Inherits from NSTextView
Conforms to ViCompletionDelegate
ViKeyManagerTarget
ViSnippetDelegate
Declared in ViTextView.h

Overview

A text edit view.

Tasks

Other Methods

Caret handling

Setting marks

Manipulating text

Working with registers

Popup menus

Working with TextMate Bundles

snippets Methods

Properties

document

Associated document.

@property (nonatomic, readonly) ViDocument *document

Declared In

ViTextView.h

keyManager

Associated key manager.

@property (nonatomic, readwrite, assign) ViKeyManager *keyManager

Declared In

ViTextView.h

mode

Vi mode (insert, normal or visual).

@property (nonatomic, readonly) ViMode mode

Declared In

ViTextView.h

visual_line_mode

YES if in visual line mode. Only valid if in visual mode.

@property (nonatomic, readwrite) BOOL visual_line_mode

Declared In

ViTextView.h

Instance Methods

caret

The location of the caret.

- (NSUInteger)caret

Return Value

The location of the caret.

Declared In

ViTextView.h

characterAtIndex:

Get the character at a location.

- (unichar)characterAtIndex:(NSUInteger)location

Parameters

location

The location to check.

Return Value

The character at the given location, or 0 if location is invalid.

Declared In

ViTextView.h

currentCharacter

The character under the caret.

- (unichar)currentCharacter

Return Value

The character under the caret.

Declared In

ViTextView.h

currentColumn

The current column.

- (NSUInteger)currentColumn

Return Value

The current column.

Declared In

ViTextView.h

currentLine

The current line number.

- (NSUInteger)currentLine

Return Value

The current line number.

Declared In

ViTextView.h

currentScreenColumn

The current screen column. This may be different from currentColumn if line wrapping is in effect.

- (NSUInteger)currentScreenColumn

Return Value

The current screen column. This may be different from currentColumn if line wrapping is in effect.

Declared In

ViTextView.h

cutToRegister:range:

Cut text to a register.

- (void)cutToRegister:(unichar)regName range:(NSRange)cutRange

Parameters

regName

The name of the register to cut to.

cutRange

The range of text to cut.

Declared In

ViTextView.h

deleteRange:

Delete a range of text.

- (void)deleteRange:(NSRange)aRange

Parameters

aRange

The range to delete.

Declared In

ViTextView.h

environment

Bundle environment variables.

- (NSDictionary *)environment

Return Value

Bundle environment variables.

Declared In

ViTextView.h

gotoColumn:fromLocation:

Go to a specific column.

- (void)gotoColumn:(NSUInteger)column fromLocation:(NSUInteger)aLocation

Parameters

column

The column to go to. Zero-based.

aLocation

A location on the line.

Declared In

ViTextView.h

gotoLine:column:

Go to a specific line and column.

- (BOOL)gotoLine:(NSUInteger)line column:(NSUInteger)column

Parameters

line

The line number to go to. One-based.

column

The column to go to. Zero-based.

Return Value

YES if the position was valid.

Declared In

ViTextView.h

input:

Input a string of keys as a macro.

- (BOOL)input:(NSString *)inputString

Parameters

inputString

A key sequence, can include special keys, see ViMap.

Return Value

YES if the macro evaluated successfully.

Declared In

ViTextView.h

insertNewlineAtLocation:indentForward:

Insert newline and indent.

- (NSUInteger)insertNewlineAtLocation:(NSUInteger)aLocation indentForward:(BOOL)indentForward

Parameters

aLocation

The location of the newline character to insert.

indentForward

YES if the line following the newline should be indented. NO if the line preceding the newline should be indented.

Return Value

Returns aLocation adjusted for automatic indentation.

Declared In

ViTextView.h

insertSnippet:

Insert a snippet at the current location.

- (ViSnippet *)insertSnippet:(NSString *)snippetString

Parameters

snippetString

The snippet to insert.

Declared In

ViTextView.h

insertSnippet:atLocation:

Insert a snippet at a given location.

- (ViSnippet *)insertSnippet:(NSString *)snippetString atLocation:(NSUInteger)aLocation

Parameters

snippetString

The snippet to insert.

aLocation

The location to insert the snippet. Zero-based.

Declared In

ViTextView.h

insertSnippet:inRange:

Insert a snippet, replacing the trigger word.

- (ViSnippet *)insertSnippet:(NSString *)snippetString inRange:(NSRange)aRange

Parameters

snippetString

The snippet to insert.

aRange

The range of the trigger word to replace.

Declared In

ViTextView.h

insertString:

Insert a string at the current location.

- (void)insertString:(NSString *)aString

Parameters

aString

The string to insert.

Declared In

ViTextView.h

insertString:atLocation:

Insert a string at a location.

- (void)insertString:(NSString *)aString atLocation:(NSUInteger)aLocation

Parameters

aString

The string to insert.

aLocation

The location where the string will be inserted. Zero-based.

Declared In

ViTextView.h

line

The content of the current line.

- (NSString *)line

Return Value

The content of the current line.

Declared In

ViTextView.h

markNamed:

Lookup a marked location.

- (ViMark *)markNamed:(unichar)markName

Parameters

markName

The name of the mark.

Return Value

The named mark, or nil if not set.

Declared In

ViTextView.h

popUpContextMenu:

Show a popup menu at the carets location.

- (void)popUpContextMenu:(NSMenu *)menu

Parameters

menu

The menu to display.

Declared In

ViTextView.h

preference:

A bundle preference at the current location.

- (id)preference:(NSString *)name

Parameters

name

The name of the Bundle Preference (eg, shellVariables)

Return Value

A bundle preference at the current location.

Declared In

ViTextView.h

preference:atLocation:

A bundle preference at a given location.

- (id)preference:(NSString *)name atLocation:(NSUInteger)aLocation

Parameters

name

The name of the Bundle Preference (eg, shellVariables)

aLocation

The location where the preference should be valid.

Return Value

A bundle preference at a given location.

Declared In

ViTextView.h

replaceRange:withString:

Replace a range of text with a string.

- (void)replaceRange:(NSRange)aRange withString:(NSString *)aString

Parameters

aRange

The range to replace.

aString

The replacement string.

Declared In

ViTextView.h

scrollToCaret

Scroll the view to the caret.

- (void)scrollToCaret

Discussion

Makes sure the caret is visible.

Declared In

ViTextView.h

setCaret:

Set the location of the caret.

- (void)setCaret:(NSUInteger)location

Parameters

location

The location of the caret. Zero-based.

Declared In

ViTextView.h

setInsertMode

Set insert mode.

- (void)setInsertMode

Declared In

ViTextView.h

setMark:atLocation:

Set a mark.

- (void)setMark:(unichar)name atLocation:(NSUInteger)aLocation

Parameters

name

The name of the mark.

aLocation

The location to mark.

Declared In

ViTextView.h

setNormalMode

Set normal mode.

- (void)setNormalMode

Declared In

ViTextView.h

setVisualMode

Set visual mode.

- (void)setVisualMode

Declared In

ViTextView.h

textStorage

The associated ViTextStorage object.

- (ViTextStorage *)textStorage

Return Value

The associated ViTextStorage object.

Declared In

ViTextView.h

yankToRegister:range:

Copying text to a register.

- (void)yankToRegister:(unichar)regName range:(NSRange)yankRange

Parameters

regName

The name of the register to copy to.

yankRange

The range of text to copy.

Declared In

ViTextView.h