Mappings that never go away

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Mappings that never go away

Bill-199
This n00b wants to delete a map in my _gvimrc (vim72 on Windows).

I made this underlining map => map ,u yypVr-

But vim says this is "Not an editor command: yypVr-"

OK, so I deleted it in my _gvimrc but it now follows me around like a
puppy.

How do I get Vim to just forget that I ever mapped ",u"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Mappings that never go away

Nikolay Aleksandrovich Pavlov
Ответ на сообщение «Mappings that never go away»,
присланное в 19:58:17 21 сентября 2010, Вторник,
отправитель Bill:

I do not see any errors in `yypVr-', but if you want to delete mapping in
currently running session, use `unmap ,u'. If you want to determine where it
comes from, use `verbose map ,u' (and delete it there, if it is also defined
somewhere except gvimrc). If you want it working, try replacing it with
`noremap ,u yypVr-' (and it will be good if you replace most of your mappings
defined with `*map' with `*noremap').

Текст сообщения:

> This n00b wants to delete a map in my _gvimrc (vim72 on Windows).
>
> I made this underlining map => map ,u yypVr-
>
> But vim says this is "Not an editor command: yypVr-"
>
> OK, so I deleted it in my _gvimrc but it now follows me around like a
> puppy.
>
> How do I get Vim to just forget that I ever mapped ",u"

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mappings that never go away

scott-268
In reply to this post by Bill-199
On Tuesday 21 September 2010 10:58:17 Bill wrote:

> This n00b wants to delete a map in my _gvimrc (vim72 on
> Windows).

> I made this underlining map => map ,u yypVr-

> But vim says this is "Not an editor command: yypVr-"

> OK, so I deleted it in my _gvimrc but it now follows me around
> like a puppy.

> How do I get Vim to just forget that I ever mapped ",u"

you fed it, you pet it, you should have known what would
happen

seriously, are you using a session file when you restart vim?

also, did you perchance also pet that puppy in your _vimrc?

to trace backwards, you can execute

    :verbose map <Leader>u

and it will tell you what it's mapped to and where it was set

hth,

sc

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Mappings that never go away

Henry Hertz Hobbit
In reply to this post by Bill-199
First be sure you didn't also add it to the %ProgramFiles%\Vim\vim##
\vimrc  (where ## is your version number) file.  Before you do any of
the rest of this make sure you edit your _virmc file and the other
system file (if you have one) with NotePad or some other editor that
is not depending on the _vimrc file to make sure the line is really
gone.  You would do the same thing with a .emacs file on 'nix.  Do not
use the editor that uses that startup file to edit the starup file.
Use some other editor instead.  You could potentially end up with
recursion problems!

If the problem still exists, then it may be caused by your history
which is in two parts. The first part which is the most likely should
be here:

%UserProfile%\_viminfo

Personally, I hate a history because I am almost never doing the same
thing I was doing the last time with the same file.  I like to start
fresh just like I have never been there. So I finally created some
script files since I edit most of my files from the cmd.exe.  It is
much quicker to do a:

C:> cd \windows\system32\drivers\etc

than it is to navigate there in either My Computer or Windows
Exploder. Well, it is when you type 100+ WPM and I do. Here are my
scripts which I drop into a C:\Scripts\ folder. Be sure to add what
ever folder you put them in to the %Path%. The reason I use a C:
\Scripts\ folder is because I have run into problems if you have a
space in the path to what you are executing.  Why oh why didn't they
make it C:\Programs\  instead?  Here is where you can get the scripts:

http://www.SecureMecca.com/public/WinVim.7z
http://www.SecureMecca.com/public/WinVim.zip

Once they are in your %Path% if you do a:

C:\> gvimc file1.txt file2.txt

It will delete the %UserProfile%\_viminfo file before it starts the
edit but it will keep a history of the current editing session.  But
if you do a:

C:\> gvimi file1.txt file2.txt

It will not only delete %UserProfile%\_viminfo but will not record
anything for the editing session (my normal edit mode).  Now you know
why I start my edits using cmd.exe.  I am almost always using gvimi.
You could put this no history in the _vimrc file but I would NOT
advise you to do that! Most people want a history most of the time.
Oh yes, on Linux the history is of course in ~/.viminfo and deleting
it when you run into the problems like this MAY clean up the problem.

The second part is a backup of the file itself. So be sure you don't
also have a  %UserProfile%\_vimrc~ file.  The default is to backup the
file itself as well. I don't see that as a problem here but I do have
this set in my _vimrc (Windows) and .vimrc (Unix / Linux) files:

set nobackup

I use scripts that make backups of files with dates instead. What I am
suggesting is clear out ALL of the history so you are starting fresh.
You should not have a problem after doing that.  If you still have
problems, you somehow contaminated your Vim program files in
%ProgramFiles% .  I highly doubt that.

On Sep 21, 3:58 pm, Bill <[hidden email]> wrote:

> This n00b wants to delete a map in my _gvimrc (vim72 on Windows).
>
> I made this underlining map => map ,u yypVr-
>
> But vim says this is "Not an editor command: yypVr-"
>
> OK, so I deleted it in my _gvimrc but it now follows me around like a
> puppy.
>
> How do I get Vim to just forget that I ever mapped ",u"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: Mappings that never go away

Gary Johnson-4
On 2010-09-22, Henry Hertz Hobbit wrote:
> First be sure you didn't also add it to the %ProgramFiles%\Vim\vim##
> \vimrc  (where ## is your version number) file.  Before you do any of
> the rest of this make sure you edit your _virmc file and the other
> system file (if you have one) with NotePad or some other editor that
> is not depending on the _vimrc file to make sure the line is really
> gone.  You would do the same thing with a .emacs file on 'nix.  Do not
> use the editor that uses that startup file to edit the starup file.
> Use some other editor instead.  You could potentially end up with
> recursion problems!

You don't need to do that.  The system vimrc and your personal
_vimrc or .vimrc are read only once, when Vim starts.  Other Vim
configuration files are read at deterministic times as well.  There
is no problem at all with using Vim to edit any Vim configuration
file.

If there is a problem with a configuration file that prevents Vim
from behaving properly, start vim with the "-u NONE" option.  If the
problem is with your .viminfo or _viminfo file and you want to edit
it rather that just blow it away, start Vim with the "-i NONE"
option.

Regards,
Gary

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php