diff --git a/after/plugin/ccc.lua b/after/plugin/ccc.lua deleted file mode 100644 index 8499e0f..0000000 --- a/after/plugin/ccc.lua +++ /dev/null @@ -1,131 +0,0 @@ -local status_ok, ccc = pcall(require, "ccc") -if not status_ok then - return -end - -local ColorInput = require("ccc.input") -local convert = require("ccc.utils.convert") - -local RgbHslInput = setmetatable({ - name = "RGB/HSL", - max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 }, - min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 }, - bar_name = { "R", "G", "B", "H", "S", "L" }, -}, { __index = ColorInput }) - -function RgbHslInput.format(n, i) - if i <= 3 then - -- RGB - n = n * 255 - elseif i >= 5 then - -- S or L of HSL - n = n * 100 - end - return ("%6d"):format(n) -end - -function RgbHslInput.from_rgb(RGB) - local HSL = convert.rgb2hsl(RGB) - local R, G, B = unpack(RGB) - local H, S, L = unpack(HSL) - return { R, G, B, H, S, L } -end - -function RgbHslInput.to_rgb(value) - return { value[1], value[2], value[3] } -end - -function RgbHslInput:_set_rgb(RGB) - self.value[1] = RGB[1] - self.value[2] = RGB[2] - self.value[3] = RGB[3] -end - -function RgbHslInput:_set_hsl(HSL) - self.value[4] = HSL[1] - self.value[5] = HSL[2] - self.value[6] = HSL[3] -end - -function RgbHslInput:callback(index, new_value) - self.value[index] = new_value - local v = self.value - if index <= 3 then - local RGB = { v[1], v[2], v[3] } - local HSL = convert.rgb2hsl(RGB) - self:_set_hsl(HSL) - else - local HSL = { v[4], v[5], v[6] } - local RGB = convert.hsl2rgb(HSL) - self:_set_rgb(RGB) - end -end - -ccc.setup({ - pickers = { - ccc.picker.custom_entries({ - bg = "#1a1b26", - bg_dark = "#16161e", - bg_float = "#16161e", - bg_highlight = "#292e42", - bg_popup = "#16161e", - bg_search = "#3d59a1", - bg_sidebar = "#16161e", - bg_statusline = "#16161e", - bg_visual = "#283457", - black = "#15161e", - blue = "#7aa2f7", - blue0 = "#3d59a1", - blue1 = "#2ac3de", - blue2 = "#0db9d7", - blue5 = "#89ddff", - blue6 = "#b4f9f8", - blue7 = "#394b70", - border = "#15161e", - border_highlight = "#27a1b9", - comment = "#565f89", - cyan = "#7dcfff", - dark3 = "#545c7e", - dark5 = "#737aa2", - delta_add = "#2c5a66", - delta_delete = "#713137", - diff_add = "#20303b", - diff_change = "#1f2231", - diff_delete = "#37222c", - diff_text = "#394b70", - error = "#db4b4b", - fg = "#c0caf5", - fg_dark = "#a9b1d6", - fg_float = "#c0caf5", - fg_gutter = "#3b4261", - fg_sidebar = "#a9b1d6", - git_add = "#449dab", - git_change = "#6183bb", - git_delete = "#914c54", - git_ignore = "#545c7e", - gitSigns_add = "#266d6a", - gitSigns_change = "#536c9e", - gitSigns_delete = "#b2555b", - green = "#9ece6a", - green1 = "#73daca", - green2 = "#41a6b5", - hint = "#1abc9c", - info = "#0db9d7", - magenta = "#bb9af7", - magenta2 = "#ff007c", - none = "NONE", - orange = "#ff9e64", - purple = "#9d7cd8", - red = "#f7768e", - red1 = "#db4b4b", - teal = "#1abc9c", - terminal_black = "#414868", - warning = "#e0af68", - yellow = "#e0af68", - }), - }, - inputs = { - RgbHslInput, - }, -}) diff --git a/after/plugin/cmake.lua b/after/plugin/cmake.lua deleted file mode 100644 index f56f397..0000000 --- a/after/plugin/cmake.lua +++ /dev/null @@ -1,21 +0,0 @@ -local status_ok, cmake = pcall(require, "cmake-tools") -if not status_ok then - return -end - -cmake.setup({ - cmake_command = "cmake", - cmake_build_directory = "target/build/", - cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is "", this option will be activated - cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" }, - cmake_soft_link_compile_commands = true, -- if softlink compile commands json file - cmake_build_options = {}, - cmake_console_size = 15, -- cmake output window height - cmake_console_position = "belowright", -- "belowright", "aboveleft", ... - cmake_show_console = "always", -- "always", "only_on_error" - cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional - cmake_variants_message = { - short = { show = true }, - long = { show = true, max_length = 40 }, - }, -}) diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua deleted file mode 100644 index fe9375a..0000000 --- a/after/plugin/cmp.lua +++ /dev/null @@ -1,95 +0,0 @@ -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local luasnip_status_ok, luasnip = pcall(require, "luasnip") -if not luasnip_status_ok then - return -end - -local kind_icons = { - Text = "󰉿", - Method = "󰆧", - Function = "󰊕", - Constructor = "", - Field = "󰜢", - Variable = "󰀫", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "󰑭", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈙", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "󰙅", - Event = "", - Operator = "󰆕", - TypeParameter = "", -} - -cmp.setup({ - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = 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 = true }), - }, - sources = { - { name = "gh_issues" }, - { name = "nvim_lua" }, - { name = "nvim_lsp" }, - { name = "path" }, - { name = "luasnip" }, - { name = "buffer" }, - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - formatting = { - fields = { "abbr", "kind", "menu" }, - format = function(entry, vim_item) - vim_item.kind = kind_icons[vim_item.kind] - vim_item.menu = ({ - nvim_lsp = "[LSP]", - nvim_lua = "[api]", - luasnip = "[snip]", - buffer = "[buf]", - path = "[path]", - emoji = "[emoji]", - gh_issues = "[issues]", - })[entry.source.name] - return vim_item - end, - }, - - experimental = { - ghost_text = true, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - confirm_opts = { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, -}) diff --git a/after/plugin/cmp_gh_source.lua b/after/plugin/cmp_gh_source.lua deleted file mode 100644 index f6d1219..0000000 --- a/after/plugin/cmp_gh_source.lua +++ /dev/null @@ -1,75 +0,0 @@ -local plenary_status_ok, plenary = pcall(require, "plenary.job") -if not plenary_status_ok then - return -end - -local source = {} - -local enabled = true - -source.new = function() - return setmetatable({ cache = {} }, { __index = source }) -end - -source.complete = function(self, _, callback) - if not enabled then - return - end - - local bufnr = vim.api.nvim_get_current_buf() - - -- This just makes sure that we only hit the GH API once per session. - -- - -- You could remove this if you wanted, but this just makes it so we're - -- good programming citizens. - if not self.cache[bufnr] then - plenary - :new({ - -- Uses `gh` executable to request the issues from the remote repository. - "gh", - "issue", - "list", - "--limit", - "1000", - "--json", - "title,number,body", - on_exit = function(job) - local result = job:result() - local parser_status_ok, parsed = pcall(vim.json.decode, table.concat(result, "")) - if not parser_status_ok then - enabled = false - return - end - - local items = {} - for _, gh_item in ipairs(parsed) do - gh_item.body = string.gsub(gh_item.body or "", "\r", "") - - table.insert(items, { - label = string.format("#%s", gh_item.number), - documentation = { - kind = "markdown", - value = string.format("# %s\n\n%s", gh_item.title, gh_item.body), - }, - }) - end - - callback({ items = items, isIncomplete = false }) - self.cache[bufnr] = items - end, - }) - :start() - else - callback({ items = self.cache[bufnr], isIncomplete = false }) - end -end - -source.get_trigger_characters = function() - return { "#" } -end - -source.is_available = function() - return vim.bo.filetype == "gitcommit" -end - -require("cmp").register_source("gh_issues", source.new()) diff --git a/after/plugin/colorizer.lua b/after/plugin/colorizer.lua deleted file mode 100644 index 37dedd7..0000000 --- a/after/plugin/colorizer.lua +++ /dev/null @@ -1,34 +0,0 @@ -local status_ok, colorizer = pcall(require, "colorizer") -if not status_ok then - return -end - -colorizer.setup({ - filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml" }, - user_default_options = { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - names = false, -- "Name" codes like Blue or blue - RRGGBBAA = true, -- #RRGGBBAA hex codes - AARRGGBB = true, -- 0xAARRGGBB hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - -- Available modes for `mode`: foreground, background, virtualtext - mode = "background", -- Set the display mode. - -- Available methods are false / true / "normal" / "lsp" / "both" - -- True is same as normal - tailwind = true, -- Enable tailwind colors - -- parsers can contain values used in |user_default_options| - sass = { - enable = true, - parsers = { "css" }, - }, -- Enable sass colors - virtualtext = "■", - }, - -- all the sub-options of filetypes apply to buftypes - buftypes = {}, - html = { names = true }, - css = { names = true }, -}) diff --git a/after/plugin/comment.lua b/after/plugin/comment.lua deleted file mode 100644 index 9744a46..0000000 --- a/after/plugin/comment.lua +++ /dev/null @@ -1,62 +0,0 @@ -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup({ - ---Add a space b/w comment and the line - padding = true, - ---Whether the cursor should stay at its position - sticky = true, - ---Lines to be ignored while (un)comment - ignore = nil, - ---LHS of toggle mappings in NORMAL mode - toggler = { - ---Line-comment toggle keymap - line = "gcc", - ---Block-comment toggle keymap - block = "gbb", - }, - -- -LHS of operator-pending mappings in NORMAL and VISUAL mode - opleader = { - ---Line-comment keymap - line = "gc", - ---Block-comment keymap - block = "gb", - }, - ---LHS of extra mappings - extra = { - ---Add comment on the line above - above = "gcO", - ---Add comment on the line below - below = "gco", - ---Add comment at the end of line - eol = "gcA", - }, - --- Enable keybindings - --- NOTE: If given `false` then the plugin won't create any mappings - mappings = { - ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` - basic = true, - ---Extra mapping; `gco`, `gcO`, `gcA` - extra = true, - ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` - extended = true, - }, - ---Function to call before (un)comment - -- pre_hook = function(ctx) - -- local U = require("Comment.utils") - -- - -- local location = nil - -- if ctx.ctype == U.ctype.block then - -- location = require("ts_context_commentstring.utils").get_cursor_location() - -- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - -- location = require("ts_context_commentstring.utils").get_visual_start_location() - -- end - -- - -- return require("ts_context_commentstring.internal").calculate_commentstring({ - -- key = ctx.ctype == U.ctype.line and "__default" or "__multiline", - -- location = location, - -- }) - -- end, -}) diff --git a/after/plugin/crates.lua b/after/plugin/crates.lua deleted file mode 100644 index 21f5ba9..0000000 --- a/after/plugin/crates.lua +++ /dev/null @@ -1,144 +0,0 @@ -local status_ok, crates = pcall(require, "crates") -if not status_ok then - return -end - -crates.setup({ - smart_insert = true, - insert_closing_quote = true, - avoid_prerelease = true, - autoload = true, - autoupdate = true, - loading_indicator = true, - date_format = "%d-%m-%Y", - thousands_separator = ".", - notification_title = "Crates", - disable_invalid_feature_diagnostic = false, - text = { - loading = "  Loading", - version = "  %s", - prerelease = "  %s", - yanked = "  %s", - nomatch = "  No match", - upgrade = "  %s", - error = "  Error fetching crate", - }, - highlight = { - loading = "CratesNvimLoading", - version = "CratesNvimVersion", - prerelease = "CratesNvimPreRelease", - yanked = "CratesNvimYanked", - nomatch = "CratesNvimNoMatch", - upgrade = "CratesNvimUpgrade", - error = "CratesNvimError", - }, - popup = { - autofocus = false, - copy_register = '"', - style = "minimal", - border = "none", - show_version_date = false, - show_dependency_version = true, - max_height = 30, - min_width = 20, - padding = 1, - text = { - title = " %s", - pill_left = "", - pill_right = "", - description = "%s", - created_label = " created ", - created = "%s", - updated_label = " updated ", - updated = "%s", - downloads_label = " downloads ", - downloads = "%s", - homepage_label = " homepage ", - homepage = "%s", - repository_label = " repository ", - repository = "%s", - documentation_label = " documentation ", - documentation = "%s", - crates_io_label = " crates.io ", - crates_io = "%s", - categories_label = " categories ", - keywords_label = " keywords ", - version = " %s", - prerelease = " %s", - yanked = " %s", - version_date = " %s", - feature = " %s", - enabled = " %s", - transitive = " %s", - normal_dependencies_title = " Dependencies", - build_dependencies_title = " Build dependencies", - dev_dependencies_title = " Dev dependencies", - dependency = " %s", - optional = " %s", - dependency_version = " %s", - loading = "  ", - }, - highlight = { - title = "CratesNvimPopupTitle", - pill_text = "CratesNvimPopupPillText", - pill_border = "CratesNvimPopupPillBorder", - description = "CratesNvimPopupDescription", - created_label = "CratesNvimPopupLabel", - created = "CratesNvimPopupValue", - updated_label = "CratesNvimPopupLabel", - updated = "CratesNvimPopupValue", - downloads_label = "CratesNvimPopupLabel", - downloads = "CratesNvimPopupValue", - homepage_label = "CratesNvimPopupLabel", - homepage = "CratesNvimPopupUrl", - repository_label = "CratesNvimPopupLabel", - repository = "CratesNvimPopupUrl", - documentation_label = "CratesNvimPopupLabel", - documentation = "CratesNvimPopupUrl", - crates_io_label = "CratesNvimPopupLabel", - crates_io = "CratesNvimPopupUrl", - categories_label = "CratesNvimPopupLabel", - keywords_label = "CratesNvimPopupLabel", - version = "CratesNvimPopupVersion", - prerelease = "CratesNvimPopupPreRelease", - yanked = "CratesNvimPopupYanked", - version_date = "CratesNvimPopupVersionDate", - feature = "CratesNvimPopupFeature", - enabled = "CratesNvimPopupEnabled", - transitive = "CratesNvimPopupTransitive", - normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle", - build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle", - dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle", - dependency = "CratesNvimPopupDependency", - optional = "CratesNvimPopupOptional", - dependency_version = "CratesNvimPopupDependencyVersion", - loading = "CratesNvimPopupLoading", - }, - keys = { - hide = { "q", "" }, - open_url = { "" }, - select = { "" }, - select_alt = { "s" }, - toggle_feature = { "" }, - copy_value = { "yy" }, - goto_item = { "gd", "K", "" }, - jump_forward = { "" }, - jump_back = { "", "" }, - }, - }, - src = { - insert_closing_quote = true, - text = { - prerelease = "  pre-release ", - yanked = "  yanked ", - }, - coq = { - enabled = false, - name = "Crates", - }, - }, - null_ls = { - enabled = false, - name = "Crates", - }, -}) diff --git a/after/plugin/dap.lua b/after/plugin/dap.lua index 9daae24..3c60c67 100644 --- a/after/plugin/dap.lua +++ b/after/plugin/dap.lua @@ -1,65 +1,5 @@ -local status_mason_dap_ok, mason_dap = pcall(require, "mason-nvim-dap") -if not status_mason_dap_ok then - return -end - -local dap_status_ok, dap = pcall(require, "dap") -if not dap_status_ok then - return -end - -local dap_ui_status_ok, dapui = pcall(require, "dapui") -if not dap_ui_status_ok then - return -end - -local dap_install_status_ok, dap_install = pcall(require, "dap-install") -if not dap_install_status_ok then - return -end - -mason_dap.setup({ - automatic_installation = true, - automatic_setup = true, -}) --- add other configs here - -dapui.setup({ - layouts = { - { - elements = { - "scopes", - "breakpoints", - "stacs", - "watches", - }, - size = 40, - position = "left", - }, - { - elements = { - "repl", - "console", - }, - size = 10, - position = "bottom", - }, - }, - -- sidebar = { - -- elements = { - -- { - -- id = "scopes", - -- size = 0.25, -- Can be float or integer > 1 - -- }, - -- { id = "breakpoints", size = 0.25 }, - -- }, - -- size = 40, - -- position = "right", -- Can be "left", "right", "top", "bottom" - -- }, - -- tray = { - -- elements = {}, - -- }, -}) +local dap = require("dap") +local dapui = require("dapui") vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua deleted file mode 100644 index 6af70f4..0000000 --- a/after/plugin/gitsigns.lua +++ /dev/null @@ -1,14 +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" }, - }, -}) diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua deleted file mode 100644 index 642893d..0000000 --- a/after/plugin/harpoon.lua +++ /dev/null @@ -1,17 +0,0 @@ -local status_ok, harpoon = pcall(require, "harpoon") -if not status_ok then - return -end -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - -harpoon.setup() - -local keymap = vim.keymap.set -local opts = { silent = true } - -for i = 1, 12, 1 do - keymap("n", "", function() - ui.nav_file(i) - end) -end diff --git a/after/plugin/hologram.lua b/after/plugin/hologram.lua deleted file mode 100644 index 636c7db..0000000 --- a/after/plugin/hologram.lua +++ /dev/null @@ -1,8 +0,0 @@ -local status_ok, hologram = pcall(require, "hologram") -if not status_ok then - return -end - -hologram.setup({ - auto_display = true, -}) diff --git a/after/plugin/illuminate.lua b/after/plugin/illuminate.lua deleted file mode 100644 index bfcde5d..0000000 --- a/after/plugin/illuminate.lua +++ /dev/null @@ -1,13 +0,0 @@ -vim.g.Illuminate_ftblacklist = { "alpha", "NvimTree" } -vim.api.nvim_set_keymap( - "n", - "", - "lua require('illuminate').next_reference{wrap=true}", - { noremap = true } -) -vim.api.nvim_set_keymap( - "n", - "", - "lua require('illuminate').next_reference{reverse=true,wrap=true}", - { noremap = true } -) diff --git a/after/plugin/impatient.lua b/after/plugin/impatient.lua deleted file mode 100644 index fa64f00..0000000 --- a/after/plugin/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/after/plugin/indentline.lua b/after/plugin/indentline.lua deleted file mode 100644 index d7d482a..0000000 --- a/after/plugin/indentline.lua +++ /dev/null @@ -1,80 +0,0 @@ -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end - -local g = vim.g -local opt = vim.opt -local cmd = vim.cmd -g.indent_blankline_buftype_exclude = { "terminal", "nofile" } -g.indent_blankline_filetype_exclude = { - "help", - "startify", - "dashboard", - "packer", - "neogitstatus", - "NvimTree", - "Trouble", -} -g.indentLine_enabled = 1 -g.indent_blankline_char = "▎" -g.indent_blankline_show_trailing_blankline_indent = false -g.indent_blankline_show_first_indent_level = true -g.indent_blankline_use_treesitter = true -g.indent_blankline_show_current_context = true -g.indent_blankline_context_patterns = { - "class", - "return", - "function", - "method", - "^if", - "^while", - "jsx_element", - "^for", - "^object", - "^table", - "block", - "arguments", - "if_statement", - "else_clause", - "jsx_element", - "jsx_self_closing_element", - "try_statement", - "catch_clause", - "import_statement", - "operation_type", -} -vim.wo.colorcolumn = "99999" -cmd([[highlight IndentBlanklineIndent1 guifg=#C678DD gui=nocombine]]) -cmd([[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]]) -cmd([[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]]) -cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]]) -cmd([[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]]) -cmd([[highlight IndentBlanklineIndent6 guifg=#E06C75 gui=nocombine]]) -opt.list = true -opt.listchars:append("space:⋅") -opt.listchars:append("eol:↴") -indent_blankline.setup({ - char = "▏", - show_trailing_blankline_indent = false, - show_first_indent_level = true, - use_treesitter = true, - show_end_of_line = true, - space_char_blankline = " ", - show_current_context = true, - show_current_context_start = true, - char_highlight_list = { - "IndentBlanklineIndent1", - "IndentBlanklineIndent2", - "IndentBlanklineIndent3", - "IndentBlanklineIndent4", - "IndentBlanklineIndent5", - "IndentBlanklineIndent6", - }, - buftype_exclude = { "terminal", "nofile" }, - filetype_exclude = { - "help", - "packer", - "NvimTree", - }, -}) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua new file mode 100644 index 0000000..49a77de --- /dev/null +++ b/after/plugin/lsp.lua @@ -0,0 +1,314 @@ +local lsp = require("lsp-zero").preset({ + float_border = "rounded", + call_servers = "local", + configure_diagnostics = true, + setup_servers_on_start = true, + set_lsp_keymaps = { + preserve_mappings = false, + omit = {}, + }, + manage_nvim_cmp = { + set_sources = "recommended", + set_basic_mappings = false, + set_extra_mappings = false, + use_luasnip = true, + set_format = true, + documentation_window = true, + }, +}) + +lsp.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp.default_keymaps({ buffer = bufnr }) + local opts = { buffer = bufnr } + local bind = vim.keymap.set + + bind("n", "gD", "lua vim.lsp.buf.declaration()", opts) + bind("n", "gd", "lua require('telescope.builtin').lsp_definitions()", opts) + bind("n", "K", "lua vim.lsp.buf.hover()", opts) + bind("n", "gI", "lua vim.lsp.buf.implementation()", opts) + bind("n", "gr", "lua require('telescope.builtin').lsp_references()", opts) + bind("n", "gl", "lua vim.diagnostic.open_float()", opts) +end) + +lsp.ensure_installed({ + "bashls", + "clangd", + "cmake", + "cssls", + "emmet_ls", + "html", + "jedi_language_server", + "jsonls", + "lua_ls", + "ruff_lsp", + "rust_analyzer", + "sqlls", + "tailwindcss", + "taplo", + "texlab", + "tsserver", +}) + +lsp.configure("clangd", { + capabilities = { + offsetEncoding = { "utf-16" }, + }, + on_attach = function() + require("clangd_extensions.inlay_hints").setup_autocmd() + require("clangd_extensions.inlay_hints").set_inlay_hints() + end, +}) + +lsp.configure("bashls", { + filetypes = { + "sh", + "bash", + "zsh", + }, +}) + +lsp.configure("emmet_ls", { + filetypes = { + "html", + "htmldjango", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "eruby", + }, +}) + +lsp.configure("texlab", { + settings = { + texlab = { + auxDirectory = ".", + bibtexFormatter = "texlab", + build = { + args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, + executable = "xelatex", + forwardSearchAfter = false, + onSave = false, + }, + chktex = { + onEdit = false, + onOpenAndSave = false, + }, + diagnosticsDelay = 0, + formatterLineLength = 120, + forwardSearch = { + args = {}, + }, + latexFormatter = "latexindent", + latexindent = { + modifyLineBreaks = false, + }, + }, + }, +}) + +require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls({ + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim", "awesome", "client" }, + }, + -- workspace = { + -- Make the server aware of Neovim runtime files + -- library = vim.api.nvim_get_runtime_file("", true), + -- }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + root_pattern = { + ".stylua.toml", + ".luarc.json", + ".luarc.jsonc", + ".luacheckrc", + "stylua.toml", + "selene.toml", + "selene.yml", + ".git", + }, + format = { + enable = false, + }, + }, + }, +})) + +lsp.setup() + +local null_ls = require("null-ls") +-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics +local formatting = null_ls.builtins.formatting +-- https://github.com/prettier-solidity/prettier-plugin-solidity +local diagnostics = null_ls.builtins.diagnostics + +null_ls.setup({ + sources = { + -- Here you can add tools not supported by mason.nvim + -- make sure the source name is supported by null-ls + -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md + + diagnostics.luacheck.with({ extra_args = { "--globals", "vim" } }), + formatting.cbfmt.with({ extra_filetypes = { "vimwiki" } }), + formatting.prettier.with({ + extra_filetypes = { "toml" }, + extra_args = { + "--no-semi", + "--double-quote", + "--no-bracket-spacing", + "--tab-width", + "4", + "--bracket-same-line", + "--html-whitespace-sensitivity", + "strict", + }, + }), + formatting.remark.with({ extra_filetypes = { "vimwiki" } }), + formatting.markdown_toc.with({ extra_filetypes = { "vimwiki" } }), + formatting.shellharden.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), + formatting.shfmt.with({ extra_filetypes = { "bash", "csh", "ksh", "zsh" } }), + }, +}) + +-- See mason-null-ls.nvim's documentation for more details: +-- https://github.com/jay-babu/mason-null-ls.nvim#setup +require("mason-null-ls").setup({ + ensure_installed = { + "cmake_lint", + "codespell", + "cpplint", + "luacheck", + "misspell", + "mypy", + "beautysh", + "cbfmt", + "clang_format", + "cmake_format", + "djlint", + "google_java_format", + "phpcbf", + "prettier", + "remark", + "markdown_toc", + "shellharden", + "shfmt", + "stylua", + "usort", + "yamlfmt", + }, + automatic_installation = true, + handlers = { + -- Here you can add functions to register sources. + -- See https://github.com/jay-babu/mason-null-ls.nvim#handlers-usage + -- + -- If left empty, mason-null-ls will use a "default handler" + -- to register all sources + }, +}) + +local cmp = require("cmp") +local cmp_action = require("lsp-zero").cmp_action() +local luasnip = require("luasnip") + +local kind_icons = { + Text = "󰉿", + Method = "󰆧", + Function = "󰊕", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈙", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "", +} + +cmp.setup({ + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = 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 = true }), + }, + sources = { + { name = "gh_issues" }, + { name = "nvim_lua" }, + { name = "nvim_lsp" }, + { name = "crates" }, + { name = "path" }, + { name = "luasnip" }, + { name = "buffer" }, + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + formatting = { + fields = { "abbr", "kind", "menu" }, + format = function(entry, vim_item) + vim_item.kind = kind_icons[vim_item.kind] + vim_item.menu = ({ + nvim_lsp = "[LSP]", + nvim_lua = "[api]", + luasnip = "[snip]", + buffer = "[buf]", + path = "[path]", + emoji = "[emoji]", + gh_issues = "[issues]", + })[entry.source.name] + return vim_item + end, + }, + + experimental = { + ghost_text = true, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, +}) + +local cmp_autopairs = require("nvim-autopairs.completion.cmp") +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua deleted file mode 100644 index b6638e0..0000000 --- a/after/plugin/lualine.lua +++ /dev/null @@ -1,24 +0,0 @@ -local status_ok, lualine = pcall(require, "lualine") -if not status_ok then - return -end - -lualine.setup({ - options = { - globalstatus = true, - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { "alpha", "dashboard" }, - always_divide_middle = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { "diff" }, - lualine_x = { "lsp_progress", "diagnostics" }, - lualine_y = { "filename" }, - lualine_z = { "location", "progress" }, - }, -}) diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua index 353cc1a..45429bf 100644 --- a/after/plugin/luasnip.lua +++ b/after/plugin/luasnip.lua @@ -1,7 +1,4 @@ -local status_ok, ls = pcall(require, "luasnip") -if not status_ok then - return -end +local ls = require("luasnip") require("luasnip/loaders/from_vscode").lazy_load() @@ -89,23 +86,6 @@ end ls.add_snippets(nil, { all = {}, - lua = { - s( - "status", - fmt( - [[ - local status_ok, {} = pcall(require, "{}") - if not status_ok then - return - end - ]], - { - i(1), - same(1), - } - ) - ), - }, rust = { s( "modtest", @@ -201,14 +181,11 @@ ls.add_snippets(nil, { ]], { i(1), - c( - 2, - { - t("Kristofers Solo"), - t("Kristiāns Francis Cagulis, kc22015"), - t("Kristiāns Francis Cagulis"), - } - ), + c(2, { + t("Kristofers Solo"), + t("Kristiāns Francis Cagulis, kc22015"), + t("Kristiāns Francis Cagulis"), + }), i(0), } ) diff --git a/after/plugin/markdown-preview.lua b/after/plugin/markdown-preview.lua deleted file mode 100644 index b53d68d..0000000 --- a/after/plugin/markdown-preview.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status_ok, markdown_preview = pcall(require, "markdown-preview") -if not status_ok then - return -end - -markdown_preview.setup({}) diff --git a/after/plugin/nvim-tree.lua b/after/plugin/nvim-tree.lua deleted file mode 100644 index 34fb19c..0000000 --- a/after/plugin/nvim-tree.lua +++ /dev/null @@ -1,126 +0,0 @@ -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -local function on_attach(bufnr) - local api_status_ok, api = pcall(require, "nvim-tree.api") - if not api_status_ok then - return - end - - local function opts(desc) - return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } - end - local keymap = vim.keymap.set - - -- Default mappings. Feel free to modify or remove as you wish. - -- - -- BEGIN_DEFAULT_ON_ATTACH - keymap("n", "", api.tree.change_root_to_node, opts("CD")) - keymap("n", "", api.node.open.replace_tree_buffer, opts("Open: In Place")) - keymap("n", "", api.node.show_info_popup, opts("Info")) - keymap("n", "", api.fs.rename_sub, opts("Rename: Omit Filename")) - keymap("n", "", api.node.open.tab, opts("Open: New Tab")) - keymap("n", "v", api.node.open.vertical, opts("Open: Vertical Split")) - keymap("n", "x", api.node.open.horizontal, opts("Open: Horizontal Split")) - keymap("n", "", api.node.navigate.parent_close, opts("Close Directory")) - keymap("n", "", api.node.open.edit, opts("Open")) - keymap("n", "", api.node.open.preview, opts("Open Preview")) - keymap("n", ">", api.node.navigate.sibling.next, opts("Next Sibling")) - keymap("n", "<", api.node.navigate.sibling.prev, opts("Previous Sibling")) - keymap("n", ".", api.node.run.cmd, opts("Run Command")) - keymap("n", "-", api.tree.change_root_to_parent, opts("Up")) - keymap("n", "a", api.fs.create, opts("Create")) - keymap("n", "bmv", api.marks.bulk.move, opts("Move Bookmarked")) - keymap("n", "B", api.tree.toggle_no_buffer_filter, opts("Toggle No Buffer")) - keymap("n", "c", api.fs.copy.node, opts("Copy")) - keymap("n", "C", api.tree.toggle_git_clean_filter, opts("Toggle Git Clean")) - keymap("n", "[c", api.node.navigate.git.prev, opts("Prev Git")) - keymap("n", "]c", api.node.navigate.git.next, opts("Next Git")) - keymap("n", "d", api.fs.remove, opts("Delete")) - keymap("n", "D", api.fs.trash, opts("Trash")) - keymap("n", "E", api.tree.expand_all, opts("Expand All")) - keymap("n", "e", api.fs.rename_basename, opts("Rename: Basename")) - keymap("n", "]e", api.node.navigate.diagnostics.next, opts("Next Diagnostic")) - keymap("n", "[e", api.node.navigate.diagnostics.prev, opts("Prev Diagnostic")) - keymap("n", "F", api.live_filter.clear, opts("Clean Filter")) - keymap("n", "f", api.live_filter.start, opts("Filter")) - keymap("n", "g?", api.tree.toggle_help, opts("Help")) - keymap("n", "gy", api.fs.copy.absolute_path, opts("Copy Absolute Path")) - keymap("n", "H", api.tree.toggle_hidden_filter, opts("Toggle Dotfiles")) - keymap("n", "I", api.tree.toggle_gitignore_filter, opts("Toggle Git Ignore")) - keymap("n", "J", api.node.navigate.sibling.last, opts("Last Sibling")) - keymap("n", "K", api.node.navigate.sibling.first, opts("First Sibling")) - keymap("n", "m", api.marks.toggle, opts("Toggle Bookmark")) - keymap("n", "o", api.node.open.edit, opts("Open")) - keymap("n", "O", api.node.open.no_window_picker, opts("Open: No Window Picker")) - keymap("n", "p", api.fs.paste, opts("Paste")) - keymap("n", "P", api.node.navigate.parent, opts("Parent Directory")) - keymap("n", "q", api.tree.close, opts("Close")) - keymap("n", "r", api.fs.rename, opts("Rename")) - keymap("n", "R", api.tree.reload, opts("Refresh")) - keymap("n", "s", api.node.run.system, opts("Run System")) - keymap("n", "S", api.tree.search_node, opts("Search")) - keymap("n", "U", api.tree.toggle_custom_filter, opts("Toggle Hidden")) - keymap("n", "W", api.tree.collapse_all, opts("Collapse")) - keymap("n", "x", api.fs.cut, opts("Cut")) - keymap("n", "y", api.fs.copy.filename, opts("Copy Name")) - keymap("n", "Y", api.fs.copy.relative_path, opts("Copy Relative Path")) - keymap("n", "<2-LeftMouse>", api.node.open.edit, opts("Open")) - keymap("n", "<2-RightMouse>", api.tree.change_root_to_node, opts("CD")) - - -- You will need to insert "your code goes here" for any mappings with a custom action_cb - keymap("n", "l", api.node.open.edit, opts("Open")) -end - -nvim_tree.setup({ - on_attach = on_attach, - update_focused_file = { - enable = true, - update_cwd = true, - }, - renderer = { - root_folder_modifier = ":t", - icons = { - glyphs = { - default = "", - symlink = "", - folder = { - arrow_open = "", - arrow_closed = "", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - untracked = "U", - deleted = "", - ignored = "◌", - }, - }, - }, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { - hint = "", - info = "", - warning = "", - error = "", - }, - }, - view = { - width = 30, - -- height = 30, - side = "left", - }, -}) diff --git a/after/plugin/oil.lua b/after/plugin/oil.lua deleted file mode 100644 index 5713d92..0000000 --- a/after/plugin/oil.lua +++ /dev/null @@ -1,124 +0,0 @@ -local status_ok, oil = pcall(require, "oil") -if not status_ok then - return -end - -oil.setup({ - -- Id is automatically added at the beginning, and name at the end - -- See :help oil-columns - columns = { - "icon", - -- "permissions", - -- "size", - -- "mtime", - }, - -- Buffer-local options to use for oil buffers - buf_options = { - buflisted = false, - bufhidden = "hide", - }, - -- Window-local options to use for oil buffers - win_options = { - wrap = false, - signcolumn = "no", - cursorcolumn = false, - foldcolumn = "0", - spell = false, - list = false, - conceallevel = 3, - concealcursor = "n", - }, - -- Oil will take over directory buffers (e.g. `vim .` or `:e src/` - default_file_explorer = true, - -- Restore window options to previous values when leaving an oil buffer - restore_win_options = true, - -- Skip the confirmation popup for simple operations - skip_confirm_for_simple_edits = false, - -- Deleted files will be removed with the `trash-put` command. - delete_to_trash = true, - -- Selecting a new/moved/renamed file or directory will prompt you to save changes first - prompt_save_on_select_new_entry = true, - -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap - -- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true }) - -- Additionally, if it is a string that matches "actions.", - -- it will use the mapping at require("oil.actions"). - -- Set to `false` to remove a keymap - -- See :help oil-actions for a list of all available actions - keymaps = { - ["?"] = "actions.show_help", - [""] = "actions.select", - [""] = "actions.select_vsplit", - ["C-J>"] = "actions.select_split", - [""] = "actions.select_tab", - [""] = "actions.preview", - [""] = "actions.close", - [""] = "actions.refresh", - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["~"] = "actions.tcd", - ["."] = "actions.toggle_hidden", - }, - -- Set to false to disable all of the above keymaps - use_default_keymaps = true, - view_options = { - -- Show files and directories that start with "." - show_hidden = true, - -- This function defines what is considered a "hidden" file - is_hidden_file = function(name, bufnr) - return vim.startswith(name, ".") - end, - -- This function defines what will never be shown, even when `show_hidden` is set - is_always_hidden = function(name, bufnr) - return false - end, - }, - -- Configuration for the floating window in oil.open_float - float = { - -- Padding around the floating window - padding = 2, - max_width = 0, - max_height = 0, - border = "rounded", - win_options = { - winblend = 10, - }, - }, - -- Configuration for the actions floating preview window - preview = { - -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_width and max_width can be a single value or a list of mixed integer/float types. - -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" - max_width = 0.9, - -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" - min_width = { 40, 0.4 }, - -- optionally define an integer/float for the exact width of the preview window - width = nil, - -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_height and max_height can be a single value or a list of mixed integer/float types. - -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" - max_height = 0.9, - -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" - min_height = { 5, 0.1 }, - -- optionally define an integer/float for the exact height of the preview window - height = nil, - border = "rounded", - win_options = { - winblend = 0, - }, - }, - -- Configuration for the floating progress window - progress = { - max_width = 0.9, - min_width = { 40, 0.4 }, - width = nil, - max_height = { 10, 0.9 }, - min_height = { 5, 0.1 }, - height = nil, - border = "rounded", - minimized_border = "none", - win_options = { - winblend = 0, - }, - }, -}) diff --git a/after/plugin/persistence.lua b/after/plugin/persistence.lua deleted file mode 100644 index 4bbd303..0000000 --- a/after/plugin/persistence.lua +++ /dev/null @@ -1,10 +0,0 @@ -local status_ok, persistence = pcall(require, "persistence") -if not status_ok then - return -end - -persistence.setup({ - dir = vim.fn.expand(vim.fn.stdpath("state") .. "/sessions/"), -- directory where session files are saved - options = { "buffers", "curdir", "tabpages", "winsize" }, -- sessionoptions used for saving - pre_save = nil, -- a function to call before saving the session -}) diff --git a/after/plugin/project.lua b/after/plugin/project.lua deleted file mode 100644 index 80ac92e..0000000 --- a/after/plugin/project.lua +++ /dev/null @@ -1,17 +0,0 @@ -local status_ok, project = pcall(require, "project_nvim") -if not status_ok then - return -end -project.setup({ - -- detection_methods = { "lsp", "pattern" }, -- NOTE: lsp detection will get annoying with multiple langs in one project - detection_methods = { "pattern" }, - -- patterns used to detect root dir, when **"pattern"** is in detection_methods - patterns = { ".git", "package.json", ".venv", "Cargo.toml", "requirements.txt", "CMakeLists.txt" }, -}) - -local tele_status_ok, telescope = pcall(require, "telescope") -if not tele_status_ok then - return -end - -telescope.load_extension("projects") diff --git a/after/plugin/tabnine.lua b/after/plugin/tabnine.lua deleted file mode 100644 index 392199d..0000000 --- a/after/plugin/tabnine.lua +++ /dev/null @@ -1,14 +0,0 @@ -local status_ok, tabnine = pcall(require, "tabnine") -if not status_ok then - return -end - -tabnine.setup({ - disable_auto_comment = true, - accept_keymap = "", - dismiss_keymap = "", - debounce_ms = 800, - suggestion_color = { gui = "#808080", cterm = 244 }, - exclude_filetypes = { "TelescopePrompt" }, - log_file_path = nil, -- absolute path to Tabnine log file, -}) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua deleted file mode 100644 index f8cd987..0000000 --- a/after/plugin/telescope.lua +++ /dev/null @@ -1,89 +0,0 @@ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -local actions = require("telescope.actions") - -telescope.setup({ - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - }, - prompt_prefix = " ", - selection_caret = " ", - path_display = { "smart" }, - file_ignore_patterns = { ".git/", "node_modules", ".venv/" }, - mappings = { - i = { - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - }, - }, - }, - pickers = { - find_files = { - hidden = true, - follow = true, - }, - }, - extensions = { - fzf = { - fuzzy = true, -- false will only do exact matching - override_generic_sorter = true, -- override the generic sorter - override_file_sorter = true, -- override the file sorter - case_mode = "smart_case", -- or "ignore_case" or "respect_case" - }, - media_files = { - -- filetypes whitelist - filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "webm" }, - find_cmd = "rg", - }, - emoji = { - action = function(emoji) - -- argument emoji is a table. - -- {name="", value="", cagegory="", description=""} - - vim.fn.setreg("*", emoji.value) - print([[Press p or "*p to paste this emoji]] .. emoji.value) - - -- insert emoji when picked - -- vim.api.nvim_put({ emoji.value }, 'c', false, true) - end, - }, - ["ui-select"] = { - require("telescope.themes").get_dropdown({ - -- even more opts - }), - - -- pseudo code / specification for writing custom displays, like the one - -- for "codeactions" - -- specific_opts = { - -- [kind] = { - -- make_indexed = function(items) -> indexed_items, width, - -- make_displayer = function(widths) -> displayer - -- make_display = function(displayer) -> function(e) - -- make_ordinal = function(e) -> string - -- }, - -- -- for example to disable the custom builtin "codeactions" display - -- do the following - -- codeactions = false, - -- } - }, - }, -}) - -telescope.load_extension("fzf") -telescope.load_extension("media_files") -telescope.load_extension("emoji") -telescope.load_extension("ui-select") -telescope.load_extension("color_names") diff --git a/after/plugin/todo.lua b/after/plugin/todo.lua deleted file mode 100644 index 0350298..0000000 --- a/after/plugin/todo.lua +++ /dev/null @@ -1,69 +0,0 @@ -local status_ok, todo = pcall(require, "todo-comments") -if not status_ok then - return -end - -todo.setup({ - signs = true, -- show icons in the signs column - sign_priority = 8, -- sign priority - -- keywords recognized as todo comments - keywords = { - FIX = { - icon = " ", -- icon used for the sign, and in search results - color = "error", -- 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 - -- signs = false, -- configure signs for some keywords individually - }, - TODO = { icon = " ", color = "info" }, - HACK = { icon = " ", color = "warning" }, - WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, - PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, - NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, - TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, - }, - gui_style = { - fg = "NONE", -- The gui style to use for the fg highlight group. - bg = "BOLD", -- The gui style to use for the bg highlight group. - }, - merge_keywords = true, -- when true, custom keywords will be merged with the defaults - -- 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 = { - multiline = true, -- enable multine todo comments - multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword - multiline_context = 10, -- extra lines that will be re-evaluated when changing a line - before = "", -- "fg" or "bg" or empty - keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg) - after = "fg", -- "fg" or "bg" or empty - pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex) - comments_only = true, -- uses treesitter to match keywords in comments only - max_line_len = 400, -- ignore lines longer than this - exclude = {}, -- list of file types to exclude highlighting - }, - -- list of named colors where we try to extract the guifg from the - -- list of highlight groups or use the hex color if hl not found as a fallback - colors = { - error = { "DiagnosticError", "ErrorMsg", "#DC2626" }, - warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" }, - info = { "DiagnosticInfo", "#2563EB" }, - hint = { "DiagnosticHint", "#10B981" }, - default = { "Identifier", "#7C3AD" }, - test = { "Identifier", "#FF00FF" }, - }, - 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/after/plugin/toggleterm.lua b/after/plugin/toggleterm.lua deleted file mode 100644 index cd60e3b..0000000 --- a/after/plugin/toggleterm.lua +++ /dev/null @@ -1,69 +0,0 @@ -local status_ok, toggleterm = pcall(require, "toggleterm") -if not status_ok then - return -end - -toggleterm.setup({ - size = 20, - open_mapping = [[]], - hide_numbers = true, - shade_terminals = true, - shading_factor = 2, - start_in_insert = true, - insert_mappings = true, - persist_size = true, - direction = "float", - close_on_exit = true, - shell = vim.o.shell, - float_opts = { - border = "curved", - winblend = 0, - highlights = { - border = "Normal", - background = "Normal", - }, - }, -}) - -function _G.set_terminal_keymaps() - local opts = { noremap = true } - vim.api.nvim_buf_set_keymap(0, "t", "", [[]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[h]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[j]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[k]], opts) - vim.api.nvim_buf_set_keymap(0, "t", "", [[l]], opts) -end - -vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") - -local Terminal = require("toggleterm.terminal").Terminal - -local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) -function _LAZYGIT_TOGGLE() - lazygit:toggle() -end - -local node = Terminal:new({ cmd = "node", hidden = true }) -function _NODE_TOGGLE() - node:toggle() -end - -local ncdu = Terminal:new({ cmd = "ncdu", hidden = true }) -function _NCDU_TOGGLE() - ncdu:toggle() -end - -local btop = Terminal:new({ cmd = "btop", hidden = true }) -function _BTOP_TOGGLE() - btop:toggle() -end - -local python = Terminal:new({ cmd = "python", hidden = true }) -function _PYTHON_TOGGLE() - python:toggle() -end - -local rust = Terminal:new({ cmd = "cargo run", hidden = true }) -function _CARGO_RUN() - rust:toggle() -end diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua deleted file mode 100644 index ee9015d..0000000 --- a/after/plugin/treesitter.lua +++ /dev/null @@ -1,59 +0,0 @@ -local status_ok, configs = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -configs.setup({ - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = "all", -- one of "all" or a list of languages - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - -- List of parsers to ignore installing (for "all") - - highlight = { - enable = true, - disable = {}, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - autopairs = { - enable = true, - }, - autotag = { - enable = true, - filetypes = { - "html", - "htmldjango", - "javascript", - "typescript", - "javascriptreact", - "typescriptreact", - "svelte", - "vue", - "tsx", - "jsx", - "rescript", - "xml", - "php", - "markdown", - "glimmer", - "handlebars", - "hbs", - }, - }, - indent = { enable = true, disable = { "" } }, - rainbow = { - enable = true, - -- disable = { "jsx", "cpp" }, list of languages you want to disable the plugin for - extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - max_file_lines = nil, -- Do not enable for files with more than n lines, int - -- colors = {}, -- table of hex strings - -- termcolors = {}, -- table of colour name strings - }, -}) diff --git a/after/plugin/whichkey.lua b/after/plugin/whichkey.lua index 5361e35..e884078 100644 --- a/after/plugin/whichkey.lua +++ b/after/plugin/whichkey.lua @@ -1,7 +1,4 @@ -local status_ok, which_key = pcall(require, "which-key") -if not status_ok then - return -end +local which_key = require("which-key") local setup = { plugins = { @@ -94,7 +91,7 @@ local vmappings = { local mappings = { [";"] = { vim.cmd.Alpha, "Dashboard" }, ["/"] = { "(comment_toggle_linewise_current)", "Comment toggle current line" }, - c = { vim.cmd.Bdelete, "Close Buffer" }, + c = { vim.cmd.bdelete, "Close Buffer" }, f = { "lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown({previewer = false}))", "Find files", @@ -106,7 +103,7 @@ local mappings = { u = { vim.cmd.UndotreeToggle, "UndotreeToggle" }, t = { vim.cmd.TagbarToggle, "Toggle Tagbar" }, m = { require("harpoon.mark").add_file, "Add file to harpoon" }, - h = { require("harpoon.ui").toggle_quick_menu, "Add file to harpoon" }, + h = { require("harpoon.ui").toggle_quick_menu, "Open harpoon menu" }, n = { vim.cmd.Oil, "Open Oil" }, g = { name = "Git", @@ -133,16 +130,6 @@ local mappings = { "Workspace Symbols", }, e = { "Telescope quickfix", "Telescope Quickfix" }, - R = { - name = "Rust", - e = { vim.cmd.RustExpandMacro, "Expand macro" }, - c = { vim.cmd.RustOpenCargo, "Open cargo.toml" }, - p = { vim.cmd.RustParentModule, "Parent module" }, - h = { vim.cmd.RustHoverActions, "Hover actions" }, - g = { vim.cmd.RustViewCrateGraph, "View create graph" }, - d = { vim.cmd.RustOpenExternalDocs, "Open external docs" }, - R = { vim.cmd.RustRunnables, "Open runnables" }, - }, }, s = { name = "Search", @@ -164,17 +151,28 @@ local mappings = { "Colorscheme with Preview", }, }, - -- T = { - -- name = "Terminal", - -- n = { "lua _NODE_TOGGLE()", "Node" }, - -- u = { "lua _NCDU_TOGGLE()", "NCDU" }, - -- b = { "lua _BTOP_TOGGLE()", "Btop" }, - -- p = { "lua _PYTHON_TOGGLE()", "Python" }, - -- c = { "lua _CARGO_RUN()", "Cargo run" }, - -- f = { "ToggleTerm direction=float", "Float" }, - -- h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, - -- v = { "ToggleTerm size=80 direction=vertical", "Vertical" }, - -- }, + r = { + name = "Rust", + e = { vim.cmd.RustExpandMacro, "Expand macro" }, + c = { vim.cmd.RustOpenCargo, "Open cargo.toml" }, + p = { vim.cmd.RustParentModule, "Parent module" }, + h = { vim.cmd.RustHoverActions, "Hover actions" }, + g = { vim.cmd.RustViewCrateGraph, "View create graph" }, + d = { vim.cmd.RustOpenExternalDocs, "Open external docs" }, + R = { vim.cmd.RustRunnables, "Open runnables" }, + a = { vim.cmd.RustCodeAction, "Code action groups" }, + }, + T = { + name = "Terminal", + n = { "lua _NODE_TOGGLE()", "Node" }, + u = { "lua _NCDU_TOGGLE()", "NCDU" }, + b = { "lua _BTOP_TOGGLE()", "Btop" }, + p = { "lua _PYTHON_TOGGLE()", "Python" }, + c = { "lua _CARGO_RUN()", "Cargo run" }, + f = { "ToggleTerm direction=float", "Float" }, + h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, + v = { "ToggleTerm size=80 direction=vertical", "Vertical" }, + }, L = { name = "Language settings", c = { "setlocal formatoptions-=cro", "Disable autocomment" }, diff --git a/after/plugin/zen.lua b/after/plugin/zen.lua deleted file mode 100644 index 085b36a..0000000 --- a/after/plugin/zen.lua +++ /dev/null @@ -1,65 +0,0 @@ -local status_ok, zen_mode = pcall(require, "zen-mode") -if not status_ok then - return -end - -zen_mode.setup({ - window = { - backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal - -- height and width can be: - -- * an absolute number of cells when > 1 - -- * a percentage of the width / height of the editor when <= 1 - -- * a function that returns the width or the height - width = 120, -- width of the Zen window - height = 1, -- height of the Zen window - -- by default, no options are changed for the Zen window - -- uncomment any of the options below, or add other vim.wo options you want to apply - options = { - signcolumn = "no", -- disable signcolumn - -- number = false, -- disable number column - -- relativenumber = false, -- disable relative numbers - cursorline = false, -- disable cursorline - cursorcolumn = false, -- disable cursor column - foldcolumn = "0", -- disable fold column - list = false, -- disable whitespace characters - }, - }, - plugins = { - -- disable some global vim options (vim.o...) - -- comment the lines to not apply the options - options = { - enabled = true, - ruler = false, -- disables the ruler text in the cmd line area - showcmd = false, -- disables the command in the last line of the screen - }, - twilight = { enabled = true }, -- enable to start Twilight when zen mode opens - gitsigns = { enabled = false }, -- disables git signs - tmux = { enabled = false }, -- disables the tmux statusline - -- this will change the font size on kitty when in zen mode - -- to make this work, you need to set the following kitty options: - -- - allow_remote_control socket-only - -- - listen_on unix:/tmp/kitty - kitty = { - enabled = false, - font = "+4", -- font size increment - }, - -- this will change the font size on alacritty when in zen mode - -- requires Alacritty Version 0.10.0 or higher - -- uses `alacritty msg` subcommand to change font size - alacritty = { - enabled = false, - font = "14", -- font size - }, - -- this will change the font size on wezterm when in zen mode - -- See also the Plugins/Wezterm section in this projects README - wezterm = { - enabled = false, - -- can be either an absolute font size or the number of incremental steps - font = "+4", -- (10% increase per step) - }, - }, - -- callback where you can add custom code when the Zen window opens - on_open = function(win) end, - -- callback where you can add custom code when the Zen window closes - on_close = function() end, -}) diff --git a/lazy-lock.json b/lazy-lock.json index 8a39307..9796e69 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -15,22 +15,21 @@ "darkplus.nvim": { "branch": "master", "commit": "7c236649f0617809db05cd30fb10fed7fb01b83b" }, "distant.nvim": { "branch": "master", "commit": "9dd21f8fa25795e56756e1ea27a1586ceee35582" }, "dracula.nvim": { "branch": "main", "commit": "9fe831e685a76e1a1898a694623b33247c4d036c" }, + "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" }, "gitsigns.nvim": { "branch": "main", "commit": "287fffb410ce82d19da2d503a1f1570adf7b7874" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "hologram.nvim": { "branch": "main", "commit": "f5194f71ec1578d91b2e3119ff08e574e2eab542" }, - "impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" }, "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, "kanagawa.nvim": { "branch": "master", "commit": "1749cea392acb7d1548a946fcee1e6f1304cd3cb" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, - "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, + "lsp-zero.nvim": { "branch": "v2.x", "commit": "73bc33fe9ad5a1d4501536fdd4755b3aa18c3392" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, - "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" }, "mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" }, - "melange-nvim": { "branch": "master", "commit": "e4958aa60ec6e1c5ecb487b9028da3a33e753b34" }, + "melange-nvim": { "branch": "master", "commit": "11f35df3e091f35e966a335ed90b0d8a03851ffd" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "nightfly": { "branch": "master", "commit": "903da3ef1e41c6c763c9f98de6f2f9dc193ca5e7" }, "nightfox.nvim": { "branch": "main", "commit": "a48f6d9a0273101df76eb25d2f5477baa277f935" }, @@ -41,10 +40,10 @@ "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, "nvim-dap": { "branch": "master", "commit": "1c63f37f95cd4fb54512898168138d9a75d1516a" }, "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, - "nvim-lspconfig": { "branch": "master", "commit": "3fe1e8de80b98c7a6b16f730711b5eafe84212e1" }, - "nvim-startup.lua": { "branch": "main", "commit": "305b34f05173b9793a0e64c88696f52a2ae0d83e" }, + "nvim-lspconfig": { "branch": "master", "commit": "4b1a764c10c6c8679615fcb4f1e8b0f5513d900b" }, "nvim-tree.lua": { "branch": "master", "commit": "904f95cd9db31d1800998fa428e78e418a50181d" }, "nvim-treesitter": { "branch": "master", "commit": "ae88851cac32415c8239a04b7ee44d8f7625e186" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, "nvim-ufo": { "branch": "main", "commit": "5be5b800b4f3512bca128f345e9c98574b5637c0" }, @@ -74,15 +73,13 @@ "toggleterm.nvim": { "branch": "main", "commit": "12cba0a1967b4f3f31903484dec72a6100dcf515" }, "tokyonight.nvim": { "branch": "main", "commit": "1ee11019f8a81dac989ae1db1a013e3d582e2033" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, - "veil.nvim": { "branch": "main", "commit": "ec18376953b401d784756a47df38a75ece40f3e9" }, - "vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" }, "vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" }, "vim-closetag": { "branch": "master", "commit": "d0a562f8bdb107a50595aefe53b1a690460c3822" }, "vim-illuminate": { "branch": "master", "commit": "5ed17582a8e97bf0a0c617c3cf762e98f87b9859" }, "vim-log-highlighting": { "branch": "master", "commit": "1037e26f3120e6a6a2c0c33b14a84336dee2a78f" }, + "vim-markdown": { "branch": "master", "commit": "cc82d88e2a791f54d2b6e2b26e41f743351ac947" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, "vimwiki": { "branch": "dev", "commit": "f0fe154ede6b11e3db9b058b930005a056a3d1c6" }, - "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, - "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } + "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } } \ No newline at end of file diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua deleted file mode 100644 index be6f003..0000000 --- a/lua/plugins/cmp.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - { - "hrsh7th/nvim-cmp", - -- event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", -- buffer completions - "hrsh7th/cmp-path", -- path completionsplu - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - }, - }, -- The completion pluginpluguse "nvim-lua/plenary.nvim" - "saadparwaiz1/cmp_luasnip", -- snippet completions -} diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..5d3dc71 --- /dev/null +++ b/lua/plugins/colorizer.lua @@ -0,0 +1,167 @@ +return { + { + "NvChad/nvim-colorizer.lua", + opts = { + filetypes = { "html", "css", "javascript", "lua", "yaml", "conf", "toml" }, + user_default_options = { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = false, -- "Name" codes like Blue or blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + AARRGGBB = true, -- 0xAARRGGBB hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + -- Available modes for `mode`: foreground, background, virtualtext + mode = "background", -- Set the display mode. + -- Available methods are false / true / "normal" / "lsp" / "both" + -- True is same as normal + tailwind = true, -- Enable tailwind colors + -- parsers can contain values used in |user_default_options| + sass = { + enable = true, + parsers = { "css" }, + }, -- Enable sass colors + virtualtext = "■", + }, + -- all the sub-options of filetypes apply to buftypes + buftypes = {}, + html = { names = true }, + css = { names = true }, + }, + }, + { + "uga-rosa/ccc.nvim", + event = "VeryLazy", + config = function() + local ccc = require("ccc") + local ColorInput = require("ccc.input") + local convert = require("ccc.utils.convert") + + local RgbHslInput = setmetatable({ + name = "RGB/HSL", + max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 }, + min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 }, + bar_name = { "R", "G", "B", "H", "S", "L" }, + }, { __index = ColorInput }) + + function RgbHslInput.format(n, i) + if i <= 3 then + -- RGB + n = n * 255 + elseif i >= 5 then + -- S or L of HSL + n = n * 100 + end + return ("%6d"):format(n) + end + + function RgbHslInput.from_rgb(RGB) + local HSL = convert.rgb2hsl(RGB) + local R, G, B = unpack(RGB) + local H, S, L = unpack(HSL) + return { R, G, B, H, S, L } + end + + function RgbHslInput.to_rgb(value) + return { value[1], value[2], value[3] } + end + + function RgbHslInput:_set_rgb(RGB) + self.value[1] = RGB[1] + self.value[2] = RGB[2] + self.value[3] = RGB[3] + end + + function RgbHslInput:_set_hsl(HSL) + self.value[4] = HSL[1] + self.value[5] = HSL[2] + self.value[6] = HSL[3] + end + + function RgbHslInput:callback(index, new_value) + self.value[index] = new_value + local v = self.value + if index <= 3 then + local RGB = { v[1], v[2], v[3] } + local HSL = convert.rgb2hsl(RGB) + self:_set_hsl(HSL) + else + local HSL = { v[4], v[5], v[6] } + local RGB = convert.hsl2rgb(HSL) + self:_set_rgb(RGB) + end + end + + ccc.setup({ + pickers = { + ccc.picker.custom_entries({ + bg = "#1a1b26", + bg_dark = "#16161e", + bg_float = "#16161e", + bg_highlight = "#292e42", + bg_popup = "#16161e", + bg_search = "#3d59a1", + bg_sidebar = "#16161e", + bg_statusline = "#16161e", + bg_visual = "#283457", + black = "#15161e", + blue = "#7aa2f7", + blue0 = "#3d59a1", + blue1 = "#2ac3de", + blue2 = "#0db9d7", + blue5 = "#89ddff", + blue6 = "#b4f9f8", + blue7 = "#394b70", + border = "#15161e", + border_highlight = "#27a1b9", + comment = "#565f89", + cyan = "#7dcfff", + dark3 = "#545c7e", + dark5 = "#737aa2", + delta_add = "#2c5a66", + delta_delete = "#713137", + diff_add = "#20303b", + diff_change = "#1f2231", + diff_delete = "#37222c", + diff_text = "#394b70", + error = "#db4b4b", + fg = "#c0caf5", + fg_dark = "#a9b1d6", + fg_float = "#c0caf5", + fg_gutter = "#3b4261", + fg_sidebar = "#a9b1d6", + git_add = "#449dab", + git_change = "#6183bb", + git_delete = "#914c54", + git_ignore = "#545c7e", + gitSigns_add = "#266d6a", + gitSigns_change = "#536c9e", + gitSigns_delete = "#b2555b", + green = "#9ece6a", + green1 = "#73daca", + green2 = "#41a6b5", + hint = "#1abc9c", + info = "#0db9d7", + magenta = "#bb9af7", + magenta2 = "#ff007c", + none = "NONE", + orange = "#ff9e64", + purple = "#9d7cd8", + red = "#f7768e", + red1 = "#db4b4b", + teal = "#1abc9c", + terminal_black = "#414868", + warning = "#e0af68", + yellow = "#e0af68", + }), + }, + inputs = { + RgbHslInput, + }, + }) + end, + }, +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..e3e2335 --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,64 @@ +return { + { + "numToStr/Comment.nvim", + lazy = false, + opts = { + + ---Add a space b/w comment and the line + padding = true, + ---Whether the cursor should stay at its position + sticky = true, + ---Lines to be ignored while (un)comment + ignore = nil, + ---LHS of toggle mappings in NORMAL mode + toggler = { + ---Line-comment toggle keymap + line = "gcc", + ---Block-comment toggle keymap + block = "gbb", + }, + -- -LHS of operator-pending mappings in NORMAL and VISUAL mode + opleader = { + ---Line-comment keymap + line = "gc", + ---Block-comment keymap + block = "gb", + }, + ---LHS of extra mappings + extra = { + ---Add comment on the line above + above = "gcO", + ---Add comment on the line below + below = "gco", + ---Add comment at the end of line + eol = "gcA", + }, + --- Enable keybindings + --- NOTE: If given `false` then the plugin won't create any mappings + mappings = { + ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` + basic = true, + ---Extra mapping; `gco`, `gcO`, `gcA` + extra = true, + ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` + extended = true, + }, + ---Function to call before (un)comment + -- pre_hook = function(ctx) + -- local U = require("Comment.utils") + -- + -- local location = nil + -- if ctx.ctype == U.ctype.block then + -- location = require("ts_context_commentstring.utils").get_cursor_location() + -- elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then + -- location = require("ts_context_commentstring.utils").get_visual_start_location() + -- end + -- + -- return require("ts_context_commentstring.internal").calculate_commentstring({ + -- key = ctx.ctype == U.ctype.line and "__default" or "__multiline", + -- location = location, + -- }) + -- end, + }, + }, +} diff --git a/lua/plugins/cpp.lua b/lua/plugins/cpp.lua new file mode 100644 index 0000000..f98dce9 --- /dev/null +++ b/lua/plugins/cpp.lua @@ -0,0 +1,91 @@ +return { + { + "p00f/clangd_extensions.nvim", + opts = { + inlay_hints = { + inline = vim.fn.has("nvim-0.10") == 1, + -- Options other than `highlight' and `priority' only work + -- if `inline' is disabled + -- Only show inlay hints for the current line + only_current_line = false, + -- Event which triggers a refresh 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 + show_parameter_hints = true, + -- prefix for parameter hints + parameter_hints_prefix = "<- ", + -- prefix for all the other hints (type, chaining) + other_hints_prefix = "=> ", + -- whether to align to the length of the longest line in the file + max_len_align = true, + -- 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 = 8, + -- The color of the hints + highlight = "Comment", + -- The highlight group priority for extmark + priority = 100, + }, + ast = { + role_icons = { + type = "", + declaration = "", + expression = "", + specifier = "", + statement = "", + ["template argument"] = "", + }, + kind_icons = { + Compound = "", + Recovery = "", + TranslationUnit = "", + PackExpansion = "", + TemplateTypeParm = "", + TemplateTemplateParm = "", + TemplateParamObject = "", + }, + highlights = { + detail = "Comment", + }, + }, + + memory_usage = { + border = "none", + }, + + symbol_info = { + border = "none", + }, + }, + }, + { + "Civitasv/cmake-tools.nvim", + event = "VeryLazy", + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + cmake_command = "cmake", + cmake_build_directory = "target/build/", + cmake_build_directory_prefix = "cmake_build_", -- when cmake_build_directory is "", this option will be activated + cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" }, + cmake_soft_link_compile_commands = true, -- if softlink compile commands json file + cmake_build_options = {}, + cmake_console_size = 15, -- cmake output window height + cmake_console_position = "belowright", -- "belowright", "aboveleft", ... + cmake_show_console = "always", -- "always", "only_on_error" + cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional + cmake_variants_message = { + short = { show = true }, + long = { show = true, max_length = 40 }, + }, + }, + }, +} diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index a429a73..4949347 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -1,10 +1,56 @@ return { - { "rcarriga/nvim-dap-ui", event = "VeryLazy", dependencies = "jayp0521/mason-nvim-dap.nvim" }, + { + "rcarriga/nvim-dap-ui", + event = "VeryLazy", + dependencies = { "jayp0521/mason-nvim-dap.nvim" }, + opts = { + layouts = { + { + elements = { + "scopes", + "breakpoints", + "stacs", + "watches", + }, + size = 40, + position = "left", + }, + { + elements = { + "repl", + "console", + }, + size = 10, + position = "bottom", + }, + }, + -- sidebar = { + -- elements = { + -- { + -- id = "scopes", + -- size = 0.25, -- Can be float or integer > 1 + -- }, + -- { id = "breakpoints", size = 0.25 }, + -- }, + -- size = 40, + -- position = "right", -- Can be "left", "right", "top", "bottom" + -- }, + -- tray = { + -- elements = {}, + -- }, + }, + }, { "jayp0521/mason-nvim-dap.nvim", event = "VeryLazy", dependencies = { - "williamboman/mason.nvim", + { + "williamboman/mason.nvim", + opts = { + automatic_installation = true, + automatic_setup = true, + }, + }, "mfussenegger/nvim-dap", }, }, diff --git a/lua/plugins/fidget.lua b/lua/plugins/fidget.lua new file mode 100644 index 0000000..f39f47d --- /dev/null +++ b/lua/plugins/fidget.lua @@ -0,0 +1,57 @@ +return { + { + "j-hui/fidget.nvim", + tag = "legacy", + event = "LspAttach", + opts = { + text = { + spinner = "pipe", -- animation shown when tasks are ongoing + done = "✔", -- character shown when all tasks are complete + commenced = "Started", -- message shown when task starts + completed = "Completed", -- message shown when task completes + }, + align = { + bottom = true, -- align fidgets along bottom edge of buffer + right = true, -- align fidgets along right edge of buffer + }, + timer = { + spinner_rate = 125, -- frame rate of spinner animation, in ms + fidget_decay = 2000, -- how long to keep around empty fidget, in ms + task_decay = 1000, -- how long to keep around completed task, in ms + }, + window = { + relative = "win", -- where to anchor, either "win" or "editor" + blend = 0, -- &winblend for the window + zindex = nil, -- the zindex value for the window + border = "none", -- style of border for the fidget window + }, + fmt = { + leftpad = true, -- right-justify text in fidget box + stack_upwards = true, -- list of tasks grows upwards + max_width = 0, -- maximum width of the fidget box + -- function to format fidget title + fidget = function(fidget_name, spinner) + return string.format("%s %s", spinner, fidget_name) + end, + -- function to format each task line + task = function(task_name, message, percentage) + return string.format( + "%s%s [%s]", + message, + percentage and string.format(" (%s%%)", percentage) or "", + task_name + ) + end, + }, + sources = { -- Sources to configure + ["*"] = { -- Name of source + ignore = false, -- Ignore notifications from this source + }, + }, + debug = { + logging = false, -- whether to enable logging, for debugging + strict = false, -- whether to interpret LSP strictly + }, + }, + }, +} diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua index 03c6cb8..2ce6515 100644 --- a/lua/plugins/general.lua +++ b/lua/plugins/general.lua @@ -1,29 +1,48 @@ return { { "folke/lazy.nvim" }, { "nvim-lua/plenary.nvim" }, -- Useful lua functions used by lots of plugins - { "windwp/nvim-autopairs" }, -- Autopairs, integrates with both cmp and treesitter - { "numToStr/Comment.nvim" }, - { "JoosepAlviste/nvim-ts-context-commentstring" }, - { "nvim-tree/nvim-web-devicons", lazy = true }, - { "nvim-tree/nvim-tree.lua" }, - { "moll/vim-bbye" }, - - { "nvim-lualine/lualine.nvim" }, - { "arkav/lualine-lsp-progress" }, - - { "akinsho/toggleterm.nvim" }, - { "ahmedkhalf/project.nvim" }, - { "lewis6991/impatient.nvim" }, - { "lukas-reineke/indent-blankline.nvim" }, + { + "windwp/nvim-autopairs", -- Autopairs, integrates with both cmp and treesitter + opts = { + check_ts = true, -- treesitter integration + disable_filetype = { + "NvimTree", + "TelescopePrompt", + "alpha", + "lazy", + }, + }, + }, { "goolord/alpha-nvim", lazy = true }, - { "willothy/veil.nvim", lazy = true }, - { "henriquehbr/nvim-startup.lua", lazy = true }, + -- TODO: replace alphh with veil + -- { "willothy/veil.nvim", lazy = true }, - { "andweeb/presence.nvim" }, + { + "andweeb/presence.nvim", + opts = { + auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) + neovim_image_text = "The Only True Text Editor", -- Text displayed when hovered over the Neovim image + main_image = "neovim", -- Main image display (either "neovim" or "file") + -- client_id = "", -- Use your own Discord application client id (not recommended) + log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") + debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) + enable_line_number = false, -- Displays the current line number instead of the current project + blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches + buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "