Skip to content

Commit

Permalink
vim: adding ,w to open URL and auto source .vimrc when saved
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jul 19, 2010
1 parent 700e077 commit 99d76f5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions vimrc
Expand Up @@ -60,6 +60,9 @@ if has("autocmd")
\ exe "normal g`\"" |
\ endif

" Automatically load .vimrc source when saved
autocmd BufWritePost .vimrc source $MYVIMRC

augroup END

else
Expand Down Expand Up @@ -195,3 +198,14 @@ let g:fuf_splitPathMatching=1

" Open URL
command -bar -nargs=1 OpenURL :!open <args>
function! OpenURL()
let s:uri = matchstr(getline("."), '[a-z]*:\/\/[^ >,;:]*')
echo s:uri
if s:uri != ""
exec "!open \"" . s:uri . "\""
else
echo "No URI found in line."
endif
endfunction
map <Leader>w :call OpenURL()<CR>

0 comments on commit 99d76f5

Please sign in to comment.