Skip to content

Instantly share code, notes, and snippets.

@kubaPod
Created June 21, 2022 07:09
Show Gist options
  • Save kubaPod/8d84b82cb75b786e9159bea64f474194 to your computer and use it in GitHub Desktop.
Save kubaPod/8d84b82cb75b786e9159bea64f474194 to your computer and use it in GitHub Desktop.
My personal configuration for a fresh Mathematica installation. Run it step by step in case our preferences differ.
(* ::Package:: *)
(* ::Section:: *)
(*Preferences*)
CurrentValue[$FrontEnd,"NotebooksMenuHistoryLength"]=25
(* ::Subsection:: *)
(*Events*)
SetOptions[
$FrontEnd
, NotebookEventActions :> {
{"MenuCommand", "New"} :> CreateNotebook["Default"]
} (* to create a notebook with a fixed size instead of inheritting size from the current one. *)
]
(* ::Subsection:: *)
(*Notebook Interface*)
CurrentValue[$FrontEnd, {TranslationOptions,"Enabled"}] = False;
CurrentValue[$FrontEnd, Language] ="English";
If[
$VersionNumber >= 11.3
, CurrentValue[$FrontEnd, {StyleHints, "GroupOpener"}] = "OutsideFrame"
, CurrentValue[$FrontEnd, ShowGroupOpener] = True
];
CurrentValue[$FrontEnd, ShowPredictiveInterface] = False;
CurrentValue[$FrontEnd, ShowAutoSpellCheck] = False;
CurrentValue[$FrontEnd, {CodeAssistOptions, "AutoConvertEnable"}]=False;
(* ::Text:: *)
(*- Enable blinking cell insertion point -> False*)
(*the main reason is the make comments pink and strings orange*)
SetOptions[$FrontEnd
, AutoStyleOptions->{
"CommentStyle"->{
FontColor -> RGBColor[1., 0., 1.]
, ShowAutoStyles -> False
, ShowSyntaxStyles -> False
, AutoNumberFormatting -> False
, TranslationOptions -> {"Enabled" -> False}
, FontWeight -> "Normal"
}
, "StringStyle"->{
FontColor -> RGBColor[1., 0.5019607843137255, 0.25098039215686274`]
, ShowAutoStyles -> False
, ShowSyntaxStyles -> False
, AutoNumberFormatting -> False
, TranslationOptions -> {"Enabled" -> False}
}
}
]
(* ::Subsection:: *)
(*Messages*)
SetOptions[$FrontEnd,MessageOptions->{
"AllowDisablingWarnings" -> True
, "CodeCaptionWarning" -> True
, "CompatibilityToolWarning" -> True
, "ConsoleMessageAction" -> "PrintToConsole"
, "ErrorAction" -> "PrintToConsole"
, "ExplainBeepHelp" -> False
, "IgnoreTagBoxDeletionWarning" -> True
, "InsufficientVersionWarning" -> True
, "KernelMessageAction" -> "PrintToConsole"
, "MathMLPasteWarning" -> True
, "MaxMessageCount" -> 3
, "MessageCountResetTime" -> "2.`"
, "TeXPasteWarning" -> True
, "TraditionalFormEvaluationWarning" -> True
, "UseVersionedStylesheetWarning" -> True
, "WarningAction" -> "Beep"
}]
CurrentValue[$FrontEnd, PrintAction] = "PrintToConsole"
(* ::Section:: *)
(*System Settings*)
$HistoryLength = 0
SetOptions[
$FrontEnd
, NotebookSecurityOptions->{"TrustByDefault"->True,"UntrustedPath"->{}}
]
(* ::Section:: *)
(*Packages*)
Get@"http://www.mertig.com/shortcuts.m"
(* ::Text:: *)
(*after installing, go to Ctrl+Shift+J and add SelectionMove[SelectedNotebook[], All,Cell], save and done.*)
(*Now Ctrl+t selects current cell.*)
<<Shortcuts`
<<GeneralUtilities`
Import["https://raw.githubusercontent.com/kubapod/mpm/master/install.m"]
Needs @ "MPM`"
MPM`MPMInstall["kubapod", "devtools"]
Needs@"DevTools`"
CodeTemplatesEnable[];
NotebookActionsEnable[];
CurrentValue[
$FrontEnd, "DefaultPackageStyleDefinitions"
] = FrontEnd`FileName[{"DevTools", "DevPackageDark.nb"}]
(* ::Section:: *)
(*Autoload / init.m*)
FilePrint@FindFile @ "init.m"
PutAppend[
Unevaluated @ Needs["GeneralUtilities`"]
, FindFile @ "init.m"
]
(* ::Section:: *)
(*LinkSnooper*)
EvaluatorNames->{
"Local" -> {"AutoStartOnLaunch" -> True},
"LinkSnooper" -> {
"AutoStartOnLaunch" -> False, "MLOpenArguments" ->
"-LinkMode Launch -LinkName {oq}`javaw` -classpath {iq}`jlinkjar`{iq} \
com.wolfram.jlink.util.LinkSnooper -noinit -kernelname \
{iq}`mathkernel`{iq}{oq}"}}
(* ::Section:: *)
(*IDE*)
(* ::Text:: *)
(*Go get IntelliJ IDEA community edition and go to http://wlplugin.halirutan.de/index.php/downloads to learn how to install Halirutans plugin*)
(**)
(*rigth click on .nb file and associate file type with external editor.*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment