F# support for Vim/Neovim
Part of the Ionide plugin suite.
-
A fork of fsharp/vim-fsharp.
-
Uses LSP-mode of FsAutoComplete as a backend.
-
Powered by autozimu/LanguageClient-neovim.
Consider this to be beta since it's lacking features compared to Ionide-VSCode and not as battle-tested as that.
That being said, we maintainers use this plugin daily so it will someday become feature-rich and stable for sure.
Feel free to request features and/or file bug reports!
-
Neovim or Vim 8.0+
- Python support is not required as of now. This may or may not change in the future.
-
- Required to run FsAutoComplete.
- Very useful for command-line development.
-
- Required to communicate with FsAutoComplete.
-
fzf (optional)
- Optional dependency of LanguageClient-neovim.
- Multi-entry selection UI.
- Syntax highlighting
- Auto completions
- Error highlighting
- Tooltips
- Go to Definition
- Find all references
- Highlighting usages
- Rename
- Show symbols in file
- Find symbol in workspace
- Show signature in status line
1. Install LanguageClient-neovim
Refer to their INSTALL.md.
Plug 'ionide/Ionide-vim', {
\ 'do': 'make fsautocomplete',
\}
call dein#add('ionide/Ionide-vim', {
\ 'build': 'make fsautocomplete',
\ })
Run install.cmd
.
Once you installed, add the following to somewhere in your .vimrc
:
let g:LanguageClient_serverCommands = {
\ 'fsharp': g:fsharp#languageserver_command
\ }
This will configure FSAC to be used from LanguageClient-neovim.
Opening either *.fs
, *.fsi
or *.fsx
files should trigger syntax highlighting and other depending runtime files as well.
Refer to LanguageClient-neovim for features provided via Language Server Protocol.
To be added as requested for F#-specific features.
- Search a workspace (
sln
orfsproj
) and then load it. - Equivalent to
FSharp.workspaceMode = sln
in Ionide-VSCode. - Automatically called when you open F# files. Can be disabled in settings.
- The deep level of directory hierarchy to search can also be configured in settings.
- Load specified projects (
sln
orfsproj
).
- Reload all the projects currently loaded.
- Automatically called when you save
.fsproj
files. Can be disabled in settings.
- Download the latest build of FsAutoComplete to be used with Ionide-vim.
Refer to LanguageClient-neovim for features provided via Language Server Protocol.
To be added as requested for F#-specific features.
let g:fsharp#automatic_workspace_init = 1 " 0 to disable.
let g:fsharp#workspace_mode_peek_deep_level = 2
let g:fsharp#automatic_reload_workspace = 1 " 0 to disable.
let g:fsharp#show_signature_on_cursor_move = 1 " 0 to disable.
If you are using neovim 0.4.0 or later, floating windows will be used for tooltips and you might find it convenient to make them appear if the cursor does not move for several seconds.
if has('nvim') && exists('*nvim_open_win')
augroup FSharpShowTooltip
autocmd!
autocmd CursorHold *.fs call fsharp#showTooltip()
augroup END
endif
Note that you can set the delay time to show the tooltip by set updatetime=<ms>
. The default delay is 4 seconds, which you may find too slow.
- The primary maintainer for this repository is @cannorin.