Skip to content
F# Vim plugin based on FsAutoComplete and LSP protocol
Vim script F# Makefile Other
Branch: master
Clone or download
Latest commit 4019d1f Jul 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autoload Add fsharp#showTooltip Jul 18, 2019
doc Update docs Feb 8, 2017
ftdetect Rewrite for LSP Jul 13, 2019
ftplugin Add g:fsharp#workspace_mode_peek_deep_level Jul 16, 2019
indent Add modified indent file taken from fsharp-vim Nov 5, 2016
syntax add local setting: regexpengine=1 Jun 8, 2018
.gitignore Adjust README for Ionide Jul 14, 2019
LICENSE.md Create LICENSE.md Oct 6, 2016
Makefile
README.mkd Update README.mkd Jul 18, 2019
install.cmd Fix install.sh for *nix #7 May 26, 2015
install.fsx Rewrite for LSP Jul 13, 2019
install.sh Fix install.sh for *nix #7 May 26, 2015
paket.bootstrapper.exe Update paket.bootstrapper.exe May 24, 2015
paket.dependencies
paket.lock Switch to paket #7 May 23, 2015

README.mkd

Ionide-Vim

F# support for Vim/Neovim

Part of the Ionide plugin suite.

About Ionide-Vim

Development Status

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!

Requirements

  • Neovim or Vim 8.0+

    • Python support is not required as of now. This may or may not change in the future.
  • .NET Core SDK

    • Required to run FsAutoComplete.
    • Very useful for command-line development.
  • LanguageClient-neovim

    • Required to communicate with FsAutoComplete.
  • fzf (optional)

    • Optional dependency of LanguageClient-neovim.
    • Multi-entry selection UI.

Features

  • 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

Getting Started

1. Install LanguageClient-neovim

Refer to their INSTALL.md.

2. Install Ionide-vim

Installing with your plugin manager

vim-plug
Plug 'ionide/Ionide-vim', {
      \ 'do':  'make fsautocomplete',
      \}
dein.vim
call dein#add('ionide/Ionide-vim', {
    \ 'build': 'make fsautocomplete',
    \ })

Installing on Windows

Run install.cmd.

3. Setting up the language client

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.

Usage

Opening either *.fs, *.fsi or *.fsx files should trigger syntax highlighting and other depending runtime files as well.

Commands

Refer to LanguageClient-neovim for features provided via Language Server Protocol.

To be added as requested for F#-specific features.

:FSharpLoadWorkspaceAuto

  • Search a workspace (sln or fsproj) 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.

:FSharpParseProject <files>+

  • Load specified projects (sln or fsproj).

:FSharpReloadWorkspace

  • Reload all the projects currently loaded.
  • Automatically called when you save .fsproj files. Can be disabled in settings.

Settings

Refer to LanguageClient-neovim for features provided via Language Server Protocol.

To be added as requested for F#-specific features.

Enable/disable automatic calling of :FSharpLoadWorkspaceAuto on opening F# files (default: 1)

let g:fsharp#automatic_workspace_init = 1 " 0 to disable.

Set the deep level of directory hierarchy when searching for sln/fsprojs (default: 2)

let g:fsharp#workspace_mode_peek_deep_level = 2

Enable/disable automatic calling of :FSharpReloadWorkspace on saving fsproj (default: 1)

let g:fsharp#automatic_reload_workspace = 1 " 0 to disable.

Show type signature at cursor position (default: 1)

let g:fsharp#show_signature_on_cursor_move = 1 " 0 to disable.

Advanced Tips

Show tooltips on CursorHold

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.

Maintainers

  • The primary maintainer for this repository is @cannorin.
You can’t perform that action at this time.