mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2025-07-02 02:49:26 +00:00
[neovim] Simplify plugins including
This commit is contained in:
@ -13,18 +13,13 @@ vim.opt.rtp:prepend(lazypath)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local status_ok, lazy = pcall(require, "lazy")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local lazy_opts = {
|
||||
ui = {
|
||||
border = "rounded",
|
||||
},
|
||||
}
|
||||
|
||||
lazy.setup({
|
||||
require("lazy").setup({
|
||||
-- Colorschemes
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
|
@ -1,6 +1 @@
|
||||
local status_ok, align = pcall(require, "mini.align")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
align.setup({})
|
||||
require("mini.align").setup({})
|
||||
|
@ -1,10 +1,5 @@
|
||||
-- Setup nvim-cmp.
|
||||
local status_ok, npairs = pcall(require, "nvim-autopairs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
npairs.setup({
|
||||
require("nvim-autopairs").setup({
|
||||
check_ts = true,
|
||||
disable_filetype = { "TelescopePrompt", "neo-tree" },
|
||||
ts_config = {
|
||||
@ -24,8 +19,4 @@ npairs.setup({
|
||||
})
|
||||
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({}))
|
||||
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done({}))
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, autosave = pcall(require, "auto-save")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
autosave.setup({
|
||||
require("auto-save").setup({
|
||||
execution_message = {
|
||||
message = function()
|
||||
return ""
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, bufferline = pcall(require, "bufferline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
bufferline.setup({
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
@ -24,12 +19,10 @@ bufferline.setup({
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
buffer_visible = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
close_button = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
@ -38,7 +31,6 @@ bufferline.setup({
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
tab_selected = {
|
||||
fg = { attribute = "fg", highlight = "Normal" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
@ -51,7 +43,6 @@ bufferline.setup({
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "Normal" },
|
||||
},
|
||||
|
||||
duplicate_selected = {
|
||||
fg = { attribute = "fg", highlight = "TabLineSel" },
|
||||
bg = { attribute = "bg", highlight = "TabLineSel" },
|
||||
@ -67,7 +58,6 @@ bufferline.setup({
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
italic = true,
|
||||
},
|
||||
|
||||
modified = {
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
@ -80,7 +70,6 @@ bufferline.setup({
|
||||
fg = { attribute = "fg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
},
|
||||
|
||||
separator = {
|
||||
fg = { attribute = "bg", highlight = "TabLine" },
|
||||
bg = { attribute = "bg", highlight = "TabLine" },
|
||||
|
@ -1,12 +1,5 @@
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
if not cmp_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local snip_status_ok, luasnip = pcall(require, "luasnip")
|
||||
if not snip_status_ok then
|
||||
return
|
||||
end
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
require("luasnip/loaders/from_vscode").lazy_load()
|
||||
|
||||
@ -49,7 +42,6 @@ cmp.setup({
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
|
@ -1,6 +1 @@
|
||||
local status_ok, comment = pcall(require, "Comment")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
comment.setup({})
|
||||
require("Comment").setup({})
|
||||
|
@ -1,19 +1,7 @@
|
||||
local dap_status_ok, dap = pcall(require, "dap")
|
||||
if not dap_status_ok then
|
||||
return
|
||||
end
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
local dap_ui_status_ok, dapui = pcall(require, "dapui")
|
||||
if not dap_ui_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local dap_install_status_ok, dap_install = pcall(require, "dap-install")
|
||||
if not dap_install_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
dap_install.config("python", {})
|
||||
require("dap-install").config("python", {})
|
||||
dapui.setup({
|
||||
layouts = {
|
||||
{
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, diffview = pcall(require, "diffview")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
diffview.setup({
|
||||
require("diffview").setup({
|
||||
view = {
|
||||
merge_tool = {
|
||||
layout = "diff3_mixed",
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, gitsigns = pcall(require, "gitsigns")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
gitsigns.setup({
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
@ -14,7 +9,6 @@ gitsigns.setup({
|
||||
preview_config = {
|
||||
border = "rounded",
|
||||
},
|
||||
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, go = pcall(require, "go")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
go.setup({
|
||||
require("go").setup({
|
||||
icons = { breakpoint = "", currentpos = "🏃" },
|
||||
fillstruct = "fillstruct",
|
||||
gofmt = "gofumpt",
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, illuminate = pcall(require, "illuminate")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
illuminate.configure({
|
||||
require("illuminate").configure({
|
||||
delay = 200,
|
||||
filetypes_denylist = {
|
||||
"neo-tree",
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, indent_blankline = pcall(require, "indent_blankline")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
indent_blankline.setup({
|
||||
require("indent_blankline").setup({
|
||||
char = "▏",
|
||||
show_trailing_blankline_indent = false,
|
||||
show_first_indent_level = true,
|
||||
|
@ -1,9 +1,6 @@
|
||||
local M = {}
|
||||
|
||||
local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
||||
if not status_cmp_ok then
|
||||
return
|
||||
end
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
M.capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
M.capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
@ -58,11 +55,7 @@ M.on_attach = function(client)
|
||||
client.server_capabilities.hover = false
|
||||
end
|
||||
|
||||
local status_ok, illuminate = pcall(require, "illuminate")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
illuminate.on_attach(client)
|
||||
require("illuminate").on_attach(client)
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -1,12 +1,8 @@
|
||||
local status_ok, win = pcall(require, "lspconfig.ui.windows")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
require("plugins.lsp.mason")
|
||||
require("plugins.lsp.handlers").setup()
|
||||
require("plugins.lsp.null-ls")
|
||||
require("plugins.lsp.lsp-saga")
|
||||
require("plugins.lsp.yaml-companion")
|
||||
|
||||
local win = require("lspconfig.ui.windows")
|
||||
win.default_options.border = "rounded"
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, lsp_saga = pcall(require, "lspsaga")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
lsp_saga.setup({
|
||||
require("lspsaga").setup({
|
||||
ui = {
|
||||
border = "rounded",
|
||||
code_action_icon = "",
|
||||
|
@ -31,23 +31,17 @@ require("mason-lspconfig").setup({
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
|
||||
if not lspconfig_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local opts = {}
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
for _, server in pairs(servers) do
|
||||
opts = {
|
||||
local opts = {
|
||||
on_attach = require("plugins.lsp.handlers").on_attach,
|
||||
capabilities = require("plugins.lsp.handlers").capabilities,
|
||||
}
|
||||
|
||||
server = vim.split(server, "@")[1]
|
||||
|
||||
local require_ok, conf_opts = pcall(require, "plugins.lsp.settings." .. server)
|
||||
if require_ok then
|
||||
local config_exists, conf_opts = pcall(require, "plugins.lsp.settings." .. server)
|
||||
if config_exists then
|
||||
opts = vim.tbl_deep_extend("force", conf_opts, opts)
|
||||
end
|
||||
|
||||
|
@ -1,8 +1,4 @@
|
||||
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
|
||||
if not null_ls_status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
local formatting = null_ls.builtins.formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
|
@ -1,8 +1,3 @@
|
||||
local status_ok, lualine = pcall(require, "lualine")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end
|
||||
@ -70,16 +65,13 @@ local get_schema = function()
|
||||
end
|
||||
end
|
||||
|
||||
local gitblame_status_ok, gitblame = pcall(require, "gitblame")
|
||||
if not gitblame_status_ok then
|
||||
return
|
||||
end
|
||||
local gitblame = require("gitblame")
|
||||
|
||||
vim.g.gitblame_date_format = "%r"
|
||||
vim.g.gitblame_display_virtual_text = 0
|
||||
vim.g.gitblame_message_template = "<author>, <date>"
|
||||
|
||||
lualine.setup({
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
globalstatus = true,
|
||||
},
|
||||
|
@ -1,11 +1,6 @@
|
||||
local status_ok, neotree = pcall(require, "neo-tree")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.g.neo_tree_remove_legacy_commands = true
|
||||
|
||||
neotree.setup({
|
||||
require("neo-tree").setup({
|
||||
close_if_last_window = true,
|
||||
auto_clean_after_session_restore = true,
|
||||
open_files_do_not_replace_filetypes = { "terminal", "trouble", "qf", "starter" },
|
||||
|
@ -1,15 +1,8 @@
|
||||
local status_ok, projections = pcall(require, "projections")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
projections.setup({
|
||||
require("projections").setup({
|
||||
store_hooks = {
|
||||
pre = function()
|
||||
-- Close neo-tree before storing sessions
|
||||
if pcall(require, "neo-tree") then
|
||||
vim.cmd([[Neotree action=close]])
|
||||
end
|
||||
vim.cmd([[Neotree action=close]])
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, sad = pcall(require, "sad")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
sad.setup({
|
||||
require("sad").setup({
|
||||
diff = "delta",
|
||||
ls_file = "fd",
|
||||
exact = false,
|
||||
|
@ -1,8 +1,4 @@
|
||||
local status_ok, starter = pcall(require, "mini.starter")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local starter = require("mini.starter")
|
||||
local pad = string.rep(" ", 4)
|
||||
local new_section = function(name, action, section)
|
||||
return { name = name, action = action, section = pad .. section }
|
||||
|
@ -1,8 +1,4 @@
|
||||
local status_ok, telescope = pcall(require, "telescope")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
|
@ -1,9 +1,4 @@
|
||||
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
configs.setup({
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"markdown",
|
||||
|
@ -1,6 +1 @@
|
||||
local status_ok, trouble = pcall(require, "trouble")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
trouble.setup({})
|
||||
require("trouble").setup({})
|
||||
|
@ -1,7 +1,4 @@
|
||||
local status_ok, wilder = pcall(require, "wilder")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
local wilder = require("wilder")
|
||||
|
||||
wilder.setup({
|
||||
modes = { ":" },
|
||||
@ -58,7 +55,6 @@ wilder.set_option(
|
||||
border = "Normal",
|
||||
gradient = gradient,
|
||||
},
|
||||
|
||||
border = "rounded",
|
||||
highlighter = wilder.highlighter_with_gradient({
|
||||
wilder.lua_fzy_highlighter(),
|
||||
|
Reference in New Issue
Block a user