From efb515d76cf5b984a6104e702ce46c0127e3e7e2 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 18 Feb 2026 10:20:00 -0500 Subject: [PATCH] feat: misc configs --- config/nvim/after/ftplugin/typst.lua | 13 ++++- config/nvim/file.svg | 0 config/nvim/lazy-lock.json | 2 - config/nvim/lua/plugins/fzf.lua | 1 + config/nvim/lua/plugins/lsp.lua | 11 ---- config/nvim/lua/plugins/nvim.lua | 85 +++++++++++++++++++++------- config/tmux/tmux.conf | 7 ++- flake.lock | 18 +++--- scripts/theme | 2 +- 9 files changed, 91 insertions(+), 48 deletions(-) delete mode 100644 config/nvim/file.svg diff --git a/config/nvim/after/ftplugin/typst.lua b/config/nvim/after/ftplugin/typst.lua index 9a418a6..cc9548e 100644 --- a/config/nvim/after/ftplugin/typst.lua +++ b/config/nvim/after/ftplugin/typst.lua @@ -10,9 +10,16 @@ vim.keymap.set('n', 't', function() local ret = vim.system({ 'hyprctl', 'clients', '-j' }):wait() if ret.code == 0 then for _, c in ipairs(vim.json.decode(ret.stdout)) do - if (c.class or ''):lower():find('sioyek') - and (c.title or ''):find(basename, 1, true) then - vim.system({ 'hyprctl', 'dispatch', 'closewindow', 'address:' .. c.address }) + if + (c.class or ''):lower():find('sioyek') + and (c.title or ''):find(basename, 1, true) + then + vim.system({ + 'hyprctl', + 'dispatch', + 'closewindow', + 'address:' .. c.address, + }) return end end diff --git a/config/nvim/file.svg b/config/nvim/file.svg deleted file mode 100644 index e69de29..0000000 diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 110a612..846024e 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -12,8 +12,6 @@ "mini.pairs": { "branch": "main", "commit": "4089aa6ea6423e02e1a8326a7a7a00159f6f5e04" }, "nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" }, "nvim-lspconfig": { "branch": "master", "commit": "f4e9d367d4e067d7a5fabc9fd3f1349b291eb718" }, - "nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" }, - "nvim-nonicons": { "branch": "main", "commit": "0cd3e96efe766fb3688d955c129c78986d4b295f" }, "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, "nvim-treesitter": { "branch": "main", "commit": "9f2dad22ef8bb14fd1e0a3aa8859cdc88170668b" }, "nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" }, diff --git a/config/nvim/lua/plugins/fzf.lua b/config/nvim/lua/plugins/fzf.lua index 96fce5f..03c1dce 100644 --- a/config/nvim/lua/plugins/fzf.lua +++ b/config/nvim/lua/plugins/fzf.lua @@ -74,6 +74,7 @@ return { { 'gl', 'FzfLua loclist' }, }, opts = { + file_icon_padding = ' ', files = { cmd = vim.env.FZF_CTRL_T_COMMAND, file_icons = true, diff --git a/config/nvim/lua/plugins/lsp.lua b/config/nvim/lua/plugins/lsp.lua index 17baa9d..dba648e 100644 --- a/config/nvim/lua/plugins/lsp.lua +++ b/config/nvim/lua/plugins/lsp.lua @@ -178,15 +178,4 @@ return { }, }, }, - { - 'SmiteshP/nvim-navic', - opts = { - depth_limit = 3, - depth_limit_indicator = '…', - icons = { - enabled = false, - }, - }, - event = 'LspAttach', - }, } diff --git a/config/nvim/lua/plugins/nvim.lua b/config/nvim/lua/plugins/nvim.lua index cb19a13..ef1f206 100644 --- a/config/nvim/lua/plugins/nvim.lua +++ b/config/nvim/lua/plugins/nvim.lua @@ -1,3 +1,39 @@ +local oil_detail = false + +local function parse_output(proc) + local result = proc:wait() + local ret = {} + if result.code == 0 then + for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do + ret[line:gsub("/$", "")] = true + end + end + return ret +end + +local function new_git_status() + return setmetatable({}, { + __index = function(self, key) + local ignored_proc = vim.system( + { "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" }, + { cwd = key, text = true } + ) + local tracked_proc = vim.system( + { "git", "ls-tree", "HEAD", "--name-only" }, + { cwd = key, text = true } + ) + local ret = { + ignored = parse_output(ignored_proc), + tracked = parse_output(tracked_proc), + } + rawset(self, key, ret) + return ret + end, + }) +end + +local git_status = new_git_status() + return { { 'barrettruth/midnight.nvim', @@ -8,9 +44,9 @@ return { end, }, { - dir = '~/dev/nonicons', + 'barrettruth/nonicons.nvim', + dir = '~/dev/nonicons.nvim', dependencies = { 'nvim-tree/nvim-web-devicons' }, - opts = {}, }, { 'echasnovski/mini.pairs', @@ -227,6 +263,12 @@ return { 'stevearc/oil.nvim', config = function(_, opts) require('oil').setup(opts) + local refresh = require("oil.actions").refresh + local orig_refresh = refresh.callback + refresh.callback = function(...) + git_status = new_git_status() + orig_refresh(...) + end vim.api.nvim_create_autocmd('BufEnter', { callback = function() local ft = vim.bo.filetype @@ -251,21 +293,16 @@ return { float = { border = 'single' }, view_options = { is_hidden_file = function(name, bufnr) - local dir = require('oil').get_current_dir(bufnr) + local dir = require("oil").get_current_dir(bufnr) + local is_dotfile = vim.startswith(name, ".") and name ~= ".." if not dir then - return false + return is_dotfile end - if vim.startswith(name, '.') then - return false + if is_dotfile then + return not git_status[dir].tracked[name] + else + return git_status[dir].ignored[name] end - local git_dir = vim.fn.finddir('.git', dir .. ';') - if git_dir == '' then - return false - end - local fullpath = dir .. '/' .. name - local result = - vim.fn.systemlist({ 'git', 'check-ignore', fullpath }) - return #result > 0 end, }, keymaps = { @@ -275,7 +312,7 @@ return { [''] = 'actions.refresh', [''] = { 'actions.select', opts = { vertical = true } }, [''] = { 'actions.select', opts = { horizontal = true } }, - ['q'] = function() + q = function() local ok, bufremove = pcall(require, 'mini.bufremove') if ok then bufremove.delete() @@ -283,6 +320,14 @@ return { vim.cmd.bd() end end, + k = function() + oil_detail = not oil_detail + if oil_detail then + require("oil").set_columns({ "icon", "permissions", "size", "mtime" }) + else + require("oil").set_columns({ "icon" }) + end + end }, }, }, @@ -311,15 +356,15 @@ return { }, }, { 'tpope/vim-abolish', event = 'VeryLazy' }, - { 'tpope/vim-sleuth', event = 'BufReadPost' }, + { 'tpope/vim-sleuth', event = 'BufReadPost' }, { 'kylechui/nvim-surround', config = true, keys = { - { 'cs', mode = 'n' }, - { 'ds', mode = 'n' }, - { 'ys', mode = 'n' }, - { 'yS', mode = 'n' }, + { 'cs', mode = 'n' }, + { 'ds', mode = 'n' }, + { 'ys', mode = 'n' }, + { 'yS', mode = 'n' }, { 'yss', mode = 'n' }, { 'ySs', mode = 'n' }, }, diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf index a3194b7..8b261d7 100644 --- a/config/tmux/tmux.conf +++ b/config/tmux/tmux.conf @@ -54,8 +54,11 @@ unbind ?; bind ? if -F '#{pane_in_mode}' { send-keys -X cancel } { copy-mode ; c bind -T copy-mode-vi v send-keys -X begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' -bind -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' -bind -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' +bind -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection +bind -n TripleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection +bind -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection +bind -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection +bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe 'test -n "$WAYLAND_DISPLAY" && wl-copy || xclip -in -sel c' \; send-keys -X clear-selection unbind b; bind b set status\; refresh -S unbind m; bind m set -g mouse\; run-shell 'mux bar'\; refresh -S diff --git a/flake.lock b/flake.lock index 557a7a0..2a65045 100644 --- a/flake.lock +++ b/flake.lock @@ -38,11 +38,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1771279376, - "narHash": "sha256-9/eeQCpc1BksJLNU1Mx3e4waUt/DSwaEMHI3noUy738=", + "lastModified": 1771355895, + "narHash": "sha256-sopgRZY3c/8LCMKk/r97qFR4qrRq7PQqCLjnhiTJKdg=", "owner": "ryoppippi", "repo": "claude-code-overlay", - "rev": "2a846ca500a647ffe5e58954c531f447d86d4da6", + "rev": "c731854774677b1aa8ec11c30f8e4ebd912789c0", "type": "github" }, "original": { @@ -205,11 +205,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1771249510, - "narHash": "sha256-Iql2BwsfrHiyDmZfc/9Cp6oa2569/WrJqhqWWg3EY50=", + "lastModified": 1771336666, + "narHash": "sha256-b3UT9mOjQTNwfT/MHO3ZpBHlAvTC+BaqUokqS0VEgRo=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "661314e13487784c94b3c9fd69b469764eb6ef7b", + "rev": "0de216e783d02748183ac5a5712201517685f492", "type": "github" }, "original": { @@ -623,11 +623,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1771303996, - "narHash": "sha256-cwf75uTx8cGJCP+nohi7iVTE+lmfevBxNgirkMLkuEY=", + "lastModified": 1771381854, + "narHash": "sha256-6uEDuQYEGuyuFnvOdSx+fW75tRbNiLswAl6+4qyTdJ4=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "a7659a805bda3ae8e4861572d8dc0f1d29f3fc3c", + "rev": "0fa995bec0e391b45b032fbd9d6e03609a30c115", "type": "github" }, "original": { diff --git a/scripts/theme b/scripts/theme index 5d81d36..18caf9d 100755 --- a/scripts/theme +++ b/scripts/theme @@ -22,7 +22,7 @@ else if [ "$XDG_SESSION_TYPE" = "wayland" ]; then require fuzzel count="$(printf "%s\n" "$themes" | wc -l)" - theme="$(printf "%s\n" "$themes" | fuzzel --dmenu --prompt="theme: " --lines="$count")" + theme="$(printf "%s\n" "$themes" | fuzzel --dmenu --hide-prompt --lines="$count")" else require dmenu theme="$(printf "%s\n" "$themes" | dmenu -p 'select theme: ')"