File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,16 @@ g:pydocstring_enable_comment *g:pydocstring_enable_comment*
161161
162162 Default value is '1'
163163
164+ g:pydocstring_enable_mapping *g:pydocstring_enable_mapping*
165+ Disable this option to prevent pydocstring from creating any
166+ key mapping to the `:Pydocstring` command.
167+ Note: this value is overridden if you explicitly create a
168+ mapping in your vimrc, such as if you do:
169+
170+ nmap <silent> <C-m> <Plug> (pydocstring)
171+
172+ Default value is '1'
173+
164174==============================================================================
165175EXAMPLE *pydocstring-vim-example*
166176
@@ -196,6 +206,10 @@ Override default mapping.
196206
197207 nmap <silent> <C-m> <Plug> (pydocstring)
198208
209+ To disable mappings entirely, add the following to your .vimrc or _vimrc.
210+
211+ let g:pydocstring_enable_mapping = 0
212+
199213
200214==============================================================================
201215vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0:
Original file line number Diff line number Diff line change @@ -10,9 +10,15 @@ set cpo&vim
1010
1111command ! -nargs =0 - buffer -complete =customlist ,pydocstring#insert Pydocstring call pydocstring#insert ()
1212
13- nnoremap <silent> <buffer> <Plug> (pydocstring) :call pydocstring#insert()<CR>
14- if ! hasmapto (' <Plug>(pydocstring)' )
15- nmap <silent> <C-l> <Plug> (pydocstring)
13+ if ! exists (' g:pydocstring_enable_mapping' )
14+ let g: pydocstring_enable_mapping = 1
15+ endif
16+
17+ if g: pydocstring_enable_mapping == 1 || hasmapto (' <Plug>(pydocstring)' )
18+ nnoremap <silent> <buffer> <Plug> (pydocstring) :call pydocstring#insert()<CR>
19+ if ! hasmapto (' <Plug>(pydocstring)' )
20+ nmap <silent> <C-l> <Plug> (pydocstring)
21+ endif
1622endif
1723
1824let &cpo = s: save_cpo
You can’t perform that action at this time.
0 commit comments