diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-12-14 13:01:40 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-12-14 13:02:00 -0700 |
commit | 7096ef11bf9d706f0e69994ae783ccc428004918 (patch) | |
tree | bf84f491201b63a4b90739baab6a63484d673a00 | |
parent | 1c027cb7fecc7d9ff817cecd24202b639b8717c3 (diff) | |
download | config.vim-7096ef11bf9d706f0e69994ae783ccc428004918.tar.gz config.vim-7096ef11bf9d706f0e69994ae783ccc428004918.tar.bz2 config.vim-7096ef11bf9d706f0e69994ae783ccc428004918.zip |
Shell escape some commands to work with filenames with spaces
-rw-r--r-- | init.vim | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |