Tuesday, December 21, 2010

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

On Tuesday 21 December 2010 11:57:05 Andrej08 wrote:

> I'm using GVim 7.3.46 on XP32

> Here's part of my vimrc:
> " Movement
> noremap i <Up>
> noremap j <Left>
> noremap k <Down>
> noremap h i

> This works in all modes, except when using edit. If I enter
edit mode with:
> :e C:

> I can browse through my filesystem, however the "i" key won't
> work, instead of moving up it seems to cycle through
> hiding/showing various file details.

> Any ideas why this is hapenning? Maybe it's a bug, since it
> only seems to be a problem with remmaping "i", the following
> will work fine for example:

> noremap ; l
> noremap l k
> noremap k j
> noremap j h

> I'm really used to using IJKL however, and I'd prefer that
> over JKL;.

when you browse the filesystem with gvim you are using a
plugin called netrw -- the mapping to 'i' is a feature of
netrw

the best solution would be to whack your movement mappings and
start getting used to the vim hjkl movement commands

there are dozens of next best solutions -- ways of telling
netrw not to map i to information, ways of remapping i when
you use netrw, ways to hack netrw

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

every possible way of defeating this feature of netrw so goes
against "the vim way" that i become apoplectic when i try to
think what your best solution will be, so maybe i better not
try, and leave it to you

<some time passes>

ok, i've calmed down enough to think about this further

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

the mapping is in a function called BrowserMaps and looks
like:

nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(1)<cr>

to comment it out just put a double quote at the beginning of
the line

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

No comments:

Post a Comment