From 87a26c5bf169bafbee837e2323f24cfb07e35250 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 21 Dec 2021 14:41:23 +0100 Subject: Update --- ftplugin/gitrebase.vim | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ftplugin/gitrebase.vim') 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 K col('.') < 7 && expand('cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K' nnoremap :=v:count1Cycle nnoremap :=v:count1Cycle! -let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap K'|exe 'nunmap '|exe 'nunmap '" +let b:undo_ftplugin = b:undo_ftplugin . "|exe 'nunmap '|exe 'nunmap '" -- cgit v1.2.3