feature: opencode functions and better telescope search

This commit is contained in:
2026-06-22 15:55:49 +03:00
parent 50d5c4fbd9
commit be8bfc0056
3 changed files with 69 additions and 4 deletions
+22 -2
View File
@@ -66,10 +66,9 @@ alias cfgyazi='(cd ~/.config/yazi && nvim .)'
alias cfgfastfetch='(cd ~/.config/fastfetch && nvim .)'
alias cfgbash='(cd ~/.config/bash && nvim .)'
alias cfgtmux='(cd ~/.config/tmux && nvim .)'
alias cfgopencode='(cd ~/.config/opencode && nvim .)'
alias cfgscripts='(cd ~/config-scripts && nvim .)'
alias cfgquickshell='(cd ~/.config/quickshell && nvim .)'
alias cfgxfce='(cd ~/.config/xfce4 && nvim .)'
alias cfgdriftwm='(cd ~/.config/driftwm && nvim .)'
alias script='(cd ~/scripts && nvim .)'
alias scripts='(cd ~/scripts && nvim .)'
alias notes='(cd ~/Documents/obsidian/Notes && nvim .)'
@@ -189,6 +188,27 @@ look-into-kitty() {
pstree -p "$ABDUCO_PID"
}
opencode-save() {
uuid="$1"
echo "opencode -s $uuid" >>.opencode-session
echo 'Saved the command to continue opencode session to ".opencode-session"'
}
opencode-restore() {
FILE_PATH=".opencode-session"
if [ ! -f "$FILE_PATH" ]; then
echo "Error: no such file - $FILE_PATH"
return 1
fi
uuid=$(awk '/opencode -s/ {print $3}' "$FILE_PATH")
if [ -z "$uuid" ]; then
echo "Error: no sessionn saved"
return 1
fi
echo "Resuming Opencode session with ID: $uuid..."
opencode -s "$uuid"
}
# Imports
if [ -f "$HOME/.bash_private" ]; then
+45 -2
View File
@@ -6,8 +6,51 @@ return {
},
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", builtin.find_files, opts)
vim.keymap.set("n", "<leader>fg", builtin.live_grep, opts)
local shared_ignores = {
-- Core / Git
"^%.git/",
-- Python
"__pycache__/",
"%.pyc",
"%.pyo",
"%.pyd",
"%.venv/",
"env/",
"%.egg%-info/",
"%.ruff_cache",
"%.pytest_cache",
"%uv.lock",
-- Go
"^vendor/",
"bin/",
"%.exe",
-- React / Vue / JavaScript
"node_modules/",
"dist/",
"build/",
"%.next/",
"%.nuxt/",
"%.output/",
-- Miscellaneous system files
"%.DS_Store",
"%.cache/",
}
vim.keymap.set("n", "<leader>ff", function()
builtin.find_files({
hidden = true,
no_ignore = true,
file_ignore_patterns = shared_ignores,
})
end, opts)
vim.keymap.set("n", "<leader>fg", function()
builtin.live_grep({
additional_args = function()
return { "--hidden", "--no-ignore" }
end,
file_ignore_patterns = shared_ignores,
})
end, opts)
vim.keymap.set("n", "<leader>fb", builtin.buffers, opts)
require("yanky").setup()
@@ -9,4 +9,6 @@
<property name="last-show-hidden" type="bool" value="true"/>
<property name="last-sort-column" type="string" value="THUNAR_COLUMN_DATE_MODIFIED"/>
<property name="last-sort-order" type="string" value="GTK_SORT_DESCENDING"/>
<property name="last-details-view-zoom-level" type="string" value="THUNAR_ZOOM_LEVEL_38_PERCENT"/>
<property name="last-details-view-column-widths" type="string" value="50,50,131,50,50,879,50,50,454,50,50,81,50,446"/>
</channel>