Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does anybody get these weird repeated ()()()()()() in Vim?

Tags:

vim

Couple of times a day I get this, usually when typing in a browser() statement while debugging.

enter image description here

It repeats a whole bunch of brackets, when I only typed a pair. Usually I very quickly type "browser() esc :w enter" (without the quotes) so that I can save and go back to my R environment, and it pauses for a second, and then sticks all these brackets in. It's not really a problem, a quick Undo takes it out, just wondering why it does this. Am I moving too fast for Vim (touch typist).

I'm using Vim 7.3 on Windows 7. Does this on more than one machine. In all cases I'm also mapping caps lock to escape using sharpkeys, I don't know if that might be a factor. Anybody seeing this? Any remedy?

Thanks.

For completeness, here is my vimrc file:

colorscheme clarity
syntax enable
set guifont=Consolas:h10:cANSI
set number 
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set autoindent
set smarttab
set backspace=indent,eol,start
set nocompatible
set expandtab
filetype plugin on
filetype indent on
set ruler
set cursorline
set noerrorbells
set visualbell
"set guioptions-=m
set guioptions-=T
like image 315
Thomas Browne Avatar asked Nov 03 '22 22:11

Thomas Browne


1 Answers

I am guessing on line 32 you had:

browser

Then you typed:

90a()<esc>

The mistake here being that typed "90", thinking that you were in insert/append mode, realized you weren't went into that mode, typed your parenthesis, then exited. What you actually told vim was "Append this text 90 times", and it gladly did it for you, so you ended up with:

browser()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()

It's ok, it happens to the best of us.

like image 140
sleepynate Avatar answered Nov 13 '22 16:11

sleepynate