udpate keymaps
This commit is contained in:
parent
67e501963c
commit
dbb79dd46b
3 changed files with 105 additions and 94 deletions
|
@ -42,14 +42,14 @@ require("util").keymaps({
|
||||||
["H"] = { "<cmd>tabprevious<cr>", desc = "Move to previous tab" },
|
["H"] = { "<cmd>tabprevious<cr>", desc = "Move to previous tab" },
|
||||||
["L"] = { "<cmd>tabnext<cr>", desc = "Move to next tab" },
|
["L"] = { "<cmd>tabnext<cr>", desc = "Move to next tab" },
|
||||||
-- reformat LSP
|
-- reformat LSP
|
||||||
["<leader>lf"] = {
|
["<leader>l<leader>"] = {
|
||||||
function()
|
function()
|
||||||
-- vim.cmd "SqlxFormat"
|
-- vim.cmd "SqlxFormat"
|
||||||
vim.lsp.buf.format()
|
vim.lsp.buf.format()
|
||||||
end,
|
end,
|
||||||
desc = "Reformat file",
|
desc = "Reformat file",
|
||||||
},
|
},
|
||||||
["<leader>lsf"] = { "<cmd>SqlxFormat<cr>", desc = "Format sqlx queries in rust raw string literals." },
|
["<leader>ls<leader>"] = { "<cmd>SqlxFormat<cr>", desc = "Format sqlx queries in rust raw string literals." },
|
||||||
["<leader>ld"] = {
|
["<leader>ld"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.open_float()
|
vim.diagnostic.open_float()
|
||||||
|
|
|
@ -1,95 +1,105 @@
|
||||||
local function prereqs()
|
local function prereqs()
|
||||||
local output = vim.fn.system({
|
local output = vim.fn.system({
|
||||||
"which",
|
"which",
|
||||||
"rg",
|
"rg",
|
||||||
})
|
})
|
||||||
if output == nil or output == "" or string.find(output, "not installed for the toolchain") then
|
if output == nil or output == "" or string.find(output, "not installed for the toolchain") then
|
||||||
print("Installing ripgrep globally with rtx")
|
print("Installing ripgrep globally with rtx")
|
||||||
vim.fn.system({
|
vim.fn.system({
|
||||||
"rtx",
|
"rtx",
|
||||||
"global",
|
"global",
|
||||||
"ripgrep@latest",
|
"ripgrep@latest",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
tag = "0.1.1",
|
tag = "0.1.1",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "nvim-lua/plenary.nvim" },
|
{ "nvim-lua/plenary.nvim" },
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable("make") == 1, build = "make" },
|
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable("make") == 1, build = "make" },
|
||||||
},
|
},
|
||||||
build = prereqs,
|
build = prereqs,
|
||||||
cmd = "Telescope",
|
cmd = "Telescope",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>f", "<Nop>", desc = "Find ..." },
|
{ "<leader>f", "<Nop>", desc = "Find ..." },
|
||||||
{
|
{
|
||||||
"<leader>fr",
|
"<leader>fr",
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").resume()
|
require("telescope.builtin").resume()
|
||||||
end,
|
end,
|
||||||
desc = "Resume last telescope",
|
desc = "Resume last telescope",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>ff",
|
"<leader>ff",
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").find_files({
|
require("telescope.builtin").find_files({
|
||||||
hidden = true
|
hidden = true,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
desc = "Find Files",
|
desc = "Find Files",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>fg",
|
"<leader>fg",
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").git_files()
|
require("telescope.builtin").git_files()
|
||||||
end,
|
end,
|
||||||
desc = "Find Git only Files",
|
desc = "Find Git only Files",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>fw",
|
"<leader>fw",
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").live_grep({
|
if vim.fn.executable("rg") == 0 then
|
||||||
grep_open_files = true,
|
vim.notify("rg not installed, live grep will not function.", 3)
|
||||||
})
|
end
|
||||||
end,
|
require("telescope.builtin").live_grep({
|
||||||
desc = "Find Words",
|
grep_open_files = true,
|
||||||
},
|
})
|
||||||
{
|
end,
|
||||||
"<leader>fc",
|
desc = "Find Words",
|
||||||
function()
|
},
|
||||||
require("telescope.builtin").commands()
|
{
|
||||||
end,
|
"<leader>fc",
|
||||||
desc = "Find Commands",
|
function()
|
||||||
},
|
require("telescope.builtin").commands()
|
||||||
{
|
end,
|
||||||
"<leader>fk",
|
desc = "Find Commands",
|
||||||
function()
|
},
|
||||||
require("telescope.builtin").keymaps()
|
{
|
||||||
end,
|
"<leader>fk",
|
||||||
desc = "Find Commands",
|
function()
|
||||||
},
|
require("telescope.builtin").keymaps()
|
||||||
{
|
end,
|
||||||
"<leader>fb",
|
desc = "Find Commands",
|
||||||
function()
|
},
|
||||||
require("telescope.builtin").buffers()
|
{
|
||||||
end,
|
"<leader>fb",
|
||||||
desc = "Find Commands",
|
function()
|
||||||
},
|
require("telescope.builtin").buffers()
|
||||||
},
|
end,
|
||||||
opts = {
|
desc = "Find Commands",
|
||||||
pickers = {
|
},
|
||||||
buffers = {
|
{
|
||||||
sort_lastused = true,
|
"<leader>lfr",
|
||||||
},
|
function()
|
||||||
find_files = {
|
require("telescope.builtin").lsp_references()
|
||||||
hidden = true,
|
end,
|
||||||
sort_lastused = true,
|
desc = "Find References",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
defaults = {
|
opts = {
|
||||||
file_ignore_patterns = { 'node_modules', 'package-lock.json', 'target' },
|
pickers = {
|
||||||
},
|
buffers = {
|
||||||
},
|
sort_lastused = true,
|
||||||
|
},
|
||||||
|
find_files = {
|
||||||
|
hidden = true,
|
||||||
|
sort_lastused = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = { "node_modules", "package-lock.json", "target" },
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
return {
|
return {
|
||||||
"rcarriga/nvim-notify",
|
"rcarriga/nvim-notify",
|
||||||
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
top_down = false,
|
top_down = false,
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("notify").setup(opts)
|
require("notify").setup(opts)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue