yi-core-0.19.2: Yi editor core library

Yi.Misc

Description

Various high-level functions to further classify.

Synopsis

# Documentation

Given a possible starting path (which if not given defaults to the current directory) and a fragment of a path we find all files within the given (or current) directory which can complete the given path fragment. We return a pair of both directory plus the filenames on their own that is without their directories. The reason for this is that if we return all of the filenames then we get a hint which is way too long to be particularly useful.

Given a path, trim the file name bit if it exists. If no path given, return current directory.

cd :: YiM () Source #

Like M-x cd, it changes the current working directory. Mighty useful when we don't start Yi from the project directory or want to switch projects, as many tools only use the current working directory.

pwd :: YiM () Source #

Shows current working directory. Also see cd.

Given a possible path and a prefix, return matching file names.

Place mark at current point. If there's an existing mark at point already, deactivate mark.

Select the contents of the whole buffer

A simple wrapper to adjust the current indentation using the mode specific indentation function but according to the given indent behaviour.

promptFile :: Text -> (Text -> YiM ()) -> YiM () Source #

Generic emacs style prompt file action. Takes a prompt and a continuation act and prompts the user with file hints.

Arguments

 :: Text Prompt -> (Text -> [Text] -> YiM [Text]) Hint transformer: current path, generated hints -> (Text -> YiM ()) Action over choice -> YiM ()

As promptFile but additionally allows the caller to transform the list of hints arbitrarily, such as only showing directories.

Prints out the rope of the current buffer as-is to stdout.

The only way to stop it is to close the buffer in question which should free up the BufferRef.