Improve nano and make it work with shortcuts used in windows
Posted 08-14-2012 at 04:15 PM by deskt0plinux
Updated 08-14-2012 at 04:19 PM by deskt0plinux (added note about keybinding working only for 2.x)
Updated 08-14-2012 at 04:19 PM by deskt0plinux (added note about keybinding working only for 2.x)
I use these lines in a file .nanorc in my home directory - eg:
/home/deskt0plinux/.nanorc
For a full explanation of the options do man nanorc
Note !
Possibly the entire section with "bind ..." might not work on older versions of nano (before 2.x), that is, shortcut mapping works only since 2.x AFAIK.
----------
If you put the above file in your home directory, the following should result:
This makes nano recognise the default Windows shortcuts - Ctrl+C, Ctrl+X, Ctrl+V.
Note that Ctrl+Z may not work - undo works only in newer versions of nano (v2.2+ AFAIK).
M-X stands for Alt-X which suspends to the shell/command-line. To resume from that shell back into nano type "fg" (for "foreground").
M-Q = Alt-Q = Quit.
Happy editing!
/home/deskt0plinux/.nanorc
Code:
set autoindent set boldtext set brackets ""')>]}" set const set historylog set matchbrackets "(<[{)>]}" set mouse set multibuffer set regexp set smarthome set smooth set suspend set tabsize 4 set wordbounds set softwrap bind ^S writeout main bind ^W nowrap main bind ^F whereis main bind ^G searchagain main bind ^C copytext main bind ^X cut main bind ^V uncut main bind ^L gotoline main bind ^H replace main bind ^I indent main bind ^J unindent main bind ^B findbracket main bind ^Z cancel all bind ^Y redo main bind ^P prevbuf main bind ^N nextbuf main bind ^O insert main bind M-X suspend main bind M-Q exit main bind M-H firstline main bind M-E lastline main bind F1 help main bind F5 refresh main
Note !
Possibly the entire section with "bind ..." might not work on older versions of nano (before 2.x), that is, shortcut mapping works only since 2.x AFAIK.
----------
If you put the above file in your home directory, the following should result:
This makes nano recognise the default Windows shortcuts - Ctrl+C, Ctrl+X, Ctrl+V.
Note that Ctrl+Z may not work - undo works only in newer versions of nano (v2.2+ AFAIK).
M-X stands for Alt-X which suspends to the shell/command-line. To resume from that shell back into nano type "fg" (for "foreground").
M-Q = Alt-Q = Quit.
Happy editing!
Total Comments 0