F# on Emacs with Spacemacs
While F# is first-class citizen in Visual Studio, there’s also support for text editors:
- via fsharp/fsharpbinding for Emacs, Vim, and Sublime Text
- via Krzysztof-Cieslak/FSharp.Atom for Atom
Beyond Visual Studio
In my experience so far, getting F# to work outside Visual Studio requires quite an effort.
There are always a couple of steps to be done, and basic knowledge of the target text editor is also assumed.
A flexible, easy way, with Spacemacs
I learned Spacemacs in a tweet by Chris Bowdon. Spacemacs is essentially an Emacs configuration.
Open a Git Bash command prompt window:
# Backup any existing Emacs configuration. mv ~/AppData/Roaming/.emacs.d ~/AppData/Roaming/.emacs.bak # Clone Spacemacs in place of the old Emacs configuration. git clone --recursive http://github.com/syl20bnr/spacemacs ~/AppData/Roaming/.emacs.d
Then, launch Emacs and Spacemacs will automatically load, installing all required packages. After that, Emacs must be restarted.
After opening Emacs, it should show
~/.spacemacs under Recent files. – Click on that file to open it.
Add F# as shown in the following diff-output:
diff --git a/.spacemacs b/.spacemacs index d6cedae..a47936c 100644 --- a/.spacemacs +++ b/.spacemacs @@ -23,6 +23,7 @@ ;; markdown ;; org ;; syntax-checking + fsharp ) ;; A list of packages and/or extensions that will not be install and loaded. dotspacemacs-excluded-packages '()
Then hit CTRL+C & CTRL+C, and the Spacemacs layer for F# will install itself.
The F# projects shown in the above screenshots are Qaiain and DiamondFsCheck.