summaryrefslogtreecommitdiff
path: root/mac/.config
diff options
context:
space:
mode:
Diffstat (limited to 'mac/.config')
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua2
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua18
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua (renamed from mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua)8
-rw-r--r--mac/.config/shell/aliasrc8
-rw-r--r--mac/.config/tmux/tmux.conf2
-rw-r--r--mac/.config/zsh/scripts.zsh10
6 files changed, 26 insertions, 22 deletions
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
index 52ceb01..4ac8762 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
@@ -277,7 +277,7 @@ return {
vim.o.autoread = true
-- Recommended/example keymaps.
- vim.keymap.set({ "n", "x" }, "<C-a>", function()
+ vim.keymap.set({ "n", "x" }, "<C-q>", function()
require("opencode").ask("@this: ", { submit = true })
end, { desc = "Ask opencode" })
vim.keymap.set({ "n", "x" }, "<C-x>", function()
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
index be4daa4..a9e39c2 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/mini.lua
@@ -927,18 +927,18 @@ return {
---@param buf_id integer
---@return nil
local function updateGitStatus(buf_id)
- local cwd = vim.uv.cwd()
- if not cwd or not vim.fs.root(cwd, ".git") then
+ local git_root = vim.fs.root(buf_id, ".git")
+ if not git_root then
return
end
local currentTime = os.time()
- if gitStatusCache[cwd] and currentTime - gitStatusCache[cwd].time < cacheTimeout then
- updateMiniWithGit(buf_id, gitStatusCache[cwd].statusMap)
+ if gitStatusCache[git_root] and currentTime - gitStatusCache[git_root].time < cacheTimeout then
+ updateMiniWithGit(buf_id, gitStatusCache[git_root].statusMap)
else
- fetchGitStatus(cwd, function(content)
+ fetchGitStatus(git_root, function(content)
local gitStatusMap = parseGitStatus(content)
- gitStatusCache[cwd] = {
+ gitStatusCache[git_root] = {
time = currentTime,
statusMap = gitStatusMap,
}
@@ -979,9 +979,9 @@ return {
pattern = "MiniFilesBufferUpdate",
callback = function(sii)
local bufnr = sii.data.buf_id
- local cwd = vim.fn.expand("%:p:h")
- if gitStatusCache[cwd] then
- updateMiniWithGit(bufnr, gitStatusCache[cwd].statusMap)
+ local git_root = vim.fs.root(bufnr, ".git")
+ if git_root and gitStatusCache[git_root] then
+ updateMiniWithGit(bufnr, gitStatusCache[git_root].statusMap)
end
end,
})
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
index 9ce9124..90528a1 100644
--- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/recordings.lua
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
@@ -6,8 +6,8 @@ local f = ls.function_node
local fmt = require("luasnip.extras.fmt").fmta
-local recordings_snippet = s(
- "recordings",
+local diary_snippet = s(
+ "diary",
fmt(
[[---
title: <title>
@@ -26,5 +26,5 @@ date: <date>
)
)
-ls.add_snippets("markdown", { recordings_snippet })
-ls.add_snippets("quarto", { recordings_snippet })
+ls.add_snippets("markdown", { diary_snippet })
+ls.add_snippets("quarto", { diary_snippet })
diff --git a/mac/.config/shell/aliasrc b/mac/.config/shell/aliasrc
index 6dcdf7d..64783f8 100644
--- a/mac/.config/shell/aliasrc
+++ b/mac/.config/shell/aliasrc
@@ -383,7 +383,7 @@ alias skype='skypeforlinux'
# ssh
alias gts="ssh $THESIAH_SERVER"
-alias wwr="ssh recordings"
+alias wwr="ssh diary"
# sudo
alias su='sudo su -l root'
@@ -501,6 +501,6 @@ alias szs="source ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh/.zshrc"
alias ylogh='ylog -s hidden -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
alias ylogi='ylog -s hidden -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
-alias ylogt='ylog -s recordings -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
-alias ylogy='ylog -s recordings -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
-alias ylogu='ylog -s recordings -c us'
+alias ylogt='ylog -s diary -c us | grep $(LC_TIME=C date +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
+alias ylogy='ylog -s diary -c us | grep $(LC_TIME=C date -v-1d +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
+alias ylogu='ylog -s diary -c us'
diff --git a/mac/.config/tmux/tmux.conf b/mac/.config/tmux/tmux.conf
index eb13530..156cfff 100644
--- a/mac/.config/tmux/tmux.conf
+++ b/mac/.config/tmux/tmux.conf
@@ -319,7 +319,7 @@ set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│"
# TODO: configure when the battery is available
set -ga status-right "#{?#{<=:#{battery_percentage},0},#{#[bg=default,fg=#{@thm_red}] #{battery_icon} },#{#[bg=default,fg=#{@thm_green}]} #{battery_icon} #{battery_percentage} }"
set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│"
-set -ga status-right "#[bg=default]#{?#{==:#{online_status},ok},#[fg=#{@thm_pink}] 󰖩 ,#[fg=#{@thm_red},bold]#[reverse] 󰖪 }"
+set -ga status-right "#{?#{==:#{online_status},ok},#{#[fg=#{@thm_pink}] 󰖩 },#{#[fg=#{@thm_red},bold,reverse]} 󰖪 }"
set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│"
# set -ga status-right "#[bg=default,fg=#{@thm_red}] #{weather} "
# set -ga status-right "#[bg=default,fg=#{@thm_overlay_0},none]│"
diff --git a/mac/.config/zsh/scripts.zsh b/mac/.config/zsh/scripts.zsh
index f92a6c4..ac59ca6 100644
--- a/mac/.config/zsh/scripts.zsh
+++ b/mac/.config/zsh/scripts.zsh
@@ -388,9 +388,13 @@ EOF
)
[[ -z "${SELECTED_DIRS// }" ]] && return
if [[ "$(echo "$SELECTED_DIRS" | wc -l)" -eq 1 ]]; then
- cd "$SELECTED_DIRS"
- if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain)" ]]; then
- git status --porcelain 2>/dev/null
+ if [[ -n "$TMUX" ]]; then
+ opensessions "$SELECTED_DIRS"
+ else
+ cd "$SELECTED_DIRS" || return
+ if [[ -n "$(git -C "$SELECTED_DIRS" status --porcelain 2>/dev/null)" ]]; then
+ git status --porcelain
+ fi
fi
else
opensessions "$SELECTED_DIRS"