From 973278140e738f601117922b25171d5e3d10dd7d Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sat, 18 May 2013 16:49:09 -0400 Subject: [PATCH] [Fix #103] Add documentation for editor --- modules/editor/README.md | 63 ++++++++++++++++++++++++++++++++++++++++ modules/editor/init.zsh | 36 ----------------------- 2 files changed, 63 insertions(+), 36 deletions(-) create mode 100644 modules/editor/README.md diff --git a/modules/editor/README.md b/modules/editor/README.md new file mode 100644 index 0000000..03bc02f --- /dev/null +++ b/modules/editor/README.md @@ -0,0 +1,63 @@ +Editor +====== + +Sets key bindings. + +Settings +-------- + +### Key bindings + +To enable key bindings, add the following to *zpreztorc*, and replace 'map' with +'emacs' or 'vi'. + + zstyle ':prezto:module:editor' keymap 'map' + +### Dot Expansion + +To enable the auto conversion of .... to ../.., add the following to +*zpreztorc*. + + zstyle ':prezto:module:editor' dot-expansion 'yes' + +Theming +------- + +To indicate when the editor is in the primary keymap (emacs or viins), add +the following to your `theme_prompt_setup` function. + + zstyle ':prezto:module:editor:info:keymap:primary' format '>>>' + +To indicate when the editor is in the primary keymap (emacs or viins) insert +mode, add the following to your `theme_prompt_setup` function. + + zstyle ':prezto:module:editor:info:keymap:primary:insert' format 'I' + +To indicate when the editor is in the primary keymap (emacs or viins) overwrite +mode, add the following to your `theme_prompt_setup` function. + + zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format 'O' + +To indicate when the editor is in the alternate keymap (vicmd), add the +following to your `theme_prompt_setup` function. + + zstyle ':prezto:module:editor:info:keymap:alternate' format '<<<' + +To indicate when the editor is completing, add the following to your +`theme_prompt_setup` function. + + zstyle ':prezto:module:editor:info:completing' format '...' + +Then add `$editor_info[context]`, where context is *keymap*, *insert*, or +*overwrite*, to `$PROMPT` or `$RPROMPT` and call `editor-info` in the +`prompt_name_preexec` hook function. + +Authors +------- + +*The authors of this module should be contacted via the [issue tracker][1].* + + - [Sorin Ionescu](https://github.com/sorin-ionescu) + +[1]: https://github.com/sorin-ionescu/oh-my-zsh/issues + diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index b905fac..4838ba7 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -4,42 +4,6 @@ # Authors: # Sorin Ionescu # -# Usage: -# To enable key bindings, add the following to zpreztorc, and replace 'map' -# with 'emacs' or 'vi. -# -# zstyle ':prezto:module:editor' keymap 'map' -# -# To enable the auto conversion of .... to ../.., add the following to -# zpreztorc. -# -# zstyle ':prezto:module:editor' dot-expansion 'yes' -# -# To indicate when the editor is in the primary keymap (emacs or viins), add -# the following to your theme prompt setup function. -# -# zstyle ':prezto:module:editor:info:keymap:primary' format '>>>' -# -# To indicate when the editor is in the primary keymap (emacs or viins) insert -# mode, add the following to your theme prompt setup function. -# -# zstyle ':prezto:module:editor:info:keymap:primary:insert' format 'I' -# -# To indicate when the editor is in the primary keymap (emacs or viins) -# overwrite mode, add the following to your theme prompt setup function. -# -# zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format 'O' -# -# To indicate when the editor is in the alternate keymap (vicmd), add the -# following to your theme prompt setup function. -# -# zstyle ':prezto:module:editor:info:keymap:alternate' format '<<<' -# -# To indicate when the editor is completing, add the following to your theme -# prompt setup function. -# -# zstyle ':prezto:module:editor:info:completing' format '...' -# # Return if requirements are not found. if [[ "$TERM" == 'dumb' ]]; then