I use ack.vim, and have below keymap in my .vimrc
,
nnoremap ;f :Ack! ^\"
to search for tags in my note files, which are lines that begin with double quote followed by non-space characters.
which works fine, since my note files lies in a common directory, say ~/notes
.
Now, say at a git repo, eg, ~/code/some_repo
, I want below keymap at that directory,
nnoremap ;f :Ack! ^\/\/\ *\"
I could manually set the keymap if work at given directory, but it soon become tedious.
So I wonder, how can I set keymap base on working directory when I start vim.
-- hopefully vimscript solution, with possible aid of bash command.