aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2021-11-07 12:58:54 +0900
committernsfisis <nsfisis@gmail.com>2021-11-07 12:58:54 +0900
commitd381cb3fa599b4292debd0390d60ec51c221f465 (patch)
treede195d7a6cc8bd753f9aeac6a955938913d25c60
parentedcbbbf55e5dbc6030ff0475299dd28b10798a61 (diff)
downloaddotfiles-d381cb3fa599b4292debd0390d60ec51c221f465.tar.gz
dotfiles-d381cb3fa599b4292debd0390d60ec51c221f465.tar.zst
dotfiles-d381cb3fa599b4292debd0390d60ec51c221f465.zip
.vimrc: Make my-insert-blank-lines-{after,before} dot-repeatable
-rw-r--r--.vimrc23
1 files changed, 18 insertions, 5 deletions
diff --git a/.vimrc b/.vimrc
index 75aa4e6..09f739a 100644
--- a/.vimrc
+++ b/.vimrc
@@ -1051,8 +1051,13 @@ nnoremap <silent> <C-c> :<C-u>nohlsearch<CR>
-nnoremap <silent> go :<C-u>call <SID>insert_blank_line(0)<CR>
-nnoremap <silent> gO :<C-u>call <SID>insert_blank_line(1)<CR>
+nnoremap <silent> <Plug>(my-insert-blank-lines-after)
+ \ :<C-u>call <SID>insert_blank_line(0)<CR>
+nnoremap <silent> <Plug>(my-insert-blank-lines-before)
+ \ :<C-u>call <SID>insert_blank_line(1)<CR>
+
+nmap go <Plug>(my-insert-blank-lines-after)
+nmap gO <Plug>(my-insert-blank-lines-before)
function! s:insert_blank_line(offset) abort
for i in range(v:count1)
@@ -1540,14 +1545,22 @@ xmap BB <Plug>(quickrun)
" repeat {{{2
-nmap U <Plug>(RepeatRedo)
-" Work around. vim-repeatの内部構造に大きく依存する。
-" repeat#setregの呼び出しが(ほぼ)副作用を持たないことが必要
+nmap U <Plug>(RepeatRedo)
" Autoload vim-repeat immediately in order to make <Plug>(RepeatRedo) available.
" repeat#setreg() does nothing here.
call repeat#setreg('', '')
+" Make them repeatable with vim-repeat.
+nnoremap <silent> <Plug>(my-insert-blank-lines-after)
+ \ :<C-u>call <SID>insert_blank_line(0)<Bar>
+ \ silent! call repeat#set("\<Lt>Plug>(my-insert-blank-lines-after)")<CR>
+nnoremap <silent> <Plug>(my-insert-blank-lines-before)
+ \ :<C-u>call <SID>insert_blank_line(1)<Bar>
+ \ silent! call repeat#set("\<Lt>Plug>(my-insert-blank-lines-before)")<CR>
+
+
+
" ripgrep {{{2
" Workaround: do not open quickfix window.