This is a Vim/Neovim plugin that provides Fish syntax highlighting, automatic indentation as you type, file detection, and a colorscheme matching Fish's default shell highlighting.
The syntax highlighting is very close to how fish highlights text in an interactive shell. Try comparing type fish_prompt
and funced --editor=vim fish_prompt
(or --editor=nvim
if you use Neovim). They should be exactly the same or very similar, assuming your fish and vim colors match.
Please open an issue if you encounter differences in highlighting.
Install with vim-plug
Plug 'nickeb96/fish.vim'
It should also work with other plugin managers.
Use :colorscheme fish-default
to have the editor use the same colors that Fish uses by default. This colorscheme only works with fish files, so use a conditional autocommand in your config file to set it:
autocommand FileType fish colorscheme fish-default
You can use autocommand FileType fish set notermguicolors
to force Vim/Neovim to use the basic 16 colors that fish uses by default when editing *.fish files.
This plugin creates syntax highlighting groups that match Fish's $fish_color_*
variables. You can create a custom colorscheme by setting vim highlight groups with the same name and value:
fish> echo $fish_color_option
8abeb7
and then
" inside your custom vim colorscheme
hi fish_color_option guifg=#8abeb7
Look inside colors/fish-default.vim for more examples.
- Fix tilde being highlighted wrong in
cmd text~
- Add support for new
VAR=val command
syntax - Add support for folding and concealing
- Fix any remaining discrepancies in syntax highlighting
- Add auto-formatting support with
fish_indent
- Possibly add completion support
- Fix
<&0
not working - Fix highlighting breaking with
echo ('...')