feat: misc configs
This commit is contained in:
parent
15a876e975
commit
efb515d76c
9 changed files with 91 additions and 48 deletions
|
|
@ -10,9 +10,16 @@ vim.keymap.set('n', '<leader>t', function()
|
||||||
local ret = vim.system({ 'hyprctl', 'clients', '-j' }):wait()
|
local ret = vim.system({ 'hyprctl', 'clients', '-j' }):wait()
|
||||||
if ret.code == 0 then
|
if ret.code == 0 then
|
||||||
for _, c in ipairs(vim.json.decode(ret.stdout)) do
|
for _, c in ipairs(vim.json.decode(ret.stdout)) do
|
||||||
if (c.class or ''):lower():find('sioyek')
|
if
|
||||||
and (c.title or ''):find(basename, 1, true) then
|
(c.class or ''):lower():find('sioyek')
|
||||||
vim.system({ 'hyprctl', 'dispatch', 'closewindow', 'address:' .. c.address })
|
and (c.title or ''):find(basename, 1, true)
|
||||||
|
then
|
||||||
|
vim.system({
|
||||||
|
'hyprctl',
|
||||||
|
'dispatch',
|
||||||
|
'closewindow',
|
||||||
|
'address:' .. c.address,
|
||||||
|
})
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,6 @@
|
||||||
"mini.pairs": { "branch": "main", "commit": "4089aa6ea6423e02e1a8326a7a7a00159f6f5e04" },
|
"mini.pairs": { "branch": "main", "commit": "4089aa6ea6423e02e1a8326a7a7a00159f6f5e04" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "f4e9d367d4e067d7a5fabc9fd3f1349b291eb718" },
|
"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-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" },
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "9f2dad22ef8bb14fd1e0a3aa8859cdc88170668b" },
|
"nvim-treesitter": { "branch": "main", "commit": "9f2dad22ef8bb14fd1e0a3aa8859cdc88170668b" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" },
|
"nvim-treesitter-textobjects": { "branch": "main", "commit": "a0e182ae21fda68c59d1f36c9ed45600aef50311" },
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ return {
|
||||||
{ 'gl', '<cmd>FzfLua loclist<cr>' },
|
{ 'gl', '<cmd>FzfLua loclist<cr>' },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
|
file_icon_padding = ' ',
|
||||||
files = {
|
files = {
|
||||||
cmd = vim.env.FZF_CTRL_T_COMMAND,
|
cmd = vim.env.FZF_CTRL_T_COMMAND,
|
||||||
file_icons = true,
|
file_icons = true,
|
||||||
|
|
|
||||||
|
|
@ -178,15 +178,4 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'SmiteshP/nvim-navic',
|
|
||||||
opts = {
|
|
||||||
depth_limit = 3,
|
|
||||||
depth_limit_indicator = '…',
|
|
||||||
icons = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
event = 'LspAttach',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
return {
|
||||||
{
|
{
|
||||||
'barrettruth/midnight.nvim',
|
'barrettruth/midnight.nvim',
|
||||||
|
|
@ -8,9 +44,9 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dir = '~/dev/nonicons',
|
'barrettruth/nonicons.nvim',
|
||||||
|
dir = '~/dev/nonicons.nvim',
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
opts = {},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'echasnovski/mini.pairs',
|
'echasnovski/mini.pairs',
|
||||||
|
|
@ -227,6 +263,12 @@ return {
|
||||||
'stevearc/oil.nvim',
|
'stevearc/oil.nvim',
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require('oil').setup(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', {
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
callback = function()
|
callback = function()
|
||||||
local ft = vim.bo.filetype
|
local ft = vim.bo.filetype
|
||||||
|
|
@ -251,21 +293,16 @@ return {
|
||||||
float = { border = 'single' },
|
float = { border = 'single' },
|
||||||
view_options = {
|
view_options = {
|
||||||
is_hidden_file = function(name, bufnr)
|
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
|
if not dir then
|
||||||
return false
|
return is_dotfile
|
||||||
end
|
end
|
||||||
if vim.startswith(name, '.') then
|
if is_dotfile then
|
||||||
return false
|
return not git_status[dir].tracked[name]
|
||||||
|
else
|
||||||
|
return git_status[dir].ignored[name]
|
||||||
end
|
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,
|
end,
|
||||||
},
|
},
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
|
@ -275,7 +312,7 @@ return {
|
||||||
['<C-r>'] = 'actions.refresh',
|
['<C-r>'] = 'actions.refresh',
|
||||||
['<C-s>'] = { 'actions.select', opts = { vertical = true } },
|
['<C-s>'] = { 'actions.select', opts = { vertical = true } },
|
||||||
['<C-x>'] = { 'actions.select', opts = { horizontal = true } },
|
['<C-x>'] = { 'actions.select', opts = { horizontal = true } },
|
||||||
['q'] = function()
|
q = function()
|
||||||
local ok, bufremove = pcall(require, 'mini.bufremove')
|
local ok, bufremove = pcall(require, 'mini.bufremove')
|
||||||
if ok then
|
if ok then
|
||||||
bufremove.delete()
|
bufremove.delete()
|
||||||
|
|
@ -283,6 +320,14 @@ return {
|
||||||
vim.cmd.bd()
|
vim.cmd.bd()
|
||||||
end
|
end
|
||||||
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-abolish', event = 'VeryLazy' },
|
||||||
{ 'tpope/vim-sleuth', event = 'BufReadPost' },
|
{ 'tpope/vim-sleuth', event = 'BufReadPost' },
|
||||||
{
|
{
|
||||||
'kylechui/nvim-surround',
|
'kylechui/nvim-surround',
|
||||||
config = true,
|
config = true,
|
||||||
keys = {
|
keys = {
|
||||||
{ 'cs', mode = 'n' },
|
{ 'cs', mode = 'n' },
|
||||||
{ 'ds', mode = 'n' },
|
{ 'ds', mode = 'n' },
|
||||||
{ 'ys', mode = 'n' },
|
{ 'ys', mode = 'n' },
|
||||||
{ 'yS', mode = 'n' },
|
{ 'yS', mode = 'n' },
|
||||||
{ 'yss', mode = 'n' },
|
{ 'yss', mode = 'n' },
|
||||||
{ 'ySs', mode = 'n' },
|
{ 'ySs', mode = 'n' },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -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 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 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 -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 -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 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 b; bind b set status\; refresh -S
|
||||||
unbind m; bind m set -g mouse\; run-shell 'mux bar'\; refresh -S
|
unbind m; bind m set -g mouse\; run-shell 'mux bar'\; refresh -S
|
||||||
|
|
|
||||||
18
flake.lock
generated
18
flake.lock
generated
|
|
@ -38,11 +38,11 @@
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771279376,
|
"lastModified": 1771355895,
|
||||||
"narHash": "sha256-9/eeQCpc1BksJLNU1Mx3e4waUt/DSwaEMHI3noUy738=",
|
"narHash": "sha256-sopgRZY3c/8LCMKk/r97qFR4qrRq7PQqCLjnhiTJKdg=",
|
||||||
"owner": "ryoppippi",
|
"owner": "ryoppippi",
|
||||||
"repo": "claude-code-overlay",
|
"repo": "claude-code-overlay",
|
||||||
"rev": "2a846ca500a647ffe5e58954c531f447d86d4da6",
|
"rev": "c731854774677b1aa8ec11c30f8e4ebd912789c0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -205,11 +205,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771249510,
|
"lastModified": 1771336666,
|
||||||
"narHash": "sha256-Iql2BwsfrHiyDmZfc/9Cp6oa2569/WrJqhqWWg3EY50=",
|
"narHash": "sha256-b3UT9mOjQTNwfT/MHO3ZpBHlAvTC+BaqUokqS0VEgRo=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "661314e13487784c94b3c9fd69b469764eb6ef7b",
|
"rev": "0de216e783d02748183ac5a5712201517685f492",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -623,11 +623,11 @@
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1771303996,
|
"lastModified": 1771381854,
|
||||||
"narHash": "sha256-cwf75uTx8cGJCP+nohi7iVTE+lmfevBxNgirkMLkuEY=",
|
"narHash": "sha256-6uEDuQYEGuyuFnvOdSx+fW75tRbNiLswAl6+4qyTdJ4=",
|
||||||
"owner": "0xc000022070",
|
"owner": "0xc000022070",
|
||||||
"repo": "zen-browser-flake",
|
"repo": "zen-browser-flake",
|
||||||
"rev": "a7659a805bda3ae8e4861572d8dc0f1d29f3fc3c",
|
"rev": "0fa995bec0e391b45b032fbd9d6e03609a30c115",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ else
|
||||||
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
|
||||||
require fuzzel
|
require fuzzel
|
||||||
count="$(printf "%s\n" "$themes" | wc -l)"
|
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
|
else
|
||||||
require dmenu
|
require dmenu
|
||||||
theme="$(printf "%s\n" "$themes" | dmenu -p 'select theme: ')"
|
theme="$(printf "%s\n" "$themes" | dmenu -p 'select theme: ')"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue