From 403aa74f8ad7fab227c3dd282ac9143da9b25b7b Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sat, 6 Jul 2024 23:24:35 +0300 Subject: Neovim: refactored a bunch more files into a more organized structure, and changed some configurations --- .config/nvim/lua/custom/plugins/TODO-alpha.lua | 68 ------- .../nvim/lua/custom/plugins/TODO-auto-session.lua | 12 -- .config/nvim/lua/custom/plugins/TODO-autopair.lua | 5 - .config/nvim/lua/custom/plugins/TODO-color.lua | 13 -- .config/nvim/lua/custom/plugins/TODO-comment.lua | 27 --- .config/nvim/lua/custom/plugins/TODO-dap.lua | 27 +++ .config/nvim/lua/custom/plugins/TODO-debug.lua | 27 --- .config/nvim/lua/custom/plugins/TODO-edgy.lua | 2 +- .config/nvim/lua/custom/plugins/TODO-ftFT.lua | 8 - .../nvim/lua/custom/plugins/TODO-illuminate.lua | 6 - .../lua/custom/plugins/TODO-indent-blankline.lua | 8 - .config/nvim/lua/custom/plugins/TODO-lazydev.lua | 5 +- .config/nvim/lua/custom/plugins/TODO-leap.lua | 16 -- .config/nvim/lua/custom/plugins/TODO-lightbulb.lua | 20 -- .config/nvim/lua/custom/plugins/TODO-lualine.lua | 12 -- .config/nvim/lua/custom/plugins/TODO-neoclip.lua | 22 --- .config/nvim/lua/custom/plugins/TODO-noice.lua | 204 --------------------- .config/nvim/lua/custom/plugins/TODO-obsidian.lua | 15 -- .../nvim/lua/custom/plugins/TODO-statusline.lua | 12 ++ .config/nvim/lua/custom/plugins/TODO-surround.lua | 21 --- .../nvim/lua/custom/plugins/TODO-time-tracking.lua | 4 - .../lua/custom/plugins/TODO-vim-tmux-navigator.lua | 7 - .config/nvim/lua/custom/plugins/alpha.lua | 68 +++++++ .config/nvim/lua/custom/plugins/motions.lua | 80 ++++++++ .config/nvim/lua/custom/plugins/ui.lua | 56 ++++++ .config/nvim/lua/custom/plugins/utility.lua | 40 ++++ 26 files changed, 285 insertions(+), 500 deletions(-) delete mode 100644 .config/nvim/lua/custom/plugins/TODO-alpha.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-auto-session.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-autopair.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-color.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-comment.lua create mode 100644 .config/nvim/lua/custom/plugins/TODO-dap.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-debug.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-ftFT.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-illuminate.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-indent-blankline.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-leap.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-lightbulb.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-lualine.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-neoclip.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-noice.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-obsidian.lua create mode 100644 .config/nvim/lua/custom/plugins/TODO-statusline.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-surround.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-time-tracking.lua delete mode 100644 .config/nvim/lua/custom/plugins/TODO-vim-tmux-navigator.lua create mode 100644 .config/nvim/lua/custom/plugins/alpha.lua create mode 100644 .config/nvim/lua/custom/plugins/motions.lua create mode 100644 .config/nvim/lua/custom/plugins/ui.lua create mode 100644 .config/nvim/lua/custom/plugins/utility.lua (limited to '.config/nvim') diff --git a/.config/nvim/lua/custom/plugins/TODO-alpha.lua b/.config/nvim/lua/custom/plugins/TODO-alpha.lua deleted file mode 100644 index e1b9532..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-alpha.lua +++ /dev/null @@ -1,68 +0,0 @@ -return { - 'goolord/alpha-nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - config = function() - local alpha = require('alpha') - local dashboard = require('alpha.themes.dashboard') - - local function get_natural_day(day) - local suffix = 'th' - local day_mod = day % 10 - - if day_mod == 1 and day ~= 11 then - suffix = 'st' - elseif day_mod == 2 and day ~= 12 then - suffix = 'nd' - elseif day_mod == 3 and day ~= 13 then - suffix = 'rd' - end - - return tostring(day) .. suffix - end - - local find_file_path = '$HOME' - local date = os.date('  %A, %B ') .. get_natural_day(tonumber(os.date('%d'))) - local plugins = '  ' .. require('lazy').stats().count .. ' plugins ' - local v = vim.version() - local version = '  v' .. v.major .. '.' .. v.minor .. '.' .. v.patch - local info_line = date .. plugins .. version - - -- WARN: Just hardcoded the length of the first line in the header - local header_length = #'  ' - local padding = (header_length - #info_line) / 2 - info_line = string.rep(' ', padding) .. info_line - - dashboard.section.header.val = { - [[  ]], - [[ ████ ██████ █████ ██ ██ ]], - [[ ███████████ █████ ███ ]], - [[ █████████ ███████████████████ ███ ███████████ ]], - [[ █████████ ███ █████████████ █████ ██████████████ ]], - [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], - [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], - [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], - [[ ]], - info_line, - } - - dashboard.section.buttons.opts.spacing = 0 - dashboard.section.buttons.val = { - dashboard.button('e', ' > New file', 'ene startinsert'), - dashboard.button('w', ' > Find file', 'cd ' .. find_file_path .. ' | Telescope find_files'), - dashboard.button('r', ' > Recent', 'Telescope oldfiles'), - dashboard.button('c', ' > Configuration', 'e $MYVIMRC | cd %:p:h'), - dashboard.button( - 's', - '󱎠 > Last Session', - 'lua require("auto-session.session-lens.actions").alternate_session()' - ), - dashboard.button('q', '󰈆 > Quit NVIM', 'qa'), - } - - dashboard.section.footer.val = require('alpha.fortune')() - - alpha.setup(dashboard.opts) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-auto-session.lua b/.config/nvim/lua/custom/plugins/TODO-auto-session.lua deleted file mode 100644 index bf4fa27..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-auto-session.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'rmagatti/auto-session', - config = function() - vim.opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions' - require('auto-session').setup({ - log_level = 'error', - auto_session_suppress_dirs = { '~/', '/' }, - }) - local session = require('auto-session.session-lens') - vim.keymap.set('n', '', session.search_session, { desc = '[S]ession Manager' }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-autopair.lua b/.config/nvim/lua/custom/plugins/TODO-autopair.lua deleted file mode 100644 index c51bf19..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-autopair.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - config = true, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-color.lua b/.config/nvim/lua/custom/plugins/TODO-color.lua deleted file mode 100644 index 0597733..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-color.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - 'uga-rosa/ccc.nvim', - lazy = false, - config = function() - require('ccc').setup({ - highlighter = { - auto_enable = true, - }, - }) - vim.keymap.set('n', 'cp', ':CccPick', { desc = '[C]olor [P]icker' }) - vim.keymap.set('n', 'ct', ':CccHighlighterToggle', { desc = '[C]olor [T]oggle' }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-comment.lua b/.config/nvim/lua/custom/plugins/TODO-comment.lua deleted file mode 100644 index 02eb39d..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-comment.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - 'numToStr/Comment.nvim', - opts = { - padding = true, - ignore = nil, - - toggler = { line = 'gcc', block = 'gbc' }, - opleader = { line = 'gc', block = 'gb' }, - extra = { above = 'gcO', below = 'gco', eol = 'gcA' }, - - mappings = { - basic = true, -- `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` - extra = false, -- `gco`, `gcO`, `gcA` - }, - }, - config = function() - local api = require('Comment.api') - local esc = vim.api.nvim_replace_termcodes('', true, false, true) - local toggole_linewise_selection = function() - vim.api.nvim_feedkeys(esc, 'nx', false) - api.toggle.linewise(vim.fn.visualmode()) - end - - vim.keymap.set('n', '', api.toggle.linewise.current, { noremap = true, silent = true }) - vim.keymap.set('v', '', toggole_linewise_selection, { noremap = true, silent = true }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-dap.lua b/.config/nvim/lua/custom/plugins/TODO-dap.lua new file mode 100644 index 0000000..191dd33 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/TODO-dap.lua @@ -0,0 +1,27 @@ +return { + 'mfussenegger/nvim-dap', + dependencies = { + 'rcarriga/nvim-dap-ui', + 'nvim-neotest/nvim-nio', -- dependency for nvim-dap-ui + }, + config = function() + local dap = require('dap') + local dapui = require('dapui') + + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + + vim.keymap.set('n', 'bp', dap.toggle_breakpoint, { desc = 'Set [B]reak[p]oint (toggle)' }) + vim.keymap.set('n', 'dd', dap.continue, { desc = '[D]ebugger [D]ebug (start)' }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/TODO-debug.lua b/.config/nvim/lua/custom/plugins/TODO-debug.lua deleted file mode 100644 index 191dd33..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-debug.lua +++ /dev/null @@ -1,27 +0,0 @@ -return { - 'mfussenegger/nvim-dap', - dependencies = { - 'rcarriga/nvim-dap-ui', - 'nvim-neotest/nvim-nio', -- dependency for nvim-dap-ui - }, - config = function() - local dap = require('dap') - local dapui = require('dapui') - - dap.listeners.before.attach.dapui_config = function() - dapui.open() - end - dap.listeners.before.launch.dapui_config = function() - dapui.open() - end - dap.listeners.before.event_terminated.dapui_config = function() - dapui.close() - end - dap.listeners.before.event_exited.dapui_config = function() - dapui.close() - end - - vim.keymap.set('n', 'bp', dap.toggle_breakpoint, { desc = 'Set [B]reak[p]oint (toggle)' }) - vim.keymap.set('n', 'dd', dap.continue, { desc = '[D]ebugger [D]ebug (start)' }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-edgy.lua b/.config/nvim/lua/custom/plugins/TODO-edgy.lua index 7f01245..ab91d31 100644 --- a/.config/nvim/lua/custom/plugins/TODO-edgy.lua +++ b/.config/nvim/lua/custom/plugins/TODO-edgy.lua @@ -4,7 +4,7 @@ return { opts = { bottom = { 'Trouble', - { ft = 'qf', title = 'QuickFix' }, + { ft = 'qf', title = 'QuickFix' }, { ft = 'help', size = { height = 20 }, diff --git a/.config/nvim/lua/custom/plugins/TODO-ftFT.lua b/.config/nvim/lua/custom/plugins/TODO-ftFT.lua deleted file mode 100644 index fcf37d8..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-ftFT.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "gukz/ftFT.nvim", - opts = { - keys = { "f", "t", "F", "T" }, - modes = {"n", "v"}, - }, - config = true, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-illuminate.lua b/.config/nvim/lua/custom/plugins/TODO-illuminate.lua deleted file mode 100644 index ae99f39..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-illuminate.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - 'RRethy/vim-illuminate', - config = function() - vim.keymap.set('n', 'it', ':IlluminateToggle', { desc = '[I]lluminate [Tloggle]' }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-indent-blankline.lua b/.config/nvim/lua/custom/plugins/TODO-indent-blankline.lua deleted file mode 100644 index 7130fbb..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-indent-blankline.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - 'lukas-reineke/indent-blankline.nvim', - main = 'ibl', - opts = {}, - config = function() - require('ibl').setup() - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-lazydev.lua b/.config/nvim/lua/custom/plugins/TODO-lazydev.lua index ab0de90..988bf32 100644 --- a/.config/nvim/lua/custom/plugins/TODO-lazydev.lua +++ b/.config/nvim/lua/custom/plugins/TODO-lazydev.lua @@ -1,4 +1,5 @@ return { + { 'Bilal2453/luvit-meta', lazy = true }, { 'folke/lazydev.nvim', ft = 'lua', @@ -8,8 +9,4 @@ return { }, }, }, - { - 'Bilal2453/luvit-meta', - lazy = true, - }, } diff --git a/.config/nvim/lua/custom/plugins/TODO-leap.lua b/.config/nvim/lua/custom/plugins/TODO-leap.lua deleted file mode 100644 index 3c4e99e..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-leap.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - 'ggandor/leap.nvim', - dependencies = { "tpope/vim-repeat" }, - config = function() - vim.keymap.set({ 'n', 'x', 'o' }, 's', '(leap-forward)') - vim.keymap.set({ 'n', 'x', 'o' }, 'S', '(leap-backward)') - vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '(leap-from-window)') - - -- Define equivalence classes for brackets and quotes, in addition to - -- the default whitespace group. - require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' } - - -- Set background to gray in searchable area - vim.api.nvim_set_hl(0, 'LeapBackdrop', { fg = '#777777' }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-lightbulb.lua b/.config/nvim/lua/custom/plugins/TODO-lightbulb.lua deleted file mode 100644 index 29aeffb..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-lightbulb.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - 'kosayoda/nvim-lightbulb', - config = function() - require('nvim-lightbulb').setup({ - autocmd = { - enabled = true, - updatetime = 50, - }, - action_kinds = { 'quickfix', 'refactor.rewrite' }, - sign = { enabled = false }, - virtual_text = { enabled = true }, - float = { enabled = true }, - ignore = { - ft = { 'neo-tree' }, - actions_without_kind = true, - }, - }) - local test = "" - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-lualine.lua b/.config/nvim/lua/custom/plugins/TODO-lualine.lua deleted file mode 100644 index 99dd11f..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-lualine.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'nvim-lualine/lualine.nvim', - config = function() - -- TODO: Configure this to make the status line fully customizable - require('lualine').setup({ - options = { - theme = 'tokyonight', - }, - sections = { lualine_c = { require('auto-session.lib').current_session_name } }, - }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-neoclip.lua b/.config/nvim/lua/custom/plugins/TODO-neoclip.lua deleted file mode 100644 index ef4f15b..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-neoclip.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - 'AckslD/nvim-neoclip.lua', - dependencies = { - { 'kkharji/sqlite.lua', module = 'sqlite' }, - { 'nvim-telescope/telescope.nvim' }, - }, - config = function() - require('neoclip').setup({ - enable_persistent_history = true, - keys = { - telescope = { - i = { - paste = '', - paste_behind = '', - }, - }, - } - }) - -- NOTE: Using `plus` to set the plus register to the selected value - vim.keymap.set('n', 'nc', ':Telescope neoclip plus', { desc = '[N]eo[c]lip History' }) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-noice.lua b/.config/nvim/lua/custom/plugins/TODO-noice.lua deleted file mode 100644 index f4acfe4..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-noice.lua +++ /dev/null @@ -1,204 +0,0 @@ -return { - --[[ - 'folke/noice.nvim', - dependencies = { - 'MunifTanjim/nui.nvim', - 'rcarriga/nvim-notify', - }, - event = 'VeryLazy', - config = function() - require('noice').setup({ - cmdline = { - enabled = false, -- enables the Noice cmdline UI - view = 'cmdline_popup', -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom - opts = {}, -- global options for the cmdline. See section on views - ---@type table - format = { - -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. - -- view: (default is cmdline view) - -- opts: any options passed to the view - -- icon_hl_group: optional hl_group for the icon - -- title: set to anything or empty string to hide - cmdline = { pattern = '^:', icon = '', lang = 'vim' }, - search_down = { kind = 'search', pattern = '^/', icon = ' ', lang = 'regex' }, - search_up = { kind = 'search', pattern = '^%?', icon = ' ', lang = 'regex' }, - filter = { pattern = '^:%s*!', icon = '$', lang = 'bash' }, - lua = { pattern = { '^:%s*lua%s+', '^:%s*lua%s*=%s*', '^:%s*=%s*' }, icon = '', lang = 'lua' }, - help = { pattern = '^:%s*he?l?p?%s+', icon = '' }, - input = { view = 'cmdline_input', icon = '󰥻 ' }, -- Used by input() - -- lua = false, -- to disable a format, set to `false` - }, - }, - messages = { - -- NOTE: If you enable messages, then the cmdline is enabled automatically. - -- This is a current Neovim limitation. - enabled = false, -- enables the Noice messages UI - view = 'notify', -- default view for messages - view_error = 'notify', -- view for errors - view_warn = 'notify', -- view for warnings - view_history = 'messages', -- view for :messages - view_search = 'virtualtext', -- view for search count messages. Set to `false` to disable - }, - popupmenu = { - enabled = true, -- enables the Noice popupmenu UI - ---@type 'nui'|'cmp' - backend = 'nui', -- backend to use to show regular cmdline completions - ---@type NoicePopupmenuItemKind|false - -- Icons for completion item kinds (see defaults at noice.config.icons.kinds) - kind_icons = {}, -- set to `false` to disable icons - }, - -- default options for require('noice').redirect - -- see the section on Command Redirection - ---@type NoiceRouteConfig - redirect = { - view = 'popup', - filter = { event = 'msg_show' }, - }, - -- You can add any custom commands below that will be available with `:Noice command` - ---@type table - commands = { - history = { - -- options for the message history that you get with `:Noice` - view = 'split', - opts = { enter = true, format = 'details' }, - filter = { - any = { - { event = 'notify' }, - { error = true }, - { warning = true }, - { event = 'msg_show', kind = { '' } }, - { event = 'lsp', kind = 'message' }, - }, - }, - }, - -- :Noice last - last = { - view = 'popup', - opts = { enter = true, format = 'details' }, - filter = { - any = { - { event = 'notify' }, - { error = true }, - { warning = true }, - { event = 'msg_show', kind = { '' } }, - { event = 'lsp', kind = 'message' }, - }, - }, - filter_opts = { count = 1 }, - }, - -- :Noice errors - errors = { - -- options for the message history that you get with `:Noice` - view = 'popup', - opts = { enter = true, format = 'details' }, - filter = { error = true }, - filter_opts = { reverse = true }, - }, - all = { - -- options for the message history that you get with `:Noice` - view = 'split', - opts = { enter = true, format = 'details' }, - filter = {}, - }, - }, - notify = { - -- Noice can be used as `vim.notify` so you can route any notification like other messages - -- Notification messages have their level and other properties set. - -- event is always "notify" and kind can be any log level as a string - -- The default routes will forward notifications to nvim-notify - -- Benefit of using Noice for this is the routing and consistent history view - enabled = true, - view = 'notify', - }, - lsp = { - progress = { - enabled = true, - -- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin - -- See the section on formatting for more details on how to customize. - --- @type NoiceFormat|string - format = 'lsp_progress', - --- @type NoiceFormat|string - format_done = 'lsp_progress_done', - throttle = 1000 / 30, -- frequency to update lsp progress message - view = 'mini', - }, - override = { - ['vim.lsp.util.convert_input_to_markdown_lines'] = true, - ['vim.lsp.util.stylize_markdown'] = true, - ['cmp.entry.get_documentation'] = true, - }, - hover = { - enabled = true, - silent = false, -- set to true to not show a message if hover is not available - view = nil, -- when nil, use defaults from documentation - ---@type NoiceViewOptions - opts = {}, -- merged with defaults from documentation - }, - signature = { - enabled = true, - auto_open = { - enabled = true, - trigger = true, -- Automatically show signature help when typing a trigger character from the LSP - luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes - throttle = 50, -- Debounce lsp signature help request by 50ms - }, - view = nil, -- when nil, use defaults from documentation - ---@type NoiceViewOptions - opts = {}, -- merged with defaults from documentation - }, - message = { - -- Messages shown by lsp servers - enabled = true, - view = 'notify', - opts = {}, - }, - -- defaults for hover and signature help - documentation = { - view = 'hover', - ---@type NoiceViewOptions - opts = { - lang = 'markdown', - replace = true, - render = 'plain', - format = { '{message}' }, - win_options = { concealcursor = 'n', conceallevel = 3 }, - }, - }, - }, - markdown = { - hover = { - ['|(%S-)|'] = vim.cmd.help, -- vim help links - ['%[.-%]%((%S-)%)'] = require('noice.util').open, -- markdown links - }, - highlights = { - ['|%S-|'] = '@text.reference', - ['@%S+'] = '@parameter', - ['^%s*(Parameters:)'] = '@text.title', - ['^%s*(Return:)'] = '@text.title', - ['^%s*(See also:)'] = '@text.title', - ['{%S-}'] = '@parameter', - }, - }, - health = { - checker = true, -- Disable if you don't want health checks to run - }, - ---@type NoicePresets - presets = { - bottom_search = true, -- use a classic bottom cmdline for search - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help - }, - throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? - ---@type NoiceConfigViews - views = {}, ---@see section on views - ---@type NoiceRouteConfig[] - routes = {}, --- @see section on routes - ---@type table - status = {}, --- @see section on statusline components - ---@type NoiceFormatOptions - format = {}, --- @see section on formatting - }) - end,]] -} diff --git a/.config/nvim/lua/custom/plugins/TODO-obsidian.lua b/.config/nvim/lua/custom/plugins/TODO-obsidian.lua deleted file mode 100644 index 55a242d..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-obsidian.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - 'epwalsh/obsidian.nvim', - version = '*', - lazy = true, - ft = 'markdown', - dependencies = { 'nvim-lua/plenary.nvim', 'hrsh7th/nvim-cmp' }, - opts = { - workspaces = { - { - name = 'personal', - path = '/mnt/c/users/owner/Projects/ObsidianSync', - }, - }, - }, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-statusline.lua b/.config/nvim/lua/custom/plugins/TODO-statusline.lua new file mode 100644 index 0000000..99dd11f --- /dev/null +++ b/.config/nvim/lua/custom/plugins/TODO-statusline.lua @@ -0,0 +1,12 @@ +return { + 'nvim-lualine/lualine.nvim', + config = function() + -- TODO: Configure this to make the status line fully customizable + require('lualine').setup({ + options = { + theme = 'tokyonight', + }, + sections = { lualine_c = { require('auto-session.lib').current_session_name } }, + }) + end, +} diff --git a/.config/nvim/lua/custom/plugins/TODO-surround.lua b/.config/nvim/lua/custom/plugins/TODO-surround.lua deleted file mode 100644 index 7f8c88b..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-surround.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - 'kylechui/nvim-surround', - version = '*', - event = 'VeryLazy', - config = function() - require('nvim-surround').setup({}) - local opts = {} - vim.keymap.set('v', '(', '(nvim-surround-visual)(', opts) - vim.keymap.set('v', ')', '(nvim-surround-visual))', opts) - vim.keymap.set('v', '{', '(nvim-surround-visual){', opts) - vim.keymap.set('v', '}', '(nvim-surround-visual)}', opts) - -- NOTE: I still want to be able to do < and > for indentation - -- vim.keymap.set('v', '<', '(nvim-surround-visual)<', opts) - -- vim.keymap.set('v', '>', '(nvim-surround-visual)>', opts) - vim.keymap.set('v', '[', '(nvim-surround-visual)[', opts) - vim.keymap.set('v', ']', '(nvim-surround-visual)]', opts) - vim.keymap.set('v', "'", "(nvim-surround-visual)'", opts) - vim.keymap.set('v', '"', '(nvim-surround-visual)"', opts) - vim.keymap.set('v', '`', '(nvim-surround-visual)`', opts) - end, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-time-tracking.lua b/.config/nvim/lua/custom/plugins/TODO-time-tracking.lua deleted file mode 100644 index d63a22b..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-time-tracking.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - 'wakatime/vim-wakatime', - lazy = false, -} diff --git a/.config/nvim/lua/custom/plugins/TODO-vim-tmux-navigator.lua b/.config/nvim/lua/custom/plugins/TODO-vim-tmux-navigator.lua deleted file mode 100644 index 4d5c018..0000000 --- a/.config/nvim/lua/custom/plugins/TODO-vim-tmux-navigator.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - 'christoomey/vim-tmux-navigator', - vim.keymap.set('n', 'C-h', ':TmuxNavigatorLeft'), - vim.keymap.set('n', 'C-j', ':TmuxNavigatorDown'), - vim.keymap.set('n', 'C-k', ':TmuxNavigatorUp'), - vim.keymap.set('n', 'C-l', ':TmuxNavigatorRight'), -} diff --git a/.config/nvim/lua/custom/plugins/alpha.lua b/.config/nvim/lua/custom/plugins/alpha.lua new file mode 100644 index 0000000..e1b9532 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/alpha.lua @@ -0,0 +1,68 @@ +return { + 'goolord/alpha-nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + local alpha = require('alpha') + local dashboard = require('alpha.themes.dashboard') + + local function get_natural_day(day) + local suffix = 'th' + local day_mod = day % 10 + + if day_mod == 1 and day ~= 11 then + suffix = 'st' + elseif day_mod == 2 and day ~= 12 then + suffix = 'nd' + elseif day_mod == 3 and day ~= 13 then + suffix = 'rd' + end + + return tostring(day) .. suffix + end + + local find_file_path = '$HOME' + local date = os.date('  %A, %B ') .. get_natural_day(tonumber(os.date('%d'))) + local plugins = '  ' .. require('lazy').stats().count .. ' plugins ' + local v = vim.version() + local version = '  v' .. v.major .. '.' .. v.minor .. '.' .. v.patch + local info_line = date .. plugins .. version + + -- WARN: Just hardcoded the length of the first line in the header + local header_length = #'  ' + local padding = (header_length - #info_line) / 2 + info_line = string.rep(' ', padding) .. info_line + + dashboard.section.header.val = { + [[  ]], + [[ ████ ██████ █████ ██ ██ ]], + [[ ███████████ █████ ███ ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + info_line, + } + + dashboard.section.buttons.opts.spacing = 0 + dashboard.section.buttons.val = { + dashboard.button('e', ' > New file', 'ene startinsert'), + dashboard.button('w', ' > Find file', 'cd ' .. find_file_path .. ' | Telescope find_files'), + dashboard.button('r', ' > Recent', 'Telescope oldfiles'), + dashboard.button('c', ' > Configuration', 'e $MYVIMRC | cd %:p:h'), + dashboard.button( + 's', + '󱎠 > Last Session', + 'lua require("auto-session.session-lens.actions").alternate_session()' + ), + dashboard.button('q', '󰈆 > Quit NVIM', 'qa'), + } + + dashboard.section.footer.val = require('alpha.fortune')() + + alpha.setup(dashboard.opts) + end, +} diff --git a/.config/nvim/lua/custom/plugins/motions.lua b/.config/nvim/lua/custom/plugins/motions.lua new file mode 100644 index 0000000..3cfcfcf --- /dev/null +++ b/.config/nvim/lua/custom/plugins/motions.lua @@ -0,0 +1,80 @@ +return { + { + 'christoomey/vim-tmux-navigator', + config = function() + vim.keymap.set('n', 'C-h', ':TmuxNavigatorLeft') + vim.keymap.set('n', 'C-j', ':TmuxNavigatorDown') + vim.keymap.set('n', 'C-k', ':TmuxNavigatorUp') + vim.keymap.set('n', 'C-l', ':TmuxNavigatorRight') + end, + }, + { + 'ggandor/leap.nvim', + dependencies = { 'tpope/vim-repeat' }, + config = function() + vim.keymap.set({ 'n', 'x', 'o' }, 's', '(leap-forward)') + vim.keymap.set({ 'n', 'x', 'o' }, 'S', '(leap-backward)') + vim.keymap.set({ 'n', 'x', 'o' }, 'gs', '(leap-from-window)') + + -- Define equivalence classes for brackets and quotes, in addition to + -- the default whitespace group. + require('leap').opts.equivalence_classes = { ' \t\r\n', '([{', ')]}', '\'"`' } + + -- Set background to gray in searchable area + vim.api.nvim_set_hl(0, 'LeapBackdrop', { fg = '#777777' }) + end, + }, + { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = true, + }, + { + 'numToStr/Comment.nvim', + opts = { + padding = true, + ignore = nil, + + toggler = { line = 'gcc', block = 'gbc' }, + opleader = { line = 'gc', block = 'gb' }, + extra = { above = 'gcO', below = 'gco', eol = 'gcA' }, + + mappings = { + basic = true, -- `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` + extra = false, -- `gco`, `gcO`, `gcA` + }, + }, + config = function() + local api = require('Comment.api') + local esc = vim.api.nvim_replace_termcodes('', true, false, true) + local toggole_linewise_selection = function() + vim.api.nvim_feedkeys(esc, 'nx', false) + api.toggle.linewise(vim.fn.visualmode()) + end + + -- means Ctrl slash, `_` is a `/` + vim.keymap.set('n', '', api.toggle.linewise.current, { noremap = true, silent = true }) + vim.keymap.set('v', '', toggole_linewise_selection, { noremap = true, silent = true }) + end, + }, + { + 'kylechui/nvim-surround', + version = '*', + event = 'VeryLazy', + config = function() + require('nvim-surround').setup({}) + vim.keymap.set('v', '(', '(nvim-surround-visual)(') + vim.keymap.set('v', ')', '(nvim-surround-visual))') + vim.keymap.set('v', '{', '(nvim-surround-visual){') + vim.keymap.set('v', '}', '(nvim-surround-visual)}') + -- I still want to be able to do < and > for indentation + -- vim.keymap.set('v', '<', '(nvim-surround-visual)<', opts) + -- vim.keymap.set('v', '>', '(nvim-surround-visual)>', opts) + vim.keymap.set('v', '[', '(nvim-surround-visual)[') + vim.keymap.set('v', ']', '(nvim-surround-visual)]') + vim.keymap.set('v', "'", "(nvim-surround-visual)'") + vim.keymap.set('v', '"', '(nvim-surround-visual)"') + vim.keymap.set('v', '`', '(nvim-surround-visual)`') + end, + }, +} diff --git a/.config/nvim/lua/custom/plugins/ui.lua b/.config/nvim/lua/custom/plugins/ui.lua new file mode 100644 index 0000000..052be12 --- /dev/null +++ b/.config/nvim/lua/custom/plugins/ui.lua @@ -0,0 +1,56 @@ +return { + { + 'gukz/ftFT.nvim', + opts = { + keys = { 'f', 't', 'F', 'T' }, + modes = { 'n', 'v' }, + }, + config = true, + }, + { + 'uga-rosa/ccc.nvim', + lazy = false, + config = function() + require('ccc').setup({ + highlighter = { + auto_enable = true, + }, + }) + vim.keymap.set('n', 'cp', ':CccPick', { desc = '[C]olor [P]icker' }) + vim.keymap.set('n', 'ct', ':CccHighlighterToggle', { desc = '[C]olor [T]oggle' }) + end, + }, + { + 'RRethy/vim-illuminate', + config = function() + vim.keymap.set('n', 'it', ':IlluminateToggle', { desc = '[I]lluminate [Tloggle]' }) + end, + }, + { + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + opts = {}, + config = function() + require('ibl').setup() + end, + }, + { + 'kosayoda/nvim-lightbulb', + config = function() + require('nvim-lightbulb').setup({ + autocmd = { + enabled = true, + updatetime = 50, + }, + action_kinds = { 'quickfix', 'refactor.rewrite' }, + sign = { enabled = false }, + virtual_text = { enabled = true }, + float = { enabled = false }, + ignore = { + ft = { 'neo-tree' }, + actions_without_kind = true, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/custom/plugins/utility.lua b/.config/nvim/lua/custom/plugins/utility.lua new file mode 100644 index 0000000..8b336ee --- /dev/null +++ b/.config/nvim/lua/custom/plugins/utility.lua @@ -0,0 +1,40 @@ +return { + { + 'rmagatti/auto-session', + config = function() + vim.opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions' + require('auto-session').setup({ + log_level = 'error', + auto_session_suppress_dirs = { '~/', '/' }, + }) + local session = require('auto-session.session-lens') + vim.keymap.set('n', '', session.search_session, { desc = '[S]ession Manager' }) + end, + }, + { + 'wakatime/vim-wakatime', + lazy = false, + }, + { + 'AckslD/nvim-neoclip.lua', + dependencies = { + { 'kkharji/sqlite.lua', module = 'sqlite' }, + { 'nvim-telescope/telescope.nvim' }, + }, + config = function() + require('neoclip').setup({ + enable_persistent_history = true, + keys = { + telescope = { + i = { + paste = '', + paste_behind = '', + }, + }, + }, + }) + -- NOTE: Using `plus` to set the plus register to the selected value + vim.keymap.set('n', 'nc', ':Telescope neoclip plus', { desc = '[N]eo[c]lip History' }) + end, + }, +} -- cgit v1.3.1