Awesome
vim-erlang-omnicomplete
vim-erlang-omnicomplete
is an Erlang autocompletion plugin for Vim.
Table of Contents
Installation
<details> <summary>Vim's built-in package manager</summary>This is the recommended installation method if you use at least Vim 8 and you don't use another package manager.
Information about Vim's built-in package manager: :help packages
.
Installation steps:
-
Clone this repository (you can replace
foo
with the directory name of your choice):$ git clone https://github.com/vim-erlang/vim-erlang-omnicomplete.git \ ~/.vim/pack/foo/start/vim-erlang-omnicomplete
-
Restart Vim.
-
Generate help page (replace
foo
with the same directory name as above)::helptags ~/.vim/pack/foo/start/vim-erlang-omnicomplete/doc
Information about Pathogen: Pathogen repository.
Installation steps:
-
Clone this repository:
$ git clone https://github.com/vim-erlang/vim-erlang-omnicomplete.git \ ~/.vim/bundle/vim-erlang-omnicomplete
-
Restart Vim.
-
Generate help page:
:Helptags
Information about Vundle: Vundle repository.
Installation steps:
-
Add
vim-erlang-omnicomplete
to your plugin list in.vimrc
by inserting the line that starts withPlugin
:call vundle#begin() [...] Plugin 'vim-erlang/vim-erlang-omnicomplete' [...] call vundle#end()
-
Restart Vim.
-
Run
:PluginInstall
.
Information about Vim-Plug: vim-plug repository.
Installation steps:
-
Add
vim-erlang-omnicomplete
to your plugin list in.vimrc
by inserting the line that starts withPlug
:call plug#begin() [...] Plug 'vim-erlang/vim-erlang-omnicomplete' [...] call plug#end()
-
Restart Vim.
-
Run
:PlugInstall
.
Quick start
-
Open an Erlang source file.
-
Start typing something (e.g.
li
orio:fo
). -
Without leaving insert mode, hit CTRL-X and then CTRL-O.
-
After at most a few seconds, you should see a list of completions.
Documentation
-
Vim's omni completion (i.e., autocomplete) functionality:
:help compl-omni
. -
Vim's
completeopt
option to configure omni completion:help completeopt
. -
vim-erlang-omnicomplete
plugin::help vim-erlang-omnicomplete
.
Development
File layout
This repository contains the following files and directories:
<!-- If you edit the list, please keep the alphabetical order. -->-
autoload/erlang_complete.erl
: Erlang script which can analyse the code base and calculate the list of modules and the list of functions in a module. -
autoload/erlang_complete.vim
: This script contains most ofvim-erlang-omnicomplete
's functionality on the Vim side.This functionality is here (instead of
plugin/erlang_omnicomplete.vim
) so that Vim's autoload functionality (:help autoload
) can make sure that this script is executed only when needed the first time. -
doc/vim-erlang-omnicomplete.txt
: This file contains the user documentation ofvim-erlang-omnicomplete
. -
ftplugin/erlang.vim
: This script sets upvim-erlang-omnicomplete
when an Erlang source file is opened. -
plugin/erlang_omnicomplete.vim
: This script sets upvim-erlang-omnicomplete
when Vim is started. It is kept small so that the effect on Vim's startup time is minimal.
Contributing
-
Please read the Contributing section of the
vim-erlang
README. -
If you modify
autoload/erlang_complete.erl
, please:-
update the tests in the
vim-erlang
repository -
also modify
vim-erlang-compiler
(if you modify the "load build information" code block)
-