Monday, March 10, 2008

vi environment variables

set
you can customize your environment with this command by typing set var=value, this will set the specified var to value for a scalar variable. For boolean varaibles, use set var to set and set novar to unset. You can see which variables are set by just typing the set by its itself. You can see a list of all variables by typing set all. some environment variables are specific to the ex editor and some are specific to the vi editor.

boolean variables:

autoindent(ai)

begin editing next line at same level of indent-ion as this one.

autowrite(aw)

write current buffer before leaving

exrc(ex)

tells vi/ex if it should read the .exrc file in the current directory(this can be a security risk).

errorbells

editor sends a beep to the terminal when an incorrect

flash

inverse the screen on an error instead of producing a bell

ignorecase(ic)

ignore case of characters in searches.

lisp

enter lisp mode

list

place a $ at the end of each line and a ^I on each tab.

magic

allow ., [, and * to be interpreted as special characters in RE's.

modelines

execute the first and last 5 lines of the file if of the form: ex:command: or vi:command:

number(nu)

number lines in left margin

showmatch(sm)

when closing a paren., brace or bracket; move the visual cursor to opening item to check scope

showmode(smd)

show type of insert mode

wrapscan(ws)

when searching and at bottom of file, continue searching from the top


Scalar variables:

directory

the location of the temporary directory used by vi

paragraphs(para)

macros to signify the beginning of a paragraph

report

vi will notify you if you change more lines than the value of report

sections(sect)

macros to signify the beginning of a section

shell

The shell to use when executing the command :sh or :!

shiftwidth(sw)

number of spaces to to insert on a shift operation

showmatch(sm)

show the match of ) and } when typed

tabstop

the length, in characters, of a tabstop

term

holds the name of the terminal type being used

wrapmargin(wm)

split lines at the column which is equal to the value of wrapmargin

No comments: