diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index eed6eea..aa2e6a3 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -1,3 +1,3 @@ { - "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" } + "lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" } } diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index 69ae60b..6e4753d 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -1,145 +1,146 @@ local use_google = require("utils").use_google return { - "sindrets/diffview.nvim", - { "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, - { - "MagicDuck/grug-far.nvim", - config = function() - require("grug-far").setup({ - -- search and replace engines configuration - engines = { - -- see https://github.com/BurntSushi/ripgrep - ripgrep = { - -- ripgrep executable to use, can be a different path if you need to configure - path = "rg", - -- extraArgs = "-.", - }, - }, - }) - end, - }, - { - "shellRaining/hlchunk.nvim", - event = { "BufReadPre", "BufNewFile" }, - opts = { - line_num = { enable = true }, - chunk = { - enable = true, - priority = 15, - style = { - { fg = "#393d4c" }, - }, - chars = { - horizontal_line = "─", - -- vertical_line = "│", - vertical_line = "┊", - left_top = "╭", - left_bottom = "╰", - right_arrow = ">", - }, - use_treesitter = true, - textobject = "", - max_file_size = 1024 * 1024, - error_sign = true, - -- animation related - duration = 0, - delay = 0, - }, - }, - }, - "RRethy/vim-illuminate", - "kdheepak/lazygit.nvim", - "flwyd/vim-conjoin", - "rafcamlet/nvim-luapad", - "vim-scripts/vcscommand.vim", - "AndrewRadev/tagalong.vim", - "AndrewRadev/yankwin.vim", - { "squk/gdrama-syntax.vim", ft = "gdrama" }, - { "nvim-lua/plenary.nvim", lazy = false }, - { "squk/java-syntax.vim", ft = "java" }, - { "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" }, - { "andymass/vim-matchup", event = "VimEnter" }, - { "jghauser/mkdir.nvim", event = "BufWritePre" }, - { - "rmagatti/auto-session", - dependencies = { - "nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens - }, - config = function() - require("auto-session").setup({ - auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, - args_allow_single_directory = false, - bypass_save_filetypes = { "netrw" }, - }) - end, - }, - "tpope/vim-abolish", - { - "johmsalas/text-case.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - config = function() - require("textcase").setup({}) - require("telescope").load_extension("textcase") - end, - cmd = { - "Subs", - }, + "tikhomirov/vim-glsl", + "sindrets/diffview.nvim", + { "folke/todo-comments.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, + { + "MagicDuck/grug-far.nvim", + config = function() + require("grug-far").setup({ + -- search and replace engines configuration + engines = { + -- see https://github.com/BurntSushi/ripgrep + ripgrep = { + -- ripgrep executable to use, can be a different path if you need to configure + path = "rg", + -- extraArgs = "-.", + }, + }, + }) + end, + }, + { + "shellRaining/hlchunk.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = { + line_num = { enable = true }, + chunk = { + enable = true, + priority = 15, + style = { + { fg = "#393d4c" }, + }, + chars = { + horizontal_line = "─", + -- vertical_line = "│", + vertical_line = "┊", + left_top = "╭", + left_bottom = "╰", + right_arrow = ">", + }, + use_treesitter = true, + textobject = "", + max_file_size = 1024 * 1024, + error_sign = true, + -- animation related + duration = 0, + delay = 0, + }, + }, + }, + "RRethy/vim-illuminate", + "kdheepak/lazygit.nvim", + "flwyd/vim-conjoin", + "rafcamlet/nvim-luapad", + "vim-scripts/vcscommand.vim", + "AndrewRadev/tagalong.vim", + "AndrewRadev/yankwin.vim", + { "squk/gdrama-syntax.vim", ft = "gdrama" }, + { "nvim-lua/plenary.nvim", lazy = false }, + { "squk/java-syntax.vim", ft = "java" }, + { "udalov/kotlin-vim", event = "VeryLazy", ft = "kotlin" }, + { "andymass/vim-matchup", event = "VimEnter" }, + { "jghauser/mkdir.nvim", event = "BufWritePre" }, + { + "rmagatti/auto-session", + dependencies = { + "nvim-telescope/telescope.nvim", -- Only needed if you want to use session lens + }, + config = function() + require("auto-session").setup({ + auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, + args_allow_single_directory = false, + bypass_save_filetypes = { "netrw" }, + }) + end, + }, + "tpope/vim-abolish", + { + "johmsalas/text-case.nvim", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("textcase").setup({}) + require("telescope").load_extension("textcase") + end, + cmd = { + "Subs", + }, -- stylua: ignore keys = { { "tc", "TextCaseOpenTelescope", mode = { "n", "v" }, desc = "Telescope" }, }, - }, - { - "NvChad/nvim-colorizer.lua", - ft = "lua", - config = function() - require("colorizer").setup() - end, - }, - { + }, + { + "NvChad/nvim-colorizer.lua", + ft = "lua", + config = function() + require("colorizer").setup() + end, + }, + { - "andweeb/presence.nvim", - cond = not use_google(), - config = function() - require("presence").setup({ - main_image = "file", - show_time = false, - }) - end, - }, - { - "ntpeters/vim-better-whitespace", - config = function() - vim.g.better_whitespace_filetypes_blacklist = { "dashboard" } - end, - }, - { - "mbbill/undotree", - cmd = "UndotreeToggle", - config = function() - vim.g.undotree_SetFocusWhenToggle = 1 - end, + "andweeb/presence.nvim", + cond = not use_google(), + config = function() + require("presence").setup({ + main_image = "file", + show_time = false, + }) + end, + }, + { + "ntpeters/vim-better-whitespace", + config = function() + vim.g.better_whitespace_filetypes_blacklist = { "dashboard" } + end, + }, + { + "mbbill/undotree", + cmd = "UndotreeToggle", + config = function() + vim.g.undotree_SetFocusWhenToggle = 1 + end, -- stylua: ignore keys = { { "ut", ":UndotreeToggle" } }, - }, - { - "stevearc/aerial.nvim", - opts = {}, - cmd = { "AerialToggle", "AerialOn" }, + }, + { + "stevearc/aerial.nvim", + opts = {}, + cmd = { "AerialToggle", "AerialOn" }, -- stylua: ignore keys = { { "so", ":AerialToggle", desc = "[S]symbols [O]utline" } }, - }, - { - "andrewferrier/debugprint.nvim", - opts = {}, - -- Dependency only needed for NeoVim 0.8 - dependencies = { - "nvim-treesitter/nvim-treesitter", - }, - -- Remove the following line to use development versions, - -- not just the formal releases - version = "*", + }, + { + "andrewferrier/debugprint.nvim", + opts = {}, + -- Dependency only needed for NeoVim 0.8 + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, + -- Remove the following line to use development versions, + -- not just the formal releases + version = "*", -- stylua: ignore keys = { { "dp", ":lua require('debugprint').debugprint()", desc = "Debug print" }, @@ -147,5 +148,5 @@ return { { "dq", ":lua require('debugprint').debugprint({variable = true})", desc = "Debug print" }, { "dQ", ":lua require('debugprint').debugprint({variable = true, above = true})", desc = "Debug print", }, }, - }, + }, } diff --git a/vim/.vim/lua/plugins/lsp.lua b/vim/.vim/lua/plugins/lsp.lua index b8dc062..66dfa28 100644 --- a/vim/.vim/lua/plugins/lsp.lua +++ b/vim/.vim/lua/plugins/lsp.lua @@ -2,130 +2,134 @@ local use_google = require("utils").use_google local flags = require("utils").flags return { - -- { - -- "ray-x/lsp_signature.nvim", - -- event = "VeryLazy", - -- opts = { - -- floating_window = true, - -- hint_prefix = "󰡱 ", - -- }, - -- config = function(_, opts) - -- require("lsp_signature").setup(opts) - -- end, - -- }, - { - "kosayoda/nvim-lightbulb", - commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49", - event = { "LspAttach" }, - opts = { - autocmd = { enabled = true }, - virtual_text = { - enabled = true, - text = " 󱐋", - hl = "DiagnosticWarn", - }, - sign = { enabled = false }, - }, - }, - { - "L3MON4D3/LuaSnip", - build = "make install_jsregexp", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - dependencies = { "rafamadriz/friendly-snippets" }, - }, - { - "ray-x/go.nvim", - dependencies = { -- optional packages - "ray-x/guihua.lua", - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - }, - -- cond = not use_google(), - config = function() - local capabilities = flags.blink - and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) - or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) - capabilities.offsetEncoding = { "utf-16" } - require("go").setup({ - lsp_cfg = { capabilities = capabilities }, - lsp_keymaps = false, - lsp_inlay_hints = { - enable = not use_google(), -- doesn't work with ciderlsp - }, - }) - -- Run gofmt + goimports on save + -- { + -- "ray-x/lsp_signature.nvim", + -- event = "VeryLazy", + -- opts = { + -- floating_window = true, + -- hint_prefix = "󰡱 ", + -- }, + -- config = function(_, opts) + -- require("lsp_signature").setup(opts) + -- end, + -- }, + { + "kosayoda/nvim-lightbulb", + commit = "1cae7b7153ae98dcf1b11173a443ac1b6d8e3d49", + event = { "LspAttach" }, + opts = { + autocmd = { enabled = true }, + virtual_text = { + enabled = true, + text = " 󱐋", + hl = "DiagnosticWarn", + }, + sign = { enabled = false }, + }, + }, + { + "L3MON4D3/LuaSnip", + build = "make install_jsregexp", + config = function() + require("luasnip.loaders.from_vscode").lazy_load() + end, + dependencies = { "rafamadriz/friendly-snippets" }, + }, + { + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + -- cond = not use_google(), + config = function() + local capabilities = flags.blink + and require("blink.cmp").get_lsp_capabilities(vim.lsp.protocol.make_client_capabilities()) + or require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) + capabilities.offsetEncoding = { "utf-16" } + require("go").setup({ + lsp_cfg = { capabilities = capabilities }, + lsp_keymaps = false, + lsp_inlay_hints = { + enable = not use_google(), -- doesn't work with ciderlsp + }, + }) + -- Run gofmt + goimports on save - local format_sync_grp = vim.api.nvim_create_augroup("goimports", {}) - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*.go", - callback = function() - require("go.format").goimports() - end, - group = format_sync_grp, - }) - end, - ft = { "go", "gomod" }, - build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries - }, - { - "neovim/nvim-lspconfig", - dependencies = { - "hrsh7th/nvim-cmp", - "saghen/blink.cmp", - "saghen/blink.compat", - "nvim-lua/lsp-status.nvim", - "VonHeikemen/lsp-zero.nvim", - }, - keys = { - { "F", ":lua vim.lsp.buf.format()" }, - { "rn", ":lua vim.lsp.buf.rename()" }, - { "L", ":lua vim.lsp.buf.hover()" }, - { "gr", ":Telescope lsp_references" }, - { "gd", ":lua vim.lsp.buf.definition()" }, - -- { "gd", "Telescope lsp_definitions" }, - { "gD", ":tab split | lua vim.lsp.buf.definition()" }, - { "gi", ":lua vim.lsp.buf.implementation()" }, - { "gI", ":lua vim.lsp.buf.implementation()" }, - { "gR", ":lua vim.lsp.buf.references()" }, - { "gt", ":lua vim.lsp.buf.type_definition()" }, - { "", ":lua vim.lsp.buf.signature_help()" }, - { "", ":lua vim.lsp.buf.signature_help()", mode = "i" }, - }, - config = function() - local nvim_lspconfig = require("lspconfig") - local lsp_configs = require("lspconfig.configs") + local format_sync_grp = vim.api.nvim_create_augroup("goimports", {}) + vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + require("go.format").goimports() + end, + group = format_sync_grp, + }) + end, + ft = { "go", "gomod" }, + build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries + }, + { + "neovim/nvim-lspconfig", + dependencies = { + "hrsh7th/nvim-cmp", + "saghen/blink.cmp", + "saghen/blink.compat", + "nvim-lua/lsp-status.nvim", + "VonHeikemen/lsp-zero.nvim", + }, + keys = { + { "F", ":lua vim.lsp.buf.format()" }, + { "rn", ":lua vim.lsp.buf.rename()" }, + { "L", ":lua vim.lsp.buf.hover()" }, + { "gr", ":Telescope lsp_references" }, + { "gd", ":lua vim.lsp.buf.definition()" }, + -- { "gd", "Telescope lsp_definitions" }, + { "gD", ":tab split | lua vim.lsp.buf.definition()" }, + { "gi", ":lua vim.lsp.buf.implementation()" }, + { "gI", ":lua vim.lsp.buf.implementation()" }, + { "gR", ":lua vim.lsp.buf.references()" }, + { "gt", ":lua vim.lsp.buf.type_definition()" }, + { "", ":lua vim.lsp.buf.signature_help()" }, + { "", ":lua vim.lsp.buf.signature_help()", mode = "i" }, + }, + config = function() + local nvim_lspconfig = require("lspconfig") + local lsp_configs = require("lspconfig.configs") - lsp_configs.ciderlsp = { - default_config = { - cmd = { - "/google/bin/releases/cider/ciderlsp/ciderlsp", - "--tooltag=nvim-lsp", - "--noforward_sync_responses", - }, - filetypes = { - "c", - "cpp", - "java", - "kotlin", - "objc", - "proto", - "textproto", - "go", - "python", - "bzl", - "typescript", - }, - offset_encoding = "utf-8", - root_dir = nvim_lspconfig.util.root_pattern(".citc"), - settings = {}, - }, - } + lsp_configs.ciderlsp = { + default_config = { + cmd = { + "/google/bin/releases/cider/ciderlsp/ciderlsp", + "--tooltag=nvim-lsp", + "--noforward_sync_responses", + }, + filetypes = { + "c", + "cpp", + "java", + "kotlin", + "objc", + "proto", + "textproto", + "go", + "python", + "bzl", + "typescript", + }, + offset_encoding = "utf-8", + root_dir = nvim_lspconfig.util.root_pattern(".citc"), + settings = {}, + }, + } - nvim_lspconfig.ciderlsp.setup({}) - vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]]) - vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]]) - end, - }, + if use_google() then + nvim_lspconfig.ciderlsp.setup({}) + end + nvim_lspconfig.wgsl_analyzer.setup({}) + + vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]]) + vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]]) + end, + }, }