« back to discussion

Vim jumping 2 chars after exiting insert

I recently remapped my esc from caps lock to jk (so I can use caps for ctrl). However now when I exit insert mode it jumps two chars to the left..... Is this normal? Any idea where I should start looking?

imap jk <Esc> is what I have currently.

example (pipe is cursor):
fo|obarbaz then I hit jk and the block cursor is here foob|a|rbaz

about 3 years ago, by SkinnyGeek1010

13 Replies

pineapple

Can you post your .virmrc? Also, use :verb map <key> to check if there are conflicts with j, or k

pineapple, about 3 years ago

SkinnyGeek1010

Hmm I tried using :verb map j (and jj) but it just says No mapping found.
It should be pretty close to what you had several months ago. I've even tried mapping to random things like bb or aa and they do it as well. Ctl-o works great though.

https://gist.github.com/AdamBrodzinski/1e83cfef22cd48cd5edf

SkinnyGeek1010, about 3 years ago

pineapple

i tried your .vimrc and definitely weird shit going on. I have to run right now or I would look, but basically just do a simple binary process of elimination by adding the word finish to your config (which prevents loading the rest of your vimrc). First move your jj command all the way to the top, then start with finish near the top beneath that. Chances are it will work properly. Just keep moving the finish command lower and lower until it breaks, and then you will find out whats causing it.

pineapple, about 3 years ago

SkinnyGeek1010

Oh wow thanks. After I find it I also want to start with a blank one and add everything back in 1 by 1... So much going on there that I never took the time to learn.

Thanks again!!

SkinnyGeek1010, about 3 years ago

Walkman

Do you use a predefined config package like Janus?

Walkman, about 3 years ago

SkinnyGeek1010

I looked into it but there were too many plugins I didn't want to use (it also seemed to be very geared towards Rails users coming from Textmate).

After @pineapple convinced me to jump ship from Sublime I started out with this awesome vim folder and vimrc: https://github.com/9mm/dotfiles and added a few things to it like syntastic and some javascript stuff (ctags for js and better indenting I think)

SkinnyGeek1010, about 3 years ago

Walkman

I wanted to suggest that start from scratch without copying from anyone else, and edit vimrc bit-by-bit. This way you will really know what's happening and eventually learn vim in the process. Those bootstrap configs make more harm to your vim learning process than good!
Vim is a tool you have to learn anyway, so there is no advantage using a huge config file which you don't know at all.

Walkman, about 3 years ago

SkinnyGeek1010

Yea that's good advice! The bootstrap enabled me to get work done while using vim, but it's definitely time to rebuild it from scratch to see what each part does.... as well as actually reading the help for each one! I'm planning on brewing a pot of coffee, starting with a fresh install of Mavericks and blank dotfiles and rebuild them up line by line =D

SkinnyGeek1010, about 3 years ago

pineapple
posted by SkinnyGeek1010 on Wed, Oct 23 at 09:16PM

Yea that's good advice! The bootstrap enabled me to get work done while using vim, but it's definitely time to rebuild it from scratch to see what each part does.... as well as actually reading the help for each one! I'm planning on brewing a pot of coffee, starting with a fresh install of Mavericks and blank dotfiles and rebuild them up line by line =D

I just bought fully loaded MBPr and plan to do the same thing :]

pineapple, about 3 years ago

SkinnyGeek1010

Woooo, I hope it's one of the new ones?!?!?

I just renamed my .vimrc and .vim folder and its still jumping out of insert with jjlol! I even unlinked macvim from the terminal and used system vim 7.3 lol. time for a reformat.

SkinnyGeek1010, about 3 years ago

pineapple
posted by SkinnyGeek1010 on Wed, Oct 23 at 11:19PM

Woooo, I hope it's one of the new ones?!?!?

I just renamed my .vimrc and .vim folder and its still jumping out of insert with jjlol! I even unlinked macvim from the terminal and used system vim 7.3 lol. time for a reformat.

Well it definitely works on mine, that is some funky stuff you have going on. And yes, I bought it an hour after they released it 8]

pineapple, about 3 years ago

pineapple

pineapple, about 3 years ago

pineapple
def test_method_please_ignore
  puts "Pygments syntax highlighting updated successfully on #{Time.zone.now}?"
end

pineapple, about 3 years ago


Login or to comment.

« back to discussion

Tutorials are any resources you learn from.

Examples: an intro to html5 screencast, a pdf about git, photoshop effects tutorials, meta-programming in ruby, lambda calculus, higher-order fixed-point combinators.

Tools are websites, apps or services used -on- your project (indirectly), to aid the process.

Examples: A color scheme generator, email marketing software, usability heat maps, css3 code generators, a downloadable png compressor.

Assets are downloadable files used -in- your projects, usually as code, textures, or images.

Examples: a jquery sticky menu, photoshop brushes, background textures, mvc frameworks, twitter bootstrap, 960 grid system.