diff options
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/debchangelog.vim | 2 | ||||
-rw-r--r-- | runtime/ftplugin/gpg.vim | 17 | ||||
-rw-r--r-- | runtime/ftplugin/modconf.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/muttrc.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/readline.vim | 18 | ||||
-rw-r--r-- | runtime/ftplugin/rst.vim | 2 | ||||
-rw-r--r-- | runtime/ftplugin/sh.vim | 13 | ||||
-rw-r--r-- | runtime/ftplugin/solidity.vim | 15 | ||||
-rw-r--r-- | runtime/ftplugin/sql.vim | 4 | ||||
-rw-r--r-- | runtime/ftplugin/sshconfig.vim | 25 | ||||
-rw-r--r-- | runtime/ftplugin/sudoers.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/systemd.vim | 53 | ||||
-rw-r--r-- | runtime/ftplugin/tidy.vim | 2 | ||||
-rw-r--r-- | runtime/ftplugin/udevrules.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/zig.vim | 2 |
15 files changed, 176 insertions, 41 deletions
diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim index 062fc054c8..dca7f7355a 100644 --- a/runtime/ftplugin/debchangelog.vim +++ b/runtime/ftplugin/debchangelog.vim @@ -122,7 +122,7 @@ function NewVersion() normal! 1G0 call search(')') normal! h - " ':normal' doens't support key annotation (<c-a>) directly. + " ':normal' doesn't support key annotation (<c-a>) directly. " Vim's manual recommends using ':exe' to use key annotation indirectly (backslash-escaping needed though). exe "normal! \<c-a>" call setline(1, substitute(getline(1), '-\$\$', '-', '')) diff --git a/runtime/ftplugin/gpg.vim b/runtime/ftplugin/gpg.vim index 3f890e58f6..9e00daed6a 100644 --- a/runtime/ftplugin/gpg.vim +++ b/runtime/ftplugin/gpg.vim @@ -15,5 +15,22 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+--' . <q-args> . '\b'' --hilite-search" man ' . 'gpg' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+--' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'gpg' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save + diff --git a/runtime/ftplugin/modconf.vim b/runtime/ftplugin/modconf.vim index c8e76b538b..09ad54b64a 100644 --- a/runtime/ftplugin/modconf.vim +++ b/runtime/ftplugin/modconf.vim @@ -16,5 +16,21 @@ let b:undo_ftplugin = "setl com< cms< inc< fo<" setlocal comments=:# commentstring=#\ %s include=^\\s*include setlocal formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'modprobe.d' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'modprobe.d' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/muttrc.vim b/runtime/ftplugin/muttrc.vim index c8ad0f2ec5..bd01367158 100644 --- a/runtime/ftplugin/muttrc.vim +++ b/runtime/ftplugin/muttrc.vim @@ -18,5 +18,21 @@ setlocal formatoptions-=t formatoptions+=croql let &l:include = '^\s*source\>' +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . 'muttrc' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'muttrc' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/readline.vim b/runtime/ftplugin/readline.vim index eba7122347..c81d0f2f65 100644 --- a/runtime/ftplugin/readline.vim +++ b/runtime/ftplugin/readline.vim @@ -25,11 +25,27 @@ if exists("loaded_matchit") && !exists("b:match_words") endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") - let b:browsefilter = "Readline Intialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" .. + let b:browsefilter = "Readline Initialization Files (inputrc .inputrc)\tinputrc;*.inputrc\n" .. \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '\b'' --hilite-search" man ' . '3 readline' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . '3 readline' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/rst.vim b/runtime/ftplugin/rst.vim index ff7a402d10..c88e8f2580 100644 --- a/runtime/ftplugin/rst.vim +++ b/runtime/ftplugin/rst.vim @@ -28,7 +28,7 @@ setlocal formatoptions+=tcroql " directives (..) and ordered lists (1.), although it can cause problems for " many other cases. " -" More sophisticated indentation rules should be revisted in the future. +" More sophisticated indentation rules should be revisited in the future. if exists("g:rst_style") && g:rst_style != 0 setlocal expandtab shiftwidth=3 softtabstop=3 tabstop=8 diff --git a/runtime/ftplugin/sh.vim b/runtime/ftplugin/sh.vim index b6fdb8f3e2..7106bf9155 100644 --- a/runtime/ftplugin/sh.vim +++ b/runtime/ftplugin/sh.vim @@ -41,6 +41,19 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif +if (exists('b:is_bash') && (b:is_bash == 1)) || + \ (exists('b:is_sh') && (b:is_sh == 1)) + if !has('gui_running') && executable('less') + command! -buffer -nargs=1 Help silent exe '!bash -c "{ help "<args>" 2>/dev/null || man "<args>"; } | LESS= less"' | redraw! + elseif has('terminal') + command! -buffer -nargs=1 Help silent exe ':term bash -c "help "<args>" 2>/dev/null || man "<args>""' + else + command! -buffer -nargs=1 Help echo system('bash -c "help <args>" 2>/dev/null || man "<args>"') + endif + setlocal keywordprg=:Help + let b:undo_ftplugin .= '| setlocal keywordprg<' +endif + " Restore the saved compatibility options. let &cpo = s:save_cpo unlet s:save_cpo diff --git a/runtime/ftplugin/solidity.vim b/runtime/ftplugin/solidity.vim new file mode 100644 index 0000000000..abe9f2ff26 --- /dev/null +++ b/runtime/ftplugin/solidity.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin file +" Language: Solidity +" Maintainer: Cothi (jiungdev@gmail.com) +" Original Author: tomlion (https://github.com/tomlion/vim-solidity) +" Last Change: 2022 Sep 27 +" 2023 Aug 22 Vim Project (did_ftplugin, undo_ftplugin) + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal commentstring<" diff --git a/runtime/ftplugin/sql.vim b/runtime/ftplugin/sql.vim index 1c02a98c7c..7a29d39f8e 100644 --- a/runtime/ftplugin/sql.vim +++ b/runtime/ftplugin/sql.vim @@ -140,7 +140,7 @@ if !exists("*SQL_SetType") \ ) " Remove duplicates, since sqlanywhere.vim can exist in the - " sytax, indent and ftplugin directory, yet we only want + " syntax, indent and ftplugin directory, yet we only want " to display the option once let index = match(sqls, '.\{-}\ze\n') while index > -1 @@ -204,7 +204,7 @@ if !exists("*SQL_SetType") endif let b:sql_type_override = new_sql_type - " Remove any cached SQL since a new sytax will have different + " Remove any cached SQL since a new syntax will have different " items and groups if !exists('g:loaded_sql_completion') || g:loaded_sql_completion >= 100 call sqlcomplete#ResetCacheSyntax() diff --git a/runtime/ftplugin/sshconfig.vim b/runtime/ftplugin/sshconfig.vim index d933ce0527..214e4928a0 100644 --- a/runtime/ftplugin/sshconfig.vim +++ b/runtime/ftplugin/sshconfig.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file -" Language: OpenSSH client configuration file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Language: OpenSSH client configuration file +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2008-07-09 if exists("b:did_ftplugin") finish @@ -11,9 +11,24 @@ let b:did_ftplugin = 1 let s:cpo_save = &cpo set cpo&vim -let b:undo_ftplugin = "setl com< cms< fo<" - setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +let b:undo_ftplugin = 'setlocal com< cms< fo<' + +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s+' . <q-args> . '$'' --hilite-search" man ' . 'ssh_config' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe 'term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s+' . <q-args> . '$', '\') . ''' --hilite-search" man ' . 'ssh_config' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/sudoers.vim b/runtime/ftplugin/sudoers.vim index 38dbf559ee..65cf2d8203 100644 --- a/runtime/ftplugin/sudoers.vim +++ b/runtime/ftplugin/sudoers.vim @@ -15,5 +15,21 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''\b' . <q-args> . '\b'' --hilite-search" man ' . 'sudoers' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('\b' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'sudoers' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/systemd.vim b/runtime/ftplugin/systemd.vim index 4c5c9a1dc1..c0bc6302f2 100644 --- a/runtime/ftplugin/systemd.vim +++ b/runtime/ftplugin/systemd.vim @@ -7,35 +7,30 @@ if !exists('b:did_ftplugin') runtime! ftplugin/dosini.vim endif -if !has('unix') - finish -endif - -if !has('gui_running') - command! -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw! -elseif has('terminal') - command! -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>) -else - finish -endif - -if !exists('*KeywordLookup_systemd') - function KeywordLookup_systemd(keyword) abort - let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') - if len(matches) > 1 - let section = matches[1] - return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman silent exe '!' . KeywordLookup_systemd(<q-args>) | redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman silent exe 'term ' . KeywordLookup_systemd(<q-args>) + endif + if exists(':Sman') == 2 + if !exists('*KeywordLookup_systemd') + function KeywordLookup_systemd(keyword) abort + let matches = matchlist(getline(search('\v^\s*\[\s*.+\s*\]\s*$', 'nbWz')), '\v^\s*\[\s*(\k+).*\]\s*$') + if len(matches) > 1 + let section = matches[1] + return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd.' . section + else + return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' + endif + endfunction + endif + setlocal iskeyword+=- + setlocal keywordprg=:Sman + if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) + let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' else - return 'LESS= MANPAGER="less --pattern=''(^|,)\s+' . a:keyword . '=$'' --hilite-search" man ' . 'systemd' + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' endif - endfunction -endif - -setlocal iskeyword+=- -setlocal keywordprg=:Sman - -if !exists('b:undo_ftplugin') || empty(b:undo_ftplugin) - let b:undo_ftplugin = 'setlocal keywordprg< iskeyword<' -else - let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif endif diff --git a/runtime/ftplugin/tidy.vim b/runtime/ftplugin/tidy.vim index 470548d83a..b81b66db4a 100644 --- a/runtime/ftplugin/tidy.vim +++ b/runtime/ftplugin/tidy.vim @@ -1,5 +1,5 @@ " Vim filetype plugin file -" Language: HMTL Tidy Configuration +" Language: HTML Tidy Configuration " Maintainer: Doug Kearns <dougkearns@gmail.com> " Last Change: 2020 Sep 4 diff --git a/runtime/ftplugin/udevrules.vim b/runtime/ftplugin/udevrules.vim index 6404f6c85e..bde9c5dfa0 100644 --- a/runtime/ftplugin/udevrules.vim +++ b/runtime/ftplugin/udevrules.vim @@ -15,5 +15,21 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +if has('unix') && executable('less') + if !has('gui_running') + command -buffer -nargs=1 Sman + \ silent exe '!' . 'LESS= MANPAGER="less --pattern=''^\s{,8}' . <q-args> . '\b'' --hilite-search" man ' . 'udev' | + \ redraw! + elseif has('terminal') + command -buffer -nargs=1 Sman + \ silent exe ':term ' . 'env LESS= MANPAGER="less --pattern=''' . escape('^\s{,8}' . <q-args> . '\b', '\') . ''' --hilite-search" man ' . 'udev' + endif + if exists(':Sman') == 2 + setlocal iskeyword+=- + setlocal keywordprg=:Sman + let b:undo_ftplugin .= '| setlocal keywordprg< iskeyword<' + endif +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/zig.vim b/runtime/ftplugin/zig.vim index e740a52849..5f453fc8d1 100644 --- a/runtime/ftplugin/zig.vim +++ b/runtime/ftplugin/zig.vim @@ -17,7 +17,7 @@ compiler zig_build " Match Zig builtin fns setlocal iskeyword+=@-@ -" Recomended code style, no tabs and 4-space indentation +" Recommended code style, no tabs and 4-space indentation setlocal expandtab setlocal tabstop=8 setlocal softtabstop=4 |