From b8765d1df6413a2e4bde319a128cad184dd335bf Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 13 Sep 2023 16:32:27 -0500 Subject: [PATCH] style(nvim): format with stylua --- dots/.config/nvim/after/ftplugin/asm.lua | 2 +- dots/.config/nvim/after/ftplugin/nix.lua | 8 +-- dots/.config/nvim/after/ftplugin/python.lua | 20 ++++-- dots/.config/nvim/lua/core/autocmds.lua | 70 +++++++------------ dots/.config/nvim/lua/core/mappings.lua | 13 ++-- dots/.config/nvim/lua/plugins/configs/cmp.lua | 53 ++++++++------ .../nvim/lua/plugins/configs/flatten.lua | 14 ++-- .../nvim/lua/plugins/configs/formatter.lua | 4 +- .../nvim/lua/plugins/configs/github.lua | 12 ++-- .../nvim/lua/plugins/configs/heirline.lua | 18 ++--- .../lua/plugins/configs/highlight-undo.lua | 6 +- .../nvim/lua/plugins/configs/hydra.lua | 2 +- .../nvim/lua/plugins/configs/kanagawa.lua | 4 +- dots/.config/nvim/lua/plugins/configs/lsp.lua | 16 ++--- .../nvim/lua/plugins/configs/telescope.lua | 63 +++++++++-------- .../nvim/lua/plugins/configs/toggleterm.lua | 2 +- .../nvim/lua/plugins/configs/treesitter.lua | 5 +- dots/.config/nvim/lua/utils/funcs.lua | 1 - 18 files changed, 160 insertions(+), 153 deletions(-) diff --git a/dots/.config/nvim/after/ftplugin/asm.lua b/dots/.config/nvim/after/ftplugin/asm.lua index 512dcc04..1dca36b5 100644 --- a/dots/.config/nvim/after/ftplugin/asm.lua +++ b/dots/.config/nvim/after/ftplugin/asm.lua @@ -23,7 +23,7 @@ vim.keymap.set("n", "fr", function() "-o", executable_path, "&& \n", - executable_path + executable_path, } require("toggleterm").exec(table.concat(cmd, " ")) end, { diff --git a/dots/.config/nvim/after/ftplugin/nix.lua b/dots/.config/nvim/after/ftplugin/nix.lua index e55810ab..0dc0c260 100644 --- a/dots/.config/nvim/after/ftplugin/nix.lua +++ b/dots/.config/nvim/after/ftplugin/nix.lua @@ -10,12 +10,12 @@ vim.keymap.set("n", "fr", function() "nix-instantiate", "--eval", "--strict", - vim.api.nvim_buf_get_name(0) + vim.api.nvim_buf_get_name(0), } require("toggleterm").exec(table.concat(cmd, " ")) end, { buffer = true, - desc = "Nix: Run with default output" + desc = "Nix: Run with default output", }) vim.keymap.set("n", "fj", function() @@ -26,10 +26,10 @@ vim.keymap.set("n", "fj", function() "--json", vim.api.nvim_buf_get_name(0), "|", - "jq" + "jq", } require("toggleterm").exec(table.concat(cmd, " ")) end, { buffer = true, - desc = "Nix: Run with json output" + desc = "Nix: Run with json output", }) diff --git a/dots/.config/nvim/after/ftplugin/python.lua b/dots/.config/nvim/after/ftplugin/python.lua index 3e795b0e..c0205e4d 100644 --- a/dots/.config/nvim/after/ftplugin/python.lua +++ b/dots/.config/nvim/after/ftplugin/python.lua @@ -7,14 +7,22 @@ vim.api.nvim_create_autocmd("InsertCharPre", { --- @return nil callback = function(opts) -- Only run if f-string escape character is typed - if vim.v.char ~= "{" then return end + if vim.v.char ~= "{" then + return + end -- Get node and return early if not in a string local node = vim.treesitter.get_node() - if not node then return end - if node:type() ~= "string" then node = node:parent() end - if not node or node:type() ~= "string" then return end + if not node then + return + end + if node:type() ~= "string" then + node = node:parent() + end + if not node or node:type() ~= "string" then + return + end vim.print(node:type()) local row, col, _, _ = vim.treesitter.get_node_range(node) @@ -23,7 +31,9 @@ vim.api.nvim_create_autocmd("InsertCharPre", { local first_char = vim.api.nvim_buf_get_text(opts.buf, row, col, row, col + 1, {})[1] vim.print("row " .. row .. " col " .. col) vim.print("char: '" .. first_char .. "'") - if first_char == "f" then return end + if first_char == "f" then + return + end -- Otherwise, make the string a format string vim.api.nvim_input("m'" .. row + 1 .. "gg" .. col + 1 .. "|if`'la") diff --git a/dots/.config/nvim/lua/core/autocmds.lua b/dots/.config/nvim/lua/core/autocmds.lua index 459f019d..3cd26c5d 100644 --- a/dots/.config/nvim/lua/core/autocmds.lua +++ b/dots/.config/nvim/lua/core/autocmds.lua @@ -17,18 +17,13 @@ M.setup = function() if not strip_trail_space then intercept_state = "`Disabled`" end - vim.notify("Strip Trail Space set to " .. intercept_state, vim.log.levels.INFO, - { - title = "Strip Trail Space", - ---@param win integer The window handle - on_open = function(win) - vim.api.nvim_buf_set_option( - vim.api.nvim_win_get_buf(win), - "filetype", - "markdown" - ) - end - }) + vim.notify("Strip Trail Space set to " .. intercept_state, vim.log.levels.INFO, { + title = "Strip Trail Space", + ---@param win integer The window handle + on_open = function(win) + vim.api.nvim_buf_set_option(vim.api.nvim_win_get_buf(win), "filetype", "markdown") + end, + }) end, { desc = "Toggles intercepting BufWritePre to strip trail space" }) -- NOTE: Remove trailing whitespace on save @@ -38,7 +33,7 @@ M.setup = function() if strip_trail_space then vim.cmd.StripTrailSpace() end - end + end, }) -- NOTE: Disables status column elements in Terminal buffer @@ -60,7 +55,9 @@ M.setup = function() desc = "Delete [No Name] buffers", callback = function(event) if event.file == "" and vim.bo[event.buf].buftype == "" and not vim.bo[event.buf].modified then - vim.schedule(function() pcall(vim.api.nvim_buf_delete, event.buf, {}) end) + vim.schedule(function() + pcall(vim.api.nvim_buf_delete, event.buf, {}) + end) end end, }) @@ -72,18 +69,13 @@ M.setup = function() if not intercept_file_open then intercept_state = "`Disabled`" end - vim.notify("Intercept file open set to " .. intercept_state, vim.log.levels.INFO, - { - title = "Intercept File Open", - ---@param win integer The window handle - on_open = function(win) - vim.api.nvim_buf_set_option( - vim.api.nvim_win_get_buf(win), - "filetype", - "markdown" - ) - end - }) + vim.notify("Intercept file open set to " .. intercept_state, vim.log.levels.INFO, { + title = "Intercept File Open", + ---@param win integer The window handle + on_open = function(win) + vim.api.nvim_buf_set_option(vim.api.nvim_win_get_buf(win), "filetype", "markdown") + end, + }) end, { desc = "Toggles intercepting BufNew to open files in custom programs" }) -- NOTE: Add "BufReadPre" to the autocmd events to also intercept files given on the command line, e.g. @@ -106,21 +98,13 @@ M.setup = function() ---@param fpath string The file path given to the program ---@param fname string The file name used in notifications local function open_mime(buf, fpath, fname) - vim.notify( - string.format("Opening `%s` in external program", fname), - vim.log.levels.INFO, - { - title = "Open File in External Program", - ---@param win integer The window handle - on_open = function(win) - vim.api.nvim_buf_set_option( - vim.api.nvim_win_get_buf(win), - "filetype", - "markdown" - ) - end - } - ) + vim.notify(string.format("Opening `%s` in external program", fname), vim.log.levels.INFO, { + title = "Open File in External Program", + ---@param win integer The window handle + on_open = function(win) + vim.api.nvim_buf_set_option(vim.api.nvim_win_get_buf(win), "filetype", "markdown") + end, + }) vim.system({ "xdg-open", fpath }, { detach = true }) vim.api.nvim_buf_delete(buf, { force = true }) end @@ -136,7 +120,7 @@ M.setup = function() ["mp4"] = function(buf, fpath, fname) open_mime(buf, fpath, fname) end, - ["gif"] = "mp4" + ["gif"] = "mp4", } ---Get the extension callback for a given extension. Will do a recursive lookup if an extension callback is actually @@ -157,7 +141,7 @@ M.setup = function() callback(bufnr, path, filename) end end - end + end, }) end diff --git a/dots/.config/nvim/lua/core/mappings.lua b/dots/.config/nvim/lua/core/mappings.lua index 0df2dbbc..b25036e4 100755 --- a/dots/.config/nvim/lua/core/mappings.lua +++ b/dots/.config/nvim/lua/core/mappings.lua @@ -5,7 +5,7 @@ local M = {} ---Traverse to indent >= or > current indent ---@param direction integer 1 - forwards | -1 - backwards ---@param equal boolean include lines equal to current indent in search? -local function indent_traverse(direction, equal) -- {{{ +local function indent_traverse(direction, equal) -- {{{ return function() -- Get the current cursor position local current_line, column = unpack(vim.api.nvim_win_get_cursor(0)) @@ -17,14 +17,11 @@ local function indent_traverse(direction, equal) -- {{{ -- Look for a line of appropriate indent -- level without going out of the buffer - while (not match) - and (match_line ~= buf_length) - and (match_line ~= 1) - do + while (not match) and (match_line ~= buf_length) and (match_line ~= 1) do match_line = match_line + direction local match_line_str = vim.api.nvim_buf_get_lines(0, match_line - 1, match_line, false)[1] -- local match_line_is_whitespace = match_line_str and match_line_str:match('^%s*$') - local match_line_is_whitespace = match_line_str:match('^%s*$') + local match_line_is_whitespace = match_line_str:match("^%s*$") if equal then match_indent = vim.fn.indent(match_line) <= vim.fn.indent(current_line) @@ -112,8 +109,8 @@ M.setup = function() -- Binding to keep S-Space in terminals from not sending vim.keymap.set("t", "", "", { silent = true, desc = "Terminal: Hack S-Space to Space" }) - vim.keymap.set("n", "", indent_traverse(1, true), { silent = true, desc = "Move: To next equal indent"}) - vim.keymap.set("n", "", indent_traverse(-1, true), { silent = true, desc = "Move: To previous equal indent"}) + vim.keymap.set("n", "", indent_traverse(1, true), { silent = true, desc = "Move: To next equal indent" }) + vim.keymap.set("n", "", indent_traverse(-1, true), { silent = true, desc = "Move: To previous equal indent" }) end return M diff --git a/dots/.config/nvim/lua/plugins/configs/cmp.lua b/dots/.config/nvim/lua/plugins/configs/cmp.lua index 274bc73d..357c0b19 100644 --- a/dots/.config/nvim/lua/plugins/configs/cmp.lua +++ b/dots/.config/nvim/lua/plugins/configs/cmp.lua @@ -66,25 +66,35 @@ return { s = s / 100 l = l / 100 - local r, g, b; + local r, g, b if s == 0 then - r, g, b = l, l, l; -- achromatic + r, g, b = l, l, l -- achromatic else local function hue2rgb(p, q, t) - if t < 0 then t = t + 1 end - if t > 1 then t = t - 1 end - if t < 1 / 6 then return p + (q - p) * 6 * t end - if t < 1 / 2 then return q end - if t < 2 / 3 then return p + (q - p) * (2 / 3 - t) * 6 end - return p; + if t < 0 then + t = t + 1 + end + if t > 1 then + t = t - 1 + end + if t < 1 / 6 then + return p + (q - p) * 6 * t + end + if t < 1 / 2 then + return q + end + if t < 2 / 3 then + return p + (q - p) * (2 / 3 - t) * 6 + end + return p end - local q = l < 0.5 and l * (1 + s) or l + s - l * s; - local p = 2 * l - q; - r = hue2rgb(p, q, h + 1 / 3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - 1 / 3); + local q = l < 0.5 and l * (1 + s) or l + s - l * s + local p = 2 * l - q + r = hue2rgb(p, q, h + 1 / 3) + g = hue2rgb(p, q, h) + b = hue2rgb(p, q, h - 1 / 3) end local function round(num) @@ -93,7 +103,6 @@ return { return round(r * 255), round(g * 255), round(b * 255) end - ---@param sources table? local standard_sources = function(sources) sources = sources or {} @@ -170,8 +179,12 @@ return { return conversion end end - return string.format("#%s%s%s", convertNumHex(red), convertNumHex(green), - convertNumHex(blue)) + return string.format( + "#%s%s%s", + convertNumHex(red), + convertNumHex(green), + convertNumHex(blue) + ) end if type(hl) == string then @@ -180,11 +193,11 @@ return { hl = rgbToHex(red, green, blue) end - local start, _, hue, saturation, lightness = hl:find( - "hsl.*%((%d+), (%d+)%%, (%d+)%%.*%)") + local start, _, hue, saturation, lightness = + hl:find("hsl.*%((%d+), (%d+)%%, (%d+)%%.*%)") if start ~= nil then - red, green, blue = hslToRgb(tonumber(hue), tonumber(saturation), - tonumber(lightness)) + red, green, blue = + hslToRgb(tonumber(hue), tonumber(saturation), tonumber(lightness)) hl = rgbToHex(red, green, blue) end diff --git a/dots/.config/nvim/lua/plugins/configs/flatten.lua b/dots/.config/nvim/lua/plugins/configs/flatten.lua index 9b38beac..afa1d75e 100644 --- a/dots/.config/nvim/lua/plugins/configs/flatten.lua +++ b/dots/.config/nvim/lua/plugins/configs/flatten.lua @@ -8,11 +8,11 @@ return { return { window = { - open = "alternate" + open = "alternate", }, one_per = { wezterm = false, - kitty = false + kitty = false, }, callbacks = { should_block = function(argv) @@ -49,7 +49,7 @@ return { once = true, callback = vim.schedule_wrap(function() vim.api.nvim_buf_delete(bufnr, {}) - end) + end), }) end end, @@ -61,9 +61,9 @@ return { saved_terminal = nil end end) - end - } + end, + }, } - end - } + end, + }, } diff --git a/dots/.config/nvim/lua/plugins/configs/formatter.lua b/dots/.config/nvim/lua/plugins/configs/formatter.lua index 257e180a..5d369816 100644 --- a/dots/.config/nvim/lua/plugins/configs/formatter.lua +++ b/dots/.config/nvim/lua/plugins/configs/formatter.lua @@ -28,9 +28,9 @@ return { asm = function() return { exe = "asmfmt", - stdin = true + stdin = true, } - end + end, }, } end, diff --git a/dots/.config/nvim/lua/plugins/configs/github.lua b/dots/.config/nvim/lua/plugins/configs/github.lua index 369a91a0..c1978462 100644 --- a/dots/.config/nvim/lua/plugins/configs/github.lua +++ b/dots/.config/nvim/lua/plugins/configs/github.lua @@ -1,12 +1,12 @@ return { { - 'pwntester/octo.nvim', + "pwntester/octo.nvim", cmd = "Octo", dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope.nvim', - 'nvim-tree/nvim-web-devicons', + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", }, - config = true - } + config = true, + }, } diff --git a/dots/.config/nvim/lua/plugins/configs/heirline.lua b/dots/.config/nvim/lua/plugins/configs/heirline.lua index d2bdc7b3..cb8b93b7 100644 --- a/dots/.config/nvim/lua/plugins/configs/heirline.lua +++ b/dots/.config/nvim/lua/plugins/configs/heirline.lua @@ -142,11 +142,11 @@ return { local filename = self.filename local extension = vim.fn.fnamemodify(filename, ":e") local buftype = vim.api.nvim_get_option_value("buftype", { - buf = self.bufnr + buf = self.bufnr, }) local filetype = vim.api.nvim_get_option_value("filetype", { - buf = self.bufnr + buf = self.bufnr, }) self.icon, self.icon_color = require("nvim-web-devicons").get_icon_color(filename, extension, { default = true }) @@ -155,11 +155,11 @@ return { ["rust"] = { icon = "", icon_color = self.icon_color }, ["sshconfig"] = { icon = "󰴳", icon_color = colors.carpYellow }, ["sshdconfig"] = "sshconfig", - ["help"] = { icon = "󰋗", icon_color = colors.springGreen } + ["help"] = { icon = "󰋗", icon_color = colors.springGreen }, } local buftype_overrides = { - ["terminal"] = { icon = " ", icon_color = colors.roninYellow } + ["terminal"] = { icon = " ", icon_color = colors.roninYellow }, } local function get_override(name, overrides) @@ -194,7 +194,7 @@ return { provider = function(self) local filename = "" local buftype = vim.api.nvim_get_option_value("buftype", { - buf = self.bufnr + buf = self.bufnr, }) if buftype == "terminal" then local subs = 0 @@ -455,7 +455,7 @@ return { StatusLineBufferBlock, { provider = "", hl = { fg = colors.katanaGray } }, -- left truncation, optional (defaults to "<") { provider = "", hl = { fg = colors.katanaGray } } -- right trunctation, also optional (defaults to ...... yep, ">") - -- by the way, open a lot of buffers and try clicking them ;) + -- by the way, open a lot of buffers and try clicking them ;) ) local Tabpage = { @@ -562,7 +562,7 @@ return { end return { fg = colors.oniViolet, bg = bg } - end + end, }, }, { @@ -589,7 +589,7 @@ return { return { fg = colors.oniViolet2, bg = bg } end, }, - } + }, }, { condition = conditions.has_diagnostics, @@ -676,7 +676,7 @@ return { }, { FileIcon, - hl = { bg = colors.sumiInk4 } + hl = { bg = colors.sumiInk4 }, }, { provider = seps.full.right, diff --git a/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua b/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua index cb552889..553b099b 100644 --- a/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua +++ b/dots/.config/nvim/lua/plugins/configs/highlight-undo.lua @@ -1,9 +1,9 @@ return { { - 'tzachar/highlight-undo.nvim', + "tzachar/highlight-undo.nvim", keys = { - {"u"}, - {""} + { "u" }, + { "" }, }, opts = {}, }, diff --git a/dots/.config/nvim/lua/plugins/configs/hydra.lua b/dots/.config/nvim/lua/plugins/configs/hydra.lua index 6cba6c71..82c95ccb 100644 --- a/dots/.config/nvim/lua/plugins/configs/hydra.lua +++ b/dots/.config/nvim/lua/plugins/configs/hydra.lua @@ -9,7 +9,7 @@ return { }, keys = { { "h", desc = "> Hydra" }, - { "" } + { "" }, }, event = { "BufReadPre", "BufNewFile" }, config = function() diff --git a/dots/.config/nvim/lua/plugins/configs/kanagawa.lua b/dots/.config/nvim/lua/plugins/configs/kanagawa.lua index b9452a76..0d085b35 100644 --- a/dots/.config/nvim/lua/plugins/configs/kanagawa.lua +++ b/dots/.config/nvim/lua/plugins/configs/kanagawa.lua @@ -212,9 +212,9 @@ return { vim.cmd.colorscheme("kanagawa") local colors = require("kanagawa.colors").setup().palette vim.api.nvim_set_hl(0, "StatusLine", { bg = colors.sumiInk0 }) - vim.api.nvim_set_hl(0, "WinBar", { bg = nil }) + vim.api.nvim_set_hl(0, "WinBar", { bg = nil }) vim.api.nvim_set_hl(0, "StatusLineNC", { bg = nil }) - vim.api.nvim_set_hl(0, "WinBarNC", { bg = nil }) + vim.api.nvim_set_hl(0, "WinBarNC", { bg = nil }) end, }, } diff --git a/dots/.config/nvim/lua/plugins/configs/lsp.lua b/dots/.config/nvim/lua/plugins/configs/lsp.lua index 4ba5028d..50e4a30e 100644 --- a/dots/.config/nvim/lua/plugins/configs/lsp.lua +++ b/dots/.config/nvim/lua/plugins/configs/lsp.lua @@ -462,16 +462,17 @@ return { require("typescript-tools").setup({ on_attach = on_attach, settings = { - tsserver_path = vim.fn.stdpath("data") .. "/mason/packages/typescript-language-server/node_modules/typescript/lib/tsserver.js", + tsserver_path = vim.fn.stdpath("data") + .. "/mason/packages/typescript-language-server/node_modules/typescript/lib/tsserver.js", expose_as_code_action = { "fix_all", "add_missing_imports", "remove_unused", "remove_unused_imports", - "organize_imports" + "organize_imports", }, tsserver_plugins = { - "@styled/typescript-styled-plugin" + "@styled/typescript-styled-plugin", }, tsserver_file_preferences = { includeInlayParameterNameHints = "all", @@ -497,11 +498,10 @@ return { functionTypeParameters = true, parameterNames = true, rangeVariableTypes = true, - } - } - } - } - ) + }, + }, + }, + }) -- NOTE: GENERIC LSP SERVERS for _, server in ipairs({ diff --git a/dots/.config/nvim/lua/plugins/configs/telescope.lua b/dots/.config/nvim/lua/plugins/configs/telescope.lua index 6e8982da..c7c5da06 100644 --- a/dots/.config/nvim/lua/plugins/configs/telescope.lua +++ b/dots/.config/nvim/lua/plugins/configs/telescope.lua @@ -11,30 +11,30 @@ return { ":Telescope diagnostics bufnr=0", desc = "LSP: Telescope Diagnostics", }, - { "t", desc = "> Telescope" }, - { "tg", desc = "> Telescope: Git" }, - { "tw", ":Telescope live_grep", desc = "Telescope: Grep for Word" }, - { "tgs", ":Telescope git_status", desc = "Telescope: Git Status" }, - { "tgc", ":Telescope git_commits", desc = "Telescope: Git Commits" }, - { "tgb", ":Telescope git_branches", desc = "Telescope: Git Branches" }, - { "tf", ":Telescope find_files", desc = "Telescope: Find Files" }, - { "td", ":Telescope find_directories", desc = "Telescope: Find Directories" }, - { "tb", ":Telescope buffers", desc = "Telescope: Buffers" }, - { "th", ":Telescope help_tags", desc = "Telescope: Help Tags" }, - { "to", ":Telescope oldfiles", desc = "Telescope: Recent Files" }, - { "tn", ":Telescope neoclip default", desc = "Telescope: Neoclip Buffer" }, - { "tr", ":Telescope resume", desc = "Telescope: Resume" }, - { "tR", ":Telescope registers", desc = "Telescope: Registers" }, - { "tt", ":Telescope file_browser", desc = "Telescope: File Tree" }, - { "ts", ":Telescope spell_suggest", desc = "Telescope: Spell Suggest" }, - { "tl", ":Telescope resume", desc = "Telescope: Previous State" }, - { "tT", ":TodoTelescope", desc = "Telescope: Todo Items" }, - { "tk", ":Telescope keymaps", desc = "Telescope: Keymaps" }, - { "tc", ":Telescope commands", desc = "Telescope: Commands" }, - { "tu", ":Telescope undo", desc = "Telescope: Undo History" }, - { "tm", ":Telescope man_pages", desc = "Telescope: Man Pages" }, - { "lq", ":Telescope diagnostics bufnr=0", desc = "LSP: Telescope Diagnostics" }, - { "nv", ":Telescope notify", desc = "Notifications: Search" }, + { "t", desc = "> Telescope" }, + { "tg", desc = "> Telescope: Git" }, + { "tw", ":Telescope live_grep", desc = "Telescope: Grep for Word" }, + { "tgs", ":Telescope git_status", desc = "Telescope: Git Status" }, + { "tgc", ":Telescope git_commits", desc = "Telescope: Git Commits" }, + { "tgb", ":Telescope git_branches", desc = "Telescope: Git Branches" }, + { "tf", ":Telescope find_files", desc = "Telescope: Find Files" }, + { "td", ":Telescope find_directories", desc = "Telescope: Find Directories" }, + { "tb", ":Telescope buffers", desc = "Telescope: Buffers" }, + { "th", ":Telescope help_tags", desc = "Telescope: Help Tags" }, + { "to", ":Telescope oldfiles", desc = "Telescope: Recent Files" }, + { "tn", ":Telescope neoclip default", desc = "Telescope: Neoclip Buffer" }, + { "tr", ":Telescope resume", desc = "Telescope: Resume" }, + { "tR", ":Telescope registers", desc = "Telescope: Registers" }, + { "tt", ":Telescope file_browser", desc = "Telescope: File Tree" }, + { "ts", ":Telescope spell_suggest", desc = "Telescope: Spell Suggest" }, + { "tl", ":Telescope resume", desc = "Telescope: Previous State" }, + { "tT", ":TodoTelescope", desc = "Telescope: Todo Items" }, + { "tk", ":Telescope keymaps", desc = "Telescope: Keymaps" }, + { "tc", ":Telescope commands", desc = "Telescope: Commands" }, + { "tu", ":Telescope undo", desc = "Telescope: Undo History" }, + { "tm", ":Telescope man_pages", desc = "Telescope: Man Pages" }, + { "lq", ":Telescope diagnostics bufnr=0", desc = "LSP: Telescope Diagnostics" }, + { "nv", ":Telescope notify", desc = "Notifications: Search" }, }, dependencies = { "nvim-telescope/telescope-file-browser.nvim", @@ -43,7 +43,7 @@ return { "debugloop/telescope-undo.nvim", "rcarriga/nvim-notify", { "nvim-telescope/telescope-smart-history.nvim", dependencies = "tami5/sqlite.lua" }, - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, }, config = function() local telescope = require("telescope") @@ -179,7 +179,7 @@ return { "Wikipedia", ("https://en.wikipedia.org/w/index.php?search=" .. search:gsub(" ", "+")), }, - { "Github", ("https://github.com/search?q=" .. search:gsub(" ", "+")) }, + { "Github", ("https://github.com/search?q=" .. search:gsub(" ", "+")) }, }, entry_maker = function(entry) return { value = entry, display = entry[1], ordinal = entry[1] } @@ -193,9 +193,14 @@ return { ---@param obj vim.SystemCompleted vim.system({ "xdg-open", selection["value"][2] }, { text = true }, function(obj) if obj.code ~= 0 then - vim.notify(string.format( - "Failed to open selection, exit code: %s!\n---Stdout---\n%s\n---Stderr---\n%s", - obj.code, obj.stdout, obj.stderr)) + vim.notify( + string.format( + "Failed to open selection, exit code: %s!\n---Stdout---\n%s\n---Stderr---\n%s", + obj.code, + obj.stdout, + obj.stderr + ) + ) end end) end) diff --git a/dots/.config/nvim/lua/plugins/configs/toggleterm.lua b/dots/.config/nvim/lua/plugins/configs/toggleterm.lua index 766da489..f3232bff 100644 --- a/dots/.config/nvim/lua/plugins/configs/toggleterm.lua +++ b/dots/.config/nvim/lua/plugins/configs/toggleterm.lua @@ -22,7 +22,7 @@ return { vim.cmd.ToggleTerm() end end, - desc = "ToggleTerm: Toggle" + desc = "ToggleTerm: Toggle", }, }, opts = { diff --git a/dots/.config/nvim/lua/plugins/configs/treesitter.lua b/dots/.config/nvim/lua/plugins/configs/treesitter.lua index 6be4be39..c557612b 100644 --- a/dots/.config/nvim/lua/plugins/configs/treesitter.lua +++ b/dots/.config/nvim/lua/plugins/configs/treesitter.lua @@ -122,7 +122,7 @@ return { }, "JoosepAlviste/nvim-ts-context-commentstring", "nvim-treesitter/nvim-treesitter-textobjects", - "RRethy/nvim-treesitter-endwise" + "RRethy/nvim-treesitter-endwise", }, config = function() local treesitter_dir = vim.fn.stdpath("data") .. "/treesitter" @@ -180,7 +180,7 @@ return { enable = true, }, endwise = { - enable = true + enable = true, }, textobjects = { select = { @@ -234,7 +234,6 @@ return { }, include_surrounding_whitespace = true, }, - }) end, }, diff --git a/dots/.config/nvim/lua/utils/funcs.lua b/dots/.config/nvim/lua/utils/funcs.lua index b537686d..2466f14a 100755 --- a/dots/.config/nvim/lua/utils/funcs.lua +++ b/dots/.config/nvim/lua/utils/funcs.lua @@ -51,5 +51,4 @@ U.title_case = function(str) return string.gsub(str, "(%a)([%w_']*)", inner) end - return U