How To Go To End or Beginning of a Line In Vim (2024)

Use the [.inline-code]ESC[.inline-code] key to enter normal mode in vim:

  • Press [.inline-code]$[.inline-code] to move the cursor to the end of the line
  • Press [.inline-code]g_[.inline-code] to move the cursor to the last non-whitespace character

How To Go To End or Beginning of a Line In Vim (1)

On the left is the result after typing [.inline-code]$[.inline-code] to go to the end of the line, and on the right is the result after [.inline-code]g_[.inline-code] to go to the last non-whitespace character.

[#insert-at-end-line]Insert at the end of a line with Vim[#insert-at-end-line]

To edit the end of the line, you can press [.inline-code]A[.inline-code] to jump to the last character and switch to insert mode.

[#go-to-line-beg]Go to the beginning of a line with Vim[#go-to-line-beg]

In normal mode:

  • Press [.inline-code]0[.inline-code] to move the cursor to the start of the line
  • Press [.inline-code]^[.inline-code] or [.inline-code]_[.inline-code] to move to the first non-whitespace character in the line

To edit the beginning of the line, you can press [.inline-code]I[.inline-code] (capital i) to go to the first non-whitespace character and switch to insert mode.

[#navigating]Navigating around Vim[#navigating]

Once you have navigated to the desired position, you can use other Vim commands such as:

  • [.inline-code]j[.inline-code] to move the cursor to the next line
  • [.inline-code]x[.inline-code] to delete the character under the cursor
  • [.inline-code]dG[.inline-code] to delete everything after the cursor

Note: The commands above are cursor-specific, meaning that the position of your cursor is essential and will affect the command. For those types of commands, navigating to either the end or the beginning of the line before executing those commands is helpful.

However, some commands, like those below, are line-specific and do not require the cursor to be at a specific position on the line:

  • [.inline-code]o[.inline-code] creates a new line below the current line and enters insert mode
  • [.inline-code]O[.inline-code] creates a new line above the current line and enters insert mode
  • [.inline-code]J[.inline-code] appends the next line next to the current line
  • [.inline-code]dd[.inline-code] deletes the current line
  • [.inline-code]yy[.inline-code] yanks (copy) the current line

To keep reading about navigating in Vim, check out these tips on going to the end of the file and copy and pasting.

How To Go To End or Beginning of a Line In Vim (2024)
Top Articles
Bitcoin Cash Price Prediction | Is Bitcoin Cash a Good Investment?
What is the SMB protocol, and how does it work? | NordVPN
Uworld Cost
Www.metaquest/Device Code
Uk Adventure Couple Leak
Fuego Azteca Mexican Bar And Grill Live Oak Photos
Dutch Sheets Give Him 15 Today's Message Today
Stellaris Piracy Suppression
Longhorn Steakhouse Hiring Age
Sanford Orlando Kennel Club Results
Moe's Sides
Embassy Suites Wisconsin Dells
At 25 Years, Understanding The Longevity Of Craigslist
Concordia Apartment 34 Tarkov
Patriots, Loyalists, and Neutrals Before the American Revolution
Z Score Calculator - Z Table Calculator
Aldi Weekly Ad Lake Elsinore
Twitchmetrics
Richard Sambade Obituary
Weld County Sheriff Daily Arrests
Freightliner Cascadia d'occasion à vendre | tracteur routier
Constraining neutron star matter from the slope of the mass-radius curves
Craigslist Ludington Michigan
Robert Moses State Park ocean water temperature today | NY, United States temp
8554262764
Crytek director says Hunt: Showdown's big August update represents 'a significant relaunch of Hunt: Showdown at a whole new level'
Sun Tracker Pontoon Wiring Diagram
Grown Ups - TV Tropes
Parent Portal Pat Med
Rhode Island Weather by Month – Btobers.com
George The Animal Steele Gif
Slusd Schoology
Cbre Employee Holidays 2023
Www.labcorp.com
Understanding North Star Metrics | Planio
How to Use Craigslist (with Pictures) - wikiHow
Officialtayyyy
What Website Assists The Educational Services Officer
Amazon Ups Drop Off Locations Near Me
Craigslist Meadville Farm And Garden
Final Jeopardy Today July 25, 2024 – Question, Answer, Wages & Winner
Akali Op Gg Aram
Overtime Megan File Download
Young & Restless Dirty Laundry
They're Cast In Some Shows Crossword Clue
Myapps Tesla Ultipro Sign In
Mnps Payroll Calendar 2022-23
Missing 2023 Showtimes Near Cinemark Beaumont 15 And Xd
The Top 10 Things to Do in the Poconos
MLN9658742 – Medicare Provider Enrollment
Cta Bus Tracker 77
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 5334

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.