• Home
  • Shell
    • Emacs
    • Perl
    • screen
    • sed
  • Ubuntu
    • VNC
  • Web Development
    • Javascript
    • Joomla
    • MySQL
    • osTicket
  • Windows
    • Gimp

Posts tagged key

BASH> Fix vi arrow keys in insert mode

Mar28
2013
Written by Scott Rowley

Full credit to Michael S. Kirkpatrick

The following fix saved my sanity

I prefer using vi as my text editor, because it is clean and simple. I don’t have to go searching for commands from drop-down boxes and other GUI crap. But arrow keys and backspace are sometimes problematic, depending on the OS you’re using. In my case, I frequently ssh from Linux to SunOS, and the SunOS vi doesn’t like my keyboard mappings.

Here is my (partial) solution. Open ~/.exrc and add the following lines. In case it is not obvious, do not type the letters inside brackets, but press those keys instead (i.e., [ctrl-v] means you hold the Ctrl key while pressing v).

— Michael S. Kirkpatrick

:map! [ctrl-v][backspace] [ctrl-v][esc]xa
:map! [ctrl-v][up-arrow] [ctrl-v][esc]ka
:map! [ctrl-v][down-arrow] [ctrl-v][esc]ja
:map! [ctrl-v][right-arrow] [ctrl-v][esc]la
:map! [ctrl-v][left-arrow] [ctrl-v][esc]ha

When you type these in (assuming you’re using vi or vim, these lines will look like this.

:map! ^? ^[xa
:map! ^[OA ^[ka
:map! ^[OB ^[ja
:map! ^[OC ^[ha
:map! ^[OD ^[la
Posted in BASH - Tagged arrow, backspace, control, ctrl, down, editor, esc, escape, exrc, fix, keys, left, map, Michael S. Kirkpatrick, right, up, vi, vim

BASH> Set DELETE key in Putty/Poderosa/SecureCRT

Oct26
2010
Written by Scott Rowley

For Poderosa/Putty
– Create or edit the ~/.inputrc file with the following code:

"\e[3~": delete-char

For SecureCRT

Click Tools
Keymap Editor
Click the "DEL" button
Click Map Selected Key
enter in "\e[3~" (no quotes)
Hit OK
Save
Posted in BASH - Tagged delete, poderosa, putty, securecrt, terminal

Emacs> Set delete key in emacs

Oct26
2010
Written by Scott Rowley

I really hate that the delete key backspaces. I’m sure there is a lot of pointless posturing on how this is the ‘old school’ way. Well… 1) I don’t care 2) I’m new school and I want a backspace key AND a delete key…
Add the following line to your ~/.emacs file:

(global-set-key (kbd "") 'delete-char)
Posted in Emacs - Tagged backspace, BASH, delete, Emacs

Corrections? Questions? Comments?

Find an error?
Everything work out great for you?
Have some feedback?
Like to see something added to the article?

PLEASE leave us a comment after the article and let us know how we are doing, or if something needs corrected, improved or clarified.

Thank you!
- The Management

Advertisement

Sudo Bash
By Geeks - For Geeks

Back to Top