So today I read How To Switch Between TTYs Without Using Function Keys In Linux and learned about the `chvt` command which can change the virtual terminal on the host’s physical console. This is gonna come in handy!
Tag Archives: terminal
What to do if you accidentally press Ctrl+S in Vim
If you press Ctrl+S in Vim (i.e. because that’s hard-wired for ‘save’) your terminal may lockup, depending on how it’s configured.
If you want to know why, have a read here. If you just want to get on with life, press Ctrl+Q!
Everything is easy when you know how.
Fixing meta-keys in Vim via Mac OS X Terminal.app
So I configured Terminal.app to use Option (Alt) as Meta key: Terminal => Preferences => Profiles => Keyboard => Use Option as Meta key
nmap <M-j> mz:m+<cr>`z nmap <M-k> mz:m-2<cr>`z
So I found this article: Fix meta-keys that break out of Insert mode and ended up with the following snippet for my .vimrc which fixed my Meta-key problem:
let c='a' while c <= 'z' exec "set <M-".tolower(c).">=\e".c exec "imap \e".c." <M-".tolower(c).">" let c = nr2char(1+char2nr(c)) endw
Everything is easy when you know how!
When you’re at a Unix terminal and your terminal goes screwy, try typing “stty sane” to reset it. Handy!