Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-01-2011, 04:32 PM   #1
Registered: Sep 2006
Posts: 374

Rep: Reputation: 16
Command to indent text in vim


I set in the .vimrc the autoindent (set autoindent).
Although I would like to create a shortcut to indent the code. What is the command to indent text?

Old 03-01-2011, 04:44 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Uh - <tab>?

Another command is ">". for example:
<esc>, :, >  // Indents current line
5>> // Indents next five lines
'a,.> // Indents block beginning at marker "a" to current line
Old 03-01-2011, 04:45 PM   #3
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356 is your friend. Use it to search for answers pertaining to anything in Linux/Unix systems. This is the first return I got when I searched for "vim indent". It has just about everything you could want to know about indenting in vim.
Old 03-01-2011, 05:05 PM   #4
Registered: Sep 2006
Posts: 374

Original Poster
Rep: Reputation: 16
I've this line in the .vimrc

set cinkeys=0{,0},:,0#,!,!^F

that are keys to indent.

But I don't understand this line.

For example, to indent the whole I've to do:

Last edited by xeon123; 03-02-2011 at 02:39 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gedit: how to indent whole blocks of text linuxqueric Linux - Desktop 1 05-16-2009 04:43 AM
vim , indent and printing reddog Programming 3 05-09-2009 05:23 PM
Vim re indent? dlublink Linux - Software 3 10-02-2006 01:37 PM
vim text wrap problem darknails Linux - Software 1 12-06-2005 06:54 AM
Text Reflow in Vim k4zau Linux - Software 4 02-29-2004 10:32 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration