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
- How to load zsh profile on opening shell terminal
- Set Python 3.8 as a default python version on macOS
- Show CPU and Memory Usage on macOS Menu Bar
- How to save macOS Terminal outputs as text file
- How to install wget on macOS
- Display ls command file sizes in KB (kilobytes) MB (megabytes) or GB (gigabytes) [Linux/macOS]
- How to Change Mouse Wheel Scroll Direction on Mac
- macOS R installation steps
- How to open terminal on Mac to run commands
- How to know your Mac Screen Resolution?
- Safari - Get HTTP Request Response Headers
- Opening mac Terminal
- bash: command not found error [macOS Terminal Linux, Unix or Windows]
- Add Bookmark macOS Safari
- How to check RAM details on Mac?
- How to install Java on macOS [Big Sur]
- How to Display Analog Clock on Mac Menu Bar
- How to remove app from Dock when closed [macOS Big Sur]
- How to add to PATH in macOS Big Sur
- Keyboard Shortcut to delete a file on a Mac [Macbook]
- How to increase macOS Terminal text font size (Big Sur)
- Permanently set $PATH variable in Mac Zsh shell
- Delete a Directory using Mac Terminal Command
- Remove Now Playing icon from macOS Big Sur Menu Bar
- How to find files taking up space on your Mac
- reCAPTCHA Implementation Tutorial - CSS
- AADSTS90033: A transient error has occurred. Please try again. [Microsoft 365] - Microsoft
- Increase Android Emulator Timeout time - Android
- How to remove Floating Action Button Android Studio Blank Activity Template - Android-Studio
- Top 3 Awesome Text Editors developers prefer at workplace - Sublime