diff options
32 files changed, 479 insertions, 134 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 970cc942dc..02d6986289 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -31,6 +31,7 @@ runtime/compiler/dartdevc.vim @dkearns runtime/compiler/dartdoc.vim @dkearns runtime/compiler/dartfmt.vim @dkearns runtime/compiler/eruby.vim @dkearns +runtime/compiler/fbc.vim @dkearns runtime/compiler/gawk.vim @dkearns runtime/compiler/gjs.vim @dkearns runtime/compiler/haml.vim @tpope @@ -66,12 +67,14 @@ runtime/doc/pi_tar.txt @cecamp runtime/doc/pi_vimball.txt @cecamp runtime/doc/pi_zip.txt @cecamp runtime/ftplugin/awk.vim @dkearns +runtime/ftplugin/basic.vim @dkearns runtime/ftplugin/bst.vim @tpope runtime/ftplugin/cfg.vim @chrisbra runtime/ftplugin/css.vim @dkearns runtime/ftplugin/cucumber.vim @tpope runtime/ftplugin/eiffel.vim @dkearns runtime/ftplugin/eruby.vim @tpope @dkearns +runtime/ftplugin/freebasic.vim @dkearns runtime/ftplugin/git.vim @tpope runtime/ftplugin/gitcommit.vim @tpope runtime/ftplugin/gitconfig.vim @tpope @@ -93,6 +96,7 @@ runtime/ftplugin/ruby.vim @tpope @dkearns runtime/ftplugin/sass.vim @tpope runtime/ftplugin/scss.vim @tpope runtime/ftplugin/spec.vim @ignatenkobrain +runtime/ftplugin/tidy.vim @dkearns runtime/ftplugin/tmux.vim @ericpruitt runtime/ftplugin/typescript.vim @dkearns runtime/ftplugin/typescriptreact.vim @dkearns @@ -127,6 +131,7 @@ runtime/syntax/amiga.vim @cecamp runtime/syntax/asm.vim @dkearns runtime/syntax/asmh8300.vim @dkearns runtime/syntax/awk.vim @dkearns +runtime/syntax/basic.vim @dkearns runtime/syntax/bst.vim @tpope runtime/syntax/cabal.vim @coot runtime/syntax/cabalconfig.vim @coot diff --git a/runtime/compiler/fbc.vim b/runtime/compiler/fbc.vim new file mode 100644 index 0000000000..1c29392da8 --- /dev/null +++ b/runtime/compiler/fbc.vim @@ -0,0 +1,27 @@ +" Vim compiler file +" Compiler: FreeBASIC Compiler +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2015 Jan 10 + +if exists("current_compiler") + finish +endif +let current_compiler = "fbc" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=fbc +CompilerSet errorformat=%-G%.%#Too\ many\ errors\\,\ exiting, + \%f(%l)\ %tarning\ %n(%\\d%\\+):\ %m, + \%E%f(%l)\ error\ %n:\ %m, + \%-Z%p^, + \%-C%.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/tidy.vim b/runtime/compiler/tidy.vim index 75be8b83d9..3f8e68ebf2 100644 --- a/runtime/compiler/tidy.vim +++ b/runtime/compiler/tidy.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: HTML Tidy " Maintainer: Doug Kearns <dougkearns@gmail.com> -" Last Change: 2016 Apr 21 +" Last Change: 2020 Sep 4 if exists("current_compiler") finish @@ -12,8 +12,15 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal command -nargs=* CompilerSet setlocal <args> endif -CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes\ %:S +let s:cpo_save = &cpo +set cpo&vim -" foo.html:8:1: Warning: inserting missing 'foobar' element -" foo.html:9:2: Error: <foobar> is not recognized! -CompilerSet errorformat=%f:%l:%c:\ %trror:%m,%f:%l:%c:\ %tarning:%m,%-G%.%# +CompilerSet makeprg=tidy\ -quiet\ -errors\ --gnu-emacs\ yes +CompilerSet errorformat=%f:%l:%c:\ %trror:\ %m, + \%f:%l:%c:\ %tarning:\ %m, + \%f:%l:%c:\ %tnfo:\ %m, + \%f:%l:%c:\ %m, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index bf425dda51..7db3ffc41f 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 8.2. Last change: 2020 Nov 21 +*change.txt* For Vim version 8.2. Last change: 2021 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1631,24 +1631,31 @@ default setting is "tcq". You can separate the option letters with commas for readability. letter meaning when present in 'formatoptions' ~ - + *fo-t* t Auto-wrap text using textwidth + *fo-c* c Auto-wrap comments using textwidth, inserting the current comment leader automatically. + *fo-r* r Automatically insert the current comment leader after hitting <Enter> in Insert mode. + *fo-o* o Automatically insert the current comment leader after hitting 'o' or 'O' in Normal mode. + *fo-q* q Allow formatting of comments with "gq". Note that formatting will not change blank lines or lines containing only the comment leader. A new paragraph starts after such a line, or when the comment leader changes. + *fo-w* w Trailing white space indicates a paragraph continues in the next line. A line that ends in a non-white character ends a paragraph. + *fo-a* a Automatic formatting of paragraphs. Every time text is inserted or deleted the paragraph will be reformatted. See |auto-format|. When the 'c' flag is present this only happens for recognized comments. + *fo-n* n When formatting text, recognize numbered lists. This actually uses the 'formatlistpat' option, thus any kind of list can be used. The indent of the text after the number is used for the next line. The @@ -1659,6 +1666,7 @@ n When formatting text, recognize numbered lists. This actually uses 1. the first item wraps 2. the second item +< *fo-2* 2 When formatting text, use the indent of the second line of a paragraph for the rest of the paragraph, instead of the indent of the first line. This supports paragraphs in which the first line has a @@ -1668,36 +1676,46 @@ n When formatting text, recognize numbered lists. This actually uses second line of the same paragraph third line. < This also works inside comments, ignoring the comment leader. + *fo-v* v Vi-compatible auto-wrapping in insert mode: Only break a line at a blank that you have entered during the current insert command. (Note: this is not 100% Vi compatible. Vi has some "unexpected features" or bugs in this area. It uses the screen column instead of the line column.) + *fo-b* b Like 'v', but only auto-wrap if you enter a blank at or before the wrap margin. If the line was longer than 'textwidth' when you started the insert, or you do not enter a blank in the insert before reaching 'textwidth', Vim does not perform auto-wrapping. + *fo-l* l Long lines are not broken in insert mode: When a line was longer than 'textwidth' when the insert command started, Vim does not automatically format it. + *fo-m* m Also break at a multibyte character above 255. This is useful for Asian text where every character is a word on its own. + *fo-M* M When joining lines, don't insert a space before or after a multibyte character. Overrules the 'B' flag. + *fo-B* B When joining lines, don't insert a space between two multibyte characters. Overruled by the 'M' flag. + *fo-1* 1 Don't break a line after a one-letter word. It's broken before it instead (if possible). + *fo-]* ] Respect textwidth rigorously. With this flag set, no line can be longer than textwidth, unless line-break-prohibition rules make this impossible. Mainly for CJK scripts and works only if 'encoding' is "utf-8". + *fo-j* j Where it makes sense, remove a comment leader when joining lines. For example, joining: int i; // the index ~ // in the list ~ Becomes: int i; // the index in the list ~ + *fo-p* p Don't break lines at single spaces that follow periods. This is intended to complement 'joinspaces' and |cpo-J|, for prose with sentences separated by two spaces. For example, with 'textwidth' set diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index dd5bc939d3..edf5fc8cc3 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2021 Jan 21 +*eval.txt* For Vim version 8.2. Last change: 2021 Jan 22 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2085,7 +2085,7 @@ v:null An empty String. Used to put "null" in JSON. See *v:numbermax* *numbermax-variable* v:numbermax Maximum value of a number. - *v:numbermix* *numbermix-variable* + *v:numbermin* *numbermin-variable* v:numbermin Minimum value of a number (negative) *v:numbersize* *numbersize-variable* diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index d3a4bde8b0..6a23b2fdb8 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 8.2. Last change: 2020 Sep 28 +*filetype.txt* For Vim version 8.2. Last change: 2021 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt index 005b57f0d0..6d70cecd54 100644 --- a/runtime/doc/popup.txt +++ b/runtime/doc/popup.txt @@ -1,4 +1,4 @@ -*popup.txt* For Vim version 8.2. Last change: 2020 Nov 07 +*popup.txt* For Vim version 8.2. Last change: 2021 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index a2a12b0cf0..6a94980671 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 8.2. Last change: 2020 Dec 17 +*syntax.txt* For Vim version 8.2. Last change: 2021 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/tags b/runtime/doc/tags index 24cdded5aa..83ccca299e 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6431,7 +6431,26 @@ fname_new-variable eval.txt /*fname_new-variable* fname_out-variable eval.txt /*fname_out-variable* fnameescape() eval.txt /*fnameescape()* fnamemodify() eval.txt /*fnamemodify()* +fo-1 change.txt /*fo-1* +fo-2 change.txt /*fo-2* +fo-B change.txt /*fo-B* +fo-M change.txt /*fo-M* +fo-] change.txt /*fo-]* +fo-a change.txt /*fo-a* +fo-b change.txt /*fo-b* +fo-c change.txt /*fo-c* +fo-j change.txt /*fo-j* +fo-l change.txt /*fo-l* +fo-m change.txt /*fo-m* +fo-n change.txt /*fo-n* +fo-o change.txt /*fo-o* +fo-p change.txt /*fo-p* +fo-q change.txt /*fo-q* +fo-r change.txt /*fo-r* +fo-t change.txt /*fo-t* fo-table change.txt /*fo-table* +fo-v change.txt /*fo-v* +fo-w change.txt /*fo-w* fold-behavior fold.txt /*fold-behavior* fold-colors fold.txt /*fold-colors* fold-commands fold.txt /*fold-commands* @@ -8271,6 +8290,8 @@ null vim9.txt /*null* null-variable eval.txt /*null-variable* number_relativenumber options.txt /*number_relativenumber* numbered-function eval.txt /*numbered-function* +numbermax-variable eval.txt /*numbermax-variable* +numbermin-variable eval.txt /*numbermin-variable* numbersize-variable eval.txt /*numbersize-variable* o insert.txt /*o* o_CTRL-V motion.txt /*o_CTRL-V* @@ -9847,6 +9868,8 @@ v:mouse_win eval.txt /*v:mouse_win* v:mouse_winid eval.txt /*v:mouse_winid* v:none eval.txt /*v:none* v:null eval.txt /*v:null* +v:numbermax eval.txt /*v:numbermax* +v:numbermin eval.txt /*v:numbermin* v:numbersize eval.txt /*v:numbersize* v:oldfiles eval.txt /*v:oldfiles* v:operator eval.txt /*v:operator* @@ -10089,6 +10112,7 @@ vim8 version8.txt /*vim8* vim9 vim9.txt /*vim9* vim9-classes vim9.txt /*vim9-classes* vim9-const vim9.txt /*vim9-const* +vim9-curly vim9.txt /*vim9-curly* vim9-declaration vim9.txt /*vim9-declaration* vim9-declarations usr_46.txt /*vim9-declarations* vim9-differences vim9.txt /*vim9-differences* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 75133f78bc..efff0929d7 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.2. Last change: 2021 Jan 17 +*todo.txt* For Vim version 8.2. Last change: 2021 Jan 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -41,6 +41,7 @@ browser use: https://github.com/vim/vim/issues/1234 test_autocmd failure in Windows: Something wrong with system()? Vim9 - Make everything work: +- Add a test for profiling with nested function calls and lambda. - Expand `=expr` in :next, :argedit, :argadd, :argdelete, :drop - Expand `=expr` in :vimgrep, :vimgrepadd, :lvimgrep, :lvimgrepadd - Expand `=expr` in :mkspell @@ -50,7 +51,7 @@ Vim9 - Make everything work: - Using a script variable inside a :def function doesn't work if the variable is inside a block, see Test_nested_function(). Should it work? - give error for variable name: - let p = function('NoSuchFunc') + var p = function('NoSuchFunc') - Make closures work better: - Create closure in a loop. Need to make a list of them. - If a :def function is called with a function reference, compile it to get @@ -58,20 +59,16 @@ Vim9 - Make everything work: def Filter(x: string, Cond: func(string): bool) Filter(x, (v) => v =~ '^b') - Make inline function work, to be used as a funcref: - let Ref = (arg: type): type => { + var Ref = (arg: type): type => { statement return expr } - let Ref = (arg: type) => { + var Ref = (arg: type) => { statement statement } -- Does this work already: can use func as reference: - def SomeFunc() ... - map(list, SomeFunc) - For builtin functions using tv_get_string*() use check_for_string() to be more strict about the argument type. -- Possible memory leaks in test_vim9_func - Implement :lockvar and :unlockvar. How about local variables? Perhaps only allow this for global variables. Use :final or :const otherwise. - Allow function names that will be script-local to start with lower case @@ -86,10 +83,10 @@ Vim9 - Make everything work: - Need the equivalent of get_lval() and set_var_lval() to implement assignment to nested list and dict members. - Assignment to dict doesn't work: - let ret: dict<string> = #{} + var ret: dict<string> = #{} ret[i] = string(i) - Appending to dict item doesn't work: - let d[i] ..= value + var d[i] ..= value - Using ".." at script level doesn't convert arguments to a string. - Compile replacement of :s command: s/pat/\=expr/ - Compile redir to local variable: var_redir_start(). @@ -144,7 +141,6 @@ Also for Vim9: - Make debugging work - at least per function. Need to recompile a function to step through it line-by-line? Evaluate the stack and variables on the stack? -- Make profiling work - Add ISN_PROFILE instructions after every line? - List commands when 'verbose' is set or :verbose is used. Further Vim9 improvements, possibly after launch: @@ -187,6 +183,10 @@ Popup windows: - Figure out the size and position better if wrapping inserts indent Text properties: +- Popup attached to text property stays visible when text is no longer + visible. (#7736) +- Popup attached to text property stays visible when text is deleted with + "cc". (#7737) "C" works OK. - :goto does not go to the right place when text properties are present. (#5930) - "cc" does not call inserted_bytes(). (Axel Forsman, #5763) @@ -282,7 +282,7 @@ Patch to implement the vimtutor with a plugin: #6414 Was originally written by Felipe Morales. Adding "10" to 'spellsuggest' causes spell suggestions to become very slow. -(#4087) +(#4087) Did patch 8.2.2379 help? Patch to find Python dll using registry key. (#7540) diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 0fb29e4946..89ef4bb71e 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 8.2. Last change: 2020 Aug 15 +*vi_diff.txt* For Vim version 8.2. Last change: 2021 Jan 21 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt index 93c3ddd2f9..7246ff87a6 100644 --- a/runtime/doc/vim9.txt +++ b/runtime/doc/vim9.txt @@ -1,4 +1,4 @@ -*vim9.txt* For Vim version 8.2. Last change: 2021 Jan 15 +*vim9.txt* For Vim version 8.2. Last change: 2021 Jan 23 VIM REFERENCE MANUAL by Bram Moolenaar @@ -403,10 +403,16 @@ Additionally, a lambda can contain statements in {}: > } NOT IMPLEMENTED YET + *vim9-curly* To avoid the "{" of a dictionary literal to be recognized as a statement block wrap it in parenthesis: > var Lambda = (arg) => ({key: 42}) +Also when confused with the start of a command block: > + ({ + key: value + })->method() + Automatic line continuation ~ @@ -841,6 +847,9 @@ prefix and they do not need to exist (they can be deleted any time). Note that for command line completion of {func} you can prepend "s:" to find script-local functions. +:disa[ssemble]! {func} Like `:disassemble` but with the instructions used for + profiling. + Limitations ~ Local variables will not be visible to string evaluation. For example: > diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 897ac80ebc..e4910e3719 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2020 Dec 24 +" Last Change: 2021 Jan 21 " Listen very carefully, I will say this only once if exists("did_load_filetypes") diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim index 0809e7b206..a0621e1d13 100644 --- a/runtime/ftplugin/ada.vim +++ b/runtime/ftplugin/ada.vim @@ -159,40 +159,41 @@ if exists("g:ada_abbrev") endif " Section: Commands, Mapping, Menus {{{1 -" -call ada#Map_Popup ( - \ 'Tag.List', - \ 'l', - \ 'call ada#List_Tag ()') -call ada#Map_Popup ( - \'Tag.Jump', - \'j', - \'call ada#Jump_Tag ()') -call ada#Map_Menu ( - \'Tag.Create File', - \':AdaTagFile', - \'call ada#Create_Tags (''file'')') -call ada#Map_Menu ( - \'Tag.Create Dir', - \':AdaTagDir', - \'call ada#Create_Tags (''dir'')') - -call ada#Map_Menu ( - \'Highlight.Toggle Space Errors', - \ ':AdaSpaces', - \'call ada#Switch_Syntax_Option (''space_errors'')') -call ada#Map_Menu ( - \'Highlight.Toggle Lines Errors', - \ ':AdaLines', - \'call ada#Switch_Syntax_Option (''line_errors'')') -call ada#Map_Menu ( - \'Highlight.Toggle Rainbow Color', - \ ':AdaRainbow', - \'call ada#Switch_Syntax_Option (''rainbow_color'')') -call ada#Map_Menu ( - \'Highlight.Toggle Standard Types', - \ ':AdaTypes', - \'call ada#Switch_Syntax_Option (''standard_types'')') +if !exists(':AdaTagFile') + call ada#Map_Popup ( + \ 'Tag.List', + \ 'l', + \ 'call ada#List_Tag ()') + call ada#Map_Popup ( + \'Tag.Jump', + \'j', + \'call ada#Jump_Tag ()') + call ada#Map_Menu ( + \'Tag.Create File', + \':AdaTagFile', + \'call ada#Create_Tags (''file'')') + call ada#Map_Menu ( + \'Tag.Create Dir', + \':AdaTagDir', + \'call ada#Create_Tags (''dir'')') + + call ada#Map_Menu ( + \'Highlight.Toggle Space Errors', + \ ':AdaSpaces', + \'call ada#Switch_Syntax_Option (''space_errors'')') + call ada#Map_Menu ( + \'Highlight.Toggle Lines Errors', + \ ':AdaLines', + \'call ada#Switch_Syntax_Option (''line_errors'')') + call ada#Map_Menu ( + \'Highlight.Toggle Rainbow Color', + \ ':AdaRainbow', + \'call ada#Switch_Syntax_Option (''rainbow_color'')') + call ada#Map_Menu ( + \'Highlight.Toggle Standard Types', + \ ':AdaTypes', + \'call ada#Switch_Syntax_Option (''standard_types'')') +endif " 1}}} " Reset cpoptions diff --git a/runtime/ftplugin/basic.vim b/runtime/ftplugin/basic.vim new file mode 100644 index 0000000000..c6ec254dfc --- /dev/null +++ b/runtime/ftplugin/basic.vim @@ -0,0 +1,27 @@ +" Vim filetype plugin file +" Language: BASIC +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2015 Jan 10 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:REM,:' +setlocal commentstring='\ %s +setlocal formatoptions-=t formatoptions+=croql + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "BASIC Source Files (*.bas)\t*.bas\n" . + \ "All Files (*.*)\t*.*\n" +endif + +let b:undo_ftplugin = "setl fo< com< cms< sua<" . + \ " | unlet! b:browsefilter" + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/bzl.vim b/runtime/ftplugin/bzl.vim index 0296b0c0b8..8ab876e9d6 100644 --- a/runtime/ftplugin/bzl.vim +++ b/runtime/ftplugin/bzl.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Bazel (http://bazel.io) " Maintainer: David Barnett (https://github.com/google/vim-ft-bzl) -" Last Change: 2015 Aug 11 +" Last Change: 2021 Jan 19 "" " @section Introduction, intro @@ -51,6 +51,8 @@ if get(g:, 'ft_bzl_fold', 0) endif if exists('*BzlFoldText') + let &cpo = s:save_cpo + unlet s:save_cpo finish endif diff --git a/runtime/ftplugin/framescript.vim b/runtime/ftplugin/framescript.vim index 48fe0ace7c..66802cad0d 100644 --- a/runtime/ftplugin/framescript.vim +++ b/runtime/ftplugin/framescript.vim @@ -3,14 +3,14 @@ " Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Latest Revision: 2008-07-19 -let s:cpo_save = &cpo -set cpo&vim - if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 +let s:cpo_save = &cpo +set cpo&vim + let b:undo_ftplugin = "setl com< cms< fo< inc< | unlet! b:matchwords" setlocal comments=s1:/*,mb:*,ex:*/,:// commentstring=/*\ %s\ */ diff --git a/runtime/ftplugin/freebasic.vim b/runtime/ftplugin/freebasic.vim new file mode 100644 index 0000000000..a2bb459f20 --- /dev/null +++ b/runtime/ftplugin/freebasic.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin file +" Language: FreeBasic +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2015 Jan 10 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +runtime! ftplugin/basic.vim + +" vim: ts=8 diff --git a/runtime/ftplugin/hamster.vim b/runtime/ftplugin/hamster.vim index 6c0630fe04..5446e72286 100644 --- a/runtime/ftplugin/hamster.vim +++ b/runtime/ftplugin/hamster.vim @@ -2,7 +2,7 @@ " Language: Hamster Script " Version: 2.0.6.0 " Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> -" Last Change: 2017 Mar 18 +" Last Change: 2021 Jan 19 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -57,6 +57,9 @@ if exists("loaded_matchit") endif setlocal ignorecase + let &cpo = s:cpo_save unlet s:cpo_save -setlocal cpo+=M " makes \%( match \) + +" Disabled, 'cpo' is a global option. +" setlocal cpo+=M " makes \%( match \) diff --git a/runtime/ftplugin/ocaml.vim b/runtime/ftplugin/ocaml.vim index 793b887afc..8a628604fa 100644 --- a/runtime/ftplugin/ocaml.vim +++ b/runtime/ftplugin/ocaml.vim @@ -159,6 +159,8 @@ let b:undo_ftplugin = "setlocal efm< foldmethod< foldexpr<" " - Only definitions below, executed once ------------------------------------- if exists("*OMLetFoldLevel") + let &cpoptions = s:cposet + unlet s:cposet finish endif @@ -635,7 +637,7 @@ endfunction nnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("normal")<CR> xnoremap <silent> <Plug>OCamlPrintType :<C-U>call Ocaml_print_type("visual")<CR>`< -let &cpoptions=s:cposet +let &cpoptions = s:cposet unlet s:cposet " vim:sw=2 fdm=indent diff --git a/runtime/ftplugin/tidy.vim b/runtime/ftplugin/tidy.vim new file mode 100644 index 0000000000..470548d83a --- /dev/null +++ b/runtime/ftplugin/tidy.vim @@ -0,0 +1,32 @@ +" Vim filetype plugin file +" Language: HMTL Tidy Configuration +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2020 Sep 4 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:#,:// +setlocal commentstring=#\ %s +setlocal formatoptions-=t formatoptions+=croql + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "HTML Tidy Files (tidyrc, .tidyrc, tidy.conf)\ttidyrc;.tidyrc;tidy.conf\n" . + \ "HTML Files (*.html, *.htm)\t*.html;*.htm\n" . + \ "XHTML Files (*.xhtml, *.xhtm)\t*.xhtml;*.xhtm\n" . + \ "XML Files (*.xml)\t*.xml\n" . + \ "All Files (*.*)\t*.*\n" +endif + +let b:undo_ftplugin = "setl fo< com< cms<" . + \ " | unlet! b:browsefilter" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim index 6adadbda94..d39ad9579b 100644 --- a/runtime/ftplugin/vim.vim +++ b/runtime/ftplugin/vim.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: Vim " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2021 Jan 12 +" Last Change: 2021 Jan 23 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -88,8 +88,13 @@ endif " Let the matchit plugin know what items can be matched. if exists("loaded_matchit") let b:match_ignorecase = 0 + " "func" can also be used as a type: + " var Ref: func + " or to list functions: + " func name + " require a parenthesis following, then there can be an "endfunc". let b:match_words = - \ '\<\%(fu\%[nction]\|def\)\>)\@!:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' . + \ '\<\%(fu\%[nction]\|def\)\s\+\S\+(:\<retu\%[rn]\>:\<\%(endf\%[unction]\|enddef\)\>,' . \ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' . \ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' . \ '{:},' . diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim index 696320288d..26ed33a54d 100644 --- a/runtime/indent/fortran.vim +++ b/runtime/indent/fortran.vim @@ -74,11 +74,15 @@ endif if (b:fortran_fixed_source == 1) setlocal indentexpr=FortranGetFixedIndent() if exists("*FortranGetFixedIndent") + let &cpoptions = s:cposet + unlet s:cposet finish endif else setlocal indentexpr=FortranGetFreeIndent() if exists("*FortranGetFreeIndent") + let &cpoptions = s:cposet + unlet s:cposet finish endif endif @@ -213,7 +217,7 @@ function FortranGetFixedIndent() return ind endfunction -let &cpoptions=s:cposet +let &cpoptions = s:cposet unlet s:cposet " vim:sw=2 tw=130 diff --git a/runtime/indent/testdir/vim.in b/runtime/indent/testdir/vim.in index 47e692975f..f652dbda79 100644 --- a/runtime/indent/testdir/vim.in +++ b/runtime/indent/testdir/vim.in @@ -10,6 +10,11 @@ let cmd = \ 'some ' \ 'string' +if 1 |