added plugins

This commit is contained in:
λmolinae 2025-03-19 22:21:14 -06:00
parent d871422273
commit 4a074cc247
13 changed files with 204 additions and 43 deletions

View file

@ -1,4 +1,56 @@
require("config.lazy")
require("config.settings")
require("config.lazy")
require("config.mappings")
vim.cmd.colorscheme("neopywal")
vim.cmd.colorscheme("pywal16")
local tn_colors = require("tokyonight.colors").setup({ style = "storm" })
local syntax_overrides = {
{ "Comment", tn_colors.comment, true },
{ "Constant", tn_colors.orange },
{ "String", tn_colors.green },
{ "Character", tn_colors.green },
{ "Number", tn_colors.orange },
{ "Boolean", tn_colors.orange },
{ "Float", tn_colors.orange },
{ "Identifier", tn_colors.cyan },
{ "Function", tn_colors.blue, true },
{ "Statement", tn_colors.magenta },
{ "Conditional", tn_colors.magenta },
{ "Repeat", tn_colors.magenta },
{ "Label", tn_colors.blue },
{ "Operator", tn_colors.magenta },
{ "Keyword", tn_colors.magenta },
{ "Exception", tn_colors.magenta },
{ "PreProc", tn_colors.blue },
{ "Include", tn_colors.blue },
{ "Define", tn_colors.blue },
{ "Macro", tn_colors.blue },
{ "Type", tn_colors.yellow },
{ "StorageClass", tn_colors.yellow },
{ "Structure", tn_colors.yellow },
{ "Typedef", tn_colors.yellow },
{ "Special", tn_colors.red },
{ "Delimiter", tn_colors.fg },
{ "SpecialComment", tn_colors.comment },
{ "Debug", tn_colors.red },
{ "DiagnosticError", tn_colors.error, true },
{ "DiagnosticWarn", tn_colors.warning, true },
{ "DiagnosticInfo", tn_colors.blue },
{ "DiagnosticHint", tn_colors.hint },
{ "DiagnosticUnderlineError", tn_colors.error, false, true },
{ "DiagnosticUnderlineWarn", tn_colors.warning, false, true },
{ "DiagnosticUnderlineInfo", tn_colors.blue, false, true },
{ "DiagnosticUnderlineHint", tn_colors.hint, false, true },
{ "DiagnosticVirtualTextError", tn_colors.error, false, false, nil },
{ "DiagnosticVirtualTextWarn", tn_colors.warning, false, false, nil },
{ "DiagnosticVirtualTextInfo", tn_colors.blue, false, false, nil },
{ "DiagnosticVirtualTextHint", tn_colors.hint, false, false, nil }
}
for _, group in ipairs(syntax_overrides) do
vim.api.nvim_set_hl(0, group[1], { fg = group[2], bold = group[3] or false, italic = group[4] or false, bg = group[5] or nil })
end

View file

@ -31,5 +31,5 @@ require("lazy").setup({
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "neopywal" } },
-- automatically check for plugin updates
checker = { enabled = true },
checker = { enabled = false },
})

49
lua/config/mappings.lua Normal file
View file

@ -0,0 +1,49 @@
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"})
-- 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" })
-- Nonels
map("n", "<leader>gf", vim.lsp.buf.format, {})
-- 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, {})

View file

@ -22,7 +22,7 @@
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
{ name = 'nvim_lua' },
{ name = 'buffer' },
-- { name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lsp_signature_help' },
-- { name = 'cmdline' },

View file

@ -1,6 +1,2 @@
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({})
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
vim.keymap.set({'n', 'v'}, '<space>ca', vim.lsp.buf.code_action, {})

View file

@ -30,17 +30,17 @@ o.inccommand = "split"
o.splitright = true
o.splitbelow = true
o.termguicolors = true
opt.shortmess:append "sI"
opt.whichwrap:append "<>[]hl"
opt.fillchars = { eob = " " }
o.updatetime = 250
o.ignorecase = true
o.incsearch = true
o.smartcase = true
o.mouse = "a"
opt.shortmess:append "sI"
opt.whichwrap:append "<>[]hl"
opt.fillchars = { eob = " " }
opt.termguicolors = true
g.loaded_node_provider = 0
g.loaded_python3_provider = 0
g.loaded_perl_provider = 0

20
lua/plugins/autosave.lua Normal file
View file

@ -0,0 +1,20 @@
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

@ -13,6 +13,7 @@ return {
opts = {
fast_wrap = {},
disable_filetype = { "TelescopePrompt", "vim" },
map_cr = true,
},
config = function(opts)
require("nvim-autopairs").setup(opts)
@ -20,6 +21,12 @@ return {
local cmp = require('cmp')
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
end
},
{
"lukas-reineke/indent-blankline.nvim",
event = "User FilePost",
main = "ibl",
opts = {}
}
},
opts = function()
@ -29,20 +36,21 @@ return {
{
"hrsh7th/cmp-nvim-lsp",
dependencies = {},
-- [[
config = function ()
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('lspconfig').clangd.setup {
capabilities = capabilities,
}
require('lspconfig').pylsp.setup {
capabilities = capabilities
}
require('lspconfig').ltex.setup {
capabilities = capabilities
local lsps = {
"clangd", "arduino_language_server",
"lua_ls", "pylsp",
"texlab", "tinymist",
"cssls", "html",
}
-- Load completion engines
for _, lsp in pairs(lsps) do
require('lspconfig')[lsp].setup { capabilities = capabilities }
end
end,
--]]
},
{
"L3MON4D3/LuaSnip",

View file

@ -18,7 +18,14 @@ return {
dependencies = {},
config = function()
require("mason-lspconfig").setup {
ensure_installed = { "lua_ls" },
ensure_installed = {
"lua_ls",
"tinymist",
"arduino_language_server",
"pylsp",
"texlab",
"clangd"
},
}
end,
}

View file

@ -7,8 +7,6 @@ return {
"MunifTanjim/nui.nvim",
-- "3rd/image.nvim", -- Optional see `# Preview Mode` for more information
},
opts = {
vim.keymap.set('n', '<C-b>', '<Cmd>Neotree toggle<CR>')
}
opts = {}
}
}

View file

@ -6,10 +6,9 @@ return {
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
-- null_ls.builtins.completion.spell,
null_ls.builtins.completion.spell,
},
})
vim.keymap.set("n", "<space>gf", vim.lsp.buf.format, {})
end,
},
}

View file

@ -2,11 +2,7 @@ return {
{
"nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<C-p>', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<C-g>', builtin.live_grep, { desc = 'Telescope live grep' })
end,
opts = {}
},
{
"nvim-telescope/telescope-ui-select.nvim",

View file

@ -1,12 +1,28 @@
return {
{
"RedsXDD/neopywal.nvim",
name = "neopywal",
opts = {
transparent_background = true,
terminal_colors = true,
show_end_of_buffer = false,
'uZer/pywal16.nvim',
opts = {},
},
{
"folke/tokyonight.nvim",
priority = 1000,
opts = {
transparent = false,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
},
{
"norcalli/nvim-colorizer.lua",
opts = {
'css';
'javascript';
html = {
mode = 'foreground';
}
}
},
{
-- Lua status-bar
@ -15,12 +31,32 @@ return {
opts = {
options = {
icons_enabled = true,
theme = 'auto',
theme = 'pywal16-nvim',
component_separators = { left = "|", right = "|"},
section_separators = { left = "", right = ""},
section_separators = { left = "", right = ""},
}
}
},
{
'akinsho/bufferline.nvim',
version = "*",
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
}
},
themable = false,
},
}
},
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },