Re: vi question

From: Tim Hammerquist (tim_at_vegeta.ath.cx)
Date: 06/12/03


Date: 11 Jun 2003 17:41:59 -0700


[f-up's set to comp.editors]

Mike G. graced us by uttering:
> can someone tell me how i can get "vi" to recogize the 'end'
> and 'home' keys.
>
> basically i'm looking for vi to mimic windows notepad.

You didn't mention which vi you're using (vanilla, vim, nvi,
etc.), but GVim 6.x (which is possible the most portable of vi
clones) supports Notepad-like operation with it's "evim" alias.
It should work on any complete 6.x GUI install of Vim, but
requires a GUI. evim should take care of a lot of this type of
thing automatically, though I don't use it.

> i'm assuming there is some sort of key mapping that i need to
> put in a configuration file....
>
> also, try to keep it simple, i'm not to skilled with unix.

Not to discourage, but vim is usually not the simplest editor for
a Windows user to become accustomed to. evim (above) can help
with some, but vi itself is so different from what so many Win32
users are used to that we lose some of them to Emacs. ;)

BTW, the vi way to accomplish the Home/End function:

In normal mode:
    End: $
    Home: ^ or 0 (zero)

The '0' command will place the cursor in the very first column of
the current line, whereas the '^' command will place the cursor
in the first non-whitespace character on the line.

Vim takes care of these keys for me (Home placing in first
column), so I can only assume you're not using Vim. For other
vi's, you can use the :map command to try to simulate this.

HTH,
Tim Hammerquist

-- 
A witty saying proves nothing.
    -- Voltaire


Relevant Pages

  • Re: okay, time to ask the wizards.
    ... You could also open the file in vi or Vim and give it this command: ... Note that you don't type in that ^M by using the ^ and M keys on the ... you first type ctrl-v then press the Enter key. ...
    (freebsd-questions)
  • Re: vim: SCO
    ... All is OK except the the Global hot keys. ... and have time to think which command to use, gvim/ ... vim will lead to XIM/Insert mode. ...
    (comp.editors)
  • Re: Great SWT Program
    ... there the arrow keys *sometimes* did something useful, ... both about how vim works and about ... called by all applications -- except that with the Unix model you ... for their putative purpose due to the clumsy interface that makes ...
    (comp.lang.java.programmer)
  • Re: Mapped vim shortcuts
    ... It used to work just fine for me too, when it was released some years ago; then came the exciting alpha versions, and later the releases, of Vim 7 with a lot of new features. ... A ":write file" command no longer resets the 'modified' flag of the buffer, ... Now only the window is closed. ... The patch was provided by Mattias Flodin. ...
    (comp.editors)
  • Re: [Full-disclosure] Vim: Arbitrary Code Execution in Commands: K, Control-], g]
    ... Product: Vim -- Vi IMproved ... command is assembled, and on line 5564, it is executed as a regular Ex ... No special shell escaping is done for the ``K'' command, ... Keyword Program Command Line Switches ...
    (Full-Disclosure)