Octave syntax and indentation support for Vim
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
James Wright d4b3820a3e
Set commentstring in ftplugin
8 months ago
ftdetect Automate Octave source file recognition 1 year ago
ftplugin Set commentstring in ftplugin 8 months ago
indent Fix whitespace and add link to vim-polyglot 2 years ago
syntax Fix typos and my ignorance 2 years ago
LICENSE Initial commit 2 years ago
README.md Automate Octave source file recognition 1 year ago

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/McSinyx/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/McSinyx/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.