3430 views|20 replies

4771

Posts

12

Resources
The OP
 

Programmer's tool, embedded artifact ---- Vim [Copy link]

 

https://nju-projectn.github.io/ics-pa-gitbook/ics2022/0.4.html

http://www.study-area.org/tips/vim/index.html

(First, post the link. If you like it, just collect it.)

In the eyes of many people, embedded engineers are just people who adjust boards and write low-level codes. They cannot make cool CSS animations, but they earn one-tenth of the salary of people who make apps on the Internet, and their work is much more difficult than theirs.

They have all kinds of frameworks and libraries, and they also have a resource-rich GitHub to use. It seems that we embedded programmers have nothing in common. Are their tools really completely incompatible with ours?

Today I will introduce you to a hardcore tool - Vim

Vim is called the God of Editors

Vim is a text editor developed from vi . It has rich functions for convenient programming, such as code completion, compilation, and error jump, and is widely used by programmers. It is the most popular editor for Unix-like system users, along with Emacs .

Among my many programmer friends, there are quite a few heavy Vim users. They pursue concise and efficient writing, and they also recommended this versatile editing method to me.

Now I write almost all my codes in VS code, C/C++/VBA/Python, and they are all perfectly compatible.

Combined with the editor's automatic incompleteness and highlighted alignment line display, it is absolutely perfect. It is basically difficult for users to get rid of it once they use it because it is so good.

I even used vim when writing my blog, although I just jumped around and deleted text.

Throwing out ideas

Without taking your hands off the keyboard, your coding efficiency will be increased by 30%. HJKL----left, bottom, top, right, you can quickly find the place you want to modify in any embedded code.

1

CVGreat! 70% of our beginners' codes are learned from others' codes, so copying and pasting is a must.

Some basic operations, such as when you need to declare some variables during programming, you can simply copy and modify them

  • yy + p copies a line
  • f; Position to the semicolon
  • hciw deletes to the beginning of the previous word and enters insert mode

Final Thoughts

Good tools can help you get twice the result with half the effort. For example, I don’t use the code interface of Keli Modelism ISE anymore. I will code everything I want in vscode + Vim, and then use the tool to compile.

Finally, here is a simple command diagram.

This post is from Programming Basics

Latest reply

If you can use VSC or something like that, use it. If you can't use VIM or something like that, it takes time to learn and memorize a bunch of shortcut keys.  Details Published on 2023-6-8 19:24
 

2873

Posts

4

Resources
2
 

I recommend VScode. If you like vi, you can use plug-ins.

This post is from Programming Basics

Comments

Correct answer, for me, who writes a lot of complicated and simple vscode, it is concise and efficient, which is exactly what I need.  Details Published on 2022-6-12 20:02
 
 
 

6841

Posts

11

Resources
3
 
Thanks to the moderator for sharing. I have a hard time moving the cursor when using vi. It seems I need to learn it well!
This post is from Programming Basics

Comments

Habit becomes nature. It only takes three days to get familiar with it. Then you can move quickly with numbers and hjkl.  Details Published on 2022-6-12 20:03
 
 
 

4771

Posts

12

Resources
4
 
bigbat posted on 2022-6-12 10:51 I recommend VScode. If you like vi, you can use the plug-in.

Correct answer, for me, who writes a lot of complicated and simple vscode, it is concise and efficient, which is exactly what I need.

This post is from Programming Basics
 
 
 

4771

Posts

12

Resources
5
 
lugl4313820 posted on 2022-6-12 11:54 Thanks for sharing. I use vi and it’s hard to move the cursor. It seems I need to learn it well!

Habit becomes nature. It only takes three days to get familiar with it. Then you can move quickly with numbers and hjkl.

This post is from Programming Basics

Comments

Thank you very much!  Details Published on 2022-6-12 20:41
 
 
 

6841

Posts

11

Resources
6
 
Azuma Simeng posted on 2022-6-12 20:03 Habit becomes nature. It only took three days to get familiar with it. Combined with numbers and hjkl, it moves very fast

Thank you very much!

This post is from Programming Basics
 
 
 

114

Posts

6

Resources
7
 

Thank you for sharing. I have always heard about the benefits of vim. It is time to find time to play with this editor.

This post is from Programming Basics

Comments

In fact, Vim is not an editor, it is an editing method. Everyone has their own preferences for editors. You can install Vim plug-ins on any editor you like, such as vscode, sublime, and notepad.  Details Published on 2022-6-13 07:19
 
 
 

4771

Posts

12

Resources
8
 
vincentc543 posted on 2022-6-12 22:48 Thank you for sharing. I have always heard about the benefits of vim. It is time to find time to play with this editor.

In fact, Vim is not an editor, it is an editing method. Everyone has their own preferences for editors. You can install Vim plug-ins on any editor you like, such as vscode, sublime, and notepad.

This post is from Programming Basics

Comments

Vim is a variant of VI, which is the official command line editor of the Unix system. The early version of vi only had editing functions, and later added syntax highlighting, macro commands, teleprompters and other functions. It has gradually developed to the present.  Details Published on 2022-6-13 09:37
 
 
 

2873

Posts

4

Resources
9
 
Azuma Simeng posted on 2022-6-13 07:19 In fact, Vim is not an editor, it is an editing method. Everyone has their own preferences for editors, vscode, sublime, notepad, whatever you like is fine...

Vim is a variant of VI, which is the official command line editor of the Unix system. The early version of vi only had editing functions, and later added syntax highlighting, macro commands, teleprompters and other functions. It has gradually developed to the present.

This post is from Programming Basics

Comments

Correct answer. The additional functions are becoming more and more enjoyable to use, and it has developed from the original single editor to a plug-in tool with various functions.  Details Published on 2022-6-14 08:21
 
 
 

4771

Posts

12

Resources
10
 
bigbat posted on 2022-6-13 09:37 Vim is a variant of VI, which is the official command line editor of the Unix system. The early version of vi only had editing functions, and later added syntax highlighting and macro commands...

Correct answer. The additional functions are becoming more and more enjoyable to use, and it has developed from the original single editor to a plug-in tool with various functions.

This post is from Programming Basics
 
 
 

2873

Posts

4

Resources
11
 

The best thing about vim is that you don’t need a mouse. No mouse, no mouse!

This post is from Programming Basics

Comments

Yes, there is no need to click with the mouse, and it is very comfortable to use all kinds of shells and conf.  Details Published on 2022-6-14 21:44
 
 
 

4771

Posts

12

Resources
12
 
bigbat posted on 2022-6-14 09:09 The coolest thing about vim is that you don’t need a mouse, no mouse, no mouse!

Yes, there is no need to click with the mouse, and it is very comfortable to use all kinds of shells and conf.

This post is from Programming Basics
 
 
 

7462

Posts

2

Resources
13
 

I spent a long time learning how to use vim, but now I can basically use the mouse without using shortcut keys. . .

This post is from Programming Basics

Comments

Hahahaha, habit becomes nature, use it more and you will become familiar with it without having to learn it deliberately.  Details Published on 2022-6-15 22:10
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

4771

Posts

12

Resources
14
 
freebsder posted on 2022-6-15 19:56 I once learned various operations of vim for a long time. Now I can basically use the mouse without shortcut keys. . .

Hahahaha, habit becomes nature, use it more and you will become familiar with it without having to learn it deliberately.

This post is from Programming Basics

Comments

Now I only know the most basic operations of vim, and I have forgotten all the various plug-ins and shortcut keys.  Details Published on 2022-6-16 18:33
 
 
 

7462

Posts

2

Resources
15
 
Azuma Simeng posted on 2022-6-15 22:10 Hahaha, habit becomes nature, use it more and you will be familiar with it without having to learn it deliberately,

Now I only know the most basic operations of vim, and I have forgotten all the various plug-ins and shortcut keys.

This post is from Programming Basics

Comments

In fact, if you don't use it, you will forget it. Unless you do intensive programming for four or five years, you may not forget it. But the shortcut keys will become familiar with it after using it for a long time, so you don't need to remember them deliberately.  Details Published on 2022-6-17 23:18
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

4771

Posts

12

Resources
16
 
freebsder posted on 2022-6-16 18:33 Now I only know the most basic operations of vim. I have forgotten all the various plug-ins and shortcut keys.

In fact, if you don't use it, you will forget it. Unless you do intensive programming for four or five years, you may not forget it.

However, you will become familiar with the shortcut keys after using them, so you don’t need to remember them deliberately.

This post is from Programming Basics
 
 
 

224

Posts

0

Resources
17
 

I felt the power of vi when I started learning it.

But I still feel uncomfortable at first, so I have to keep practicing to master it.

In addition, my Ubuntu computer is equipped with a Japanese keyboard, so the feeling of "man on man" is really too sour

Temporarily escape back to gVim, a half-baked editor, to slow down for a while

This post is from Programming Basics
 
 
 

210

Posts

3

Resources
18
 

I have never used VIM. But I have used vi. VI is very convenient in command line editor. But now users often develop in projects. There are IDEs such as .NET, Eclipse, Keil, etc. that can easily display and organize multi-file projects. Isn't their purpose to replace command line editors?

This post is from Programming Basics
 
 
 

44

Posts

0

Resources
19
 
If you can use VSC or something like that, use it. If you can't use VIM or something like that, it takes time to learn and memorize a bunch of shortcut keys.
This post is from Programming Basics

Comments

Brother VSC, it’s so good to install a vim plug-in. Now I can’t code anymore.  Details Published on 2023-6-8 22:10
Brother VSC, it’s so good to install a vim plug-in. Now I can’t code anymore.  Details Published on 2023-6-8 22:09
 
 
 

4771

Posts

12

Resources
20
 
gzwangyu posted on 2023-6-8 19:24 If you can use VSC or something like that, use it. If you can't use VIM or something like that, after all, it takes time to get familiar with and remember a bunch of shortcut keys

Brother VSC, it’s so good to install a vim plug-in. Now I can’t code anymore.

This post is from Programming Basics
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list