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.
:FSharpLoadWorkspaceAuto
sln
or fsproj
) and then load it.FSharp.workspaceMode = sln
in Ionide-VSCode.:FSharpParseProject <files>+
sln
or fsproj
).:FSharpReloadWorkspace
.fsproj
files. Can be disabled in settings.:FSharpUpdateServerConfig
:FSharpUpdateFSAC
Ionide-vim has an integration with F# Interactive.
FSI is displayed using the builtin :terminal
feature introduced in Vim 8 / Neovim and can be used like in VSCode.
:FsiShow
:FsiEval <expr>
:FsiEvalBuffer
:FsiReset
Alt-Enter
Alt-@
Alt-Enter
by default).You can customize the location of FSI, key mappings, etc. See the documentation below.
Refer to LanguageClient-neovim's recommended settings for features provided via Language Server Protocol.
To be added as requested for F#-specific features.
snake_case
for the setting names.
CamelCase
can also be used (as it gets serialized to a F# record).snake_case
and CamelCase
are specified, the snake_case
one will be preferred.:FSharpUpdateServerConfig
.g:LanguageClient_settingsPath
, the recommended default values will override the settings loaded from it.let g:fsharp#use_recommended_server_config = 0
.See the documentation of FSAC for the complete list of available settings. Frequently used ones are:
:FSharpLoadWorkspaceAuto
on opening F# files (default: enabled)let g:fsharp#automatic_workspace_init = 1 " 0 to disable.
2
)let g:fsharp#workspace_mode_peek_deep_level = 2
let g:fsharp#exclude_project_directories = ['paket-files']
You may want to bind LanguageClient#textDocument_codeAction()
to some shortcut key. Refer to their docs.
" 0 to disable.
let g:fsharp#linter = 1
let g:fsharp#unused_opens_analyzer = 1
let g:fsharp#unused_declarations_analyzer = 1
:FSharpReloadWorkspace
on saving fsproj
(default: enabled)let g:fsharp#automatic_reload_workspace = 1 " 0 to disable.
let g:fsharp#show_signature_on_cursor_move = 1 " 0 to disable.
dotnet fsi
)If you want to use a .NET Framework FSI instead of .NET Core one, set g:fsharp#use_sdk_scripts
to 0
.
See: https://github.com/fsharp/FsAutoComplete/pull/466#issue-324869672
let g:fsharp#fsi_command = "fsharpi"
let g:fsharp#use_sdk_scripts = 0 " for net462 FSI
[]
(empty))Sets additional arguments of the FSI instance Ionide-vim spawns and changes the behavior of FSAC accordingly when editing fsx files.
let g:fsharp#fsi_extra_parameters = ['--langversion:preview']
botright 10new
)It must create a new empty window and then focus to it.
See :help opening-window
for details.
let g:fsharp#fsi_window_command = "botright vnew"
If you are using Vim, you might want to enable this to see the result without inputting something.
let g:fsharp#fsi_focus_on_send = 1 " 0 to not to focus.
vscode
)vscode
: Default. Same as in Ionide-VSCode (Alt-Enter
to send, Alt-@
to toggle terminal).
<M-CR>
in Neovim / <ESC><CR>
in Vim: Sends line/selection to FSI.<M-@>
in Neovim / <ESC>@
in Vim: Toggles FSI window.vim-fsharp
: Same as in fsharp/vim-fsharp. Note that <leader>
is mapped to backslash by default. See :help mapleader
.
<leader>i
: Sends line/selecion to FSI.<leader>e
: Toggles FSI window.custom
: You must set both g:fsharp#fsi_keymap_send
and g:fsharp#fsi_keymap_toggle
by yourself.
g:fsharp#fsi_keymap_send
: Sends line/selection to FSI.g:fsharp#fsi_keymap_toggle
: Toggles FSI window.none
: Disables mapping." custom mapping example
let g:fsharp#fsi_keymap = "custom"
let g:fsharp#fsi_keymap_send = "<C-e>"
let g:fsharp#fsi_keymap_toggle = "<C-@>"
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,*.fsi,*.fsx 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.