Nano editor is one of convenient text editors in unix. If You ever have trouble with vim (I do) You could find nano editor very friendly. But unix people make difficult anything that can be very easy. Keyboard layout is unbelievable inconvenient... what authors smoking? Fortunately it can be easy fixed by .nanorc file. Symply make new file .nanorc in home directory with content followed below. It will make keyboard bindings almost same as on Windows.
After restart nano editor will use standard shortcuts - Ctrl-S for save, Ctrl-O for open files, Ctrl-C for copy, Ctrl-V for paste, etc. Although there is some problem with undo/redo. Seems undo shortcut is hardcoded to Alt-U and Alt-Y for redo.
~/.nanorc
set undo set autoindent set mouse bind ^S writeout main bind ^O insert main bind ^G gotoline main bind ^X cut main bind ^V uncut main bind ^C copytext main bind ^H replace main bind ^Q exit main bind ^Z undo main bind ^F whereis main bind F3 searchagain main bind F1 help main
Updated layout:
Ctrl-Q leaved for exit for compatibility
Cut line replaced by Ctrl-Y, which is common for cut line
set undo set autoindent set mouse bind ^S writeout main bind ^O insert main bind ^G gotoline main bind ^Y cut main bind ^V uncut main bind ^C copytext main bind ^H replace main bind ^Z undo main bind ^F whereis main bind F3 searchagain main bind F1 help main
What's the problem with Ctrl-Q ?
ReplyDeleteCherry MX Red Mechanical Switches - Smooth, linear key response for ultra fast double and triple taps without the audible click, 45g Actuation Force, 2mm to actuation and 4mm to bottom, Rated to 50 million operations, Gold contacts cheap mechanical keyboard
ReplyDelete