From 9e5fa3cf62a0d50ba6f86267de8182e0df9d4347 Mon Sep 17 00:00:00 2001 From: Josuer08 <josuer08@gmail.com> Date: Tue, 9 Feb 2021 14:40:05 -0500 Subject: [PATCH] New searcher without plugin --- .config/nvim/init.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 3cf47324..d482a954 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -26,8 +26,6 @@ syntax on "let mapleader = " " "jk in insert mode takes you back to normal mode inoremap jk <ESC> -"Ctrl-n activates nerd toggle -nmap <C-n> :NERDTreeToggle<CR> "Ctrl-s saves nmap <C-s> :w<CR> "++ in vmap or nmap coments @@ -39,6 +37,18 @@ noremap <silent> <expr> k (v:count == 0 ? 'gk' : 'k') "Vex nnoremap <leader>v :Vex<CR> nnoremap <leader>h :Sex<CR> + +function! Grepper() + call inputsave() + let replacement = input('RegExp: ') + let workdir = input('Directory: ') + call inputrestore() + execute 'grep! -Irn '.replacement.' '.workdir +endfunction +nnoremap <silent> <leader>gg :call Grepper()<CR>:copen<CR> + + + " this is an auto changer for relative numbers :augroup numbertoggle : autocmd! -- 2.25.1