Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax coloring with Vim and Fish-Shell

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.

like image 237
Olivier Refalo Avatar asked Nov 12 '13 15:11

Olivier Refalo


2 Answers

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
like image 101
terje Avatar answered Sep 19 '22 12:09

terje


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.

like image 32
Martin Delille Avatar answered Sep 20 '22 12:09

Martin Delille