diff --git a/config/dashboard.nix b/config/dashboard.nix index a56ca06..5de9b32 100644 --- a/config/dashboard.nix +++ b/config/dashboard.nix @@ -70,8 +70,7 @@ { type = "button"; val = "  Find File "; - on_press.__raw = - "function() require('telescope.builtin').find_files() end"; + on_press.__raw = "function() require('telescope.builtin').find_files() end"; opts = { shortcut = "f"; keymap = [ @@ -97,8 +96,7 @@ { type = "button"; val = "  Recent Files "; - on_press.__raw = - "function() require('telescope.builtin').oldfiles() end"; + on_press.__raw = "function() require('telescope.builtin').oldfiles() end"; opts = { shortcut = "r"; keymap = [ @@ -124,8 +122,7 @@ { type = "button"; val = "  Find Text "; - on_press.__raw = - "function() require('telescope.builtin').live_grep() end"; + on_press.__raw = "function() require('telescope.builtin').live_grep() end"; opts = { shortcut = "g"; keymap = [ diff --git a/config/debugging.nix b/config/debugging.nix index a48d6fc..ac4a3a2 100644 --- a/config/debugging.nix +++ b/config/debugging.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { plugins = { cmp-dap.enable = true; dap = { @@ -6,9 +6,9 @@ extensions = { dap-ui = { enable = true; - floating.mappings = { close = [ "" "q" ]; }; + floating.mappings = {close = ["" "q"];}; }; - dap-virtual-text = { enable = true; }; + dap-virtual-text = {enable = true;}; }; signs = { dapBreakpoint = { @@ -31,8 +31,7 @@ { mode = "n"; key = "dB"; - action = - "\n lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))\n "; + action = "\n lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))\n "; options = { silent = true; desc = "Breakpoint Condition"; @@ -192,7 +191,7 @@ }; } { - mode = [ "n" "v" ]; + mode = ["n" "v"]; key = "de"; action = "lua require('dapui').eval()"; options = { @@ -203,9 +202,8 @@ { mode = "n"; key = "df"; - action = - "lua require('dap.ext.vscode').load_launchjs()Telescope dap configurations"; - options = { desc = "Debug Configurations"; }; + action = "lua require('dap.ext.vscode').load_launchjs()Telescope dap configurations"; + options = {desc = "Debug Configurations";}; } ]; @@ -216,5 +214,5 @@ require('dap').listeners.before.event_exited['dapui_config'] = require('dapui').close ''; - extraPlugins = [ (pkgs.vimPlugins.telescope-dap-nvim) ]; + extraPlugins = [(pkgs.vimPlugins.telescope-dap-nvim)]; } diff --git a/config/default.nix b/config/default.nix index 33dbcbd..9537074 100644 --- a/config/default.nix +++ b/config/default.nix @@ -7,8 +7,7 @@ let # Create a list of import statements imports = map (name: ./. + "/${name}") nixFiles; -in -{ +in { # Import all configuration modules automatically imports = imports; } diff --git a/config/find.nix b/config/find.nix index ebe163e..e754b0f 100644 --- a/config/find.nix +++ b/config/find.nix @@ -5,11 +5,11 @@ keymaps = { "/" = { action = "live_grep"; - options = { desc = "Live Grep"; }; + options = {desc = "Live Grep";}; }; "," = { action = "buffers"; - options = { desc = "Switch Buffer"; }; + options = {desc = "Switch Buffer";}; settings = { sort_mru = true; sort_lastused = true; @@ -17,39 +17,39 @@ }; "ff" = { action = "files"; - options = { desc = "Find Files"; }; + options = {desc = "Find Files";}; }; "fr" = { action = "oldfiles"; - options = { desc = "Recent Files"; }; + options = {desc = "Recent Files";}; }; "gc" = { action = "git_commits"; - options = { desc = "Git Commits"; }; + options = {desc = "Git Commits";}; }; "gs" = { action = "git_status"; - options = { desc = "Git Status"; }; + options = {desc = "Git Status";}; }; "s\"" = { action = "registers"; - options = { desc = "Registers"; }; + options = {desc = "Registers";}; }; "sd" = { action = "diagnostics_document"; - options = { desc = "Document Diagnostics"; }; + options = {desc = "Document Diagnostics";}; }; "sD" = { action = "diagnostics_workspace"; - options = { desc = "Workspace Diagnostics"; }; + options = {desc = "Workspace Diagnostics";}; }; "sh" = { action = "help_tags"; - options = { desc = "Help Pages"; }; + options = {desc = "Help Pages";}; }; "sk" = { action = "keymaps"; - options = { desc = "Key Maps"; }; + options = {desc = "Key Maps";}; }; }; }; @@ -59,11 +59,9 @@ keymaps = { todoTelescope = { key = "st"; - keywords = [ "TODO" ]; + keywords = ["TODO"]; }; }; }; }; - } - diff --git a/config/keys.nix b/config/keys.nix index 4aa544e..bb8a214 100644 --- a/config/keys.nix +++ b/config/keys.nix @@ -64,19 +64,19 @@ mode = "i"; key = "jk"; action = "noh"; - options = { desc = "Normal mode and clear highlight"; }; + options = {desc = "Normal mode and clear highlight";}; } { mode = "i"; key = ""; action = "noh"; - options = { desc = "Normal mode and clear highlight"; }; + options = {desc = "Normal mode and clear highlight";}; } { mode = "n"; key = ""; action = "noh"; - options = { desc = "Normal mode and clear highlight"; }; + options = {desc = "Normal mode and clear highlight";}; } # Add undo breakpoints @@ -84,26 +84,26 @@ mode = "i"; key = ","; action = ",u"; - options = { desc = "Undo breakpoint"; }; + options = {desc = "Undo breakpoint";}; } { mode = "i"; key = "."; action = ".u"; - options = { desc = "Undo breakpoint"; }; + options = {desc = "Undo breakpoint";}; } { mode = "i"; key = ";"; action = ";u"; - options = { desc = "Undo breakpoint"; }; + options = {desc = "Undo breakpoint";}; } { mode = "n"; key = "e"; action = "Neotree toggle"; - options = { desc = "Toggle tree view"; }; + options = {desc = "Toggle tree view";}; } # Database @@ -111,49 +111,45 @@ mode = "n"; key = "Du"; action = "DBUI"; - options = { desc = "Show Database UI"; }; + options = {desc = "Show Database UI";}; } # LSP Actions { mode = "n"; key = "gd"; - action = - "FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true"; - options = { desc = "Goto Definition"; }; + action = "FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true"; + options = {desc = "Goto Definition";}; } { mode = "n"; key = "gr"; - action = - "FzfLua lsp_references jump_to_single_result=true ignore_current_line=true"; - options = { desc = "References"; }; + action = "FzfLua lsp_references jump_to_single_result=true ignore_current_line=true"; + options = {desc = "References";}; } { mode = "n"; key = "gI"; - action = - "FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true"; - options = { desc = "Goto Implementation"; }; + action = "FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true"; + options = {desc = "Goto Implementation";}; } { mode = "n"; key = "gy"; - action = - "FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true"; - options = { desc = "Goto T[y]pe Definition"; }; + action = "FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true"; + options = {desc = "Goto T[y]pe Definition";}; } { mode = "n"; key = "cd"; action = "lua vim.diagnostic.open_float()"; - options = { desc = "Popup Diagnostics"; }; + options = {desc = "Popup Diagnostics";}; } { mode = "n"; key = "cD"; action = "Trouble diagnostics toggle"; - options = { desc = "List All Diagnostics"; }; + options = {desc = "List All Diagnostics";}; } # SOPS @@ -161,13 +157,13 @@ mode = "n"; key = "od"; action = "!sops -d -i %"; - options = { desc = "Decrypt SOPS File"; }; + options = {desc = "Decrypt SOPS File";}; } { mode = "n"; key = "oe"; action = "!sops -e -i %"; - options = { desc = "Encrypt SOPS File"; }; + options = {desc = "Encrypt SOPS File";}; } # Git @@ -175,53 +171,53 @@ mode = "n"; key = "gg"; action = "LazyGit"; - options = { desc = "LazyGit"; }; + options = {desc = "LazyGit";}; } # Windows { key = ""; action = "wincmd h"; - options = { desc = "Navigate Window Left"; }; + options = {desc = "Navigate Window Left";}; } { key = ""; action = "wincmd j"; - options = { desc = "Navigate Window Down"; }; + options = {desc = "Navigate Window Down";}; } { key = ""; action = "wincmd k"; - options = { desc = "Navigate Window Up"; }; + options = {desc = "Navigate Window Up";}; } { key = ""; action = "wincmd l"; - options = { desc = "Navigate Window Right"; }; + options = {desc = "Navigate Window Right";}; } { mode = "n"; key = "w"; action = ""; - options = { desc = "Windows"; }; + options = {desc = "Windows";}; } { mode = "n"; key = "-"; action = "s"; - options = { desc = "Split Window Below"; }; + options = {desc = "Split Window Below";}; } { mode = "n"; key = "|"; action = "v"; - options = { desc = "Split Window Right"; }; + options = {desc = "Split Window Right";}; } { mode = "n"; key = "wd"; action = "c"; - options = { desc = "Delete Window"; }; + options = {desc = "Delete Window";}; } # Tabs @@ -229,43 +225,43 @@ mode = "n"; key = "l"; action = "tablast"; - options = { desc = "Last Tab"; }; + options = {desc = "Last Tab";}; } { mode = "n"; key = "o"; action = "tabonly"; - options = { desc = "Close Other Tabs"; }; + options = {desc = "Close Other Tabs";}; } { mode = "n"; key = "f"; action = "tabfirst"; - options = { desc = "First Tab"; }; + options = {desc = "First Tab";}; } { mode = "n"; key = ""; action = "tabnew"; - options = { desc = "New Tab"; }; + options = {desc = "New Tab";}; } { mode = "n"; key = "]"; action = "tabnext"; - options = { desc = "Next Tab"; }; + options = {desc = "Next Tab";}; } { mode = "n"; key = "d"; action = "tabclose"; - options = { desc = "Close Tab"; }; + options = {desc = "Close Tab";}; } { mode = "n"; key = "["; action = "tabprevious"; - options = { desc = "Previous Tab"; }; + options = {desc = "Previous Tab";}; } # Buffer @@ -273,55 +269,55 @@ mode = "n"; key = ""; action = "bprevious"; - options = { desc = "Previous Buffer"; }; + options = {desc = "Previous Buffer";}; } { mode = "n"; key = ""; action = "bnext"; - options = { desc = "Next Buffer"; }; + options = {desc = "Next Buffer";}; } { mode = "n"; key = "bb"; action = "e #"; - options = { desc = "Switch To Other Buffer"; }; + options = {desc = "Switch To Other Buffer";}; } { mode = "n"; key = "bd"; action = "bd"; - options = { desc = "Delete Buffer and Window"; }; + options = {desc = "Delete Buffer and Window";}; } { mode = "n"; key = "bp"; action = "BufferLineTogglePin"; - options = { desc = "Toggle Pin"; }; + options = {desc = "Toggle Pin";}; } { mode = "n"; key = "bP"; action = "BufferLineGroupClose ungrouped"; - options = { desc = "Delete Non-Pinned Buffers"; }; + options = {desc = "Delete Non-Pinned Buffers";}; } { mode = "n"; key = "bo"; action = "BufferLineCloseOthers"; - options = { desc = "Delete Other Buffers"; }; + options = {desc = "Delete Other Buffers";}; } { mode = "n"; key = "br"; action = "BufferLineCloseRight"; - options = { desc = "Delete Buffers to the Right"; }; + options = {desc = "Delete Buffers to the Right";}; } { mode = "n"; key = "bl"; action = "BufferLineCloseLeft"; - options = { desc = "Delete Buffers to the Left"; }; + options = {desc = "Delete Buffers to the Left";}; } # DAP Telescope Actions @@ -329,25 +325,25 @@ mode = "n"; key = "d/c"; action = "Telescope dap commands"; - options = { desc = "Search Commands"; }; + options = {desc = "Search Commands";}; } { mode = "n"; key = "d/b"; action = "Telescope dap list_breakpoints"; - options = { desc = "Search Breakpoints"; }; + options = {desc = "Search Breakpoints";}; } { mode = "n"; key = "d/v"; action = "Telescope dap variables"; - options = { desc = "Search Variables"; }; + options = {desc = "Search Variables";}; } { mode = "n"; key = "d/f"; action = "Telescope dap frames"; - options = { desc = "Search Frames"; }; + options = {desc = "Search Frames";}; } ]; } diff --git a/config/language.nix b/config/language.nix index 016ef8f..34b5c2f 100644 --- a/config/language.nix +++ b/config/language.nix @@ -1,263 +1,262 @@ let selectOpts = "{behavior = cmp.SelectBehavior.Select}"; in -{ pkgs, ... }: -{ - plugins = { - cmp = { - enable = true; - settings = { - autoEnableSources = true; - performance = { - debounce = 150; - }; - sources = [ - { name = "path"; } - { - name = "nvim_lsp"; - keywordLength = 1; - } - { - name = "buffer"; - keywordLength = 3; - } - { name = "supermaven"; } - ]; - - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; - formatting = { - fields = [ - "menu" - "abbr" - "kind" + {pkgs, ...}: { + plugins = { + cmp = { + enable = true; + settings = { + autoEnableSources = true; + performance = { + debounce = 150; + }; + sources = [ + {name = "path";} + { + name = "nvim_lsp"; + keywordLength = 1; + } + { + name = "buffer"; + keywordLength = 3; + } + {name = "supermaven";} ]; - format = '' - function(entry, item) - local menu_icon = { - nvim_lsp = '[LSP]', - luasnip = '[SNIP]', - buffer = '[BUF]', - path = '[PATH]', - } - item.menu = menu_icon[entry.source.name] - return item - end - ''; - }; + snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + formatting = { + fields = [ + "menu" + "abbr" + "kind" + ]; + format = '' + function(entry, item) + local menu_icon = { + nvim_lsp = '[LSP]', + luasnip = '[SNIP]', + buffer = '[BUF]', + path = '[PATH]', + } - mapping = { - "" = "cmp.mapping.select_prev_item(${selectOpts})"; - "" = "cmp.mapping.select_next_item(${selectOpts})"; - - "" = "cmp.mapping.select_prev_item(${selectOpts})"; - "" = "cmp.mapping.select_next_item(${selectOpts})"; - - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.scroll_docs(4)"; - - "" = "cmp.mapping.abort()"; - "" = "cmp.mapping.confirm({select = true})"; - "" = "cmp.mapping.confirm({select = false})"; - - "" = '' - cmp.mapping( - function(fallback) - if luasnip.jumpable(1) then - luasnip.jump(1) - else - fallback() - end - end, - { "i", "s" } - ) - ''; - - "" = '' - cmp.mapping( - function(fallback) - if luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, - { "i", "s" } - ) - ''; - - "" = '' - cmp.mapping( - function(fallback) - local col = vim.fn.col('.') - 1 - - if cmp.visible() then - cmp.select_next_item(select_opts) - elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - fallback() - else - cmp.complete() - end - end, - { "i", "s" } - ) - ''; - - "" = '' - cmp.mapping( - function(fallback) - if cmp.visible() then - cmp.select_prev_item(select_opts) - else - fallback() - end - end, - { "i", "s" } - ) - ''; - }; - window = { - completion = { - border = "rounded"; - winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None"; - zindex = 1001; - scrolloff = 0; - colOffset = 0; - sidePadding = 1; - scrollbar = true; + item.menu = menu_icon[entry.source.name] + return item + end + ''; }; - documentation = { - border = "rounded"; - winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None"; - zindex = 1001; - maxHeight = 20; + + mapping = { + "" = "cmp.mapping.select_prev_item(${selectOpts})"; + "" = "cmp.mapping.select_next_item(${selectOpts})"; + + "" = "cmp.mapping.select_prev_item(${selectOpts})"; + "" = "cmp.mapping.select_next_item(${selectOpts})"; + + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + + "" = "cmp.mapping.abort()"; + "" = "cmp.mapping.confirm({select = true})"; + "" = "cmp.mapping.confirm({select = false})"; + + "" = '' + cmp.mapping( + function(fallback) + if luasnip.jumpable(1) then + luasnip.jump(1) + else + fallback() + end + end, + { "i", "s" } + ) + ''; + + "" = '' + cmp.mapping( + function(fallback) + if luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, + { "i", "s" } + ) + ''; + + "" = '' + cmp.mapping( + function(fallback) + local col = vim.fn.col('.') - 1 + + if cmp.visible() then + cmp.select_next_item(select_opts) + elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then + fallback() + else + cmp.complete() + end + end, + { "i", "s" } + ) + ''; + + "" = '' + cmp.mapping( + function(fallback) + if cmp.visible() then + cmp.select_prev_item(select_opts) + else + fallback() + end + end, + { "i", "s" } + ) + ''; + }; + window = { + completion = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None"; + zindex = 1001; + scrolloff = 0; + colOffset = 0; + sidePadding = 1; + scrollbar = true; + }; + documentation = { + border = "rounded"; + winhighlight = "Normal:Normal,FloatBorder:Normal,CursorLine:Visual,Search:None"; + zindex = 1001; + maxHeight = 20; + }; }; }; }; - }; - cmp-nvim-lsp.enable = true; - cmp-buffer.enable = true; - cmp-path.enable = true; - cmp-treesitter.enable = true; - dap.enable = true; - none-ls = { - enable = true; - sources.formatting = { - alejandra.enable = true; - hclfmt.enable = true; - just.enable = true; - opentofu_fmt.enable = true; - prettier.enable = true; - # rubyfmt is broken on darwin-based systems - rubyfmt.enable = ( - pkgs.stdenv.hostPlatform.system != "x86_64-darwin" - && pkgs.stdenv.hostPlatform.system != "aarch64-darwin" - ); - sqlformat.enable = true; - stylua.enable = true; - yamlfmt.enable = true; - }; - sources.diagnostics = { - trivy.enable = true; - yamllint.enable = true; - }; - }; - - conform-nvim = { - enable = true; - settings = { - format_on_save = { - lsp_fallback = "fallback"; - timeout_ms = 500; + cmp-nvim-lsp.enable = true; + cmp-buffer.enable = true; + cmp-path.enable = true; + cmp-treesitter.enable = true; + dap.enable = true; + none-ls = { + enable = true; + sources.formatting = { + alejandra.enable = true; + hclfmt.enable = true; + just.enable = true; + opentofu_fmt.enable = true; + prettier.enable = true; + # rubyfmt is broken on darwin-based systems + rubyfmt.enable = ( + pkgs.stdenv.hostPlatform.system + != "x86_64-darwin" + && pkgs.stdenv.hostPlatform.system != "aarch64-darwin" + ); + sqlformat.enable = true; + stylua.enable = true; + yamlfmt.enable = true; }; - notify_on_error = true; + sources.diagnostics = { + trivy.enable = true; + yamllint.enable = true; + }; + }; - formatters_by_ft = { - css = [ "prettier" ]; - html = [ "prettier" ]; - javascript = [ "prettier" ]; - javascriptreact = [ "prettier" ]; - json = [ "prettier" ]; - just = [ "just" ]; - lua = [ "stylua" ]; - markdown = [ "prettier" ]; - nix = [ "alejandra" ]; - ruby = [ "rubyfmt" ]; - terraform = [ "tofu_fmt" ]; - tf = [ "tofu_fmt" ]; - typescript = [ "prettier" ]; - typescriptreact = [ "prettier" ]; - yaml = [ "yamlfmt" ]; + conform-nvim = { + enable = true; + settings = { + format_on_save = { + lsp_fallback = "fallback"; + timeout_ms = 500; + }; + notify_on_error = true; + + formatters_by_ft = { + css = ["prettier"]; + html = ["prettier"]; + javascript = ["prettier"]; + javascriptreact = ["prettier"]; + json = ["prettier"]; + just = ["just"]; + lua = ["stylua"]; + markdown = ["prettier"]; + nix = ["alejandra"]; + ruby = ["rubyfmt"]; + terraform = ["tofu_fmt"]; + tf = ["tofu_fmt"]; + typescript = ["prettier"]; + typescriptreact = ["prettier"]; + yaml = ["yamlfmt"]; + }; + }; + }; + + lsp = { + enable = true; + inlayHints = true; + keymaps = { + diagnostic = { + "E" = "open_float"; + "[" = "goto_prev"; + "]" = "goto_next"; + "do" = "setloclist"; + }; + lspBuf = { + "K" = "hover"; + "gD" = "declaration"; + "gd" = "definition"; + "gr" = "references"; + "gI" = "implementation"; + "gy" = "type_definition"; + "rn" = "rename"; + "ca" = "code_action"; + "wl" = "list_workspace_folders"; + "wr" = "remove_workspace_folder"; + "wa" = "add_workspace_folder"; + }; + }; + preConfig = '' + vim.diagnostic.config({ + virtual_text = false, + severity_sort = true, + float = { + border = 'rounded', + source = 'always', + }, + }) + + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, + {border = 'rounded'} + ) + + vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( + vim.lsp.handlers.signature_help, + {border = 'rounded'} + ) + ''; + postConfig = '' + local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } + for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) + end + ''; + servers = { + jsonls.enable = true; + marksman.enable = true; + nil-ls.enable = true; + nixd.enable = true; + yamlls.enable = true; + }; + }; + + trouble = { + enable = true; + settings = { + use_diagnostic_signs = true; }; }; }; - - lsp = { - enable = true; - inlayHints = true; - keymaps = { - diagnostic = { - "E" = "open_float"; - "[" = "goto_prev"; - "]" = "goto_next"; - "do" = "setloclist"; - }; - lspBuf = { - "K" = "hover"; - "gD" = "declaration"; - "gd" = "definition"; - "gr" = "references"; - "gI" = "implementation"; - "gy" = "type_definition"; - "rn" = "rename"; - "ca" = "code_action"; - "wl" = "list_workspace_folders"; - "wr" = "remove_workspace_folder"; - "wa" = "add_workspace_folder"; - }; - }; - preConfig = '' - vim.diagnostic.config({ - virtual_text = false, - severity_sort = true, - float = { - border = 'rounded', - source = 'always', - }, - }) - - vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( - vim.lsp.handlers.hover, - {border = 'rounded'} - ) - - vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( - vim.lsp.handlers.signature_help, - {border = 'rounded'} - ) - ''; - postConfig = '' - local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end - ''; - servers = { - jsonls.enable = true; - marksman.enable = true; - nil-ls.enable = true; - nixd.enable = true; - yamlls.enable = true; - }; - }; - - trouble = { - enable = true; - settings = { - use_diagnostic_signs = true; - }; - }; - - }; -} + } diff --git a/config/plugins.nix b/config/plugins.nix index b7a8761..f72e688 100644 --- a/config/plugins.nix +++ b/config/plugins.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{pkgs, ...}: { extraPlugins = with pkgs; [ vimPlugins.supermaven-nvim # AI code completion vimPlugins.vim-dadbod # DB client diff --git a/config/sets.nix b/config/sets.nix index 9959536..6a7680e 100644 --- a/config/sets.nix +++ b/config/sets.nix @@ -6,12 +6,14 @@ options = { always_show_bufferline = false; buffer_close_icon = ""; - offsets = [{ - filetype = "neo-tree"; - text = "Neo-tree"; - highlight = "Directory"; - text_align = "left"; - }]; + offsets = [ + { + filetype = "neo-tree"; + text = "Neo-tree"; + highlight = "Directory"; + text_align = "left"; + } + ]; diagnostics = "nvim_lsp"; }; }; @@ -27,14 +29,14 @@ }; signcolumn = true; signs = { - add = { text = "│"; }; - change = { text = "│"; }; - changedelete = { text = "~"; }; - delete = { text = "_"; }; - topdelete = { text = "‾"; }; - untracked = { text = "┆"; }; + add = {text = "│";}; + change = {text = "│";}; + changedelete = {text = "~";}; + delete = {text = "_";}; + topdelete = {text = "‾";}; + untracked = {text = "┆";}; }; - watch_gitdir = { follow_files = true; }; + watch_gitdir = {follow_files = true;}; }; }; @@ -50,10 +52,10 @@ mini = { enable = true; modules = { - surround = { }; + surround = {}; indentscope = { symbol = "│"; - options = { try_as_border = true; }; + options = {try_as_border = true;}; }; }; }; diff --git a/config/themes.nix b/config/themes.nix index 409f075..b90d54a 100644 --- a/config/themes.nix +++ b/config/themes.nix @@ -3,7 +3,7 @@ onedark = { enable = true; settings = { - colors = { yellow = "#d9a950"; }; + colors = {yellow = "#d9a950";}; style = "dark"; transparent = true; }; diff --git a/config/transparent.nix b/config/transparent.nix index 6175543..c0348ea 100644 --- a/config/transparent.nix +++ b/config/transparent.nix @@ -1,5 +1,5 @@ let - status = [ "Alternate" "Current" "Inactive" "Visible" ]; + status = ["Alternate" "Current" "Inactive" "Visible"]; part = [ "ADDED" "CHANGED" @@ -26,7 +26,8 @@ let "FloatBorder" ]; # "Buffer" + status + part - buffer_status = builtins.foldl' (acc: elem: acc ++ elem) [ ] + buffer_status = + builtins.foldl' (acc: elem: acc ++ elem) [] (builtins.map (status: builtins.map (part: "Buffer" + status + part) part) status); in { diff --git a/flake.nix b/flake.nix index 9f2d2f2..4b53866 100644 --- a/flake.nix +++ b/flake.nix @@ -6,56 +6,89 @@ flake-parts.url = "github:hercules-ci/flake-parts"; rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { nixvim, flake-parts, rust-overlay, ... }@inputs: + outputs = + { + nixvim, + flake-parts, + rust-overlay, + ... + }@inputs: flake-parts.lib.mkFlake { inherit inputs; } { - systems = - [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - perSystem = { system, ... }: + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + perSystem = + { system, ... }: let overlays = [ (import rust-overlay) ]; nixvimLib = nixvim.lib.${system}; nixvim' = nixvim.legacyPackages.${system}; baseNixvimModule = { inherit pkgs; - module = { pkgs, ... }: { - imports = [ ./config ]; - extraPackages = with pkgs; [ sops ]; - }; + module = + { pkgs, ... }: + { + imports = [ ./config ]; + extraPackages = with pkgs; [ sops ]; + }; extraSpecialArgs = { }; }; rustNixvimModule = { inherit pkgs; - module = { pkgs, ... }: { - imports = [ ./config ./config/rust ]; - extraPackages = with pkgs; [ - sops - rust-bin.stable.latest.default - ]; - }; + module = + { pkgs, ... }: + { + imports = [ + ./config + ./config/rust + ]; + extraPackages = with pkgs; [ + sops + rust-bin.stable.latest.default + ]; + }; extraSpecialArgs = { }; }; csharpNixvimModule = { inherit pkgs; - module = { pkgs, ... }: { - imports = [ ./config ./config/csharp ]; - extraPackages = with pkgs; [ sops ]; - }; + module = + { pkgs, ... }: + { + imports = [ + ./config + ./config/csharp + ]; + extraPackages = with pkgs; [ sops ]; + }; extraSpecialArgs = { }; }; goNixvimModule = { inherit pkgs; - module = { pkgs, ... }: { - imports = [ ./config ./config/golang ]; - extraPackages = with pkgs; [ sops ]; - }; + module = + { pkgs, ... }: + { + imports = [ + ./config + ./config/golang + ]; + extraPackages = with pkgs; [ sops ]; + }; extraSpecialArgs = { }; }; pythonNixvimModule = { inherit pkgs; - module = { pkgs, ... }: { - imports = [ ./config ./config/python ]; - extraPackages = with pkgs; [ sops ]; - }; + module = + { pkgs, ... }: + { + imports = [ + ./config + ./config/python + ]; + extraPackages = with pkgs; [ sops ]; + }; extraSpecialArgs = { }; }; pkgs = import inputs.nixpkgs { @@ -67,11 +100,11 @@ csharpNvim = nixvim'.makeNixvimWithModule csharpNixvimModule; goNvim = nixvim'.makeNixvimWithModule goNixvimModule; pythonNvim = nixvim'.makeNixvimWithModule pythonNixvimModule; - in { + in + { checks = { # Run `nix flake check .` to verify that your config is not broken - default = - nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule; + default = nixvimLib.check.mkTestDerivationFromNixvimModule baseNixvimModule; }; packages = { # Lets you run `nix run .` to start nixvim