.vimrc.after not overriding certain commands #158

Closed
corroded opened this Issue Sep 12, 2012 · 5 comments

Projects

None yet

2 participants

@corroded
Contributor

I just tried disabling my arrow keys(to learn more about Vim movement) and added these rules to my .vimrc.after:

noremap  <Up> ""
noremap! <Up> <Esc>
noremap  <Down> ""
noremap! <Down> <Esc>
noremap  <Left> ""
noremap! <Left> <Esc>
noremap  <Right> ""
noremap! <Right> <Esc>

Problem is, it doesn't disable the arrow keys. I tried adding them directly to vimrc and it worked, so there's nothing wrong with the bindings(I think). I moved them to vimrc.after and it didn't work. I checked though and it loads the vimrc.after, since I have some settings that do appear to work:

map <D-W> <Plug>CamelCaseMotion_w
map <D-B> <Plug>CamelCaseMotion_b
map <D-E> <Plug>CamelCaseMotion_e

nunmap E
nunmap W
nunmap B

set gfn=Inconsolata:h14,Monaco:h14
set lines=999
set columns=999

noremap  <Up> ""
noremap! <Up> <Esc>
noremap  <Down> ""
noremap! <Down> <Esc>
noremap  <Left> ""
noremap! <Left> <Esc>
noremap  <Right> ""
noremap! <Right> <Esc>

As you can see, I set my fonts a bit smaller. I took it out of my vimrc.after and it reverted to having huge fonts -- so I know the vimrc.after is working. Is there something wrong with the mappings? is this an issue with YADR or with Vim?

Contributor

Just out of curiosity, where is you vimrc.after located? in YADR or in ~/?

Contributor

I did the pull request to put the vimrc.after in ~/.yadr/vim/after but I also tried it in a separate machine that had a .vimrc.after in ~/.vimrc.after just in case it was my fault. It exhibited the same problem though

Contributor

I added the lines at the end of my ~/.vimrc.after and it worked i.e. arrow keys were dead.

What's you OS and what vim u're using? (term, macvim, gvim? ) I might be related to the editor or something else! FYI, I tested it on gvim.

(You actually encouraged me to try disabling them myself :D hahaha :) )

Contributor

At least it did someone good haha. Anyway I checked it on my Macbook (Macvim, Lion, yadr/vim/after) and on our office machine (iMac, Lion, ~/.vimrc.after, Macvim).

I'll check our other machines tomorrow if it is isolated to just macvim. It is totally weird though that it works if I put it in the last line of ~/.vimrc which is symlinked to ~/.yadr/.vimrc

Contributor

Okay this is weird and I don't know now what the real problem is. I checked the office machine again and it worked, both in it's vimrc and vimrc.after(arrow keys were disabled). I checked my machine and it DIDN'T work on BOTH .vimrc and .vimrc.after(I also tried both /yadr/vim/after and ~/.vimrc.after).

I checked Macvim versions and saw that they were the same:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 27 2012 11:24:54)
MacOS X (unix) version
Included patches: 1-390

I changed the overrides though and it WORKED. Here are the new overrides I used:

map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
imap <up> <nop>
imap <down> <nop>
imap <left> <nop>
imap <right> <nop>

That worked in the new vimrc.after location by the way. So it seems like it is probably a Macvim issue.

@corroded corroded closed this Sep 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment