• search through the folder of the current file path by using the absolute folder path.
    • :lgrep -E "gz" -0 --color -n %:p:h/*
  • more...
    • :vimgrep /regex/ %:p:h/**/* – search recursively by using regex
      • :vimgrep "word" %:p:h/**/* – search recursively by using a single word
      • location list :lvimgrep "word" %:p:h/**/* – search recursively by using a single word
    • vim can interface with “grep” and grep-like programs
      • :grep :lgr :lgrep
        • grep -E "test" -0 -nR src --exclude="*node_modules*"
        • lgrep -E "test" -0 -nR src --exclude="*node_modules*"
      • the location list behaves just like the quickfix list except that it is local to the current window instead of being global to the Vim session. So if you have five open windows, you can have up to five location lists, but only one quickfix list.
        • quickfix list
          • grep -E "test" -0 -nR src --exclude="*node_modules*"
            • navigation: [[q, ]]q, [q, [Q, ]q, ]Q
            • <leader>qa, <leader>qX, <leader>qx, <leader>qs
        • location list
          • lgrep -E "test" -0 -nR src --exclude="*node_modules*"
            • navigation: [[l, ]]l, [l, [L, ]l, ]L
            • <leader>la, <leader>lX, <leader>lx, <leader>ls

How to…

  • how to use VI to search for lines with a certain length?
  • how to open multiple files in vim splits and tabs
    • vim `fzf`
      
    • in horizontal splits
      • vim -o file1 file2
      • vim -o `fzf`
        
    • in vertical splits
      • vim -O file1 file2
      • vim -O `fzf`
        
    • in vim tabs
      • vim -p file1 file2
      • vim -p `fzf`
        

Table of contents