update readme

This commit is contained in:
Productive2 2021-02-19 00:03:01 +01:00
parent ed00e87415
commit 8d1cb21b03
1 changed files with 9 additions and 4 deletions

View File

@ -30,6 +30,8 @@ the output.
- multiline support - multiline support
- easily add new keybindings (using templates) - easily add new keybindings (using templates)
- very customizable (even inserting characters is a keybinding that's optional) - very customizable (even inserting characters is a keybinding that's optional)
- plugin system based
- history
# Example usage # Example usage
@ -39,7 +41,7 @@ the output.
import editor import editor
# import the default keybindings for basic stuff # import the default keybindings for basic stuff
# like arrow key movement or inserting characters # like arrow key movement or inserting characters
import defaults import plugin/defaults
# import helper templates for adding custom key or # import helper templates for adding custom key or
# event bindings # event bindings
import templates import templates
@ -52,6 +54,9 @@ e.prompt = "> "
e.populateDefaults() e.populateDefaults()
var printOutput = true var printOutput = true
# very weird use case, but if ctrl+b is pressed during reading, don't
# print the output
e.bindKey("ctrl+b"): e.bindKey("ctrl+b"):
printOutput = false printOutput = false
@ -61,7 +66,7 @@ if printOutput:
echo input echo input
``` ```
Also see main.nim if the above example does not suffice, Also see examples folder if the above example does not suffice,
and look at defaults.nim for many binding examples. and look at defaults.nim for many binding examples.
Look at multiline.nim's procs and editor.nim's Look at multiline.nim's procs and editor.nim's
LineEditor type for an "API". It's wip, docs will LineEditor type for an "API". It's wip, docs will
@ -72,7 +77,7 @@ improve if it ever gets more stable.
Note: they won't be missing forever hopefully. Note: they won't be missing forever hopefully.
- No utf-8 - No utf-8
- No tab support - No tab autocompletion support
- No syntax highlighting support - No syntax highlighting support
- Does not support windows - Windows keybindings not finished, windows was not tested yet