231 lines
4.5 KiB
Lua
231 lines
4.5 KiB
Lua
local M = {
|
|
{
|
|
"folke/which-key.nvim",
|
|
event = "VeryLazy",
|
|
opts = {
|
|
-- your configuration comes here
|
|
-- or leave it empty to use the default settings
|
|
-- refer to the configuration section below
|
|
},
|
|
keys = {
|
|
{
|
|
"<leader>?",
|
|
function()
|
|
require("which-key").show({ global = false })
|
|
end,
|
|
desc = "Buffer Local Keymaps (which-key)",
|
|
},
|
|
},
|
|
},
|
|
|
|
{
|
|
"junegunn/fzf.vim",
|
|
dependencies = {
|
|
"https://github.com/junegunn/fzf",
|
|
},
|
|
keys = {
|
|
{ "<Leader><Leader>", "<Cmd>Files<CR>", desc = "Find files" },
|
|
{ "<Leader>,", "<Cmd>Buffers<CR>", desc = "Find buffers" },
|
|
{ "<Leader>/", "<Cmd>Rg<CR>", desc = "Search project" },
|
|
},
|
|
},
|
|
{
|
|
"stevearc/oil.nvim",
|
|
config = function()
|
|
require("oil").setup()
|
|
end,
|
|
keys = {
|
|
{ "-", "<Cmd>Oil<CR>", desc = "Browse files from here" },
|
|
},
|
|
},
|
|
{
|
|
"farmergreg/vim-lastplace",
|
|
event = "BufReadPost",
|
|
},
|
|
{
|
|
"windwp/nvim-autopairs",
|
|
event = "InsertEnter",
|
|
config = function()
|
|
require("nvim-autopairs").setup()
|
|
end,
|
|
},
|
|
{
|
|
"numToStr/Comment.nvim",
|
|
event = "VeryLazy",
|
|
config = function()
|
|
require("Comment").setup()
|
|
end,
|
|
},
|
|
{
|
|
"Aasim-A/scrollEOF.nvim",
|
|
event = { "CursorMoved", "WinScrolled" },
|
|
opts = {},
|
|
},
|
|
{
|
|
"folke/todo-comments.nvim",
|
|
dependencies = { "nvim-lua/plenary.nvim" },
|
|
opts = {}
|
|
},
|
|
{
|
|
"folke/flash.nvim",
|
|
event = "VeryLazy",
|
|
keys = {
|
|
{
|
|
"s",
|
|
mode = { "n", "x", "o" },
|
|
function()
|
|
require("flash").jump()
|
|
end,
|
|
desc = "Flash",
|
|
},
|
|
{
|
|
"S",
|
|
mode = { "n", "x", "o" },
|
|
function()
|
|
require("flash").treesitter()
|
|
end,
|
|
desc = "Flash Treesitter",
|
|
},
|
|
{
|
|
"r",
|
|
mode = "o",
|
|
function()
|
|
require("flash").remote()
|
|
end,
|
|
desc = "Remote Flash",
|
|
},
|
|
{
|
|
"R",
|
|
mode = { "o", "x" },
|
|
function()
|
|
require("flash").treesitter_search()
|
|
end,
|
|
desc = "Treesitter Search",
|
|
},
|
|
{
|
|
"<c-s>",
|
|
mode = { "c" },
|
|
function()
|
|
require("flash").toggle()
|
|
end,
|
|
desc = "Toggle Flash Search",
|
|
},
|
|
},
|
|
config = function()
|
|
require("flash").setup({
|
|
modes = {
|
|
search = {
|
|
enabled = true,
|
|
},
|
|
char = {
|
|
enabled = true,
|
|
jump_labels = true,
|
|
multi_line = false,
|
|
jump = {
|
|
autojump = true,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
end,
|
|
},
|
|
{
|
|
"folke/snacks.nvim",
|
|
priority = 1000,
|
|
lazy = false,
|
|
---@type snacks.Config
|
|
opts = {
|
|
bigfile = { enabled = true },
|
|
dashboard = { enabled = true },
|
|
explorer = { enabled = true },
|
|
indent = { enabled = true },
|
|
input = { enabled = true },
|
|
picker = { enabled = true },
|
|
notifier = { enabled = true },
|
|
quickfile = { enabled = true },
|
|
scope = { enabled = true },
|
|
scroll = {
|
|
enabled = true,
|
|
animate = {
|
|
duration = { step = 10, total = 100 },
|
|
easing = "linear",
|
|
},
|
|
},
|
|
statuscolumn = { enabled = true },
|
|
words = { enabled = true },
|
|
},
|
|
config = function(_, opts)
|
|
function floating_terminal()
|
|
require("snacks").terminal("fish", {
|
|
win = {
|
|
position = "float",
|
|
width = 0.8,
|
|
height = 0.8,
|
|
border = "rounded",
|
|
},
|
|
})
|
|
end
|
|
vim.keymap.set("n", "<leader>tf", floating_terminal, { desc = "Open floating terminal" })
|
|
vim.keymap.set("n", "<leader>\\", floating_terminal, { desc = "Open floating terminal" })
|
|
require("snacks").setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
"lukas-reineke/indent-blankline.nvim",
|
|
event = { "VeryLazy" },
|
|
config = function()
|
|
require("ibl").setup()
|
|
end,
|
|
},
|
|
{
|
|
"stevearc/conform.nvim",
|
|
opts = {},
|
|
config = function()
|
|
local conform = require("conform")
|
|
conform.setup({
|
|
formatters_by_ft = {
|
|
lua = { "stylua" },
|
|
python = {
|
|
"ruff_fix",
|
|
"ruff_format",
|
|
},
|
|
},
|
|
})
|
|
|
|
vim.api.nvim_create_user_command("Format", function(args)
|
|
local range = nil
|
|
if args.count ~= -1 then
|
|
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
|
range = {
|
|
start = { args.line1, 0 },
|
|
["end"] = { args.line2, end_line:len() },
|
|
}
|
|
end
|
|
require("conform").format({
|
|
async = true,
|
|
lsp_fallback = true,
|
|
range = range,
|
|
})
|
|
end, { range = true, desc = "Format buffer or range with conform.nvim" })
|
|
|
|
vim.keymap.set("n", "<leader>lf", "<cmd>Format<cr>", { desc = "Format buffer with conform.nvim" })
|
|
end,
|
|
},
|
|
{
|
|
"serhez/bento.nvim",
|
|
config = function()
|
|
require("bento").setup({
|
|
main_keymap = ",",
|
|
})
|
|
end,
|
|
},
|
|
{
|
|
"brianhuster/live-preview.nvim",
|
|
dependencies = {
|
|
"ibhagwan/fzf-lua",
|
|
},
|
|
},
|
|
}
|
|
|
|
return M
|