Vim Configuration
- Install maven
sudo apt-get install maven
- Clone the project: algs4
- Compile
algs4
:
cd algs4
mvn compile
To install plugins:
Plug 'roxma/nvim-completion-manager'
Plug 'artur-shaik/vim-javacomplete2', {'for': 'java'}
Append following code to vimrc
:
autocmd FileType java setlocal omnifunc=javacomplete#Complete
set runtimepath^=~/.config/nvim/plugged/vim-javacomplete2/libs
let g:JavaComplete_LibsPath = "/path/to/algs4/target/classes"
let g:JavaComplete_MavenRepositoryDisable = 0
au User CmSetup call cm#register_source({'name' : 'cm-java',
\ 'priority': 9,
\ 'scoping': 0,
\ 'scopes': ['java'],
\ 'abbreviation': 'java',
\ 'cm_refresh_patterns': ['\w+\.'],
\ 'cm_refresh': {'omnifunc': 'javacomplete#Complete'},
\ })
Workaround if the plugin does not work:
- Remove all caches in
~/.cache/javacomplete2/