Wednesday, December 22, 2010

Re: edit doesn't work properly when remapping "i"

On Dec 21, 7:20 pm, sc <tooth...@swbell.net> wrote:
>
> the actual mapping occurs in $RUNTIME/autoload/netrw.vim
>
> the probably worst way of eliminating netrw's mapping to i
> would be to comment out the mapping in the above module on
> the runtime path because future upgrades would wipe it out
>

I agree with this statement. Do not edit any official runtime file in-
place, or you will forget your changes and wipe them out in a future
upgrade.

>
> assuming you refuse to learn to use vim the "right" way, you
> can copy autoload/netrw.vim to
>
>     $HOME/vimfiles/autoload/netrw.vim
>
> and comment out the mapping there -- where $HOME is what your
> vim thinks of as $HOME, not windows -- i haven't used windows
> for years so i'm flying blind here, but i think i'm right
> about the path
>

First of all, if HOME is defined on Windows, Vim will use it, so
really "what Vim thinks of as $HOME" either is the same as Windows, or
Windows doesn't have any concept of HOME (normally the case).

Secondly, I would discourage this method of copying a single portion
of a runtime plugin to a local area and modifying it there. If you do
this, you may break your netrw plugin in a future install, because
generally plugin authors do not check to make sure the correct version
of EVERY FILE in their plugin is loaded. They generally assume that a
user will have a complete copy of the entire version of a plugin.

If you want to solve this by modifying netrw, you will need to copy
EVERY FILE netrw uses, not just the one you want to modify. I do not
know all the files involved, but probably there are some in the
plugin, ftplugin, syntax, and autoload directories. You way also wish
to copy over the documentation so you do not have documentation that
mismatches the actual plugin installed.

So, instead of this, I would recommend that you add an autocmd to
your .vimrc that will restore your mapping:

autocmd FileType netrw noremap i <Up>

Or, add a file in your $HOME/vimfiles/after/ftplugin directory called
netrw.vim, containing your mapping:

noremap i <Up>

--
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

No comments:

Post a Comment