mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-13 13:19:12 +08:00
Add key binding to generate docstring
* Add key binding to generate docstring to lang/python layer * Update documentation
This commit is contained in:
parent
eedd31343d
commit
4e7474f1a5
@ -80,6 +80,16 @@ function! s:language_specified_mappings() abort
|
||||
call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'],
|
||||
\ 'call SpaceVim#plugins#repl#send("selection")',
|
||||
\ 'send selection and keep code buffer focused', 1)
|
||||
|
||||
" +Generate {{{
|
||||
|
||||
let g:_spacevim_mappings_space.l.g = {'name' : '+Generate'}
|
||||
|
||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'g', 'd'],
|
||||
\ 'Pydocstring', 'generate docstring', 1)
|
||||
|
||||
" }}}
|
||||
|
||||
if SpaceVim#layers#lsp#check_filetype('python')
|
||||
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
||||
|
||||
|
@ -15,6 +15,7 @@ description: "This layer is for Python development, provide autocompletion, synt
|
||||
- [Buffer formatting](#buffer-formatting)
|
||||
- [Format imports](#format-imports)
|
||||
- [Key bindings](#key-bindings)
|
||||
- [Code generation](#code-generation)
|
||||
- [Inferior REPL process](#inferior-repl-process)
|
||||
- [Running current script](#running-current-script)
|
||||
- [Testing](#testing)
|
||||
@ -69,6 +70,12 @@ pip install --user isort
|
||||
|
||||
## Key bindings
|
||||
|
||||
### Code generation
|
||||
|
||||
| Mode | Key Binding | Description |
|
||||
| ------ | ----------- | ------------------------------------- |
|
||||
| normal | `SPC l g d` | Generate docstring |
|
||||
|
||||
### Inferior REPL process
|
||||
|
||||
Start a Python or iPython inferior REPL process with `SPC l s i`. If `ipython` is available in system executable search paths, `ipython` will be used to launch python shell; otherwise, default `python` interpreter will be used. You may change your system executable search path by activating a virtual environment.
|
||||
|
Loading…
x
Reference in New Issue
Block a user