diff --git a/home-manager/modules/neovim/plugins/cmp.nix b/home-manager/modules/neovim/plugins/cmp.nix index 75d6f98..31e0947 100644 --- a/home-manager/modules/neovim/plugins/cmp.nix +++ b/home-manager/modules/neovim/plugins/cmp.nix @@ -69,10 +69,10 @@ "" = "cmp.mapping.confirm({ select = true })"; "" = '' cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_locally_jumpable() then + if require("luasnip").expand_or_locally_jumpable() then require("luasnip").expand_or_jump() + elseif cmp.visible() then + cmp.select_next_item() elseif has_words_before() then cmp.complete() else @@ -82,10 +82,10 @@ ''; "" = '' cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then + if require("luasnip").jumpable(-1) then require("luasnip").jump(-1) + elseif cmp.visible() then + cmp.select_prev_item() else fallback() end diff --git a/home-manager/modules/neovim/plugins/debugprint.nix b/home-manager/modules/neovim/plugins/debugprint.nix new file mode 100644 index 0000000..cbf6f95 --- /dev/null +++ b/home-manager/modules/neovim/plugins/debugprint.nix @@ -0,0 +1,38 @@ +{...}: { + programs.nixvim = { + plugins = { + debugprint = { + enable = true; + + settings = { + commands = { + toggle_comment_debug_prints = "ToggleCommentDebugPrints"; + delete_debug_prints = "DeleteDebugPrints"; + }; + + display_counter = true; + display_snippet = true; + + keymaps = { + normal = { + plain_below = "g?p"; + plain_above = "g?P"; + variable_below = "g?v"; + variable_above = "g?V"; + variable_below_alwaysprompt.__raw = "nil"; + variable_above_alwaysprompt.__raw = "nil"; + textobj_below = "g?o"; + textobj_above = "g?O"; + toggle_comment_debug_prints.__raw = "nil"; + delete_debug_prints.__raw = "nil"; + }; + visual = { + variable_below = "g?v"; + variable_above = "g?V"; + }; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/default.nix b/home-manager/modules/neovim/plugins/default.nix index 7507753..7943ef6 100644 --- a/home-manager/modules/neovim/plugins/default.nix +++ b/home-manager/modules/neovim/plugins/default.nix @@ -8,12 +8,14 @@ _: { ./conform.nix ./clangd-extensions.nix ./cmp.nix + ./debugprint.nix ./diffview.nix ./flash.nix ./git-conflict.nix ./gitsigns.nix ./harpoon.nix ./illuminate.nix + ./indent-blankline.nix ./lightbulb.nix ./lualine.nix ./luasnip.nix @@ -37,6 +39,7 @@ _: { ./which-key.nix ./undotree.nix ./yazi.nix + ./yanky.nix ./vimtex.nix ]; } diff --git a/home-manager/modules/neovim/plugins/indent-blankline.nix b/home-manager/modules/neovim/plugins/indent-blankline.nix new file mode 100644 index 0000000..910699d --- /dev/null +++ b/home-manager/modules/neovim/plugins/indent-blankline.nix @@ -0,0 +1,30 @@ +{...}: { + programs.nixvim = { + plugins.indent-blankline = { + enable = true; + + settings = { + scope.enabled = false; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "ui"; + action = "IBLToggle"; + options = { + desc = "Indent-Blankline toggle"; + }; + } + { + mode = "n"; + key = "uI"; + action = "IBLToggleScope"; + options = { + desc = "Indent-Blankline Scope toggle"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/noice.nix b/home-manager/modules/neovim/plugins/noice.nix index c317a16..250900c 100644 --- a/home-manager/modules/neovim/plugins/noice.nix +++ b/home-manager/modules/neovim/plugins/noice.nix @@ -2,6 +2,138 @@ programs.nixvim = { plugins.noice = { enable = true; + + # Hides the title above noice boxes + cmdline = { + format = { + cmdline = { + pattern = "^:"; + icon = ""; + lang = "vim"; + opts = { + border = { + text = { + top = "Cmd"; + }; + }; + }; + }; + search_down = { + kind = "search"; + pattern = "^/"; + icon = " "; + lang = "regex"; + }; + search_up = { + kind = "search"; + pattern = "^%?"; + icon = " "; + lang = "regex"; + }; + filter = { + pattern = "^:%s*!"; + icon = ""; + lang = "bash"; + opts = { + border = { + text = { + top = "Bash"; + }; + }; + }; + }; + lua = { + pattern = "^:%s*lua%s+"; + icon = ""; + lang = "lua"; + }; + help = { + pattern = "^:%s*he?l?p?%s+"; + icon = "󰋖"; + }; + input = {}; + }; + }; + + messages = { + view = "mini"; + viewError = "mini"; + viewWarn = "mini"; + }; + + lsp = { + override = { + "vim.lsp.util.convert_input_to_markdown_lines" = true; + "vim.lsp.util.stylize_markdown" = true; + "cmp.entry.get_documentation" = true; + }; + + progress.enabled = true; + signature.enabled = true; + }; + + popupmenu.backend = "nui"; + # Doesn't support the standard cmdline completions + # popupmenu.backend = "cmp"; + + presets = { + bottom_search = false; + command_palette = true; + long_message_to_split = true; + inc_rename = true; + lsp_doc_border = true; + }; + + routes = [ + { + filter = { + event = "msg_show"; + kind = "search_count"; + }; + opts = { + skip = true; + }; + } + { + # skip progress messages from noisy servers + filter = { + event = "lsp"; + kind = "progress"; + cond.__raw = '' + function(message) + local client = vim.tbl_get(message.opts, 'progress', 'client') + local servers = { 'jdtls' } + + for index, value in ipairs(servers) do + if value == client then + return true + end + end + end + ''; + }; + opts = { + skip = true; + }; + } + ]; + + views = { + cmdline_popup = { + border = { + style = "single"; + }; + }; + + confirm = { + border = { + style = "single"; + text = { + top = ""; + }; + }; + }; + }; }; }; } diff --git a/home-manager/modules/neovim/plugins/yanky.nix b/home-manager/modules/neovim/plugins/yanky.nix new file mode 100644 index 0000000..e4919de --- /dev/null +++ b/home-manager/modules/neovim/plugins/yanky.nix @@ -0,0 +1,9 @@ +{...}: { + programs.nixvim = { + plugins = { + yanky = { + enable = true; + }; + }; + }; +} diff --git a/home-manager/modules/zsh.nix b/home-manager/modules/zsh.nix index 6bc6bb1..088c82c 100644 --- a/home-manager/modules/zsh.nix +++ b/home-manager/modules/zsh.nix @@ -72,6 +72,8 @@ size = 10000; path = "${config.xdg.dataHome}/zsh/history"; }; - initExtra = ''''; + initExtra = '' + eval $(thefuck --alias) + ''; }; }