Syntax coloring using VIM and Fish-Shell

What is the best editor for fish scripts? I mean an editor that can correctly highlight, indent and syntax.

I found the vim-fish project , but I'm still scratching my head on how to install it locally.

+6
source share
2 answers

Copy all of these files and directories inside the repository into ~/.vim . However, it is recommended that you use something like vundle or pathogen

For vundle:

Run the following 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 

The next time you run vim, you can run the command :BundleInstall to install vim-fish .

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 
+14
source

As an alternative, I would advise you to install it via vim-plug , which is minimalistic:

 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 the plugins.

+1
source

Source: https://habr.com/ru/post/957925/


All Articles