Skip to content

Instantly share code, notes, and snippets.

@ilyakatz
Last active December 21, 2015 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyakatz/6300224 to your computer and use it in GitHub Desktop.
Save ilyakatz/6300224 to your computer and use it in GitHub Desktop.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" update ack command to be able to search through the gem files
:autocmd BufEnter * call SetCurrentGemHome()
function! SetCurrentGemHome()
call UpdateGemPath()
:command! -nargs=* AckGems execute 'Ack' <q-args> $GEM_PATH
endfunction
function! UpdateGemPath()
let $GEM_PREFIX=system("rbenv prefix")
let $GEMSET_FILE_NAME=system("rbenv gemset file")
let $GEMSET_NAME=system("cat " . $GEMSET_FILE_NAME)
let $GEM_PATH=join([$GEM_PREFIX, "gemsets",$GEMSET_NAME],"/")
let $GEM_PATH = substitute($GEM_PATH,"[\n|\r]*","","g")
endfunction
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment