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.lua47
-rw-r--r--ar/.config/shell/profile13
-rw-r--r--ar/.config/yazi/keymap-default.toml2
3 files changed, 58 insertions, 4 deletions
diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
index 6ff4ac6..52ceb01 100644
--- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
+++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ai.lua
@@ -260,6 +260,53 @@ return {
},
},
{
+ "NickvanDyke/opencode.nvim",
+ dependencies = {
+ -- Recommended for `ask()` and `select()`.
+ -- Required for `snacks` provider.
+ ---@module 'snacks' <- Loads `snacks.nvim` types for configuration intellisense.
+ { "folke/snacks.nvim", opts = { input = {}, picker = {}, terminal = {} } },
+ },
+ config = function()
+ ---@type opencode.Opts
+ vim.g.opencode_opts = {
+ -- Your configuration, if any — see `lua/opencode/config.lua`, or "goto definition".
+ }
+
+ -- Required for `opts.events.reload`.
+ vim.o.autoread = true
+
+ -- Recommended/example keymaps.
+ vim.keymap.set({ "n", "x" }, "<C-a>", function()
+ require("opencode").ask("@this: ", { submit = true })
+ end, { desc = "Ask opencode" })
+ vim.keymap.set({ "n", "x" }, "<C-x>", function()
+ require("opencode").select()
+ end, { desc = "Execute opencode action…" })
+ vim.keymap.set({ "n", "t" }, "<C-.>", function()
+ require("opencode").toggle()
+ end, { desc = "Toggle opencode" })
+
+ vim.keymap.set({ "n", "x" }, "go", function()
+ return require("opencode").operator("@this ")
+ end, { expr = true, desc = "Add range to opencode" })
+ vim.keymap.set("n", "goo", function()
+ return require("opencode").operator("@this ") .. "_"
+ end, { expr = true, desc = "Add line to opencode" })
+
+ vim.keymap.set("n", "<S-C-u>", function()
+ require("opencode").command("session.half.page.up")
+ end, { desc = "opencode half page up" })
+ vim.keymap.set("n", "<S-C-d>", function()
+ require("opencode").command("session.half.page.down")
+ end, { desc = "opencode half page down" })
+
+ -- You may want these if you stick with the opinionated "<C-a>" and "<C-x>" above — otherwise consider "<leader>o".
+ vim.keymap.set("n", "+", "<C-a>", { desc = "Increment", noremap = true })
+ vim.keymap.set("n", "-", "<C-x>", { desc = "Decrement", noremap = true })
+ end,
+ },
+ {
"kkrampis/codex.nvim",
lazy = true,
cmd = { "Codex", "CodexToggle" }, -- Optional: Load only on command execution
diff --git a/ar/.config/shell/profile b/ar/.config/shell/profile
index 4d3312b..f68a4b8 100644
--- a/ar/.config/shell/profile
+++ b/ar/.config/shell/profile
@@ -20,8 +20,11 @@ unsetopt PROMPT_SP 2>/dev/null
export BROWSER=$(command -v librewolf || command -v firefox || command -v qutebrowser)
export EDITOR="nvim"
export EDITOR2="vim"
-# export FILE_MANAGER="lf $(lf -version)"
-export FILE_MANAGER="yazi $(yazi --version)"
+if command -v lf >/dev/null 2>&1; then
+ export FILE_MANAGER="lf $(lf -version)"
+elif command -v yazi >/dev/null 2>&1; then
+ export FILE_MANAGER="yazi $(yazi --version)"
+fi
export KEYTIMEOUT=10
export SUDO_EDITOR=$EDITOR
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
@@ -61,6 +64,10 @@ export ANDROID_SDK_HOME="$XDG_CONFIG_HOME/android"
### --- ANSIBLE --- ###
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible/ansible.cfg"
+### --- ASDF --- ###
+export ASDF_CONFIG_FILE="$XDG_CONFIG_HOME/asdf/asdfrc"
+export ASDF_DATA_DIR="$XDG_DATA_HOME/asdf"
+
### --- BAT --- ###
export BAT_CONFIG_PATH="$XDG_CONFIG_HOME/bat/config"
@@ -262,7 +269,7 @@ export SDCV_PAGER='less --quit-if-one-screen -RX'
[ ! -f "$XDG_CONFIG_HOME/shell/shortcutrc" ] && setsid -f shortcuts >/dev/null 2>&1
### --- START GRAPHICAL SERVER ON USER'S CURRENT TTY IF NOT ALREADY RUNNING --- ###
-[ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
+tty -s && [ "$(tty)" = "/dev/tty1" ] && ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
### --- LAPTOP KEYMAP --- ###
sudo -n loadkeys "$XDG_DATA_HOME/thesiah/ttymaps.kmap" 2>/dev/null
diff --git a/ar/.config/yazi/keymap-default.toml b/ar/.config/yazi/keymap-default.toml
index 6b7acad..24c5376 100644
--- a/ar/.config/yazi/keymap-default.toml
+++ b/ar/.config/yazi/keymap-default.toml
@@ -190,7 +190,7 @@ run = "plugin chmod"
desc = "Chmod on selected files"
[[mgr.prepend_keymap]]
-on = "<C-d>"
+on = [ "g", "f" ]
run = "plugin diff"
desc = "Diff the selected with the hovered file"