# inside emacs fixes
-if [[ $INSIDE_EMACS ]]; then
+if [[ $RLC_INSIDE_EMACS ]]; then
# EMACS is used by bash on startup, but we don't need it anymore.
# plus I hit a bug in a makefile which inherited it
unset EMACS
- export INSIDE_EMACS
+ export RLC_INSIDE_EMACS
export PAGER=cat
export MANPAGER=cat
# scp completion does not work, but this doesn't fix it. todo, figure this out
if [[ $- == *i* ]]; then
# for readline-complete.el
- if [[ $INSIDE_EMACS ]]; then
+ if [[ $RLC_INSIDE_EMACS ]]; then
# all for readline-complete.el
stty echo
bind 'set horizontal-scroll-mode on'
HISTCONTROL=ignoredups
# works in addition to HISTCONTROL to do more flexible things
# it could also do the same things as HISTCONTROL and thus replace it,
-# but meh
-HISTIGNORE='k *; *'
+# but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
+HISTIGNORE='k *:[ ]*'
export BC_LINE_LENGTH=0
ack() { ack-grep "$@"; }
+astudio() {
+ # googling android emulator libGL error: failed to load driver: r600
+ # lead to http://stackoverflow.com/a/36625175/14456
+ export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
+ /a/opt/android-studio/bin/studio.sh "$@" &r;
+}
+
bashrcpush () {
local startdir="$PWD"
cd ~
done < <(find "$@" -print0);
}
+faf() { # find all files
+ find $@ -type f
+}
+
+fastboot() { /home/ian/Android/Sdk/platform-tools/fastboot "$@"; }
ff() {
if type -P firefox &>/dev/null; then
echo "${p%%/.git}"
}
+# quit will prompt if the program crashes.
+gmacs() { gdb -ex=r -ex=quit --args emacs "$@"; r; }
+
+gse() {
+ git send-email --notes '--envelope-sender=<ian@iankelling.org>' \
+ --suppress-cc=self "$@"
+}
+
gr() {
grep -iIP --color=auto "$@"
}
fi
}
+hstatus() {
+ # do git status on published repos
+ cd /a/bin/githtml
+ for x in !(forks) forks/* ian-specific/*; do
+ cd `readlink -f $x`/..
+ hr
+ echo $x
+ i status
+ cd /a/bin/githtml
+ done
+}
+
hl() { # history limit. Write extra history to archive file.
# todo: this is not working or not used currently
local max_lines linecount tempfile prune_lines x
echo
}
+hrcat() { local f; for f; do [[ -f $f ]] || continue; hr; echo "$f"; cat "$f"; done }
+
i() { git "$@"; }
# modified from ~/local/bin/git-completion.bash
}
-ifn () {
+ifn() {
# insensitive find
- find -L . -iname "*$**" 2>/dev/null
+ find -L . -not \( -name .svn -prune -o -name .git -prune \
+ -o -name .hg -prune \) -iname "*$**" 2>/dev/null
}
}
rlu() { # [OPTS] HOST PATH
- # eg rlu -opts frodo testpath
+ # eg rlu -opts frodo /testpath
# useful for selectively sending dirs which have been synced with unison,
# where the path is the same on both hosts.
opts=("${@:1:$#-2}") # 1 to last -2
}
complete -F _root_command s sb
+scssl() {
+ # s gem install scss-lint
+ pushd /a/opt/thoughtbot-guides
+ git pull --stat
+ popd
+ scss-lint -c /a/opt/thoughtbot-guides/style/sass/.scss-lint.yml "$@"
+}
ser() {
local s; [[ $EUID != 0 ]] && s=sudo
tm() {
# timer in minutes
- (sleep $(calc "$@ * 60") && mpv --volume 50 /a/bin/data/alarm.mp3) > /dev/null 2>&1 &
+ (sleep $(calc "$@ * 60") && mpv --volume 50 /a/bin/data/alarm.mp3 --loop=no) > /dev/null 2>&1 &
}
ts() { # start editing a new file
shopt -s autocd
shopt -s dirspell
PS1='\w'
- if [[ $- == *i* ]] && [[ ! $INSIDE_EMACS ]]; then
+ if [[ $- == *i* ]] && [[ ! $RLC_INSIDE_EMACS ]]; then
PROMPT_DIRTRIM=2
bind -m vi-command B:shell-backward-word
bind -m vi-command W:shell-forward-word
path_add --end ~/.npm-global
+
+# didn't get drush working, if I did, this seems like the
+# only good thing to include for it.
+# Include Drush completion.
+# if [ -f "/home/ian/.drush/drush.complete.sh" ] ; then
+# source /home/ian/.drush/drush.complete.sh
+# fi
+
+
# https://wiki.archlinux.org/index.php/Xinitrc#Autostart_X_at_login
# i added an extra condition as gentoo xorg guide says depending on
# $DISPLAY is fragile.