Sponsored Content
Full Discussion: Auto indent in vi
Top Forums UNIX for Dummies Questions & Answers Auto indent in vi Post 23224 by sierra_aar on Wednesday 19th of June 2002 03:39:39 AM
Old 06-19-2002
Question Auto indent in vi

Hi,

I use vi for my text editing. Is there a way to use smart indentation?
that is when adding a '{' or '}' that the editor will jump and advance, or any other thing like that?

thanks
 

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
ex(1)							      General Commands Manual							     ex(1)

Name
       ex, edit - text editor

Syntax
       ex [ - ] [ -v ] [ -x ] [ -t tag ] [ -r ] [ +command ] [ -l ] name...
       edit [ ex options ]

Description
       The  editor  is	the  root  of a family of editors: and The editor is a superset of with the most notable extension being a display-editing
       facility.  Display-based editing is the focus of

       The name argument indicates the files to be edited.

Options
       -    Suppresses all interactive-user feedback.  This option is useful in processing editor scripts in command files.

       -v   Equivalent to using rather than

       -t   Equivalent to an initial tag command, that is, editing the file containing the tag and positioning the editor at its definition.

       -r   Used to recover after an editor or system crash.  It recovers by retrieving the last saved version of the named file.  If no  file	is
	    specified, it displays a list of saved files.

       -R   Sets the read-only option at the start.

       +command
	    Indicates  that  the editor should begin by executing the specified command.  If the command is omitted, it defaults to $, positioning
	    the editor at the last line of the first file, initially.  Other useful commands here are scanning patterns of the form  +/pattern	or
	    line numbers.

       -l   Sets up for LISP.  That is, it sets the showmatch and lisp options.  The -x option is available only if the Encryption layered product
	    is installed.

       -x   Causes to prompt for a key. The key is used to encrypt and decrypt the contents of the file. If the file contents have been  encrypted
	    with one key, you must use the same key to decrypt them.

Restrictions
       The command causes all marks to be lost on lines changed and then restored if the marked lines were changed.

       The command does not clear the buffer modified condition.

       The z command prints a number of logical rather than physical lines.  More than a screenful of output may result if long lines are present.

       File input/output errors do not print a name if the command line minus sign (-) option is used.

       There is no easy way to do a single scan ignoring case.

       The editor does not warn you if you place text in named buffers and do not use it before exiting the editor.

       Null characters are discarded from input files, and cannot appear in output files.

Files
       /usr/lib/ex?.?recover	     recover command
       /usr/lib/ex?.?preserve	     preserve command
       /etc/termcap		terminal capabilities
       ~/.exrc			editor startup file
       /tmp/Exnnnnn		editor temporary
       /tmp/Rxnnnnn		named buffer temporary
       /usr/preserve		preservation directory

See Also
       awk(1), ed(1), grep(1), sed(1), vi(1), termcap(5), environ(7)
       "Edit: A Tutorial" and the "Ex Reference Manual" in the
       Supplementary Documents, Volume 1: General User

																	     ex(1)
All times are GMT -4. The time now is 07:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy