If you are using Vi/Vim editor to read a text file and want to move your cursor to the first character of the line i.e. at the start of the line, you can make use of the ^ (caret) symbol on your keyboard,Example:
- Open your file in vi editor - vi myFile.txt
- Now be on the line you want to move to the start of.
- Press ^ character on your keyboard (mostly should Shift + 6 key)
- You would see your cursor moves at the first char of the line.
⚠️ Make sure that you are not in Insert Mode, or else you would see that the character ^ will get added to the text and this shortcut won't work, press Esc (Escape) key to come out of Insert Mode and then try the command.
⚡️ On Windows Operating system keyboard you can make use of Home and End keys as well to get this behavior.
Usecase: Imagine someone is working a terminal on a file that does not have a line break (\r \n) then it would be very difficult to get to the start of the line using the right and left arrow keys!
Hashtags: #vi #vim #viMacOs #macOS #viTips #viCommands
- Open New Terminal Window Using Keyboard Shortcut macOS
- How to Refresh Mac Desktop
- How to remove app from Dock when closed [macOS Big Sur]
- WARNING: Python 2.7 is not recommended [macOS Big Sur]
- Terminal Command to get the list of available shells in macOS
- Add Bookmark macOS Safari
- Youtube spacebar not working in search on macOS Safari
- How to refresh Safari on Mac (macOS) using keyboard shortcut
- How to know your Mac Screen Resolution?
- Disable Startup Sound on macOS
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Test internet speed using macOS Terminal command
- How to hide or display Wifi icon in macOS Bug Sur Menu Bar
- Limit scrollback rows in macOS Terminal
- [macOS] Change homepage Macbook Safari Browser
- wget Command on macOS Terminal
- How to install Java on macOS [Big Sur]
- How to increase macOS Terminal text font size (Big Sur)
- How to check zsh installed version using terminal
- This operation couldnt be completed. Unable to locate a Java Runtime. [macOS]
- ls: .: Operation not permitted - Mac Big Sur Terminal Zsh Error
- How to install maven in macOS using Terminal Command
- How to open new tabs macOS Terminal
- How to uninstall GarageBand from Mac
- How to Restart Mac using Terminal Command
- Aw Snap! Something went wrong while displaying this webpage Error code: STATUS_INVALID_IMAGE_HASH - Chrome
- SharePoint CAML query error - The XML source is not correct - SharePoint
- Add scroll to div element in HTML Css - CSS
- SharePoint An unexpected error has occurred - Correlation ID and PowerShell Merge-SPlogfile - SharePoint
- Transfer files between Android and Mac OS X using usb cable - Mac-OS-X