From 95e3445db0a18e87c5c826240b5af4bb55bba118 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Mon, 9 Oct 2023 17:14:40 +0100 Subject: switch to alacritty + starship --- .bashrc | 12 +++- .config/alacritty.yml | 90 +++++++++++++++++++++++ .config/starship.toml | 194 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 294 insertions(+), 2 deletions(-) create mode 100644 .config/alacritty.yml create mode 100644 .config/starship.toml diff --git a/.bashrc b/.bashrc index 41d0fa4..55121e4 100644 --- a/.bashrc +++ b/.bashrc @@ -32,7 +32,7 @@ shopt -s no_empty_cmd_completion function xtitle() { case $TERM in - xterm*|rxvt|Eterm|eterm) + xterm*|rxvt*|Eterm|eterm) echo -ne "\e]0;$1\007" ;; screen) @@ -49,7 +49,15 @@ function xreset() { esac } -. ~/src/git-prompt/git-prompt.sh +#. ~/src/git-prompt/git-prompt.sh +function starship_set_win_title() { + local cwd="${PWD/$HOME/\~}" + cwd="${cwd##[/~]*/}/" + + xtitle "$USER@$(hostname):$cwd" +} +starship_precmd_user_func=starship_set_win_title +eval "$(starship init bash)" #export PS1="\ #\[\033[1;37m\]\u@\h\ diff --git a/.config/alacritty.yml b/.config/alacritty.yml new file mode 100644 index 0000000..bb95d7d --- /dev/null +++ b/.config/alacritty.yml @@ -0,0 +1,90 @@ +window: + dimensions: + columns: 80 + lines: 37 + opacity: 0.86 + resize_increments: true + option_as_alt: Both + alt_send_esc: true + +font: + normal: + family: 'DejaVuSansM Nerd Font Mono' + bold: + family: 'DejaVuSansM Nerd Font Mono' + italic: + family: 'DejaVuSansM Nerd Font Mono' + style: 'Oblique' + bold_italic: + family: 'DejaVuSansM Nerd Font Mono' + style: 'Bold Oblique' + size: 8.0 + builtin_box_drawing: false + +selection: + semantic_escape_chars: " !@#$%^&*(){}[]'\",.<>/?=+-\\|`~;:" + +hints: + alphabet: "aoeuidhtns" + enabled: + - regex: "(mailto|http|https):[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + hyperlinks: true + command: xdg-open + post_processing: true + mouse: + enabled: true + mods: Command + binding: + key: Return + mods: Control|Command + +key_bindings: + # Option key remapping + - { key: A, mods: Command, chars: "\x1ba" } + - { key: B, mods: Command, chars: "\x1bb" } + - { key: C, mods: Command, chars: "\x1bc" } + - { key: D, mods: Command, chars: "\x1bd" } + - { key: E, mods: Command, chars: "\x1be" } + - { key: F, mods: Command, chars: "\x1bf" } + - { key: G, mods: Command, chars: "\x1bg" } + - { key: H, mods: Command, chars: "\x1bh" } + - { key: I, mods: Command, chars: "\x1bi" } + - { key: J, mods: Command, chars: "\x1bj" } + - { key: K, mods: Command, chars: "\x1bk" } + - { key: L, mods: Command, chars: "\x1bl" } + - { key: M, mods: Command, chars: "\x1bm" } + - { key: N, mods: Command, chars: "\x1bn" } + - { key: O, mods: Command, chars: "\x1bo" } + - { key: P, mods: Command, chars: "\x1bp" } + - { key: Q, mods: Command, chars: "\x1bq" } + - { key: R, mods: Command, chars: "\x1br" } + - { key: S, mods: Command, chars: "\x1bs" } + - { key: T, mods: Command, chars: "\x1bt" } + - { key: U, mods: Command, chars: "\x1bu" } + - { key: V, mods: Command, chars: "\x1bv" } + - { key: W, mods: Command, chars: "\x1bw" } + - { key: X, mods: Command, chars: "\x1bx" } + - { key: Y, mods: Command, chars: "\x1by" } + - { key: Z, mods: Command, chars: "\x1bz" } + - { key: Key1, mods: Command, chars: "\x1b1" } + - { key: Key2, mods: Command, chars: "\x1b2" } + - { key: Key3, mods: Command, chars: "\x1b3" } + - { key: Key4, mods: Command, chars: "\x1b4" } + - { key: Key5, mods: Command, chars: "\x1b5" } + - { key: Key6, mods: Command, chars: "\x1b6" } + - { key: Key7, mods: Command, chars: "\x1b7" } + - { key: Key8, mods: Command, chars: "\x1b8" } + - { key: Key9, mods: Command, chars: "\x1b9" } + - { key: Key0, mods: Command, chars: "\x1b0" } + - { key: Grave, mods: Command, chars: "\x1b`" } # Command + ` + - { key: Grave, mods: Command|Shift, chars: "\x1b~" } # Command + ~ + - { key: Period, mods: Command, chars: "\x1b." } # Command + . + - { key: Key8, mods: Command|Shift, chars: "\x1b*" } # Command + * + - { key: Key3, mods: Command|Shift, chars: "\x1b#" } # Command + # + - { key: Period, mods: Command|Shift, chars: "\x1b>" } # Command + > + - { key: Comma, mods: Command|Shift, chars: "\x1b<" } # Command + < + - { key: Minus, mods: Command|Shift, chars: "\x1b_" } # Command + _ + - { key: Key5, mods: Command|Shift, chars: "\x1b%" } # Command + % + - { key: Key6, mods: Command|Shift, chars: "\x1b^" } # Command + ^ + - { key: Backslash, mods: Command, chars: "\x1b\\" } # Command + \ + - { key: Backslash, mods: Command|Shift, chars: "\x1b|" } # Command + | diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..0b92cd9 --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,194 @@ +# Get editor completions based on the config schema +"$schema" = 'https://starship.rs/config-schema.json' + +# Inserts a blank line between shell prompts +add_newline = true + +format = """ +[](fg:user)\ +$username[@](bg:user)$hostname\ +[](fg:user bg:dir)\ +$directory\ +[](bg:time fg:dir)\ +$time\ +[](fg:time)\n\ +([](fg:vcs)\ +$vcsh\ +$git_branch\ +$git_status\ +$git_state\ +$git_commit\ +[](fg:vcs bg:lang)\ +$c\ +$golang\ +$java\ +$nodejs\ +$perl\ +$raku\ +$ruby\ +$rust\ +$vagrant\ +[](fg:lang)\n)\ +[](fg:jobs)\ +$jobs\ +[](fg:jobs bg:status)\ +$status\ +[](fg:status)\ +""" + +continuation_prompt = '▶▶ ' + +palette = 'pastels' + +[palettes.pastels] +user = '#9A348E' +user_fg = 'white' +user_root = '#FF0000' +time = '#33658A' +time_fg = 'white' +dir = '#DA627D' +dir_fg = 'white' +dir_repo_fg='black' +dir_ro_fg='yellow' +vcs = '#FCA17D' +vcs_fg = '8' +lang = '#86BBD8' +lang_fg = '8' +jobs = '#DA627D' +jobs_fg = '8' +status = '#33658A' +status_fg = 'white' + +[c] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[ $symbol ($version) ]($style)' + +[directory] +read_only = " 󰌾" +style = 'bg:dir fg:dir_fg' +read_only_style = 'bg:dir fg:dir_ro_fg' +repo_root_style = 'bg:dir fg:dir_repo_fg' +format = "[ $path]($style)[$read_only ]($read_only_style)" +repo_root_format = "[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only ]($read_only_style)" +truncation_length = 3 +truncation_symbol = "…/" +truncate_to_repo = false + +[git_branch] +symbol = " " +style = "bg:vcs fg:vcs_fg" +format = '[ $symbol$branch]($style)' +only_attached = false + +[git_commit] +only_detached = false +tag_disabled = false +style = "bg:vcs fg:vcs_fg" +format = "[ $hash$tag]($style)" + +[git_status] +style = "bg:vcs fg:vcs_fg" +conflicted = "⚔️" +ahead = "↑${count}" +behind = "↓${count}" +diverged = "↑${ahead_count}↓${behind_count}" +untracked = "🤷${count}" +stashed = "📦${count}" +modified = "📝${count}" +staged = "🗃️ ${count}" +renamed = "📛${count}" +deleted = "🗑️${count}" +format = '[ $all_status$ahead_behind]($style)' + +[golang] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' + +[hg_branch] +symbol = " " +style = "bg:vcs fg:vcs_fg" +format = '[ $symbol$branch]($style)' + +[hostname] +ssh_symbol = " " +ssh_only = false +style = "bg:user fg:user_fg" +format = '[$ssh_symbol$hostname]($style)' + +[java] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' + +[jobs] +number_threshold = 0 +style = "bg:jobs fg:jobs_fg" +format = '[$symbol$number]($style)' + +[nodejs] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[ $symbol ($version) ]($style)' + +[package] +symbol = "󰏗 " +style = "bg:lang fg:lang_fg" + +[perl] +symbol = "🐪" +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' +detect_files = [ 'Makefile.PL', 'Build.PL', 'cpanfile', 'cpanfile.snapshot', 'META.json', 'META.yml', '.perl-version', 'dist.ini' ] + +[python] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[${symbol}${pyenv_prefix}(${version})(\($virtualenv\))]($style)' + +[raku] +symbol = "🦋" +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' + +[ruby] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' + +[rust] +symbol = " " +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' + +[status] +disabled = false +style = 'bg:status fg:status_fg' +format = '[$symbol$maybe_int$signal_name]($style)' +success_symbol = '✅' + +[sudo] +disabled = true +format = '[as $symbol]($style)' + +[time] +disabled = false +time_format = "%F-%T" +style = "bg:time fg:time_fg" +format = '[ 🕙 $time ]($style)' + +[username] +format = '[$user]($style)' +show_always = true +style_user = "bg:user fg:user_fg" +style_root = "bg:user_root fg:user_fg" +disabled = false + +[vagrant] +style = "bg:lang fg:lang_fg" +format = '[ $symbol($version)]($style)' + +[vcsh] +style = "bg:vcs fg:vcs_fg" +format = '[ $repo]($style)' \ No newline at end of file -- cgit v1.2.3