{"id":13496600,"url":"https://github.com/ionide/Ionide-vim","last_synced_at":"2025-03-28T19:30:39.365Z","repository":{"id":40589337,"uuid":"196748504","full_name":"ionide/Ionide-vim","owner":"ionide","description":"F# Vim plugin based on FsAutoComplete and LSP protocol ","archived":false,"fork":false,"pushed_at":"2024-05-21T05:59:43.000Z","size":353,"stargazers_count":159,"open_issues_count":12,"forks_count":20,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-05-22T15:27:30.748Z","etag":null,"topics":["fsharp","ionide","vim","vim-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ionide.png","metadata":{"files":{"readme":"README.mkd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"ionide"}},"created_at":"2019-07-13T17:26:56.000Z","updated_at":"2024-05-28T13:40:30.024Z","dependencies_parsed_at":"2023-02-14T12:15:39.098Z","dependency_job_id":"fe9e086b-3d52-46b1-91fc-06f0bddea2e1","html_url":"https://github.com/ionide/Ionide-vim","commit_stats":{"total_commits":242,"total_committers":45,"mean_commits":5.377777777777778,"dds":0.6942148760330579,"last_synced_commit":"00099c3cf53cba28a1d8084ab8d21639c62bd747"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionide%2FIonide-vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionide%2FIonide-vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionide%2FIonide-vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ionide%2FIonide-vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ionide","download_url":"https://codeload.github.com/ionide/Ionide-vim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554792,"owners_count":20471289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fsharp","ionide","vim","vim-plugin"],"created_at":"2024-07-31T19:01:52.630Z","updated_at":"2025-03-28T19:30:39.334Z","avatar_url":"https://github.com/ionide.png","language":"Vim Script","readme":"# Ionide-Vim\n\n**F# support for Vim/Neovim**\n\n![ionide-vim](https://i.imgur.com/3RLcJw6.gif)\n\n_Part of the [Ionide](http://ionide.io) plugin suite._\n\n## About Ionide-Vim\n\n* A fork of [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp).\n\n* Uses LSP-mode of [FsAutoComplete](https://github.com/fsharp/FsAutoComplete) as a backend.\n\n* Uses one of the following LSP clients:\n  - Neovim's built-in LSP client (requires Neovim 0.5+)\n  - [autozimu/LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim).\n\n## Development Status\n\nConsider this to be beta since it's lacking features compared to Ionide-VSCode and not as battle-tested as that.\n\nThat being said, we maintainers use this plugin daily so it will someday become feature-rich and stable for sure.\n\nFeel free to [request features and/or file bug reports](https://github.com/ionide/Ionide-vim/issues)!\n\n## Requirements\n\n* Neovim or Vim 8+\n\n* [.NET Core SDK](https://dotnet.microsoft.com/download)\n  - Required to install and run FsAutoComplete.\n  - Very useful for command-line development.\n\n* If you are using Vim or Neovim below version 0.5:\n  * [autozimu/LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim)\n    - Required to communicate with FsAutoComplete.\n  * [junegunn/fzf](https://github.com/junegunn/fzf) (optional)\n    - Optional dependency of LanguageClient-neovim.\n    - Multi-entry selection UI.\n\n## Features\n\n- Syntax highlighting\n- Auto completions\n- Error highlighting, error list, and quick fixes based on errors\n- Tooltips\n- Codelens\n- Go to Definition\n- Find all references\n- Highlighting usages\n- Rename\n- Show symbols in file\n- Find symbol in workspace\n- Show signature in status line\n- Integration with F# Interactive\n- Integration with [FSharpLint](https://github.com/fsprojects/FSharpLint) (additional hints and quick fixes)\n- Integration with [Fantomas](https://github.com/fsprojects/fantomas/) (the best formatter available for F#)\n\n## Getting Started\n\n### Install FsAutoComplete\n\nInstall FsAutoComplete with `dotnet tool install`.\n\nIf you want to install it as a \"global\" tool, run `dotnet tool install -g fsautocomplete`.\n\nIf you want to install it as a project-local tool, run `dotnet tool install fsautocomplete`\nat the root directory of your F# project, and configure `g:fsharp#fsautocomplete_command`\nas explained [here](#set-the-path-to-fsac).\n\n### Install a LSP Client\n\n#### For Neovim 0.5+\n\nNo LSP client plugin is required.\n\nIf you are using [neovim/nvim-lspconfig](https://github.com/neovim/nvim-lspconfig), do *not* enable `fsautocomplete`.\nIonide-vim automatically integrates itself into nvim-lspconfig and will register itself as a server.\n\n#### For Vim / Neovim (below 0.5)\n\nInstall [LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim). Refer to [their INSTALL.md](https://github.com/autozimu/LanguageClient-neovim/blob/next/INSTALL.md).\n\nHere is the example for [vim-plug](https://github.com/junegunn/vim-plug) package manager.\n\n~~~.vim\nPlug 'autozimu/LanguageClient-neovim', {\n    \\ 'branch': 'next',\n    \\ 'do': 'bash install.sh',\n    \\ }\n~~~\n\nIf you are running Windows, you will have to set the value of `do` to `'powershell -ExecutionPolicy Unrestricted .\\install.ps1'`.\n\n### Install an autocompletion plugin\n\nWe recommend using [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp), but the setup is a bit complicated.\nSee [the example](https://github.com/ionide/Ionide-vim/wiki/Configuration-Examples#with-nvim-lspconfig-and-nvim-cmp-for-neovim-05) in our wiki for how to setup nvim-cmp to be used with Ionide-vim.\n\n[Shougo/deoplete.nvim](https://github.com/Shougo/deoplete.nvim) is an easier alternative, but they say its development is complete and it won't get some features such as heredoc.\n\n~~~.vim\n\" if you use nvim \u003e 0.5:\nPlug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }\nPlug 'deoplete-plugins/deoplete-lsp'\n\n\" otherwise:\nPlug 'Shougo/deoplete.nvim'\nPlug 'roxma/nvim-yarp'\nPlug 'roxma/vim-hug-neovim-rpc'\n\n\" also set this in both cases.\nlet g:deoplete#enable_at_startup = 1\n~~~\n\n### Install Ionide-vim\n\n#### [vim-plug](https://github.com/junegunn/vim-plug)\n\n~~~.vim\nPlug 'ionide/Ionide-vim'\n~~~\n\n#### [dein.vim](https://github.com/Shougo/dein.vim)\n\n~~~.vim\ncall dein#add('ionide/Ionide-vim')\n~~~\n\n#### Installing manually\n\nClone Ionide-vim to some runtimepath.\n\n## Usage\n\nOpening either `*.fs`, `*.fsi` or `*.fsx` files should trigger syntax highlighting and other depending runtime files as well.\n\n### LSP features (such as go-to-definition or rename)\n\nIonide-vim only handles F# specific features of FsAutoComplete, and any other generic features such as \"go to definition\" and\n\"rename\" are provided by either Neovim or autozimu/LanguageClient-neovim.\n\nYou should set your key bindings for those features on your own, so please refer to their documentation.\n[The examples in our wiki](https://github.com/ionide/Ionide-vim/wiki/Configuration-Examples#with-nvim-lspconfig-and-nvim-cmp-for-neovim-05)\nalso contains an example bindings for both Neovim and LanguageClient-neovim.\n\n### Commands\n\nTo be added as requested for F#-specific features.\n\n#### `:FSharpShowLoadedProjects`\n  - Shows the projects currently loaded.\n\n#### `:FSharpParseProject \u003cfiles\u003e+`\n  - Loads specified projects (`sln` or `fsproj`).\n\n#### `:FSharpReloadWorkspace`\n  - Reloads all the projects currently loaded.\n  - Automatically called when you save `.fsproj` files. Can be disabled in settings.\n\n#### `:FSharpUpdateServerConfig`\n  - Updates FSAC configuration.\n  - See [FsAutoComplete Settings](#fsautocomplete-settings) for details.\n\n### Working with F# Interactive\n\nIonide-vim has an integration with F# Interactive.\n\nFSI is displayed using the builtin `:terminal` feature introduced in Vim 8 / Neovim and can be used like in VSCode.\n\n#### `:FsiShow`\n  - Shows a F# Interactive window.\n\n#### `:FsiEval \u003cexpr\u003e`\n  - Evaluates given expression in FSI.\n\n#### `:FsiEvalBuffer`\n  - Sends the content of current file to FSI.\n\n#### `:FsiReset`\n  - Resets the current FSI session.\n\n#### `Alt-Enter`\n  - When in normal mode, sends the current line to FSI.\n  - When in visual mode, sends the selection to FSI.\n  - Sending code to FSI opens FSI window but the cursor does not focus to it. Unlike Neovim, Vim doesn't support asynchronous buffer updating so you have to input something (e.g. moving cursor) to see the result. You can change this behavior in settings.\n\n#### `Alt-@`\n  - Toggles FSI window. FSI windows shown in different tabpages share the same FSI session.\n  - When opened, the cursor automatically focuses to the FSI window (unlike in `Alt-Enter` by default).\n\nYou can customize the location of FSI, key mappings, etc. See [the documentation below](#f-interactive-settings).\n\n### Settings\n\nTo be added as requested for F#-specific features.\n\nSee some examples in [our wiki](https://github.com/ionide/Ionide-vim/wiki/Configuration-Examples) if you're not sure what you would want to set.\n\n#### LSP Client Settings\n\n##### Set the LSP client used by Ionide-vim\n\nSet `g:fsharp#backend` to\n* `nvim` if you want to use neovim's built-in LSP client.\n* `languageclient-neovim` if you want to use [autozimu/LanguageClient-neovim](https://github.com/autozimu/LanguageClient-neovim).\n* `disable` if you only want the syntax highlighting and the FSI integration.\n\n*Default:* `nvim` if you are using Neovim 0.5+, `languageclient-neovim` otherwise.\n\n~~~.vim\nlet g:fsharp#backend = \"languageclient-neovim\"\n~~~\n\n##### Set the path to FSAC\n\n*Default:* `['fsautocomplete', '--background-service-enabled']`\n\nThis option overrides the path to the FSAC Ionide-vim uses.\n\nBy default, Ionide-vim uses the FSAC installed globally with `dotnet tool install`.\n\nFor example, if you want to use a project-local FSAC, set the following:\n\n~~~.vim\nlet g:fsharp#fsautocomplete_command =\n    \\ [ 'dotnet',\n    \\   'fsautocomplete',\n    \\   '--background-service-enabled'\n    \\ ]\n~~~\n\nNote: You have to use an array here. Setting a string value to this option will result in an error.\n\n##### Set the keybindings for LSP features\n\n*Default:* not set\n\nIonide-vim does *not* provide default keybindings for various LSP features, so you will have to set them yourself.\n\n* If you are using neovim's built-in LSP client, see [here](https://github.com/neovim/nvim-lspconfig#keybindings-and-completion).\n* If you are using LanguageClient-neovim, refer to [their docs](https://github.com/autozimu/LanguageClient-neovim/blob/next/doc/LanguageClient.txt).\n\nExamples are available at [our wiki](https://github.com/ionide/Ionide-vim/wiki/Configuration-Examples).\n\n#### Settings specific to neovim's built-in LSP client\n\n##### Enable/disable the default colorscheme for diagnostics\n\n*Default:* enabled\n\nNeovim's LSP client comes with no default colorscheme, so Ionide-vim sets a VSCode-like one for LSP diagnostics by default.\nYou can disable this by the following:\n\n~~~.vim\nlet g:fsharp#lsp_recommended_colorscheme = 0\n~~~\n\n##### Enable/disable automatic setup\n\n*Default:* enabled\n\nWith [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig), you would manually call the `setup` function for each LSP servers.\nIonide-vim does this automatically by default, but you can disable it.\n\n~~~.vim\nlet g:fsharp#lsp_auto_setup = 0\n\nlua \u003c\u003c EOF\nrequire'ionide'.setup{}\nEOF\n~~~\n\n##### Enable/disable automatic refreshing CodeLens\n\n*Default:* enabled\n\nBy default, Ionide-vim sets the following so that CodeLens gets refreshed automatically.\n\n~~~.vim\naugroup FSharp_AutoRefreshCodeLens\n    autocmd!\n    autocmd CursorHold,InsertLeave \u003cbuffer\u003e lua vim.lsp.codelens.refresh()\naugroup END\n~~~\n\nYou can disable this by setting the below option:\n\n~~~.vim\nlet g:fsharp#lsp_codelens = 0\n~~~\n\n**Note: this setting does not affect LanguageClient-neovim's CodeLens feature.**\nPlease see [their docs](https://github.com/autozimu/LanguageClient-neovim/blob/next/doc/LanguageClient.txt) for how to configure it.\n\n#### FsAutoComplete Settings\n\n* Ionide-vim uses `snake_case` for the setting names.\n  - For FSAC settings only, `CamelCase` can also be used (as it gets serialized to a F# record).\n  - If both `snake_case` and `CamelCase` are specified, the `snake_case` one will be preferred.\n* You can change the values at runtime and then notify the changes to FSAC by `:FSharpUpdateServerConfig`.\n* Some of the settings may not work in Ionide-vim as it is lacking the corresponding feature of Ionide-VSCode.\n* If not specified, the recommended default values described in the FSAC's documentation will be used.\n  - You can disable this by `let g:fsharp#use_recommended_server_config = 0`.\n\nSee [the documentation of FSAC](https://github.com/fsharp/FsAutoComplete#settings)\nfor the complete list of available settings. Frequently used ones are:\n\n##### Enable/disable automatic loading of the workspace on opening F# files\n\n*Default:* enabled\n\n~~~.vim\nlet g:fsharp#automatic_workspace_init = 1 \" 0 to disable.\n~~~\n\n##### Set the deep level of directory hierarchy when searching for sln/fsprojs\n\n*Default:* `2`\n\n~~~.vim\nlet g:fsharp#workspace_mode_peek_deep_level = 2\n~~~\n\n##### Ignore specific directories when loading a workspace\n\n*Default:* empty\n\n~~~.vim\nlet g:fsharp#exclude_project_directories = ['paket-files']\n~~~\n\n##### Enable/disable linter and unused opens/declarations analyzer\n\n*Default:* all enabled\n\nYou may want to bind `LanguageClient#textDocument_codeAction()` to some shortcut key. Refer to their docs.\n\n~~~.vim\n\" 0 to disable.\nlet g:fsharp#linter = 1\nlet g:fsharp#unused_opens_analyzer = 1\nlet g:fsharp#unused_declarations_analyzer = 1\n~~~\n\n#### Editor Settings\n\n##### Enable/disable automatic calling of `:FSharpReloadWorkspace` on saving `fsproj`\n\n*Default:* enabled\n\n~~~.vim\nlet g:fsharp#automatic_reload_workspace = 1 \" 0 to disable.\n~~~\n\n##### Show type signature at cursor position\n\n*Default:* disabled\n\n~~~.vim\nlet g:fsharp#show_signature_on_cursor_move = 0 \" 1 to enable.\n~~~\n\n\u003e Note: this feature is known to be causing issues in some circumstances (#57, #58).\n\u003e So this feature is now disabled by default.\n\n#### F# Interactive Settings\n\n##### Change the F# Interactive command to be used within Ionide-vim\n\n*Default:* `dotnet fsi`\n\nIf you want to use a .NET Framework FSI instead of .NET Core one, set `g:fsharp#use_sdk_scripts` to `0`.\nSee: https://github.com/fsharp/FsAutoComplete/pull/466#issue-324869672\n\n~~~.vim\nlet g:fsharp#fsi_command = \"fsharpi\"\nlet g:fsharp#use_sdk_scripts = 0 \" for net462 FSI\n~~~\n\n##### Set additional runtime arguments passed to FSI\n\n*Default:* `--readline-`\n\nSets additional arguments of the FSI instance Ionide-vim spawns and changes the behavior of FSAC accordingly when editing fsx files.\nFSAC passes parameters on to the compiler for static analysis of script files.\nNot all parameters are shared between the compiler and interpreter, so FSAC splits these into\n1. `FSIExtraInteractiveParameters`: specifically for use with the interpreter process\n2. `FSIExtraSharedParameters`: those parameters which should be passed both to the interactive interpreter *and* the compiler\n\nIonide-vim will pass all options from both of these parameters to the interpreter launched by `fsharp#fsi_command`\n\n~~~.vim\nlet g:fsharp#fsi_extra_interactive_parameters = ['--readline-']\nlet g:fsharp#fsi_extra_shared_parameters = ['--langversion:preview']\n~~~\n\nThere is a legacy option that is still supported by Ionide-vim and FSAC, `FSIExtraParameters`, that will be deprecated upstream in the future.\nThis is a single option that combines the functionality of both mentioned above.\nUsing interactive-only parameters in this option yields compiler errors.\n[See more discussion in the issue for FSAC](https://github.com/Ionide/fsautocomplete/issues/1210).\n\nIt is recommended to migrate configuration to the new parameters.\nIf you are currently using `FSIExtraParameters`, simply copying the options to `FSIExtraSharedParameters` will preserve all current behavior.\n\nUnti\n\n##### Customize how FSI window is opened\n\n*Default:* `botright 10new`\n\nIt must create a new empty window and then focus to it.\n\nSee [`:help opening-window`](http://vimdoc.sourceforge.net/htmldoc/windows.html#opening-window) for details.\n\n~~~.vim\nlet g:fsharp#fsi_window_command = \"botright vnew\"\n~~~\n\n##### Set if sending line/selection to FSI shoule make the cursor focus to FSI window\n\n*Default:* disabled\n\nIf you are using Vim, you might want to enable this to see the result without inputting something.\n\n~~~.vim\nlet g:fsharp#fsi_focus_on_send = 1 \" 0 to not to focus.\n~~~\n\n##### Change the key mappings\n\n*Default:* `vscode`\n\n* `vscode`:     Default. Same as in Ionide-VSCode (`Alt-Enter` to send, `Alt-@` to toggle terminal).\n  - `\u003cM-CR\u003e` in Neovim / `\u003cESC\u003e\u003cCR\u003e` in Vim: Sends line/selection to FSI.\n  - `\u003cM-@\u003e`  in Neovim / `\u003cESC\u003e@`    in Vim: Toggles FSI window.\n* `vim-fsharp`: Same as in [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp#fsharp-interactive). Note that `\u003cleader\u003e` is mapped to backslash by default. See [`:help mapleader`](http://vimdoc.sourceforge.net/htmldoc/map.html#mapleader).\n  - `\u003cleader\u003ei` : Sends line/selecion to FSI.\n  - `\u003cleader\u003ee` : Toggles FSI window.\n* `custom`:     You must set both `g:fsharp#fsi_keymap_send` and `g:fsharp#fsi_keymap_toggle` by yourself.\n  - `g:fsharp#fsi_keymap_send`   : Sends line/selection to FSI.\n  - `g:fsharp#fsi_keymap_toggle` : Toggles FSI window.\n* `none`:       Disables mapping.\n\n~~~.vim\n\" custom mapping example\nlet g:fsharp#fsi_keymap = \"custom\"\nlet g:fsharp#fsi_keymap_send   = \"\u003cC-e\u003e\"\nlet g:fsharp#fsi_keymap_toggle = \"\u003cC-@\u003e\"\n~~~\n\n#### Linter \u0026 Formatter Settings\n\nLinting (other than the basic ones described above) and formatting is powered by independent tools, [FSharpLint](https://github.com/fsprojects/FSharpLint) and [Fantomas](https://github.com/fsprojects/fantomas/) respectively.\n\nBoth uses their own JSON file for configuration and Ionide-vim does not control them. See their docs about configuration: [FSharpLint](http://fsprojects.github.io/FSharpLint/#Configuration-Files) and [Fantomas](https://github.com/fsprojects/fantomas/blob/master/docs/Documentation.md#--config-path-to-file-or-folder).\n\n### Advanced Tips\n\n#### Show tooltips on CursorHold\n\nIf 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.\n\n~~~.vim\nif has('nvim') \u0026\u0026 exists('*nvim_open_win')\n  augroup FSharpShowTooltip\n    autocmd!\n    autocmd CursorHold *.fs,*.fsi,*.fsx call fsharp#showTooltip()\n  augroup END\nendif\n~~~\n\nNote that you can set the delay time to show the tooltip by [`set updatetime=\u003cms\u003e`](http://vimdoc.sourceforge.net/htmldoc/options.html#'updatetime'). The default delay is 4 seconds, which you may find too slow.\n\n## Maintainers\n\n* The primary maintainer for this repository is [@cannorin](http://github.com/cannorin).\n\n","funding_links":["https://opencollective.com/ionide"],"categories":["Vim Script","Vim script"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionide%2FIonide-vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fionide%2FIonide-vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fionide%2FIonide-vim/lists"}