不辜负自己,不将就生活。

Month: August 2016

Awesome Plugins for Vimers – 3

Vim plugins continued …

Nerd Commenter

Always we need to add comment, toggle comment in our codes, and there are different comment syntax for different programming languages. With nerdcommenter, forget about the difference, simply achieve these needs with a hotkey, and the right comment style will be applied depending on the file type. It is a very focused plugin that does the one thing very well. I like it. It is also a plugin from Martin Grenfell 🙂

DoxygenToolkit

A good coding practice is using doxygen style to comment functions, modules and files, later using the Doxygen tool to auto generate documentation. With DoxygenToolkit, you can forget about doxgen formats but focusing on the real important part: like function illustraion, parameter explaination, etc.

I often use DoxygenToolkit to comment my functions and modules, nerdcommenter to do general purpose comment, and vim-licenses to generate correct license headers. Altogether they work great.

ctrlp

ctrlp is a very famous and useful plugin. Basically with ctrlp, we can do fuzzy finding by file, mru, buffer, tag, etc. As the plugin name shows, just use Ctrl+p and see!

ag.vim

ag.vim is a vim front end for calling the silver searcher ag. In my post “Useful Development Tools – 3”, I recommend using ag for searching in source codes as ag works smart and fast.

However recently ag.vim indicates in the github that it is deprecated and suggests the use of ack.vim. Well I have not tried the latter but you can git a try. But ag.vim still works now.

Awesome Plugins for Vimers – 2

Vim plugins continued …

YouCompleteMe

YouCompleteMe is the best auto-completion plugin for Vim. It contains support for a variety of programming languages, such as c, c++, python, javascript, etc. YCM also supports the powerful snippet plugin Ultisnips. One thing I think YCM is great is the way it supports semantic completion. By semanic completion, YCM understands your code at realtime, not by simply guessing patterns from buffer which is implemented by other auto-completion plugins such as neocomplete. However, due to YCM uses clang, it is a bit hard to install YCM on Windows, in such conditions, you can choose install a precompiled YCM, such as this one.

Ultisnips

Ultisnips provides the best snippet for Vim. YouCompleteMe integrates support of Ultisnips as well, which means when you type, the system will give you smart hints for snippets if available in addition to buffer or semantic completion. The experience is perfect.

Syntastic

Syntastic is used for static checking of source codes. It comes from Martin Grenfell, author of nerdtree and nerdcommenter. Syntastic runs well with a variety of programming languages and checkers, such as cppcheck, jshint, pylint, tidy, prettyccs, etc. I recommend you to install Syntastic along with YCM, as it enhances YCM with a decent syntax checking. Type :SyntasticInfo to see the available checkers you have, and install your preferred tool.

vim-licenses

Vim-licenses is a plugin that eases adding license to the top of the buffer. I think it is good practice to confirm your license for the source codes you write. It not only shows your professionalism, but also indicates your respect for the open source movement. But first, understand different open source licenses such as GPL, LGPL, MIT, BSD, Apache, etc. When you uses source codes from others, either non-commercial or commercial, always read its license and behave correspondly.

To be continued…

Awesome Plugins for Vimers – 1

Vim is a flexible and powerful editor. There is always a saying about 3 kinds of editors in the world (Vim, Emacs and the others), and there is always a war between Vim and Emacs.

I am not interested in the battle of world’s best editor, but I can convince you that although Vim comes with a bit steep learning curve, when you are used to it, you will always understand why lots of programmers choose it.

One important feature of Vim is its support for plugins. It is those plugins that enhance Vim for different uses. Here I will recommend several awesome plugins which I believe essential for Vimers.

Vundle

Vundle is a great plugin manager for Vim. It is the first ever plugin a Vimer should install. After that, Vundle takes charge of all the other plugin maintenance taaks, including downloading, installing, loading, updating, cleaning, etc. With Vundle, you only need the vimrc file when swithing computers, Vundle ensures you always getting the same configuations and plugins.

The NERD Tree

Nerdtree is a plugin for file system exploration in Vim. You can navigate through the filesystem tree with keyboard or mouse easily with the plugin. You can also bookmark certain folders or files in Nerdtree for quick access.

tagbar

Tagbar is the famous taglist alternative. Like taglist, tagbar internally uses ctags to generate at realime tags for the file, but tagbar has more support for OO languages such as c++.

a.vim

a.vim is used for quick switch between source and header. For example, when you are editing foo.c, simply type :A and you will be editing foo.h, or :AS makes a split window for editing foo.h.

To be continued…

Useful Development Tools – 3

This article continues my last blog.

Source Navigation

cscope and ctags

Cscope and ctags can assist you in when browsing source codes. You can use ctags with Vim plugins like tagbar or taglist, and Vim also supports cscope jumping. Both cscope and ctags are good alternative to commercial software like Source Insight, Scitools Understand and Crystal Flow, and they are always available in Linux and Windows.

Searcher

grep and grepWin

Grep is an essential tool in Linux system. And if you are working on Windows, you can consider using the alternative grepWin, it has a decent UI as well.

Ag

Ag is called the silver searcher, and can be integrated with Vim using ag.vim. I find ag very fast when searching codes, because perhaps it is smart in its searching, like ignoring files flagged in .gitignore. I will recommend you to use it instead of grep tools for source codes. For general regex search, using grep instead.

everything

Everything works only on Windows. Well, if you read my posts, you will find that I prefer cross-platform tools, that is because sometimes I have to work on both platforms (Linux and Windows), and I enjoy having the same experience. However, everything is so great tool that I cannot ignore it here. It is super-fast when searching NTFS files, in a blink of eyes, but it only searches by file name. You will find it very useful when you try to find a file that buried in SOME direcoty that you have forgot.

Offline Documentation Browser

Zeal

Zeal is a quite new tool, featuring offline documentation browsing. Mac programmers always find Dash indispensable, now zeal is an open source alternative to Dash and works on both Linux and Windows. Actually, zeal uses api docsets from Dash I suppose, and it now supports 198 docsets. Zeal can be integrated with Vim with zeavim, and you can cross-reference from your source code to its api documentation easily with your defined hot keys.

© 2025 A Life Climber

Theme by Anders NorenUp ↑

error: Content is protected !!