Client Configurations
fish-lsp works with any LSP-compatible editor. In almost every client the
configuration boils down to translating one shell command for fish files:
- command →
fish-lsp - arguments →
start - filetype →
fish
Important
Editors like VSCode/VSCodium install and wire up the server automatically via their extension — no client configuration required. A server configuration can still be applied.
All Clients
Pre-Built Examples
The fish-lsp-language-clients
repo has ready-to-use, testable configs:
Neovim (native LSP, >= 0.8)
vim.api.nvim_create_autocmd('FileType', {
pattern = 'fish',
callback = function()
vim.lsp.start({
name = 'fish-lsp',
cmd = { 'fish-lsp', 'start' },
})
end,
})
Or use nvim-lspconfig:
require('lspconfig').fish_lsp.setup({})
mason.nvim
:MasonInstall fish-lsp
coc.nvim
Minimal coc-settings.json:
{
"languageserver": {
"fish-lsp": {
"command": "fish-lsp",
"filetypes": ["fish"],
"args": ["start"]
}
}
}
nvf
vim.languages.fish.lsp = {
enable = true;
servers = ["fish-lsp"];
};
YouCompleteMe
let g:ycm_language_server =
\ [
\ {
\ 'name': 'fish',
\ 'cmdline': [ 'fish-lsp', 'start' ],
\ 'filetypes': [ 'fish' ],
\ }
\ ]
vim-lsp
if executable('fish-lsp')
au User lsp_setup call lsp#register_server({
\ 'name': 'fish-lsp',
\ 'cmd': {server_info->['fish-lsp', 'start']},
\ 'allowlist': ['fish'],
\ })
endif
Helix
In ~/.config/helix/languages.toml:
[[language]]
name = "fish"
language-servers = [ "fish-lsp" ]
[language-server.fish-lsp]
command = "fish-lsp"
args = ["start"]
## (Optional)
# environment = { "fish_lsp_show_client_popups" = "false" }
Kakoune
For kakoune-lsp, in ~/.config/kak-lsp/kak-lsp.toml:
[language.fish]
filetypes = ["fish"]
command = "fish-lsp"
args = ["start"]
Kate
{
"servers": {
"fish": {
"command": ["fish-lsp", "start"],
"url": "https://github.com/ndonfris/fish-lsp",
"highlightingModeRegex": "^fish$"
}
}
}
Emacs
Using eglot (built into Emacs 29+):
(require 'eglot)
(add-to-list 'eglot-server-programs
'(fish-mode . ("fish-lsp" "start")))
(add-hook 'fish-mode-hook 'eglot-ensure)
Using lsp-mode:
(require 'lsp-mode)
(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection '("fish-lsp" "start"))
:activation-fn (lsp-activate-on "fish")
:server-id 'fish-lsp))
(add-hook 'fish-mode-hook #'lsp)
BBEdit
Follow the bbedit branch instructions
Important
Includes a Fish.plist for syntax highlighting.
VSCode or VSCodium
Install the extension and the server works out-of-the-box:
Note
The extension includes its own copy of fish-lsp, so you don't need to install it separately.
However, if you want to use a custom version of fish-lsp, this can be configured in the extension settings.
Zed
See zed-fish-lsp
IntelliJ
See jetbrains-fish
Testing in Isolation
# 1. Clone an example config under a separate Neovim appname
git clone https://github.com/ndonfris/fish-lsp-language-clients \
-b coc_example ~/.config/nvim-fish-lsp
# 2. Aliases in config.fish
alias nvimfish 'NVIM_APPNAME=nvim-fish-lsp nvim'
alias nff 'nvimfish ~/.config/fish/config.fish'
# 3. Launch
nff
# or
nvimfish ~/.config/fish/config.fish
Tip
Missing a client? Open a PR with your configuration.