From 1b189d0b0a2eefcc8d7a1fa7b3cb251305dfff85 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Mon, 25 Nov 2024 15:19:45 +1030 Subject: [PATCH] bye bye old config --- .config/nvim/lua/chris/alpha.lua | 45 ---- .config/nvim/lua/chris/autocmd.lua | 72 ----- .config/nvim/lua/chris/autopairs.lua | 17 -- .config/nvim/lua/chris/bufferline.lua | 77 ------ .config/nvim/lua/chris/cmp.lua | 200 -------------- .config/nvim/lua/chris/colorizer.lua | 6 - .config/nvim/lua/chris/colorscheme.lua | 12 - .config/nvim/lua/chris/comment.lua | 6 - .config/nvim/lua/chris/cybu.lua | 28 -- .config/nvim/lua/chris/dap.lua | 133 ---------- .config/nvim/lua/chris/dial.lua | 67 ----- .config/nvim/lua/chris/dressing.lua | 105 -------- .config/nvim/lua/chris/fidget.lua | 6 - .config/nvim/lua/chris/functions.lua | 67 ----- .config/nvim/lua/chris/gitsigns.lua | 48 ---- .config/nvim/lua/chris/harpoon.lua | 11 - .config/nvim/lua/chris/icons.lua | 116 --------- .config/nvim/lua/chris/impatient.lua | 6 - .config/nvim/lua/chris/indentline.lua | 27 -- .config/nvim/lua/chris/init.lua | 38 --- .config/nvim/lua/chris/keymaps.lua | 50 ---- .config/nvim/lua/chris/lsp/handlers.lua | 126 --------- .config/nvim/lua/chris/lsp/init.lua | 22 -- .config/nvim/lua/chris/lsp/mason.lua | 121 --------- .config/nvim/lua/chris/lsp/null-ls.lua | 64 ----- .../nvim/lua/chris/lsp/settings/clangd.lua | 3 - .../nvim/lua/chris/lsp/settings/emmet_ls.lua | 25 -- .../nvim/lua/chris/lsp/settings/omnisharp.lua | 38 --- .config/nvim/lua/chris/lsp/settings/rust.lua | 126 --------- .../lua/chris/lsp/settings/shellcheck.lua | 1 - .../lua/chris/lsp/settings/sumneko_lua.lua | 43 --- .../nvim/lua/chris/lsp/settings/tsserver.lua | 15 -- .../nvim/lua/chris/lsp/settings/yamlls.lua | 8 - .config/nvim/lua/chris/lspsaga.lua | 10 - .config/nvim/lua/chris/lualine.lua | 113 -------- .config/nvim/lua/chris/navic.lua | 43 --- .config/nvim/lua/chris/neogen.lua | 10 - .config/nvim/lua/chris/noice.lua | 195 -------------- .config/nvim/lua/chris/notify.lua | 53 ---- .config/nvim/lua/chris/numb.lua | 8 - .config/nvim/lua/chris/nvim-tree.lua | 117 --------- .config/nvim/lua/chris/options.lua | 60 ----- .config/nvim/lua/chris/plugins.lua | 165 ------------ .config/nvim/lua/chris/spectre.lua | 135 ---------- .config/nvim/lua/chris/symbols-outline.lua | 50 ---- .config/nvim/lua/chris/telescope.lua | 128 --------- .config/nvim/lua/chris/todo-comments.lua | 58 ----- .config/nvim/lua/chris/treesitter.lua | 111 -------- .config/nvim/lua/chris/whichkey.lua | 246 ------------------ .config/nvim/lua/chris/winbar.lua | 40 --- .config/nvim/lua/chris/zen-mode.lua | 40 --- .config/nvim/lua/lazyvim/plugins/lsp/init.lua | 1 - .config/nvim/lua/lazyvim/plugins/utility.lua | 3 - .config/nvim/lua/lazyvim/plugins/zk.lua | 52 ++-- 54 files changed, 26 insertions(+), 3341 deletions(-) delete mode 100644 .config/nvim/lua/chris/alpha.lua delete mode 100644 .config/nvim/lua/chris/autocmd.lua delete mode 100644 .config/nvim/lua/chris/autopairs.lua delete mode 100644 .config/nvim/lua/chris/bufferline.lua delete mode 100644 .config/nvim/lua/chris/cmp.lua delete mode 100644 .config/nvim/lua/chris/colorizer.lua delete mode 100644 .config/nvim/lua/chris/colorscheme.lua delete mode 100644 .config/nvim/lua/chris/comment.lua delete mode 100644 .config/nvim/lua/chris/cybu.lua delete mode 100644 .config/nvim/lua/chris/dap.lua delete mode 100644 .config/nvim/lua/chris/dial.lua delete mode 100644 .config/nvim/lua/chris/dressing.lua delete mode 100644 .config/nvim/lua/chris/fidget.lua delete mode 100644 .config/nvim/lua/chris/functions.lua delete mode 100644 .config/nvim/lua/chris/gitsigns.lua delete mode 100644 .config/nvim/lua/chris/harpoon.lua delete mode 100644 .config/nvim/lua/chris/icons.lua delete mode 100644 .config/nvim/lua/chris/impatient.lua delete mode 100644 .config/nvim/lua/chris/indentline.lua delete mode 100644 .config/nvim/lua/chris/init.lua delete mode 100644 .config/nvim/lua/chris/keymaps.lua delete mode 100644 .config/nvim/lua/chris/lsp/handlers.lua delete mode 100644 .config/nvim/lua/chris/lsp/init.lua delete mode 100644 .config/nvim/lua/chris/lsp/mason.lua delete mode 100644 .config/nvim/lua/chris/lsp/null-ls.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/clangd.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/emmet_ls.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/omnisharp.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/rust.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/shellcheck.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/sumneko_lua.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/tsserver.lua delete mode 100644 .config/nvim/lua/chris/lsp/settings/yamlls.lua delete mode 100644 .config/nvim/lua/chris/lspsaga.lua delete mode 100644 .config/nvim/lua/chris/lualine.lua delete mode 100644 .config/nvim/lua/chris/navic.lua delete mode 100644 .config/nvim/lua/chris/neogen.lua delete mode 100644 .config/nvim/lua/chris/noice.lua delete mode 100644 .config/nvim/lua/chris/notify.lua delete mode 100644 .config/nvim/lua/chris/numb.lua delete mode 100644 .config/nvim/lua/chris/nvim-tree.lua delete mode 100644 .config/nvim/lua/chris/options.lua delete mode 100644 .config/nvim/lua/chris/plugins.lua delete mode 100644 .config/nvim/lua/chris/spectre.lua delete mode 100644 .config/nvim/lua/chris/symbols-outline.lua delete mode 100644 .config/nvim/lua/chris/telescope.lua delete mode 100644 .config/nvim/lua/chris/todo-comments.lua delete mode 100644 .config/nvim/lua/chris/treesitter.lua delete mode 100644 .config/nvim/lua/chris/whichkey.lua delete mode 100644 .config/nvim/lua/chris/winbar.lua delete mode 100644 .config/nvim/lua/chris/zen-mode.lua diff --git a/.config/nvim/lua/chris/alpha.lua b/.config/nvim/lua/chris/alpha.lua deleted file mode 100644 index 6ef425a..0000000 --- a/.config/nvim/lua/chris/alpha.lua +++ /dev/null @@ -1,45 +0,0 @@ -local s_ok, alpha = pcall(require, "alpha") -if not s_ok then - return -end - -local dashboard = require"alpha.themes.dashboard" - -local function button(sc, txt, key, key_opts) - local b = dashboard.button(sc, txt, key, key_opts) - b.opts.hl_shortcut = "Macro" - return b -end - -local icons = require"chris.icons" - -dashboard.section.header.val = { -[[ , __ ___ __. _ __ ` , _ , _ ]], -[[ |' `. .' ` .' \ | / | |' `|' `.]], -[[ | | |----' | | ` / | | | |]], -[[ / | `.___, `._.' \/ / / ' /]], -} - -dashboard.section.buttons.val = { - button("f", icons.documents.Files .. " Find file", ":Telescope find_files "), - button("e", icons.ui.NewFile .. " New file", ":ene startinsert "), - button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles "), - button("t", icons.ui.List .. " Find text", ":Telescope live_grep "), - button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua "), - button("u", icons.ui.CloudDownload .. " Update", ":PackerSync"), - button("q", icons.ui.SignOut .. " Quit", ":qa"), -} - -dashboard.section.footer.val = { - [[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]], - [[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]], - [[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]], -} - -dashboard.section.header.opts.hl = "Include" -dashboard.section.buttons.opts.hl = "Macro" -dashboard.section.footer.opts.hl = "Type" - -dashboard.opts.opts.noautocmd = true - -alpha.setup(dashboard.opts) diff --git a/.config/nvim/lua/chris/autocmd.lua b/.config/nvim/lua/chris/autocmd.lua deleted file mode 100644 index 3ac61c5..0000000 --- a/.config/nvim/lua/chris/autocmd.lua +++ /dev/null @@ -1,72 +0,0 @@ -vim.api.nvim_create_autocmd({ "User" }, { - pattern = { "AlphaReady" }, - callback = function() - vim.cmd([[ - set laststatus=0 | autocmd BufUnload set laststatus=3 - ]]) - end, -}) - -vim.api.nvim_create_autocmd({ "BufEnter" }, { - pattern = { "term://*" }, - callback = function() - vim.cmd("startinsert!") - vim.cmd("set cmdheight=1") - end, -}) - -vim.api.nvim_create_autocmd({ "VimResized" }, { - callback = function() - vim.cmd("tabdo wincmd =") - end, -}) - -vim.api.nvim_create_autocmd({ "CmdWinEnter" }, { - callback = function() - vim.cmd("quit") - end, -}) - -vim.api.nvim_create_autocmd({ "BufWinEnter" }, { - callback = function() - vim.cmd("set formatoptions-=cro") - end, -}) - -vim.api.nvim_create_autocmd({ "TextYankPost" }, { - callback = function() - vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) - end, -}) - -vim.api.nvim_create_autocmd({ "VimEnter" }, { - callback = function() - vim.cmd("hi link illuminatedWord LspReferenceText") - end, -}) - --- Prevent auto comment on next line -vim.cmd([[autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o]]) - --- Set filetype to tex for .tex files? -vim.cmd([[autocmd BufRead,BufNewFile *.tex set filetype=tex]]) - --- Trim whitespace from files on save -vim.cmd [[ -autocmd BufWritePre * let currPos = getpos(".") -autocmd BufWritePre * %s/\s\+$//e -autocmd BufWritePre * %s/\n\+\%$//e -autocmd BufWritePre *.[ch] %s/\%$/\r/e -autocmd BufWritePre * cal cursor(currPos[1], currPos[2]) -]] - --- Recompile and restart Xmonad on save of config file for Xmonad or Xmobar -vim.cmd([[autocmd BufWritePost ~/.xmonad/xmonad.hs,~/.config/xmobar/xmobar-main.hs,~/.config/xmobar/xmobar-sub.hs,~/.config/xmobar/xmobar-single.hs !xmonad --recompile && xmonad --restart]]) - --- Run custom textclear command when exiting a .tex file (cleanup files) -vim.cmd([[autocmd VimLeave *.tex !texclear %]]) - --- Run install when editing my scripts -vim.cmd([[ -autocmd BufWritePost ~/repos/inks-scripts/scripts/** !~/repos/inks-scripts/install -]]) diff --git a/.config/nvim/lua/chris/autopairs.lua b/.config/nvim/lua/chris/autopairs.lua deleted file mode 100644 index c16c1d3..0000000 --- a/.config/nvim/lua/chris/autopairs.lua +++ /dev/null @@ -1,17 +0,0 @@ -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup { - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - ignored_next_char = "[%w%.*]", -- don't place autopairs when cursor sits infront of any character. -} - -local cmp_autopairs = require "nvim-autopairs.completion.cmp" -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) diff --git a/.config/nvim/lua/chris/bufferline.lua b/.config/nvim/lua/chris/bufferline.lua deleted file mode 100644 index ac1ee5d..0000000 --- a/.config/nvim/lua/chris/bufferline.lua +++ /dev/null @@ -1,77 +0,0 @@ -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup { - options = { - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" - left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions" - middle_mouse_command = nil, -- can be a string | function, see "Mouse actions" - -- NOTE: this plugin is designed with this icon in mind, - -- and so changing this is NOT recommended, this is intended - -- as an escape hatch for people who cannot bear it for whatever reason - indicator = { - icon = " ﯦ", - }, - -- indicator_icon = "▎", - buffer_close_icon = "", - -- buffer_close_icon = '', - modified_icon = "●", - close_icon = "", - -- close_icon = '', - left_trunc_marker = "", - right_trunc_marker = "", - --- name_formatter can be used to change the buffer's label in the bufferline. - --- Please note some names can/will break the - --- bufferline so use this at your discretion knowing that it has - --- some limitations that will *NOT* be fixed. - -- name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr" - -- -- remove extension from markdown files for example - -- if buf.name:match('%.md') then - -- return vim.fn.fnamemodify(buf.name, ':t:r') - -- end - -- end, - max_name_length = 30, - max_prefix_length = 30, -- prefix used when a buffer is de-duplicated - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - -- diagnostics_indicator = function(count, level, diagnostics_dict, context) - -- return "("..count..")" - -- end, - -- NOTE: this will be called a lot so don't do any heavy processing here - -- custom_filter = function(buf_number) - -- -- filter out filetypes you don't want to see - -- if vim.bo[buf_number].filetype ~= "" then - -- return true - -- end - -- -- filter out by buffer name - -- if vim.fn.bufname(buf_number) ~= "" then - -- return true - -- end - -- -- filter out based on arbitrary rules - -- -- e.g. filter out vim wiki buffer from tabline in your work repo - -- if vim.fn.getcwd() == "" and vim.bo[buf_number].filetype ~= "wiki" then - -- return true - -- end - -- end, - offsets = { { filetype = "NvimTree", text = "", padding = 1 } }, - show_buffer_icons = true, - show_buffer_close_icons = true, - show_close_icon = true, - show_tab_indicators = true, - persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - -- can also be a table containing 2 custom separators - -- [focused and unfocused]. eg: { '|', '|' } - separator_style = "thin", -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - -- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b) - -- -- add custom logic - -- return buffer_a.modified > buffer_b.modified - -- end - }, -} diff --git a/.config/nvim/lua/chris/cmp.lua b/.config/nvim/lua/chris/cmp.lua deleted file mode 100644 index 941c724..0000000 --- a/.config/nvim/lua/chris/cmp.lua +++ /dev/null @@ -1,200 +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 - -local buffer_fts = { - "markdown", - "toml", - "yaml", - "json", -} - -local function contains(t, value) - for _, v in pairs(t) do - if v == value then - return true - end - end - return false -end - -local compare = require("cmp.config.compare") - -require("luasnip/loaders/from_vscode").lazy_load() - -local check_backspace = function() - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil -end - -local icons = require("chris.icons") - -local kind_icons = icons.kind - --- I don't have most of the following but they can serve as future examples -vim.g.cmp_active = true - -cmp.setup({ - enabled = function() - local buftype = vim.api.nvim_buf_get_option(0, "buftype") - if buftype == "prompt" then - return false - end - return vim.g.cmp_active - end, - preselect = cmp.PreselectMode.None, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) -- For `luasnip` users. - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - [""] = 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(), - }), - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [""] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - [""] = 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.confirm({ select = true }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.jumpable(1) then - luasnip.jump(1) - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif luasnip.expandable() then - luasnip.expand() - elseif check_backspace() then - -- cmp.complete() - 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 = kind_icons[vim_item.kind] - - if entry.source.name == "lab.quick_data" then - vim_item.kind = icons.misc.CircuitBoard - vim_item.kind_hl_group = "CmpItemKindConstant" - end - - -- NOTE: order matters - vim_item.menu = ({ - nvim_lsp = "[LSP]", - nvim_lua = "[LUA]", - luasnip = "[SNP]", - buffer = "[BUF]", - path = "[PTH]", - })[entry.source.name] - return vim_item - end, - }, - sources = { - { - name = "nvim_lsp", - filter = function(entry, ctx) - local kind = require("cmp.types.lsp").CompletionItemKind[entry:get_kind()] - if kind == "Snippet" and ctx.prev_context.filetype == "java" then - return true - end - - if kind == "Text" then - return true - end - end, - group_index = 2, - }, - { name = "nvim_lua", group_index = 2 }, - { name = "luasnip", group_index = 2 }, - { - name = "buffer", - group_index = 2, - filter = function(entry, ctx) - if not contains(buffer_fts, ctx.prev_context.filetype) then - return true - end - end, - }, - { name = "path", group_index = 2 }, - { name = "lab.quick_data", keyword_length = 4, group_index = 2 }, - }, - sorting = { - priority_weight = 2, - comparators = { - compare.offset, - compare.exact, - -- compare.scopes, - compare.score, - compare.recently_used, - compare.locality, - -- compare.kind, - compare.sort_text, - compare.length, - compare.order, - }, - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - window = { - documentation = false, - completion = { - border = "rounded", - winhighlight = "NormalFloat:Pmenu,NormalFloat:Pmenu,CursorLine:PmenuSel,Search:None", - }, - }, - experimental = { - ghost_text = true, - }, -}) diff --git a/.config/nvim/lua/chris/colorizer.lua b/.config/nvim/lua/chris/colorizer.lua deleted file mode 100644 index 17c3ecd..0000000 --- a/.config/nvim/lua/chris/colorizer.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, colorizer = pcall(require, "colorizer") -if not status_ok then - return -end - -colorizer.setup() diff --git a/.config/nvim/lua/chris/colorscheme.lua b/.config/nvim/lua/chris/colorscheme.lua deleted file mode 100644 index 2031380..0000000 --- a/.config/nvim/lua/chris/colorscheme.lua +++ /dev/null @@ -1,12 +0,0 @@ -local colorscheme = "base16-gruvbox-dark-medium" - -local s_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme) - -if not s_ok then - vim.notify("Colorscheme" .. colorscheme .. " not found!") - return -end - --- For transperant background --- vim.api.nvim_set_hl(0, "Normal", { bg = "none"}) --- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none"}) diff --git a/.config/nvim/lua/chris/comment.lua b/.config/nvim/lua/chris/comment.lua deleted file mode 100644 index fa16f91..0000000 --- a/.config/nvim/lua/chris/comment.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup {} diff --git a/.config/nvim/lua/chris/cybu.lua b/.config/nvim/lua/chris/cybu.lua deleted file mode 100644 index b1b2e9f..0000000 --- a/.config/nvim/lua/chris/cybu.lua +++ /dev/null @@ -1,28 +0,0 @@ -local ok, cybu = pcall(require, "cybu") -if not ok then - return -end -cybu.setup { - position = { - relative_to = "win", -- win, editor, cursor - anchor = "topright", -- topleft, topcenter, topright, - -- centerleft, center, centerright, - -- bottomleft, bottomcenter, bottomright - -- vertical_offset = 10, -- vertical offset from anchor in lines - -- horizontal_offset = 0, -- vertical offset from anchor in columns - -- max_win_height = 5, -- height of cybu window in lines - -- max_win_width = 0.5, -- integer for absolute in columns - -- float for relative to win/editor width - }, - display_time = 1750, -- time the cybu window is displayed - style = { - separator = " ", -- string used as separator - prefix = "…", -- string used as prefix for truncated paths - padding = 1, -- left & right padding in number of spaces - hide_buffer_id = true, - devicons = { - enabled = true, -- enable or disable web dev icons - colored = true, -- enable color for web dev icons - }, - }, -} diff --git a/.config/nvim/lua/chris/dap.lua b/.config/nvim/lua/chris/dap.lua deleted file mode 100644 index 1453cb7..0000000 --- a/.config/nvim/lua/chris/dap.lua +++ /dev/null @@ -1,133 +0,0 @@ -local dap_status_ok, dap = pcall(require, "dap") -if not dap_status_ok then - print("error requiring dap") - return -end - -local dap_ui_status_ok, dapui = pcall(require, "dapui") -if not dap_ui_status_ok then - print("error requiring dapui") - return -end - --- dapui.setup() -dapui.setup({ - icons = { expanded = "▾", collapsed = "▸" }, - mappings = { - -- Use a table to apply multiple mappings - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - edit = "e", - repl = "r", - toggle = "t", - }, - -- Expand lines larger than the window - -- Requires >= 0.7 - expand_lines = vim.fn.has("nvim-0.7"), - -- Layouts define sections of the screen to place windows. - -- The position can be "left", "right", "top" or "bottom". - -- The size specifies the height/width depending on position. It can be an Int - -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while - -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) - -- Elements are the elements shown in the layout (in order). - -- Layouts are opened in order so that earlier layouts take priority in window sizing. - layouts = { - { - elements = { - -- Elements can be strings or table with id and size keys. - { id = "scopes", size = 0.25 }, - "breakpoints", - -- "stacks", - -- "watches", - }, - size = 40, -- 40 columns - position = "right", - }, - { - elements = { - "repl", - "console", - }, - size = 0.25, -- 25% of total lines - position = "bottom", - }, - }, - floating = { - max_height = nil, -- These can be integers or a float between 0 and 1. - max_width = nil, -- Floats will be treated as percentage of your screen. - border = "single", -- Border style. Can be "single", "double" or "rounded" - mappings = { - close = { "q", "" }, - }, - }, - windows = { indent = 1 }, - render = { - max_type_length = nil, -- Can be integer or nil. - }, -}) - -local icons = require("chris.icons") - -vim.fn.sign_define("DapBreakpoint", { text = icons.ui.Bug, texthl = "DiagnosticSignError", linehl = "", numhl = "" }) - -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 - --- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#Dotnet -dap.adapters.coreclr = { - type = 'executable', - command = 'netcoredbg', - args = {'--interpreter=vscode'} -} - -dap.configurations.cs = { - { - type = "coreclr", - name = "launch - netcoredbg", - request = "launch", - program = function() - return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file') - end, - }, -} - --- https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation#Javascript-chrome -dap.adapters.chrome = { - type = "executable", - command = "node", - args = {"/home/solomon/repos/vscode-chrome-debug/out/src/chromeDebug.js"} -} - -dap.configurations.javascript = { -- change this to javascriptreact if needed - { - type = "chrome", - request = "attach", - program = "${file}", - cwd = vim.fn.getcwd(), - sourceMaps = true, - protocol = "inspector", - port = 9222, - webRoot = "${workspaceFolder}" - } -} - -dap.configurations.typescript = { -- change to typescriptreact if needed - { - type = "chrome", - request = "attach", - program = "${file}", - cwd = vim.fn.getcwd(), - sourceMaps = true, - protocol = "inspector", - port = 9222, - webRoot = "${workspaceFolder}" - } -} diff --git a/.config/nvim/lua/chris/dial.lua b/.config/nvim/lua/chris/dial.lua deleted file mode 100644 index a561734..0000000 --- a/.config/nvim/lua/chris/dial.lua +++ /dev/null @@ -1,67 +0,0 @@ -local status_ok, dial_config = pcall(require, "dial.config") -if not status_ok then - return -end - -local y = "2024/05/29" - -local augend = require "dial.augend" -dial_config.augends:register_group { - default = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.date.alias["%Y/%m/%d"], - }, - typescript = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.constant.new { elements = { "let", "const" } }, - }, - visual = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.date.alias["%Y/%m/%d"], - augend.constant.alias.alpha, - augend.constant.alias.Alpha, - }, - mygroup = { - augend.constant.new { - elements = { "and", "or" }, - word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. - cyclic = true, -- "or" is incremented into "and". - }, - augend.constant.new { - elements = { "True", "False" }, - word = true, - cyclic = true, - }, - augend.constant.new { - elements = { "public", "private" }, - word = true, - cyclic = true, - }, - augend.constant.new { - elements = { "&&", "||" }, - word = false, - cyclic = true, - }, - augend.date.alias["%d/%m/%Y"], -- date (02/19/2022, etc.) - augend.constant.alias.bool, -- boolean value (true <-> false) - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.semver.alias.semver - }, -} - -local map = require "dial.map" - --- change augends in VISUAL mode -vim.api.nvim_set_keymap("n", "", map.inc_normal "mygroup", { noremap = true }) -vim.api.nvim_set_keymap("n", "", map.dec_normal "mygroup", { noremap = true }) -vim.api.nvim_set_keymap("v", "", map.inc_normal "visual", { noremap = true }) -vim.api.nvim_set_keymap("v", "", map.dec_normal "visual", { noremap = true }) - -vim.cmd [[ - " enable only for specific FileType - autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").inc_normal("typescript"), {noremap = true}) -]] diff --git a/.config/nvim/lua/chris/dressing.lua b/.config/nvim/lua/chris/dressing.lua deleted file mode 100644 index 1ad1fa0..0000000 --- a/.config/nvim/lua/chris/dressing.lua +++ /dev/null @@ -1,105 +0,0 @@ -local status_ok, dressing = pcall(require, "dressing") -if not status_ok then - return -end - -dressing.setup { - input = { - -- Set to false to disable the vim.ui.input implementation - enabled = true, - - -- Default prompt string - default_prompt = "Input:", - - -- Can be 'left', 'right', or 'center' - prompt_align = "left", - - -- When true, will close the modal - insert_only = true, - - -- These are passed to nvim_open_win - anchor = "SW", - -- 'editor' and 'win' will default to being centered - relative = "cursor", - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - prefer_width = 40, - width = nil, - -- min_width and max_width can be a list of mixed types. - -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" - max_width = { 140, 0.9 }, - min_width = { 20, 0.2 }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - - -- see :help dressing_get_config - get_config = nil, - }, - select = { - -- Set to false to disable the vim.ui.select implementation - enabled = true, - - -- Priority list of preferred vim.select implementations - -- backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, - backend = { "builtin", "telescope", "nui" }, - - -- Trim trailing `:` from prompt - trim_prompt = true, - - -- Options for telescope selector - -- These are passed into the telescope picker directly. Can be used like: - -- telescope = require('telescope.themes').get_ivy({...}) - telescope = nil, - - -- Options for nui Menu - nui = { - position = "50%", - size = nil, - relative = "editor", - border = { - }, - buf_options = { - swapfile = false, - filetype = "DressingSelect", - }, - max_width = 80, - max_height = 40, - min_width = 40, - min_height = 10, - }, - - -- Options for built-in selector - builtin = { - -- These are passed to nvim_open_win - anchor = "NW", - -- 'editor' and 'win' will default to being centered - relative = "editor", - - -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- the min_ and max_ options can be a list of mixed types. - -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" - width = nil, - max_width = { 140, 0.8 }, - min_width = { 40, 0.2 }, - height = nil, - max_height = 0.9, - min_height = { 10, 0.2 }, - - override = function(conf) - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - return conf - end, - }, - - -- Used to override format_item. See :help dressing-format - format_item_override = {}, - - -- see :help dressing_get_config - get_config = nil, - }, -} diff --git a/.config/nvim/lua/chris/fidget.lua b/.config/nvim/lua/chris/fidget.lua deleted file mode 100644 index 2f8ad8c..0000000 --- a/.config/nvim/lua/chris/fidget.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, fidget = pcall(require, "fidget") -if not status_ok then - return -end - -fidget.setup() diff --git a/.config/nvim/lua/chris/functions.lua b/.config/nvim/lua/chris/functions.lua deleted file mode 100644 index e457a52..0000000 --- a/.config/nvim/lua/chris/functions.lua +++ /dev/null @@ -1,67 +0,0 @@ -local M = {} - -function M.get_word_length() - local word = vim.fn.expand "" - return #word -end - -function M.toggle_option(option) - local value = not vim.api.nvim_get_option_value(option, {}) - vim.opt[option] = value - vim.notify(option .. " set to " .. tostring(value)) -end - -function M.toggle_tabline() - local value = vim.api.nvim_get_option_value("showtabline", {}) - - if value == 2 then - value = 0 - else - value = 2 - end - - vim.opt.showtabline = value - - vim.notify("showtabline" .. " set to " .. tostring(value)) -end - -local diagnostics_active = true -function M.toggle_diagnostics() - diagnostics_active = not diagnostics_active - if diagnostics_active then - vim.diagnostic.show() - else - vim.diagnostic.hide() - end -end - -function M.isempty(s) - return s == nil or s == "" -end - -function M.get_buf_option(opt) - local status_ok, buf_option = pcall(vim.api.nvim_buf_get_option, 0, opt) - if not status_ok then - return nil - else - return buf_option - end -end - -function M.smart_quit() - local bufnr = vim.api.nvim_get_current_buf() - local modified = vim.api.nvim_buf_get_option(bufnr, "modified") - if modified then - vim.ui.input({ - prompt = "You have unsaved changes. Quit anyway? (y/n) ", - }, function(input) - if input == "y" then - vim.cmd "q!" - end - end) - else - vim.cmd "q!" - end -end - -return M diff --git a/.config/nvim/lua/chris/gitsigns.lua b/.config/nvim/lua/chris/gitsigns.lua deleted file mode 100644 index 088c9f8..0000000 --- a/.config/nvim/lua/chris/gitsigns.lua +++ /dev/null @@ -1,48 +0,0 @@ -local status_ok, gitsigns = pcall(require, "gitsigns") -if not status_ok then - return -end - -gitsigns.setup { - signs = { - add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "rounded", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { - enable = false, - }, -} diff --git a/.config/nvim/lua/chris/harpoon.lua b/.config/nvim/lua/chris/harpoon.lua deleted file mode 100644 index 3b0eaaf..0000000 --- a/.config/nvim/lua/chris/harpoon.lua +++ /dev/null @@ -1,11 +0,0 @@ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -local h_status_ok, harpoon = pcall(require, "harpoon") -if not h_status_ok then - return -end - -telescope.load_extension "harpoon" diff --git a/.config/nvim/lua/chris/icons.lua b/.config/nvim/lua/chris/icons.lua deleted file mode 100644 index f1fa05c..0000000 --- a/.config/nvim/lua/chris/icons.lua +++ /dev/null @@ -1,116 +0,0 @@ --- https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts --- go to the above and then enter u and the symbold should appear --- or go here and upload the font file: https://mathew-kurian.github.io/CharacterMap/ --- find more here: https://www.nerdfonts.com/cheat-sheet -return { - kind = { - Text = "", - -- Method = "m", - Function = "", - -- Constructor = "", - Method = "", - -- Function = "", - Constructor = "", - Field = "", - -- Variable = "", - Variable = "", - Namespace = "פּ", - Class = "", - Interface = "", - -- Module = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Key = "k", - -- Keyword = "", - Keyword = "", - -- Snippet = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", - }, - type = { - Array = "", - Number = "", - String = "", - Boolean = "蘒", - Null = "ﳠ", - Object = "", - }, - documents = { - File = "", - Files = "", - Folder = "", - OpenFolder = "", - }, - git = { - Add = "", - Mod = "", - Remove = "", - Ignore = "", - Rename = "", - Diff = "", - Repo = "", - Octoface = "", - }, - ui = { - ArrowClosed = "", - ArrowOpen = "", - Lock = "", - Circle = "", - BigCircle = "", - BigUnfilledCircle = "", - Close = "", - NewFile = "", - Search = "", - Lightbulb = "", - Project = "", - Dashboard = "", - History = "", - Comment = "", - Bug = "", - Code = "", - Telescope = "", - Gear = "", - Package = "", - List = "", - SignIn = "", - SignOut = "", - Check = "", - Fire = "", - Note = "", - BookMark = "", - Pencil = "", - -- ChevronRight = "", - ChevronRight = ">", - Table = "", - Calendar = "", - CloudDownload = "", - }, - diagnostics = { - Error = "", - Warning = "", - Information = "", - Question = "", - Hint = "", - }, - misc = { - Robot = "ﮧ", - Squirrel = "", - Tag = "", - Watch = "", - Smiley = "ﲃ", - Package = "", - CircuitBoard = "", - }, -} diff --git a/.config/nvim/lua/chris/impatient.lua b/.config/nvim/lua/chris/impatient.lua deleted file mode 100644 index 84419e0..0000000 --- a/.config/nvim/lua/chris/impatient.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end - -impatient.enable_profile() diff --git a/.config/nvim/lua/chris/indentline.lua b/.config/nvim/lua/chris/indentline.lua deleted file mode 100644 index cc73d08..0000000 --- a/.config/nvim/lua/chris/indentline.lua +++ /dev/null @@ -1,27 +0,0 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end - -vim.g.indent_blankline_buftype_exclude = { "terminal", "nofile" } -vim.g.indent_blankline_filetype_exclude = { - "help", - "startify", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "Trouble", - "text" -} -vim.g.indentLine_enabled = 1 -vim.g.indent_blankline_char = "▏" - -vim.g.indent_blankline_show_trailing_blankline_indent = false -vim.g.indent_blankline_show_first_indent_level = true -vim.g.indent_blankline_use_treesitter = false -vim.g.indent_blankline_show_current_context = true - -indent_blankline.setup { - show_current_context = true, -} diff --git a/.config/nvim/lua/chris/init.lua b/.config/nvim/lua/chris/init.lua deleted file mode 100644 index 3863a61..0000000 --- a/.config/nvim/lua/chris/init.lua +++ /dev/null @@ -1,38 +0,0 @@ --- require "chris.bufferline" -- unused --- require "chris.noice" -- unused --- require "chris.winbar" -- top bar, unused - -require "chris.impatient" -- good leading -require "chris.options" -- my options -require "chris.keymaps" -- misc keymaps not part of whichkey -require "chris.plugins" -- plugins configuration (packer) -require "chris.colorscheme" -- my choice of colorscheme -require "chris.lsp" -- lsp configuration -require "chris.alpha" -- start/home page for nvim -require "chris.autocmd" -- custom autocmds -require "chris.autopairs" -- automatically add parirs for brackens quotes etc -require "chris.cmp" -- completion configuration -require "chris.colorizer" -- highlight colors hexcodes etc -require "chris.comment" -- better commenting -require "chris.dressing" -- better ui -require "chris.dial" -- better incrementing/decrementing -require "chris.fidget" -- display lsp server progress -require "chris.functions" -- custom functions -require "chris.gitsigns" -- gitsigns integration -require "chris.harpoon" -- mark files in project and pull them too you -require "chris.indentline" -- show indentation levels for code blocks -require "chris.lualine" -- pretty and nice statusline plugin -require "chris.navic" -- lsp integrated location in code finder/printer -require "chris.notify" -- display notifications nicer -require "chris.numb" -- peek before you move :10 etc. -require "chris.nvim-tree" -- file tree, when needed. -require "chris.symbols-outline" -- navigate code symbols -require "chris.telescope" -- nice. -require "chris.todo-comments" -- highlight TODO and other related comments -require "chris.treesitter" -- magic -require "chris.whichkey" -- keymaps -require "chris.spectre" -- renaming but better -require "chris.cybu" -- cycle through current buffers -require "chris.dap" -- debugging -require "chris.lspsaga" -- bit overkill, using for code action menu -require "chris.neogen" -- annotation/doc generator diff --git a/.config/nvim/lua/chris/keymaps.lua b/.config/nvim/lua/chris/keymaps.lua deleted file mode 100644 index 235e56b..0000000 --- a/.config/nvim/lua/chris/keymaps.lua +++ /dev/null @@ -1,50 +0,0 @@ -local opts = { noremap = true, silent = true } - -local map = vim.api.nvim_set_keymap - --- set Space as leader key -map("n", "", "", opts) -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- NORMAL --- Move text up and down -map("n", "", ":m .-2==", opts) -map("n", "", ":m .+1==", opts) - --- Copy/Paste -map("n", "", '"+y', opts) -map("n", "", '"+y', opts) - --- Save -map("n", "", ":w", opts) - --- Switch between buffers -map("n", "", ":CybuNext", opts) -map("n", "", ":CybuPrev", opts) - --- center after up and down movements -map("n", "", "zz", opts) -map("n", "", "zz", opts) - --- INSERT --- Easy exit insert mode -map("i", "jk", "", opts) - --- Paste -map("i", "", '"+y', opts) - --- Save -map("i", "", ":wa", opts) - --- VISUAL --- Indenting -map("v", "<", "", ">gv", opts) - --- Move text up and down -map("v", "", ":m .+1==V", opts) -map("v", "", ":m .-2==V", opts) - --- Copy -map("v", "", '"+y', opts) diff --git a/.config/nvim/lua/chris/lsp/handlers.lua b/.config/nvim/lua/chris/lsp/handlers.lua deleted file mode 100644 index d7fac92..0000000 --- a/.config/nvim/lua/chris/lsp/handlers.lua +++ /dev/null @@ -1,126 +0,0 @@ -local M = {} - -M.capabilities = vim.lsp.protocol.make_client_capabilities() - -local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -if not status_cmp_ok then - print("cmp_nvim_lsp error!") - return -end - -M.capabilities.textDocument.completion.completionItem.snippetSupport = true -M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities) - -M.setup = function() - local icons = require("chris.icons") - local signs = { - { name = "DiagnosticSignError", text = icons.diagnostics.Error }, - { name = "DiagnosticSignWarn", text = icons.diagnostics.Warning }, - { name = "DiagnosticSignHint", text = icons.diagnostics.Hint }, - { name = "DiagnosticSignInfo", text = icons.diagnostics.Information }, - } - - for _, sign in ipairs(signs) do - vim.fn.sign_define(sign.name, { - texthl = sign.name, - text = sign.text, - numhl = "", - }) - end - - local config = { - -- disable virtual text - virtual_lines = false, - virtual_text = false, - -- show signs - signs = { - active = signs, - }, - update_in_insert = true, - underline = true, - severity_sort = true, - float = { - focusable = true, - style = "minimal", - source = "if_many", -- Or "always" - }, - } - - vim.diagnostic.config(config) -end - -local function attach_navic(client, bufnr) - vim.g.navic_silence = false - local status_ok, navic = pcall(require, "nvim-navic") - if not status_ok then - print("nvim-navic error!") - return - end - if client.server_capabilities.documentSymbolProvider then - navic.attach(client, bufnr) - end -end - -local function disable_deno_formatting(client) - if client.name == "denols" then - require("null-ls").disable({ "prettier" }) - end -end - -local function resolve_tsserver_deno(client) - local active_clients = vim.lsp.get_active_clients() - if client.name == "denols" then - for _, client_ in pairs(active_clients) do - -- stop tsserver if denols is already active - if client_.name == "tsserver" then - client_.stop() - end - end - elseif client.name == "tsserver" then - for _, client_ in pairs(active_clients) do - -- prevent tsserver from starting if denols is already active - if client_.name == "denols" then - client.stop() - end - end - end -end - -M.on_attach = function(client, bufnr) - attach_navic(client, bufnr) - disable_deno_formatting(client) - resolve_tsserver_deno(client) -end - -function M.enable_format_on_save() - vim.cmd([[ - augroup format_on_save - autocmd! - autocmd BufWritePre * lua vim.lsp.buf.format({ async = false }) - augroup end - ]]) - vim.notify("Enabled format on save") -end - -function M.disable_format_on_save() - M.remove_augroup("format_on_save") - vim.notify("Disabled format on save") -end - -function M.toggle_format_on_save() - if vim.fn.exists("#format_on_save#BufWritePre") == 0 then - M.enable_format_on_save() - else - M.disable_format_on_save() - end -end - -function M.remove_augroup(name) - if vim.fn.exists("#" .. name) == 1 then - vim.cmd("au! " .. name) - end -end - -vim.cmd([[ command! LspToggleAutoFormat execute 'lua require("chris.lsp.handlers").toggle_format_on_save()' ]]) - -return M diff --git a/.config/nvim/lua/chris/lsp/init.lua b/.config/nvim/lua/chris/lsp/init.lua deleted file mode 100644 index c700e25..0000000 --- a/.config/nvim/lua/chris/lsp/init.lua +++ /dev/null @@ -1,22 +0,0 @@ -M = {} - -local status_ok, _ = pcall(require, "lspconfig") -if not status_ok then - print "lspconfig error!" - return -end - --- may add signature in future. --- require "chris.lsp.lsp-signature" -require "chris.lsp.mason" -require "chris.lsp.handlers".setup() -require "chris.lsp.null-ls" - -local l_status_ok, lsp_lines = pcall(require, "lsp_lines") -if not l_status_ok then - return -end - -lsp_lines.setup() - -return M diff --git a/.config/nvim/lua/chris/lsp/mason.lua b/.config/nvim/lua/chris/lsp/mason.lua deleted file mode 100644 index f6b9e55..0000000 --- a/.config/nvim/lua/chris/lsp/mason.lua +++ /dev/null @@ -1,121 +0,0 @@ -local status_ok, mason = pcall(require, "mason") -if not status_ok then - return -end - -local status_ok_1, mason_lspconfig = pcall(require, "mason-lspconfig") -if not status_ok_1 then - return -end - -local servers = { - "cssls", - "cssmodules_ls", - "emmet_ls", - "html", - "sumneko_lua", - "omnisharp", - "tflint", - "denols", - "tsserver", - "pyright", - "yamlls", - "texlab", - "bashls", - "clangd", - "rust_analyzer", - "taplo", - "lemminx", - "clangd", -} - -local settings = { - ui = { - border = "rounded", - icons = { - package_installed = "i", - package_pending = "p", - package_uninstalled = "u", - }, - }, - log_level = vim.log.levels.INFO, - max_concurrent_installers = 4, -} - -mason.setup(settings) -mason_lspconfig.setup({ - ensure_installed = servers, - automatic_installation = true, -}) - --- New way of setting up neodev, formally lua-dev by folke -local l_status_ok, neodev = pcall(require, "neodev") -if not l_status_ok then - return -end - -neodev.setup({}) - -local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig") -if not lspconfig_status_ok then - print("lspconfig error!") - return -end - -local opts = {} - -for _, server in pairs(servers) do - opts = { - on_attach = require("chris.lsp.handlers").on_attach, - capabilities = require("chris.lsp.handlers").capabilities, - } - - server = vim.split(server, "@", {})[1] - - if server == "yamlls" then - local yamlls_opts = require("chris.lsp.settings.yamlls") - opts = vim.tbl_deep_extend("force", yamlls_opts, opts) - end - - if server == "sumneko_lua" then - lspconfig.sumneko_lua.setup({ - on_attach = require("chris.lsp.handlers").on_attach, - }) - goto continue - end - - if server == "tsserver" then - local tsserver_opts = require("chris.lsp.settings.tsserver") - opts = vim.tbl_deep_extend("force", tsserver_opts, opts) - end - - if server == "clangd" then - local clangd_opts = require("chris.lsp.settings.clangd") - opts = vim.tbl_deep_extend("force", clangd_opts, opts) - end - - if server == "emmet_ls" then - local emmet_ls_opts = require("chris.lsp.settings.emmet_ls") - opts = vim.tbl_deep_extend("force", emmet_ls_opts, opts) - end - - if server == "rust_analyzer" then - local rust_opts = require("chris.lsp.settings.rust") - -- opts = vim.tbl_deep_extend("force", rust_opts, opts) - local rust_tools_status_ok, rust_tools = pcall(require, "rust-tools") - if not rust_tools_status_ok then - return - end - - rust_tools.setup(rust_opts) - goto continue - end - - if server == "omnisharp" then - local omnisharp_opts = require("chris.lsp.settings.omnisharp") - opts = vim.tbl_deep_extend("force", omnisharp_opts, opts) - end - - lspconfig[server].setup(opts) - ::continue:: -end diff --git a/.config/nvim/lua/chris/lsp/null-ls.lua b/.config/nvim/lua/chris/lsp/null-ls.lua deleted file mode 100644 index 470b7cd..0000000 --- a/.config/nvim/lua/chris/lsp/null-ls.lua +++ /dev/null @@ -1,64 +0,0 @@ -local null_ls_status_ok, null_ls = pcall(require, "null-ls") -if not null_ls_status_ok then - return -end - --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting -local formatting = null_ls.builtins.formatting --- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics -local diagnostics = null_ls.builtins.diagnostics - -null_ls.setup({ - debug = false, - sources = { - formatting.prettier.with({ - filetypes = { - "javascript", - "typescript", - "css", - "scss", - "html", - "json", - "yaml", - }, - }), - formatting.black.with({ extra_args = { "--fast" } }), - formatting.stylua, - -- formatting.shfmt, - formatting.google_java_format, - formatting.bibclean, - formatting.beautysh, - -- diagnostics.flake8, - diagnostics.shellcheck, - }, -}) - -local unwrap = { - method = null_ls.methods.DIAGNOSTICS, - filetypes = { "rust" }, - generator = { - fn = function(params) - local diagnostics = {} - -- sources have access to a params object - -- containing info about the current file and editor state - for i, line in ipairs(params.content) do - local col, end_col = line:find("unwrap()") - if col and end_col then - -- null-ls fills in undefined positions - -- and converts source diagnostics into the required format - table.insert(diagnostics, { - row = i, - col = col, - end_col = end_col, - source = "unwrap", - message = "hey " .. os.getenv("USER") .. ", don't forget to handle this", - severity = 2, - }) - end - end - return diagnostics - end, - }, -} - -null_ls.register(unwrap) diff --git a/.config/nvim/lua/chris/lsp/settings/clangd.lua b/.config/nvim/lua/chris/lsp/settings/clangd.lua deleted file mode 100644 index 4adffa5..0000000 --- a/.config/nvim/lua/chris/lsp/settings/clangd.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - cmd = { "clangd" } -} diff --git a/.config/nvim/lua/chris/lsp/settings/emmet_ls.lua b/.config/nvim/lua/chris/lsp/settings/emmet_ls.lua deleted file mode 100644 index fac61ba..0000000 --- a/.config/nvim/lua/chris/lsp/settings/emmet_ls.lua +++ /dev/null @@ -1,25 +0,0 @@ --- https://github.com/pedro757/emmet --- npm i -g ls_emmet -return { - cmd = { "ls_emmet", "--stdio" }, - filetypes = { - "html", - "css", - "scss", - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - "haml", - "xml", - "xsl", - "pug", - "slim", - "sass", - "stylus", - "less", - "sss", - "hbs", - "handlebars", - }, -} diff --git a/.config/nvim/lua/chris/lsp/settings/omnisharp.lua b/.config/nvim/lua/chris/lsp/settings/omnisharp.lua deleted file mode 100644 index aa22e5d..0000000 --- a/.config/nvim/lua/chris/lsp/settings/omnisharp.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - cmd = { "omnisharp" }, - - -- Enables support for reading code style, naming convention and analyzer - -- settings from .editorconfig. - enable_editorconfig_support = true, - - -- If true, MSBuild project system will only load projects for files that - -- were opened in the editor. This setting is useful for big C# codebases - -- and allows for faster initialization of code navigation features only - -- for projects that are relevant to code that is being edited. With this - -- setting enabled OmniSharp may load fewer projects and may thus display - -- incomplete reference lists for symbols. - enable_ms_build_load_projects_on_demand = false, - - -- Enables support for roslyn analyzers, code fixes and rulesets. - enable_roslyn_analyzers = true, - - -- Specifies whether 'using' directives should be grouped and sorted during - -- document formatting. - organize_imports_on_format = false, - - -- Enables support for showing unimported types and unimported extension - -- methods in completion lists. When committed, the appropriate using - -- directive will be added at the top of the current file. This option can - -- have a negative impact on initial completion responsiveness, - -- particularly for the first few completion sessions after opening a - -- solution. - enable_import_completion = false, - - -- Specifies whether to include preview versions of the .NET SDK when - -- determining which version to use for project loading. - sdk_include_prereleases = true, - - -- Only run analyzers against open files when 'enableRoslynAnalyzers' is - -- true - analyze_open_documents_only = false, -} diff --git a/.config/nvim/lua/chris/lsp/settings/rust.lua b/.config/nvim/lua/chris/lsp/settings/rust.lua deleted file mode 100644 index 9610cd6..0000000 --- a/.config/nvim/lua/chris/lsp/settings/rust.lua +++ /dev/null @@ -1,126 +0,0 @@ -return { - tools = { - -- autoSetHints = false, - on_initialized = function() - vim.api.nvim_create_autocmd({ "BufWritePost", "BufEnter", "CursorHold", "InsertLeave" }, { - pattern = { "*.rs" }, - callback = function() - vim.lsp.codelens.refresh() - end, - }) - end, - - auto = false, - inlay_hints = { - -- Only show inlay hints for the current line - only_current_line = false, - auto = false, - - -- Event which triggers a refersh of the inlay hints. - -- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but - -- not that this may cause higher CPU usage. - -- This option is only respected when only_current_line and - -- autoSetHints both are true. - only_current_line_autocmd = "CursorHold", - - -- whether to show parameter hints with the inlay hints or not - -- default: true - show_parameter_hints = false, - - -- whether to show variable name before type hints with the inlay hints or not - -- default: false - show_variable_name = false, - - -- prefix for parameter hints - -- default: "<-" - -- parameter_hints_prefix = "<- ", - parameter_hints_prefix = " ", - - -- prefix for all the other hints (type, chaining) - -- default: "=>" - -- other_hints_prefix = "=> ", - other_hints_prefix = " ", - - -- whether to align to the lenght of the longest line in the file - max_len_align = false, - - -- padding from the left if max_len_align is true - max_len_align_padding = 1, - - -- whether to align to the extreme right or not - right_align = false, - - -- padding from the right if right_align is true - right_align_padding = 7, - - -- The color of the hints - highlight = "Comment", - }, - hover_actions = { - auto_focus = false, - border = "rounded", - width = 60, - -- height = 30, - }, - }, - server = { - --[[ - $ mkdir -p ~/.local/bin - $ curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer - $ chmod +x ~/.local/bin/rust-analyzer - --]] - -- cmd = { os.getenv "HOME" .. "/.local/bin/rust-analyzer" }, - cmd = { "rustup", "run", "nightly", os.getenv "HOME" .. "/.local/bin/rust-analyzer" }, - on_attach = require("chris.lsp.handlers").on_attach, - capabilities = require("chris.lsp.handlers").capabilities, - - settings = { - ["rust-analyzer"] = { - lens = { - enable = true, - }, - checkOnSave = { - command = "clippy", - }, - }, - }, - }, -} --- return { --- settings = { --- rust_analyzer = { --- inlayHints = { --- bindingModeHints = { --- enable = true, --- }, --- typeHints = { --- enable = true, --- hideClosureInitialization = false, --- hideNamedConstructor = false, --- }, --- chainingHints = { --- enable = true, --- }, --- closingBraceHints = { --- enable = true, --- minLines = 25, --- }, --- closureReturnTypeHints = { --- enable = "never", --- }, --- lifetimeElisionHints = { --- enable = "never", --- useParameterNames = false, --- maxLength = 25, --- }, --- parameterHints = { --- enable = true, --- }, --- reborrowHints = { --- enable = "never", --- }, --- renderColons = true, --- }, --- }, --- }, --- } diff --git a/.config/nvim/lua/chris/lsp/settings/shellcheck.lua b/.config/nvim/lua/chris/lsp/settings/shellcheck.lua deleted file mode 100644 index a564707..0000000 --- a/.config/nvim/lua/chris/lsp/settings/shellcheck.lua +++ /dev/null @@ -1 +0,0 @@ -return {} diff --git a/.config/nvim/lua/chris/lsp/settings/sumneko_lua.lua b/.config/nvim/lua/chris/lsp/settings/sumneko_lua.lua deleted file mode 100644 index 1130c8a..0000000 --- a/.config/nvim/lua/chris/lsp/settings/sumneko_lua.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - settings = { - Lua = { - type = { - -- weakUnionCheck = true, - -- weakNilCheck = true, - -- castNumberToInteger = true, - }, - format = { - enable = false, - }, - hint = { - enable = true, - arrayIndex = "Disable", -- "Enable", "Auto", "Disable" - await = true, - paramName = "Disable", -- "All", "Literal", "Disable" - paramType = false, - semicolon = "Disable", -- "All", "SameLine", "Disable" - setType = true, - }, - -- spell = {"the"} - runtime = { - version = "LuaJIT", - special = { - reload = "require", - }, - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua"] = true, - [vim.fn.stdpath "config" .. "/lua"] = true, - -- [vim.fn.datapath "config" .. "/lua"] = true, - }, - }, - telemetry = { - enable = false, - }, - }, - }, -} diff --git a/.config/nvim/lua/chris/lsp/settings/tsserver.lua b/.config/nvim/lua/chris/lsp/settings/tsserver.lua deleted file mode 100644 index e3ae6e8..0000000 --- a/.config/nvim/lua/chris/lsp/settings/tsserver.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - settings = { - typescript = { - inlayHints = { - includeInlayEnumMemberValueHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'; - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayVariableTypeHints = true, - }, - }, - }, -} diff --git a/.config/nvim/lua/chris/lsp/settings/yamlls.lua b/.config/nvim/lua/chris/lsp/settings/yamlls.lua deleted file mode 100644 index 5003f08..0000000 --- a/.config/nvim/lua/chris/lsp/settings/yamlls.lua +++ /dev/null @@ -1,8 +0,0 @@ - -return { - yaml = { - schemaStore = { - enable = true - } - } -} diff --git a/.config/nvim/lua/chris/lspsaga.lua b/.config/nvim/lua/chris/lspsaga.lua deleted file mode 100644 index ba43a9e..0000000 --- a/.config/nvim/lua/chris/lspsaga.lua +++ /dev/null @@ -1,10 +0,0 @@ -local status_ok, lspsaga = pcall(require, "lspsaga") -if not status_ok then - return -end - -local icons = require "chris.icons" - -lspsaga.init_lsp_saga({ - code_action_icon = icons.diagnostics.Hint -}) diff --git a/.config/nvim/lua/chris/lualine.lua b/.config/nvim/lua/chris/lualine.lua deleted file mode 100644 index 4d46f83..0000000 --- a/.config/nvim/lua/chris/lualine.lua +++ /dev/null @@ -1,113 +0,0 @@ -local colors = { - red = "#ca1243", - grey = "#a0a1a7", - black = "#383a42", - white = "#f3f3f3", - light_green = "#83a598", - orange = "#fe8019", - green = "#8ec07c", -} - --- Put proper separators and gaps between components in sections -local function process_sections(sections) - for name, section in pairs(sections) do - local left = name:sub(9, 10) < "x" - for pos = 1, name ~= "lualine_z" and #section or #section - 1 do - table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } }) - end - for id, comp in ipairs(section) do - if type(comp) ~= "table" then - comp = { comp } - section[id] = comp - end - comp.separator = left and { right = "" } or { left = "" } - end - end - return sections -end - -local function search_result() - if vim.v.hlsearch == 0 then - return '' - end - local last_search = vim.fn.getreg('/') - if not last_search or last_search == '' then - return '' - end - local searchcount = vim.fn.searchcount { maxcount = 9999 } - return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')' - -- return "" -end - -local function modified() - if vim.bo.modified then - return "+" - elseif vim.bo.modifiable == false or vim.bo.readonly == true then - return "-" - end - return "" -end - -local status_ok, navic = pcall(require, "nvim-navic") -if not status_ok then - print("navic error!") - return -end - -require("lualine").setup({ - options = { - theme = "gruvbox", - component_separators = "", - section_separators = { left = "", right = "" }, - }, - sections = process_sections({ - lualine_a = { "mode" }, - lualine_b = { - "branch", - "diff", - { - "diagnostics", - source = { "nvim" }, - sections = { "error" }, - diagnostics_color = { error = { bg = colors.red, fg = colors.white } }, - }, - { - "diagnostics", - source = { "nvim" }, - sections = { "warn" }, - diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } }, - }, - { "filename", file_status = false, path = 1 }, - { modified, color = { bg = colors.red } }, - { - "%w", - cond = function() - return vim.wo.previewwindow - end, - }, - { - "%r", - cond = function() - return vim.bo.readonly - end, - }, - { - "%q", - cond = function() - return vim.bo.buftype == "quickfix" - end, - }, - }, - lualine_c = { - { navic.get_location, cond = navic.is_available }, - }, - lualine_x = {}, - -- lualine_y = { search_result, 'filetype' }, - lualine_y = { "filetype " }, - lualine_z = { "%l:%c", "%p%%/%L" }, - }), - inactive_sections = { - lualine_c = { "%f %y %m" }, - lualine_x = {}, - }, -}) diff --git a/.config/nvim/lua/chris/navic.lua b/.config/nvim/lua/chris/navic.lua deleted file mode 100644 index fbf86a1..0000000 --- a/.config/nvim/lua/chris/navic.lua +++ /dev/null @@ -1,43 +0,0 @@ -local status_ok, navic = pcall(require, "nvim-navic") -if not status_ok then - print("navic error!") - return -end - -local icons = require("chris.icons") - -navic.setup({ - icons = { - File = icons.kind.File .. " ", - Module = icons.kind.Module .. " ", - Namespace = icons.kind.Namespace .. " ", - Package = icons.ui.Package .. " ", - Class = icons.kind.Class .. " ", - Method = icons.kind.Method .. " ", - Property = icons.kind.Property .. " ", - Field = icons.kind.Field .. " ", - Constructor = icons.kind.Constructor .. " ", - Enum = icons.kind.Enum .. " ", - Interface = icons.kind.Interface .. " ", - Function = icons.kind.Function .. " ", - Variable = icons.kind.Variable .. " ", - Constant = icons.kind.Constant .. " ", - String = icons.type.String .. " ", - Number = icons.type.Number .. " ", - Boolean = icons.type.Boolean .. " ", - Array = icons.type.Array .. " ", - Object = icons.type.Object .. " ", - Key = icons.kind.Key .. " ", - Null = icons.type.Null .. " ", - EnumMember = icons.kind.EnumMember .. " ", - Struct = icons.kind.Struct .. " ", - Event = icons.kind.Event .. " ", - Operator = icons.kind.Operator .. " ", - TypeParameter = icons.kind.TypeParameter .. " ", - }, - highlight = false, - separator = " > ", - depth_limit = 0, - depth_limit_indicator = "..", - safe_output = true, -}) diff --git a/.config/nvim/lua/chris/neogen.lua b/.config/nvim/lua/chris/neogen.lua deleted file mode 100644 index dd48fb7..0000000 --- a/.config/nvim/lua/chris/neogen.lua +++ /dev/null @@ -1,10 +0,0 @@ -local s_ok, neogen = pcall(require, "neogen") -if not s_ok then - return -end - -neogen.setup { - enabled = true, --if you want to disable Neogen - input_after_comment = true, -- (default: true) automatic jump (with insert mode) on inserted annotation - -- jump_map = "" -- (DROPPED SUPPORT, see [here](#cycle-between-annotations) !) The keymap in order to jump in the annotation fields (in insert mode) -} diff --git a/.config/nvim/lua/chris/noice.lua b/.config/nvim/lua/chris/noice.lua deleted file mode 100644 index 14ca1e7..0000000 --- a/.config/nvim/lua/chris/noice.lua +++ /dev/null @@ -1,195 +0,0 @@ -local s_ok, noice = pcall(require, "noice") -if not s_ok then - return -end - -noice.setup({ - cmdline = { - enabled = false, -- enables the Noice cmdline UI - view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom - opts = {}, -- global options for the cmdline. See section on views - ---@type table - format = { - -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. - -- view: (default is cmdline view) - -- opts: any options passed to the view - -- icon_hl_group: optional hl_group for the icon - -- title: set to anything or empty string to hide - cmdline = { pattern = "^:", icon = ":", lang = "vim" }, - search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, - search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, - filter = { pattern = "^:%s*!", icon = "$", lang = "bash" }, - lua = { pattern = "^:%s*lua%s+", icon = "", lang = "lua" }, - help = { pattern = "^:%s*he?l?p?%s+", icon = "" }, - input = {}, -- Used by input() - -- lua = false, -- to disable a format, set to `false` - }, - }, - messages = { - -- NOTE: If you enable messages, then the cmdline is enabled automatically. - -- This is a current Neovim limitation. - enabled = false, -- enables the Noice messages UI - view = "notify", -- default view for messages - view_error = "notify", -- view for errors - view_warn = "notify", -- view for warnings - view_history = "messages", -- view for :messages - view_search = "virtualtext", -- view for search count messages. Set to `false` to disable - }, - popupmenu = { - enabled = true, -- enables the Noice popupmenu UI - ---@type 'nui'|'cmp' - backend = "nui", -- backend to use to show regular cmdline completions - ---@type NoicePopupmenuItemKind|false - -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) - kind_icons = {}, -- set to `false` to disable icons - }, - -- You can add any custom commands below that will be available with `:Noice command` - ---@type table - commands = { - history = { - -- options for the message history that you get with `:Noice` - view = "split", - opts = { enter = true, format = "details" }, - filter = { - any = { - { event = "notify" }, - { error = true }, - { warning = true }, - { event = "msg_show", kind = { "" } }, - { event = "lsp", kind = "message" }, - }, - }, - }, - -- :Noice last - last = { - view = "popup", - opts = { enter = true, format = "details" }, - filter = { - any = { - { event = "notify" }, - { error = true }, - { warning = true }, - { event = "msg_show", kind = { "" } }, - { event = "lsp", kind = "message" }, - }, - }, - filter_opts = { count = 1 }, - }, - -- :Noice errors - errors = { - -- options for the message history that you get with `:Noice` - view = "popup", - opts = { enter = true, format = "details" }, - filter = { error = true }, - filter_opts = { reverse = true }, - }, - }, - notify = { - -- Noice can be used as `vim.notify` so you can route any notification like other messages - -- Notification messages have their level and other properties set. - -- event is always "notify" and kind can be any log level as a string - -- The default routes will forward notifications to nvim-notify - -- Benefit of using Noice for this is the routing and consistent history view - enabled = true, - view = "notify", - }, - lsp = { - progress = { - enabled = true, - -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin - -- See the section on formatting for more details on how to customize. - --- @type NoiceFormat|string - format = "lsp_progress", - --- @type NoiceFormat|string - format_done = "lsp_progress_done", - throttle = 1000 / 30, -- frequency to update lsp progress message - view = "mini", - }, - override = { - -- override the default lsp markdown formatter with Noice - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - -- override the lsp markdown formatter with Noice - ["vim.lsp.util.stylize_markdown"] = true, - -- override cmp documentation with Noice (needs the other options to work) - ["cmp.entry.get_documentation"] = true, - }, - hover = { - enabled = true, - view = nil, -- when nil, use defaults from documentation - ---@type NoiceViewOptions - opts = {}, -- merged with defaults from documentation - }, - signature = { - enabled = true, - auto_open = { - enabled = true, - trigger = true, -- Automatically show signature help when typing a trigger character from the LSP - luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes - throttle = 50, -- Debounce lsp signature help request by 50ms - }, - view = nil, -- when nil, use defaults from documentation - ---@type NoiceViewOptions - opts = {}, -- merged with defaults from documentation - }, - message = { - -- Messages shown by lsp servers - enabled = true, - view = "notify", - opts = {}, - }, - -- defaults for hover and signature help - documentation = { - view = "hover", - ---@type NoiceViewOptions - opts = { - lang = "markdown", - replace = true, - render = "plain", - format = { "{message}" }, - win_options = { concealcursor = "n", conceallevel = 3 }, - }, - }, - }, - markdown = { - hover = { - ["|(%S-)|"] = vim.cmd.help, -- vim help links - ["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links - }, - highlights = { - ["|%S-|"] = "@text.reference", - ["@%S+"] = "@parameter", - ["^%s*(Parameters:)"] = "@text.title", - ["^%s*(Return:)"] = "@text.title", - ["^%s*(See also:)"] = "@text.title", - ["{%S-}"] = "@parameter", - }, - }, - health = { - checker = true, -- Disable if you don't want health checks to run - }, - smart_move = { - -- noice tries to move out of the way of existing floating windows. - enabled = true, -- you can disable this behaviour here - -- add any filetypes here, that shouldn't trigger smart move. - excluded_filetypes = { "cmp_menu", "cmp_docs", "notify" }, - }, - ---@type NoicePresets - presets = { - -- you can enable a preset by setting it to true, or a table that will override the preset config - -- you can also add custom presets that you can enable/disable with enabled=true - bottom_search = false, -- use a classic bottom cmdline for search - command_palette = false, -- position the cmdline and popupmenu together - long_message_to_split = false, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, - throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. - ---@type NoiceConfigViews - views = {}, ---@see section on views - ---@type NoiceRouteConfig[] - routes = {}, --- @see section on routes - ---@type table - status = {}, --- @see section on statusline components - ---@type NoiceFormatOptions - format = {}, --- @see section on formatting -}) diff --git a/.config/nvim/lua/chris/notify.lua b/.config/nvim/lua/chris/notify.lua deleted file mode 100644 index 29cc16d..0000000 --- a/.config/nvim/lua/chris/notify.lua +++ /dev/null @@ -1,53 +0,0 @@ -local status_ok, notify = pcall(require, "notify") -if not status_ok then - return -end - -local icons = require "chris.icons" - -notify.setup { - -- Animation style (see below for details) - stages = "fade_in_slide_out", - - -- Function called when a new window is opened, use for changing win settings/config - on_open = nil, - - -- Function called when a window is closed - on_close = nil, - - -- Render function for notifications. See notify-render() - render = "default", - - -- Default timeout for notifications - timeout = 2000, - - -- For stages that change opacity this is treated as the highlight behind the window - -- Set this to either a highlight group or an RGB hex value e.g. "#000000" - background_colour = "Normal", - - -- Minimum width for notification windows - minimum_width = 10, - - -- Icons for the different levels - icons = { - ERROR = icons.diagnostics.Error, - WARN = icons.diagnostics.Warning, - INFO = icons.diagnostics.Information, - DEBUG = icons.ui.Bug, - TRACE = icons.ui.Pencil, - }, -} - -vim.notify = notify - -local notify_filter = vim.notify -vim.notify = function(msg, ...) - if msg:match "character_offset must be called" then - return - end - if msg:match "method textDocument" then - return - end - - notify_filter(msg, ...) -end diff --git a/.config/nvim/lua/chris/numb.lua b/.config/nvim/lua/chris/numb.lua deleted file mode 100644 index b7439a9..0000000 --- a/.config/nvim/lua/chris/numb.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, numb = pcall(require, "numb") -if not status_ok then - return -end -numb.setup({ - show_numbers = true, -- Enable 'number' for the window while peeking - show_cursorline = true, -- Enable 'cursorline' for the window while peeking -}) diff --git a/.config/nvim/lua/chris/nvim-tree.lua b/.config/nvim/lua/chris/nvim-tree.lua deleted file mode 100644 index eae1996..0000000 --- a/.config/nvim/lua/chris/nvim-tree.lua +++ /dev/null @@ -1,117 +0,0 @@ -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end - -local icons = require("chris.icons") - -local tree_cb = nvim_tree_config.nvim_tree_callback - -nvim_tree.setup({ - hijack_directories = { - enable = false, - }, - ignore_ft_on_setup = { - "alpha", - }, - filters = { - custom = { ".git" }, - exclude = { ".gitignore" }, - }, - hijack_cursor = false, - update_cwd = true, - renderer = { - add_trailing = false, - group_empty = false, - highlight_git = false, - highlight_opened_files = "none", - root_folder_modifier = ":t", - indent_markers = { - enable = false, - icons = { - corner = "└ ", - edge = "│ ", - none = " ", - }, - }, - icons = { - webdev_colors = true, - git_placement = "before", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - glyphs = { - default = "", - symlink = "", - folder = { - arrow_open = icons.ui.ArrowOpen, - arrow_closed = icons.ui.ArrowClosed, - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - untracked = "U", - deleted = "", - ignored = "◌", - }, - }, - }, - }, - diagnostics = { - enable = true, - icons = { - hint = icons.diagnostics.Hint, - info = icons.diagnostics.Information, - warning = icons.diagnostics.Warning, - error = icons.diagnostics.Error, - }, - }, - update_focused_file = { - enable = true, - update_cwd = true, - ignore_list = {}, - }, - git = { - enable = true, - ignore = true, - timeout = 500, - }, - view = { - width = 30, - hide_root_folder = false, - side = "left", - mappings = { - custom_only = false, - list = { - { key = { "l", "", "o" }, cb = tree_cb("edit") }, - { key = "h", cb = tree_cb("close_node") }, - { key = "v", cb = tree_cb("vsplit") }, - }, - }, - number = false, - relativenumber = false, - }, - actions = { - open_file = { - quit_on_open = true, - }, - }, -}) diff --git a/.config/nvim/lua/chris/options.lua b/.config/nvim/lua/chris/options.lua deleted file mode 100644 index 35c6193..0000000 --- a/.config/nvim/lua/chris/options.lua +++ /dev/null @@ -1,60 +0,0 @@ -local options = { - backup = false, -- creates a backup file - -- clipboard = "unnamedplus", -- gives nvim access to clipboard - cmdheight = 1, -- more space in nvim cmd line - completeopt = { "menuone", "noselect" }, -- cmp related - conceallevel = 0, -- don't hide `` in md - fileencoding = "utf-8", - hlsearch = false, - ignorecase = true, - mouse = "a", -- allow use of mouse (bad I know but sometimes useful) - pumheight = 10, -- popup menu height - showmode = true, - smartcase = true, - smartindent = true, - splitbelow = true, - splitright = true, - swapfile = false, - termguicolors = true, - timeoutlen = 500, - ttimeoutlen = 10, - undofile = true, - updatetime = 100, - writebackup = false, - expandtab = true, -- use spaces instead of tab - shiftwidth = 4, -- insert 4 spaces for indentation - tabstop = 4, -- insert 4 spaces for tab - cursorline = false, - number = true, - laststatus = 3, - showcmd = false, - ruler = false, - relativenumber = true, - numberwidth = 2, - signcolumn = "yes", - wrap = false, - scrolloff = 8, - sidescrolloff = 8, - guifont = "monospace:h17", - title = true, - spelllang = "en_us", -} - -vim.opt.fillchars = vim.opt.fillchars + 'eob: ' - -vim.opt.shortmess:append "c" - -for k, v in pairs(options) do - vim.opt[k] = v -end - -vim.cmd "set whichwrap+=<,>,[,],h,l" -vim.cmd "set colorcolumn=80" -vim.cmd [[set iskeyword+=-]] - --- Disable snipmate plugins to avoid duplicate snippets -vim.g.UltiSnipsEnableSnipMate = 0 -vim.g.UltiSnipsRemoveSelectModeMappings = 0 -vim.g.UltiSnipsExpandTrigger = "" -vim.g.UltiSnipsJumpForwardTrigger = "" -vim.g.UltiSnipsJumpBackwardTrigger = "" diff --git a/.config/nvim/lua/chris/plugins.lua b/.config/nvim/lua/chris/plugins.lua deleted file mode 100644 index bfef9c8..0000000 --- a/.config/nvim/lua/chris/plugins.lua +++ /dev/null @@ -1,165 +0,0 @@ -local fn = vim.fn - --- Automatically install packer -local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system({ - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - }) - print("Installing packer, please close and reopen Neovim...") - vim.cmd([[packadd packer.nvim]]) -end - --- Autocommand to reload neovime whenever this file is saved. -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source | PackerSync - augroup end -]]) - --- use a protected call so there's no error on first use -local s_ok, packer = pcall(require, "packer") -if not s_ok then - return -end - --- Have packer use a popup -packer.init({ - max_jobs = 50, - display = { - open_fn = function() - return require("packer.util").float({ border = "rounded" }) - end, - prompt_border = "rounded", - }, -}) - --- Add plugins from here -return packer.startup(function(use) - -- Plugin manager - use("wbthomason/packer.nvim") -- Have packer manage inself - - -- Lua Development - --use("nvim-lua/plenary.nvim") -- useful lua functions - --use("nvim-lua/popup.nvim") - --use("folke/neodev.nvim") - - -- LSP - use("neovim/nvim-lspconfig") -- enable LSP - use("williamboman/mason.nvim") -- language server manager/installer - use("williamboman/mason-lspconfig.nvim") - use("j-hui/fidget.nvim") -- displays lsp progress in bottom right - use("SmiteshP/nvim-navic") -- integrates with winbar to show location in program e.g.: MyClass > MyFunc > MyProperty - use("simrat39/symbols-outline.nvim") -- class explorer for nvim - use("folke/trouble.nvim") -- view lsp diagnostics - use("https://git.sr.ht/~whynothugo/lsp_lines.nvim") - use({ -- I'm currently just using this for a functional code action menu for omnisharp, I want to look further into its functions though. - "glepnir/lspsaga.nvim", - branch = "main", - }) - use("jose-elias-alvarez/null-ls.nvim") - - -- Completion - use("hrsh7th/nvim-cmp") -- completion engine - use("hrsh7th/cmp-buffer") -- buffer completions - use("hrsh7th/cmp-path") -- path completions - use("saadparwaiz1/cmp_luasnip") -- snippet completions - use("hrsh7th/cmp-nvim-lsp") -- lsp completions - use("hrsh7th/cmp-nvim-lua") - - -- Snippet { - --use("L3MON4D3/LuaSnip") -- snippet engine - --use("rafamadriz/friendly-snippets") -- a collection of useful snippets - - -- Syntax/Treesitter - use("nvim-treesitter/nvim-treesitter") - use("nvim-treesitter/playground") - - -- CEO of The Startup - use("ThePrimeagen/harpoon") - - -- Telescopic Johnston - use("nvim-telescope/telescope.nvim") - use("nvim-telescope/telescope-media-files.nvim") - - -- Colour - use("NvChad/nvim-colorizer.lua") - - -- Colorschemes - use("sainnhe/gruvbox-material") - use("sainnhe/sonokai") - use("dracula/vim") - use("RRethy/nvim-base16") - - -- Utility - --use("rcarriga/nvim-notify") - use("stevearc/dressing.nvim") - --use("moll/vim-bbye") - --use("lewis6991/impatient.nvim") - --use("ghillb/cybu.nvim") - --use("mbbill/undotree") - --use("MunifTanjim/nui.nvim") - -- noice - - -- Icons - --use("kyazdani42/nvim-web-devicons") - - -- Debugging - use("mfussenegger/nvim-dap") - use("rcarriga/nvim-dap-ui") - - -- Tabline - -- use("fgheng/winbar.nvim") - -- bufferline - - -- Statusline - --use("nvim-lualine/lualine.nvim") - - -- Startup - --use("goolord/alpha-nvim") - - -- Indent - use("lukas-reineke/indent-blankline.nvim") - - -- File Explorer - use("kyazdani42/nvim-tree.lua") - - -- Comments - use("numToStr/Comment.nvim") - use("folke/todo-comments.nvim") - - -- Git - use("lewis6991/gitsigns.nvim") - use("f-person/git-blame.nvim") - use("tpope/vim-fugitive") - - -- Editing Support - use("windwp/nvim-autopairs") - use("preservim/vim-markdown") - use("folke/zen-mode.nvim") - use("junegunn/vim-slash") - use("andymass/vim-matchup") - use("nacro90/numb.nvim") - use("monaqa/dial.nvim") - use({ - "abecodes/tabout.nvim", - wants = { "nvim-treesitter" }, - }) - use("windwp/nvim-spectre") - use("tpope/vim-surround") - use("danymat/neogen") - - -- Keybinding - use("folke/which-key.nvim") - - -- Automatically setup after cloning packer.nvim - if PACKER_BOOTSTRAP then - require("packer").sync() - end -end) diff --git a/.config/nvim/lua/chris/spectre.lua b/.config/nvim/lua/chris/spectre.lua deleted file mode 100644 index fe8eb6b..0000000 --- a/.config/nvim/lua/chris/spectre.lua +++ /dev/null @@ -1,135 +0,0 @@ -local status_ok, spectre = pcall(require, "spectre") -if not status_ok then - return -end -spectre.setup({ - - color_devicons = true, - highlight = { - ui = "String", - search = "DiffChange", - replace = "DiffDelete", - }, - mapping = { - ["toggle_line"] = { - map = "t", - cmd = "lua require('spectre').toggle_line()", - desc = "toggle current item", - }, - ["enter_file"] = { - map = "", - cmd = "lua require('spectre.actions').select_entry()", - desc = "goto current file", - }, - ["send_to_qf"] = { - map = "Q", - cmd = "lua require('spectre.actions').send_to_qf()", - desc = "send all item to quickfix", - }, - ["replace_cmd"] = { - map = "c", - cmd = "lua require('spectre.actions').replace_cmd()", - desc = "input replace vim command", - }, - ["show_option_menu"] = { - map = "o", - cmd = "lua require('spectre').show_options()", - desc = "show option", - }, - ["run_replace"] = { - map = "R", - cmd = "lua require('spectre.actions').run_replace()", - desc = "replace all", - }, - ["change_view_mode"] = { - map = "m", - cmd = "lua require('spectre').change_view()", - desc = "change result view mode", - }, - ["toggle_ignore_case"] = { - map = "I", - cmd = "lua require('spectre').change_options('ignore-case')", - desc = "toggle ignore case", - }, - ["toggle_ignore_hidden"] = { - map = "H", - cmd = "lua require('spectre').change_options('hidden')", - desc = "toggle search hidden", - }, - -- you can put your mapping here it only use normal mode - }, - find_engine = { - -- rg is map with finder_cmd - ["rg"] = { - cmd = "rg", - -- default args - args = { - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - }, - options = { - ["ignore-case"] = { - value = "--ignore-case", - icon = "[I]", - desc = "ignore case", - }, - ["hidden"] = { - value = "--hidden", - desc = "hidden file", - icon = "[H]", - }, - -- you can put any option you want here it can toggle with - -- show_option function - }, - }, - ["ag"] = { - cmd = "ag", - args = { - "--vimgrep", - "-s", - }, - options = { - ["ignore-case"] = { - value = "-i", - icon = "[I]", - desc = "ignore case", - }, - ["hidden"] = { - value = "--hidden", - desc = "hidden file", - icon = "[H]", - }, - }, - }, - }, - replace_engine = { - ["sed"] = { - cmd = "sed", - args = nil, - }, - options = { - ["ignore-case"] = { - value = "--ignore-case", - icon = "[I]", - desc = "ignore case", - }, - }, - }, - default = { - find = { - --pick one of item in find_engine - cmd = "rg", - options = { "ignore-case" }, - }, - replace = { - --pick one of item in replace_engine - cmd = "sed", - }, - }, - replace_vim_cmd = "cdo", - is_open_target_win = true, --open file on opener window - is_insert_mode = false, -- start open panel on is_insert_mode -}) diff --git a/.config/nvim/lua/chris/symbols-outline.lua b/.config/nvim/lua/chris/symbols-outline.lua deleted file mode 100644 index ae29ec4..0000000 --- a/.config/nvim/lua/chris/symbols-outline.lua +++ /dev/null @@ -1,50 +0,0 @@ -local icons = require "chris.icons" -vim.g.symbols_outline = { - highlight_hovered_item = true, - show_guides = true, - auto_preview = false, - position = "right", - width = 40, - show_numbers = false, - show_relative_numbers = false, - show_symbol_details = true, - keymaps = { -- These keymaps can be a string or a table for multiple keys - close = { "", "q" }, - goto_location = "", - focus_location = "o", - hover_symbol = "", - toggle_preview = "K", - rename_symbol = "r", - code_actions = "a", - }, - lsp_blacklist = {}, - symbol_blacklist = {}, - symbols = { - File = { icon = icons.documents.File, hl = "CmpItemKindFile" }, - Module = { icon = icons.kind.Module, hl = "CmpItemKindModule" }, - Namespace = { icon = icons.kind.Module, hl = "CmpItemKindModule" }, - Package = { icon = icons.kind.Module, hl = "CmpItemKindModule" }, - Class = { icon = icons.kind.Class, hl = "CmpItemKindClass" }, - Method = { icon = icons.kind.Method, hl = "CmpItemKindMethod" }, - Property = { icon = icons.kind.Property, hl = "CmpItemKindProperty" }, - Field = { icon = icons.kind.Field, hl = "CmpItemKindField" }, - Constructor = { icon = icons.kind.Constructor, hl = "CmpItemKindConstructor" }, - Enum = { icon = icons.kind.Enum, hl = "CmpItemKindEnum" }, - Interface = { icon = icons.kind.Interface, hl = "CmpItemKindInterface" }, - Function = { icon = icons.kind.Function, hl = "CmpItemKindFunction" }, - Variable = { icon = icons.kind.Variable, hl = "CmpItemKindVariable" }, - Constant = { icon = icons.kind.Constant, hl = "CmpItemKindConstant" }, - String = { icon = icons.type.String, hl = "TSString" }, - Number = { icon = icons.type.Number, hl = "TSNumber" }, - Boolean = { icon = icons.type.Boolean, hl = "TSBoolean" }, - Array = { icon = icons.type.Array, hl = "TSKeyword" }, - Object = { icon = icons.type.Object, hl = "TSKeyword" }, - Key = { icon = icons.kind.Keyword, hl = "CmpItemKeyword" }, - Null = { icon = "NULL", hl = "TSKeyword" }, - EnumMember = { icon = icons.kind.EnumMember, hl = "CmpItemKindEnumMember" }, - Struct = { icon = icons.kind.Struct, hl = "CmpItemKindStruct" }, - Event = { icon = icons.kind.Event, hl = "CmpItemKindEvent" }, - Operator = { icon = icons.kind.Operator, hl = "CmpItemKindOperator" }, - TypeParameter = { icon = icons.kind.TypeParameter, hl = "CmpItemKindTypeParameter" }, - }, -} diff --git a/.config/nvim/lua/chris/telescope.lua b/.config/nvim/lua/chris/telescope.lua deleted file mode 100644 index e3157e1..0000000 --- a/.config/nvim/lua/chris/telescope.lua +++ /dev/null @@ -1,128 +0,0 @@ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -local actions = require("telescope.actions") -local icons = require("chris.icons") - -telescope.setup({ - defaults = { - - prompt_prefix = icons.ui.Telescope .. " > ", - selection_caret = " ", - path_display = { "smart" }, - - file_ignore_patterns = { - ".git/", - "target/", - "docs/", - "vendor/*", - "%.lock", - "__pycache__/*", - "%.sqlite3", - "%.ipynb", - "node_modules/*", - "%.svg", - "%.otf", - "%.ttf", - "%.webp", - ".dart_tool/", - ".github/", - ".gradle/", - ".idea/", - ".settings/", - ".vscode/", - "__pycache__/", - "build/", - "env/", - "gradle/", - "node_modules/", - "%.pdb", - "%.dll", - "%.class", - "%.exe", - "%.cache", - "%.ico", - "%.pdf", - "%.dylib", - "%.jar", - "%.docx", - "%.met", - "smalljre_*/*", - ".vale/", - "%.burp", - "%.mp4", - "%.mkv", - "%.rar", - "%.zip", - "%.7z", - "%.tar", - "%.bz2", - "%.epub", - "%.flac", - "%.tar.gz", - }, - - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.close, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - [""] = require("telescope.actions").delete_buffer, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.complete_tag, - [""] = actions.which_key, -- keys from pressing - [""] = actions.close, - }, - - n = { - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.select_tab, - - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - ["H"] = actions.move_to_top, - ["M"] = actions.move_to_middle, - ["L"] = actions.move_to_bottom, - ["q"] = actions.close, - ["dd"] = require("telescope.actions").delete_buffer, - ["s"] = actions.select_horizontal, - ["v"] = actions.select_vertical, - ["t"] = actions.select_tab, - - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - ["gg"] = actions.move_to_top, - ["G"] = actions.move_to_bottom, - - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - - ["?"] = actions.which_key, - }, - }, - }, -}) diff --git a/.config/nvim/lua/chris/todo-comments.lua b/.config/nvim/lua/chris/todo-comments.lua deleted file mode 100644 index 0470695..0000000 --- a/.config/nvim/lua/chris/todo-comments.lua +++ /dev/null @@ -1,58 +0,0 @@ -local status_ok, todo_comments = pcall(require, "todo-comments") -if not status_ok then - return -end - -local icons = require "chris.icons" - -local error_red = "#F44747" -local warning_orange = "#ff8800" -local info_yellow = "#FFCC66" -local hint_blue = "#4FC1FF" -local perf_purple = "#7C3AED" -local note_green = '#10B981' - -todo_comments.setup { - signs = true, -- show icons in the signs column - sign_priority = 8, -- sign priority - -- keywords recognized as todo comments - keywords = { - FIX = { - icon = icons.ui.Bug, -- icon used for the sign, and in search results - color = error_red, -- can be a hex color, or a named color (see below) - alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords - }, - TODO = { icon = icons.ui.Check, color = hint_blue, alt = { "TIP" } }, - HACK = { icon = icons.ui.Fire, color = warning_orange }, - WARN = { icon = icons.diagnostics.Warning, color = warning_orange }, - PERF = { icon = icons.ui.Dashboard, color = perf_purple }, - NOTE = { icon = icons.ui.Note, color = note_green, alt = { "INFO" } }, - }, - -- highlighting of the line containing the todo comment - -- * before: highlights before the keyword (typically comment characters) - -- * keyword: highlights of the keyword - -- * after: highlights after the keyword (todo text) - highlight = { - before = "", -- "fg" or "bg" or empty - keyword = "wide", -- "fg", "bg", "wide" or empty. (wide is the same as bg, but will also highlight surrounding characters) - after = "fg", -- "fg" or "bg" or empty - pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlightng (vim regex) - comments_only = true, -- uses treesitter to match keywords in comments only - max_line_len = 400, -- ignore lines longer than this - exclude = { "markdown" }, -- list of file types to exclude highlighting - }, - search = { - command = "rg", - args = { - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - }, - -- regex that will be used to match keywords. - -- don't replace the (keywords) placeholder - pattern = [[\b(keywords):]], -- ripgrep regex - -- pattern = [[\b(keywords)\b]], -- match without the extra colon. you'll likely get false positives - }, -} diff --git a/.config/nvim/lua/chris/treesitter.lua b/.config/nvim/lua/chris/treesitter.lua deleted file mode 100644 index a7ac32f..0000000 --- a/.config/nvim/lua/chris/treesitter.lua +++ /dev/null @@ -1,111 +0,0 @@ -local status_ok, configs = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -configs.setup({ - ensure_installed = "all", -- one of "all" or a list of languages - sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) - ignore_install = { "phpdoc" }, -- List of parsers to ignore installing - matchup = { - enable = true, -- mandatory, false will disable the whole extension - disable_virtual_text = true, - disable = { "html" }, -- optional, list of language that will be disabled - }, - highlight = { - enable = true, -- false will disable the whole extension - disable = { "markdown" }, -- list of language that will be disabled - }, - autopairs = { - enable = true, - }, - indent = { enable = true, disable = { "python", "css", "rust" } }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - autotag = { - enable = true, - disable = { "xml", "markdown" }, - }, - rainbow = { - enable = true, - extended_mode = false, - colors = { - -- "#68a0b0", - -- "#946EaD", - -- "#c7aA6D", - "Gold", - "Orchid", - "DodgerBlue", - -- "Cornsilk", - -- "Salmon", - -- "LawnGreen", - }, - disable = { "html" }, - }, - playground = { - enable = true, - }, - textobjects = { - select = { - enable = true, - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["at"] = "@class.outer", - ["it"] = "@class.inner", - ["ac"] = "@call.outer", - ["ic"] = "@call.inner", - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - ["ai"] = "@conditional.outer", - ["ii"] = "@conditional.inner", - ["a/"] = "@comment.outer", - ["i/"] = "@comment.inner", - ["ab"] = "@block.outer", - ["ib"] = "@block.inner", - ["as"] = "@statement.outer", - ["is"] = "@scopename.inner", - ["aA"] = "@attribute.outer", - ["iA"] = "@attribute.inner", - ["aF"] = "@frame.outer", - ["iF"] = "@frame.inner", - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - }, - swap = { - enable = true, - swap_next = { - ["."] = "@parameter.inner", - }, - swap_previous = { - [","] = "@parameter.inner", - }, - }, - }, -}) diff --git a/.config/nvim/lua/chris/whichkey.lua b/.config/nvim/lua/chris/whichkey.lua deleted file mode 100644 index cba2dfd..0000000 --- a/.config/nvim/lua/chris/whichkey.lua +++ /dev/null @@ -1,246 +0,0 @@ -local status_ok, which_key = pcall(require, "which-key") -if not status_ok then - return -end - -local setup = { - plugins = { - marks = true, -- shows a list of your marks on ' and ` - registers = true, -- shows your registers on " in NORMAL or in INSERT mode - spelling = { - enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions - suggestions = 20, -- how many suggestions should be shown in the list? - }, - -- the presets plugin, adds help for a bunch of default keybindings in Neovim - -- No actual key bindings are created - presets = { - operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion - motions = false, -- adds help for motions - text_objects = false, -- help for text objects triggered after entering an operator - windows = true, -- default bindings on - nav = true, -- misc bindings to work with windows - z = true, -- bindings for folds, spelling and others prefixed with z - g = true, -- bindings for prefixed with g - }, - }, - key_labels = { - -- override the label used to display some keys. It doesn't effect WK in any other way. - [""] = "SPC", - }, - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "➜", -- symbol used between a key and it's label - group = "+", -- symbol prepended to a group - }, - popup_mappings = { - scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup - }, - window = { - border = "rounded", -- none, single, double, shadow - position = "bottom", -- bottom, top - margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] - padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] - winblend = 0, - }, - layout = { - height = { min = 4, max = 25 }, -- min and max height of the columns - width = { min = 20, max = 50 }, -- min and max width of the columns - spacing = 3, -- spacing between columns - align = "center", -- align columns left, center or right - }, - ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate - show_help = false, -- show help message on the command line when the popup is visible - triggers_blacklist = { - -- list of mode / prefixes that should never be hooked by WhichKey - -- this is mostly relevant for key maps that start with a native binding - -- most people should not need to change this - i = { "j", "k" }, - v = { "j", "k" }, - }, -} - -local opts = { - mode = "n", -- NORMAL mode - prefix = "", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps -} - -local m_opts = { - mode = "n", -- NORMAL mode - prefix = "m", - buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings - silent = true, -- use `silent` when creating keymaps - noremap = true, -- use `noremap` when creating keymaps - nowait = true, -- use `nowait` when creating keymaps -} - -local m_mappings = { - m = { 'lua require("harpoon.mark").add_file()', "Harpoon" }, - l = { 'lua require("harpoon.ui").nav_next()', "Harpoon Next" }, - h = { 'lua require("harpoon.ui").nav_prev()', "Harpoon Prev" }, - s = { "Telescope harpoon marks", "Search Files" }, - u = { 'lua require("harpoon.ui").toggle_quick_menu()', "Harpoon UI" }, - - ["1"] = { ' lua require("harpoon.ui").nav_file(1)', "Goto 1" }, - ["2"] = { ' lua require("harpoon.ui").nav_file(2)', "Goto 2" }, - ["3"] = { ' lua require("harpoon.ui").nav_file(3)', "Goto 3" }, - ["4"] = { ' lua require("harpoon.ui").nav_file(4)', "Goto 4" }, -} - -local mappings = { - a = { "Lspsaga code_action", "Action" }, - c = { "Bdelete", "Close Buffer" }, - H = { "split", "split" }, - h = { "lua vim.lsp.buf.hover()", "Hover" }, - n = { "NvimTreeToggle", "Explorer" }, - O = { "setlocal spell! spelllang=en_us", "Toggle Spelling" }, - P = { "!opout %", "Preview Document" }, - q = { 'lua require("user.functions").smart_quit()', "Quit" }, - V = { "vsplit", "vsplit" }, - w = { "w", "Write" }, - z = { "ZenMode", "Zen" }, - ["/"] = { 'lua require("Comment.api").toggle.linewise.current()', "Comment" }, - ["'"] = { "close", "Close split" }, - u = { "UndoTreeToggle", "Undo Tree" }, - - C = { - name = "Compiler", - c = { "w! | !compiler %", "Compile File" }, - b = { "w! | !pandoc % -t beamer -o presentation.pdf", "Beamer Presentation" }, - }, - - b = { - name = "Buffer", - b = { "Telescope buffers", "Telescope" }, - c = { "Bdelete!", "Close Buffer" }, - h = { "BufferLineCyclePrev", "Cycle Previous" }, - l = { "BufferLineCycleNext", "Cycle Next" }, - p = { "BufferLinePickClose", "Pick Close" }, - }, - - p = { - name = "Packer", - c = { "PackerCompile", "Compile" }, - i = { "PackerInstall", "Install" }, - s = { "PackerSync", "Sync" }, - S = { "PackerStatus", "Status" }, - u = { "PackerUpdate", "Update" }, - }, - - o = { - name = "Options", - c = { "lua vim.g.cmp_active=false", "Completion off" }, - C = { "lua vim.g.cmp_active=true", "Completion on" }, - w = { 'lua require("user.functions").toggle_option("wrap")', "Wrap" }, - r = { 'lua require("user.functions").toggle_option("relativenumber")', "Relative" }, - l = { 'lua require("user.functions").toggle_option("cursorline")', "Cursorline" }, - s = { 'lua require("user.functions").toggle_option("spell")', "Spell" }, - t = { 'lua require("user.functions").toggle_tabline()', "Tabline" }, - }, - - r = { - name = "Replace", - r = { "lua require('spectre').open()", "Replace" }, - w = { "lua require('spectre').open_visual({select_word=true})", "Replace Word" }, - f = { "lua require('spectre').open_file_search()", "Replace Buffer" }, - }, - - d = { - name = "Debug", - b = { "lua require'dap'.toggle_breakpoint()", "Breakpoint" }, - c = { "lua require'dap'.continue()", "Continue" }, - i = { "lua require'dap'.step_into()", "Into" }, - o = { "lua require'dap'.step_over()", "Over" }, - O = { "lua require'dap'.step_out()", "Out" }, - r = { "lua require'dap'.repl.toggle()", "Repl" }, - l = { "lua require'dap'.run_last()", "Last" }, - u = { "lua require'dapui'.toggle()", "UI" }, - x = { "lua require'dap'.terminate()", "Exit" }, - }, - - f = { - name = "Find", - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope colorscheme", "Colorscheme" }, - f = { "Telescope find_files", "Find files" }, - t = { "Telescope live_grep", "Find Text" }, - s = { "Telescope grep_string", "Find String" }, - h = { "Telescope help_tags", "Help" }, - H = { "Telescope highlights", "Highlights" }, - l = { "Telescope resume", "Last Search" }, - M = { "Telescope man_pages", "Man Pages" }, - r = { "Telescope oldfiles", "Recent File" }, - R = { "Telescope registers", "Registers" }, - k = { "Telescope keymaps", "Keymaps" }, - C = { "Telescope commands", "Commands" }, - }, - - g = { - name = "Git", - g = { "Git", "Git" }, - j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, - k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, - l = { "GitBlameToggle", "Blame" }, - p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, - r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, - R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, - s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, - u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk", - }, - o = { "Telescope git_status", "Open changed file" }, - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope git_commits", "Checkout commit" }, - d = { - "Gitsigns diffthis HEAD", - "Diff", - }, - }, - - l = { - name = "LSP", - a = { "Lspsaga code_action", "Code Action" }, - t = { "TroubleToggle document_diagnostics", "Diagnostics" }, - d = { "lua vim.lsp.buf.definition()", "Definition" }, - w = { - "TroubleToggle workspace_diagnostics", - "Workspace Diagnostics", - }, - f = { "lua vim.lsp.buf.format({ async = true })", "Format" }, - F = { "LspToggleAutoFormat", "Toggle Autoformat" }, - h = { "lua vim.lsp.buf.hover()", "Hover" }, - i = { "lua vim.lsp.buf.implementation()", "Implementation" }, - I = { "LspInfo", "Info" }, - j = { - "lua vim.diagnostic.goto_next({buffer=0})", - "Next Diagnostic", - }, - k = { - "lua vim.diagnostic.goto_prev({buffer=0})", - "Prev Diagnostic", - }, - v = { "lua require('lsp_lines').toggle()", "Virtual Text" }, - l = { "lua vim.lsp.codelens.run()", "CodeLens Action" }, - o = { "SymbolsOutline", "Outline" }, - r = { "lua vim.lsp.buf.rename()", "Rename" }, - R = { "TroubleToggle lsp_references", "References" }, - s = { "Telescope lsp_document_symbols", "Document Symbols" }, - S = { - "Telescope lsp_dynamic_workspace_symbols", - "Workspace Symbols", - }, - T = { 'lua require("user.functions").toggle_diagnostics()', "Toggle Diagnostics" }, - u = { "LuaSnipUnlinkCurrent", "Unlink Snippet" }, - M = { "Mason", "Open Mason UI" }, - }, -} - -which_key.setup(setup) -which_key.register(mappings, opts) -which_key.register(m_mappings, m_opts) diff --git a/.config/nvim/lua/chris/winbar.lua b/.config/nvim/lua/chris/winbar.lua deleted file mode 100644 index eda8bfd..0000000 --- a/.config/nvim/lua/chris/winbar.lua +++ /dev/null @@ -1,40 +0,0 @@ -local status_ok, winbar = pcall(require, "winbar") -if not status_ok then - return -end - -winbar.setup({ - enabled = true, - - show_file_path = false, - show_symbols = true, - - colors = { - path = '', -- You can customize colors like #c946fd - file_name = '', - symbols = '', - }, - - icons = { - file_icon_default = '', - seperator = '>', - editor_state = '●', - lock_icon = '', - }, - - exclude_filetype = { - 'help', - 'startify', - 'dashboard', - 'packer', - 'neogitstatus', - 'NvimTree', - 'Trouble', - 'alpha', - 'lir', - 'Outline', - 'spectre_panel', - 'toggleterm', - 'qf', - } -}) diff --git a/.config/nvim/lua/chris/zen-mode.lua b/.config/nvim/lua/chris/zen-mode.lua deleted file mode 100644 index 78067a9..0000000 --- a/.config/nvim/lua/chris/zen-mode.lua +++ /dev/null @@ -1,40 +0,0 @@ -local status_ok, zen_mode = pcall(require, "zen-mode") -if not status_ok then - return -end - -zen_mode.setup { - window = { - backdrop = 1, - height = 0.9, - width = 80, - options = { - signcolumn = "no", - number = false, - relativenumber = false, - cursorline = true, - cursorcolumn = false, -- disable cursor column - }, - }, - plugins = { - gitsigns = { enabled = false }, - tmux = { enabled = false }, - twilight = { enabled = false }, - }, - on_open = function() - vim.g.cmp_active = false - vim.cmd [[LspStop]] - local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" }) - if not status_ok then - return - end - if vim.fn.exists("#" .. "_winbar") == 1 then - vim.cmd("au! " .. "_winbar") - end - end, - on_close = function() - vim.g.cmp_active = true - vim.cmd [[LspStart]] - require("user.winbar").create_winbar() - end, -} diff --git a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua index eddf51a..d540873 100644 --- a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua +++ b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua @@ -5,7 +5,6 @@ return { event = "BufReadPre", dependencies = { { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, - { "folke/neodev.nvim", config = true }, "mason.nvim", "williamboman/mason-lspconfig.nvim", "hrsh7th/cmp-nvim-lsp", diff --git a/.config/nvim/lua/lazyvim/plugins/utility.lua b/.config/nvim/lua/lazyvim/plugins/utility.lua index 4bde1cc..559bd81 100644 --- a/.config/nvim/lua/lazyvim/plugins/utility.lua +++ b/.config/nvim/lua/lazyvim/plugins/utility.lua @@ -19,9 +19,6 @@ return { { "nvim-lua/popup.nvim", }, - { - "folke/neodev.nvim", - }, -- { -- "rcarriga/nvim-notify", -- opts = { diff --git a/.config/nvim/lua/lazyvim/plugins/zk.lua b/.config/nvim/lua/lazyvim/plugins/zk.lua index 9e6f7dc..3c85c4a 100644 --- a/.config/nvim/lua/lazyvim/plugins/zk.lua +++ b/.config/nvim/lua/lazyvim/plugins/zk.lua @@ -1,32 +1,32 @@ return { - { - "mickael-menu/zk-nvim", - event = "VeryLazy", - opts = { - picker = "telescope", - }, - config = function(_, opts) - require("zk").setup(opts) + { + "mickael-menu/zk-nvim", + event = "VeryLazy", + opts = { + picker = "telescope", + }, + config = function(_, opts) + require("zk").setup(opts) - local function yankName(options, picker_options) - require("zk").pick_notes(options, picker_options, function(notes) - local pos = vim.api.nvim_win_get_cursor(0)[2] - local line = vim.api.nvim_get_current_line() + local function yankName(options, picker_options) + require("zk").pick_notes(options, picker_options, function(notes) + local pos = vim.api.nvim_win_get_cursor(0)[2] + local line = vim.api.nvim_get_current_line() - if picker_options.multi_select == false then - notes = { notes } - end - for _, note in ipairs(notes) do + if picker_options.multi_select == false then + notes = { notes } + end + for _, note in ipairs(notes) do -- stylua: ignore - local nline = line:sub(0, pos) .. note.title .. " - " .. note.path .. line:sub(pos + 1) - vim.api.nvim_set_current_line(nline) - end - end) - end + local nline = line:sub(0, pos) .. note.title .. " - " .. note.path .. line:sub(pos + 1) + vim.api.nvim_set_current_line(nline) + end + end) + end - require("zk.commands").add("ZkInsertLink", function(options) - yankName(options, { title = "Zk Yank" }) - end) - end, - }, + require("zk.commands").add("ZkInsertLink", function(options) + yankName(options, { title = "Zk Yank" }) + end) + end, + }, }