diff options
Diffstat (limited to 'modules/home/conf/nvim/plgs')
62 files changed, 0 insertions, 2298 deletions
diff --git a/modules/home/conf/nvim/plgs/colorscheme/default.nix b/modules/home/conf/nvim/plgs/colorscheme/default.nix deleted file mode 100644 index 11357f77..00000000 --- a/modules/home/conf/nvim/plgs/colorscheme/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package nightfox though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/nightfox.lua} - ${lib.strings.fileContents ./lua/mk_todos_readable.lua} - ''; - colorscheme = "carbonfox"; - extraPlugins = [ - pkgs.vimPlugins.nightfox-nvim - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/colorscheme/lua/mk_todos_readable.lua b/modules/home/conf/nvim/plgs/colorscheme/lua/mk_todos_readable.lua deleted file mode 100644 index d02171b5..00000000 --- a/modules/home/conf/nvim/plgs/colorscheme/lua/mk_todos_readable.lua +++ /dev/null @@ -1,16 +0,0 @@ -local opts = { bg = "NONE", bold = true } - ----@param hl_group string: The name of the hl group ----@param extra_opts table: Extra options to pass to nvim_set_hl -local set_hl = function(hl_group, extra_opts) - local local_opts = vim.deepcopy(opts) - for k, v in ipairs(extra_opts) do - local_opts[k] = v - end - vim.api.nvim_set_hl(0, hl_group, local_opts) -end - -set_hl("@text.danger", { fg = "red" }) -set_hl("@text.note", { fg = "blue" }) -set_hl("@text.todo", { fg = "green" }) -set_hl("@text.warning", { fg = "yellow" }) diff --git a/modules/home/conf/nvim/plgs/colorscheme/lua/nightfox.lua b/modules/home/conf/nvim/plgs/colorscheme/lua/nightfox.lua deleted file mode 100644 index 4c502153..00000000 --- a/modules/home/conf/nvim/plgs/colorscheme/lua/nightfox.lua +++ /dev/null @@ -1,44 +0,0 @@ -require("nightfox").setup({ - options = { - -- Compiled file's destination location - compile_path = vim.fn.stdpath("cache") .. "/nightfox", - compile_file_suffix = "_compiled", -- Compiled file suffix - transparent = true, -- Disable setting background - terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` - dim_inactive = true, -- Non focused panes set to alternative background - module_default = true, -- Default enable value for modules - colorblind = { - enable = true, -- Enable colorblind support - simulate_only = false, -- Only show simulated colorblind colors and not diff shifted - severity = { - protan = 0.3, -- Severity [0,1] for protan (red) - deutan = 0.9, -- Severity [0,1] for deutan (green) - tritan = 0, -- Severity [0,1] for tritan (blue) - }, - }, - styles = { -- Style to be applied to different syntax groups - comments = "italic", -- Value is any valid attr-list value `:help attr-list` - conditionals = "NONE", - constants = "NONE", - functions = "bold", - keywords = "bold", - numbers = "NONE", - operators = "NONE", - strings = "NONE", - types = "NONE", - variables = "NONE", - }, - inverse = { -- Inverse highlight for different types - match_paren = false, - visual = false, - search = false, - }, - modules = { -- List of various plugins and additional options - diagnostic = { enable = true, background = false }, - native_lsp = { enable = true, background = false }, - }, - }, - palettes = {}, - specs = {}, - groups = {}, -}) diff --git a/modules/home/conf/nvim/plgs/comment-nvim/default.nix b/modules/home/conf/nvim/plgs/comment-nvim/default.nix deleted file mode 100644 index 2a73b8db..00000000 --- a/modules/home/conf/nvim/plgs/comment-nvim/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{...}: { - programs.nixvim = { - plugins.comment = { - enable = true; - settings = { - padding = true; - sticky = true; - mappings = { - basic = false; - extra = false; - }; - }; - }; - keymaps = [ - { - key = "gcc"; - mode = "v"; - action = "<Plug>(comment_toggle_linewise_visual)"; - options.desc = "toggle the current line in a linewise comment"; - } - { - key = "gbc"; - mode = "v"; - action = "<Plug>(comment_toggle_blockwise_visual)"; - options.desc = "toggle the current line in a blockwise comment"; - } - { - key = "gcc"; - mode = "n"; - action = "<Plug>(comment_toggle_linewise_current)"; - options.desc = "toggle the current line in a linewise comment"; - } - { - key = "gbc"; - mode = "n"; - action = "<Plug>(comment_toggle_blockwise_current)"; - options.desc = "toggle the current line in a blockwise comment"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/debugprint/default.nix b/modules/home/conf/nvim/plgs/debugprint/default.nix deleted file mode 100644 index 3c591e9f..00000000 --- a/modules/home/conf/nvim/plgs/debugprint/default.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package debugprint though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/debugprint.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.debugprint-nvim - ]; - - keymaps = [ - { - key = "g?v"; - mode = ["v" "n"]; - action.__raw = '' - function() - return require('debugprint').debugprint({variable = true;}); - end - ''; - options.expr = true; - options.desc = '' - 'variable' debug line below the current line - ''; - } - { - key = "g?V"; - mode = ["v" "n"]; - action.__raw = '' - function() - return require('debugprint').debugprint({above = true; variable = true;}) ; - end - ''; - options.expr = true; - options.desc = '' - 'variable' debug line above the current line - ''; - } - { - key = "g?p"; - mode = "n"; - action.__raw = '' - function() - return require('debugprint').debugprint(); - end - ''; - options.expr = true; - options.desc = '' - 'plain' debug line below the current line - ''; - } - { - key = "g?P"; - mode = "n"; - action.__raw = '' - function() - return require('debugprint').debugprint({above = true;}); - end - ''; - options.expr = true; - options.desc = '' - 'plain' debug line above the current line - ''; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/debugprint/lua/debugprint.lua b/modules/home/conf/nvim/plgs/debugprint/lua/debugprint.lua deleted file mode 100644 index da7e1735..00000000 --- a/modules/home/conf/nvim/plgs/debugprint/lua/debugprint.lua +++ /dev/null @@ -1,3 +0,0 @@ -require("debugprint").setup({ - create_keymaps = false, -}) diff --git a/modules/home/conf/nvim/plgs/default.nix b/modules/home/conf/nvim/plgs/default.nix deleted file mode 100644 index 991bc315..00000000 --- a/modules/home/conf/nvim/plgs/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{...}: { - imports = - [ - # Plugins not yet packaged in nixpkgs - # ./debugprint - ./lf-nvim - # ./lsp-progress-nvim - ] - ++ [ - # Already packaged in nixpkgs - ./colorscheme - ./comment-nvim - ./femaco - ./flatten-nvim - ./goto-preview - ./harpoon - ./leap - ./lsp - ./lspkind - ./ltex_extra - ./lualine - ./luasnip - ./neorg - ./nvim-cmp - ./nvim-lint - ./raw_plugins - ./telescope - ./todo-comments - ./treesitter - ./vim-tex - ./which-key - ]; -} diff --git a/modules/home/conf/nvim/plgs/femaco/default.nix b/modules/home/conf/nvim/plgs/femaco/default.nix deleted file mode 100644 index 6c4a7d89..00000000 --- a/modules/home/conf/nvim/plgs/femaco/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package femaco through a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/femaco.lua} - ''; - extraPlugins = [ - pkgs.vimPlugins.nvim-FeMaco-lua - ]; - keymaps = [ - { - key = "<leader>cc"; - mode = "n"; - action.__raw = "require('femaco.edit').edit_code_block"; - options.desc = "edit a [c]ode blo[c]k with femaco"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/femaco/lua/femaco.lua b/modules/home/conf/nvim/plgs/femaco/lua/femaco.lua deleted file mode 100644 index da3be8e1..00000000 --- a/modules/home/conf/nvim/plgs/femaco/lua/femaco.lua +++ /dev/null @@ -1,50 +0,0 @@ -local clip_val = require("femaco.utils").clip_val -require("femaco").setup({ - -- should prepare a new buffer and return the winid - -- by default opens a floating window - -- provide a different callback to change this behaviour - -- @param opts: the return value from float_opts - prepare_buffer = function(opts) - local buf = vim.api.nvim_create_buf(false, false) - return vim.api.nvim_open_win(buf, true, opts) - end, - -- should return options passed to nvim_open_win - -- @param code_block: data about the code-block with the keys - -- * range - -- * lines - -- * lang - float_opts = function(code_block) - return { - relative = "cursor", - width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10), -- TODO: how to offset sign column etc? - height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6), - anchor = "NW", - row = 0, - col = 0, - style = "minimal", - border = "rounded", - zindex = 1, - } - end, - -- return filetype to use for a given lang - -- lang can be nil - ft_from_lang = function(lang) - return lang - end, - -- what to do after opening the float - post_open_float = function(winnr) - vim.wo.signcolumn = "no" - end, - -- create the path to a temporary file - create_tmp_filepath = function(filetype) - return os.tmpname() - end, - -- if a newline should always be used, useful for multiline injections - -- which separators needs to be on separate lines such as markdown, neorg etc - -- @param base_filetype: The filetype which FeMaco is called from, not the - -- filetype of the injected language (this is the current buffer so you can - -- get it from vim.bo.filetyp). - ensure_newline = function(base_filetype) - return false - end, -}) diff --git a/modules/home/conf/nvim/plgs/flatten-nvim/default.nix b/modules/home/conf/nvim/plgs/flatten-nvim/default.nix deleted file mode 100644 index cd6f8bcc..00000000 --- a/modules/home/conf/nvim/plgs/flatten-nvim/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package flatten-nvim though a module - - extraConfigLuaPre = '' - ${lib.strings.fileContents ./lua/flatten-nvim.lua} - if os.getenv("NVIM") ~= nil then - -- Avoid loading plugins because the host will take control of the instance anyways - return - end - ''; - extraPlugins = [ - pkgs.vimPlugins.flatten-nvim - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua b/modules/home/conf/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua deleted file mode 100644 index 42ea1eb6..00000000 --- a/modules/home/conf/nvim/plgs/flatten-nvim/lua/flatten-nvim.lua +++ /dev/null @@ -1,106 +0,0 @@ ----Types: --- --- Passed to callbacks that handle opening files ----@alias BufInfo { fname: string, bufnr: buffer } --- --- Needed aliases ----@alias buffer integer: Buffer id ----@alias window integer: Window id --- --- The first argument is a list of BufInfo tables representing the newly opened files. --- The third argument is a single BufInfo table, only provided when a buffer is created from stdin. --- --- IMPORTANT: For `block_for` to work, you need to return a buffer number OR a buffer number and a window number. --- The `winnr` return value is not required, `vim.fn.bufwinid(bufnr)` is used if it is not provided. --- The `filetype` of this buffer will determine whether block should happen or not. --- ----@alias OpenHandler fun(files: BufInfo[], argv: string[], stdin_buf: BufInfo, guest_cwd: string):window, buffer --- -require("flatten").setup({ - callbacks = { - ---Called to determine if a nested session should wait for the host to close the file. - ---param argv: a list of all the arguments in the nested session - ---@type fun(argv: table): boolean - should_block = require("flatten").default_should_block, - - ---If this returns true, the nested session will be opened. - ---If false, default behavior is used, and - ---config.nest_if_no_args is respected. - ---@type fun(host: channel):boolean - should_nest = require("flatten").default_should_nest, - - ---Called before a nested session is opened. - pre_open = function() end, - - ---Called after a nested session is opened. - ---@param bufnr buffer - ---@param winnr window - ---@param filetype string - ---@param is_blocking boolean - ---@param is_diff boolean - post_open = function(bufnr, winnr, filetype, is_blocking, is_diff) - -- If the file is a git commit, create one-shot autocmd to delete its buffer on write - if filetype == "gitcommit" or filetype == "gitrebase" then - vim.api.nvim_create_autocmd("BufWritePost", { - buffer = bufnr, - once = true, - callback = vim.schedule_wrap(function() - vim.api.nvim_buf_delete(bufnr, {}) - end), - }) - end - end, - - ---Called when a nested session is done waiting for the host. - ---@param filetype string - block_end = function(filetype) end, - }, - -- <String, Bool> dictionary of filetypes that should be blocking - block_for = { - gitcommit = true, - }, - -- Command passthrough - allow_cmd_passthrough = true, - -- Allow a nested session to open if Neovim is opened without arguments - nest_if_no_args = false, - -- Window options - window = { - -- Options: - -- current -> open in current window (default) - -- alternate -> open in alternate window (recommended) - -- tab -> open in new tab - -- split -> open in split - -- vsplit -> open in vsplit - -- smart -> smart open (avoids special buffers) - -- OpenHandler -> allows you to handle file opening yourself (see Types) - -- - -- TODO: Open gitcommit filetypes in the current buffer, everything else in a new tab <2023-08-29> - open = "split", - - -- Options: - -- vsplit -> opens files in diff vsplits - -- split -> opens files in diff splits - -- tab_vsplit -> creates a new tabpage, and opens diff vsplits - -- tab_split -> creates a new tabpage, and opens diff splits - -- OpenHandler -> allows you to handle file opening yourself (see Types) - diff = "tab_vsplit", - - -- Affects which file gets focused when opening multiple at once - -- Options: - -- "first" -> open first file of new files (default) - -- "last" -> open last file of new files - focus = "first", - }, - -- Override this function to use a different socket to connect to the host - -- On the host side this can return nil or the socket address. - -- On the guest side this should return the socket address - -- or a non-zero channel id from `sockconnect` - -- flatten.nvim will detect if the address refers to this instance of nvim, to determine if this is a host or a guest - pipe_path = require("flatten").default_pipe_path, - -- The `default_pipe_path` will treat the first nvim instance within a single kitty/wezterm session as the host - -- You can configure this behaviour using the following: - one_per = { - kitty = true, -- Flatten all instance in the current Kitty session - wezterm = true, -- Flatten all instance in the current Wezterm session - }, -}) diff --git a/modules/home/conf/nvim/plgs/goto-preview/default.nix b/modules/home/conf/nvim/plgs/goto-preview/default.nix deleted file mode 100644 index 3de28c68..00000000 --- a/modules/home/conf/nvim/plgs/goto-preview/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package goto-preview though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/goto-preview.lua} - ''; - extraPlugins = [ - pkgs.vimPlugins.goto-preview - ]; - keymaps = [ - { - key = "<space>gd"; - mode = "n"; - action.__raw = "require('goto-preview').goto_preview_definition"; - options.desc = "[G]oto [D]efinition"; - } - { - key = "<space>gtd"; - mode = "n"; - action.__raw = "require('goto-preview').goto_preview_type_definition"; - options.desc = "[G]oto the [t]ype [D]efinition"; - } - { - key = "<space>gi"; - mode = "n"; - action.__raw = "require('goto-preview').goto_preview_implementation"; - options.desc = "[G]oto [I]mplementations"; - } - { - key = "<space>gr"; - mode = "n"; - action.__raw = "require('goto-preview').goto_preview_references"; - options.desc = "[G]o to all [R]eferences of the symbol"; - } - { - key = "\\<space>"; - mode = "n"; - action.__raw = "require('goto-preview').close_all_win"; - options.desc = "close all preview windows"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/goto-preview/lua/goto-preview.lua b/modules/home/conf/nvim/plgs/goto-preview/lua/goto-preview.lua deleted file mode 100644 index 9687a5a0..00000000 --- a/modules/home/conf/nvim/plgs/goto-preview/lua/goto-preview.lua +++ /dev/null @@ -1,21 +0,0 @@ -require("goto-preview").setup({ - width = 120, -- Width of the floating window - height = 15, -- Height of the floating window - border = { "↖", "─", "┐", "│", "┘", "─", "└", "│" }, -- Border characters of the floating window - default_mappings = false, -- Bind default mappings - debug = false, -- Print debug information - opacity = nil, -- 0-100 opacity level of the floating window where 100 is fully transparent. - resizing_mappings = false, -- Binds arrow keys to resizing the floating window. - post_open_hook = nil, -- A function taking two arguments, a buffer and a window to be ran as a hook. - post_close_hook = nil, -- A function taking two arguments, a buffer and a window to be ran as a hook. - references = { -- Configure the telescope UI for slowing the references cycling window. - telescope = {}, -- require("telescope.themes").get_dropdown({ hide_preview = false }) - }, - -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. - focus_on_open = true, -- Focus the floating window when opening it. - dismiss_on_move = false, -- Dismiss the floating window when moving the cursor. - force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close - bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden - stack_floating_preview_windows = true, -- Whether to nest floating windows - preview_window_title = { enable = true, position = "left" }, -- Whether to set the preview window title as the filename -}) diff --git a/modules/home/conf/nvim/plgs/harpoon/default.nix b/modules/home/conf/nvim/plgs/harpoon/default.nix deleted file mode 100644 index 465f24f0..00000000 --- a/modules/home/conf/nvim/plgs/harpoon/default.nix +++ /dev/null @@ -1,94 +0,0 @@ -{pkgs, ...}: let - numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]; - mkNumberedCommand = { - command_template, - prefix, - number, - desc_template, - }: { - key = "${prefix}${number}"; - action.__raw = '' - function() - ${command_template number} - end - ''; - options.desc = "${desc_template number}"; - }; - mkGotoTerminalCommand = number: let - desc_template = number: "Goto terminal number ${number}"; - command_template = number: ''require("harpoon.term").gotoTerminal(${number})''; - prefix = "gt"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - mkGotoFileCommand = number: let - desc_template = number: "Goto Buffer number ${number}"; - command_template = number: ''require("harpoon.ui").nav_file(${number})''; - prefix = "gf"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - - gotoTerminalMappings = builtins.map mkGotoTerminalCommand numbers; - gotoFileMappings = builtins.map mkGotoFileCommand numbers; -in { - programs.nixvim = { - plugins.harpoon = { - enable = true; - package = pkgs.vimPlugins.harpoon; - enableTelescope = true; - # menu.width = "vim.api.nvim_win_get_width(0) - 4"; # TODO: integrate that - keymaps = { - tmuxGotoTerminal = null; # TODO: - }; - }; - keymaps = - [ - { - key = "-"; - action.__raw = '' - function() - require("harpoon.ui").nav_next() - end - ''; - options.desc = "go to the next marked file"; - } - { - key = "_"; - action.__raw = '' - function() - require("harpoon.ui").nav_prev() - end - ''; - options.desc = "go to the previous marked file"; - } - { - key = "<leader><leader>"; - action.__raw = '' - function() - require("harpoon.mark").add_file() - end - ''; - options.desc = "add a mark to the open file in harpoon."; - } - { - key = "gqc"; - action.__raw = '' - function() - require("harpoon.cmd-ui").toggle_quick_menu() - end - ''; - options.desc = "toggle the harpoon command quick menu to see all commands."; - } - { - key = "<leader>q"; - action.__raw = '' - function() - require("harpoon.ui").toggle_quick_menu() - end - ''; - options.desc = "toggle the harpoon normal quick menu to see all marks."; - } - ] - ++ gotoFileMappings - ++ gotoTerminalMappings; - }; -} diff --git a/modules/home/conf/nvim/plgs/leap/default.nix b/modules/home/conf/nvim/plgs/leap/default.nix deleted file mode 100644 index 4e7ae60c..00000000 --- a/modules/home/conf/nvim/plgs/leap/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{...}: { - programs.nixvim = { - plugins.leap = { - enable = true; - addDefaultMappings = false; # They don't work with dvorak. - safeLabels = [ - "f" - "j" - "k" - "l" - "/" - "z" - "S" - "F" - "J" - "K" - "L" - "H" - "W" - "E" - "M" - "B" - "U" - "X" - "?" - "Z" - ]; - }; - keymaps = [ - { - key = "j"; - action = "<Plug>(leap-forward-to)"; - options.desc = "jump forward to"; - } - { - key = "J"; - action = "<Plug>(leap-backward-to)"; - options.desc = "jump backward to"; - } - { - key = "gj"; - action = "<Plug>(leap-from-window)"; - options.desc = "jump to enterable windows"; - } - /* - {key= "x"; - mode = "v"; - action = "<Plug>(leap-forward-till)"; - options.desc = "leap forward till"; - } - {key= "X"; - mode = "v"; - action = "<Plug>(leap-backward-till)"; - options.desc = "leap backward till"; - } - */ - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lf-nvim/default.nix b/modules/home/conf/nvim/plgs/lf-nvim/default.nix deleted file mode 100644 index 11ad2807..00000000 --- a/modules/home/conf/nvim/plgs/lf-nvim/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package lf-nvim though a module - # FIXME: change the nvim path, when I change the path with lf - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/lf-nvim.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.lf-nvim - - pkgs.vimPlugins.toggleterm-nvim # required by lf-nvim - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lf-nvim/lua/lf-nvim.lua b/modules/home/conf/nvim/plgs/lf-nvim/lua/lf-nvim.lua deleted file mode 100644 index 1eadf375..00000000 --- a/modules/home/conf/nvim/plgs/lf-nvim/lua/lf-nvim.lua +++ /dev/null @@ -1,43 +0,0 @@ -local fn = vim.fn - --- Defaults -require("lf").setup({ - default_action = "drop", -- default action when `Lf` opens a file - -- TODO: what do these mappings do? - default_actions = { -- default action keybindings - ["<C-t>"] = "tabedit", - ["<C-x>"] = "split", - ["<C-v>"] = "vsplit", - ["<C-o>"] = "tab drop", - }, - - winblend = 10, -- psuedotransparency level - dir = "", -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD) - direction = "float", -- window type: float horizontal vertical - border = "rounded", -- border kind: single double shadow curved - height = fn.float2nr(fn.round(0.75 * vim.o.lines)), -- height of the *floating* window - width = fn.float2nr(fn.round(0.75 * vim.o.columns)), -- width of the *floating* window - escape_quit = true, -- map escape to the quit command (so it doesn't go into a meta normal mode) - focus_on_open = true, -- focus the current file when opening Lf (experimental) - mappings = true, -- whether terminal buffer mapping is enabled - tmux = false, -- tmux statusline can be disabled on opening of Lf - default_file_manager = true, -- make lf default file manager - disable_netrw_warning = true, -- don't display a message when opening a directory with `default_file_manager` as true - highlights = { -- highlights passed to toggleterm - Normal = { link = "Normal" }, - NormalFloat = { link = "Normal" }, - FloatBorder = { guifg = "#cdcbe0", guibg = "#191726" }, - }, - - -- Layout configurations - layout_mapping = "<M-u>", -- resize window with this key - views = { -- window dimensions to rotate through - { width = 0.800, height = 0.800 }, - { width = 0.600, height = 0.600 }, - { width = 0.950, height = 0.950 }, - { width = 0.500, height = 0.500, col = 0, row = 0 }, - { width = 0.500, height = 0.500, col = 0, row = 0.5 }, - { width = 0.500, height = 0.500, col = 0.5, row = 0 }, - { width = 0.500, height = 0.500, col = 0.5, row = 0.5 }, - }, -}) diff --git a/modules/home/conf/nvim/plgs/lsp-progress-nvim/default.nix b/modules/home/conf/nvim/plgs/lsp-progress-nvim/default.nix deleted file mode 100644 index 6602ceb6..00000000 --- a/modules/home/conf/nvim/plgs/lsp-progress-nvim/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.nixvim = { - # TODO: package lsp-progress-nvim though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/lsp-progress-nvim.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.lsp-progress-nvim - ]; - - # Status line setup - autoGroups.lsp_refresh.clear = true; - autoCmd = [ - { - event = ["User LspProgressStatusUpdated"]; - pattern = ["*"]; - callback = - /* - lua - */ - { - __raw = '' - require("lualine").refresh - ''; - }; - group = "lsp_refresh"; - description = "Refresh the statusbar when the lsp status was updated."; - } - ]; - plugins.lualine = let - get_lsp_progress = { - __raw = - /* - lua - */ - '' - require('lsp-progress').progress - ''; - }; - in { - sections = { - lualine_c = [{name = get_lsp_progress;}]; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua b/modules/home/conf/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua deleted file mode 100644 index efb15720..00000000 --- a/modules/home/conf/nvim/plgs/lsp-progress-nvim/lua/lsp-progress-nvim.lua +++ /dev/null @@ -1,150 +0,0 @@ ---- @type table<string, any> -require("lsp-progress").setup({ - -- Spinning icons. - -- - --- @type string[] - spinner = { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }, - - -- Spinning update time in milliseconds. - -- - --- @type integer - spin_update_time = 200, - - -- Last message cached decay time in milliseconds. - -- - -- Message could be really fast(appear and disappear in an - -- instant) that user cannot even see it, thus we cache the last message - -- for a while for user view. - -- - --- @type integer - decay = 700, - - -- User event name. - -- - --- @type string - event = "LspProgressStatusUpdated", - - -- Event update time limit in milliseconds. - -- - -- Sometimes progress handler could emit many events in an instant, while - -- refreshing statusline cause too heavy synchronized IO, so we limit the - -- event rate to reduce this cost. - -- - --- @type integer - event_update_time_limit = 100, - - -- Max progress string length, by default -1 is unlimited. - -- - --- @type integer - max_size = -1, - - -- Regular internal update time. - -- - -- Emit user event to update the lsp progress status, even there's no new - -- message. - -- - --- @type integer - regular_internal_update_time = 500, - - -- Disable emitting events on specific mode/filetype. - -- User events would interrupt insert mode, thus break which-key like plugins behaviour. - -- See: - -- * https://github.com/linrongbin16/lsp-progress.nvim/issues/50 - -- * https://neovim.io/doc/user/builtin.html#mode() - -- - --- @type table[] - disable_events_opts = { { mode = "i", filetype = "TelescopePrompt" } }, - - -- Format series message. - -- - -- By default it looks like: `formatting isort (100%) - done`. - -- - --- @param title string|nil - --- Message title. - --- @param message string|nil - --- Message body. - --- @param percentage number|nil - --- Progress in percentage numbers: 0-100. - --- @param done boolean - --- Indicate whether this series is the last one in progress. - --- @return string|nil messages - --- The returned value will be passed to function `client_format` as - --- one of the `series_messages` array, or ignored if return nil. - series_format = function(title, message, percentage, done) - local builder = {} - local has_title = false - local has_message = false - if title and title ~= "" then - table.insert(builder, title) - has_title = true - end - if message and message ~= "" then - table.insert(builder, message) - has_message = true - end - if percentage and (has_title or has_message) then - table.insert(builder, string.format("(%.0f%%%%)", percentage)) - end - if done and (has_title or has_message) then - table.insert(builder, "- done") - end - return table.concat(builder, " ") - end, - - -- Format client message. - -- - -- By default it looks like: - -- `[null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)`. - -- - --- @param client_name string - --- Client name. - --- @param spinner string - --- Spinner icon. - --- @param series_messages string[]|table[] - --- Messages array. - --- @return string|nil messages - --- The returned value will be passed to function `format` as one of the - --- `client_messages` array, or ignored if return nil. - client_format = function(client_name, spinner, series_messages) - return #series_messages > 0 - and ("[" .. client_name .. "] " .. spinner .. " " .. table.concat(series_messages, ", ")) - or nil - end, - - -- Format (final) message. - -- - -- By default it looks like: - -- ` LSP [null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)` - -- - --- @param client_messages string[]|table[] - --- Client messages array. - --- @return nil|string message - --- The returned value will be returned from `progress` API. - format = function(client_messages) - local sign = " LSP" -- nf-fa-gear \uf013 - return #client_messages > 0 and (sign .. " " .. table.concat(client_messages, " ")) or sign - end, - - -- Enable debug. - -- - --- @type boolean - debug = false, - - -- Print log to console(command line). - -- - --- @type boolean - console_log = false, - - -- Print log to file. - -- - --- @type boolean - file_log = true, - - -- Log file to write, work with `file_log=true`. - -- - -- For Windows: `$env:USERPROFILE\AppData\Local\nvim-data\lsp-progress.log`. - -- For *NIX: `~/.local/share/nvim/lsp-progress.log`. - -- - --- @type string - file_log_name = "lsp-progress.log", -}) diff --git a/modules/home/conf/nvim/plgs/lsp/default.nix b/modules/home/conf/nvim/plgs/lsp/default.nix deleted file mode 100644 index b7c1e174..00000000 --- a/modules/home/conf/nvim/plgs/lsp/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{...}: { - imports = [ - ./keymaps - ./servers - ]; - programs.nixvim.plugins.lsp = { - enable = true; - onAttach = - "" - # + '' - # function(client, bufnr) - # -- Enable completion triggered by <c-x><c-o> - # -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - # end - # '' - ; - preConfig = '' - vim.diagnostic.config({ - underline = true, - -- virtual_text = true, - virtual_text = { - source = "always", -- Or "if_many" - }, - update_in_insert = true, - severity_sort = true, - }, nil); - ''; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix b/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix deleted file mode 100644 index b1276639..00000000 --- a/modules/home/conf/nvim/plgs/lsp/keymaps/default.nix +++ /dev/null @@ -1,70 +0,0 @@ -{...}: { - programs.nixvim = { - plugins.lsp.keymaps = { - diagnostic = { - "N" = { - action = "goto_prev"; - desc = "go to previous diagnostic message"; - }; - "T" = { - action = "goto_next"; - desc = "go to next diagnostic message"; - }; - "<space>e" = { - action = "open_float"; - desc = "open float for the symbol"; - }; - "<space>gq" = { - action = "setloclist"; - desc = "add buffer diagnostic to the location list (quick-fix)"; - }; - }; - lspBuf = { - "<space>gD" = { - action = "declaration"; - desc = "[G]o to [d]eclaration"; - }; - "<space>hi" = { - action = "hover"; - desc = "Display [h]over [i]nformation"; - }; - "<space>sh" = { - action = "signature_help"; - desc = "Display [s]ignature [h]elp"; - }; - "<space>wa" = { - action = "add_workspace_folder"; - desc = "[W]orkspace folder [a]dd"; - }; - "<space>wr" = { - action = "remove_workspace_folder"; - desc = "[W]orkspace folder [r]emove"; - }; - "<space>rn" = { - action = "rename"; - desc = "[R]e[n]ame the item under the cursor"; - }; - "<space>ca" = { - action = "code_action"; - desc = "Open the [c]ode [a]ction menu"; - }; - }; - }; - keymaps = [ - { - key = "<space>f"; - action.__raw = "function() vim.lsp.buf.format { async = true } end"; - options.desc = "[F]ormat the current buffer (asynchronously)"; - } - { - key = "<space>wl"; - action.__raw = '' - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end - ''; - options.desc = "[W]orkspace folders [l]ist"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/default.nix b/modules/home/conf/nvim/plgs/lsp/servers/default.nix deleted file mode 100644 index 605046d4..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{...}: { - imports = [ - # ./servers/pylyzer.nix - ./servers/bashls.nix - ./servers/ccls.nix - ./servers/quick-lint-js.nix - ./servers/ltex.nix - ./servers/lua-ls.nix - ./servers/nil-ls.nix - ./servers/openscad.nix - ./servers/ruff-lsp.nix - ./servers/rust-analyzer.nix - ./servers/texlab.nix - ]; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix deleted file mode 100644 index 0577a335..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/bashls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - bashls.enable = true; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix deleted file mode 100644 index 0698bcce..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/ccls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ccls.enable = true; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix deleted file mode 100644 index 3224bc41..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/ltex.nix +++ /dev/null @@ -1,39 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ltex = let - filetypes = [ - "java" - "cpp" - "shell" - "bash" - - "bibtex" - "context" - "context.tex" - "latex" - "tex" - - "markdown" - "org" - "restructuredtext" - "rsweave" - - "git-commit" - "gitcommit" - - "mail" - ]; - in { - enable = true; - inherit filetypes; - settings = { - enabled = filetypes; - completionEnabled = false; - language = "en-CA"; - additionalRules = { - enablePickyRules = true; - }; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix deleted file mode 100644 index 4f20558c..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/lua-ls.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - lua_ls = { - enable = true; - settings.telemetry.enable = false; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix deleted file mode 100644 index f0cccbdc..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/nil-ls.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - nil_ls = { - enable = true; - settings = { - formatting.command = ["alejandra"]; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix deleted file mode 100644 index a0221cc4..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/openscad.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').openscad_lsp.setup{ - cmd = {"openscad-lsp", "--stdio", "--fmt-style", "WebKit"}, - } - ''; - extraPackages = with pkgs; [ - openscad-lsp - clang-tools # Need to satisfy `clang-format` (which is used by openscad-lsp) - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix deleted file mode 100644 index b1042221..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/pylyzer.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').pylyzer.setup{} - ''; - extraPackages = with pkgs; [pylyzer]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix deleted file mode 100644 index 23c3054a..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/quick-lint-js.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraConfigLuaPost = - /* - lua - */ - '' - require('lspconfig').quick_lint_js.setup{ - } - ''; - extraPackages = with pkgs; [ - quick-lint-js - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix deleted file mode 100644 index 6fbdc998..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/ruff-lsp.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - plugins.lsp.servers = { - ruff_lsp = { - enable = true; - }; - }; - extraPackages = with pkgs; [ruff]; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix deleted file mode 100644 index 5da61a71..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/rust-analyzer.nix +++ /dev/null @@ -1,17 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - rust_analyzer = { - enable = true; - settings = { - typing.autoClosingAngleBrackets.enable = true; - - # Check with `cargo clippy` instead of just `cargo check` - check.command = "clippy"; - }; - # NOTE: These should be provided by the devenv, to support nightly and - # such things <2023-11-25> - installCargo = false; - installRustc = false; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix b/modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix deleted file mode 100644 index 59af8d39..00000000 --- a/modules/home/conf/nvim/plgs/lsp/servers/servers/texlab.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - texlab = { - enable = true; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/lspkind/default.nix b/modules/home/conf/nvim/plgs/lspkind/default.nix deleted file mode 100644 index ed7d411b..00000000 --- a/modules/home/conf/nvim/plgs/lspkind/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - programs.nixvim.plugins.lspkind = { - enable = true; - preset = "default"; # "codicons" is only for a font patched with vscode-codeicons. - }; -} diff --git a/modules/home/conf/nvim/plgs/ltex_extra/default.nix b/modules/home/conf/nvim/plgs/ltex_extra/default.nix deleted file mode 100644 index af78c7a5..00000000 --- a/modules/home/conf/nvim/plgs/ltex_extra/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - # TODO: package ltex_extra though a module - extraPlugins = [ - pkgs.vimPlugins.ltex_extra-nvim - ]; - plugins.lsp.servers.ltex.onAttach.function = builtins.readFile ./lua/ltex_extra.lua; - }; -} diff --git a/modules/home/conf/nvim/plgs/ltex_extra/lua/ltex_extra.lua b/modules/home/conf/nvim/plgs/ltex_extra/lua/ltex_extra.lua deleted file mode 100644 index d532428a..00000000 --- a/modules/home/conf/nvim/plgs/ltex_extra/lua/ltex_extra.lua +++ /dev/null @@ -1,16 +0,0 @@ -require("ltex_extra").setup({ - -- table <string> : languages for witch dictionaries will be loaded, e.g. { "es-AR", "en-US" } - -- https://valentjn.github.io/ltex/supported-languages.html#natural-languages - load_langs = { "en-CA", "de-DE", "sv-SE" }, -- en-US as default - -- boolean : whether to load dictionaries on startup - init_check = true, - -- string : relative or absolute path to store dictionaries - -- e.g. subfolder in the project root or the current working directory: ".ltex" - -- e.g. shared files for all projects: vim.fn.expand("~") .. "/.local/share/ltex" - path = vim.fn.expand("~") .. "/.local/state/nvim/ltex", -- project root or current working directory - -- string : "none", "trace", "debug", "info", "warn", "error", "fatal" - log_level = "warn", - -- table : configurations of the ltex language server. - -- Only if you are calling the server from ltex_extra - server_opts = nil, -}) diff --git a/modules/home/conf/nvim/plgs/lualine/default.nix b/modules/home/conf/nvim/plgs/lualine/default.nix deleted file mode 100644 index 54d20380..00000000 --- a/modules/home/conf/nvim/plgs/lualine/default.nix +++ /dev/null @@ -1,121 +0,0 @@ -{...}: { - programs.nixvim.plugins.lualine = let - get_location_of_file = { - __raw = '' - function() - local file_lines = vim.fn.line('$'); - local file_current_cursor_positon = vim.fn.getcurpos(); - return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines - end - ''; - }; - - get_trailing_whitespace = { - __raw = '' - function() - local space = vim.fn.search([[\s\+$]], 'nwc') - return space ~= 0 and "TW:" .. space or "" - end - ''; - }; - get_mixed_indent = { - __raw = - /* - lua - */ - '' - function() - local space_pat = [[\v^ +]] - local tab_pat = [[\v^\t+]] - local space_indent = vim.fn.search(space_pat, 'nwc') - local tab_indent = vim.fn.search(tab_pat, 'nwc') - local mixed = (space_indent > 0 and tab_indent > 0) - local mixed_same_line - if not mixed then - mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') - mixed = mixed_same_line > 0 - end - if not mixed then return "" end - if mixed_same_line ~= nil and mixed_same_line > 0 then - return 'MI:' .. mixed_same_line - end - local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total - local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total - if space_indent_cnt > tab_indent_cnt then - return 'MI:' .. tab_indent - else - return 'MI:' .. space_indent - end - end - ''; - }; - in { - enable = true; - - settings = { - options = { - iconsEnabled = true; - theme = "nightfox"; - }; - - # TODO: add all installed and supported extensions here - extensions = [ - "toggleterm" - #"fugitive" # TODO: maybe add this? - ]; - - componentSeparators = { - left = ""; - right = ""; - }; - sectionSeparators = { - left = ""; - right = ""; - }; - disabledFiletypes = { - statusline = []; - winbar = []; - }; - ignoreFocus = []; - alwaysDivideMiddle = true; - globalstatus = false; - refresh = { - statusline = 1000; - tabline = 1000; - winbar = 1000; - }; - sections = { - lualine_a = ["mode"]; - lualine_b = [ - { - __raw = '' - {'FugitiveHead', icon = ""} - ''; - } - "diff" - "diagnostics" - ]; - lualine_c = ["filename"]; - lualine_x = ["searchcount" "filetype"]; - lualine_y = [ - "encoding" - "fileformat" - get_mixed_indent - get_trailing_whitespace - ]; - lualine_z = [get_location_of_file]; - }; - inactiveSections = { - lualine_a = []; - lualine_b = []; - lualine_c = ["filename"]; - lualine_x = [get_location_of_file]; - lualine_y = []; - lualine_z = []; - }; - tabline = {}; - winbar = {}; - inactiveWinbar = {}; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/luasnip/default.nix b/modules/home/conf/nvim/plgs/luasnip/default.nix deleted file mode 100644 index 130fafee..00000000 --- a/modules/home/conf/nvim/plgs/luasnip/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.nixvim = { - plugins.luasnip = { - enable = true; - }; - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/luasnip.lua}; - require("luasnip.loaders.from_lua").load({paths = "${./lua/snippets}"}); - require("luasnip.loaders.from_lua").lazy_load({paths = "${./lua/snippets}"}); - ''; - extraPlugins = [ - # needed for the todo-comments snippets - pkgs.vimPlugins.comment-nvim - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/luasnip/lua/luasnip.lua b/modules/home/conf/nvim/plgs/luasnip/lua/luasnip.lua deleted file mode 100644 index a05fa57f..00000000 --- a/modules/home/conf/nvim/plgs/luasnip/lua/luasnip.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("luasnip").config.set_config({ - -- Enable auto triggered snippets - enable_autosnippets = true, - - -- Use Tab (or some other key if you prefer) to trigger visual selection - store_selection_keys = "<Tab>", -}) diff --git a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/all.lua b/modules/home/conf/nvim/plgs/luasnip/lua/snippets/all.lua deleted file mode 100644 index c3f75058..00000000 --- a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/all.lua +++ /dev/null @@ -1,182 +0,0 @@ -local ls = require("luasnip") --- auto_pairs {{{ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end -local function char_count_same(c1, c2) - local line = vim.api.nvim_get_current_line() - -- '%'-escape chars to force explicit match (gsub accepts patterns). - -- second return value is number of substitutions. - local _, ct1 = string.gsub(line, "%" .. c1, "") - local _, ct2 = string.gsub(line, "%" .. c2, "") - return ct1 == ct2 -end - -local function even_count(c, ...) - local line = vim.api.nvim_get_current_line() - local _, ct = string.gsub(line, c, "") - return ct % 2 == 0 -end - --- This makes creation of pair-type snippets easier. -local function pair(pair_begin, pair_end, file_types, condition_function) - -- FIXME(@Soispha): This only works if file_types == nil, otherwise the snippet does not expand. - -- It would be nice, if it would support both an empty array (`{}`) and nil <2023-08-27> - -- file_types = file_types or {}; - - return s( - { trig = pair_begin, wordTrig = false, snippetType = "autosnippet" }, - { t({ pair_begin }), d(1, get_visual), t({ pair_end }) }, - { - condition = function() - local filetype_check = true - if file_types ~= nil then - filetype_check = file_types[vim.bo.filetype] or false - end - return (not condition_function(pair_begin, pair_end)) and filetype_check - end, - } - ) -end - -local auto_pairs = { - pair("(", ")", nil, char_count_same), - pair("{", "}", nil, char_count_same), - pair("[", "]", nil, char_count_same), - pair("<", ">", { ["rust"] = true, ["tex"] = true }, char_count_same), - pair("'", "'", nil, even_count), - pair('"', '"', nil, even_count), - pair("`", "`", nil, even_count), -} - -ls.add_snippets("all", auto_pairs, { type = "snippets", key = "auto_pairs" }) --- }}} - --- todo_comments {{{ -local calculate_comment_string = require("Comment.ft").calculate -local utils = require("Comment.utils") - ---- Get the comment string {beg,end} table ----@param ctype integer 1 for `line`-comment and 2 for `block`-comment ----@return table comment_strings {begcstring, endcstring} -local get_cstring = function(ctype) - -- use the `Comments.nvim` API to fetch the comment string for the region (eq. '--%s' or '--[[%s]]' for `lua`) - local cstring = calculate_comment_string({ ctype = ctype, range = utils.get_region() }) or vim.bo.commentstring - -- as we want only the strings themselves and not strings ready for using `format` we want to split the left and right side - local left, right = utils.unwrap_cstr(cstring) - -- create a `{left, right}` table for it - return { left, right } -end -_G.luasnip = {} -_G.luasnip.vars = { - username = "@soispha", - email = "soispha@vhack.eu", -} - ---- Options for marks to be used in a TODO comment ----@return table,table: The first table contains a node for the date, the second for the signature -local marks = { - signature = function() - return t("(" .. _G.luasnip.vars.username .. ")"), t("") - end, - date_signature = function() - return t("<" .. os.date("%Y-%m-%d") .. ">"), t("(" .. _G.luasnip.vars.username .. ")") - end, - date = function() - return t("<" .. os.date("%Y-%m-%d") .. ">"), t("") - end, - empty = function() - return t(""), t("") - end, -} - ----@param alias string ----@param opts table ----@param mark_function function: This function should return two nodes ----@return table: Returns the comment node -local todo_snippet_nodes = function(alias, opts, mark_function) - local date_node, signature_node = mark_function() - -- format them into the actual snippet - local comment_node = fmta("<> <><>: <> <> <>", { - f(function() - return get_cstring(opts.ctype)[1] -- get <comment-string[1]> - end), - t(alias), -- [name-of-comment] - signature_node, - i(0), -- {comment-text} - date_node, - f(function() - return get_cstring(opts.ctype)[2] -- get <comment-string[2]> - end), - }) - return comment_node -end - ---- Generate a TODO comment snippet with an automatic description and docstring ----@param context table merged with the generated context table `trig` must be specified ----@param alias string of aliases for the todo comment (ex.: {FIX, ISSUE, FIXIT, BUG}) ----@param opts table merged with the snippet opts table ----@param mark_function function: The function used to get the marks -local todo_snippet = function(context, alias, opts, mark_function) - opts = opts or {} - context = context or {} - if not context.trig then - return error("context doesn't include a `trig` key which is mandatory", 2) -- all we need from the context is the trigger - end - opts.ctype = opts.ctype or 1 -- comment type can be passed in the `opts` table, but if it is not, we have to ensure, it is defined - local alias_string = alias -- `choice_node` documentation - context.name = context.name or (alias_string .. " comment") -- generate the `name` of the snippet if not defined - context.dscr = context.dscr or (alias_string .. " comment with a signature-mark") -- generate the `dscr` if not defined - context.docstring = context.docstring or (" {1:" .. alias_string .. "}: {3} <{2:mark}>{0} ") -- generate the `docstring` if not defined - local comment_node = todo_snippet_nodes(alias, opts, mark_function) - return s(context, comment_node, opts) -- the final todo-snippet constructed from our parameters -end - ----@param context table: The luasnip context ----@param opts table: The luasnip opts table, needs to have a ctype set ----@param aliases string: All aliases for a name ----@param marks table: Possible marks to account in snipped generation ----@return table: All possible snippets build from the marks -local process_marks = function(context, aliases, opts, marks) - local output = {} - for mark_name, mark_function in pairs(marks) do - local contex_trig_local = context.trig - context.trig = context.trig .. "-" .. mark_name - output[#output + 1] = todo_snippet(context, aliases, opts, mark_function) - context.trig = contex_trig_local - end - return output -end - -local todo_snippet_specs = { - { { trig = "todo" }, { "TODO" }, { ctype = 1 } }, - { { trig = "fix" }, { "FIXME", "ISSUE" }, { ctype = 1 } }, - { { trig = "hack" }, { "HACK" }, { ctype = 1 } }, - { { trig = "warn" }, { "WARNING" }, { ctype = 1 } }, - { { trig = "perf" }, { "PERFORMANCE", "OPTIMIZE" }, { ctype = 1 } }, - { { trig = "note" }, { "NOTE", "INFO" }, { ctype = 1 } }, - - -- NOTE: Block commented todo-comments - { { trig = "todob" }, { "TODO" }, { ctype = 2 } }, - { { trig = "fixb" }, { "FIXME", "ISSUE" }, { ctype = 2 } }, - { { trig = "hackb" }, { "HACK" }, { ctype = 2 } }, - { { trig = "warnb" }, { "WARNING" }, { ctype = 2 } }, - { { trig = "perfb" }, { "PERF", "PERFORMANCE", "OPTIM", "OPTIMIZE" }, { ctype = 2 } }, - { { trig = "noteb" }, { "NOTE", "INFO" }, { ctype = 2 } }, -} - -local todo_comment_snippets = {} -for _, v in ipairs(todo_snippet_specs) do - local snippets = process_marks(v[1], v[2][1], v[3], marks) - for _, value in pairs(snippets) do - table.insert(todo_comment_snippets, value) - end -end - -ls.add_snippets("all", todo_comment_snippets, { type = "snippets", key = "todo_comments" }) - --- }}} diff --git a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/html/html.lua b/modules/home/conf/nvim/plgs/luasnip/lua/snippets/html/html.lua deleted file mode 100644 index 17e1e7fb..00000000 --- a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/html/html.lua +++ /dev/null @@ -1,108 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1)) - end -end - -local line_begin = require("luasnip.extras.expand_conditions").line_begin - -return { - -- HEADER - s( - { - trig = "h([123456])", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmt( - [[ - <h{}>{}</h{}> - ]], - { - f(function(_, snip) - return snip.captures[1] - end), - d(1, get_visual), - f(function(_, snip) - return snip.captures[1] - end), - } - ), - { condition = line_begin } - ), -- PARAGRAPH - s( - { trig = "pp", snippetType = "autosnippet" }, - fmt( - [[ - <p>{}</p> - ]], - { d(1, get_visual) } - ), - { condition = line_begin } - ), -- UNORDERED LIST - s( - { trig = "itt", snippetType = "autosnippet" }, - fmt( - [[ - <ul> - <li>{}</li>{} - </ul> - ]], - { i(1), i(0) } - ), - { condition = line_begin } - ), -- LIST ITEM - s( - { trig = "ii", snippetType = "autosnippet" }, - fmt( - [[ - <li>{}</li> - ]], - { d(1, get_visual) } - ), - { condition = line_begin } - ), - -- DOCUMENT TEMPLATE - s( - { trig = "base" }, - fmt( - [[ - <!doctype HTML> - <html lang="en"> - <head> - <meta charset="UTF-8"> - <title>{}</title> - </head> - <body> - {} - </body> - </html> - ]], - { i(1, "FooBar"), i(0) } - ), - { condition = line_begin } - ), -- ANCHOR TAG - s( - { - trig = "([^%l])aa", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmt( - [[ - {}<a href="{}">{}</a> - ]], - { - f(function(_, snip) - return snip.captures[1] - end), - i(1), - d(2, get_visual), - } - ) - ), -} diff --git a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua b/modules/home/conf/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua deleted file mode 100644 index 22434aa3..00000000 --- a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/tex/delimiter.lua +++ /dev/null @@ -1,34 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end - -local translation_table = { ["("] = ")", ["{"] = "}", ["["] = "]" } - --- Return snippet tables -return { - -- LEFT/RIGHT ALL BRACES - s( - { - trig = "([^%a])l([%(%[%{])", - regTrig = true, - wordTrig = false, - snippetType = "autosnippet", - }, - fmta("<>\\left<><>\\right<>", { - f(function(_, snip) - return snip.captures[1] - end), - f(function(_, snip) - return snip.captures[2] - end), - d(1, get_visual), - f(function(_, snip) - return translation_table[snip.captures[2]] - end), - }) - ), -} diff --git a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/tex/greek.lua b/modules/home/conf/nvim/plgs/luasnip/lua/snippets/tex/greek.lua deleted file mode 100644 index ebf4f9d7..00000000 --- a/modules/home/conf/nvim/plgs/luasnip/lua/snippets/tex/greek.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Return snippet tables -return { - s({ trig = ";a", snippetType = "autosnippet" }, { t("\\alpha") }), - s({ trig = ";b", snippetType = "autosnippet" }, { t("\\beta") }), - s({ trig = ";g", snippetType = "autosnippet" }, { t("\\gamma") }), - s({ trig = ";G", snippetType = "autosnippet" }, { t("\\Gamma") }), - s({ trig = ";d", snippetType = "autosnippet" }, { t("\\delta") }), - s({ trig = ";D", snippetType = "autosnippet" }, { t("\\Delta") }), - s({ trig = ";e", snippetType = "autosnippet" }, { t("\\epsilon") }), - s({ trig = ";ve", snippetType = "autosnippet" }, { t("\\varepsilon") }), - s({ trig = ";z", snippetType = "autosnippet" }, { t("\\zeta") }), - s({ trig = ";h", snippetType = "autosnippet" }, { t("\\eta") }), - s({ trig = ";o", snippetType = "autosnippet" }, { t("\\theta") }), - s({ trig = ";vo", snippetType = "autosnippet" }, { t("\\vartheta") }), - s({ trig = ";O", snippetType = "autosnippet" }, { t("\\Theta") }), - s({ trig = ";k", snippetType = "autosnippet" }, { t("\\kappa") }), - s({ trig = ";l", snippetType = "autosnippet" }, { t("\\lambda") }), - s({ trig = ";L", snippetType = "autosnippet" }, { t("\\Lambda") }), - s({ trig = ";m", snippetType = "autosnippet" }, { t("\\mu") }), - s({ trig = ";n", snippetType = "autosnippet" }, { t("\\nu") }), - s({ trig = ";x", snippetType = "autosnippet" }, { t("\\xi") }), - s({ trig = ";X", snippetType = "autosnippet" }, { t("\\Xi") }), - s({ trig = ";i", snippetType = "autosnippet" }, { t("\\pi") }), - s({ trig = ";I", snippetType = "autosnippet" }, { t("\\Pi") }), - s({ trig = ";r", snippetType = "autosnippet" }, { t("\\rho") }), - s({ trig = ";s", snippetType = "autosnippet" }, { t("\\sigma") }), - s({ trig = ";S", snippetType = "autosnippet" }, { t("\\Sigma") }), - s({ trig = ";t", snippetType = "autosnippet" }, { t("\\tau") }), - s({ trig = ";f", snippetType = "autosnippet" }, { t("\\phi") }), - s({ trig = ";vf", snippetType = "autosnippet" }, { t("\\varphi") }), - s({ trig = ";F", snippetType = "autosnippet" }, { t("\\Phi") }), - s({ trig = ";c", snippetType = "autosnippet" }, { t("\\chi") }), - s({ trig = ";p", snippetType = "autosnippet" }, { t("\\psi") }), - s({ trig = ";P", snippetType = "autosnippet" }, { t("\\Psi") }), - s({ trig = ";w", snippetType = "autosnippet" }, { t("\\omega") }), - s({ trig = ";W", snippetType = "autosnippet" }, { t("\\Omega") }), -} diff --git a/modules/home/conf/nvim/plgs/neorg/default.nix b/modules/home/conf/nvim/plgs/neorg/default.nix deleted file mode 100644 index 7d61ce09..00000000 --- a/modules/home/conf/nvim/plgs/neorg/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{pkgsStable, ...}: { - programs.nixvim.plugins.neorg = { - package = pkgsStable.vimPlugins.neorg; - enable = true; - lazyLoading = true; - - modules = { - "core.defaults" = { - __empty = null; - }; - "core.esupports.metagen".config = { - type = "auto"; - }; - "core.journal".config = { - workspace = "journal"; - }; - "core.keybinds".config = { - hook = { - __raw = '' - function(keybinds) - -- remap the looking glas to the same key, femaco is also mapped to. - keybinds.remap_event("norg", "n", "<space>cc", "core.looking-glass.magnify-code-block") - - keybinds.remap_event("norg", "n", "<C-s>", "core.integrations.telescope.find_linkable") - keybinds.remap_event("norg", "i", "<C-i>", "core.integrations.telescope.insert_link") - end, - ''; - }; - }; - "core.completion".config = { - engine = "nvim-cmp"; - }; - "core.concealer".config = { - __empty = null; - }; - "core.dirman".config = { - workspaces = { - general = "~/repos/notes/general"; - journal = "~/repos/notes/journal"; - projects = "~/repos/notes/projects"; - }; - }; - "core.export".config = { - __empty = null; - }; - "core.integrations.telescope".config = { - __empty = null; - }; - - # TODO: Add this when the nvim version in nixpkgs is >= 0.10 <2023-08-29> - # - # "core.ui.calendar".config = { - # __empty = null; - # }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/nvim-cmp/default.nix b/modules/home/conf/nvim/plgs/nvim-cmp/default.nix deleted file mode 100644 index ed0e57c3..00000000 --- a/modules/home/conf/nvim/plgs/nvim-cmp/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{config, ...}: { - programs.nixvim.plugins.cmp = let - neorg_source = - if config.programs.nixvim.plugins.neorg.modules."core.completion".config.engine == "nvim-cmp" - then [{name = "neorg";}] - else []; - in { - /* - TODO: integrate this: - ```lua - enabled = { - function() - -- disable completion in comments - local context = require 'cmp.config.context' - -- keep command mode completion enabled when cursor is in a comment - -- te - if vim.api.nvim_get_mode().mode == 'c' then - return true - else - return not context.in_treesitter_capture("comment") - and not context.in_syntax_group("Comment") - end - end - }, - ``` - */ - enable = true; - autoEnableSources = true; - settings = { - mapping = { - # TODO: add support for desc and which key here - "<C-d>" = "cmp.mapping.scroll_docs(-4)"; # desc = "Scroll up by four lines" - "<C-f>" = "cmp.mapping.scroll_docs(4)"; # desc = "Scroll down by four lines" - "HH" = "cmp.mapping.complete()"; # desc = "Confirm snipped" - }; - - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; - - sources = - [ - {name = "nvim_lsp";} - {name = "luasnip";} - {name = "path";} - {name = "git";} # TODO: I might want to add config to allow all issues/prs <2023-10-16> - # {name = "convertionalcommits";} # TODO: Useless without commitlint [https://commitlint.js.org/] <2023-10-16> - # {name = "rg";} # TODO: This might really RIP-grep my system <2023-10-16> - # {name = "buffer";} - # {name = "digraphs";} - {name = "calc";} - ] - ++ neorg_source; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/nvim-lint/default.nix b/modules/home/conf/nvim/plgs/nvim-lint/default.nix deleted file mode 100644 index f5cb9acf..00000000 --- a/modules/home/conf/nvim/plgs/nvim-lint/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package nvim-lint though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/nvim-lint.lua} - ''; - extraPlugins = [ - pkgs.vimPlugins.nvim-lint - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/nvim-lint/lua/nvim-lint.lua b/modules/home/conf/nvim/plgs/nvim-lint/lua/nvim-lint.lua deleted file mode 100644 index 4ed49f7b..00000000 --- a/modules/home/conf/nvim/plgs/nvim-lint/lua/nvim-lint.lua +++ /dev/null @@ -1,20 +0,0 @@ -require("lint").linters_by_ft = { - -- text - markdown = {}, - -- tex = {'chktex'}, -- maybe add some text linters ? - - -- shell (already covered by the bash language sever) - -- sh = { "shellcheck"; }; - -- bash = { "shellcheck"; }; - -- zsh = { "shellcheck"; }; - -- dash = { "shellcheck"; }; - - yaml = { "yamllint" }, - nix = { "nix", "statix" }, -} - -vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, { - callback = function() - require("lint").try_lint() - end, -}) diff --git a/modules/home/conf/nvim/plgs/raw_plugins/default.nix b/modules/home/conf/nvim/plgs/raw_plugins/default.nix deleted file mode 100644 index 941cb7cb..00000000 --- a/modules/home/conf/nvim/plgs/raw_plugins/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{...}: { - programs.nixvim = { - # Not all plugins have own modules - # You can add missing plugins here - # `pkgs.vimExtraPlugins` is added by the overlay you added at the beginning - # For a list of available plugins, look here: - # https://github.com/jooooscha/nixpkgs-vim-extra-plugins/blob/main/plugins.md - extraPlugins = [ - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/default.nix b/modules/home/conf/nvim/plgs/telescope/default.nix deleted file mode 100644 index c32e139c..00000000 --- a/modules/home/conf/nvim/plgs/telescope/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{...}: { - imports = [ - ./defaults - ./keymaps - ./extensions - ]; - programs.nixvim.plugins = { - telescope = { - enable = true; - }; - - # This is a dependency of telescope - web-devicons = { - enable = true; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/defaults/default.nix b/modules/home/conf/nvim/plgs/telescope/defaults/default.nix deleted file mode 100644 index 933089ef..00000000 --- a/modules/home/conf/nvim/plgs/telescope/defaults/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.settings.defaults = { - mappings = let - insert_and_normal_mappings = { - # map actions.which_key to <c-h> (default: <c-/>) - # actions.which_key shows the mappings for your picker, - # e.g. git_{create, delete, ...}_branch for the git_branches picker - "<C-h>" = "which_key"; - }; - in { - i = - insert_and_normal_mappings; - n = - { - "t" = "move_selection_next"; - "n" = "move_selection_previous"; - "<Space>" = "toggle_all"; - - "<C-d>" = "preview_scrolling_up"; - "<C-u>" = "preview_scrolling_down"; - "<Left>" = "preview_scrolling_left"; - "<Right>" = "preview_scrolling_right"; - - "<Esc>" = "close"; - "q" = "close"; - } - // insert_and_normal_mappings; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/bibtex/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/bibtex/default.nix deleted file mode 100644 index 6f3cc2ea..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/bibtex/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - # WARNING: This is only activated in tex files via the ftplugin. - programs.nixvim = { - extraPlugins = [ - pkgs.vimExtraPlugins.telescope-bibtex-nvim - ]; - keymaps = [ - { - key = "<space>ib"; - # This is registered in the ftplugin file, so we set this to null here - action = "<Nop>"; - mode = "n"; - options.desc = "[i]nsert a [b]atex citation"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/default.nix deleted file mode 100644 index 0b1e033a..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - imports = [ - ./bibtex - ./frecency - ./fzy-native - ./rooter - ./symbols - ]; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix deleted file mode 100644 index 0e007b80..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/frecency/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{...}: { - programs.nixvim = { - keymaps = [ - { - key = "gff"; - mode = "n"; - action.__raw = "function() require('telescope').extensions.frecency.frecency() end"; - options.desc = "activate the frecency file selection"; - } - ]; - plugins.telescope = { - extensions.frecency = { - enable = true; - settings = { - show_scores = true; - db_safe_mode = false; - default_workspace = "CWD"; # or 'LSP' - }; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix deleted file mode 100644 index ce0bdccc..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/fzy-native/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.extensions.fzy-native = { - enable = true; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/rooter/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/rooter/default.nix deleted file mode 100644 index 779448cc..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/rooter/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/rooter.lua} - ''; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua b/modules/home/conf/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua deleted file mode 100644 index 7235c5a3..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/rooter/lua/rooter.lua +++ /dev/null @@ -1,84 +0,0 @@ --- Taken from: https://github.com/desdic/telescope-rooter.nvim/blob/69423216c75a5f1f1477bbf8faf6b0dc8af04099/lua/telescope/_extensions/rooter.lua -local has_telescope, telescope = pcall(require, "telescope") -if not has_telescope then - error("This extension requires telescope.nvim") - return -end - -local has_plenary, plenary = pcall(require, "plenary") -if not has_plenary then - error("This extension requires plenary") - return -end - -local log = plenary.log.new({ plugin = "telescope_rooter", level = "info" }) - --- TODO: expose this function -local toggle = function(_) - vim.g["Telescope#rooter#enabled"] = not vim.g["Telescope#rooter#enabled"] - print("Telescope#rooter#enabled=" .. vim.inspect(vim.g["Telescope#rooter#enabled"])) -end - -local config = { patterns = { ".git" }, enable = true, debug = false } - --- default enabled -vim.g["Telescope#rooter#enabled"] = vim.F.if_nil(config.enable, true) - --- redefine log if debug enabled -if vim.F.if_nil(config.debug, false) then - log = plenary.log.new({ plugin = "telescope_rooter", level = "debug" }) -end - -local group = vim.api.nvim_create_augroup("TelescopeRooter", { clear = true }) - -vim.api.nvim_create_autocmd({ "DirChangedPre" }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - if vim.g["Telescope#rooter#oldpwd"] == nil then - vim.g["Telescope#rooter#oldpwd"] = vim.loop.cwd() - log.debug("before " .. vim.inspect(vim.loop.cwd())) - end - end, - group = group, -}) - -vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - vim.schedule(function() - if vim.bo.filetype == "TelescopePrompt" then - local rootdir = vim.fs.dirname(vim.fs.find(config.patterns, { upward = true })[1]) - if rootdir ~= nil then - vim.api.nvim_set_current_dir(rootdir) - log.debug("changing dir to " .. rootdir) - end - end - end) - end, - group = group, -}) - -vim.api.nvim_create_autocmd({ "BufWinLeave" }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - vim.schedule(function() - if vim.bo.filetype ~= "TelescopePrompt" then - if vim.g["Telescope#rooter#oldpwd"] ~= nil then - log.debug("restoring " .. vim.g["Telescope#rooter#oldpwd"]) - vim.api.nvim_set_current_dir(vim.g["Telescope#rooter#oldpwd"]) - vim.g["Telescope#rooter#oldpwd"] = nil - end - end - end) - end, - group = group, -}) diff --git a/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix b/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix deleted file mode 100644 index 05b4a4f2..00000000 --- a/modules/home/conf/nvim/plgs/telescope/extensions/symbols/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraPlugins = [ - # Source of symbols for telescope symbols - pkgs.vimPlugins.telescope-symbols-nvim - ]; - keymaps = [ - { - key = "<space>il"; - mode = "n"; - action.__raw = '' - function() - require('telescope.builtin').symbols{ sources = { - 'latex' - }} - end - ''; - options.desc = "[i]nsert a [l]atex symbol"; - } - { - key = "<space>ie"; - mode = "n"; - action.__raw = '' - function() - require('telescope.builtin').symbols{ sources = { - 'emoji', - }} - end - ''; - options.desc = "[i]nsert a [e]moji"; - } - { - key = "<space>is"; - mode = "n"; - action.__raw = '' - function() - require('telescope.builtin').symbols{ sources = { - 'emoji', - 'gitmoji', - 'julia', - 'kaomoji', - 'latex', - 'math', - 'nerd', - }} - end - ''; - options.desc = "[i]nsert a [s]ymbol (like emojis)"; - } - ]; - }; -} diff --git a/modules/home/conf/nvim/plgs/telescope/keymaps/default.nix b/modules/home/conf/nvim/plgs/telescope/keymaps/default.nix deleted file mode 100644 index e551cc5a..00000000 --- a/modules/home/conf/nvim/plgs/telescope/keymaps/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.keymaps = { - "<space>rg" = { - action = "live_grep"; - options = { - desc = "[rg] in a live session"; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/todo-comments/default.nix b/modules/home/conf/nvim/plgs/todo-comments/default.nix deleted file mode 100644 index e33f961b..00000000 --- a/modules/home/conf/nvim/plgs/todo-comments/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{...}: { - programs.nixvim.plugins.todo-comments = { - enable = true; - settings = { - guiStyle = { - fg = "BOLD"; - bg = "NONE"; - }; - highlight = { - keyword = "wide_fg"; - }; - keywords = { - /* - # Defaults: - FIX = { - icon = " "; # Icon used for the sign, and in search results. - color = "error"; # Can be a hex color, or a named color. - alt = ["FIXME" "BUG" "FIXIT" "ISSUE"]; # A set of other keywords that all map to this FIX keywords. - }; - TODO = { - icon = " "; - color = "info"; - }; - HACK = { - icon = " "; - color = "warning"; - }; - WARN = { - icon = " "; - color = "warning"; - alt = ["WARNING" "XXX"]; - }; - PERF = { - icon = " "; - alt = ["OPTIM" "PERFORMANCE" "OPTIMIZE"]; - }; - NOTE = { - icon = " "; - color = "hint"; - alt = ["INFO"]; - }; - TEST = { - icon = "⏲ "; - color = "test"; - alt = ["TESTING" "PASSED" "FAILED"]; - }; - */ - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/treesitter/default.nix b/modules/home/conf/nvim/plgs/treesitter/default.nix deleted file mode 100644 index b4b20388..00000000 --- a/modules/home/conf/nvim/plgs/treesitter/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: { - programs.nixvim = { - plugins.treesitter = { - enable = true; - - # NOTE: These are required to build grammars, but I already use the nix grammars <2024-07-13> - gccPackage = null; - nodejsPackage = null; - treesitterPackage = null; - - # inject nixvim specific highlighting (eg in extraConfigLua). - nixvimInjections = true; - - nixGrammars = true; - grammarPackages = - config.programs.nixvim.plugins.treesitter.package.passthru.allGrammars - ++ [pkgs.tree-sitter-yts]; - - settings = { - auto_install = false; - ensureInstalled = "all"; - indent.enable = true; - disabledLanguages = []; - - highlight = { - enable = true; - disable = []; - - # Setting this to true will run `:h syntax` and tree-sitter at the same time. - # Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - # Using this option may slow down your editor; and you may see some duplicate highlights. - # Instead of true it can also be a list of languages - additionalVimRegexHighlighting = ["latex"]; - }; - - incrementalSelection = { - enable = true; - keymaps = { - # TODO: include these in the which-key description - initSelection = "gnn"; # set to `false` to disable one of the mappings - nodeIncremental = "grn"; - scopeIncremental = "grc"; - nodeDecremental = "grm"; - }; - }; - }; - }; - extraFiles = { - "queries/yts/highlights.scm".text = '' - ${lib.strings.fileContents "${pkgs.tree-sitter-yts}/queries/highlights.scm"} - ''; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/vim-tex/default.nix b/modules/home/conf/nvim/plgs/vim-tex/default.nix deleted file mode 100644 index 0b92c429..00000000 --- a/modules/home/conf/nvim/plgs/vim-tex/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -{...}: { - programs.nixvim = { - opts.conceallevel = 0; - - plugins.vimtex = { - enable = true; - settings = { - view_method = "zathura"; - quickfix_mode = -1; - view_enabled = -1; - tex_conceal = "abdmg"; - tex_flavor = "latex"; - - # Useful if treesitter is the highlighter - syntax_enabled = 0; - syntax_conceal_disable = 1; - - mappings_disable = { - n = [ - "ts$" - "tsD" - "tsb" - "tsc" - "tsd" - "tse" - "tsf" - ]; - x = [ - "tsD" - "tsd" - "tsf" - ]; - }; - - toc_config = { - name = "TOC"; - layers = ["content" "todo" "include"]; - resize = false; - split_width = 49; - todo_sorted = -1; - show_help = false; - show_numbers = false; - mode = true; - layer_keys = { - content = "C"; - label = "L"; - todo = "j"; - include = "I"; - }; - }; - - compiler_latexmk = { - build_dir = "build"; - callback = false; - continuous = true; - executable = "latexmk"; - hooks = []; - options = [ - "-verbose" - "-file-line-error" - "-synctex=0" - "-interaction=nonstopmode" - "-outdir=build" - ]; - }; - }; - }; - }; -} diff --git a/modules/home/conf/nvim/plgs/which-key/default.nix b/modules/home/conf/nvim/plgs/which-key/default.nix deleted file mode 100644 index be63f7ac..00000000 --- a/modules/home/conf/nvim/plgs/which-key/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.which-key = { - enable = true; - }; -} |