Get autocomplete working, fix telescope settings, add java language server
This commit is contained in:
parent
be6f2e6bdf
commit
4556e70dcd
5
ftplugin/java.lua
Normal file
5
ftplugin/java.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local config = {
|
||||
cmd = { "/home/aselimov/.local/share/nvim/mason/bin/jdtls" },
|
||||
root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]),
|
||||
}
|
||||
require("jdtls").start_or_attach(config)
|
@ -1,2 +0,0 @@
|
||||
set colorcolumn=120
|
||||
set tw=120
|
31
init.lua
31
init.lua
@ -255,9 +255,9 @@ require("lazy").setup({
|
||||
-- You can put your default mappings / updates / etc. in here
|
||||
-- All the info you're looking for is in `:help telescope.setup()`
|
||||
--
|
||||
defaults = {
|
||||
defaults = vim.tbl_extend("force", require("telescope.themes").get_ivy(), {
|
||||
path_display = { "smart" },
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
pcall(require("telescope").load_extension("live_grep_args"))
|
||||
@ -377,6 +377,7 @@ require("lazy").setup({
|
||||
local servers = {
|
||||
clangd = {},
|
||||
-- gopls = {},
|
||||
jdtls = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
@ -467,13 +468,34 @@ require("lazy").setup({
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
-- Snippet Engine & its associated nvim-cmp source
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
build = (function()
|
||||
-- Build Step is needed for regex support in snippets
|
||||
-- This step is not supported in many windows environments
|
||||
-- Remove the below condition to re-enable on windows
|
||||
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
return
|
||||
end
|
||||
return "make install_jsregexp"
|
||||
end)(),
|
||||
},
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
},
|
||||
config = function()
|
||||
-- See `:help cmp`
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
luasnip.config.setup({})
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = { completeopt = "menu,menuone,noinsert" },
|
||||
|
||||
-- For an understanding of why these mappings were
|
||||
@ -496,6 +518,11 @@ require("lazy").setup({
|
||||
-- completions whenever it has completion options available.
|
||||
["<C-Space>"] = cmp.mapping.complete({}),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user