I am learning vim recently as i have to use vim in some restricted machines. As i am a vscode user, I would like to find ctrl+f and ctrl+shift+f equivalent to do string search
Ctrl+f will search within the file
ctrl+shift+f will search in all the files in the folder tree.
I added ripgrep , It search :Rg! ,it always search in all files like Ctrl+shift+f Whether Rg can be used to search with the files? (like ctrl+f).
Also how to add ctrl+f and ctrl+shift+f mapping in vim
I agree with romainl, vim already has these function without any plugins. Just want to add some details.
Search string in current file is done by
/
in normal mode, see:h /
,:h pattern.txt
.Search string in many files may be done by vimgrep command, see
:h :vimgrep
.Also you may find useful vim fzf plugin, it uses ripgrep you already installed and does much more.
Of course you can do mappings on
Ctrl-F
andCtrl-Shift-F
, but it will override builtin vim command, so I don't recommend to do it.See
:h map.txt