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 =
#
# 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
@ -51,7 +51,7 @@ in {
then "+"
else "-";
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";
@ -68,23 +68,23 @@ in {
# previous -> Prev
prettyDir = (toUpper (substring 0 1 d)) + (substring 1 3 d);
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-l>" = "next";
"<S-H>" = "previous";
"<S-L>" = "next";
"[b" = "previous";
"]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 - - - - - - - - - - - - - - - - - - - - -
++ [
(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"
"<cmd>nohlsearch<bar>diffupdate<bar>normal! <C-l><cr>"
keys.mk ["n"] "<LEADER>ur"
"<CMD>nohlsearch<BAR>diffupdate<BAR>normal! <C-l><CR>"
"Redraw / Clear hlsearch / Diff Update"
)
]
@ -119,11 +119,11 @@ in {
)
#
# 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) - - - - - - - - - - - - - - - - - - - - - - - -
# 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (map (c: keys.mk' ["v"] c "${c}gv") ["<" ">"])
@ -132,7 +132,7 @@ in {
++ (
mapAttrsToList (
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}"
)
{
@ -142,19 +142,19 @@ in {
)
#
# New File - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<leader>fn" "<cmd>enew<cr>" "New File")]
++ [(keys.mk ["n"] "<LEADER>fn" "<CMD>enew<CR>" "New File")]
#
# Locations/Quickfixes - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [
(keys.mk ["n"] "<leader>xl" "<cmd>lopen<cr>" "Location List")
(keys.mk ["n"] "<leader>xq" "<cmd>copen<cr>" "Quickfix list")
(keys.mk ["n"] "<LEADER>xl" "<CMD>lopen<CR>" "Location List")
(keys.mk ["n"] "<LEADER>xq" "<CMD>copen<CR>" "Quickfix list")
]
++ (
mapAttrsToList (
k: d: let
cmd = substring 0 4 (toLower d);
in
keys.mk ["n"] "${k}q" "<cmd>c${cmd}<cr>" "${d} Quickfix"
keys.mk ["n"] "${k}q" "<CMD>c${cmd}<CR>" "${d} Quickfix"
)
{
"[" = "Previous";
@ -164,7 +164,7 @@ in {
#
# Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [
(keys.mk ["n"] "<leader>cd" (
(keys.mk ["n"] "<LEADER>cd" (
mkRaw
# lua
"function() vim.diagnostic.open_float() end"
@ -215,17 +215,17 @@ in {
)
#
# Quit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<leader>qq" "<cmd>qa<cr>" "Quit All")]
++ [(keys.mk ["n"] "<LEADER>qq" "<CMD>qa<CR>" "Quit All")]
#
# 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [
(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>v" "Split Window Right" {remap = true;})
(keys.mkWithOpts ["n"] "<leader>wd" "<C-w>c" "Delete Window" {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>v" "Split Window Right" {remap = true;})
(keys.mkWithOpts ["n"] "<LEADER>wd" "<C-w>c" "Delete Window" {remap = true;})
]
#
# Tab Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -237,13 +237,13 @@ in {
then "Close Other Tabs"
else "${a} Tab";
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";
o = "Only";
f = "First";
"<Tab>" = "New";
"<TAB>" = "New";
"]" = "Next";
d = "Close";
"[" = "Previous";

View file

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