Adventures with neovim, evil terminals, and machine bootstrapping

So, I’m rewriting my dot files repository with a proper easy one-script installer. It’s more like a bootstrapping new Linux development machines. It should handle all (ubuntu-based) package requirements, symlinking the repository’s dot files with the system’s dot files (for easy syncing) and some other cool stuff (like compiling neovim!).

During this process which is done on a VirtualBox Mint MATE I encountered many annoying stuff mostly involving neovim. This is how I fixed them, or at least attempted to.

neovim is doing funny stuff in the terminal

That’s the mate-terminal for you. This should work for you actually, as the bug was fixed by a pull-request that should have been merged by the time you read this.  I’m just excited because I had to test this PR locally which involved GitHub magic stolen from this gist (which is awesome, CMake also). I got to the PR from this issue.

Fixed.

Everyone likes tmux but me (I like it secretly, and on servers)

I’m not even sure if this is how the world works, as every terminal emulator these days has tabs and all kinds of fun stuff, but my friend told me he uses tmux at work while he’s vimming (haha! he’s not using neovim!). I thought giving it a try on my local machine’s terminal. After all, you can split and vsplit terminals and look like a hax0r.

Worth mentioning and essential to the story is that I use awesome vim themes (which are also neovim themes, and I think I’ll stop mentioning neovim every 3 words neovim) that require the terminal to support 256 colors. While running nvim on the terminal stuff look amazing. However, running nvim under tmux proved to be a kakashka of a cat. Colors were a bit funny, and trying to <C-j>/<C-k> in CtrlP (which is actually good if you :help ctrlp-commands and learn its game) just didn’t show the selection that you were to consider. Horrors.

Now, let the terrible fixing begin.

$ echo "This is terrible:"
$ tmux -2

This forces tmux to run in 256 colors. But you don’t want to alias tmux to tmux -2 because it’s dirty.

What you wanna do is have your $TERM set to something interesting.

$ echo "This is also terrible:"
$ TERM=screen-256color tmux

It can actually be xterm-256color or something like that, there’s another guy with 256color I think.

So you can set this up in your .bashrc or .profile, but you shouldn’t! Why? Because the Arch people said:

Do not set the TERM variable from your ~/.bashrc or ~/.bash_profile or similar file.

~Arch people

But! Guess what?

I don’t care.

I put it in my ~/.profile but I don’t think it’s the correct place and I don’t feel like logging in/out to find out. Worse case I’ll put it in some .bashrc or its relatives.

This morning I went to the post office to get my MIDI keyboard pedal controller that I ordered from the Chinese people at aliexpress.com. It’s so awesome! Playing the keyboard with sustain is very freshening and it’s a dream coming true, after buying my MIDI keyboard in the first place (the M-Audio Code 49, which is ok), my first dream.

Have you encountered similar issues? Maybe something I wrote above is utter bullshit? Are you an Arch guy who wanna look down at me and snort? I’d be more than happy to hear from you and have your thoughts shared.

May you never eat kittens in a soup or with bread,
Amir