Created
February 19, 2016 17:31
-
-
Save spalenza/d24200b5cfe0c2e55447 to your computer and use it in GitHub Desktop.
vim copy file path
This file contains hidden or 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
" Convert slashes to backslashes for Windows. | |
if has('win32') | |
nmap ,cs :let @*=substitute(expand("%"), "/", "\\", "g")<CR> | |
nmap ,cl :let @*=substitute(expand("%:p"), "/", "\\", "g")<CR> | |
" This will copy the path in 8.3 short format, for DOS and Windows 9x | |
nmap ,c8 :let @*=substitute(expand("%:p:8"), "/", "\\", "g")<CR> | |
else | |
nmap ,cs :let @*=expand("%")<CR> | |
nmap ,cl :let @*=expand("%:p")<CR> | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment