Miscellaneous: Vi autoindent / startup file

(last edit: 2000-11-22) Vi autoindent This is realy usefull when you are programming in vi. Autoindenting means that vi helps you with the tabs in front of your code. Just try it and you'll love it.... Start vi hit ESC hit the ':' type in 'set autoindent' and hit ENTER now type a line hit ESC type '>>' You'll see that your line moves one tab to the right. Now type a new line below or above. You'll see that the new line has the same number of tabs in front as the first one. When you want to lower the number of tabs in front of the paragraph you type '<<'. Personaly I find a tab of 8 characters a bit too long so you can change this by: hit ESC hit the ':' type in 'set shiftwidth=2' and hit ENTER now you have a tabwidth of 2. Vi startup file The above is nice and nifty but I'm to lazy to type that every time vi starts so I've put these settings in a vi startup file named '$HOME/.nexrc' (thus the file '.nextc' in your homedir). This is how my '.nexrc' file looks like: user@host:~#cat .nexrc set shiftwidth=2 set autoindent

Click here to go back to the index.