yi-0.8.1: The Haskell-Scriptable Editor

Copyright(c) 2005,2007,2008 Jean-Philippe Bernardy
LicenseGPL
Safe HaskellNone
LanguageHaskell2010

Yi.Keymap.Emacs.Utils

Description

This module is aimed at being a helper for the Emacs keybindings. In particular this should be useful for anyone that has a custom keymap derived from or based on the Emacs one.

Synopsis

Documentation

argToInt :: UnivArgument -> Int Source

Convert the universal argument to a number of repetitions

askQuitEditor :: YiM () Source

Quits the editor if there are no unmodified buffers if there are unmodified buffers then we ask individually for each modified buffer whether or not the user wishes to save it or not. If we get to the end of this list and there are still some modified buffers then we ask again if the user wishes to quit, but this is then a simple yes or no.

askSaveEditor :: YiM () Source

Quits the editor if there are no unmodified buffers if there are unmodified buffers then we ask individually for each modified buffer whether or not the user wishes to save it or not. If we get to the end of this list and there are still some modified buffers then we ask again if the user wishes to quit, but this is then a simple yes or no.

modifiedQuitEditor :: YiM () Source

Quits the editor if there are no unmodified buffers if there are then simply confirms with the user that they with to quit.

withMinibuffer :: String -> (String -> YiM [String]) -> (String -> YiM ()) -> YiM () Source

withMinibuffer prompt completer act: open a minibuffer with prompt. Once a string s is obtained, run act s. completer can be used to complete functions: it returns a list of possible matches.

cabalConfigureE :: CommandArguments -> YiM () Source

cabal-configure

insertNextC :: UnivArgument -> KeymapM () Source

Insert next character, "raw"

findFile :: YiM () Source

Open a file using the minibuffer. We have to set up some stuff to allow hints and auto-completion.

findFileNewTab :: YiM () Source

Open a file in a new tab using the minibuffer.

promptFile :: String -> (String -> YiM ()) -> YiM () Source

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

promptTag :: YiM () Source

Prompt the user to give a tag and then jump to that tag

justOneSep :: BufferM () Source

If on separators (space, tab, unicode seps), reduce multiple separators to just a single separator. If we aren't looking at a separator, insert a single space. This kind of behaves as emacs ‘just-one-space’ function with the argument of ‘1’ but it prefers to use the separator we're looking at instead of assuming a space.

joinLinesE :: UnivArgument -> BufferM () Source

Join this line to previous (or next N if universal)