Añado mis cositas actuales para empezar

This commit is contained in:
werty534 2024-09-05 00:38:15 +02:00
parent 379a9ebc6a
commit baa9464123
2 changed files with 66 additions and 57 deletions

View File

@ -104,6 +104,9 @@ vim.opt.number = true
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
-- Ver colores en hexadecimal
vim.opt.termguicolors = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
@ -121,6 +124,10 @@ end)
-- Enable break indent
vim.opt.breakindent = true
-- Tabulación
vim.opt.tabstop = 4
vim.opt.shiftwidth = 0
-- Save undo history
vim.opt.undofile = true
@ -274,7 +281,8 @@ require('lazy').setup({
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
opts = {
config = function() -- This is the function that runs, AFTER loading
require('which-key').setup {
icons = {
-- set icon mappings to true if you have a Nerd Font
mappings = vim.g.have_nerd_font,
@ -311,18 +319,19 @@ require('lazy').setup({
F12 = '<F12>',
},
},
}
-- Document existing key chains
spec = {
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
require('which-key').add {
{ '<leader>c', group = '[C]ode' },
{ '<leader>d', group = '[D]ocument' },
{ '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' },
{ '<leader>w', group = '[W]orkspace' },
{ '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
},
},
}
end,
},
-- NOTE: Plugins can specify dependencies.
@ -505,9 +514,8 @@ require('lazy').setup({
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local map = function(keys, func, desc, mode)
mode = mode or 'n'
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
local map = function(keys, func, desc)
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
end
-- Jump to the definition of the word under your cursor.
@ -541,7 +549,7 @@ require('lazy').setup({
-- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate.
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
@ -607,8 +615,9 @@ require('lazy').setup({
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
pyright = {},
asm_lsp = {},
rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful:
@ -673,7 +682,7 @@ require('lazy').setup({
{
'<leader>f',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '',
desc = '[F]ormat buffer',
@ -686,21 +695,16 @@ require('lazy').setup({
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
local lsp_format_opt
if disable_filetypes[vim.bo[bufnr].filetype] then
lsp_format_opt = 'never'
else
lsp_format_opt = 'fallback'
end
return {
timeout_ms = 500,
lsp_format = lsp_format_opt,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
python = { 'isort', 'black' },
-- assembly = { 'asmfmt' },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
@ -929,7 +933,7 @@ require('lazy').setup({
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
}, {
ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the

View File

@ -2,4 +2,9 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
{
'norcalli/nvim-colorizer.lua',
opts = {},
},
}