vim-floaterm
vim-floaterm copied to clipboard
toggle floaterm in current file directory instead of working directory?
gone through the docs and reamdme but didn't find what i am looking for. So, is there any way to toggle floaterm in current file directory (directory of current buffer) instead of working directory?
This can be achieved in command mode by:
:FloatermNew --cwd %:h
where, %:h
refers to full path to current file without filename itself. Check link here to know how files/directories are named in vim.
A shortcut for this feature is also nice, I use <leader>7
noremap <silent><leader>7 :FloatermNew --cwd %:h<CR>
i use penvim to detect and change working directory to project root directory.
:FloatermNew --cwd %:h<CR>
don't work. it just opens the floaterm to root directory instead of current file directory
Just checked, only :FloatermNew --cwd=<buffer>
works, and :FloatermNew --cwd <buffer>
still open in <root>