About: Recover from accidental Ctrl-U   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

In insert mode, pressing Ctrl-u deletes text you've typed in the current line, and Ctrl-w deletes the word before the cursor. You can't undo these deletions. However, what you've typed is still in the . register. You can confirm that (after pressing Esc to return to normal mode) with the command :reg which will list all registers (or just :reg . to display the . register). You may be able to copy the missing text from the register display, for example, with the mouse. :let @a = @. "aP To avoid the problem in the future, put the following in your vimrc:

AttributesValues
rdfs:label
  • Recover from accidental Ctrl-U
rdfs:comment
  • In insert mode, pressing Ctrl-u deletes text you've typed in the current line, and Ctrl-w deletes the word before the cursor. You can't undo these deletions. However, what you've typed is still in the <b>.</b> register. You can confirm that (after pressing Esc to return to normal mode) with the command :reg which will list all registers (or just :reg . to display the <b>.</b> register). You may be able to copy the missing text from the register display, for example, with the mouse. :let @a = @. "aP To avoid the problem in the future, put the following in your vimrc:
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 434(xsd:integer)
Category
  • Undo
Author
  • John Wright
Complexity
  • basic
Created
  • 2003(xsd:integer)
ID
  • 436(xsd:integer)
NEXT
  • 437(xsd:integer)
Rating
  • 17(xsd:integer)
abstract
  • In insert mode, pressing Ctrl-u deletes text you've typed in the current line, and Ctrl-w deletes the word before the cursor. You can't undo these deletions. However, what you've typed is still in the <b>.</b> register. You can confirm that (after pressing Esc to return to normal mode) with the command :reg which will list all registers (or just :reg . to display the <b>.</b> register). You may be able to copy the missing text from the register display, for example, with the mouse. Unfortunately, simply pasting the <b>.</b> register won't help because it will repeat the Ctrl-u or Ctrl-w and will delete the text again. However, you can use another register (register a in the following): :let @a = @. "aP The above will paste all the text you last inserted, including what was accidentally deleted. To avoid the problem in the future, put the following in your vimrc: inoremap u inoremap u Now Ctrl-u and Ctrl-w will work as before, but they first use Ctrl-g u to start a new change, as far as undo is concerned. For example, in insert mode, you might type several lines then accidentally press Ctrl-u which deletes the last line. If you have used the above mapping, you can press Esc to return to normal mode, then u to undo, which will recover the last line. The first mapping (for ) is now included by default in the vimrc_example.vim distributed with Vim.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software