Vim: How do I map vimgrep command to avoid typing the file pattern? -


i search in projects using vimgrep command in fahsion:

:vimgrep /{pattern}/gj app_name/**/*.py 

all significant source code lives inside app_name directory , search inside python files, create command avoid writing search path on , on (i'm using project specific vimrc custom mappings). this:

:proj_search {pattern} 

you can use command

command -nargs=1 projsearch vimgrep /<args>/gj app_name/**/*.py 

:h 40.2


edit: mcubik pointed out

user-defined commands must start capital letter. cannot use ":x", ":next" , ":print". underscore cannot used! can use digits, discouraged.


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -