From f644bf199ec806cbf7d9d6ce53e52528abd6477e Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 28 Oct 2015 15:15:04 -0400 Subject: 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 `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. --- vimrc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vimrc') diff --git a/vimrc b/vimrc index 40d20f0..fc73fa7 100644 --- a/vimrc +++ b/vimrc @@ -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 of :execute '!open "' . expand('%:p:h') . '"' " Open current file in ranger nnoremap or :execute '!ranger "' . expand('%:p:h') . '"' +" Open the current file in Chrome +nnoremap oc :execute '!open -a Google\ Chrome\ Canary "' . expand('%:p') . '"' + " HTML " Split outer tag on a single line to multiple lines " Example: -- cgit v1.2.3