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

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -