Setting autoindent tab and shift width on vim/vi

Setting autoindent tab and shift width on vim/vi

Vim/vi is a real handy tool for updating any file on many linux destros including the favored ubuntu.
While working you might want to set the tab width [say 4 chars or whatever] along with shift size. Also how about to auto indent whenever you hit enter- all easy..
look for your vimrc – a config file for vim, it would be in

 /etc/vim/vimrc 

by default on ubuntu or
if you do

locate vimrc 

on your terminal it would show you the path,
Then do add the following lines in it

set autoindent
set shiftwidth=4
set tabstop=4

Well, you can change the the value of the tabs and shift as you want it..
happy vim’ing

See how you would solve these known algorithm problems

Find K Complementary numbers from array Java implementation

Get maximum occurring character

Finding missing numbers from billion sequential number list file

find longest word in the sentence

Kadane’s algorithm in C – Dynamic Programming

String Ordered Permutation Algorithm Problem

binary tree problems with solution

Java solution for checking anagram strings – tell if phrases are anagrams

Implement Queue Using two Stacks – JavaScript algorithm

Changing decimal number to its binary equivalent

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*