Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, Whenever i want to edit a program i have to type vim.tiny progname.c. if i use vi progname.c the arrows are not working correctly. can anyone please let me ...
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3

    how to make vim.tiny as default editor

    Hi,
    Whenever i want to edit a program i have to type
    vim.tiny progname.c.
    if i use vi progname.c the arrows are not working correctly.

    can anyone please let me know how invoke vim.tiny by typing only vi .

    and also :syntax on / off commands are not working here.

    i am using ubuntu 11.10.

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    So there are a few things here.

    First of all, in your .bashrc (or .zshrc, or whatever shell you're using), set the EDITOR environment variable to the path of your preferred editor. Many programs that automatically launch an editor respect this environment variable.

    As for making "vi" refer to /usr/bin/vim.tiny (I'm assuming), you can use aliases. For example, here's a pertinent one:
    Code:
    alias vi="/usr/bin/vim -p"
    This alias makes the command:
    Code:
    vi file1 file2
    into
    Code:
    /usr/bin/vim -p file1 file2
    Add this to your .bashrc and it should all work!
    DISTRO=Arch
    Registered Linux User #388732

  3. #3
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Quote Originally Posted by oxpac View Post
    and also :syntax on / off commands are not working here.
    I believe vim.tiny does not support syntax highlighting (guess that would make it less tiny). You'll probably have to stick with vim if you want that.

  4. #4
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    358
    I like to use 'edit' as the alias for my editor. That way I can change editors at will by just editing .bashrc, and still have all my editors available using their names. But that's just me, you can use any alias you want.

Posting Permissions

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