commit 131a454bb6a5bfedff7f2c56876aa8a895b92305 from: Andre M. Bertachini date: Sun Jun 1 02:42:06 2025 UTC Clean-up commit - 8f25fd11b64f9e16db18d8213fdc1791ac39066f commit + 131a454bb6a5bfedff7f2c56876aa8a895b92305 blob - 9bc96d544e1b659520e85c1173344c43844e1d70 (mode 644) blob + /dev/null --- Untitled +++ /dev/null @@ -1 +0,0 @@ - sf blob - 404f3b106d6bd941644eba6d7275ba200c14dfa9 blob + 7d8338998b65051c0842c130e745a770b75d0d19 --- init.lua +++ init.lua @@ -15,5 +15,6 @@ require('lazy').setup({ require('plugins/colors') }) +MiniMisc.setup_termbg_sync() require('config.options') require('config.keymaps') blob - ddbd453f7700582d1a3b76043fc758db43d11315 blob + 3d4972aed395a1f5ef31995bfc63c427ed9d357c --- lazy-lock.json +++ lazy-lock.json @@ -1,14 +1,14 @@ { - "conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" }, - "gitsigns.nvim": { "branch": "main", "commit": "43b0c856ae5f32a195d83f4a27fe21d63e6c966c" }, + "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, + "gitsigns.nvim": { "branch": "main", "commit": "8bdaccdb897945a3c99c1ad8df94db0ddf5c8790" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "62f821a14e20f3f2ee358cd44d0b3d299a508e72" }, - "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, - "mini.nvim": { "branch": "main", "commit": "c665f30bb372c2ec8cfd61f7531098d3658b6634" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "60eaff7a470b8e78ddff09d847d17a011f560759" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "mini.nvim": { "branch": "main", "commit": "c39f7f506939f065d0d1af237e2ea3f252edd3d4" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, - "nvim-lspconfig": { "branch": "master", "commit": "61e5109c8cf24807e4ae29813a3a82b31821dd45" }, - "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, + "nvim-lspconfig": { "branch": "master", "commit": "03bc581e05e81d33808b42b2d7e76d70adb3b595" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, blob - 3be45a6df1c0fe10a0c6315ccd818800227d60f9 blob + c3afd4fde5ca953340dc1f78feac411c2cfb3f81 --- lua/config/keymaps.lua +++ lua/config/keymaps.lua @@ -16,12 +16,8 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloc -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping -- or just use to exit terminal mode -- See `:help terminal` -vim.keymap.set('n', '', 'nohlsearch') -vim.keymap.set('n', 'e', ':Ex') +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) --- Diagnostic keymaps -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - -- TIP: Disable arrow keys in normal mode vim.keymap.set('n', '', 'echo "No Arrows!"') vim.keymap.set('n', '', 'echo "No Arrows!"') @@ -46,33 +42,17 @@ vim.api.nvim_create_autocmd('TextYankPost', { vim.highlight.on_yank() end, }) -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) --- TIP: Disable arrow keys in normal mode -vim.keymap.set('n', '', 'echo "No Arrows!"') -vim.keymap.set('n', '', 'echo "No Arrows!"') -vim.keymap.set('n', '', 'echo "No Arrows!"') -vim.keymap.set('n', '', 'echo "No Arrows!"') - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - -- Telescope keymaps -- See `:help telescope.builtin` vim.keymap.set('n', 'sf', 'Telescope find_files', { desc = 'Find files' }) vim.keymap.set('n', 'sg', 'Telescope live_grep', { desc = 'Search text in files' }) vim.keymap.set('n', 'sb', 'Telescope buffers', { desc = 'List open buffers' }) -vim.keymap.set('n', 'gf', 'Telescope git_files', { desc = 'Find Git-tracked files' }) vim.keymap.set('n', 'sh', 'Telescope help_tags', { desc = 'Search help tags' }) vim.keymap.set('n', 'sr', 'Telescope oldfiles', { desc = 'List recent files' }) vim.keymap.set( 'n', - 'sz', + 's/', 'Telescope current_buffer_fuzzy_find', { desc = 'Fuzzy find in current buffer' } ) @@ -102,40 +82,6 @@ vim.api.nvim_create_autocmd('LspAttach', { lsp_map('lr', vim.lsp.buf.rename, 'Rename across multiple files', 'n') lsp_map('ca', vim.lsp.buf.code_action, 'Code actions', { 'n', 'x' }) lsp_map('lt', require('telescope.builtin').lsp_type_definitions, 'Type Definition') - - lsp_map('lc', function() - local line = vim.api.nvim_win_get_cursor(0)[1] - 1 - if line < 0 then - vim.notify('Invalid line number', vim.log.levels.ERROR) - return - end - - local diagnostics = vim.diagnostic.get(0, { lnum = line }) - if not diagnostics or #diagnostics == 0 then - vim.notify('No diagnostics found', vim.log.levels.WARN) - return - end - - local first_diagnostic = diagnostics[1] - local diagnostic_text = - string.format('%s: %s', vim.diagnostic.severity[first_diagnostic.severity], first_diagnostic.message) - - vim.fn.setreg('+', diagnostic_text) - - vim.notify('First diagnostic copied to clipboard', vim.log.levels.INFO) - end, 'Copy first error diagnostic', 'n') - - lsp_map('le', function() - require('telescope.builtin').diagnostics({ - bufnr = 0, -- Current buffer - line = vim.api.nvim_win_get_cursor(0)[1], -- Current line - prompt_title = 'Line Error Diagnostics', - layout_config = { - width = 0.8, -- Max width (80% of screen) - height = 0.4, - }, - }) - end, 'Show error diagnostics in Telescope', 'n') end, }) @@ -150,39 +96,6 @@ vim.api.nvim_create_autocmd('BufEnter', { local gitsigns = require('gitsigns') - -- Navigation - gs_map(']c', function() - if vim.wo.diff then - vim.cmd.normal({ ']c', bang = true }) - else - gitsigns.nav_hunk('next') - end - end, 'Jump to next git change') - - gs_map('[c', function() - if vim.wo.diff then - vim.cmd.normal({ '[c', bang = true }) - else - gitsigns.nav_hunk('prev') - end - end, 'Jump to previous git change') - - -- Actions visual mode - gs_map('hs', function() - gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) - end, 'git stage hunk', 'v') - - gs_map('hr', function() - gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) - end, 'git reset hunk', 'v') - - gs_map('gb', gitsigns.blame_line, 'git blame line') - gs_map('gd', gitsigns.diffthis, 'git diff against index') - gs_map('gD', function() - gitsigns.diffthis('@') - end, 'git diff against last commit') - - -- Toggles gs_map('tb', gitsigns.toggle_current_line_blame, 'toggle git show blame line') gs_map('tD', gitsigns.toggle_deleted, 'Toggle git show deleted') end, blob - dcaf51191a2e5f79336adda3906ff92d4136c46c blob + 5daa5bc8bde9876c0e2a7f007479728a1628abaa --- lua/config/options.lua +++ lua/config/options.lua @@ -4,10 +4,10 @@ vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' -vim.opt.expandtab = true -- Use spaces instead of tabs -vim.opt.shiftwidth = 4 -- Number of spaces to insert for indentation -vim.opt.tabstop = 4 -- Display width of tabs (doesn't affect actual indentation) -vim.opt.softtabstop = 4 -- Number of spaces for key to insert (for convenience) +vim.opt.expandtab = true -- Use spaces instead of tabs +vim.opt.shiftwidth = 4 -- Number of spaces to insert for indentation +vim.opt.tabstop = 4 -- Display width of tabs (doesn't affect actual indentation) +vim.opt.softtabstop = 4 -- Number of spaces for key to insert (for convenience) -- Don't show the mode, since it's already in the status line vim.o.showmode = false @@ -56,3 +56,4 @@ vim.o.scrolloff = 10 -- instead raise a dialog asking if you wish to save the current file(s) -- See `:help 'confirm'` vim.o.confirm = true + blob - 28f2f5f42b6a7a3d148be202672327fcec3d8adc blob + 6b3f8f26db2ae0ef0531eb900e99673d4eaed7f5 --- lua/plugins/lspconfig.lua +++ lua/plugins/lspconfig.lua @@ -25,7 +25,8 @@ return { end, }, }) - -- Define LSP servers + + -- custom LSP configs are define here local servers = { lua_ls = { settings = { blob - ad982f94e6000f0c9aaa489ef8d752973942e84e blob + f7cd623b1073d781930c9b8af042560d0e7630ca --- lua/plugins/mason.lua +++ lua/plugins/mason.lua @@ -7,7 +7,7 @@ return { 'williamboman/mason-lspconfig.nvim', opts = { ensure_installed = { 'lua_ls' }, - automatic_installation = true, + automatic_installation = false, handlers = { function(server_name) local server = servers[server_name] or {} blob - acc41e0cb6e1ab649267f989eda4be6f92306ed8 blob + d435f4c2ca827dfb9e79b71288b6440ff6c96a4e --- lua/plugins/mini.lua +++ lua/plugins/mini.lua @@ -1,21 +1,21 @@ return { - { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + { + 'echasnovski/mini.nvim', + config = function() + -- Better Around/Inside textobjects + -- + -- - va) - [V]isually select [A]round [)]paren + -- - yinq - [Y]ank [I]nside [N]ext [Q]uote + -- - ci' - [C]hange [I]nside [']quote + require('mini.ai').setup({ n_lines = 500 }) - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - end, - }, + -- Add/delete/replace surroundings (brackets, quotes, etc.) + -- + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren + -- - sd' - [S]urround [D]elete [']quotes + -- - sr)' - [S]urround [R]eplace [)] ['] + require('mini.surround').setup() + require('mini.misc').setup() + end, + }, } blob - 00623459738a8d3c21eca419751c15e15b82b2a1 blob + 1e548810fb6551094baf9ad752f06e642473966c --- lua/plugins/telescope.lua +++ lua/plugins/telescope.lua @@ -5,45 +5,39 @@ return { 'nvim-lua/plenary.nvim', { 'nvim-telescope/telescope-ui-select.nvim' }, { + -- Builds fzf-native if make is avaliable. 'nvim-telescope/telescope-fzf-native.nvim', - -- `build` is used to run some command when the plugin is installed/updated. - -- This is only run then, not every time Neovim starts up. build = 'make', - -- `cond` is a condition used to determine whether this plugin should be - -- installed and loaded. cond = function() return vim.fn.executable('make') == 1 end, }, }, - cmd = 'Telescope', -- Lazy-load on :Telescope command + cmd = 'Telescope', config = function() pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') require('telescope').setup({ defaults = { - -- Minimal layout for speed layout_strategy = 'horizontal', - layout_config = { - width = 0.8, - height = 0.8, - preview_width = 0.5, - }, - -- Disable costly files file_ignore_patterns = { 'node_modules', '^package%-lock%.json$' }, - -- Basic mappings for efficiency mappings = { i = { [''] = 'move_selection_next', [''] = 'move_selection_previous', - [''] = 'close', + [''] = 'close', }, n = { ['q'] = 'close', }, }, }, + pickers = { + find_files = { + theme = "ivy" + } + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(),