Showing posts with label vimrc. Show all posts
Showing posts with label vimrc. Show all posts

Setting-up Vimux ( vim + tmux ) in Linux machine

By using vimux we can use vim as an IDE. It basically opens a terminal below vim panel with 20 width and then run the mapped command. Pre-requisites are vim and tmux installed.

Installation :

Make sure vim plugin manager will be installed. I installed pathgen. Now run the below command :
 cd ~/.vim/bundle
 git clone https://github.com/benmills/vimux.git

Configuration :

The function used to configure vimux are VimuxRunCommand, VimuxPromptCommand, VimuxRunLastCommand.
  • VimuxRunCommand : used to run certain system command. It is mapped with autocmd FileType which map different commands for different filetypes. Press LEADER + e
  • VimuxPromptCommand : used to open a prompt to run user supplied command. Press LEADER + p
  • VimuxRunLastCommand : used to run last command Executed by VimuxRunLastCommand. Press LEADER + l
Note : LEADER key is mapped to / (slach), by default it is mapped to \ (backword-slash).
Read more »

vim plugins installation and some basic .vimrc configuration

Installing plugin manager Pathogen

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 :
Read more »