-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.lua
216 lines (180 loc) · 7.24 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
--reload("langs.go-config")
--reload("langs.rust-config")
-- Set space as the leader key
-- CONFIGURACION EPICA GAMER
-- set wrap
-- set indent
-- set smartindent
-- set autoindent
vim.g.mapleader = ' '
-- CONFIGURACION EPICA GAMER
-- Activar el ajuste de líneas
vim.o.wrap = true
-- Activar la sangría automática
vim.o.autoindent = true
-- Activar la sangría inteligente
vim.o.smartindent = true
-- Activar la sangría
vim.o.indentexpr = "autoindent"
-- Configuración adicional según tus preferencias
-- Por ejemplo, configurar el ancho de tabulación a 4 espacios
vim.o.tabstop = 4
vim.o.shiftwidth = 4
vim.o.softtabstop = 4
-- Desactivar el resaltado de búsqueda mientras escribes
vim.o.incsearch = false
-- Desactivar la resalta automática de la línea actual
-- vim.o.cursorline = false
-- Activar breakindent
vim.o.breakindent = true
-- Configurar la línea número
-- vim.o.number = true
-- Guardar la posición del cursor entre sesiones
vim.cmd([[au! BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif]])
-- Guardar automáticamente los archivos antes de cambiar de ventana
vim.cmd([[au FocusLost * :wa]])
-- Configurar otros ajustes según tus preferencias
-- Example mapping: Remap leader + w to save the current file
--
--
-- (asdfasdf)
vim.api.nvim_set_keymap('n', '-', '_', { noremap = true })
vim.api.nvim_set_keymap('n', '4', '$', { noremap = true })
vim.api.nvim_set_keymap('n', '<A-9>', 'vi(', { noremap = true })
vim.api.nvim_set_keymap('n', '<A-{>', 'vi{', { noremap = true })
vim.api.nvim_set_keymap('n', '<A-[>', 'vi[', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-9>', 'ci(', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-{>', 'vi{', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-[>', 'vi[', { noremap = true })
vim.api.nvim_set_keymap('n', '<leader>ee', 'oif err != nil {<CR>}<Esc>O<Tab>return err<Esc>',
{ noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>w', ':w<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>z', ':ZenMode<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>n', ':Telescope live_grep<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-,>', [[fmt.Println()<Esc>ha]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', '<A-b>', [[if err != nil {<CR>}<Esc>k]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('i', 'kj', '<Esc>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('v', 'kj', '<Esc>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Leader>a', '<C-^>', { noremap = true, silent = true })
-- Mapeo para pegar desde el registro "0 con la tecla F1 en modo normal
--
vim.api.nvim_set_keymap('n', '<F1>', '"0p', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<F2>', '"1p', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<F3>', '"2p', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<F4>', '"3p', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<F5>', '"4p', { noremap = true, silent = true })
vim.opt.relativenumber = true
lvim.plugins = {
{
"kawre/neotab.nvim",
event = "InsertEnter",
opts = {
-- configuration goes here
},
},
"sainnhe/gruvbox-material",
{
"wellle/context.vim",
event = 'VeryLazy',
},
{ "ellisonleao/gruvbox.nvim", priority = 1000, config = true, opts = ... },
"lunarvim/horizon.nvim",
"nyngwang/nvimgelion",
{
'folke/zen-mode.nvim',
event = 'VeryLazy',
opts = {
window = {
backdrop = 0.96, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal
width = 80, -- width of the Zen window
height = 1, -- height of the Zen window
options = {
signcolumn = "no", -- disable signcolumn
cursorcolumn = false, -- disable cursor column
}
},
plugins = {
options = {
enabled = true,
ruler = true, -- disables the ruler text in the cmd line area
showcmd = false, -- disables the command in the last line of the screen
laststatus = 0, -- turn off the statusline in zen mode
}
}
}
},
{
"ggandor/leap.nvim",
event = 'VeryLazy',
config = function()
require('leap').add_default_mappings()
end
},
{
'barrett-ruth/live-server.nvim',
build = 'yarn global add live-server',
config = true
},
{
'ThePrimeagen/harpoon',
event = 'VeryLazy',
config = function()
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>t", mark.add_file)
vim.keymap.set("n", "<leader>m", ui.toggle_quick_menu)
vim.keymap.set("n", "<leader>1", function() ui.nav_file(1) end)
vim.keymap.set("n", "<leader>2", function() ui.nav_file(2) end)
vim.keymap.set("n", "<leader>3", function() ui.nav_file(3) end)
vim.keymap.set("n", "<leader>4", function() ui.nav_file(4) end)
end
},
}
-- Establecer el fondo a gris oscuro
-- Change the background of lualine_c section for normal mode
-- vim.defer_fn(function()
-- -- Cambiar el color de fondo después de cargar el esquema de colores
-- vim.cmd([[hi Normal guibg=#121212 ctermbg=235]])
-- end, 0)
lvim.colorscheme = 'gruvbox-material'
lvim.lsp.on_attach_callback = function(client, _)
client.server_capabilities.semanticTokensProvider = nil
end
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.blade = {
install_info = {
url = "https://github.com/EmranMR/tree-sitter-blade",
files = { "src/parser.c" },
branch = "main",
},
filetype = "blade"
}
local capabilities = require("lvim.lsp").common_capabilities()
require("lvim.lsp.manager").setup("htmx", {
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
capabilities = capabilities,
})
require("lvim.lsp.manager").setup("sqlls", {
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
capabilities = capabilities,
})
require("lvim.lsp.manager").setup("html", {
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
capabilities = capabilities,
})
require("lvim.lsp.manager").setup("html", {
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
capabilities = capabilities,
})
vim.cmd("autocmd BufNewFile,BufRead *.tmpl setfiletype html")
vim.cmd("autocmd BufNewFile,BufRead *.blade.php setfiletype html")
function Err_nil()
vim.api.nvim_put({ "if err != nil {}" }, "c", true, true)
end
-- Asigna la función a una combinación de teclas (puedes cambiarlo según tus preferencias)
vim.api.nvim_set_keymap('n', '<Leader>hm', [[:lua Err_nil()<CR>]], { noremap = true, silent = true })
lvim.format_on_save.enabled = true