update nvim plugins

- remove unused plugins
- change file explorer plugin

closes #3
This commit is contained in:
Alexander Navarro 2024-11-18 10:12:46 -03:00
parent 00e3f8f8e9
commit c7b411f60f
10 changed files with 40 additions and 245 deletions

View file

@ -1,35 +0,0 @@
return {
"goolord/alpha-nvim",
lazy = false,
opts = function()
local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.val = {
" ████ ███ █████ █████ ",
" ░░███ ░░░ ░░███ ░░███ ",
" ██████ ░███ ██████ ████ ███████ ░███ █████",
" ░░░░░███ ░███ ███░░███░░███ ███░░███ ░███░░███ ",
" ███████ ░███ ░███████ ░███ ░███ ░███ ░██████░ ",
" ███░░███ ░███ ░███░░░ ░███ ░███ ░███ ░███░░███ ",
"░░████████ █████░░██████ █████░░████████ ████ █████",
" ░░░░░░░░ ░░░░░ ░░░░░░ ░░░░░ ░░░░░░░░ ░░░░ ░░░░░ ",
}
dashboard.section.header.opts.hl = "DashboardHeader"
dashboard.section.buttons.val = {
dashboard.button("LDR f f", " Find File ", "<leader>ff"),
dashboard.button("LDR LDR t", " Bookmars", "<leader><leader>t"),
dashboard.button("LDR g g", " Git ", "<leader>gg"),
}
dashboard.section.footer.val =
{ " ", " ", " ", "Nvim loaded " .. require("lazy").stats().count .. " plugins " }
dashboard.section.footer.opts.hl = "DashboardFooter"
dashboard.config.layout[1].val = vim.fn.max({ 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) })
dashboard.config.layout[3].val = 5
dashboard.config.opts.noautocmd = true
return dashboard.opts
end,
}

View file

@ -1,7 +0,0 @@
return {
"andrewferrier/debugprint.nvim",
opts = {},
-- Remove the following line to use development versions,
-- not just the formal releases
version = "*",
}

View file

@ -1,100 +0,0 @@
return {
{
"nvim-tree/nvim-tree.lua",
enabled = false,
version = "*",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
keys = {
{ "<Leader>e", "<CMD>NvimTreeToggle<CR>", desc = "Open file explorer" },
},
cmd = { "NvimTreeToggle", "Tree" },
config = function()
local tree = require("nvim-tree")
local api = require("nvim-tree.api")
tree.setup({
hijack_unnamed_buffer_when_opening = true,
disable_netrw = false,
hijack_netrw = false, -- handle by telescope browser
hijack_cursor = true, -- cursor at the start of filename
sync_root_with_cwd = true,
respect_buf_cwd = true,
update_focused_file = {
enable = true, -- focus curren file
update_root = true,
},
actions = { open_file = { quit_on_open = true } },
renderer = {
full_name = true, -- show remaining name in floating text
group_empty = true, -- group empty folders
add_trailing = true, -- Trailing slash to folders
highlight_opened_files = "all",
highlight_git = true,
},
view = {
centralize_selection = true, -- center current file on enter
width = 30, -- N° of columns or %
},
on_attach = function(bufnr)
local function opts(desc)
return {
desc = "nvim-tree: " .. desc,
buffer = bufnr,
noremap = true,
silent = true,
nowait = true,
}
end
-- Check defaults here: https://github.com/nvim-tree/nvim-tree.lua/wiki/Migrating-To-on_attach
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set("n", "l", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "o", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "<CR>", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "<2-LeftMouse>", api.node.open.edit, opts("Open"))
vim.keymap.set("n", "s", api.node.open.vertical, opts("Open in vsplit"))
vim.keymap.set("n", "v", api.node.open.horizontal, opts("Open in hsplit"))
vim.keymap.set("n", "t", api.node.open.tab, opts("Open in tab"))
vim.keymap.set("n", "h", api.node.navigate.parent_close, opts("Close dir"))
vim.keymap.set("n", "<BS>", api.node.navigate.parent_close, opts("Close dir"))
vim.keymap.set("n", "i", api.tree.toggle_hidden_filter, opts("Toggle Dotfiles"))
vim.keymap.set("n", "I", api.tree.toggle_gitignore_filter, opts("Toggle Git Ignore"))
end,
})
-- Auto open when a dir is opened
local function open_nvim_tree(data)
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
if not directory then
return
end
-- create a new, empty buffer
vim.cmd.enew()
-- wipe the directory buffer
vim.cmd.bw(data.buf)
-- change to the directory
vim.cmd.cd(data.file)
-- open the tree
require("nvim-tree.api").tree.open()
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
vim.api.nvim_create_user_command("Tree", "NvimTreeToggle", {})
-- bindings
-- disabled to discourage the use of this plugin without disabling it
-- vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
-- vim.keymap.set("n", "<C-e>", ":NvimTreeToggle<CR>", { desc = "Toggle file tree", silent = true })
end,
},
}

View file

@ -1,66 +1,44 @@
---@type LazySpec
return {
"rolv-apneseth/tfm.nvim",
lazy = false,
opts = {
-- TFM to use
-- Possible choices: "ranger" | "nnn" | "lf" | "vifm" | "yazi" (default)
file_manager = "yazi",
-- Replace netrw entirely
-- Default: false
replace_netrw = true,
-- Enable creation of commands
-- Default: false
-- Commands:
-- Tfm: selected file(s) will be opened in the current window
-- TfmSplit: selected file(s) will be opened in a horizontal split
-- TfmVsplit: selected file(s) will be opened in a vertical split
-- TfmTabedit: selected file(s) will be opened in a new tab page
enable_cmds = true,
-- Custom keybindings only applied within the TFM buffer
-- Default: {}
keybindings = {
["<ESC>"] = "q",
},
-- Customise UI. The below options are the default
ui = {
border = "rounded",
height = 1,
width = 1,
x = 0.5,
y = 0.5,
},
},
"mikavilpas/yazi.nvim",
event = "VeryLazy",
keys = {
-- 👇 in this section, choose your own keymappings!
{
"<leader>e",
function()
require("tfm").open()
end,
desc = "TFM",
"<cmd>Yazi<cr>",
desc = "Open yazi at the current file",
},
{
"<leader>mh",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.split)
end,
desc = "TFM - horizontal split",
-- Open in the current working directory
"<leader>-",
"<cmd>Yazi cwd<cr>",
desc = "Open the file manager in nvim's working directory",
},
{
"<leader>mv",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.vsplit)
end,
desc = "TFM - vertical split",
},
{
"<leader>mt",
function()
local tfm = require("tfm")
tfm.open(nil, tfm.OPEN_MODE.tabedit)
end,
desc = "TFM - new tab",
-- {
-- -- NOTE: this requires a version of yazi that includes
-- -- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
-- '<c-up>',
-- "<cmd>Yazi toggle<cr>",
-- desc = "Resume the last yazi session",
-- },
},
---@type YaziConfig
opts = {
-- if you want to open yazi instead of netrw, see below for more info
open_for_directories = true,
open_multiple_tabs = true,
floating_window_scaling_factor = 1,
keymaps = {
show_help = '<f1>',
open_file_in_vertical_split = '<c-v>',
open_file_in_horizontal_split = '<c-s>',
open_file_in_tab = '<c-t>',
grep_in_directory = '<c-w>',
cycle_open_buffers = '<tab>',
copy_relative_path_to_selected_files = '<c-y>',
send_to_quickfix_list = '<c-q>',
change_working_directory = "<c-\\>",
},
},
}

View file

@ -1,38 +0,0 @@
return {
"jellydn/hurl.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter"
},
ft = "hurl",
opts = {
-- Show debugging info
debug = false,
-- Show notification on run
show_notification = false,
-- Show response in popup or split
mode = "popup",
-- Default formatter
formatters = {
json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq
html = {
'prettierd', -- Make sure you have install prettier in your system, e.g: npm install -g prettier
'--parser',
'html',
},
},
env_file = {
'hurl.env',
'.env',
'.env.local',
},
},
keys = {
-- Run API request
{ "<leader>ph", "<cmd>HurlRunnerAt<CR>", desc = "Run HTTP request" },
{ "<leader>pH", "<cmd>HurlRunner<CR>", desc = "Run all HTTP requests" },
-- Run Hurl request in visual mode
{ "<leader>ph", ":HurlRunner<CR>", desc = "Run HTTP requests", mode = "v" },
},
}