diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-09-21 20:09:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-21 20:09:51 +0200 |
commit | 34cc7d8c034f2bc5b57455577051db8d72e2b87c (patch) | |
tree | de1790044f221b5cc942b47d42dff8b847fd9db3 /runtime/ftplugin | |
parent | 690c524ce6629f9ff67728541ba211f831caf0ee (diff) |
Update runtime files
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/8th.vim | 10 | ||||
-rw-r--r-- | runtime/ftplugin/c.vim | 10 | ||||
-rw-r--r-- | runtime/ftplugin/gprof.vim | 22 |
3 files changed, 26 insertions, 16 deletions
diff --git a/runtime/ftplugin/8th.vim b/runtime/ftplugin/8th.vim index 14301187d6..ad04f9ac84 100644 --- a/runtime/ftplugin/8th.vim +++ b/runtime/ftplugin/8th.vim @@ -1,9 +1,10 @@ " Vim ftplugin file " Language: 8th " Version: any -" Last Change: 2015/11/08 +" Last Change: 2021 Sep 20 +" Last Change: 2021/09/20 " Maintainer: Ron Aaron <ron@aaron-tech.com> -" URL: https://8th-dev.com/ +" URL: https://8th-dev.com/ " Filetypes: *.8th " NOTE: 8th allows any non-whitespace in a name, so you need to do: " setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 @@ -14,12 +15,13 @@ if exists("b:did_8thplugin") finish endif -" Don't load another plugin for this buffer +" Don't load another 8th plugin for this buffer let b:did_8thplugin = 1 setlocal ts=2 sts=2 sw=2 et -setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\ +setlocal com=s1:/*,mb:*,ex:*/,b:--,be:\\ setlocal fo=tcrqol setlocal matchpairs+=\::; setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 setlocal suffixesadd=.8th +let b:undo_ftplugin = "setlocal ts< sts< sw< et< com< fo< mps< isk< sua<" diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 70e54b303a..b6aed9cb04 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Feb 01 +" Last Change: 2021 Sep 21 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -40,8 +40,11 @@ endif " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments properly. -let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' -let b:match_skip = 's:comment\|string\|character\|special' +if !exists("b:match_words") + let b:match_words = '^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' + let b:match_skip = 's:comment\|string\|character\|special' + let b:undo_ftplugin ..= " | unlet! b:match_skip b:match_words" +endif " Win32 can filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") @@ -62,6 +65,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") \ "C++ Source Files (*.cpp *.c++)\t*.cpp;*.c++\n" . \ "All Files (*.*)\t*.*\n" endif + let b:undo_ftplugin ..= " | unlet! b:browsefilter" endif let &cpo = s:cpo_save diff --git a/runtime/ftplugin/gprof.vim b/runtime/ftplugin/gprof.vim index d4547ae9a6..d8974bcc84 100644 --- a/runtime/ftplugin/gprof.vim +++ b/runtime/ftplugin/gprof.vim @@ -1,6 +1,7 @@ -" Language: gprof -" Maintainer: Dominique Pelle <dominique.pelle@gmail.com> -" Last Change: 2021 Apr 08 +" Language: gprof +" Maintainer: Dominique Pelle <dominique.pelle@gmail.com> +" Contributors: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2021 Sep 19 " When cursor is on one line of the gprof call graph, " calling this function jumps to this function in the call graph. @@ -9,7 +10,7 @@ if exists("b:did_ftplugin") endif let b:did_ftplugin=1 -fun! <SID>GprofJumpToFunctionIndex() +func! <SID>GprofJumpToFunctionIndex() let l:line = getline('.') if l:line =~ '[\d\+\]$' " We're in a line in the call graph. @@ -22,11 +23,14 @@ fun! <SID>GprofJumpToFunctionIndex() call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.') . '\>', 'sW') norm! zz endif -endfun +endfunc -" Pressing <C-]> on a line in the gprof flat profile or in -" the call graph, jumps to the corresponding function inside -" the flat profile. -map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR> +if !exists("no_plugin_maps") && !exists("no_gprof_maps") + " Pressing <C-]> on a line in the gprof flat profile or in + " the call graph, jumps to the corresponding function inside + " the flat profile. + map <buffer> <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR> + let b:undo_ftplugin = "silent! unmap <buffer> <C-]>" +endif " vim:sw=2 fdm=indent |