diff --git a/nvim/plugin/editing.vim b/nvim/plugin/editing.vim index 416d073..00b283a 100644 --- a/nvim/plugin/editing.vim +++ b/nvim/plugin/editing.vim @@ -142,6 +142,9 @@ set commentstring=//%s xnoremap zL xnoremap zl + " Repeat the last edit n times, taken from + nnoremap . execute "normal!" repeat(".", v:count1) + " }}} diff --git a/nvim/plugin/interface.vim b/nvim/plugin/interface.vim index 082f3b4..769871c 100644 --- a/nvim/plugin/interface.vim +++ b/nvim/plugin/interface.vim @@ -137,6 +137,17 @@ endif nmap [l (qf_loc_previous) nmap ]l (qf_loc_next) let g:qf_mapping_ack_style = 1 + + " Based on , inspired by + " . + " But apparently `vimgrep /pattern/ %` can be used instead? + function! s:CmdGlobal(pattern, bang) + let pattern = substitute(a:pattern, "/.*$", "", "") + let matches = [] + execute "g" . (a:bang ? "!" : "") . "/" . pattern . "/call add(matches, expand(\"%\").\":\".line(\".\").\":\".col(\".\").\":\".getline(\".\"))" + cexpr matches + endfunction + command! -bang -nargs=1 Global call CmdGlobal(, 0) " }}}