mirror of
1
0
Fork 0

fix: escape spaces in expanded paths (#676)

This commit is contained in:
David Wettstein 2022-10-15 21:17:55 +02:00 committed by GitHub
parent 88f64a0561
commit bbab4579f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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 <leader>te :tabedit <C-r>=expand("%:p:h")<cr>/
map <leader>te :tabedit <C-r>=escape(expand("%:p:h"), " ")<cr>/
Switch [CWD](http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file) to the directory of the open buffer:

View File

@ -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 <leader>te :tabedit <C-r>=expand("%:p:h")<cr>/
map <leader>te :tabedit <C-r>=escape(expand("%:p:h"), " ")<cr>/
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>

View File

@ -170,7 +170,7 @@ func! DeleteTillSlash()
endfunc
func! CurrentFileDir(cmd)
return a:cmd . " " . expand("%:p:h") . "/"
return a:cmd . " " . escape(expand("%:p:h"), " ") . "/"
endfunc
"=================================================================================