I started using VIM as my editor for programming and general use. That also meant switching my command line environment shortcuts to VI rather than Emacs.
This post highlights a few interesting problems I had and how I solved them. For a shell I use ZSH and my terminal emulator is Gnome-terminal. I should probably start using Tmux as well but haven’t yet really gotten into the habit.
- VI mode in ZSH (perhaps BASH for others)
- Remap
escape
key- xmodmap
- xmodmap command in .*rc files didn’t work as expected
- script to customize gnome terminal
- xmodmap
- command history search
control R
VI keybindings
I put the following in my .zshrc
file.
Command History Search
If you use VI keybindings, then control r
command history is broken. I found a fix on SO as I recall, here it is:
Xmodmap
I put the following code into a file named .Xmodmap
.
Xmodmap in a script
Terminal Short Cut
When I open a terminal I like the dimsenions of the screen to be full height of the screen and an 80 character width. Gnome terminal has command line arguments for this.
After the terminal is opened, I want xmodmap to remap my keys for me.
Now I have a working VI mode where Escape is mapped to the Caps Lock key, my terminal opens to decent dimensions and my command history search works. I’m pleased for mow.
Next up, Tmux configuration that I like.