diff --git a/flake.lock b/flake.lock index c9112b8..7d07cd7 100644 --- a/flake.lock +++ b/flake.lock @@ -171,6 +171,27 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "neovim-nightly-overlay", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { "inputs": { "nixpkgs-lib": [ "stylix", @@ -617,6 +638,44 @@ "type": "github" } }, + "neovim-nightly-overlay": { + "inputs": { + "flake-parts": "flake-parts", + "neovim-src": "neovim-src", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1770249911, + "narHash": "sha256-r2MZTU2zsIfkdIUS+Dn4e74on6JJ2VNWHzMfgckuIL8=", + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "rev": "e9a48f471e4d9de23aa41fa3566ece92c1841d0a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "neovim-nightly-overlay", + "type": "github" + } + }, + "neovim-src": { + "flake": false, + "locked": { + "lastModified": 1770248217, + "narHash": "sha256-1TBgrAAyPo4NtACyPFuhrmn7bchTH93YTjsLqEl5ovc=", + "owner": "neovim", + "repo": "neovim", + "rev": "bdd886622d4d4ae29334248b3e7451c59be0f409", + "type": "github" + }, + "original": { + "owner": "neovim", + "repo": "neovim", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -688,21 +747,6 @@ "type": "github" } }, - "nixCats": { - "locked": { - "lastModified": 1769578476, - "narHash": "sha256-4+KbiBcC6hQ3sh0UbPXjy6TOfLh9yhskRlfPzyZ2FH4=", - "owner": "BirdeeHub", - "repo": "nixCats-nvim", - "rev": "48f8be4bdafccfa19ceaaf08071a15eca36fdb1d", - "type": "github" - }, - "original": { - "owner": "BirdeeHub", - "repo": "nixCats-nvim", - "type": "github" - } - }, "nixos-hardware": { "locked": { "lastModified": 1769302137, @@ -943,9 +987,9 @@ "home-manager": "home-manager", "hyprland": "hyprland", "hyprland-plugins": "hyprland-plugins", + "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-darwin": "nix-darwin", "nix-on-droid": "nix-on-droid", - "nixCats": "nixCats", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", "nixpkgs": "nixpkgs_3", @@ -975,7 +1019,7 @@ "base16-helix": "base16-helix", "base16-vim": "base16-vim", "firefox-gnome-theme": "firefox-gnome-theme", - "flake-parts": "flake-parts", + "flake-parts": "flake-parts_2", "gnome-shell": "gnome-shell", "nixpkgs": [ "nixpkgs" diff --git a/flake.nix b/flake.nix index 905c6bc..7883c3d 100644 --- a/flake.nix +++ b/flake.nix @@ -22,9 +22,6 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; - nixCats = { - url = "github:BirdeeHub/nixCats-nvim"; - }; nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; stylix = { url = "github:nix-community/stylix"; @@ -34,6 +31,10 @@ url = "github:nix-community/emacs-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; + neovim-nightly-overlay = { + url = "github:nix-community/neovim-nightly-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { diff --git a/hosts/android/home.nix b/hosts/android/home.nix index bbb69a0..c144131 100644 --- a/hosts/android/home.nix +++ b/hosts/android/home.nix @@ -9,7 +9,7 @@ # insert home-manager config imports = [ - ../../modules/home-manager/nixcats + ../../modules/home-manager/neovim ../../modules/home-manager/zsh.nix ../../modules/home-manager/git.nix ../../modules/home-manager/tmux.nix diff --git a/hosts/desktop/home.nix b/hosts/desktop/home.nix index d139f54..55dbea4 100644 --- a/hosts/desktop/home.nix +++ b/hosts/desktop/home.nix @@ -6,7 +6,7 @@ imports = [ ../../modules/home-manager/hyprland.nix ../../modules/home-manager/git.nix - ../../modules/home-manager/nixcats + ../../modules/home-manager/neovim ../../modules/home-manager/kitty.nix ../../modules/home-manager/zsh.nix ../../modules/home-manager/tmux.nix diff --git a/hosts/macbook/configuration.nix b/hosts/macbook/configuration.nix index 0d1ceed..963a1b4 100644 --- a/hosts/macbook/configuration.nix +++ b/hosts/macbook/configuration.nix @@ -8,6 +8,7 @@ inputs.home-manager.darwinModules.default ../../modules/nix-darwin/system.nix ../../modules/nix-darwin/aerospace.nix + ../../modules/nixos/neovim.nix ]; nixpkgs.hostPlatform = "aarch64-darwin"; diff --git a/hosts/macbook/home.nix b/hosts/macbook/home.nix index 412620d..3a4b6a0 100644 --- a/hosts/macbook/home.nix +++ b/hosts/macbook/home.nix @@ -5,7 +5,7 @@ }: { imports = [ ../../modules/home-manager/git.nix - ../../modules/home-manager/nixcats + ../../modules/home-manager/neovim ../../modules/home-manager/emacs ../../modules/home-manager/kitty.nix ../../modules/home-manager/zsh.nix @@ -23,7 +23,7 @@ ../../modules/home-manager/direnv.nix ../../modules/home-manager/spotify-player.nix ../../modules/home-manager/nb.nix - ../../modules/home-manager/stylix.nix + #../../modules/home-manager/stylix.nix ../../modules/home-manager/hledger.nix ]; home.username = "mthomson"; diff --git a/hosts/macvm/home.nix b/hosts/macvm/home.nix index ca834aa..94cc4cf 100644 --- a/hosts/macvm/home.nix +++ b/hosts/macvm/home.nix @@ -8,7 +8,7 @@ #../../modules/home-manager/sway.nix ../../modules/home-manager/i3 ../../modules/home-manager/git.nix - ../../modules/home-manager/nixcats + ../../modules/home-manager/neovim ../../modules/home-manager/wezterm ../../modules/home-manager/zsh.nix ../../modules/home-manager/tmux.nix diff --git a/hosts/thinkpad/home.nix b/hosts/thinkpad/home.nix index d1b011b..5920cef 100644 --- a/hosts/thinkpad/home.nix +++ b/hosts/thinkpad/home.nix @@ -8,7 +8,7 @@ #../../modules/home-manager/sway.nix ../../modules/home-manager/i3 ../../modules/home-manager/git.nix - ../../modules/home-manager/nixcats + ../../modules/home-manager/neovim ../../modules/home-manager/kitty.nix ../../modules/home-manager/zsh.nix ../../modules/home-manager/tmux.nix diff --git a/hosts/wsl/home.nix b/hosts/wsl/home.nix index 1de02bb..0f5e8cc 100644 --- a/hosts/wsl/home.nix +++ b/hosts/wsl/home.nix @@ -6,7 +6,7 @@ imports = [ ../../modules/home-manager/git.nix ../../modules/home-manager/stylix.nix - ../../modules/home-manager/nixcats + ../../modules/home-manager/neovim ../../modules/home-manager/zsh.nix ../../modules/home-manager/tmux.nix ../../modules/home-manager/direnv.nix diff --git a/modules/home-manager/kitty.nix b/modules/home-manager/kitty.nix index 37f620e..77c6e51 100644 --- a/modules/home-manager/kitty.nix +++ b/modules/home-manager/kitty.nix @@ -10,14 +10,14 @@ # size = 12; # }; font = { - # name = "JetBrainsMono Nerd Font"; + name = "JetBrainsMono Nerd Font Mono"; size = 12; - # package = pkgs.nerd-fonts.jetbrains-mono; + package = pkgs.nerd-fonts.jetbrains-mono; }; shellIntegration = { enableZshIntegration = true; }; - #themeFile = "gruvbox-dark"; + themeFile = "Modus_Vivendi"; # darwinLaunchOptions = [ # "--single-instance" # ]; diff --git a/modules/home-manager/neovim/default.nix b/modules/home-manager/neovim/default.nix new file mode 100644 index 0000000..c831a23 --- /dev/null +++ b/modules/home-manager/neovim/default.nix @@ -0,0 +1,25 @@ +{ + pkgs, + config, + ... +}: { + home.packages = with pkgs; [ + #utilities + ripgrep + + # language servers + lua-language-server + vtsls + gopls + eslint_d + tailwindcss-language-server + vscode-langservers-extracted + rust-analyzer + yaml-language-server + haskell-language-server + clang + ]; + home.file = { + ".config/nvim/init.lua".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/personal/nixos/modules/home-manager/neovim/init.lua"; + }; +} diff --git a/modules/home-manager/neovim/init.lua b/modules/home-manager/neovim/init.lua new file mode 100644 index 0000000..b5d06b4 --- /dev/null +++ b/modules/home-manager/neovim/init.lua @@ -0,0 +1,179 @@ +-- set leader keys +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- highlight as you search +vim.opt.hlsearch = true +vim.keymap.set('n', '', 'nohlsearch') + +-- preview substitutions live in preview window +vim.opt.inccommand = 'split' + +-- prevent cursor from hitting top or bottom of screen +vim.opt.scrolloff = 10 + +-- line numbers +vim.wo.number = true +vim.wo.relativenumber = true + +-- Indent stuff +vim.o.expandtab = true +vim.o.smartindent = true +vim.o.autoindent = true +vim.o.tabstop = 2 +vim.o.softtabstop = 2 +vim.o.shiftwidth = 2 + +-- wrapped lines are visually indented +vim.o.breakindent = true + +-- save undo history +vim.o.undofile = true + +-- case insensitive search unless capitalized +vim.o.ignorecase = true +vim.o.smartcase = true + +-- keep on signcolumn +vim.wo.signcolumn = 'yes' + +-- decrease update time +vim.o.updatetime = 250 +vim.o.timeoutlen = 300 + +-- better completion experience +vim.o.completeopt = 'menu,preview,noselect' + +-- better term colors +vim.o.termguicolors = true + +-- clean up netrw +vim.g.netrw_liststyle = 0 +vim.g.netrw_banner = 0 + +-- Basic Keymaps +-- improves C-u and C-d by centering on scroll +vim.keymap.set('n', '', 'zz', { desc = 'Scroll Up' }) +vim.keymap.set('n', '', 'zz', { desc = 'Scroll Down' }) + +-- improved search by centering on results +vim.keymap.set('n', 'n', 'nzzzv', { desc = 'Next Search Result' }) +vim.keymap.set('n', 'N', 'Nzzzv', { desc = 'Previous Search Result' }) + +-- diagnostics +vim.keymap.set('n', 'd', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) + +-- clipboard binds +vim.keymap.set({"v", "x", "n"}, 'y', '"+y', { noremap = true, silent = true, desc = 'Yank to clipboard' }) +vim.keymap.set({"n", "v", "x"}, 'Y', '"+yy', { noremap = true, silent = true, desc = 'Yank line to clipboard' }) +vim.keymap.set({'n', 'v', 'x'}, 'p', '"+p', { noremap = true, silent = true, desc = 'Paste from clipboard' }) +vim.keymap.set('i', '', '+', { noremap = true, silent = true, desc = 'Paste from clipboard from within insert mode' }) +vim.keymap.set("x", "P", '"_dP', { noremap = true, silent = true, desc = 'Paste over selection without erasing unnamed register' }) + +-- Plugins +vim.pack.add({ + { src = 'https://github.com/vague-theme/vague.nvim' }, + { src = 'https://github.com/miikanissi/modus-themes.nvim' }, + { src = 'https://github.com/nvim-treesitter/nvim-treesitter' }, + { src = 'https://github.com/nvim-mini/mini.pick' }, + { src = 'https://github.com/nvim-mini/mini.extra' }, + { src = 'https://github.com/nvim-mini/mini.icons' }, + { src = 'https://github.com/nvim-mini/mini.notify' }, + { src = 'https://github.com/nvim-mini/mini.pairs' }, + { src = 'https://github.com/nvim-mini/mini.surround' }, + { src = 'https://github.com/neovim/nvim-lspconfig' }, + { src = 'https://github.com/stevearc/oil.nvim' }, + { src = 'https://github.com/saghen/blink.cmp', version = vim.version.range('1.*') }, +}) + +-- Theme (vague) +vim.cmd('colorscheme modus') + +-- Blink +require('blink.cmp').setup({ + signature = { enabled = true } +}) + +-- Oil +require('oil').setup() + +-- Mini +require('mini.icons').setup() +require('mini.pick').setup() +require('mini.extra').setup() +require('mini.notify').setup() +require('mini.pairs').setup() +require('mini.surround').setup() +vim.keymap.set('n', 'ff', MiniPick.builtin.files, { desc = 'Find Files' }) +vim.keymap.set('n', 'fg', MiniPick.builtin.grep_live, { desc = 'Grep Files' }) + +-- Oil +vim.keymap.set('n', 'fe', 'Oil', { desc = 'Explore Files' }) + +-- LSP +-- global on_attach +local function lsp_on_attach(client, bufnr) + -- utility function for LSP keymaps + local nmap = function(keys, func, desc) + vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) + end + + -- if client:supports_method('textDocument/completion') then + -- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end + -- client.server_capabilities.completionProvider.triggerCharacters = chars + -- + -- vim.lsp.completion.enable(true, client.id, bufnr, {autotrigger = true}) + -- end + + nmap('rn', vim.lsp.buf.rename, 'Rename') + nmap('ca', vim.lsp.buf.code_action, 'Code Actions') + nmap('gd', vim.lsp.buf.definition, 'Goto Definition') + + nmap('gr', function() MiniExtra.pickers.lsp({ scope = 'references' }) end, 'Goto References') + nmap('gI', function() MiniExtra.pickers.lsp({ scope = 'implementation' }) end, 'Goto Implementation') + nmap('ds', function() MiniExtra.pickers.lsp({ scope = 'document_symbol' }) end, 'Document Symbols') + nmap('ws', function() MiniExtra.pickers.lsp({ scope = 'workspace_symbol_live' }) end, 'Workspace Symbols') + + nmap('D', vim.lsp.buf.type_definition, 'Goto Type Definition') + nmap('gD', vim.lsp.buf.declaration, 'Goto Declaration') + + nmap('K', vim.lsp.buf.hover, 'Hover Documentation') + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') +end + +vim.lsp.config('*', { + on_attach = lsp_on_attach +}) + +-- Langauges +vim.lsp.config('lua_ls', { + settings = { + Lua = { + diagnostics = { + globals = { 'vim' }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + runtime = { + version = 'LuaJIT', + }, + telemetry = { + enable = false, + }, + }, + }, +}) + +vim.lsp.enable('lua_ls') +vim.lsp.enable('vtsls') +vim.lsp.enable('cssls') +vim.lsp.enable('tailwindcss') +vim.lsp.enable('eslint') +vim.lsp.enable('gopls') +vim.lsp.enable('nixd') +vim.lsp.enable('rust_analyzer') +vim.lsp.enable('yamlls') +vim.lsp.enable('clangd') +vim.lsp.enable('hls') diff --git a/modules/home-manager/nixcats/default.nix b/modules/home-manager/nixcats/default.nix deleted file mode 100644 index 1a5f34f..0000000 --- a/modules/home-manager/nixcats/default.nix +++ /dev/null @@ -1,232 +0,0 @@ -{ - config, - lib, - inputs, - pkgs, - ... -}: let - utils = inputs.nixCats.utils; - - kulala-grammer = pkgs.tree-sitter.buildGrammar { - language = "kulala_http"; - version = "${pkgs.vimPlugins.kulala-nvim.version}"; - src = "${pkgs.vimPlugins.kulala-nvim}/lua/tree-sitter"; - generate = true; - }; -in { - imports = [ - inputs.nixCats.homeModule - ../zk.nix - ]; - - config = { - home.sessionVariables = { - EDITOR = "nvim"; - }; - nixCats = { - enable = true; - packageNames = ["nvim"]; - - luaPath = ./.; - - # for useage of this section, refer to :h nixCats.flake.outputs.categories - categoryDefinitions.replace = { - pkgs, - settings, - categories, - extra, - name, - mkPlugin, - ... - } @ packageDef: { - # lspsAndRuntimeDeps: - # this section is for dependencies that should be available - # at RUN TIME for plugins. Will be available to PATH within neovim terminal - # this includes LSPs - lspsAndRuntimeDeps = { - general = with pkgs; [ - lazygit - ripgrep - fzf - ]; - notes = with pkgs; [ - zk - tinymist - typst - ]; - lua = with pkgs; [ - lua-language-server - stylua - ]; - nix = with pkgs; [ - nixd - alejandra - ]; - go = with pkgs; [ - gopls - delve - golint - golangci-lint - gotools - go-tools - go - ]; - typescript = with pkgs; [ - vtsls - vscode-langservers-extracted - stylelint-lsp - tailwindcss-language-server - vscode-css-languageserver - ]; - yaml = with pkgs; [ - yaml-language-server - ]; - c = with pkgs; [ - clang - ]; - csharp = with pkgs; [ - omnisharp-roslyn - ]; - gitlab = with pkgs; [ - gitlab-ci-ls - ]; - http = with pkgs; [ - kulala-fmt - ]; - }; - - # This is for plugins that will load at startup without using packadd: - startupPlugins = { - general = with pkgs.vimPlugins; [ - # lazy loading isnt required with a config this small - # but as a demo, we do it anyway. - lze - lzextras - (nvim-treesitter.withPlugins ( - plugins: - nvim-treesitter.allGrammars ++ [kulala-grammer] - - )) - snacks-nvim - gruvbox-nvim - gruber-darker-nvim - lackluster-nvim - oxocarbon-nvim - vim-sleuth - oil-nvim - plenary-nvim - vim-tmux-navigator - friendly-snippets - vim-ledger - ]; - }; - - # not loaded automatically at startup. - # use with packadd and an autocommand in config to achieve lazy loading - optionalPlugins = { - notes = with pkgs.vimPlugins; [ - zk-nvim - typst-preview-nvim - ]; - go = with pkgs.vimPlugins; [ - nvim-dap-go - ]; - lua = with pkgs.vimPlugins; [ - lazydev-nvim - ]; - general = with pkgs.vimPlugins; [ - mini-nvim - nvim-lspconfig - blink-cmp - gitsigns-nvim - harpoon2 - which-key-nvim - nvim-lint - conform-nvim - nvim-dap - nvim-dap-ui - nvim-dap-virtual-text - ]; - http = with pkgs.vimPlugins; [ - kulala-nvim - ]; - }; - - # shared libraries to be added to LD_LIBRARY_PATH - # variable available to nvim runtime - sharedLibraries = { - general = with pkgs; []; - }; - - # environmentVariables: - # this section is for environmentVariables that should be available - # at RUN TIME for plugins. Will be available to path within neovim terminal - environmentVariables = { - # test = { - # CATTESTVAR = "It worked!"; - # }; - }; - - # categories of the function you would have passed to withPackages - python3.libraries = { - # test = [ (_:[]) ]; - }; - - # If you know what these are, you can provide custom ones by category here. - # If you dont, check this link out: - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/make-wrapper.sh - extraWrapperArgs = { - # test = [ - # '' --set CATTESTVAR2 "It worked again!"'' - # ]; - }; - }; - - # see :help nixCats.flake.outputs.packageDefinitions - packageDefinitions.replace = { - # These are the names of your packages - # you can include as many as you wish. - nvim = { - pkgs, - name, - ... - }: { - # they contain a settings set defined above - # see :help nixCats.flake.outputs.settings - settings = { - suffix-path = true; - suffix-LD = true; - wrapRc = true; - # unwrappedCfgPath = "/path/to/here"; - # IMPORTANT: - # your alias may not conflict with your other packages. - # aliases = [ "vim" "homeVim" ]; - # neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim; - hosts.python3.enable = true; - hosts.node.enable = true; - }; - # and a set of categories that you want - # (and other information to pass to lua) - # and a set of categories that you want - categories = { - general = true; - notes = true; - lua = true; - nix = true; - go = true; - typescript = true; - yaml = true; - c = true; - csharp = true; - gitlab = true; - http = true; - }; - # anything else to pass and grab in lua with `nixCats.extra` - extra = { - nixdExtras.nixpkgs = ''import { }''; - }; - }; - }; - }; - }; -} diff --git a/modules/home-manager/nixcats/init.lua b/modules/home-manager/nixcats/init.lua deleted file mode 100644 index 5871528..0000000 --- a/modules/home-manager/nixcats/init.lua +++ /dev/null @@ -1,820 +0,0 @@ --- NOTE: These 2 need to be set up before any plugins are loaded. -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' - --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! - --- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` -vim.opt.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - --- Set highlight on search -vim.opt.hlsearch = true -vim.keymap.set('n', '', 'nohlsearch') - --- Preview substitutions live, as you type! -vim.opt.inccommand = 'split' - --- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 - --- Make line numbers default -vim.wo.number = true - --- Enable mouse mode -vim.o.mouse = 'a' - -vim.o.conceallevel = 2 - --- Indent --- vim.o.smarttab = true -vim.opt.cpoptions:append('I') -vim.o.expandtab = true -vim.o.smartindent = true -vim.o.autoindent = true -vim.o.tabstop = 4 -vim.o.softtabstop = 4 -vim.o.shiftwidth = 4 - --- stops line wrapping from being confusing -vim.o.breakindent = true - --- Save undo history -vim.o.undofile = true - --- Case-insensitive searching UNLESS \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true - --- Keep signcolumn on by default -vim.wo.signcolumn = 'yes' -vim.wo.relativenumber = true - --- Decrease update time -vim.o.updatetime = 250 -vim.o.timeoutlen = 300 - --- Set completeopt to have a better completion experience -vim.o.completeopt = 'menu,preview,noselect' - --- NOTE: You should make sure your terminal supports this -vim.o.termguicolors = true - --- [[ Disable auto comment on enter ]] --- See :help formatoptions -vim.api.nvim_create_autocmd("FileType", { - desc = "remove formatoptions", - callback = function() - vim.opt.formatoptions:remove({ "c", "r", "o" }) - end, -}) - --- [[ Highlight on yank ]] --- See `:help vim.highlight.on_yank()` -local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) -vim.api.nvim_create_autocmd('TextYankPost', { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = '*', -}) - -vim.g.netrw_liststyle=0 -vim.g.netrw_banner=0 --- [[ Basic Keymaps ]] - --- Keymaps for better default experience --- See `:help vim.keymap.set()` -vim.keymap.set("v", "J", ":m '>+1gv=gv", { desc = 'Moves Line Down' }) -vim.keymap.set("v", "K", ":m '<-2gv=gv", { desc = 'Moves Line Up' }) -vim.keymap.set("n", "", "zz", { desc = 'Scroll Down' }) -vim.keymap.set("n", "", "zz", { desc = 'Scroll Up' }) -vim.keymap.set("n", "n", "nzzzv", { desc = 'Next Search Result' }) -vim.keymap.set("n", "N", "Nzzzv", { desc = 'Previous Search Result' }) - -vim.keymap.set("n", "[", "bprev", { desc = 'Previous buffer' }) -vim.keymap.set("n", "]", "bnext", { desc = 'Next buffer' }) -vim.keymap.set("n", "l", "b#", { desc = 'Last buffer' }) -vim.keymap.set("n", "d", "bdelete", { desc = 'delete buffer' }) - --- Remap for dealing with word wrap -vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) -vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - --- Diagnostic keymaps -vim.keymap.set('n', 'd', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) - --- kickstart.nvim starts you with this. --- But it constantly clobbers your system clipboard whenever you delete anything. - --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` --- vim.o.clipboard = 'unnamedplus' - --- You should instead use these keybindings so that they are still easy to use, but dont conflict -vim.keymap.set({"v", "x", "n"}, 'y', '"+y', { noremap = true, silent = true, desc = 'Yank to clipboard' }) -vim.keymap.set({"n", "v", "x"}, 'Y', '"+yy', { noremap = true, silent = true, desc = 'Yank line to clipboard' }) -vim.keymap.set({'n', 'v', 'x'}, 'p', '"+p', { noremap = true, silent = true, desc = 'Paste from clipboard' }) -vim.keymap.set('i', '', '+', { noremap = true, silent = true, desc = 'Paste from clipboard from within insert mode' }) -vim.keymap.set("x", "P", '"_dP', { noremap = true, silent = true, desc = 'Paste over selection without erasing unnamed register' }) - -vim.cmd.colorscheme('gruvbox') - -require("oil").setup() -vim.keymap.set("n", "fe", "Oil", { desc = 'Oil' }) - -require("snacks").setup({ - explorer = {}, - picker = {}, - bigfile = {}, - image = {}, - lazygit = {}, - rename = {}, - notifier = {}, - indent = { - enabled = true, - animate = { - enabled = false, - }, - }, - gitbrowse = {}, - scope = {}, -}) - -vim.g.ledger_fuzzy_account_completion = 1 - --- LSP Progress indicator -vim.api.nvim_create_autocmd("LspProgress", { - ---@param ev {data: {client_id: integer, params: lsp.ProgressParams}} - callback = function(ev) - local spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" } - vim.notify(vim.lsp.status(), "info", { - id = "lsp_progress", - title = "LSP Progress", - opts = function(notif) - notif.icon = ev.data.params.value.kind == "end" and " " - or spinner[math.floor(vim.uv.hrtime() / (1e6 * 80)) % #spinner + 1] - end, - }) - end, -}) - -vim.keymap.set("n", "gg", function() Snacks.lazygit.open() end, { desc = 'Snacks LazyGit' }) -vim.keymap.set('n', "sf", function() Snacks.picker.smart() end, { desc = "Smart Find Files" }) -vim.keymap.set('n', "s", function() Snacks.picker.buffers() end, { desc = "Search Buffers" }) --- find -vim.keymap.set('n', "ff", function() Snacks.picker.files() end, { desc = "Find Files" }) --- Grep -vim.keymap.set('n', "fg", function() Snacks.picker.grep({ hidden = true }) end, { desc = "Grep" }) --- search -vim.keymap.set('n', "fd", function() Snacks.picker.diagnostics() end, { desc = "Diagnostics" }) -vim.keymap.set('n', "fh", function() Snacks.picker.help() end, { desc = "Help Pages" }) -vim.keymap.set('n', "fj", function() Snacks.picker.jumps() end, { desc = "Jumps" }) -vim.keymap.set('n', "fk", function() Snacks.picker.keymaps() end, { desc = "Keymaps" }) -vim.keymap.set('n', "fl", function() Snacks.picker.loclist() end, { desc = "Location List" }) -vim.keymap.set('n', "fM", function() Snacks.picker.man() end, { desc = "Man Pages" }) -vim.keymap.set('n', "fq", function() Snacks.picker.qflist() end, { desc = "Quickfix List" }) -vim.keymap.set('n', "fr", function() Snacks.picker.resume() end, { desc = "Resume" }) -vim.keymap.set('n', "fu", function() Snacks.picker.undo() end, { desc = "Undo History" }) -require('lze').load { - { - "blink.cmp", - enabled = nixCats('general') or false, - event = "DeferredUIEnter", - on_require = "blink", - after = function (plugin) - require("blink.cmp").setup({ - -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) - -- See :h blink-cmp-config-keymap for configuring keymaps - keymap = { preset = 'default' }, - appearance = { - nerd_font_variant = 'mono' - }, - signature = { enabled = true, }, - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer', 'omni' }, - }, - }) - end, - }, - { - "nvim-treesitter", - lazy = false, - after = function(plugin) - ---@param buf integer - ---@param language string - local function treesitter_try_attach(buf, language) - -- check if parser exists and load it - if not vim.treesitter.language.add(language) then - return - end - -- enables syntax highlighting and other treesitter features - vim.treesitter.start(buf, language) - - -- enables treesitter based folds - vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" - - -- enables treesitter based indentation - vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" - end - - local available_parsers = require("nvim-treesitter").get_available() - vim.api.nvim_create_autocmd("FileType", { - callback = function(args) - local buf, filetype = args.buf, args.match - local language = vim.treesitter.language.get_lang(filetype) - if not language then - return - end - - local installed_parsers = require("nvim-treesitter").get_installed("parsers") - - if vim.tbl_contains(installed_parsers, language) then - -- enable the parser if it is installed - treesitter_try_attach(buf, language) - elseif vim.tbl_contains(available_parsers, language) then - -- if a parser is available in `nvim-treesitter` enable it after ensuring it is installed - require("nvim-treesitter").install(language):await(function() - treesitter_try_attach(buf, language) - end) - else - -- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter` - treesitter_try_attach(buf, language) - end - end, - }) - end, - }, - { - "mini.nvim", - enabled = nixCats('general') or false, - event = "DeferredUIEnter", - after = function (plugin) - require('mini.pairs').setup() - require('mini.icons').setup() - require('mini.ai').setup() - end, - }, - { - "gitsigns.nvim", - enabled = nixCats('general') or false, - event = "DeferredUIEnter", - after = function (plugin) - require('gitsigns').setup({ - -- See `:help gitsigns.txt` - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map({ 'n', 'v' }, ']c', function() - if vim.wo.diff then - return ']c' - end - vim.schedule(function() - gs.next_hunk() - end) - return '' - end, { expr = true, desc = 'Jump to next hunk' }) - - map({ 'n', 'v' }, '[c', function() - if vim.wo.diff then - return '[c' - end - vim.schedule(function() - gs.prev_hunk() - end) - return '' - end, { expr = true, desc = 'Jump to previous hunk' }) - - -- Actions - -- visual mode - map('v', 'hs', function() - gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'stage git hunk' }) - map('v', 'hr', function() - gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - end, { desc = 'reset git hunk' }) - -- normal mode - map('n', 'gs', gs.stage_hunk, { desc = 'git stage hunk' }) - map('n', 'gr', gs.reset_hunk, { desc = 'git reset hunk' }) - map('n', 'gS', gs.stage_buffer, { desc = 'git Stage buffer' }) - map('n', 'gu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) - map('n', 'gR', gs.reset_buffer, { desc = 'git Reset buffer' }) - map('n', 'gp', gs.preview_hunk, { desc = 'preview git hunk' }) - map('n', 'gb', function() - gs.blame_line { full = false } - end, { desc = 'git blame line' }) - map('n', 'gd', gs.diffthis, { desc = 'git diff against index' }) - map('n', 'gD', function() - gs.diffthis '~' - end, { desc = 'git diff against last commit' }) - - -- Toggles - map('n', 'gtb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) - map('n', 'gtd', gs.toggle_deleted, { desc = 'toggle git show deleted' }) - - -- Text object - map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select git hunk' }) - end, - }) - vim.cmd([[hi GitSignsAdd guifg=#04de21]]) - vim.cmd([[hi GitSignsChange guifg=#83fce6]]) - vim.cmd([[hi GitSignsDelete guifg=#fa2525]]) - end, - }, - { - "which-key.nvim", - enabled = nixCats('general') or false, - event = "DeferredUIEnter", - after = function (plugin) - require('which-key').setup({}) - require('which-key').add { - { "b", group = "buffer commands" }, - { "c", group = "[c]ode" }, - { "c_", hidden = true }, - { "d", group = "[d]ocument" }, - { "d_", hidden = true }, - { "g", group = "[g]it" }, - { "g_", hidden = true }, - { "r", group = "[r]ename" }, - { "r_", hidden = true }, - { "f", group = "[f]ind" }, - { "f_", hidden = true }, - { "s", group = "[s]earch" }, - { "s_", hidden = true }, - { "t", group = "[t]oggles" }, - { "t_", hidden = true }, - { "w", group = "[w]orkspace" }, - { "w_", hidden = true }, - } - end, - }, - { - "nvim-lint", - enabled = nixCats('general') or false, - event = "FileType", - after = function (plugin) - require('lint').linters_by_ft = { - -- markdown = {'vale',}, - -- javascript = { 'eslint' }, - -- typescript = { 'eslint' }, - go = nixCats('go') and { 'golangcilint' } or nil, - } - - vim.api.nvim_create_autocmd({ "BufWritePost" }, { - callback = function() - require("lint").try_lint() - end, - }) - end, - }, - { - "conform.nvim", - enabled = nixCats('general') or false, - keys = { - { "FF", desc = "[F]ormat [F]ile" }, - }, - after = function (plugin) - local conform = require("conform") - - conform.setup({ - formatters_by_ft = { - -- NOTE: download some formatters in lspsAndRuntimeDeps - -- and configure them here - lua = nixCats('lua') and { "stylua" } or nil, - go = nixCats('go') and { "gofmt", "golint" } or nil, - -- templ = { "templ" }, - -- Conform will run multiple formatters sequentially - -- python = { "isort", "black" }, - -- Use a sub-list to run only the first available formatter - -- javascript = { { "prettierd", "prettier" } }, - }, - }) - - vim.keymap.set({ "n", "v" }, "FF", function() - conform.format({ - lsp_fallback = true, - async = false, - timeout_ms = 1000, - }) - end, { desc = "[F]ormat [F]ile" }) - end, - }, - { - "nvim-dap", - enabled = nixCats('general') or false, - keys = { - { "", desc = "Debug: Start/Continue" }, - { "", desc = "Debug: Step Into" }, - { "", desc = "Debug: Step Over" }, - { "", desc = "Debug: Step Out" }, - { "b", desc = "Debug: Toggle Breakpoint" }, - { "B", desc = "Debug: Set Breakpoint" }, - { "", desc = "Debug: See last session result." }, - }, - -- colorscheme = "", - load = function(name) - vim.cmd.packadd(name) - vim.cmd.packadd("nvim-dap-ui") - vim.cmd.packadd("nvim-dap-virtual-text") - end, - after = function (plugin) - local dap = require 'dap' - local dapui = require 'dapui' - - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Start/Continue' }) - vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', 'B', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, { desc = 'Debug: Set Breakpoint' }) - - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - vim.keymap.set('n', '', dapui.toggle, { desc = 'Debug: See last session result.' }) - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } - - require("nvim-dap-virtual-text").setup { - enabled = true, -- enable this plugin (the default) - enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination) - highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText - highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables) - show_stop_reason = true, -- show stop reason when stopped for exceptions - commented = false, -- prefix virtual text with comment string - only_first_definition = true, -- only show virtual text at first definition (if there are multiple) - all_references = false, -- show virtual text on all all references of the variable (not only definitions) - clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping) - --- A callback that determines how a variable is displayed or whether it should be omitted - --- variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable - --- buf number - --- stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame - --- node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`) - --- options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text - --- string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed - display_callback = function(variable, buf, stackframe, node, options) - if options.virt_text_pos == 'inline' then - return ' = ' .. variable.value - else - return variable.name .. ' = ' .. variable.value - end - end, - -- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line - virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol', - - -- experimental features: - all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine. - virt_lines = false, -- show virtual lines instead of virtual text (will flicker!) - virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) , - -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()` - } - - -- NOTE: Install lang specific config - -- either in here, or in a separate plugin spec as demonstrated for go below. - end, - }, - { - "nvim-dap-go", - enabled = nixCats('go') or false, - on_plugin = { "nvim-dap", }, - after = function(plugin) - require("dap-go").setup() - end, - }, - { - -- lazydev makes your lsp way better in your config without needing extra lsp configuration. - "lazydev.nvim", - enabled = nixCats('lua') or false, - cmd = { "LazyDev" }, - ft = "lua", - after = function(_) - require('lazydev').setup({ - library = { - { words = { "nixCats" }, path = (nixCats.nixCatsPath or "") .. '/lua' }, - }, - }) - end, - }, - { - "harpoon2", - enabled = nixCats('general') or false, - keys = { - { "a", desc = "[A]dd harpoon" }, - { "e", desc = "[E]dit harpoon" }, - { "k", desc = "Harpoon prev" }, - { "j", desc = "Harpoon next" }, - }, - after = function () - local harpoon = require("harpoon") - require("blink.cmp.sources.lsp.commands") - harpoon:setup() - - vim.keymap.set("n", "a", function() harpoon:list():add() end) - vim.keymap.set("n", "e", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set("n", "k", function() harpoon:list():prev() end) - vim.keymap.set("n", "j", function() harpoon:list():next() end) - end - }, - { - "kulala.nvim", - keys = { - { "Rs", desc = "Send request" }, - { "Ra", desc = "Send all requests" }, - { "Rb", desc = "Open scratchpad" }, - }, - ft = {"http", "rest"}, - after = function () - require('kulala').setup({ - global_keymaps = true, - global_keymaps_prefix = "R", - }) - end - }, - { - "obsidian.nvim", - enabled = nixCats('notes') or false, - ft = {"md"}, - after = function () - require("obsidian").setup({ - workspaces = { - { - name = "everything", - path = "~/vaults/everything" - }, - }, - daily_notes = { - folder = "journal" - }, - }) - end - }, - { - "zk-nvim", - enabled = nixCats('notes') or false, - event = "DeferredUIEnter", - after = function () - require("zk").setup({ - picker = "snacks_picker" - }) - - local opts = { noremap=true, silent=false } - - -- Create a new note after asking for its title. - vim.api.nvim_set_keymap("n", "zn", "ZkNew { title = vim.fn.input('Title: ') }", opts) - - -- Create note from selection - vim.api.nvim_set_keymap("v", "znt", ":'<,'>ZkNewFromTitleSelection", opts) - - -- Open notes. - vim.api.nvim_set_keymap("n", "zf", "ZkNotes { sort = { 'modified' } }", opts) - -- Open notes associated with the selected tags. - vim.api.nvim_set_keymap("n", "zt", "ZkTags", opts) - -- show links in note - vim.api.nvim_set_keymap("n", "zl", "ZkLinks", opts) - - -- Search for the notes matching a given query. - vim.api.nvim_set_keymap("n", "zg", "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", opts) - -- Search for the notes matching the current visual selection. - vim.api.nvim_set_keymap("v", "zm", ":'<,'>ZkMatch", opts) - end - }, - { - "typst-preview.nvim", - enabled = nixCats('notes') or false, - after = function () - require('typst-preview').setup({}) - end - } -} - -local function lsp_on_attach(_, bufnr) - -- we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - - local nmap = function(keys, func, desc) - if desc then - desc = 'LSP: ' .. desc - end - vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) - end - - nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - - nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') - - if nixCats('general') then - nmap('gr', function() Snacks.picker.lsp_references() end, '[G]oto [R]eferences') - nmap('gI', function() Snacks.picker.lsp_implementations() end, '[G]oto [I]mplementation') - nmap('ds', function() Snacks.picker.lsp_symbols() end, '[D]ocument [S]ymbols') - nmap('ws', function() Snacks.picker.lsp_workspace_symbols() end, '[W]orkspace [S]ymbols') - end - - nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') - - -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - -- nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') - - -- Lesser used LSP functionality - nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') - nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') - nmap('wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, '[W]orkspace [L]ist Folders') - - -- Create a command `:Format` local to the LSP buffer - vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - vim.lsp.buf.format() - end, { desc = 'Format current buffer with LSP' }) - -end - --- NOTE: Register a handler from lzextras. This one makes it so that --- you can set up lsps within lze specs, --- and trigger vim.lsp.enable and the rtp config collection only on the correct filetypes --- it adds the lsp field used below --- (and must be registered before any load calls that use it!) -require('lze').register_handlers(require('lzextras').lsp) --- also replace the fallback filetype list retrieval function with a slightly faster one -require('lze').h.lsp.set_ft_fallback(function(name) - return dofile(nixCats.pawsible({ "allPlugins", "opt", "nvim-lspconfig" }) .. "/lsp/" .. name .. ".lua").filetypes or {} -end) -require('lze').load { - { - "nvim-lspconfig", - enabled = nixCats("general") or false, - -- the on require handler will be needed here if you want to use the - -- fallback method of getting filetypes if you don't provide any - on_require = { "lspconfig" }, - -- define a function to run over all type(plugin.lsp) == table - -- when their filetype trigger loads them - lsp = function(plugin) - vim.lsp.config(plugin.name, plugin.lsp or {}) - vim.lsp.enable(plugin.name) - end, - before = function(_) - vim.lsp.config('*', { - capabilities = require('blink.cmp').get_lsp_capabilities(), - on_attach = lsp_on_attach, - }) - end, - }, - { - -- name of the lsp - "lua_ls", - enabled = nixCats('lua') or false, - -- provide a table containing filetypes, - -- and then whatever your functions defined in the function type specs expect. - -- in our case, it just expects the normal lspconfig setup options. - lsp = { - -- if you provide the filetypes it doesn't ask lspconfig for the filetypes - filetypes = { 'lua' }, - settings = { - Lua = { - runtime = { version = 'LuaJIT' }, - formatters = { - ignoreComments = true, - }, - signatureHelp = { enabled = true }, - diagnostics = { - globals = { "nixCats", "vim", }, - disable = { 'missing-fields' }, - }, - telemetry = { enabled = false }, - }, - }, - }, - -- also these are regular specs and you can use before and after and all the other normal fields - }, - { - "vtsls", - enabled = nixCats('typescript') or false, - lsp = {}, - }, - { - "eslint", - enabled = nixCats('typescript') or false, - lsp = {}, - }, - { - "stylelint_lsp", - enabled = nixCats('typescript') or false, - lsp = {}, - }, - { - "tailwindcss", - enabled = false, - lsp = {}, - }, - { - "cssls", - enabled = nixCats('typescript') or false, - lsp = {}, - }, - { - "yamlls", - enabled = nixCats('yaml') or false, - lsp = {}, - }, - { - "clangd", - enabled = nixCats('c') or false, - lsp = {}, - }, - { - "gopls", - enabled = nixCats("go") or false, - lsp = { - -- filetypes = { "go", "gomod", "gowork", "gotmpl" }, - }, - }, - { - "gitlab_ci_ls", - enabled = nixCats("gitlab") or false, - lsp = {}, - }, - { - "omnisharp", - enabled = nixCats("csharp") or false, - lsp = { - -- filetypes = { "go", "gomod", "gowork", "gotmpl" }, - }, - }, - { - "tinymist", - enabled = nixCats("notes") or false, - lsp = {}, - }, - { - "nixd", - enabled = nixCats('nix') or false, - lsp = { - filetypes = { 'nix' }, - settings = { - nixd = { - nixpkgs = { - expr = nixCats.extra("nixdExtras.nixpkgs") or [[import {}]], - }, - formatting = { - command = { "alejandra" } - }, - diagnostic = { - suppress = { - "sema-escaping-with" - } - } - } - }, - }, - }, -} diff --git a/modules/nixos/neovim.nix b/modules/nixos/neovim.nix new file mode 100644 index 0000000..efe04a3 --- /dev/null +++ b/modules/nixos/neovim.nix @@ -0,0 +1,5 @@ +{pkgs, inputs, ...}: { + environment.systemPackages = [ + inputs.neovim-nightly-overlay.packages.${pkgs.system}.default + ]; +}