haskeline-0.4: A command-line interface for user input, written in Haskell.Source codeContentsIndex
System.Console.Haskeline.Prefs
Description

Prefs allow the user to customize the line-editing interface. They are read by default from ~/.haskeline; to override that behavior, use readPrefs and runInputTWithPrefs.

Each line of a .haskeline file defines one field of the Prefs datatype; field names are case-insensitive and unparseable lines are ignored. For example:

 editMode: Vi
 completionType: MenuCompletion
 maxhistorysize: Just 40
Synopsis
data Prefs = Prefs {
bellStyle :: !BellStyle
editMode :: !EditMode
maxHistorySize :: !(Maybe Int)
completionType :: !CompletionType
completionPaging :: !Bool
completionPromptLimit :: !(Maybe Int)
listCompletionsImmediately :: !Bool
}
defaultPrefs :: Prefs
readPrefs :: FilePath -> IO Prefs
data CompletionType
= ListCompletion
| MenuCompletion
data BellStyle
= NoBell
| VisualBell
| AudibleBell
data EditMode
= Vi
| Emacs
Documentation
data Prefs Source
Constructors
Prefs
bellStyle :: !BellStyle
editMode :: !EditMode
maxHistorySize :: !(Maybe Int)
completionType :: !CompletionType
completionPaging :: !BoolWhen listing completion alternatives, only display one screen of possibilities at a time.
completionPromptLimit :: !(Maybe Int)If more than this number of completion possibilities are found, then ask before listing them.
listCompletionsImmediately :: !BoolIf False, completions with multiple possibilities will ring the bell and only display them if the user presses TAB again.
show/hide Instances
Read Prefs
Show Prefs
Monad m => MonadReader Prefs (InputT m)
defaultPrefs :: PrefsSource

The default preferences which may be overwritten in the .haskeline file:

 defaultPrefs = Prefs {bellStyle = AudibleBell,
                      maxHistorySize = Just 100,
                      editMode = Emacs,
                      completionType = ListCompletion,
                      completionPaging = True,
                      completionPromptLimit = Just 100,
                      listCompletionsImmediately = True
                    }
readPrefs :: FilePath -> IO PrefsSource
Read Prefs from a given file. If there is an error reading the file, the defaultPrefs will be returned.
data CompletionType Source
Constructors
ListCompletion
MenuCompletion
show/hide Instances
data BellStyle Source
Constructors
NoBell
VisualBell
AudibleBell
show/hide Instances
data EditMode Source
Constructors
Vi
Emacs
show/hide Instances
Produced by Haddock version 2.4.2