Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 7 of 7

This is a discussion on command line editing and vi setup in the Shared & Semi-Dedicated forum
I'm an experienced UNIX and vi user. I'm looking for the equivalent of what was called command line editing on the Korn Shell (ksh), where ...

  1. #1
    JPC Member
    Join Date
    Mar 2003
    Posts
    11

    command line editing and vi setup

    I'm an experienced UNIX and vi user. I'm looking for the equivalent of what was called command line editing on the Korn Shell (ksh), where I could pull up a previously executed command by hitting the Esc key. This would put me in a "one line vi editing mode" and I could easily rerun previous commands.

    Looks like this Linux system runs something called bash. Is there a way to set up analogous ksh command line editing under bash? In ksh this setup was done in the .profile but I didn't see a .profile in my login directory

    Also, I note that my vi editor on this system paints lines in a file in an attempt to "help" me see the structure of the file. That's OK sometimes but there are times when I just want to see a plain file without any painting by vi. I presume there is a vi setting that controls this. What is it?

    Denis

  2. #2
    JPC Addict randyriegel's Avatar
    Join Date
    Jan 2002
    Location
    Wintersville, OH
    Posts
    161
    Previously executed commands can be brought up by using the up arrow key. There should be a .bash_profile file in your home directory.

  3. #3
    Ron
    Guest
    If you want to use vi editing commands on your recalled command lines, issue the command "set -o vi". There may be others, but that's what I use.

    To recall a previous command, hit esc-k then each time you hit k, it will move backwards through your command history. j is forwards, "/" initiates patter-matching search.

    To make that setting permanent, create a file called ".bashrc" and in it two lines:
    Code:
    set -o vi
    export EDITOR=vi
    Permissions should be 744

    For fixing vim to look like vi (not highlighting search words), create a file called ".vimrc" with the line
    Code:
    set nohlsearch
    Permissions should be 644

    I'll have to look up how to prevent what you're calling "structure painting".

  4. #4
    Ron
    Guest
    While I'm looking, here's a good resource for the .vimrc file:
    http://www.vim.org/htmldoc/usr_05.html

  5. #5
    Ron
    Guest
    the command line to turn off "syntax highlighting" is

    :syntax off

    to turn it back on is

    :syntax enable

    How arcane is that.....?

    If you want to do that as default, add the line
    Code:
    syntax off
    into the aforementioned .vimrc file.

    Good luck!

  6. #6
    JPC Member
    Join Date
    Mar 2003
    Posts
    11
    Thanks Ron. I have everything working the way I like for command line and vi editing now. Your responses saved me a lot of searching and I bookmarked the vim manual page.

  7. #7
    Ron
    Guest
    Glad to help ... I'm sure you'll pay it forward some day.

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
  •