You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am a relatively experienced Linux user -- started with Ubuntu 8.04 LTS in late 2009 as part of the labs in my undergrad institute.
Various technology magazines made me a distro hopper in 2011.
Eight years with Ubuntu
When I stabilized back to Ubuntu, I started getting familiar with bash-script, learnt building unavailable packages, and became an ardent Vimmer.
In 2012 I ditched Windows completely and started using Ubuntu 10.04 as the standalone OS on my Dell Studio 1450 laptop.
That was a liberating experience -- no startup errors, superfast bootup, no antivirus scans -- awesome!
When I got my new Lenovo laptop in 2014, I vowed to always keep my machine a Linux box.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using git submodules to version-control Vim plugins
Using git-submodules to version-control Vim plugins
If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need.
Thus, you should keep the .vim directory along with your .vimrc version-controlled.
But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.
Creating the repository
Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:
Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo.
First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).
Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default).
For example, if the layout of a plugin foo is as follows:
Vim provides built-in mechanisms to search through projects in the form of the grep command.
However, on large projects, grep is known to be slow; and hence people have been switching to simpler searchers like ack, and faster, parallel (metal?) searchers like ag and pt.
Correspondingly, several plugins have been created that integrate these tools in vim: ack.vim, ag.vim, etc.
However, it's actually very easy to get the functionalities these plugins provide (faster search, results in quickfix-window, jumps, previews, and so on) in vanilla Vim itself; in fact, Vim already populates the grep-search results in a quickfix window. We just need to tell Vim to do the following things (use-case: ag):