diff --git a/flake.lock b/flake.lock index 87de0df..3668904 100644 --- a/flake.lock +++ b/flake.lock @@ -241,6 +241,22 @@ } }, "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1777699697, + "narHash": "sha256-Eg9b/rq/ECYwNwEXs5i9wHyhxNI0JrYx2srdI2uZMaQ=", + "ref": "refs/heads/main", + "rev": "382052b74656a369c5408822af3f2501e9b1af81", + "revCount": 94, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1751685974, @@ -257,7 +273,7 @@ "flake-parts": { "inputs": { "nixpkgs-lib": [ - "nixvim", + "nvf", "nixpkgs" ] }, @@ -654,6 +670,21 @@ "type": "github" } }, + "mnw": { + "locked": { + "lastModified": 1780772958, + "narHash": "sha256-VKKe8r4pwCGWZ3Yr9CPN129R4S3CKLSrlYqdYz3vKpM=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "0871dbf63a53610c95db04439ed8ea4d6ec9c160", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, "niri": { "inputs": { "niri-stable": "niri-stable", @@ -795,28 +826,6 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems" - }, - "locked": { - "lastModified": 1782913335, - "narHash": "sha256-7ieA05HSzb6uH7x+6LjwsYETrYUdkIbhtMMOijJ0pag=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "be307b6b8fe5745095b2de8587bed94a46b06c5f", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, "nu_plugin_dbus": { "inputs": { "crane": "crane_3", @@ -839,6 +848,30 @@ "url": "https://knot.bwc9876.dev/did:plc:2oab3hjwitemxd3mycmqoz3t" } }, + "nvf": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts", + "mnw": "mnw", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1782841360, + "narHash": "sha256-S1f/S5Vv7wURVUtzPkmAFlKPVciaPLXxoeg7/GCnl28=", + "owner": "NotAShelf", + "repo": "nvf", + "rev": "6fad9e9a998dd3a7783c839ce2928877d3e5a883", + "type": "github" + }, + "original": { + "owner": "NotAShelf", + "repo": "nvf", + "type": "github" + } + }, "pre-commit": { "inputs": { "flake-compat": "flake-compat", @@ -876,8 +909,8 @@ "nix-index-db": "nix-index-db", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", - "nixvim": "nixvim", "nu_plugin_dbus": "nu_plugin_dbus", + "nvf": "nvf", "spoon": "spoon", "tangled": "tangled", "tranquil": "tranquil", @@ -1002,16 +1035,15 @@ }, "systems": { "locked": { - "lastModified": 1774449309, - "narHash": "sha256-brhZ8DmuGtzkCYHJg4HEd602amKm89Y9ytsFZ5uWD1w=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", "repo": "default", - "rev": "c29398b59d2048c4ab79345812849c9bd15e9150", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "ref": "future-26.11", "repo": "default", "type": "github" } @@ -1036,7 +1068,7 @@ "actor-typeahead-src": "actor-typeahead-src", "fenix": "fenix_3", "fetch-tangled": "fetch-tangled", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "gomod2nix": "gomod2nix", "hls-src": "hls-src", "htmx-src": "htmx-src", diff --git a/flake.nix b/flake.nix index 9517806..f60b72a 100644 --- a/flake.nix +++ b/flake.nix @@ -35,8 +35,8 @@ # flake = false; # }; - nixvim.url = "github:nix-community/nixvim"; - nixvim.inputs.nixpkgs.follows = "nixpkgs"; + nvf.url = "github:NotAShelf/nvf"; + nvf.inputs.nixpkgs.follows = "nixpkgs"; impermanence.url = "github:nix-community/impermanence"; impermanence.inputs.nixpkgs.follows = "nixpkgs"; @@ -73,7 +73,7 @@ fenix, catppuccin, # cat-stylus, - nixvim, + nvf, impermanence, nu_plugin_dbus, bingus, @@ -102,11 +102,11 @@ _module.args = {inherit inputs;}; imports = let deps = [ - inputs.nixvim.homeModules.nixvim inputs.nix-index-db.homeModules.nix-index inputs.catppuccin.homeModules.catppuccin inputs.niri.homeModules.niri inputs.wayland-mpris-idle-inhibit.homeModules.default + inputs.nvf.homeManagerModules.default ]; myMods = lib.mapAttrsToList (k: v: ./homeModules/${k}) (builtins.readDir ./homeModules); in diff --git a/homeModules/firefox.nix b/homeModules/firefox.nix index c1ea7e6..82cbd1a 100644 --- a/homeModules/firefox.nix +++ b/homeModules/firefox.nix @@ -363,10 +363,6 @@ in { mkEngineForceFavicon ["@nixissues"] "https://github.com/NixOS/nixpkgs/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+{searchTerms}" "https://github.githubassets.com/favicons/favicon-dark.svg"; - "NixVim Options" = - mkEngineForceFavicon ["@nixvim"] - "https://nix-community.github.io/nixvim/search/?option_scope=0&query={searchTerms}" - "https://nix-community.github.io/nixvim/search/favicon.ico"; # Media "youtube" = mkEngine ["@yt"] "https://www.youtube.com/results?search_query={searchTerms}" "ico"; diff --git a/homeModules/gdi.nix b/homeModules/gdi.nix index 52575cb..9cfedfe 100644 --- a/homeModules/gdi.nix +++ b/homeModules/gdi.nix @@ -69,7 +69,6 @@ ++ (lib.optional config.cow.keepassxc.enable pkgs.keepassxc) ++ (lib.optional config.cow.qmplay2.enable pkgs.qmplay2) ++ (lib.optional config.cow.firefox.enable config.programs.firefox.package) - ++ (lib.optional config.cow.neovim.enable config.programs.nixvim.build.package) ++ (lib.optional config.cow.kitty.enable config.programs.kitty.package); }; @@ -262,7 +261,7 @@ spawnRofi "-show" "calc" "-modi" "calc" "-no-show-match" "-no-sort" "-calc-command" "echo -n '{result}' | wl-copy"; "Mod+V".action = - spawnSh "cliphist list | sed -r 's/\[\[ binary data (.* .iB) (.*) (.*) \]\]/ 󰋩 \2 Image (\3, \1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy"; + spawnSh "cliphist list | sed -r 's/\\[\\[ binary data (.* .iB) (.*) (.*) \\]\\]/ 󰋩 \\2 Image (\\3, \\1)/g' | rofi -dmenu -display-columns 2 -p Clipboard | cliphist decode | wl-copy"; "Mod+Alt+V".action = spawnSh "echo -e \"Yes\\nNo\" | [[ $(rofi -dmenu -mesg \"Clear Clipboard History?\" -p Clear) == \"Yes\" ]] && cliphist wipe"; @@ -500,7 +499,6 @@ dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; services = { - gnome-keyring.enable = lib.mkForce false; swaync = { diff --git a/homeModules/nvim.nix b/homeModules/nvim.nix index b2d2b69..8b735c6 100644 --- a/homeModules/nvim.nix +++ b/homeModules/nvim.nix @@ -1,846 +1,211 @@ { - pkgs, config, lib, ... }: { - options.cow.neovim.enable = lib.mkEnableOption "Neovim + Nixvim + Customizations"; + options.cow.neovim.enable = lib.mkEnableOption "Neovim + Nvf + Customizations"; config = lib.mkIf config.cow.neovim.enable { cow.imperm.keep = [".local/share/nvim"]; home.sessionVariables.EDITOR = "nvim"; - programs.nixvim = { - # Meta - + programs.nvf = let + dev = config.cow.dev; + ifCat = lib.mkIf config.cow.cat.enable; + in { enable = true; - enableMan = false; - defaultEditor = true; - viAlias = true; - vimAlias = true; - - nixpkgs.pkgs = pkgs; - - performance = { - byteCompileLua = { - enable = true; - nvimRuntime = true; - plugins = true; - }; - combinePlugins = { - enable = true; - }; - }; - - # Theming - - colorschemes.catppuccin = lib.mkIf config.cow.cat.enable { - enable = true; - settings = { - inherit (config.catppuccin) flavor; - no_underline = false; - no_bold = false; - no_italics = false; - term_colors = true; - integrations = { - fidget = true; - markdown = true; - ufo = true; - rainbow_delimiters = true; - lsp_trouble = true; - which_key = true; - telescope.enabled = true; - treesitter = true; - lsp_saga = true; - illuminate = { - enabled = true; - lsp = true; - }; - neotree = true; - native_lsp = { - enabled = true; - inlay_hints = { - background = true; - }; - virtual_text = { - errors = ["italic"]; - hints = ["italic"]; - information = ["italic"]; - warnings = ["italic"]; - ok = ["italic"]; - }; - underlines = { - errors = ["underline"]; - hints = ["underline"]; - information = ["underline"]; - warnings = ["underline"]; - }; - }; + settings = { + vim = { + viAlias = true; + vimAlias = true; + debugMode = { + enable = false; }; - }; - }; - # Misc. Global Options + utility.sleuth.enable = true; - extraConfigLua = '' - vim.diagnostic.config({ - signs = { - text = { - [vim.diagnostic.severity.ERROR] = "", - [vim.diagnostic.severity.WARN] = "", - }, - }, - }) - ''; - - opts = { - number = true; - relativenumber = true; - smartindent = true; - cursorline = true; - showtabline = 2; - tabstop = 2; - shiftwidth = 2; - breakindent = true; - fillchars.__raw = "[[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]"; - foldcolumn = "1"; - foldlevel = 100; - foldlevelstart = 100; - foldenable = true; - mouse = ""; - }; - - # Allow system clipboard copying if graphical env is enabled - clipboard.providers.wl-copy.enable = lib.mkDefault config.cow.gdi.enable; - - # Associate .mdx extension to mdx buffer type - filetype.extension = { - mdx = "mdx"; - }; - - # Auto Run Commands + lsp = { + enable = true; + formatOnSave = true; + trouble.enable = true; + otter-nvim.enable = true; + nvim-docs-view.enable = true; + }; - autoCmd = [ - { - group = "restore_cursor"; - event = ["BufReadPost"]; - pattern = "*"; - callback.__raw = '' - function() - if - vim.fn.line "'\"" > 1 - and vim.fn.line "'\"" <= vim.fn.line "$" - and vim.bo.filetype ~= "commit" - and vim.fn.index({ "xxd", "gitrebase" }, vim.bo.filetype) == -1 - then - vim.cmd "normal! g`\"" - end - end - ''; - } - ]; + languages = { + enableFormat = true; + enableTreesitter = true; + enableExtraDiagnostics = true; - autoGroups = { - # Try to restore cursor to the last position it was at last time this file was opened - restore_cursor = {}; - }; + bash.enable = true; + nu.enable = true; + just.enable = true; - # Keybinds + nix.enable = dev.nix; - # globals.mapleader = " "; + clang.enable = dev.c; + cmake.enable = dev.c; - keymaps = let - prefixMap = group: - builtins.map (k: { - action = "${ - if group ? "cmdPrefix" - then group.cmdPrefix + " " - else "" - }${k.action}"; - key = "${group.prefix}${k.key}"; - options = k.options; - }) - group.keys; - in - lib.lists.flatten ( - builtins.map (g: - if g ? "group" - then prefixMap g - else g) [ - { - action = ''"+p''; - key = ""; - options.desc = "Paste from system clipboard"; - } - { - action = ''"+y''; - key = ""; - options.desc = "Copy to system clipboard"; - } - { - action = ''"+x''; - key = ""; - options.desc = "Cut to system clipboard"; - } - { - action = "Format"; - key = ""; - options.desc = "Format Buffer"; - } - { - group = "Tab Navigation"; - prefix = ""; - keys = [ - { - action = "BufferLineCycleNext"; - key = "e"; - options.desc = "Next Tab"; - } - { - action = "BufferLineCyclePrev"; - key = "q"; - options.desc = "Previous Tab"; - } - { - action = "Neotree toggle reveal"; - key = "t"; - options.desc = "Toggle Neotree"; - } - ]; - } - { - group = "Tab Closing"; - prefix = ""; - keys = [ - { - action = "BufferLineCloseLeft"; - key = "q"; - options.desc = "Close Tab Left"; - } - { - action = "BufferLineCloseRight"; - key = "e"; - options.desc = "Close Tab Right"; - } - { - action = "BufferLinePickClose"; - key = ""; - options.desc = "Pick Tab and Close"; - } - { - action = "BufferLineCloseOthers"; - key = "w"; - options.desc = "Close Other Tabs"; - } - ]; - } - { - action = "Bdelete"; - key = ""; - options.desc = "Close Current Buffer"; - } - { - group = "LSP Actions"; - prefix = ""; - cmdPrefix = "Lspsaga"; - keys = [ - { - action = "code_action code_action"; - key = "a"; - options.desc = "Code Actions"; - } - { - action = "rename"; - key = "r"; - options.desc = "LSP Rename"; - } - { - action = "diagnostic_jump_next"; - key = "e"; - options.desc = "Next Diagnostic"; - } - { - action = "diagnostic_jump_previous"; - key = "E"; - options.desc = "Previous Diagnostic"; - } - { - action = "goto_definition"; - key = "d"; - options.desc = "Jump to Definition"; - } - { - action = "peek_definition"; - key = "D"; - options.desc = "Peek Definition"; - } - { - action = "finder ref"; - key = "fr"; - options.desc = "Find References"; - } - { - action = "finder imp"; - key = "fi"; - options.desc = "Find Implementations"; - } - { - action = "finder def"; - key = "fd"; - options.desc = "Find Definitions"; - } - { - action = "finder"; - key = "ff"; - options.desc = "Finder"; - } - { - action = "hover_doc"; - key = "h"; - options.desc = "Hover Doc"; - } - ]; - } - { - group = "Telescope"; - prefix = " "; - cmdPrefix = "Telescope"; - keys = [ - { - key = "u"; - action = "undo"; - options.desc = "Undo Tree"; - } - { - key = "c"; - action = "commands"; - options.desc = "Browse Commands"; - } - { - key = "w"; - action = "spell_suggest"; - options.desc = "Spell Suggest"; - } - { - key = "s"; - action = "lsp_document_symbols"; - options.desc = "LSP Symbols"; - } - { - key = "t"; - action = "treesitter"; - options.desc = "Treesitter Symbols"; - } - { - key = "f"; - action = "find_files"; - options.desc = "Files"; - } - { - key = "gs"; - action = "git_status"; - options.desc = "Git Status"; - } - { - key = "gb"; - action = "git_branches"; - options.desc = "Git Branches"; - } - { - key = "gc"; - action = "git_commits"; - options.desc = "Git Commits"; - } - { - key = "r"; - action = "oldfiles"; - options.desc = "Recent Files"; - } - { - key = "l"; - action = "live_grep"; - options.desc = "Live Grep"; - } - ]; - } - { - action.__raw = "[[]]"; - mode = ["t"]; - key = ""; - } - { - action.__raw = "[[]]"; - mode = ["t"]; - key = ""; - } - { - action = "WhichKey"; - key = ""; - } - ] - ); + css.enable = dev.web; + html.enable = dev.web; + json.enable = dev.web; + typescript.enable = dev.web; + markdown.enable = dev.web; + astro.enable = dev.web; + astro.format.enable = false; - # Plugins + python.enable = dev.python; - dependencies = { - fd.enable = true; - ripgrep.enable = true; - tree-sitter.enable = true; - }; + typst.enable = dev.typst; - extraPlugins = with pkgs.vimPlugins; - (lib.optional config.cow.dev.web {plugin = pkgs.nvim-mdx;}) - ++ [ - {plugin = flatten-nvim;} # Opens neovim invocations in terminal windows in the current Neovim session - {plugin = satellite-nvim;} # Scrollbar - {plugin = tiny-devicons-auto-colors-nvim;} # Color language icons - ]; + rust = { + enable = dev.rust; + extensions.crates-nvim.enable = dev.rust; + }; + toml.enable = dev.rust; - plugins = { - # Navigation + csharp.enable = dev.dotnet; - # Interactive Fuzzy Search w/ various providers - telescope = { - enable = true; - settings.defaults = { - layout_config.prompt_position = "top"; + haskell.enable = dev.haskell; }; - extensions = { - file-browser.enable = true; - ui-select.enable = true; - undo.enable = true; - }; - }; - - # Highlight current row - illuminate.enable = true; - # Underline matching token in buffer - cursorline.enable = true; - - # Nicer bdelete - bufdelete.enable = true; - # Tab bar - bufferline = { - enable = true; - settings.highlights.__raw = lib.mkIf config.cow.cat.enable '' - require("catppuccin.special.bufferline").get_theme() - ''; - settings.options = { - indicator.style = "none"; - show_buffer_close_icons = false; - show_close_icon = false; - offsets = [ - { - filetype = "neo-tree"; - highlight = "String"; - text = "Files"; - text_align = "center"; - # separator = true; - } - ]; - separator_style = "slant"; - hover = { - enabled = true; - delay = 150; - reveal = ["close"]; - }; - sort_by = "insert_at_end"; - diagnostics = "nvim_lsp"; - diagnostics_indicator.__raw = '' - function(count, level, diagnostics_dict, context) - local icon = level:match("error") and " " or " " - return " " .. icon .. count - end - ''; + visuals = { + nvim-web-devicons.enable = true; + nvim-cursorline.enable = true; + rainbow-delimiters.enable = true; + cinnamon-nvim.enable = true; + highlight-undo.enable = true; }; - }; - # Tree file manager - neo-tree = { - enable = true; - settings = { - hide_root_node = false; - follow_current_file.enabled = true; - add_blank_line_at_top = true; - default_component_configs = { - container.right_padding = 2; - name.trailing_slash = true; - indent = { - indent_size = 2; - with_expanders = true; - }; - }; - window.width = 40; - auto_clean_after_session_restore = true; - close_if_last_window = true; - filesystem.components.name.__raw = '' - function(config, node, state) - local components = require('neo-tree.sources.common.components') - local name = components.name(config, node, state) - if node:get_depth() == 1 then - name.text = vim.fs.basename(vim.loop.cwd() or "") .. "/" - end - return name - end - ''; + statusline.lualine = { + enable = true; }; - }; - - # In-buffer UI/tweaks - - # Toggle relativenumber off when inserting - numbertoggle.enable = true; - - # Folding implementation - nvim-ufo.enable = true; - - # Nicer indenting - indent-o-matic.enable = true; - intellitab.enable = true; - - # Image Previews - image.enable = true; - # Color Picker - ccc = { - enable = true; - settings = { - inputs = [ - "ccc.input.rgb" - "ccc.input.hsl" - "ccc.input.hwb" - "ccc.input.lab" - "ccc.input.lch" - "ccc.input.oklab" - "ccc.input.oklch" - "ccc.input.cmyk" - "ccc.input.hsluv" - "ccc.input.okhsl" - "ccc.input.hsv" - "ccc.input.okhsv" - "ccc.input.xyz" - ]; + theme = ifCat { + enable = true; + name = "catppuccin"; + style = "mocha"; + transparent = false; }; - }; - # Completions - cmp = { - enable = true; - settings = { - sources = map (name: {inherit name;}) [ - "nvim_lsp" - "nvim_lsp_signature_help" - "spell" - "path" - "buffer" - ]; - mapping = { - "" = "cmp.mapping.abort()"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - }; + autocomplete.blink-cmp = { + enable = true; + setupOpts.cmdline.completion.ghost_text.enabled = false; }; - }; - # Color-coded matching symbols - rainbow-delimiters.enable = true; - - # Line number column + LSP + folding + etc. - statuscol = { - enable = true; - settings.segments = let - dispCond = { - __raw = '' - function(ln) - return vim.bo.filetype ~= "neo-tree" + filetree.neo-tree = { + enable = true; + setupOpts = { + hide_root_node = false; + follow_current_file.enabled = true; + add_blank_line_at_top = true; + default_component_configs = { + container.right_padding = 2; + name.trailing_slash = true; + indent = { + indent_size = 2; + with_expanders = true; + }; + }; + window.width = 40; + auto_clean_after_session_restore = true; + close_if_last_window = true; + filesystem.components.name = lib.generators.mkLuaInline '' + function(config, node, state) + local components = require('neo-tree.sources.common.components') + local name = components.name(config, node, state) + if node:get_depth() == 1 then + name.text = vim.fs.basename(vim.loop.cwd() or "") .. "/" + end + return name end ''; }; - in [ - { - click = "v:lua.ScSa"; - condition = [ - dispCond - ]; - text = [ - "%s" - ]; - } - { - click = "v:lua.ScLa"; - condition = [dispCond]; - text = [ - { - __raw = "require('statuscol.builtin').lnumfunc"; - } - ]; - } - { - click = "v:lua.ScFa"; - condition = [ - dispCond - { - __raw = "require('statuscol.builtin').not_empty"; - } - ]; - text = [ - { - __raw = "require('statuscol.builtin').foldfunc"; - } - " " - ]; - } - ]; - }; - - # Informational bottom line - lualine = { - enable = true; - settings = { - extensions = [ - "trouble" - "toggleterm" - ]; - - options = { - # theme = lib.mkIf config.cow.cat.enable "catppuccin"; - disabled_filetypes = ["neo-tree"]; - ignore_focus = ["neo-tree"]; - }; }; - }; - # New Windows - - # Nice notifications and progress indicator - fidget = { - enable = true; - settings.notification = { - override_vim_notify = true; - window = { - y_padding = 2; - x_padding = 2; - zindex = 50; - align = "top"; - winblend = 0; + tabline = { + nvimBufferline = { + enable = true; + setupOpts.options = { + numbers = "none"; + indicator.style = "none"; + show_buffer_close_icons = false; + show_close_icon = false; + offsets = [ + { + filetype = "neo-tree"; + highlight = "String"; + text = "Files"; + text_align = "center"; + # separator = true; + } + ]; + separator_style = "slant"; + hover = { + enabled = true; + delay = 150; + reveal = ["close"]; + }; + sort_by = "insert_at_end"; + diagnostics = "nvim_lsp"; + diagnostics_indicator = lib.generators.mkLuaInline '' + function(count, level, diagnostics_dict, context) + local icon = level:match("error") and " " or " " + return " " .. icon .. count + end + ''; + }; }; }; - }; - # Interactive keybind helper - which-key = { - enable = true; - settings = { - show_help = true; - preset = "modern"; - win.wo.winblend = 8; + treesitter = { + indent.enable = true; }; - }; - - # Toggle a Terminal Window - toggleterm = { - enable = true; - luaConfig.post = '' - local flatten = require('flatten') - ---@type Terminal? - local saved_terminal + binds = { + whichKey.enable = true; + cheatsheet.enable = true; + }; - flatten.setup({ - hooks = { - should_block = function(argv) - return vim.tbl_contains(argv, "-b") - end, - pre_open = function() - local term = require("toggleterm.terminal") - local termid = term.get_focused_id() - saved_terminal = term.get(termid) - end, - post_open = function(opts) - if saved_terminal then - saved_terminal:close() - else - vim.api.nvim_set_current_win(opts.winnr) - end + telescope.enable = true; - if opts.filetype == "gitcommit" or opts.filetype == "gitrebase" then - vim.api.nvim_create_autocmd("BufWritePost", { - buffer = opts.bufnr, - once = true, - callback = vim.schedule_wrap(function() - require('bufdelete').bufdelete(opts.bufnr, true) - end), - }) - end - end, - block_end = function() - vim.schedule(function() - if saved_terminal then - saved_terminal:open() - saved_terminal = nil - end - end) - end, - }, - window = { - open = "alternate", - }, - }) - ''; - settings = { - size = 20; - open_mapping = "[[]]"; - direction = "horizontal"; - start_in_insert = true; - insert_mappings = true; - terminal_mappings = true; + git = { + enable = true; + gitsigns.enable = true; + gitsigns.codeActions.enable = false; }; - }; - # Language Integration and LSPs + notify.nvim-notify.enable = true; - # Provider for syntax highlighting, symbols, etc. when not using an LSP - treesitter = { - enable = true; - settings = { - highlight = { - enable = true; - additional_vim_regex_highlighting = false; - }; - indent.enable = true; + terminal.toggleterm = { + enable = true; }; - }; - # Formatting code using multiple providers - conform-nvim = { - enable = true; - settings = { - formatters.treefmt = { - require_cwd = false; - }; - formatters_by_ft = { - "*" = ["treefmt"]; - }; - default_format_opts = { - lsp_format = "fallback"; - }; + diagnostics.config.signs.text = { + "[vim.diagnostic.severity.ERROR]" = ""; + "[vim.diagnostic.severity.WARN]" = ""; }; - # Taken from https://github.com/stevearc/conform.nvim/blob/master/doc/recipes.md#format-command - 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({ range = range, timeout_ms = 5000 }) - end, { range = true }) - ''; - }; - - # Common buffer type associations to activate LSPs - lspconfig.enable = true; - # UI for many LSP features - lspsaga = { - enable = true; - settings = { - symbol_in_winbar.enable = false; - implement.enable = false; - lightbulb.enable = false; - ui = { - code_action = "󰛨"; - actionfix = "󰖷"; - }; - hover = { - openCmd = "!xdg-open"; - openLink = "o"; - maxWidth = 0.5; - maxHeight = 0.4; - }; - rename.autoSave = true; - finder = { - keys.close = ""; - }; - codeAction.keys.quit = ""; + ui = { + borders.enable = true; + noice.enable = true; + colorizer.enable = true; + illuminate.enable = true; }; - }; - - # Get latest version of deps in a Cargo.toml as inline hints - crates.enable = lib.mkDefault config.cow.dev.rust; - - # Better TS LSP, etc. - typescript-tools.enable = lib.mkDefault config.cow.dev.web; - # Typst preview - typst-preview.enable = config.cow.dev.typst; - - # Misc. UI - - # UI and provider for diagnostics - trouble = { - enable = true; - }; - - # Icons used in many places for languages - web-devicons.enable = true; - }; - - lsp = lib.mkDefault { - inlayHints.enable = true; - - servers = let - inherit - (config.cow.dev) - dotnet - python - haskell - rust - web - c - typst - ; - in { - clangd.enable = c; - tinymist.enable = typst; - astro.enable = web; - hls = lib.mkIf haskell { - enable = true; - # ghcPackage = pkgs.haskell.compiler.ghc912; - package = pkgs.haskell.packages.ghc912.haskell-language-server; + opts = { + mouse = ""; }; - mdx_analyzer = lib.mkIf web { - enable = true; - package = pkgs.mdx-language-server; - }; - # ts_ls.enable = web; - html.enable = web; - emmet_language_server.enable = web; - marksman.enable = web; - cssls.enable = web; - jsonls.enable = web; - yamlls.enable = web; - ruff.enable = python; - csharp_ls.enable = dotnet; - nil_ls.enable = true; - bashls.enable = true; - nushell.enable = config.cow.nushell.enable; - taplo.enable = rust; - typos_lsp.enable = true; - rust_analyzer = lib.mkIf rust { - enable = true; - package = pkgs.rust-analyzer-nightly; - packageFallback = true; - }; - lemminx.enable = web; - eslint.enable = web; - just.enable = config.cow.utils.enable; + + keymaps = [ + { + key = ""; + mode = "n"; + silent = true; + action = ":Neotree toggle reveal"; + } + ]; }; }; };