adapted config to latest version

This commit is contained in:
λmolinae 2025-05-20 20:56:11 -06:00
parent cf52bb4d5b
commit 1f1479385b
16 changed files with 146 additions and 214 deletions

1
.gitignore vendored
View file

@ -1,2 +1 @@
.luarc.json
lazy-lock.json

30
lazy-lock.json Normal file
View file

@ -0,0 +1,30 @@
{
"LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "ce0e87c0be12e7c48296a7513e90430e3eac7f24" },
"mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" },
"neo-tree.nvim": { "branch": "main", "commit": "56f383aa157f1ff20a59154907cc5f9fe26e4db9" },
"nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" },
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
"nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" },
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"pywal16.nvim": { "branch": "main", "commit": "0e9f3878c6f9fe8adaf7884cd7da871b9abb2447" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }
}

View file

@ -27,9 +27,6 @@ require("lazy").setup({
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "neopywal" } },
-- automatically check for plugin updates
checker = { enabled = false },
install = { colorscheme = { "pywal16" } },
checker = { enabled = true },
})

View file

@ -1,49 +1,40 @@
local map = vim.keymap.set
-- Set mapleader
vim.g.mapleader = " "
-- Disable arrow keys in normal, visual, and insert modes.
local keys = { "<Up>", "<Down>", "<Left>", "<Right>" }
for _, key in ipairs(keys) do
map({ "n", "i", "v" }, key, "<Nop>", { noremap = true, silent = true })
end
-- Toggle spellcheck (When working with LaTeX/Typst)
local spelllangs = {"es_mx", "en_us"}
local current_index = 1
function ToggleSpell()
vim.o.spelllang = spelllangs[current_index]
vim.o.spell = not vim.o.spell
print("Spellcheck " .. (vim.o.spell and "enabled" or "disabled") .. ": " .. spelllangs[current_index])
end
map("n", "<leader>ts", ":lua ToggleSpell()<CR>", { noremap = true, silent = true })
-- Toggle spellcheck language.
function ToggleSpellLang()
current_index = (current_index % #spelllangs) + 1
vim.o.spelllang = spelllangs[current_index]
print("Spelllang: " .. spelllangs[current_index])
end
map("n", "<Leader>sp", ":lua ToggleSpellLang()<CR>", { noremap = true, silent = true })
-- Open terminal
map("n", "<leader>t", "<cmd>8split | terminal<CR>", { noremap = true, silent = true })
-- Neotree
map("n", "<C-b>", "<cmd>Neotree toggle<CR>", { desc = "open neotree"})
map("n", "<C-b>", "<cmd>Neotree toggle<CR>", { desc = "Open neotree"})
-- Telescope
map("n", "<C-p>", "<cmd>Telescope find_files<CR>", { desc = "telescope find files" })
map("n", "<C-g>", "<cmd>Telescope live_grep<CR>", { desc = "telescope live grep" })
map("n", "<C-p>", "<cmd>Telescope find_files<CR>", { desc = "Telescope: Find files" })
map("n", "<C-g>", "<cmd>Telescope live_grep<CR>", { desc = "Telescope: Live grep" })
-- Nonels
map("n", "<leader>gf", vim.lsp.buf.format, {})
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
local opts = { buffer = ev.buf }
local tele = require("telescope.builtin")
-- LSP Stuff
map('n', 'K', vim.lsp.buf.hover, {})
map('n', 'gd', vim.lsp.buf.definition, {})
map({'n', 'v'}, '<space>ca', vim.lsp.buf.code_action, {})
-- LSP
map("n", "gd", tele.lsp_definitions, vim.tbl_extend("force", opts, { desc = "Goto Definition" }))
map("n", "<leader>fs", tele.lsp_document_symbols, vim.tbl_extend("force", opts, { desc = "Doc Symbols" }))
map("n", "<leader>fS", tele.lsp_dynamic_workspace_symbols, vim.tbl_extend("force", opts, { desc = "Dynamic Symbols" }))
map("n", "<leader>ft", tele.lsp_type_definitions, vim.tbl_extend("force", opts, { desc = "Goto Type" }))
map("n", "<leader>fr", tele.lsp_references, vim.tbl_extend("force", opts, { desc = "Goto References" }))
map("n", "<leader>fi", tele.lsp_implementations, vim.tbl_extend("force", opts, { desc = "Goto Impl" }))
map("n", "K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover" }))
map("n", "<leader>e", vim.diagnostic.open_float, vim.tbl_extend("force", opts, { desc = "Diagnostic" }))
map("n", "<leader>k", vim.lsp.buf.signature_help, vim.tbl_extend("force", opts, { desc = "Sig Help" }))
map("n", "<leader>rn", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename" }))
map("n", "<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code Action" }))
map("n", "<leader>wf", vim.lsp.buf.format, vim.tbl_extend("force", opts, { desc = "Format" }))
-- Visual mode code action
map("v", "<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code Action" }))
end,
})

View file

@ -1,30 +1,33 @@
local cmp = require'cmp'
require("luasnip.loaders.from_vscode").lazy_load()
local cmp = require'cmp'
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
{ name = 'nvim_lua' },
-- { name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lsp_signature_help' },
-- { name = 'cmdline' },
})
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
{ name = 'nvim_lua' },
-- { name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lsp_signature_help' },
-- { name = 'cmdline' },
})
})

View file

@ -1,2 +0,0 @@
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})

View file

@ -1,9 +0,0 @@
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
max_concurrent_installers = 10

View file

@ -29,7 +29,6 @@ o.showmatch = true
o.inccommand = "split"
o.splitright = true
o.splitbelow = true
o.termguicolors = true
o.updatetime = 250
o.ignorecase = true
o.incsearch = true
@ -45,3 +44,4 @@ g.loaded_node_provider = 0
g.loaded_python3_provider = 0
g.loaded_perl_provider = 0
g.loaded_ruby_provider = 0

17
lua/plugins/autopairs.lua Normal file
View file

@ -0,0 +1,17 @@
return {
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {
fast_wrap = {},
disable_filetype = { "TelescopePrompt", "vim" },
map_cr = true,
},
config = function(opts)
require("nvim-autopairs").setup(opts)
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
local cmp = require('cmp')
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
end
}
}

View file

@ -1,20 +0,0 @@
return {
{
"okuuva/auto-save.nvim",
version = '^1.0.0',
cmd = "ASToggle",
event = { "InsertLeave", "TextChanged" },
opts = {
enabled = true,
trigger_events = {
immediate_save = {
{ "BufLeave", pattern = { "*.typ", "*.tex" } }
},
defer_save = {
{ "BufLeave", pattern = { "*.typ", "*.tex"} }
},
cancel_deferred_save = { "InsertEnter" },
},
}
}
}

View file

@ -7,21 +7,6 @@ return {
{ "hrsh7th/cmp-cmdline" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-buffer" },
{
"windwp/nvim-autopairs",
event = "InsertEnter",
opts = {
fast_wrap = {},
disable_filetype = { "TelescopePrompt", "vim" },
map_cr = true,
},
config = function(opts)
require("nvim-autopairs").setup(opts)
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
local cmp = require('cmp')
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
end
},
},
opts = function()
require "config.plugins.cmp"
@ -30,40 +15,15 @@ return {
{
"hrsh7th/cmp-nvim-lsp",
dependencies = {},
config = function ()
config = function()
local lspconfig = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities()
lspconfig.lua_ls.setup({
capabilities = capabilities,
})
lspconfig.clangd.setup({
capabilities = capabilities,
})
lspconfig.tinymist.setup({
capabilities = capabilities,
})
lspconfig.texlab.setup({
capabilities = capabilities,
})
lspconfig.cssls.setup({
capabilities = capabilities,
})
lspconfig.html.setup({
capabilities = capabilities,
})
lspconfig.pyright.setup({
capabilities = capabilities,
})
lspconfig.arduino_language_server.setup({
capabilities = capabilities,
})
end,
},
{
"L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip",
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets"
},
opts = {}

View file

@ -3,30 +3,7 @@ return {
"neovim/nvim-lspconfig",
dependencies= {},
config = function()
require "config.plugins.lsp"
local lspconfig = require("lspconfig")
end,
},
{
"williamboman/mason.nvim",
dependencies = {},
opts = function ()
require "config.plugins.mason"
end
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = {},
config = function()
require("mason-lspconfig").setup {
ensure_installed = {
"lua_ls",
"tinymist",
"arduino_language_server",
"pylsp",
"texlab",
"clangd"
},
}
end,
}
}

23
lua/plugins/mason.lua Normal file
View file

@ -0,0 +1,23 @@
return {
{
"mason-org/mason.nvim",
opts = {
ui = {
icons = {
package_installed = "󰏖",
package_pending = "󰏗",
package_uninstalled = "󱧖"
}
}
}
},
{
"mason-org/mason-lspconfig.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
opts = {
automatic_enable = true
},
},
}

View file

@ -1,14 +0,0 @@
return {
{
"nvimtools/none-ls.nvim",
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.completion.spell,
},
})
end,
},
}

View file

@ -18,3 +18,4 @@ return {
end,
}
}

View file

@ -5,61 +5,40 @@ return {
},
{
"folke/tokyonight.nvim",
priority = 1000,
opts = {
transparent = false,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
opts = {}
},
{
"norcalli/nvim-colorizer.lua",
opts = {
'css';
'javascript';
html = {
mode = 'foreground';
}
}
opts = { 'css'; 'javascript'; html = {mode = 'foreground';} },
},
{
-- Lua status-bar
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
options = {
icons_enabled = true,
theme = 'pywal16-nvim',
component_separators = { left = "|", right = "|"},
section_separators = { left = "", right = ""},
}
component_separators = { left = "|", right = "|" },
section_separators = { left = "", right = "" },
},
}
},
{
'akinsho/bufferline.nvim',
"akinsho/bufferline.nvim",
version = "*",
dependencies = {'nvim-tree/nvim-web-devicons'},
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
options = {
mode = "buffers",
diagnostics = "nvim_lsp",
offsets = {
{
filetype = "neo-tree",
text = "File Explorer",
text_align = "center",
separator = true
{
filetype = "neo-tree", text = "File Explorer",
text_align = "center", separator = true
}
},
themable = false,
},
}
},
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
opts = {}
},
},
}