Hacker News new | past | comments | ask | show | jobs | submit login

The actual vim config is terribly simple:

    nmap <silent> <Leader><Tab> :make search PATTERN='\<^R^W\>'<Cr>
Where ^R and ^W are literal ctrl-R and ctrl-W (typed with a leading ctrl-v).

Then my Makefile contains:

    search:
        git grep -n "$$PATTERN"
plus some project-specific bits to prune out portions of the tree which should be skipped.

The following are also nice:

    clip:           
        xclip -o        
                    
    todo:           
        PATTERN=TO''DO make search | sed -n 's/\([^ \t]*\)\(.*TO''DO \(([0-9]*)\)\):\?\(.*\)/\1 \3 \2\4/p' | sort -k 2                  

I've also found it useful to make sure my unit tests output some relevant file:line: info and run those from my makefile.

Relatedly, I have:

    nmap <silent> <Tab> :cnext<Cr>
    nmap <silent> <S-Tab> :cprev<Cr>
to make it easy to jump between quick-fix items.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: