yi- The Haskell-Scriptable Editor

Safe HaskellSafe-Infered




File-based actions

editFile :: FilePath -> YiM BufferRefSource

If file exists, read contents of file into a new buffer, otherwise creating a new empty buffer. Replace the current window with a new window onto the new buffer.

If the file is already open, just switch to the corresponding buffer.

Need to clean up semantics for when buffers exist, and how to attach windows to buffers.

viWrite :: YiM ()Source

Try to write a file in the manner of vi/vim Need to catch any exception to avoid losing bindings

viWriteTo :: String -> YiM ()Source

Try to write to a named file in the manner of vi/vim

viSafeWriteTo :: String -> YiM ()Source

Try to write to a named file if it doesn't exist. Error out if it does.

fwriteE :: YiM ()Source

Write current buffer to disk, if this buffer is associated with a file

fwriteBufferE :: BufferRef -> YiM ()Source

Write a given buffer to disk if it is associated with a file.

fwriteAllE :: YiM ()Source

Write all open buffers

fwriteToE :: String -> YiM ()Source

Write current buffer to disk as f. The file is also set to f

backupE :: FilePath -> YiM ()Source

Make a backup copy of file

revertE :: YiM ()Source

Revert to the contents of the file on disk

Helper functions

setFileName :: BufferRef -> FilePath -> YiM ()Source

Associate buffer with file; canonicalize the given path name.