diff --git a/alacritty/.alacritty.toml b/alacritty/.alacritty.toml index 8cb24c5..53e421c 100644 --- a/alacritty/.alacritty.toml +++ b/alacritty/.alacritty.toml @@ -13,35 +13,37 @@ decorations = "None" [colors] draw_bold_text_with_bright_colors = true +# Default colors +[colors.primary] +background = '#1e2024' +foreground = '#a1a3a8' + +# Normal colors +[colors.normal] +black = '#27272a' +blue = '#5e7fdd' +cyan = '#97c3fa' +green = '#90b99f' +magenta = '#e29eca' +red = '#d45d9e' +white = '#c9c7cd' +yellow = '#f0ea2d' + +# Bright colors [colors.bright] -black = "#949494" -blue = "#74b2ff" -cyan = "#85dc85" -green = "#36c692" -magenta = "#ae81ff" -red = "#ff5189" -white = "#e4e4e4" -yellow = "#c6c684" +black = '#353539' +blue = '#a7b3dd' +cyan = '#6de6fc' +green = '#a8fc8d' +magenta = '#eb4cce' +red = '#ca72de' +white = '#c9c7cd' +yellow = '#f7f48d' [colors.cursor] cursor = "#8e8e8e" text = "#080808" -[colors.normal] -black = "#323437" -blue = "#80a0ff" -cyan = "#79dac8" -green = "#8cc85f" -magenta = "#cf87e8" -red = "#ff5454" -white = "#c6c6c6" -yellow = "#e3c78a" - -[colors.primary] -background = "#080808" -bright_foreground = "#eeeeee" -foreground = "#bdbdbd" - [colors.selection] background = "#b2ceee" text = "#080808" diff --git a/config/.config/nvim/init.lua b/config/.config/nvim/init.lua index b8cd798..f8581bb 100644 --- a/config/.config/nvim/init.lua +++ b/config/.config/nvim/init.lua @@ -25,14 +25,6 @@ end require("lazy").setup({ -- this entry tells lazy.nvim to load the list of of *.lua files from plugins/ import = "plugins", - -- Dev configuration - dev = { - -- Directory where you store your local plugin projects - path = "~/neovim-plugins/squk/", - -- @type string[] plugins that match these patterns will use your local versions instead of being fetched from GitHub - patterns = { "squk" }, - fallback = false, -- Fallback to git when local plugin doesn't exist - }, }) vim.opt.undodir = vim.fn.expand("$HOME") .. "/.undo/" diff --git a/vim/.vim/lua/config/wgsl.lua b/vim/.vim/lua/config/wgsl.lua new file mode 100644 index 0000000..6436ab2 --- /dev/null +++ b/vim/.vim/lua/config/wgsl.lua @@ -0,0 +1,9 @@ +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { + pattern = "*.wgsl", + callback = function() + local lspconfig = require("lspconfig") + lspconfig.wgsl_analyzer.setup({}) + + vim.bo.filetype = "wgsl" + end, +}) diff --git a/vim/.vim/lua/plugins/codeium.lua b/vim/.vim/lua/plugins/codeium.lua deleted file mode 100644 index 60cf6df..0000000 --- a/vim/.vim/lua/plugins/codeium.lua +++ /dev/null @@ -1,17 +0,0 @@ -local use_google = require("utils").use_google -return { - { - "Exafunction/codeium.nvim", - -- commit = "b1ff0d6c993e3d87a4362d2ccd6c660f7444599f", - event = "VeryLazy", - -- event = "InsertEnter", - cond = not use_google(), - dependencies = { - "nvim-lua/plenary.nvim", - "hrsh7th/nvim-cmp", - }, - config = function() - require("codeium").setup({}) - end, - }, -} diff --git a/vim/.vim/lua/plugins/conform.lua b/vim/.vim/lua/plugins/conform.lua index e5486b2..657c0fc 100644 --- a/vim/.vim/lua/plugins/conform.lua +++ b/vim/.vim/lua/plugins/conform.lua @@ -61,12 +61,11 @@ return { -- Conform will run multiple formatters sequentially -- go = { "goimports", "gofmt" }, -- Use a sub-list to run only the first available formatter - -- javascript = { { "prettierd", "prettier" } }, lua = { "stylua" }, -- Conform will run multiple formatters sequentially - python = { "isort", "black" }, + python = { "isort" }, -- Use a sub-list to run only the first available formatter - javascript = { { "prettierd", "prettier" } }, + javascript = { { "prettier" } }, gdscript = { "gdformat" }, ron = { "ronfmt" }, dashboard = {}, diff --git a/vim/.vim/lua/plugins/lsp.lua b/vim/.vim/lua/plugins/lsp.lua index 29b0c9c..dd33bf6 100644 --- a/vim/.vim/lua/plugins/lsp.lua +++ b/vim/.vim/lua/plugins/lsp.lua @@ -83,7 +83,7 @@ return { { "", ":lua vim.lsp.buf.signature_help()", mode = "i" }, }, config = function() - local nvim_lspconfig = require("lspconfig") + local lspconfig = require("lspconfig") local lsp_configs = require("lspconfig.configs") lsp_configs.ciderlsp = { @@ -107,18 +107,20 @@ return { "typescript", }, offset_encoding = "utf-8", - root_dir = nvim_lspconfig.util.root_pattern(".citc"), + root_dir = lspconfig.util.root_pattern(".citc"), settings = {}, }, } if use_google() then - nvim_lspconfig.ciderlsp.setup({}) + lspconfig.ciderlsp.setup({}) end - nvim_lspconfig.wgsl_analyzer.setup({}) + require("lspconfig").gdscript.setup({}) vim.cmd([[autocmd FileType gdscript setlocal commentstring=#\ %s]]) vim.cmd([[autocmd FileType gdscript setlocal autoindent noexpandtab tabstop=4 shiftwidth=4]]) + + require("lspconfig").gdshader_lsp.setup({}) end, }, } diff --git a/vim/.vim/lua/plugins/rust.lua b/vim/.vim/lua/plugins/rust.lua index 973df10..b350d8e 100644 --- a/vim/.vim/lua/plugins/rust.lua +++ b/vim/.vim/lua/plugins/rust.lua @@ -6,6 +6,16 @@ return { ft = { "rust" }, config = function(_, opts) vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {}) + + for _, method in ipairs({ "textDocument/diagnostic", "workspace/diagnostic" }) do + local default_diagnostic_handler = vim.lsp.handlers[method] + vim.lsp.handlers[method] = function(err, result, context, config) + if err ~= nil and err.code == -32802 then + return + end + return default_diagnostic_handler(err, result, context, config) + end + end end, opts = { server = { diff --git a/vim/.vim/lua/plugins/telescope.lua b/vim/.vim/lua/plugins/telescope.lua index c9709fe..8a21b59 100644 --- a/vim/.vim/lua/plugins/telescope.lua +++ b/vim/.vim/lua/plugins/telescope.lua @@ -3,45 +3,35 @@ local exec = require("utils").exec local TableConcat = require("utils").TableConcat _G.find_files = function(search_dirs) - require("telescope.builtin").find_files({ search_dirs = search_dirs }) + require("telescope.builtin").find_files({ search_dirs = search_dirs }) end -- Helper functions to fetch the current scope and set `search_dirs` _G.find_dotfiles = function() end _G.search_cwd = function() - local builtin = require("telescope.builtin") - local utils = require("telescope.utils") - builtin.find_files({ cwd = utils.buffer_dir() }) -end - -_G.live_grep = function(search_dirs) - require("telescope.builtin").live_grep({ - search_dirs = search_dirs, - }) -end - -_G.live_grep_cword = function(search_dirs) - require("telescope.builtin").live_grep({ search_dirs = search_dirs }) + local builtin = require("telescope.builtin") + local utils = require("telescope.utils") + builtin.find_files({ cwd = utils.buffer_dir() }) end local function exe(cmd) - return vim.split(vim.fn.system(cmd), "\n") + return vim.split(vim.fn.system(cmd), "\n") end local function fig_modified() - return exe("chg pstatus -ma -n --no-status --template= | sort") + return exe("chg pstatus -ma -n --no-status --template= | sort") end local function fig_all_modified() - return exe("chg status -ma -n --rev p4base --no-status --template= | sort") + return exe("chg status -ma -n --rev p4base --no-status --template= | sort") end -- stylua: ignore local keys = { - { "e", ":lua search_cwd()", desc = "Find Files in Buffer Directory" }, - { "ts", require('telescope.builtin').live_grep }, + { "e", ":lua search_cwd()", desc = "Find Files in Buffer Directory" }, { "tb", ":Telescope buffers" }, - { "TS", function() require('telescope.builtin').live_grep { default_text = vim.fn.expand("") } end, }, + -- { "ts", require('telescope.builtin').live_grep }, + -- { "TS", function() require('telescope.builtin').live_grep { default_text = vim.fn.expand("") } end, }, { "t.", function() @@ -61,8 +51,8 @@ local keys = { } if use_google() then - local find_files = require("telescope.builtin").find_files - local cs_query = require("telescope").extensions.codesearch.find_query + local find_files = require("telescope.builtin").find_files + local cs_query = require("telescope").extensions.codesearch.find_query -- stylua: ignore TableConcat(keys, { { "tm", function() find_files({ search_dirs = fig_modified() }) end, desc = "list modified Fig files." }, @@ -77,144 +67,167 @@ if use_google() then end return { - { - "aznhe21/actions-preview.nvim", - config = function() - require("actions-preview").setup({ - telescope = { - sorting_strategy = "ascending", - layout_strategy = "vertical", - layout_config = { - width = 0.8, - height = 0.9, - prompt_position = "top", - preview_cutoff = 20, - preview_height = function(_, _, max_lines) - return max_lines - 15 - end, - }, - }, - }) - end, - keys = { - { "?", "lua require('actions-preview').code_actions()" }, - }, - }, - { - "smartpde/telescope-recent-files", - config = function() - require("telescope").load_extension("recent_files") - end, - keys = { - { "to", [[lua require('telescope').extensions.recent_files.pick()]] }, - }, - }, - { - "piersolenski/telescope-import.nvim", - dependencies = "nvim-telescope/telescope.nvim", - config = function() - require("telescope").load_extension("import") - end, - keys = function() - if not use_google() then - return { - { "i", ":Telescope import" }, - } - end - end, - }, - { - "nvim-telescope/telescope.nvim", - dependencies = { - "mfussenegger/nvim-dap", - "smartpde/telescope-recent-files", - "rcarriga/nvim-dap-ui", - }, - config = function() - require("telescope").setup({ - defaults = { - -- The vertical layout strategy is good to handle long paths like those in - -- google3 repos because you have nearly the full screen to display a file path. - -- The caveat is that the preview area is smaller. - layout_strategy = "vertical", - -- Common paths in google3 repos are collapsed following the example of Cider - -- It is nice to keep this as a user config rather than part of - -- telescope-codesearch because it can be reused by other telescope pickers. - path_display = function(opts, path) - -- Do common substitutions - path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1) - path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1) - path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1) - path = path:gsub("^google3/third_party/", "//3p/", 1) - path = path:gsub("^google3/", "//", 1) + { + "aznhe21/actions-preview.nvim", + config = function() + require("actions-preview").setup({ + telescope = { + sorting_strategy = "ascending", + layout_strategy = "vertical", + layout_config = { + width = 0.8, + height = 0.9, + prompt_position = "top", + preview_cutoff = 20, + preview_height = function(_, _, max_lines) + return max_lines - 15 + end, + }, + }, + }) + end, + keys = { + { "?", "lua require('actions-preview').code_actions()" }, + }, + }, + { + "smartpde/telescope-recent-files", + config = function() + require("telescope").load_extension("recent_files") + end, + keys = { + { "to", [[lua require('telescope').extensions.recent_files.pick()]] }, + }, + }, + { + "piersolenski/telescope-import.nvim", + dependencies = "nvim-telescope/telescope.nvim", + config = function() + require("telescope").load_extension("import") + end, + keys = function() + if not use_google() then + return { + { "i", ":Telescope import" }, + } + end + end, + }, + { + "nvim-telescope/telescope-live-grep-args.nvim", + keys = { + { + "ts", + function() + require("telescope").extensions.live_grep_args.live_grep_args() + end, + }, + { + "TS", + function() + require("telescope").extensions.live_grep_args.live_grep_args({ + default_text = vim.fn.expand(""), + }) + end, + }, + }, + config = function() + require("telescope").load_extension("live_grep_args") + end, + }, + { + "nvim-telescope/telescope.nvim", + dependencies = { + "nvim-telescope/telescope-live-grep-args.nvim", + "mfussenegger/nvim-dap", + "smartpde/telescope-recent-files", + "rcarriga/nvim-dap-ui", + }, + config = function() + require("telescope").setup({ + defaults = { + -- The vertical layout strategy is good to handle long paths like those in + -- google3 repos because you have nearly the full screen to display a file path. + -- The caveat is that the preview area is smaller. + layout_strategy = "vertical", + -- Common paths in google3 repos are collapsed following the example of Cider + -- It is nice to keep this as a user config rather than part of + -- telescope-codesearch because it can be reused by other telescope pickers. + path_display = function(opts, path) + -- Do common substitutions + path = path:gsub("^/google/src/cloud/[^/]+/[^/]+/google3/", "google3/", 1) + path = path:gsub("^google3/java/com/google/", "//j/c/g/", 1) + path = path:gsub("^google3/javatests/com/google/", "//jt/c/g/", 1) + path = path:gsub("^google3/third_party/", "//3p/", 1) + path = path:gsub("^google3/", "//", 1) - -- Do truncation. This allows us to combine our custom display formatter - -- with the built-in truncation. - -- `truncate` handler in transform_path memoizes computed truncation length in opts.__length. - -- Here we are manually propagating this value between new_opts and opts. - -- We can make this cleaner and more complicated using metatables :) - local new_opts = { - path_display = { - truncate = true, - }, - __length = opts.__length, - } - path = require("telescope.utils").transform_path(new_opts, path) - opts.__length = new_opts.__length - return path - end, - mappings = { - n = { - [""] = "close", - [""] = "close", - }, - i = { - -- [""] = function(bufnr) - -- require("telescope.actions.set").edit(bufnr, "tab drop") - -- end, - [""] = "close", - [""] = "close", - [""] = "cycle_history_next", - [""] = "cycle_history_prev", - }, - }, - }, - extensions = { - codesearch = { - experimental = true, -- enable results from google3/experimental - }, - recent_files = { - -- This function rewrites all file paths to the current workspace. - -- For example, if w2 is the current workspace, then - -- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc, - transform_file_path = function(path) - local neocitc = require("neocitc") - local path_func = neocitc.path_in_current_workspace_or_head - or neocitc.path_in_current_workspace - return path_func(path) - end, - -- This is a useful option to speed up Telescope by avoiding the check - -- for file existence. - stat_files = false, - -- Ignore common patterns that can show up from other google plugins - ignore_patterns = { - "/%.git/COMMIT_EDITING$", - "/%.git/COMMIT_EDITMSG$", - "/%.git/MERGE_MSG$", - "^/tmp/%.pipertmp-", - "/Related_Files$", - "^term:", - ";#toggleterm#", - }, - }, - persisted = {}, - import = { - -- Add imports to the top of the file keeping the cursor in place - insert_at_top = true, - }, - }, - }) - end, - keys = keys, - }, + -- Do truncation. This allows us to combine our custom display formatter + -- with the built-in truncation. + -- `truncate` handler in transform_path memoizes computed truncation length in opts.__length. + -- Here we are manually propagating this value between new_opts and opts. + -- We can make this cleaner and more complicated using metatables :) + local new_opts = { + path_display = { + truncate = true, + }, + __length = opts.__length, + } + path = require("telescope.utils").transform_path(new_opts, path) + opts.__length = new_opts.__length + return path + end, + mappings = { + n = { + [""] = "close", + [""] = "close", + }, + i = { + -- [""] = function(bufnr) + -- require("telescope.actions.set").edit(bufnr, "tab drop") + -- end, + [""] = "close", + [""] = "close", + [""] = "cycle_history_next", + [""] = "cycle_history_prev", + }, + }, + }, + extensions = { + codesearch = { + experimental = true, -- enable results from google3/experimental + }, + recent_files = { + -- This function rewrites all file paths to the current workspace. + -- For example, if w2 is the current workspace, then + -- /google/.../w1/google3/my_file.cc becomes /google/.../w2/google3/my_file.cc, + transform_file_path = function(path) + local neocitc = require("neocitc") + local path_func = neocitc.path_in_current_workspace_or_head + or neocitc.path_in_current_workspace + return path_func(path) + end, + -- This is a useful option to speed up Telescope by avoiding the check + -- for file existence. + stat_files = false, + -- Ignore common patterns that can show up from other google plugins + ignore_patterns = { + "/%.git/COMMIT_EDITING$", + "/%.git/COMMIT_EDITMSG$", + "/%.git/MERGE_MSG$", + "^/tmp/%.pipertmp-", + "/Related_Files$", + "^term:", + ";#toggleterm#", + }, + }, + persisted = {}, + import = { + -- Add imports to the top of the file keeping the cursor in place + insert_at_top = true, + }, + }, + }) + end, + keys = keys, + }, } diff --git a/vim/.vim/lua/plugins/themes-personal.lua b/vim/.vim/lua/plugins/themes-personal.lua index 3ab17b7..437c611 100644 --- a/vim/.vim/lua/plugins/themes-personal.lua +++ b/vim/.vim/lua/plugins/themes-personal.lua @@ -1,6 +1,19 @@ local use_google = require("utils").use_google return { + { + "squk/ableton.nvim", + lazy = false, + cond = not use_google(), + priority = 1000, + dir = "~/neovim-plugins/squk/ableton.nvim", + opts = { + variant = "cooler", + }, + config = function() + vim.cmd("colorscheme ableton") + end, + }, { "dgox16/oldworld.nvim", lazy = false, @@ -10,7 +23,7 @@ return { variant = "cooler", }, config = function() - vim.cmd("colorscheme oldworld") + -- vim.cmd("colorscheme oldworld") end, }, {