summaryrefslogtreecommitdiffstats
path: root/ftplugin/gitrebase.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2021-12-21 14:41:23 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2021-12-21 14:41:23 +0100
commit87a26c5bf169bafbee837e2323f24cfb07e35250 (patch)
tree326eb21bb10c3d3633b83263d21c85c98f92a67e /ftplugin/gitrebase.vim
parent918610d427503c5c7b380eae4a954bd8cb427db5 (diff)
downloadvim-polyglot-87a26c5bf169bafbee837e2323f24cfb07e35250.tar.gz
vim-polyglot-87a26c5bf169bafbee837e2323f24cfb07e35250.zip
Update
Diffstat (limited to 'ftplugin/gitrebase.vim')
-rw-r--r--ftplugin/gitrebase.vim13
1 files changed, 5 insertions, 8 deletions
diff --git a/ftplugin/gitrebase.vim b/ftplugin/gitrebase.vim
index 7163f916..285f76a4 100644
--- a/ftplugin/gitrebase.vim
+++ b/ftplugin/gitrebase.vim
@@ -12,15 +12,13 @@ if (exists("b:did_ftplugin"))
finish
endif
-runtime! ftplugin/git.vim
let b:did_ftplugin = 1
-setlocal comments=:# commentstring=#\ %s formatoptions-=t
+let &l:comments = ':' . (matchstr(getline('$'), '^[#;@!$%^&|:]\S\@!') . '#')[0]
+let &l:commentstring = &l:comments[1] . ' %s'
+setlocal formatoptions-=t
setlocal nomodeline
-if !exists("b:undo_ftplugin")
- let b:undo_ftplugin = ""
-endif
-let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo< ml<"
+let b:undo_ftplugin = "setl com< cms< fo< ml<"
function! s:choose(word) abort
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
@@ -45,8 +43,7 @@ if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
finish
endif
-nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K'
nnoremap <buffer> <silent> <C-A> :<C-U><C-R>=v:count1<CR>Cycle<CR>
nnoremap <buffer> <silent> <C-X> :<C-U><C-R>=v:count1<CR>Cycle!<CR>
-let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap <buffer> K'|exe 'nunmap <buffer> <C-A>'|exe 'nunmap <buffer> <C-X>'"
+let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap <buffer> <C-A>'|exe 'nunmap <buffer> <C-X>'"