From 7adc3a8bf9624e15d8e41994aa431c89e9ab4565 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Fri, 3 Nov 2023 00:55:23 -0500 Subject: [PATCH] formatting --- cspell.json | 75 +--------------- lua/keymaps.lua | 222 ++++++++++++++++++++++++------------------------ 2 files changed, 114 insertions(+), 183 deletions(-) diff --git a/cspell.json b/cspell.json index c42b216..fcb2bd5 100644 --- a/cspell.json +++ b/cspell.json @@ -1,74 +1 @@ -{ - "language": "en", - "version": "0.2", - "flagWords": [], - "words": [ - "nvim", - "builtins", - "stylua", - "rustfmt", - "pendo", - "tanstack", - "ripgrep", - "Typeahead", - "overscan", - "autorun", - "mediatype", - "BIOINF", - "Transitioner", - "pkce", - "ilike", - "arrayify", - "arrayified", - "komodo", - "wezterm", - "gcloud", - "pbpaste", - "Hasher", - "semvers", - "upserted", - "dtos", - "Yeatts", - "Mahon", - "Beaubier", - "Taussing", - "chakra", - "langchain", - "openai", - "getattr", - "llms", - "docstore", - "kwargs", - "svgr", - "healthcheck", - "venv", - "virtualenv", - "ringofstorms", - "nestjs", - "oneshot", - "templating", - "tiktoken", - "pydantic", - "NCCN", - "clsx", - "reactflow", - "Convo", - "DSAB", - "pgvector", - "postprocess", - "stylelua", - "sqlx", - "genemichaels", - "williamboman", - "substr", - "findfile", - "Hammerspoon", - "eventtap", - "OSTYPE", - "sccache", - "binstall", - "elif", - "autofocus", - "colours" - ] -} +{"flagWords":[],"version":"0.2","words":["nvim","builtins","stylua","rustfmt","pendo","tanstack","ripgrep","Typeahead","overscan","autorun","mediatype","BIOINF","Transitioner","pkce","ilike","arrayify","arrayified","komodo","wezterm","gcloud","pbpaste","Hasher","semvers","upserted","dtos","Yeatts","Mahon","Beaubier","Taussing","chakra","langchain","openai","getattr","llms","docstore","kwargs","svgr","healthcheck","venv","virtualenv","ringofstorms","nestjs","oneshot","templating","tiktoken","pydantic","NCCN","clsx","reactflow","Convo","DSAB","pgvector","postprocess","stylelua","sqlx","genemichaels","williamboman","substr","findfile","Hammerspoon","eventtap","OSTYPE","sccache","binstall","elif","autofocus","colours","Resizer"],"language":"en"} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 0be18dc..c9ff609 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -12,114 +12,118 @@ vim.g.maplocalleader = " " -- command_mode = "c", require("util").keymaps({ - n = { - [";"] = { ":", desc = "No shift command mode" }, - ["n"] = { "nzzzv", desc = "Next search result centered" }, - ["N"] = { "Nzzzv", desc = "Previous search result centered" }, - [""] = { ":noh", desc = "Clear search on escape" }, - [""] = { ":noh", desc = "Clear search on return" }, - ["a"] = { "ggVG", desc = "Select all" }, - ["w"] = { "w", desc = "Save" }, - ["qq"] = { - function() - -- Use to have this which always closed and quit ont he last screen: "confirm q" - -- Instead I want this behavior: - -- if only 1 screen is open then close all buffers, resulting in a blank unamed buffer window similar to fresh session - -- else if more than 1 screen, confirm q to close that screen - -- Check the number of screens - if vim.fn.winnr("$") == 1 then - -- If only 1 screen is open then close all buffers, resulting in a blank unnamed buffer window similar to fresh session - vim.cmd("bufdo bd") + n = { + [";"] = { ":", desc = "No shift command mode" }, + ["n"] = { "nzzzv", desc = "Next search result centered" }, + ["N"] = { "Nzzzv", desc = "Previous search result centered" }, + [""] = { ":noh", desc = "Clear search on escape" }, + [""] = { ":noh", desc = "Clear search on return" }, + ["a"] = { "ggVG", desc = "Select all" }, + ["w"] = { "w", desc = "Save" }, + ["qq"] = { + function() + -- Use to have this which always closed and quit ont he last screen: "confirm q" + -- Instead I want this behavior: + -- if only 1 screen is open then close all buffers, resulting in a blank unamed buffer window similar to fresh session + -- else if more than 1 screen, confirm q to close that screen + -- Check the number of screens + if vim.fn.winnr("$") == 1 then + -- If only 1 screen is open then close all buffers, resulting in a blank unnamed buffer window similar to fresh session + vim.cmd("bufdo bd") vim.cmd("SessionDelete") - else - -- If more than 1 screen, confirm q to close that screen - vim.cmd("confirm q") - end - end, - desc = "Quit", - }, - ["bq"] = { "bp|bd #", desc = "Close current buffer only" }, - ["tn"] = { "tabnew", desc = "Create new tab" }, - ["tq"] = { "tabclose", desc = "Close current tab" }, - ["|"] = { "vsplit", desc = "Vertical Split" }, - ["\\"] = { "split", desc = "Horizontal Split" }, - [""] = { "zz", desc = "Vertical half page down and center cursor" }, - [""] = { "zz", desc = "Vertical half page up and center cursor" }, - ["y"] = { '"*y', desc = "Copy to system clipboard" }, - ["p"] = { '"*p', desc = "Paste from system clipboard" }, - -- ["Q"] = { "Neotree closeqa", desc = "Quit all" }, - ["sq"] = { "Neotree closeSessionDeleteqa", desc = "Quit all, no session saved" }, - ["q"] = { "Neotree closeqa", desc = "Quit all" }, - ["J"] = { "mzJ`z", desc = "Move line below onto this line" }, - [""] = { "", desc = "Go back " }, - -- window navigation - [""] = { "h", desc = "Move window left current" }, - [""] = { "j", desc = "Move window below current" }, - [""] = { "k", desc = "Move window above current" }, - [""] = { "l", desc = "Move window right current" }, - -- tab navigation - ["H"] = { "tabprevious", desc = "Move to previous tab" }, - ["L"] = { "tabnext", desc = "Move to next tab" }, - -- reformat LSP - ["l"] = { - function() - -- vim.cmd "SqlxFormat" - vim.lsp.buf.format() - end, - desc = "Reformat file", - }, - ["ls"] = { "SqlxFormat", desc = "Format sqlx queries in rust raw string literals." }, - ["ld"] = { - function() - vim.diagnostic.open_float() - end, - desc = "Show diagnostic message", - }, - ["ll"] = { - function() - vim.diagnostic.setloclist() - end, - desc = "Show diagnostic list", - }, - ["lz"] = { "e", desc = "Edit current file again / Restart LSP Server" }, - [",uu"] = { ':let @u = trim(tolower(system("uuidgen")))au', desc = "Generate and insert UUID" }, - ["B"] = { "b#", desc = "Switch to last buffer" }, - ["S"] = { - "set equalalwaysset noequalalways", - desc = "Equalize/resize screens evenly", - }, - }, - v = { - ["J"] = { ":m '>+1gv=gv", desc = "Visually move block down" }, - ["K"] = { ":m '<-2gv=gv", desc = "Visually move block up" }, - [",uu"] = { - 'd:let @u = trim(tolower(system("uuidgen")))iu', - desc = "Generate and replace UUID", - }, - ["y"] = { '"*y', desc = "Copy to system clipboard" }, - ["p"] = { '"*p', desc = "Paste from system clipboard" }, - ["p"] = { '"_dP', desc = "Paste without yanking replaced content" }, - [""] = { '"hy:%s/h//g', desc = "Replace current selection" }, - [">"] = { "> gv", desc = "Indent selection" }, - ["<"] = { "< gv", desc = "Outdent selection" }, - }, - i = { - [""] = { "", desc = "Up" }, - [""] = { "", desc = "Down" }, - [""] = { "", desc = "Left" }, - [""] = { "", desc = "Right" }, - [""] = { "", desc = "End" }, - [""] = { "", desc = "Home" }, - }, - c = { - [""] = { "", desc = "Left" }, - [""] = { "", desc = "Down" }, - [""] = { "", desc = "Up" }, - [""] = { "", desc = "Right" }, - [""] = { "", desc = "End" }, - [""] = { "", desc = "Home" }, - }, - t = { - [""] = { "", desc = "Escape the terminal" }, - }, + else + -- If more than 1 screen, confirm q to close that screen + vim.cmd("confirm q") + end + end, + desc = "Quit", + }, + ["bq"] = { "bp|bd #", desc = "Close current buffer only" }, + ["tn"] = { "tabnew", desc = "Create new tab" }, + ["tq"] = { "tabclose", desc = "Close current tab" }, + ["|"] = { "vsplit", desc = "Vertical Split" }, + ["\\"] = { "split", desc = "Horizontal Split" }, + [""] = { "zz", desc = "Vertical half page down and center cursor" }, + [""] = { "zz", desc = "Vertical half page up and center cursor" }, + ["y"] = { '"*y', desc = "Copy to system clipboard" }, + ["p"] = { '"*p', desc = "Paste from system clipboard" }, + -- ["Q"] = { "Neotree closeqa", desc = "Quit all" }, + ["sq"] = { + "Neotree closeSessionDeleteqa", + desc = "Quit all, no session saved", + }, + ["q"] = { "Neotree closeqa", desc = "Quit all" }, + ["J"] = { "mzJ`z", desc = "Move line below onto this line" }, + [""] = { "", desc = "Go back " }, + -- window navigation + [""] = { "h", desc = "Move window left current" }, + [""] = { "j", desc = "Move window below current" }, + [""] = { "k", desc = "Move window above current" }, + [""] = { "l", desc = "Move window right current" }, + -- tab navigation + ["H"] = { "tabprevious", desc = "Move to previous tab" }, + ["L"] = { "tabnext", desc = "Move to next tab" }, + -- reformat LSP + ["l"] = { + function() + -- vim.cmd "SqlxFormat" + vim.lsp.buf.format() + end, + desc = "Reformat file", + }, + ["ls"] = { "SqlxFormat", desc = "Format sqlx queries in rust raw string literals." }, + ["ld"] = { + function() + vim.diagnostic.open_float() + end, + desc = "Show diagnostic message", + }, + ["ll"] = { + function() + vim.diagnostic.setloclist() + end, + desc = "Show diagnostic list", + }, + ["lz"] = { "e", desc = "Edit current file again / Restart LSP Server" }, + [",uu"] = { ':let @u = trim(tolower(system("uuidgen")))au', desc = "Generate and insert UUID" }, + ["B"] = { "b#", desc = "Switch to last buffer" }, + ["S"] = { + "set equalalwaysset noequalalways", + desc = "Equalize/resize screens evenly", + }, + }, + v = { + ["J"] = { ":m '>+1gv=gv", desc = "Visually move block down" }, + ["K"] = { ":m '<-2gv=gv", desc = "Visually move block up" }, + [",uu"] = { + 'd:let @u = trim(tolower(system("uuidgen")))iu', + desc = "Generate and replace UUID", + }, + ["y"] = { '"*y', desc = "Copy to system clipboard" }, + ["p"] = { '"*p', desc = "Paste from system clipboard" }, + ["p"] = { '"_dP', desc = "Paste without yanking replaced content" }, + [""] = { '"hy:%s/h//g', desc = "Replace current selection" }, + [">"] = { "> gv", desc = "Indent selection" }, + ["<"] = { "< gv", desc = "Outdent selection" }, + + }, + i = { + [""] = { "", desc = "Up" }, + [""] = { "", desc = "Down" }, + [""] = { "", desc = "Left" }, + [""] = { "", desc = "Right" }, + [""] = { "", desc = "End" }, + [""] = { "", desc = "Home" }, + }, + c = { + [""] = { "", desc = "Left" }, + [""] = { "", desc = "Down" }, + [""] = { "", desc = "Up" }, + [""] = { "", desc = "Right" }, + [""] = { "", desc = "End" }, + [""] = { "", desc = "Home" }, + }, + t = { + [""] = { "", desc = "Escape the terminal" }, + }, })