20.4.10

the nice editor and the backspace

Subtitle: The sad state of Backspace and Delete key in linux(cit.)

For a newbie, what is the scariest part in a linux system? A lot of people hate linux 'cause "in a forum they made me open a DOS prompt to solve...".
The console is a powerful tool, but a lot of people doesn't like it.
Personally I prefer a lot of console applications, for the lighteness and the power of simple commands; sometimes is useful a quick edit in the console window of a configuration file, so I searched for a text editor that didn't change my mental keybinding. You know what I mean.
ctrl+c is for copy, ctrl+v is for paste, ctrl+x is for cut, ctrl+s is for saving, ctrl+q is for quit, ctrl+f is for search and ctrl+r is for replace.
In my experience, they are the same in EditPlus, UltraEdit, Notepad++, eclipse, kwrite, gedit: graphical text editor.
So after using vi, emacs -nw and nano for those dirty jobs I found ne.
It's the text editor that I'm searching for, just a console tool with the gui guys keybindings.
But...
The only thing that didn't work is the backspace key in urxvt. It's a well known problem in linux terminal, explained here (from the author of ne, Sebastiano Vigna).
The quick fix is the export TERM=gnome way, but I didn't like it, 'cause in some application it may cause mistake.
So I written a trivial fix for this:
~/bin/ne.sh

#!/bin/sh
export TERM=gnome
/usr/bin/ne $1
export TERM=rxvt

and added to my .zshrc

alias='ne=~/bin/ne.sh'


Fix'd! :)

5 commenti:

  1. a) you are a whimp
    b) change the script to:

    #!/bin/bash
    TERM=gnome /usr/bin/ne $*

    RispondiElimina
  2. But.. but.. why bash? why loose the original TERM value after exiting from ne?

    $*: new thing learned :)

    RispondiElimina
  3. bash because it's the shell installed everywhere, the same script works in zsh too. and you don't loose the original value of TERM, that's the syntax for a local assignment.

    RispondiElimina
  4. just do:
    alias ne="TERM=gnome ne"
    ;-)

    RispondiElimina

Hello, new comment!

Warning

My first language isn't english. Feel free to gently correct my words. :)
Powered By Blogger