-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(neovim): add support for C/C++, Lua, Rust, and Java
Add completion support using Neovim's built-in LSP client. Add documentations for installing language servers. Add highlighting support based on Tree-sitter. Configure Tree-sitter parsers and language servers. https://github.com/mfussenegger/nvim-jdtls#configuration-quickstart LuaLS/lua-language-server#1788 (comment)
- Loading branch information
1 parent
5ccc088
commit 2ea0b92
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Neovim | ||
|
||
Neovim has a built-in LSP client. There are several language servers used in the | ||
configurations. | ||
|
||
Language | Language Server | Installation | ||
-------- | ------------------------------------ | ------------------------------ | ||
C/C++ | [clangd] | [Installation][install_clangd] | ||
Lua | [lua-language-server][luals] | [Installation][install_luals] | ||
Rust | [rust-analyzer][rls2] | [Installation][install_rls2] | ||
Java | [Eclipse JDT Language Server][jdtls] | [Installation][install_jdtls] | ||
|
||
[clangd]: https://github.com/clangd/clangd | ||
[install_clangd]: https://clangd.llvm.org/installation#installing-clangd | ||
[luals]: https://github.com/LuaLS/lua-language-server | ||
[install_luals]: https://luals.github.io/#neovim-install | ||
[rls2]: https://github.com/rust-lang/rust-analyzer | ||
[install_rls2]: https://rust-analyzer.github.io/manual.html#installation | ||
[jdtls]: https://github.com/eclipse-jdtls/eclipse.jdt.ls | ||
[install_jdtls]: https://github.com/eclipse-jdtls/eclipse.jdt.ls#installation | ||
|
||
```console | ||
$ sudo pacman -S clangd rust-analyzer lua-language-server | ||
$ paru -S jdtls | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
local jdtls = require("jdtls") | ||
jdtls.start_or_attach({ | ||
cmd = { "jdtls" }, | ||
root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw", { upward = true }})[1]) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
local cmp = require("cmp") | ||
cmp.setup({ | ||
mapping = cmp.mapping.preset.insert({ | ||
["<CR>"] = cmp.mapping.confirm({ select = true }), | ||
}), | ||
sources = cmp.config.sources({ | ||
{ name = "nvim_lsp" }, | ||
}), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
local lspconfig = require("lspconfig") | ||
lspconfig.clangd.setup({}) | ||
lspconfig.lua_ls.setup({ | ||
settings = { | ||
Lua = { | ||
workspace = { | ||
library = vim.tbl_extend( | ||
"keep", | ||
{ "/usr/lib/lua-language-server/meta/template" }, | ||
vim.api.nvim_get_runtime_file("", true) | ||
), | ||
}, | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters