Rewrite init.vim
from ArmandXiao/vim to init.lua
git clone https://github.com/ArmandXiao/nvim-lua.git ~/.config/nvim
for *nix users
- place it under
~/.config~
init.lua
is going torequire()
lua files fromlua
folders.plugin
folder is auto-generated by packer plugin manager
- use jdtls-launcher Recommanded
- use nvim-jdtls plugin for native LSP
For easy use of java lsp
Follow instructions at jdtls-launcher Recommanded
Automatic installation
curl https://raw.githubusercontent.com/eruizc-dev/jdtls-launcher/master/install.sh | bash
# .bashrc, .zshrc or whatever shell you use
export PATH=$PATH:$HOME/.local/bin
then setup at lsp-setup.lua
require'lspconfig'.jdtls.setup{
cmd = { 'jdtls' },
root_dir = function(fname)
return require'lspconfig'.util.root_pattern('pom.xml', 'gradle.build', '.git')(fname) or vim.fn.getcwd()
end
}
- first add it to plugin.lua
- go jdtls bin download one
- then
tar zxvf jdtls-bin
to place you want - Follow instructions on nvim-jdtls
- create a
jdtls-launch
bash, then add it to$PATH
a simple way is to
sudo chmod +x jdtls-launch sudo cp jdtls-launch /usr/bin jdtls-launch
- create a
- Java lsp dont work Solution:
require('lspconfig').jdtls.setup{
settings = {
java = {signatureHelp = {enabled = true}, contentProvider = {preferred = 'fernflower'}}
},
on_init = function(client)
if client.config.settings then
client.notify('workspace/didChangeConfiguration', {settings = client.config.settings})
end
end,
...
}
Q: Why do we want to rewrite
init.vim
? A: Why not?