mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] add a few little tricks found in romainl's Gists
This commit is contained in:
parent
b0f7307999
commit
bf230c414e
2 changed files with 14 additions and 0 deletions
|
@ -142,6 +142,9 @@ set commentstring=//%s
|
|||
xnoremap <M-L> zL
|
||||
xnoremap <M-Right> zl
|
||||
|
||||
" Repeat the last edit n times, taken from <https://gist.github.com/romainl/db725db7babc84a9a6436180cedee188>
|
||||
nnoremap . <Cmd>execute "normal!" repeat(".", v:count1)<CR>
|
||||
|
||||
" }}}
|
||||
|
||||
|
||||
|
|
|
@ -137,6 +137,17 @@ endif
|
|||
nmap [l <Plug>(qf_loc_previous)
|
||||
nmap ]l <Plug>(qf_loc_next)
|
||||
let g:qf_mapping_ack_style = 1
|
||||
|
||||
" Based on <https://stackoverflow.com/a/1330556/12005228>, inspired by
|
||||
" <https://gist.github.com/romainl/f7e2e506dc4d7827004e4994f1be2df6>.
|
||||
" 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 <SID>CmdGlobal(<q-args>, <bang>0)
|
||||
" }}}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue