C editing with Vim HOWTO
2010-03-18 16:11
253 查看
2 moving around
2.1 w, e, b keystrokes
2.2 {, }, [[, ]] keystrokes
2.3 % keystroke
3 jumping to random positions in C files
3.1 ctags
ctrl-] ctrl-t
3.2 marks
mj 'j
mA 'A upper-case register could span files
3.3 gd stroke
gd means Goto Declaration.
gD will take you to the global declaration of the variable under the cursor.
4. Auto-completing words
ctrl-p ctrl-n
if you want to include foo.h, you can type
#include "f ctrl-x ctrl-f"
:set dictionary=file
ctrl-x ctrl-k
5. Formatting automatically
5.2 Automatically indent code
:set cindent
6. multi-file editing
$vim file1 file2
:n :N
:e# //jump back,toggle between two files
:split :vs ctrl-w ctrl-w
7. Quickfix
:make :cn :cN
:set makeprg=gcc/ test.c
2.1 w, e, b keystrokes
2.2 {, }, [[, ]] keystrokes
2.3 % keystroke
3 jumping to random positions in C files
3.1 ctags
ctrl-] ctrl-t
3.2 marks
mj 'j
mA 'A upper-case register could span files
3.3 gd stroke
gd means Goto Declaration.
gD will take you to the global declaration of the variable under the cursor.
4. Auto-completing words
ctrl-p ctrl-n
if you want to include foo.h, you can type
#include "f ctrl-x ctrl-f"
:set dictionary=file
ctrl-x ctrl-k
5. Formatting automatically
5.2 Automatically indent code
:set cindent
6. multi-file editing
$vim file1 file2
:n :N
:e# //jump back,toggle between two files
:split :vs ctrl-w ctrl-w
7. Quickfix
:make :cn :cN
:set makeprg=gcc/ test.c
相关文章推荐
- Linux/Ubuntu How to play with Vim(持续更新)
- VIM格式化代码(How to format code with VIM)
- How to effectively work with multiple files in Vim?
- How to generate Hibernate mapping files & annotation with Hibernate Tools
- How to use GitHub with Android Studio
- How to set third-party cookies with iframe?
- [错误处理]: How to deal with chrome failing to launch GPU process
- How to deal with the Diehards ?
- How to work with MeshLab's mesh
- how to excute command which need su permission with adb shell?
- How to get up and running with Apparat
- How to customize PuTTY terminal with Solarized palette
- [Yii Framework] How to develop an extension with image, css and js
- How To Install and Configure Django with Postgres, Nginx, and Gunicorn
- How To Drag and Drop Sprites with Cocos2D
- Enemies and Combat: How to Create a Tile Based Game with Cocos2D Part 3
- Sticky grinding ball mill work how to deal with?
- How To Create a Modeless CPropertySheet with Standard Buttons
- how to use ffmpeg with media wowza server (mpeg-ts)
- How To Default To Search Companion With Windows Desktop Search 3