diff --git a/README.md b/README.md index 2cb4caf6..c27cf97b 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ Useful mappings for managing tabs: " Opens a new tab with the current buffer's path " Super useful when editing files in the same directory - map te :tabedit =expand("%:p:h")/ + map te :tabedit =escape(expand("%:p:h"), " ")/ Switch [CWD](http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file) to the directory of the open buffer: diff --git a/vimrcs/basic.vim b/vimrcs/basic.vim index e108c303..68d71f3e 100644 --- a/vimrcs/basic.vim +++ b/vimrcs/basic.vim @@ -241,7 +241,7 @@ au TabLeave * let g:lasttab = tabpagenr() " Opens a new tab with the current buffer's path " Super useful when editing files in the same directory -map te :tabedit =expand("%:p:h")/ +map te :tabedit =escape(expand("%:p:h"), " ")/ " Switch CWD to the directory of the open buffer map cd :cd %:p:h:pwd diff --git a/vimrcs/extended.vim b/vimrcs/extended.vim index e07045aa..fc935f8f 100644 --- a/vimrcs/extended.vim +++ b/vimrcs/extended.vim @@ -170,7 +170,7 @@ func! DeleteTillSlash() endfunc func! CurrentFileDir(cmd) - return a:cmd . " " . expand("%:p:h") . "/" + return a:cmd . " " . escape(expand("%:p:h"), " ") . "/" endfunc "=================================================================================