diff --git a/config/default.nix b/config/default.nix index 505d12f..d7ffff7 100644 --- a/config/default.nix +++ b/config/default.nix @@ -2,5 +2,8 @@ imports = [ ./settings.nix + ./keymaps.nix + + ./plugins/themes/default.nix ]; } diff --git a/config/keymaps.nix b/config/keymaps.nix new file mode 100644 index 0000000..d1bb12c --- /dev/null +++ b/config/keymaps.nix @@ -0,0 +1,347 @@ +{ + globals.mapleader = " "; + + keymaps = [ + + { + mode = ["n" "x"]; + key = "j"; + action = "v:count == 0 ? 'gj' : 'j'"; + options = {expr = true; silent = true;}; + } + { + mode = ["n" "x"]; + key = ""; + action = "v:count == 0 ? 'gj' : 'j'"; + options = {expr = true; silent = true;}; + } + { + mode = ["n" "x"]; + key = "k"; + action = "v:count == 0 ? 'gk' : 'k'"; + options = {expr = true; silent = true;}; + } + { + mode = ["n" "x"]; + key = ""; + action = "v:count == 0 ? 'gk' : 'k'"; + options = {expr = true; silent = true;}; + } + { + mode = "n"; + key = ""; + action = "h"; + options = {desc = "Go to Left Window"; remap = true;}; + } + { + mode = "n"; + key = ""; + action = "j"; + options = {desc = "Go to Lower Window"; remap = true;}; + } + { + mode = "n"; + key = ""; + action = "k"; + options = {desc = "Go to Upper Window"; remap = true;}; + } + { + mode = "n"; + key = ""; + action = "l"; + options = {desc = "Go to Right Window"; remap = true;}; + } + { + mode = "n"; + key = ""; + action = "resize +2"; + options = {desc = "Increase Window Height";}; + } + { + mode = "n"; + key = ""; + action = "resize -2"; + options = {desc = "Decrease Window Height";}; + } + { + mode = "n"; + key = ""; + action = "vertical resize -2"; + options = {desc = "Decrease Window Width";}; + } + { + mode = "n"; + key = ""; + action = "vertical resize +2"; + options = {desc = "Increase Window Width";}; + } + { + mode = "n"; + key = ""; + action = "m .+1=="; + options = {desc = "Move Down";}; + } + { + mode = "n"; + key = ""; + action = "m .-2=="; + options = {desc = "Move Up";}; + } + { + mode = "i"; + key = ""; + action = "m .+1==gi"; + options = {desc = "Move Down";}; + } + { + mode = "i"; + key = ""; + action = "m .-2==gi"; + options = {desc = "Move Up";}; + } + { + mode = "v"; + key = ""; + action = ":m '>+1gv=gv"; + options = {desc = "Move Down";}; + } + { + mode = "v"; + key = ""; + action = ":m '<-2gv=gv"; + options = {desc = "Move Up";}; + } + { + mode = "i"; + key = ";"; + action = ";u"; + } + { + mode = "i"; + key = "."; + action = ".u"; + } + { + mode = "i"; + key = ";"; + action = ";u"; + } + { + mode = ["i" "x" "n" "s"]; + key = ""; + action = "w"; + options = {desc = "Save File";}; + } + { + mode = ["i" "n"]; + key = ""; + action = "noh"; + options = {desc = "Escape and Clear hlsearch";}; + } + { + mode = "n"; + key = "ur"; + action = "nohlsearchdiffupdatenormal! "; + options = {desc = "Redraw / Clear hlsearch / Diff Update";}; + } + { + mode = "n"; + key = "n"; + action = "'Nn'[v:searchforward].'zv'"; + options = {expr = true; desc = "Next Search Result";}; + } + { + mode = "x"; + key = "n"; + action = "'Nn'[v:searchforward]"; + options = {expr = true; desc = "Next Search Result";}; + } + { + mode = "o"; + key = "n"; + action = "'Nn'[v:searchforward]"; + options = {expr = true; desc = "Next Search Result";}; + } + { + mode = "n"; + key = "N"; + action = "'nN'[v:searchforward].'zv'"; + options = {expr = true; desc = "Prev Search Result";}; + } + { + mode = "x"; + key = "N"; + action = "'nN'[v:searchforward]"; + options = {expr = true; desc = "Prev Search Result";}; + } + { + mode = "o"; + key = "N"; + action = "'nN'[v:searchforward]"; + options = {expr = true; desc = "Prev Search Result";}; + } + { + mode = "n"; + key = "cd"; + action = "vim.diagnostic.open_float"; + options = {desc = "Line Diagnostics";}; + } + { + mode = "n"; + key = "]d"; + action = "diagnostic_goto(true)"; + options = {desc = "Next Diagnostic";}; + } + { + mode = "n"; + key = "[d"; + action = "diagnostic_goto(false)"; + options = {desc = "Prev Diagnostic";}; + } + { + mode = "n"; + key = "]e"; + action = "diagnostic_goto(true 'ERROR')"; + options = {desc = "Next Error";}; + } + { + mode = "n"; + key = "[e"; + action = "diagnostic_goto(false 'ERROR')"; + options = {desc = "Prev Error";}; + } + { + mode = "n"; + key = "]w"; + action = "diagnostic_goto(true 'WARN')"; + options = {desc = "Next Warning";}; + } + { + mode = "n"; + key = "[w"; + action = "diagnostic_goto(false 'WARN')"; + options = {desc = "Prev Warning";}; + } + { + mode = "n"; + key = "qq"; + action = "qa"; + options = {desc = "Quit All";}; + } + { + mode = "n"; + key = "ui"; + action = "vim.show_pos"; + options = {desc = "Inspect Pos";}; + } + { + mode = "t"; + key = ""; + action = ""; + options = {desc = "Enter Normal Mode";}; + } + { + mode = "t"; + key = ""; + action = "wincmd h"; + options = {desc = "Go to Left Window";}; + } + { + mode = "t"; + key = ""; + action = "wincmd j"; + options = {desc = "Go to Lower Window";}; + } + { + mode = "t"; + key = ""; + action = "wincmd k"; + options = {desc = "Go to Upper Window";}; + } + { + mode = "t"; + key = ""; + action = "wincmd l"; + options = {desc = "Go to Right Window";}; + } + { + mode = "t"; + key = ""; + action = "close"; + options = {desc = "Hide Terminal";}; + } + { + mode = "n"; + key = "ww"; + action = "p"; + options = {desc = "Other Window"; remap = true;}; + } + { + mode = "n"; + key = "wd"; + action = "c"; + options = {desc = "Delete Window"; remap = true;}; + } + { + mode = "n"; + key = "w-"; + action = "s"; + options = {desc = "Split Window Below"; remap = true;}; + } + { + mode = "n"; + key = "w|"; + action = "v"; + options = {desc = "Split Window Right"; remap = true;}; + } + { + mode = "n"; + key = "-"; + action = "s"; + options = {desc = "Split Window Below"; remap = true;}; + } + { + mode = "n"; + key = "|"; + action = "v"; + options = {desc = "Split Window Right"; remap = true;}; + } + { + mode = "n"; + key = "l"; + action = "tablast"; + options = {desc = "Last Tab";}; + } + { + mode = "n"; + key = "f"; + action = "tabfirst"; + options = {desc = "First Tab";}; + } + { + mode = "n"; + key = ""; + action = "tabnew"; + options = {desc = "New Tab";}; + } + { + mode = "n"; + key = "]"; + action = "tabnext"; + options = {desc = "Next Tab";}; + } + { + mode = "n"; + key = "d"; + action = "tabclose"; + options = {desc = "Close Tab";}; + } + { + mode = "n"; + key = "["; + action = "tabprevious"; + options = {desc = "Previous Tab";}; + } + ]; +} + diff --git a/config/plugins/themes/default.nix b/config/plugins/themes/default.nix new file mode 100644 index 0000000..8cba6ba --- /dev/null +++ b/config/plugins/themes/default.nix @@ -0,0 +1,45 @@ +{config, ...}: let + lua = x: {__raw = x;}; +in { + colorschemes = { + catppuccin = { + enable = true; + background = { + light = "macchiato"; + dark = "mocha"; + }; + flavour = "frappe"; # "latte", "mocha", "frappe", "macchiato" or raw lua code + disableBold = false; + disableItalic = false; + disableUnderline = false; + transparentBackground = true; + integrations = { + cmp = true; + noice = true; + notify = true; + gitsigns = true; + which_key = true; + illuminate = { + enabled = true; + }; + treesitter = true; + treesitter_context = true; + telescope.enabled = true; + indent_blankline.enabled = true; + mini.enabled = true; + native_lsp = { + enabled = true; + inlay_hints = { + background = true; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + information = ["underline"]; + warnings = ["underline"]; + }; + }; + }; + }; + }; +}