feat: misc configs

This commit is contained in:
Barrett Ruth 2026-02-18 10:20:00 -05:00
parent 15a876e975
commit efb515d76c
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
9 changed files with 91 additions and 48 deletions

View file

@ -10,9 +10,16 @@ vim.keymap.set('n', '<leader>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

View file

View file

@ -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" },

View file

@ -74,6 +74,7 @@ return {
{ 'gl', '<cmd>FzfLua loclist<cr>' },
},
opts = {
file_icon_padding = ' ',
files = {
cmd = vim.env.FZF_CTRL_T_COMMAND,
file_icons = true,

View file

@ -178,15 +178,4 @@ return {
},
},
},
{
'SmiteshP/nvim-navic',
opts = {
depth_limit = 3,
depth_limit_indicator = '',
icons = {
enabled = false,
},
},
event = 'LspAttach',
},
}

View file

@ -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 {
['<C-r>'] = 'actions.refresh',
['<C-s>'] = { 'actions.select', opts = { vertical = true } },
['<C-x>'] = { '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' },
},

View file

@ -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

18
flake.lock generated
View file

@ -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": {

View file

@ -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: ')"