vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

fish.vim (1174B)


      1 " Vim filetype plugin file
      2 " Language:     fish
      3 " Maintainer:   Nicholas Boyle (github.com/nickeb96)
      4 " Repository:   https://github.com/nickeb96/fish.vim
      5 " Last Change:  February 1, 2023
      6 "               2023 Aug 28 by Vim Project (undo_ftplugin)
      7 "               2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')
      8 "               2026 Mar 16 by Phạm Bình An (add matchit support)
      9 
     10 if exists("b:did_ftplugin")
     11     finish
     12 endif
     13 
     14 let s:saved_cpo = &cpo
     15 set cpo-=C
     16 
     17 let b:did_ftplugin = 1
     18 
     19 setlocal iskeyword=@,48-57,_,192-255,-,.
     20 setlocal comments=:#
     21 setlocal commentstring=#\ %s
     22 setlocal formatoptions+=crjq
     23 
     24 let b:undo_ftplugin = "setl cms< com< fo< isk<"
     25 
     26 " Define patterns for the matchit plugin
     27 if exists("loaded_matchit") && !exists("b:match_words")
     28   let b:match_words =
     29       \ '\<\%(else\s\+\)\@<!if\>\|\<\%(switch\|begin\|function\|while\|for\)\>:' ..
     30       \ '\<else\%(\s\+if\)\?\>\|\<case\>:' ..
     31       \ '\<end\>'
     32 
     33   let b:match_ignorecase = 0
     34   let b:match_skip = "S:keyword"
     35 
     36   let b:undo_ftplugin ..= " | unlet! b:match_words b:match_ignorecase b:match_skip"
     37 endif
     38 
     39 " Restore 'cpo' to its original value
     40 let &cpo = s:saved_cpo
     41 unlet s:saved_cpo