Installing plugin manager Pathogen
Run below commands:
Commands :
Using language Templates in vim :
Create templates folder on ~/.vim folder
template.c
Installing Supertab in vim :
Auto-Completion function (sort of...). Commands :
Installing taglist with bundle
It shows all the tags (function, classes, variables ) etc. Steps to install :
Download taglist from : http://vim-taglist.sourceforge.net/download.html
Create a folder in ~/.vim/bundle/taglist and put doc and plugin folders in it.
Add below configuration in it.
Run below commands:
$ mkdir -p ~/.vim/autoload ~/.vim/bundle
$ curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Add below lines to ~/.vimrc file : execute pathogen#infect()
syntax on
filetype plugin indent on
Installing NERDTREE plugin:Commands :
$ cd ~/.vim/bundle
$ git clone https://github.com/scrooloose/nerdtree.git
Add below lines to ~/.vimrc file : map <F2> :NERDTree<CR>
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
To open the NERDTREE pane press F2.Using language Templates in vim :
Create templates folder on ~/.vim folder
$ mkdir ~/.vim/templates
$ cd ~/.vim/templates
Now create template files on ~/.vim/templates/ directory. Some examples of template files are as follows :template.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
return 0;
}
template.cpp #include <iostream>
int main(int argc, char *argv[]) {
return 0;
}
template.py #!/usr/bin/python
template.sh #!/bin/bash
Now add below lines to ~/.vimrc file : " code for template snippets
if has("autocmd")
augroup templates
autocmd BufNewFile *.sh 0r ~/.vim/templates/template.sh
autocmd BufNewFile *.c 0r ~/.vim/templates/template.c
autocmd BufNewFile *.cpp 0r ~/.vim/templates/template.cpp
autocmd BufNewFile *.java 0r ~/.vim/templates/template.java
autocmd BufNewFile *.php 0r ~/.vim/templates/template.php
autocmd BufNewFile *.py 0r ~/.vim/templates/template.py
autocmd BufNewFile *.html 0r ~/.vim/templates/template.html
augroup END
endif
Installing Supertab in vim :
Auto-Completion function (sort of...). Commands :
$ cd ~/.vim/bundle
$ git clone https://github.com/ervandew/supertab
Installing taglist with bundle
It shows all the tags (function, classes, variables ) etc. Steps to install :
Download taglist from : http://vim-taglist.sourceforge.net/download.html
Create a folder in ~/.vim/bundle/taglist and put doc and plugin folders in it.
Add below configuration in it.
map <F3> :TlistToggle<CR>
let Tlist_Use_Right_Window = 1
Now you can start taglist by pressing F3 button and second line of above configuration snippets sets taglist to right side of vim window. If there any message Error message shows like this : Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.
Press ENTER or type command to continue
then you have to install exuberant-ctags package sudo apt-get install exuberant-ctags