Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better project search, a readme

  • Loading branch information...
commit a8c891da9ae376cbbbdbbe80bf32255b38939caa 1 parent ce16c64
@jduff jduff authored
Showing with 28 additions and 9 deletions.
  1. +18 −0 README
  2. +10 −9 vimrc
View
18 README
@@ -0,0 +1,18 @@
+For Find In Project(,+f) you will need ack installed.
+On OSX the easiest way to do this is with macports, but you could also install the Perl module with CSPAN (just make sure ack is on your path).
+sudo port install p5-app-ack
+
+** NOTE - I've mapped the leader to ','
+
+Some Shortcuts
+` Toggles NERDTree
+
+,+t FuzzyFinderTextMate (cmd+t stlye file search from TextMate)
+,+b FuzzyFinderBuffer (same as above but only searches open buffers)
+,+r Refreshes FuzzyFinder (if you rename or add a file you might need this)
+
+,+f Find in Project (using ack)
+,+[ Previous search result
+,+] Next search result
+** NOTE to scope your search to a dir give the dir name as the second argument to Ack
+ex. ,f RecordNotFound app
View
19 vimrc
@@ -20,7 +20,7 @@ set scrolloff=3
set shortmess=atI
set visualbell
set autowrite " Automatically save before commands like :next
-
+set grepprg=ack
" http://github.com/hgimenez/vimfiles/blob/master/vimrc
@@ -77,20 +77,21 @@ map <leader>t :FuzzyFinderTextMate<CR>
map <leader>b :FuzzyFinderBuffer<CR>
map <leader>r :ruby finder.rescan!<CR>
-" Simple find that uses vimgrep to search all project files
-function! FindInProject()
- let pattern = input('Enter search pattern: ')
- execute ':vimgrep ' . pattern . ' **'
+" https://wincent.com/blog/2-hours-with-vim
+function! AckGrep(command)
+ cexpr system("ack " . a:command)
+ cw " show quickfix window already
endfunction
-
-map <leader>f :call FindInProject()<CR>
-" previous vimgrep result
+command! -nargs=+ -complete=file Ack call AckGrep(<q-args>)
+map <leader>f :Ack<space>
+" previous ack result
map <leader>[ :cp<CR>
-" next vimgrep result
+" next ack result
map <leader>] :cn<CR>
+
" Printing options
set printoptions=duplex:long,paper:letter
Please sign in to comment.
Something went wrong with that request. Please try again.