mirror of
https://github.com/zoriya/flake.git
synced 2025-12-05 22:26:21 +00:00
Use osc52 for every copy/paste in the terminal
This commit is contained in:
@@ -45,7 +45,9 @@
|
||||
ssh-tunnel = pkgs.writeShellScriptBin "ssh-tunnel" ''
|
||||
while true; do
|
||||
dns-sd -m -Q fuhen.local
|
||||
echo "Host found, starting tunnel" | tee /dev/stderr
|
||||
ssh -NR "2222:localhost:22" zoriya@fuhen.local
|
||||
echo "Connetion closed" | tee /dev/stderr
|
||||
sleep 5
|
||||
done
|
||||
'';
|
||||
|
||||
@@ -93,8 +93,6 @@
|
||||
if pkgs.stdenv.isLinux
|
||||
then "ss -tlpun"
|
||||
else "netstat -anvp tcp | awk 'NR<3 || /LISTEN/'";
|
||||
# habits
|
||||
copyfile = "clipcopy";
|
||||
|
||||
# viu doesn't work with tmux, icat does. using that while waiting
|
||||
viu = "kitty +kitten icat";
|
||||
@@ -128,16 +126,6 @@
|
||||
src = pkgs.oh-my-zsh;
|
||||
file = "share/oh-my-zsh/plugins/git/git.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "clipcopy"; # dependency of copypath & copyfile
|
||||
src = pkgs.oh-my-zsh;
|
||||
file = "share/oh-my-zsh/lib/clipboard.zsh";
|
||||
}
|
||||
{
|
||||
name = "copypath";
|
||||
src = pkgs.oh-my-zsh;
|
||||
file = "share/oh-my-zsh/plugins/copypath/copypath.plugin.zsh";
|
||||
}
|
||||
];
|
||||
completionInit =
|
||||
#bash
|
||||
@@ -362,6 +350,7 @@
|
||||
usql
|
||||
rsync
|
||||
moreutils
|
||||
osc
|
||||
# bitwarden-cli
|
||||
]
|
||||
++ lib.optionals pkgs.stdenv.isLinux [
|
||||
|
||||
@@ -108,3 +108,10 @@ _kgy() {
|
||||
_kubectl
|
||||
}
|
||||
compdef _kgy kgy
|
||||
|
||||
alias copyfile="osc copy"
|
||||
copypath() {
|
||||
local file="${1:-.}"
|
||||
[[ $file = /* ]] || file="$PWD/$file"
|
||||
print -n "${file:a}" | osc copy || return 1
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ vim.keymap.set("v", "<", "<gv")
|
||||
vim.keymap.set("v", ">", ">gv")
|
||||
|
||||
-- Copy to/from system clipboard
|
||||
vim.g.clipboard = 'osc52'
|
||||
vim.keymap.set({ "n", "x" }, "<leader>y", '"+y', { desc = "Yank to system clipboard" })
|
||||
vim.keymap.set({ "n", "x" }, "<leader>Y", '"+y$', { desc = "Yank line to system clipboard" })
|
||||
vim.keymap.set({ "n", "x" }, "<leader>p", '"+p', { desc = "Past from system clipboard" })
|
||||
|
||||
@@ -23,6 +23,11 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
# they try to use passthrough if they detect tmux. we don't want that.
|
||||
osc = wrapProgram super.osc ["osc"] ''
|
||||
--set TMUX ""
|
||||
'';
|
||||
|
||||
# it doesn't start without this, no clue why.
|
||||
freecad = wrapProgram super.freecad ["freecad" "FreeCAD" "freecadcmd" "FreeCADCmd"] ''
|
||||
--set QT_QPA_PLATFORM 'wayland;xcb' \
|
||||
|
||||
Reference in New Issue
Block a user