Skip to content

Commit

Permalink
use SAGE's help() function to look up doc.
Browse files Browse the repository at this point in the history
Ideally, would use SAGE's ?, but I do not know how to call it from
the command line instead of SAGE's REPL
  • Loading branch information
Konfekt committed Apr 24, 2020
1 parent 09d565f commit 63ff3d6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ftplugin/sage.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,20 @@ compiler sage

let b:undo_ftplugin = 'setlocal tabstop< shiftwidth< expandtab<'
let b:undo_ftplugin .= '| setlocal makeprg< errorformat<'

if executable('sage')
if !has('gui_running')
command! -buffer -nargs=1 SageHelp
\ silent exe '!' . 'sage -c ''help(<args>)''' |
\ redraw!
elseif has('terminal')
command! -buffer -nargs=1 SageHelp
\ silent exe 'term ' . 'sage -c ''help(<args>)'''
else
command! -buffer -nargs=1 SageHelp echo system('sage -c ''<args>'' 2>/dev/null')
endif
setlocal keywordprg=:SageHelp
let b:undo_ftplugin .= '| setlocal keywordprg<'
endif

let b:did_ftplugin = 1

0 comments on commit 63ff3d6

Please sign in to comment.