Getting myself to use j,j,k, and l in vim

It’s been quite a while since I blogged, more than 6 months or so. Between a family emergency in December,

I’ve been using vim for a while now, I guess about 2 years? Heck, I’m even writing this post in vim (yay, jekyll!). After all this, I was using arrow keys for moving around in vim. I thought, they worked for me, until I recently read a blog post about vim One of the suggestions in there was to map the arrow keys to in normal mode and insert mode. I’ve tried it out for a week now, and I wonder, how did I ever use the arrow keys; h, j, k, and l make so much more sense)

If you’ve always wanted to get rid of your arrow key habit, add this to your .vimrc!

nnoremap <up> <nop> nnoremap <down> <nop> nnoremap <left> <nop> nnoremap <right> <nop> inoremap <up> <nop> inoremap <down> <nop> inoremap <left> <nop> inoremap <right> <nop> 

The one place where I used arrows was for vim completion with ^N and ^P. Quickly, I learned that ^N and ^P can replace the arrow keys there too! It’s still not yet muscle memory, but pretty close.

Embedding a terminal with byobu

The other day I blogged about how I was looking for embedded terminal in vim and found something hilarious. This post is about how I solved what I was trying to do.

Typing this blog post on the kind of setup I'm writing about

I know I can do :shell, but that’s quite not what I wanted. Here’s how I got it working the way I want with byobu:

  • Open a terminal and start byobu.
  • Type C-a S, basically, Ctrl followed by a, and then capital S.
  • Then, C-a :, so you can type commands to the screen.
  • Now you can type resize +15 to increase the size of the top split
  • C-a Tab, to switch to the other split
  • C-a c to create a new terminal there.
  • Use C-a Tab to switch between the splits.
  • ???

I’d love to make this into some kind of config that I can load, but I haven’t discovered that yet. If someone knows how, please do let me know in the comments!