/ README.md
README.md
 1  # nim-prompt
 2  
 3  ![Software License](https://img.shields.io/badge/license-BSD-brightgreen.svg?style=flat-square)
 4  
 5  A library for building powerful interactive prompts inspired by [python-prompt-toolkit](https://github.com/jonathanslenders/python-prompt-toolkit), making it easier to build cross-platform command line tools using Nim.
 6  
 7  #### Projects using nim-prompt
 8  
 9  * [nim-chronicles](https://github.com/status-im/nim-chronicles/). The log filtering tool chronicles_tail was the original project that lead to the creation of this library.
10  
11  ## Features
12  
13  ### Powerful auto-completion
14  
15  ### Keyboard Shortcuts
16  
17  The provided shortcuts should be familiar to most Windows, macOS and Linux users.
18  
19  Key Binding                                           | Description
20  ------------------------------------------------------|------------------------------------------------
21  <kbd>Home</kbd>, <kbd>Ctrl + A</kbd>                  | Go to the beginning of the line
22  <kbd>End</kbd>,  <kbd>Ctrl + E</kbd>                  | Go to the end of the line
23  <kbd>Up Arrow</kbd>, <kbd>Ctrl + P</kbd>              | Previous command, Previous completion
24  <kbd>Down Arrow</kbd>, <kbd>Ctrl + N</kbd>            | Next command, Next completion
25  <kbd>Right Arrow</kbd>, <kbd>Ctrl + F</kbd>           | Forward one character
26  <kbd>Left Arrow</kbd>, <kbd>Ctrl + B</kbd>            | Backward one character
27  <kbd>Ctrl + Right Arrow</kbd>, <kbd> Alt + F</kbd>    | Move to next word
28  <kbd>Ctrl + Left Arrow</kbd>, <kbd> Alt + B</kbd>     | Move to previous word
29  <kbd>Delete</kbd>, <kbd>Ctrl + D</kbd>                | Delete character under the cursor
30  <kbd>Backspace</kbd>, <kbd>Ctrl + H</kbd>             | Delete character before the cursor
31  <kbd>Ctrl + Delete</kbd>                              | Delete to end of word
32  <kbd>Ctrl + Backspace</kbd>                           | Delete to beginning of word
33  <kbd>Tab</kbd>                                        | Trigger auto-complete, Select next completion
34  <kbd>Ctrl + L</kbd>                                   | Clear the screen
35  <kbd>Enter</kbd>, <kbd>Ctrl + J</kbd>                 | Accept line
36  
37  ### History
38  
39  You can use <kbd>Up arrow</kbd> and <kbd>Down arrow</kbd> to walk through the history of commands executed.
40  An optional history file can be specified for each user program.
41  
42  ### Unicode aware
43  
44  nim-prompt will correctly handle and display all unicode characters. In the public API, all procs use UTF-8 encoded strings on all platforms.
45  
46  ### Multiple platform support
47  
48  We have confirmed nim-prompt works fine in the following terminals:
49  
50  * iTerm2, Terminal.app (macOS)
51  * Command Prompt (Windows)
52  * gnome-terminal (Ubuntu)
53  
54  ## License
55  
56  This software is licensed under the BSD 2-Clause license, see [LICENSE](./LICENSE) for more information.