Fish shell syntax hilighting for vim.
Go to file
Khaveesh N (MBP) bd6b832f33
formatprg
2022-01-06 12:00:10 +05:30
autoload Cleanup 2021-09-28 20:38:55 +05:30
ftdetect Cleanup 2021-09-28 20:38:55 +05:30
ftplugin formatprg 2022-01-06 12:00:10 +05:30
syntax Revamped syntax 2021-03-15 03:33:58 +05:30
LICENSE Initial commit 2020-08-22 00:10:33 +05:30
README.md Cleanup 2021-09-28 20:38:55 +05:30

vim-fish-syntax

Syntax and ftplugin files for fish shell scripts

Installation

I recommend the native packages support built into Vim8 and NeoVim, but you can use any plugin manager you like.

Features aplenty

  • Syntax highlighting and filetype detection, of course.
  • Code formatting with fish_indent.
  • Fold expressions for automatic folding.
  • Omni-complete from fish using the ^X^O command.
  • Comment strings & matchit patterns.

For everything above to work you need to have fish installed in $PATH and some Vim features turned on. First, tell Vim to use the syntax and filetype functionality, normally in your ~/.vimrc:

syntax enable
filetype plugin indent on

The above commands are required only for Vim and not for NeoVim.

Teach a Vim to fish...

Vim needs a more POSIX compatible shell than fish for certain functionality to work, such as :%!, compressed help pages and many third-party addons. If you use fish as your login shell or launch Vim from fish, you need to set shell to something else in your vimrc, for example:

if &shell =~# 'fish$'
    set shell=sh
endif

Best do it somewhere at the top, before any addon code is loaded and executed.