3 ms·
Can you please elaborate how you make use of the built in terminal emulation of neovim? Whenever I see a mention I think "neat" but have yet to integrate it int
by 101km 9y ago
Can you please elaborate how you make use of the built in terminal emulation of neovim? Whenever I see a mention I think "neat" but have yet to integrate it into my workflow.
- has2k1 9y agoNot parent, but I use Neovim and Ranger [1] filemanager and I have a shortcut to open Ranger in a split or full window from which I can browse and open a file. You can do this only because Neovim has a built-in terminal. This may end up replacing vinegar [2] as my in-VIM filemanager. [1] https://github.com/ranger/ranger https://github.com/ranger/ranger [2] https://github.com/tpope/vim-vinegar https://github.com/tpope/vim-vinegar
- cschneid 9y agoSo the nesting you have is Shell -> Nvim -> Ranger, so ranger is contained inside of a vim split? Mind sharing some docs on how to do that?
- Tarean 9y agoLazy version would be `:vsplit | lcd %:h | term ranger<cr>`. `vsplit` splits the window vertically. `lcd` sets the bufferlocal working directory which is a new feature in neovim. `term ranger` launches the terminal emulator. If you wanted to be fancy you could add a toggle that reuses the same ranger instance which'd add an additional ~10 loc.
- has2k1 9y agoI use a plugin ranger.vim [1]. Although it works for plain VIM, it is very clunky, since ranger is opened with a !command you get a blocking terminal. The nesting really is tmux -> Shell -> Nvim -> Ranger. https://github.com/francoiscabrol/ranger.vim https://github.com/francoiscabrol/ranger.vim
- soraminazuki 9y agoStuff like fzf (https://github.com/junegunn/fzf https://github.com/junegunn/fzf) works nicer with terminal emulation.
- nat 9y agoI use it a lot when doing exploratory SQL work or writing queries. I can tinker with my query in one pane and send it over to the `psql` repl in the other. I do use psql's `\e` command to open the previous query in your `$EDITOR`, but that only lets me get the single previous query, and throws out any comments.
- nolliebs180 9y agoLike a lot of other IDEs, it is convenient to have a console to focus over to then run ad-hoc cmdline stuff or run tests for the currently active project. This is what I use :terminal for the most. It was helpful for me to setup the below keybingds for focusing back/forth between a :terminal split and my "editing" splits: tnoremap <C-h> <c-\><c-n><c-w>h tnoremap <C-j> <C-\><C-n><C-w>j tnoremap <C-k> <C-\><C-n><C-w>k tnoremap <C-l> <C-\><C-n><C-w>l nnoremap <C-h> <c-w>h nnoremap <C-j> <c-w>j nnoremap <C-k> <c-w>k nnoremap <C-l> <c-w>l
- fao_ 9y agoI use it to either run microservices for testing, or for testing code in the erlang shell. It's MUCH easier to copy and paste inside vim and be able to copy logs out into a buffer to run sed expressions on it, than if I were using another terminal.