@@ -10,7 +10,7 @@ function! g:SphinxNotesSnippetEdit(id)
1010 let file = system (join ([s: snippet , ' get' , ' --file' , a: id , ' 2>/dev/null' ], ' ' ))
1111 let line = system (join ([s: snippet , ' get' , ' --line-start' , a: id , ' 2>/dev/null' ], ' ' ))
1212 if &modified
13- execute ' tabedit ' . file
13+ execute ' vsplit ' . file
1414 else
1515 execute ' edit ' . file
1616 endif
@@ -38,7 +38,22 @@ function! g:SphinxNotesSnippetListAndUrl()
3838 call g: SphinxNotesSnippetList (function (' s:CallUrl' ), ' ds' )
3939endfunction
4040
41+ function ! g: SphinxNotesSnippetInput (id, item)
42+ let docname = system (join ([s: snippet , ' get' , ' --' . a: item , a: id , ' 2>/dev/null' ], ' ' ))
43+ let docname = substitute (docname, ' \n\+$' , ' ' , ' ' ) " skip trailing \n
44+ execute ' normal! i:doc:`/' . docname . ' `'
45+ endfunction
46+
47+ function ! g: SphinxNotesSnippetListAndInputDocname ()
48+ function ! s: CallInputDocname (selection )
49+ call g: SphinxNotesSnippetInput (s: SplitID (a: selection ), ' docname' )
50+ endfunction
51+ call g: SphinxNotesSnippetList (function (' s:CallInputDocname' ), ' d' )
52+ endfunction
53+
4154nmap <C-k> e :call g:SphinxNotesSnippetListAndEdit()<CR>
4255nmap <C-k> u :call g:SphinxNotesSnippetListAndUrl()<CR>
56+ nmap <C-k> d :call g:SphinxNotesSnippetListAndInputDocname()<CR>
57+ imap <C-k> d <Esc> :call g:SphinxNotesSnippetListAndInputDocname()<CR> a
4358
4459" vim: set shiftwidth = 2 :
0 commit comments