git checkout --orphan future-master git add -A # Add all files and commit them git commit git branch -D master # Deletes the master branch git branch -m master # Rename the current branch to master git push -f origin master # Force push master branch to github git gc --aggressive --prune=all # remove the old files
|# This script creates a new project (or site) under /var/sites and creates|
|# new virtual host for that site. With the options a site can also|
|# install the latest version of Laravel directly.|
|# This script was originally based on the following script by @Nek from|
|# Coderwall: https://coderwall.com/p/cqoplg|
|# Display the usage information of the command.|
Creating your own ag.vim
Vim provides built-in mechanisms to search through projects in the form of the
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):
- Use ag as the default grep program
- Open quickfix window by default
- Create mappin
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
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: