Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76275 - 'g' cannot be remapped in vim using .vimrc
Summary: 'g' cannot be remapped in vim using .vimrc
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-31 19:01 UTC by scot
Modified: 2005-01-01 10:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description scot 2004-12-31 19:01:48 UTC
/etc/vim/vimrc contains a block of code that effectively disallows remapping 'g' in a user's .vimrc file.

Reproducible: Always
Steps to Reproduce:
1. Add this line to ~/.vimrc ":map g o"
2. Open an existing file with vim
Actual Results:  
The second line of the opened file will have these two characters added: "'

Expected Results:  
The file should not have been modified immediately after being opened.

I assume the following gentoo-specific code in /etc/vim/vimrc is the culprit:

  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
        \ if line("'\"") > 0 && line ("'\"") <= line("$") |
        \   exe "normal g'\"" |
        \ endif
Comment 1 Ciaran McCreesh 2005-01-01 09:45:43 UTC
Feel free to modify your /etc/vim/vimrc or disable that autocmd if you want to use really weird maps.
Comment 2 scot 2005-01-01 10:03:09 UTC
What about something that achieves gentoo's goals and also it's user's goals?

What about using this instead?

au BufReadPost * if line("'\"") | exe "'\"" | endif
Comment 3 Ciaran McCreesh 2005-01-01 10:18:28 UTC
No, because then the user could come up with some other equally weird mapping which would break that.