Compare commits
5 commits
391b47fa75
...
62ecb566ed
| Author | SHA1 | Date | |
|---|---|---|---|
| 62ecb566ed | |||
| 9583e816d6 | |||
| e6522bdb86 | |||
| 02bd57490f | |||
| bdaefa4d5c |
15 changed files with 449 additions and 396 deletions
33
;
33
;
|
|
@ -1,33 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
options,
|
|
||||||
machine,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
custom.program = mkOption {
|
|
||||||
type = types.attrsOf (
|
|
||||||
types.submodule (
|
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
name = mkOption {
|
|
||||||
type = types.string;
|
|
||||||
};
|
|
||||||
home-config = mkOption {
|
|
||||||
type = types.deferredModule;
|
|
||||||
};
|
|
||||||
system-config = mkOption {
|
|
||||||
type = types.deferredModule;
|
|
||||||
default = _: { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = if builtins.isNull machine.home-only then config.system-config else config.home-config;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
{
|
{ lib
|
||||||
lib,
|
, pkgs
|
||||||
pkgs,
|
, config
|
||||||
config,
|
, secrets
|
||||||
secrets,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
factorioVersion =
|
factorioVersion =
|
||||||
|
|
@ -61,12 +60,11 @@ let
|
||||||
};
|
};
|
||||||
privateUsers = "no";
|
privateUsers = "no";
|
||||||
|
|
||||||
imports =
|
config =
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
systemd.services.factorio.serviceConfig.User = "factorio";
|
systemd.services.factorio.serviceConfig.User = "factorio";
|
||||||
|
|
@ -108,7 +106,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
containers =
|
containers =
|
||||||
factorioContainer "tawney" {
|
factorioContainer "tawney"
|
||||||
|
{
|
||||||
autosave-interval = 20;
|
autosave-interval = 20;
|
||||||
admins = [
|
admins = [
|
||||||
"jonay2000"
|
"jonay2000"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, config
|
||||||
config,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|
@ -63,7 +62,8 @@
|
||||||
nautilus
|
nautilus
|
||||||
|
|
||||||
adwaita-icon-theme
|
adwaita-icon-theme
|
||||||
(pkgs.callPackage (
|
(pkgs.callPackage
|
||||||
|
(
|
||||||
{ stdenv }:
|
{ stdenv }:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "global-cursor-theme";
|
name = "global-cursor-theme";
|
||||||
|
|
@ -79,9 +79,10 @@
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
) { })
|
)
|
||||||
|
{ })
|
||||||
|
|
||||||
config.boot.kernelPackages.perf
|
perf
|
||||||
rr
|
rr
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
imports = lib.concatLists [
|
imports = lib.concatLists [
|
||||||
[
|
[
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
|
./ssh.nix
|
||||||
./nvim
|
./nvim
|
||||||
./fish
|
./fish
|
||||||
./kanata
|
./kanata
|
||||||
|
|
@ -43,11 +44,10 @@
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
requirements = [ "graphical" ];
|
requirements = [ "graphical" ];
|
||||||
home-config =
|
home-config =
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
disableFeatures = [
|
disableFeatures = [
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,10 @@ inputs@{ machine, ... }:
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
requirements = [ "cli" ];
|
requirements = [ "cli" ];
|
||||||
home-config =
|
home-config =
|
||||||
{
|
{ config
|
||||||
config,
|
, pkgs
|
||||||
pkgs,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
with builtins;
|
with builtins;
|
||||||
with lib.attrsets;
|
with lib.attrsets;
|
||||||
|
|
@ -19,8 +18,9 @@ inputs@{ machine, ... }:
|
||||||
"cp-mov" = cp-media "mov" "movies";
|
"cp-mov" = cp-media "mov" "movies";
|
||||||
"cp-ser" = cp-media "ser" "shows";
|
"cp-ser" = cp-media "ser" "shows";
|
||||||
"cp-ani" = cp-media "ani" "anime";
|
"cp-ani" = cp-media "ani" "anime";
|
||||||
|
"ragdoll" = ragdoll;
|
||||||
"dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm";
|
"dumpasm" = "${pkgs.custom.dumpasm}/bin/dumpasm";
|
||||||
"p" = builtins.trace calc calc;
|
"p" = calc;
|
||||||
"s" = "systemctl";
|
"s" = "systemctl";
|
||||||
"j" = "journalctl";
|
"j" = "journalctl";
|
||||||
"ju" = "journalctl -u";
|
"ju" = "journalctl -u";
|
||||||
|
|
@ -239,7 +239,11 @@ inputs@{ machine, ... }:
|
||||||
setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
setupTide = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
setupTide() {
|
setupTide() {
|
||||||
${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${
|
${pkgs.fish}/bin/fish -c ${lib.escapeShellArg "tide configure ${
|
||||||
lib.cli.toGNUCommandLineShell { } {
|
lib.cli.toCommandLineShell (optionName: {
|
||||||
|
option = if builtins.stringLength optionName > 1 then "--${optionName}" else "-${optionName}";
|
||||||
|
sep = null;
|
||||||
|
explicitBool = false;
|
||||||
|
}) {
|
||||||
auto = true;
|
auto = true;
|
||||||
style = "Lean";
|
style = "Lean";
|
||||||
prompt_colors = "True color";
|
prompt_colors = "True color";
|
||||||
|
|
|
||||||
|
|
@ -22,4 +22,16 @@
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
"${s}/bin/cp-${name}";
|
"${s}/bin/cp-${name}";
|
||||||
|
|
||||||
|
ragdoll = "${pkgs.writeScriptBin "ragdoll" ''
|
||||||
|
RAND=$(xxd -l 32 -c 32 -p < /dev/urandom)
|
||||||
|
if [ -z "$TMUX_SESSION_NAME" ]; then
|
||||||
|
RAND=$(cat /dev/urandom | head -c 20 | base32)
|
||||||
|
export TMUX_SESSION_NAME="$RAND"
|
||||||
|
tmux rename-session -t "$(tmux display-message -p "#S")" "$TMUX_SESSION_NAME"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SSH_TMUX_SESSION_NAME="ssh-from-$(hostname)-$TMUX_SESSION_NAME"
|
||||||
|
tmux detach -E "kitten ssh -t ragdoll \"export TMUX_SESSION_NAME=$SSH_TMUX_SESSION_NAME; tmux attach -t $SSH_TMUX_SESSION_NAME || tmux new -e TMUX_SESSION_NAME=$SSH_TMUX_SESSION_NAME -s $SSH_TMUX_SESSION_NAME\"; exec tmux attach -t $TMUX_SESSION_NAME"
|
||||||
|
''}/bin/ragdoll";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ inputs@{ machine, ... }:
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
requirements = [ "cli" ];
|
requirements = [ "cli" ];
|
||||||
home-config = _: {
|
home-config = _: {
|
||||||
|
home.file.".gitignore".text = ''
|
||||||
|
server\ exited\ unexpectedly
|
||||||
|
'';
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
signing.key = "/home/jana/.ssh/id_ed25519.pub";
|
signing.key = "/home/jana/.ssh/id_ed25519.pub";
|
||||||
|
|
|
||||||
|
|
@ -100,8 +100,6 @@ inputs@{ machine, ... }:
|
||||||
"-c"
|
"-c"
|
||||||
script
|
script
|
||||||
];
|
];
|
||||||
in
|
|
||||||
{
|
|
||||||
tug = [
|
tug = [
|
||||||
"bookmark"
|
"bookmark"
|
||||||
"move"
|
"move"
|
||||||
|
|
@ -110,6 +108,9 @@ inputs@{ machine, ... }:
|
||||||
"--to"
|
"--to"
|
||||||
"coalesce(@ & ~empty(), @-)"
|
"coalesce(@ & ~empty(), @-)"
|
||||||
];
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
inherit tug;
|
||||||
fuck = [
|
fuck = [
|
||||||
"bookmark"
|
"bookmark"
|
||||||
"move"
|
"move"
|
||||||
|
|
@ -153,6 +154,18 @@ inputs@{ machine, ... }:
|
||||||
"--from"
|
"--from"
|
||||||
"trunk()"
|
"trunk()"
|
||||||
];
|
];
|
||||||
|
n = [ "edit" "@+" ];
|
||||||
|
p = [ "edit" "@-" ];
|
||||||
|
|
||||||
|
gp = [ "git" "push" ];
|
||||||
|
t = tug;
|
||||||
|
|
||||||
|
d = "describe";
|
||||||
|
dm = [ "describe" "-m" ];
|
||||||
|
e = "edit";
|
||||||
|
s = "squash";
|
||||||
|
si = "squash -i";
|
||||||
|
sp = "split";
|
||||||
};
|
};
|
||||||
|
|
||||||
templates = {
|
templates = {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,11 @@ inputs@{ machine, ... }:
|
||||||
draw_minimal_borders = false;
|
draw_minimal_borders = false;
|
||||||
hide_window_decorations = true;
|
hide_window_decorations = true;
|
||||||
|
|
||||||
shell = "${pkgs.tmux}/bin/tmux";
|
shell = "${pkgs.writeScriptBin "tmux-sesh" ''
|
||||||
|
RAND=$(cat /dev/urandom | head -c 20 | base32)
|
||||||
|
export TMUX_SESSION_NAME="kitty-$RAND"
|
||||||
|
exec ${pkgs.tmux}/bin/tmux new -e TMUX_SESSION_NAME=$TMUX_SESSION_NAME -s "$TMUX_SESSION_NAME"
|
||||||
|
''}/bin/tmux-sesh";
|
||||||
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
|
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
|
||||||
|
|
||||||
foreground = "#fcfcfc";
|
foreground = "#fcfcfc";
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ inputs@{ machine, ... }:
|
||||||
]
|
]
|
||||||
++ (pkgs.lib.splitString " " cmd);
|
++ (pkgs.lib.splitString " " cmd);
|
||||||
|
|
||||||
wallpaper = ("${pkgs.custom.raw-data}/pacific.png");
|
wallpaper = "${pkgs.custom.raw-data}/pacific.png";
|
||||||
matugenSchemeType = "scheme-tonal-spot";
|
matugenSchemeType = "scheme-tonal-spot";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -107,9 +107,12 @@ vim.cmd([[
|
||||||
|
|
||||||
-- multicursor
|
-- multicursor
|
||||||
vim.g.VM_default_mappings = 1
|
vim.g.VM_default_mappings = 1
|
||||||
|
vim.g.VM_mouse_mappings = 1
|
||||||
vim.g.VM_reselect_first = 1
|
vim.g.VM_reselect_first = 1
|
||||||
vim.g.VM_notify_previously_selected = 1
|
vim.g.VM_notify_previously_selected = 1
|
||||||
vim.g.VM_theme = "iceblue"
|
vim.g.VM_theme = "iceblue"
|
||||||
|
-- vim.g.VM_maps["Undo"] = 'u'
|
||||||
|
-- vim.g.VM_maps["Redo"] = '<C-r>'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,10 @@ inputs@{ machine, ... }:
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
requirements = [ "cli" ];
|
requirements = [ "cli" ];
|
||||||
home-config =
|
home-config =
|
||||||
{
|
{ pkgs
|
||||||
pkgs,
|
, flakes
|
||||||
flakes,
|
, lib
|
||||||
lib,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
nvim_mime_types = [
|
nvim_mime_types = [
|
||||||
|
|
@ -58,9 +57,11 @@ inputs@{ machine, ... }:
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.mimeApps.associations.added = lib.mergeAttrsList (
|
xdg.mimeApps.associations.added = lib.mergeAttrsList (
|
||||||
map (mime: {
|
map
|
||||||
|
(mime: {
|
||||||
${mime} = [ "${desktop-entry-name}.desktop" ];
|
${mime} = [ "${desktop-entry-name}.desktop" ];
|
||||||
}) nvim_mime_types
|
})
|
||||||
|
nvim_mime_types
|
||||||
);
|
);
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
|
|
||||||
|
|
@ -384,7 +384,7 @@ in
|
||||||
code_action.keys = {
|
code_action.keys = {
|
||||||
quit = "<Esc>";
|
quit = "<Esc>";
|
||||||
};
|
};
|
||||||
symbol_in_winbar.enable = false;
|
symbol_in_winbar.enable = true;
|
||||||
implement.enable = true;
|
implement.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -435,8 +435,8 @@ in
|
||||||
__unkeyed-1 = "filetype";
|
__unkeyed-1 = "filetype";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
lualine_y = [ { __unkeyed-1 = "progress"; } ];
|
lualine_y = [{ __unkeyed-1 = "progress"; }];
|
||||||
lualine_z = [ { __unkeyed-1 = "location"; } ];
|
lualine_z = [{ __unkeyed-1 = "location"; }];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
42
programs/ssh.nix
Normal file
42
programs/ssh.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
inputs@{ machine, ... }: {
|
||||||
|
imports =
|
||||||
|
machine.program {
|
||||||
|
name = "ssh";
|
||||||
|
inherit inputs;
|
||||||
|
requirements = [ "cli" ];
|
||||||
|
home-config = _: {
|
||||||
|
programs.ssh = {
|
||||||
|
enable = true;
|
||||||
|
enableDefaultConfig = false;
|
||||||
|
matchBlocks = {
|
||||||
|
fili = {
|
||||||
|
user = "jana";
|
||||||
|
hostname = "donsz.nl";
|
||||||
|
};
|
||||||
|
icecube = {
|
||||||
|
hostname = "192.168.178.138";
|
||||||
|
proxyJump = "fili";
|
||||||
|
};
|
||||||
|
ragdoll = {
|
||||||
|
hostname = "192.168.178.138";
|
||||||
|
proxyJump = "fili";
|
||||||
|
};
|
||||||
|
|
||||||
|
"*" = {
|
||||||
|
forwardAgent = false;
|
||||||
|
serverAliveInterval = 0;
|
||||||
|
serverAliveCountMax = 3;
|
||||||
|
compression = false;
|
||||||
|
addKeysToAgent = null;
|
||||||
|
hashKnownHosts = false;
|
||||||
|
userKnownHostsFile = "~/.ssh/known_hosts";
|
||||||
|
controlMaster = "no";
|
||||||
|
controlPath = "~/.ssh/master-%r@%n:%p";
|
||||||
|
controlPersist = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
@ -14,9 +14,12 @@ inputs@{ machine, ... }:
|
||||||
|
|
||||||
shortcut = "k";
|
shortcut = "k";
|
||||||
|
|
||||||
plugins = with pkgs; [
|
plugins =
|
||||||
|
with pkgs;
|
||||||
|
with tmuxPlugins;
|
||||||
|
[
|
||||||
{
|
{
|
||||||
plugin = tmuxPlugins.mkTmuxPlugin {
|
plugin = mkTmuxPlugin {
|
||||||
pluginName = "suspend";
|
pluginName = "suspend";
|
||||||
version = "1a2f806";
|
version = "1a2f806";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
|
|
@ -31,15 +34,13 @@ inputs@{ machine, ... }:
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = tmuxPlugins.mode-indicator;
|
plugin = mode-indicator;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
# unbind every single normal keybinding
|
# unbind every single normal keybinding
|
||||||
unbind-key -a
|
unbind -a
|
||||||
|
|
||||||
set -g status-left "#{?client_prefix,#[bg=colour2],#[bg=colour1]}#[fg=colour0] #S "
|
|
||||||
|
|
||||||
# for special characters to work right
|
# for special characters to work right
|
||||||
# like <C-_>
|
# like <C-_>
|
||||||
|
|
@ -60,39 +61,40 @@ inputs@{ machine, ... }:
|
||||||
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
|
||||||
bind v copy-mode
|
bind v copy-mode
|
||||||
bind p paste-buffer -p
|
bind p paste-buffer -p
|
||||||
|
bind d detach
|
||||||
set -s set-clipboard on
|
set -s set-clipboard on
|
||||||
|
|
||||||
# get back normal terminal emulator bindings
|
# get back normal terminal emulator bindings
|
||||||
bind-key -n S-PPage copy-mode -u
|
bind -n S-PPage copy-mode -u
|
||||||
bind-key -T copy-mode -n S-NPage send-keys -X page-down
|
bind -T copy-mode -n S-NPage send-keys -X page-down
|
||||||
|
|
||||||
# don't scroll to end when copying with mouse
|
# don't scroll to end when copying with mouse
|
||||||
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
|
bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe
|
||||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
|
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe
|
||||||
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
bind -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||||
bind-key -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
bind -T copy-mode TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||||
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
bind -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||||
bind-key -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
bind -T copy-mode-vi TripleClick1Pane select-pane \; send-keys -X select-line \; run-shell -d 0.3 \; send-keys -X copy-pipe
|
||||||
|
|
||||||
# window control
|
# window control
|
||||||
bind t new-window -c "#{pane_current_path}"
|
bind t new-window -c "#{pane_current_path}"
|
||||||
bind-key Tab next-window
|
bind Tab next-window
|
||||||
bind-key BTab previous-window
|
bind BTab previous-window
|
||||||
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
|
set -g automatic-rename-format "#{?#{==:#{pane_current_path},$HOME},~,#{b:pane_current_path}} (#{pane_current_command})"
|
||||||
set -g renumber-windows on
|
set -g renumber-windows on
|
||||||
bind-key Q confirm-before -p "kill-window #W? (y/n)" kill-window
|
bind Q confirm-before -p "kill-window #W? (y/n)" kill-window
|
||||||
bind A last-window
|
bind A last-window
|
||||||
|
|
||||||
bind-key 1 select-window -t :0
|
bind 1 select-window -t :0
|
||||||
bind-key 2 select-window -t :1
|
bind 2 select-window -t :1
|
||||||
bind-key 3 select-window -t :2
|
bind 3 select-window -t :2
|
||||||
bind-key 4 select-window -t :3
|
bind 4 select-window -t :3
|
||||||
bind-key 5 select-window -t :4
|
bind 5 select-window -t :4
|
||||||
bind-key 6 select-window -t :5
|
bind 6 select-window -t :5
|
||||||
bind-key 7 select-window -t :6
|
bind 7 select-window -t :6
|
||||||
bind-key 8 select-window -t :7
|
bind 8 select-window -t :7
|
||||||
bind-key 9 select-window -t :8
|
bind 9 select-window -t :8
|
||||||
bind-key 0 select-window -t :9
|
bind 0 select-window -t :9
|
||||||
|
|
||||||
# pane control
|
# pane control
|
||||||
bind h select-pane -L
|
bind h select-pane -L
|
||||||
|
|
@ -111,40 +113,44 @@ inputs@{ machine, ... }:
|
||||||
bind S-Down split-window -v -c "#{pane_current_path}"
|
bind S-Down split-window -v -c "#{pane_current_path}"
|
||||||
bind S-Up split-window -h -b -c "#{pane_current_path}"
|
bind S-Up split-window -h -b -c "#{pane_current_path}"
|
||||||
bind S-Right split-window -v -b -c "#{pane_current_path}"
|
bind S-Right split-window -v -b -c "#{pane_current_path}"
|
||||||
bind-key -r -T prefix M-h resize-pane -L 5
|
bind -r -T prefix M-h resize-pane -L 5
|
||||||
bind-key -r -T prefix M-j resize-pane -D 5
|
bind -r -T prefix M-j resize-pane -D 5
|
||||||
bind-key -r -T prefix M-k resize-pane -U 5
|
bind -r -T prefix M-k resize-pane -U 5
|
||||||
bind-key -r -T prefix M-l resize-pane -R 5
|
bind -r -T prefix M-l resize-pane -R 5
|
||||||
bind x swap-pane -D
|
bind x swap-pane -D
|
||||||
|
bind z resize-pane -Z
|
||||||
|
|
||||||
|
# swap a full screen and terminal
|
||||||
|
bind a if -F "#{?window_zoomed_flag,0,1}" "select-pane -l ; resize-pane -Z" "resize-pane -Z ; select-pane -l"
|
||||||
|
|
||||||
# double-click ^k (or lshift with kanata) for previous pane like ^w in vim
|
# double-click ^k (or lshift with kanata) for previous pane like ^w in vim
|
||||||
bind -r ^k select-pane -l
|
bind -r ^k select-pane -l
|
||||||
bind-key q confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
bind q confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
||||||
|
|
||||||
# bind-key o choose-tree -wZ
|
# bind o choose-tree -wZ
|
||||||
# bind-key O choose-tree -sZ
|
# bind O choose-tree -sZ
|
||||||
|
|
||||||
# get back command mode and some other basics...
|
# get back command mode and some other basics...
|
||||||
bind : command-prompt
|
bind : command-prompt
|
||||||
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
|
bind r source-file ~/.config/tmux/tmux.conf \; display "config reloaded"
|
||||||
bind-key ? list-keys
|
bind ? list-keys
|
||||||
|
|
||||||
# Scroll oin man etc
|
# Scroll in man etc
|
||||||
tmux_commands_with_legacy_scroll="nano less more man git"
|
tmux_commands_with_legacy_scroll="nano less more man git"
|
||||||
|
|
||||||
bind-key -T root WheelUpPane \
|
bind -T root WheelUpPane \
|
||||||
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
|
if-shell -Ft= '#{?mouse_any_flag,1,#{pane_in_mode}}' \
|
||||||
'send -Mt=' \
|
'send -Mt=' \
|
||||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||||
"send -t= Up" "copy-mode -et="'
|
"send -t= Up" "copy-mode -et="'
|
||||||
|
|
||||||
bind-key -T root WheelDownPane \
|
bind -T root WheelDownPane \
|
||||||
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
|
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
|
||||||
'send -Mt=' \
|
'send -Mt=' \
|
||||||
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
'if-shell -t= "#{?alternate_on,true,false} || echo \"#{tmux_commands_with_legacy_scroll}\" | grep -q \"#{pane_current_command}\"" \
|
||||||
"send -t= Down" "send -Mt="'
|
"send -t= Down" "send -Mt="'
|
||||||
|
|
||||||
bind-key -T copy-mode-vi ] \
|
bind -T copy-mode-vi ] \
|
||||||
send-keys -X clear-selection \; \
|
send-keys -X clear-selection \; \
|
||||||
send-keys -X search-forward "--> " \; \
|
send-keys -X search-forward "--> " \; \
|
||||||
send-keys -X next-word \; \
|
send-keys -X next-word \; \
|
||||||
|
|
@ -152,7 +158,7 @@ inputs@{ machine, ... }:
|
||||||
send-keys -X jump-forward ":" \; \
|
send-keys -X jump-forward ":" \; \
|
||||||
send-keys -X jump-to-forward ":" \;
|
send-keys -X jump-to-forward ":" \;
|
||||||
|
|
||||||
bind-key -T copy-mode-vi [ \
|
bind -T copy-mode-vi [ \
|
||||||
send-keys -X clear-selection \; \
|
send-keys -X clear-selection \; \
|
||||||
send-keys -X start-of-line \; \
|
send-keys -X start-of-line \; \
|
||||||
send-keys -X search-backward "--> " \; \
|
send-keys -X search-backward "--> " \; \
|
||||||
|
|
@ -161,10 +167,8 @@ inputs@{ machine, ... }:
|
||||||
send-keys -X jump-forward ":" \; \
|
send-keys -X jump-forward ":" \; \
|
||||||
send-keys -X jump-to-forward ":" \;
|
send-keys -X jump-to-forward ":" \;
|
||||||
|
|
||||||
bind-key [ copy-mode \; send-keys [
|
bind [ copy-mode \; send-keys [
|
||||||
bind-key ] copy-mode \; send-keys ]
|
bind ] copy-mode \; send-keys ]
|
||||||
|
|
||||||
bind d select-pane -l \; send-keys [
|
|
||||||
|
|
||||||
# f: file search
|
# f: file search
|
||||||
# unbound: git files
|
# unbound: git files
|
||||||
|
|
@ -174,32 +178,31 @@ inputs@{ machine, ... }:
|
||||||
# M-i: ips
|
# M-i: ips
|
||||||
# include line and column numbers in file search
|
# include line and column numbers in file search
|
||||||
# rebind `f` so we can reuse it here
|
# rebind `f` so we can reuse it here
|
||||||
bind-key -T prefix C-f command-prompt { find-window -Z "%%" }
|
bind -T prefix C-f command-prompt { find-window -Z "%%" }
|
||||||
# jyn is so sorry, and so am I now
|
# jyn is so sorry, and so am I now
|
||||||
# https://github.com/jyn514/dotfiles/blob/65be3c004113290f41f858f4d7f1a6799fabab19/config/tmux.conf#L203-L212
|
# https://github.com/jyn514/dotfiles/blob/65be3c004113290f41f858f4d7f1a6799fabab19/config/tmux.conf#L203-L212
|
||||||
# see `search-regex.sh` for wtf this means
|
# see `search-regex.sh` for wtf this means
|
||||||
# TODO: include shell variable names
|
# TODO: include shell variable names
|
||||||
bind-key f copy-mode \; send-keys -X search-backward '(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))'
|
bind f copy-mode \; send-keys -X search-backward '(^|/|\<|[[:space:]"])((\.|\.\.)|[[:alnum:]~_"-]*)((/[][[:alnum:]_.#$%&+=@"-]+)+([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)|(/[][[:alnum:]_.#$%&+=@"-]+){2,}([/ "]|\.([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?)|[][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)(:[0-9]+)?)?|(\.|\.\.)/([][[:alnum:]_.#$%&+=@"-]+(:[0-9]+)?(:[0-9]+)?))'
|
||||||
# urls
|
# urls
|
||||||
bind-key u copy-mode \; send-keys -X search-backward '(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&*+-]*'
|
bind u copy-mode \; send-keys -X search-backward '(https?://|git@|git://|ssh://|ftp://|file:///)[[:alnum:]?=%/_.:,;~@!#$&*+-]*'
|
||||||
# hashes
|
# hashes
|
||||||
bind-key g copy-mode \; send-keys -X search-backward '[[:<:]]([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{64})[[:>:]]'
|
bind g copy-mode \; send-keys -X search-backward '[[:<:]]([0-9a-f]{7,40}|[[:alnum:]]{52}|[0-9a-f]{64})[[:>:]]'
|
||||||
# ips
|
# ips
|
||||||
bind-key M-i copy-mode \; send-keys -X search-backward '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}'
|
bind M-i copy-mode \; send-keys -X search-backward '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}'
|
||||||
|
|
||||||
bind-key -T copy-mode-vi o send-keys -X copy-pipe \
|
bind -T copy-mode-vi o send-keys -X copy-pipe \
|
||||||
'cd #{pane_current_path}; xargs -I {} echo "echo {}" | bash | xargs ${../nvim/editor-hax.py} xdg-open-proxy' \; \
|
'cd #{pane_current_path}; xargs -I {} echo "echo {}" | bash | xargs ${../nvim/editor-hax.py} xdg-open-proxy' \; \
|
||||||
if -F "#{alternate_on}" { send-keys -X cancel }
|
if -F "#{alternate_on}" { send-keys -X cancel }
|
||||||
# save the buffer, then open an editor in the current pane
|
# save the buffer, then open an editor in the current pane
|
||||||
bind-key -T copy-mode-vi O send-keys -X copy-pipe-and-cancel \
|
bind -T copy-mode-vi O send-keys -X copy-pipe-and-cancel \
|
||||||
'tmux send-keys "C-q"; xargs -I {} tmux send-keys "vim {}"; tmux send-keys "C-m"'
|
'tmux send-keys "C-q"; xargs -I {} tmux send-keys "vim {}"; tmux send-keys "C-m"'
|
||||||
# search for the highlighted text
|
# search for the highlighted text
|
||||||
bind-key -T copy-mode-vi s send-keys -X copy-pipe \
|
bind -T copy-mode-vi s send-keys -X copy-pipe \
|
||||||
"cd #{pane_current_path}; xargs -I {} open 'https://www.google.com/search?q={}'" \; \
|
"cd #{pane_current_path}; xargs -I {} open 'https://www.google.com/search?q={}'" \; \
|
||||||
if -F "#{alternate_on}" { send-keys -X cancel }
|
if -F "#{alternate_on}" { send-keys -X cancel }
|
||||||
# save buffer and retype into the shell
|
# save buffer and retype into the shell
|
||||||
bind-key -T copy-mode-vi Tab send-keys -X copy-selection-and-cancel \; paste-buffer -p
|
bind -T copy-mode-vi Tab send-keys -X copy-selection-and-cancel \; paste-buffer -p
|
||||||
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue