1

I've traditionally used vim as a text editor and tmux as a terminal multiplexer, but I'm trying to see if I can drop tmux entirely and just use vim for everything (except session attach/detach, which will be handled by an external tool). So far, I have almost zero knowledge about terminal emulators in vim and how to customize them.

My main question is: should I base this setup upon neovim or vim 8? From what I gathered, terminal support is largely different in those 2 programs. I know that neovim implementation should be more mature, since it got terminal first, but I also noticed that terminal help in neovim is very sparse, while help page in vim 8 is much more expansive.

My second question is whether that's at all feasible.

Here are some of the functionality I'm hoping to achieve (don't yet know if all of this is possible):

  • Open new splits with terminal similar to tmux (each split is a separate terminal)
  • Ability to go into netrw from terminal with working directory being one opened in shell
  • Start terminal in currently from directory currently open in netrw
  • Have separate working directory for each tab/split
  • Edit terminal command in normal mode without opening nested editor with C-x C-e
1

should I base this setup upon neovim or vim 8?

If you don't have any problems with Vim, there's no need to switch to Neovim. In particular, Vim's terminal support is very decent.

Open new splits with terminal similar to tmux (each split is a separate terminal)

Yes, it's trivial. In fact, it's hard to avoid this.

Ability to go into netrw from terminal with working directory being one opened in shell

First, netrw sucks. Seriously consider migrating to NERDTree or vim-dirvish (or maybe vim-vinegar).

Second, that requires Vim to get CWD of another process. In general, that could be tricky, but as for shell you probably can live with term_gettitle().

Start terminal in currently from directory currently open in netrw

That's not about terminal support, but rather about netrw/other plugin. Easily done with dirvish. Perhaps, the same for others.

Have separate working directory for each tab/split

Again, that has nothing to do with terminal support (every process has CWD of its own anyway). But every window (and tab) in Vim can also have CWD of its own (see :h lcd).

Edit terminal command in normal mode without opening nested editor with C-x C-e

Vim (and also Neovim) has Normal mode for terminal window, but it's read-only. It should be possible to do some tricks with tnoremap and term_sendkeys(), but that will not be true editing mode either. Bash setting set -o vi should be much more practical.

  • 1
    *netrw sucks*—meh, that’s your opinion. I like it. It has advantages and disadvantages, like everything... great answer ‘til I read that though... – D. Ben Knoble Sep 27 at 23:38
  • 1
    @D.BenKnoble Maybe that sounded a bit harsh, but I became too frustrated when attempted to use it. And although all "file managers" for Vim surely have some flaws and a "standard" plugin should normally be preferred, but I still ended switching to dirvish which, IMO, is a lesser evil. The support level of netrw is awful. Why, they even haven't fixed the bug which prevents going to the drive's rootdir under Windows for years, and you have to apply the patch manually. Custom scripting for netrw is also very inconvenient, especially compared with a "regular buffer" model of vinegar/dirvish. – Matt Sep 28 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.