From e95226daa6f6dcd76db8e66dafc5b0ad90f45957 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Tue, 3 Sep 2024 16:23:41 +0200 Subject: [PATCH] Add fold capa / remove ondarker plugin / add correct jdtls support --- nvim/lazy-lock.json | 3 ++- nvim/lua/chadrc.lua | 7 +++++++ nvim/lua/configs/lspconfig.lua | 30 +++++++++++++----------------- nvim/lua/options.lua | 16 ++++++++++++++++ nvim/lua/plugins/init.lua | 7 +------ nvim/lua/plugins/onedarker.lua | 19 ------------------- nvim/lua/plugins/ufo.lua | 12 ++++++++++++ 7 files changed, 51 insertions(+), 43 deletions(-) delete mode 100644 nvim/lua/plugins/onedarker.lua create mode 100644 nvim/lua/plugins/ufo.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 2aaa500..5b15d58 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -23,10 +23,11 @@ "nvim-lspconfig": { "branch": "master", "commit": "3ad562700d0615818bf358268ac8914f6ce2b079" }, "nvim-tree.lua": { "branch": "master", "commit": "ea55ef12036897fdc4476b115a395d2a34965c82" }, "nvim-treesitter": { "branch": "master", "commit": "a1573a9135c608e68cb383f752623527be84bdce" }, + "nvim-ufo": { "branch": "main", "commit": "5525f422d48f570262611ae2b6aa562c1c428bc5" }, "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, - "onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" }, "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "8f47c3d70286a85940cafe990a64b0eac1033671" }, "rustaceanvim": { "branch": "master", "commit": "d3a8b145f0b3db4de9a08fcbc604659f52ee4fbc" }, "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, diff --git a/nvim/lua/chadrc.lua b/nvim/lua/chadrc.lua index 1e71cf1..5f2ca7d 100644 --- a/nvim/lua/chadrc.lua +++ b/nvim/lua/chadrc.lua @@ -65,7 +65,9 @@ M.base46 = { ["@module"] = { fg = "yellow" }, ["@constant"] = { fg = "orange" }, + ["Include"] = { fg = "purple" }, + ["@keyword.exception"] = { fg = "purple" }, ["@string.escape"] = { fg = "red" }, ["Special"] = { fg = "red" }, @@ -73,10 +75,15 @@ M.base46 = { ["@punctuation.bracket"] = { fg = "light_grey" }, ["@punctuation.delimiter"] = { fg = "light_grey" }, ["@tag.delimiter"] = { fg = "light_grey" }, + ["Delimiter"] = { fg = "light_grey" }, + ["Function"] = { bold = true }, ["@function"] = { bold = true }, ["@function.builtin"] = { bold = true }, ["@function.call"] = { bold = true }, + ["@function.method"] = { bold = true }, + ["@function.method.call"] = { bold = true }, + ["@constructor"] = { bold = true }, ["@keyword"] = { italic = true }, ["@keyword.function"] = { bold = true }, diff --git a/nvim/lua/configs/lspconfig.lua b/nvim/lua/configs/lspconfig.lua index 935311d..ff2b76f 100644 --- a/nvim/lua/configs/lspconfig.lua +++ b/nvim/lua/configs/lspconfig.lua @@ -3,22 +3,18 @@ require("nvchad.configs.lspconfig").defaults() local lspconfig = require "lspconfig" --- EXAMPLE -local servers = { "html", "cssls" } -local nvlsp = require "nvchad.configs.lspconfig" +lspconfig.rust_analyzer.setup { + settings = { + ["rust-analyzer"] = { + inlayHints = { + parameterHints = { + enable = false, + }, + }, + }, + }, +} --- lsps with default config -for _, lsp in ipairs(servers) do - lspconfig[lsp].setup { - on_attach = nvlsp.on_attach, - on_init = nvlsp.on_init, - capabilities = nvlsp.capabilities, - } -end --- configuring single server, example: typescript --- lspconfig.tsserver.setup { --- on_attach = nvlsp.on_attach, --- on_init = nvlsp.on_init, --- capabilities = nvlsp.capabilities, --- } +local lombok = vim.fn.stdpath('data') .. '/mason/packages/jdtls/lombok.jar' +lspconfig.jdtls.setup { cmd = { "jdtls", "--jvm-arg=-javaagent:" .. lombok } } diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index 81a6dc8..8a503af 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -6,3 +6,19 @@ require "nvchad.options" -- o.cursorlineopt ='both' -- to enable cursorline! vim.lsp.inlay_hint.enable(true) + +vim.o.foldcolumn = '0' -- '0' is not bad +vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value +vim.o.foldlevelstart = 99 +vim.o.foldenable = true +vim.opt.fillchars = { + vert = "▕", -- alternatives │ + fold = " ", + eob = " ", -- suppress ~ at EndOfBuffer + diff = "╱", -- alternatives = ⣿ ░ ─ + msgsep = "‾", + foldopen = "", + foldsep = "│", + foldclose = "", +} + diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 71433b0..298ea84 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -1,18 +1,14 @@ return { { "stevearc/conform.nvim", - -- event = 'BufWritePre', -- uncomment for format on save opts = require "configs.conform", }, - - -- These are some examples, uncomment them if you want to see them work! { "neovim/nvim-lspconfig", config = function() require "configs.lspconfig" end, }, - { "Pocco81/auto-save.nvim", config = function() @@ -20,7 +16,6 @@ return { end, lazy = false, }, - { "nvim-treesitter/nvim-treesitter", opts = require "configs.default-ts", @@ -32,4 +27,4 @@ return { "nvim-tree/nvim-tree.lua", opts = require "configs.nvim-tree", }, -} + } diff --git a/nvim/lua/plugins/onedarker.lua b/nvim/lua/plugins/onedarker.lua deleted file mode 100644 index f7974a0..0000000 --- a/nvim/lua/plugins/onedarker.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - "navarasu/onedark.nvim", - lazy = false, - config = function() - require("onedark").setup { - style = "darker", -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light' - toggle_style_key = "ss", - transparent = false, -- Show/hide background - - code_style = { - comments = "italic", - keywords = "italic,", - functions = "bold", - strings = "none", - variables = "none", - }, - } - end, -} diff --git a/nvim/lua/plugins/ufo.lua b/nvim/lua/plugins/ufo.lua new file mode 100644 index 0000000..529c5ad --- /dev/null +++ b/nvim/lua/plugins/ufo.lua @@ -0,0 +1,12 @@ +return { + "kevinhwang91/nvim-ufo", + config = function() + require("ufo").setup { + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter", "indent" } + end, + } + end, + lazy = false, + dependencies = { "kevinhwang91/promise-async" }, +}