Updating config, enabling more plugins, sort deprecation warnings

This commit is contained in:
juanito87 2025-04-26 12:04:04 -03:00
parent b860612884
commit e5a05cfcb2
No known key found for this signature in database
GPG Key ID: EAB042894FD44AFD
9 changed files with 31 additions and 25 deletions

View File

@ -1,12 +1,13 @@
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()` -- NOTE: See `:help vim.keymap.set()`
-- vim.keymap.set(<mode/s> required, <keymap> required, <command> required, <optoins> not required) -- vim.keymap.set(<mode/s> required, <keymap> required, <command> required, <optoins> not required)
-- Set highlight on search, but clear on pressing <Esc> in normal mode -- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>', { desc = 'Remove higlight after search is done' }) vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>', { desc = 'Remove higlight after search is done' })
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) vim.keymap.set('n', '[d', function() vim.diagnostic.goto({ direction = 'prev', float = false }) end, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) vim.keymap.set('n', ']d', function() vim.diagnostic.goto({ direction = 'next', float = false }) end, { desc = 'Go to next [D]iagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
@ -21,21 +22,20 @@ vim.keymap.set('n', '<leader>pv', vim.cmd.Ex, { desc = 'Open netrw' }) -- open n
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- Keybinds to make split navigation easier. -- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows -- NOTE: Use CTRL+<hjkl> to switch between windows
-- See `:help wincmd` for a list of all window commands -- See `:help wincmd` for a list of all window commands
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' }) vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' }) vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' }) vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- TODO add more comments, do some improvements on those.
-- copy pasting -- copy pasting
vim.keymap.set('n', 'Y', 'y$', { desc = 'Yank till the end of the line' }) -- yanks till the end of the line, like C for change or D for delete vim.keymap.set('n', 'Y', 'y$', { desc = 'Yank till the end of the line' })
vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Marks the point (mz), joins the lines (J) and gets back to the marked place (`z)' }) vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Marks the point (mz), joins the lines (J) and gets back to the marked place (`z)' })
vim.keymap.set({ 'n', 'v' }, '<leader>y', '"+y', { desc = 'Prefix y with leader to send to system clipboard' }) vim.keymap.set({ 'n', 'v' }, '<leader>y', '"+y', { desc = 'Prefix y with leader to send to system clipboard' })
vim.keymap.set({ 'n', 'v' }, '<leader>Y', '"+Y', { desc = 'Prefix y with leader to send to system clipboard' }) vim.keymap.set({ 'n', 'v' }, '<leader>Y', '"+Y', { desc = 'Prefix Y with leader to send to system clipboard' })
vim.keymap.set('x', '<leader>p', '"+p', { desc = 'Deletes to void registry to avoid changing registry content' }) vim.keymap.set('x', '<leader>p', '"+p', { desc = 'Paste from clipboard over the selection, without chaging the clipboard registry("+).' })
vim.keymap.set('x', '<leader>P', '"_dP', { desc = 'Deletes to void registry to avoid changing registry content' }) vim.keymap.set('x', '<leader>P', '"_dP', { desc = 'Deletes to void registry("_) to avoid changing registry("0) content, and then pastes from clipboard' })
-- Search remaps -- Search remaps
vim.keymap.set('n', 'n', 'nzzzv', { desc = 'n = next search, zz = center cursor on screen, zv = open fold if exist' }) vim.keymap.set('n', 'n', 'nzzzv', { desc = 'n = next search, zz = center cursor on screen, zv = open fold if exist' })
@ -66,20 +66,23 @@ vim.keymap.set('n', '<C-C>', '<C-W><C-C>', { desc = 'Close window with ctrl+c' }
vim.keymap.set({ 'i', 'v', 'n', 's' }, '<C-s>', '<cmd>w<cr><esc>', { desc = 'Save file' }) vim.keymap.set({ 'i', 'v', 'n', 's' }, '<C-s>', '<cmd>w<cr><esc>', { desc = 'Save file' })
-- Function and remap to toggle relative numbers. -- Function and remap to toggle relative numbers.
vim.keymap.set('n', '<leader>nr', function() vim.keymap.set('n', '<leader>nr', function() vim.opt.nu = false vim.opt.relativenumber = false end, { desc = 'Disable number and relative number' })
vim.opt.nu = false vim.keymap.set('n', '<leader>rn', function() vim.opt.nu = true vim.opt.relativenumber = true end, { desc = 'Enable number and relative number' })
vim.opt.relativenumber = false
end, { desc = 'Disable number and relative number' })
vim.keymap.set('n', '<leader>rn', function()
vim.opt.nu = true
vim.opt.relativenumber = true
end, { desc = 'Enable number and relative number' })
-- Clean up -- Clean up
vim.keymap.set('n', '<leader>dw', ':%s/\\s\\+$//e<CR>', { desc = 'Clean trailing whitespace in the document' }) vim.keymap.set('n', '<leader>dw', ':%s/\\s\\+$//e<CR>', { desc = 'Clean trailing whitespace in the document' })
vim.keymap.set('n', '<leader>dn', ':%s/\\n\\+\\%$//e<CR>', { desc = 'Clean trailing newlines in the document' }) vim.keymap.set('n', '<leader>dn', ':%s/\\n\\+\\%$//e<CR>', { desc = 'Clean trailing newlines in the document' })
vim.keymap.set('n', '<leader>ds', ':%s/\\^\\[\\+\\%$//e<CR>', { desc = 'Clean trailing escape sequences in the document' }) vim.keymap.set('n', '<leader>ds', ':%s/\\^\\[\\+\\%$//e<CR>', { desc = 'Clean trailing escape sequences in the document' })
-- Code runner keymaps
vim.keymap.set('n', '<leader>rr', ':RunCode<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>rf', ':RunFile<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>rft', ':RunFile tab<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>rp', ':RunProject<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>rc', ':RunClose<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>crf', ':CRFiletype<CR>', { noremap = true, silent = false })
vim.keymap.set('n', '<leader>crp', ':CRProjects<CR>', { noremap = true, silent = false })
-- Testing remaps and functions -- Testing remaps and functions
-- better indenting -- better indenting

View File

@ -17,8 +17,7 @@ require('lazy').setup({
-- One liners -- One liners
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, -- { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
-- { 'CRAG666/code_runner.nvim', config = true }, -- Execute code within nvim.
-- Plugins with custom values -- Plugins with custom values
require 'plugins_config/which-key', -- Show created key bindings require 'plugins_config/which-key', -- Show created key bindings
@ -34,6 +33,8 @@ require('lazy').setup({
require 'plugins_config/tree-sitter', -- manage lint, indentation and some othe language related tasks require 'plugins_config/tree-sitter', -- manage lint, indentation and some othe language related tasks
require 'plugins_config/harpoon', -- Improve workflow for multiple files require 'plugins_config/harpoon', -- Improve workflow for multiple files
require 'plugins_config/code_runner', -- Code runner require 'plugins_config/code_runner', -- Code runner
require 'plugins_config/indent_line', -- visualize indentation
require 'plugins_config/lint', -- Add inting to files to complement tree sitter
-- require 'plugins_config/copilot', -- copilot config -- require 'plugins_config/copilot', -- copilot config
-- Broken configs/Testing config -- Broken configs/Testing config

View File

@ -4,7 +4,8 @@ return {
require('code_runner').setup { require('code_runner').setup {
filetype = { filetype = {
python = 'python3 -u', python = 'python3 -u',
typescript = 'deno run', javascript = 'node $file',
typescript = 'ts-node $file',
rust = { rust = {
'cd $dir &&', 'cd $dir &&',
'rustc $fileName &&', 'rustc $fileName &&',

View File

@ -46,7 +46,7 @@ return {
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' }) map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' }) map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' }) map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' }) map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' }) map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
@ -56,7 +56,7 @@ return {
end, { desc = 'git [D]iff against last commit' }) end, { desc = 'git [D]iff against last commit' })
-- Toggles -- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' }) map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
end, end,
}, },
} }

View File

@ -83,7 +83,7 @@ return {
-- Rename the variable under your cursor. -- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc. -- Most Language Servers support renaming across files, etc.
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') map('<leader>Rn', vim.lsp.buf.rename, '[R]e[n]ame')
-- Execute a code action, usually your cursor needs to be on top of an error -- 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. -- or a suggestion from your LSP for this to activate.

View File

@ -12,8 +12,10 @@ return { -- Useful plugin to show you pending keybinds.
{ '<leader>d_', hidden = true }, { '<leader>d_', hidden = true },
{ '<leader>h', group = 'Git [H]unk' }, { '<leader>h', group = 'Git [H]unk' },
{ '<leader>h_', hidden = true }, { '<leader>h_', hidden = true },
{ '<leader>r', group = '[R]ename' }, { '<leader>r', group = '[R]un code' },
{ '<leader>r_', hidden = true }, { '<leader>r_', hidden = true },
{ '<leader>R', group = '[R]e[n]ame' },
{ '<leader>R_', hidden = true },
{ '<leader>s', group = '[S]earch' }, { '<leader>s', group = '[S]earch' },
{ '<leader>s_', hidden = true }, { '<leader>s_', hidden = true },
{ '<leader>t', group = '[T]oggle' }, { '<leader>t', group = '[T]oggle' },

View File

@ -1,5 +1,4 @@
return { return {
'ThePrimeagen/git-worktree.nvim', -- Manage worktrees from nvim 'ThePrimeagen/git-worktree.nvim', -- Manage worktrees from nvim
opts = { opts = {
change_directory_command = 'tcd', -- command to change directory (e.g. lcd for NvimTree) change_directory_command = 'tcd', -- command to change directory (e.g. lcd for NvimTree)