1
0
Fork 0
mirror of synced 2024-06-01 15:01:10 -04:00

fix: escape spaces in expanded paths

This commit is contained in:
David Wettstein 2021-11-11 21:52:31 +01:00
parent a716fe1777
commit 828b5662b7
No known key found for this signature in database
GPG key ID: 748422EC581CA60F
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 " Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory " 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: 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 " Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory " 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 " Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr> map <leader>cd :cd %:p:h<cr>:pwd<cr>

View file

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