As the saying goes, 工欲善其事, its prerequisite, last year began to do Linux C development, to source INSTGHT,ECLIPSE,QT creator and other development tools on the whole a long time, not a close mind, finally heard vim, and Emacs plus plug-ins will be more useful, but need a very long time to get started, but still relatively want to engage in the development of Linux, in addition, even in Windows can replace the source insight to read FFmpeg source, moved to Vim, It took me a year to finally get vim to the point where at least I felt more comfortable than the source insight. All profiles have been shared on GitHub. Personal advice, if you don't want to do Linux development for a long time, I think source insight is enough to write code on Linux with Samba services. If you want to be in any environment, you can easily play to the Linux/C + + code, I think with my current creation of this vim is quite enough. Although it is easier to put this vim directly, it is certainly not a day or two to use to feel more comfortable than the source insight.
Directory
缘起版本支持使用范围使用方法相对于原生VIM定制的内容新增快捷键已知不足交流
Origin
I tried a lot of editing methods when I started doing Linux C + +, including: souce Insight: Write code on Linux hosts via samba services on Linux ( I don't think it's the best choice outside of the custom version of Vim and Emacs, on the one hand, without the need to open the virtual machine interface, on the other hand, souce Insight Writing code is very useful. Eclipse: Very good, but do not open the Linux GUI, in addition eclipse runs very slowly, especially the large project QT creator: Even if not the QT project, of course, can also be used in the Linux graphical interface with Qt Creator write code, faster than eclipse run, Of course, if the QT project under Linux is of course Qt Creator is also preferred. Vim and Emacs: as a development environment to add jump and automatic completion of the class of plug-ins. Although they may not be as powerful as other Ides, other Ides need to open up a resource-intensive graphical interface, and vim and Emacs have many benefits that other Ides do not, such as the need for a mouse for all operations, the ability to search by one click, and so on. In addition, they can be directly ssh to the Linux host is directly used, the disadvantage is that it is not easy to get started. Vim and Emacs can be without bounds to add any function of the plug-in, the theory can be implemented in one of the above functions on the other can be achieved, there is no one who is stronger than the problem. From the basic operation of the individual or more like Emacs, but because the toss Emcas plugin more difficult than vim, so chose vim. This vim customization is gradually perfected in a year, in which a period of time to turn to Emacs, and then toss Cedet really did not toss not perfect, can not find who used to exchange, so eventually back to the vim. The principle of this vim customization is to keep it as streamlined as possible, fast and better compatible, but to achieve more powerful, practical, and user-friendly features.
Version support
7.2及以上,暂未发现有兼容性问题情况。7.2以下版本的vim我没有见到过。
Scope of Use
作为c/c++和python开发,会有意想不到的效果,对shell脚本开发也还行,对于一般配置文件的修改或许会比原生好点,至少不会有变差的地方。
How to use
把.vimrc和.vim文件夹拷贝到自己的家目录下就可以了。如果要用索引功能要装ctags和cscope,在ubuntu下安装apt-get install ctags && apt-get install cscope即可。在其他发行版这两个软件的包名一般也一样是ctags和cscope。
Customized content relative to native vim
1. Syntax coloring 2.desert Theme in the case of white background to change the background option in the configuration file 3. Setting the 256-color display mode will show better looking if the terminal supports 256 colors. If the terminal is 8 colors, then the color displayed is not as good as the 256-color setting. Screen under the default is 8 colors, to change the Screenr configuration script. 4. The status bar is permanently displayed, and the lower right corner of the screen shows the ruler some people like to add line numbers before each line, but I don't normally use them, mainly because the current cursor is already on the status bar. 5. Display the corresponding brackets 6.tab length set to 4, in addition to tab display Chengjian line, when writing Python is very useful 7. Set automatically select UTF8 and cp936 mode, reduce the likelihood of garbled 8. Set to non-compatible VI mode 9. Better use of the fallback key 10. Fix C + + Indentation for identifiers such as public under Class 11. Add Nerd Tree file list feature This plugin is very powerful, as a file tree only you can not think of features, there is no function that it does not implement. On the basis of the original function, I added a "w" Shortcut to toggle the width of the window between the fixed width and the longest line width. Press F2 button to activate the plugin, use Baidu or Google for details. 12. Added Tagbar function list function and variable list 13. Add Ctags and Cscope index ctags and cscope shortcut keys themselves Baidu or Google, using the way is in the project root directory run vim, then press F5 Update Index, You can then use the shortcut keys to jump. I usually use ctags to define the jump, Cscope used as a search for a word in the project where all occurrences. 15. Add the comment plug-in support of the language has n, in its supported language range, "\CC" three keys can comment on the current line, if some rows are selected, then the selected rows will be commented. "\cu" is used for anti-annotation and usage. 16. Add the Omnicpp Auto-complete plug-in vim, C + + auto-complete plug-ins are many, but this is very streamlined, including CPU usage and physical file occupancy. Although more powerful, the configuration is complex and may not be compatible. It's enough for me at least. This complements the input "." Below the C + +. Or "," will automatically pop up the optional list, Python auto-completion I did not add a new plugin, because the general vim installation will come with Python's completion plug-in, but also quite powerful. As long as the. can, and then press C-x X-o on it, in some cases, the vim on the machine may not be compiled into the Python module, there is no way. 17. Adding header files and implementing file switchingThe function shortcut key is <f4>18. Adding a search shortcut can show the number and list of occurrences of the word in this file with a single click.
Shortcut keys
F2 目录树 F3 函数列表 F4 头文件和实现文件切换 F5 更新ctags和cscope F6 更新cscopeF7 在这个文件下搜索光标下单词以列表的形式显示F8 关闭F7所打开的列表F9 运行pythonF10 退出vimc-h, j, k, l可以在各个窗口间切换
Known Insufficient
1.在文件未保存的情况下不可以跳转到其他文件2.ctags在文件编码与终端编码不相同且跳转行有中文的情况下无法跳转
Code please see here. Https://github.com/langsim/VIM-IDE, feel good to point a star ha.
Code please see here. Https://github.com/langsim/VIM-IDE, feel good to point a star ha.
Create Super Vim-ide Nerdtree ctags cscope a omnicpp Python garbled tab theme