summaryrefslogtreecommitdiff
path: root/ar/.config
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config')
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua72
-rw-r--r--ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua32
-rw-r--r--ar/.config/lf/lfrc32
-rw-r--r--ar/.config/shell/aliasrc7
4 files changed, 127 insertions, 16 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
index 4ac8762..ee97612 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
@@ -260,6 +260,75 @@ return {
},
},
{
+ "greggh/claude-code.nvim",
+ dependencies = {
+ "nvim-lua/plenary.nvim", -- Required for git operations
+ },
+ config = function()
+ require("claude-code").setup({
+ -- Terminal window settings
+ window = {
+ split_ratio = 0.3, -- Percentage of screen for the terminal window (height for horizontal, width for vertical splits)
+ position = "vertical", -- Position of the window: "botright", "topleft", "vertical", "float", etc.
+ enter_insert = true, -- Whether to enter insert mode when opening Claude Code
+ hide_numbers = true, -- Hide line numbers in the terminal window
+ hide_signcolumn = true, -- Hide the sign column in the terminal window
+
+ -- Floating window configuration (only applies when position = "float")
+ float = {
+ width = "80%", -- Width: number of columns or percentage string
+ height = "80%", -- Height: number of rows or percentage string
+ row = "center", -- Row position: number, "center", or percentage string
+ col = "center", -- Column position: number, "center", or percentage string
+ relative = "editor", -- Relative to: "editor" or "cursor"
+ border = "rounded", -- Border style: "none", "single", "double", "rounded", "solid", "shadow"
+ },
+ },
+ -- File refresh settings
+ refresh = {
+ enable = true, -- Enable file change detection
+ updatetime = 100, -- updatetime when Claude Code is active (milliseconds)
+ timer_interval = 1000, -- How often to check for file changes (milliseconds)
+ show_notifications = true, -- Show notification when files are reloaded
+ },
+ -- Git project settings
+ git = {
+ use_git_root = true, -- Set CWD to git root when opening Claude Code (if in git project)
+ },
+ -- Shell-specific settings
+ shell = {
+ separator = "&&", -- Command separator used in shell commands
+ pushd_cmd = "pushd", -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell)
+ popd_cmd = "popd", -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell)
+ },
+ -- Command settings
+ command = "claude", -- Command used to launch Claude Code
+ -- Command variants
+ command_variants = {
+ -- Conversation management
+ continue = "--continue", -- Resume the most recent conversation
+ resume = "--resume", -- Display an interactive conversation picker
+
+ -- Output options
+ verbose = "--verbose", -- Enable verbose logging with full turn-by-turn output
+ },
+ -- Keymaps
+ keymaps = {
+ toggle = {
+ normal = "<C-,>", -- Normal mode keymap for toggling Claude Code, false to disable
+ terminal = "<C-,>", -- Terminal mode keymap for toggling Claude Code, false to disable
+ variants = {
+ continue = "<leader>cC", -- Normal mode keymap for Claude Code with continue flag
+ verbose = "<leader>cV", -- Normal mode keymap for Claude Code with verbose flag
+ },
+ },
+ window_navigation = true, -- Enable window navigation keymaps (<C-h/j/k/l>)
+ scrolling = true, -- Enable scrolling keymaps (<C-f/b>) for page up/down
+ },
+ })
+ end,
+ },
+ {
"NickvanDyke/opencode.nvim",
dependencies = {
-- Recommended for `ask()` and `select()`.
@@ -387,7 +456,7 @@ return {
instructions_file = "avante.md",
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
---@type Provider
- provider = "openai", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode
+ provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode
---@alias Mode "agentic" | "legacy"
---@type Mode
mode = "agentic", -- The default mode for interaction. "agentic" uses tools to automatically generate code, "legacy" uses the old planning method to generate code.
@@ -398,6 +467,7 @@ return {
providers = {
claude = {
endpoint = "https://api.anthropic.com",
+ auth_type = "max", -- Set to "max" to sign in with Claude Pro/Max subscription
model = "claude-sonnet-4-20250514",
timeout = 30000, -- Timeout in milliseconds
extra_request_body = {
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
index 90528a1..f1c636b 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
@@ -3,15 +3,46 @@ local ls = require("luasnip")
local s = ls.snippet
local i = ls.insert_node
local f = ls.function_node
+local c = ls.choice_node
+local t = ls.text_node
local fmt = require("luasnip.extras.fmt").fmta
+local function bgm_list()
+ local handle = io.popen("ssh root@thesiah.xyz 'ls /var/www/thesiah/bgm/' 2>/dev/null")
+ if not handle then
+ return nil
+ end
+
+ local result = handle:read("*a")
+ handle:close()
+
+ if not result or result == "" then
+ return nil
+ end
+
+ local choices = {}
+ for filename in result:gmatch("[^\r\n]+") do
+ table.insert(choices, t(filename))
+ end
+
+ if #choices == 0 then
+ return nil
+ end
+
+ return choices
+end
+
+local bgm_choices = bgm_list()
+local bgm_node = bgm_choices and c(2, bgm_choices) or i(2, "bgm")
+
local diary_snippet = s(
"diary",
fmt(
[[---
title: <title>
date: <date>
+bgm: <bgm>
---
<story>
@@ -21,6 +52,7 @@ date: <date>
date = f(function()
return os.date("%Y-%m-%d")
end, {}),
+ bgm = bgm_node,
story = i(3),
}
)
diff --git a/ar/.config/lf/lfrc b/ar/.config/lf/lfrc
index 64416d3..becd52c 100644
--- a/ar/.config/lf/lfrc
+++ b/ar/.config/lf/lfrc
@@ -101,16 +101,24 @@ cmd yank-basename $basename -a -- $fx | head -c-1 | xclip -i -selection clipboar
cmd yank-basename-without-extension &basename -a -- $fx | cut -d. -f1 | head -c-1 | xclip -i -selection clipboard
# Create
-cmd mkdir ${{ clear; tput cup $(($(tput lines)/3)); tput bold
- printf "Directory Name: "
- read ans
- mkdir -p $ans
-}}
-cmd mkfile ${{
- clear; tput cup $(($(tput lines)/3)); tput bold
- printf "File Name: "
- read ans
- $EDITOR $ans
+cmd mkdir %{{
+ IFS=" "
+ file="$*"
+ mkdir -p -- "$file"
+ lf -remote "send $id cd \"$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')\""
+}}
+cmd touch %{{
+ IFS=" "
+ file="$*"
+ case "$file" in
+ /*) ;;
+ *) file="$PWD/$file" ;;
+ esac
+ dir="${file%/*}"
+ [ "$dir" != "$file" ] && mkdir -p -- "$dir"
+ touch -- "$file"
+ file="$(printf '%s' "$file" | sed 's/\\/\\\\/g;s/"/\\"/g')"
+ lf -remote "send $id :select \"$file\"; \$\$EDITOR \"$file\""
}}
cmd link %{{
set -- $(cat ~/.local/share/lf/files)
@@ -500,8 +508,8 @@ map yt $printf "%s" "$fx" | sed -E 's/^.+\[/https:\/\/www.youtube.com\/watch?v=/
map yy copy
# Create
-map Md mkdir
-map Mf mkfile
+map Md push :mkdir<space>
+map Mf push :touch<space>
map Ml link
# Cut
diff --git a/ar/.config/shell/aliasrc b/ar/.config/shell/aliasrc
index d353cd3..1cf6045 100644
--- a/ar/.config/shell/aliasrc
+++ b/ar/.config/shell/aliasrc
@@ -12,7 +12,7 @@
[ -f "$MBSYNCRC" ] && alias mbsync='mbsync -c $MBSYNCRC'
# sudo not required for some system commands
-for command in blkid lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
+for command in arp-scan blkid docker ecrypt lazydocker lsblk mount umount pacman poweroff reboot shutdown su sv updatedb; do
alias $command="sudo $command"
done
unset command
@@ -487,7 +487,8 @@ alias sps="source ${XDG_CONFIG_HOME:-${HOME}/.config}/shell/profile"
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 ylogi='ylog -s hidden -c us | grep $(LC_TIME=C date -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
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 -d "yesterday" +%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 -d "1 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
+alias ylogr='ylog -s diary -c us | grep $(LC_TIME=C date -d "2 days ago" +%d/%b) | grep -E "[0-9]{2}:[0-9]{2}:[0-9]{2} "'
alias ylogu='ylog -s diary -c us'