LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Tab setting in vim editor!!! (https://www.linuxquestions.org/questions/linux-software-2/tab-setting-in-vim-editor-633035/)

visitnag 04-04-2008 11:38 AM

Tab setting in vim editor!!!
 
Hi all,

I am a newbie to the vi editor. I use vi to write AWK progs and perl scripts. I am facing a problem of indentation. When I press enter after writing a line, the cursor is going back to the start of the line. But i want the cursor to be placed at bottom of the above lines beginning, i.e., if I typed some code from 16th column the next line should start from 16th column only, unless i change the indentation.

druuna 04-04-2008 12:11 PM

Hi,

Did you try activating autoindent (ai)?

You can try it by issueing the following command in command mode: set ai (set noai to deactivate).

If this is what you want/need you can put it in your vimrc (global or local). The full name can also be used. I.e. set autoindent.

Hope this helps.

prad77 04-04-2008 03:47 PM

http://vim.sourceforge.net/tips/tip.php?tip_id=83

This thread has more alikes.

Gentoo

tronayne 04-04-2008 05:01 PM

If you create a file, .exrc, in your home directory with this content
Code:

set autoindent showmode showmatch
you'll get autoindent (you use ^D to go back to the previous indent level on a new line), showmode (an indication of what mode you're in) and showmatch (the cursor will jump back to the previous '(' or '[' or '{' when you type a corresponding ')' or ']' or '}' -- kinda handy, that).

visitnag 04-12-2008 11:41 AM

Thank you all...


All times are GMT -5. The time now is 04:26 PM.