repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk

eab17ecac5835c3e74149fa0e95a2809798dc00b

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

nushell/login.nu

Modified
17 17 use svn-completions.nu *
19 +use svn-completions.nu *
19 21 if $env.WIN32 {
20 22 use refreshenv.nu *

nushell/scripts/commands.nu

Modified
17 17 rm -fp $tmp
20 +# creates a backup of the given file in a temporary directory and prints the path
21 +export def bak [
22 + file: path # the file to copy into a backup
23 +] {
24 + if not ($file | path exists ) {
25 + error make {
26 + msg: "The file to backup does not exist.",
27 + label: {
28 + text: "Missing its existence!",
29 + span: (metadata $file).span
30 + }
31 + }
32 + }
33 + let full_path = $file | path expand
34 + let tmpdir = mktemp --directory --tmpdir backup_XXX
35 + let backup = $tmpdir | path join ( $file | path basename )
36 + let backup_original_path = $tmpdir | path join 'original.path'
37 + $full_path | save $backup_original_path
38 + cp --preserve [ mode timestamps ] $file $backup
39 + print $backup
42 +# restores a backup previously made with `bak` command
43 +export def kab [
44 + backup: path # a backup file to restore
45 +] {
46 + if not ($backup | path exists ) {
47 + error make {
48 + msg: "The backup file does not exist.",
49 + label: {
50 + text: "Missing its existence!",
51 + span: (metadata $backup).span
52 + }
53 + }
54 + }
55 + let backup_file = $backup | path expand
56 + if ($backup_file !~ 'backup_' ) {
57 + error make {
58 + msg: "The file does not seem to be a backup file from `bak`.",
59 + label: {
60 + text: "Are u even bak'ed up?",
61 + span: (metadata $backup).span
62 + }
63 + }
64 + }
65 + let backup_dir = $backup | path dirname
66 + let original_path_file = $backup_dir | path join 'original.path'
67 + let original_path = open --raw $original_path_file
68 + try {
69 + mv --progress --interactive --verbose $backup_file $original_path
70 + } catch {
71 + return # skip deletion
72 + }
73 + rm --trash --recursive $backup_dir

wezterm/bugabinga/key_binds.lua

Modified
59 59 { key = 'v', action = wez.action.SplitHorizontal { domain = 'CurrentPaneDomain', }, },
60 60 { key = 's', action = wez.action.SplitVertical { domain = 'CurrentPaneDomain', }, },
62 + { key = 'r', action = wez.action.RotatePanes 'CounterClockwise', },
63 + { key = 'R', action = wez.action.RotatePanes 'Clockwise', },
62 64 { key = '=', action = wez.action.ActivateKeyTable { name = resize_pane_mode, one_shot = false, }, },
64 66 { key = 'q', action = wez.action.CloseCurrentPane { confirm = false, }, },