nvim updates - undotree to telescope

This commit is contained in:
Henrik Bakken
2025-02-21 11:55:39 +01:00
parent 0a365e9192
commit 3f1c3f648b
+40 -14
View File
@@ -248,7 +248,6 @@ require("lazy").setup({
"tpope/vim-sleuth", -- do the right thing with tabstop and softtabstop "tpope/vim-sleuth", -- do the right thing with tabstop and softtabstop
"dhruvasagar/vim-table-mode", -- tables "dhruvasagar/vim-table-mode", -- tables
"itchyny/vim-qfedit", -- editable quickfix list "itchyny/vim-qfedit", -- editable quickfix list
"mbbill/undotree",
{ {
-- keep location upon reopening -- keep location upon reopening
"ethanholz/nvim-lastplace", "ethanholz/nvim-lastplace",
@@ -612,24 +611,13 @@ require("lazy").setup({
end, end,
noremap = true, noremap = true,
}, },
{
"<M-w>",
"<cmd>Telescope live_grep <cr>",
function()
require("telescope.builtin").live_grep({
layout_strategy = "vertical",
layout_config = { width = 0.99 },
})
end,
noremap = true,
},
{ {
"<M-w>", "<M-w>",
function() require("telescope").extensions.live_grep_args.live_grep_args() end, function() require("telescope").extensions.live_grep_args.live_grep_args() end,
noremap = true, noremap = true,
}, },
{ "<M-y>", function() require("telescope.builtin").filetypes() end, noremap = true }, { "<M-y>", function() require("telescope.builtin").filetypes() end, noremap = true },
{ "<M-u>", function() require("telescope.builtin").search_history() end, noremap = true }, { "<M-H>", function() require("telescope.builtin").search_history() end, noremap = true },
{ {
"<F9>", "<F9>",
function() function()
@@ -675,6 +663,42 @@ require("lazy").setup({
}) })
end, end,
}, },
{
"debugloop/telescope-undo.nvim",
dependencies = {
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
},
},
keys = {
{
"<M-u>",
function() require("telescope").extensions.undo.undo() end,
desc = "undo history",
},
},
opts = {
extensions = {
undo = {
side_by_side = true,
vim_diff_opts = { ctxlen = vim.o.scrolloff },
entry_format = "state #$ID, $STAT, $TIME",
time_format = "%H:%M:%S %m/%d/%Y",
saved_only = false,
layout_strategy = "vertical",
layout_config = { preview_height = 0.6, width = 0.99 },
},
},
},
config = function(_, opts)
-- Calling telescope's setup from multiple specs does not hurt, it will happily merge the
-- configs for us. We won't use data, as everything is in it's own namespace (telescope
-- defaults, as well as each extension).
require("telescope").setup(opts)
require("telescope").load_extension("undo")
end,
},
{ {
"kevinhwang91/nvim-ufo", "kevinhwang91/nvim-ufo",
dependencies = { "kevinhwang91/promise-async" }, dependencies = { "kevinhwang91/promise-async" },
@@ -797,8 +821,10 @@ require("lazy").setup({
javascript = { "eslint_d" }, javascript = { "eslint_d" },
typescript = { "eslint_d" }, typescript = { "eslint_d" },
html = { "tidy", "eslint_d" }, html = { "tidy", "eslint_d" },
go = { "golangcilint" },
sh = { "shellcheck" },
} }
vim.api.nvim_create_autocmd({ "BufWritePost", "TextChanged" }, { vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
callback = function() require("lint").try_lint() end, callback = function() require("lint").try_lint() end,
}) })
end, end,