aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2022-07-30 15:48:32 +0200
committerGitHub <noreply@github.com>2022-07-30 15:48:32 +0200
commit6237ac84024f048ec60475276fbf0663d9d17879 (patch)
treea26df8962b063f73b4c85e9906b2e2edb54fb73c /runtime/ftplugin
parentd36d9be8ff0e03a7cbba087abb9167056f9c56c7 (diff)
downloadrneovim-6237ac84024f048ec60475276fbf0663d9d17879.tar.gz
rneovim-6237ac84024f048ec60475276fbf0663d9d17879.tar.bz2
rneovim-6237ac84024f048ec60475276fbf0663d9d17879.zip
vim-patch:2ecbe53f452e (#19577)
Update runtime files https://github.com/vim/vim/commit/2ecbe53f452e92e941aff623f6a0b72f80e43d07
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/debchangelog.vim101
-rw-r--r--runtime/ftplugin/desktop.vim13
-rw-r--r--runtime/ftplugin/swayconfig.vim16
3 files changed, 85 insertions, 45 deletions
diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim
index a78f7811f1..cf8dd17c44 100644
--- a/runtime/ftplugin/debchangelog.vim
+++ b/runtime/ftplugin/debchangelog.vim
@@ -1,9 +1,9 @@
" Vim filetype plugin file (GUI menu, folding and completion)
" Language: Debian Changelog
-" Maintainer: Debian Vim Maintainers
+" Maintainer: Debian Vim Maintainers <team+vim@tracker.debian.org>
" Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de>
" Stefano Zacchiroli <zack@debian.org>
-" Last Change: 2018-01-28
+" Last Change: 2022 Jul 25
" License: Vim License
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim
@@ -35,6 +35,11 @@ if exists('g:did_changelog_ftplugin')
finish
endif
+" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
+" <CR> would not be recognized. See ":help 'cpoptions'".
+let s:cpo_save = &cpo
+set cpo&vim
+
" Don't load another plugin (this is global)
let g:did_changelog_ftplugin = 1
@@ -101,13 +106,13 @@ endfunction
" These functions implement the menus
function NewVersion()
" The new entry is unfinalised and shall be changed
- amenu disable Changelog.New\ Version
- amenu enable Changelog.Add\ Entry
- amenu enable Changelog.Close\ Bug
- amenu enable Changelog.Set\ Distribution
- amenu enable Changelog.Set\ Urgency
- amenu disable Changelog.Unfinalise
- amenu enable Changelog.Finalise
+ amenu disable &Changelog.&New\ Version
+ amenu enable &Changelog.&Add\ Entry
+ amenu enable &Changelog.&Close\ Bug
+ amenu enable &Changelog.Set\ &Distribution
+ amenu enable &Changelog.Set\ &Urgency
+ amenu disable &Changelog.U&nfinalise
+ amenu enable &Changelog.&Finalise
call append(0, substitute(getline(1), '-\([[:digit:]]\+\))', '-$$\1)', ''))
call append(1, '')
call append(2, '')
@@ -117,7 +122,9 @@ function NewVersion()
normal! 1G0
call search(')')
normal! h
- normal! 
+ " ':normal' doens'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), '-\$\$', '-', ''))
if exists('g:debchangelog_fold_enable')
foldopen
@@ -161,13 +168,13 @@ endfunction
function <SID>UnfinaliseMenu()
" This means the entry shall be changed
- amenu disable Changelog.New\ Version
- amenu enable Changelog.Add\ Entry
- amenu enable Changelog.Close\ Bug
- amenu enable Changelog.Set\ Distribution
- amenu enable Changelog.Set\ Urgency
- amenu disable Changelog.Unfinalise
- amenu enable Changelog.Finalise
+ amenu disable &Changelog.&New\ Version
+ amenu enable &Changelog.&Add\ Entry
+ amenu enable &Changelog.&Close\ Bug
+ amenu enable &Changelog.Set\ &Distribution
+ amenu enable &Changelog.Set\ &Urgency
+ amenu disable &Changelog.U&nfinalise
+ amenu enable &Changelog.&Finalise
endfunction
function Unfinalise()
@@ -179,13 +186,13 @@ endfunction
function <SID>FinaliseMenu()
" This means the entry should not be changed anymore
- amenu enable Changelog.New\ Version
- amenu disable Changelog.Add\ Entry
- amenu disable Changelog.Close\ Bug
- amenu disable Changelog.Set\ Distribution
- amenu disable Changelog.Set\ Urgency
- amenu enable Changelog.Unfinalise
- amenu disable Changelog.Finalise
+ amenu enable &Changelog.&New\ Version
+ amenu disable &Changelog.&Add\ Entry
+ amenu disable &Changelog.&Close\ Bug
+ amenu disable &Changelog.Set\ &Distribution
+ amenu disable &Changelog.Set\ &Urgency
+ amenu enable &Changelog.U&nfinalise
+ amenu disable &Changelog.&Finalise
endfunction
function Finalise()
@@ -198,26 +205,26 @@ endfunction
function <SID>MakeMenu()
amenu &Changelog.&New\ Version :call NewVersion()<CR>
- amenu Changelog.&Add\ Entry :call AddEntry()<CR>
- amenu Changelog.&Close\ Bug :call CloseBug()<CR>
- menu Changelog.-sep- <nul>
-
- amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR>
- amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen")<CR>
- amenu Changelog.Set\ Distribution.&stable :call Distribution("stable")<CR>
- menu Changelog.Set\ Distribution.-sep- <nul>
- amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR>
- amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable")<CR>
- amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen")<CR>
- amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR>
-
- amenu Changelog.Set\ &Urgency.&low :call Urgency("low")<CR>
- amenu Changelog.Set\ Urgency.&medium :call Urgency("medium")<CR>
- amenu Changelog.Set\ Urgency.&high :call Urgency("high")<CR>
-
- menu Changelog.-sep- <nul>
- amenu Changelog.U&nfinalise :call Unfinalise()<CR>
- amenu Changelog.&Finalise :call Finalise()<CR>
+ amenu &Changelog.&Add\ Entry :call AddEntry()<CR>
+ amenu &Changelog.&Close\ Bug :call CloseBug()<CR>
+ menu &Changelog.-sep- <nul>
+
+ amenu &Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR>
+ amenu &Changelog.Set\ &Distribution.&frozen :call Distribution("frozen")<CR>
+ amenu &Changelog.Set\ &Distribution.&stable :call Distribution("stable")<CR>
+ menu &Changelog.Set\ &Distribution.-sep- <nul>
+ amenu &Changelog.Set\ &Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR>
+ amenu &Changelog.Set\ &Distribution.stable\ unstable :call Distribution("stable unstable")<CR>
+ amenu &Changelog.Set\ &Distribution.stable\ frozen :call Distribution("stable frozen")<CR>
+ amenu &Changelog.Set\ &Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR>
+
+ amenu &Changelog.Set\ &Urgency.&low :call Urgency("low")<CR>
+ amenu &Changelog.Set\ &Urgency.&medium :call Urgency("medium")<CR>
+ amenu &Changelog.Set\ &Urgency.&high :call Urgency("high")<CR>
+
+ menu &Changelog.-sep- <nul>
+ amenu &Changelog.U&nfinalise :call Unfinalise()<CR>
+ amenu &Changelog.&Finalise :call Finalise()<CR>
if <SID>Finalised()
call <SID>FinaliseMenu()
@@ -228,7 +235,7 @@ endfunction
augroup changelogMenu
au BufEnter * if &filetype == "debchangelog" | call <SID>MakeMenu() | endif
-au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif
+au BufLeave * if &filetype == "debchangelog" | silent! aunmenu &Changelog | endif
augroup END
" }}}
@@ -380,4 +387,8 @@ setlocal omnifunc=DebCompleteBugs
" }}}
+" Restore the previous value of 'cpoptions'.
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
" vim: set foldmethod=marker:
diff --git a/runtime/ftplugin/desktop.vim b/runtime/ftplugin/desktop.vim
new file mode 100644
index 0000000000..bd6fd7097c
--- /dev/null
+++ b/runtime/ftplugin/desktop.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin file
+" Language: XDG desktop entry
+" Maintainer: Eisuke Kawashima ( e.kawaschima+vim AT gmail.com )
+" Last Change: 2022-07-26
+
+if exists('b:did_ftplugin')
+ finish
+endif
+let b:did_ftplugin = v:true
+
+setl comments=:#
+setl commentstring=#%s
+let b:undo_ftplugin = 'setl com< cms<'
diff --git a/runtime/ftplugin/swayconfig.vim b/runtime/ftplugin/swayconfig.vim
new file mode 100644
index 0000000000..45d6bdb3e5
--- /dev/null
+++ b/runtime/ftplugin/swayconfig.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin file
+" Language: sway config file
+" Original Author: James Eapen <james.eapen@vai.org>
+" Maintainer: James Eapen <james.eapen@vai.org>
+" Version: 0.1
+" Last Change: 2022 June 07
+
+if exists("b:did_ftplugin")
+ finish
+endif
+
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setlocal cms<"
+
+setlocal commentstring=#\ %s