aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bashrc36
-rw-r--r--config/htop/htoprc26
-rwxr-xr-xinstall1
-rwxr-xr-xlocal/bin/project-test43
-rw-r--r--shellrc2
-rw-r--r--zshrc26
6 files changed, 84 insertions, 50 deletions
diff --git a/bashrc b/bashrc
index ef4e60c..f36391e 100644
--- a/bashrc
+++ b/bashrc
@@ -10,14 +10,19 @@ if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
+# Source all completions
+if [ -d ~/.bash_completions ]; then
+ for F in $(find ~/.bash_completions -type f); do
+ . "$F"
+ done
+fi
+
+# PROMPT #######################################################
PS1='$(
if [ `id -u` -eq "0" ]; then
echo -n "\[\e[1;31m\]\u@\h:\[\e[1;34m\]\W\[\e[1;31m\]\$\[\e[0m\] "
else
- if ls ~/.annoyme/*.pid 2>/dev/null >/dev/null; then
- ANNOYME_PS="\[\e[1;31m\]!\[\e[0m\]"
- fi
- echo -n "$ANNOYME_PS\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] "
+ echo -n "\[\e[1;32m\]\u@\h:\[\e[1;34m\]\W\[\e[1;32m\]\$\[\e[0m\] "
fi)'
PROMPT_COMMAND='
@@ -37,3 +42,26 @@ case "$TERM" in
;;
esac
+# Completions ##################################################
+
+_gitbmerge() {
+ local cur prev
+ _init_completion || return
+ [ $COMP_CWORD -gt 1 ] && return # Complete only single dependency
+ COMPREPLY=()
+ local GDIR="$(pwd)"
+ while [ ! -d "$GDIR/.git" ]; do
+ [ -z "$GDIR" ] && return
+ GDIR="${GDIR%/*}"
+ done
+ GDIR="$GDIR/.git"
+ [ -f "$GDIR" ] && GDIR="$(cat "$GDIR")" # This just points to some other directory
+ [ -d "$GDIR/refs/heads" ] || return # No completion if there is no local branch
+ local ops=""
+ for B in "$GDIR"/refs/heads/*; do
+ # TODO skip branch on HEAD
+ ops="$ops ${B#$GDIR/refs/heads/}"
+ done
+ COMPREPLY+=($(compgen -W "${ops}" -- ${cur}))
+}
+complete -F _gitbmerge gitbmerge
diff --git a/config/htop/htoprc b/config/htop/htoprc
new file mode 100644
index 0000000..0492e91
--- /dev/null
+++ b/config/htop/htoprc
@@ -0,0 +1,26 @@
+# Beware! This file is rewritten by htop when settings are changed in the interface.
+# The parser is also very primitive, and not human-friendly.
+fields=0 48 17 18 38 39 40 2 46 47 49 1
+sort_key=46
+sort_direction=1
+hide_threads=1
+hide_kernel_threads=1
+hide_userland_threads=1
+shadow_other_users=0
+show_thread_names=0
+show_program_path=1
+highlight_base_name=0
+highlight_megabytes=1
+highlight_threads=1
+tree_view=1
+header_margin=1
+detailed_cpu_time=0
+cpu_count_from_zero=0
+update_process_names=0
+account_guest_in_cpu_meter=0
+color_scheme=0
+delay=15
+left_meters=LeftCPUs Memory Swap
+left_meter_modes=1 1 1
+right_meters=RightCPUs Tasks LoadAverage Uptime
+right_meter_modes=1 2 2 2
diff --git a/install b/install
index 4a68dbf..1dcadee 100755
--- a/install
+++ b/install
@@ -33,6 +33,7 @@ fi
if ask "Install configurations for various utility tools"; then
inst screenrc ~/.screenrc
+ inst config/htop/htoprc ~/.config/htop/htoprc
fi
if ask "Install vim scripts"; then
diff --git a/local/bin/project-test b/local/bin/project-test
deleted file mode 100755
index a0591d8..0000000
--- a/local/bin/project-test
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-# Executes given command on all commits from current one to given one.
-set -e
-
-print_help() {
- echo "Executes given command for each commit. In default it executes"
- echo "for 10 previous commands."
- echo
- echo "Usage: project-test [OPTION...] [--] COMMAND"
- echo " -r,--ref [REF]"
- echo " Git reference to go to"
- echo " -c,--count [COUNT]"
- echo " Tests given count of references back from current one."
-}
-
-while [ -n "$1" ]; do
- case $1 in
- -r|--ref)
- shift
- REF=$1
- ;;
- -c|--count)
- shift
- REF=HEAD~$1
- ;;
- --)
- shift
- break
- ;;
- *)
- break
- ;;
- esac
- shift
-done
-
-[ -n "$REF" ] || REF=HEAD~10
-
-while read -r rev; do
- git checkout "$rev"
- git submodule update
- eval $@
-done < <(git rev-list "$REF"..HEAD)
diff --git a/shellrc b/shellrc
index 1c274db..a607bd9 100644
--- a/shellrc
+++ b/shellrc
@@ -14,7 +14,7 @@ else
eval $(dircolors -b)
alias make="make -j$(nproc)"
fi
-alias ll='ls -l'
+alias ll='ls -lh'
alias grep='grep --color=auto'
alias git='LANG=en_GB git'
alias gdb='gdb -q'
diff --git a/zshrc b/zshrc
index b3547e5..ed2058d 100644
--- a/zshrc
+++ b/zshrc
@@ -10,6 +10,7 @@ zstyle ':completion:*' cache-path ~/.cache/zsh
zstyle :compinstall filename '/home/kkoci/.zshrc'
zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)(?)*==32=33}:${(s.:.)LS_COLORS}")'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
+fpath=(~/.zsh_completions $fpath)
autoload -Uz compinit && compinit
autoload -Uz colors && colors
@@ -65,9 +66,9 @@ lrbell_active_window_id() {
lrbell_begin() {
lrbell_timestamp=$EPOCHSECONDS
- lrbell_message="`pwd`: $1"
if [ -n "$DISPLAY" ]; then
- lrbell_window_id=$(lrbell_active_window_id)
+ lrbell_message="`pwd`: $1"
+ lrbell_window_id="$(lrbell_active_window_id)"
fi
}
lrbell_end() {
@@ -85,6 +86,27 @@ lrbell_end() {
add-zsh-hook preexec lrbell_begin
add-zsh-hook precmd lrbell_end
+# Completions ##################################################
+
+_gitbmerge() {
+ (( CURRENT > 2)) && return # Complete only single dependency
+ local GDIR="$(pwd)"
+ while [ ! -d "$GDIR/.git" ]; do
+ [ -z "$GDIR" ] && return
+ GDIR="${GDIR%/*}"
+ done
+ GDIR="$GDIR/.git"
+ [ -f "$GDIR" ] && GDIR="$(cat "$GDIR")" # This just points to some other directory
+ [ -d "$GDIR/refs/heads" ] || return # No completion if there is no local branch
+ local branches=()
+ for B in "$GDIR"/refs/heads/*; do
+ # TODO skip branch on HEAD
+ branches+=("${B#$GDIR/refs/heads/}")
+ done
+ _describe -t branches 'gitbmerge' branches
+}
+compdef _gitbmerge gitbmerge
+
################################################################
case "$TERM" in
xterm*|*rxvt*)