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

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