From dbb79dd46b845243fb4bbc8709732d4e953ae24a Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Wed, 4 Oct 2023 10:53:18 -0500 Subject: [PATCH] udpate keymaps --- lua/keymaps.lua | 4 +- lua/plugins/telescope.lua | 190 +++++++++++++++++++------------------ lua/plugins/vim-notify.lua | 5 +- 3 files changed, 105 insertions(+), 94 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index f405c4e..186b3a3 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -42,14 +42,14 @@ require("util").keymaps({ ["H"] = { "tabprevious", desc = "Move to previous tab" }, ["L"] = { "tabnext", desc = "Move to next tab" }, -- reformat LSP - ["lf"] = { + ["l"] = { function() -- vim.cmd "SqlxFormat" vim.lsp.buf.format() end, desc = "Reformat file", }, - ["lsf"] = { "SqlxFormat", desc = "Format sqlx queries in rust raw string literals." }, + ["ls"] = { "SqlxFormat", desc = "Format sqlx queries in rust raw string literals." }, ["ld"] = { function() vim.diagnostic.open_float() diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index f6b6fce..c7068bd 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,95 +1,105 @@ local function prereqs() - local output = vim.fn.system({ - "which", - "rg", - }) - if output == nil or output == "" or string.find(output, "not installed for the toolchain") then - print("Installing ripgrep globally with rtx") - vim.fn.system({ - "rtx", - "global", - "ripgrep@latest", - }) - end + local output = vim.fn.system({ + "which", + "rg", + }) + if output == nil or output == "" or string.find(output, "not installed for the toolchain") then + print("Installing ripgrep globally with rtx") + vim.fn.system({ + "rtx", + "global", + "ripgrep@latest", + }) + end end return { - "nvim-telescope/telescope.nvim", - tag = "0.1.1", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable("make") == 1, build = "make" }, - }, - build = prereqs, - cmd = "Telescope", - keys = { - { "f", "", desc = "Find ..." }, - { - "fr", - function() - require("telescope.builtin").resume() - end, - desc = "Resume last telescope", - }, - { - "ff", - function() - require("telescope.builtin").find_files({ - hidden = true - }) - end, - desc = "Find Files", - }, - { - "fg", - function() - require("telescope.builtin").git_files() - end, - desc = "Find Git only Files", - }, - { - "fw", - function() - require("telescope.builtin").live_grep({ - grep_open_files = true, - }) - end, - desc = "Find Words", - }, - { - "fc", - function() - require("telescope.builtin").commands() - end, - desc = "Find Commands", - }, - { - "fk", - function() - require("telescope.builtin").keymaps() - end, - desc = "Find Commands", - }, - { - "fb", - function() - require("telescope.builtin").buffers() - end, - desc = "Find Commands", - }, - }, - opts = { - pickers = { - buffers = { - sort_lastused = true, - }, - find_files = { - hidden = true, - sort_lastused = true, - } - }, - defaults = { - file_ignore_patterns = { 'node_modules', 'package-lock.json', 'target' }, - }, - }, + "nvim-telescope/telescope.nvim", + tag = "0.1.1", + dependencies = { + { "nvim-lua/plenary.nvim" }, + { "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable("make") == 1, build = "make" }, + }, + build = prereqs, + cmd = "Telescope", + keys = { + { "f", "", desc = "Find ..." }, + { + "fr", + function() + require("telescope.builtin").resume() + end, + desc = "Resume last telescope", + }, + { + "ff", + function() + require("telescope.builtin").find_files({ + hidden = true, + }) + end, + desc = "Find Files", + }, + { + "fg", + function() + require("telescope.builtin").git_files() + end, + desc = "Find Git only Files", + }, + { + "fw", + function() + if vim.fn.executable("rg") == 0 then + vim.notify("rg not installed, live grep will not function.", 3) + end + require("telescope.builtin").live_grep({ + grep_open_files = true, + }) + end, + desc = "Find Words", + }, + { + "fc", + function() + require("telescope.builtin").commands() + end, + desc = "Find Commands", + }, + { + "fk", + function() + require("telescope.builtin").keymaps() + end, + desc = "Find Commands", + }, + { + "fb", + function() + require("telescope.builtin").buffers() + end, + desc = "Find Commands", + }, + { + "lfr", + function() + require("telescope.builtin").lsp_references() + end, + desc = "Find References", + }, + }, + opts = { + pickers = { + buffers = { + sort_lastused = true, + }, + find_files = { + hidden = true, + sort_lastused = true, + }, + }, + defaults = { + file_ignore_patterns = { "node_modules", "package-lock.json", "target" }, + }, + }, } diff --git a/lua/plugins/vim-notify.lua b/lua/plugins/vim-notify.lua index d013df4..235e52d 100644 --- a/lua/plugins/vim-notify.lua +++ b/lua/plugins/vim-notify.lua @@ -1,8 +1,9 @@ return { "rcarriga/nvim-notify", + event = "VeryLazy", opts = { - top_down = false, - }, + top_down = false, + }, config = function(_, opts) require("notify").setup(opts)