How to efficiently undo an autocomplete in vim -


right i'm playing autocompletions in vim, , i've settled on supertab handle completions. while it's running smoothly , (i think) it's designed, i'd know how change something.

firstly, i'm running 7.3.429 on ubuntu 12.04lts

set completeopt=menuone,preview,longest 

so have bash-type autocompletion supertab, , default complete.

let's suppose have following in file:

aaabbbcccddd aaabbccddeef aaabbcddeeff 

if type aa , hit tab, vim realized aaabb longest common string among matches, inserts aaabb , displays menu containing 3 options. if did want 1 of options, good. maybe wanted aaaaazzzzz, didn't realize hadn't typed yet.

is there way vim, "oh, i'm sorry! didn't mean tabcomplete after all! please pretend didn't."

right now, options apparent me to:

  1. hit tab or shift+tab enough times initial. if there many similar words, different lengths, annoying.
  2. hit backspace many times necessary, or other naive deletion. these surely unnecessary key strokes.
  3. hit esc+u undo, undoes whole word (or more if typed quickly). entirely unacceptable. , afterwards, need re-enter insert mode , retype. gross.
  4. hit ctrl+u undo without leaving insert-mode. has tendency remove way much.
  5. hit ctrl+w delete last word. while without exiting insert-mode, still have retype. best have found far.

if didn't have longest enabled, use ctrl+e, quits menu without inserting else. since longest on, stops autocomplete leaves longest common match entered.

surely there has better way this.

there 2 native ways in vim. if know right way item not in completion menu can use <c-y>. <c-y> accepts current match if didn't move though completions send text inserted. (second way) if did move through completion menu can move though until original text.

however imagine isn't hard accept longest matching , edit word. use <c-g>u break undo block working <tab> mapping. although may break history more want.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -