Showing posts with label vim. Show all posts
Showing posts with label vim. 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 »

A Beginners Guide to vi / vim text editor

vi (visual editor) is a terminal based text editing application, originally created for the Unix operating system. It is a fast, powerful and most popular and classic text editor in the Linux family. It is available in almost all Linux and Unix Distributions, and works the same across different platforms and Distributions. Vi does not contain any menu, instead it uses combinations of keystrokes to accomplish an action. It requires very few resources to run. An improved version of the vi editor which is called the VIM (Vi IMproved) has also been made available now. The vi editor is a full screen editor and has two modes of operation:
Read more »