Vim Plugins for C/C++ developers
2011-12-09 16:11
323 查看
原文链接:http://www.fortystones.com/vim-plugins-c-cplusplus-developer/
Following up on my previous post on Essential
Vim Plugins for Web Developers, I have decided to tell you about the awesomeness of the C / C++ plugin for Vim in this article.
Now to get things going, let’s start by thinking what are the basic stuffs that you would be carrying out as a C / C++ developer? Include header files, some functions, loops, conditional statements and
a main function. These are some repetitive boring tasks that you would rather have someone else do it for you. Well, that’s what c.vim plugin is all about.
For example, after installing this plugin, when you open a C or C++ file, you would get something like:
To make necessary changes in the above fields, modify the values in ~/.vim/c-support/templates/Templates file. (Installation at the end of the article)
Now you would want to insert some header files. All you need to do is type these commands in either normal mode or insert mode of vim.
Similarly, to include loop structures, all you have to do is type these commands in normal or insert mode of vim.
If you want to make your program, a well-documented and a readable one, then take my advice, use c.vim plugin. You can add a frame comment, a class description, function description etc.
For e.g. if you type \cfu in visual or insert mode, it will give you
This is one of the interesting parts of c.vim plugin. For instance, type \ii (in normal or insert mode) and witness the change.
You can now compile and run your program without quitting Vim. You don’t need to go back to the terminal, compile and again return to vim to make necessary modifications. Just follow the following commands
(in visual or insert mode).
Finally, \hm to Show manual & \hp for help.
Download the plugin c.vim
Extract the file to .vim folder
unzip -d ~/.vim/
Enable the plugin by adding the following line in ~/.vimrc file
filetype plugin on
http://www.vim.org/scripts/script.php?script_id=213
http://lug.fh-swf.de/vim/vim-c/c-hotkeys.pdf
Following up on my previous post on Essential
Vim Plugins for Web Developers, I have decided to tell you about the awesomeness of the C / C++ plugin for Vim in this article.
Now to get things going, let’s start by thinking what are the basic stuffs that you would be carrying out as a C / C++ developer? Include header files, some functions, loops, conditional statements and
a main function. These are some repetitive boring tasks that you would rather have someone else do it for you. Well, that’s what c.vim plugin is all about.
For example, after installing this plugin, when you open a C or C++ file, you would get something like:
To make necessary changes in the above fields, modify the values in ~/.vim/c-support/templates/Templates file. (Installation at the end of the article)
Now you would want to insert some header files. All you need to do is type these commands in either normal mode or insert mode of vim.
Similarly, to include loop structures, all you have to do is type these commands in normal or insert mode of vim.
For e.g. if you type \cfu in visual or insert mode, it will give you
(in visual or insert mode).
Finally, \hm to Show manual & \hp for help.
Extract the file to .vim folder
unzip -d ~/.vim/
Enable the plugin by adding the following line in ~/.vimrc file
filetype plugin on
http://lug.fh-swf.de/vim/vim-c/c-hotkeys.pdf
相关文章推荐
- ubuntu下安装eclipse IDE for C/C++ developers
- vim config for C/C++/shell(ubuntu 12.04)
- Professional Multicore Programming: Design and Implementation for C++ Developers
- ubuntu安装eclipse IDE for C/C++ developers
- 使用Eclipse IDE for CC++ Developers 构建C++开发环境
- Eclipse IDE for C/C++ Developers和MinGW安装配置C/C++开发学习环境详解
- Vim for Rails developers: Lazy modern configuration
- 在ubuntu 12.04系统上安装Eclipse IDE for C/C++ Developers
- Personal Note:Eclipse IDE for C/C++ Developers
- 使用Eclipse IDE for CC++ Developers 构建C++开发环境
- Eclipse IDE for C/C++ Developers 与 MinGW 配置说明
- VIM IDE for C++
- [Linux] Migrate plugins and setting for vim
- Ubuntu 12.04下在Eclipse IDE for C/C++ Developers中运行C语言的GTK程序
- Vim for Python & Normal Plugins & Vundle
- Introduction to C++ for iOS Developers: Part 1
- Eclipse IDE for C/C++ Developers include glib on linux
- win7x64下配置eclipse for JAVA及C/C++ developers + MinGW + Opengl的备忘录
- 定制Vim for C++