aboutsummaryrefslogtreecommitdiffstats
path: root/lua/config
diff options
context:
space:
mode:
authorElvis Claros Castro <elvis@claros.ar>2024-08-17 18:37:18 -0300
committerElvis Claros Castro <elvis@claros.ar>2024-08-17 18:37:18 -0300
commit56758415b40197ff1e7dab653ab24af58727aa4e (patch)
tree7540fa0d34e1c07adb26eb3aa59e529e7ea189a4 /lua/config
parent41d3fb238db45b38b2ddb1635f45f098bd963ad2 (diff)
downloadnvim-conf-56758415b40197ff1e7dab653ab24af58727aa4e.tar.gz
nvim-conf-56758415b40197ff1e7dab653ab24af58727aa4e.zip
Feat: update all
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/autocmds.lua11
-rw-r--r--lua/config/diagnostic.lua29
-rw-r--r--lua/config/keymaps.lua108
-rw-r--r--lua/config/options.lua2
4 files changed, 130 insertions, 20 deletions
diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua
index b62150e..9030e4e 100644
--- a/lua/config/autocmds.lua
+++ b/lua/config/autocmds.lua
@@ -49,3 +49,14 @@ if vim.fn.has("persistent_undo") then
vim.o.undodir = target_path
vim.o.undofile = true
end
+-- Función para alternar el ajuste de línea
+function ToggleWrap()
+ local wrap = vim.wo.wrap
+ vim.wo.wrap = not wrap
+ if vim.wo.wrap then
+ print("Ajuste de línea: Habilitado")
+ else
+ print("Ajuste de línea: Deshabilitado")
+ end
+end
+
diff --git a/lua/config/diagnostic.lua b/lua/config/diagnostic.lua
index 67465ae..84d57b5 100644
--- a/lua/config/diagnostic.lua
+++ b/lua/config/diagnostic.lua
@@ -1,9 +1,28 @@
+
vim.diagnostic.config {
virtual_text = false,
+ signs = {
+ text = {
+ [vim.diagnostic.severity.ERROR] = '',
+ [vim.diagnostic.severity.WARN] = '',
+ [vim.diagnostic.severity.INFO] = '',
+ [vim.diagnostic.severity.HINT] = '',
+ },
+ linehl = {
+ [vim.diagnostic.severity.ERROR] = 'ErrorMsg',
+ },
+ numhl = {
+ [vim.diagnostic.severity.WARN] = 'WarningMsg',
+ },
+ },
}
-local signs = { Error = "", Warn = "", Hint = "", Info = "" }
-for type, icon in pairs(signs) do
- local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
-end
+-- vim.diagnostic.config {
+-- virtual_text = false,
+-- }
+--
+-- local signs = { Error = "", Warn = "", Hint = "", Info = "" }
+-- for type, icon in pairs(signs) do
+-- local hl = "DiagnosticSign" .. type
+-- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
+-- end
diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua
index 70f7511..73478de 100644
--- a/lua/config/keymaps.lua
+++ b/lua/config/keymaps.lua
@@ -69,21 +69,101 @@ map(
{ desc = "Save the current file and source it for .vim and .lua files" }
)
-map("n", "<leader>vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" })
-map("n", "<leader>vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" })
+-- map("n", "<leader>vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" })
+-- map("n", "<leader>vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" })
+map(
+ "n",
+ "<leader>vn",
+ function() vim.diagnostic.jump({ count = 1, float = true }) end,
+ { desc = "Goes to next diagnostic error" }
+)
+map(
+ "n",
+ "<leader>vp",
+ function() vim.diagnostic.jump({ count = -1, float = true }) end,
+ { desc = "Goes to prev diagnostic error" }
+)
map("v", "<leader>q", require('pi.select_to_quickfix').handle)
map('n', '99', ':set invspell<CR>', { noremap = true })
-- map("n", "<leader>ss", function() require('nvim-python-repl').send_statement_definition() end, { desc = "Send semantic unit to REPL"})
-vim.api.nvim_set_keymap('n', '<C-Enter>', [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>j]], {noremap = true, silent = true})
-vim.api.nvim_set_keymap('i', '<C-Enter>', [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>i]], {noremap = true, silent = true})
-map("n", "<leader>sl", function() require('nvim-python-repl').send_visual_to_repl() end, { desc = "Send visual selection to REPL"})
-map("v", "<leader>sl", function() require('nvim-python-repl').send_visual_to_repl() end, { desc = "Send visual selection to REPL"})
-map("n", "<leader>MReturn", function() require('nvim-python-repl').send_buffer_to_repl() end, { desc = "Send entire buffer to REPL"})
-map("n", "<leader>e", function() require('nvim-python-repl').toggle_execute() end, { desc = "Automatically execute command in REPL after sent"})
-map("n", "<leader>vi", function() require('nvim-python-repl').toggle_vertical() end, { desc = "Create REPL in vertical or horizontal split"})
-map("n", "<leader>rl",function() require('rust-tools').inlay_hints.enable() end, {desc = "Enable inlay hints auto update and set them for all the buffers"})
-map("n", "<leader>rdl",function() require('rust-tools').inlay_hints.disable() end, {desc = "Disable inlay hints auto update and unset them for all buffers"})
-map("n", "<leader>rrn", function () require('rust-tools').runnables.runnables() end, {desc = "run rust"})
-map("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
-map("n", "<leader>fg", function() require('telescope').extensions.live_grep_args.live_grep_args() end, {desc = "run grep"})
+vim.api.nvim_set_keymap(
+ 'n',
+ '<C-Enter>',
+ [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>j]],
+ {noremap = true, silent = true}
+)
+vim.api.nvim_set_keymap(
+ 'i',
+ '<C-Enter>',
+ [[<Esc>:lua require('nvim-python-repl').send_statement_definition()<CR>i]],
+ {noremap = true, silent = true}
+)
+map(
+ "n",
+ "<leader>sl",
+ function() require('nvim-python-repl').send_visual_to_repl() end,
+ { desc = "Send visual selection to REPL"}
+)
+map(
+ "v",
+ "<leader>sl",
+ function() require('nvim-python-repl').send_visual_to_repl() end,
+ { desc = "Send visual selection to REPL"}
+)
+map(
+ "n",
+ "<leader>MReturn",
+ function() require('nvim-python-repl').send_buffer_to_repl() end,
+ { desc = "Send entire buffer to REPL"}
+)
+map(
+ "n",
+ "<leader>e",
+ function() require('nvim-python-repl').toggle_execute() end,
+ { desc = "Automatically execute command in REPL after sent"}
+)
+map(
+ "n",
+ "<leader>vi",
+ function() require('nvim-python-repl').toggle_vertical() end,
+ { desc = "Create REPL in vertical or horizontal split"}
+)
+-- map(
+-- "n",
+-- "<leader>rl",
+-- function() require('rust-tools').inlay_hints.enable() end,
+-- {desc = "Enable inlay hints auto update and set them for all the buffers"}
+-- )
+-- map(
+-- "n",
+-- "<leader>rdl",
+-- function() require('rust-tools').inlay_hints.disable() end,
+-- {desc = "Disable inlay hints auto update and unset them for all buffers"}
+-- )
+-- map(
+-- "n",
+-- "<leader>rrn",
+-- function () require('rust-tools').runnables.runnables() end,
+-- {desc = "run rust"}
+-- )
+map(
+ "n",
+ "-",
+ "<CMD>Oil<CR>",
+ { desc = "Open parent directory" }
+)
+map(
+ "n",
+ "<leader>fg",
+ function() require('telescope').extensions.live_grep_args.live_grep_args() end,
+ {desc = "run grep"}
+)
+
+-- Asignar la función a una tecla específica
+vim.api.nvim_set_keymap(
+ 'n',
+ '<leader>w',
+ ':lua ToggleWrap()<CR>',
+ { noremap = true, silent = true }
+)
diff --git a/lua/config/options.lua b/lua/config/options.lua
index de3b12f..1400d03 100644
--- a/lua/config/options.lua
+++ b/lua/config/options.lua
@@ -37,7 +37,7 @@ opt.smartindent = true
opt.errorbells = false
-- Habilita el ajuste de línea.
-opt.wrap = true
+opt.wrap = false
-- Habilita el corrector ortográfico.
opt.spell = true