summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/init.vim b/init.vim
index eec97d3..cbb6d59 100644
--- a/init.vim
+++ b/init.vim
@@ -144,7 +144,7 @@ if isdirectory(printf('%s/.config/nvim/after', $HOME))
endif
noremap <leader>nt <cmd>NvimTreeToggle<cr>
-noremap <C-n><C-e> :<C-u>e <C-r>=expand('%:h')<cr>/
+noremap <C-n><C-e> :<C-u>e <C-r>=escape(expand('%:h'), ' \')<cr>/
noremap <C-w>. <cmd>lua require('windownav').goto_terminal()<cr>
noremap <C-w>I <cmd>lua require('windownav').goto_initvim()<cr>
noremap <C-w>' <cmd>lua require('windownav').goto_lastwin()<cr>
@@ -167,7 +167,7 @@ if has('rneovim')
endif
" Opens a terminal in the directory of the current file.
-command! TERM exec "term sh -c 'cd " . expand('%:p:h') . " && exec $SHELL'"
+command! TERM exec "term sh -c " . shellescape(printf("cd %s && exec ", shellescape(expand('%:p:h')))) . '$SHELL'
" W = w. I often click when typing :w
command! W w