diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-10-17 08:19:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-17 08:19:48 +0200 |
commit | 9701c9dc9f157c4d09d1783aab9913d05b0d73b1 (patch) | |
tree | dd9b7d788960d5a481e14fb720235f456e691636 /runtime/ftplugin | |
parent | d44f088834081ee404db4459fdcfba82d14ef157 (diff) | |
download | rneovim-9701c9dc9f157c4d09d1783aab9913d05b0d73b1.tar.gz rneovim-9701c9dc9f157c4d09d1783aab9913d05b0d73b1.tar.bz2 rneovim-9701c9dc9f157c4d09d1783aab9913d05b0d73b1.zip |
vim-patch:3c053a1a5ad2 (#20679)
Update runtime files
https://github.com/vim/vim/commit/3c053a1a5ad2a3c924929e11f2b9af20a8b901e2
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/abaqus.vim | 43 | ||||
-rw-r--r-- | runtime/ftplugin/lua.vim | 7 | ||||
-rw-r--r-- | runtime/ftplugin/markdown.vim | 36 | ||||
-rw-r--r-- | runtime/ftplugin/poefilter.vim | 13 | ||||
-rw-r--r-- | runtime/ftplugin/ssa.vim | 13 |
5 files changed, 89 insertions, 23 deletions
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim index 3faeff621a..5931cd921d 100644 --- a/runtime/ftplugin/abaqus.vim +++ b/runtime/ftplugin/abaqus.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Abaqus finite element input file (www.abaqus.com) " Maintainer: Carl Osterwisch <costerwi@gmail.com> -" Last Change: 2022 Aug 03 +" Last Change: 2022 Oct 08 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") | finish | endif @@ -66,25 +66,44 @@ if exists("loaded_matchit") && !exists("b:match_words") endif if !exists("no_plugin_maps") && !exists("no_abaqus_maps") - " Define keys used to move [count] keywords backward or forward. - noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR> - noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR> + " Map [[ and ]] keys to move [count] keywords backward or forward + nnoremap <silent><buffer> ]] :call <SID>Abaqus_NextKeyword(1)<CR> + nnoremap <silent><buffer> [[ :call <SID>Abaqus_NextKeyword(-1)<CR> + function! <SID>Abaqus_NextKeyword(direction) + .mark ' + if a:direction < 0 + let flags = 'b' + else + let flags = '' + endif + let l:count = abs(a:direction) * v:count1 + while l:count > 0 && search("^\\*\\a", flags) + let l:count -= 1 + endwhile + endfunction - " Define key to toggle commenting of the current line or range + " Map \\ to toggle commenting of the current line or range noremap <silent><buffer> <LocalLeader><LocalLeader> \ :call <SID>Abaqus_ToggleComment()<CR>j function! <SID>Abaqus_ToggleComment() range - if strpart(getline(a:firstline), 0, 2) == "**" - " Un-comment all lines in range - silent execute a:firstline . ',' . a:lastline . 's/^\*\*//' - else - " Comment all lines in range - silent execute a:firstline . ',' . a:lastline . 's/^/**/' - endif + if strpart(getline(a:firstline), 0, 2) == "**" + " Un-comment all lines in range + silent execute a:firstline . ',' . a:lastline . 's/^\*\*//' + else + " Comment all lines in range + silent execute a:firstline . ',' . a:lastline . 's/^/**/' + endif + endfunction + + " Map \s to swap first two comma separated fields + noremap <silent><buffer> <LocalLeader>s :call <SID>Abaqus_Swap()<CR> + function! <SID>Abaqus_Swap() range + silent execute a:firstline . ',' . a:lastline . 's/\([^*,]*\),\([^,]*\)/\2,\1/' endfunction let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]" \ . "|unmap <buffer> <LocalLeader><LocalLeader>" + \ . "|unmap <buffer> <LocalLeader>s" endif " Undo must be done in nocompatible mode for <LocalLeader>. diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index aaa61f71d9..c28b8aecf8 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -3,7 +3,8 @@ " Maintainer: Doug Kearns <dougkearns@gmail.com> " Previous Maintainer: Max Ischenko <mfi@ukr.net> " Contributor: Dorai Sitaram <ds26@gte.com> -" Last Change: 2022 Sep 05 +" C.D. MacEachern <craig.daniel.maceachern@gmail.com> +" Last Change: 2022 Oct 15 if exists("b:did_ftplugin") finish @@ -19,9 +20,11 @@ setlocal formatoptions-=t formatoptions+=croql let &l:define = '\<function\|\<local\%(\s\+function\)\=' +" TODO: handle init.lua +setlocal includeexpr=substitute(v:fname,'\\.','/','g') setlocal suffixesadd=.lua -let b:undo_ftplugin = "setlocal cms< com< def< fo< sua<" +let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<" if exists("loaded_matchit") && !exists("b:match_words") let b:match_ignorecase = 0 diff --git a/runtime/ftplugin/markdown.vim b/runtime/ftplugin/markdown.vim index fc1d9e068b..2b963f139d 100644 --- a/runtime/ftplugin/markdown.vim +++ b/runtime/ftplugin/markdown.vim @@ -1,7 +1,7 @@ " Vim filetype plugin -" Language: Markdown -" Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2019 Dec 05 +" Language: Markdown +" Maintainer: Tim Pope <https://github.com/tpope/vim-markdown> +" Last Change: 2022 Oct 13 if exists("b:did_ftplugin") finish @@ -9,18 +9,33 @@ endif runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim +let s:keepcpo= &cpo +set cpo&vim + setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=<!--%s--> setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o -setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]: +setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+\\\|^\\[^\\ze[^\\]]\\+\\]:\\&^.\\{4\\} if exists('b:undo_ftplugin') - let b:undo_ftplugin .= "|setl cms< com< fo< flp<" + let b:undo_ftplugin .= "|setl cms< com< fo< flp< et< ts< sts< sw<" else - let b:undo_ftplugin = "setl cms< com< fo< flp<" + let b:undo_ftplugin = "setl cms< com< fo< flp< et< ts< sts< sw<" +endif + +if get(g:, 'markdown_recommended_style', 1) + setlocal expandtab tabstop=4 softtabstop=4 shiftwidth=4 +endif + +if !exists("g:no_plugin_maps") && !exists("g:no_markdown_maps") + nnoremap <silent><buffer> [[ :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> + nnoremap <silent><buffer> ]] :<C-U>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> + xnoremap <silent><buffer> [[ :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "bsW")<CR> + xnoremap <silent><buffer> ]] :<C-U>exe "normal! gv"<Bar>call search('\%(^#\{1,5\}\s\+\S\\|^\S.*\n^[=-]\+$\)', "sW")<CR> + let b:undo_ftplugin .= '|sil! nunmap <buffer> [[|sil! nunmap <buffer> ]]|sil! xunmap <buffer> [[|sil! xunmap <buffer> ]]' endif function! s:NotCodeBlock(lnum) abort - return synIDattr(synID(v:lnum, 1, 1), 'name') !=# 'markdownCode' + return synIDattr(synID(a:lnum, 1, 1), 'name') !=# 'markdownCode' endfunction function! MarkdownFold() abort @@ -64,11 +79,14 @@ function! MarkdownFoldText() abort return hash_indent.' '.title.' '.linecount endfunction -if has("folding") && exists("g:markdown_folding") +if has("folding") && get(g:, "markdown_folding", 0) setlocal foldexpr=MarkdownFold() setlocal foldmethod=expr setlocal foldtext=MarkdownFoldText() - let b:undo_ftplugin .= " foldexpr< foldmethod< foldtext<" + let b:undo_ftplugin .= "|setl foldexpr< foldmethod< foldtext<" endif +let &cpo = s:keepcpo +unlet s:keepcpo + " vim:set sw=2: diff --git a/runtime/ftplugin/poefilter.vim b/runtime/ftplugin/poefilter.vim new file mode 100644 index 0000000000..92c2def630 --- /dev/null +++ b/runtime/ftplugin/poefilter.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: PoE item filter +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Oct 07 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:# commentstring=#\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/runtime/ftplugin/ssa.vim b/runtime/ftplugin/ssa.vim new file mode 100644 index 0000000000..04cc7a9bde --- /dev/null +++ b/runtime/ftplugin/ssa.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: SubStation Alpha +" Maintainer: ObserverOfTime <chronobserver@disroot.org> +" Last Change: 2022 Oct 10 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=:;,:!: commentstring=;\ %s + +let b:undo_ftplugin = 'setl com< cms<' |