From 8fcf44d780b1b55e3eaa2df538054c10964f1031 Mon Sep 17 00:00:00 2001 From: serenity-F Date: Thu, 26 Dec 2024 23:15:27 +1000 Subject: [PATCH] removed unused plugins in `home/programs/nvim` --- home/programs/nvim/default.nix | 62 ++++- home/programs/nvim/options.nix | 38 --- home/programs/nvim/plugins/bufferline.nix | 6 - home/programs/nvim/plugins/cmp.nix | 117 --------- home/programs/nvim/plugins/dap.nix | 28 -- home/programs/nvim/plugins/dashboard.nix | 155 ----------- home/programs/nvim/plugins/lsp.nix | 140 +++++++++- home/programs/nvim/plugins/telescope.nix | 52 +++- home/programs/nvim/plugins/tree.nix | 44 ---- home/programs/nvim/plugins/ui.nix | 301 +++++++++++++++++----- home/programs/nvim/plugins/utils.nix | 40 ++- home/programs/nvim/plugins/zenmode.nix | 46 ---- 12 files changed, 489 insertions(+), 540 deletions(-) delete mode 100755 home/programs/nvim/options.nix delete mode 100755 home/programs/nvim/plugins/bufferline.nix delete mode 100755 home/programs/nvim/plugins/cmp.nix delete mode 100755 home/programs/nvim/plugins/dap.nix delete mode 100755 home/programs/nvim/plugins/dashboard.nix delete mode 100755 home/programs/nvim/plugins/tree.nix delete mode 100755 home/programs/nvim/plugins/zenmode.nix diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index 66f12ee..a3fd884 100755 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -1,21 +1,57 @@ -# Nixvim is a NixOS module that installs and configures Neovim { inputs, ... }: { + imports = [ - inputs.nixvim.homeManagerModules.nixvim - ./plugins/cmp.nix - ./plugins/dashboard.nix + + inputs.nixvim.homeManagerModules.nixvim # uses the module channel from `flake.nix` + ./keymaps.nix # keybinds + + ## Neovim plugins + ./plugins/utils.nix + ./plugins/ui.nix ./plugins/lsp.nix ./plugins/markdown.nix - ./plugins/tree.nix - ./plugins/ui.nix - ./plugins/utils.nix - ./plugins/dap.nix ./plugins/telescope.nix - ./plugins/zenmode.nix - - ./options.nix - ./keymaps.nix ]; - programs.nixvim.enable = true; + ## Enables nixvim + programs = { + + nixvim = { + enable = true; + globals = { mapleader = " "; }; + + opts = { + updatetime = 50; # Faster completion + number = true; + relativenumber = true; + autoindent = true; + clipboard = "unnamed,unnamedplus"; + expandtab = true; + tabstop = 2; + softtabstop = 2; + shiftwidth = 2; + smartindent = true; + breakindent = true; + ignorecase = true; + incsearch = true; + hlsearch = true; + smartcase = true; + wildmode = "list:longest"; + completeopt = [ "menuone" "noselect" "noinsert" ]; + signcolumn = "yes"; + cursorline = false; + scrolloff = 8; + mouse = "a"; + termguicolors = true; + showmode = false; + wrap = false; + swapfile = false; + undofile = true; + conceallevel = 3; + + }; + }; + + }; + } diff --git a/home/programs/nvim/options.nix b/home/programs/nvim/options.nix deleted file mode 100755 index 8cb51c7..0000000 --- a/home/programs/nvim/options.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - programs.nixvim.globals.mapleader = " "; - programs.nixvim.opts = { - updatetime = 50; # Faster completion - - number = true; - relativenumber = true; - - autoindent = true; - clipboard = "unnamed,unnamedplus"; - - expandtab = true; - tabstop = 2; - softtabstop = 2; - shiftwidth = 2; - smartindent = true; - breakindent = true; - - ignorecase = true; - incsearch = true; - hlsearch = true; - smartcase = true; - wildmode = "list:longest"; - completeopt = [ "menuone" "noselect" "noinsert" ]; - signcolumn = "yes"; - cursorline = false; - scrolloff = 8; - mouse = "a"; - termguicolors = true; - showmode = false; - - wrap = false; - - swapfile = false; - undofile = true; - conceallevel = 3; - }; -} diff --git a/home/programs/nvim/plugins/bufferline.nix b/home/programs/nvim/plugins/bufferline.nix deleted file mode 100755 index 2dfee9e..0000000 --- a/home/programs/nvim/plugins/bufferline.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - plugins = { - bufferline.enable = true; - web-devicons.enable = true; - }; -} diff --git a/home/programs/nvim/plugins/cmp.nix b/home/programs/nvim/plugins/cmp.nix deleted file mode 100755 index e53726a..0000000 --- a/home/programs/nvim/plugins/cmp.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ - programs.nixvim.plugins = { - luasnip.enable = true; - cmp-buffer = { enable = true; }; - cmp-emoji = { enable = true; }; - cmp-nvim-lsp = { enable = true; }; - cmp-path = { enable = true; }; - cmp_luasnip = { enable = true; }; - - cmp = { - enable = true; - settings = { - snippet.expand = - "function(args) require('luasnip').lsp_expand(args.body) end"; - sources = [ - { name = "nvim_lsp"; } - { name = "luasnip"; } - { - name = "buffer"; - option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; - } - { name = "nvim_lua"; } - { name = "mkdnflow"; } - { name = "path"; } - ]; - - formatting = { - fields = [ "abbr" "kind" "menu" ]; - format = - # lua - '' - function(_, item) - local icons = { - Namespace = "󰌗", - Text = "󰉿", - Method = "󰆧", - Function = "󰆧", - Constructor = "", - Field = "󰜢", - Variable = "󰀫", - Class = "󰠱", - Interface = "", - Module = "", - Property = "󰜢", - Unit = "󰑭", - Value = "󰎠", - Enum = "", - Keyword = "󰌋", - Snippet = "", - Color = "󰏘", - File = "󰈚", - Reference = "󰈇", - Folder = "󰉋", - EnumMember = "", - Constant = "󰏿", - Struct = "󰙅", - Event = "", - Operator = "󰆕", - TypeParameter = "󰊄", - Table = "", - Object = "󰅩", - Tag = "", - Array = "[]", - Boolean = "", - Number = "", - Null = "󰟢", - String = "󰉿", - Calendar = "", - Watch = "󰥔", - Package = "", - Copilot = "", - Codeium = "", - TabNine = "", - } - - local icon = icons[item.kind] or "" - item.kind = string.format("%s %s", icon, item.kind or "") - return item - end - ''; - }; - - window = { - completion = { - winhighlight = - "FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel"; - scrollbar = false; - sidePadding = 0; - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; - }; - - documentation = { - border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; - winhighlight = - "FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel"; - }; - }; - - mapping = { - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.select_next_item()"; - "" = "cmp.mapping.select_prev_item()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.close()"; - "" = - "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; - }; - }; - }; - - }; -} diff --git a/home/programs/nvim/plugins/dap.nix b/home/programs/nvim/plugins/dap.nix deleted file mode 100755 index 1de9291..0000000 --- a/home/programs/nvim/plugins/dap.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs, ... }: { - programs.nixvim.plugins.dap = { - enable = true; - adapters = { }; - signs = { - dapBreakpoint = { - text = "●"; - texthl = "DapBreakpoint"; - }; - dapBreakpointCondition = { - text = "●"; - texthl = "DapBreakpointCondition"; - }; - dapLogPoint = { - text = "◆"; - texthl = "DapLogPoint"; - }; - }; - extensions = { - dap-go = { - enable = true; - delve.path = "${pkgs.delve}/bin/dlv"; - }; - dap-ui = { enable = true; }; - dap-virtual-text = { enable = true; }; - }; - }; -} diff --git a/home/programs/nvim/plugins/dashboard.nix b/home/programs/nvim/plugins/dashboard.nix deleted file mode 100755 index dc5028d..0000000 --- a/home/programs/nvim/plugins/dashboard.nix +++ /dev/null @@ -1,155 +0,0 @@ -{ config, ... }: - -let - - accent = "#${config.theme.colors.color14}"; - muted = "#${config.theme.colors.secondary-bg}"; - foreground = "#${config.theme.colors.primary-fg}"; - -in { - - programs.nixvim.highlight = { - AlphaHeaderColor.fg = accent; - AlphaTextColor.fg = foreground; - AlphaShortcutColor.fg = muted; - }; - - programs.nixvim.plugins.alpha = { - enable = true; - layout = [ - { - type = "padding"; - val = 4; - } - { - type = "text"; - opts = { - position = "center"; - hl = "AlphaHeaderColor"; - }; - val = [ - "  " - " ████ ██████ █████ ██ " - " ███████████ █████  " - " █████████ ███████████████████ ███ ███████████ " - " █████████ ███ █████████████ █████ ██████████████ " - " █████████ ██████████ █████████ █████ █████ ████ █████ " - " ███████████ ███ ███ █████████ █████ █████ ████ █████ " - " ██████ █████████████████████ ████ █████ █████ ████ ██████ " - " " - ]; - } - { - type = "padding"; - val = 4; - } - { - type = "group"; - - val = [ - { - type = "button"; - val = "󰭎 Find file"; - on_press.__raw = "function() vim.cmd[[Telescope find_files]] end"; - opts = { - shortcut = "nf"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - { - type = "button"; - val = " New file"; - on_press.__raw = "function() vim.cmd[[ene]] end"; - opts = { - shortcut = "nn"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - { - type = "button"; - val = " NixOs Config"; - on_press.__raw = "function() vim.cmd[[Neotree /home/serenity/flakes/nixdots/home/common/dotconfig/nvim]] end"; - opts = { - shortcut = "nc"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - { - type = "button"; - val = " Keybindings"; - on_press.__raw = - "function() vim.cmd[[e /home/serenity/flakes/nixdots/home/common/dotconfig/nvim/docs/KEYBINDINGS.md]] end"; - opts = { - shortcut = "nc"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - { - type = "button"; - val = " Recently used"; - on_press.__raw = "function() vim.cmd[[Telescope oldfiles]] end"; - opts = { - shortcut = "no"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - { - type = "button"; - val = "󰱽 Find text"; - on_press.__raw = "function() vim.cmd[[Telescope live_grep]] end"; - opts = { - shortcut = "nt"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - { - type = "button"; - val = "󰩈 Quit Neovim"; - on_press.__raw = "function() vim.cmd[[qa]] end"; - opts = { - shortcut = "nq"; - position = "center"; - cursor = 3; - width = 50; - align_shortcut = "right"; - hl_shortcut = "AlphaShortcutColor"; - hl = "AlphaTextColor"; - }; - } - ]; - - } - ]; - }; - -} diff --git a/home/programs/nvim/plugins/lsp.nix b/home/programs/nvim/plugins/lsp.nix index 802435f..051bc3a 100755 --- a/home/programs/nvim/plugins/lsp.nix +++ b/home/programs/nvim/plugins/lsp.nix @@ -1,20 +1,23 @@ { programs.nixvim.plugins = { + + ## Misc. LSP related plugins + web-devicons.enable = true; + bufferline.enable = true; + + ## Language syntax processing lsp-format.enable = true; lsp = { enable = true; servers = { + html.enable = true; + cssls.enale = true; + marksman.enable = true; bashls.enable = true; - clangd.enable = true; - gopls.enable = true; nixd = { enable = true; extraOptions = { expr = "import {}"; }; }; - tailwindcss.enable = true; - html.enable = true; - svelte.enable = true; - marksman.enable = true; }; keymaps.lspBuf = { "gd" = "definition"; @@ -32,17 +35,128 @@ statix.enable = true; }; formatting = { - gofmt.enable = true; - goimports.enable = true; - nixfmt.enable = true; - markdownlint.enable = true; tidy.enable = true; - shellharden.enable = true; + markdownlint.enable = true; shfmt.enable = true; - golines.enable = true; - gofumpt.enable = true; + shellharden.enable = true; + nixfmt.enable = true; }; }; }; + + ## Completion + luasnip.enable = true; + cmp-buffer = { enable = true; }; + cmp-emoji = { enable = true; }; + cmp-nvim-lsp = { enable = true; }; + cmp-path = { enable = true; }; + cmp_luasnip = { enable = true; }; + + cmp = { + enable = true; + settings = { + snippet.expand = + "function(args) require('luasnip').lsp_expand(args.body) end"; + sources = [ + { name = "nvim_lsp"; } + { name = "luasnip"; } + { + name = "buffer"; + option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; + } + { name = "nvim_lua"; } + { name = "mkdnflow"; } + { name = "path"; } + ]; + + formatting = { + fields = [ "abbr" "kind" "menu" ]; + format = + # lua + '' + function(_, item) + local icons = { + Namespace = "󰌗", + Text = "󰉿", + Method = "󰆧", + Function = "󰆧", + Constructor = "", + Field = "󰜢", + Variable = "󰀫", + Class = "󰠱", + Interface = "", + Module = "", + Property = "󰜢", + Unit = "󰑭", + Value = "󰎠", + Enum = "", + Keyword = "󰌋", + Snippet = "", + Color = "󰏘", + File = "󰈚", + Reference = "󰈇", + Folder = "󰉋", + EnumMember = "", + Constant = "󰏿", + Struct = "󰙅", + Event = "", + Operator = "󰆕", + TypeParameter = "󰊄", + Table = "", + Object = "󰅩", + Tag = "", + Array = "[]", + Boolean = "", + Number = "", + Null = "󰟢", + String = "󰉿", + Calendar = "", + Watch = "󰥔", + Package = "", + Copilot = "", + Codeium = "", + TabNine = "", + } + + local icon = icons[item.kind] or "" + item.kind = string.format("%s %s", icon, item.kind or "") + return item + end + ''; + }; + + window = { + completion = { + winhighlight = + "FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel"; + scrollbar = false; + sidePadding = 0; + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + }; + + documentation = { + border = [ "╭" "─" "╮" "│" "╯" "─" "╰" "│" ]; + winhighlight = + "FloatBorder:CmpBorder,Normal:CmpPmenu,Search:PmenuSel"; + }; + }; + + mapping = { + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.close()"; + "" = + "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true })"; + }; + }; + }; + }; } diff --git a/home/programs/nvim/plugins/telescope.nix b/home/programs/nvim/plugins/telescope.nix index 0ce21e0..0ead316 100755 --- a/home/programs/nvim/plugins/telescope.nix +++ b/home/programs/nvim/plugins/telescope.nix @@ -22,10 +22,54 @@ in { fg = accent; }; }; - plugins.telescope = { - enable = true; - extensions.fzf-native = { enable = true; }; - settings.defaults = { selection_caret = "❚ "; }; + plugins = { + telescope = { + enable = true; + extensions.fzf-native = { enable = true; }; + settings.defaults = { selection_caret = "❚ "; }; + }; + + ## Tree + #treesitter-context.enable = true; + neo-tree.enable = true; + oil = { + enable = true; + settings = { + default_file_explorer = false; + skip_confirm_for_simple_edits = true; + win_options = { + concealcursor = "ncv"; + conceallevel = 3; + cursorcolumn = false; + foldcolumn = "0"; + list = false; + signcolumn = "no"; + spell = false; + wrap = false; + }; + float = { padding = 5; }; + keymaps = { + "-" = "actions.parent"; + "b" = "actions.parent"; + "" = "actions.close"; + "" = "actions.select_split"; + "" = "actions.refresh"; + "" = "actions.preview"; + "" = "actions.select_vsplit"; + "" = "actions.select_tab"; + "" = "actions.select"; + _ = "actions.open_cwd"; + "`" = "actions.cd"; + "g." = "actions.toggle_hidden"; + "g?" = "actions.show_help"; + "g\\" = "actions.toggle_trash"; + gs = "actions.change_sort"; + gx = "actions.open_external"; + "~" = "actions.tcd"; + }; + }; + }; + }; }; } diff --git a/home/programs/nvim/plugins/tree.nix b/home/programs/nvim/plugins/tree.nix deleted file mode 100755 index d0eb537..0000000 --- a/home/programs/nvim/plugins/tree.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - programs.nixvim = { - plugins = { - neo-tree.enable = true; - oil = { - enable = true; - settings = { - default_file_explorer = false; - skip_confirm_for_simple_edits = true; - win_options = { - concealcursor = "ncv"; - conceallevel = 3; - cursorcolumn = false; - foldcolumn = "0"; - list = false; - signcolumn = "no"; - spell = false; - wrap = false; - }; - float = { padding = 5; }; - keymaps = { - "-" = "actions.parent"; - "b" = "actions.parent"; - "" = "actions.close"; - "" = "actions.select_split"; - "" = "actions.refresh"; - "" = "actions.preview"; - "" = "actions.select_vsplit"; - "" = "actions.select_tab"; - "" = "actions.select"; - _ = "actions.open_cwd"; - "`" = "actions.cd"; - "g." = "actions.toggle_hidden"; - "g?" = "actions.show_help"; - "g\\" = "actions.toggle_trash"; - gs = "actions.change_sort"; - gx = "actions.open_external"; - "~" = "actions.tcd"; - }; - }; - }; - }; - }; -} diff --git a/home/programs/nvim/plugins/ui.nix b/home/programs/nvim/plugins/ui.nix index f197834..4584c4d 100755 --- a/home/programs/nvim/plugins/ui.nix +++ b/home/programs/nvim/plugins/ui.nix @@ -1,82 +1,243 @@ -{ pkgs, config, ... }: { +{ config, pkgs, ... }: + +let + + accent = "#${config.theme.colors.color14}"; + muted = "#${config.theme.colors.secondary-bg}"; + foreground = "#${config.theme.colors.primary-fg}"; + +in { + home.packages = with pkgs; [ ctags ]; - programs.nixvim = { - colorschemes.modus = { - enable = true; - settings = { - transparent = true; - style = "modus_vivendi"; - styles = { - comments = { - italic = true; - #bg = ""; - fg = "#cdcdcd"; - }; - variables = { - #bg = ""; - fg = "#00cdff"; - }; - functions = { - #bg = ""; - fg = "#ddeeff"; - }; - keywords = { - bold = true; - #bg = ""; - fg = "#00cdff"; + programs = { + nixvim = { + highlight = { + AlphaHeaderColor.fg = accent; + AlphaTextColor.fg = foreground; + AlphaShortcutColor.fg = muted; + }; + colorschemes = { + modus = { + enable = true; + settings = { + transparent = true; + style = "modus_vivendi"; + styles = { + comments = { + italic = true; + #bg = ""; + fg = "#cdcdcd"; + }; + variables = { + #bg = ""; + fg = "#00cdff"; + }; + functions = { + #bg = ""; + fg = "#ddeeff"; + }; + keywords = { + bold = true; + #bg = ""; + fg = "#00cdff"; + }; + }; }; }; }; - }; - plugins = { - #transparent.enable = true; - lualine = { - enable = true; - settings = { - options.disabled_filetypes.statusline = - [ "dashboard" "alpha" "neo-tree" ]; + plugins = { + #transparent.enable = true; + lualine = { + enable = true; + settings = { + options.disabled_filetypes.statusline = + [ "dashboard" "alpha" "neo-tree" ]; - alwaysDivideMiddle = true; - globalstatus = true; - ignoreFocus = [ "neo-tree" ]; - extensions = [ "fzf" ]; - theme = "auto"; - componentSeparators = { - left = "|"; - right = "|"; - }; - sectionSeparators = { - left = "█"; #  - right = "█"; #  - }; - sections = { - lualine_a = [ "mode" ]; - lualine_b = [ "branch" "diff" "diagnostics" ]; - lualine_c = [ "filename" ]; - lualine_x = [ "filetype" ]; - lualine_y = [ "progress" ]; - lualine_z = [ ''" " .. os.date("%R")'' ]; + alwaysDivideMiddle = true; + globalstatus = true; + ignoreFocus = [ "neo-tree" ]; + extensions = [ "fzf" ]; + theme = "auto"; + componentSeparators = { + left = "|"; + right = "|"; + }; + sectionSeparators = { + left = "█"; #  + right = "█"; #  + }; + sections = { + lualine_a = [ "mode" ]; + lualine_b = [ "branch" "diff" "diagnostics" ]; + lualine_c = [ "filename" ]; + lualine_x = [ "filetype" ]; + lualine_y = [ "progress" ]; + lualine_z = [ ''" " .. os.date("%R")'' ]; + }; }; }; - }; - web-devicons.enable = true; - noice.enable = true; - notify = { - enable = true; - level = "warn"; - }; - gitsigns = { - enable = true; - settings.current_line_blame = false; - }; - trouble.enable = true; - indent-blankline.enable = true; - colorizer.enable = true; - tagbar = { - enable = true; - tagsPackage = pkgs.universal-ctags; + web-devicons.enable = true; + noice.enable = true; + notify = { + enable = true; + level = "warn"; + }; + gitsigns = { + enable = true; + settings.current_line_blame = false; + }; + + trouble.enable = true; + indent-blankline.enable = true; + colorizer.enable = true; + tagbar = { + enable = true; + tagsPackage = pkgs.universal-ctags; + }; + + alpha = { + enable = true; + layout = [ + { + type = "padding"; + val = 4; + } + { + type = "text"; + opts = { + position = "center"; + hl = "AlphaHeaderColor"; + }; + val = [ + "  " + " ████ ██████ █████ ██ " + " ███████████ █████  " + " █████████ ███████████████████ ███ ███████████ " + " █████████ ███ █████████████ █████ ██████████████ " + " █████████ ██████████ █████████ █████ █████ ████ █████ " + " ███████████ ███ ███ █████████ █████ █████ ████ █████ " + " ██████ █████████████████████ ████ █████ █████ ████ ██████ " + " " + ]; + } + { + type = "padding"; + val = 4; + } + { + type = "group"; + val = [ + { + type = "button"; + val = "󰭎 Find file"; + on_press.__raw = + "function() vim.cmd[[Telescope find_files]] end"; + opts = { + shortcut = "nf"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + { + type = "button"; + val = " New file"; + on_press.__raw = "function() vim.cmd[[ene]] end"; + opts = { + shortcut = "nn"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + { + type = "button"; + val = " NixOs Config"; + on_press.__raw = + "function() vim.cmd[[Neotree /home/serenity/flakes/nixdots/home/common/dotconfig/nvim]] end"; + opts = { + shortcut = "nc"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + { + type = "button"; + val = " Keybindings"; + on_press.__raw = + "function() vim.cmd[[e /home/serenity/flakes/nixdots/home/common/dotconfig/nvim/docs/KEYBINDINGS.md]] end"; + opts = { + shortcut = "nc"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + { + type = "button"; + val = " Recently used"; + on_press.__raw = + "function() vim.cmd[[Telescope oldfiles]] end"; + opts = { + shortcut = "no"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + { + type = "button"; + val = "󰱽 Find text"; + on_press.__raw = + "function() vim.cmd[[Telescope live_grep]] end"; + opts = { + shortcut = "nt"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + { + type = "button"; + val = "󰩈 Quit Neovim"; + on_press.__raw = "function() vim.cmd[[qa]] end"; + opts = { + shortcut = "nq"; + position = "center"; + cursor = 3; + width = 50; + align_shortcut = "right"; + hl_shortcut = "AlphaShortcutColor"; + hl = "AlphaTextColor"; + }; + } + ]; + + } + ]; + }; }; }; }; + } diff --git a/home/programs/nvim/plugins/utils.nix b/home/programs/nvim/plugins/utils.nix index 56b62c2..c644a28 100755 --- a/home/programs/nvim/plugins/utils.nix +++ b/home/programs/nvim/plugins/utils.nix @@ -1,10 +1,8 @@ -{ config, ... }: { +{ config, pkgs, ... }: { programs.nixvim = { - highlightOverride = { - FloatBorder.fg = "#${config.theme.colors.color15}"; - }; + highlightOverride = { FloatBorder.fg = "#${config.theme.colors.color15}"; }; plugins = { - copilot-vim.enable = true; + flash.enable = true; image = { enable = true; @@ -13,11 +11,13 @@ onlyRenderImageAtCursor = true; }; }; + tmux-navigator.enable = true; comment.enable = true; nvim-autopairs.enable = true; friendly-snippets.enable = true; todo-comments.enable = true; + treesitter = { enable = true; nixGrammars = true; @@ -26,6 +26,7 @@ highlight.enable = true; }; }; + harpoon = { enable = true; enableTelescope = true; @@ -43,7 +44,34 @@ }; }; }; - # treesitter-context.enable = true; + + dap = { + enable = true; + adapters = { }; + signs = { + dapBreakpoint = { + text = "●"; + texthl = "DapBreakpoint"; + }; + dapBreakpointCondition = { + text = "●"; + texthl = "DapBreakpointCondition"; + }; + dapLogPoint = { + text = "◆"; + texthl = "DapLogPoint"; + }; + }; + extensions = { + dap-go = { + enable = true; + delve.path = "${pkgs.delve}/bin/dlv"; + }; + dap-ui = { enable = true; }; + dap-virtual-text = { enable = true; }; + }; + }; + }; }; } diff --git a/home/programs/nvim/plugins/zenmode.nix b/home/programs/nvim/plugins/zenmode.nix deleted file mode 100755 index 3ec69ae..0000000 --- a/home/programs/nvim/plugins/zenmode.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - programs.nixvim.plugins = { - zen-mode = { - enable = true; - settings = { - on_close = '' - function() - require("gitsigns.actions").toggle_current_line_blame() - vim.cmd('IBLEnable') - vim.opt.signcolumn = "yes:2" - vim.wo.wrap = false - vim.wo.linebreak = false - require("gitsigns.actions").refresh() - end - ''; - on_open = '' - function() - require("gitsigns.actions").toggle_current_line_blame() - vim.cmd('IBLDisable') - vim.opt.relativenumber = false - vim.opt.signcolumn = "no" - vim.wo.wrap = true - vim.wo.linebreak = true - require("gitsigns.actions").refresh() - end - ''; - window = { - backdrop = 1; - height = 1; - options = { - signcolumn = "no"; - number = false; - relativenumber = false; - cursorline = false; - cursorcolumn = false; - foldcolumn = "0"; - list = false; - }; - width = 0.8; - - }; - }; - }; - - }; -}