From 386d50d7ce13e1bf53b6b9a29f739dff67ab798c Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Tue, 15 Jul 2025 16:25:52 +0500 Subject: [PATCH] nvim lazy plugin management part 2 --- .config/nvim/init.lua | 10 +- .config/nvim/lua/user/cmp.lua | 128 ----------------- .config/nvim/lua/user/dap/dap.lua | 81 ----------- .config/nvim/lua/user/dap/dapui.lua | 6 - .config/nvim/lua/user/lazy.lua | 58 +------- .config/nvim/lua/user/lsp/init.lua | 12 -- .config/nvim/lua/user/lsp_format.lua | 7 - .config/nvim/lua/user/plugins/cmp.lua | 133 ++++++++++++++++++ .config/nvim/lua/user/plugins/dap/init.lua | 85 +++++++++++ .../{ => plugins}/lsp/diagnostics_config.lua | 0 .config/nvim/lua/user/plugins/lsp/init.lua | 34 +++++ .../{ => plugins}/lsp/mason_lsp_config.lua | 0 .../lua/user/{ => plugins}/lsp/none_ls.lua | 0 .config/nvim/lua/user/plugins/snipptes.lua | 2 - .config/nvim/lua/user/plugins/telescope.lua | 12 +- .config/nvim/lua/user/plugins/theme/init.lua | 39 +++++ .config/nvim/lua/user/plugins/treesitter.lua | 7 +- .config/nvim/lua/user/plugins/which_key.lua | 12 +- .config/nvim/lua/user/plugins/zen_mode.lua | 9 ++ .config/nvim/lua/user/themes/kanagawa.lua | 29 ---- .config/nvim/lua/user/themes/tokyo_night.lua | 1 - 21 files changed, 318 insertions(+), 347 deletions(-) delete mode 100644 .config/nvim/lua/user/cmp.lua delete mode 100644 .config/nvim/lua/user/dap/dap.lua delete mode 100644 .config/nvim/lua/user/dap/dapui.lua delete mode 100644 .config/nvim/lua/user/lsp/init.lua delete mode 100644 .config/nvim/lua/user/lsp_format.lua create mode 100644 .config/nvim/lua/user/plugins/cmp.lua create mode 100644 .config/nvim/lua/user/plugins/dap/init.lua rename .config/nvim/lua/user/{ => plugins}/lsp/diagnostics_config.lua (100%) create mode 100644 .config/nvim/lua/user/plugins/lsp/init.lua rename .config/nvim/lua/user/{ => plugins}/lsp/mason_lsp_config.lua (100%) rename .config/nvim/lua/user/{ => plugins}/lsp/none_ls.lua (100%) create mode 100644 .config/nvim/lua/user/plugins/theme/init.lua create mode 100644 .config/nvim/lua/user/plugins/zen_mode.lua delete mode 100644 .config/nvim/lua/user/themes/kanagawa.lua delete mode 100644 .config/nvim/lua/user/themes/tokyo_night.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 9c8d7c1..1a4cd8b 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,12 +1,4 @@ require("user.keymaps") -require("user.lazy") - -require("user.themes.kanagawa") - require("user.options") -require("user.cmp") -require("user.lsp") -require("user.lsp_format") --- require("user.dap.dapui") --- require("user.dap.dap") +require("user.lazy") diff --git a/.config/nvim/lua/user/cmp.lua b/.config/nvim/lua/user/cmp.lua deleted file mode 100644 index 1625894..0000000 --- a/.config/nvim/lua/user/cmp.lua +++ /dev/null @@ -1,128 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end - -require("luasnip/loaders/from_vscode").lazy_load() - -local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" -end - -local cmp_kinds = { - Text = ' ', - Method = ' ', - Function = ' ', - Constructor = ' ', - Field = ' ', - Variable = ' ', - Class = ' ', - Interface = ' ', - Module = ' ', - Property = ' ', - Unit = ' ', - Value = ' ', - Enum = ' ', - Keyword = ' ', - Snippet = ' ', - Color = ' ', - File = ' ', - Reference = ' ', - Folder = ' ', - EnumMember = ' ', - Constant = ' ', - Struct = ' ', - Event = ' ', - Operator = ' ', - TypeParameter = ' ', -} - -cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. - [""] = cmp.mapping { - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }, - -- Accept currently selected item. If none selected, `select` first item. - -- Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm { select = false }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif check_backspace() then - fallback() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - formatting = { - fields = { "kind", "abbr", "menu" }, - format = function(entry, vim_item) - -- Kind icons - vim_item.kind = string.format("%s", cmp_kinds[vim_item.kind]) - vim_item.menu = ({ - nvim_lsp = "[LSP]", - luasnip = "[Snippet]", - buffer = "[Buffer]", - path = "[Path]", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "path" }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - documentation = { - border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, - }, - }, - experimental = { - ghost_text = false, - native_menu = false, - }, -} diff --git a/.config/nvim/lua/user/dap/dap.lua b/.config/nvim/lua/user/dap/dap.lua deleted file mode 100644 index ca9f1a7..0000000 --- a/.config/nvim/lua/user/dap/dap.lua +++ /dev/null @@ -1,81 +0,0 @@ -local dap_status_ok, dap = pcall(require, "dap") -if not dap_status_ok then - return -end - -local dapui_status_ok, dapui = pcall(require, "dapui") -if not dapui_status_ok then - return -end - - -dap.adapters.coreclr = { - type = 'executable', - command = '/home/nikita/.local/share/nvim/mason/bin/netcoredbg', - args = { '--interpreter=vscode' } -} - -vim.g.dotnet_build_project = function() - local default_path = vim.fn.getcwd() .. '/' - if vim.g['dotnet_last_proj_path'] ~= nil then - default_path = vim.g['dotnet_last_proj_path'] - end - local path = vim.fn.input('Path to your *proj file', default_path, 'file') - vim.g['dotnet_last_proj_path'] = path - local cmd = 'dotnet build -c Debug ' .. path .. ' > /dev/null' - print('') - print('Cmd to execute: ' .. cmd) - local f = os.execute(cmd) - if f == 0 then - print('\nBuild: ✔️ ') - else - print('\nBuild: ❌ (code: ' .. f .. ')') - end -end - -vim.g.dotnet_get_dll_path = function() - local request = function() - return vim.fn.input('Path to dll', vim.fn.getcwd(), 'file') - end - - if vim.g['dotnet_last_dll_path'] == nil then - vim.g['dotnet_last_dll_path'] = request() - else - if vim.fn.confirm('Do you want to change the path to dll?\n' .. vim.g['dotnet_last_dll_path'], '&yes\n&no', 2) == 1 then - vim.g['dotnet_last_dll_path'] = request() - end - end - - return vim.g['dotnet_last_dll_path'] -end - -local config = { - { - type = "coreclr", - name = "launch - netcoredbg", - request = "launch", - -- console = "integratedTerminal", - cwd = "${workspaceFolder}/src/ClientService.AspNet", - launchSettingsFilePath = "${workspaceFolder}/src/ClientService.AspNet/Properties/launchSettings.json", - launchSettingsProfile = "ClientService.AspNet", - program = function() - if vim.fn.confirm('Should I recompile first?', '&yes\n&no', 2) == 1 then - vim.g.dotnet_build_project() - end - return vim.g.dotnet_get_dll_path() - end, - }, -} - -dap.configurations.cs = config - ---Autostart ui when debugging -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() -end --- dap.listeners.before.event_terminated["dapui_config"] = function() --- dapui.close() --- end --- dap.listeners.before.event_exited["dapui_config"] = function() --- dapui.close() --- end diff --git a/.config/nvim/lua/user/dap/dapui.lua b/.config/nvim/lua/user/dap/dapui.lua deleted file mode 100644 index 2d2e610..0000000 --- a/.config/nvim/lua/user/dap/dapui.lua +++ /dev/null @@ -1,6 +0,0 @@ -local dapui_status_ok, dapui = pcall(require, "dapui") -if not dapui_status_ok then - return -end - -dapui.setup() diff --git a/.config/nvim/lua/user/lazy.lua b/.config/nvim/lua/user/lazy.lua index 5bf2f94..3f11ba9 100644 --- a/.config/nvim/lua/user/lazy.lua +++ b/.config/nvim/lua/user/lazy.lua @@ -1,5 +1,3 @@ -local fn = vim.fn - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ @@ -21,61 +19,11 @@ end lazy.setup( { + change_detection = { + enabled = false, + }, spec = { { import = "user.plugins" }, - - { "hrsh7th/nvim-cmp", event = "VeryLazy" }, -- The completion plugin - { "hrsh7th/cmp-buffer", event = "VeryLazy" }, -- buffer completions - { "hrsh7th/cmp-path", event = "VeryLazy" }, -- path completions - { "hrsh7th/cmp-cmdline", event = "VeryLazy" }, -- cmdline completions - { "saadparwaiz1/cmp_luasnip", event = "VeryLazy" }, -- snippet completions - { "hrsh7th/cmp-nvim-lsp", event = "VeryLazy" }, - - -- snippets - - -- LSP - { "williamboman/mason.nvim", event = "VeryLazy" }, -- simple to use language server installer - { "williamboman/mason-lspconfig.nvim", event = "VeryLazy" }, - { "neovim/nvim-lspconfig", event = "VeryLazy" }, -- enable LSP - { - "folke/zen-mode.nvim", - opts = { - window = { - backdrop = 1 - } - }, - event = "VeryLazy" - }, - - - { - "nvimtools/none-ls.nvim", - event = "VeryLazy" - }, - - { "lukas-reineke/lsp-format.nvim", event = "VeryLazy" }, - - --comment out - { "tpope/vim-commentary", event = "VeryLazy" }, - { "windwp/nvim-ts-autotag", event = "VeryLazy" }, - - { - "rebelot/kanagawa.nvim", - lazy = false, - priority = 1000, - }, - - --debugging - { "mfussenegger/nvim-dap", event = "VeryLazy" }, - { - "rcarriga/nvim-dap-ui", - dependencies = { - "mfussenegger/nvim-dap", - "nvim-neotest/nvim-nio" - }, - event = { "VeryLazy" } - }, - }, } ) diff --git a/.config/nvim/lua/user/lsp/init.lua b/.config/nvim/lua/user/lsp/init.lua deleted file mode 100644 index 087b1b2..0000000 --- a/.config/nvim/lua/user/lsp/init.lua +++ /dev/null @@ -1,12 +0,0 @@ -local status_ok, mason = pcall(require, "mason") -if not status_ok then - return -end - -mason.setup() - -require("user.lsp.mason_lsp_config") -require("user.lsp.diagnostics_config").setup() --- require("user.lsp.none_ls") - -vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]]) diff --git a/.config/nvim/lua/user/lsp_format.lua b/.config/nvim/lua/user/lsp_format.lua deleted file mode 100644 index c213507..0000000 --- a/.config/nvim/lua/user/lsp_format.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("lsp-format").setup {} - -local on_attach = function(client) - require "lsp-format".on_attach(client) -end - -require "lspconfig".gopls.setup { on_attach = on_attach } diff --git a/.config/nvim/lua/user/plugins/cmp.lua b/.config/nvim/lua/user/plugins/cmp.lua new file mode 100644 index 0000000..95a319d --- /dev/null +++ b/.config/nvim/lua/user/plugins/cmp.lua @@ -0,0 +1,133 @@ +return { + { + "hrsh7th/nvim-cmp", + event = "VeryLazy", + config = function() + local cmp = require "cmp" + local luasnip = require "luasnip" + require("luasnip/loaders/from_vscode").lazy_load() + + local check_backspace = function() + local col = vim.fn.col "." - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" + end + + local cmp_kinds = { + Text = ' ', + Method = ' ', + Function = ' ', + Constructor = ' ', + Field = ' ', + Variable = ' ', + Class = ' ', + Interface = ' ', + Module = ' ', + Property = ' ', + Unit = ' ', + Value = ' ', + Enum = ' ', + Keyword = ' ', + Snippet = ' ', + Color = ' ', + File = ' ', + Reference = ' ', + Folder = ' ', + EnumMember = ' ', + Constant = ' ', + Struct = ' ', + Event = ' ', + Operator = ' ', + TypeParameter = ' ', + } + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `` mapping. + [""] = cmp.mapping { + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }, + -- Accept currently selected item. If none selected, `select` first item. + -- Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm { select = false }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + -- Kind icons + vim_item.kind = string.format("%s", cmp_kinds[vim_item.kind]) + vim_item.menu = ({ + nvim_lsp = "[LSP]", + luasnip = "[Snippet]", + buffer = "[Buffer]", + path = "[Path]", + })[entry.source.name] + return vim_item + end, + }, + sources = { + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + window = { + documentation = { + border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, + }, + }, + experimental = { + ghost_text = false, + native_menu = false, + }, + } + end + }, -- The completion plugin + { "hrsh7th/cmp-buffer", event = "VeryLazy" }, -- buffer completions + { "hrsh7th/cmp-path", event = "VeryLazy" }, -- path completions + { "hrsh7th/cmp-cmdline", event = "VeryLazy" }, -- cmdline completions + { "saadparwaiz1/cmp_luasnip", event = "VeryLazy" }, -- snippet completions + { "hrsh7th/cmp-nvim-lsp", event = "VeryLazy" }, +} diff --git a/.config/nvim/lua/user/plugins/dap/init.lua b/.config/nvim/lua/user/plugins/dap/init.lua new file mode 100644 index 0000000..5d4b3cf --- /dev/null +++ b/.config/nvim/lua/user/plugins/dap/init.lua @@ -0,0 +1,85 @@ +return { + { + "mfussenegger/nvim-dap", + event = "VeryLazy", + config = function() + local dap = require "dap" + + local dapui = require "dapui" + + dap.adapters.coreclr = { + type = 'executable', + command = '/home/nikita/.local/share/nvim/mason/bin/netcoredbg', + args = { '--interpreter=vscode' } + } + + vim.g.dotnet_build_project = function() + local default_path = vim.fn.getcwd() .. '/' + if vim.g['dotnet_last_proj_path'] ~= nil then + default_path = vim.g['dotnet_last_proj_path'] + end + local path = vim.fn.input('Path to your *proj file', default_path, 'file') + vim.g['dotnet_last_proj_path'] = path + local cmd = 'dotnet build -c Debug ' .. path .. ' > /dev/null' + print('') + print('Cmd to execute: ' .. cmd) + local f = os.execute(cmd) + if f == 0 then + print('\nBuild: ✔️ ') + else + print('\nBuild: ❌ (code: ' .. f .. ')') + end + end + + vim.g.dotnet_get_dll_path = function() + local request = function() + return vim.fn.input('Path to dll', vim.fn.getcwd(), 'file') + end + + if vim.g['dotnet_last_dll_path'] == nil then + vim.g['dotnet_last_dll_path'] = request() + else + if vim.fn.confirm('Do you want to change the path to dll?\n' .. vim.g['dotnet_last_dll_path'], '&yes\n&no', 2) == 1 then + vim.g['dotnet_last_dll_path'] = request() + end + end + + return vim.g['dotnet_last_dll_path'] + end + + local config = { + { + type = "coreclr", + name = "launch - netcoredbg", + request = "launch", + -- console = "integratedTerminal", + cwd = "${workspaceFolder}/src/ClientService.AspNet", + launchSettingsFilePath = "${workspaceFolder}/src/ClientService.AspNet/Properties/launchSettings.json", + launchSettingsProfile = "ClientService.AspNet", + program = function() + if vim.fn.confirm('Should I recompile first?', '&yes\n&no', 2) == 1 then + vim.g.dotnet_build_project() + end + return vim.g.dotnet_get_dll_path() + end, + }, + } + + dap.configurations.cs = config + + --Autostart ui when debugging + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + end + }, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio" + }, + event = { "VeryLazy" }, + config = true + }, +} diff --git a/.config/nvim/lua/user/lsp/diagnostics_config.lua b/.config/nvim/lua/user/plugins/lsp/diagnostics_config.lua similarity index 100% rename from .config/nvim/lua/user/lsp/diagnostics_config.lua rename to .config/nvim/lua/user/plugins/lsp/diagnostics_config.lua diff --git a/.config/nvim/lua/user/plugins/lsp/init.lua b/.config/nvim/lua/user/plugins/lsp/init.lua new file mode 100644 index 0000000..3ecd4f4 --- /dev/null +++ b/.config/nvim/lua/user/plugins/lsp/init.lua @@ -0,0 +1,34 @@ +return { + { + "williamboman/mason.nvim", + event = "VeryLazy", + config = true + }, -- simple to use language server installer + { + "williamboman/mason-lspconfig.nvim", + event = "VeryLazy", + config = function() + require("user.plugins.lsp.mason_lsp_config") + require("user.plugins.lsp.diagnostics_config").setup() + -- require("user.lsp.none_ls") + + vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format{async=true}' ]]) + end + }, + { "neovim/nvim-lspconfig", event = "VeryLazy" }, -- enable LSP + { + "lukas-reineke/lsp-format.nvim", + event = "VeryLazy", + config = function() + local on_attach = function(client) + require("lsp-format").on_attach(client) + end + + require("lspconfig").gopls.setup { on_attach = on_attach } + end + }, + { + "nvimtools/none-ls.nvim", + event = "VeryLazy" + }, +} diff --git a/.config/nvim/lua/user/lsp/mason_lsp_config.lua b/.config/nvim/lua/user/plugins/lsp/mason_lsp_config.lua similarity index 100% rename from .config/nvim/lua/user/lsp/mason_lsp_config.lua rename to .config/nvim/lua/user/plugins/lsp/mason_lsp_config.lua diff --git a/.config/nvim/lua/user/lsp/none_ls.lua b/.config/nvim/lua/user/plugins/lsp/none_ls.lua similarity index 100% rename from .config/nvim/lua/user/lsp/none_ls.lua rename to .config/nvim/lua/user/plugins/lsp/none_ls.lua diff --git a/.config/nvim/lua/user/plugins/snipptes.lua b/.config/nvim/lua/user/plugins/snipptes.lua index 770e223..d8b2bbb 100644 --- a/.config/nvim/lua/user/plugins/snipptes.lua +++ b/.config/nvim/lua/user/plugins/snipptes.lua @@ -1,5 +1,4 @@ return { - { "L3MON4D3/LuaSnip", event = "VeryLazy" }, --snippet engine { "rafamadriz/friendly-snippets", event = "VeryLazy" }, -- a bunch of snippets to use { @@ -7,5 +6,4 @@ return { run = "yarn install --frozen-lockfile && yarn compile", event = "VeryLazy" }, - } diff --git a/.config/nvim/lua/user/plugins/telescope.lua b/.config/nvim/lua/user/plugins/telescope.lua index 7d7bbce..bac2097 100644 --- a/.config/nvim/lua/user/plugins/telescope.lua +++ b/.config/nvim/lua/user/plugins/telescope.lua @@ -1,11 +1,13 @@ return { { "nvim-telescope/telescope.nvim", - config = function() + dependencies = { "nvim-telescope/telescope-media-files.nvim", "nvim-lua/plenary.nvim" }, + lazy = false, + config = function(_, _opts) local telescope = require("telescope") - telescope.load_extension("media_files") + telescope.setup(_opts) - local telescope_builtin = require("telescope.builtin") + telescope.load_extension("media_files") local which_key = require("which-key") which_key.add({ @@ -115,7 +117,5 @@ return { }, } end, - event = "VeryLazy" - }, - { "nvim-telescope/telescope-media-files.nvim", event = "VeryLazy" }, + } } diff --git a/.config/nvim/lua/user/plugins/theme/init.lua b/.config/nvim/lua/user/plugins/theme/init.lua new file mode 100644 index 0000000..e7a292d --- /dev/null +++ b/.config/nvim/lua/user/plugins/theme/init.lua @@ -0,0 +1,39 @@ +return { + "rebelot/kanagawa.nvim", + lazy = false, + priority = 1000, + opts = { + compile = false, -- enable compiling the colorscheme + undercurl = true, -- enable undercurls + commentStyle = { italic = true }, + functionStyle = {}, + keywordStyle = { italic = true }, + statementStyle = { bold = true }, + typeStyle = {}, + transparent = true, -- do not set background color + dimInactive = false, -- dim inactive window `:h hl-NormalNC` + terminalColors = true, -- define vim.g.terminal_color_{0,17} + colors = { + -- add/modify theme and palette colors + palette = {}, + theme = { wave = {}, lotus = {}, dragon = {}, all = { ui = { bg_gutter = "none" } } }, + }, + overrides = function(colors) -- add/modify highlights + local theme = colors.theme + return { + CursorLine = { bg = "#272735" }, + } + end, + theme = "wave", -- Load "wave" theme when 'background' option is not set + background = { -- map the value of 'background' option to a theme + dark = "wave", -- try "dragon" ! + }, + }, + config = function(_, _opts) + require("kanagawa").setup(_opts) + + vim.cmd("colorscheme kanagawa") + end +} + + diff --git a/.config/nvim/lua/user/plugins/treesitter.lua b/.config/nvim/lua/user/plugins/treesitter.lua index c6919da..a768567 100644 --- a/.config/nvim/lua/user/plugins/treesitter.lua +++ b/.config/nvim/lua/user/plugins/treesitter.lua @@ -1,8 +1,8 @@ return { { "nvim-treesitter/nvim-treesitter", - run = ":TSUpdate", - event = "VeryLazy", + build = ":TSUpdate", + lazy = false, -- init = function(plugin) -- require("nvim-treesitter") -- end, @@ -34,5 +34,8 @@ return { }, }, }, + config = function (_, opts) + require("nvim-treesitter.configs").setup(opts) + end }, } diff --git a/.config/nvim/lua/user/plugins/which_key.lua b/.config/nvim/lua/user/plugins/which_key.lua index 509079e..b98cf2e 100644 --- a/.config/nvim/lua/user/plugins/which_key.lua +++ b/.config/nvim/lua/user/plugins/which_key.lua @@ -72,8 +72,10 @@ return { filetypes = { "TelescopePrompt" }, }, }, - config = function() + config = function(_, opts) local which_key = require("which-key") + which_key.setup(opts) + which_key.add({ { "", group = "Hotkeys" }, { "?", ":WhichKey ", desc = "Show keybindings" }, @@ -82,14 +84,6 @@ return { { "F", ":lua vim.lsp.buf.format() ", desc = "Format file" }, }) - -- which_key.add({ - -- { "f", group = "Find" }, - -- { "ff", "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", desc = "Find file" }, - -- { "fw", "lua require'telescope.builtin'.live_grep()", desc = "Grep file" }, - -- { "fb", "lua require'telescope.builtin'.buffers()", desc = "Find buffer" }, - -- { "fh", "lua require'telescope.builtin'.resume()", desc = "Resume last search" }, - -- }) - which_key.add({ { "g", group = "Git" }, { "gb", toggle_gitsigns_blame, desc = "Toggle git blame view" }, diff --git a/.config/nvim/lua/user/plugins/zen_mode.lua b/.config/nvim/lua/user/plugins/zen_mode.lua new file mode 100644 index 0000000..18accf1 --- /dev/null +++ b/.config/nvim/lua/user/plugins/zen_mode.lua @@ -0,0 +1,9 @@ +return { + "folke/zen-mode.nvim", + opts = { + window = { + backdrop = 1 + } + }, + event = "VeryLazy" +} diff --git a/.config/nvim/lua/user/themes/kanagawa.lua b/.config/nvim/lua/user/themes/kanagawa.lua deleted file mode 100644 index 8585036..0000000 --- a/.config/nvim/lua/user/themes/kanagawa.lua +++ /dev/null @@ -1,29 +0,0 @@ -require("kanagawa").setup({ - compile = false, -- enable compiling the colorscheme - undercurl = true, -- enable undercurls - commentStyle = { italic = true }, - functionStyle = {}, - keywordStyle = { italic = true }, - statementStyle = { bold = true }, - typeStyle = {}, - transparent = true, -- do not set background color - dimInactive = false, -- dim inactive window `:h hl-NormalNC` - terminalColors = true, -- define vim.g.terminal_color_{0,17} - colors = { - -- add/modify theme and palette colors - palette = {}, - theme = { wave = {}, lotus = {}, dragon = {}, all = { ui = { bg_gutter = "none" } } }, - }, - overrides = function(colors) -- add/modify highlights - local theme = colors.theme - return { - CursorLine = { bg = "#272735" }, - } - end, - theme = "wave", -- Load "wave" theme when 'background' option is not set - background = { -- map the value of 'background' option to a theme - dark = "wave", -- try "dragon" ! - }, -}) - -vim.cmd("colorscheme kanagawa") diff --git a/.config/nvim/lua/user/themes/tokyo_night.lua b/.config/nvim/lua/user/themes/tokyo_night.lua deleted file mode 100644 index f6afac5..0000000 --- a/.config/nvim/lua/user/themes/tokyo_night.lua +++ /dev/null @@ -1 +0,0 @@ -vim.g.tokyonight_style = "night"