From: Jannik ZANDER Date: Tue, 24 Oct 2017 18:50:10 +0000 (+0200) Subject: Cleanup for ubuntu X-Git-Url: https://git.zndr.dk/?a=commitdiff_plain;h=7dc0eb3e56111f07d548493936c4962cafc7b213;p=dotfiles.git Cleanup for ubuntu --- diff --git a/.config/bash/aliases b/.config/bash/aliases index 9a8c67c..aea7fb8 100644 --- a/.config/bash/aliases +++ b/.config/bash/aliases @@ -1,90 +1,82 @@ -alias sl=ls -alias la='ls -A' -alias ll='ls -Al' -alias l1='ls -1' -alias l.='ls -d .[a-z]*' - -lsflags="-hF" -# Detect which `ls` flavor is in use -if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` - eval $(dircolors -b $HOME/.dir_colors) - colorflag="--color=auto" - lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" -else # OS X `ls` - export CLICOLOR=1 - colorflag="-G" -fi - -alias ls="ls $colorflag $lsflags" -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' - -if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi - -# Shortcuts -alias g='git' -alias h='history' -alias j='jobs' -alias v='vim' -alias q='exit' -alias c='clear' -alias cls='clear' - -alias edit="$EDITOR" -alias pager="$PAGER" - -# Easier navigation: .., ..., ...., ....., ~ and - -alias ..="cd .." -alias ...="cd ../.." -alias ....="cd ../../.." -alias .....="cd ../../../.." -alias ~="cd ~" # `cd` is probably faster to type though -alias -- -="cd -" -alias cd=cd_func -alias -- --="cd --" -alias -- -0="cd -0" -alias -- -1="cd -1" -alias -- -2="cd -2" -alias -- -3="cd -3" -alias -- -4="cd -4" -alias -- -5="cd -5" -alias -- -6="cd -6" -alias -- -7="cd -7" -alias -- -8="cd -8" -alias -- -9="cd -9" - -# Secure settings -alias rm='rm -i' -alias cp='cp -i' -alias mv='mv -i' -alias md='mkdir -p' -alias rd='rmdir' -alias mkdate='mkdir "$(date +'%Y%m%d')"' - -if [ ! -x "$(which tree 2>/dev/null)" ] -then - alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" -fi - -alias info='info --vi-keys' -#alias less='less -rX' # raw control characters, don't clear the screen after quitting - -# Enable aliases to be sudo'ed -alias sudo='sudo ' -alias _="sudo" - -# Get week number -alias week='date +%V' - -# Stopwatch -alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' - -# Reload the shell (i.e. invoke as a login shell) -alias reload="exec $SHELL -l" -alias gtypist='gtypist -wi' -alias startxwin='run /usr/bin/bash.exe -l -c "/usr/bin/startxwin -- -nolock -unixkill"' -alias startvnc='vncserver -geometry 1870x980 -depth 24' -alias startvnc4='vnc4server -geometry 1870x980 -depth 24' -alias dot='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' -alias genilog='/c/projects/genilog/genilog.py' +alias sl=ls +alias la='ls -A' +alias ll='ls -Al' +alias l1='ls -1' +alias l.='ls -d .[a-z]*' + +lsflags="-hF" +# Detect which `ls` flavor is in use +if [ -x "$(which dircolors 2>/dev/null)" ]; then # GNU `ls` + eval $(dircolors -b $HOME/.dir_colors) + colorflag="--color=auto" + lsflags="$lsflags -I NTUSER.\* -I ntuser.\*" +else # OS X `ls` + export CLICOLOR=1 + colorflag="-G" +fi + +alias ls="ls $colorflag $lsflags" +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' + +if [ -e /usr/bin/vimx ]; then alias vim='/usr/bin/vimx'; fi + +# Shortcuts +alias g='git' +alias h='history' +alias j='jobs' +alias v='vim' +alias q='exit' +alias c='clear' +alias cls='clear' + +alias edit="$EDITOR" +alias pager="$PAGER" + +# Easier navigation: .., ..., ...., ....., ~ and - +alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias .....="cd ../../../.." +alias ~="cd ~" # `cd` is probably faster to type though +alias -- -="cd -" +alias cd=cd_func +alias -- --="cd --" +alias -- -0="cd -0" +alias -- -1="cd -1" +alias -- -2="cd -2" +alias -- -3="cd -3" +alias -- -4="cd -4" +alias -- -5="cd -5" +alias -- -6="cd -6" +alias -- -7="cd -7" +alias -- -8="cd -8" +alias -- -9="cd -9" + +# Secure settings +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i' +alias md='mkdir -p' +alias rd='rmdir' +alias mkdate='mkdir "$(date +'%Y%m%d')"' + +if [ ! -x "$(which tree 2>/dev/null)" ] +then + alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" +fi + +alias info='info --vi-keys' +#alias less='less -rX' # raw control characters, don't clear the screen after quitting + +# Enable aliases to be sudo'ed +alias sudo='sudo ' +alias _="sudo" + +# Get week number +alias week='date +%V' + +# Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + diff --git a/.config/bash/completion b/.config/bash/completion index e23497e..b1460ac 100644 --- a/.config/bash/completion +++ b/.config/bash/completion @@ -1,15 +1,15 @@ -# Add tab completion for many Bash commands - -[ -f /etc/bash_completion ] && . /etc/bash_completion - -[ -f "${HOME}/.cache/bash/git-completion.bash" ] && . "${HOME}/.cache/bash/git-completion.bash" - -# Enable tab completion for `g` by marking it as an alias for `git` -if type _git &> /dev/null; then - complete -o default -o nospace -F _git g; -fi; - -# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -if [ -e "$HOME/.ssh/config" ]; then - complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; -fi; +# Add tab completion for many Bash commands + +[ -f /etc/bash_completion ] && . /etc/bash_completion + +[ -f "${HOME}/.cache/bash/git-completion.bash" ] && . "${HOME}/.cache/bash/git-completion.bash" + +# Enable tab completion for `g` by marking it as an alias for `git` +if type _git &> /dev/null; then + complete -o default -o nospace -F _git g; +fi; + +# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards +if [ -e "$HOME/.ssh/config" ]; then + complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh; +fi; diff --git a/.config/bash/functions b/.config/bash/functions index 2aab04b..cabbbc0 100644 --- a/.config/bash/functions +++ b/.config/bash/functions @@ -1,80 +1,80 @@ -# Create a new directory and enter it -function mkd() { - mkdir -p "$@" && cd "$@"; -} - -# `v` with no arguments opens the current directory in Vim, otherwise opens the -# given location -function v() { - if [ $# -eq 0 ]; then - vim .; - else - vim "$@"; - fi; -} - -# `o` with no arguments opens the current directory, otherwise opens the given -# location -function o() { - if [ $# -eq 0 ]; then - open .; - else - open "$@"; - fi; -} - -# This function defines a 'cd' replacement function capable of keeping, -# displaying and accessing history of visited directories, up to 10 entries. -# To use it, uncomment it, source this file and try 'cd --'. - -cd_func() -{ - local x2 the_new_dir adir index - local -i cnt - - if [[ $1 == "--" ]]; then - dirs -v - return 0 - fi - - the_new_dir=$1 - [[ -z $1 ]] && the_new_dir=$HOME - - if [[ ${the_new_dir:0:1} == '-' ]]; then - # - # Extract dir N from dirs - index=${the_new_dir:1} - [[ -z $index ]] && index=1 - adir=$(dirs +$index) - [[ -z $adir ]] && return 1 - the_new_dir=$adir - fi - - # - # '~' has to be substituted by ${HOME} - [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}" - - # - # Now change to the new dir and add to the top of the stack - pushd "${the_new_dir}" > /dev/null - [[ $? -ne 0 ]] && return 1 - the_new_dir=$(pwd) - - # - # Trim down everything beyond 11th entry - popd -n +11 2>/dev/null 1>/dev/null - - # - # Remove any other occurence of this dir, skipping the top of the stack - for ((cnt=1; cnt <= 10; cnt++)); do - x2=$(dirs +${cnt} 2>/dev/null) - [[ $? -ne 0 ]] && return 0 - [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}" - if [[ "${x2}" == "${the_new_dir}" ]]; then - popd -n +$cnt 2>/dev/null 1>/dev/null - cnt=cnt-1 - fi - done - - return 0 -} +# Create a new directory and enter it +function mkd() { + mkdir -p "$@" && cd "$@"; +} + +# `v` with no arguments opens the current directory in Vim, otherwise opens the +# given location +function v() { + if [ $# -eq 0 ]; then + vim .; + else + vim "$@"; + fi; +} + +# `o` with no arguments opens the current directory, otherwise opens the given +# location +function o() { + if [ $# -eq 0 ]; then + open .; + else + open "$@"; + fi; +} + +# This function defines a 'cd' replacement function capable of keeping, +# displaying and accessing history of visited directories, up to 10 entries. +# To use it, uncomment it, source this file and try 'cd --'. + +cd_func() +{ + local x2 the_new_dir adir index + local -i cnt + + if [[ $1 == "--" ]]; then + dirs -v + return 0 + fi + + the_new_dir=$1 + [[ -z $1 ]] && the_new_dir=$HOME + + if [[ ${the_new_dir:0:1} == '-' ]]; then + # + # Extract dir N from dirs + index=${the_new_dir:1} + [[ -z $index ]] && index=1 + adir=$(dirs +$index) + [[ -z $adir ]] && return 1 + the_new_dir=$adir + fi + + # + # '~' has to be substituted by ${HOME} + [[ ${the_new_dir:0:1} == '~' ]] && the_new_dir="${HOME}${the_new_dir:1}" + + # + # Now change to the new dir and add to the top of the stack + pushd "${the_new_dir}" > /dev/null + [[ $? -ne 0 ]] && return 1 + the_new_dir=$(pwd) + + # + # Trim down everything beyond 11th entry + popd -n +11 2>/dev/null 1>/dev/null + + # + # Remove any other occurence of this dir, skipping the top of the stack + for ((cnt=1; cnt <= 10; cnt++)); do + x2=$(dirs +${cnt} 2>/dev/null) + [[ $? -ne 0 ]] && return 0 + [[ ${x2:0:1} == '~' ]] && x2="${HOME}${x2:1}" + if [[ "${x2}" == "${the_new_dir}" ]]; then + popd -n +$cnt 2>/dev/null 1>/dev/null + cnt=cnt-1 + fi + done + + return 0 +} diff --git a/.config/bash/options b/.config/bash/options index b49294b..3081bae 100644 --- a/.config/bash/options +++ b/.config/bash/options @@ -1,20 +1,20 @@ -# Case-insensitive globbing (used in pathname expansion) -shopt -s nocaseglob; - -# Append to the Bash history file, rather than overwriting it -#shopt -s histappend; - -# Autocorrect typos in path names when using `cd` -shopt -s cdspell; - -# Enable some Bash 4 features when possible: -# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` -# * Recursive globbing, e.g. `echo **/*.txt` -for option in autocd globstar; do - shopt -s "$option" 2> /dev/null; -done; - -# Don't use ^D to exit -set -o ignoreeof -set -o vi - +# Case-insensitive globbing (used in pathname expansion) +shopt -s nocaseglob; + +# Append to the Bash history file, rather than overwriting it +#shopt -s histappend; + +# Autocorrect typos in path names when using `cd` +shopt -s cdspell; + +# Enable some Bash 4 features when possible: +# * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux` +# * Recursive globbing, e.g. `echo **/*.txt` +for option in autocd globstar; do + shopt -s "$option" 2> /dev/null; +done; + +# Don't use ^D to exit +set -o ignoreeof +set -o vi + diff --git a/.config/bash/prompt.bash b/.config/bash/prompt.bash index fba6244..ffdbf57 100644 --- a/.config/bash/prompt.bash +++ b/.config/bash/prompt.bash @@ -1,203 +1,203 @@ -#!/bin/bash - -# bash_prompt - -# iTerm2 prefs: import Solarized theme (disable bright colors for bold text) -# Color ref: http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim -# More tips: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html - -if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then - export TERM='gnome-256color'; -elif infocmp xterm-256color >/dev/null 2>&1; then - export TERM='xterm-256color'; -fi; - -if [ -f "${HOME}/.cache/bash/git-prompt.sh" ]; then - . "${HOME}/.cache/bash/git-prompt.sh" - - # Enabling any of these options will slow down the prompt - export GIT_PS1_SHOWDIRTYSTATE='y' - export GIT_PS1_SHOWSTASHSTATE='y' - export GIT_PS1_SHOWUNTRACKEDFILES='y' - export GIT_PS1_DESCRIBE_STYLE='contains' - export GIT_PS1_SHOWUPSTREAM='auto' -fi - -# Solarized colors -# (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values) -set_prompts() -{ -# GREEN="\[$(tput setaf 2)\]" -# RESET="\[$(tput sgr0)\]" -# -## Reset -#Color_Off="\[\033[0m\]" # Text Reset -# -## Regular Colors -#Black="\[\033[0;30m\]" # Black -#Red="\[\033[0;31m\]" # Red -#Green="\[\033[0;32m\]" # Green -#Yellow="\[\033[0;33m\]" # Yellow -#Blue="\[\033[0;34m\]" # Blue -#Purple="\[\033[0;35m\]" # Purple -#Cyan="\[\033[0;36m\]" # Cyan -#White="\[\033[0;37m\]" # White -# -## Bold -#BBlack="\[\033[1;30m\]" # Black -#BRed="\[\033[1;31m\]" # Red -#BGreen="\[\033[1;32m\]" # Green -#BYellow="\[\033[1;33m\]" # Yellow -#BBlue="\[\033[1;34m\]" # Blue -#BPurple="\[\033[1;35m\]" # Purple -#BCyan="\[\033[1;36m\]" # Cyan -#BWhite="\[\033[1;37m\]" # White -# -## Underline -#UBlack="\[\033[4;30m\]" # Black -#URed="\[\033[4;31m\]" # Red -#UGreen="\[\033[4;32m\]" # Green -#UYellow="\[\033[4;33m\]" # Yellow -#UBlue="\[\033[4;34m\]" # Blue -#UPurple="\[\033[4;35m\]" # Purple -#UCyan="\[\033[4;36m\]" # Cyan -#UWhite="\[\033[4;37m\]" # White -# -## Background -#On_Black="\[\033[40m\]" # Black -#On_Red="\[\033[41m\]" # Red -#On_Green="\[\033[42m\]" # Green -#On_Yellow="\[\033[43m\]" # Yellow -#On_Blue="\[\033[44m\]" # Blue -#On_Purple="\[\033[45m\]" # Purple -#On_Cyan="\[\033[46m\]" # Cyan -#On_White="\[\033[47m\]" # White -# -## High Intensty -#IBlack="\[\033[0;90m\]" # Black -#IRed="\[\033[0;91m\]" # Red -#IGreen="\[\033[0;92m\]" # Green -#IYellow="\[\033[0;93m\]" # Yellow -#IBlue="\[\033[0;94m\]" # Blue -#IPurple="\[\033[0;95m\]" # Purple -#ICyan="\[\033[0;96m\]" # Cyan -#IWhite="\[\033[0;97m\]" # White -# -## Bold High Intensty -#BIBlack="\[\033[1;90m\]" # Black -#BIRed="\[\033[1;91m\]" # Red -#BIGreen="\[\033[1;92m\]" # Green -#BIYellow="\[\033[1;93m\]" # Yellow -#BIBlue="\[\033[1;94m\]" # Blue -#BIPurple="\[\033[1;95m\]" # Purple -#BICyan="\[\033[1;96m\]" # Cyan -#BIWhite="\[\033[1;97m\]" # White -# -## High Intensty backgrounds -#On_IBlack="\[\033[0;100m\]" # Black -#On_IRed="\[\033[0;101m\]" # Red -#On_IGreen="\[\033[0;102m\]" # Green -#On_IYellow="\[\033[0;103m\]" # Yellow -#On_IBlue="\[\033[0;104m\]" # Blue -#On_IPurple="\[\033[10;95m\]" # Purple -#On_ICyan="\[\033[0;106m\]" # Cyan -#On_IWhite="\[\033[0;107m\]" # White -# -## Various variables you might want for your PS1 prompt instead -#Time12h="\T" -#Time12a="\@" -#PathShort="\w" -#PathFull="\W" -#NewLine="\n" -#Jobs="\j" -#export PS1="${GREEN}my prompt${RESET}> " - - if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then - bold=$(tput bold) - reset=$(tput sgr0) - - black=$(tput setaf 0) - blue=$(tput setaf 33) - cyan=$(tput setaf 37) - green=$(tput setaf 64) - orange=$(tput setaf 166) - purple=$(tput setaf 125) - red=$(tput setaf 124) - violet=$(tput setaf 61) - white=$(tput setaf 15) - yellow=$(tput setaf 136) - else - bold="" - reset="\e[0m" - - black="\e[1;30m" - blue="\e[1;34m" - cyan="\e[1;36m" - green="\e[1;32m" - orange="\e[1;33m" - purple="\e[1;35m" - red="\e[1;31m" - violet="\e[1;35m" - white="\e[1;37m" - yellow="\e[1;33m" - fi - - # build the prompt - fg="$white" - - # logged in as root - if [[ "$USER" == "root" ]]; then - userStyle="$bold$red" - else - userStyle="$orange" - fi - - # connected via ssh - if [[ "$SSH_TTY" ]]; then - hostStyle="$bold$red" - else - hostStyle="$yellow" - fi - - # Set the terminal title to the current working directory. - PS1="\[\033]0;\w\007\]" - - if [[ "$TERM" == *color ]]; then -# PS1+=$'\r' # carriage return - PS1+="\[$userStyle\]\u" # username - PS1+="\[$reset$fg\] at " - PS1+="\[$hostStyle\]\h" # host - PS1+="\[$reset$fg\] in " - PS1+="\[$green\]\w" # working directory - # PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details - PS1+="\$(__git_ps1 '\[${fg}\] on \[${cyan}\]%s')"; # on branch - PS1+=$'\n' # newline - PS1+="\[$reset$fg\]\$ \[$reset\]" # $ (and reset color) - - PS2="\[${yellow}\]-> " - PS2+="\[${reset}\]" # reset color - else # no colors - PS1+=$'\r' # carriage return - PS1+="\u at \h in \w on \$(__git_ps1 %s)" - PS1+=$'\n''\$ ' # newline and $ - - PS2="-> " - fi - - export PS1 PS2 -} - - -set_prompts -unset set_prompts - -# When the shell exits, append to the history file instead of overwriting it -shopt -s histappend -# Larger bash history -export HISTFILESIZE=10000; -export HISTSIZE=5000; -export HISTCONTROL=ignoreboth:erasedups -export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help"; -# Whenever displaying the prompt, write the previous line to disk -export PROMPT_COMMAND="history -a" - +#!/bin/bash + +# bash_prompt + +# iTerm2 prefs: import Solarized theme (disable bright colors for bold text) +# Color ref: http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim +# More tips: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html + +if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then + export TERM='gnome-256color'; +elif infocmp xterm-256color >/dev/null 2>&1; then + export TERM='xterm-256color'; +fi; + +if [ -f "${HOME}/.cache/bash/git-prompt.sh" ]; then + . "${HOME}/.cache/bash/git-prompt.sh" + + # Enabling any of these options will slow down the prompt + export GIT_PS1_SHOWDIRTYSTATE='y' + export GIT_PS1_SHOWSTASHSTATE='y' + export GIT_PS1_SHOWUNTRACKEDFILES='y' + export GIT_PS1_DESCRIBE_STYLE='contains' + export GIT_PS1_SHOWUPSTREAM='auto' +fi + +# Solarized colors +# (https://github.com/altercation/solarized/tree/master/iterm2-colors-solarized#the-values) +set_prompts() +{ +# GREEN="\[$(tput setaf 2)\]" +# RESET="\[$(tput sgr0)\]" +# +## Reset +#Color_Off="\[\033[0m\]" # Text Reset +# +## Regular Colors +#Black="\[\033[0;30m\]" # Black +#Red="\[\033[0;31m\]" # Red +#Green="\[\033[0;32m\]" # Green +#Yellow="\[\033[0;33m\]" # Yellow +#Blue="\[\033[0;34m\]" # Blue +#Purple="\[\033[0;35m\]" # Purple +#Cyan="\[\033[0;36m\]" # Cyan +#White="\[\033[0;37m\]" # White +# +## Bold +#BBlack="\[\033[1;30m\]" # Black +#BRed="\[\033[1;31m\]" # Red +#BGreen="\[\033[1;32m\]" # Green +#BYellow="\[\033[1;33m\]" # Yellow +#BBlue="\[\033[1;34m\]" # Blue +#BPurple="\[\033[1;35m\]" # Purple +#BCyan="\[\033[1;36m\]" # Cyan +#BWhite="\[\033[1;37m\]" # White +# +## Underline +#UBlack="\[\033[4;30m\]" # Black +#URed="\[\033[4;31m\]" # Red +#UGreen="\[\033[4;32m\]" # Green +#UYellow="\[\033[4;33m\]" # Yellow +#UBlue="\[\033[4;34m\]" # Blue +#UPurple="\[\033[4;35m\]" # Purple +#UCyan="\[\033[4;36m\]" # Cyan +#UWhite="\[\033[4;37m\]" # White +# +## Background +#On_Black="\[\033[40m\]" # Black +#On_Red="\[\033[41m\]" # Red +#On_Green="\[\033[42m\]" # Green +#On_Yellow="\[\033[43m\]" # Yellow +#On_Blue="\[\033[44m\]" # Blue +#On_Purple="\[\033[45m\]" # Purple +#On_Cyan="\[\033[46m\]" # Cyan +#On_White="\[\033[47m\]" # White +# +## High Intensty +#IBlack="\[\033[0;90m\]" # Black +#IRed="\[\033[0;91m\]" # Red +#IGreen="\[\033[0;92m\]" # Green +#IYellow="\[\033[0;93m\]" # Yellow +#IBlue="\[\033[0;94m\]" # Blue +#IPurple="\[\033[0;95m\]" # Purple +#ICyan="\[\033[0;96m\]" # Cyan +#IWhite="\[\033[0;97m\]" # White +# +## Bold High Intensty +#BIBlack="\[\033[1;90m\]" # Black +#BIRed="\[\033[1;91m\]" # Red +#BIGreen="\[\033[1;92m\]" # Green +#BIYellow="\[\033[1;93m\]" # Yellow +#BIBlue="\[\033[1;94m\]" # Blue +#BIPurple="\[\033[1;95m\]" # Purple +#BICyan="\[\033[1;96m\]" # Cyan +#BIWhite="\[\033[1;97m\]" # White +# +## High Intensty backgrounds +#On_IBlack="\[\033[0;100m\]" # Black +#On_IRed="\[\033[0;101m\]" # Red +#On_IGreen="\[\033[0;102m\]" # Green +#On_IYellow="\[\033[0;103m\]" # Yellow +#On_IBlue="\[\033[0;104m\]" # Blue +#On_IPurple="\[\033[10;95m\]" # Purple +#On_ICyan="\[\033[0;106m\]" # Cyan +#On_IWhite="\[\033[0;107m\]" # White +# +## Various variables you might want for your PS1 prompt instead +#Time12h="\T" +#Time12a="\@" +#PathShort="\w" +#PathFull="\W" +#NewLine="\n" +#Jobs="\j" +#export PS1="${GREEN}my prompt${RESET}> " + + if [ -x /usr/bin/tput ] && tput setaf 1 >& /dev/null; then + bold=$(tput bold) + reset=$(tput sgr0) + + black=$(tput setaf 0) + blue=$(tput setaf 33) + cyan=$(tput setaf 37) + green=$(tput setaf 64) + orange=$(tput setaf 166) + purple=$(tput setaf 125) + red=$(tput setaf 124) + violet=$(tput setaf 61) + white=$(tput setaf 15) + yellow=$(tput setaf 136) + else + bold="" + reset="\e[0m" + + black="\e[1;30m" + blue="\e[1;34m" + cyan="\e[1;36m" + green="\e[1;32m" + orange="\e[1;33m" + purple="\e[1;35m" + red="\e[1;31m" + violet="\e[1;35m" + white="\e[1;37m" + yellow="\e[1;33m" + fi + + # build the prompt + fg="$white" + + # logged in as root + if [[ "$USER" == "root" ]]; then + userStyle="$bold$red" + else + userStyle="$orange" + fi + + # connected via ssh + if [[ "$SSH_TTY" ]]; then + hostStyle="$bold$red" + else + hostStyle="$yellow" + fi + + # Set the terminal title to the current working directory. + PS1="\[\033]0;\w\007\]" + + if [[ "$TERM" == *color ]]; then +# PS1+=$'\r' # carriage return + PS1+="\[$userStyle\]\u" # username + PS1+="\[$reset$fg\] at " + PS1+="\[$hostStyle\]\h" # host + PS1+="\[$reset$fg\] in " + PS1+="\[$green\]\w" # working directory + # PS1+="\$(prompt_git \"$white on $cyan\")" # git repository details + PS1+="\$(__git_ps1 '\[${fg}\] on \[${cyan}\]%s')"; # on branch + PS1+=$'\n' # newline + PS1+="\[$reset$fg\]\$ \[$reset\]" # $ (and reset color) + + PS2="\[${yellow}\]-> " + PS2+="\[${reset}\]" # reset color + else # no colors + PS1+=$'\r' # carriage return + PS1+="\u at \h in \w on \$(__git_ps1 %s)" + PS1+=$'\n''\$ ' # newline and $ + + PS2="-> " + fi + + export PS1 PS2 +} + + +set_prompts +unset set_prompts + +# When the shell exits, append to the history file instead of overwriting it +shopt -s histappend +# Larger bash history +export HISTFILESIZE=10000; +export HISTSIZE=5000; +export HISTCONTROL=ignoreboth:erasedups +export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help"; +# Whenever displaying the prompt, write the previous line to disk +export PROMPT_COMMAND="history -a" + diff --git a/.config/bash/solarized b/.config/bash/solarized index cdb1920..180196d 100644 --- a/.config/bash/solarized +++ b/.config/bash/solarized @@ -1,23 +1,23 @@ -[[ "$OSTYPE" == *darwin* ]] && return; - -echo -ne '\eP\e]10;#839496\a' # Foreground -> base0 -echo -ne '\eP\e]11;#002B36\a' # Background -> base03 - -echo -ne '\eP\e]12;#DC322F\a' # Cursor -> red - -echo -ne '\eP\e]4;0;#073642\a' # black -> Base02 -echo -ne '\eP\e]4;8;#002B36\a' # bold black -> Base03 -echo -ne '\eP\e]4;1;#DC322F\a' # red -> red -echo -ne '\eP\e]4;9;#CB4B16\a' # bold red -> orange -echo -ne '\eP\e]4;2;#859900\a' # green -> green -echo -ne '\eP\e]4;10;#586E75\a' # bold green -> base01 * -echo -ne '\eP\e]4;3;#B58900\a' # yellow -> yellow -echo -ne '\eP\e]4;11;#657B83\a' # bold yellow -> base00 * -echo -ne '\eP\e]4;4;#268BD2\a' # blue -> blue -echo -ne '\eP\e]4;12;#839496\a' # bold blue -> base0 * -echo -ne '\eP\e]4;5;#D33682\a' # magenta -> magenta -echo -ne '\eP\e]4;13;#6C71C4\a' # bold magenta -> violet -echo -ne '\eP\e]4;6;#2AA198\a' # cyan -> cyan -echo -ne '\eP\e]4;14;#93A1A1\a' # bold cyan -> base1 * -echo -ne '\eP\e]4;7;#EEE8D5\a' # white -> Base2 -echo -ne '\eP\e]4;15;#FDF6E3\a' # bold white -> Base3 +[[ "$OSTYPE" == *darwin* ]] && return; + +echo -ne '\eP\e]10;#839496\a' # Foreground -> base0 +echo -ne '\eP\e]11;#002B36\a' # Background -> base03 + +echo -ne '\eP\e]12;#DC322F\a' # Cursor -> red + +echo -ne '\eP\e]4;0;#073642\a' # black -> Base02 +echo -ne '\eP\e]4;8;#002B36\a' # bold black -> Base03 +echo -ne '\eP\e]4;1;#DC322F\a' # red -> red +echo -ne '\eP\e]4;9;#CB4B16\a' # bold red -> orange +echo -ne '\eP\e]4;2;#859900\a' # green -> green +echo -ne '\eP\e]4;10;#586E75\a' # bold green -> base01 * +echo -ne '\eP\e]4;3;#B58900\a' # yellow -> yellow +echo -ne '\eP\e]4;11;#657B83\a' # bold yellow -> base00 * +echo -ne '\eP\e]4;4;#268BD2\a' # blue -> blue +echo -ne '\eP\e]4;12;#839496\a' # bold blue -> base0 * +echo -ne '\eP\e]4;5;#D33682\a' # magenta -> magenta +echo -ne '\eP\e]4;13;#6C71C4\a' # bold magenta -> violet +echo -ne '\eP\e]4;6;#2AA198\a' # cyan -> cyan +echo -ne '\eP\e]4;14;#93A1A1\a' # bold cyan -> base1 * +echo -ne '\eP\e]4;7;#EEE8D5\a' # white -> Base2 +echo -ne '\eP\e]4;15;#FDF6E3\a' # bold white -> Base3 diff --git a/.config/git/attributes b/.config/git/attributes index 0034fed..db895c5 100644 --- a/.config/git/attributes +++ b/.config/git/attributes @@ -1,18 +1,18 @@ -# Default -#* text=auto - -# Text files that should be normalized (CRLF => LF) -#*.c text -#*.h text - -# Text files with fixed EOL=LF -#*.sh text eol=LF - -# Text files with fixed EOL=CRLF$ -#*.bat text eol=CRLF -#*.ahk text eol=crlf -#*.vcproj text eol=crlf - -# Binary files -#*.reg binary -#*.exe binary +# Default +#* text=auto + +# Text files that should be normalized (CRLF => LF) +#*.c text +#*.h text + +# Text files with fixed EOL=LF +#*.sh text eol=LF + +# Text files with fixed EOL=CRLF$ +#*.bat text eol=CRLF +#*.ahk text eol=crlf +#*.vcproj text eol=crlf + +# Binary files +#*.reg binary +#*.exe binary diff --git a/.config/git/config b/.config/git/config index 1c5fc15..cf4929f 100644 --- a/.config/git/config +++ b/.config/git/config @@ -2,102 +2,102 @@ clean = git-lfs clean %f smudge = git-lfs smudge %f required = true -[github] - user = jannikz -[alias] - a = add - una = reset HEAD -- - uha = checkout HEAD -- - unaa = reset HEAD - uhaa = reset --hard HEAD - br = branch - brdm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" - co = checkout - go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" - ci = commit - amend = commit --amend - unci = reset --soft HEAD~ - diff = diff --word-diff - dt = difftool - mt = mergetool - # dont pull without rebase, and dont push without pull (fetch & merge) - p = pull --rebase - pp = "!git pull --rebase && git push" - # avoid merge commits - mf = merge --ff-only - cp = cherry-pick - wc = whatchanged -p - ch = cherry -v - s = status -sb - fs = "!git fetch && git status" - rb = rebase - ec = config --global -e - l = log --oneline --decorate - lg = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph +[github] + user = jannikz +[alias] + a = add + una = reset HEAD -- + uha = checkout HEAD -- + unaa = reset HEAD + uhaa = reset --hard HEAD + br = branch + brdm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" + co = checkout + go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" + ci = commit + amend = commit --amend + unci = reset --soft HEAD~ + diff = diff --word-diff + dt = difftool + mt = mergetool + # dont pull without rebase, and dont push without pull (fetch & merge) + p = pull --rebase + pp = "!git pull --rebase && git push" + # avoid merge commits + mf = merge --ff-only + cp = cherry-pick + wc = whatchanged -p + ch = cherry -v + s = status -sb + fs = "!git fetch && git status" + rb = rebase + ec = config --global -e + l = log --oneline --decorate + lg = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph lol = log --oneline --decorate --graph --all --first-parent - last = log -1 HEAD - ls = ls-files - lt = tag -l - type = cat-file -t - dump = cat-file -p - who = shortlog -s -- - remotes = remote -v - root = rev-parse --show-toplevel - cl = clone --recursive + last = log -1 HEAD + ls = ls-files + lt = tag -l + type = cat-file -t + dump = cat-file -p + who = shortlog -s -- + remotes = remote -v + root = rev-parse --show-toplevel + cl = clone --recursive - # Show the diff between the latest commit and the current state - d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" - # `git di $number` shows the diff between the state `$number` revisions ago and the current state - di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" + # Show the diff between the latest commit and the current state + d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat" + # `git di $number` shows the diff between the state `$number` revisions ago and the current state + di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d" - # Find branches containing commit - fb = "!f() { git branch -a --contains $1; }; f" - # Find tags containing commit - ft = "!f() { git describe --always --contains $1; }; f" - # Find commits by source code - fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f" - # Find commits by commit message - fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f" + # Find branches containing commit + fb = "!f() { git branch -a --contains $1; }; f" + # Find tags containing commit + ft = "!f() { git describe --always --contains $1; }; f" + # Find commits by source code + fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f" + # Find commits by commit message + fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f" - #Credit an author on the latest commit - credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" - # List contributors with number of commits - contributors = shortlog --summary --numbered + #Credit an author on the latest commit + credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f" + # List contributors with number of commits + contributors = shortlog --summary --numbered - k = !gitk - visual = !gitk + k = !gitk + visual = !gitk - ctags = "!sh -c '[ -f .git/hooks/ctags ] || git init; .git/hooks/ctags' git-ctags" - gtags = "!sh -c '[ -f .git/hooks/gtags ] || git init; .git/hooks/gtags' git-gtags" - cscope = "!sh -c '[ -f .git/hooks/cscope ] || git init; .git/hooks/cscope' git-cscope" - -[help] - autocorrect = 10 -[branch] - autosetupmerge = always - autosetuprebase = always -[rebase] - autosquash = true - autostash = true -[pull] - rebase = true -[push] - default = simple -[diff] - tool = vimdiff -[difftool] - prompt = false -[merge] - tool = vimdiff - conflictstyle = diff3 -[mergetool] - prompt = false -[init] - templatedir = ~/.config/git/templates -[core] + ctags = "!sh -c '[ -f .git/hooks/ctags ] || git init; .git/hooks/ctags' git-ctags" + gtags = "!sh -c '[ -f .git/hooks/gtags ] || git init; .git/hooks/gtags' git-gtags" + cscope = "!sh -c '[ -f .git/hooks/cscope ] || git init; .git/hooks/cscope' git-cscope" + +[help] + autocorrect = 10 +[branch] + autosetupmerge = always + autosetuprebase = always +[rebase] + autosquash = true + autostash = true +[pull] + rebase = true +[push] + default = simple +[diff] + tool = vimdiff +[difftool] + prompt = false +[merge] + tool = vimdiff + conflictstyle = diff3 +[mergetool] + prompt = false +[init] + templatedir = ~/.config/git/templates +[core] excludesfile = - attributesFile = ~/.config/git/attributes - editor = vim + attributesFile = ~/.config/git/attributes + editor = vim # eol = native autocrlf = false [include] diff --git a/.config/git/ignore b/.config/git/ignore index 0d306af..5221ad5 100644 --- a/.config/git/ignore +++ b/.config/git/ignore @@ -1,64 +1,64 @@ -# Ignore tags created by etags, ctags, gtags (GNU global) and cscope -TAGS -.TAGS -!TAGS/ -tags -.tags -!tags/ -gtags.files -GTAGS -GRTAGS -GPATH -cscope.files -cscope.out -cscope.in.out -cscope.po.out - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -# OSX -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -__pycache__ +# Ignore tags created by etags, ctags, gtags (GNU global) and cscope +TAGS +.TAGS +!TAGS/ +tags +.tags +!tags/ +gtags.files +GTAGS +GRTAGS +GPATH +cscope.files +cscope.out +cscope.in.out +cscope.po.out + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + + +# OSX +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +__pycache__ diff --git a/.config/profile/environ.sh b/.config/profile/environ.sh index 1561265..a16bcda 100644 --- a/.config/profile/environ.sh +++ b/.config/profile/environ.sh @@ -1,49 +1,49 @@ -export USERNAME=$LOGNAME -export HOSTNAME=`hostname` -#echo Welcome $USERNAME. You are on Server: $HOSTNAME !!! - -# Set defaults -export SHELL='bash' -export EDITOR='vim' -export VISUAL='vim' -export PAGER='less -eFRX' -export MANPAGER="less -eFRX" -export BROWSER='lynx -vikeys -use_mouse' - - -# Prefer US language and UTF-8 -export LANG="en_US.UTF-8"; -export LC_ALL="en_US.UTF-8"; -#export LC_ALL="en_DK.UTF-8"; -#export LC_NUMERIC=en_DK.UTF-8 -#export LC_TIME=en_DK.UTF-8 -#export LC_MONETARY=en_DK.UTF-8 -#export LC_PAPER=en_DK.UTF-8 -#export LC_MEASUREMENT=en_DK.UTF-8 -export KEYMAP=us -# Highlight section titles in manual pages -export LESS_TERMCAP_md="${yellow}"; - -# Always enable colored `grep` output -#export GREP_OPTIONS="--color=auto"; - -# Set up syntax highlighting for 'less' (requires source-highlight package) -# See http://www.gnu.org/software/src-highlite/source-highlight.html -# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" -export LESS=-eFRX - -#export GTEST_DIR='c:/googletest-release-1.7.0' -#export GTEST_DIR='c:/googletest-release-1.8.0' -#export CPPUNITDIR='c:/cppunit-1.12.1' -#export CPPUNITDIR='c:/cppunit-1.13.2' -export CPPUNITDIR_2013='c:/programs/cppunit_2013' - -export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3 - -#export XDG_CONFIG_HOME = ~/.config/ -#export XDG_DATA_HOME = ~/.local/share/ -#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/ -if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then - . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs - export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR -fi +export USERNAME=$LOGNAME +export HOSTNAME=`hostname` +#echo Welcome $USERNAME. You are on Server: $HOSTNAME !!! + +# Set defaults +export SHELL='bash' +export EDITOR='vim' +export VISUAL='vim' +export PAGER='less -eFRX' +export MANPAGER="less -eFRX" +export BROWSER='lynx -vikeys -use_mouse' + + +# Prefer US language and UTF-8 +export LANG="en_US.UTF-8"; +export LC_ALL="en_US.UTF-8"; +#export LC_ALL="en_DK.UTF-8"; +#export LC_NUMERIC=en_DK.UTF-8 +#export LC_TIME=en_DK.UTF-8 +#export LC_MONETARY=en_DK.UTF-8 +#export LC_PAPER=en_DK.UTF-8 +#export LC_MEASUREMENT=en_DK.UTF-8 +export KEYMAP=us +# Highlight section titles in manual pages +export LESS_TERMCAP_md="${yellow}"; + +# Always enable colored `grep` output +#export GREP_OPTIONS="--color=auto"; + +# Set up syntax highlighting for 'less' (requires source-highlight package) +# See http://www.gnu.org/software/src-highlite/source-highlight.html +# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" +export LESS=-eFRX + +#export GTEST_DIR='c:/googletest-release-1.7.0' +#export GTEST_DIR='c:/googletest-release-1.8.0' +#export CPPUNITDIR='c:/cppunit-1.12.1' +#export CPPUNITDIR='c:/cppunit-1.13.2' +export CPPUNITDIR_2013='c:/programs/cppunit_2013' + +export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3 + +#export XDG_CONFIG_HOME = ~/.config/ +#export XDG_DATA_HOME = ~/.local/share/ +#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/ +if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then + . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs + export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR +fi diff --git a/.config/profile/install.sh b/.config/profile/install.sh index 9e55a9c..5bdc46b 100644 --- a/.config/profile/install.sh +++ b/.config/profile/install.sh @@ -1,13 +1,13 @@ -# Install git completion -if [ ! -f "${HOME}/.cache/bash/git-completion.bash" ]; then - URL="https://raw.githubusercontent.com/git/git/master/contrib/completion" - mkdir -p ${HOME}/.cache/bash > /dev/null 2>&1 - curl "${URL}/git-completion.bash" -L -s -o "${HOME}/.cache/bash/git-completion.bash" - curl "${URL}/git-prompt.sh" -L -s -o "${HOME}/.cache/bash/git-prompt.sh" -fi - -# Install fzf -if [ ! -f "${HOME}/.cache/fzf/install" ]; then - git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.cache/fzf - $HOME/.cache/fzf/install -fi +# Install git completion +if [ ! -f "${HOME}/.cache/bash/git-completion.bash" ]; then + URL="https://raw.githubusercontent.com/git/git/master/contrib/completion" + mkdir -p ${HOME}/.cache/bash > /dev/null 2>&1 + curl "${URL}/git-completion.bash" -L -s -o "${HOME}/.cache/bash/git-completion.bash" + curl "${URL}/git-prompt.sh" -L -s -o "${HOME}/.cache/bash/git-prompt.sh" +fi + +# Install fzf +if [ ! -f "${HOME}/.cache/fzf/install" ]; then + git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.cache/fzf + $HOME/.cache/fzf/install +fi diff --git a/.config/profile/paths.sh b/.config/profile/paths.sh index b2f1c9d..0d355c3 100644 --- a/.config/profile/paths.sh +++ b/.config/profile/paths.sh @@ -1,42 +1,42 @@ -# Set XDG directory defaults -#export XDG_DATA_DIRS=/usr/share/ -#export XDG_CONFIG_DIRS=/etc/xdg/ - -PATH=.:${HOME}/bin:${PATH} -#PATH=/c/ProgramData/chocolatey/bin:${PATH} -PATH=${HOME}/.gem/ruby/2.3.0/gems/asciidoctor-1.5.6.1/bin:${PATH} - -# Set PATH so it includes user's private bin if it exists -if [ -d "${HOME}/.local/bin" ] ; then - PATH=${HOME}/.local/bin:${PATH} -fi - -# Set MANPATH so it includes users' private man if it exists -if [ -d "${HOME}/.local/share/man" ]; then - MANPATH="${HOME}/.local/share/man:${MANPATH}" -fi - -# Set INFOPATH so it includes users' private info if it exists -if [ -d "${HOME}/.local/share/info" ]; then - INFOPATH="${HOME}/.local/share/info:${INFOPATH}" -fi - -# Set PATH to temporary folders -export TMPDIR="${HOME}/.tmp" -export TEMPDIR="$TMPDIR" -export TEMP="$TMPDIR" -export TMP="$TMPDIR" -mkdir -m700 "$TMPDIR" > /dev/null 2>&1 - -# Set PATH to PREFIX folders -export PREFIX="${HOME}/.local/" - -# Add local libraries to libpath -# LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}" - -# Setup some the location environment variable. -#export MYVIMRC="$HOME/.config/vim/vimrc" -export INPUTRC="$HOME/.inputrc" -export HISTFILE="$HOME/.local/share/bash/history"; - - +# Set XDG directory defaults +#export XDG_DATA_DIRS=/usr/share/ +#export XDG_CONFIG_DIRS=/etc/xdg/ + +PATH=.:${HOME}/bin:${PATH} +#PATH=/c/ProgramData/chocolatey/bin:${PATH} +PATH=${HOME}/.gem/ruby/2.3.0/gems/asciidoctor-1.5.6.1/bin:${PATH} + +# Set PATH so it includes user's private bin if it exists +if [ -d "${HOME}/.local/bin" ] ; then + PATH=${HOME}/.local/bin:${PATH} +fi + +# Set MANPATH so it includes users' private man if it exists +if [ -d "${HOME}/.local/share/man" ]; then + MANPATH="${HOME}/.local/share/man:${MANPATH}" +fi + +# Set INFOPATH so it includes users' private info if it exists +if [ -d "${HOME}/.local/share/info" ]; then + INFOPATH="${HOME}/.local/share/info:${INFOPATH}" +fi + +# Set PATH to temporary folders +export TMPDIR="${HOME}/.tmp" +export TEMPDIR="$TMPDIR" +export TEMP="$TMPDIR" +export TMP="$TMPDIR" +mkdir -m700 "$TMPDIR" > /dev/null 2>&1 + +# Set PATH to PREFIX folders +export PREFIX="${HOME}/.local/" + +# Add local libraries to libpath +# LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}" + +# Setup some the location environment variable. +#export MYVIMRC="$HOME/.config/vim/vimrc" +export INPUTRC="$HOME/.inputrc" +export HISTFILE="$HOME/.local/share/bash/history"; + + diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index 09593a6..0d19da4 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -1,15 +1,15 @@ -# This file is written by xdg-user-dirs-update -# If you want to change or add directories, just edit the line you're -# interested in. All local changes will be retained on the next run -# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped -# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an -# absolute path. No other format is supported. -# -XDG_DESKTOP_DIR="$HOME/Desktop" -XDG_DOWNLOAD_DIR="$HOME/Downloads" -XDG_TEMPLATES_DIR="$HOME/Templates" -XDG_PUBLICSHARE_DIR="$HOME/Public" -XDG_DOCUMENTS_DIR="$HOME/Documents" -XDG_MUSIC_DIR="$HOME/Music" -XDG_PICTURES_DIR="$HOME/Pictures" -XDG_VIDEOS_DIR="$HOME/Videos" +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="$HOME/Desktop" +XDG_DOWNLOAD_DIR="$HOME/Downloads" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/Documents" +XDG_MUSIC_DIR="$HOME/Music" +XDG_PICTURES_DIR="$HOME/Pictures" +XDG_VIDEOS_DIR="$HOME/Videos" diff --git a/.vimrc b/.vimrc index 27a3137..9750ff8 100644 --- a/.vimrc +++ b/.vimrc @@ -1,344 +1,344 @@ -" section: environment {{{1 -" --------------------- - -if (empty(glob('~/.cache/vim/autoload/plug.vim')) || - \ empty(glob('~/.local/share/vim/viminfo'))) - cd ~ - silent !mkdir -p .local/share/vim/{swap,backup,undo} - silent !mkdir -p .cache/vim/autoload - silent !curl -fLo .cache/vim/autoload/plug.vim - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall | source $MYVIMRC - cd - -endif - -set directory=~/.local/share/vim/swap -set backupdir=~/.local/share/vim/backup -set undodir=~/.local/share/vim/undo -set viminfo+=n~/.local/share/vim/viminfo -set runtimepath+=~/.cache/vim - -" section: plugins {{{1 -" --------------------- -silent call plug#begin('~/.cache/vim/bundle') -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-commentary' -Plug 'tpope/vim-unimpaired' -Plug 'tpope/vim-dispatch' -"Plug 'tpope/vim-vinager' -Plug 'scrooloose/syntastic' -"Plug 'vim-airline/vim-airline' -Plug 'airblade/vim-gitgutter' -Plug 'majutsushi/tagbar' -Plug 'fholgado/minibufexpl.vim' -Plug 'brookhong/cscope.vim' -Plug 'ctrlpvim/ctrlp.vim' -Plug 'brandonbloom/csearch.vim' -Plug 'mileszs/ack.vim' -Plug 'jeetsukumaran/vim-filesearch' -Plug 'haya14busa/incsearch.vim' -Plug 'altercation/vim-colors-solarized' -Plug 'editorconfig/editorconfig-vim' -Plug 'johnsyweb/vim-makeshift' -Plug 'tfnico/vim-gradle' -"Plug 'a.vim' -"Plug 'heaths/vim-msbuild' -"Plug 'hdima/python-syntax' -"Plug 'klen/python-mode' -"Plug 'jalcine/cmake.vim' -call plug#end() - -" section: options {{{1 -" --------------------- - -"set autoindent -set autoread -set autowrite " automatically save before commands like :next and :make -set background=dark -set backspace=2 -if exists('+breakindent') - set breakindent showbreak=\ + -endif -set cmdheight=2 -setglobal commentstring=#\ %s -set complete-=i " searching includes can be slow -"if has("win32") || has("win64") -" does not work for msys2 -set clipboard=unnamed -"else -"set clipboard=unnamedplus -"endif -set fileformats=unix,dos,mac -"set foldmethod=syntax -"set foldlevel=1 -"set foldclose=all -"set foldopen+=jump -set guioptions+=a -set history=200 -set incsearch " incremental search -set laststatus=2 " always show status line -set lazyredraw -set linebreak -set mouse=nvi -set mousemodel=popup -set number -"set pastetoggle= -set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin -set printoptions=paper:letter -set scrolloff=1 -set shiftround -set shortmess=aoOtI -"set showcmd " show (partial) command in status line. -set showmatch " show matching brackets. -set sidescrolloff=5 -set smartcase " case insensitive searches become sensitive with capitals -"setglobal tags=./tags; -set timeoutlen=500 " leader key timeout -set ttimeoutlen=50 " make esc work faster -set visualbell -if exists('+undofile') - set undofile -endif -set virtualedit=block -set updatetime=250 -set wildmenu -set wildmode=longest:full,full -set wildignore+=tags,.*.un~,*.pyc -set winaltkeys=no - -"if !has("gui_running") && $display == '' || !has("gui") -" set mouse= -"endif -" -"set makeprg=cmake\ --build\ . -" Visual studio 2013 -"set errorformat=\ %#%f(%l):\ %m -" Visual studio 2008 -"set errorformat=%.%#>\ %#%f(%l)\ :\ %m -" -" IAR compiler -set makeprg=vim-iarbuild.cmd -set errorformat=%f(%l)\ :\ %m - -"syn match pythonDefStatement /^\s*\%(def\|class\)/ -" \ nextgroup=pythonFunction skipwhite -"syn region pythonFunctionFold start="^\z(\s*\)\%(def\|class\)\>" -" \ end="\ze\%(\s*\n\)\+\%(\z1\s\)\@!." fold transparent - -"hi link pythonDefStatement Statement - -let g:syntastic_quiet_messages = { "type": "style" } - -" plugin settings {{{1 -let g:netrw_liststyle=3 -let g:netrw_banner = 0 -let g:netrw_sort_sequence = '[\/]$,*' - -let g:solarized_menu=0 -let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] -let g:markdown_syntax_conceal = 0 - -" %s is replaced with fzf command -"let g:fzf_launcher = 'xterm -e bash -ic %s' -"let g:fzf_launcher = "in_a_new_term_function %s" - -"for airline -"let g:airline#extensions#tabline#enabled = 1 - -let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] -let g:editorconfig_verbose = 1 - -if has("win32") - let g:EditorConfig_exec_path = "C:\programs\editorconfig\bin\editorconfig.exe" -else - let g:editorconfig_core_mode = "python_builtin" -endif - -set colorcolumn=80 -highlight ColorColumn ctermbg=9 - -" block cursor in normal mode -let &t_ti.="\e[1 q" -let &t_SI.="\e[5 q" -let &t_EI.="\e[1 q" -let &t_te.="\e[0 q" - -let python_folding = 1 -" }}}2 -" section: commands {{{1 -"----------------------- - -if has("cscope") - set nocscopetag - set cscopequickfix=s-,c-,d-,i-,t-,e- - set nocscopeverbose - if filereadable(".git/cscope.out") - cscope add .git/cscope.out - endif - set cscopeverbose - - function! Cscoperebuild() - cscope kill .git/cscope.out - silent execute "!./.git/hooks/cscope" - if v:shell_error - redraw! - echohl errormsg | echo "unable to run cscope command." | echohl none - else - if filereadable(".git/cscope.out") - redraw! - cscope add .git/cscope.out - else - redraw! - echohl errormsg | echo "unable to read cscope database." | echohl none - endif - endif - endfunction - - command! Cscope call Cscoperebuild() -endif" - - -" section: mappings {{{1 -" ---------------------- -" -let mapleader = "," - - -" Quickly edit/reload the vimrc file -nmap ev :e $MYVIMRC -nmap sv :so $MYVIMRC - -" Minibufferexplorer -nnoremap b :MBEToggle -"let g:miniBufExplMapWindowNavVim = 1 -"let g:miniBufExplMapCTabSwitchBufs = 1 -" -" Tagbar -nnoremap t :TagbarToggle - -" copy/paste from system clipboard -if has("win32") -vnoremap y "*y -vnoremap d "*d -nnoremap p "*p -nnoremap P "*P - -vnoremap p "*p -vnoremap P "*P -else -" nnoremap y "*y -" nnoremap p "*p -" nnoremap Y "+y -" nnoremap P "+p -" nnoremap y "*y -" nnoremap yy "*yy -" noremap p "*p -" noremap P "*P -endif - -if has("cscope") -" cnoreabbrev csa -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs add' : 'csa') -" cnoreabbrev csf -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs find' : 'csf') -" cnoreabbrev csk -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs kill' : 'csk') -" cnoreabbrev csr -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs reset' : 'csr') -" cnoreabbrev css -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs show' : 'css') -" cnoreabbrev csh -" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs help' : 'csh') - - nnoremap fa :call CscopeFindInteractive(expand('')) - nnoremap l :call ToggleLocationList() - - " s: Find this C symbol - nnoremap fs :call CscopeFind('s', expand('')) - " g: Find this definition - nnoremap fg :call CscopeFind('g', expand('')) - " d: Find functions called by this function - nnoremap fd :call CscopeFind('d', expand('')) - " c: Find functions calling this function - nnoremap fc :call CscopeFind('c', expand('')) - " t: Find this text string - nnoremap ft :call CscopeFind('t', expand('')) - " e: Find this egrep pattern - nnoremap fe :call CscopeFind('e', expand('')) - " f: Find this file - nnoremap ff :call CscopeFind('f', expand('')) - " i: Find files #including this file - nnoremap fi :call CscopeFind('i', expand('')) - - "todo: figure out how to get cstag output in quickfix or a popup menu. - map :cstag =expand("") -endif - -" Maps Ctrl-[h,j,k,l] to windows split navigations -nnoremap -nnoremap -nnoremap -nnoremap - -" Maps leader-[h,j,k,l] to windows split navigations -"nnoremap h -"nnoremap j -"nnoremap k -"nnoremap l -" -"" Maps Ctrl-[h,j,k,l] to resizing a window split -"nnoremap < -"nnoremap - -"nnoremap + -"nnoremap > - -"exit insert mode -inoremap jj -inoremap j j -" folding -noremap za -" In the quickfix window, is used to jump to the error under the -" cursor, so undefine the mapping there. -autocmd BufReadPost quickfix nnoremap - -" section: autocommands {{{1 -" -------------------------- -if has("autocmd") - filetype plugin indent on - autocmd bufnewfile,bufread *.md set filetype=markdown - autocmd bufnewfile,bufread *.gradle set filetype=groovy -endif " has("autocmd") -" }}}1 -" section: visual {{{1 -" -------------------- - -" switch syntax highlighting on, when the terminal has colors -if (&t_Co > 2 || has("gui_running")) && has("syntax") - if exists("&guifont") - if has("mac") - set guifont=monaco:h11 - elseif has("unix") - set guifont=inconsolata\ 11 - elseif has("win32") - set guifont=consolas:h11,courier\ new:h10 - endif - endif - - - if exists("syntax_on") || exists("syntax_manual") - else - syntax on - endif - set list - if !exists('g:colors_name') - silent! colorscheme solarized - endif -endif -" }}}1 - -if filereadable(expand('~/.vimrc_local')) - source ~/.vimrc_local -endif - +" section: environment {{{1 +" --------------------- + +if (empty(glob('~/.cache/vim/autoload/plug.vim')) || + \ empty(glob('~/.local/share/vim/viminfo'))) + cd ~ + silent !mkdir -p .local/share/vim/{swap,backup,undo} + silent !mkdir -p .cache/vim/autoload + silent !curl -fLo .cache/vim/autoload/plug.vim + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall | source $MYVIMRC + cd - +endif + +set directory=~/.local/share/vim/swap +set backupdir=~/.local/share/vim/backup +set undodir=~/.local/share/vim/undo +set viminfo+=n~/.local/share/vim/viminfo +set runtimepath+=~/.cache/vim + +" section: plugins {{{1 +" --------------------- +silent call plug#begin('~/.cache/vim/bundle') +Plug 'tpope/vim-repeat' +Plug 'tpope/vim-fugitive' +Plug 'tpope/vim-surround' +Plug 'tpope/vim-commentary' +Plug 'tpope/vim-unimpaired' +Plug 'tpope/vim-dispatch' +"Plug 'tpope/vim-vinager' +Plug 'scrooloose/syntastic' +"Plug 'vim-airline/vim-airline' +Plug 'airblade/vim-gitgutter' +Plug 'majutsushi/tagbar' +Plug 'fholgado/minibufexpl.vim' +Plug 'brookhong/cscope.vim' +Plug 'ctrlpvim/ctrlp.vim' +Plug 'brandonbloom/csearch.vim' +Plug 'mileszs/ack.vim' +Plug 'jeetsukumaran/vim-filesearch' +Plug 'haya14busa/incsearch.vim' +Plug 'altercation/vim-colors-solarized' +Plug 'editorconfig/editorconfig-vim' +Plug 'johnsyweb/vim-makeshift' +Plug 'tfnico/vim-gradle' +"Plug 'a.vim' +"Plug 'heaths/vim-msbuild' +"Plug 'hdima/python-syntax' +"Plug 'klen/python-mode' +"Plug 'jalcine/cmake.vim' +call plug#end() + +" section: options {{{1 +" --------------------- + +"set autoindent +set autoread +set autowrite " automatically save before commands like :next and :make +set background=dark +set backspace=2 +if exists('+breakindent') + set breakindent showbreak=\ + +endif +set cmdheight=2 +setglobal commentstring=#\ %s +set complete-=i " searching includes can be slow +"if has("win32") || has("win64") +" does not work for msys2 +set clipboard=unnamed +"else +"set clipboard=unnamedplus +"endif +set fileformats=unix,dos,mac +"set foldmethod=syntax +"set foldlevel=1 +"set foldclose=all +"set foldopen+=jump +set guioptions+=a +set history=200 +set incsearch " incremental search +set laststatus=2 " always show status line +set lazyredraw +set linebreak +set mouse=nvi +set mousemodel=popup +set number +"set pastetoggle= +set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin +set printoptions=paper:letter +set scrolloff=1 +set shiftround +set shortmess=aoOtI +"set showcmd " show (partial) command in status line. +set showmatch " show matching brackets. +set sidescrolloff=5 +set smartcase " case insensitive searches become sensitive with capitals +"setglobal tags=./tags; +set timeoutlen=500 " leader key timeout +set ttimeoutlen=50 " make esc work faster +set visualbell +if exists('+undofile') + set undofile +endif +set virtualedit=block +set updatetime=250 +set wildmenu +set wildmode=longest:full,full +set wildignore+=tags,.*.un~,*.pyc +set winaltkeys=no + +"if !has("gui_running") && $display == '' || !has("gui") +" set mouse= +"endif +" +"set makeprg=cmake\ --build\ . +" Visual studio 2013 +"set errorformat=\ %#%f(%l):\ %m +" Visual studio 2008 +"set errorformat=%.%#>\ %#%f(%l)\ :\ %m +" +" IAR compiler +set makeprg=vim-iarbuild.cmd +set errorformat=%f(%l)\ :\ %m + +"syn match pythonDefStatement /^\s*\%(def\|class\)/ +" \ nextgroup=pythonFunction skipwhite +"syn region pythonFunctionFold start="^\z(\s*\)\%(def\|class\)\>" +" \ end="\ze\%(\s*\n\)\+\%(\z1\s\)\@!." fold transparent + +"hi link pythonDefStatement Statement + +let g:syntastic_quiet_messages = { "type": "style" } + +" plugin settings {{{1 +let g:netrw_liststyle=3 +let g:netrw_banner = 0 +let g:netrw_sort_sequence = '[\/]$,*' + +let g:solarized_menu=0 +let g:markdown_fenced_languages = ['html', 'python', 'bash=sh'] +let g:markdown_syntax_conceal = 0 + +" %s is replaced with fzf command +"let g:fzf_launcher = 'xterm -e bash -ic %s' +"let g:fzf_launcher = "in_a_new_term_function %s" + +"for airline +"let g:airline#extensions#tabline#enabled = 1 + +let g:editorconfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] +let g:editorconfig_verbose = 1 + +if has("win32") + let g:EditorConfig_exec_path = "C:\programs\editorconfig\bin\editorconfig.exe" +else + let g:editorconfig_core_mode = "python_builtin" +endif + +set colorcolumn=80 +highlight ColorColumn ctermbg=9 + +" block cursor in normal mode +let &t_ti.="\e[1 q" +let &t_SI.="\e[5 q" +let &t_EI.="\e[1 q" +let &t_te.="\e[0 q" + +let python_folding = 1 +" }}}2 +" section: commands {{{1 +"----------------------- + +if has("cscope") + set nocscopetag + set cscopequickfix=s-,c-,d-,i-,t-,e- + set nocscopeverbose + if filereadable(".git/cscope.out") + cscope add .git/cscope.out + endif + set cscopeverbose + + function! Cscoperebuild() + cscope kill .git/cscope.out + silent execute "!./.git/hooks/cscope" + if v:shell_error + redraw! + echohl errormsg | echo "unable to run cscope command." | echohl none + else + if filereadable(".git/cscope.out") + redraw! + cscope add .git/cscope.out + else + redraw! + echohl errormsg | echo "unable to read cscope database." | echohl none + endif + endif + endfunction + + command! Cscope call Cscoperebuild() +endif" + + +" section: mappings {{{1 +" ---------------------- +" +let mapleader = "," + + +" Quickly edit/reload the vimrc file +nmap ev :e $MYVIMRC +nmap sv :so $MYVIMRC + +" Minibufferexplorer +nnoremap b :MBEToggle +"let g:miniBufExplMapWindowNavVim = 1 +"let g:miniBufExplMapCTabSwitchBufs = 1 +" +" Tagbar +nnoremap t :TagbarToggle + +" copy/paste from system clipboard +if has("win32") +vnoremap y "*y +vnoremap d "*d +nnoremap p "*p +nnoremap P "*P + +vnoremap p "*p +vnoremap P "*P +else +" nnoremap y "*y +" nnoremap p "*p +" nnoremap Y "+y +" nnoremap P "+p +" nnoremap y "*y +" nnoremap yy "*yy +" noremap p "*p +" noremap P "*P +endif + +if has("cscope") +" cnoreabbrev csa +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs add' : 'csa') +" cnoreabbrev csf +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs find' : 'csf') +" cnoreabbrev csk +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs kill' : 'csk') +" cnoreabbrev csr +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs reset' : 'csr') +" cnoreabbrev css +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs show' : 'css') +" cnoreabbrev csh +" \ ((getcmdtype() == ':' && getcmdpos() <= 4)? 'cs help' : 'csh') + + nnoremap fa :call CscopeFindInteractive(expand('')) + nnoremap l :call ToggleLocationList() + + " s: Find this C symbol + nnoremap fs :call CscopeFind('s', expand('')) + " g: Find this definition + nnoremap fg :call CscopeFind('g', expand('')) + " d: Find functions called by this function + nnoremap fd :call CscopeFind('d', expand('')) + " c: Find functions calling this function + nnoremap fc :call CscopeFind('c', expand('')) + " t: Find this text string + nnoremap ft :call CscopeFind('t', expand('')) + " e: Find this egrep pattern + nnoremap fe :call CscopeFind('e', expand('')) + " f: Find this file + nnoremap ff :call CscopeFind('f', expand('')) + " i: Find files #including this file + nnoremap fi :call CscopeFind('i', expand('')) + + "todo: figure out how to get cstag output in quickfix or a popup menu. + map :cstag =expand("") +endif + +" Maps Ctrl-[h,j,k,l] to windows split navigations +nnoremap +nnoremap +nnoremap +nnoremap + +" Maps leader-[h,j,k,l] to windows split navigations +"nnoremap h +"nnoremap j +"nnoremap k +"nnoremap l +" +"" Maps Ctrl-[h,j,k,l] to resizing a window split +"nnoremap < +"nnoremap - +"nnoremap + +"nnoremap > + +"exit insert mode +inoremap jj +inoremap j j +" folding +noremap za +" In the quickfix window, is used to jump to the error under the +" cursor, so undefine the mapping there. +autocmd BufReadPost quickfix nnoremap + +" section: autocommands {{{1 +" -------------------------- +if has("autocmd") + filetype plugin indent on + autocmd bufnewfile,bufread *.md set filetype=markdown + autocmd bufnewfile,bufread *.gradle set filetype=groovy +endif " has("autocmd") +" }}}1 +" section: visual {{{1 +" -------------------- + +" switch syntax highlighting on, when the terminal has colors +if (&t_Co > 2 || has("gui_running")) && has("syntax") + if exists("&guifont") + if has("mac") + set guifont=monaco:h11 + elseif has("unix") + set guifont=inconsolata\ 11 + elseif has("win32") + set guifont=consolas:h11,courier\ new:h10 + endif + endif + + + if exists("syntax_on") || exists("syntax_manual") + else + syntax on + endif + set list + if !exists('g:colors_name') + silent! colorscheme solarized + endif +endif +" }}}1 + +if filereadable(expand('~/.vimrc_local')) + source ~/.vimrc_local +endif + diff --git a/README.md b/README.md index 76795af..432f8a6 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# dotfiles - -What you need to do on the new box is this: - - $ cd $HOME - $ git init --bare $HOME/.dotfiles - $ alias dot='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' - $ dot config --local status.showUntrackedFiles no - $ dot remote add origin git@bitbucket.org:jannikz/dotfiles.git - $ dot fetch - $ dot reset --hard origin/master +# dotfiles + +What you need to do on the new box is this: + + $ cd $HOME + $ git init --bare $HOME/.dotfiles + $ alias dot='git --git-dir=$HOME/.dotfiles --work-tree=$HOME' + $ dot config --local status.showUntrackedFiles no + $ dot remote add origin git@bitbucket.org:jannikz/dotfiles.git + $ dot fetch + $ dot reset --hard origin/master $ dot branch -u origin/master \ No newline at end of file diff --git a/exe/caps_and_rwin_to_ctrl.reg b/exe/caps_and_rwin_to_ctrl.reg deleted file mode 100644 index 5e93d69..0000000 Binary files a/exe/caps_and_rwin_to_ctrl.reg and /dev/null differ diff --git a/exe/msys2_here.reg b/exe/msys2_here.reg deleted file mode 100644 index 61ab49d..0000000 Binary files a/exe/msys2_here.reg and /dev/null differ diff --git a/exe/remove_scancode_mappings.reg b/exe/remove_scancode_mappings.reg deleted file mode 100644 index 8a029d0..0000000 Binary files a/exe/remove_scancode_mappings.reg and /dev/null differ diff --git a/exe/solarized.reg b/exe/solarized.reg deleted file mode 100644 index ab8eac1..0000000 --- a/exe/solarized.reg +++ /dev/null @@ -1,47 +0,0 @@ -Windows Registry Editor Version 5.00 - -; Registry file that maps the solarized palette to the 16 avaliable colors -; in a Windows command prompt. Note, hex values in the table are RGB but byte -; ordering of a DWORD is BGR, e.g. "ColorTable<##>"=dword:00 -; -; Solarized color table from http://ethanschoonover.com/solarized. -; -; NR cmd.exe PowerShell SOLARIZED HEX DWORD -; -- ------- ----------- --------- ------- -------- -; 00 Black Black base03 #002b36 00362b00 -; 01 Blue DarkBlue base0 #839496 00969483 -; 02 Green DarkGreen base01 #586e75 00756e58 -; 03 Aqua DarkCyan base1 #93a1a1 00a1a193 -; 04 Red DarkRed orange #cb4b16 00164bcb -; 05 Purple DarkMagenta violet #6c71c4 00c4716c -; 06 Yellow DarkYellow base00 #657b83 00837b65 -; 07 White Gray base2 #eee8d5 00d5e8ee -; 08 Gray DarkGray base02 #073642 00423607 -; 09 LightBlue Blue blue #268bd2 00d28b26 -; 10 LightGreen Green green #859900 00009985 -; 11 LightAqua Cyan cyan #2aa198 0098a12a -; 12 LightRed Red red #dc322f 002f32dc -; 13 LightPurple Magenta magenta #d33682 008236d3 -; 14 LightYellow Yellow yellow #b58900 000089b5 -; 15 BrightWhite White base3 #fdf6e3 00e3f6fd -; - -[HKEY_CURRENT_USER\Console] -"ColorTable00"=dword:00362b00 -"ColorTable01"=dword:00969483 -"ColorTable02"=dword:00756e58 -"ColorTable03"=dword:00a1a193 -"ColorTable04"=dword:00164bcb -"ColorTable05"=dword:00c4716c -"ColorTable06"=dword:00837b65 -"ColorTable07"=dword:00d5e8ee -"ColorTable08"=dword:00423607 -"ColorTable09"=dword:00d28b26 -"ColorTable10"=dword:00009985 -"ColorTable11"=dword:0098a12a -"ColorTable12"=dword:002f32dc -"ColorTable13"=dword:008236d3 -"ColorTable14"=dword:000089b5 -"ColorTable15"=dword:00e3f6fd -"ScreenColors"=dword:00000001 -"PopupColors"=dword:000000f6 diff --git a/exe/usdk-hhkb.ahk b/exe/usdk-hhkb.ahk deleted file mode 100644 index 6a681a2..0000000 --- a/exe/usdk-hhkb.ahk +++ /dev/null @@ -1,24 +0,0 @@ -; Use caps and rwin as ctrl (HHKB alike) -Capslock::LCtrl -RWin::RCtrl -LWin::return - -; Letter a -> skandinavian å -:*?:``a::å -:*?:``A::Å - -; Letter o -> danish/norwegen ø -:*?:``o::ø -:*?:``O::Ø - -; Letter e -> danish/norwegen æ -:*?:``e::æ -:*?:``E::Æ - -; Letter u -> swedish/finish ö -:*?:``u::ö -:*?:``U::Ö - -; Letter ' -> swedish/finish ä -:*?:``'::ä -:*?:``"::Ä diff --git a/exe/usdk-hhkb.exe b/exe/usdk-hhkb.exe deleted file mode 100644 index 48af1da..0000000 Binary files a/exe/usdk-hhkb.exe and /dev/null differ