Results 1 to 7 of 7

Thread: Force Terminal to use VI and nothing else

  1. #1
    Join Date
    Mar 2013
    Beans
    2

    Force Terminal to use VI and nothing else

    Sorry if I am not precise, thus posting in this area. (:

    In my work environment, I have to jump on a lot of AIX boxes, and the terminal on these are straight VI. No arrow / tab keys allowed.
    I am practicing a lot on my home Ubuntu install, but I find myself using the arrow keys and the tab key a lot.

    So to train myself to use only VI, I was wondering how to change bash to use VI only - including removing arrow keys, tab keys, and any other key that is not used in an AIX install.

    I'm using

    bash -version
    GNU bash, version 4.2.37(1)-release (i686-pc-linux-gnu)
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

    TIA for any advice on this.

    Rick

  2. #2
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    3,594
    Distro
    Xubuntu 17.04 Zesty Zapus

    Re: Force Terminal to use VI and nothing else

    Try vi -C. This will start vim in compatibility mode, making it behave almost identical to vi. Not sure whether it will do everything you want.

  3. #3
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Force Terminal to use VI and nothing else

    Put set -o vi into file ~/.bashrc

    @Impavidus I guess the OP means bash command-line editing mode.
    Last edited by schragge; March 24th, 2013 at 07:49 PM.

  4. #4
    Join Date
    Sep 2012
    Location
    I think EARTH
    Beans
    76
    Distro
    Ubuntu 12.04 Precise Pangolin

    Smile Re: Force Terminal to use VI and nothing else

    Try this command
    Code:
    export EDITOR="vi"
    Next try and open the crontab file by doing crontab -e. This will open the cron file in vi editor instead of the nano.In the above command if you specify nano (instead of vi) the cron file opens in the nano editor.

    To choose vi/vim as the default editor permanently just put the above code in the ~/.bashrc file and restart your system.

  5. #5
    Join Date
    Mar 2013
    Beans
    2

    [SOLVED] Re: Force Terminal to use VI and nothing else

    Thanks all, this seems to be working, the arrow keys and tab keys still work, but I'll keep off of them.

  6. #6
    Join Date
    Apr 2012
    Beans
    7,093

    Re: Force Terminal to use VI and nothing else

    ... maybe it's just a question of the shell you are using? iirc AIX used the Korn shell, there are a couple of Korn shell alternatives in the repos that you might want to play with

    Code:
    $ apt-cache search --names-only ksh
    kshisen - Shisen-Sho solitaire game
    pdksh - Public domain version of the Korn shell
    ksh - The real, AT&T version of the Korn shell
    kshutdown - advanced shut down utility for KDE
    mksh - MirBSD Korn Shell

  7. #7
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Force Terminal to use VI and nothing else

    Starting from quantal, pdksh is just a dummy package that installs mksh:
    Code:
    $ apt-cache -n search ksh$
    ksh - Real, AT&T version of the Korn shell
    mksh - MirBSD Korn Shell
    pdksh - transitional dummy package to migrate from pdksh to mksh
    Last edited by schragge; March 26th, 2013 at 02:00 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •