From 58ceb817bb6ba195d1189160878f318f3bcda0ef Mon Sep 17 00:00:00 2001 From: triethyl Date: Sat, 16 Aug 2025 20:20:21 -0400 Subject: neovim: restarted config --- .../config/lua/plugins/actions-preview.lua | 3 + .../config/lua/plugins/auto-session.lua | 1 + .../config/lua/plugins/comment.lua | 1 + .../config/lua/plugins/dropbar.lua | 43 ++++++++++ .../config/lua/plugins/fidget.lua | 1 + .../old-custom-neovim/config/lua/plugins/focus.lua | 18 +++++ .../config/lua/plugins/gitsigns.lua | 1 + .../config/lua/plugins/incline.lua | 25 ++++++ .../config/lua/plugins/mini/clue.lua | 66 ++++++++++++++++ .../config/lua/plugins/mini/cursorword.lua | 1 + .../config/lua/plugins/mini/files.lua | 91 ++++++++++++++++++++++ .../config/lua/plugins/mini/git.lua | 1 + .../config/lua/plugins/mini/icons.lua | 3 + .../config/lua/plugins/mini/indentscope.lua | 6 ++ .../config/lua/plugins/mini/pairs.lua | 1 + .../config/lua/plugins/mini/tabline.lua | 20 +++++ pkgs/old-custom-neovim/config/lua/plugins/namu.lua | 1 + .../config/lua/plugins/presence.lua | 3 + .../config/lua/plugins/render-markdown.lua | 1 + .../config/lua/plugins/snacks.lua | 36 +++++++++ .../old-custom-neovim/config/lua/plugins/tabby.lua | 53 +++++++++++++ .../config/lua/plugins/treesitter.lua | 5 ++ .../config/lua/plugins/ts-autotag.lua | 1 + 23 files changed, 382 insertions(+) create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/actions-preview.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/auto-session.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/comment.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/dropbar.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/fidget.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/focus.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/gitsigns.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/incline.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/clue.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/cursorword.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/files.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/git.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/icons.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/indentscope.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/pairs.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/mini/tabline.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/namu.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/presence.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/render-markdown.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/snacks.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/tabby.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/treesitter.lua create mode 100644 pkgs/old-custom-neovim/config/lua/plugins/ts-autotag.lua (limited to 'pkgs/old-custom-neovim/config/lua/plugins') diff --git a/pkgs/old-custom-neovim/config/lua/plugins/actions-preview.lua b/pkgs/old-custom-neovim/config/lua/plugins/actions-preview.lua new file mode 100644 index 0000000..0e3cc02 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/actions-preview.lua @@ -0,0 +1,3 @@ +require("actions-preview").setup { + backend = {"snacks"} +} diff --git a/pkgs/old-custom-neovim/config/lua/plugins/auto-session.lua b/pkgs/old-custom-neovim/config/lua/plugins/auto-session.lua new file mode 100644 index 0000000..99df59b --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/auto-session.lua @@ -0,0 +1 @@ +require("auto-session").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/comment.lua b/pkgs/old-custom-neovim/config/lua/plugins/comment.lua new file mode 100644 index 0000000..bd47faf --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/comment.lua @@ -0,0 +1 @@ +require("Comment").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/dropbar.lua b/pkgs/old-custom-neovim/config/lua/plugins/dropbar.lua new file mode 100644 index 0000000..5d4bb43 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/dropbar.lua @@ -0,0 +1,43 @@ +local dropbar = require('dropbar') +local sources = require('dropbar.sources') +local utils = require('dropbar.utils') + +Utils.link_highlight("DropBarFileName", "MiniFilesTitleFocused") + +local custom_path = { + get_symbols = function(buff, win, cursor) + local symbols = sources.path.get_symbols(buff, win, cursor) + symbols[#symbols].name_hl = 'DropBarFileName' + if vim.bo[buff].modified then + symbols[#symbols].name = symbols[#symbols].name .. ' [+]' + symbols[#symbols].name_hl = 'DropBarFileName' + symbols[#symbols].truncate = false + end + return symbols + end, +} + +dropbar.setup({ + bar = { + sources = function(buf, _) + if vim.bo[buf].ft == 'markdown' then + return { + custom_path, + sources.markdown, + } + end + -- if vim.bo[buf].buftype == 'terminal' then + -- return { + -- sources.terminal, + -- } + -- end + return { + custom_path, + utils.source.fallback { + sources.lsp, + sources.treesitter, + }, + } + end, + }, +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/fidget.lua b/pkgs/old-custom-neovim/config/lua/plugins/fidget.lua new file mode 100644 index 0000000..4f1ab35 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/fidget.lua @@ -0,0 +1 @@ +require("fidget").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/focus.lua b/pkgs/old-custom-neovim/config/lua/plugins/focus.lua new file mode 100644 index 0000000..560f3ce --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/focus.lua @@ -0,0 +1,18 @@ +require("focus").setup { + enable = true, + split = { + -- bufnew = true, + }, + ui = { + winhighlight = true, -- Highlight focused and unfocused windows + signcolumn = false, -- Signcolumn on all windows + -- cursorline = false, + }, +} + +vim.api.nvim_create_autocmd("WinEnter", { + pattern = "picker", + callback = function(args) + vim.b[args.buf].cursorline = false + end, +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/gitsigns.lua b/pkgs/old-custom-neovim/config/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..d16d238 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/gitsigns.lua @@ -0,0 +1 @@ +require("gitsigns").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/incline.lua b/pkgs/old-custom-neovim/config/lua/plugins/incline.lua new file mode 100644 index 0000000..92ced03 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/incline.lua @@ -0,0 +1,25 @@ +local icons = require 'mini.icons' +require('incline').setup { + hide = { + only_win = true, + }, + window = { + padding = 0, + margin = { horizontal = 0 }, + }, + render = function(props) + local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t') + if filename == '' then + filename = '[No Name]' + end + local ft_icon, ft_hl = icons.get("file", filename) + local modified = vim.bo[props.buf].modified + return { + ft_icon and { ' ', ft_icon, ' ', gui = ft_hl } or '', + ' ', + { filename, gui = 'bold' }, + ' ', + modified and '[+] ' or '', + } + end, +} diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/clue.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/clue.lua new file mode 100644 index 0000000..3dcac1b --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/clue.lua @@ -0,0 +1,66 @@ +local miniclue = require('mini.clue') +miniclue.setup({ + triggers = { + -- Leader triggers + { mode = 'n', keys = '' }, + { mode = 'v', keys = '' }, + + -- Built-in completion + { mode = 'i', keys = '' }, + + -- `g` key + { mode = 'n', keys = 'g' }, + { mode = 'v', keys = 'g' }, + + -- Marks + { mode = 'n', keys = "'" }, + { mode = 'v', keys = "'" }, + { mode = 'n', keys = '`' }, + { mode = 'v', keys = '`' }, + + -- Registers + { mode = 'n', keys = '"' }, + { mode = 'v', keys = '"' }, + { mode = 'i', keys = '' }, + { mode = 'c', keys = '' }, + + -- Window commands + { mode = 'n', keys = '' }, + -- { mode = 'n', keys = 'w' }, + + -- `z` key + { mode = 'v', keys = 'z' }, + { mode = 'n', keys = 'z' }, + }, + + clues = { + { mode = {'n', 'v'}, keys = '' }, + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + Utils.replaceInTable(miniclue.gen_clues.windows(), "", "w"), + miniclue.gen_clues.z(), + }, + + window = { + delay = 0, + + scroll_down = "", + scroll_up = "", + }, +}) + +vim.api.nvim_create_autocmd("TermOpen", { + callback = function() + vim.cmd.lua("MiniClue.ensure_buf_triggers()") + end, +}) + +vim.api.nvim_create_autocmd("User", { + pattern = "MiniFilesWindowOpen", + callback = function() + vim.cmd.lua("MiniClue.ensure_buf_triggers()") + end, +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/cursorword.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/cursorword.lua new file mode 100644 index 0000000..530b88b --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/cursorword.lua @@ -0,0 +1 @@ +require("mini.cursorword").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/files.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/files.lua new file mode 100644 index 0000000..1dc1c3e --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/files.lua @@ -0,0 +1,91 @@ +require("mini.files").setup { + mappings = { + close = '', + go_in = 'L', + go_in_plus = "", + go_out = 'H', + go_out_plus = '', + mark_goto = "'", + mark_set = 'm', + reset = '', + reveal_cwd = '@', + show_help = 'g?', + synchronize = '=', + trim_left = '<', + trim_right = '>', + }, + windows = { + preview = true, + }, +} + +-- Set focused directory as current working directory +local set_cwd = function() + local path = (MiniFiles.get_fs_entry() or {}).path + if path == nil then return vim.notify('Cursor is not on valid entry') end + vim.fn.chdir(vim.fs.dirname(path)) +end + +-- Yank in register full path of entry under cursor +local yank_path = function() + local path = (MiniFiles.get_fs_entry() or {}).path + if path == nil then return vim.notify('Cursor is not on valid entry') end + vim.fn.setreg(vim.v.register, path) +end + +-- Open path with system default handler (useful for non-text files) +local ui_open = function() vim.ui.open(MiniFiles.get_fs_entry().path) end + +vim.api.nvim_create_autocmd('User', { + pattern = 'MiniFilesBufferCreate', + callback = function(args) + local b = args.data.buf_id + vim.keymap.set('n', 'g~', set_cwd, { buffer = b, desc = 'Set cwd' }) + vim.keymap.set('n', 'gX', ui_open, { buffer = b, desc = 'OS open' }) + vim.keymap.set('n', 'gy', yank_path, { buffer = b, desc = 'Yank path' }) + end, +}) + +-- Add custom bookmarks. +local set_mark = function(id, path, desc) + MiniFiles.set_bookmark(id, path, { desc = desc }) +end + +vim.api.nvim_create_autocmd('User', { + pattern = 'MiniFilesExplorerOpen', + callback = function() + set_mark('w', vim.fn.getcwd, 'Working directory') -- callable + set_mark('~', '~', 'Home directory') + end, +}) + +-- Add split keys +local map_split = function(buf_id, lhs, direction) + local rhs = function() + -- Make new window and set it as target + local cur_target = MiniFiles.get_explorer_state().target_window + local new_target = vim.api.nvim_win_call(cur_target, function() + vim.cmd(direction .. ' split') + return vim.api.nvim_get_current_win() + end) + + MiniFiles.set_target_window(new_target) + + MiniFiles.go_in() + end + + -- Adding `desc` will result into `show_help` entries + local desc = 'Split ' .. direction + vim.keymap.set('n', lhs, rhs, { buffer = buf_id, desc = desc }) +end + +vim.api.nvim_create_autocmd('User', { + pattern = 'MiniFilesBufferCreate', + callback = function(args) + local buf_id = args.data.buf_id + -- Tweak keys to your liking + map_split(buf_id, '', 'belowright horizontal') + map_split(buf_id, '', 'belowright vertical') + map_split(buf_id, '', 'tab') + end, +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/git.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/git.lua new file mode 100644 index 0000000..943f91d --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/git.lua @@ -0,0 +1 @@ +require("mini.git").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/icons.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/icons.lua new file mode 100644 index 0000000..fd2c5f9 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/icons.lua @@ -0,0 +1,3 @@ +require("mini.icons").setup() + +MiniIcons.mock_nvim_web_devicons() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/indentscope.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/indentscope.lua new file mode 100644 index 0000000..2543c40 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/indentscope.lua @@ -0,0 +1,6 @@ +require("mini.indentscope").setup() + +-- Don't work in terminal or help windows. +local f = function(args) vim.b[args.buf].miniindentscope_disable = true end +vim.api.nvim_create_autocmd('Filetype', { pattern = 'help', callback = f }) +vim.api.nvim_create_autocmd('TermOpen', {callback = f}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/pairs.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/pairs.lua new file mode 100644 index 0000000..493c4d0 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/pairs.lua @@ -0,0 +1 @@ +require("mini.pairs").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/mini/tabline.lua b/pkgs/old-custom-neovim/config/lua/plugins/mini/tabline.lua new file mode 100644 index 0000000..1ec6e7f --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/mini/tabline.lua @@ -0,0 +1,20 @@ +require("mini.tabline").setup { + format = function(buf_id, label) + local suffix = vim.bo[buf_id].modified and '[+] ' or '' + return MiniTabline.default_format(buf_id, label) .. suffix + end +} + +local link_hl = Utils.link_highlight + +vim.api.nvim_create_autocmd({"Colorscheme", "VimEnter"}, { + + callback = function() + -- Change colors. + + -- Make modified buffers the same color. + link_hl("MiniTablineModifiedHidden", "MiniTablineHidden") + link_hl("MiniTablineModifiedVisible", "MiniTablineVisible") + link_hl("MiniTablineModifiedCurrent", "MiniTablineCurrent") + end, +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/namu.lua b/pkgs/old-custom-neovim/config/lua/plugins/namu.lua new file mode 100644 index 0000000..82275b9 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/namu.lua @@ -0,0 +1 @@ +require("namu").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/presence.lua b/pkgs/old-custom-neovim/config/lua/plugins/presence.lua new file mode 100644 index 0000000..7ffb57f --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/presence.lua @@ -0,0 +1,3 @@ +require('presence').setup({ + neovim_image_text = "Neovim Text Editor", +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/render-markdown.lua b/pkgs/old-custom-neovim/config/lua/plugins/render-markdown.lua new file mode 100644 index 0000000..45bdcf2 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/render-markdown.lua @@ -0,0 +1 @@ +require("render-markdown").setup() diff --git a/pkgs/old-custom-neovim/config/lua/plugins/snacks.lua b/pkgs/old-custom-neovim/config/lua/plugins/snacks.lua new file mode 100644 index 0000000..c2cf737 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/snacks.lua @@ -0,0 +1,36 @@ +require("snacks").setup { + bigfile = { enabled = true }, + picker = { + enabled = true, + win = { + input = { + keys = { + [""] = { "close", mode = { "n", "i" } }, + }, + }, + }, + }, + lazygit = { + enabled = true, + config = { + quitOnTopLevelReturn = true, + }, + win = { + height = 0.8, + }, + }, + input = { + enabled = true, + }, + terminal = { + -- interactive = false, + start_insert = true, + auto_insert = true, + win = { + height = 0.2, + }, + keys = {}, + }, +} + +-- Utils.mapkey("t", "", "Manage windows", "") diff --git a/pkgs/old-custom-neovim/config/lua/plugins/tabby.lua b/pkgs/old-custom-neovim/config/lua/plugins/tabby.lua new file mode 100644 index 0000000..c00dad7 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/tabby.lua @@ -0,0 +1,53 @@ +local general_theme = Utils.generate_theme_from_highlight_groups() +local colors = { + current = { fg = general_theme.modes.normal, bg = general_theme.background, style = 'bold'}, + not_current = { fg = general_theme.text.light, bg = general_theme.background }; + fill = { bg = general_theme.background }; +}; +local theme = { + fill = colors.fill, + head = colors.fill, + current_tab = colors.current, + tab = colors.not_current, + win = colors.fill, + tail = colors.fill, +} +require('tabby').setup({ + line = function(line) + return { + { + -- { '  ', hl = theme.head }, + -- line.sep('', theme.head, theme.fill), + }, + line.tabs().foreach(function(tab) + local hl = tab.is_current() and theme.current_tab or theme.tab + return { + line.sep('', hl, theme.fill), + -- tab.is_current() and '' or '󰆣', + -- tab.number(), + tab.name(), + line.sep('', hl, theme.fill), + hl = hl, + margin = ' ', + } + end), + line.spacer(), + line.wins_in_tab(line.api.get_current_tab()).foreach(function(win) + return { + line.sep('', theme.win, theme.fill), + -- win.is_current() and '' or '', + win.buf_name(), + line.sep('', theme.win, theme.fill), + hl = theme.win, + margin = ' ', + } + end), + { + line.sep('', theme.tail, theme.fill), + -- { '  ', hl = theme.tail }, + }, + hl = theme.fill, + } + end, + -- option = {}, -- setup modules' option, +}) diff --git a/pkgs/old-custom-neovim/config/lua/plugins/treesitter.lua b/pkgs/old-custom-neovim/config/lua/plugins/treesitter.lua new file mode 100644 index 0000000..3ad4c9f --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/treesitter.lua @@ -0,0 +1,5 @@ +require("nvim-treesitter.configs").setup { + highlight = { + enable = true, + }, +} diff --git a/pkgs/old-custom-neovim/config/lua/plugins/ts-autotag.lua b/pkgs/old-custom-neovim/config/lua/plugins/ts-autotag.lua new file mode 100644 index 0000000..67b9f06 --- /dev/null +++ b/pkgs/old-custom-neovim/config/lua/plugins/ts-autotag.lua @@ -0,0 +1 @@ +require("nvim-ts-autotag").setup() -- cgit v1.2.3