From f31e2e4ad42f931d403321066cd681398ef0128a Mon Sep 17 00:00:00 2001 From: r17x Date: Mon, 12 Aug 2024 18:09:37 +0700 Subject: [PATCH 1/4] chore(lockfile): update inputs.nixpkgs-unstable --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 690cee4..d306e62 100644 --- a/flake.lock +++ b/flake.lock @@ -651,11 +651,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1727089097, - "narHash": "sha256-ZMHMThPsthhUREwDebXw7GX45bJnBCVbfnH1g5iuSPc=", + "lastModified": 1723221148, + "narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "568bfef547c14ca438c56a0bece08b8bb2b71a9c", + "rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6", "type": "github" }, "original": { From 47777dc5d0d80919e21dbcab2298ebc9169534f9 Mon Sep 17 00:00:00 2001 From: r17x Date: Tue, 13 Aug 2024 02:08:02 +0700 Subject: [PATCH 2/4] chore(lockfile): update inputs.nixvim --- flake.lock | 103 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 42 deletions(-) diff --git a/flake.lock b/flake.lock index d306e62..127b231 100644 --- a/flake.lock +++ b/flake.lock @@ -242,7 +242,7 @@ }, "flake-utils_7": { "inputs": { - "systems": "systems_5" + "systems": "systems_4" }, "locked": { "lastModified": 1710146030, @@ -258,59 +258,46 @@ "type": "github" } }, - "git-hooks": { + "flake-utils_8": { "inputs": { - "flake-compat": [ - "nixvim", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", - "nixpkgs" - ] + "systems": "systems_5" }, "locked": { - "lastModified": 1726745158, - "narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { - "owner": "cachix", - "repo": "git-hooks.nix", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, - "git-hooks-nix": { + "git-hooks": { "inputs": { "flake-compat": [ - "nix" - ], - "gitignore": [ - "nix" + "nixvim", + "flake-compat" ], + "gitignore": "gitignore", "nixpkgs": [ - "nix", + "nixvim", "nixpkgs" ], "nixpkgs-stable": [ - "nix", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1721042469, - "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "lastModified": 1723202784, + "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "rev": "c7012d0c18567c889b948781bc74a501e92275d1", "type": "github" }, "original": { @@ -718,11 +705,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1727277745, - "narHash": "sha256-ypOw6aiWorsZl/UkfiJF6I7FnrfpGixebPa5VbbwQFM=", + "lastModified": 1723460395, + "narHash": "sha256-KxPw+HVYphxCEnkE/KicgY46WlggCZH0HRSDNJPlpbk=", "owner": "nix-community", "repo": "nixvim", - "rev": "a8f678da24418e1c84eb0818e1d154d67c982033", + "rev": "f823d01002acd7e1adab01680e42e31b8edc50f5", "type": "github" }, "original": { @@ -774,18 +761,18 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "nixpkgs": [ "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1726995581, - "narHash": "sha256-lgsE/CTkZk9OIiFGEIrxXZQ7Feiv41dqlN7pEfTdgew=", + "lastModified": 1723367906, + "narHash": "sha256-v1qA4WBGDI2uH/TVqRwuXSBP341W681psbzYJ8zrjog=", "owner": "NuschtOS", "repo": "search", - "rev": "3b7dd61b365ca45380707453758a45f2e9977be3", + "rev": "6ca2c3ae05a915c160512bd41f6810f456c9b30d", "type": "github" }, "original": { @@ -816,6 +803,38 @@ } }, "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "nix" + ], + "flake-utils": "flake-utils_6", + "gitignore": [ + "nix" + ], + "nixpkgs": [ + "nix", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712897695, + "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_2": { "inputs": { "flake-compat": "flake-compat_5", "gitignore": "gitignore_2", @@ -1059,11 +1078,11 @@ ] }, "locked": { - "lastModified": 1726734507, - "narHash": "sha256-VUH5O5AcOSxb0uL/m34dDkxFKP6WLQ6y4I1B4+N3L2w=", + "lastModified": 1723454642, + "narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "ee41a466c2255a3abe6bc50fc6be927cdee57a9f", + "rev": "349de7bc435bdff37785c2466f054ed1766173be", "type": "github" }, "original": { From 42baa71341c664a147c10e8aa881ff30b2b17c51 Mon Sep 17 00:00:00 2001 From: r17x Date: Tue, 13 Aug 2024 02:08:38 +0700 Subject: [PATCH 3/4] feat!(nvim): update breaking options --- nix/icons.nix | 154 +++++++++--------- nvim.nix/config/ai.nix | 182 ++++++++-------------- nvim.nix/config/git.nix | 141 ++++++++++------- nvim.nix/config/lsp.nix | 266 ++++++++++++++++++-------------- nvim.nix/config/navigations.nix | 219 +++++++++++++++++--------- nvim.nix/config/ui.nix | 60 +++---- nvim.nix/config/writing.nix | 51 +++--- 7 files changed, 587 insertions(+), 486 deletions(-) diff --git a/nix/icons.nix b/nix/icons.nix index ec12e32..30e8b02 100644 --- a/nix/icons.nix +++ b/nix/icons.nix @@ -1,77 +1,79 @@ -{ - # suggest me with devicons from nerdfonts - language.vim = ""; - language.neovim = ""; - language.org = ""; - language.reason = ""; +let + icons = { + # suggest me with devicons from nerdfonts + language.vim = ""; + language.neovim = ""; + language.org = ""; + language.reason = ""; - circleLeft = ""; - circleLeft1 = ""; - circleRight = ""; - circleRight1 = ""; - hint = ""; - info = "ℹ"; - info1 = ""; - info2 = ""; - warning = ""; - warning1 = ""; - warning2 = ""; - warning3 = ""; - cross = ""; - cross1 = ""; - cross2 = ""; - cross3 = ""; - cross4 = ""; - plus = ""; - plus1 = ""; - plus2 = "洛"; - plus3 = ""; - plus4 = "⊕"; - minus = ""; - minus1 = ""; - minus2 = ""; - minus3 = ""; - refresh = ""; - file = ""; - reload = ""; - bookmark = ""; - word = ""; - recent = ""; - notes = ""; - lightning = ""; - org = ""; - still = ""; - camera = ""; - nix = ""; - function = ""; - code = "󰘦 "; - wand = " "; - robotFace = " "; - git = " "; - gearSM = "⛭"; - checkmark = "✔"; - chevronRight = ""; - chevronDown = ""; - chevronLeft = ""; - chevronUp = ""; - folder = ""; - folderOpen = ""; - package = ""; - telescope = ""; - freeBSD = ""; - linux = ""; - archlinux = ""; - resource = ""; - terminal = ""; - cloud = ""; - database = ""; - server = ""; - settings = ""; - gear = ""; - rocket = ""; - bug = ""; - face = "󰏚 "; - lightbulb = ""; - star = ""; - indent = "▎"; -} + circleLeft = ""; + circleLeft1 = ""; + circleRight = ""; + circleRight1 = ""; + info = "ℹ"; + info1 = ""; + info2 = ""; + warning = ""; + warning1 = ""; + warning2 = ""; + warning3 = ""; + cross = ""; + cross1 = ""; + cross2 = ""; + cross3 = ""; + cross4 = ""; + plus = ""; + plus1 = ""; + plus2 = "洛"; + plus3 = ""; + plus4 = "⊕"; + minus = ""; + minus1 = ""; + minus2 = ""; + minus3 = ""; + refresh = ""; + file = ""; + reload = ""; + bookmark = ""; + word = ""; + recent = ""; + notes = ""; + lightning = ""; + org = ""; + still = ""; + camera = ""; + nix = ""; + function = ""; + code = "󰘦 "; + wand = " "; + robotFace = " "; + git = " "; + gearSM = "⛭"; + checkmark = "✔"; + chevronRight = ""; + chevronDown = ""; + chevronLeft = ""; + chevronUp = ""; + folder = ""; + folderOpen = ""; + package = ""; + telescope = ""; + freeBSD = ""; + linux = ""; + archlinux = ""; + resource = ""; + terminal = ""; + cloud = ""; + database = ""; + server = ""; + settings = ""; + gear = ""; + rocket = ""; + bug = ""; + face = "󰏚 "; + lightbulb = ""; + star = ""; + indent = "▎"; + }; +in +icons // { withIcon = iconName: s: "${icons.${iconName}} ${s}"; } diff --git a/nvim.nix/config/ai.nix b/nvim.nix/config/ai.nix index 5c938da..0855d3b 100644 --- a/nvim.nix/config/ai.nix +++ b/nvim.nix/config/ai.nix @@ -1,11 +1,5 @@ -{ pkgs, ... }: +{ pkgs, icons, ... }: -let - mode = [ - "n" - "v" - ]; -in { extraPlugins = with pkgs.vimPlugins; [ avante-nvim @@ -24,123 +18,83 @@ in }, }) ''; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "cc"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPT"; + desc = "Open ChatGPT Prompt"; + } - # extraConfigLuaPost = # lua - # '' - # require('chatgpt').setup({ - # actions_paths = {"~/.config/openai/actions.json"}, - # open_ai_params = { - # model = "gpt-4", - # }, - # openai_edit_params = { - # model = "gpt-4", - # }, - # }) - # ''; - - plugins.which-key.registrations = { - "cc" = [ - [ - "ChatGPT" - "Open ChatGPT Prompt" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "ce"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTEditWithInstruction"; + desc = "Edit with instruction"; + } - "ce" = [ - [ - "ChatGPTEditWithInstruction" - "Edit with instruction" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "cg"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun grammar_correction"; + desc = "Grammar Correction"; + } - "cg" = [ - [ - "ChatGPTRun grammar_correction" - "Grammar Correction" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "ct"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun translate"; + desc = "Translate"; + } - "ct" = [ - [ - "ChatGPTRun translate" - "Translate" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "ck"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun keywords"; + desc = "Keywords"; + } - "ck" = [ - [ - "ChatGPTRun keywords" - "Keywords" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "cd"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun docstring"; + desc = "Docstring"; + } - "cd" = [ - [ - "ChatGPTRun docstring" - "Docstring" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "ca"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun add_tests"; + desc = "Add Tests"; + } - "ca" = [ - [ - "ChatGPTRun add_tests" - "Add Tests" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "co"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun optimize_code"; + desc = "Optimize Code"; + } - "co" = [ - [ - "ChatGPTRun optimize_code" - "Optimize Code" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "cs"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun summarize"; + desc = "Summarize"; + } - "cs" = [ - [ - "ChatGPTRun summarize" - "Summarize" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "cf"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun fix_bugs"; + desc = "Fix Bugs"; + } - "cf" = [ - [ - "ChatGPTRun fix_bugs" - "Fix Bugs" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "cx"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun explain_code"; + desc = "Explain Code"; + } - "cx" = [ - [ - "ChatGPTRun explain_code" - "Explain Code" - { inherit mode; } - ] - ]; + { + __unkeyed-1 = "cr"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun roxygen_edit"; + desc = "Roxygen Edit"; + } - "cr" = [ - [ - "ChatGPTRun roxygen_edit" - "Roxygen Edit" - { inherit mode; } - ] - ]; - - "cl" = [ - [ - "ChatGPTRun code_readability_analysis" - "Code Readability Analysis" - { inherit mode; } - ] - ]; - }; + { + __unkeyed-1 = "cl"; + __unkeyed-2 = icons.withIcon "robotFace" "ChatGPTRun code_readability_analysis"; + desc = "Code Readability Analysis"; + } + ]; } diff --git a/nvim.nix/config/git.nix b/nvim.nix/config/git.nix index 959950d..7ec2b03 100644 --- a/nvim.nix/config/git.nix +++ b/nvim.nix/config/git.nix @@ -13,66 +13,91 @@ let in { - plugins.which-key.registrations = { - "mg" = [ - "Neogit" - "Open Neogit" - ]; - "gss" = [ - gs.toggle_signs - "Toggle Sign Column" - ]; - "gsn" = [ - gs.toggle_numhl - "Toggle Num Hightlight" - ]; - "gsl" = [ - gs.toggle_linehl - "Toggle Line Hightlight" - ]; - "gsw" = [ - gs.toggle_word_diff - "Toggle Word Diff" - ]; - "gsd" = [ - gs.toggle_deleted - "Toggle Deleted" - ]; - "gsb" = [ - gs.toggle_current_line_blame - "Toggle Current line blame" - ]; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "mg"; + __unkeyed-2 = "Neogit"; + desc = icons.withIcon "git" "Open Neogit"; + } + { + __unkeyed-1 = "gss"; + __unkeyed-2 = gs.toggle_signs; + desc = icons.withIcon "git" "Toggle Sign Column"; + } + { + __unkeyed-1 = "gsn"; + __unkeyed-2 = gs.toggle_numhl; + desc = icons.withIcon "git" "Toggle Num Hightlight"; + } + { + __unkeyed-1 = "gsl"; + __unkeyed-2 = gs.toggle_linehl; + desc = icons.withIcon "git" "Toggle Line Hightlight"; + } + { + __unkeyed-1 = "gsw"; + __unkeyed-2 = gs.toggle_word_diff; + desc = icons.withIcon "git" "Toggle Word Diff"; + } + { + __unkeyed-1 = "gsd"; + __unkeyed-2 = gs.toggle_deleted; + desc = icons.withIcon "git" "Toggle Deleted"; + } + { + __unkeyed-1 = "gsb"; + __unkeyed-2 = gs.toggle_current_line_blame; + desc = icons.withIcon "git" "Toggle Current line blame"; + } - "fghi" = [ "Telescope gh issues" ]; - "fghp" = [ "Telescope gh pull_request" ]; - "fghg" = [ "Telescope gh gist" ]; - "fghr" = [ "Telescope gh run" ]; + { + __unkeyed-1 = "fghi"; + __unkeyed-2 = "Telescope gh issues"; + } + { + __unkeyed-1 = "fghp"; + __unkeyed-2 = "Telescope gh pull_request"; + } + { + __unkeyed-1 = "fghg"; + __unkeyed-2 = "Telescope gh gist"; + } + { + __unkeyed-1 = "fghr"; + __unkeyed-2 = "Telescope gh run"; + } - "fgc" = [ - "Telescope git_commits" - "Lists git commits with diff preview, checkout action , reset mixed m, reset soft s and reset hard h" - ]; - "fgf" = [ - "Telescope git_bcommits" - "Lists buffer's git commits with diff preview and checks them out on " - ]; - "fgr" = [ - "Telescope git_bcommits_range" - "Lists buffer's git commits in a range of lines. Use options from and to to specify the range. In visual mode, lists commits for the selected lines" - ]; - "fgb" = [ - "Telescope git_branches" - "Lists all branches with log preview, checkout action , track action , rebase action, create action , switch action , delete action and merge action " - ]; - "fgs" = [ - "Telescope git_status" - "Lists current changes per file with diff preview and add action. (Multi-selection still WIP)" - ]; - "fgw" = [ - "Telescope git_stash" - "Lists stash items in current repository with ability to apply them on " - ]; - }; + { + __unkeyed-1 = "fgc"; + __unkeyed-2 = "Telescope git_commits"; + desc = icons.withIcon "git" "Lists git commits with diff preview, checkout action , reset mixed m, reset soft s and reset hard h"; + } + { + __unkeyed-1 = "fgf"; + __unkeyed-2 = "Telescope git_bcommits"; + desc = icons.withIcon "git" "Lists buffer's git commits with diff preview and checks them out on "; + } + { + __unkeyed-1 = "fgr"; + __unkeyed-2 = "Telescope git_bcommits_range"; + desc = icons.withIcon "git" "Lists buffer's git commits in a range of lines. Use options from and to to specify the range. In visual mode, lists commits for the selected lines"; + } + { + __unkeyed-1 = "fgb"; + __unkeyed-2 = "Telescope git_branches"; + desc = icons.withIcon "git" "Lists all branches with log preview, checkout action , track action , rebase action, create action , switch action , delete action and merge action "; + } + { + __unkeyed-1 = "fgs"; + __unkeyed-2 = "Telescope git_status"; + desc = icons.withIcon "git" "Lists current changes per file with diff preview and add action. (Multi-selection still WIP)"; + } + { + __unkeyed-1 = "fgw"; + __unkeyed-2 = "Telescope git_stash"; + desc = icons.withIcon "git" "Lists stash items in current repository with ability to apply them on "; + } + ]; plugins.neogit.enable = true; plugins.git-conflict.enable = true; diff --git a/nvim.nix/config/lsp.nix b/nvim.nix/config/lsp.nix index 3d6fd37..5c49345 100644 --- a/nvim.nix/config/lsp.nix +++ b/nvim.nix/config/lsp.nix @@ -56,125 +56,155 @@ "rei" = "reason"; }; - plugins.which-key.registrations = { - "//" = [ - "nohlsearch" - "Clear search highlight" - ]; - "" = [ - "Lspsaga term_toggle" - "Open Terminal" - ]; - "ge" = [ - "Trouble" - "Show diagnostics [Trouble]" - ]; - "[e" = [ - "Lspsaga diagnostic_jump_next" - "Next Diagnostic" - ]; - "]e" = [ - "Lspsaga diagnostic_jump_prev" - "Previous Diagnostic" - ]; - "K" = [ - "Lspsaga hover_doc" - "Code Hover" - ]; - "F" = [ - "lua vim.lsp.buf.format({ async = true }) " - "Format the current buffer" - ]; - "gl" = [ - "LspInfo" - "Show LSP Info" - ]; - "gt" = [ - "Lspsaga outline" - "Code Action" - ]; - "ga" = [ - "Lspsaga code_action" - "Code Action" - ]; - "gi" = [ - "Lspsaga incoming_calls" - "Incoming Calls" - ]; - "go" = [ - "Lspsaga outgoing_calls" - "Outgoing Calls" - ]; - "gD" = [ - "Lspsaga goto_definition" - "Go to Definition" - ]; - "gd" = [ - "Lspsaga peek_definition" - "Peek Definition" - ]; - "gr" = [ - "Lspsaga rename" - "Code Rename" - ]; - "gs" = [ - ''lua require("wtf").search() '' - "Search diagnostic with Google" - ]; - "gcf" = [ - "Lspsaga finder" - "Code Finder" - ]; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "//"; + __unkeyed-2 = "nohlsearch"; + desc = icons.withIcon "git" "Clear search highlight"; + } + { + __unkeyed-1 = ""; + __unkeyed-2 = "Lpsaga term_toggle"; + desc = icons.withIcon "git" "Open Terminal"; + } + { + __unkeyed-1 = "ge"; + __unkeyed-2 = "Trouble"; + desc = icons.withIcon "git" "Show diagnostics [Trouble]"; + } + { + __unkeyed-1 = "[e"; + __unkeyed-2 = "Lspsaga diagnostic_jump_next"; + desc = icons.withIcon "git" "Next Diagnostic"; + } + { + __unkeyed-1 = "]e"; + __unkeyed-2 = "Lspsaga diagnostic_jump_prev"; + desc = icons.withIcon "git" "Previous Diagnostic"; + } + { + __unkeyed-1 = "K"; + __unkeyed-2 = "Lspsaga hover_doc"; + desc = icons.withIcon "git" "Code Hover"; + } + { + __unkeyed-1 = "F"; + __unkeyed-2 = "lua vim.lsp.buf.format({ async = true }) "; + desc = icons.withIcon "git" "Format the current buffer"; + } + { + __unkeyed-1 = "gl"; + __unkeyed-2 = "LspInfo"; + desc = icons.withIcon "git" "Show LSP Info"; + } + { + __unkeyed-1 = "gt"; + __unkeyed-2 = "Lspsaga outline"; + desc = icons.withIcon "git" "Code Action"; + } + { + __unkeyed-1 = "ga"; + __unkeyed-2 = "Lspsaga code_action"; + desc = icons.withIcon "git" "Code Action"; + } + { + __unkeyed-1 = "gi"; + __unkeyed-2 = "Lspsaga incoming_calls"; + desc = icons.withIcon "git" "Incoming Calls"; + } + { + __unkeyed-1 = "go"; + __unkeyed-2 = "Lspsaga outgoing_calls"; + desc = icons.withIcon "git" "Outgoing Calls"; + } + { + __unkeyed-1 = "gD"; + __unkeyed-2 = "Lspsaga goto_definition"; + desc = icons.withIcon "git" "Go to Definition"; + } + { + __unkeyed-1 = "gd"; + __unkeyed-2 = "Lspsaga peek_definition"; + desc = icons.withIcon "git" "Peek Definition"; + } + { + __unkeyed-1 = "gr"; + __unkeyed-2 = "Lspsaga rename"; + desc = icons.withIcon "git" "Code Rename"; + } + { + __unkeyed-1 = "gs"; + __unkeyed-2 = ''lua require("wtf").search() ''; + desc = icons.withIcon "git" "Search diagnostic with Google"; + } + { + __unkeyed-1 = "gcf"; + __unkeyed-2 = "Lspsaga finder"; + desc = icons.withIcon "git" "Code Finder"; + } # telescope with lsp - "tih" = [ - "LspInlay" - "Toggle Inlay Hints" - ]; - "fnix" = [ - "Telescope manix" - "Find nix with man|nix" - ]; - "flr" = [ - "lua require'telescope.builtin'.lsp_references()" - "[Lsp] Find References" - ]; - "fic" = [ - "lua require'telescope.builtin'.lsp_incoming_calls()" - "[Lsp] Find Incoming Calls" - ]; - "foc" = [ - "lua require'telescope.builtin'.lsp_outgoing_calls()" - "[Lsp] Find Outgoing Calls" - ]; - "fds" = [ - "lua require'telescope.builtin'.lsp_document_symbols()" - "[Lsp] Find Document Symbols" - ]; - "fws" = [ - "lua require'telescope.builtin'.lsp_workspace_symbols()" - "[Lsp] Find Workspace Symbols" - ]; - "fdws" = [ - "lua require'telescope.builtin'.lsp_dynamic_workspace_symbols()" - "[Lsp] Find Dynamic Workspace Symbols" - ]; - "fld" = [ - "lua require'telescope.builtin'.diagnostics()" - "[Lsp] Find Diagnostics" - ]; - "fli" = [ - "lua require'telescope.builtin'.lsp_implementations()" - "[Lsp] Find Implementations" - ]; - "flD" = [ - "lua require'telescope.builtin'.lsp_definitions()" - "[Lsp] Find Definitions" - ]; - "flt" = [ - "lua require'telescope.builtin'.lsp_type_definitions()" - "[Lsp] Find Type Definitions" - ]; - }; + { + __unkeyed-1 = "tih"; + __unkeyed-2 = "LspInlay"; + desc = icons.withIcon "git" "Toggle Inlay Hints"; + } + { + __unkeyed-1 = "fnix"; + __unkeyed-2 = "Telescope manix"; + desc = icons.withIcon "git" "Find nix with man|nix"; + } + { + __unkeyed-1 = "flr"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_references()"; + desc = icons.withIcon "git" "[Lsp] Find References"; + } + { + __unkeyed-1 = "fic"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_incoming_calls()"; + desc = icons.withIcon "git" "[Lsp] Find Incoming Calls"; + } + { + __unkeyed-1 = "foc"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_outgoing_calls()"; + desc = icons.withIcon "git" "[Lsp] Find Outgoing Calls"; + } + { + __unkeyed-1 = "fds"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_document_symbols()"; + desc = icons.withIcon "git" "[Lsp] Find Document Symbols"; + } + { + __unkeyed-1 = "fws"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_workspace_symbols()"; + desc = icons.withIcon "git" "[Lsp] Find Workspace Symbols"; + } + { + __unkeyed-1 = "fdws"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_dynamic_workspace_symbols()"; + desc = icons.withIcon "git" "[Lsp] Find Dynamic Workspace Symbols"; + } + { + __unkeyed-1 = "fld"; + __unkeyed-2 = "lua require'telescope.builtin'.diagnostics()"; + desc = icons.withIcon "git" "[Lsp] Find Diagnostics"; + } + { + __unkeyed-1 = "fli"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_implementations()"; + desc = icons.withIcon "git" "[Lsp] Find Implementations"; + } + { + __unkeyed-1 = "flD"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_definitions()"; + desc = icons.withIcon "git" "[Lsp] Find Definitions"; + } + { + __unkeyed-1 = "flt"; + __unkeyed-2 = "lua require'telescope.builtin'.lsp_type_definitions()"; + desc = icons.withIcon "git" "[Lsp] Find Type Definitions"; + } + + ]; plugins.lsp = { enable = true; diff --git a/nvim.nix/config/navigations.nix b/nvim.nix/config/navigations.nix index 61de772..44ca47a 100644 --- a/nvim.nix/config/navigations.nix +++ b/nvim.nix/config/navigations.nix @@ -1,9 +1,19 @@ # this declarations based on {https://github.com/r17x/nixpkgs/blob/main/configs/nvim/lua/config/keymap.lua} -{ helpers, pkgs, ... }: +{ + icons, + helpers, + pkgs, + ... +}: let inherit (helpers) mkRaw; + tb.findFiles = mkRaw "require'telescope.builtin'.find_files"; + tb.liveGrep = mkRaw "require'telescope.builtin'.live_grep"; + tb.findBuffers = mkRaw "require'telescope.builtin'.buffers"; + tb.findHelpTags = mkRaw "require'telescope.builtin'.help_tags"; + resize.up = mkRaw "function() vim.cmd [[ resize +1 ]] end"; resize.down = mkRaw "function() vim.cmd [[ resize -1 ]] end"; resize.left = mkRaw "function() vim.cmd [[ vertical resize -1 ]] end"; @@ -40,79 +50,142 @@ in plugins.telescope.keymaps.fghs.action = "gh gist"; plugins.which-key.enable = true; - plugins.which-key.triggers = [ - "" - "f" + plugins.which-key.settings.triggers = [ + { + __unkeyed-1 = ""; + mode = "n"; + } + { + __unkeyed-1 = "g"; + mode = "n"; + } + { + __unkeyed-1 = "f"; + mode = "n"; + } + ]; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = "w"; + __unkeyed-2 = "w"; + desc = icons.withIcon "git" "Write current buffer"; + } + + { + __unkeyed-1 = "ww"; + __unkeyed-2 = "w!"; + desc = icons.withIcon "git" "Write current buffer forced"; + } + + { + __unkeyed-1 = "wq"; + __unkeyed-2 = "wq"; + desc = icons.withIcon "git" "Write current buffer and quit"; + } + + { + __unkeyed-1 = "wqq"; + __unkeyed-2 = "wq"; + desc = icons.withIcon "git" "Write & quit forced"; + } + + { + __unkeyed-1 = "Y"; + __unkeyed-2 = "\"+yy"; + desc = icons.withIcon "git" "Copy to Clipboard!"; + } + + { + __unkeyed-1 = "p"; + __unkeyed-2 = "\"+p"; + desc = icons.withIcon "git" "Paste from Clipboard"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = "h"; + desc = icons.withIcon "git" "Move top"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = "j"; + desc = icons.withIcon "git" "Move down"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = "k"; + desc = icons.withIcon "git" "Move left"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = "l"; + desc = icons.withIcon "git" "Move right"; + } + + { + __unkeyed-1 = "ff"; + __unkeyed-2 = tb.findFiles; + desc = icons.withIcon "git" "Find by files"; + } + + { + __unkeyed-1 = "fb"; + __unkeyed-2 = tb.findBuffers; + desc = icons.withIcon "git" "Find by current buffers"; + } + + { + __unkeyed-1 = "fh"; + __unkeyed-2 = tb.findHelpTags; + desc = icons.withIcon "git" "Find by help tags"; + } + + { + __unkeyed-1 = "fg"; + __unkeyed-2 = tb.liveGrep; + desc = icons.withIcon "git" "Find by words"; + } + + { + __unkeyed-1 = "fw"; + __unkeyed-2 = "HopWord"; + desc = icons.withIcon "git" "Find by Word"; + } + + { + __unkeyed-1 = "fhh"; + __unkeyed-2 = "HopPattern"; + desc = icons.withIcon "git" "Find by Patterns"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = resize.up; + desc = icons.withIcon "git" "resize window up"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = resize.down; + desc = icons.withIcon "git" "resize window down"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = resize.left; + desc = icons.withIcon "git" "resize window right"; + } + + { + __unkeyed-1 = ""; + __unkeyed-2 = resize.right; + desc = icons.withIcon "git" "resize window left"; + } + ]; - plugins.which-key.registrations = { - "w" = [ - "w" - "Write current buffer" - ]; - "ww" = [ - "w!" - "Write current buffer forced" - ]; - "wq" = [ - "wq" - "Write current buffer and quit" - ]; - "wqq" = [ - "wq" - "Write & quit forced" - ]; - - "Y" = [ - "\"+yy" - "Copy to Clipboard!" - ]; - "p" = [ - "\"+p" - "Paste from Clipboard" - ]; - - "" = [ - "h" - "Move top" - ]; - "" = [ - "j" - "Move down" - ]; - "" = [ - "k" - "Move left" - ]; - "" = [ - "l" - "Move right" - ]; - "fw" = [ - "HopWord" - "Find by Word" - ]; - "fhh" = [ - "HopPattern" - "Find by Patterns" - ]; - - "" = [ - resize.up - "resize window up" - ]; - "" = [ - resize.down - "resize window down" - ]; - "" = [ - resize.left - "resize window right" - ]; - "" = [ - resize.right - "resize window left" - ]; - }; plugins.hop.enable = true; } diff --git a/nvim.nix/config/ui.nix b/nvim.nix/config/ui.nix index 07a4387..596060b 100644 --- a/nvim.nix/config/ui.nix +++ b/nvim.nix/config/ui.nix @@ -54,28 +54,34 @@ in lualine-lsp-progress ]; - plugins.which-key.registrations = { - "" = [ - "NvimTreeToggle" - "Open Tree in left side" - ]; - "tl" = [ - "lua vim.g.unhide_lualine = not vim.g.unhide_lualine; require('lualine').hide({ unhide = vim.g.unhide_lualine })" - "Toggle Status Line" - ]; - "tib" = [ - "IBLToggle" - "Toggle Indent Blankline" - ]; - "tc" = [ - "ColorizerToggle" - "Toggle Colorizer" - ]; - "fhi" = [ - "Telescope highlights" - "Find Highlight Groups" - ]; - }; + plugins.which-key.settings.spec = [ + { + __unkeyed-1 = ""; + __unkeyed-2 = "NvimTreeToggle"; + desc = icons.withIcon "git" "Open Tree in left side"; + } + { + __unkeyed-1 = "tl"; + __unkeyed-2 = "lua vim.g.unhide_lualine = not vim.g.unhide_lualine; require('lualine').hide({ unhide = vim.g.unhide_lualine })"; + desc = icons.withIcon "git" "Toggle Status Line"; + } + { + __unkeyed-1 = "tib"; + __unkeyed-2 = "IBLToggle"; + desc = icons.withIcon "git" "Toggle Indent Blankline"; + } + { + __unkeyed-1 = "tc"; + __unkeyed-2 = "ColorizerToggle"; + desc = icons.withIcon "git" "Toggle Colorizer"; + } + { + __unkeyed-1 = "fhi"; + __unkeyed-2 = "Telescope highlights"; + desc = icons.withIcon "git" "Find Highlight Groups"; + } + + ]; plugins.wakatime.enable = true; @@ -113,7 +119,7 @@ in plugins.nvim-tree.renderer.highlightGit = true; plugins.nvim-tree.renderer.indentMarkers.enable = true; - plugins.indent-blankline.enable = true; + plugins.indent-blankline.settings.indent.enable = true; plugins.indent-blankline.settings.indent.char = icons.indent; plugins.indent-blankline.settings.exclude.buftypes = [ "terminal" @@ -245,12 +251,12 @@ in plugins.treesitter.enable = true; plugins.treesitter.folding = true; - plugins.treesitter.indent = true; + plugins.treesitter.settings.indent.enable = true; plugins.treesitter.nixvimInjections = true; plugins.treesitter.grammarPackages = builtins.map ( x: pkgs.vimPlugins.nvim-treesitter.builtGrammars.${x} - ) config.plugins.treesitter.ensureInstalled; - plugins.treesitter.ignoreInstall = [ + ) config.plugins.treesitter.settings.ensure_installed; + plugins.treesitter.settings.ignore_install = [ # ┌─────────────────────────────────────┐ # │ move to ensureInstalled for enabled │ # └─────────────────────────────────────┘ @@ -464,7 +470,7 @@ in "zathurarc" "zig" ]; - plugins.treesitter.ensureInstalled = [ + plugins.treesitter.settings.ensure_installed = [ # ┌────────────────────────────────────┐ # │ move to ignoreInstall for disabled │ # └────────────────────────────────────┘ diff --git a/nvim.nix/config/writing.nix b/nvim.nix/config/writing.nix index 1af92fe..7132d78 100644 --- a/nvim.nix/config/writing.nix +++ b/nvim.nix/config/writing.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ icons, pkgs, ... }: { keymaps = [ @@ -78,27 +78,38 @@ end end ''; + plugins.which-key.settings.spec = [ - plugins.which-key.registrations."mp" = [ - "MarkdownPreview" - "Preview Markdown" - ]; - plugins.which-key.registrations."tv" = [ - ":lua Toggle_venn()" - "Toggle Venn" - ]; + { + __unkeyed-1 = "mp"; + __unkeyed-2 = "MarkdownPreview"; + desc = icons.withIcon "git" "Preview Markdown"; + } + + { + __unkeyed-1 = "tv"; + __unkeyed-2 = ":lua Toggle_venn()"; + desc = icons.withIcon "git" "Toggle Venn"; + } + + { + __unkeyed-1 = "oj"; + __unkeyed-2 = "Neorg journal today"; + desc = icons.withIcon "git" "Journal Today"; + } + + { + __unkeyed-1 = "oh"; + __unkeyed-2 = "Neorg workspace home"; + desc = icons.withIcon "git" "Open Neorg Home"; + } + + { + __unkeyed-1 = "zm"; + __unkeyed-2 = "ZenMode"; + desc = icons.withIcon "git" "Focus like a Japanese Philosopher 🧘"; + } - plugins.which-key.registrations."oj" = [ - "Neorg journal today" - "Journal Today" - ]; - plugins.which-key.registrations."oh" = [ - "Neorg workspace home" - "Open Neorg Home" - ]; - plugins.which-key.registrations."zm" = [ - "ZenMode" - "Focus like a Japanese Philosopher 🧘" ]; plugins.comment.enable = true; From 6239104d4959a05b648622b1d35ee48737b208cd Mon Sep 17 00:00:00 2001 From: r17x Date: Thu, 26 Sep 2024 01:59:31 +0700 Subject: [PATCH 4/4] fix!(nvim): breaking options --- flake.lock | 109 ++++++++++++--------------- nix/icons.nix | 4 +- nvim.nix/config/lsp.nix | 92 +++++++++++------------ nvim.nix/config/ui.nix | 158 +++++++++++++++------------------------- 4 files changed, 146 insertions(+), 217 deletions(-) diff --git a/flake.lock b/flake.lock index 127b231..690cee4 100644 --- a/flake.lock +++ b/flake.lock @@ -242,7 +242,7 @@ }, "flake-utils_7": { "inputs": { - "systems": "systems_4" + "systems": "systems_5" }, "locked": { "lastModified": 1710146030, @@ -258,46 +258,59 @@ "type": "github" } }, - "flake-utils_8": { + "git-hooks": { "inputs": { - "systems": "systems_5" + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1726745158, + "narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, - "git-hooks": { + "git-hooks-nix": { "inputs": { "flake-compat": [ - "nixvim", - "flake-compat" + "nix" + ], + "gitignore": [ + "nix" ], - "gitignore": "gitignore", "nixpkgs": [ - "nixvim", + "nix", "nixpkgs" ], "nixpkgs-stable": [ - "nixvim", + "nix", "nixpkgs" ] }, "locked": { - "lastModified": 1723202784, - "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "c7012d0c18567c889b948781bc74a501e92275d1", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", "type": "github" }, "original": { @@ -638,11 +651,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1723221148, - "narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=", + "lastModified": 1727089097, + "narHash": "sha256-ZMHMThPsthhUREwDebXw7GX45bJnBCVbfnH1g5iuSPc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6", + "rev": "568bfef547c14ca438c56a0bece08b8bb2b71a9c", "type": "github" }, "original": { @@ -705,11 +718,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1723460395, - "narHash": "sha256-KxPw+HVYphxCEnkE/KicgY46WlggCZH0HRSDNJPlpbk=", + "lastModified": 1727277745, + "narHash": "sha256-ypOw6aiWorsZl/UkfiJF6I7FnrfpGixebPa5VbbwQFM=", "owner": "nix-community", "repo": "nixvim", - "rev": "f823d01002acd7e1adab01680e42e31b8edc50f5", + "rev": "a8f678da24418e1c84eb0818e1d154d67c982033", "type": "github" }, "original": { @@ -761,18 +774,18 @@ }, "nuschtosSearch": { "inputs": { - "flake-utils": "flake-utils_7", + "flake-utils": "flake-utils_6", "nixpkgs": [ "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1723367906, - "narHash": "sha256-v1qA4WBGDI2uH/TVqRwuXSBP341W681psbzYJ8zrjog=", + "lastModified": 1726995581, + "narHash": "sha256-lgsE/CTkZk9OIiFGEIrxXZQ7Feiv41dqlN7pEfTdgew=", "owner": "NuschtOS", "repo": "search", - "rev": "6ca2c3ae05a915c160512bd41f6810f456c9b30d", + "rev": "3b7dd61b365ca45380707453758a45f2e9977be3", "type": "github" }, "original": { @@ -803,38 +816,6 @@ } }, "pre-commit-hooks": { - "inputs": { - "flake-compat": [ - "nix" - ], - "flake-utils": "flake-utils_6", - "gitignore": [ - "nix" - ], - "nixpkgs": [ - "nix", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712897695, - "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, - "pre-commit-hooks_2": { "inputs": { "flake-compat": "flake-compat_5", "gitignore": "gitignore_2", @@ -1078,11 +1059,11 @@ ] }, "locked": { - "lastModified": 1723454642, - "narHash": "sha256-S0Gvsenh0II7EAaoc9158ZB4vYyuycvMGKGxIbERNAM=", + "lastModified": 1726734507, + "narHash": "sha256-VUH5O5AcOSxb0uL/m34dDkxFKP6WLQ6y4I1B4+N3L2w=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "349de7bc435bdff37785c2466f054ed1766173be", + "rev": "ee41a466c2255a3abe6bc50fc6be927cdee57a9f", "type": "github" }, "original": { diff --git a/nix/icons.nix b/nix/icons.nix index 30e8b02..0af497e 100644 --- a/nix/icons.nix +++ b/nix/icons.nix @@ -10,6 +10,7 @@ let circleLeft1 = ""; circleRight = ""; circleRight1 = ""; + hint = ""; info = "ℹ"; info1 = ""; info2 = ""; @@ -75,5 +76,4 @@ let star = ""; indent = "▎"; }; -in -icons // { withIcon = iconName: s: "${icons.${iconName}} ${s}"; } +in icons // { withIcon = iconName: s: "${icons.${iconName}} ${s}"; } diff --git a/nvim.nix/config/lsp.nix b/nvim.nix/config/lsp.nix index 5c49345..41f7360 100644 --- a/nvim.nix/config/lsp.nix +++ b/nvim.nix/config/lsp.nix @@ -160,27 +160,32 @@ } { __unkeyed-1 = "fic"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_incoming_calls()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_incoming_calls()"; desc = icons.withIcon "git" "[Lsp] Find Incoming Calls"; } { __unkeyed-1 = "foc"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_outgoing_calls()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_outgoing_calls()"; desc = icons.withIcon "git" "[Lsp] Find Outgoing Calls"; } { __unkeyed-1 = "fds"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_document_symbols()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_document_symbols()"; desc = icons.withIcon "git" "[Lsp] Find Document Symbols"; } { __unkeyed-1 = "fws"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_workspace_symbols()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_workspace_symbols()"; desc = icons.withIcon "git" "[Lsp] Find Workspace Symbols"; } { __unkeyed-1 = "fdws"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_dynamic_workspace_symbols()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_dynamic_workspace_symbols()"; desc = icons.withIcon "git" "[Lsp] Find Dynamic Workspace Symbols"; } { @@ -190,7 +195,8 @@ } { __unkeyed-1 = "fli"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_implementations()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_implementations()"; desc = icons.withIcon "git" "[Lsp] Find Implementations"; } { @@ -200,7 +206,8 @@ } { __unkeyed-1 = "flt"; - __unkeyed-2 = "lua require'telescope.builtin'.lsp_type_definitions()"; + __unkeyed-2 = + "lua require'telescope.builtin'.lsp_type_definitions()"; desc = icons.withIcon "git" "[Lsp] Find Type Definitions"; } @@ -224,9 +231,9 @@ eslint.enable = true; eslint.autostart = true; - tsserver.enable = true; - tsserver.autostart = true; - tsserver.rootDir = # lua + ts-ls.enable = true; + ts-ls.autostart = true; + ts-ls.rootDir = # lua '' require('lspconfig.util').root_pattern('.git') ''; @@ -256,11 +263,9 @@ schemas = [ { description = "nixd schema"; - fileMatch = [ - ".nixd.json" - "nixd.json" - ]; - url = "https://raw.githubusercontent.com/nix-community/nixd/main/nixd/docs/nixd-schema.json"; + fileMatch = [ ".nixd.json" "nixd.json" ]; + url = + "https://raw.githubusercontent.com/nix-community/nixd/main/nixd/docs/nixd-schema.json"; } { description = "Turbo.build configuration file"; @@ -269,24 +274,20 @@ } { description = "TypeScript compiler configuration file"; - fileMatch = [ - "tsconfig.json" - "tsconfig.*.json" - ]; + fileMatch = [ "tsconfig.json" "tsconfig.*.json" ]; url = "https://json.schemastore.org/tsconfig.json"; } { description = "ReScript compiler schema"; - fileMatch = [ - "bsconfig.json" - "rescript.json" - ]; - url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/87d78697d7a1eed75c9de55bbdc476540d6f77bb/docs/docson/build-schema.json"; + fileMatch = [ "bsconfig.json" "rescript.json" ]; + url = + "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/87d78697d7a1eed75c9de55bbdc476540d6f77bb/docs/docson/build-schema.json"; } { description = "ReScript v11 compiler schema "; fileMatch = [ "rescript.json" ]; - url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json"; + url = + "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json"; } ]; }; @@ -316,14 +317,8 @@ }; plugins.lsp-format.enable = true; - plugins.lsp-format.setup.ts.order = [ - "tsserver" - "eslint" - ]; - plugins.lsp-format.setup.js.order = [ - "tsserver" - "eslint" - ]; + plugins.lsp-format.setup.ts.order = [ "ts-ls" "eslint" ]; + plugins.lsp-format.setup.js.order = [ "ts-ls" "eslint" ]; plugins.lspkind.enable = true; plugins.lspkind.symbolMap.Codeium = icons.code; @@ -361,7 +356,7 @@ plugins.trouble.enable = true; # TODO: move plugin configuration when needed secrets plugins.codeium-nvim.enable = true; - plugins.codeium-nvim.configPath.__raw = # lua + plugins.codeium-nvim.settings.config_path.__raw = # lua '' vim.env.HOME .. '/.config/sops-nix/secrets/codeium' ''; @@ -377,26 +372,26 @@ plugins.cmp.settings.performance.fetching_timeout = 200; plugins.cmp.settings.performance.max_view_entries = 30; - plugins.cmp.settings.window.completion.winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None"; + plugins.cmp.settings.window.completion.winhighlight = + "Normal:Pmenu,FloatBorder:Pmenu,Search:None"; plugins.cmp.settings.window.completion.border = "rounded"; plugins.cmp.settings.window.documentation.border = "rounded"; plugins.cmp.settings.window.completion.col_offset = -3; plugins.cmp.settings.window.completion.side_padding = 0; plugins.cmp.settings.formatting.expandable_indicator = true; - plugins.cmp.settings.formatting.fields = [ - "kind" - "abbr" - "menu" - ]; + plugins.cmp.settings.formatting.fields = [ "kind" "abbr" "menu" ]; plugins.cmp.settings.mapping."" = "cmp.mapping.complete()"; plugins.cmp.settings.mapping."" = "cmp.mapping.scroll_docs(-4)"; plugins.cmp.settings.mapping."" = "cmp.mapping.close()"; plugins.cmp.settings.mapping."" = "cmp.mapping.scroll_docs(4)"; - plugins.cmp.settings.mapping."" = "cmp.mapping.confirm({ select = true })"; - plugins.cmp.settings.mapping."" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - plugins.cmp.settings.mapping."" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + plugins.cmp.settings.mapping."" = + "cmp.mapping.confirm({ select = true })"; + plugins.cmp.settings.mapping."" = + "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + plugins.cmp.settings.mapping."" = + "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; plugins.cmp.settings.snippet.expand = # lua '' @@ -436,20 +431,15 @@ ''; plugins.cmp.cmdline."/".mapping.__raw = "cmp.mapping.preset.cmdline()"; - plugins.cmp.cmdline."/".sources = [ { name = "buffer"; } ]; + plugins.cmp.cmdline."/".sources = [{ name = "buffer"; }]; plugins.cmp.cmdline."?".mapping.__raw = "cmp.mapping.preset.cmdline()"; - plugins.cmp.cmdline."?".sources = [ { name = "buffer"; } ]; + plugins.cmp.cmdline."?".sources = [{ name = "buffer"; }]; plugins.cmp.cmdline.":".mapping.__raw = "cmp.mapping.preset.cmdline()"; plugins.cmp.cmdline.":".sources = [ { name = "async_path"; } { name = "cmdline"; - option = { - ignore_cmds = [ - "Man" - "!" - ]; - }; + option = { ignore_cmds = [ "Man" "!" ]; }; } ]; } diff --git a/nvim.nix/config/ui.nix b/nvim.nix/config/ui.nix index 596060b..82d1cc1 100644 --- a/nvim.nix/config/ui.nix +++ b/nvim.nix/config/ui.nix @@ -1,11 +1,4 @@ -{ - lib, - helpers, - config, - icons, - pkgs, - ... -}: +{ lib, helpers, config, icons, pkgs, ... }: let devicons = { norg = { @@ -34,18 +27,15 @@ let }; }; - deviconsToLuaString = - icons: - builtins.foldl' - (acc: icon: '' - ${acc} - devicons.set_icon ${icon} - '') - "local devicons = require'nvim-web-devicons'" - (lib.attrsets.mapAttrsToList (name: value: helpers.toLuaObject { "${name}" = value; }) icons); + deviconsToLuaString = icons: + builtins.foldl' (acc: icon: '' + ${acc} + devicons.set_icon ${icon} + '') "local devicons = require'nvim-web-devicons'" + (lib.attrsets.mapAttrsToList + (name: value: helpers.toLuaObject { "${name}" = value; }) icons); -in -{ +in { highlight."@neorg.tags.ranged_verbatim.code_block".link = "Fg"; extraPlugins = with pkgs.vimPlugins; [ @@ -62,7 +52,8 @@ in } { __unkeyed-1 = "tl"; - __unkeyed-2 = "lua vim.g.unhide_lualine = not vim.g.unhide_lualine; require('lualine').hide({ unhide = vim.g.unhide_lualine })"; + __unkeyed-2 = + "lua vim.g.unhide_lualine = not vim.g.unhide_lualine; require('lualine').hide({ unhide = vim.g.unhide_lualine })"; desc = icons.withIcon "git" "Toggle Status Line"; } { @@ -121,10 +112,7 @@ in plugins.indent-blankline.settings.indent.enable = true; plugins.indent-blankline.settings.indent.char = icons.indent; - plugins.indent-blankline.settings.exclude.buftypes = [ - "terminal" - "neorg" - ]; + plugins.indent-blankline.settings.exclude.buftypes = [ "terminal" "neorg" ]; plugins.indent-blankline.settings.exclude.filetypes = [ "norg" "NvimTree" @@ -173,89 +161,59 @@ in -- let g:edge_better_performance = 1 ''; - # based on {https://github.com/r17x/nixpkgs/blob/main/configs/nvim/lua/config/lualine.lua} + plugins.web-devicons.enable = true; + # based on {https://github.com/r17x/nixpkgs/blob/main/configs/nvim/lua/config/lualine.lua} plugins.lualine.enable = true; - plugins.lualine.disabledFiletypes.statusline = [ - "sagaoutline" - "NvimTree" - "Trouble" - ]; - plugins.lualine.theme = "edge"; - plugins.lualine.componentSeparators.left = ""; - plugins.lualine.componentSeparators.right = ""; - plugins.lualine.sectionSeparators.left = icons.circleRight; - plugins.lualine.sectionSeparators.right = icons.circleLeft; - plugins.lualine.sections.lualine_a = [ - { - name = "mode"; - separator.right = icons.circleRight; - extraConfig.padding.left = 1; - } - ]; - - plugins.lualine.sections.lualine_b = [ - { - name = "branch"; - color.fg = "BlueSign"; - } - ]; - plugins.lualine.sections.lualine_c = [ - "diff" - "diagnostics" - ]; - plugins.lualine.sections.lualine_x = [ - { - name = "lsp_progress"; - extraConfig.colors.title = "Cyan"; - extraConfig.separators.component = ""; - extraConfig.separators.percentage.pre = ""; - extraConfig.separators.percentage.post = "%% "; - extraConfig.separators.title.pre = ""; - extraConfig.separators.title.post = ": "; - extraConfig.displayComponents = [ - "spinner" - "lsp_client_name" - ]; - extraConfig.timer.progressEnddelay = 500; - extraConfig.timer.spinner = 1000; - extraConfig.timer.lspClientNameEnddelay = 1000; - extraConfig.spinnerSymbols = [ - "⣀" - "⣠" - "⣴" - "⣶" - "⣾" - "⣿" - "⢿" - "⡿" - ]; - } - ]; - plugins.lualine.sections.lualine_y = [ - "searchcount" - "selectioncount" - "filetype" - "progress" - ]; - plugins.lualine.sections.lualine_z = [ - { - name = "location"; - separator.left = icons.circleLeft; - extraConfig.padding.right = 1; - } - ]; - plugins.lualine.winbar = { }; - plugins.lualine.tabline = { }; - plugins.lualine.extensions = [ ]; + plugins.lualine.settings.disabled_filetypes.statusline = + [ "sagaoutline" "NvimTree" "Trouble" ]; + plugins.lualine.settings.theme = "edge"; + plugins.lualine.settings.components_separatos.left = ""; + plugins.lualine.settings.components_separatos.right = ""; + plugins.lualine.settings.secction_separators.left = icons.circleRight; + plugins.lualine.settings.secction_separators.right = icons.circleLeft; + plugins.lualine.settings.sections.lualine_a = [{ + __unkeyed-1 = "mode"; + separator.right = icons.circleRight; + padding.left = 1; + }]; + plugins.lualine.settings.sections.lualine_b = [{ + __unkeyed-1 = "branch"; + color.fg = "BlueSign"; + }]; + plugins.lualine.settings.sections.lualine_c = [ "diff" "diagnostics" ]; + plugins.lualine.settings.sections.lualine_x = [{ + __unkeyed-1 = "lsp_progress"; + colors.title = "Cyan"; + separators.component = ""; + separators.percentage.pre = ""; + separators.percentage.post = "%% "; + separators.title.pre = ""; + separators.title.post = ": "; + displayComponents = [ "spinner" "lsp_client_name" ]; + timer.progressEnddelay = 500; + timer.spinner = 1000; + timer.lspClientNameEnddelay = 1000; + spinnerSymbols = [ "⣀" "⣠" "⣴" "⣶" "⣾" "⣿" "⢿" "⡿" ]; + }]; + plugins.lualine.settings.sections.lualine_y = + [ "searchcount" "selectioncount" "filetype" "progress" ]; + plugins.lualine.settings.sections.lualine_z = [{ + __unkeyed-1 = "location"; + separator.left = icons.circleLeft; + padding.right = 1; + }]; + plugins.lualine.settings.winbar = { }; + plugins.lualine.settings.tabline = { }; + plugins.lualine.settings.extensions = [ ]; plugins.treesitter.enable = true; plugins.treesitter.folding = true; plugins.treesitter.settings.indent.enable = true; plugins.treesitter.nixvimInjections = true; - plugins.treesitter.grammarPackages = builtins.map ( - x: pkgs.vimPlugins.nvim-treesitter.builtGrammars.${x} - ) config.plugins.treesitter.settings.ensure_installed; + plugins.treesitter.grammarPackages = + builtins.map (x: pkgs.vimPlugins.nvim-treesitter.builtGrammars.${x}) + config.plugins.treesitter.settings.ensure_installed; plugins.treesitter.settings.ignore_install = [ # ┌─────────────────────────────────────┐ # │ move to ensureInstalled for enabled │