Octave syntax and indentation support for Vim
Go to file
Wu Zhenyu 61268df03c
📝 Update URLs
2023-08-28 14:12:11 +08:00
ftdetect Support DESCRIPTION, Fix #4 2023-08-28 14:10:03 +08:00
ftplugin 🔀 Merge ftplugin/octave.vim 2023-08-28 14:03:46 +08:00
indent Fix whitespace and add link to vim-polyglot 2019-10-16 21:49:35 +07:00
syntax Fix typos and my ignorance 2019-10-11 14:28:49 +07:00
LICENSE Initial commit 2019-10-11 11:32:42 +07:00
README.md 📝 Update URLs 2023-08-28 14:12:11 +08:00

README.md

vim-octave

Octave syntax and indentation support for Vim:

  • Syntax highlighting is taken from Rik's script
  • Identation is ported accordingly using upstream Lua's as a base.

Features

From the syntax file description:

  • Highlights entire Octave grammar (endwhile, endfor, etc.), not just Matlab keywords
  • Updated to highlight all core Octave functions as of version 4.2.0
  • Highlights user functions and anonymous functions [@(...)] from within the .m file being edited
  • Use-dependent highlighting of Octave system variables
    • When querying system variables, keyword is highlighted as a constant. For example, var = true, highlights true as a constant.
    • When setting variables or otherwise invoking keyword as a function, keyword is highlighted as a function. For example, var = true (2,4), highlights true as a function.
  • Support for multi-line strings with line continuation characters as well as escaped quotes (\" or \') within string.
  • Support for multi-line block comments
  • Support for highlighting numbers that use hex (0x) or binary (0b) syntax
  • Error highlighting for bad number syntax, bad structure variable names, bad block comments, bad line continuations.
  • Optional support for highlighting operators (+, -, *, etc.), user variables, or tabs, which can be achieved by uncommenting appropriate tagged lines in the syntax file.

The indentation file provides basic automatic indentation of blocks.

Installations

  1. Install Pathogen, Vundle, NeoBundle, or Plug package manager for Vim.
  2. Use this repository as submodule or package.

For example, when using Plug:

Plug 'https://github.com/gnu-octave/vim-octave.git', {'for': 'octave'}

You can also use Vim 8 built-in package manager:

mkdir -p ~/.vim/pack/default/start
git clone https://github.com/gnu-octave/vim-octave.git ~/.vim/pack/default/start/vim-octave

Note that this plugin contributes to vim-polyglot language pack.

Usage

The plugin should work out of the box. You can enable omni completion by setting omnifunc=syntaxcomplete#Complete.