Skip to content

Commit

Permalink
[Magma] Add initial support for Magma (#95)
Browse files Browse the repository at this point in the history
Magma Computer Algebra system is a proprioritary computer algebra system designed to solve problems in algebra, number theory, geometry and combinatorics. Which is quite famous for the area. Webpage: https://magma.maths.usyd.edu.au/

There is a vim-magma plugin with support of *.mag files:
https://github.com/petRUShka/vim-magma.

Code of `ftplugin/magma_cmdline.vim` is based on `ftplugin/sage_cmdline.vim`.
  • Loading branch information
petRUShka authored Jan 24, 2021
1 parent c755f35 commit e213637
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ftplugin/magma_cmdline.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
" Ensure that plugin/vimcmdline.vim was sourced
if !exists('g:cmdline_job')
runtime plugin/vimcmdline.vim
endif

function! MagmaSourceLines(lines)
"call VimCmdLineSendCmd('%cpaste -q')
"sleep 100m " Wait for IPython to read stdin
call VimCmdLineSendCmd(join(a:lines, b:cmdline_nl))
endfunction

let b:cmdline_nl = "\n"
let b:cmdline_app = 'magma'
let b:cmdline_quit_cmd = 'quit;'
let b:cmdline_source_fun = function('MagmaSourceLines')
let b:cmdline_send_empty = 1
let b:cmdline_filetype = 'magma'

exe 'nmap <buffer><silent> ' . g:cmdline_map_start . ' :call VimCmdLineStartApp()<CR>'

call VimCmdLineSetApp('magma')

0 comments on commit e213637

Please sign in to comment.