codekingpro/portable-devtools
114k
1" Vim filetype plugin2" Language: Hamster Script3" Version: 2.0.6.04" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>5" Last Change: 2021 Jan 196" 2024 May 23 by Riley Bruins <ribru17@gmail.com> ('commentstring')7" 2025 Sep 05 by Vim Project, disable setting global ignorecase8 9" Only do this when not done yet for this buffer10if exists("b:did_ftplugin")11 finish12endif13 14" Don't load another plugin for this buffer15let b:did_ftplugin = 116 17let s:cpo_save = &cpo18set cpo&vim19 20let b:undo_ftplugin = "setl fo< com< tw< commentstring<"21 \ . "| unlet! b:match_ignorecase b:match_words b:match_skip"22 23" Set 'formatoptions' to break comment lines but not other lines,24" and insert the comment leader when hitting <CR> or using "o".25setlocal fo-=t fo+=croql26 27" Use the # sign for comments28setlocal comments=:#29 30" Format comments to be up to 78 characters long31if &tw == 032 setlocal tw=7833endif34 35" Comments start with a double quote36setlocal commentstring=#\ %s37 38" Move around functions.39noremap <silent><buffer> [[ :call search('^\s*sub\>', "bW")<CR>40noremap <silent><buffer> ]] :call search('^\s*sub\>', "W")<CR>41noremap <silent><buffer> [] :call search('^\s*endsub\>', "bW")<CR>42noremap <silent><buffer> ][ :call search('^\s*endsub\>', "W")<CR>43 44" Move around comments45noremap <silent><buffer> ]# :call search('^\s*#\@!', "W")<CR>46noremap <silent><buffer> [# :call search('^\s*#\@!', "bW")<CR>47 48" Let the matchit plugin know what items can be matched.49if exists("loaded_matchit")50 let b:match_ignorecase = 051 let b:match_words =52 \ '\<sub\>:\<return\>:\<endsub\>,' .53 \ '\<do\|while\|repeat\|for\>:\<break\>:\<continue\>:\<loop\|endwhile\|until\|endfor\>,' .54 \ '\<if\>:\<else\%[if]\>:\<endif\>' 55 56 " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif57 " let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||58 " \ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'59endif60 61" setlocal ignorecase62 63let &cpo = s:cpo_save64unlet s:cpo_save65 66" Disabled, 'cpo' is a global option.67" setlocal cpo+=M " makes \%( match \)68 