From 23ba9b1a7f56ae0556e7187b1eb327eda649a0aa Mon Sep 17 00:00:00 2001 From: TuDatTr Date: Mon, 6 Mar 2023 10:20:51 +0100 Subject: [PATCH] Replace byobu with zellij Signed-off-by: TuDatTr --- config/.config/i3/config | 4 +- config/.config/nushell/config.nu | 557 +++++++++++++++++++++++++++ config/.config/nushell/env.nu | 70 ++++ config/.config/starship.toml | 64 +++ config/.config/zellij/config.kdl | 299 ++++++++++++++ config/.local/share/ranger/bookmarks | 2 +- config/.scripts/zellij-chooser.nu | 21 + emacs/.doom.d/custom.el | 105 ++++- emacs/.doom.d/init.el | 4 +- zsh/.zshrc | 5 +- 10 files changed, 1115 insertions(+), 16 deletions(-) create mode 100644 config/.config/nushell/config.nu create mode 100644 config/.config/nushell/env.nu create mode 100644 config/.config/starship.toml create mode 100644 config/.config/zellij/config.kdl create mode 100755 config/.scripts/zellij-chooser.nu diff --git a/config/.config/i3/config b/config/.config/i3/config index d292e43..0572e1f 100644 --- a/config/.config/i3/config +++ b/config/.config/i3/config @@ -124,7 +124,7 @@ bindsym $mod+Shift+s exec poweroff # start a terminal bindsym $mod+space exec alacritty -bindsym $mod+Return exec alacritty -e byobu +bindsym $mod+Return exec alacritty -e nu /home/tuan/.scripts/zellij-chooser.nu # kill focused window bindsym $mod+Shift+q kill @@ -149,7 +149,7 @@ bindsym XF86AudioPrevious exec "playerctl previous; cmus-remote -r" # Application Shortcuts bindsym $mod+b exec firefox bindsym $mod+p exec firefox --private-window https://mos4.de -bindsym $mod+e exec alacritty -e ranger +bindsym $mod+e exec emacsclient -c bindsym $mod+m exec thunderbird # Whole Screen diff --git a/config/.config/nushell/config.nu b/config/.config/nushell/config.nu new file mode 100644 index 0000000..0774dc9 --- /dev/null +++ b/config/.config/nushell/config.nu @@ -0,0 +1,557 @@ +# Nushell Config File + +# For more information on defining custom themes, see +# https://www.nushell.sh/book/coloring_and_theming.html +# And here is the theme collection +# https://github.com/nushell/nu_scripts/tree/main/themes +let dark_theme = { + # color for nushell primitives + separator: white + leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off + header: green_bold + empty: blue + # Closures can be used to choose colors for specific values. + # The value (in this case, a bool) is piped into the closure. + bool: { if $in { 'light_cyan' } else { 'light_gray' } } + int: white + filesize: {|e| + if $e == 0b { + 'white' + } else if $e < 1mb { + 'cyan' + } else { 'blue' } + } + duration: white + date: { (date now) - $in | + if $in < 1hr { + 'red3b' + } else if $in < 6hr { + 'orange3' + } else if $in < 1day { + 'yellow3b' + } else if $in < 3day { + 'chartreuse2b' + } else if $in < 1wk { + 'green3b' + } else if $in < 6wk { + 'darkturquoise' + } else if $in < 52wk { + 'deepskyblue3b' + } else { 'dark_gray' } + } + range: white + float: white + string: white + nothing: white + binary: white + cellpath: white + row_index: green_bold + record: white + list: white + block: white + hints: dark_gray + + shape_and: purple_bold + shape_binary: purple_bold + shape_block: blue_bold + shape_bool: light_cyan + shape_custom: green + shape_datetime: cyan_bold + shape_directory: cyan + shape_external: cyan + shape_externalarg: green_bold + shape_filepath: cyan + shape_flag: blue_bold + shape_float: purple_bold + # shapes are used to change the cli syntax highlighting + shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b} + shape_globpattern: cyan_bold + shape_int: purple_bold + shape_internalcall: cyan_bold + shape_list: cyan_bold + shape_literal: blue + shape_matching_brackets: { attr: u } + shape_nothing: light_cyan + shape_operator: yellow + shape_or: purple_bold + shape_pipe: purple_bold + shape_range: yellow_bold + shape_record: cyan_bold + shape_redirection: purple_bold + shape_signature: green_bold + shape_string: green + shape_string_interpolation: cyan_bold + shape_table: blue_bold + shape_variable: purple +} + +let light_theme = { + # color for nushell primitives + separator: dark_gray + leading_trailing_space_bg: { attr: n } # no fg, no bg, attr none effectively turns this off + header: green_bold + empty: blue + # Closures can be used to choose colors for specific values. + # The value (in this case, a bool) is piped into the closure. + bool: { if $in { 'dark_cyan' } else { 'dark_gray' } } + int: dark_gray + filesize: {|e| + if $e == 0b { + 'dark_gray' + } else if $e < 1mb { + 'cyan_bold' + } else { 'blue_bold' } + } + duration: dark_gray + date: { (date now) - $in | + if $in < 1hr { + 'red3b' + } else if $in < 6hr { + 'orange3' + } else if $in < 1day { + 'yellow3b' + } else if $in < 3day { + 'chartreuse2b' + } else if $in < 1wk { + 'green3b' + } else if $in < 6wk { + 'darkturquoise' + } else if $in < 52wk { + 'deepskyblue3b' + } else { 'dark_gray' } + } + range: dark_gray + float: dark_gray + string: dark_gray + nothing: dark_gray + binary: dark_gray + cellpath: dark_gray + row_index: green_bold + record: white + list: white + block: white + hints: dark_gray + + shape_and: purple_bold + shape_binary: purple_bold + shape_block: blue_bold + shape_bool: light_cyan + shape_custom: green + shape_datetime: cyan_bold + shape_directory: cyan + shape_external: cyan + shape_externalarg: green_bold + shape_filepath: cyan + shape_flag: blue_bold + shape_float: purple_bold + # shapes are used to change the cli syntax highlighting + shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b} + shape_globpattern: cyan_bold + shape_int: purple_bold + shape_internalcall: cyan_bold + shape_list: cyan_bold + shape_literal: blue + shape_matching_brackets: { attr: u } + shape_nothing: light_cyan + shape_operator: yellow + shape_or: purple_bold + shape_pipe: purple_bold + shape_range: yellow_bold + shape_record: cyan_bold + shape_redirection: purple_bold + shape_signature: green_bold + shape_string: green + shape_string_interpolation: cyan_bold + shape_table: blue_bold + shape_variable: purple +} + +# External completer example +# let carapace_completer = {|spans| +# carapace $spans.0 nushell $spans | from json +# } + + +# The default config record. This is where much of your global configuration is setup. +let-env config = { + ls: { + use_ls_colors: true # use the LS_COLORS environment variable to colorize output + clickable_links: true # enable or disable clickable links. Your terminal has to support links. + } + rm: { + always_trash: false # always act as if -t was given. Can be overridden with -p + } + cd: { + abbreviations: false # allows `cd s/o/f` to expand to `cd some/other/folder` + } + table: { + mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other + trim: { + methodology: wrapping # wrapping or truncating + wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology + truncating_suffix: "..." # A suffix used by the 'truncating' methodology + } + } + + explore: { + help_banner: true + exit_esc: true + + command_bar_text: '#C4C9C6' + # command_bar: {fg: '#C4C9C6' bg: '#223311' } + + status_bar_background: {fg: '#1D1F21' bg: '#C4C9C6' } + # status_bar_text: {fg: '#C4C9C6' bg: '#223311' } + + highlight: {bg: 'yellow' fg: 'black' } + + status: { + # warn: {bg: 'yellow', fg: 'blue'} + # error: {bg: 'yellow', fg: 'blue'} + # info: {bg: 'yellow', fg: 'blue'} + } + + try: { + # border_color: 'red' + # highlighted_color: 'blue' + + # reactive: false + } + + table: { + split_line: '#404040' + + cursor: true + + line_index: true + line_shift: true + line_head_top: true + line_head_bottom: true + + show_head: true + show_index: true + + # selected_cell: {fg: 'white', bg: '#777777'} + # selected_row: {fg: 'yellow', bg: '#C1C2A3'} + # selected_column: blue + + # padding_column_right: 2 + # padding_column_left: 2 + + # padding_index_left: 2 + # padding_index_right: 1 + } + + config: { + cursor_color: {bg: 'yellow' fg: 'black' } + + # border_color: white + # list_color: green + } + } + + history: { + max_size: 10000 # Session has to be reloaded for this to take effect + sync_on_enter: true # Enable to share history between multiple sessions, else you have to close the session to write history to file + file_format: "plaintext" # "sqlite" or "plaintext" + } + completions: { + case_sensitive: false # set to true to enable case-sensitive completions + quick: true # set this to false to prevent auto-selecting completions when only one remains + partial: true # set this to false to prevent partial filling of the prompt + algorithm: "prefix" # prefix or fuzzy + external: { + enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up my be very slow + max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options + completer: null # check 'carapace_completer' above as an example + } + } + filesize: { + metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard) + format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto + } + + color_config: $dark_theme # if you want a light theme, replace `$dark_theme` to `$light_theme` + use_grid_icons: true + footer_mode: "25" # always, never, number_of_rows, auto + float_precision: 2 # the precision for displaying floats in tables + # buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL + use_ansi_coloring: true + edit_mode: emacs # emacs, vi + shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue + # true or false to enable or disable the welcome banner at startup + show_banner: false + render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt. + + hooks: { + pre_prompt: [{ + null # replace with source code to run before the prompt is shown + }] + pre_execution: [{ + null # replace with source code to run before the repl input is run + }] + env_change: { + PWD: [{|before, after| + null # replace with source code to run if the PWD environment is different since the last repl input + }] + } + display_output: { + if (term size).columns >= 100 { table -e } else { table } + } + } + menus: [ + # Configuration for default nushell menus + # Note the lack of source parameter + { + name: completion_menu + only_buffer_difference: false + marker: "| " + type: { + layout: columnar + columns: 4 + col_width: 20 # Optional value. If missing all the screen width is used to calculate column width + col_padding: 2 + } + style: { + text: green + selected_text: green_reverse + description_text: yellow + } + } + { + name: history_menu + only_buffer_difference: true + marker: "? " + type: { + layout: list + page_size: 10 + } + style: { + text: green + selected_text: green_reverse + description_text: yellow + } + } + { + name: help_menu + only_buffer_difference: true + marker: "? " + type: { + layout: description + columns: 4 + col_width: 20 # Optional value. If missing all the screen width is used to calculate column width + col_padding: 2 + selection_rows: 4 + description_rows: 10 + } + style: { + text: green + selected_text: green_reverse + description_text: yellow + } + } + # Example of extra menus created using a nushell source + # Use the source field to create a list of records that populates + # the menu + { + name: commands_menu + only_buffer_difference: false + marker: "# " + type: { + layout: columnar + columns: 4 + col_width: 20 + col_padding: 2 + } + style: { + text: green + selected_text: green_reverse + description_text: yellow + } + source: { |buffer, position| + $nu.scope.commands + | where name =~ $buffer + | each { |it| {value: $it.name description: $it.usage} } + } + } + { + name: vars_menu + only_buffer_difference: true + marker: "# " + type: { + layout: list + page_size: 10 + } + style: { + text: green + selected_text: green_reverse + description_text: yellow + } + source: { |buffer, position| + $nu.scope.vars + | where name =~ $buffer + | sort-by name + | each { |it| {value: $it.name description: $it.type} } + } + } + { + name: commands_with_description + only_buffer_difference: true + marker: "# " + type: { + layout: description + columns: 4 + col_width: 20 + col_padding: 2 + selection_rows: 4 + description_rows: 10 + } + style: { + text: green + selected_text: green_reverse + description_text: yellow + } + source: { |buffer, position| + $nu.scope.commands + | where name =~ $buffer + | each { |it| {value: $it.name description: $it.usage} } + } + } + ] + keybindings: [ + { + name: completion_menu + modifier: none + keycode: tab + mode: [emacs vi_normal vi_insert] + event: { + until: [ + { send: menu name: completion_menu } + { send: menunext } + ] + } + } + { + name: completion_previous + modifier: shift + keycode: backtab + mode: [emacs, vi_normal, vi_insert] # Note: You can add the same keybinding to all modes by using a list + event: { send: menuprevious } + } + { + name: history_menu + modifier: control + keycode: char_r + mode: emacs + event: { send: menu name: history_menu } + } + { + name: next_page + modifier: control + keycode: char_x + mode: emacs + event: { send: menupagenext } + } + { + name: undo_or_previous_page + modifier: control + keycode: char_z + mode: emacs + event: { + until: [ + { send: menupageprevious } + { edit: undo } + ] + } + } + { + name: yank + modifier: control + keycode: char_y + mode: emacs + event: { + until: [ + {edit: pastecutbufferafter} + ] + } + } + { + name: unix-line-discard + modifier: control + keycode: char_u + mode: [emacs, vi_normal, vi_insert] + event: { + until: [ + {edit: cutfromlinestart} + ] + } + } + { + name: kill-line + modifier: control + keycode: char_k + mode: [emacs, vi_normal, vi_insert] + event: { + until: [ + {edit: cuttolineend} + ] + } + } + # Keybindings used to trigger the user defined menus + { + name: commands_menu + modifier: control + keycode: char_t + mode: [emacs, vi_normal, vi_insert] + event: { send: menu name: commands_menu } + } + { + name: vars_menu + modifier: alt + keycode: char_o + mode: [emacs, vi_normal, vi_insert] + event: { send: menu name: vars_menu } + } + { + name: commands_with_description + modifier: control + keycode: char_s + mode: [emacs, vi_normal, vi_insert] + event: { send: menu name: commands_with_description } + } + ] + +} + +def add_soft [project] { git remote add soft ssh://git.aya00:/$project } + +alias ll = ls -la +alias la = ls -a +alias q = exit +alias e = emacsclient -t +alias ekill = (pkill emacs; pkill emacsclient; emacs --daemon) +alias picotik = picocom --b 115200 /dev/ttyUSB0 +alias xsel = xsel -ib +alias nmap = nmap -T5 --min-parallelism 100 -Pn +alias ed = emacs --daemon +alias eledger = emacsclient -nw ~/Documents/Finanzen/Ledger/MyBudget.ledger +alias sshconfig = emacsclient -nw ~/.ssh/config +alias econfig = emacsclient -nw ~/.doom.d/init.el +alias wttr = curl wttr.in/Essen +alias tvres = xrandr --output HDMI1 --transform 1.02,0,-20,0,1.02,-10,0,0,1 +alias defaultres = xrandr --output HDMI1 --transform 1.00,0,0,0,1.00,0,0,0,1 +alias latexmk = latexmk -f -pdf -interaction=nonstopmode + +# git +alias gpa = git push soft --all +alias gras = add_soft +alias gd = git diff +alias gp = git push +alias gcsm = git commit -s -m +alias gaa = git add --all +alias gco = git checkout +alias grv = git remote -v + +let-env PATH = ($env.PATH | append /home/tuan/.emacs.d/bin/) +let-env DOCKER_BUILDKIT = 1 +source ~/.cache/starship/init.nu diff --git a/config/.config/nushell/env.nu b/config/.config/nushell/env.nu new file mode 100644 index 0000000..e573cae --- /dev/null +++ b/config/.config/nushell/env.nu @@ -0,0 +1,70 @@ +# Nushell Environment Config File + +def create_left_prompt [] { + let home = ($env | get -i (if $nu.os-info.name == "windows" { "USERPROFILE" } else { "HOME" }) | into string) + let dir = ([ + ($env.PWD | str substring 0..($home | str length) | str replace -s $home "~"), + ($env.PWD | str substring ($home | str length)..) + ] | str join) + + let path_segment = if (is-admin) { + $"(ansi red_bold)($dir)" + } else { + $"(ansi green_bold)($dir)" + } + + $path_segment +} + +def create_right_prompt [] { + let time_segment = ([ + (date now | date format '%m/%d/%Y %r') + ] | str join) + + $time_segment +} + +# Use nushell functions to define your right and left prompt +let-env PROMPT_COMMAND = { create_left_prompt } +let-env PROMPT_COMMAND_RIGHT = { create_right_prompt } + +# The prompt indicators are environmental variables that represent +# the state of the prompt +let-env PROMPT_INDICATOR = { "〉" } +let-env PROMPT_INDICATOR_VI_INSERT = { ": " } +let-env PROMPT_INDICATOR_VI_NORMAL = { "〉" } +let-env PROMPT_MULTILINE_INDICATOR = { "::: " } + +# Specifies how environment variables are: +# - converted from a string to a value on Nushell startup (from_string) +# - converted from a value back to a string when running external commands (to_string) +# Note: The conversions happen *after* config.nu is loaded +let-env ENV_CONVERSIONS = { + "PATH": { + from_string: { |s| $s | split row (char esep) | path expand -n } + to_string: { |v| $v | path expand -n | str join (char esep) } + } + "Path": { + from_string: { |s| $s | split row (char esep) | path expand -n } + to_string: { |v| $v | path expand -n | str join (char esep) } + } +} + +# Directories to search for scripts when calling source or use +# +# By default, /scripts is added +let-env NU_LIB_DIRS = [ + ($nu.config-path | path dirname | path join 'scripts') +] + +# Directories to search for plugin binaries when calling register +# +# By default, /plugins is added +let-env NU_PLUGIN_DIRS = [ + ($nu.config-path | path dirname | path join 'plugins') +] + +# To add entries to PATH (on Windows you might use Path), you can use the following pattern: +# let-env PATH = ($env.PATH | split row (char esep) | prepend '/some/path') +let-env VISUAL = 'emacsclient -t' +let-env EDITOR = 'emacsclient -t' diff --git a/config/.config/starship.toml b/config/.config/starship.toml new file mode 100644 index 0000000..8b77bf4 --- /dev/null +++ b/config/.config/starship.toml @@ -0,0 +1,64 @@ +format = """ +[░▒▓](#a3aed2)\ +[  ](bg:#a3aed2 fg:#090c0c)\ +[](bg:#769ff0 fg:#a3aed2)\ +$directory\ +[](fg:#769ff0 bg:#394260)\ +$git_branch\ +$git_status\ +[](fg:#394260 bg:#212736)\ +$nodejs\ +$rust\ +$golang\ +$php\ +[](fg:#212736 bg:#1d2230)\ +$time\ +[ ](fg:#1d2230)\ +\n$character""" + +[directory] +style = "fg:#e3e5e5 bg:#769ff0" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +[directory.substitutions] +"Documents" = " " +"Downloads" = " " +"Music" = " " +"Pictures" = " " + +[git_branch] +symbol = "" +style = "bg:#394260" +format = '[[ $symbol $branch ](fg:#769ff0 bg:#394260)]($style)' + +[git_status] +style = "bg:#394260" +format = '[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)' + +[nodejs] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[rust] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[golang] +symbol = "ﳑ" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[php] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[time] +disabled = false +time_format = "%R" # Hour:Minute Format +style = "bg:#1d2230" +format = '[[  $time ](fg:#a0a9cb bg:#1d2230)]($style)' diff --git a/config/.config/zellij/config.kdl b/config/.config/zellij/config.kdl new file mode 100644 index 0000000..688af61 --- /dev/null +++ b/config/.config/zellij/config.kdl @@ -0,0 +1,299 @@ +// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true" +keybinds { + normal { + // uncomment this and adjust key if using copy_on_select=false + // bind "Alt c" { Copy; } + } + locked { + bind "Ctrl g" { SwitchToMode "Normal"; } + } + resize { + bind "Ctrl n" { SwitchToMode "Normal"; } + bind "h" "Left" { Resize "Increase Left"; } + bind "j" "Down" { Resize "Increase Down"; } + bind "k" "Up" { Resize "Increase Up"; } + bind "l" "Right" { Resize "Increase Right"; } + bind "H" { Resize "Decrease Left"; } + bind "J" { Resize "Decrease Down"; } + bind "K" { Resize "Decrease Up"; } + bind "L" { Resize "Decrease Right"; } + bind "=" "+" { Resize "Increase"; } + bind "-" { Resize "Decrease"; } + } + pane { + bind "Ctrl p" { SwitchToMode "Normal"; } + bind "h" "Left" { MoveFocus "Left"; } + bind "l" "Right" { MoveFocus "Right"; } + bind "j" "Down" { MoveFocus "Down"; } + bind "k" "Up" { MoveFocus "Up"; } + bind "p" { SwitchFocus; } + bind "n" { NewPane; SwitchToMode "Normal"; } + bind "d" { NewPane "Down"; SwitchToMode "Normal"; } + bind "r" { NewPane "Right"; SwitchToMode "Normal"; } + bind "x" { CloseFocus; SwitchToMode "Normal"; } + bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + bind "z" { TogglePaneFrames; SwitchToMode "Normal"; } + bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; } + bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; } + bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;} + } + move { + bind "Ctrl h" { SwitchToMode "Normal"; } + bind "n" "Tab" { MovePane; } + bind "h" "Left" { MovePane "Left"; } + bind "j" "Down" { MovePane "Down"; } + bind "k" "Up" { MovePane "Up"; } + bind "l" "Right" { MovePane "Right"; } + } + tab { + bind "Ctrl t" { SwitchToMode "Normal"; } + bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; } + bind "h" "Left" "Up" "k" { GoToPreviousTab; } + bind "l" "Right" "Down" "j" { GoToNextTab; } + bind "n" { NewTab; SwitchToMode "Normal"; } + bind "x" { CloseTab; SwitchToMode "Normal"; } + bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; } + bind "1" { GoToTab 1; SwitchToMode "Normal"; } + bind "2" { GoToTab 2; SwitchToMode "Normal"; } + bind "3" { GoToTab 3; SwitchToMode "Normal"; } + bind "4" { GoToTab 4; SwitchToMode "Normal"; } + bind "5" { GoToTab 5; SwitchToMode "Normal"; } + bind "6" { GoToTab 6; SwitchToMode "Normal"; } + bind "7" { GoToTab 7; SwitchToMode "Normal"; } + bind "8" { GoToTab 8; SwitchToMode "Normal"; } + bind "9" { GoToTab 9; SwitchToMode "Normal"; } + bind "Tab" { ToggleTab; } + } + scroll { + bind "Ctrl s" { SwitchToMode "Normal"; } + bind "e" { EditScrollback; SwitchToMode "Normal"; } + bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "j" "Down" { ScrollDown; } + bind "k" "Up" { ScrollUp; } + bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } + bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + // uncomment this and adjust key if using copy_on_select=false + // bind "Alt c" { Copy; } + } + search { + bind "Ctrl s" { SwitchToMode "Normal"; } + bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; } + bind "j" "Down" { ScrollDown; } + bind "k" "Up" { ScrollUp; } + bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; } + bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; } + bind "d" { HalfPageScrollDown; } + bind "u" { HalfPageScrollUp; } + bind "n" { Search "down"; } + bind "p" { Search "up"; } + bind "c" { SearchToggleOption "CaseSensitivity"; } + bind "w" { SearchToggleOption "Wrap"; } + bind "o" { SearchToggleOption "WholeWord"; } + } + entersearch { + bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; } + bind "Enter" { SwitchToMode "Search"; } + } + renametab { + bind "Ctrl c" { SwitchToMode "Normal"; } + bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; } + } + renamepane { + bind "Ctrl c" { SwitchToMode "Normal"; } + bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; } + } + session { + bind "Ctrl o" { SwitchToMode "Normal"; } + bind "Ctrl s" { SwitchToMode "Scroll"; } + bind "d" { Detach; } + } + tmux { + bind "[" { SwitchToMode "Scroll"; } + bind "Ctrl b" { Write 2; SwitchToMode "Normal"; } + bind "\"" { NewPane "Down"; SwitchToMode "Normal"; } + bind "%" { NewPane "Right"; SwitchToMode "Normal"; } + bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; } + bind "c" { NewTab; SwitchToMode "Normal"; } + bind "," { SwitchToMode "RenameTab"; } + bind "p" { GoToPreviousTab; SwitchToMode "Normal"; } + bind "n" { GoToNextTab; SwitchToMode "Normal"; } + bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; } + bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; } + bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; } + bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; } + bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; } + bind "o" { FocusNextPane; } + bind "d" { Detach; } + } + shared_except "locked" { + bind "Ctrl g" { SwitchToMode "Locked"; } + bind "Ctrl q" { Quit; } + bind "Alt n" { NewPane; } + bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } + bind "Alt j" "Alt Down" { MoveFocus "Down"; } + bind "Alt k" "Alt Up" { MoveFocus "Up"; } + bind "Alt =" "Alt +" { Resize "Increase"; } + bind "Alt -" { Resize "Decrease"; } + } + shared_except "normal" "locked" { + bind "Enter" "Esc" { SwitchToMode "Normal"; } + } + shared_except "pane" "locked" { + bind "Ctrl p" { SwitchToMode "Pane"; } + } + shared_except "resize" "locked" { + bind "Ctrl n" { SwitchToMode "Resize"; } + } + shared_except "scroll" "locked" { + bind "Ctrl s" { SwitchToMode "Scroll"; } + } + shared_except "session" "locked" { + bind "Ctrl o" { SwitchToMode "Session"; } + } + shared_except "tab" "locked" { + bind "Ctrl t" { SwitchToMode "Tab"; } + } + shared_except "move" "locked" { + bind "Ctrl h" { SwitchToMode "Move"; } + } + shared_except "tmux" "locked" { + bind "Ctrl b" { SwitchToMode "Tmux"; } + } +} + +plugins { + tab-bar { path "tab-bar"; } + status-bar { path "status-bar"; } + strider { path "strider"; } + compact-bar { path "compact-bar"; } +} + +// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP +// eg. when terminal window with an active zellij session is closed +// Options: +// - detach (Default) +// - quit +// +// on_force_close "quit" + +// Send a request for a simplified ui (without arrow fonts) to plugins +// Options: +// - true +// - false (Default) +// +// simplified_ui true + +// Choose the path to the default shell that zellij will use for opening new panes +// Default: $SHELL +// +// default_shell "fish" + +// Toggle between having pane frames around the panes +// Options: +// - true (default) +// - false +// +// pane_frames true + +// Define color themes for Zellij +// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes +// Once these themes are defined, one of them should to be selected in the "theme" section of this file +// +themes { + tokyo-night-dark { + fg 169 177 214 + bg 26 27 38 + black 56 62 90 + red 249 51 87 + green 158 206 106 + yellow 224 175 104 + blue 122 162 247 + magenta 187 154 247 + cyan 42 195 222 + white 192 202 245 + orange 255 158 100 + } +} + +// Choose the theme that is specified in the themes section. +// Default: default +// +theme "tokyo-night-dark" + +// The name of the default layout to load on startup +// Default: "default" +// +// default_layout "compact" + +// Choose the mode that zellij uses when starting up. +// Default: normal +// +// default_mode "locked" + +// Toggle enabling the mouse mode. +// On certain configurations, or terminals this could +// potentially interfere with copying text. +// Options: +// - true (default) +// - false +// +// mouse_mode false + +// Configure the scroll back buffer size +// This is the number of lines zellij stores for each pane in the scroll back +// buffer. Excess number of lines are discarded in a FIFO fashion. +// Valid values: positive integers +// Default value: 10000 +// +// scroll_buffer_size 10000 + +// Provide a command to execute when copying text. The text will be piped to +// the stdin of the program to perform the copy. This can be used with +// terminal emulators which do not support the OSC 52 ANSI control sequence +// that will be used by default if this option is not set. +// Examples: +// +// copy_command "xclip -selection clipboard" // x11 +// copy_command "wl-copy" // wayland +// copy_command "pbcopy" // osx + +// Choose the destination for copied text +// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. +// Does not apply when using copy_command. +// Options: +// - system (default) +// - primary +// +// copy_clipboard "primary" + +// Enable or disable automatic copy (and clear) of selection when releasing mouse +// Default: true +// +// copy_on_select false + +// Path to the default editor to use to edit pane scrollbuffer +// Default: $EDITOR or $VISUAL +// +// scrollback_editor "/usr/bin/vim" + +// When attaching to an existing session with other users, +// should the session be mirrored (true) +// or should each user have their own cursor (false) +// Default: false +// +// mirror_session true + +// The folder in which Zellij will look for layouts +// +// layout_dir "/path/to/my/layout_dir" + +// The folder in which Zellij will look for themes +// +// theme_dir "/path/to/my/theme_dir" diff --git a/config/.local/share/ranger/bookmarks b/config/.local/share/ranger/bookmarks index 4df5ad8..3c55145 100644 --- a/config/.local/share/ranger/bookmarks +++ b/config/.local/share/ranger/bookmarks @@ -9,7 +9,7 @@ t:/home/tuan/Templates w:/home/tuan/workspace_l/home_lab/wiki k:/home/tuan/.syncthing/Documents/Uni/Studium/2022_Sommersemester/Bachelorprojekt/Implement EFCF based on libAFL/git/foundry/evm/src/executor q:/home/tuan/Documents/Arbeit/Uni-DuE_NCS_SHK/04_-_Projekte/04-5G_IANA/02-gps -':/home/tuan/workspace_l/home_lab/ansible +':/home/tuan/.syncthing/Documents/Uni/Studium e:/home/tuan/Documents/CTF/TryHackMe/Ice/2_Recon s:/home/tuan/Pictures/Screenshots v:/home/tuan/.aya01/Documents/Arbeit/Uni-DuE_NCS_SHK/04_-_Projekte/06-Server_Setup/ansible diff --git a/config/.scripts/zellij-chooser.nu b/config/.scripts/zellij-chooser.nu new file mode 100755 index 0000000..00cfb4f --- /dev/null +++ b/config/.scripts/zellij-chooser.nu @@ -0,0 +1,21 @@ +#!/usr/bin/env nu + +let zellij_session_table = (zellij ls | lines); +let zellij_session_count = ($zellij_session_table | length); + +if $zellij_session_count == 0 { + zellij +} else if $zellij_session_count == 1 { + zellij attach +} else { + let prompt = $" +zellij sessions: + +($zellij_session_table|table) + +Choose session 0-($zellij_session_count - 1): + "; + let user_input = (input $"($prompt)"| into int); + let table_entry = ($zellij_session_table | select $user_input) + zellij attach $table_entry; +} diff --git a/emacs/.doom.d/custom.el b/emacs/.doom.d/custom.el index 8c3bbb2..034c166 100644 --- a/emacs/.doom.d/custom.el +++ b/emacs/.doom.d/custom.el @@ -3,16 +3,103 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. + '(org-hugo-base-dir "~/Documents/hugo/") '(org-roam-capture-templates - '(("d" "default" plain "%?" :target - (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") - :unnarrowed t) - ("p" "project" plain "* Project Description\n\n- Type: %^{Project Type}\n- Project Partner: %?\n\n* Tasks\n\n** TODO Add initial taks\n\n* Deadlines\n" :target - (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") - :unnarrowed t) - ("l" "lecture" plain "- Lecture: ${title}\\n\\n- Lecturer: %^{Docent}\\n- Research Group: %^{Research Group}\\n* Description\\n\\n " :target - (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") - :unnarrowed t nil nil)))) + '(("d" "default" plain "* Description +%? + +* Resources +- " :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") +:unnarrowed t) + ("r" "Code Implementation" plain "* Description +%? + +* Methods + +** TODO + +*** Description + +*** Code + +* Resources +- " :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} +#+filetags: code") +:unnarrowed t) + ("t" "Rust Traits" plain "* Description +%? + +* Notable Implementations/Subtraits + + + +* Methods + +** TODO + +*** Description + +*** Code + +* Resources +- " :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} +#+filetags: rust-trait") +:unnarrowed t) + ("P" "project" plain "* Project Overview +- Type: %^{Project Type} +- Project Partners: + - %? + +* Project Description + +* Tasks + +** TODO Add initial taks + +* Sprints + +** +" :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} +#+filetags: project") +:unnarrowed t) + ("p" "paper" plain "* Authors +- %? + +* Index Terms +- + +* Short Summary +" :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} +#+filetags: paper") +:unnarrowed t) + ("l" "programming language" plain "* Description +%? + +* Programming Language Properties +- + +* Benefits +- + +* Examples +** Hello World +#+begin_src ${title} +#+end_src +" :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") +:unnarrowed t) + ("L" "lecture" plain "- Lecture: ${title} +- Lecturer: %^{Docent} +- Research Group: %^{Research Group} +* Description +" :target +(file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") +:unnarrowed t nil nil)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs/.doom.d/init.el b/emacs/.doom.d/init.el index 677c244..a7f03b6 100644 --- a/emacs/.doom.d/init.el +++ b/emacs/.doom.d/init.el @@ -93,7 +93,7 @@ ;;biblio ; Writes a PhD for you (citation needed) debugger ; FIXME stepping through code, to help you add bugs ;;direnv - ;;docker + docker ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval @@ -189,7 +189,7 @@ ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. ;;web ; the tubes - ;;yaml ; JSON, but readable + yaml ; JSON, but readable ;;zig ; C, but simpler :email diff --git a/zsh/.zshrc b/zsh/.zshrc index f0ff293..ba4c1c7 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -34,13 +34,14 @@ alias econfig="emacsclient -nw ~/.doom.d/init.el" alias wttr="curl wttr.in/Essen" alias tvres="xrandr --output HDMI1 --transform 1.02,0,-20,0,1.02,-10,0,0,1" alias defaultres="xrandr --output HDMI1 --transform 1.00,0,0,0,1.00,0,0,0,1" -alias zshconfig="emacsclient -vw ~/.zshrc; source ~/.zshrc;" +alias zshconfig="emacsclient -nw ~/.zshrc; source ~/.zshrc;" alias notify="dunstify \"ping~\"" alias ekill="pkill emacs; pkill emacsclient; ed" alias latexmk="latexmk -f -pdf -interaction=nonstopmode" alias picotik="picocom --b 115200 /dev/ttyUSB0" ## git alias gps="git push soft --all" +alias gras="add_soft_git" # Theme ZSH_THEME="agnoster" @@ -57,5 +58,5 @@ randpw() { < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-$1};echo;}; # Source source $ZSH/oh-my-zsh.sh -gras() { git remote add soft ssh://git.aya01:/$1 } +add_soft_git() { git remote add soft ssh://git.aya01:/$1 } open_emacs() { emacsclient -c $1 & disown; };