Created
July 14, 2010 11:28
-
-
Save marceldegraaf/475310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" | |
" APIdock search for word under cursor | |
" | |
let g:browser = 'open -a /Applications/Google\ Chrome.app ' | |
" On OSX - let g:browser = 'open -a /Applications/Firefox.app' | |
" Open the Ruby ApiDock page for the word under cursor, in a new Firefox tab | |
function! OpenRubyDoc(keyword) | |
let url = 'http://apidock.com/ruby/search/quick?query='.a:keyword | |
exec '!'.g:browser.' '.url.' &' | |
endfunction | |
noremap RB :call OpenRubyDoc(expand('<cword>'))<CR> | |
" Open the Rails ApiDock page for the word under cursor, in a new Firefox tab | |
function! OpenRailsDoc(keyword) | |
let url = 'http://apidock.com/rails/search/quick?query='.a:keyword | |
exec '!'.g:browser.' '.url.' &' | |
endfunction | |
noremap RR :call OpenRailsDoc(expand('<cword>'))<CR> | |
" Open the Rspec ApiDock page for the word under cursor, in a new Firefox tab | |
function! OpenRspecDoc(keyword) | |
let url = 'http://apidock.com/rspec/search/quick?query='.a:keyword | |
exec '!'.g:browser.' '.url.' &' | |
endfunction | |
noremap RS :call OpenRspecDoc(expand('<cword>'))<CR> | |
function! RemoveTrailingWhiteSpaces() | |
" Remove ALL trailing whitespaces | |
%s/\s\+$// | |
endfunction | |
noremap WW :call RemoveTrailingWhiteSpaces()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment