update plugins

This commit is contained in:
Alexander Navarro 2023-05-10 22:21:53 -04:00
parent c080f17b08
commit 195fb5d98d
13 changed files with 204 additions and 32 deletions

View file

@ -6,14 +6,14 @@ require("aleidk.options")
-- Install package manager https://github.com/folke/lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
@ -25,6 +25,3 @@ require("lazy").setup("aleidk.plugins")
require("aleidk.keymaps")
require("aleidk.autocmds")
require("aleidk.IDE")
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View file

@ -1,5 +1,12 @@
-- [[ Basic Keymaps ]]
local function default(desc)
return {
silent = true,
desc = desc,
}
end
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
@ -7,3 +14,35 @@ vim.keymap.set({ "n", "v" }, "<Space>", "<Nop>", { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set("n", "J", "mzJ`z", default("Keep cursor in column while joining lines"))
vim.keymap.set("n", "<C-d>", "<C-d>zz", default("Keep cursor centered while junping"))
vim.keymap.set("n", "<C-u>", "<C-u>zz", default("Keep cursor centered while junping"))
vim.keymap.set("n", "n", "nzzzv", default("Keep cursor centered while searching"))
vim.keymap.set("n", "N", "Nzzzv", default("Keep cursor centered while searching"))
vim.keymap.set("n", "Q", "<nop>", {})
vim.keymap.set("n", "<leader>lj", function()
vim.diagnostic.goto_next()
end, default("Go to next diagnostic"))
vim.keymap.set("n", "<leader>lk", function()
vim.diagnostic.goto_prev()
end, default("Go to prev diagnostic"))
vim.keymap.set(
"n",
"<leader>r",
[[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
default("Search and replace current word")
)
vim.keymap.set("n", "<leader>R", ":%s/", default("Search and replace in the whole file"))
vim.keymap.set("v", "<leader>r", ":s/", default("Search and replace in selection"))
vim.keymap.set("v", "p", [["_dP]], default("Paste whitout lossing yanked text"))
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", default("Move selection down"))
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up"))

View file

@ -0,0 +1,15 @@
return {
"rebelot/heirline.nvim",
-- You can optionally lazy-load heirline on UiEnter
-- to make sure all required plugins and colorschemes are loaded before setup
event = "UiEnter",
config = function()
require("heirline").setup({
statusline = {},
winbar = {},
tabline = {},
statuscolumn = {},
opts = {},
})
end,
}

View file

@ -18,10 +18,10 @@ return {
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ "j-hui/fidget.nvim", opts = {} },
{ "j-hui/fidget.nvim", opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
{ "folke/neodev.nvim", opts = {} },
{ "folke/neodev.nvim", opts = {} },
},
},
@ -48,4 +48,18 @@ return {
-- "gc" to comment visual regions/lines
{ "numToStr/Comment.nvim", opts = {} },
{
"famiu/bufdelete.nvim",
config = nil,
keys = {
{
"<leader>c",
function()
require("bufdelete").bufdelete(0, true)
end,
desc = "Close buffer",
},
},
},
}

View file

@ -0,0 +1,42 @@
return {
"anuvyklack/pretty-fold.nvim",
config = {
sections = {
left = {
"+",
function()
return string.rep("-", vim.v.foldlevel)
end,
" ",
"content",
" ",
"number_of_folded_lines",
" ",
function()
return string.rep("-", vim.v.foldlevel)
end,
"+",
},
},
fill_char = " ",
-- Possible values:
-- "delete" : Delete all comment signs from the fold string.
-- "spaces" : Replace all comment signs with equal number of spaces.
-- false : Do nothing with comment signs.
process_comment_signs = "delete",
-- List of patterns that will be removed from content foldtext section.
stop_words = {
"@brief%s*", -- (for C++) Remove '@brief' and all spaces after.
},
matchup_patterns = {
{ "{", "}" },
{ "%(", ")" }, -- % to escape lua pattern char
{ "%[", "]" }, -- % to escape lua pattern char
},
ft_ignore = { "neorg" },
},
}

View file

@ -3,15 +3,17 @@ return {
"nvim-treesitter/nvim-treesitter",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"windwp/nvim-ts-autotag",
"JoosepAlviste/nvim-ts-context-commentstring",
},
build = ":TSUpdate",
opts = {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { "c", "cpp", "go", "lua", "python", "rust", "tsx", "typescript", "vimdoc", "vim" },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
auto_install = true,
highlight = { enable = true },
indent = { enable = true, disable = { "python" } },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
@ -65,5 +67,15 @@ return {
},
},
},
autotag = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false },
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
vim.cmd([[
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
set nofoldenable
]])
end,
}

View file

@ -0,0 +1,32 @@
return {
"folke/trouble.nvim",
-- dependencies = { "kyazdani42/nvim-web-devicons" },
config = function()
require("trouble").setup({
mode = "document_diagnostics",
action_keys = { -- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q", -- close the list
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
refresh = "r", -- manually refresh
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
open_split = { "s" }, -- open buffer in new split
open_vsplit = { "v" }, -- open buffer in new vsplit
open_tab = { "t" }, -- open buffer in new tab
jump_close = { "o" }, -- jump to the diagnostic and close the list
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
toggle_preview = "P", -- toggle auto_preview
hover = "K", -- opens a small popup with the full multiline message
preview = "p", -- preview the diagnostic location
close_folds = { "zM", "zm" }, -- close all folds
open_folds = { "zR", "zr" }, -- open all folds
toggle_fold = { "zA", "za" }, -- toggle fold of current file
previous = "k", -- previous item
next = "j", -- next item
},
})
vim.keymap.set("n", "<leader>fd", "<cmd>TroubleToggle<cr>", { silent = true, desc = "Search diagnostics" })
end,
}

View file

@ -0,0 +1,18 @@
return {
"ckolkey/ts-node-action",
dependencies = { "nvim-treesitter", "jose-elias-alvarez/null-ls.nvim" },
config = function()
require("ts-node-action").setup({})
vim.keymap.set({ "n" }, "<leader>lA", require("ts-node-action").node_action, { desc = "Trigger Node Action" })
require("null-ls").register({
name = "more_actions",
method = { require("null-ls").methods.CODE_ACTION },
filetypes = { "_all" },
generator = {
fn = require("ts-node-action").available_actions,
},
})
end,
}