diff --git a/home/apps/neovim/after/plugin/auto-dark-mode.lua b/home/apps/neovim/after/plugin/auto-dark-mode.lua deleted file mode 100644 index fdee153..0000000 --- a/home/apps/neovim/after/plugin/auto-dark-mode.lua +++ /dev/null @@ -1,27 +0,0 @@ -local present, autodm = pcall(require, "auto-dark-mode") - -if not (present and vim.fn.has("mac") == 1) then - return -end - -local update_neovide_background = function() - if not vim.g.neovide then - return - end - local ctp_present, ctp = pcall(require, "catppuccin.palettes") - if ctp_present then - vim.g.neovide_background_color = ctp.get_palette().base - end -end - -autodm.setup({ - set_dark_mode = function() - vim.api.nvim_set_option("background", "dark") - update_neovide_background() - end, - set_light_mode = function() - vim.api.nvim_set_option("background", "light") - update_neovide_background() - end, -}) -autodm.init() diff --git a/home/apps/neovim/after/plugin/bufferline.lua b/home/apps/neovim/after/plugin/bufferline.lua deleted file mode 100644 index 7331dbf..0000000 --- a/home/apps/neovim/after/plugin/bufferline.lua +++ /dev/null @@ -1,96 +0,0 @@ -local present, bufferline = pcall(require, "bufferline") -if not present then - return -end - -local ctp_present, ctp = - pcall(require, "catppuccin.groups.integrations.bufferline") -local ctp_bufferline -if not ctp_present then - ctp_bufferline = {} -else - ctp_bufferline = ctp.get() -end - -local v = vim.version() -local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch) - -bufferline.setup({ - highlights = ctp_bufferline, - options = { - show_close_icon = false, - show_buffer_close_icons = false, - offsets = { - { - filetype = "NvimTree", - text = "  neovim " .. vStr, - text_align = "left", - separator = "║", - }, - }, - left_mouse_command = "buffer %d", - middle_mouse_command = "bdelete! %d", - right_mouse_command = nil, - indicator = { icon = "‣" }, - numbers = function(tab) - local roman = { - "Ⅰ", - "Ⅱ", - "Ⅲ", - "Ⅳ", - "Ⅴ", - "Ⅵ", - "Ⅶ", - "Ⅷ", - "Ⅸ", - "Ⅹ", - "Ⅺ", - "Ⅻ", - "XⅢ", - "XⅣ", - "ⅩⅤ", - "ⅩⅥ", - "ⅩⅦ", - "ⅩⅧ", - "ⅩⅨ", - "ⅩⅩ", - } - - return string.format("%s ", roman[tab.ordinal]) - end, - }, -}) - -local nmap = function(key, cmd) - vim.api.nvim_set_keymap("n", key, cmd, { noremap = true, silent = true }) -end - --- hop between buffers in order of the bar -nmap("", "BufferLineCyclePrev") -nmap("", "BufferLineCycleNext") --- Re-order to previous/next -nmap("", "BufferLineMovePrev") -nmap(">", "BufferLineMoveNext") --- Goto buffer in position... -nmap("", "BufferLineGoToBuffer 1") -nmap("", "BufferLineGoToBuffer 2") -nmap("", "BufferLineGoToBuffer 3") -nmap("", "BufferLineGoToBuffer 4") -nmap("", "BufferLineGoToBuffer 5") -nmap("", "BufferLineGoToBuffer 6") -nmap("", "BufferLineGoToBuffer 7") -nmap("", "BufferLineGoToBuffer 8") -nmap("", "BufferLineGoToBuffer 9") -nmap("", "BufferLineGoToBuffer -1") --- Pin/unpin buffer -nmap("", "BufferLineTogglePin") --- Close buffer -nmap("", "bdelete") -nmap("", "bdelete!") --- create new buffer -nmap("", "enew") --- pick buffer -nmap("", "BufferLinePick") --- Sort automatically by... -nmap("bd", "BufferLineSortByDirectory") -nmap("bl", "BufferLineSortByExtension") diff --git a/home/apps/neovim/after/plugin/catppuccin.lua b/home/apps/neovim/after/plugin/catppuccin.lua deleted file mode 100644 index b4f4723..0000000 --- a/home/apps/neovim/after/plugin/catppuccin.lua +++ /dev/null @@ -1,99 +0,0 @@ -vim.g.catppuccin_flavour = "mocha" -local present, catppuccin = pcall(require, "catppuccin") -if not present then - return -end - -catppuccin.setup({ - transparent_background = true, - dim_inactive = { - enable = true, - shade = "dark", - percentage = 0.15, - }, - styles = { - comments = { "italic" }, - conditionals = { "italic" }, - }, - integrations = { - treesitter = true, - native_lsp = { - enabled = true, - virtual_text = { - errors = { "italic" }, - hints = { "italic" }, - warnings = { "italic" }, - information = { "italic" }, - }, - underlines = { - errors = { "undercurl" }, - hints = { "undercurl" }, - warnings = { "undercurl" }, - information = { "undercurl" }, - }, - }, - cmp = true, - lsp_trouble = true, - nvimtree = true, - which_key = true, - indent_blankline = { - enabled = true, - colored_indent_levels = true, - }, - navic = { - enabled = true, - custom_bg = "NONE", - }, - gitsigns = true, - lightspeed = true, - markdown = true, - neogit = true, - symbols_outline = true, - ts_rainbow = true, - vimwiki = true, - }, - highlight_overrides = { - all = function(colors) - return { - -- custom selection highlight - Selection = { bg = colors.surface1, fg = colors.text }, - -- borders - FloatBorder = { fg = colors.overlay0 }, - LspInfoBorder = { link = "FloatBorder" }, - NvimTreeWinSeparator = { link = "FloatBorder" }, - WhichKeyBorder = { link = "FloatBorder" }, - -- telescope - TelescopeBorder = { link = "FloatBorder" }, - TelescopeTitle = { fg = colors.text }, - TelescopeSelection = { link = "Selection" }, - TelescopeSelectionCaret = { link = "Selection" }, - -- pmenu - PmenuSel = { link = "Selection" }, - -- bufferline - BufferLineTabSeparator = { link = "FloatBorder" }, - BufferLineSeparator = { link = "FloatBorder" }, - BufferLineOffsetSeparator = { link = "FloatBorder" }, - -- - FidgetTitle = { fg = colors.subtext1 }, - FidgetTask = { fg = colors.subtext0 }, - } - end, - mocha = function(colors) - return { - Selection = { bg = "#121212", fg = colors.text }, - Comment = { fg = colors.surface2, style = { "italic" } }, - InlayHint = { fg = colors.surface0, style = { "italic" } }, - WinSeparator = { fg = colors.surface2 }, - } - end, - }, - color_overrides = { - mocha = { - base = "#000000", - crust = "#010101", - mantle = "#020202", - }, - }, -}) - -vim.api.nvim_command("colorscheme catppuccin") diff --git a/home/apps/neovim/after/plugin/colorizer.lua b/home/apps/neovim/after/plugin/colorizer.lua deleted file mode 100644 index 2e6dc3b..0000000 --- a/home/apps/neovim/after/plugin/colorizer.lua +++ /dev/null @@ -1,29 +0,0 @@ -local present, colorizer = pcall(require, "colorizer") -if not present then - return -end - -colorizer.setup({ - user_default_options = { - RGB = true, - RRGGBB = true, - names = false, - RRGGBBAA = true, - AARRGGBB = false, - rgb_fn = false, - hsl_fn = false, - css = false, - css_fn = false, - mode = "background", - tailwind = "both", - sass = { enable = true }, - virtualtext = " ", - }, - buftypes = { - "*", - "!dashboard", - "!lazy", - "!popup", - "!prompt", - }, -}) diff --git a/home/apps/neovim/after/plugin/copilot.lua b/home/apps/neovim/after/plugin/copilot.lua deleted file mode 100644 index d5b0954..0000000 --- a/home/apps/neovim/after/plugin/copilot.lua +++ /dev/null @@ -1,32 +0,0 @@ -local present, copilot = pcall(require, "copilot") - -if not present then - return -end - -copilot.setup({ - panel = { - enabled = false, - }, - suggestion = { - enabled = true, - auto_trigger = true, - debounce = 75, - keymap = { - accept = "", - }, - }, - filetypes = { - yaml = true, - markdown = false, - help = false, - gitcommit = false, - gitrebase = false, - hgcommit = false, - svn = false, - cvs = false, - ["."] = false, - }, - copilot_node_command = "node", - server_opts_overrides = {}, -}) diff --git a/home/apps/neovim/after/plugin/fidget.lua b/home/apps/neovim/after/plugin/fidget.lua deleted file mode 100644 index 13d7bea..0000000 --- a/home/apps/neovim/after/plugin/fidget.lua +++ /dev/null @@ -1,19 +0,0 @@ -local present, fidget = pcall(require, "fidget") - -if not present then - return -end - -fidget.setup({ - text = { - spinner = "dots", - done = "﫠", - commenced = "init", - completed = "done", - }, - window = { blend = 0 }, - sources = { - ["copilot"] = { ignore = true }, - ["null-ls"] = { ignore = true }, - }, -}) diff --git a/home/apps/neovim/after/plugin/gitsigns.lua b/home/apps/neovim/after/plugin/gitsigns.lua deleted file mode 100644 index a787268..0000000 --- a/home/apps/neovim/after/plugin/gitsigns.lua +++ /dev/null @@ -1,143 +0,0 @@ -local p1, wk = pcall(require, "which-key") -local p2, gs = pcall(require, "gitsigns") - -if not (p1 and p2) then - return -end - -gs.setup({ - on_attach = function(bufnr) - -- Gitsigns - wk.register({ - ["h"] = { - name = "+Gitsigns", - s = { "Gitsigns stage_hunk", "Stage Hunk" }, - r = { "Gitsigns reset_hunk", "Reset Hunk" }, - }, - }, { mode = { "n", "v" } }) - - wk.register({ - ["h"] = { - name = "+Gitsigns", - s = { gs.stage_buffer, "Stage Buffer" }, - u = { gs.undo_stage_hunk, "Undo Stage Hunk" }, - R = { gs.reset_buffer, "Reset Buffer" }, - p = { gs.preview_hunk, "Preview Hunk" }, - b = { - function() - gs.blame_line({ full = true }) - end, - "Blame line", - }, - d = { gs.diffthis, "Diff current buffer" }, - D = { - function() - gs.diffthis("~") - end, - "Diff against last commit", - }, - }, - }) - - wk.register({ - ["t"] = { - name = "+Toggle settings", - b = { gs.toggle_current_line_blame, "Toggle blame lines" }, - d = { gs.toggle_deleted, "Toggle deleted lines" }, - }, - }) - - wk.register({ - ["[c"] = { - function() - if vim.wo.diff then - return "]c" - end - vim.schedule(function() - gs.next_hunk() - end) - return "" - end, - "Go to Next Hunk", - }, - ["]c"] = { - function() - if vim.wo.diff then - return "[c" - end - vim.schedule(function() - gs.prev_hunk() - end) - return "" - end, - "Go to Previous Hunk", - }, - }, { expr = true }) - - -- Text object - wk.register({ - ["ih"] = { ":Gitsigns select_hunk", "Select inside Hunk" }, - }, { mode = { "o", "x" } }) - end, - 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 = "x", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - linehl = false, - numhl = false, - signcolumn = true, - word_diff = false, - watch_gitdir = { enable = false, interval = 1000, follow_files = true }, - attach_to_untracked = true, - -- current line highlighting - current_line_blame = false, - current_line_blame_opts = { - delay = 1000, - ignore_whitespace = true, - virt_text = true, - virt_text_pos = "eol", - }, - current_line_blame_formatter = ", - | ", - -- perf - max_file_length = 40000, - sign_priority = 6, - update_debounce = 100, - -- use the included status formatter - status_formatter = nil, - preview_config = { - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { enable = false }, -}) diff --git a/home/apps/neovim/after/plugin/indent_blankline.lua b/home/apps/neovim/after/plugin/indent_blankline.lua deleted file mode 100644 index ba4c754..0000000 --- a/home/apps/neovim/after/plugin/indent_blankline.lua +++ /dev/null @@ -1,17 +0,0 @@ -local present, indent_blankline = pcall(require, "indent_blankline") -if not present then - return -end - -indent_blankline.setup({ - space_char_blankline = " ", -}) -vim.g.indent_blankline_filetype_exclude = { - "dashboard", - "fugitive", - "help", - "lazy", - "NvimTree", - "neogitstatus", - "Trouble", -} diff --git a/home/apps/neovim/after/plugin/lualine.lua b/home/apps/neovim/after/plugin/lualine.lua deleted file mode 100644 index 42ec54b..0000000 --- a/home/apps/neovim/after/plugin/lualine.lua +++ /dev/null @@ -1,101 +0,0 @@ -local present, lualine = pcall(require, "lualine") - -if not present then - return -end - -local navic_present, navic = pcall(require, "nvim-navic") - -if navic_present then - navic.setup({ - icons = { - File = " ", - Module = " ", - Namespace = " ", - Package = " ", - Class = " ", - Method = " ", - Property = " ", - Field = " ", - Constructor = " ", - Enum = " ", - Interface = " ", - Function = " ", - Variable = " ", - Constant = " ", - String = " ", - Number = " ", - Boolean = " ", - Array = " ", - Object = " ", - Key = " ", - Null = " ", - EnumMember = " ", - Struct = " ", - Event = " ", - Operator = " ", - TypeParameter = " ", - }, - }) -end - -local function navic_available() - return navic_present and navic.is_available() -end - -local function navic_get_location() - if not navic_available() then - return "" - end - return navic.get_location() -end - -local config = { - options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = true, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - }, - }, - sections = { - lualine_a = { - { - "mode", - fmt = function(str) - return " " .. str - end, - }, - }, - lualine_b = { - { "branch", icon = "" }, - "diff", - "diagnostics", - }, - lualine_c = { - { navic_get_location, condition = navic_available }, - "searchcount", - "lsp_progress", - }, - lualine_x = { "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {}, -} - -lualine.setup(config) diff --git a/home/apps/neovim/after/plugin/neogit.lua b/home/apps/neovim/after/plugin/neogit.lua deleted file mode 100644 index 90a420c..0000000 --- a/home/apps/neovim/after/plugin/neogit.lua +++ /dev/null @@ -1,5 +0,0 @@ -local present, neogit = pcall(require, "neogit") - -if not present then - return -end diff --git a/home/apps/neovim/after/plugin/neorg.lua b/home/apps/neovim/after/plugin/neorg.lua deleted file mode 100644 index d345eae..0000000 --- a/home/apps/neovim/after/plugin/neorg.lua +++ /dev/null @@ -1,11 +0,0 @@ -local present, neorg = pcall(require, "neorg") - -if not present then - return -end - -neorg.setup({ - load = { - ["core.defaults"] = {}, - }, -}) diff --git a/home/apps/neovim/after/plugin/nvim-autopairs.lua b/home/apps/neovim/after/plugin/nvim-autopairs.lua deleted file mode 100644 index ddc0a61..0000000 --- a/home/apps/neovim/after/plugin/nvim-autopairs.lua +++ /dev/null @@ -1,9 +0,0 @@ -local ap_present, ap = pcall(require, "nvim-autopairs") -local cmp_present, cmp = pcall(require, "cmp") -if not ap_present or cmp_present then - return -end - -ap.setup() -local cmp_autopairs = require("nvim-autopairs.completion.cmp") -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/home/apps/neovim/after/plugin/nvim-tree.lua b/home/apps/neovim/after/plugin/nvim-tree.lua deleted file mode 100644 index cd32d99..0000000 --- a/home/apps/neovim/after/plugin/nvim-tree.lua +++ /dev/null @@ -1,23 +0,0 @@ -local present, nvimtree = pcall(require, "nvim-tree") - -if not present then - return -end - -nvimtree.setup({ - renderer = { - indent_markers = { - enable = true, - }, - }, - diagnostics = { - enable = true, - }, - actions = { - file_popup = { - open_win_config = { - border = "double", - }, - }, - }, -}) diff --git a/home/apps/neovim/after/plugin/presence.lua b/home/apps/neovim/after/plugin/presence.lua deleted file mode 100644 index 9873e4e..0000000 --- a/home/apps/neovim/after/plugin/presence.lua +++ /dev/null @@ -1,108 +0,0 @@ -local present, presence = pcall(require, "presence") - -if not present then - return -end - -function string.starts(self, str) - return self:find("^" .. str) ~= nil -end - -local home = vim.fn.expand("$HOME") .. "/Code/" - -local blacklist = { - [vim.fn.resolve(home .. "work")] = "Using nvim at work.", - [vim.fn.resolve(home .. "freelance")] = "Using nvim to freelance.", - [vim.fn.resolve(vim.fn.stdpath("config"))] = "Configuring nvim. (" - .. require("lazy").stats().count - .. " plugins)", -} - -local conceal = function(activity, info) - local cur_file = vim.fn.expand("%:p") - for k, v in pairs(blacklist) do - if cur_file:starts(k) then - return v - end - end - if info ~= nil then - return activity .. " " .. info - end -end - -local v = vim.version() -local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch) - -presence:setup({ - -- General options - auto_update = true, - debounce_timeout = 10, - neovim_image_text = "Neovim " .. vStr, - -- Main image display (either "neovim" or "file") - main_image = "file", - show_time = false, - buttons = function(buffer, repo_url) - local concealed = conceal() - if concealed then - return { - { - label = "View my config", - url = "https://github.com/nekowinston/dotfiles", - }, - } - else - return { - { - label = "View the repository", - url = repo_url, - }, - } - end - end, - file_assets = { - ["k8s.yaml"] = { - "Kubernetes", - "https://avatars.githubusercontent.com/u/13629408", - }, - ["Chart.yaml"] = { - "Helm Chart", - "https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png", - }, - ["helmfile.yaml"] = { - "helmfile", - "https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png", - }, - ["prisma"] = { - "Prisma", - "https://avatars.githubusercontent.com/u/17219288", - }, - ["bu"] = { - "Butane Config", - "https://avatars.githubusercontent.com/u/3730757", - }, - ["ign"] = { - "CoreOS Ignition", - "https://avatars.githubusercontent.com/u/3730757", - }, - }, - -- Rich Presence text options - editing_text = function(s) - return conceal("Editing", s) - end, - reading_text = function(s) - return conceal("Reading", s) - end, - file_explorer_text = function(s) - return conceal("Browsing", s) - end, - workspace_text = function(s) - local concealed = conceal() - if s ~= nil and not concealed then - return "Working on " .. s - else - return nil - end - end, - git_commit_text = "Committing changes", - plugin_manager_text = "Managing Plugins", -}) diff --git a/home/apps/neovim/after/plugin/telescope.lua b/home/apps/neovim/after/plugin/telescope.lua deleted file mode 100644 index 35d553d..0000000 --- a/home/apps/neovim/after/plugin/telescope.lua +++ /dev/null @@ -1,24 +0,0 @@ -local present, telescope = pcall(require, "telescope") -if not present then - return -end - -pcall(telescope.load_extension, "fzf") -pcall(telescope.load_extension, "asynctasks") -pcall(telescope.load_extension, "file_browser") -pcall(telescope.load_extension, "project") - -telescope.setup({ - defaults = { - selection_caret = "▶ ", - borderchars = { "═", "║", "═", "║", "╔", "╗", "╝", "╚" }, - }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, -}) diff --git a/home/apps/neovim/after/plugin/treesitter.lua b/home/apps/neovim/after/plugin/treesitter.lua deleted file mode 100644 index 7b8846d..0000000 --- a/home/apps/neovim/after/plugin/treesitter.lua +++ /dev/null @@ -1,57 +0,0 @@ -local present, treesitter = pcall(require, "nvim-treesitter.configs") -if not present then - return -end - -local parsers = require("nvim-treesitter.parsers") - -local parser_config = parsers.get_parser_configs() -parser_config.gotmpl = { - install_info = { - url = "https://github.com/ngalaiko/tree-sitter-go-template", - files = { "src/parser.c" }, - }, - filetype = "gotmpl", - used_by = { "gohtmltmpl", "gotexttmpl", "gotmpl", "yaml", "helm" }, -} - -local ft_to_parser = parsers.filetype_to_parsername -ft_to_parser.helm = "gotmpl" - -treesitter.setup({ - auto_install = true, - ignore_install = { - "phpdoc", - }, - highlight = { - enable = true, - }, - rainbow = { - enable = true, - extended_mode = true, - max_file_lines = 8192, - }, - ensure_installed = { - "bash", - "css", - "dockerfile", - "go", - "html", - "javascript", - "json", - "lua", - "markdown", - "python", - "regex", - "rust", - "scss", - "toml", - "tsx", - "typescript", - "yaml", - }, -}) - -vim.o.foldmethod = "expr" -vim.o.foldexpr = "nvim_treesitter#foldexpr()" -vim.o.foldenable = false diff --git a/home/apps/neovim/after/plugin/which-key.lua b/home/apps/neovim/after/plugin/which-key.lua deleted file mode 100644 index bd111c2..0000000 --- a/home/apps/neovim/after/plugin/which-key.lua +++ /dev/null @@ -1,51 +0,0 @@ -local present, wk = pcall(require, "which-key") - -if not present then - return -end - -wk.setup({ - key_labels = { - [""] = "␣", - [""] = "␣", - [""] = " ", - [""] = " ", - [""] = "⎋ ", - }, - window = { - border = "double", - margin = { 0, 0, 0, 0 }, - }, -}) - --- Telescope -wk.register({ - ["f"] = { - name = "+Telescope", - b = { "Telescope buffers", "File Browser" }, - d = { "Telescope find_files", "Find File" }, - g = { "Telescope live_grep", "Live Grep" }, - h = { "Telescope help_tags", "Help Tags" }, - p = { "Telescope project", "Project" }, - r = { "Telescope asynctasks all", "Run Asynctasks" }, - s = { - function() - local confpath = vim.fn.resolve(vim.fn.stdpath("config")) - require("telescope.builtin").find_files({ cwd = confpath }) - end, - "Find in config", - }, - }, -}) - --- clipboard -wk.register({ - [""] = { - y = { '"+y', "Copy to clipboard" }, - p = { '"+p', "Paste from clipboard" }, - db = { "DBUIToggle", "Toggle DBUI" }, - gd = { "Gvdiff!", "Git Diff" }, - ng = { "Neogit", "Neogit" }, - sl = { "SessionLoad", "Load Session" }, - }, -}, { mode = { "n", "v" } }) diff --git a/home/apps/neovim/lazy-lock.json b/home/apps/neovim/lazy-lock.json index 3cc620c..96a2023 100644 --- a/home/apps/neovim/lazy-lock.json +++ b/home/apps/neovim/lazy-lock.json @@ -17,7 +17,7 @@ "fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" }, "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, "gitsigns.nvim": { "branch": "main", "commit": "b1f9cf7c5c5639c006c937fc1819e09f358210fc" }, - "go.nvim": { "branch": "master", "commit": "f80661a7109373aedee491acd8ddadc57e5c60aa" }, + "go.nvim": { "branch": "master", "commit": "44130d73565cc123436ce7317bab4edce40a8886" }, "guihua.lua": { "branch": "master", "commit": "a19ac4447021f21383fadd7a9e1fc150d0b67e1f" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, "lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" }, diff --git a/home/apps/neovim/lua/config/init.lua b/home/apps/neovim/lua/config/init.lua index cdb2a4d..d3bf33b 100644 --- a/home/apps/neovim/lua/config/init.lua +++ b/home/apps/neovim/lua/config/init.lua @@ -1,151 +1,4 @@ require("config.autocmds") require("config.mappings") require("config.options") - -local plugins = { - { "catppuccin/nvim", name = "catppuccin" }, - "pocco81/true-zen.nvim", - "lewis6991/gitsigns.nvim", - "lukas-reineke/indent-blankline.nvim", - "akinsho/bufferline.nvim", - { - "nvim-lualine/lualine.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - "SmiteshP/nvim-navic", - }, - }, - "luukvbaal/stabilize.nvim", - { - "nvim-treesitter/nvim-treesitter", - build = function() - require("nvim-treesitter.install").update({ with_sync = true }) - end, - }, - "nvim-treesitter/playground", - "windwp/nvim-ts-autotag", - "HiPhish/nvim-ts-rainbow2", - -- syntax - { - "wuelnerdotexe/vim-astro", - config = function() - vim.g.astro_typescript = "enable" - end, - }, - "noahtheduke/vim-just", - - { "numtostr/comment.nvim", opts = {} }, - "gpanders/editorconfig.nvim", - "ggandor/lightspeed.nvim", - "windwp/nvim-autopairs", - "nvchad/nvim-colorizer.lua", - { "kylechui/nvim-surround", opts = {} }, - { "folke/todo-comments.nvim", opts = {} }, - "jamessan/vim-gnupg", - { - "dhruvasagar/vim-table-mode", - config = function() - vim.cmd([[autocmd FileType markdown let g:table_mode_corner='|']]) - end, - }, - "folke/which-key.nvim", - "f-person/auto-dark-mode.nvim", - - -- git - "tpope/vim-fugitive", - "TimUntersberger/neogit", - - -- databases - "tpope/vim-dadbod", - "kristijanhusak/vim-dadbod-completion", - { - "kristijanhusak/vim-dadbod-ui", - config = function() - vim.g.db_ui_use_nerd_fonts = true - vim.g.db_ui_win_position = "right" - end, - }, - - "skywind3000/asyncrun.vim", - "skywind3000/asynctasks.vim", - - -- telescope - { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - }, - "GustavoKatel/telescope-asynctasks.nvim", - "nvim-telescope/telescope-file-browser.nvim", - "nvim-telescope/telescope-project.nvim", - }, - }, - - { - "pwntester/octo.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - "nvim-tree/nvim-web-devicons", - }, - opts = {}, - }, - - -- nvimtree - "nvim-tree/nvim-web-devicons", - "nvim-tree/nvim-tree.lua", - - "stevearc/dressing.nvim", - - -- discord - "andweeb/presence.nvim", - { "iamcco/markdown-preview.nvim", build = "cd app && yarn install" }, - - "towolf/vim-helm", - -- LSP - { - "neovim/nvim-lspconfig", - dependencies = { - -- completion - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-path", - "hrsh7th/cmp-vsnip", - "hrsh7th/vim-vsnip", - "petertriho/cmp-git", - "onsails/lspkind.nvim", - "rafamadriz/friendly-snippets", - "jose-elias-alvarez/null-ls.nvim", - "folke/trouble.nvim", - "nvim-lua/lsp-status.nvim", - "j-hui/fidget.nvim", - "barreiroleo/ltex-extra.nvim", - "b0o/schemastore.nvim", - "hallerpatrick/py_lsp.nvim", - "simrat39/rust-tools.nvim", - { "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" } }, - { - "rcarriga/nvim-dap-ui", - dependencies = { - "mfussenegger/nvim-dap", - "theHamsta/nvim-dap-virtual-text", - }, - }, - }, - config = function() - require("lsp") - end, - }, - - -- lua github copilot - "zbirenbaum/copilot.lua", - - { "nvim-neorg/neorg", build = ":Neorg sync-parsers" }, -} - -require("config.plugins").setup(plugins) +require("config.plugins").setup({ { import = "plugins" } }) diff --git a/home/apps/neovim/lua/plugins/auto-dark-mode.lua b/home/apps/neovim/lua/plugins/auto-dark-mode.lua new file mode 100644 index 0000000..8000a44 --- /dev/null +++ b/home/apps/neovim/lua/plugins/auto-dark-mode.lua @@ -0,0 +1,33 @@ +return { + { + "f-person/auto-dark-mode.nvim", + config = function() + local autodm = require("auto-dark-mode") + if vim.fn.has("mac") ~= 1 then + return + end + + local update_neovide_background = function() + if not vim.g.neovide then + return + end + local ctp_present, ctp = pcall(require, "catppuccin.palettes") + if ctp_present then + vim.g.neovide_background_color = ctp.get_palette().base + end + end + + autodm.setup({ + set_dark_mode = function() + vim.api.nvim_set_option("background", "dark") + update_neovide_background() + end, + set_light_mode = function() + vim.api.nvim_set_option("background", "light") + update_neovide_background() + end, + }) + autodm.init() + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/auto-pairs.lua b/home/apps/neovim/lua/plugins/auto-pairs.lua new file mode 100644 index 0000000..b8b7c13 --- /dev/null +++ b/home/apps/neovim/lua/plugins/auto-pairs.lua @@ -0,0 +1,15 @@ +return { + { + "windwp/nvim-autopairs", + dependencies = { + "hrsh7th/nvim-cmp", + }, + config = function() + local ap = require("nvim-autopairs") + local cmp = require("cmp") + ap.setup() + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/bufferline.lua b/home/apps/neovim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..c32c16a --- /dev/null +++ b/home/apps/neovim/lua/plugins/bufferline.lua @@ -0,0 +1,100 @@ +return { + { + "akinsho/bufferline.nvim", + dependencies = { + { "catppuccin/nvim", name = "catppuccin" }, + }, + config = function() + local bufferline = require("bufferline") + local ctp = require("catppuccin.groups.integrations.bufferline").get() + + local v = vim.version() + local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch) + + bufferline.setup({ + highlights = ctp, + options = { + show_close_icon = false, + show_buffer_close_icons = false, + offsets = { + { + filetype = "NvimTree", + text = "  neovim " .. vStr, + text_align = "left", + separator = "║", + }, + }, + left_mouse_command = "buffer %d", + middle_mouse_command = "bdelete! %d", + right_mouse_command = nil, + indicator = { icon = "‣" }, + numbers = function(tab) + local roman = { + "Ⅰ", + "Ⅱ", + "Ⅲ", + "Ⅳ", + "Ⅴ", + "Ⅵ", + "Ⅶ", + "Ⅷ", + "Ⅸ", + "Ⅹ", + "Ⅺ", + "Ⅻ", + "XⅢ", + "XⅣ", + "ⅩⅤ", + "ⅩⅥ", + "ⅩⅦ", + "ⅩⅧ", + "ⅩⅨ", + "ⅩⅩ", + } + + return string.format("%s ", roman[tab.ordinal]) + end, + }, + }) + + local nmap = function(key, cmd) + vim.api.nvim_set_keymap( + "n", + key, + cmd, + { noremap = true, silent = true } + ) + end + + -- hop between buffers in order of the bar + nmap("", "BufferLineCyclePrev") + nmap("", "BufferLineCycleNext") + -- Re-order to previous/next + nmap("", "BufferLineMovePrev") + nmap(">", "BufferLineMoveNext") + -- Goto buffer in position... + nmap("", "BufferLineGoToBuffer 1") + nmap("", "BufferLineGoToBuffer 2") + nmap("", "BufferLineGoToBuffer 3") + nmap("", "BufferLineGoToBuffer 4") + nmap("", "BufferLineGoToBuffer 5") + nmap("", "BufferLineGoToBuffer 6") + nmap("", "BufferLineGoToBuffer 7") + nmap("", "BufferLineGoToBuffer 8") + nmap("", "BufferLineGoToBuffer 9") + nmap("", "BufferLineGoToBuffer -1") + -- Pin/unpin buffer + nmap("", "BufferLineTogglePin") + -- Close buffer + nmap("", "bdelete") + nmap("", "bdelete!") + -- create new buffer + nmap("", "enew") + -- pick buffer + nmap("", "BufferLinePick") + -- Sort automatically by... + nmap("bd", "BufferLineSortByDirectory") + nmap("bl", "BufferLineSortByExtension") + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/catppuccin.lua b/home/apps/neovim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..ecc0c1f --- /dev/null +++ b/home/apps/neovim/lua/plugins/catppuccin.lua @@ -0,0 +1,101 @@ +return { + { + "catppuccin/nvim", + name = "catppuccin", + config = function() + require("catppuccin").setup({ + transparent_background = true, + dim_inactive = { + enable = true, + shade = "dark", + percentage = 0.15, + }, + styles = { + comments = { "italic" }, + conditionals = { "italic" }, + }, + integrations = { + treesitter = true, + native_lsp = { + enabled = true, + virtual_text = { + errors = { "italic" }, + hints = { "italic" }, + warnings = { "italic" }, + information = { "italic" }, + }, + underlines = { + errors = { "undercurl" }, + hints = { "undercurl" }, + warnings = { "undercurl" }, + information = { "undercurl" }, + }, + }, + cmp = true, + lsp_trouble = true, + nvimtree = true, + which_key = true, + indent_blankline = { + enabled = true, + colored_indent_levels = true, + }, + navic = { + enabled = true, + custom_bg = "NONE", + }, + gitsigns = true, + lightspeed = true, + markdown = true, + neogit = true, + symbols_outline = true, + ts_rainbow = true, + vimwiki = true, + }, + highlight_overrides = { + all = function(colors) + return { + -- custom selection highlight + Selection = { bg = colors.surface1, fg = colors.text }, + -- borders + FloatBorder = { fg = colors.overlay0 }, + LspInfoBorder = { link = "FloatBorder" }, + NvimTreeWinSeparator = { link = "FloatBorder" }, + WhichKeyBorder = { link = "FloatBorder" }, + -- telescope + TelescopeBorder = { link = "FloatBorder" }, + TelescopeTitle = { fg = colors.text }, + TelescopeSelection = { link = "Selection" }, + TelescopeSelectionCaret = { link = "Selection" }, + -- pmenu + PmenuSel = { link = "Selection" }, + -- bufferline + BufferLineTabSeparator = { link = "FloatBorder" }, + BufferLineSeparator = { link = "FloatBorder" }, + BufferLineOffsetSeparator = { link = "FloatBorder" }, + -- + FidgetTitle = { fg = colors.subtext1 }, + FidgetTask = { fg = colors.subtext0 }, + } + end, + mocha = function(colors) + return { + Selection = { bg = "#121212", fg = colors.text }, + Comment = { fg = colors.surface2, style = { "italic" } }, + InlayHint = { fg = colors.surface0, style = { "italic" } }, + WinSeparator = { fg = colors.surface2 }, + } + end, + }, + color_overrides = { + mocha = { + base = "#000000", + crust = "#010101", + mantle = "#020202", + }, + }, + }) + + vim.cmd.colorscheme("catppuccin") + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/colorizer.lua b/home/apps/neovim/lua/plugins/colorizer.lua new file mode 100644 index 0000000..187d280 --- /dev/null +++ b/home/apps/neovim/lua/plugins/colorizer.lua @@ -0,0 +1,29 @@ +return { + { + "nvchad/nvim-colorizer.lua", + opts = { + user_default_options = { + RGB = true, + RRGGBB = true, + names = false, + RRGGBBAA = true, + AARRGGBB = false, + rgb_fn = false, + hsl_fn = false, + css = false, + css_fn = false, + mode = "background", + tailwind = "both", + sass = { enable = true }, + virtualtext = " ", + }, + buftypes = { + "*", + "!dashboard", + "!lazy", + "!popup", + "!prompt", + }, + }, + }, +} diff --git a/home/apps/neovim/lua/plugins/copilot.lua b/home/apps/neovim/lua/plugins/copilot.lua new file mode 100644 index 0000000..56c3082 --- /dev/null +++ b/home/apps/neovim/lua/plugins/copilot.lua @@ -0,0 +1,31 @@ +return { + { + "zbirenbaum/copilot.lua", + opts = { + panel = { + enabled = false, + }, + suggestion = { + enabled = true, + auto_trigger = true, + debounce = 75, + keymap = { + accept = "", + }, + }, + filetypes = { + yaml = true, + markdown = false, + help = false, + gitcommit = false, + gitrebase = false, + hgcommit = false, + svn = false, + cvs = false, + ["."] = false, + }, + copilot_node_command = "node", + server_opts_overrides = {}, + }, + }, +} diff --git a/home/apps/neovim/lua/plugins/databases.lua b/home/apps/neovim/lua/plugins/databases.lua new file mode 100644 index 0000000..2a217e2 --- /dev/null +++ b/home/apps/neovim/lua/plugins/databases.lua @@ -0,0 +1,11 @@ +return { + "tpope/vim-dadbod", + "kristijanhusak/vim-dadbod-completion", + { + "kristijanhusak/vim-dadbod-ui", + config = function() + vim.g.db_ui_use_nerd_fonts = true + vim.g.db_ui_win_position = "right" + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/editor.lua b/home/apps/neovim/lua/plugins/editor.lua new file mode 100644 index 0000000..9a13a3e --- /dev/null +++ b/home/apps/neovim/lua/plugins/editor.lua @@ -0,0 +1,20 @@ +return { + -- TODO: remove in nvim 0.9 because of upstream merge + "luukvbaal/stabilize.nvim", + -- zen mode + "pocco81/true-zen.nvim", + -- respect project settings + "gpanders/editorconfig.nvim", + -- best hop + "ggandor/lightspeed.nvim", + -- run tasks + "skywind3000/asyncrun.vim", + "skywind3000/asynctasks.vim", + -- ui + "stevearc/dressing.nvim", + -- highlight todo/fixme/etc + { "folke/todo-comments.nvim", opts = {} }, + -- pretty much default nvim at this point + { "kylechui/nvim-surround", opts = {} }, + { "numtostr/comment.nvim", opts = {} }, +} diff --git a/home/apps/neovim/lua/plugins/fidget.lua b/home/apps/neovim/lua/plugins/fidget.lua new file mode 100644 index 0000000..23c6493 --- /dev/null +++ b/home/apps/neovim/lua/plugins/fidget.lua @@ -0,0 +1,18 @@ +return { + { + "j-hui/fidget.nvim", + opts = { + text = { + spinner = "dots", + done = "﫠", + commenced = "init", + completed = "done", + }, + window = { blend = 0 }, + sources = { + ["copilot"] = { ignore = true }, + ["null-ls"] = { ignore = true }, + }, + }, + }, +} diff --git a/home/apps/neovim/lua/plugins/git.lua b/home/apps/neovim/lua/plugins/git.lua new file mode 100644 index 0000000..5688d4e --- /dev/null +++ b/home/apps/neovim/lua/plugins/git.lua @@ -0,0 +1,154 @@ +return { + "tpope/vim-fugitive", + { "TimUntersberger/neogit", opts = {} }, + { + "lewis6991/gitsigns.nvim", + config = function() + local present, wk = pcall(require, "which-key") + + if not present then + vim.notify("which-key not found") + return + end + + local gs = require("gitsigns") + + gs.setup({ + on_attach = function(bufnr) + -- Gitsigns + wk.register({ + ["h"] = { + name = "+Gitsigns", + s = { "Gitsigns stage_hunk", "Stage Hunk" }, + r = { "Gitsigns reset_hunk", "Reset Hunk" }, + }, + }, { mode = { "n", "v" } }) + + wk.register({ + ["h"] = { + name = "+Gitsigns", + s = { gs.stage_buffer, "Stage Buffer" }, + u = { gs.undo_stage_hunk, "Undo Stage Hunk" }, + R = { gs.reset_buffer, "Reset Buffer" }, + p = { gs.preview_hunk, "Preview Hunk" }, + b = { + function() + gs.blame_line({ full = true }) + end, + "Blame line", + }, + d = { gs.diffthis, "Diff current buffer" }, + D = { + function() + gs.diffthis("~") + end, + "Diff against last commit", + }, + }, + }) + + wk.register({ + ["t"] = { + name = "+Toggle settings", + b = { gs.toggle_current_line_blame, "Toggle blame lines" }, + d = { gs.toggle_deleted, "Toggle deleted lines" }, + }, + }) + + wk.register({ + ["[c"] = { + function() + if vim.wo.diff then + return "]c" + end + vim.schedule(function() + gs.next_hunk() + end) + return "" + end, + "Go to Next Hunk", + }, + ["]c"] = { + function() + if vim.wo.diff then + return "[c" + end + vim.schedule(function() + gs.prev_hunk() + end) + return "" + end, + "Go to Previous Hunk", + }, + }, { expr = true }) + + -- Text object + wk.register({ + ["ih"] = { ":Gitsigns select_hunk", "Select inside Hunk" }, + }, { mode = { "o", "x" } }) + end, + 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 = "x", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + linehl = false, + numhl = false, + signcolumn = true, + word_diff = false, + watch_gitdir = { enable = false, interval = 1000, follow_files = true }, + attach_to_untracked = true, + -- current line highlighting + current_line_blame = false, + current_line_blame_opts = { + delay = 1000, + ignore_whitespace = true, + virt_text = true, + virt_text_pos = "eol", + }, + current_line_blame_formatter = ", - | ", + -- perf + max_file_length = 40000, + sign_priority = 6, + update_debounce = 100, + -- use the included status formatter + status_formatter = nil, + preview_config = { + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { enable = false }, + }) + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/indent-blankline.lua b/home/apps/neovim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..90f3d4d --- /dev/null +++ b/home/apps/neovim/lua/plugins/indent-blankline.lua @@ -0,0 +1,19 @@ +return { + { + "lukas-reineke/indent-blankline.nvim", + config = function() + require("indent_blankline").setup({ + space_char_blankline = " ", + }) + vim.g.indent_blankline_filetype_exclude = { + "dashboard", + "fugitive", + "help", + "lazy", + "NvimTree", + "neogitstatus", + "Trouble", + } + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/lsp.lua b/home/apps/neovim/lua/plugins/lsp.lua new file mode 100644 index 0000000..ce2af50 --- /dev/null +++ b/home/apps/neovim/lua/plugins/lsp.lua @@ -0,0 +1,37 @@ +return { + { + "neovim/nvim-lspconfig", + dependencies = { + -- completion + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "hrsh7th/cmp-vsnip", + "hrsh7th/vim-vsnip", + "petertriho/cmp-git", + "onsails/lspkind.nvim", + "rafamadriz/friendly-snippets", + "jose-elias-alvarez/null-ls.nvim", + "folke/trouble.nvim", + "nvim-lua/lsp-status.nvim", + "barreiroleo/ltex-extra.nvim", + "b0o/schemastore.nvim", + "hallerpatrick/py_lsp.nvim", + "simrat39/rust-tools.nvim", + { "ray-x/go.nvim", dependencies = { "ray-x/guihua.lua" } }, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "theHamsta/nvim-dap-virtual-text", + }, + }, + }, + config = function() + require("lsp") + end, + }, + "towolf/vim-helm", +} diff --git a/home/apps/neovim/lua/plugins/lualine.lua b/home/apps/neovim/lua/plugins/lualine.lua new file mode 100644 index 0000000..a709b4c --- /dev/null +++ b/home/apps/neovim/lua/plugins/lualine.lua @@ -0,0 +1,95 @@ +return { + { + "nvim-lualine/lualine.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + { + "SmiteshP/nvim-navic", + opts = { + icons = { + File = " ", + Module = " ", + Namespace = " ", + Package = " ", + Class = " ", + Method = " ", + Property = " ", + Field = " ", + Constructor = " ", + Enum = " ", + Interface = " ", + Function = " ", + Variable = " ", + Constant = " ", + String = " ", + Number = " ", + Boolean = " ", + Array = " ", + Object = " ", + Key = " ", + Null = " ", + EnumMember = " ", + Struct = " ", + Event = " ", + Operator = " ", + TypeParameter = " ", + }, + }, + }, + }, + config = function() + local lualine = require("lualine") + local navic = require("nvim-navic") + + local config = { + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = true, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, + }, + sections = { + lualine_a = { + { + "mode", + fmt = function(str) + return " " .. str + end, + }, + }, + lualine_b = { + { "branch", icon = "" }, + "diff", + "diagnostics", + }, + lualine_c = { + { navic.get_location, condition = navic.is_available }, + "searchcount", + "lsp_progress", + }, + lualine_x = { "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, + } + + lualine.setup(config) + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/natural-language.lua b/home/apps/neovim/lua/plugins/natural-language.lua new file mode 100644 index 0000000..5722213 --- /dev/null +++ b/home/apps/neovim/lua/plugins/natural-language.lua @@ -0,0 +1,10 @@ +return { + { + "dhruvasagar/vim-table-mode", + config = function() + vim.cmd([[autocmd FileType markdown let g:table_mode_corner='|']]) + end, + }, + "jamessan/vim-gnupg", + { "iamcco/markdown-preview.nvim", build = "cd app && yarn install" }, +} diff --git a/home/apps/neovim/lua/plugins/neorg.lua b/home/apps/neovim/lua/plugins/neorg.lua new file mode 100644 index 0000000..011fbb6 --- /dev/null +++ b/home/apps/neovim/lua/plugins/neorg.lua @@ -0,0 +1,11 @@ +return { + { + "nvim-neorg/neorg", + build = ":Neorg sync-parsers", + opts = { + load = { + ["core.defaults"] = {}, + }, + }, + }, +} diff --git a/home/apps/neovim/lua/plugins/nvim-tree.lua b/home/apps/neovim/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..f3fa98f --- /dev/null +++ b/home/apps/neovim/lua/plugins/nvim-tree.lua @@ -0,0 +1,25 @@ +return { + { + "nvim-tree/nvim-tree.lua", + opts = { + renderer = { + indent_markers = { + enable = true, + }, + }, + diagnostics = { + enable = true, + }, + actions = { + file_popup = { + open_win_config = { + border = "double", + }, + }, + }, + }, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + }, +} diff --git a/home/apps/neovim/lua/plugins/presence.lua b/home/apps/neovim/lua/plugins/presence.lua new file mode 100644 index 0000000..0368d68 --- /dev/null +++ b/home/apps/neovim/lua/plugins/presence.lua @@ -0,0 +1,111 @@ +return { + { + "andweeb/presence.nvim", + config = function() + local presence = require("presence") + + function string.starts(self, str) + return self:find("^" .. str) ~= nil + end + + local home = vim.fn.expand("$HOME") .. "/Code/" + + local blacklist = { + [vim.fn.resolve(home .. "work")] = "Using nvim at work.", + [vim.fn.resolve(home .. "freelance")] = "Using nvim to freelance.", + [vim.fn.resolve(vim.fn.stdpath("config"))] = "Configuring nvim. (" + .. require("lazy").stats().count + .. " plugins)", + } + + local conceal = function(activity, info) + local cur_file = vim.fn.expand("%:p") + for k, v in pairs(blacklist) do + if cur_file:starts(k) then + return v + end + end + if info ~= nil then + return activity .. " " .. info + end + end + + local v = vim.version() + local vStr = string.format("v%d.%d.%d", v.major, v.minor, v.patch) + + presence:setup({ + -- General options + auto_update = true, + debounce_timeout = 10, + neovim_image_text = "Neovim " .. vStr, + -- Main image display (either "neovim" or "file") + main_image = "file", + show_time = false, + buttons = function(buffer, repo_url) + local concealed = conceal() + if concealed then + return { + { + label = "View my config", + url = "https://github.com/nekowinston/dotfiles", + }, + } + else + return { + { + label = "View the repository", + url = repo_url, + }, + } + end + end, + file_assets = { + ["k8s.yaml"] = { + "Kubernetes", + "https://avatars.githubusercontent.com/u/13629408", + }, + ["Chart.yaml"] = { + "Helm Chart", + "https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png", + }, + ["helmfile.yaml"] = { + "helmfile", + "https://raw.githubusercontent.com/helm/community/main/art/images/Logo-Tweak-Dark.png", + }, + ["prisma"] = { + "Prisma", + "https://avatars.githubusercontent.com/u/17219288", + }, + ["bu"] = { + "Butane Config", + "https://avatars.githubusercontent.com/u/3730757", + }, + ["ign"] = { + "CoreOS Ignition", + "https://avatars.githubusercontent.com/u/3730757", + }, + }, + -- Rich Presence text options + editing_text = function(s) + return conceal("Editing", s) + end, + reading_text = function(s) + return conceal("Reading", s) + end, + file_explorer_text = function(s) + return conceal("Browsing", s) + end, + workspace_text = function(s) + local concealed = conceal() + if s ~= nil and not concealed then + return "Working on " .. s + else + return nil + end + end, + git_commit_text = "Committing changes", + plugin_manager_text = "Managing Plugins", + }) + end, + }, +} diff --git a/home/apps/neovim/lua/plugins/telescope.lua b/home/apps/neovim/lua/plugins/telescope.lua new file mode 100644 index 0000000..bcb7447 --- /dev/null +++ b/home/apps/neovim/lua/plugins/telescope.lua @@ -0,0 +1,60 @@ +return { + { + { + "nvim-telescope/telescope.nvim", + config = function() + local telescope = require("telescope") + + pcall(telescope.load_extension, "fzf") + pcall(telescope.load_extension, "asynctasks") + pcall(telescope.load_extension, "file_browser") + pcall(telescope.load_extension, "project") + + telescope.setup({ + defaults = { + selection_caret = "▶ ", + borderchars = { + "═", + "║", + "═", + "║", + "╔", + "╗", + "╝", + "╚", + }, + }, + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + }, + }, + }) + end, + dependencies = { + "nvim-lua/plenary.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + }, + "GustavoKatel/telescope-asynctasks.nvim", + "nvim-telescope/telescope-file-browser.nvim", + "nvim-telescope/telescope-project.nvim", + }, + }, + + -- octo extension + { + "pwntester/octo.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", + }, + opts = {}, + }, + }, +} diff --git a/home/apps/neovim/lua/plugins/tree-sitter.lua b/home/apps/neovim/lua/plugins/tree-sitter.lua new file mode 100644 index 0000000..4793b9f --- /dev/null +++ b/home/apps/neovim/lua/plugins/tree-sitter.lua @@ -0,0 +1,75 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, + config = function() + local treesitter = require("nvim-treesitter.configs") + local parsers = require("nvim-treesitter.parsers") + + local parser_config = parsers.get_parser_configs() + parser_config.gotmpl = { + install_info = { + url = "https://github.com/ngalaiko/tree-sitter-go-template", + files = { "src/parser.c" }, + }, + filetype = "gotmpl", + used_by = { "gohtmltmpl", "gotexttmpl", "gotmpl", "yaml", "helm" }, + } + + local ft_to_parser = parsers.filetype_to_parsername + ft_to_parser.helm = "gotmpl" + + treesitter.setup({ + auto_install = true, + ignore_install = { + "phpdoc", + }, + highlight = { + enable = true, + }, + rainbow = { + enable = true, + extended_mode = true, + max_file_lines = 8192, + }, + ensure_installed = { + "bash", + "css", + "dockerfile", + "go", + "html", + "javascript", + "json", + "lua", + "markdown", + "python", + "regex", + "rust", + "scss", + "toml", + "tsx", + "typescript", + "yaml", + }, + }) + + vim.o.foldmethod = "expr" + vim.o.foldexpr = "nvim_treesitter#foldexpr()" + vim.o.foldenable = false + end, + }, + "nvim-treesitter/playground", + "windwp/nvim-ts-autotag", + "HiPhish/nvim-ts-rainbow2", + + -- not treesitter, but close enough + { + "wuelnerdotexe/vim-astro", + config = function() + vim.g.astro_typescript = "enable" + end, + }, + "noahtheduke/vim-just", +} diff --git a/home/apps/neovim/lua/plugins/which-key.lua b/home/apps/neovim/lua/plugins/which-key.lua new file mode 100644 index 0000000..7402868 --- /dev/null +++ b/home/apps/neovim/lua/plugins/which-key.lua @@ -0,0 +1,54 @@ +return { + { + "folke/which-key.nvim", + config = function() + local wk = require("which-key") + + wk.setup({ + key_labels = { + [""] = "␣", + [""] = "␣", + [""] = " ", + [""] = " ", + [""] = "⎋ ", + }, + window = { + border = "double", + margin = { 0, 0, 0, 0 }, + }, + }) + + -- Telescope + wk.register({ + ["f"] = { + name = "+Telescope", + b = { "Telescope buffers", "File Browser" }, + d = { "Telescope find_files", "Find File" }, + g = { "Telescope live_grep", "Live Grep" }, + h = { "Telescope help_tags", "Help Tags" }, + p = { "Telescope project", "Project" }, + r = { "Telescope asynctasks all", "Run Asynctasks" }, + s = { + function() + local confpath = vim.fn.resolve(vim.fn.stdpath("config")) + require("telescope.builtin").find_files({ cwd = confpath }) + end, + "Find in config", + }, + }, + }) + + -- clipboard + wk.register({ + [""] = { + y = { '"+y', "Copy to clipboard" }, + p = { '"+p', "Paste from clipboard" }, + db = { "DBUIToggle", "Toggle DBUI" }, + gd = { "Gvdiff!", "Git Diff" }, + ng = { "Neogit", "Neogit" }, + sl = { "SessionLoad", "Load Session" }, + }, + }, { mode = { "n", "v" } }) + end, + }, +}