diff --git a/nixos/nvim/default.nix b/nixos/nvim/default.nix index 894f46d..9b1c5a7 100644 --- a/nixos/nvim/default.nix +++ b/nixos/nvim/default.nix @@ -3,6 +3,7 @@ ./keymaps.nix ./settings.nix + ./plugins/autoclose.nix ./plugins/cmp.nix ./plugins/conform.nix ./plugins/dashboard.nix @@ -10,9 +11,11 @@ ./plugins/lazygit.nix ./plugins/lsp.nix ./plugins/lualine.nix - ./plugins/neo-tree.nix - #./plugins/rooter.nix + ./plugins/oil.nix + ./plugins/profile.nix + ./plugins/rooter.nix ./plugins/snacks.nix ./plugins/telescope.nix + ./plugins/treesitter.nix ]; } diff --git a/nixos/nvim/keymaps.nix b/nixos/nvim/keymaps.nix index 3e063a2..4570e9c 100644 --- a/nixos/nvim/keymaps.nix +++ b/nixos/nvim/keymaps.nix @@ -1,5 +1,9 @@ { programs.nixvim = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; keymaps = [ { mode = "n"; # Normal mode @@ -7,6 +11,42 @@ action = ""; options.silent = true; } + { + mode = "n"; + key = ""; + action = "h"; + options = { + desc = "Move Left"; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action = "j"; + options = { + desc = "Move Down"; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action = "k"; + options = { + desc = "Move Up"; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action = "l"; + options = { + desc = "Move Right"; + silent = true; + }; + } { mode = "n"; key = ""; @@ -31,22 +71,45 @@ action = ":w"; options = { desc = "Save Buffer to File"; - silent = true; + silent = false; }; } { mode = "n"; key = "q"; + action = ":bd"; + options = { + desc = "Close Buffer"; + silent = false; + }; + } + { + mode = "n"; + key = "Q"; + action = ":bd!"; + options = { + desc = "Force Close Buffer"; + silent = false; + }; + } + { + mode = "n"; + key = "`"; action = ":qa"; options = { desc = "Quit All"; silent = false; }; } + { + mode = "t"; + key = ""; + action = ""; + options = { + desc = "Exit Terminal Mode"; # why does Neovim not have this by default??? wtf??? + silent = true; + }; + } ]; - globals = { - mapleader = " "; - maplocalleader = " "; - }; }; } diff --git a/nixos/nvim/plugins/autoclose.nix b/nixos/nvim/plugins/autoclose.nix new file mode 100644 index 0000000..585b637 --- /dev/null +++ b/nixos/nvim/plugins/autoclose.nix @@ -0,0 +1,10 @@ +{ + programs.nixvim = { + plugins = { + nvim-autopairs = { + enable = true; + settings = { }; + }; + }; + }; +} diff --git a/nixos/nvim/plugins/cmp.nix b/nixos/nvim/plugins/cmp.nix index 9b233d1..21c21c4 100644 --- a/nixos/nvim/plugins/cmp.nix +++ b/nixos/nvim/plugins/cmp.nix @@ -14,7 +14,7 @@ "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.close()"; "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping.confirm({ select = false })"; "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; }; diff --git a/nixos/nvim/plugins/conform.nix b/nixos/nvim/plugins/conform.nix index d4fdfcf..c5771b2 100644 --- a/nixos/nvim/plugins/conform.nix +++ b/nixos/nvim/plugins/conform.nix @@ -47,94 +47,121 @@ "trim_whitespace" "trim_newlines" ]; - format_on_save = # Lua - '' - function(bufnr) - if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then - return - end - - if slow_format_filetypes[vim.bo[bufnr].filetype] then - return - end - - local function on_format(err) - if err and err:match("timeout$") then - slow_format_filetypes[vim.bo[bufnr].filetype] = true - end - end - - return { timeout_ms = 200, lsp_fallback = true }, on_format - end - ''; - format_after_save = # Lua - '' - function(bufnr) - if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then - return - end - - if not slow_format_filetypes[vim.bo[bufnr].filetype] then - return - end - - return { lsp_fallback = true } - end - ''; - log_level = "warn"; - notify_on_error = true; - notify_no_formatters = true; - default_format_opts = { - lsp_format = "fallback"; - timeout_ms = 300; + }; + log_level = "warn"; + notify_on_error = true; + notify_no_formatters = true; + default_format_opts = { + lsp_format = "fallback"; + timeout_ms = 300; + }; + formatters = { + shellcheck = { + command = lib.getExe pkgs.shellcheck; }; - formatters = { - shellcheck = { - command = lib.getExe pkgs.shellcheck; - }; - shfmt = { - command = lib.getExe pkgs.shfmt; - }; - shellharden = { - command = lib.getExe pkgs.shellharden; - }; - nixfmt = { - command = lib.getExe pkgs.nixfmt-rfc-style; - }; - stylua = { - command = lib.getExe pkgs.stylua; - }; - clang-format = { - command = "${pkgs.clang-tools}/bin/clang-format"; - }; - csharpier = { - command = lib.getExe pkgs.csharpier; - }; - ruff_fix = { - command = lib.getExe pkgs.ruff; - }; - ruff_format = { - command = lib.getExe pkgs.ruff; - }; - ruff_organize_imports = { - command = lib.getExe pkgs.ruff; - }; + shfmt = { + command = lib.getExe pkgs.shfmt; + }; + shellharden = { + command = lib.getExe pkgs.shellharden; + }; + nixfmt = { + command = lib.getExe pkgs.nixfmt-rfc-style; + }; + stylua = { + command = lib.getExe pkgs.stylua; + }; + clang-format = { + command = "${pkgs.clang-tools}/bin/clang-format"; + }; + csharpier = { + command = lib.getExe pkgs.csharpier; + }; + ruff_fix = { + command = lib.getExe pkgs.ruff; + }; + ruff_format = { + command = lib.getExe pkgs.ruff; + }; + ruff_organize_imports = { + command = lib.getExe pkgs.ruff; }; }; + format_on_save = # lua + '' + function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + + if slow_format_filetypes[vim.bo[bufnr].filetype] then + return + end + + local function on_format(err) + if err and err:match("timeout$") then + slow_format_filetypes[vim.bo[bufnr].filetype] = true + end + end + + return { timeout_ms = 200, lsp_fallback = true }, on_format + end + ''; + format_after_save = # lua + '' + function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + + if not slow_format_filetypes[vim.bo[bufnr].filetype] then + return + end + + return { lsp_fallback = true } + end + ''; }; - luaConfig.post = '' - vim.api.nvim_create_user_command("Format", function(args) - local range = nil - if args.count ~= -1 then - local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] - range = { - start = { args.line1, 0 }, - ["end"] = { args.line2, end_line:len() }, - } - end - require("conform").format({ async = true, lsp_format = "fallback", range = range }) - end, { range = true }) - ''; + luaConfig.post = # lua + '' + slow_format_filetypes = {} -- Filetypes that are slow to format, and should be formatted after saving a buffer instead of before + require("conform").formatters.injected = { + options = { + lang_to_ext = { + c = "c", + cpp = "cpp", + cs = "cs", + csharp = "cs", + lua = "lua", + nix = "nix", + python = "py", + bash = "sh", + javascript = "js", + javascriptreact = "jsx", + typescript = "ts", + typescriptreact = "tsx", + markdown = "md", + yaml = "yaml", + json = "json", + svelte = "svelte", + html = "html", + css = "css", + graphql = "graphql", + }, + }, + } + vim.api.nvim_create_user_command("Format", function(args) + local range = nil + if args.count ~= -1 then + local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] + range = { + start = { args.line1, 0 }, + ["end"] = { args.line2, end_line:len() }, + } + end + require("conform").format({ async = true, lsp_format = "fallback", range = range }) + end, { range = true }) + ''; }; }; keymaps = [ diff --git a/nixos/nvim/plugins/devcontainer.nix b/nixos/nvim/plugins/devcontainer.nix index 89710db..efc1695 100644 --- a/nixos/nvim/plugins/devcontainer.nix +++ b/nixos/nvim/plugins/devcontainer.nix @@ -5,7 +5,7 @@ extraPlugins = [ (pkgs.vimUtils.buildVimPlugin { # https://codeberg.org/esensar/nvim-dev-container - name = "nvim-dev-container"; + name = "devcontainer"; src = pkgs.fetchgit { url = "https://codeberg.org/esensar/nvim-dev-container"; rev = "ba9666bdaec23cfe8087c0b6bb0a15c93ec8ba87"; @@ -16,5 +16,79 @@ extraConfigLua = '' require("devcontainer").setup({}) ''; + keymaps = [ + { + mode = "n"; + key = "d"; + action = ""; + options = { + desc = "Manage Dev Container"; + silent = true; + }; + } + { + mode = "n"; + key = "ds"; + action = ":DevcontainerStart"; + options = { + desc = "Start Dev Container"; + silent = false; + }; + } + { + mode = "n"; + key = "dc"; + action = ":DevcontainerStopAll"; + options = { + desc = "Stop Dev Container"; + silent = false; + }; + } + { + mode = "n"; + key = "dr"; + action = ":DevcontainerRemoveAll"; + options = { + desc = "Remove Dev Container"; + silent = false; + }; + } + { + mode = "n"; + key = "da"; + action = ":DevcontainerAttach"; + options = { + desc = "Attach to Dev Container"; + silent = false; + }; + } + { + mode = "n"; + key = "de"; + action = ":DevcontainerExec "; + options = { + desc = "Execute Command in Dev Container"; + silent = false; + }; + } + { + mode = "n"; + key = "dl"; + action = ":DevcontainerLogs"; + options = { + desc = "Open Dev Container Logs"; + silent = true; + }; + } + { + mode = "n"; + key = "dz"; + action = ":DevcontainerEditNearestConfig"; + options = { + desc = "Edit Nearest devcontainer.json"; + silent = false; + }; + } + ]; }; } diff --git a/nixos/nvim/plugins/lsp.nix b/nixos/nvim/plugins/lsp.nix index 9568ece..80c7900 100644 --- a/nixos/nvim/plugins/lsp.nix +++ b/nixos/nvim/plugins/lsp.nix @@ -9,37 +9,41 @@ (callPackage ../../../packages/luau-lsp.nix { inherit pkgs; }) ]; plugins = { + lsp-status = { + enable = true; + }; lsp = { enable = true; - postConfig = '' - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }), - callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - if client == nil then - return - end - if client.name == 'ruff' then - -- Disable hover in favor of Pyright - client.server_capabilities.hoverProvider = false - end - end, - desc = 'LSP: Disable hover capability from Ruff', - }) - require('lspconfig').basedpyright.setup { settings = { pyright = { disableOrganizeImports = true } } } - require('lspconfig').ruff.setup { } - require('lspconfig').nil_ls.setup { - cmd = { "${pkgs.nil}/bin/nil" }, - settings = { - ['nil'] = { - formatting = { - command = { "${pkgs.nixfmt-rfc-style}/bin/nixfmt" }, + postConfig = # lua + '' + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup('lsp_attach_disable_ruff_hover', { clear = true }), + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client == nil then + return + end + if client.name == 'ruff' then + -- Disable hover in favor of Pyright + client.server_capabilities.hoverProvider = false + end + end, + desc = 'LSP: Disable hover capability from Ruff', + }) + require('lspconfig').basedpyright.setup { settings = { pyright = { disableOrganizeImports = true } } } + require('lspconfig').ruff.setup { } + require('lspconfig').nil_ls.setup { + cmd = { "${pkgs.nil}/bin/nil" }, + settings = { + ['nil'] = { + formatting = { + command = { "${pkgs.nixfmt-rfc-style}/bin/nixfmt" }, + }, }, }, - }, - } - --require('luau-lsp').setup { } - ''; + } + --require('luau-lsp').setup { } + ''; }; trouble = { enable = true; diff --git a/nixos/nvim/plugins/lualine.nix b/nixos/nvim/plugins/lualine.nix index ed952f8..1029b57 100644 --- a/nixos/nvim/plugins/lualine.nix +++ b/nixos/nvim/plugins/lualine.nix @@ -1,8 +1,111 @@ +{ pkgs, ... }: { programs.nixvim = { plugins.lualine = { enable = true; - settings = { }; + autoLoad = true; + settings = { + options = { + globalstatus = true; + ignore_focus = [ + "neo-tree" + "nvim-tree" + "mini-files" + "TelescopePrompt" + ]; + }; + sections = { + lualine_a = [ + "mode" + ]; + lualine_b = [ + "branch" + ]; + lualine_c = [ + "filename" + "diff" + ]; + lualine_x = [ + "diagnostics" + { + __unkeyed-1 = { + __raw = '' + function() + local msg = "" + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end + ''; + }; + color = { + fg = "#ffffff"; + }; + icon = ""; + } + "encoding" + "fileformat" + "filetype" + ]; + lualine_y = [ + { + __unkeyed-1 = "aerial"; + colored = true; + cond = { + __raw = '' + function() + local buf_size_limit = 1024 * 1024 + if vim.api.nvim_buf_get_offset(0, vim.api.nvim_buf_line_count(0)) > buf_size_limit then + return false + end + + return true + end + ''; + }; + dense = false; + dense_sep = "."; + depth = { + __raw = "nil"; + }; + sep = " ) "; + } + ]; + lualine_z = [ + { + __unkeyed-1 = "location"; + } + ]; + }; + tabline = { + lualine_a = [ + { + __unkeyed-1 = "buffers"; + symbols = { + alternate_file = ""; + }; + disabled_filetypes = [ + "TelescopePrompt" + ]; + } + ]; + lualine_z = [ + "tabs" + ]; + }; + }; }; + extraPlugins = with pkgs.vimPlugins; [ + copilot-lualine + ]; }; } diff --git a/nixos/nvim/plugins/lz-n.nix b/nixos/nvim/plugins/lz-n.nix new file mode 100644 index 0000000..a97421b --- /dev/null +++ b/nixos/nvim/plugins/lz-n.nix @@ -0,0 +1,9 @@ +{ + programs.nixvim = { + plugins = { + lz-n = { + enable = true; + }; + }; + }; +} diff --git a/nixos/nvim/plugins/neo-tree.nix b/nixos/nvim/plugins/neo-tree.nix deleted file mode 100644 index 322e242..0000000 --- a/nixos/nvim/plugins/neo-tree.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - programs.nixvim = { - plugins.neo-tree = { - enable = true; - enableGitStatus = true; - }; - keymaps = [ - { - mode = "n"; - key = "e"; - action = ":Neotree toggle"; - options = { - desc = "Toggle Neotree"; - silent = true; - }; - } - ]; - }; -} diff --git a/nixos/nvim/plugins/oil.nix b/nixos/nvim/plugins/oil.nix new file mode 100644 index 0000000..e4e6f7e --- /dev/null +++ b/nixos/nvim/plugins/oil.nix @@ -0,0 +1,23 @@ +{ + programs.nixvim = { + plugins = { + oil = { + enable = true; + settings = { + default_file_explorer = false; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "o"; + action = "Oil --float"; + options = { + desc = "Manage Files"; + silent = true; + }; + } + ]; + }; +} diff --git a/nixos/nvim/plugins/profile.nix b/nixos/nvim/plugins/profile.nix new file mode 100644 index 0000000..cfa70aa --- /dev/null +++ b/nixos/nvim/plugins/profile.nix @@ -0,0 +1,63 @@ +{ pkgs, ... }: +{ + programs.nixvim = { + extraPlugins = [ + (pkgs.vimUtils.buildVimPlugin { + # https://github.com/stevearc/profile.nvim + name = "profile"; + src = pkgs.fetchFromGitHub { + owner = "stevearc"; + repo = "profile.nvim"; + rev = "f2d2cf5eae9ba3b9ca6bc148507d153f3e6ae282"; + sha256 = "sha256-xnScKSrlm1N3cw+hPmUd97b1gjue7FG+1f9genzw5yM="; + }; + }) + ]; + extraConfigLuaPre = # lua + '' + local should_profile = os.getenv("NVIM_PROFILE") + if should_profile then + require("profile").instrument_autocmds() + if should_profile:lower():match("^start") then + require("profile").start("*") + else + require("profile").instrument("*") + end + end + + local function toggle_profile() + local prof = require("profile") + if prof.is_recording() then + prof.stop() + vim.ui.input({ prompt = "Save profile to:", completion = "file", default = "profile.json" }, function(filename) + if filename then + prof.export(filename) + vim.notify(string.format("Wrote %s", filename)) + end + end) + else + vim.ui.select({ "yes", "no" }, { prompt = "Would you like to start profiling?", format_item = function(item) + return item + end, + }, function(choice) + if choice == "yes" then + prof.start("*") + end + end) + end + end + vim.keymap.set("", "p", toggle_profile, { desc = "Toggle Profiling", silent = true }) + ''; + # keymaps = [ + # { + # mode = "n"; + # key = "p"; + # action = "toggle_profile"; + # options = { + # desc = "Toggle Profiling"; + # silent = true; + # }; + # } + # ]; + }; +} diff --git a/nixos/nvim/plugins/rooter.nix b/nixos/nvim/plugins/rooter.nix index 5639487..e2a592b 100644 --- a/nixos/nvim/plugins/rooter.nix +++ b/nixos/nvim/plugins/rooter.nix @@ -2,19 +2,10 @@ { programs.nixvim = { extraPlugins = [ - (pkgs.vimUtils.buildVimPlugin { - # https://codeberg.org/esensar/nvim-dev-container - name = "vim-rooter"; - src = pkgs.fetchFromGitHub { - owner = "airblade"; - repo = "vim-rooter"; - rev = "51402fb77c4d6ae94994e37dc7ca13bec8f4afcc"; - sha256 = "sha256-JrpYcQ/mJQQUvDdsYlaaep6J6/irDIrCAb8W49JHqzk="; - }; - }) + pkgs.vimPlugins.vim-rooter ]; - extraConfigLua = '' - require("vim-rooter").setup({}) - ''; + globals = { + rooter_patterns = [ ".git" ]; + }; }; } diff --git a/nixos/nvim/plugins/telescope.nix b/nixos/nvim/plugins/telescope.nix index 6a30fd3..7aadb01 100644 --- a/nixos/nvim/plugins/telescope.nix +++ b/nixos/nvim/plugins/telescope.nix @@ -2,15 +2,24 @@ { programs.nixvim = { extraPackages = with pkgs; [ + ripgrep fd plocate glow ]; plugins = { + aerial.enable = true; + neoclip.enable = true; telescope = { enable = true; extensions = { fzf-native.enable = true; + file-browser = { + enable = true; + settings = { + hijack_netrw = false; + }; + }; }; enabledExtensions = [ "repo" @@ -26,7 +35,7 @@ }; extraPlugins = [ (pkgs.vimUtils.buildVimPlugin { - # https://codeberg.org/esensar/nvim-dev-container + # https://github.com/cljoly/telescope-repo.nvim name = "telescope-repo.nvim"; src = pkgs.fetchFromGitHub { owner = "cljoly"; @@ -36,6 +45,43 @@ }; }) ]; + # https://github.com/nvim-telescope/telescope.nvim/issues/2806#issuecomment-1904877188 + autoGroups.find_files_hijack_netrw.clear = true; + autoCmd = [ + { + event = "VimEnter"; + pattern = "*"; + once = true; + callback.__raw = # lua + '' + function() + pcall(vim.api.nvim_clear_autocmds, { group = "FileExplorer" }) + end + ''; + } + { + event = "BufEnter"; + group = "find_files_hijack_netrw"; + pattern = "*"; + callback.__raw = # lua + '' + function() + vim.schedule(function() + -- Early return if netrw or not a directory + if vim.bo[0].filetype == "netrw" or vim.fn.isdirectory(vim.fn.expand("%:p")) == 0 then + return + end + + vim.api.nvim_buf_set_option(0, "bufhidden", "wipe") + + require("telescope.builtin").find_files({ + cwd = vim.fn.expand("%:p:h"), + }) + end) + end + ''; + } + ]; keymaps = [ { mode = "n"; @@ -55,6 +101,15 @@ silent = true; }; } + { + mode = "n"; + key = "te"; + action = ":Telescope file_browser"; + options = { + desc = "File Explorer"; + silent = true; + }; + } { mode = "n"; key = "tg"; @@ -64,6 +119,15 @@ silent = true; }; } + { + mode = "n"; + key = "ta"; + action = ":Telescope aerial"; + options = { + desc = "Aerial"; + silent = true; + }; + } { mode = "n"; key = "tb"; @@ -109,6 +173,61 @@ silent = true; }; } + { + mode = "n"; + key = "tm"; + action = ":Telescope man_pages"; + options = { + desc = "Man Pages"; + silent = true; + }; + } + { + mode = "n"; + key = "tn"; + action = ":Telescope vim_options"; + options = { + desc = "Vim Options"; + silent = true; + }; + } + # Git + { + mode = "n"; + key = "tgc"; + action = ":Telescope git_commits"; + options = { + desc = "Git Commits"; + silent = true; + }; + } + { + mode = "n"; + key = "tgb"; + action = ":Telescope git_branches"; + options = { + desc = "Git Branches"; + silent = true; + }; + } + { + mode = "n"; + key = "tgs"; + action = ":Telescope git_status"; + options = { + desc = "Git Status"; + silent = true; + }; + } + { + mode = "n"; + key = "tgS"; + action = ":Telescope git_stash"; + options = { + desc = "Git Stash"; + silent = true; + }; + } ]; }; } diff --git a/nixos/nvim/plugins/treesitter.nix b/nixos/nvim/plugins/treesitter.nix new file mode 100644 index 0000000..0d052f9 --- /dev/null +++ b/nixos/nvim/plugins/treesitter.nix @@ -0,0 +1,70 @@ +{ pkgs, ... }: +{ + programs.nixvim = { + plugins = { + treesitter-refactor = { + enable = true; + highlightCurrentScope.enable = true; + highlightDefinitions.enable = true; + navigation = { + enable = true; + keymaps = { + gotoDefinition = null; + gotoDefinitionLspFallback = "gnd"; + gotoNextUsage = ""; + gotoPreviousUsage = ""; + listDefinitions = "gnD"; + listDefinitionsToc = "gO"; + }; + }; + smartRename = { + enable = true; + keymaps.smartRename = "grr"; + }; + }; + treesitter-context = { + enable = true; + }; + treesitter = { + enable = true; + settings = { + indent.enable = true; + incremental_selection = { + enable = true; + keymaps = { + init_selection = "gnn"; + node_incremental = "grn"; + scope_incremental = "grc"; + node_decremental = "grm"; + }; + }; + highlight = { + enable = true; + }; + }; + grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ + bash + c + cpp + css + dockerfile + go + graphql + html + javascript + json + jsonc + lua + python + regex + ruby + rust + svelte + toml + typescript + yaml + ]; + }; + }; + }; +} diff --git a/nixos/nvim/settings.nix b/nixos/nvim/settings.nix index a8a4d60..c3545cb 100755 --- a/nixos/nvim/settings.nix +++ b/nixos/nvim/settings.nix @@ -5,18 +5,37 @@ enable = true; viAlias = true; vimAlias = true; - colorschemes.catppuccin.enable = true; + clipboard.register = [ + "unnamed" + "unnamedplus" + ]; + performance = { + byteCompileLua = { + enable = true; + configs = true; + initLua = true; + nvimRuntime = true; + plugins = true; + }; + }; + # extraFiles = { + # "queries/nix/injections.scm".text = lib.mkForce '' + # (string_literal + # (string_fragment) @lua + # (#match? @lua ".*") + # ) + # ''; + # }; + colorscheme = "catppuccin"; + colorschemes.catppuccin = { + enable = true; + #lazyLoad.enable = true; + }; plugins = { - # lz-n = { - # enable = true; - # lazyLoad = { - # enable = true; - # }; - # }; - treesitter.enable = true; + aerial.enable = true; direnv.enable = true; web-devicons.enable = true; - bufferline.enable = true; + #bufferline.enable = true; glow.enable = true; gitblame.enable = true; git-conflict.enable = true; @@ -24,9 +43,16 @@ nix-develop.enable = true; image.enable = true; which-key.enable = true; - neocord.enable = true; + neocord.enable = false; rainbow-delimiters.enable = true; neoconf.enable = true; + colorizer.enable = true; + comment.enable = true; + dotnet.enable = true; + sqlite-lua.enable = true; }; + extraConfigVim = '' + set number " enable number lines + ''; }; }