style: <cmd> -> <CMD> etc

This commit is contained in:
punkfairie 2024-11-25 21:23:29 -08:00
parent c7a523f4c1
commit e3ef9e4716
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
2 changed files with 46 additions and 46 deletions

View file

@ -24,7 +24,7 @@ in {
keymaps = keymaps =
# #
# Disable Arrow Key Movement - - - - - - - - - - - - - - - - - - - - - - - - # Disable Arrow Key Movement - - - - - - - - - - - - - - - - - - - - - - - -
(map (d: keys.mk' ["i" "n"] d "<nop>") ["<Down>" "<Up>" "<Left>" "<Right>"]) (map (d: keys.mk' ["i" "n"] d "<NOP>") ["<DOWN>" "<UP>" "<LEFT>" "<RIGHT>"])
# #
# Better Up/Down - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Better Up/Down - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ ( ++ (
@ -51,7 +51,7 @@ in {
then "+" then "+"
else "-"; else "-";
in in
keys.mk ["n"] "<C-${k}>" "<cmd>resize ${s}4<cr>" "${d} Window Height" keys.mk ["n"] "<C-${k}>" "<CMD>resize ${s}4<CR>" "${d} Window Height"
) )
{ {
Up = "Increase"; Up = "Increase";
@ -68,23 +68,23 @@ in {
# previous -> Prev # previous -> Prev
prettyDir = (toUpper (substring 0 1 d)) + (substring 1 3 d); prettyDir = (toUpper (substring 0 1 d)) + (substring 1 3 d);
in in
keys.mk ["n"] k "<cmd>b${d}<cr>" "${prettyDir} Buffer" keys.mk ["n"] k "<CMD>b${d}<CR>" "${prettyDir} Buffer"
) )
{ {
"<S-h>" = "previous"; "<S-H>" = "previous";
"<S-l>" = "next"; "<S-L>" = "next";
"[b" = "previous"; "[b" = "previous";
"]b" = "next"; "]b" = "next";
} }
) )
++ [(keys.mk ["n"] "<leader>bD" "<cmd>bd<cr>" "Delete Buffer and Window")] ++ [(keys.mk ["n"] "<LEADER>bD" "<CMD>bd<CR>" "Delete Buffer and Window")]
# #
# Clear Search/Diff Update/Redraw - - - - - - - - - - - - - - - - - - - - - # Clear Search/Diff Update/Redraw - - - - - - - - - - - - - - - - - - - - -
++ [ ++ [
(keys.mk ["i" "n"] "<esc>" "<cmd>noh<cr><esc>" "Escape and Clear hlsearch") (keys.mk ["i" "n"] "<ESC>" "<CMD>noh<CR><ESC>" "Escape and Clear hlsearch")
( (
keys.mk ["n"] "<leader>ur" keys.mk ["n"] "<LEADER>ur"
"<cmd>nohlsearch<bar>diffupdate<bar>normal! <C-l><cr>" "<CMD>nohlsearch<BAR>diffupdate<BAR>normal! <C-l><CR>"
"Redraw / Clear hlsearch / Diff Update" "Redraw / Clear hlsearch / Diff Update"
) )
] ]
@ -119,11 +119,11 @@ in {
) )
# #
# Undo Break-Points - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Undo Break-Points - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (map (c: keys.mk' ["i"] c "${c}<c-g>u") ["," "." ";"]) ++ (map (c: keys.mk' ["i"] c "${c}<C-g>u") ["," "." ";"])
# #
# Search Docs (keywordprog) - - - - - - - - - - - - - - - - - - - - - - - - # Search Docs (keywordprog) - - - - - - - - - - - - - - - - - - - - - - - -
# https://til.codeinthehole.com/posts/about-how-to-use-keywordprg-effectively/ # https://til.codeinthehole.com/posts/about-how-to-use-keywordprg-effectively/
++ [(keys.mk ["n"] "<leader>K" "<cmd>norm! K<cr>" "Search <keywordprog> for word")] ++ [(keys.mk ["n"] "<LEADER>K" "<CMD>norm! K<CR>" "Search <KEYWORDPROG> for word")]
# #
# Better Indenting - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Better Indenting - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (map (c: keys.mk' ["v"] c "${c}gv") ["<" ">"]) ++ (map (c: keys.mk' ["v"] c "${c}gv") ["<" ">"])
@ -132,7 +132,7 @@ in {
++ ( ++ (
mapAttrsToList ( mapAttrsToList (
k: d: k: d:
keys.mk ["n"] "gc${k}" "${k}<esc>Vcx<esc><cmd>normal gcc<cr>fxa<bs>" keys.mk ["n"] "gc${k}" "${k}<ESC>Vcx<ESC><CMD>normal gcc<CR>fxa<BS>"
"Add Comment ${d}" "Add Comment ${d}"
) )
{ {
@ -142,19 +142,19 @@ in {
) )
# #
# New File - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # New File - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<leader>fn" "<cmd>enew<cr>" "New File")] ++ [(keys.mk ["n"] "<LEADER>fn" "<CMD>enew<CR>" "New File")]
# #
# Locations/Quickfixes - - - - - - - - - - - - - - - - - - - - - - - - - - - # Locations/Quickfixes - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [ ++ [
(keys.mk ["n"] "<leader>xl" "<cmd>lopen<cr>" "Location List") (keys.mk ["n"] "<LEADER>xl" "<CMD>lopen<CR>" "Location List")
(keys.mk ["n"] "<leader>xq" "<cmd>copen<cr>" "Quickfix list") (keys.mk ["n"] "<LEADER>xq" "<CMD>copen<CR>" "Quickfix list")
] ]
++ ( ++ (
mapAttrsToList ( mapAttrsToList (
k: d: let k: d: let
cmd = substring 0 4 (toLower d); cmd = substring 0 4 (toLower d);
in in
keys.mk ["n"] "${k}q" "<cmd>c${cmd}<cr>" "${d} Quickfix" keys.mk ["n"] "${k}q" "<CMD>c${cmd}<CR>" "${d} Quickfix"
) )
{ {
"[" = "Previous"; "[" = "Previous";
@ -164,7 +164,7 @@ in {
# #
# Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [ ++ [
(keys.mk ["n"] "<leader>cd" ( (keys.mk ["n"] "<LEADER>cd" (
mkRaw mkRaw
# lua # lua
"function() vim.diagnostic.open_float() end" "function() vim.diagnostic.open_float() end"
@ -215,17 +215,17 @@ in {
) )
# #
# Quit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Quit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<leader>qq" "<cmd>qa<cr>" "Quit All")] ++ [(keys.mk ["n"] "<LEADER>qq" "<CMD>qa<CR>" "Quit All")]
# #
# Inspect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Inspect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<leader>ui" (mkRaw "vim.show_pos") "Inspect Position")] ++ [(keys.mk ["n"] "<LEADER>ui" (mkRaw "vim.show_pos") "Inspect Position")]
# #
# Window Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Window Management - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [ ++ [
(keys.mkWithOpts ["n"] "<leader>w" "<C-w>" "Windows" {remap = true;}) (keys.mkWithOpts ["n"] "<LEADER>w" "<C-w>" "Windows" {remap = true;})
(keys.mkWithOpts ["n"] "<leader>-" "<C-w>s" "Split Window Below" {remap = true;}) (keys.mkWithOpts ["n"] "<LEADER>-" "<C-w>s" "Split Window Below" {remap = true;})
(keys.mkWithOpts ["n"] "<leader>|" "<C-w>v" "Split Window Right" {remap = true;}) (keys.mkWithOpts ["n"] "<LEADER>|" "<C-w>v" "Split Window Right" {remap = true;})
(keys.mkWithOpts ["n"] "<leader>wd" "<C-w>c" "Delete Window" {remap = true;}) (keys.mkWithOpts ["n"] "<LEADER>wd" "<C-w>c" "Delete Window" {remap = true;})
] ]
# #
# Tab Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Tab Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -237,13 +237,13 @@ in {
then "Close Other Tabs" then "Close Other Tabs"
else "${a} Tab"; else "${a} Tab";
in in
keys.mk ["n"] "<leader><tab>${k}" "<cmd>tab${toLower a}<cr>" desc keys.mk ["n"] "<LEADER><TAB>${k}" "<CMD>tab${toLower a}<CR>" desc
) )
{ {
l = "Last"; l = "Last";
o = "Only"; o = "Only";
f = "First"; f = "First";
"<Tab>" = "New"; "<TAB>" = "New";
"]" = "Next"; "]" = "Next";
d = "Close"; d = "Close";
"[" = "Previous"; "[" = "Previous";

View file

@ -22,57 +22,57 @@ in {
}; };
keymaps = [ keymaps = [
(keys.mk ["n"] "<leader>un" ( (keys.mk ["n"] "<LEADER>un" (
mkRaw mkRaw
# lua # lua
"function() Snacks.notifier.hide() end" "function() Snacks.notifier.hide() end"
) "Dismiss All Notifications") ) "Dismiss All Notifications")
(keys.mk ["n"] "<leader>bd" ( (keys.mk ["n"] "<LEADER>bd" (
mkRaw mkRaw
# lua # lua
"function() Snacks.bufdelete() end" "function() Snacks.bufdelete() end"
) "Delete Buffer") ) "Delete Buffer")
(keys.mk ["n"] "<leader>bo" ( (keys.mk ["n"] "<LEADER>bo" (
mkRaw mkRaw
# lua # lua
"function() Snacks.bufdelete.other() end" "function() Snacks.bufdelete.other() end"
) "Delete Other Buffers") ) "Delete Other Buffers")
# LazyGit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # LazyGit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(keys.mk ["n"] "<leader>gg" ( (keys.mk ["n"] "<LEADER>gg" (
mkRaw mkRaw
# lua # lua
"function() Snacks.lazygit() end" "function() Snacks.lazygit() end"
) "Lazygit") ) "Lazygit")
(keys.mk ["n"] "<leader>gf" ( (keys.mk ["n"] "<LEADER>gf" (
mkRaw mkRaw
# lua # lua
"function() Snacks.lazygit.log_file() end" "function() Snacks.lazygit.log_file() end"
) "Lazygit Current File History") ) "Lazygit Current File History")
(keys.mk ["n"] "<leader>gl" ( (keys.mk ["n"] "<LEADER>gl" (
mkRaw mkRaw
# lua # lua
"function() Snacks.lazygit.log() end" "function() Snacks.lazygit.log() end"
) "Lazygit Log") ) "Lazygit Log")
# Git - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Git - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(keys.mk ["n"] "<leader>gb" ( (keys.mk ["n"] "<LEADER>gb" (
mkRaw mkRaw
# lua # lua
"function() Snacks.git.blame_line() end" "function() Snacks.git.blame_line() end"
) "Git Blame Line") ) "Git Blame Line")
(keys.mk ["n" "x"] "<leader>gB" ( (keys.mk ["n" "x"] "<LEADER>gB" (
mkRaw mkRaw
# lua # lua
"function() Snacks.gitbrowse() end" "function() Snacks.gitbrowse() end"
) "Git Browse (open)") ) "Git Browse (open)")
(keys.mk ["n" "x"] "<leader>gY" (mkRaw (keys.mk ["n" "x"] "<LEADER>gY" (mkRaw
# lua # lua
'' ''
function() function()
@ -131,19 +131,19 @@ in {
}) })
end end
toggle_format():map("<leader>uf") toggle_format():map("<LEADER>uf")
toggle_format(true):map("<leader>uF") toggle_format(true):map("<LEADER>uF")
Snacks.toggle.option("spell", { name = "Spelling"}):map("<leader>us") Snacks.toggle.option("spell", { name = "Spelling"}):map("<LEADER>us")
Snacks.toggle.option("wrap", {name = "Wrap"}):map("<leader>uw") Snacks.toggle.option("wrap", {name = "Wrap"}):map("<LEADER>uw")
Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("<leader>uL") Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("<LEADER>uL")
Snacks.toggle.diagnostics():map("<leader>ud") Snacks.toggle.diagnostics():map("<LEADER>ud")
Snacks.toggle.line_number():map("<leader>ul") Snacks.toggle.line_number():map("<LEADER>ul")
Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("<leader>uc") Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("<LEADER>uc")
Snacks.toggle.treesitter():map("<leader>uT") Snacks.toggle.treesitter():map("<LEADER>uT")
Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("<leader>ub") Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("<LEADER>ub")
if vim.lsp.inlay_hint then if vim.lsp.inlay_hint then
Snacks.toggle.inlay_hints():map("<leader>uh") Snacks.toggle.inlay_hints():map("<LEADER>uh")
end end
function maximize_window() function maximize_window()
@ -185,6 +185,6 @@ in {
}) })
end end
maximize_window():map("<leader>wm") maximize_window():map("<LEADER>wm")
''; '';
} }