Updating from upstream

This commit is contained in:
juanito87 2025-07-12 14:57:08 -03:00
commit 5cffa31544
No known key found for this signature in database
GPG Key ID: EAB042894FD44AFD
12 changed files with 95 additions and 74 deletions

View File

@ -24,7 +24,8 @@ If you are experiencing issues, please make sure you have the latest versions.
External Requirements:
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
[fd-find](https://github.com/sharkdp/fd#installation)
- Clipboard tool (xclip/xsel/win32yank or other depending on the platform)
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true

View File

@ -21,6 +21,12 @@ vim.keymap.set('n', '<leader>pv', vim.cmd.Ex, { desc = 'Open netrw' }) -- open n
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
-- TIP: Disable arrow keys in normal mode, i don use them
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
-- Keybinds to make split navigation easier.
-- NOTE: Use CTRL+<hjkl> to switch between windows
-- See `:help wincmd` for a list of all window commands
@ -29,6 +35,12 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
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' })
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
-- copy pasting
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)' })
@ -58,16 +70,12 @@ vim.keymap.set('n', '<leader>k', ':m .-2<CR>==', { desc = 'Move line down in in
-- Window management
vim.keymap.set('n', '<C-C>', '<C-W><C-C>', { desc = 'Close window with ctrl+c' })
-- Markdown preview haven't setup this plugin
-- vim.keymap.set('n', '<leader>mp', ':Glow<CR>', { desc = 'Remap glow to show markdown preview' })
-- vim.keymap.set('n', '<leader>mq', ':Glow!<CR>', { desc = 'Remap glow to close markdown preview' })
-- 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.
vim.keymap.set('n', '<leader>nr', function() vim.opt.nu = false 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' })
vim.keymap.set('n', '<leader>nr', function() vim.o.nu = false vim.opt.relativenumber = false end, { desc = 'Disable number and relative number' })
vim.keymap.set('n', '<leader>rn', function() vim.o.nu = true vim.opt.relativenumber = true end, { desc = 'Enable number and relative number' })
-- Clean up
vim.keymap.set('n', '<leader>dw', ':%s/\\s\\+$//e<CR>', { desc = 'Clean trailing whitespace in the document' })
@ -75,16 +83,20 @@ vim.keymap.set('n', '<leader>dn', ':%s/\\n\\+\\%$//e<CR>', { desc = 'Clean trail
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 })
vim.keymap.set('n', '<leader>rr', ':RunCode<CR>', { noremap = true, silent = false, desc = 'Run code based on file type.' })
vim.keymap.set('n', '<leader>rf', ':RunFile<CR>', { noremap = true, silent = false, desc = 'Run code in current file.' })
vim.keymap.set('n', '<leader>rft', ':RunFile tab<CR>', { noremap = true, silent = false, desc = 'Run code in current file on a tab.' })
vim.keymap.set('n', '<leader>rp', ':RunProject<CR>', { noremap = true, silent = false, desc = 'Run code in project.' })
vim.keymap.set('n', '<leader>rc', ':RunClose<CR>', { noremap = true, silent = false, desc = 'Close runner.' })
vim.keymap.set('n', '<leader>crf', ':CRFiletype<CR>', { noremap = true, silent = false, desc = 'Open json with supported files.' })
vim.keymap.set('n', '<leader>crp', ':CRProjects<CR>', { noremap = true, silent = false, desc = 'Open json with list of projects.' })
-- Testing remaps and functions
-- better indenting
-- vim.keymap.set('v', '<', '<gv')
-- vim.keymap.set('v', '>', '>gv')
-- Markdown preview haven't setup this plugin
-- vim.keymap.set('n', '<leader>mp', ':Glow<CR>', { desc = 'Remap glow to show markdown preview' })
-- vim.keymap.set('n', '<leader>mq', ':Glow!<CR>', { desc = 'Remap glow to close markdown preview' })

View File

@ -11,7 +11,7 @@
require('lazy').setup({
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
-- Plugins with default values
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
'numToStr/Comment.nvim', -- "gc" to comment visual regions/lines
'github/copilot.vim', -- Copilot
-- keeping comments for annotation
@ -39,9 +39,8 @@ require('lazy').setup({
-- which loads which-key before all the UI elements are loaded. Events can be
-- normal autocommands events (`:help autocmd-events`).
--
-- Then, because we use the `config` key, the configuration only runs
-- after the plugin has been loaded:
-- config = function() ... end
-- Then, because we use the `opts` key (recommended), the configuration runs
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
-- NOTE: Plugins can specify dependencies.
--

View File

@ -8,4 +8,4 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
error('Error cloning lazy.nvim:\n' .. out)
end
end ---@diagnostic disable-next-line: undefined-field
vim.opt.rtp:prepend(lazypath)
vim.o.rtp:prepend(lazypath)

View File

@ -1,79 +1,79 @@
-- [[ Options ]]
-- See `:help vim.opt`
-- NOTE: You can change these options as you wish!
-- For more options, you can see `:help option-list`
-- [[ oions ]]
-- See `:help vim.o`
-- NOTE: You can change these oions as you wish!
-- For more oions, you can see `:help option-list`
-- Set numbers and relativenumber
vim.opt.number = true
vim.opt.relativenumber = true
vim.o.number = true
vim.o.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
vim.o.mouse = 'a'
-- Don't show the mode, since it's already in the status line
vim.opt.showmode = false
vim.o.showmode = false
-- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function()
vim.opt.clipboard = 'unnamedplus'
end)
-- vim.schedule(function()
-- vim.o.clipboard = 'unnamedplus'
-- end)
-- Set indent
-- vim.opt.tabstop = 4
-- vim.opt.softtabstop = 4
-- vim.opt.shiftwidth = 4
vim.opt.wrap = true
vim.opt.breakindent = true -- keeps text indented after wrap line
vim.opt.expandtab = true
vim.opt.smartindent = true
-- Set indent currently managed by a plugin.
-- vim.o.tabstop = 4
-- vim.o.softtabstop = 4
-- vim.o.shiftwidth = 4
vim.o.wrap = true -- wrap text after textwidth is reached
vim.o.breakindent = true -- keeps text indented after wrap line
vim.o.expandtab = true -- put the amount of spaces each time tab is used
vim.o.smartindent = true -- autodetect indent when starting a newline
-- Save undo history and specify path to it.
vim.opt.undofile = true
vim.opt.undodir = os.getenv 'HOME' .. '/.nvim/undodir'
vim.o.undofile = true
vim.o.undodir = os.getenv 'HOME' .. '/.nvim/undodir'
-- Don't create swap or backup, we have undo for it
vim.opt.swapfile = false
vim.opt.backup = false
vim.o.swapfile = false
vim.o.backup = false
-- Set highlight and navigation
vim.opt.hlsearch = true -- Highlight partial search
vim.opt.incsearch = true -- Incremental search to highlight partial matches
vim.o.hlsearch = true -- Highlight partial search
vim.o.incsearch = true -- Incremental search to highlight partial matches
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.signcolumn = 'yes' -- Keep signcolumn on by default
vim.opt.inccommand = 'split' -- Preview substitutions live, as you type!
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.signcolumn = 'yes' -- Keep signcolumn on by default
vim.o.inccommand = 'split' -- Preview substitutions live, as you type!
-- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 20
vim.o.scrolloff = 20
-- Decrease update time
vim.opt.updatetime = 250
vim.o.updatetime = 250
-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300
vim.o.timeoutlen = 300
-- Configure how new splits should be opened
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.o.splitright = true
vim.o.splitbelow = true
-- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'`
-- and `:help 'listchars'`
vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
vim.o.list = true
vim.o.listchars = { tab = '» ', trail = '·', nbsp = '' }
-- Show which line your cursor is on
vim.opt.cursorline = true
vim.o.cursorline = true
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
-- instead raise a dialog asking if you wish to save the current file(s)
-- See `:help 'confirm'`
vim.opt.confirm = true
vim.o.confirm = true
-- set netrw config
vim.g.netrw_banner = 0 -- Remove banner at the top

View File

@ -38,7 +38,12 @@ return { -- Autoformat
rust = { 'rustfmt' },
toml = { 'taplo' },
jinja2 = { 'djlint' },
javascript = { { 'prettierd', 'prettier' } },
javascript = { 'prettierd', 'prettier' },
bash = { 'beautysh', 'shellcheck' },
terraform = { 'terraform_fmt'},
ansible = { 'ansible-lint' },
hcl = { 'hcl' },
markdown = { 'markdownfmt', 'markdownlint' },
-- You can use a sub-list to tell conform to run *until* a formatter
-- is found.
},

View File

@ -18,7 +18,7 @@ return {
'nvim-neotest/nvim-nio',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'mason-org/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here

View File

@ -9,7 +9,7 @@ return {
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
lazy = false,
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
},

View File

@ -50,7 +50,7 @@ return {
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.opt_local.modifiable:get() then
if vim.bo.modifiable then
lint.try_lint()
end
end,

View File

@ -13,8 +13,9 @@ return {
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim',
-- NOTE: Must be loaded before dependants
{ 'mason-org/mason.nvim', opts = {} },
'mason-org/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim',
-- Useful status updates for LSP.
@ -97,13 +98,10 @@ return {
-- Similar to document symbols, except searches over your entire project.
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc.
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
-- or a suggestion from your LSP for this to activate.
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
-- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*.
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
-- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap.
@ -212,6 +210,13 @@ return {
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
ansiblels = {},
bashls = {},
gh_actions_ls = {},
jinja_lsp = {},
markdown_oxide = {},
terraform_lsp = {},
yamlls = {},
gopls = {},
pyright = {},
rust_analyzer = {},

View File

@ -1,7 +1,6 @@
return { -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
event = 'VimEnter',
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
@ -88,8 +87,8 @@ return { -- Fuzzy Finder (files, lsp, etc)
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
winblend = 30,
previewer = true,
})
end, { desc = '[/] Fuzzily search in current buffer' })

View File

@ -4,7 +4,7 @@ return { -- Highlight, edit, and navigate code
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = {
ensure_installed = { 'lua', 'rust', 'toml', 'bash', 'dockerfile', 'go', 'http', 'json', 'make', 'markdown', 'python', 'regex', 'yaml', 'vim', 'vimdoc', 'diff', 'typescript', 'javascript' },
ensure_installed = { 'lua', 'luadoc', 'rust', 'toml', 'bash', 'dockerfile', 'go', 'json', 'make', 'markdown', 'python', 'regex', 'yaml', 'vim', 'vimdoc', 'diff', 'typescript', 'javascript' },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,