yi-core-0.19.2: Yi editor core library
LicenseGPL-2
Maintaineryi-devel@googlegroups.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • OverloadedStrings
  • TupleSections
  • TypeOperators
  • ExplicitNamespaces
  • LambdaCase

Yi.Misc

Description

Various high-level functions to further classify.

Synopsis

Documentation

getAppropriateFiles :: Maybe Text -> Text -> YiM (Text, [Text]) Source #

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.

getFolder :: Maybe String -> IO String Source #

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.

matchingFileNames :: Maybe Text -> Text -> YiM [Text] Source #

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

placeMark :: BufferM () Source #

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

selectAll :: BufferM () Source #

Select the contents of the whole buffer

adjIndent :: IndentBehaviour -> BufferM () Source #

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.

promptFileChangingHints Source #

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.

debugBufferContent :: YiM () Source #

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.