commit 09332722624ef2514ef47cf4daa096ff09cffc83
parent 9c2ea77b254f06877662e887df107eda2b9c3028
Author: William Casarin <jb55@jb55.com>
Date: Mon, 28 Dec 2020 11:53:34 -0800
switch to bash
Diffstat:
6 files changed, 53 insertions(+), 108 deletions(-)
diff --git a/bin/fuzz-run-command b/bin/fuzz-run-command
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-function runner() {
+function fuzz_runner() {
local prefix
local res
local get_cmd
@@ -16,8 +16,8 @@ function runner() {
cmd="$(eval $get_cmd)"
fuzz-record-command "$cmd"
if [ -n "$cmd" ]; then
- eval $cmd
+ echo "$cmd"
fi
}
-runner "$@"
+fuzz_runner "$@"
diff --git a/bin/fuzz-show-hist b/bin/fuzz-show-hist
@@ -2,4 +2,4 @@
set -e
fuzz-compress-hist
cmd_=$(<$HOME/.fuzzhist $FUZZER --tac)
-echo echo -n "$cmd_"
+echo "$cmd_"
diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases
@@ -32,13 +32,35 @@ export FZF_CTRL_R_OPTS="-e"
export FZF_DEFAULT_OPTS="-e"
export EMACSCLIENT=edit
+export NIXPKGS=$HOME/nixpkgs
+
+# nix paths
+export NIX_PATH="nixpkgs=$NIXPKGS:$NIX_PATH"
+export NIX_PATH="nixos-config=$NIX_FILES:$NIX_PATH"
+export NIX_PATH="jb55pkgs=$HOME/etc/jb55pkgs:$NIX_PATH"
+export NIX_PATH="dotfiles=$HOME/dotfiles:$NIX_PATH"
+
+# Customize to your needs...
+
+# other
+export EDITOR="edit"
+export VISUAL="edit"
+export BROWSER="browser"
+export PAGER=less
+
+# go
+
+export GOPATH=$HOME/dev/gocode
+export PATH=$HOME/bin:$PATH
+export PATH=$HOME/.local/bin:$PATH
+
md () {
mandown README*
}
alias e="edit -n"
alias g=git
-alias f=". fuzz-run-command"
+alias f=fuzz-run-command
alias vim=nvim
alias feh="feh --conversion-timeout 2"
alias info="info --vi-keys"
diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc
@@ -6,6 +6,9 @@ set -o vi
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
+
+export PS1="\u@\h:\w\$ "
+
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
@@ -15,61 +18,25 @@ export HISTCONTROL=ignoreboth
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
-# set variable identifying the chroot you work in (used in the prompt below)
-if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
- debian_chroot=$(cat /etc/debian_chroot)
-fi
-
-# set a fancy prompt (non-color, unless we know we "want" color)
-case "$TERM" in
- xterm-color) color_prompt=yes;;
-esac
-
-# uncomment for a colored prompt, if the terminal has the capability; turned
-# off by default to not distract the user: the focus in a terminal window
-# should be on the output of commands, not on the prompt
-#force_colored_prompt=yes
-
-if [ -n "$force_color_prompt" ]; then
- if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
- # We have color support; assume it's compliant with Ecma-48
- # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
- # a case would tend to support setf rather than setaf.)
- color_prompt=yes
- else
- color_prompt=
- fi
-fi
-
-if [ "$color_prompt" = yes ]; then
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
-else
- PS1='${debian_chroot:+($debian_chroot)}\[\e[1;33m\][\[\e[m\]\u\[\e[1;33m\]^\[\e[m\]\h\[\e[1;33m\]:\[\e[m\]\W\[\e[1;33m\]]\[\e[m\] '
-fi
-unset color_prompt force_color_prompt
+DIRCOLORS="$HOME/.dircolors"
+UNDISTRACT="$HOME/dotfiles/bash-undistract-me/undistract-me.sh"
-# If this is an xterm set the title to user@host:dir
-case "$TERM" in
-xterm*|rxvt*)
- #PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
- ;;
-*)
- ;;
-esac
-
-# Alias definitions.
-# You may want to put all your additions into a separate file like
-# ~/.bash_aliases, instead of adding them here directly.
-# See /usr/share/doc/bash-doc/examples in the bash-doc package.
-
-if [ -f ~/.bash_aliases ]; then
- . ~/.bash_aliases
-fi
-
-# added by travis gem
-[ -f /Users/jb55/.travis/travis.sh ] && source /Users/jb55/.travis/travis.sh
+bind
+[ -f ~/.bash_aliases ] && source ~/.bash_aliases
+[ -e "$DIRCOLORS" ] && eval "$(dircolors -b "$DIRCOLORS")"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
-. `which env_parallel.bash`
-
-source $HOME/dotfiles/bash-undistract-me/undistract-me.sh
+[ -f ~/bin/z.sh ] && source ~/bin/z.sh
+[ -f "$UNDISTRACT" ] && source "$UNDISTRACT"
+
+# needed for the C-h binding
+bind '"\C-x\C-a": vi-movement-mode'
+bind '"\C-x\C-e": shell-expand-line'
+bind '"\C-x\C-r": redraw-current-line'
+bind '"\C-x^": history-expand-line'
+
+bind '"\C-f": "\C-x\C-addi`fuzz-run-command`\C-x\C-e\C-x^\C-x\C-a$a\C-x\C-r"'
+bind -m vi-command '"\C-f": "i\C-f"'
+bind '"\C-h": "\C-x\C-addi`fuzz-run-command sh`\C-x\C-e\C-x^\C-x\C-a$a\C-x\C-r"'
+bind -m vi-command '"\C-h": "i\C-h"'
+bind '"\C-l":clear-screen'
diff --git a/dotfiles/.zshrc b/dotfiles/.zshrc
@@ -21,7 +21,6 @@ zstyle ':completion:*:directory-stack' list-colors '=(#b) #([0-9]#)*( *)==95=38;
# short ESC delay
export KEYTIMEOUT=1
-
bindkey "^R" history-incremental-search-backward
# history settings
@@ -29,52 +28,12 @@ export HISTSIZE=50000
export SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups
-export NIXPKGS=$HOME/nixpkgs
-export NIX_FILES=$HOME/etc/nix-files
-
-# nix paths
-export NIX_PATH="nixpkgs=$NIXPKGS:$NIX_PATH"
-export NIX_PATH="nixos-config=$NIX_FILES:$NIX_PATH"
-export NIX_PATH="monstercatpkgs=$HOME/etc/monstercatpkgs:$NIX_PATH"
-export NIX_PATH="jb55pkgs=$HOME/etc/jb55pkgs:$NIX_PATH"
-export NIX_PATH="dotfiles=$HOME/dotfiles:$NIX_PATH"
-
-# Customize to your needs...
-
-# other
-export EDITOR="edit"
-export VISUAL="edit"
-export BROWSER="browser"
-export PAGER=less
-
-# go
-
-export GOPATH=$HOME/dev/gocode
-export PATH=$HOME/bin:$PATH
-export PATH=$HOME/.local/bin:$PATH
-export PATH=$RUBYBIN:$HOME/.npm/bin:$GOPATH/bin:$PATH
-
-# alias
-
# fix ssh agent forwarding in screen
FIXSSH=$HOME/bin/fixssh
if [[ $TERM == screen* ]] && [[ -f $FIXSSH ]]; then
source $FIXSSH
fi
-
-### Added by the Heroku Toolbelt
-export PATH="/usr/local/heroku/bin:$PATH"
-
-PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
-
-export GEM_HOME="$HOME/.ruby/1.8/gems"
-export GEM_PATH="$GEM_HOME"
-
-# added by travis gem
-[ -f /Users/jb55/.travis/travis.sh ] && source /Users/jb55/.travis/travis.sh
-
-# z
source "$HOME/bin/z.sh"
ALIASES="$HOME/.bash_aliases"
@@ -97,7 +56,4 @@ DIRCOLORS="$HOME/.dircolors"
# undistract-me is great
[ -e $HOME/dotfiles/zsh/undistract-me.zsh ] && . $HOME/dotfiles/zsh/undistract-me.zsh
-# added by travis gem
-[ -f /home/jb55/.travis/travis.sh ] && source /home/jb55/.travis/travis.sh
-
eval "$(direnv hook zsh)"
diff --git a/nix-config/configuration.nix b/nix-config/configuration.nix
@@ -21,10 +21,10 @@ let machine = extra.private.machine;
};
util = extra.util;
caches = [ "https://cache.nixos.org" ];
- zsh = "${pkgs.zsh}/bin/zsh";
composeKey = if machine == "quiver" then "ralt" else "rwin";
home = "/home/jb55";
isDark = false;
+ bash = "${pkgs.bashInteractive}/bin/bash";
theme = if isDark then {
package = pkgs.theme-vertex;
name = "Vertex-Dark";
@@ -47,7 +47,7 @@ let machine = extra.private.machine;
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAvMdnEEAd/ZQM+pYp6ZYG/1NPE/HSwIKoec0/QgGy4UlO0EvpWWhxPaV0HlNUFfwiHE0I2TwHc+KOKcG9jcbLAjCk5rvqU7K8UeZ0v/J83bQh78dr4le09WLyhczamJN0EkNddpCyUqIbH0q3ISGPmTiW4oQniejtkdJPn2bBwb3Za8jLzlh2UZ/ZJXhKvcGjQ/M1+fBmFUwCp5Lpvg0XYXrmp9mxAaO+fxY32EGItXcjYM41xr/gAcpmzL5rNQ9a9YBYFn2VzlpL+H7319tgdZa4L57S49FPQ748paTPDDqUzHtQD5FEZXe7DZZPZViRsPc370km/5yIgsEhMPKr jb55"
];
home = home;
- shell = zsh;
+ shell = bash;
};
in {
imports =
@@ -90,11 +90,11 @@ in {
users.extraUsers.jb55 = user;
users.extraGroups.docker.members = [ "jb55" ];
- users.defaultUserShell = zsh;
+ users.defaultUserShell = bash;
users.mutableUsers = true;
console.useXkbConfig = true;
- programs.zsh.enable = true;
+ programs.zsh.enable = false;
}