MVC mappings for CtrlP
It’s been a while since I last shared anything Vim related.
My favourite somewhat-recent addition to my
.vimrc is a set of CtrlP mappings for searching directly within an apps model, view, controller, or helper directories.
1nnoremap <leader>c :CtrlP src/controllers<cr>2nnoremap <leader>h :CtrlP src/helpers<cr>3nnoremap <leader>m :CtrlP src/models<cr>4nnoremap <leader>v :CtrlP src/views<cr>
Chances are, your MVC directories don’t live in
src/ in your project. If you build Rails apps for example, then you’ll want to change that to
I first saw these mappings in Gary Bernhardt‘s dotfiles, so full credit to him.