Compare commits

..

No commits in common. "442ed8ab4e22920e3aca2d9b45b3fc85590ad402" and "83093f463b3af3443c7502d65e6e767169f38d37" have entirely different histories.

2 changed files with 23 additions and 51 deletions

View File

@ -1,32 +1,22 @@
local function save_dir()
local dir = require("oil").get_current_dir()
if dir ~= nil then
local f = io.open("/tmp/oil_dir", "w")
if f then
f:write(dir)
f:close()
end
end
end
return { return {
'stevearc/oil.nvim', 'stevearc/oil.nvim',
dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true, dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true,
opts = { opts = {
keymaps = { keymaps = {
["g?"] = "actions.show_help", ["g?"] = "actions.show_help",
["<CR>"] = function() require("oil").select({}, save_dir) end, ["<CR>"] = "actions.select",
["<leader>v"] = "actions.select_vsplit", ["<leader>v"] = "actions.select_vsplit",
["<leader>s"] = "actions.select_split", ["<leader>s"] = "actions.select_split",
["<leader>p"] = "actions.preview", ["<leader>p"] = "actions.preview",
["<backspace>"] = "actions.close", ["<backspace>"] = "actions.close",
["<leader>r"] = "actions.refresh", ["<leader>r"] = "actions.refresh",
["-"] = function() require("oil").open(); save_dir() end, ["-"] = "actions.parent",
["_"] = "actions.open_cwd", ["_"] = "actions.open_cwd",
["`"] = "actions.cd", ["`"] = "actions.cd",
["~"] = "actions.tcd", ["~"] = "actions.tcd",
["g."] = "actions.toggle_hidden", ["g."] = "actions.toggle_hidden",
}, },
-- Set to false to disable all of the above keymaps
use_default_keymaps = false, use_default_keymaps = false,
} }
} }

View File

@ -112,40 +112,24 @@ function zvm_after_init() {
fi fi
if [ ! -f $FZY_CACHE ]; then if [ ! -f $FZY_CACHE ]; then
PATHS="" PATHS=""
if [ -d ~/.dotfiles ]; then
for i in \ PATHS="$PATHS\n~/.dotfiles"
~/.config/waybar \ PATHS="$PATHS\n$(fd . ~/.dotfiles -t d -d 2)"
~/.config/xmodmap \ fi
~/.config/zsh \ if [ -d ~/Workspace ]; then
~/.config/tmux \ PATHS="$PATHS\n$(fd . ~/Workspace -t d -d 8)"
~/.config/vim \ fi
~/.config/qtile \ if [ -d ~/Containers ]; then
~/.config/rofi \ PATHS="$PATHS\n$(fd . ~/Containers -t d -d 2)"
~/.config/scripts \ fi
~/.config/nvim \ if [ -d ~/Storage/Shared ]; then
~/.config/picom \ PATHS="$PATHS\n/home/server/Storage/Shared"
~/.config/polybar \ PATHS="$PATHS\n$(fd . ~/Storage/Shared -t d -d 2)"
~/.config/awesome \ fi
~/.config/dunst \ if [ -d ~/Storage/Thomas ]; then
~/.config/firefox \ PATHS="$PATHS\n/home/server/Storage/Thomas"
~/.config/git \ PATHS="$PATHS\n$(fd . ~/Storage/Thomas -t d -d 5)"
~/.config/gitui \ fi
~/.config/helix \
~/.config/hypr \
~/.config/i3 \
~/.config/kitty \
~/.config/mpv \
~/.config/alacritty \
~/Workspace \
~/Containers \
~/Storage/Shared \
~/Storage/Thomas; do
if [ -d $i ]; then
PATHS="$PATHS\n$i/"
PATHS="$PATHS\n$(fd . $i -t d -d 5)"
fi
done
echo -e $PATHS > $FZY_CACHE echo -e $PATHS > $FZY_CACHE
fi fi
cd_to "$(cat $FZY_CACHE | fzy -l 20)" cd_to "$(cat $FZY_CACHE | fzy -l 20)"
@ -249,8 +233,7 @@ function o () {
function run_waypipe() { function run_waypipe() {
SSH_SESSION_ID=$RANDOM SSH_SESSION_ID=$RANDOM
REMOTE_PATH=$(echo $(pwd) | sed "s|/home/[a-z]*|\$HOME|g") SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t $1 env REMOTE_PATH=\"$(pwd)\" SSH_SESSION_ID=$SSH_SESSION_ID "zsh --login"
SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t $1 env REMOTE_PATH=\"$REMOTE_PATH\" SSH_SESSION_ID=$SSH_SESSION_ID "zsh --login"
} }
alias mallorea="run_waypipe mallorea" alias mallorea="run_waypipe mallorea"
@ -273,12 +256,11 @@ alias ll='ls -lhat'
alias clip="xsel --clipboard" alias clip="xsel --clipboard"
alias compress="tar --use-compress-program=lbzip2 -cvf" alias compress="tar --use-compress-program=lbzip2 -cvf"
alias vim="nvim" alias vim="nvim"
alias dot='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"' alias dotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config" alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config"
alias python=python3 alias python=python3
alias r=". ranger" alias r=". ranger"
alias v="vim . && cd \"\$(cat /tmp/oil_dir)\""
alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1" alias cpr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1"
alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files" alias mvr="rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files"
alias rg="rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'" alias rg="rg -i --colors 'match:bg:yellow' --colors 'match:fg:black' --colors 'match:style:nobold' --colors 'path:fg:green' --colors 'path:style:bold' --colors 'line:fg:yellow' --colors 'line:style:bold'"