1. Vim Preface
Students who have used Linux know that Vim is a must-have editing tool, and when mastered, it can save a lot of time. However, the learning curve for beginners is quite steep compared to other editors.
Have you ever worried about forgetting the commands when you first started using Vim? Today, I’ll introduce how to use Vim in different scenarios with a new approach.
2. Shell + Vim
# set -o vi
Running this command in the shell sets the terminal to Vi mode. You can also add this to your user configuration so that it starts in Vi mode by default.
Here’s an example:
Imagine you typed a long command to connect to MySQL on port 3307, but accidentally wrote 3306. How can you fix it quickly?
A beginner might press the left or right arrow keys multiple times to move the cursor, then delete and type the correct number. It's frustrating, especially during an emergency.
Now, using Vim mode, you can do it faster:
Let me break it down:
F6 finds the first '6' to the left,
R7 replaces the character at the cursor with '7'.
That’s just six steps—efficient and precise!
Here’s a quick recap of the solution:
(Note: The animation was recorded using screen recording software. Pressing
3. Chrome + Vim
Vimium is a Chrome extension that lets you navigate the web using Vim-like keyboard shortcuts (similar to cvim). You can download it from the Chrome Web Store or install it offline.
After installing, open any page and press '?' to see the familiar Vim keybindings.
Try it out! When browsing, press 'f' to jump to links. Type one or two letters to select the link you want. Then, press 'gg' to go back to the top of the page, or 'x' to close the tab. It feels smooth and efficient.
4. Windows + Vim
In this context, "Windows" refers to the window interface, not the operating system. The tools mentioned are cross-platform.
There are many Vim-based editors for windows, such as GVim. Recently, Vim released version 8.0 after a decade-long gap. You can download it and explore its features.
Additionally, Sublime Text can be configured to work like Vim. In Preferences > Settings > User, edit the config file and comment out "Vintage" to enable Vim mode. Add "vintage_start_in_command_mode": true to start in command mode automatically.
Text copying on mobile is painful, and if BlackBerry had continued, maybe there would have been a Vim-like editor on phones too.
5. IDE + Vim
Features like syntax highlighting, auto-indentation, function navigation, and project trees are essential in modern IDEs. With proper Vim configurations and plugins, you can replicate these features in a powerful text editor.
For more advanced setups, check out this GitHub link: https://github.com/yangyangwithgnu/use_vim_as_ide
6. Getting Started with Vim
After showing some tricks, here are some basic tips for new users. Advanced users can skip this part.
6.1 Vim Basics
I’ve heard that some people claimed their mouse-hand was cured after using Vim. While that might be exaggerated, the main idea is to minimize mouse usage and rely on the keyboard instead.
6.2 vimtutor
The power of Vim lies in its combination of movement and actions in command mode. Start with the built-in tutorial: run `vimtutor` in your terminal to get started.
6.3 Vim Keyboard Map
Before diving into Vim, having a visual reference of the keyboard layout is essential. Keep the map on your desktop or wall for easy access.
Check out the most comprehensive Vim cheat sheet online: http://cenalulu.github.io/linux/all-vim-cheatsheat/
7. Conclusion
Reading this article takes around 30 minutes. To truly master Vim, practice regularly and keep refining your workflow. If you code often, customize your plugin setup to maximize efficiency. With consistent effort, you'll achieve more with less.
OLED is organic light-emitting diode (D1de), which has the characteristics of self illumination, high brightness, wide viewing angle, high contrast, flexibility, low energy consumption and so on. Therefore, it has been widely concerned. As a new generation of display mode, it has gradually replaced the traditional liquid crystal display, and is widely used in mobile phone screen, computer display, full-color TV and so on. OLED display technology is different from traditional liquid crystal display technology. It does not need backlight. It uses very thin organic material coating and glass substrate. When there is current passing through, these organic materials will emit light. However, as organic materials are easy to react with water vapor or oxygen, OLED displays have high requirements for packaging.
Package Locating OLED Cover Glass,High Precision OLED Cover Glass,Special Desiccant Installed OLED Cover Glass
SHAOXING HUALI ELECTRONICS CO., LTD. , https://www.cnsxhuali.com