diff options
author | Teddy Wing | 2015-10-28 15:15:04 -0400 |
---|---|---|
committer | Teddy Wing | 2015-10-28 15:15:04 -0400 |
commit | f644bf199ec806cbf7d9d6ce53e52528abd6477e (patch) | |
tree | 572ff1da2922d30e64ec76c60bf34eb1be09bdfc /vimrc | |
parent | 6ff2c9f8f41b0f6227faa9adac1e290bd717f759 (diff) | |
download | dotvim-f644bf199ec806cbf7d9d6ce53e52528abd6477e.tar.bz2 |
vimrc: Add a mapping to open the current file in Chrome
This is to make it easier to preview HTML files in a browser. Otherwise
I would either open the file in Finder with `<leader>of` and drag it to
a browser in my Dock or open a new terminal, `cd` into the right
directory, start a Python `SimpleHTTPServer`, and finally navigate to
`localhost:8000/___` in a browser. This makes doing the first option
quick and easy.
Since we're opening the file directly, this will use the `file://`
protocol, but that's enough to be able to take a look at small pages.
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -337,6 +337,9 @@ " 2015.08.18: " * Add a mapping system copy the current file's path " +" 2015.10.28: +" * Add a mapping to open the current file in Chrome +" " Pathogen @@ -637,6 +640,9 @@ nnoremap <leader>of :execute '!open "' . expand('%:p:h') . '"'<cr> " Open current file in ranger nnoremap <leader>or :execute '!ranger "' . expand('%:p:h') . '"'<cr> +" Open the current file in Chrome +nnoremap <leader>oc :execute '!open -a Google\ Chrome\ Canary "' . expand('%:p') . '"'<cr> + " HTML " Split outer tag on a single line to multiple lines " Example: |