From 4f10754ec00bedbc351bebfa3782307acbc07d23 Mon Sep 17 00:00:00 2001 From: Peter Harpending Date: Sat, 19 Sep 2026 17:54:35 -0700 Subject: [PATCH] initial commit --- .gitignore | 3 + README.md | 115 +++++++++++++ config/terminator/config | 22 +++ config/terminator/config.light | 22 +++ i3/config | 286 +++++++++++++++++++++++++++++++++ i3status.conf | 65 ++++++++ tmux.conf | 3 + vimrc | 110 +++++++++++++ zshrc | 141 ++++++++++++++++ 9 files changed, 767 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 config/terminator/config create mode 100644 config/terminator/config.light create mode 100644 i3/config create mode 100644 i3status.conf create mode 100644 tmux.conf create mode 100644 vimrc create mode 100644 zshrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8810672 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +vim/ +*.swp +*.swo diff --git a/README.md b/README.md new file mode 100644 index 0000000..e5a3cff --- /dev/null +++ b/README.md @@ -0,0 +1,115 @@ +# about + +This is an "rsync repo tracked with git" for my dotfiles; see +"context" section at the end for more detail. + +It essentially contains the minimal set of deviations from "Devuan +with LXDE" defaults that I require in order to not find the computer +to be an active hindrance to my productivity: + +# new system config + +## devuan + +- SSH config: + + - copy `id_rsa.pub` from laptop + - edit `/etc/ssh/sshd_config` to sane defaults + - in particular: + + 1. disable root login + 2. disable password login + +- sudo: add `pharpend` to `sudo` group: + + # apt install sudo + # usermod -aG pharpend sudo + +- firefox: + % sudo apt install firefox + + - rsync firefox passwords + - add to firefox + +- dotfiles: + + % sudo apt install git + % mkdir ~/gho + % cd ~/gho + % git clone https://git.harpending.org/pharpend/dotfiles-ii.git + +- tmux: + + % sudo apt install tmux + % cp ~/gho/dotfiles-ii/tmux.conf ~/.tmux.conf + +- zsh: + + % sudo apt install zsh zsh-syntax-highlighting + % cp ~/gho/dotfiles-ii/zshrc ~/.zshrc + % chsh -s /usr/bin/zsh + +- vim: + + +## freebsd + +- copy `id_rsa.pub` +- enable ssh sysadmin: + + # pw groupmod wheel -m pharpend + +- basic shell utilities + + # pkg install tmux zsh vim rsync git lynx tree bash + +- basic graphical environment + + # pkg install \ + xorg i3 terminator rxvt-unicode dmenu \ + liberation-fonts-ttf pulseaudio parcellite dunst \ + nitrogen redshift firefox-esr fantasque-sans-mono \ + emacs pcmanfm pavucontrol spectacle plasma6-spectacle \ + scrot vlc viewnior gthumb \ + + linux-brave + chromium + iridium + +- Erlang/zx + + # pkg install \ + erlang erlang-wx + +# context + +- I set up new machines pretty frequently +- This has endowed me with a strong preference for low-maintenance + operating systems with sane defaults +- The idea here is to have the "minimal" set of dotfiles where I can + clone this repo and just copy everything to its location on the new + machine +- I have found that the system of directly symlinking my dotfiles + from the git repo to the local machine is more trouble than it's + worth, due to high volume of per-machine diffs. +- e.g. laptop needs battery charge info in i3status bar config, + desktop machine doesn't; there's a million little things like that + that differ from one machine to another +- like i said, this is the set of things that despite my best efforts + +- In the past I used Gentoo and Arch Linux and and and and... +- That was fun and fulfilling when I was 17 and I had no serious + responsibilities in my life. +- to be clear, the "I use Arch BTW" phase was an extremely valuable + period in which I learned the skills on which I now rely on a day + to day basis. +- However I'm now in my 30s, and, for better or for worse, I have + aged out of finding Arch Linux interesting. +- I just can't bring myself to care about the operating system for + its own sake any more. +- I have converged on "Devuan for everything" because it annoys me + the least +- In the past it was "Ubuntu for everything" but replacing the GNU + coreutils with the Rust coreutils (why?) was the straw that broke + the camel's back for me. +- I don't know why systemd or snaps weren't that straw diff --git a/config/terminator/config b/config/terminator/config new file mode 100644 index 0000000..110a42d --- /dev/null +++ b/config/terminator/config @@ -0,0 +1,22 @@ +[global_config] +[keybindings] +[profiles] + [[default]] + background_color = "#1e1f28" + background_darkness = 0.95 + cursor_blink = False + font = Fantasque Sans Mono 12 + foreground_color = "#f8f8f2" + show_titlebar = False + scrollbar_position = hidden + palette = "#000000:#ff5555:#50fa7b:#f1fa8c:#bd93f9:#ff79c6:#8be9fd:#bbbbbb:#555555:#ff5555:#50fa7b:#f1fa8c:#bd93f9:#ff79c6:#8be9fd:#ffffff" + use_system_font = False +[layouts] + [[default]] + [[[window0]]] + type = Window + parent = "" + [[[child1]]] + type = Terminal + parent = window0 +[plugins] diff --git a/config/terminator/config.light b/config/terminator/config.light new file mode 100644 index 0000000..d6f1e74 --- /dev/null +++ b/config/terminator/config.light @@ -0,0 +1,22 @@ +[global_config] +[keybindings] +[profiles] + [[default]] + background_color = "#ffffff" + background_darkness = 0.95 + cursor_blink = False + font = Fantasque Sans Mono 12 + foreground_color = "#000000" + show_titlebar = False + scrollbar_position = hidden + palette = "#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff" + use_system_font = False +[layouts] + [[default]] + [[[window0]]] + type = Window + parent = "" + [[[child1]]] + type = Terminal + parent = window0 +[plugins] diff --git a/i3/config b/i3/config new file mode 100644 index 0000000..7fe630c --- /dev/null +++ b/i3/config @@ -0,0 +1,286 @@ +# This file has been auto-generated by i2-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# Should you change your keyboard layout somewhen, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. ISO 10646 = Unicode +# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +# The font above is very space-efficient, that is, it looks good, sharp and +# clear in small sizes. However, if you need a lot of unicode glyphs or +# right-to-left text rendering, you should instead use pango for rendering and +# chose a FreeType font, such as: +#font pango: Monospace 10 +#font pango: Ubuntu Mono 11 +#font pango: Terminus 12 +#font pango: Liberation Mono 9 +font pango: Liberation Mono 9 +#font pango: JetBrains Mono 9 +#font pango: Noto Sans Mono 10 +#font pango: Roboto Mono 12 +#font pango: Hack 10 +#font pango: Fantasque Sans Mono 10 +#font pango: Input Mono 10 + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +#bindsym $mod+Return exec urxvt +#bindsym $mod+Shift+Return exec terminator + +bindsym $mod+Return exec terminator +bindsym $mod+Shift+Return exec urxvt +#bindsym $mod+Return exec konsole +#bindsym $mod+Return exec terminator +#bindsym $mod+Return exec xfce4-terminal +#bindsym $mod+Shift+Return exec urxvt + +# kill focused window +bindsym $mod+n kill + +# start dmenu (a program launcher) +bindsym $mod+q exec dmenu_run + +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout somewhen, delete +# this file and re-run i3-config-wizard(1). +# + +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +# bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+semicolon split h +# split in vertical orientation +bindsym $mod+p split v + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+d layout stacking +bindsym $mod+f layout tabbed +bindsym $mod+space layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle +# focus the parent container +bindsym $mod+a focus parent + +# switch to workspace +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +bindsym $mod+i workspace prev +bindsym $mod+o workspace next +bindsym $mod+Shift+i move container to workspace prev +bindsym $mod+Shift+o move container to workspace next + +# Scratchpad stuff +bindsym $mod+bracketleft scratchpad show +bindsym $mod+bracketright move scratchpad + +# reload the configuration file +bindsym $mod+Shift+s reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+f exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" + +exec setxkbmap us -option terminate:ctrl_alt_bksp,compose:ralt,ctrl:nocaps +#exec setxkbmap us -variant colemak -option terminate:ctrl_alt_bksp,compose:ralt,ctrl:nocaps + + +# Application keybindings +bindsym Control+$mod+m exec emacs +bindsym Control+$mod+c exec chromium-browser +bindsym $mod+c exec firefox +#bindsym $mod+s exec thunderbird +# bindsym $mod+c exec brave-browser +bindsym $mod+e exec pcmanfm +bindsym $mod+r exec pavucontrol + +# Resize windows +bindsym Control+$mod+h resize shrink width 75 px +bindsym Control+$mod+j resize grow height 75 px +bindsym Control+$mod+k resize shrink height 75 px +bindsym Control+$mod+l resize grow width 75 px +bindsym Control+$mod+Left resize shrink width 75 px +bindsym Control+$mod+Down resize grow height 75 px +bindsym Control+$mod+Up resize shrink height 75 px +bindsym Control+$mod+Right resize grow width 75 px + +#bindsym Print exec scrot -e 'mv $f ~/Pictures/screenshots/' +bindsym Print exec spectacle --background --fullscreen +bindsym $mod+Print exec spectacle --background --activewindow +bindsym $mod+Shift+Print exec spectacle --background --region +# bindsym XF86AudioMute exec amixer set Master toggle +# bindsym XF86AudioLowerVolume exec amixer set Master 8%- +# bindsym XF86AudioRaiseVolume exec amixer set Master 8%+ +# bindsym $mod+F10 exec amixer set Master toggle +# bindsym $mod+F11 exec amixer set Master 8%- +# bindsym $mod+F12 exec amixer set Master 8%+ +bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym $mod+F10 exec pactl set-sink-mute @DEFAULT_SINK@ toggle +bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym $mod+F11 exec pactl set-sink-volume @DEFAULT_SINK@ -5% +bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym $mod+F12 exec pactl set-sink-volume @DEFAULT_SINK@ +5% +bindsym $mod+F7 exec mpc prev +bindsym $mod+F8 exec mpc toggle +bindsym $mod+F9 exec mpc next +# bindsym Shift+XF86MonBrightnessDown exec xbacklight -dec 1 +# bindsym Shift+XF86MonBrightnessUp exec xbacklight -inc 1 +# bindsym XF86MonBrightnessDown exec xbacklight -dec 5 +# bindsym XF86MonBrightnessUp exec xbacklight -inc 5 +bindsym XF86MonBrightnessDown exec $HOME/bin/kb-light.py - +bindsym XF86MonBrightnessUp exec $HOME/bin/kb-light.py + + +# Autostarted applications +# exec deluge +exec blueman-applet +#exec dropbox start -i +exec guake +exec synapse +exec nm-applet +exec parcellite +exec ncmpcpp pause +# exec xfce4-power-manager + +# Non-panel things +exec dunst +#exec emacs26 --daemon +exec --no-startup-id $HOME/.local/bin/i3-battery-popup +exec mpd +exec nitrogen --restore +exec redshift -l '43:-123' +# OLD: Disables moving the cursor using touchpad +#exec synclient TouchpadOff=1 +# OLD: Disables tapping the touchpad for click +#exec xinput --disable 11 +exec --no-startup-id xinput disable "SynPS/2 Synaptics TouchPad" +# higher = faster +exec --no-startup-id xinput set-prop 'TPPS/2 IBM TrackPoint' 'libinput Accel Speed' 0.6 + +#exec xscreensaver + +## Solarized +## BorderFrame Border Title NextWindowGoesHere +##--------------------------------------------------------------------------------- +#client.focused #268bd2 #268bd2 #fdf6e3 #93a1a1 +#client.focused #f336a2 #f336a2 #fdf6e3 #93a1a1 +#client.focused_inactive #002b36 #002b36 #d0d0d0 #93a1a1 +#client.unfocused #002b36 #002b36 #d0d0d0 #93a1a1 +#client.urgent #dc322f #dc322f #fdf6e3 #cb4b16 + +## Monokai +## BorderFrame Border Title NextWindowGoesHere +##--------------------------------------------------------------------------------- +#client.focused #b3fc29 #b3fc49 #222222 #aaaaaa +#client.focused_inactive #222222 #222222 #dddddd #aaaaaa +#client.unfocused #222222 #222222 #dddddd #aaaaaa +#client.urgent #ee0000 #ee0000 #ffffff #aaaaaa + +# Blue +# BorderFrame Border Title NextWindowGoesHere +#--------------------------------------------------------------------------------- +client.focused #55ffff #55ffff #413101 #ff3399 +client.focused_inactive #00cccc #005555 #dddddd #cc0000 +client.unfocused #222222 #222222 #dddddd #cbbb92 +client.urgent #ee0000 #ee0000 #ffffff #cbbb92 + +focus_follows_mouse no + +# change normal to pixel for elimination of title bars +for_window [class="^.*"] border pixel 2 +new_window 1pixel + +#start of bar section +bar { + output eDP-1 + tray_output eDP-1 + position top + status_command i3status + colors { + # bar background color + #background $bg + # text color used for blocks that do not have a color specified. + #statusline $yellow + # bdr bg fg + #focused_workspace #0a0a0a #0a0a0a #0a0a0a + #inactive_workspace #0a0a0a #0a0a0a #0a0a0a + #active_workspace #1aAaCa #0a0a0a #0a0a0a + #urgent_workspace #EaEa0a #EaEa0a #0a0a0a + } +} + +bar { + output HDMI-2 + tray_output eDP-1 + position top + status_command cat + colors { + # bar background color + #background $bg + # text color used for blocks that do not have a color specified. + #statusline $yellow + ## workspaces section + ## border backgr. text + #focused_workspace $aqua $aqua $darkgray + #inactive_workspace $darkgray $darkgray $yellow + #active_workspace $darkgray $darkgray $yellow + #urgent_workspace $red $red $bg + } +} diff --git a/i3status.conf b/i3status.conf new file mode 100644 index 0000000..a393037 --- /dev/null +++ b/i3status.conf @@ -0,0 +1,65 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + interval = 5 + markup = "pango" +} + +order += "wireless _first_" +order += "ethernet _first_" +order += "battery all" +order += "load" +order += "memory" +order += "tztime local" +order += "tztime utc" +order += "tztime jst" + +wireless _first_ { + format_up = "W: %quality" + format_down = "W: down" +} + + +ethernet _first_ { + format_up = "E: %speed" + format_down = "E: down" +} + + +battery all { + format = "%status %percentage %remaining" + low_threshold = 20 + threshold_type = percentage +} + +load { + format = "LOAD: %1min" +} + +memory { + format = "MEM: %used" + threshold_degraded = "20%" + threshold_critical = "10%" +} + +tztime local { + # format = "%Z: %Y-%m-%d %H:%M:%S" + format = "%Z: %Y-%m-%d %H:%M:%S" +} + +tztime utc { + format = "%Z: %Y-%m-%d %H:%M:%S" + timezone = "UTC" +} + +tztime jst { + format = "%Z: %Y-%m-%d %H:%M:%S" + timezone = "Asia/Tokyo" +} diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..07fdccf --- /dev/null +++ b/tmux.conf @@ -0,0 +1,3 @@ +unbind C-b +set-option -g prefix C-q +bind C-q send-prefix diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..081a8f9 --- /dev/null +++ b/vimrc @@ -0,0 +1,110 @@ +syntax on + +execute pathogen#infect() + +"""""""" dark mode +set background=dark +"colorscheme odyssey +highlight CursorLine cterm=none ctermbg=23 +highlight CursorLineNr cterm=bold ctermbg=23 +highlight CursorColumn cterm=none ctermbg=23 +highlight ColorColumn cterm=none ctermbg=23 + +" light mode +"set background=light +"colorscheme shirotelin +""highlight CursorLine cterm=none ctermbg=7 +""highlight CursorLineNr cterm=bold ctermbg=7 +""highlight CursorColumn cterm=none ctermbg=7 +""highlight ColorColumn cterm=none ctermbg=7 +""highlight trailing whitespace, markers if line goes past screen, special + +" marker for tab characters +set list +set listchars=trail:-,extends:>,precedes:<,tab:>- + +" Line numbers, highlight current line +set number +set cursorline +set cursorcolumn + +" Autoindentation +set autoindent + +" Turn off line wrapping +set nowrap +set colorcolumn=+1 + +" Use 4 spaces instead of tabs +set shiftwidth =4 +set tabstop =4 +set expandtab +" uncomment for stupid backspace +"set softtabstop =4 + +" NERD tree +nnoremap :NERDTreeToggle + +" Show filename in mode line +set laststatus =2 + +"" Window switching commands +noremap :wincmd h +noremap :wincmd j +noremap :wincmd k +noremap :wincmd l + +" highlight when searching +set hlsearch + +" Uncomment the following to have Vim jump to the last position when +" reopening a file +if has("autocmd") + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +endif + +" tab navigation +" From https://vim.fandom.com/wiki/Using_tab_pages +cabbrev te tabedit +nnoremap :tabp +nnoremap :tabn +nnoremap :tabedit . +nnoremap :set number! +nnoremap :set cursorline!:set cursorcolumn! +nnoremap :set paste! + +" read modelines +set modeline + +" copy to system clipboard (from grok) +vnoremap :w !xclip -sel clip +" the practical effect of this augroup thing is that we avoid +" non-idempotency problems with autocmd (specifically the autocmd! +" inside, which resets all the settings in the group) +augroup foo + autocmd! + " overrides file type plugins that think they know what i want + " and i don't + " -t = don't do auto line wrapping in insert mode + " +q = do on gqq + " +n = handle numbered lists automagically + " +j = handle comment delimiters on J + " +c = autowrap in insert mode only in comments + autocmd FileType * setlocal formatoptions-=t formatoptions+=qnjc + autocmd FileType * setlocal textwidth=69 + " markdown paragraph wrap + autocmd FileType * setlocal formatoptions+=tn + " python: pep8 says best textwidth is 80 chars but fuck pep8 + " but only gently. we'll go with 79 + autocmd FileType python setlocal textwidth=79 + " xml turn off line wrapping + autocmd FileType xml setlocal formatoptions-=t + " Erlang handle comments beginning with %% | %%% etc + autocmd FileType erlang setlocal comments=:%%%%%,:%%%%,:%%%,:%%,:% + autocmd FileType erlang setlocal textwidth=55 + autocmd FileType erlang setlocal formatoptions-=t + " handle numbered lists properly in markdown + "autocmd FileType markdown setlocal formatoptions+=n + " ignore all prior tabs=4spaces settings but only in makefiles + autocmd FileType make setlocal noexpandtab +augroup END diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..80dbfe5 --- /dev/null +++ b/zshrc @@ -0,0 +1,141 @@ +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=10000 +SAVEHIST=10000 +bindkey -e +# End of lines configured by zsh-newuser-install +# The following lines were added by compinstall +zstyle :compinstall filename '~/.zshrc' + +#autoload -U colors && colors +autoload -Uz compinit +compinit +# End of lines added by compinstall +# + +# [[ -z "$TMUX" ]] && exec tmux + +# My bash aliases +alias ls='ls -F -G' +alias l='ls -l' +alias la='l -a' +alias xv='vim -X' + +genid () { + date | sha1sum | sed -e 's/^\([0-9a-z]\{7\}\).\+/\1/' +} +# thank you claude +chpwd() { ls } +ggit-branch () { + git branch &> /dev/null + if [[ $? -eq 0 ]]; then + br=$(git branch | \grep \* | sed "s/^\* //") + echo " ${br}" + fi +} + +setopt prompt_subst +setopt auto_pushd +CONFIG="~/.config" + +# [x/y git-branch] % ... pharpend@picklet + +# [src/foo master] % pharpend@picklet +#PROMPT='%B[%b%F{cyan}%2~%f%F{red}$(ggit-branch)%f%B]%b %F{green}%#%f ' +#RPROMPT='%F{red}%n%f%B@%b%F{magenta}%M%f' + +ncolor() { + last_md5_digit=$(echo $1 | md5sum | awk '{print substr($1, length($1), 1)}') + # 6 colors + #colors='red green yellow blue magenta cyan' + # 1> [{N, N*(6/16)} || N <- lists:seq(0, 15)]. + # [{0,0.0}, + # {1,0.375}, + # {2,0.75}, + # {3,1.125}, + # {4,1.5}, + # {5,1.875}, + # {6,2.25}, + # {7,2.625}, + # {8,3.0}, + # {9,3.375}, + # {10,3.75}, + # {11,4.125}, + # {12,4.5}, + # {13,4.875}, + # {14,5.25}, + # {15,5.625}] + + case $last_md5_digit in + 0|1|2) echo 'red' ;; + 3|4|5) echo 'green' ;; + 6|7) echo 'yellow' ;; + #8|9|a) echo 'blue' ;; + #b|c|d) echo 'magenta' ;; + 8|9) echo 'blue' ;; + a|b|c) echo 'magenta' ;; + *) echo 'cyan' ;; + esac +} + +ecolor() { + for arg in $@; do + this_color=$(ncolor ${arg}) + echo "%F{${this_color}}${arg}%f" + done +} + +pcolor() { + for arg in $@; do + this_color=$(ncolor ${arg}) + print -P "%F{${this_color}}${arg}%f" + done +} + +ucolor() { + ecolor $(whoami) +} +hcolor() { + ecolor $(hostname) +} +#jusername + +# [pharpend@picklet src/foo master] % +#PROMPT='%B[%b%F{red}%n%f%B@%b%F{magenta}%M%f %F{cyan}%2~%f%F{red}$(ggit-branch)%f%B]%b %F{green}%#%f ' +#RPROMPT='' + +# same but randomized colors for username/hostname +# [pharpend@picklet src/foo master] % +PROMPT='%B[%b$(ucolor)%B@%b$(hcolor) %F{cyan}%2~%f%F{red}$(ggit-branch)%f%B]%b %F{green}%#%f ' +RPROMPT='' + +# pharpend@picklet +#PROMPT='%B[%b%F{cyan}%2~%f%F{red}$(ggit-branch)%f%B]%b %F{green}%#%f ' + +# PROMPT='[%2~$(ggit-branch)] %# ' +#RPROMPT='' +# RPROMPT='%n@%M' +REPORTTIME=3 + +## Erlang +##if [[ -d $HOME/.erts ]]; then; . "$HOME"/.erts/28.3/activate; fi +#. "$HOME"/.erts/28.3/activate + +## opam configuration +#if [[ -d $HOME/.opam ]]; then +# test -r /home/pharpend/.opam/opam-init/init.zsh && . /home/pharpend/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true +#fi + + +# thank you lenovo +at () { echo -n '@' } +atln () { echo '@' } + +ii () { echo -n '2' } +iiln () { echo '2' } + +two () { echo -n '2' } +twoln () { echo '2' } + +# syntax highlighting +source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh