From 0a5e457ae05f825ebf9f3135f9c69c2815258733 Mon Sep 17 00:00:00 2001 From: Elisiei Yehorov Date: Fri, 20 Feb 2026 00:59:30 +0100 Subject: [PATCH] i got tired of b&w --- home/modules/ide/nvim/config.lua | 9 + home/modules/ide/nvim/default.nix | 83 +- home/modules/ide/nvim/keymaps.nix | 57 + .../ide/nvim/lsp/{lsp.nix => default.nix} | 21 +- home/modules/ide/nvim/lsp/fidget.nix | 10 - home/modules/ide/nvim/lsp/go.nix | 10 + home/modules/ide/nvim/lsp/langs/c.nix | 18 - home/modules/ide/nvim/lsp/langs/default.nix | 5 - home/modules/ide/nvim/lsp/langs/go.nix | 23 - home/modules/ide/nvim/lsp/langs/lua.nix | 12 - home/modules/ide/nvim/lsp/langs/nix.nix | 13 - home/modules/ide/nvim/lsp/langs/vue.nix | 5 - home/modules/ide/nvim/lsp/nixd.nix | 7 + home/modules/ide/nvim/lsp/roslyn.nix | 17 - home/modules/ide/nvim/options.nix | 33 + home/modules/ide/nvim/plugins/aerial.nix | 63 -- home/modules/ide/nvim/plugins/autopairs.nix | 11 - home/modules/ide/nvim/plugins/basics.nix | 23 + home/modules/ide/nvim/plugins/blink.nix | 95 -- home/modules/ide/nvim/plugins/completion.nix | 38 + home/modules/ide/nvim/plugins/conform.nix | 23 + home/modules/ide/nvim/plugins/dashboard.nix | 86 -- home/modules/ide/nvim/plugins/extra.nix | 5 + home/modules/ide/nvim/plugins/files.nix | 55 + home/modules/ide/nvim/plugins/git.nix | 13 + home/modules/ide/nvim/plugins/hlchunk.nix | 46 - home/modules/ide/nvim/plugins/icons.nix | 5 + home/modules/ide/nvim/plugins/keymap.nix | 5 + home/modules/ide/nvim/plugins/lualine.nix | 97 -- home/modules/ide/nvim/plugins/neo-tree.nix | 139 --- home/modules/ide/nvim/plugins/notify.nix | 5 + home/modules/ide/nvim/plugins/pairs.nix | 12 + home/modules/ide/nvim/plugins/snacks.nix | 45 - home/modules/ide/nvim/plugins/snippets.nix | 5 + home/modules/ide/nvim/plugins/starter.nix | 26 + home/modules/ide/nvim/plugins/statusline.nix | 8 + home/modules/ide/nvim/plugins/toggleterm.nix | 33 - home/modules/ide/nvim/plugins/treesitter.nix | 49 +- home/modules/ide/nvim/plugins/treesj.nix | 25 - .../modules/ide/nvim/plugins/web-devicons.nix | 10 - .../plugins/which-key.nix} | 2 +- home/modules/ide/nvim/plugins/yanky.nix | 139 --- home/modules/ide/nvim/theme.nix | 5 + home/modules/shell/bash/default.nix | 6 +- home/modules/shell/fish/config.fish | 2 +- home/modules/shell/nushell/config.nu | 103 -- .../shell/nushell/config/aliases/git.nu | 246 ----- .../shell/nushell/config/completions/git.nu | 985 ------------------ .../shell/nushell/config/completions/make.nu | 64 -- .../nushell/config/hooks/did_you_mean.nu | 48 - .../shell/nushell/config/scripts/nufetch.nu | 120 --- .../nushell/config/themes/tokyo-night.nu | 133 --- home/modules/shell/nushell/default.nix | 12 - home/modules/terminal/foot/default.nix | 2 +- .../terminal/foot/themes/tokyonight.ini | 2 +- 55 files changed, 401 insertions(+), 2713 deletions(-) create mode 100644 home/modules/ide/nvim/keymaps.nix rename home/modules/ide/nvim/lsp/{lsp.nix => default.nix} (83%) delete mode 100644 home/modules/ide/nvim/lsp/fidget.nix create mode 100644 home/modules/ide/nvim/lsp/go.nix delete mode 100644 home/modules/ide/nvim/lsp/langs/c.nix delete mode 100644 home/modules/ide/nvim/lsp/langs/default.nix delete mode 100644 home/modules/ide/nvim/lsp/langs/go.nix delete mode 100644 home/modules/ide/nvim/lsp/langs/lua.nix delete mode 100644 home/modules/ide/nvim/lsp/langs/nix.nix delete mode 100644 home/modules/ide/nvim/lsp/langs/vue.nix create mode 100644 home/modules/ide/nvim/lsp/nixd.nix delete mode 100644 home/modules/ide/nvim/lsp/roslyn.nix create mode 100644 home/modules/ide/nvim/options.nix delete mode 100644 home/modules/ide/nvim/plugins/aerial.nix delete mode 100644 home/modules/ide/nvim/plugins/autopairs.nix create mode 100644 home/modules/ide/nvim/plugins/basics.nix delete mode 100644 home/modules/ide/nvim/plugins/blink.nix create mode 100644 home/modules/ide/nvim/plugins/completion.nix create mode 100644 home/modules/ide/nvim/plugins/conform.nix delete mode 100644 home/modules/ide/nvim/plugins/dashboard.nix create mode 100644 home/modules/ide/nvim/plugins/extra.nix create mode 100644 home/modules/ide/nvim/plugins/files.nix create mode 100644 home/modules/ide/nvim/plugins/git.nix delete mode 100644 home/modules/ide/nvim/plugins/hlchunk.nix create mode 100644 home/modules/ide/nvim/plugins/icons.nix create mode 100644 home/modules/ide/nvim/plugins/keymap.nix delete mode 100644 home/modules/ide/nvim/plugins/lualine.nix delete mode 100644 home/modules/ide/nvim/plugins/neo-tree.nix create mode 100644 home/modules/ide/nvim/plugins/notify.nix create mode 100644 home/modules/ide/nvim/plugins/pairs.nix delete mode 100644 home/modules/ide/nvim/plugins/snacks.nix create mode 100644 home/modules/ide/nvim/plugins/snippets.nix create mode 100644 home/modules/ide/nvim/plugins/starter.nix create mode 100644 home/modules/ide/nvim/plugins/statusline.nix delete mode 100644 home/modules/ide/nvim/plugins/toggleterm.nix delete mode 100644 home/modules/ide/nvim/plugins/treesj.nix delete mode 100644 home/modules/ide/nvim/plugins/web-devicons.nix rename home/modules/ide/{micro/default.nix => nvim/plugins/which-key.nix} (53%) delete mode 100644 home/modules/ide/nvim/plugins/yanky.nix delete mode 100644 home/modules/shell/nushell/config.nu delete mode 100644 home/modules/shell/nushell/config/aliases/git.nu delete mode 100644 home/modules/shell/nushell/config/completions/git.nu delete mode 100644 home/modules/shell/nushell/config/completions/make.nu delete mode 100644 home/modules/shell/nushell/config/hooks/did_you_mean.nu delete mode 100644 home/modules/shell/nushell/config/scripts/nufetch.nu delete mode 100644 home/modules/shell/nushell/config/themes/tokyo-night.nu delete mode 100644 home/modules/shell/nushell/default.nix diff --git a/home/modules/ide/nvim/config.lua b/home/modules/ide/nvim/config.lua index d2ed9ab..8c8ea69 100644 --- a/home/modules/ide/nvim/config.lua +++ b/home/modules/ide/nvim/config.lua @@ -4,3 +4,12 @@ vim.o.undofile = true vim.o.undodir = vim.fn.expand("~/.local/state/nvim/undo") vim.diagnostic.config({ signs = false }) vim.print("loaded extra config.lua file ;)") + +vim.api.nvim_create_autocmd("BufEnter", { + callback = function(args) + local bt = vim.bo[args.buf].buftype + if bt == "prompt" then + vim.b[args.buf].minicompletion_disable = true + end + end, +}) diff --git a/home/modules/ide/nvim/default.nix b/home/modules/ide/nvim/default.nix index 52a77e8..570e3de 100644 --- a/home/modules/ide/nvim/default.nix +++ b/home/modules/ide/nvim/default.nix @@ -1,74 +1,37 @@ -{ pkgs, inputs, ... }: - -# my most preciated config, well documented if you want to use it. -# inspired by https://github.com/xhuyz/nixvim - -{ - imports = [ inputs.nixvim.homeModules.nixvim ]; +{inputs, ...}: { + imports = [inputs.nixvim.homeModules.nixvim]; programs.nixvim = { enable = true; imports = [ # plugins - # ./plugins/aerial.nix - ./plugins/autopairs.nix - ./plugins/blink.nix - ./plugins/dashboard.nix - ./plugins/hlchunk.nix - ./plugins/lualine.nix - ./plugins/neo-tree.nix - ./plugins/snacks.nix - ./plugins/toggleterm.nix + ./plugins/basics.nix + ./plugins/completion.nix + ./plugins/extra.nix + ./plugins/files.nix + ./plugins/git.nix + ./plugins/icons.nix + ./plugins/notify.nix + ./plugins/pairs.nix + ./plugins/statusline.nix + ./plugins/starter.nix + ./plugins/snippets.nix + ./plugins/which-key.nix + ./plugins/conform.nix ./plugins/treesitter.nix - ./plugins/treesj.nix - ./plugins/web-devicons.nix - ./plugins/yanky.nix + + # lsp + ./lsp/default.nix + + # keymaps + ./keymaps.nix # theme ./theme.nix - # lsp - ./lsp/fidget.nix - ./lsp/lsp.nix - ./lsp/roslyn.nix + # options + ./options.nix ]; - - globals.mapleader = " "; - - opts = { - number = true; - relativenumber = false; - colorcolumn = "0"; - shiftwidth = 2; - tabstop = 2; - wrap = false; - swapfile = false; # undotree - backup = false; # undotree - undofile = true; - hlsearch = false; - incsearch = true; - termguicolors = true; - scrolloff = 8; - signcolumn = "no"; - updatetime = 50; - foldlevelstart = 99; - }; - - clipboard = { - register = "unnamedplus"; - }; - - extraPackages = with pkgs; [ - # formatters - stylua - nixfmt-rfc-style - - # linters - golangci-lint - shellcheck - ]; - - extraConfigLua = builtins.readFile ./config.lua; }; } diff --git a/home/modules/ide/nvim/keymaps.nix b/home/modules/ide/nvim/keymaps.nix new file mode 100644 index 0000000..db32a95 --- /dev/null +++ b/home/modules/ide/nvim/keymaps.nix @@ -0,0 +1,57 @@ +{ + keymaps = [ + { + key = "e"; + action.__raw = '' + function() + require("neo-tree.command").execute({ + toggle = true, + dir = vim.fn.getcwd() + }) + end + ''; + } + { + key = "ff"; + mode = ["n"]; + action = "lua Snacks.picker.files()"; + options.desc = "find files"; + } + { + key = "gr"; + mode = ["n"]; + action = "lua Snacks.picker.grep()"; + options.desc = "find grep"; + } + { + key = "gl"; + mode = ["n"]; + action = "lua Snacks.picker.git_log()"; + options.desc = "git log"; + } + { + key = "gs"; + mode = ["n"]; + action = "lua Snacks.picker.git_status()"; + options.desc = "git status"; + } + { + key = "uC"; + mode = ["n"]; + action = "lua Snacks.picker.colorschemes()"; + options.desc = "colorschemes"; + } + { + key = ":"; + mode = ["n"]; + action = "lua Snacks.picker.command_history()"; + options.desc = "command history"; + } + { + key = ""; + mode = ["n"]; + action = "Neotree source=filesystem focus"; + options.desc = "switch focus"; + } + ]; +} diff --git a/home/modules/ide/nvim/lsp/lsp.nix b/home/modules/ide/nvim/lsp/default.nix similarity index 83% rename from home/modules/ide/nvim/lsp/lsp.nix rename to home/modules/ide/nvim/lsp/default.nix index 8b0be38..7457326 100644 --- a/home/modules/ide/nvim/lsp/lsp.nix +++ b/home/modules/ide/nvim/lsp/default.nix @@ -1,9 +1,8 @@ { - pkgs, - ... -}: -{ - imports = [ ./langs/default.nix ]; + imports = [ + ./nixd.nix + ./go.nix + ]; plugins = { lsp = { enable = true; @@ -62,17 +61,5 @@ }; lsp-lines.enable = true; lsp-format.enable = true; - helm.enable = true; }; - - extraPlugins = with pkgs.vimPlugins; [ - roslyn-nvim - ]; - extraPackages = with pkgs; [ - roslyn-ls - nixfmt-rfc-style - svelte-language-server - typescript-language-server - typescript - ]; } diff --git a/home/modules/ide/nvim/lsp/fidget.nix b/home/modules/ide/nvim/lsp/fidget.nix deleted file mode 100644 index bfde202..0000000 --- a/home/modules/ide/nvim/lsp/fidget.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - plugins.fidget = { - enable = true; - settings.progress = { - suppress_on_insert = true; - ignore_done_already = true; - poll_rate = 1; - }; - }; -} diff --git a/home/modules/ide/nvim/lsp/go.nix b/home/modules/ide/nvim/lsp/go.nix new file mode 100644 index 0000000..edd09d4 --- /dev/null +++ b/home/modules/ide/nvim/lsp/go.nix @@ -0,0 +1,10 @@ +{ + plugins.lsp.servers.gopls = { + enable = true; + filetypes = [ + "go" + "mod" + "sum" + ]; + }; +} diff --git a/home/modules/ide/nvim/lsp/langs/c.nix b/home/modules/ide/nvim/lsp/langs/c.nix deleted file mode 100644 index 7829578..0000000 --- a/home/modules/ide/nvim/lsp/langs/c.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ lib, pkgs, ... }: -{ - plugins = { - lsp.servers = { - clangd.enable = true; - cmake.enable = true; - }; - - conform-nvim.settings = { - formatters_by_ft = { - c = [ "clang_format" ]; - cpp = [ "clang_format" ]; - cmake = [ "cmake-format" ]; - }; - formatters.cmake-format.command = lib.getExe pkgs.cmake-format; - }; - }; -} diff --git a/home/modules/ide/nvim/lsp/langs/default.nix b/home/modules/ide/nvim/lsp/langs/default.nix deleted file mode 100644 index 37ea051..0000000 --- a/home/modules/ide/nvim/lsp/langs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = - with builtins; - map (fn: ./${fn}) (filter (fn: fn != "default.nix") (attrNames (readDir ./.))); -} diff --git a/home/modules/ide/nvim/lsp/langs/go.nix b/home/modules/ide/nvim/lsp/langs/go.nix deleted file mode 100644 index 1430f96..0000000 --- a/home/modules/ide/nvim/lsp/langs/go.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ lib, pkgs, ... }: -{ - plugins = { - lsp.servers = { - gopls = { - enable = true; - filetypes = [ - "go" - ]; - }; - }; - conform-nvim.settings = { - formatters_by_ft = { - go = [ "gofmt" ]; - }; - formatters = { - gofmt = { - command = lib.getExe pkgs.go + " fmt"; - }; - }; - }; - }; -} diff --git a/home/modules/ide/nvim/lsp/langs/lua.nix b/home/modules/ide/nvim/lsp/langs/lua.nix deleted file mode 100644 index 1a5523d..0000000 --- a/home/modules/ide/nvim/lsp/langs/lua.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - plugins = { - lsp.servers.lua_ls.enable = true; - conform-nvim.settings = { - formatters_by_ft.lua = [ "stylua" ]; - formatters.stylua = { - # if a command is string then it will execute the system's stylua binary - command = "stylua"; - }; - }; - }; -} diff --git a/home/modules/ide/nvim/lsp/langs/nix.nix b/home/modules/ide/nvim/lsp/langs/nix.nix deleted file mode 100644 index e802d27..0000000 --- a/home/modules/ide/nvim/lsp/langs/nix.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - plugins = { - lsp.servers = { - nixd = { - enable = true; - cmd = [ "nixd" ]; - rootMarkers = [ - "require('lspconfig.util').root_pattern('.nixd.json', 'flake.nix', '.git')" - ]; - }; - }; - }; -} diff --git a/home/modules/ide/nvim/lsp/langs/vue.nix b/home/modules/ide/nvim/lsp/langs/vue.nix deleted file mode 100644 index 344a8ef..0000000 --- a/home/modules/ide/nvim/lsp/langs/vue.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - plugins = { - lsp.servers.vue_ls.enable = true; - }; -} diff --git a/home/modules/ide/nvim/lsp/nixd.nix b/home/modules/ide/nvim/lsp/nixd.nix new file mode 100644 index 0000000..f16e4dd --- /dev/null +++ b/home/modules/ide/nvim/lsp/nixd.nix @@ -0,0 +1,7 @@ +{ + plugins.lsp = { + servers = { + nixd.enable = true; + }; + }; +} diff --git a/home/modules/ide/nvim/lsp/roslyn.nix b/home/modules/ide/nvim/lsp/roslyn.nix deleted file mode 100644 index d64dbf5..0000000 --- a/home/modules/ide/nvim/lsp/roslyn.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ lib, pkgs, ... }: -{ - lsp.servers.roslyn_ls = { - enable = true; - - config = { - cmd = [ - "${lib.getExe' pkgs.roslyn-ls "Microsoft.CodeAnalysis.LanguageServer"}" - "--logLevel" - "Information" - "--extensionLogDirectory" - "fs.joinpath(uv.os_tmpdir() \"roslyn_ls/logs\")" - "--stdio" - ]; - }; - }; -} diff --git a/home/modules/ide/nvim/options.nix b/home/modules/ide/nvim/options.nix new file mode 100644 index 0000000..3d9119c --- /dev/null +++ b/home/modules/ide/nvim/options.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: { + opts = { + number = true; + relativenumber = false; + colorcolumn = "0"; + shiftwidth = 2; + tabstop = 2; + wrap = false; + swapfile = false; # undotree + backup = false; # undotree + undofile = true; + hlsearch = false; + incsearch = true; + termguicolors = true; + scrolloff = 8; + signcolumn = "no"; + updatetime = 50; + foldlevelstart = 99; + }; + + clipboard = { + register = "unnamedplus"; + }; + + globals.mapleader = " "; + + extraPackages = with pkgs; [ + stylua + nixfmt-rfc-style + ]; + + extraConfigLua = builtins.readFile ./config.lua; +} diff --git a/home/modules/ide/nvim/plugins/aerial.nix b/home/modules/ide/nvim/plugins/aerial.nix deleted file mode 100644 index d6b51c8..0000000 --- a/home/modules/ide/nvim/plugins/aerial.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - plugins.aerial = { - enable = true; - autoLoad = true; - settings = { - attach_mode = "global"; - backends = [ - "treesitter" - "lsp" - "markdown" - "man" - ]; - disable_max_lines = 5000; - highlight_on_hover = true; - ignore = { - filetypes = [ - "gomod" - ]; - }; - keymaps = { - "<2-LeftMouse>" = "actions.jump"; - "" = "actions.down_and_scroll"; - "" = "actions.up_and_scroll"; - "" = "actions.jump_split"; - "" = "actions.jump_vsplit"; - "" = "actions.jump"; - "?" = "actions.show_help"; - H = "actions.tree_close_recursive"; - L = "actions.tree_open_recursive"; - O = "actions.tree_toggle_recursive"; - "[[" = "actions.prev_up"; - "]]" = "actions.next_up"; - "g?" = "actions.show_help"; - h = "actions.tree_close"; - l = "actions.tree_open"; - o = "actions.tree_toggle"; - p = "actions.scroll"; - q = "actions.close"; - zA = "actions.tree_toggle_recursive"; - zC = "actions.tree_close_recursive"; - zM = "actions.tree_close_all"; - zO = "actions.tree_open_recursive"; - zR = "actions.tree_open_all"; - zX = "actions.tree_sync_folds"; - za = "actions.tree_toggle"; - zc = "actions.tree_close"; - zm = "actions.tree_decrease_fold_level"; - zo = "actions.tree_open"; - zr = "actions.tree_increase_fold_level"; - zx = "actions.tree_sync_folds"; - "{" = "actions.prev"; - "}" = "actions.next"; - }; - }; - }; - keymaps = [ - { - key = "o"; - mode = [ "n" ]; - action = "AerialToggle"; - } - ]; -} diff --git a/home/modules/ide/nvim/plugins/autopairs.nix b/home/modules/ide/nvim/plugins/autopairs.nix deleted file mode 100644 index 2f3853e..0000000 --- a/home/modules/ide/nvim/plugins/autopairs.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - plugins.nvim-autopairs = { - enable = true; - settings = { - disable_filetype = [ - "TelescopePrompt" - "vim" - ]; - }; - }; -} diff --git a/home/modules/ide/nvim/plugins/basics.nix b/home/modules/ide/nvim/plugins/basics.nix new file mode 100644 index 0000000..1bd6ef8 --- /dev/null +++ b/home/modules/ide/nvim/plugins/basics.nix @@ -0,0 +1,23 @@ +{ + plugins.mini-basics = { + enable = true; + settings = { + autocommands = { + basic = true; + relnum_in_visual_mode = false; + }; + mappings = { + basic = true; + move_with_alt = false; + option_toggle_prefix = "\\"; + windows = false; + }; + options = { + basic = true; + extra_ui = false; + win_borders = "auto"; + }; + silent = false; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/blink.nix b/home/modules/ide/nvim/plugins/blink.nix deleted file mode 100644 index d26a8d4..0000000 --- a/home/modules/ide/nvim/plugins/blink.nix +++ /dev/null @@ -1,95 +0,0 @@ -{ - plugins = { - blink-cmp = { - enable = true; - setupLspCapabilities = true; - - settings = { - keymap.preset = "super-tab"; - signature.enabled = true; - - sources = { - default = [ - "lsp" - "buffer" - "path" - "snippets" - ]; - - providers = { - lsp.score_offset = 4; - }; - }; - - appearance = { - nerd_font_variant = "mono"; - kind_icons = { - Text = "󰉿"; - Method = ""; - Function = "󰊕"; - Constructor = "󰒓"; - Field = "󰜢"; - Variable = "󰆦"; - Property = "󰖷"; - Class = "󱡠"; - Interface = "󱡠"; - Struct = "󱡠"; - Module = "󰅩"; - Unit = "󰪚"; - Value = "󰦨"; - Enum = "󰦨"; - EnumMember = "󰦨"; - Keyword = "󰻾"; - Constant = "󰏿"; - Snippet = "󱄽"; - Color = "󰏘"; - File = "󰈔"; - Reference = "󰬲"; - Folder = "󰉋"; - Event = "󱐋"; - Operator = "󰪚"; - TypeParameter = "󰬛"; - Error = "󰏭"; - Warning = "󰏯"; - Information = "󰏮"; - Hint = "󰏭"; - }; - }; - - completion = { - menu = { - border = "none"; - draw = { - gap = 1; - treesitter = [ "lsp" ]; - columns = [ - { __unkeyed-1 = "label"; } - { - __unkeyed-1 = "kind_icon"; - __unkeyed-2 = "kind"; - gap = 1; - } - { __unkeyed-1 = "source_name"; } - ]; - }; - }; - - trigger.show_in_snippet = false; - - documentation = { - auto_show = true; - window.border = "single"; - }; - - accept.auto_brackets.enabled = false; - - performance = { - debounce_ms = 80; - throttle_ms = 50; - max_view_entries = 20; - }; - }; - }; - }; - }; -} diff --git a/home/modules/ide/nvim/plugins/completion.nix b/home/modules/ide/nvim/plugins/completion.nix new file mode 100644 index 0000000..afbcce0 --- /dev/null +++ b/home/modules/ide/nvim/plugins/completion.nix @@ -0,0 +1,38 @@ +{ lib, ... }: +{ + plugins.mini-completion = { + enable = true; + settings = { + delay = { + completion = 100; + info = 100; + signature = 50; + }; + fallback_action = ""; + lsp_completion = { + auto_setup = true; + process_items = lib.nixvim.mkRaw "nil"; + snippet_insert = lib.nixvim.mkRaw "nil"; + source_func = "completefunc"; + }; + mappings = { + force_fallback = ""; + force_twostep = ""; + scroll_down = ""; + scroll_up = ""; + }; + window = { + info = { + border = lib.nixvim.mkRaw "nil"; + height = 25; + width = 80; + }; + signature = { + border = lib.nixvim.mkRaw "nil"; + height = 25; + width = 80; + }; + }; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/conform.nix b/home/modules/ide/nvim/plugins/conform.nix new file mode 100644 index 0000000..85e4333 --- /dev/null +++ b/home/modules/ide/nvim/plugins/conform.nix @@ -0,0 +1,23 @@ +{pkgs, ...}: { + plugins.conform-nvim = { + enable = true; + settings = { + format_on_save = { + lsp_fallback = true; + timeout_ms = 500; + }; + + formatters_by_ft = { + nix = ["alejandra"]; + go = ["goimports"]; + }; + }; + }; + + extraPackages = with pkgs; [ + alejandra + go + gopls + gotools + ]; +} diff --git a/home/modules/ide/nvim/plugins/dashboard.nix b/home/modules/ide/nvim/plugins/dashboard.nix deleted file mode 100644 index f6430ad..0000000 --- a/home/modules/ide/nvim/plugins/dashboard.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ - plugins.dashboard = { - enable = true; - autoLoad = true; - - settings = { - theme = "doom"; - - config = { - header = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - " ⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀ " - " ⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷ " - " ⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿ " - " ⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿ " - " ⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿ " - " ⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿ " - " ⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃⡀⢸⡿⢸⣿⣿⣿⣿⣿⡟ " - " ⣿⣿⠃⠄⢀⣾⠋⠓⢰⣿⣿⣿⣿⣿⣿⠿⣿⣿⣾⣅⢔⣕⡇⡇⡼⢁⣿⣿⣿⣿⣿⣿⢣ " - " ⣿⡟⠄⠄⣾⣇⠷⣢⣿⣿⣿⣿⣿⣿⣿⣭⣀⡈⠙⢿⣿⣿⡇⡧⢁⣾⣿⣿⣿⣿⣿⢏⣾ " - " ⣿⡇⠄⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢻⠇⠄⠄⢿⣿⡇⢡⣾⣿⣿⣿⣿⣿⣏⣼⣿ " - " ⣿⣷⢰⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⢰⣧⣀⡄⢀⠘⡿⣰⣿⣿⣿⣿⣿⣿⠟⣼⣿⣿ " - " ⢹⣿⢸⣿⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣶⣭⣉⣤⣿⢈⣼⣿⣿⣿⣿⣿⣿⠏⣾⣹⣿⣿ " - " ⢸⠇⡜⣿⡟⠄⠄⠄⠈⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟⣱⣻⣿⣿⣿⣿⣿⠟⠁⢳⠃⣿⣿⣿ " - " ⣰⡗⠹⣿⣄⠄⠄⠄⢀⣿⣿⣿⣿⣿⣿⠟⣅⣥⣿⣿⣿⣿⠿⠋ ⣾⡌⢠⣿⡿⠃ " - " ⠜⠋⢠⣷⢻⣿⣿⣶⣾⣿⣿⣿⣿⠿⣛⣥⣾⣿⠿⠟⠛⠉ " - "" - "" - "" - ]; - - center = [ - { - icon = " "; - desc = "find files"; - action = "lua Snacks.picker.files()"; - key = "f"; - } - { - icon = " "; - desc = "projects"; - action = "lua Snacks.picker.projects()"; - key = "p"; - } - { - icon = "󱁴 "; - desc = "grep"; - action = "lua Snacks.picker.grep()"; - key = "s"; - } - { - icon = " "; - desc = "todos"; - action = "lua Snacks.picker.todo_comments()"; - key = "t"; - } - { - icon = " "; - desc = "ragequit"; - action = "qa"; - key = "x"; - } - ]; - - footer = [ "~elisiei" ]; - }; - }; - }; - - extraConfigLua = '' - vim.api.nvim_create_autocmd("User", { - pattern = "DashboardReady", - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - ''; -} diff --git a/home/modules/ide/nvim/plugins/extra.nix b/home/modules/ide/nvim/plugins/extra.nix new file mode 100644 index 0000000..6170d48 --- /dev/null +++ b/home/modules/ide/nvim/plugins/extra.nix @@ -0,0 +1,5 @@ +{ + plugins.mini-extra = { + enable = true; + }; +} diff --git a/home/modules/ide/nvim/plugins/files.nix b/home/modules/ide/nvim/plugins/files.nix new file mode 100644 index 0000000..d8b350c --- /dev/null +++ b/home/modules/ide/nvim/plugins/files.nix @@ -0,0 +1,55 @@ +{ + plugins.snacks = { + enable = true; + autoLoad = true; + }; + plugins.neo-tree = { + enable = true; + settings = { + default_component_configs = { + indent = { + with_expanders = true; + expander_collapsed = ""; + expander_expanded = ""; + expander_highlight = "NeoTreeExpander"; + }; + }; + }; + sources = [ + "filesystem" + "buffers" + "git_status" + ]; + enable_diagnostics = true; + enable_git_status = true; + enable_modified_markers = true; + enable_refresh_on_write = true; + open_files_in_last_window = true; + open_files_do_not_replace_types = [ + "terminal" + "Trouble" + "trouble" + "qf" + "Outline" + ]; + filesystem = { + bind_to_cwd = false; + follow_current_file = { + enabled = true; + }; + use_libuv_file_watcher = true; + }; + event_handlers = { + file_moved = '' + function(data) + require("snacks.rename").on_rename_file(data.source, data.destination) + end + ''; + file_renamed = '' + function(data) + require("snacks.rename").on_rename_file(data.source, data.destination) + end + ''; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/git.nix b/home/modules/ide/nvim/plugins/git.nix new file mode 100644 index 0000000..378a0f3 --- /dev/null +++ b/home/modules/ide/nvim/plugins/git.nix @@ -0,0 +1,13 @@ +{ + plugins.mini-git = { + enable = true; + settings = { + command = { + split = "horizontal"; + }; + job = { + timeout = 20000; + }; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/hlchunk.nix b/home/modules/ide/nvim/plugins/hlchunk.nix deleted file mode 100644 index 2379458..0000000 --- a/home/modules/ide/nvim/plugins/hlchunk.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - plugins.hlchunk = { - enable = true; - autoLoad = true; - settings = { - blank = { - enable = false; - }; - chunk = { - chars = { - horizontal_line = "─"; - left_bottom = "╰"; - left_top = "╭"; - right_arrow = "─"; - vertical_line = "│"; - }; - enable = true; - exclude_filetypes = { - lazyterm = true; - neo-tree = true; - }; - style = { - fg = "#91bef0"; - }; - use_treesitter = true; - }; - indent = { - chars = [ - "│" - ]; - exclude_filetypes = { - lazyterm = true; - neo-tree = true; - }; - style = { - fg = "#45475a"; - }; - use_treesitter = false; - }; - line_num = { - style = "#91bef0"; - use_treesitter = true; - }; - }; - }; -} diff --git a/home/modules/ide/nvim/plugins/icons.nix b/home/modules/ide/nvim/plugins/icons.nix new file mode 100644 index 0000000..b9eca43 --- /dev/null +++ b/home/modules/ide/nvim/plugins/icons.nix @@ -0,0 +1,5 @@ +{ + plugins.mini-icons = { + enable = true; + }; +} diff --git a/home/modules/ide/nvim/plugins/keymap.nix b/home/modules/ide/nvim/plugins/keymap.nix new file mode 100644 index 0000000..0cf873e --- /dev/null +++ b/home/modules/ide/nvim/plugins/keymap.nix @@ -0,0 +1,5 @@ +{ + plugins.mini-keymap = { + enable = true; + }; +} diff --git a/home/modules/ide/nvim/plugins/lualine.nix b/home/modules/ide/nvim/plugins/lualine.nix deleted file mode 100644 index 3140b20..0000000 --- a/home/modules/ide/nvim/plugins/lualine.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ - plugins.lualine = { - enable = true; - settings = { - options = { - globalstatus = true; - extensions = [ - "fzf" - "neo-tree" - ]; - disabledFiletypes = { - statusline = [ - "startup" - "alpha" - ]; - }; - theme = "lackluster"; - }; - sections = { - lualine_a = [ - { - __unkeyed-1 = "mode"; - icon = ""; - } - ]; - lualine_b = [ - { - __unkeyed-1 = "branch"; - icon = ""; - } - { - __unkeyed-1 = "diff"; - symbols = { - added = " "; - modified = " "; - removed = " "; - }; - } - ]; - lualine_c = [ - { - __unkeyed-1 = "diagnostics"; - sources = [ "nvim_lsp" ]; - symbols = { - error = " "; - warn = " "; - info = " "; - hint = "󰝶 "; - }; - } - { - __unkeyed-1 = "navic"; - } - ]; - lualine_x = [ - { - __unkeyed-1 = "filetype"; - icon_only = true; - separator = ""; - padding = { - left = 1; - right = 0; - }; - } - { - __unkeyed-1 = "filename"; - path = 1; - } - { - __unkeyed-1.__raw = '' - function() - local icon = " " - local status = require("copilot.api").status.data - return icon .. (status.message or " ") - end, - - cond = function() - local ok, clients = pcall(vim.lsp.get_clients, { name = "copilot", bufnr = 0 }) - return ok and #clients > 0 - end, - ''; - } - ]; - lualine_y = [ - { - __unkeyed-1 = "progress"; - } - ]; - lualine_z = [ - { - __unkeyed-1 = "location"; - } - ]; - }; - }; - }; -} diff --git a/home/modules/ide/nvim/plugins/neo-tree.nix b/home/modules/ide/nvim/plugins/neo-tree.nix deleted file mode 100644 index f3ea037..0000000 --- a/home/modules/ide/nvim/plugins/neo-tree.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ - plugins.neo-tree = { - enable = true; - settings = { - sources = [ - "filesystem" - "buffers" - "git_status" - ]; - enable_diagnostics = true; - enable_git_status = true; - enable_modified_markers = true; - enable_refresh_on_write = true; - open_files_in_last_window = true; - open_files_do_not_replace_types = [ - "terminal" - "Trouble" - "trouble" - "qf" - "Outline" - ]; - filesystem = { - bind_to_cwd = false; - follow_current_file = { - enabled = true; - }; - use_libuv_file_watcher = true; - }; - window.mappings = { - "l" = "open"; - "h" = "close_node"; - "" = "none"; - "Y" = { - __raw = '' - function(state) - local node = state.tree:get_node() - local path = node:get_id() - vim.fn.setreg("+", path, "c") - end - ''; - desc = "Copy Path to Clipboard"; - }; - "O" = { - __raw = '' - function(state) - vim.ui.open(state.tree:get_node().path) - end - ''; - desc = "Open with System Application"; - }; - }; - default_component_configs = { - indent = { - with_expanders = true; - expander_collapsed = ""; - expander_expanded = ""; - expander_highlight = "NeoTreeExpander"; - }; - - git_status.symbols = { - unstaged = ""; - staged = ""; - }; - - icon = { - folder_closed = ""; - folder_open = ""; - folder_empty = ""; - }; - }; - }; - event_handlers = { - file_moved = '' - function(data) - require("snacks.rename").on_rename_file(data.source, data.destination) - end - ''; - file_renamed = '' - function(data) - require("snacks.rename").on_rename_file(data.source, data.destination) - end - ''; - }; - }; - keymaps = [ - { - key = "fe"; - mode = [ "n" ]; - action.__raw = '' - function() - require("neo-tree.command").execute({ - toggle = true, - dir = vim.fn.getcwd() - }) - end - ''; - options.desc = "Explorer NeoTree (cwd)"; - } - { - key = "e"; - mode = [ "n" ]; - action = "fe"; - options.remap = true; - options.desc = "Explorer NeoTree (cwd)"; - } - { - key = "ge"; - mode = [ "n" ]; - action.__raw = '' - function() - require("neo-tree.command").execute({ - source = "git_status", - toggle = true - }) - end - ''; - options.desc = "Git Explorer"; - } - { - key = "be"; - mode = [ "n" ]; - action.__raw = '' - function() - require("neo-tree.command").execute({ - source = "buffers", - toggle = true - }) - end - ''; - options.desc = "Buffer Explorer"; - } - { - key = ""; - mode = [ "n" ]; - action = "Neotree source=filesystem focus"; - options.desc = "switch focus"; - } - ]; -} diff --git a/home/modules/ide/nvim/plugins/notify.nix b/home/modules/ide/nvim/plugins/notify.nix new file mode 100644 index 0000000..0c9d2f9 --- /dev/null +++ b/home/modules/ide/nvim/plugins/notify.nix @@ -0,0 +1,5 @@ +{ + plugins.mini-notify = { + enable = true; + }; +} diff --git a/home/modules/ide/nvim/plugins/pairs.nix b/home/modules/ide/nvim/plugins/pairs.nix new file mode 100644 index 0000000..2041717 --- /dev/null +++ b/home/modules/ide/nvim/plugins/pairs.nix @@ -0,0 +1,12 @@ +{ + plugins.mini-pairs = { + enable = true; + settings = { + modes = { + command = true; + insert = true; + terminal = false; + }; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/snacks.nix b/home/modules/ide/nvim/plugins/snacks.nix deleted file mode 100644 index 3ed2cdf..0000000 --- a/home/modules/ide/nvim/plugins/snacks.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - plugins.snacks = { - enable = true; - autoLoad = true; - }; - - keymaps = [ - { - key = "ff"; - mode = [ "n" ]; - action = "lua Snacks.picker.files()"; - options.desc = "Find files"; - } - { - key = "fb"; - mode = [ "n" ]; - action = "lua Snacks.picker.buffers()"; - options.desc = "Find buffers"; - } - { - key = "gl"; - mode = [ "n" ]; - action = "lua Snacks.picker.git_log()"; - options.desc = "Git log"; - } - { - key = "gs"; - mode = [ "n" ]; - action = "lua Snacks.picker.git_status()"; - options.desc = "Git status"; - } - { - key = "uC"; - mode = [ "n" ]; - action = "lua Snacks.picker.colorschemes()"; - options.desc = "Colorschemes"; - } - { - key = ":"; - mode = [ "n" ]; - action = "lua Snacks.picker.command_history()"; - options.desc = "Command history"; - } - ]; -} diff --git a/home/modules/ide/nvim/plugins/snippets.nix b/home/modules/ide/nvim/plugins/snippets.nix new file mode 100644 index 0000000..62525e8 --- /dev/null +++ b/home/modules/ide/nvim/plugins/snippets.nix @@ -0,0 +1,5 @@ +{ + plugins.mini-snippets = { + enable = true; + }; +} diff --git a/home/modules/ide/nvim/plugins/starter.nix b/home/modules/ide/nvim/plugins/starter.nix new file mode 100644 index 0000000..4b534ae --- /dev/null +++ b/home/modules/ide/nvim/plugins/starter.nix @@ -0,0 +1,26 @@ +{ + plugins.mini-starter = { + enable = true; + settings = { + autoopen = true; + evaluate_single = true; + header = '' + ⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀ + ⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷ + ⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿ + ⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿ + ⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿ + ⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿ + ⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃⡀⢸⡿⢸⣿⣿⣿⣿⣿⡟ + ⣿⣿⠃⠄⢀⣾⠋⠓⢰⣿⣿⣿⣿⣿⣿⠿⣿⣿⣾⣅⢔⣕⡇⡇⡼⢁⣿⣿⣿⣿⣿⣿⢣ + ⣿⡟⠄⠄⣾⣇⠷⣢⣿⣿⣿⣿⣿⣿⣿⣭⣀⡈⠙⢿⣿⣿⡇⡧⢁⣾⣿⣿⣿⣿⣿⢏⣾ + ⣿⡇⠄⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⢻⠇⠄⠄⢿⣿⡇⢡⣾⣿⣿⣿⣿⣿⣏⣼⣿ + ⣿⣷⢰⣿⣿⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⢰⣧⣀⡄⢀⠘⡿⣰⣿⣿⣿⣿⣿⣿⠟⣼⣿⣿ + ⢹⣿⢸⣿⣿⠟⠻⢿⣿⣿⣿⣿⣿⣿⣿⣶⣭⣉⣤⣿⢈⣼⣿⣿⣿⣿⣿⣿⠏⣾⣹⣿⣿ + ⢸⠇⡜⣿⡟⠄⠄⠄⠈⠙⣿⣿⣿⣿⣿⣿⣿⣿⠟⣱⣻⣿⣿⣿⣿⣿⠟⠁⢳⠃⣿⣿⣿ + ⣰⡗⠹⣿⣄⠄⠄⠄⢀⣿⣿⣿⣿⣿⣿⠟⣅⣥⣿⣿⣿⣿⠿⠋ ⣾⡌⢠⣿⡿⠃ + ⠜⠋⢠⣷⢻⣿⣿⣶⣾⣿⣿⣿⣿⠿⣛⣥⣾⣿⠿⠟⠛⠉ + ''; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/statusline.nix b/home/modules/ide/nvim/plugins/statusline.nix new file mode 100644 index 0000000..adc251f --- /dev/null +++ b/home/modules/ide/nvim/plugins/statusline.nix @@ -0,0 +1,8 @@ +{ + plugins.mini-statusline = { + enable = true; + settings = { + use_icons = false; + }; + }; +} diff --git a/home/modules/ide/nvim/plugins/toggleterm.nix b/home/modules/ide/nvim/plugins/toggleterm.nix deleted file mode 100644 index 77762e2..0000000 --- a/home/modules/ide/nvim/plugins/toggleterm.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - plugins.toggleterm = { - enable = true; - settings = { - direction = "float"; - float_opts = { - border = "curved"; - height = 30; - width = 130; - }; - open_mapping = "[[]]"; - autochdir = true; - auto_scroll = true; - close_on_exit = true; - insert_mappings = true; - shell = "fish"; - }; - }; - keymaps = [ - { - key = ""; - mode = [ - "n" - "t" - ]; - action = "ToggleTerm"; - options = { - silent = true; - noremap = true; - }; - } - ]; -} diff --git a/home/modules/ide/nvim/plugins/treesitter.nix b/home/modules/ide/nvim/plugins/treesitter.nix index c3ed052..3f288c1 100644 --- a/home/modules/ide/nvim/plugins/treesitter.nix +++ b/home/modules/ide/nvim/plugins/treesitter.nix @@ -1,32 +1,29 @@ -{ pkgs, ... }: -{ - plugins = { - treesitter = { - enable = true; +{pkgs, ...}: { + plugins.treesitter = { + enable = true; - settings = { - indent = { - enable = true; - }; - highlight = { - enable = true; - }; - }; - - nixvimInjections = true; - grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; - }; - - treesitter-context = { - enable = false; - }; - - treesitter-textobjects = { - enable = true; - settings.select = { + settings = { + indent = { enable = true; - lookahead = true; }; + highlight = { + enable = true; + }; + }; + + nixvimInjections = true; + grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; + }; + + treesitter-context = { + enable = false; + }; + + treesitter-textobjects = { + enable = true; + settings.select = { + enable = true; + lookahead = true; }; }; } diff --git a/home/modules/ide/nvim/plugins/treesj.nix b/home/modules/ide/nvim/plugins/treesj.nix deleted file mode 100644 index a3455f1..0000000 --- a/home/modules/ide/nvim/plugins/treesj.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - plugins.treesj = { - enable = true; - autoLoad = true; - }; - keymaps = [ - { - key = "m"; - mode = [ - "n" - ]; - action = "TSJToggle"; - } - { - key = "s"; - mode = [ "n" ]; - action = "TSJSplit"; - } - { - key = "j"; - mode = [ "n" ]; - action = "TSJJoin"; - } - ]; -} diff --git a/home/modules/ide/nvim/plugins/web-devicons.nix b/home/modules/ide/nvim/plugins/web-devicons.nix deleted file mode 100644 index 1b25f3a..0000000 --- a/home/modules/ide/nvim/plugins/web-devicons.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - plugins.web-devicons = { - enable = true; - autoLoad = true; - settings = { - color_icons = true; - strict = true; - }; - }; -} diff --git a/home/modules/ide/micro/default.nix b/home/modules/ide/nvim/plugins/which-key.nix similarity index 53% rename from home/modules/ide/micro/default.nix rename to home/modules/ide/nvim/plugins/which-key.nix index 6b0990a..f075fae 100644 --- a/home/modules/ide/micro/default.nix +++ b/home/modules/ide/nvim/plugins/which-key.nix @@ -1,5 +1,5 @@ { - programs.micro = { + plugins.which-key = { enable = true; }; } diff --git a/home/modules/ide/nvim/plugins/yanky.nix b/home/modules/ide/nvim/plugins/yanky.nix deleted file mode 100644 index 76146b6..0000000 --- a/home/modules/ide/nvim/plugins/yanky.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ config, lib, ... }: -{ - plugins = { - sqlite-lua.enable = true; - - yanky = { - enable = true; - - lazyLoad = { - settings = { - keys = lib.mkIf config.plugins.lz-n.enable [ - { - __unkeyed-1 = "fy"; - __unkeyed-2 = "Telescope yank_history"; - desc = "Paste from yanky history"; - } - { - __unkeyed-1 = "y"; - __unkeyed-2 = "(YankyYank)"; - mode = [ - "n" - "x" - ]; - desc = "Yank text"; - } - { - __unkeyed-1 = "p"; - __unkeyed-2 = "(YankyPutAfter)"; - mode = [ - "n" - "x" - ]; - desc = "Put yanked text after cursor"; - } - { - __unkeyed-1 = "P"; - __unkeyed-2 = "(YankyPutBefore)"; - mode = [ - "n" - "x" - ]; - desc = "Put yanked text before cursor"; - } - { - __unkeyed-1 = "gp"; - __unkeyed-2 = "(YankyGPutAfter)"; - mode = [ - "n" - "x" - ]; - desc = "Put yanked text after selection"; - } - { - __unkeyed-1 = "gP"; - __unkeyed-2 = "(YankyGPutBefore)"; - mode = [ - "n" - "x" - ]; - desc = "Put yanked text before selection"; - } - { - __unkeyed-1 = ""; - __unkeyed-2 = "(YankyPreviousEntry)"; - desc = "Select previous entry through yank history"; - } - { - __unkeyed-1 = ""; - __unkeyed-2 = "(YankyNextEntry)"; - desc = "Select next entry through yank history"; - } - { - __unkeyed-1 = "]p"; - __unkeyed-2 = "(YankyPutIndentAfterLinewise)"; - desc = "Put indented after cursor (linewise)"; - } - { - __unkeyed-1 = "[p"; - __unkeyed-2 = "(YankyPutIndentBeforeLinewise)"; - desc = "Put indented before cursor (linewise)"; - } - { - __unkeyed-1 = "]P"; - __unkeyed-2 = "(YankyPutIndentAfterLinewise)"; - desc = "Put indented after cursor (linewise)"; - } - { - __unkeyed-1 = "[P"; - __unkeyed-2 = "(YankyPutIndentBeforeLinewise)"; - desc = "Put indented before cursor (linewise)"; - } - { - __unkeyed-1 = ">p"; - __unkeyed-2 = "(YankyPutIndentAfterShiftRight)"; - desc = "Put and indent right"; - } - { - __unkeyed-1 = "%Creset' -export alias glods = git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ad(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' --date=short -export alias glog = git log --oneline --decorate --graph -export alias gloga = git log --oneline --decorate --graph --all -export alias glol = git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ar(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' -export alias glola = git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ar(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' --all -export alias glols = git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ar(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' --stat - -export alias gm = git merge -export alias gmtl = git mergetool --no-prompt -export alias gmtlvim = git mergetool --no-prompt --tool=vimdiff -export alias gma = git merge --abort -export def gmom [] { - let main = (git_main_branch) - git merge $"origin/($main)" -} - -export alias gp = git push -export alias gpd = git push --dry-run -export alias gpf = git push --force-with-lease -export alias gpf! = git push --force -export alias gpl = git pull -export def gpoat [] { - git push origin --all; git push origin --tags -} -export alias gpod = git push origin --delete -export alias gpodc = git push origin --delete (git_current_branch) -def "nu-complete git pull rebase" [] { - ["false","true","merges","interactive"] -} -export def gpr [rebase_type: string@"nu-complete git pull rebase"] { - git pull --rebase $rebase_type -} -export alias gpu = git push upstream -export alias gpv = git push --verbose - -export alias gr = git remote -export alias gpra = git pull --rebase --autostash -export alias gprav = git pull --rebase --autostash --verbose -export alias gprv = git pull --rebase --verbose -export alias gpsup = git push --set-upstream origin (git_current_branch) -export alias gra = git remote add -export alias grb = git rebase -export alias grba = git rebase --abort -export alias grbc = git rebase --continue -export alias grbd = git rebase develop -export alias grbi = git rebase --interactive -export alias grbm = git rebase (git_main_branch) -export alias grbo = git rebase --onto -export alias grbs = git rebase --skip -export alias grev = git revert -export alias grh = git reset -export alias grhh = git reset --hard -export alias groh = git reset $"origin/(git_current_branch)" --hard -export alias grm = git rm -export alias grmc = git rm --cached -export def grmv [remote: string, new_name: string] { - git remote rename $remote $new_name -} -export def grrm [remote: string] { - git remote remove $remote -} -export alias grs = git restore -export def grset [remote: string, url: string] { - git remote set-url $remote $url -} -export alias grss = git restore --source -export alias grst = git restore --staged -export alias grt = cd (git rev-parse --show-toplevel or echo .) -export alias gru = git reset -- -export alias grup = git remote update -export alias grv = git remote --verbose - -export alias gsb = git status --short --branch -export alias gsd = git svn dcommit -export alias gsh = git show -export alias gshs = git show -s -export alias gsi = git submodule init -export alias gsps = git show --pretty=short --show-signature -export alias gsr = git svn rebase -export alias gss = git status --short -export alias gst = git status - -export alias gsta = git stash push -export alias gstaa = git stash apply -export alias gstc = git stash clear -export alias gstd = git stash drop -export alias gstl = git stash list -export alias gstp = git stash pop -export alias gsts = git stash show --text -export alias gstu = gsta --include-untracked -export alias gstall = git stash --all -export alias gsu = git submodule update -export alias gsw = git switch -export alias gswc = git switch --create - -export alias gts = git tag --sign -export def gtv [] { - git tag | lines | sort -} -export alias glum = git pull upstream (git_main_branch) - -export alias gunignore = git update-index --no-assume-unchanged -export def gup [rebase_type: string@"nu-complete git pull rebase"] { - git pull --rebase $rebase_type -} -export alias gupv = git pull --rebase --verbose -export alias gupa = git pull --rebase --autostash -export alias gupav = git pull --rebase --autostash --verbose - -export alias gwch = git whatchanged -p --abbrev-commit --pretty=medium - -export alias gwt = git worktree -export def gwta [path: path, branch?: string] { - if $branch != null { - git worktree add $path $branch - } else { - git worktree add $path - } -} -export alias gwtls = git worktree list -export alias gwtmv = git worktree move -export def gwtm [worktree: string] { - git worktree remove $worktree -} - -export alias gam = git am -export alias gamc = git am --continue -export alias gams = git am --skip -export alias gama = git am --abort -export alias gamscp = git am --show-current-patch - diff --git a/home/modules/shell/nushell/config/completions/git.nu b/home/modules/shell/nushell/config/completions/git.nu deleted file mode 100644 index e41b28e..0000000 --- a/home/modules/shell/nushell/config/completions/git.nu +++ /dev/null @@ -1,985 +0,0 @@ -# nu-version: 0.102.0 - -module git-completion-utils { - export const GIT_SKIPABLE_FLAGS = ['-v', '--version', '-h', '--help', '-p', '--paginate', '-P', '--no-pager', '--no-replace-objects', '--bare'] - - # Helper function to append token if non-empty - def append-non-empty [token: string]: list -> list { - if ($token | is-empty) { $in } else { $in | append $token } - } - - # Split a string to list of args, taking quotes into account. - # Code is copied and modified from https://github.com/nushell/nushell/issues/14582#issuecomment-2542596272 - export def args-split []: string -> list { - # Define our states - const STATE_NORMAL = 0 - const STATE_IN_SINGLE_QUOTE = 1 - const STATE_IN_DOUBLE_QUOTE = 2 - const STATE_ESCAPE = 3 - const WHITESPACES = [" " "\t" "\n" "\r"] - - # Initialize variables - mut state = $STATE_NORMAL - mut current_token = "" - mut result: list = [] - mut prev_state = $STATE_NORMAL - - # Process each character - for char in ($in | split chars) { - if $state == $STATE_ESCAPE { - # Handle escaped character - $current_token = $current_token + $char - $state = $prev_state - } else if $char == '\' { - # Enter escape state - $prev_state = $state - $state = $STATE_ESCAPE - } else if $state == $STATE_NORMAL { - if $char == "'" { - $state = $STATE_IN_SINGLE_QUOTE - } else if $char == '"' { - $state = $STATE_IN_DOUBLE_QUOTE - } else if ($char in $WHITESPACES) { - # Whitespace in normal state means token boundary - $result = $result | append-non-empty $current_token - $current_token = "" - } else { - $current_token = $current_token + $char - } - } else if $state == $STATE_IN_SINGLE_QUOTE { - if $char == "'" { - $state = $STATE_NORMAL - } else { - $current_token = $current_token + $char - } - } else if $state == $STATE_IN_DOUBLE_QUOTE { - if $char == '"' { - $state = $STATE_NORMAL - } else { - $current_token = $current_token + $char - } - } - } - # Handle the last token - $result = $result | append-non-empty $current_token - # Return the result - $result - } - - # Get changed files which can be restored by `git checkout --` - export def get-changed-files []: nothing -> list { - ^git status -uno --porcelain=2 | lines - | where $it =~ '^1 [.MD]{2}' - | each { split row ' ' -n 9 | last } - } - - # Get files which can be retrieved from a branch/commit by `git checkout ` - export def get-checkoutable-files []: nothing -> list { - # Relevant statuses are .M", "MM", "MD", ".D", "UU" - ^git status -uno --porcelain=2 | lines - | where $it =~ '^1 ([.MD]{2}|UU)' - | each { split row ' ' -n 9 | last } - } - - export def get-all-git-local-refs []: nothing -> list> { - ^git for-each-ref --format '%(refname:lstrip=2)%09%(objectname:short)%09%(upstream:remotename)%(upstream:track)%09%(contents:subject)' refs/heads | lines | parse "{ref}\t{obj}\t{upstream}\t{subject}" - } - - export def get-all-git-remote-refs []: nothing -> list> { - ^git for-each-ref --format '%(refname:lstrip=2)%09%(objectname:short)%09%(contents:subject)' refs/remotes | lines | parse "{ref}\t{obj}\t{subject}" - } - - # Get local branches, remote branches which can be passed to `git merge` - export def get-mergable-sources []: nothing -> list> { - let local = get-all-git-local-refs | each {|x| {value: $x.ref description: $'Branch, Local, ($x.obj) ($x.subject), (if ($x.upstream | is-not-empty) { $x.upstream } else { "no upstream" } )'} } | insert style 'light_blue' - let remote = get-all-git-remote-refs | each {|x| {value: $x.ref description: $'Branch, Remote, ($x.obj) ($x.subject)'} } | insert style 'blue_italic' - $local | append $remote - } -} - -def "nu-complete git available upstream" [] { - ^git branch --no-color -a | lines | each { |line| $line | str replace '* ' "" | str trim } -} - -def "nu-complete git remotes" [] { - ^git remote | lines | each { |line| $line | str trim } -} - -def "nu-complete git log" [] { - ^git log --pretty=%h | lines | each { |line| $line | str trim } -} - -# Yield all existing commits in descending chronological order. -def "nu-complete git commits all" [] { - ^git rev-list --all --remotes --pretty=oneline | lines | parse "{value} {description}" -} - -# Yield commits of current branch only. This is useful for e.g. cut points in -# `git rebase`. -def "nu-complete git commits current branch" [] { - ^git log --pretty="%h %s" | lines | parse "{value} {description}" -} - -# Yield local branches like `main`, `feature/typo_fix` -def "nu-complete git local branches" [] { - ^git branch --no-color | lines | each { |line| $line | str replace '* ' "" | str replace '+ ' "" | str trim } -} - -# Yield remote branches like `origin/main`, `upstream/feature-a` -def "nu-complete git remote branches with prefix" [] { - ^git branch --no-color -r | lines | parse -r '^\*?(\s*|\s*\S* -> )(?P\S*$)' | get branch | uniq -} - -# Yield local and remote branch names which can be passed to `git merge` -def "nu-complete git mergable sources" [] { - use git-completion-utils * - let branches = get-mergable-sources - { - options: { - case_sensitive: false, - completion_algorithm: prefix, - sort: false, - }, - completions: $branches - } -} - -def "nu-complete git switch" [] { - use git-completion-utils * - let branches = get-mergable-sources - { - options: { - case_sensitive: false, - completion_algorithm: prefix, - sort: false, - }, - completions: $branches - } -} - -def "nu-complete git checkout" [context: string, position?:int] { - use git-completion-utils * - let preceding = $context | str substring ..$position - # See what user typed before, like 'git checkout a-branch a-path'. - # We exclude some flags from previous tokens, to detect if a branch name has been used as the first argument. - # FIXME: This method is still naive, though. - let prev_tokens = $preceding | str trim | args-split | where ($it not-in $GIT_SKIPABLE_FLAGS) - # In these scenarios, we suggest only file paths, not branch: - # - After '--' - # - First arg is a branch - # If before '--' is just 'git checkout' (or its alias), we suggest "dirty" files only (user is about to reset file). - if $prev_tokens.2? == '--' { - return (get-changed-files) - } - if '--' in $prev_tokens { - return (get-checkoutable-files) - } - # Already typed first argument. - if ($prev_tokens | length) > 2 and $preceding ends-with ' ' { - return (get-checkoutable-files) - } - # The first argument can be local branches, remote branches, files and commits - # Get local and remote branches - let branches = get-mergable-sources - let files = (get-checkoutable-files) | wrap value | insert description 'File' | insert style green - let commits = ^git rev-list -n 400 --remotes --oneline | lines | split column -n 2 ' ' value description | upsert description {|x| $'Commit, ($x.value) ($x.description)' } | insert style 'light_cyan_dimmed' - { - options: { - case_sensitive: false, - completion_algorithm: prefix, - sort: false, - }, - completions: [...$branches, ...$files, ...$commits] - } -} - -# Arguments to `git rebase --onto ` -def "nu-complete git rebase" [] { - (nu-complete git local branches) - | parse "{value}" - | insert description "local branch" - | append (nu-complete git remote branches with prefix - | parse "{value}" - | insert description "remote branch") - | append (nu-complete git commits all) -} - -def "nu-complete git stash-list" [] { - git stash list | lines | parse "{value}: {description}" -} - -def "nu-complete git tags" [] { - ^git tag --no-color | lines -} - -# See `man git-status` under "Short Format" -# This is incomplete, but should cover the most common cases. -const short_status_descriptions = { - ".D": "Deleted" - ".M": "Modified" - "!" : "Ignored" - "?" : "Untracked" - "AU": "Staged, not merged" - "MD": "Some modifications staged, file deleted in work tree" - "MM": "Some modifications staged, some modifications untracked" - "R.": "Renamed" - "UU": "Both modified (in merge conflict)" -} - -def "nu-complete git files" [] { - let relevant_statuses = ["?",".M", "MM", "MD", ".D", "UU"] - ^git status -uall --porcelain=2 - | lines - | each { |$it| - if $it starts-with "1 " { - $it | parse --regex "1 (?P\\S+) (?:\\S+\\s?){6} (?P\\S+)" - } else if $it starts-with "2 " { - $it | parse --regex "2 (?P\\S+) (?:\\S+\\s?){6} (?P\\S+)" - } else if $it starts-with "u " { - $it | parse --regex "u (?P\\S+) (?:\\S+\\s?){8} (?P\\S+)" - } else if $it starts-with "? " { - $it | parse --regex "(?P.{1}) (?P.+)" - } else { - { short_status: 'unknown', value: $it } - } - } - | flatten - | where $it.short_status in $relevant_statuses - | insert "description" { |e| $short_status_descriptions | get $e.short_status} -} - -def "nu-complete git built-in-refs" [] { - [HEAD FETCH_HEAD ORIG_HEAD] -} - -def "nu-complete git refs" [] { - nu-complete git local branches - | parse "{value}" - | insert description Branch - | append (nu-complete git tags | parse "{value}" | insert description Tag) - | append (nu-complete git built-in-refs) -} - -def "nu-complete git files-or-refs" [] { - nu-complete git local branches - | parse "{value}" - | insert description Branch - | append (nu-complete git files | where description == "Modified" | select value) - | append (nu-complete git tags | parse "{value}" | insert description Tag) - | append (nu-complete git built-in-refs) -} - -def "nu-complete git subcommands" [] { - ^git help -a | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' -} - -def "nu-complete git add" [] { - nu-complete git files -} - -def "nu-complete git pull rebase" [] { - ["false","true","merges","interactive"] -} - -def "nu-complete git merge strategies" [] { - ['ort', 'octopus'] -} - -def "nu-complete git merge strategy options" [] { - ['ours', 'theirs'] -} - - -# Check out git branches and files -export extern "git checkout" [ - ...targets: string@"nu-complete git checkout" # name of the branch or files to checkout - --conflict: string # conflict style (merge or diff3) - --detach(-d) # detach HEAD at named commit - --force(-f) # force checkout (throw away local modifications) - --guess # second guess 'git checkout ' (default) - --ignore-other-worktrees # do not check if another worktree is holding the given ref - --ignore-skip-worktree-bits # do not limit pathspecs to sparse entries only - --merge(-m) # perform a 3-way merge with the new branch - --orphan: string # new unparented branch - --ours(-2) # checkout our version for unmerged files - --overlay # use overlay mode (default) - --overwrite-ignore # update ignored files (default) - --patch(-p) # select hunks interactively - --pathspec-from-file: string # read pathspec from file - --progress # force progress reporting - --quiet(-q) # suppress progress reporting - --recurse-submodules # control recursive updating of submodules - --theirs(-3) # checkout their version for unmerged files - --track(-t) # set upstream info for new branch - -b # create and checkout a new branch - -B: string # create/reset and checkout a branch - -l # create reflog for new branch -] - -export extern "git reset" [ - ...targets: string@"nu-complete git checkout" # name of commit, branch, or files to reset to - --hard # reset HEAD, index and working tree - --keep # reset HEAD but keep local changes - --merge # reset HEAD, index and working tree - --mixed # reset HEAD and index - --patch(-p) # select hunks interactively - --quiet(-q) # be quiet, only report errors - --soft # reset only HEAD - --pathspec-from-file: string # read pathspec from file - --pathspec-file-nul # with --pathspec-from-file, pathspec elements are separated with NUL character - --no-refresh # skip refreshing the index after reset - --recurse-submodules: string # control recursive updating of submodules - --no-recurse-submodules # don't recurse into submodules -] - -# Download objects and refs from another repository -export extern "git fetch" [ - repository?: string@"nu-complete git remotes" # name of the branch to fetch - --all # Fetch all remotes - --append(-a) # Append ref names and object names to .git/FETCH_HEAD - --atomic # Use an atomic transaction to update local refs. - --depth: int # Limit fetching to n commits from the tip - --deepen: int # Limit fetching to n commits from the current shallow boundary - --shallow-since: string # Deepen or shorten the history by date - --shallow-exclude: string # Deepen or shorten the history by branch/tag - --unshallow # Fetch all available history - --update-shallow # Update .git/shallow to accept new refs - --negotiation-tip: string # Specify which commit/glob to report while fetching - --negotiate-only # Do not fetch, only print common ancestors - --dry-run # Show what would be done - --write-fetch-head # Write fetched refs in FETCH_HEAD (default) - --no-write-fetch-head # Do not write FETCH_HEAD - --force(-f) # Always update the local branch - --keep(-k) # Keep downloaded pack - --multiple # Allow several arguments to be specified - --auto-maintenance # Run 'git maintenance run --auto' at the end (default) - --no-auto-maintenance # Don't run 'git maintenance' at the end - --auto-gc # Run 'git maintenance run --auto' at the end (default) - --no-auto-gc # Don't run 'git maintenance' at the end - --write-commit-graph # Write a commit-graph after fetching - --no-write-commit-graph # Don't write a commit-graph after fetching - --prefetch # Place all refs into the refs/prefetch/ namespace - --prune(-p) # Remove obsolete remote-tracking references - --prune-tags(-P) # Remove any local tags that do not exist on the remote - --no-tags(-n) # Disable automatic tag following - --refmap: string # Use this refspec to map the refs to remote-tracking branches - --tags(-t) # Fetch all tags - --recurse-submodules: string # Fetch new commits of populated submodules (yes/on-demand/no) - --jobs(-j): int # Number of parallel children - --no-recurse-submodules # Disable recursive fetching of submodules - --set-upstream # Add upstream (tracking) reference - --submodule-prefix: string # Prepend to paths printed in informative messages - --upload-pack: string # Non-default path for remote command - --quiet(-q) # Silence internally used git commands - --verbose(-v) # Be verbose - --progress # Report progress on stderr - --server-option(-o): string # Pass options for the server to handle - --show-forced-updates # Check if a branch is force-updated - --no-show-forced-updates # Don't check if a branch is force-updated - -4 # Use IPv4 addresses, ignore IPv6 addresses - -6 # Use IPv6 addresses, ignore IPv4 addresses -] - -# Push changes -export extern "git push" [ - remote?: string@"nu-complete git remotes", # the name of the remote - ...refs: string@"nu-complete git local branches" # the branch / refspec - --all # push all refs - --atomic # request atomic transaction on remote side - --delete(-d) # delete refs - --dry-run(-n) # dry run - --exec: string # receive pack program - --follow-tags # push missing but relevant tags - --force-with-lease # require old value of ref to be at this value - --force(-f) # force updates - --ipv4(-4) # use IPv4 addresses only - --ipv6(-6) # use IPv6 addresses only - --mirror # mirror all refs - --no-verify # bypass pre-push hook - --porcelain # machine-readable output - --progress # force progress reporting - --prune # prune locally removed refs - --push-option(-o): string # option to transmit - --quiet(-q) # be more quiet - --receive-pack: string # receive pack program - --recurse-submodules: string # control recursive pushing of submodules - --repo: string # repository - --set-upstream(-u) # set upstream for git pull/status - --signed: string # GPG sign the push - --tags # push tags (can't be used with --all or --mirror) - --thin # use thin pack - --verbose(-v) # be more verbose -] - -# Pull changes -export extern "git pull" [ - remote?: string@"nu-complete git remotes", # the name of the remote - ...refs: string@"nu-complete git local branches", # the branch / refspec - --rebase(-r): string@"nu-complete git pull rebase", # rebase current branch on top of upstream after fetching - --quiet(-q) # suppress output during transfer and merge - --verbose(-v) # be more verbose - --commit # perform the merge and commit the result - --no-commit # perform the merge but do not commit the result - --edit(-e) # edit the merge commit message - --no-edit # use the auto-generated merge commit message - --cleanup: string # specify how to clean up the merge commit message - --ff # fast-forward if possible - --no-ff # create a merge commit in all cases - --gpg-sign(-S) # GPG-sign the resulting merge commit - --no-gpg-sign # do not GPG-sign the resulting merge commit - --log: int # include log messages from merged commits - --no-log # do not include log messages from merged commits - --signoff # add Signed-off-by trailer - --no-signoff # do not add Signed-off-by trailer - --stat(-n) # show a diffstat at the end of the merge - --no-stat # do not show a diffstat at the end of the merge - --squash # produce working tree and index state as if a merge happened - --no-squash # perform the merge and commit the result - --verify # run pre-merge and commit-msg hooks - --no-verify # do not run pre-merge and commit-msg hooks - --strategy(-s): string # use the given merge strategy - --strategy-option(-X): string # pass merge strategy-specific option - --verify-signatures # verify the tip commit of the side branch being merged - --no-verify-signatures # do not verify the tip commit of the side branch being merged - --summary # show a summary of the merge - --no-summary # do not show a summary of the merge - --autostash # create a temporary stash entry before the operation - --no-autostash # do not create a temporary stash entry before the operation - --allow-unrelated-histories # allow merging histories without a common ancestor - --no-rebase # do not rebase the current branch on top of the upstream branch - --all # fetch all remotes - --append(-a) # append fetched refs to existing contents of FETCH_HEAD - --atomic # use an atomic transaction to update local refs - --depth: int # limit fetching to the specified number of commits - --deepen: int # deepen the history by the specified number of commits - --shallow-since: string # deepen or shorten the history since a specified date - --shallow-exclude: string # exclude commits reachable from a specified branch or tag - --unshallow # convert a shallow repository to a complete one - --update-shallow # update .git/shallow with new refs - --tags(-t) # fetch all tags from the remote - --jobs(-j): int # number of parallel children for fetching - --set-upstream # add upstream (tracking) reference - --upload-pack: string # specify non-default path for upload-pack on the remote - --progress # force progress status even if stderr is not a terminal - --server-option(-o): string # transmit the given string to the server -] - -# Switch between branches and commits -export extern "git switch" [ - switch?: string@"nu-complete git switch" # name of branch to switch to - --create(-c) # create a new branch - --detach(-d): string@"nu-complete git log" # switch to a commit in a detached state - --force-create(-C): string # forces creation of new branch, if it exists then the existing branch will be reset to starting point - --force(-f) # alias for --discard-changes - --guess # if there is no local branch which matches then name but there is a remote one then this is checked out - --ignore-other-worktrees # switch even if the ref is held by another worktree - --merge(-m) # attempts to merge changes when switching branches if there are local changes - --no-guess # do not attempt to match remote branch names - --no-progress # do not report progress - --no-recurse-submodules # do not update the contents of sub-modules - --no-track # do not set "upstream" configuration - --orphan: string # create a new orphaned branch - --progress # report progress status - --quiet(-q) # suppress feedback messages - --recurse-submodules # update the contents of sub-modules - --track(-t) # set "upstream" configuration -] - -# Apply the change introduced by an existing commit -export extern "git cherry-pick" [ - commit?: string@"nu-complete git commits all" # The commit ID to be cherry-picked - --edit(-e) # Edit the commit message prior to committing - --no-commit(-n) # Apply changes without making any commit - --signoff(-s) # Add Signed-off-by line to the commit message - --ff # Fast-forward if possible - --continue # Continue the operation in progress - --abort # Cancel the operation - --skip # Skip the current commit and continue with the rest of the sequence -] - -# Rebase the current branch -export extern "git rebase" [ - branch?: string@"nu-complete git rebase" # name of the branch to rebase onto - upstream?: string@"nu-complete git rebase" # upstream branch to compare against - --continue # restart rebasing process after editing/resolving a conflict - --abort # abort rebase and reset HEAD to original branch - --quit # abort rebase but do not reset HEAD - --interactive(-i) # rebase interactively with list of commits in editor - --onto?: string@"nu-complete git rebase" # starting point at which to create the new commits - --root # start rebase from root commit -] - -# Merge from a branch -export extern "git merge" [ - # For now, to make it simple, we only complete branches (not commits) and support single-parent case. - branch?: string@"nu-complete git mergable sources" # The source branch - --edit(-e) # Edit the commit message prior to committing - --no-edit # Do not edit commit message - --no-commit(-n) # Apply changes without making any commit - --signoff # Add Signed-off-by line to the commit message - --ff # Fast-forward if possible - --continue # Continue after resolving a conflict - --abort # Abort resolving conflict and go back to original state - --quit # Forget about the current merge in progress - --strategy(-s): string@"nu-complete git merge strategies" # Merge strategy - -X: string@"nu-complete git merge strategy options" # Option for merge strategy - --verbose(-v) - --help -] - -# List or change branches -export extern "git branch" [ - branch?: string@"nu-complete git local branches" # name of branch to operate on - --abbrev # use short commit hash prefixes - --edit-description # open editor to edit branch description - --merged # list reachable branches - --no-merged # list unreachable branches - --set-upstream-to: string@"nu-complete git available upstream" # set upstream for branch - --unset-upstream # remote upstream for branch - --all # list both remote and local branches - --copy # copy branch together with config and reflog - --format # specify format for listing branches - --move # rename branch - --points-at # list branches that point at an object - --show-current # print the name of the current branch - --verbose # show commit and upstream for each branch - --color # use color in output - --quiet # suppress messages except errors - --delete(-d) # delete branch - --list # list branches - --contains: string@"nu-complete git commits all" # show only branches that contain the specified commit - --no-contains # show only branches that don't contain specified commit - --track(-t) # when creating a branch, set upstream -] - -# List all variables set in config file, along with their values. -export extern "git config list" [ -] - -# Emits the value of the specified key. -export extern "git config get" [ -] - -# Set value for one or more config options. -export extern "git config set" [ -] - -# Unset value for one or more config options. -export extern "git config unset" [ -] - -# Rename the given section to a new name. -export extern "git config rename-section" [ -] - -# Remove the given section from the configuration file. -export extern "git config remove-section" [ -] - -# Opens an editor to modify the specified config file -export extern "git config edit" [ -] - -# List or change tracked repositories -export extern "git remote" [ - --verbose(-v) # Show URL for remotes -] - -# Add a new tracked repository -export extern "git remote add" [ -] - -# Rename a tracked repository -export extern "git remote rename" [ - remote: string@"nu-complete git remotes" # remote to rename - new_name: string # new name for remote -] - -# Remove a tracked repository -export extern "git remote remove" [ - remote: string@"nu-complete git remotes" # remote to remove -] - -# Get the URL for a tracked repository -export extern "git remote get-url" [ - remote: string@"nu-complete git remotes" # remote to get URL for -] - -# Set the URL for a tracked repository -export extern "git remote set-url" [ - remote: string@"nu-complete git remotes" # remote to set URL for - url: string # new URL for remote -] - -# Show changes between commits, working tree etc -export extern "git diff" [ - rev1_or_file?: string@"nu-complete git files-or-refs" - rev2?: string@"nu-complete git refs" - --cached # show staged changes - --name-only # only show names of changed files - --name-status # show changed files and kind of change - --no-color # disable color output -] - -# Commit changes -export extern "git commit" [ - --all(-a) # automatically stage all modified and deleted files - --amend # amend the previous commit rather than adding a new one - --message(-m): string # specify the commit message rather than opening an editor - --reuse-message(-C): string # reuse the message from a previous commit - --reedit-message(-c): string # reuse and edit message from a commit - --fixup: string # create a fixup/amend commit - --squash: string # squash commit for autosquash rebase - --reset-author # reset author information - --short # short-format output for dry-run - --branch # show branch info in short-format - --porcelain # porcelain-ready format for dry-run - --long # long-format output for dry-run - --null(-z) # use NUL instead of LF in output - --file(-F): string # read commit message from file - --author: string # override commit author - --date: string # override author date - --template(-t): string # use commit message template file - --signoff(-s) # add Signed-off-by trailer - --no-signoff # do not add Signed-off-by trailer - --trailer: string # add trailer to commit message - --no-verify(-n) # bypass pre-commit and commit-msg hooks - --verify # do not bypass pre-commit and commit-msg hooks - --allow-empty # allow commit with no changes - --allow-empty-message # allow commit with empty message - --cleanup: string # cleanup commit message - --edit(-e) # edit commit message - --no-edit # do not edit commit message - --include(-i) # include given paths in commit - --only(-o) # commit only specified paths - --pathspec-from-file: string # read pathspec from file - --pathspec-file-nul # use NUL character for pathspec file - --untracked-files(-u): string # show untracked files - --verbose(-v) # show diff in commit message template - --quiet(-q) # suppress commit summary - --dry-run # show paths to be committed without committing - --status # include git-status output in commit message - --no-status # do not include git-status output - --gpg-sign(-S) # GPG-sign commit - --no-gpg-sign # do not GPG-sign commit - ...pathspec: string # commit files matching pathspec -] - -# List commits -export extern "git log" [ - # Ideally we'd allow completion of revisions here, but that would make completion of filenames not work. - -U # show diffs - --follow # show history beyond renames (single file only) - --grep: string # show log entries matching supplied regular expression -] - -# Show or change the reflog -export extern "git reflog" [ -] - -# Stage files -export extern "git add" [ - ...file: string@"nu-complete git add" # file to add - --all(-A) # add all files - --dry-run(-n) # don't actually add the file(s), just show if they exist and/or will be ignored - --edit(-e) # open the diff vs. the index in an editor and let the user edit it - --force(-f) # allow adding otherwise ignored files - --interactive(-i) # add modified contents in the working tree interactively to the index - --patch(-p) # interactively choose hunks to stage - --verbose(-v) # be verbose -] - -# Delete file from the working tree and the index -export extern "git rm" [ - -r # recursive - --force(-f) # override the up-to-date check - --dry-run(-n) # Don't actually remove any file(s) - --cached # unstage and remove paths only from the index -] - -# Show the working tree status -export extern "git status" [ - --verbose(-v) # be verbose - --short(-s) # show status concisely - --branch(-b) # show branch information - --show-stash # show stash information -] - -# Stash changes for later -export extern "git stash push" [ - --patch(-p) # interactively choose hunks to stash -] - -# Unstash previously stashed changes -export extern "git stash pop" [ - stash?: string@"nu-complete git stash-list" # stash to pop - --index(-i) # try to reinstate not only the working tree's changes, but also the index's ones -] - -# List stashed changes -export extern "git stash list" [ -] - -# Show a stashed change -export extern "git stash show" [ - stash?: string@"nu-complete git stash-list" - -U # show diff -] - -# Drop a stashed change -export extern "git stash drop" [ - stash?: string@"nu-complete git stash-list" -] - -# Create a new git repository -export extern "git init" [ - --initial-branch(-b): string # initial branch name -] - -# List or manipulate tags -export extern "git tag" [ - --delete(-d): string@"nu-complete git tags" # delete a tag -] - -# Prune all unreachable objects -export extern "git prune" [ - --dry-run(-n) # dry run - --expire: string # expire objects older than - --progress # show progress - --verbose(-v) # report all removed objects -] - -# Start a binary search to find the commit that introduced a bug -export extern "git bisect start" [ - bad?: string # a commit that has the bug - good?: string # a commit that doesn't have the bug -] - -# Mark the current (or specified) revision as bad -export extern "git bisect bad" [ -] - -# Mark the current (or specified) revision as good -export extern "git bisect good" [ -] - -# Skip the current (or specified) revision -export extern "git bisect skip" [ -] - -# End bisection -export extern "git bisect reset" [ -] - -# Show help for a git subcommand -export extern "git help" [ - command?: string@"nu-complete git subcommands" # subcommand to show help for -] - -# git worktree -export extern "git worktree" [ - --help(-h) # display the help message for this command - ...args -] - -# create a new working tree -export extern "git worktree add" [ - path: path # directory to clone the branch - branch: string@"nu-complete git available upstream" # Branch to clone - --help(-h) # display the help message for this command - --force(-f) # checkout even if already checked out in other worktree - -b # create a new branch - -B # create or reset a branch - --detach(-d) # detach HEAD at named commit - --checkout # populate the new working tree - --lock # keep the new working tree locked - --reason # reason for locking - --quiet(-q) # suppress progress reporting - --track # set up tracking mode (see git-branch(1)) - --guess-remote # try to match the new branch name with a remote-tracking branch - ...args -] - -# list details of each worktree -export extern "git worktree list" [ - --help(-h) # display the help message for this command - --porcelain # machine-readable output - --verbose(-v) # show extended annotations and reasons, if available - --expire # add 'prunable' annotation to worktrees older than