1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Control-U alias for Escape (command line editing)

Discussion in 'Support' started by tmaynard, Nov 17, 2013.

  1. tmaynard

    Joined:
    May 2, 2012
    Messages:
    25
    Likes Received:
    0
    In my bash/zsh alternate universe, and in a lifetime of VMS and UNIX use before that, I grew so accustomed to typing ^U to delete the entire command line (what ESC does in TCC).

    I did manage to come up with a working alias some time ago, but a hard crash and a flawed recovery later I have lost that alias, and despite my renewed attempts to figure it out a second time I remain stymied.

    How can I alias <C-u> to <Esc>?
     
  2. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    In your .INI file ("%_ininame"), in the [4NT] section, add this line:
    Code:
    DelToBeginning=Ctrl-U
    
    I've used this for years, due to decades of using it the same way you did, from half a lifetime of working with (and for) VMS.

    You might also like:
    Code:
    DelWordLeft=Ctrl-J
    EndLine=Ctrl-E
    
     
  3. tmaynard

    Joined:
    May 2, 2012
    Messages:
    25
    Likes Received:
    0
    Hot dang! That's it exactly. Thank you for that. Although I used ASR-33, ADM-3a, VT-52 and VT-100 terminals in the beginning, I became quite accustomed to the VT-220 (amber, no less), so the others will be less helpful ... but I may try mapping a few Vim keybindings that way, since they fall naturally under my fingers these days.

    Much appreciated: I would likely never have found that tip again, and I was driving myself crazy in the interim. My sanity and I salute you, sir.
     
    #3 tmaynard, Nov 17, 2013
    Last edited: Nov 17, 2013
  4. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    Each key can be assigned ("mapped") for a different purpose in each of the input modes: (command line) edit, list, popup, and general input. If you try to assign a key in a specific mode for which it has a different default assignment, you must first remove the default assignment by the appropriate normal key directive. The list of actions for default keys is in the HELP pages for each mode, but you need an eagle eye to find it by key names. But never fear, there is a simple experiment you can do. Add the desired assignment to your .INI file. If it does what it did before - you need the normal key directive. If it works as you want it, no normal key is needed.
     
  5. tmaynard

    Joined:
    May 2, 2012
    Messages:
    25
    Likes Received:
    0
     
  6. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
    If your interest is limited to the issue in your OP, my post is definitely overkill. However, if you care to duplicate other 'nixisms it may be of interest. It was intended as information which is not necessarily obvious from HELP.
     

Share This Page