Sponsored Content
Full Discussion: Auto indent in vi
Top Forums UNIX for Dummies Questions & Answers Auto indent in vi Post 23241 by Kelam_Magnus on Wednesday 19th of June 2002 10:36:08 AM
Old 06-19-2002
use :set tabstop=N

I know that you can use a setting called tabstop.

First, do a " :set all" to see the settings. Then do a " :set tabstop=N" where N is some number.

This will allow you to use the tab in edit mode to advance N spaces.

I know there is a way to set hot keys for certain actions or words but can't remember right now. I know it has been addressed before on this site.

There is a pamphlet and a book as well about VI from O'Reilly which are both very good.

Here is one link that may help as well.
http://www.thomer.com/vi/vi.html




Smilie
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

vim indent

I know this is not a unix question but I also know that many of you use vim editor every day. So hoping to get some help, here it goes: How can I change my vim config file so that the indentations while c programming take 4 spaces instead of 8? I want the change to apply any further uses of... (4 Replies)
Discussion started by: Virtuosso
4 Replies

2. UNIX for Dummies Questions & Answers

[non-important] Indent here-docs?

I recently coded a typical ftp script looking like ftp -n $hostname << user $user $pass <commands..> quit ! I know the code fails when you try to indent it like: ftp $hostname << user $user $pass <commands..> quit ! Just for the sake of neat code, is there a... (4 Replies)
Discussion started by: yongho
4 Replies

3. UNIX for Dummies Questions & Answers

Indent output of an UNIX command

Hi, How do I indent 4 spaces for standard UNIX commands like ls -ltr (or grep)? For example, I want ls -ltra to output as: <<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file1 <<spaces here>>-rw-r----- 1 a345696 rtkdevel 455 Dec 6 14:52 file2 <<spaces... (2 Replies)
Discussion started by: ssray23
2 Replies

4. UNIX for Dummies Questions & Answers

vi auto indent whole file at once

Hi, I'm working on a big project and all the CPP and header files are in mess with respect to indentation. I would like to indent whole file(s) at once (like ctrl-shift-f in eclipse). Is there anybody who knows how to do that in vi/vim? thanks (2 Replies)
Discussion started by: SaTYR
2 Replies

5. Shell Programming and Scripting

Insert Tabs / Indent text

Hi, i need replace the slash (/) with a newline (\n) and a tab (\t). With 'find -type f' in a folder i got this output: ./1999/01/file1 ./1999/01/file2 ./1999/02/file1 ./2000/04/file1 ./2000/04/file2 ./2000/04/file3 ./2000/04/file4 ./2000/06/file1 ./2000/06/file2 ./2000/06/file3... (8 Replies)
Discussion started by: Tonda
8 Replies

6. Shell Programming and Scripting

How to indent the file lines using vi?

Every now and then I have to indent the lines in my script to 4 space characters. I generally do it line by line. Is there an automated command in vi using which I can indent some set of lines to desired number of space characters in one go. (2 Replies)
Discussion started by: paragkalra
2 Replies

7. Shell Programming and Scripting

Python indent - how do you do it?

A space, a tab? Just currious what, why, you indent in x way? Fwiw, I use vi, so kind'a currious how you vi folks approach indentation when writing code (eg python). Disclosure, I'm just learning python and have never seen a language use indentation so formally (I like it too:) ). I just... (7 Replies)
Discussion started by: sas
7 Replies

8. Shell Programming and Scripting

Parse excel with indent

hello everyone how to parse excel file with indents ? i was trying perl and there is Spreadsheet::ParseExcel::Format but i have no idea how to make it work docs says $format->{Indent} but it's not working also i was trying xls2csv and xlhtml but they don't care about indents at all :( i... (1 Reply)
Discussion started by: tip78
1 Replies
textutil::tabify(n)				    Text and string utilities, macro processing 			       textutil::tabify(n)

__________________________________________________________________________________________________________________________________________________

NAME
textutil::tabify - Procedures to (un)tabify strings SYNOPSIS
package require Tcl 8.2 package require textutil::tabify ?0.7? ::textutil::tabify::tabify string ?num? ::textutil::tabify::tabify2 string ?num? ::textutil::tabify::untabify string ?num? ::textutil::tabify::untabify2 string ?num? _________________________________________________________________ DESCRIPTION
The package textutil::tabify provides commands that convert between tabulation and ordinary whitespace in strings. The complete set of procedures is described below. ::textutil::tabify::tabify string ?num? Tabify the string by replacing any substring of num space chars by a tabulation and return the result as a new string. num defaults to 8. ::textutil::tabify::tabify2 string ?num? Similar to ::textutil::tabify this command tabifies the string and returns the result as a new string. A different algorithm is used however. Instead of replacing any substring of num spaces this command works more like an editor. num defaults to 8. Each line of the text in string is treated as if there are tabstops every num columns. Only sequences of space characters containing more than one space character and found immediately before a tabstop are replaced with tabs. ::textutil::tabify::untabify string ?num? Untabify the string by replacing any tabulation char by a substring of num space chars and return the result as a new string. num defaults to 8. ::textutil::tabify::untabify2 string ?num? Untabify the string by replacing any tabulation char by a substring of at most num space chars and return the result as a new string. Unlike textutil::tabify::untabify each tab is not replaced by a fixed number of space characters. The command overlays each line in the string with tabstops every num columns instead and replaces tabs with just enough space characters to reach the next tabstop. This is the complement of the actions taken by ::textutil::tabify::tabify2. num defaults to 8. There is one asymmetry though: A tab can be replaced with a single space, but not the other way around. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category textutil of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
regexp(n), split(n), string(n) KEYWORDS
formatting, string, tabstops CATEGORY
Text processing textutil 0.7 textutil::tabify(n)
All times are GMT -4. The time now is 03:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy