InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Vim tutorials

  • Character toggle case
  • Go back to last edited line
  • Move to matching bracket
  • Multiline search replace with confirmation
  • Open vim at previous location
  • Vim mini cheat sheet
  • Vim redo (undo of last undo)
  • show line numbers
 
  • Home
  • > Tutorials
  • > Vim

Vim – how to go back to last edited line/context

By admin on Dec 1, 2015

Sometimes we are editing a certain section of code in vi and then navigate to different section for reference. It is tedious to come back to the section we are editing. Here is a quick trick to come back to same section we were editing earlier.

  1. First undo the last change (temporarily). This will bring us to the section we did the last edit.

    [ESC] + u
    
  2. Now redo the last undo. This will bring back to original state of the file. but the vi cursor is at the last edited locaiton.

    [ESC] + [CTR] + r
    

Suggested posts:

  1. AngularJS format date using date filter
  2. wget handy commands
  3. CSS outline-width
  4. Vim – highlight and move to matching bracket
  5. How to recover svn lost password on Linux
  6. Debug javascript using node-inspector, node-debug, nodemon and Chrome
  7. Linux file timestamps
  8. How to setup password less git push for github
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Linux/Unix Command Line, Tutorials, Ubuntu Linux, Vim
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress