This plugin makes Vim highlight syntax in EO progams.
The simplest way to install is by adding it to the standard Vim runtime path:
git clone https://github.com/objectionary/eo-vim.git ~/.vim/pack/plugins/start/eo-vim
However, you can also use some popular package managers:
- Vim 8 packages
git clone https://github.com/objectionary/eo-vim.git ~/.vim/pack/plugins/start/eo-vim
- Neovim packages
git clone https://github.com/objectionary/eo-vim.git ~/.local/share/nvim/site/pack/plugins/start/eo-vim
- Pathogen
git clone https://github.com/objectionary/eo-vim.git ~/.vim/bundle/eo-vim
- Vundle
git clone https://github.com/objectionary/eo-vim.git ~/.vim/bundle/eo-vim
- add
Plugin 'eo-vim'
to your~/.vimrc
and runPluginInstall
.
If you use tabs in Vim, it is necessary to set the 'expandtab' option: :set expandtab
due to compiler specifics. Also, the following line will be useful if you don't want to set this every time you start the Vim:
autocmd BufEnter *.eo set ai ts=2 st=2 expandtab
You can add it to your $HOME/.vimrc
configuration file. This will work only with .eo
files.
Arguments ts
and st
set number of space characters that will be inserted when the tab key is pressed. You can change it as you wish.
More information by:
- :help 'tabstop'
- :help 'shiftwidth'
- :help 'expandtab'
- :help 'softtabstop'
If you want to change colors in vim as you wish, you can see the list of highlight groups here.
You can change colors in syntax highlighting on your own by using highlight
command in vim, for example:
:highlight Comment term=bold ctermfg=Cyan guifg=#80a0ff gui=bold
Here is the list of highlight groups and examples in code:
Group | Example
-------------- | ---------------
Keyword | @, &, $, ^
Comment | #Here is comment
Number | Ints and floats
String | "Hello, world"
Boolean | TRUE, FALSE and bytes literals
Todo | TODO FIXME NOTE
DotName | .plus .write .smth etc.
ObjectName | All objects except abstract and dot-notation
AbstractName | Abstact objects
Define | alias package rt etc.
Statement | +rt jvm org.eolang...
More information by :highlight
and :help 'highlight'
For testing eo-vim plugin we use a testing framework for Vim script, so you can add some tests for your new features with this soft. It will be run by CI.
All PRs are welcome. If you are planning to contribute a large patch or to integrate a new tool or some features, please create an issue first to get any upfront questions or design decisions out of the way first. Then, you may fork repository, make changes and send us a pull request.