mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 11:10:04 +08:00
Compare commits
2 Commits
98b6cae025
...
aa03777a73
Author | SHA1 | Date | |
---|---|---|---|
|
aa03777a73 | ||
|
f0c9385784 |
@ -71,6 +71,7 @@ main () {
|
||||
_detact lua/spacevim/api/logger.lua
|
||||
_detact lua/spacevim/api/prompt.lua
|
||||
_detact lua/spacevim/api/notify.lua
|
||||
_detact lua/spacevim/api/job.lua
|
||||
_detact lua/spacevim/api/password.lua
|
||||
_detact lua/spacevim/api/vim.lua
|
||||
_detact lua/spacevim/api/system.lua
|
||||
|
@ -30,7 +30,9 @@ echom s:file.separator
|
||||
echom s:file.pathSeparator
|
||||
```
|
||||
|
||||
<!-- call SpaceVim#dev#api#update() -->
|
||||
<!--
|
||||
call SpaceVim#dev#api#update()
|
||||
-->
|
||||
|
||||
<!-- SpaceVim api list start -->
|
||||
|
||||
@ -53,6 +55,7 @@ Here is the list of all available APIs, and welcome to contribute to SpaceVim.
|
||||
| [messletters](messletters/) | messletters API provides some basic functions for generating messletters |
|
||||
| [notify](notify/) | notify API provides some basic functions for generating notifications |
|
||||
| [password](password/) | password API provides some basic functions for generating password |
|
||||
| [prompt](prompt/) | create cmdline prompt and handle input |
|
||||
| [system](system/) | system API provides some basic functions and values for current os. |
|
||||
| [transient-state](transient-state/) | transient state API provides some basic functions and values for current os. |
|
||||
| [unicode#box](unicode/box/) | unicode#box API provides some basic functions for drawing box. |
|
||||
|
53
docs/api/prompt.md
Normal file
53
docs/api/prompt.md
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
title: "prompt API"
|
||||
description: "create cmdline prompt and handle input"
|
||||
---
|
||||
|
||||
# [Available APIs](../) >> prompt
|
||||
|
||||
<!-- vim-markdown-toc GFM -->
|
||||
|
||||
- [Intro](#intro)
|
||||
- [Functions](#functions)
|
||||
- [Key bindings](#key-bindings)
|
||||
|
||||
<!-- vim-markdown-toc -->
|
||||
|
||||
## Intro
|
||||
|
||||
This api provides some basic Functions for generating cmdline prompt and handle input.
|
||||
|
||||
Example:
|
||||
|
||||
```lua
|
||||
local pmt = require('spacevim.api.prompt')
|
||||
local nt = require('spacevim.api.notify')
|
||||
|
||||
pmt._handle_fly = function(str)
|
||||
nt.notify(str)
|
||||
end
|
||||
|
||||
pmt.open()
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
| function name | description |
|
||||
| --------------------- | ---------------------------------------------- |
|
||||
| `_handle_fly(string)` | function to handle input, default is `''` |
|
||||
| `_onclose()` | exit function, default is `''` |
|
||||
| `_oninputpro()` | function before `_handle_fly`, default is `''` |
|
||||
| `_function_key` | a dict of keys and handle functions |
|
||||
|
||||
## Key bindings
|
||||
|
||||
| Key Bindings | Descriptions |
|
||||
| ------------- | --------------------------------------------- |
|
||||
| Ctrl-r | read from register, need insert register name |
|
||||
| Left / Right | move cursor to left or right |
|
||||
| BackSpace | remove last character |
|
||||
| Ctrl-w | remove the Word before the cursor |
|
||||
| Ctrl-u | remove the Line before the cursor |
|
||||
| Ctrl-k | remove the Line after the cursor |
|
||||
| Ctrl-a / Home | Go to the beginning of the line |
|
||||
| Ctrl-e / End | Go to the end of the line |
|
Loading…
Reference in New Issue
Block a user