[SATLUG] vi editor and insert mode as regular user

Robert Pearson e2eiod at gmail.com
Fri Jul 24 15:51:22 CDT 2009


On 7/24/09, John D Choate <jdchoate at gmail.com> wrote:
> On Friday 24 July 2009 00:52:30 Brad Knowles wrote:
>  > on 7/23/09 10:00 PM, Chris Hudson said:
>  >
>  > >   Not sure what the issue is, but just wanted to mention that you shouldn't
>  > > have to use the arrow keys to move around in Vi.
>  > > The j and k keys will move you up and down, and w and b will move you
>  > > forward and backward a word at a time.
>  >
>  > Indeed, being dependent on the extra keys working (like insert, cursor
>  > keys, etc...) is a crutch that you want to stay away from.  There are
>  > times when your terminal settings are badly enough messed up that you
>  > simply can't type these key sequences at all, or if you do type them
>  > then they don't have the effect you want.  With vi, you really, really
>  > want to learn the original native commands and sequences for everything.
>  >
>  > Also, don't get wrapped up in vim extensions (like color syntax parsing,
>  > or whatever), because vim is not universal, whereas the core vi stuff is
>  > pretty universal.
>  >
>  >
>
>  OK, but what about 'delete' and 'backspace'? I am not a perfect typist and make errors from time to time and those keys can come in handy for editing.
>  We are now straying away from my original question which was, basically:
>  Why is there the difference in behavior of vi for the root user and a regular user.
>  I want no more lessons in using the vi commands, tyvm. I can read the man pages and google for that stuff.
>
>
>  --

If the same keyboard is being used for both root and the user then the
type of keyboard is not a source of the problem. Because of keyboard
key character problems I use the "vi/vim" letter keys for "delete" and
"backspace". In the last few years the "arrow" key character codes
seem to have stabilized to where I rarely have trouble with them in
"vi/vim".
Excellent Help page here:
<http://vimdoc.sourceforge.net/htmldoc/motion.html>
[Main Help page]<http://vimdoc.sourceforge.net/htmldoc/help.html>

The vi/vim "set all" command typed at the command line prompt ":"
within vi/vim will show you what values are set inside of vi/vim.
<http://vimdoc.sourceforge.net/htmldoc/options.html>

The "set {option}" command within a vi/vim session that value is only
good for that session.
It is not permanent. To make your personal Vim preferences persist
over sessions you can create the file "$HOME/.vimrc". Key mapping (and
adding) preferences are common uses. Programmers frequently map keys
in this file to be able to quickly change the programming language
profile to the language they are using at the moment. Very powerful
option...
Be aware that most systems already set a lot of vi/vim options for you
in the standard "User Login" process. The "set all" command within
vi/vim will show what they are.
<http://vim.runpaint.org/basics/configuring-vim/>

Vi/Vim is a very powerful tool that can be customized beyond
recognition for text and even rich text emulation. It can do
non-document Word processing. Very handy for program development.

Everything that Bruce says is good stuff too.

HTH


More information about the SATLUG mailing list