yi-0.7.1: The Haskell-Scriptable Editor

Safe HaskellNone

Yi.Buffer.HighLevel

Contents

Synopsis

Documentation

moveToSol :: BufferM ()Source

Move point to start of line

moveToEol :: BufferM ()Source

Move point to end of line

topB :: BufferM ()Source

Move cursor to origin

botB :: BufferM ()Source

Move cursor to end of buffer

leftOnEol :: BufferM ()Source

Move left if on eol, but not on blank line

moveXorSol :: Int -> BufferM ()Source

Move x chars back, or to the sol, whichever is less

moveXorEol :: Int -> BufferM ()Source

Move x chars forward, or to the eol, whichever is less

nextWordB :: BufferM ()Source

Move to first char of next word forwards

prevWordB :: BufferM ()Source

Move to first char of next word backwards

Char-based movement actions.

nextCInc :: Char -> BufferM ()Source

Move to the next occurence of c

nextCExc :: Char -> BufferM ()Source

Move to the character before the next occurence of c

prevCInc :: Char -> BufferM ()Source

Move to the previous occurence of c

prevCExc :: Char -> BufferM ()Source

Move to the character after the previous occurence of c

firstNonSpaceB :: BufferM ()Source

Move to first non-space character in this line

lastNonSpaceB :: BufferM ()Source

Move to the last non-space character in this line

moveNonspaceOrSol :: BufferM ()Source

Go to the first non space character in the line; if already there, then go to the beginning of the line.

isCurrentLineEmptyB :: BufferM BoolSource

True if current line consists of just a newline (no whitespace)

isCurrentLineAllWhiteSpaceB :: BufferM BoolSource

Note: Returns False if line doesn't have any characters besides a newline

nextNParagraphs :: Int -> BufferM ()Source

Move down next n paragraphs

prevNParagraphs :: Int -> BufferM ()Source

Move up prev n paragraphs

atSol :: BufferM BoolSource

Return true if the current point is the start of a line

atEol :: BufferM BoolSource

Return true if the current point is the end of a line

atSof :: BufferM BoolSource

True if point at start of file

atEof :: BufferM BoolSource

True if point at end of file

atLastLine :: BufferM BoolSource

True if point at the last line

getLineAndCol :: BufferM (Int, Int)Source

Get the current line and column number

readLnB :: BufferM StringSource

Read the line the point is on

readRestOfLnB :: BufferM StringSource

Read from point to end of line

readPreviousOfLnB :: BufferM StringSource

Read from point to beginning of line

prevPointB :: BufferM PointSource

Get the previous point, unless at the beginning of the file

nextPointB :: BufferM PointSource

Get the next point, unless at the end of the file

bdeleteB :: BufferM ()Source

Delete one character backward

killWordB :: BufferM ()Source

Delete forward whitespace or non-whitespace depending on the character under point.

bkillWordB :: BufferM ()Source

Delete backward whitespace or non-whitespace depending on the character before point.

uppercaseWordB :: BufferM ()Source

capitalise the word under the cursor

lowercaseWordB :: BufferM ()Source

lowerise word under the cursor

capitaliseWordB :: BufferM ()Source

capitalise the first letter of this word

switchCaseCharB :: BufferM ()Source

switch the case of the letter under the cursor

deleteToEol :: BufferM ()Source

Delete to the end of line, excluding it.

deleteLineForward :: BufferM ()Source

Delete whole line moving to the next line

swapB :: BufferM ()Source

Transpose two characters, (the Emacs C-t action)

deleteTrailingSpaceB :: BufferM ()Source

Delete trailing whitespace from all lines

setSelectionMarkPointB :: Point -> BufferM ()Source

Marks

Set the current buffer selection mark

getSelectionMarkPointB :: BufferM PointSource

Get the current buffer selection mark

exchangePointAndMarkB :: BufferM ()Source

Exchange point & mark.

bufInfoB :: BufferM BufferFileInfoSource

File info, size in chars, line no, col num, char num, percent

upScreenB :: BufferM ()Source

Scroll up 1 screen

downScreenB :: BufferM ()Source

Scroll down 1 screen

scrollScreensB :: Int -> BufferM ()Source

Scroll by n screens (negative for up)

scrollByB :: (Int -> Int) -> Int -> BufferM ()Source

Scroll according to function passed. The function takes the | Window height in lines, its result is passed to scrollB | (negative for up)

vimScrollB :: Int -> BufferM ()Source

Same as scrollB, but also moves the cursor

vimScrollByB :: (Int -> Int) -> Int -> BufferM ()Source

Same as scrollByB, but also moves the cursor

scrollToCursorB :: BufferM ()Source

Move to middle line in screen

scrollCursorToTopB :: BufferM ()Source

Move cursor to the top of the screen

scrollCursorToBottomB :: BufferM ()Source

Move cursor to the bottom of the screen

scrollB :: Int -> BufferM ()Source

Scroll by n lines.

snapInsB :: BufferM ()Source

Move the point to inside the viewable region

indexOfSolAbove :: Int -> BufferM PointSource

return index of Sol on line n above current line

data RelPosition Source

Constructors

Above 
Below 
Within 

Instances

pointScreenRelPosition :: Point -> Point -> Point -> RelPositionSource

return relative position of the point p relative to the region defined by the points rs and re

snapScreenB :: Maybe ScrollStyle -> BufferM BoolSource

Move the visible region to include the point

downFromTosB :: Int -> BufferM ()Source

Move to n lines down from top of screen

upFromBosB :: Int -> BufferM ()Source

Move to n lines up from the bottom of the screen

middleB :: BufferM ()Source

Move to middle line in screen

getRawestSelectRegionB :: BufferM RegionSource

Return the region between point and mark

getRawSelectRegionB :: BufferM RegionSource

Return the empty region if the selection is not visible.

getSelectRegionB :: BufferM RegionSource

Get the current region boundaries. Extended to the current selection unit.

setSelectRegionB :: Region -> BufferM ()Source

Select the given region: set the selection mark at the regionStart and the current point at the regionEnd.

extendSelectRegionB :: Region -> BufferM ()Source

Extend the selection mark using the given region.

lineStreamB :: Direction -> BufferM [String]Source

Get a (lazy) stream of lines in the buffer, starting at the next line in the given direction.

modifySelectionB :: (String -> String) -> BufferM ()Source

Uses a string modifying function to modify the current selection Currently unsets the mark such that we have no selection, arguably we could instead work out where the new positions should be and move the mark and point accordingly.

linePrefixSelectionBSource

Arguments

:: String

The string that starts a line comment

-> BufferM () 

Prefix each line in the selection using the given string.

unLineCommentSelectionBSource

Arguments

:: String

The string which begins a line comment

-> String

A potentially shorter string that begins a comment

-> BufferM () 

Uncomments the selection using the given line comment starting string. This only works for the comments which begin at the start of the line.

toggleCommentSelectionB :: String -> String -> BufferM ()Source

Toggle line comments in the selection by adding or removing a prefix to each line.

justifySelectionWithTopB :: BufferM ()Source

Justifies all the lines of the selection to be the same as the top line. NOTE: if the selection begins part way along a line, the other lines will be justified only with respect to the part of the indentation which is selected.

replaceBufferContent :: String -> BufferM ()Source

Replace the contents of the buffer with some string

fillRegion :: Region -> BufferM ()Source

Fill the text in the region so it fits nicely 80 columns.

sortLines :: BufferM ()Source

Sort the lines of the region.

revertB :: Rope -> UTCTime -> BufferM ()Source

Helper function: revert the buffer contents to its on-disk version