Update runtime files
diff --git a/runtime/ftplugin/abaqus.vim b/runtime/ftplugin/abaqus.vim
index 3faeff6..5931cd9 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 @@
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 aaa61f7..c28b8ae 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 @@
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 fc1d9e0..2b963f1 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 @@
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 @@
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 0000000..92c2def
--- /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 0000000..04cc7a9
--- /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<'