What is the best editor for fish scripts? I mean an editor which can properly highlight, indent and syntax check.
I found the vim-fish project, but I am still scratching my head as to how to install it locally.
You just copy all those files and directories inside the repository into ~/.vim
. However, the recommended way is to use something like vundle or pathogen
For vundle:
Run these commands:
mkdir -p ~/.vim/bundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
touch ~/.vimrc
Then add this to your ~/.vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'dag/vim-fish'
filetype plugin indent on
Next time you launch vim you can run the command :BundleInstall
to get vim-fish
installed.
If you want this to work with funced
and other potential scripts that should use the fish-syntax you can add something like this to ~/.vim/ftdetect/fish.vim
:
au BufNewFile,BufRead fish_funced set ft=fish
Alternatively I would advice you to install it via vim-plug which is quite minimalist:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Add the following code to your .vimrc
file:
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes for comment
Plug 'dag/vim-fish'
" Add plugins to &runtimepath
call plug#end()
Reload .vimrc
and :PlugInstall
to install plugins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With