Skip to content

Vim plugin for SageMath (Sage) mathematics software system

Notifications You must be signed in to change notification settings

petRUShka/vim-sage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

Vim-sage is a vim plugin for support SageMath (former Sage) mathematics software system. The vim-sage supports syntax highlighting and indentation for SageMath files in Vim editor.

Installation

Use your preferred installation method for Vim plugins.

With vim-plug that would mean to add the following to your vimrc:

Plug 'petRUShka/vim-sage'

Vim plugins to extend SageMath support (together with vim-sage)

  • vimcmdline: send lines from Vim to interpreter (SageMath and vim-sage are supported);
  • vim-python-pep8-indent: a nicer Python indentation style for Vim;
  • python-syntax: extended Python syntax highlighting for Vim (much nicer than default highlight);
  • SimpylFold (together with FastFold): no-BS Python code folding for Vim (it just works with Python code);
  • vim-pythonsense: provides text objects and motions for Python classes, methods, functions, and doc strings;
  • jedi-vim: autocompletion, goto assignment/definition/stub, show documentation, renaming, usages and etc for Python. It works only with Python libraries and doesn't see Sage libraries or understand non-python Sage code. But it works well for built-in python instructions or libraries like numpy when editing sage code-file.

vim-sage sets sage.python filetype for sage-files, so above plugins for Python itself work smoothly with sage-files.

Tags and code browsing

Whereas it is not clear at the moment how to fully use tools like Language Server or Jedi with SageMath (see discussion and links here) it is possible to use good old tags with not as good but still usable code navigation (go to definition functionality).

  1. Install indexing tool Universal-ctags. Put following lines in ~/.ctags (for other other than Linux OS look at Option file help page to check the right place):
# to have ctags skip indexing import statements uncomment following line
# --python-kinds=-i
# SageMath
--langmap=Python:+.sage
  1. (Optionally) Install vim-plugin ludovicchabant/vim-gutentags for auto(re)generating tag files.

  2. Use vim built-in tag browsing and navigating functionality (:help tagsrch.txt for details).

About

Vim plugin for SageMath (Sage) mathematics software system

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published