From 660afc8411d408b386c089fd547b2ad0667a42fa Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Fri, 20 Dec 2024 18:11:06 -0500 Subject: [PATCH] refactor: clean up file tree, remove redundant code, formatting --- .config/nvim/after/ftplugin/gitcommit.lua | 5 +- .config/nvim/lua/core/autocmds.lua | 12 +- .config/nvim/lua/core/keymap.lua | 111 +++++++------- .config/nvim/lua/core/options.lua | 10 +- .config/nvim/lua/plugins/autocomplete.lua | 3 +- .config/nvim/lua/plugins/cloak.lua | 2 +- .config/nvim/lua/plugins/dressing.lua | 19 +-- .config/nvim/lua/plugins/foldsigns.lua | 2 +- .config/nvim/lua/plugins/fugitive.lua | 15 +- .config/nvim/lua/plugins/gitsigns.lua | 3 +- .config/nvim/lua/plugins/illuminate.lua | 4 +- .config/nvim/lua/plugins/indent-blankline.lua | 52 ++++--- .config/nvim/lua/plugins/lazygit.lua | 19 +-- .config/nvim/lua/plugins/linting.lua | 34 +++-- .config/nvim/lua/plugins/lsp/mason.lua | 3 +- .config/nvim/lua/plugins/lualine.lua | 18 ++- .config/nvim/lua/plugins/moveline.lua | 14 +- .config/nvim/lua/plugins/noice.lua | 52 ++++++- .config/nvim/lua/plugins/nvim-tree.lua | 4 +- .config/nvim/lua/plugins/oil.lua | 140 ++---------------- .config/nvim/lua/plugins/outline.lua | 119 ++++++++------- .config/nvim/lua/plugins/prettier.lua | 63 ++++---- .../nvim/lua/plugins/rainbow-delimiters.lua | 34 +++-- .config/nvim/lua/plugins/substitute.lua | 13 +- .config/nvim/lua/plugins/telescope-yadm.lua | 18 --- .config/nvim/lua/plugins/telescope.lua | 11 +- .config/nvim/lua/plugins/tint.lua | 4 - .config/nvim/lua/plugins/tmux-navigator.lua | 24 +-- .config/nvim/lua/plugins/todo-comments.lua | 11 +- .../lua/plugins/treesitter/treesitter.lua | 8 +- .config/nvim/lua/plugins/trouble.lua | 16 +- .config/nvim/lua/plugins/vim-maximizer.lua | 4 +- .config/nvim/lua/plugins/which-key.lua | 18 ++- 33 files changed, 418 insertions(+), 447 deletions(-) delete mode 100644 .config/nvim/lua/plugins/telescope-yadm.lua diff --git a/.config/nvim/after/ftplugin/gitcommit.lua b/.config/nvim/after/ftplugin/gitcommit.lua index 0deffb8..7e6880c 100644 --- a/.config/nvim/after/ftplugin/gitcommit.lua +++ b/.config/nvim/after/ftplugin/gitcommit.lua @@ -1,5 +1,8 @@ +vim.opt_local.textwidth = 78 +vim.opt_local.spell = true + return { require('cmp').setup.buffer({ sources = require('cmp').config.sources({ { name = 'gitmoji' } }, { { name = 'buffer' } }), }), -} +} \ No newline at end of file diff --git a/.config/nvim/lua/core/autocmds.lua b/.config/nvim/lua/core/autocmds.lua index bd7f4a0..a4f9f0f 100644 --- a/.config/nvim/lua/core/autocmds.lua +++ b/.config/nvim/lua/core/autocmds.lua @@ -1,23 +1,25 @@ local autocmd = vim.api.nvim_create_autocmd local augroup = vim.api.nvim_create_augroup +local o = vim.opt_local -- ──────────────────[ set options for markdown files ]─────────────── autocmd('FileType', { pattern = 'markdown', callback = function() - vim.opt_local.textwidth = 80 - vim.opt_local.spell = true + o.colorcolumn = '+1,+2' + o.textwidth = 80 + o.spell = true end, }) --- ─────────────────────[ set options for gitcommit ]───────────────────── +--[[ -- ─────────────────────[ set options for gitcommit ]───────────────────── autocmd('FileType', { pattern = 'gitcommit', callback = function() vim.opt_local.textwidth = 78 vim.opt_local.spell = true end, -}) +}) ]] -- ┌ -- │ Highlight on yank @@ -29,4 +31,4 @@ autocmd('TextYankPost', { callback = function() vim.highlight.on_yank({ higroup = 'IncSearch', timeout = '800' }) end, -}) \ No newline at end of file +}) diff --git a/.config/nvim/lua/core/keymap.lua b/.config/nvim/lua/core/keymap.lua index ee8d907..000829f 100644 --- a/.config/nvim/lua/core/keymap.lua +++ b/.config/nvim/lua/core/keymap.lua @@ -9,18 +9,55 @@ local function opts(desc) end -- ───────────────────────────────────────────────────( general use )─ -keymap.set('i', 'jk', '', opts('Exit insert mode with jk')) +keymap.set('i', 'jk', '', opts('Exit insert mode')) keymap.set('n', 'nh', ':nohl', opts('Clear search highlights')) -keymap.set({ 'n', 'v' }, 'cm', 'Noice dismiss', opts('Dismiss notifications')) -keymap.set('n', '?', 'Telescope help_tags', opts('Search documentation')) +keymap.set({ 'n', 'v' }, 'cm', 'NoiceDismiss', opts('Dismiss notifications')) + +-- ─────────────────────────────────────────────────────( telescope )─ +keymap.set('n', 'fh', 'Telescope help_tags', opts('Search documentation')) +keymap.set( + 'n', + 'ff', + 'Telescope find_files initial_mode=insert sort_mru=true sort_lastused=true select_current=true', + opts('Fuzzy find files in cwd') +) +keymap.set( + 'n', + 'fr', + 'Telescope oldfiles initial_mode=insert sort_mru=true sort_lastused=true select_current=true', + opts('Fuzzy find recent files') +) +keymap.set('n', 'fs', 'Telescope current_buffer_fuzzy_find', opts('Find string in this buffer')) +keymap.set('n', 'fS', 'Telescope live_grep', opts('Find string in cwd')) +keymap.set('n', 'fc', 'Telescope grep_string', opts('Find string under cursor in cwd')) +keymap.set( + 'n', + 'ft', + 'TodoTelescope initial_mode=normal sort_mru=true sort_lastused=true select_current=true', + opts('Find todos') +) +keymap.set( + 'n', + 'fb', + 'Telescope buffers initial_mode=normal sort_mru=true sort_lastused=true select_current=true', + opts('Select from open buffers') +) +keymap.set( + 'n', + 'fn', + 'Telescope find_files cwd=' .. vim.fn.stdpath('config') .. '', + opts('Edit nvim config') +) +keymap.set('n', 'fm', 'NoiceTelescope', opts('Open messages with Telescope')) -- ──────────────────────────────────────────────────────( run code )─ +keymap.set('n', 'cr', 'MdEval', opts('Execute markdown codeblock')) keymap.set('n', 'x', 'source %', opts('Execute the current file')) keymap.set('n', 'cx', ':.lua', opts('Execute current line')) keymap.set('v', 'cx', ':lua', opts('Execute selected code')) -- ────────────────────────────────────────────────────( formatting )─ -keymap.set({ 'n', 'v' }, 'F', function() +keymap.set({ 'n', 'v' }, 'cF', function() require('conform').format({ lsp_fallback = true, async = false, @@ -29,7 +66,7 @@ keymap.set({ 'n', 'v' }, 'F', function() end, opts('Format file or selection')) -- ───────────────────────────────────────────────────────( linting )─ -keymap.set('n', 'l', function() +keymap.set('n', 'cl', function() require('lint').try_lint() end, opts('Trigger linting for current file')) @@ -37,6 +74,16 @@ end, opts('Trigger linting for current file')) keymap.set('n', '+', '', opts('Increment number')) keymap.set('n', '-', '', opts('Decrement number')) +-- ────────────────────────────────────────────────────( bufferline )─ +keymap.set('n', 'bp', 'BufferLineTogglePin', opts('Toggle pinned tab')) +keymap.set('n', 'bg', 'BufferLinePick', opts('Pick tab')) +keymap.set('n', 'bx', 'bdelete', opts('Close tab')) +keymap.set('n', 'bX', 'BufferLineCloseOthers', opts('Close other tabs')) +keymap.set('n', ']b', 'BufferLineCycleNext', opts('Next tab')) +keymap.set('n', '[b', 'BufferLineCyclePrev', opts('Previous tab')) +keymap.set('n', '', 'BufferLineMoveNext', opts('Move tab to the right')) +keymap.set('n', '', 'BufferLineMovePrev', opts('Move tab to the left')) + -- ──────────────────────────────────────────────( split management )─ keymap.set('n', 'sv', 'v', opts('Split window vertically')) keymap.set('n', 'sh', 's', opts('Split window horizontally')) @@ -51,16 +98,6 @@ keymap.set('n', 'tx', 'tabclose', opts('Close current tab')) -- keymap.set("n", "tp", "tabp", opts("Go to previous tab")) keymap.set('n', 'tf', 'tabnew %', opts('Open current buffer in new tab')) --- ────────────────────────────────────────────────────( bufferline )─ -keymap.set('n', 'bp', 'BufferLineTogglePin', opts('Toggle pinned tab')) -keymap.set('n', 'bg', 'BufferLinePick', opts('Pick tab')) -keymap.set('n', 'bx', 'bdelete', opts('Close tab')) -keymap.set('n', 'bX', 'BufferLineCloseOthers', opts('Close other tabs')) -keymap.set('n', ']b', 'BufferLineCycleNext', opts('Next tab')) -keymap.set('n', '[b', 'BufferLineCyclePrev', opts('Previous tab')) -keymap.set('n', '', 'BufferLineMoveNext', opts('Move tab to the right')) -keymap.set('n', '', 'BufferLineMovePrev', opts('Move tab to the left')) - -- ────────────────────────────────────────────( session management )─ keymap.set('n', 'wa', 'SessionToggleAutoSave', opts('Toggle session autosave')) keymap.set('n', 'wD', 'Autosession delete', opts('Delete a session')) @@ -107,41 +144,6 @@ keymap.set( opts('Open todos in trouble') ) --- ─────────────────────────────────────────────────────( telescope )─ -keymap.set( - 'n', - 'ff', - 'Telescope find_files initial_mode=insert sort_mru=true sort_lastused=true select_current=true', - opts('Fuzzy find files in cwd') -) -keymap.set( - 'n', - 'fr', - 'Telescope oldfiles initial_mode=insert sort_mru=true sort_lastused=true select_current=true', - opts('Fuzzy find recent files') -) -keymap.set('n', 'fs', 'Telescope current_buffer_fuzzy_find', opts('Find string in this buffer')) -keymap.set('n', 'fS', 'Telescope live_grep', opts('Find string in cwd')) -keymap.set('n', 'fc', 'Telescope grep_string', opts('Find string under cursor in cwd')) -keymap.set( - 'n', - 'ft', - 'TodoTelescope initial_mode=normal sort_mru=true sort_lastused=true select_current=true', - opts('Find todos') -) -keymap.set( - 'n', - 'fb', - 'Telescope buffers initial_mode=normal sort_mru=true sort_lastused=true select_current=true', - opts('Select from open buffers') -) -keymap.set( - 'n', - 'fn', - 'Telescope find_files cwd=' .. vim.fn.stdpath('config') .. '', - opts('Edit nvim config') -) - -- ────────────────────────────────────────────────────( substitute )─ keymap.set('n', 's', function() require('substitute').operator() @@ -156,7 +158,7 @@ keymap.set('x', 's', function() require('substitute').visual() end, opts('Substitute in visual mode')) --- ─────────────────────────────────────────────────────( nvim-tree )─ +-- ──────────────────────────────────────────────────( file browser )─ keymap.set('n', 'ee', 'NvimTreeToggle', opts('Toggle file explorer')) keymap.set('n', 'ef', 'NvimTreeFindFileToggle', opts('Toggle file explorer on current file')) keymap.set('n', 'ec', 'NvimTreeCollapse', opts('Collapse file explorer')) @@ -171,10 +173,10 @@ end, opts('Diff this')) keymap.set('n', 'hD', function() require('gitsigns').diffthis('~') end, opts('Diff this ~')) +vim.keymap.set('n', 'hw', 'Gitsigns toggle_word_diff', opts('Toggle word diff')) -- ───────────────────────────────────────────────────────────( git )─ keymap.set('n', 'Lg', 'LazyGit', opts('Open LazyGit')) -vim.keymap.set('n', 'hw', 'Gitsigns toggle_word_diff', opts('Toggle word diff')) keymap.set('n', ']h', function() require('gitsigns').nav_hunk('next') end, opts('Next hunk')) @@ -227,9 +229,6 @@ keymap.set('n', 'cp', 'CccPick', opts('Open color picker')) keymap.set({ 'n', 'v' }, 'cv', 'CccConvert', opts('Convert color')) keymap.set('n', 'cc', 'CccHighlighterToggle', opts('Toggle rendered colors')) --- ──────────────────────────────────────────────────────( markdown )─ -keymap.set('n', 'cr', 'MdEval', opts('Execute markdown codeblock')) - -- ────────────────────────────────────────────────────( spellcheck )─ keymap.set('n', 'S', function() if vim.wo.spell then @@ -244,4 +243,4 @@ keymap.set('i', '', function() else vim.opt_local.spell = true end -end, opts('Toggle spell check')) \ No newline at end of file +end, opts('Toggle spell check')) diff --git a/.config/nvim/lua/core/options.lua b/.config/nvim/lua/core/options.lua index c9d3cc4..bef5650 100644 --- a/.config/nvim/lua/core/options.lua +++ b/.config/nvim/lua/core/options.lua @@ -22,14 +22,6 @@ o.number = true o.relativenumber = true -- ──────────────────────────────────────────────────── sign column ── o.signcolumn = 'yes' --- ─────────────────────────────────────────────────────── markdown ── -vim.api.nvim_create_autocmd('BufWinEnter', { - pattern = { '*.md' }, - callback = function() - o.colorcolumn = '+1,+2' - o.textwidth = 80 - end, -}) -- ──────────────────────────────────────────────────── cursor line ── o.cursorline = true -- o.scrolloff = 999 -- keep cursor line centered @@ -95,4 +87,4 @@ o.ignorecase = true o.smartcase = true o.iskeyword:append('-') -- consider string-string as a whole word -- ───────────────────────────────────────────────────── completion ── -o.completeopt = 'menu,preview,noselect' +o.completeopt = 'menu,preview,noselect' \ No newline at end of file diff --git a/.config/nvim/lua/plugins/autocomplete.lua b/.config/nvim/lua/plugins/autocomplete.lua index fcb6636..8f7c1b2 100644 --- a/.config/nvim/lua/plugins/autocomplete.lua +++ b/.config/nvim/lua/plugins/autocomplete.lua @@ -182,12 +182,11 @@ return { }, }) - -- FIX: on my Arch laptop, 't' as first character on cmdline escapes - -- the cmdline and destructively prints xx:xx to the document cmp.setup.cmdline(':', { enabled = function() local disabled = { -- list of commands to disable completions + wa = true, wq = true, wqa = true, } diff --git a/.config/nvim/lua/plugins/cloak.lua b/.config/nvim/lua/plugins/cloak.lua index b9ac321..2dc03ae 100644 --- a/.config/nvim/lua/plugins/cloak.lua +++ b/.config/nvim/lua/plugins/cloak.lua @@ -24,4 +24,4 @@ return { }, }, }, -} \ No newline at end of file +} diff --git a/.config/nvim/lua/plugins/dressing.lua b/.config/nvim/lua/plugins/dressing.lua index c44e383..7a269ca 100644 --- a/.config/nvim/lua/plugins/dressing.lua +++ b/.config/nvim/lua/plugins/dressing.lua @@ -1,15 +1,13 @@ return { 'stevearc/dressing.nvim', - dependencies = { - 'nvim-telescope/telescope.nvim', - }, event = 'VeryLazy', opts = { input = { enabled = true, - -- default_prompt = 'Prompt', prompt_align = 'left', + trim_prompt = 'true', insert_only = false, + -- start_mode = 'insert', start_in_insert = true, border = 'rounded', relative = 'cursor', @@ -27,9 +25,6 @@ return { [''] = 'HistoryNext', }, }, - override = function(conf) - return conf - end, }, select = { enabled = true, @@ -44,9 +39,11 @@ return { [''] = 'Confirm', }, }, - override = function(conf) - return conf - end, + }, + nui = { + win_options = { + winblend = 0.7, + }, }, }, -} \ No newline at end of file +} diff --git a/.config/nvim/lua/plugins/foldsigns.lua b/.config/nvim/lua/plugins/foldsigns.lua index 8a90d1c..443ac9b 100644 --- a/.config/nvim/lua/plugins/foldsigns.lua +++ b/.config/nvim/lua/plugins/foldsigns.lua @@ -9,4 +9,4 @@ return { seps = { '' }, }, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/fugitive.lua b/.config/nvim/lua/plugins/fugitive.lua index ac73869..ead2a44 100644 --- a/.config/nvim/lua/plugins/fugitive.lua +++ b/.config/nvim/lua/plugins/fugitive.lua @@ -1,4 +1,15 @@ return { 'tpope/vim-fugitive', - cmd = { 'Git', 'Gdiffsplit', 'Gedit', 'Gvdiffsplit', 'Gread', 'Gwrite', 'Ggrep', 'GMove', 'GDelete', 'GBrowse' }, -} \ No newline at end of file + cmd = { + 'Git', + 'Gdiffsplit', + 'Gedit', + 'Gvdiffsplit', + 'Gread', + 'Gwrite', + 'Ggrep', + 'GMove', + 'GDelete', + 'GBrowse', + }, +} diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 3d6b77c..248aac8 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -39,7 +39,8 @@ return { numhl = true, linehl = false, word_diff = false, - show_deleted = false, -- turning this off for now as it seems to be slowing down neovim on MBP + trouble = true, + show_deleted = false, watch_gitdir = { interval = 1000, follow_files = true, diff --git a/.config/nvim/lua/plugins/illuminate.lua b/.config/nvim/lua/plugins/illuminate.lua index 3099359..3d0a607 100644 --- a/.config/nvim/lua/plugins/illuminate.lua +++ b/.config/nvim/lua/plugins/illuminate.lua @@ -3,7 +3,7 @@ return { event = { 'BufReadPre', 'BufNewFile' }, opts = { providers = { - 'lsp', + 'nvim_lsp', 'treesitter', 'regex', }, @@ -14,6 +14,8 @@ return { 'man', 'markdown', 'md', + 'oil', + 'fugitive', }, under_cursor = true, min_count_to_highlight = 1, diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua index 6ffa55d..748a9e6 100644 --- a/.config/nvim/lua/plugins/indent-blankline.lua +++ b/.config/nvim/lua/plugins/indent-blankline.lua @@ -1,18 +1,18 @@ return { - "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPre", "BufNewFile" }, - main = "ibl", + 'lukas-reineke/indent-blankline.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + main = 'ibl', opts = { indent = { - char = "┊", + char = '┊', smart_indent_cap = true, highlight = { - "RainbowDelimiterCyan", -- #88c0d0 - "RainbowDelimiterBlue", -- #81a1c1 - "RainbowDelimiterGreen", -- #a3be8c - "RainbowDelimiterViolet", -- #b48ead - "RainbowDelimiterYellow", -- #ebcb8b - "RainbowDelimiterRed", -- #d08770 + 'RainbowDelimiterCyan', -- #88c0d0 + 'RainbowDelimiterBlue', -- #81a1c1 + 'RainbowDelimiterGreen', -- #a3be8c + 'RainbowDelimiterViolet', -- #b48ead + 'RainbowDelimiterYellow', -- #ebcb8b + 'RainbowDelimiterRed', -- #d08770 -- "RainbowDelimiterOrange", -- #d08770 }, }, @@ -21,22 +21,28 @@ return { show_start = true, show_end = true, -- highlight = { "Function", "Label" }, - char = "▎", + char = '▎', }, exclude = { filetypes = { - "lspinfo", - "checkhealth", - "help", - "man", - "gitcommit", - "TelescopePrompt", - "TelescopeResults", - "", - "dashboard", - "alpha", - "NvimTree", + 'lspinfo', + 'checkhealth', + 'help', + 'man', + 'gitcommit', + 'TelescopePrompt', + 'TelescopeResults', + '', + 'alpha', + 'NvimTree', + }, + buftypes = { + 'dashboard', + 'terminal', + 'nofile', + 'quickfix', + 'prompt', }, }, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/lazygit.lua b/.config/nvim/lua/plugins/lazygit.lua index 39eddff..235b965 100644 --- a/.config/nvim/lua/plugins/lazygit.lua +++ b/.config/nvim/lua/plugins/lazygit.lua @@ -1,13 +1,14 @@ return { - "kdheepak/lazygit.nvim", - cmd = { - "LazyGit", - "LazyGitConfig", - "LazyGitCurrentFile", - "LazyGitFilter", - "LazyGitFilterCurrentFile", - }, + -- TODO: replace with toggleterm or something similar.. + 'kdheepak/lazygit.nvim', dependencies = { - "nvim-lua/plenary.nvim", + 'nvim-lua/plenary.nvim', + }, + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', }, } diff --git a/.config/nvim/lua/plugins/linting.lua b/.config/nvim/lua/plugins/linting.lua index f0e0cbb..ec63360 100644 --- a/.config/nvim/lua/plugins/linting.lua +++ b/.config/nvim/lua/plugins/linting.lua @@ -1,25 +1,31 @@ return { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, + 'mfussenegger/nvim-lint', + event = { 'BufReadPre', 'BufNewFile' }, config = function() - local lint = require "lint" + local lint = require('lint') lint.linters_by_ft = { - markdown = { "markdownlint" }, - html = { "htmlhint" }, - json = { "jsonlint" }, - bash = { "shellcheck", "shellharden" }, - javascript = { "eslint_d" }, - typescript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - python = { "pylint" }, + markdown = { 'markdownlint' }, + html = { 'htmlhint' }, + json = { 'jsonlint' }, + sh = { 'shellcheck' }, + zsh = { 'shellcheck' }, + bash = { 'shellcheck' }, + javascript = { 'eslint_d', 'trivy' }, + typescript = { 'eslint_d' }, + python = { 'pylint', 'trivy' }, + ansible = { 'ansiblelint' }, + gitcommit = { 'gitlint' }, + docker = { 'trivy' }, + yaml = { 'yamllint' }, + editorconfig = { 'editorconfig-checker' }, + systemd = { 'systemdlint' }, } - local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) + local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true }) - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, { group = lint_augroup, callback = function() lint.try_lint() diff --git a/.config/nvim/lua/plugins/lsp/mason.lua b/.config/nvim/lua/plugins/lsp/mason.lua index 75367ce..9ab5508 100644 --- a/.config/nvim/lua/plugins/lsp/mason.lua +++ b/.config/nvim/lua/plugins/lsp/mason.lua @@ -51,7 +51,6 @@ return { mason_tool_installer.setup({ ensure_installed = { 'ansible-lint', - 'beautysh', 'black', 'eslint_d', 'gitlint', @@ -70,4 +69,4 @@ return { }, }) end, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index 18b4e81..bb5928a 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -84,7 +84,7 @@ return { prose.setup({ wpm = 200.0, - filetypes = { 'markdown', 'asciidoc' }, + filetypes = { 'markdown', 'asciidoc', 'text' }, placeholders = { words = nil, minutes = nil, @@ -165,6 +165,11 @@ return { }, }, lualine_x = { + --[[ { + require('noice').api.status.mode.get, + cond = require('noice').api.status.mode.has, + color = { fg = '#d08770' }, + }, ]] { -- show status when recording a macro function() @@ -272,7 +277,16 @@ return { lualine_b = { { 'navic', color_correction = 'nil' } }, lualine_c = {}, lualine_x = {}, - lualine_y = {}, + lualine_y = { + { + 'diagnostics', + sources = { 'nvim_lsp', 'nvim_workspace_diagnostic', 'nvim_diagnostic' }, + sections = { 'error', 'warn', 'info' }, + --symbols = { error = " ", warn = " ", info = " ", hint = "󰠠 " }, + colored = true, + always_visible = true, + }, + }, lualine_z = {}, }, inactive_winbar = {}, diff --git a/.config/nvim/lua/plugins/moveline.lua b/.config/nvim/lua/plugins/moveline.lua index dbbe54d..790f1d4 100644 --- a/.config/nvim/lua/plugins/moveline.lua +++ b/.config/nvim/lua/plugins/moveline.lua @@ -2,19 +2,19 @@ return { 'willothy/moveline.nvim', build = 'make', keys = { - { '', mode = 'n' }, { '', mode = 'n' }, - { '', mode = 'v' }, { '', mode = 'v' }, + { '', mode = 'n' }, + { '', mode = 'v' }, }, config = function() local moveline = require('moveline') local map = vim.keymap - map.set('n', '', moveline.up) - map.set('n', '', moveline.down) - map.set('v', '', moveline.block_up) - map.set('v', '', moveline.block_down) + map.set('n', '', moveline.up) + map.set('n', '', moveline.down) + map.set('v', '', moveline.block_up) + map.set('v', '', moveline.block_down) end, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/noice.lua b/.config/nvim/lua/plugins/noice.lua index 57ef4fb..3c24be0 100644 --- a/.config/nvim/lua/plugins/noice.lua +++ b/.config/nvim/lua/plugins/noice.lua @@ -8,22 +8,60 @@ return { render = 'compact', }, }, + 'nvim-treesitter/nvim-treesitter', }, event = 'VeryLazy', opts = { lsp = { - override = { - ['vim.lsp.util.convert_input_to_markdown_lines'] = true, - ['vim.lsp.util.stylize_markdown'] = true, - ['cmp.entry.get_documentation'] = true, + progress = { + enabled = true, + view = 'mini', }, + hover = { + enabled = true, + silent = true, + }, + signature = { + enabled = true, + trigger = true, + luasnip = true, + }, + message = { + enabled = true, + view = 'notify', + }, + documentation = { + view = 'hover', + opts = { + lang = 'markdown', + }, + }, + override = { + ['vim.lsp.util.convert_input_to_markdown_lines'] = false, + ['vim.lsp.util.stylize_markdown'] = false, + ['cmp.entry.get_documentation'] = false, + }, + }, + health = { + checker = true, }, presets = { bottom_search = true, command_palette = false, - long_message_to_split = true, - inc_rename = false, lsp_doc_border = true, }, + cmdline = { + enabled = true, + }, + messages = { + enabled = true, + view_error = 'notify', + view_warn = 'notify', + view_history = 'messages', + view_search = 'virtualtext', + }, + popupmenu = { + enabled = true, + }, }, -} \ No newline at end of file +} diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua index 3aabcbf..d0b823a 100644 --- a/.config/nvim/lua/plugins/nvim-tree.lua +++ b/.config/nvim/lua/plugins/nvim-tree.lua @@ -36,7 +36,7 @@ return { color = true, }, }, - git_placement = 'after', + git_placement = 'signcolumn', modified_placement = 'after', diagnostics_placement = 'signcolumn', padding = ' ', @@ -101,4 +101,4 @@ return { show_on_open_dirs = true, }, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua index f696693..81d80e6 100644 --- a/.config/nvim/lua/plugins/oil.lua +++ b/.config/nvim/lua/plugins/oil.lua @@ -1,134 +1,52 @@ return { 'stevearc/oil.nvim', - ---@module 'oil' - ---@type oil.SetupOpts dependencies = { 'nvim-tree/nvim-web-devicons' }, cmd = 'Oil', opts = { - -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) - -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories. - default_file_explorer = true, - -- Id is automatically added at the beginning, and name at the end + default_file_explorer = false, -- See :help oil-columns columns = { 'icon', - -- "permissions", - -- "size", - -- "mtime", }, - -- Buffer-local options to use for oil buffers buf_options = { buflisted = false, bufhidden = 'hide', }, - -- Window-local options to use for oil buffers win_options = { wrap = false, - signcolumn = 'no', - cursorcolumn = false, + signcolumn = 'yes', + cursorcolumn = true, foldcolumn = '0', spell = false, list = false, conceallevel = 3, concealcursor = 'nvic', }, - -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) - delete_to_trash = false, - -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) - skip_confirm_for_simple_edits = false, - -- Selecting a new/moved/renamed file or directory will prompt you to save changes first - -- (:help prompt_save_on_select_new_entry) + delete_to_trash = true, + skip_confirm_for_simple_edits = true, prompt_save_on_select_new_entry = true, - -- Oil will automatically delete hidden buffers after this delay - -- You can set the delay to false to disable cleanup entirely - -- Note that the cleanup process only starts when none of the oil buffers are currently displayed cleanup_delay_ms = 2000, - lsp_file_methods = { - -- Enable or disable LSP file operations - enabled = true, - -- Time to wait for LSP file operations to complete before skipping - timeout_ms = 1000, - -- Set to true to autosave buffers that are updated with LSP willRenameFiles - -- Set to "unmodified" to only save unmodified buffers - autosave_changes = false, - }, - -- Constrain the cursor to the editable parts of the oil buffer - -- Set to `false` to disable, or "name" to keep it on the file names - constrain_cursor = 'editable', - -- Set to true to watch the filesystem for changes and reload oil + constrain_cursor = 'name', watch_for_changes = false, - -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap - -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) - -- Additionally, if it is a string that matches "actions.", - -- it will use the mapping at require("oil.actions"). - -- Set to `false` to remove a keymap - -- See :help oil-actions for a list of all available actions - keymaps = { - ['g?'] = 'actions.show_help', - [''] = 'actions.select', - [''] = { 'actions.select', opts = { vertical = true }, desc = 'Open the entry in a vertical split' }, - [''] = { 'actions.select', opts = { horizontal = true }, desc = 'Open the entry in a horizontal split' }, - [''] = { 'actions.select', opts = { tab = true }, desc = 'Open the entry in new tab' }, - [''] = 'actions.preview', - [''] = 'actions.close', - [''] = 'actions.refresh', - ['-'] = 'actions.parent', - ['_'] = 'actions.open_cwd', - ['`'] = 'actions.cd', - ['~'] = { 'actions.cd', opts = { scope = 'tab' }, desc = ':tcd to the current oil directory', mode = 'n' }, - ['gs'] = 'actions.change_sort', - ['gx'] = 'actions.open_external', - ['g.'] = 'actions.toggle_hidden', - ['g\\'] = 'actions.toggle_trash', - }, - -- Set to false to disable all of the above keymaps use_default_keymaps = true, view_options = { - -- Show files and directories that start with "." - show_hidden = false, - -- This function defines what is considered a "hidden" file + show_hidden = true, is_hidden_file = function(name, bufnr) local m = name:match('^%.') return m ~= nil end, - -- This function defines what will never be shown, even when `show_hidden` is set is_always_hidden = function(name, bufnr) return false end, - -- Sort file names with numbers in a more intuitive order for humans. - -- Can be "fast", true, or false. "fast" will turn it off for large directories. natural_order = 'fast', - -- Sort file and directory names case insensitive case_insensitive = false, sort = { - -- sort order can be "asc" or "desc" - -- see :help oil-columns to see which columns are sortable - { 'type', 'asc' }, { 'name', 'asc' }, + { 'type', 'asc' }, }, - -- Customize the highlight group for the file name - highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan) - return nil - end, }, - -- Extra arguments to pass to SCP when moving/copying files over SSH extra_scp_args = {}, - -- EXPERIMENTAL support for performing file operations with git - git = { - -- Return true to automatically git add/mv/rm files - add = function(path) - return false - end, - mv = function(src_path, dest_path) - return false - end, - rm = function(path) - return false - end, - }, - -- Configuration for the floating window in oil.open_float float = { - -- Padding around the floating window padding = 2, max_width = 100, max_height = 50, @@ -136,71 +54,35 @@ return { win_options = { winblend = 0, }, - -- optionally override the oil buffers window title with custom function: fun(winid: integer): string get_win_title = nil, - -- preview_split: Split direction: "auto", "left", "right", "above", "below". - preview_split = 'auto', - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - override = function(conf) - return conf - end, + preview_split = 'right', }, - -- Configuration for the file preview window preview_win = { - -- Whether the preview window is automatically updated when the cursor is moved update_on_cursor_moved = true, - -- How to open the preview window "load"|"scratch"|"fast_scratch" preview_method = 'fast_scratch', - -- A function that returns true to disable preview on a file e.g. to avoid lag - disable_preview = function(filename) - return false - end, - -- Window-local options to use for preview window buffers win_options = {}, }, - -- Configuration for the floating action confirmation window confirmation = { - -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_width and max_width can be a single value or a list of mixed integer/float types. - -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" - max_width = 0.9, - -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" + max_width = 0.7, min_width = { 40, 0.4 }, - -- optionally define an integer/float for the exact width of the preview window - width = nil, - -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_height and max_height can be a single value or a list of mixed integer/float types. - -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" max_height = 0.9, - -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" min_height = { 5, 0.1 }, - -- optionally define an integer/float for the exact height of the preview window - height = nil, border = 'rounded', win_options = { winblend = 0, }, }, - -- Configuration for the floating progress window progress = { - max_width = 0.9, + max_width = 0.6, min_width = { 40, 0.4 }, - width = nil, max_height = { 10, 0.9 }, min_height = { 5, 0.1 }, - height = nil, border = 'rounded', minimized_border = 'none', - win_options = { - winblend = 0, - }, }, - -- Configuration for the floating SSH window ssh = { border = 'rounded', }, - -- Configuration for the floating keymaps help window keymaps_help = { border = 'rounded', }, diff --git a/.config/nvim/lua/plugins/outline.lua b/.config/nvim/lua/plugins/outline.lua index 3634157..33bc0df 100644 --- a/.config/nvim/lua/plugins/outline.lua +++ b/.config/nvim/lua/plugins/outline.lua @@ -1,13 +1,13 @@ return { - "hedyhli/outline.nvim", + 'hedyhli/outline.nvim', lazy = true, - cmd = { "Outline", "OutlineOpen" }, + cmd = { 'Outline', 'OutlineOpen' }, keys = { - { "o", "Outline", desc = "Toggle outline" }, + { 'o', 'Outline', desc = 'Toggle outline' }, }, opts = { outline_window = { - position = "right", + position = 'right', width = 25, relative_width = true, auto_close = false, @@ -18,75 +18,72 @@ return { hide_cursor = true, focus_on_open = false, }, - outline_items = { show_symbol_details = true, show_symbol_lineno = false, highlight_hovered_item = true, auto_set_cursor = true, auto_update_events = { - follow = { "CursorMoved" }, - items = { "InsertLeave", "WinEnter", "BufEnter", "BufWinEnter", "TabEnter", "BufWritePost" }, + follow = { 'CursorMoved' }, + items = { 'InsertLeave', 'WinEnter', 'BufEnter', 'BufWinEnter', 'TabEnter', 'BufWritePost' }, }, }, - keymaps = { - show_help = "?", - close = { "", "q" }, - goto_location = "", - peek_location = "o", - goto_and_close = "", - restore_location = "", - hover_symbol = "", - toggle_preview = "K", - rename_symbol = "r", - code_actions = "a", - fold = "h", - unfold = "l", - fold_toggle = "", - fold_toggle_all = "", - fold_all = "W", - unfold_all = "E", - fold_reset = "R", - down_and_jump = "", - up_and_jump = "", + show_help = '?', + close = { '', 'q' }, + goto_location = '', + peek_location = 'o', + goto_and_close = '', + restore_location = '', + hover_symbol = '', + toggle_preview = 'K', + rename_symbol = 'r', + code_actions = 'a', + fold = 'h', + unfold = 'l', + fold_toggle = '', + fold_toggle_all = '', + fold_all = 'W', + unfold_all = 'E', + fold_reset = 'R', + down_and_jump = '', + up_and_jump = '', }, - symbols = { icons = { - File = { icon = "󰈔", hl = "Identifier" }, - Module = { icon = "󰆧", hl = "Include" }, - Namespace = { icon = "󰅪", hl = "Include" }, - Package = { icon = "󰏗", hl = "Include" }, - Class = { icon = "𝓒", hl = "Type" }, - Method = { icon = "ƒ", hl = "Function" }, - Property = { icon = "", hl = "Identifier" }, - Field = { icon = "󰆨", hl = "Identifier" }, - Constructor = { icon = "", hl = "Special" }, - Enum = { icon = "ℰ", hl = "Type" }, - Interface = { icon = "󰜰", hl = "Type" }, - Function = { icon = "ƒ", hl = "Function" }, - Variable = { icon = "", hl = "Constant" }, - Constant = { icon = "", hl = "Constant" }, - String = { icon = "𝓐", hl = "String" }, - Number = { icon = "#", hl = "Number" }, - Boolean = { icon = "⊨", hl = "Boolean" }, - Array = { icon = "󰅪", hl = "Constant" }, - Object = { icon = "⦿", hl = "Type" }, - Key = { icon = "🔐", hl = "Type" }, - Null = { icon = "NULL", hl = "Type" }, - EnumMember = { icon = "", hl = "Identifier" }, - Struct = { icon = "𝓢", hl = "Structure" }, - Event = { icon = "🗲", hl = "Type" }, - Operator = { icon = "+", hl = "Identifier" }, - TypeParameter = { icon = "𝙏", hl = "Identifier" }, - Component = { icon = "󰅴", hl = "Function" }, - Fragment = { icon = "󰅴", hl = "Constant" }, - TypeAlias = { icon = " ", hl = "Type" }, - Parameter = { icon = " ", hl = "Identifier" }, - StaticMethod = { icon = " ", hl = "Function" }, - Macro = { icon = " ", hl = "Function" }, + File = { icon = '󰈔', hl = 'Identifier' }, + Module = { icon = '󰆧', hl = 'Include' }, + Namespace = { icon = '󰅪', hl = 'Include' }, + Package = { icon = '󰏗', hl = 'Include' }, + Class = { icon = '𝓒', hl = 'Type' }, + Method = { icon = 'ƒ', hl = 'Function' }, + Property = { icon = '', hl = 'Identifier' }, + Field = { icon = '󰆨', hl = 'Identifier' }, + Constructor = { icon = '', hl = 'Special' }, + Enum = { icon = 'ℰ', hl = 'Type' }, + Interface = { icon = '󰜰', hl = 'Type' }, + Function = { icon = 'ƒ', hl = 'Function' }, + Variable = { icon = '', hl = 'Constant' }, + Constant = { icon = '', hl = 'Constant' }, + String = { icon = '𝓐', hl = 'String' }, + Number = { icon = '#', hl = 'Number' }, + Boolean = { icon = '⊨', hl = 'Boolean' }, + Array = { icon = '󰅪', hl = 'Constant' }, + Object = { icon = '⦿', hl = 'Type' }, + Key = { icon = '🔐', hl = 'Type' }, + Null = { icon = 'NULL', hl = 'Type' }, + EnumMember = { icon = '', hl = 'Identifier' }, + Struct = { icon = '𝓢', hl = 'Structure' }, + Event = { icon = '🗲', hl = 'Type' }, + Operator = { icon = '+', hl = 'Identifier' }, + TypeParameter = { icon = '𝙏', hl = 'Identifier' }, + Component = { icon = '󰅴', hl = 'Function' }, + Fragment = { icon = '󰅴', hl = 'Constant' }, + TypeAlias = { icon = ' ', hl = 'Type' }, + Parameter = { icon = ' ', hl = 'Identifier' }, + StaticMethod = { icon = ' ', hl = 'Function' }, + Macro = { icon = ' ', hl = 'Function' }, }, }, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/prettier.lua b/.config/nvim/lua/plugins/prettier.lua index dfaa806..1dea3f2 100644 --- a/.config/nvim/lua/plugins/prettier.lua +++ b/.config/nvim/lua/plugins/prettier.lua @@ -1,32 +1,35 @@ return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - - config = function() - local conform = require "conform" - - conform.setup { - formatters_by_ft = { - javascript = { "prettier" }, - typescript = { "prettier" }, - javascriptreact = { "prettier" }, - typescriptreact = { "prettier" }, - svelte = { "prettier" }, - css = { "prettier" }, - html = { "prettier" }, - json = { "prettier" }, - yaml = { "prettier" }, - markdown = { "prettier" }, - graphql = { "prettier" }, - liquid = { "prettier" }, - lua = { "stylua" }, - python = { "sort", "black" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, - timeout_ms = 1000, - }, - } - end, + 'stevearc/conform.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + opts = { + formatters_by_ft = { + sh = { 'shellharden', 'shfmt' }, + bash = { 'shellharden', 'shfmt' }, + zsh = { 'shellharden', 'shfmt' }, + javascript = { 'prettier' }, + typescript = { 'prettier' }, + css = { 'prettier' }, + html = { 'prettier' }, + json = { 'prettier' }, + yaml = { 'prettier' }, + markdown = { 'markdownlint', 'prettier' }, + graphql = { 'prettier' }, + liquid = { 'prettier' }, + lua = { 'stylua' }, + python = { 'black', 'sort' }, + }, + formatters = { + --[[ shfmt = { + prepend_args = { '-i', '6' }, + }, ]] + }, + default_format_opts = { + lsp_format = 'fallback', + }, + format_on_save = { + lsp_format = 'fallback', + async = false, + timeout_ms = 1000, + }, + }, } diff --git a/.config/nvim/lua/plugins/rainbow-delimiters.lua b/.config/nvim/lua/plugins/rainbow-delimiters.lua index 7088ce3..d3a22d9 100644 --- a/.config/nvim/lua/plugins/rainbow-delimiters.lua +++ b/.config/nvim/lua/plugins/rainbow-delimiters.lua @@ -1,21 +1,25 @@ return { - "hiphish/rainbow-delimiters.nvim", - event = { "BufReadPre", "BufNewFile" }, + 'hiphish/rainbow-delimiters.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + main = 'rainbow-delimiters.setup', opts = { - strategy = {}, - query = {}, highlight = { - "RainbowDelimiterCyan", - "RainbowDelimiterBlue", - "RainbowDelimiterGreen", - "RainbowDelimiterViolet", - "RainbowDelimiterYellow", - "RainbowDelimiterRed", - "RainbowDelimiterOrange", + 'RainbowDelimiterCyan', + 'RainbowDelimiterBlue', + 'RainbowDelimiterGreen', + 'RainbowDelimiterViolet', + 'RainbowDelimiterYellow', + 'RainbowDelimiterRed', + 'RainbowDelimiterOrange', + }, + query = { + [''] = 'rainbow-delimiters', + lua = 'rainbow-blocks', + help = 'rainbow-blocks', + query = function(bufnr) + local is_nofile = vim.bo[bufnr].buftype == 'nofile' + return is_nofile and 'rainbow-blocks' or 'rainbow-delimiters' + end, }, }, - - config = function(_, opts) - require("rainbow-delimiters.setup").setup(opts) - end, } diff --git a/.config/nvim/lua/plugins/substitute.lua b/.config/nvim/lua/plugins/substitute.lua index ce9f752..81108a4 100644 --- a/.config/nvim/lua/plugins/substitute.lua +++ b/.config/nvim/lua/plugins/substitute.lua @@ -1,5 +1,10 @@ return { - 'gbprod/substitute.nvim', - event = { 'BufReadPre', 'BufNewFile' }, - opts = {}, -} \ No newline at end of file + 'gbprod/substitute.nvim', + event = { 'BufReadPre', 'BufNewFile' }, + opts = { + highlight_substituted_text = { + enabled = true, + timer = 800, + }, + }, +} diff --git a/.config/nvim/lua/plugins/telescope-yadm.lua b/.config/nvim/lua/plugins/telescope-yadm.lua deleted file mode 100644 index 87d8b55..0000000 --- a/.config/nvim/lua/plugins/telescope-yadm.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - -- does the same thing as git_files, but for yadm - 'pschmitt/telescope-yadm.nvim', - dependencies = { - 'nvim-telescope/telescope.nvim', - }, - enabled = true, - event = 'VeryLazy', - - config = function(_, opts) - local telescope = require('telescope') - - telescope.setup(opts) - telescope.load_extension('yadm_files') - telescope.load_extension('git_or_files') - telescope.load_extension('git_or_yadm_files') - end, -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index e26e866..483b1fc 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -3,9 +3,11 @@ return { branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim', - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, 'nvim-tree/nvim-web-devicons', + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, 'folke/todo-comments.nvim', + 'pschmitt/telescope-yadm.nvim', + { 'nvim-telescope/telescope-media-files.nvim', dependencies = 'nvim-lua/popup.nvim' }, }, event = 'VeryLazy', config = function() @@ -51,9 +53,16 @@ return { }, extensions = { fzf = {}, + media_files = { + find_cmd = 'rg', + }, }, }) telescope.load_extension('fzf') + telescope.load_extension('media_files') + telescope.load_extension('yadm_files') + telescope.load_extension('git_or_files') + telescope.load_extension('git_or_yadm_files') end, } diff --git a/.config/nvim/lua/plugins/tint.lua b/.config/nvim/lua/plugins/tint.lua index 74d84dd..ee3abf6 100644 --- a/.config/nvim/lua/plugins/tint.lua +++ b/.config/nvim/lua/plugins/tint.lua @@ -15,8 +15,4 @@ return { return buftype == 'terminal' or floating end, }, - - config = function(_, opts) - require('tint').setup(opts) - end, } diff --git a/.config/nvim/lua/plugins/tmux-navigator.lua b/.config/nvim/lua/plugins/tmux-navigator.lua index d732e61..1611c12 100644 --- a/.config/nvim/lua/plugins/tmux-navigator.lua +++ b/.config/nvim/lua/plugins/tmux-navigator.lua @@ -1,17 +1,17 @@ return { - "christoomey/vim-tmux-navigator", + 'christoomey/vim-tmux-navigator', cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', }, keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/todo-comments.lua b/.config/nvim/lua/plugins/todo-comments.lua index 0d08786..0c2a556 100644 --- a/.config/nvim/lua/plugins/todo-comments.lua +++ b/.config/nvim/lua/plugins/todo-comments.lua @@ -1,9 +1,6 @@ return { - "folke/todo-comments.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { "nvim-lua/plenary.nvim" }, - - config = function() - require("todo-comments").setup() - end, + 'folke/todo-comments.nvim', + dependencies = { 'nvim-lua/plenary.nvim' }, + event = { 'BufReadPre', 'BufNewFile' }, + opts = {}, } diff --git a/.config/nvim/lua/plugins/treesitter/treesitter.lua b/.config/nvim/lua/plugins/treesitter/treesitter.lua index 4bcc3b4..0fb6e16 100644 --- a/.config/nvim/lua/plugins/treesitter/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter/treesitter.lua @@ -43,11 +43,11 @@ return { incremental_selection = { enable = true, keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = false, + init_selection = 'gnn', + node_incremental = 'grn', + scope_incremental = 'grc', node_decremental = '', }, }, }, -} \ No newline at end of file +} diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua index cb20e4d..a615509 100644 --- a/.config/nvim/lua/plugins/trouble.lua +++ b/.config/nvim/lua/plugins/trouble.lua @@ -2,10 +2,22 @@ return { 'folke/trouble.nvim', dependencies = { 'nvim-tree/nvim-web-devicons', - 'folke/todo-comments.nvim', }, cmd = 'Trouble', opts = { focus = false, + warn_no_results = false, + open_no_results = true, + auto_close = false, + auto_open = false, + auto_preview = true, + auto_refresh = true, + auto_jump = false, + restore = true, + follow = true, + indent_guides = true, + max_items = 200, + multiline = true, + pinned = false, }, -} +} \ No newline at end of file diff --git a/.config/nvim/lua/plugins/vim-maximizer.lua b/.config/nvim/lua/plugins/vim-maximizer.lua index e1bde99..3477edf 100644 --- a/.config/nvim/lua/plugins/vim-maximizer.lua +++ b/.config/nvim/lua/plugins/vim-maximizer.lua @@ -1,4 +1,4 @@ return { - 'szw/vim-maximizer', - event = { 'BufReadPre', 'BufNewFile' }, + 'szw/vim-maximizer', + event = { 'BufReadPre', 'BufNewFile' }, } diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua index 9310464..5370867 100644 --- a/.config/nvim/lua/plugins/which-key.lua +++ b/.config/nvim/lua/plugins/which-key.lua @@ -1,13 +1,18 @@ return { 'folke/which-key.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, event = 'VeryLazy', init = function() vim.o.timeout = true - vim.o.timeoutlen = 500 + vim.o.timeoutlen = 800 end, opts = { preset = 'modern', -- may set this back to 'classic' - sort = { 'local', 'order', 'group', 'alphanum', 'mod' }, + sort = { 'local', 'order', 'group', 'case', 'alphanum', 'mod' }, + expand = 2, + delay = 200, notify = true, win = { title = true, @@ -21,6 +26,15 @@ return { enabled = true, suggestions = 20, }, + presets = { + operators = true, + motions = true, + text_objects = true, + windows = true, + nav = true, + z = true, + g = true, + }, }, }, }