From 9de23cdd91b365d50246673c53f721855d0bc2ed Mon Sep 17 00:00:00 2001 From: Asocia Date: Sun, 29 Aug 2021 12:37:44 +0300 Subject: [PATCH] TIL: Searching through multiple files in plain vim --- ...arching-through-multiple-files-in-plain-vim.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 vim/searching-through-multiple-files-in-plain-vim.md diff --git a/vim/searching-through-multiple-files-in-plain-vim.md b/vim/searching-through-multiple-files-in-plain-vim.md new file mode 100644 index 0000000..d41d156 --- /dev/null +++ b/vim/searching-through-multiple-files-in-plain-vim.md @@ -0,0 +1,15 @@ +You can search through multiple files using `vimgrep` command. + +``` +# search for string all python files in the current dir +:vimgrep string *.py +# search for string all python files in the current dir and subdir of the current dir +:vimgrep string **/*.py + + +Here are the commands you can use to navigate through search matches: + - `:cn` - jump to the next match. + - `:cN` - jump to the previous match. + - `:clist` - view all the files that contain the matched string + - `:cc number` - jump to specific match number, which you get from :clist output. +```