Skip to content

Instantly share code, notes, and snippets.

@jcarsique jcarsique/.bash_aliases
Last active Sep 18, 2019

Embed
What would you like to do?
Bash config
alias cd..="cd .."
alias md="mkdir"
alias rd="rmdir"
alias mvni="mvn install -DskipTests=true -DskipITs=true"
alias mvnia="mvn install -DskipTests=true -DskipITs=true -Paddons,distrib,all-distributions"
alias mvnci="mvn clean install -DskipTests=true -DskipITs=true"
alias mvncia="mvn clean install -DskipTests=true -DskipITs=true -Paddons,distrib,all-distributions"
alias mvneclipse='mvn eclipse:clean eclipse:eclipse -Declipse.useProjectReferences=true -fae'
alias mvnecl='mvn eclipse:clean eclipse:eclipse -Declipse.useProjectReferences=true -Paddons,distrib,all-distributions -fae -nsu ; ~/workspace/nuxeo/fixeclipse'
alias mvn2ecl="mvn eclipse:clean eclipse:m2eclipse -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true && ~/workspace/nuxeo/fixeclipse"
alias mvneclo='mvn eclipse:clean eclipse:eclipse -o -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true -fae ; ~/workspace/nuxeo/fixeclipse'
alias mvn2eclo="mvn eclipse:clean eclipse:m2eclipse -o -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true && ~/workspace/nuxeo/fixeclipse -o"
alias mvneclj="mvn eclipse:clean eclipse:eclipse -DdownloadJavadocs=true -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true && ~/workspace/nuxeo/fixeclipse"
alias mvnecls="mvn eclipse:clean eclipse:eclipse -DdownloadSources=true -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true && ~/workspace/nuxeo/fixeclipse"
alias mvnecla='mvn eclipse:clean eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true -fae -nsu ; ~/workspace/nuxeo/fixeclipse'
alias mvn2ecla="mvn eclipse:clean eclipse:m2eclipse -DdownloadSources=true -DdownloadJavadocs=true -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true && ~/workspace/nuxeo/fixeclipse"
alias hgl='hg glog|less'
alias hgi="hg id -nibt"
alias hgmerge="hg resolve --all -t fmmerge"
alias mvnpurge="mvn dependency:purge-local-repository -DresolutionFuzziness=version -DactTransitively=false"
alias matin="cd ~/workspace/nuxeo; ./clone.py -a -m '' master && mvncia -fae -nsu && mvn eclipse:clean eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true -Paddons,distrib,all-distributions -Declipse.useProjectReferences=true -fae -nsu && (cd nuxeo-distribution && mvn clean install -DskipTests=true -DskipITs=true) && (cd addons && mvn eclipse:clean eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true -Paddons -Declipse.useProjectReferences=true -fae -f pom-optionals.xml ; mvn eclipse:clean eclipse:eclipse -DdownloadSources=true -DdownloadJavadocs=true -Declipse.useProjectReferences=true -fae -nsu -f pom-optionals.xml) && ~/workspace/nuxeo/fixeclipse"
alias hgfpup="hgf pull && hgf up"
alias hgpup="hg pull && hg up"
# git clone https://github.com/lvv/git-prompt ~/git-prompt
alias git-prompt="source ~/git-prompt/git-prompt.sh"
alias gitconflicts="git diff --name-only --diff-filter=U | xargs $EDITOR"
alias git="LANG=en_US git"
alias git=hub
# git clone https://github.com/jcarsique/git-achievements ~/workspace/git-achievements
export PATH="$PATH:~/workspace/git-achievements"
# alias git="git-achievements"
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias gitf-st='gitf st|egrep -B3 "^\s?[ACDMRTUXB]"'
alias gitfa-st='gitfa st|egrep -B3 "^\s?[ACDMRTUXB]"'
# git@github.com:jcarsique/git.git
source /home/julien/workspace/git/contrib/completion/git-completion.bash
# Hub https://github.com/github/hub/
if [ -f /path/to/hub.bash_completion ]; then
. /home/julien/workspace/hub/etc/hub.bash_completion.sh
fi
# jx completion bash |sudo tee /etc/bash_completion.d/jx
## source <(jx completion bash)
# kubectl completion bash |sudo tee /etc/bash_completion.d/kubectl
## source <(kubectl completion bash)
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# 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
force_color_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)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
export PATH=${PATH}:~/bin/
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias rgrep='rgrep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# 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
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
PATH=${PATH}:/opt/adt-bundle-linux-x86_64/sdk/tools
PATH=${PATH}:/opt/adt-bundle-linux-x86_64/sdk/platform-tools
export ANDROID_HOME=/opt/adt-bundle-linux-x86_64/sdk/
export MAVEN_OPTS="-Xmx4g -Xms512m -XX:MaxPermSize=1g"
# better find
function f {
find . -path '*/.svn' -prune -o \( -name "$1" -a -type f \) -print
}
# hg and git functions
#. /home/julien/workspace/nuxeo-tools-parent/mercurial/.hgfunctions
#. /home/julien/workspace/nuxeo/scripts/hgfunctions.sh
#. /home/julien/workspace/nuxeo/scripts/gitfunctions.sh
# https://raw.githubusercontent.com/nuxeo/nuxeo/stable/scripts/gitfunctions.sh
source ~/bin/gitfunctions.sh
pf() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name target -o -name bin -o -name '.git' \) -prune -o -name 'pom*.xml' \
-print0 | xargs -0 grep -Hn "$@" \{\} \; 2> /dev/null
}
pf0() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name target -o -name bin -o -name '.git' \) -prune -o -name 'pom*.xml' \
-print0 | xargs -0 grep -Hln "$@" \{\} \; 2> /dev/null
}
pf2() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name target -o -name bin -o -name '.git' \) -prune -o -name 'pom*.xml' \
-print0 | xargs -0 grep -C2 -Hn "$@" \{\} \; 2> /dev/null
}
jf() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -or \( -name '*.xml*' -or -name '*.java' -or -name 'MANIFEST.MF' -or \
-name '*.properties' -or -name '*.xhtml' -or -name '*.ftl' -o -name '*.jsp' -o -name '*.txt' -o -name '*.md' -o -name '*.sh' -o -name '*.defaults' -o -name '*.html' -o \
-name '*.csv' \) -type f -print0 \
| xargs -0 grep -Hn "$@" \{\} \; 2> /dev/null
}
jf0() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -or \( -name '*.xml*' -or -name '*.java' -or -name 'MANIFEST.MF' -or \
-name '*.properties' -or -name '*.xhtml' -or -name '*.ftl' -o -name '*.jsp' -o -name '*.txt' -o -name '*.md' -o -name '*.sh' -o -name '*.defaults' -o -name '*.html' -o \
-name '*.csv' \) -type f -print0 \
| xargs -0 grep -Hln "$@" \{\} \; 2> /dev/null
}
jf2() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -or \( -name '*.xml*' -or -name '*.java' -or -name 'MANIFEST.MF' -or \
-name '*.properties' -or -name '*.xhtml' -or -name '*.ftl' -o -name '*.jsp' -o -name '*.txt' -o -name '*.md' -o -name '*.sh' -o -name '*.defaults' -o -name '*.html' -o \
-name '*.csv' \) -type f -print0 \
| xargs -0 grep -C2 -Hn "$@" \{\} \; 2> /dev/null
}
jsf() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -or \( -name '*.xml*' -or -name '*.java' -or -name 'MANIFEST.MF' -or \
-name '*.properties' -or -name '*.xhtml' -or -name '*.js' -or -name '*.ftl' -o -name '*.jsp' -o -name '*.txt' -o -name '*.md' -o -name '*.sh' -o -name '*.defaults' -o -name '*.html' -o \
-name '*.csv' \) -type f -print0 \
| xargs -0 grep -Hn "$@" \{\} \; 2> /dev/null
}
jsf0() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -or \( -name '*.xml*' -or -name '*.java' -or -name 'MANIFEST.MF' -or \
-name '*.properties' -or -name '*.xhtml' -or -name '*.js' -or -name '*.ftl' -o -name '*.jsp' -o -name '*.txt' -o -name '*.md' -o -name '*.sh' -o -name '*.defaults' -o -name '*.html' -o \
-name '*.csv' \) -type f -print0 \
| xargs -0 grep -Hln "$@" \{\} \; 2> /dev/null
}
jsf2() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -or \( -name '*.xml*' -or -name '*.java' -or -name 'MANIFEST.MF' -or \
-name '*.properties' -or -name '*.xhtml' -or -name '*.js' -or -name '*.ftl' -o -name '*.jsp' -o -name '*.txt' -o -name '*.md' -o -name '*.sh' -o -name '*.defaults' -o -name '*.html' -o \
-name '*.csv' \) -type f -print0 \
| xargs -0 grep -C2 -Hn "$@" \{\} \; 2> /dev/null
}
xf() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -o \( -name '*.xml*' \) -type f -print0 \
| xargs -0 grep -Hn "$@" \{\} \; 2> /dev/null
}
xf0() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -o \( -name '*.xml*' \) -type f -print0 \
| xargs -0 grep -Hln "$@" \{\} \; 2> /dev/null
}
xf2() {
find . -type d \( -name '.hg' -o -name '.svn' -o -name 'target' -o -name bin -o -name '.git' \) -prune -o \( -name '*.xml*' \) -type f -print0 \
| xargs -0 grep -C2 -Hn "$@" \{\} \; 2> /dev/null
}
rmrootprojects() {
for dir in $(find . -name pom.xml | xargs grep -Hl '<module>' | sed 's/pom.xml//'); do (
cd $dir
[ -e .project ] && (
[ -e .project.ok ] && (diff -q .project .project.ok || cp .project.ok .project.ok.bak)
) && mv .project .project.ok
); done
}
setrootprojects() {
for dir in $(find . -name pom.xml | xargs grep -Hl '<module>' | sed 's/pom.xml//'); do (
cd $dir
[ -e .project.ok ] && (
[ -e .project ] && (diff -q .project .project.ok || cp .project .project.bak)
) && cp .project.ok .project
); done
}
[ -z "$PS1" ] && return
set_path_and_prompt() {
if [ -z "$_OLD_DEFAULT_PS1" ]; then
_OLD_DEFAULT_PS1=$PS1
fi
if [ -z "$_OLD_DEFAULT_PATH" ]; then
_OLD_DEFAULT_PATH=$PATH
fi
# PS1="${JAVA_PROMPT}${MAVEN_PROMPT}${_OLD_DEFAULT_PS1}"
PS1="${MAVEN_PROMPT}${_OLD_DEFAULT_PS1}"
export PS1
if [ -n "JAVA_HOME" ] && [ -n "M2_HOME" ]; then
PATH="${JAVA_HOME}/bin:${M2_HOME}/bin:${_OLD_DEFAULT_PATH}"
elif [ -n "JAVA_HOME" ]; then
PATH="${JAVA_HOME}/bin:${_OLD_DEFAULT_PATH}"
else
PATH="${M2_HOME}/bin:${_OLD_DEFAULT_PATH}"
fi
export PATH
}
set_maven2() {
M2_HOME='/opt/maven'
MAVEN_PROMPT='\[\033[1;31m\]m2 \[\033[0m\]'
export M2_HOME MAVEN_PROMPT
set_path_and_prompt
}
set_maven31() {
M2_HOME='/opt/maven3.1'
MAVEN_PROMPT='\[\033[1;33m\]m3.1 \[\033[0m\]'
export M2_HOME MAVEN_PROMPT
set_path_and_prompt
}
set_maven32() {
M2_HOME='/opt/maven3.2'
MAVEN_PROMPT='\[\033[1;33m\]m3.2 \[\033[0m\]'
export M2_HOME MAVEN_PROMPT
set_path_and_prompt
}
set_maven3() {
M2_HOME='/opt/maven3'
MAVEN_PROMPT='\[\033[1;33m\]m3 \[\033[0m\]'
export M2_HOME MAVEN_PROMPT
set_path_and_prompt
}
unset_maven() {
unset M2_HOME
unset M2_REPO
unset MAVEN_PROMPT
set_path_and_prompt
}
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# https://github.com/kepkin/dev-shell-essentials
source /home/julien/workspace/dev-shell-essentials/dev-shell-essentials.sh
# git@github.com:jcarsique/git.git
source ~/workspace/git/contrib/completion/git-prompt.sh
__git_complete gitf __git_main
__git_complete gitfa __git_main
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUPSTREAM="auto verbose name"
#GIT_PS1_SHOWCOLORHINTS=true
# Reduce PWD in prompt to last 30 chars of PWD
function truncate_pwd
{
newPWD="${PWD/#$HOME/~}"
local pwdmaxlen=50
if [ ${#newPWD} -gt $pwdmaxlen ]
then
newPWD="...${newPWD: -$pwdmaxlen}"
fi
}
PROMPT_COMMAND=truncate_pwd
PS1='$? [\[\033[1;35m\]$newPWD$(__git_ps1 " \[\033[1;34m\](%s)")\[\033[0m\]]\$ '
PATH=/opt/eclipse/:$PATH
#export PATH=/opt/node/bin/:$PATH
PATH=/home/julien/workspace/fast-export/:$PATH
PATH=/opt/build/tools/gradle-1.11/bin:$PATH
PATH=/home/julien/workspace/p4v-2014.2.951414/bin:$PATH
PATH=/opt/cov-analysis-linux64-8.5.0.3/bin:$PATH
set_maven3
if [ -f ~/.wrap_alias ]; then
. ~/.wrap_alias
fi
# Chromium
PATH=$PATH:/media/julien/1To/workspace/depot_tools
PATH=$PATH:/opt/ApacheDirectoryStudio
# https://github.com/idonethis/didit-cli-client
PATH=$PATH:/media/julien/1To/workspace/didit-cli-client
export MAGICK_THREAD_LIMIT=1
export NVM_DIR="/home/julien/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
[[ -r $NVM_DIR/bash_completion ]] && . $NVM_DIR/bash_completion
export NX_PGSQL_DB_ADMINNAME=template1
export NX_PGSQL_DB_ADMINUSER=julien
export NX_PGSQL_DB_ADMINPASS=password
export PATH="/home/julien/.linuxbrew/bin:$PATH"
export HOMEBREW_GITHUB_API_TOKEN="660f8aaa660ac9d67e6684e9d78457cf51aa5fdf"
#export PATH="/media/julien/1To/workspace/nuxeo-drive/nuxeo-drive-client/scripts/:$PATH"
#export PYTHON_DRIVE_VERSION=2.7.13
#export PYQT_VERSION=4.12.1
#export WORKSPACE="/home/julien/workspace/nuxeo-drive-src"
#export PYTHONPATH="/home/julien/workspace/nuxeo-drive/nuxeo-drive-client:$PYTHONPATH"
#export PATH="$WORKSPACE/deploy-dir/.pyenv/versions/$PYTHON_DRIVE_VERSION/bin:/home/julien/workspace/nuxeo-drive/nuxeo-drive-client/scripts:$PATH"
export PATH=$PATH:/home/julien/.local/bin
export GPG_TTY=$(tty)
export PATH=$PATH:~/.jx/bin
export PATH=$PATH:~/.jenv/bin
eval "$(jenv init -)"
jenv shell 1.8
#OktaAWSCLI
if [ -f "/home/julien/.okta/bash_functions" ]; then
. "/home/julien/.okta/bash_functions"
fi
if [[ -d "$HOME/.okta/bin" && ":$PATH:" != *":$HOME/.okta/bin:"* ]]; then
PATH="$HOME/.okta/bin:$PATH"
fi
# kubectx and kubens
# https://github.com/ahmetb/kubectx.git
export PATH=~/.kubectx:$PATH
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
export GOPATH=$HOME/gocode
export GOROOT=/usr/lib/go-1.11/
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export PASSWORD_STORE_DIR=$HOME/.password-store/nuxeo/vaultbolt-devtools
### GIT-PROMPT.SH CONFIG
###
### lines commented-out with single '#' are default values
### lines commented-out with double '##' are examples
###
### NOTE: this is bash syntax - no spaces around "="
###########################################################
# error_bell=off # sound terminal bell when command return code is not zero. (use setterm to set pitch and duration)
# max_file_list_length=100 # in characters
max_file_list_length=0 # in characters
############################################################ MODULES
# git_module=on
svn_module=on
# hg_module=on
# vim_module=on
########################################################### DEFAULT OBJECTS
### Default objects are not displayed. Example:
## default_user=lvv
default_user=julien
## default_host="ahp" # remote host is always shown
default_host="Julianito-2.local" # remote host is always shown
## default_domain="lvvnet"
########################################################### Current Working Dir display
# cwd_cmd='\w' # display full path
## cwd_cmd='\W' # display only last dir of path
## cwd_cmd='cwd_truncate 40' # display only last N chars of path
########################################################### ETC
# Some don't like hostname in uppercase
# upcase_hostname=on # =off
upcase_hostname=off
# Do not do VCS parsing for listed directories
# useful for directories for which it is difficult to maintain .gitignore so
# they are always dirty (ex: home, /etc) or directory with huge repo (ex: linux src)
## vcs_ignore_dir_list=" /etc $HOME /usr/src/linux.git "
########################################################### COLOR
### directory, exit code, root color
# cols=`tput colors`
# if [[ -n "$cols" && $cols -ge 8 ]]; then # if terminal supports colors
# dir_color=CYAN
# rc_color=red
# user_id_color=blue
# root_id_color=magenta
# else # B/W terminal
# dir_color=bw_bold
# rc_color=bw_bold
# fi
### prompt character for root/non-root, default '>' for both
# prompt_char='>'
# root_prompt_char='>'
## prompt_char='$'
## root_prompt_char='#'
prompt_char='$'
root_prompt_char='#'
##### Per host color
### Per host color. If not set, color will be derived from name of host checksum).
### Variable name is uppercase-short-hostname with appended "_host_color"
### Example per-host-color config:
## TASHA_host_color=cyan
## AL_host_color=green
## AHP_host_color=white
##### VCS (version control system) state colors
# init_vcs_color=WHITE # initial
# clean_vcs_color=blue # nothing to commit (working directory clean)
# modified_vcs_color=red # Changed but not updated:
# added_vcs_color=green # Changes to be committed:
# mixed_vcs_color=yellow #
# untracked_vcs_color=BLUE # Untracked files:
# op_vcs_color=MAGENTA
# detached_vcs_color=RED
# :vim:ft=sh ts=8 sw=8 et:
$include /etc/inputrc
$if Bash
#do history expansion when space entered
Space: magic-space
$endif
# Custom
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
"use docx2txt.pl to allow VIm to view the text content of a .docx file directly.
autocmd BufReadPre *.docx set ro
autocmd BufReadPost *.docx %!docx2txt.pl
set number
" size of a hard tabstop
set tabstop=4
" size of an "indent"
set shiftwidth=4
" a combination of spaces and tabs are used to simulate tab stops at a width other than the (hard)tabstop
set softtabstop=4
" make "tab" insert indents instead of tabs at the beginning of a line
set smarttab
" always uses spaces instead of tab characters
set expandtab
" packadd! matchit
" Press Space to turn off highlighting and clear any message already displayed.
":nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
:set hlsearch
" Press F4 to toggle highlighting on/off, and show current value.
:noremap <F4> :set hlsearch! hlsearch?<CR>
# wrap_alias takes three arguments:
# $1: The name of the alias
# $2: The command used in the alias
# $3: The arguments in the alias all in one string
# Generate a wrapper completion function (completer) for an alias
# based on the command and the given arguments, if there is a
# completer for the command, and set the wrapper as the completer for
# the alias.
function wrap_alias() {
[[ "$#" == 3 ]] || return 1
local alias_name="$1"
local aliased_command="$2"
local alias_arguments="$3"
local num_alias_arguments=$(echo "$alias_arguments" | wc -w)
# The completion currently being used for the aliased command.
local completion=$(complete -p $aliased_command 2> /dev/null)
# Only a completer based on a function can be wrapped so look for -F
# in the current completion. This check will also catch commands
# with no completer for which $completion will be empty.
echo $completion | grep -q -- -F || return 0
local namespace=alias_completion::
# Extract the name of the completion function from a string that
# looks like: something -F function_name something
# First strip the beginning of the string up to the function name by
# removing "* -F " from the front.
local completion_function=${completion##* -F }
# Then strip " *" from the end, leaving only the function name.
completion_function=${completion_function%% *}
# Try to prevent an infinite loop by not wrapping a function
# generated by this function. This can happen when the user runs
# this twice for an alias like ls='ls --color=auto' or alias l='ls'
# and alias ls='l foo'
[[ "${completion_function#$namespace}" != $completion_function ]] && return 0
[[ "_longopt" = $completion_function ]] && return 0
# echo DEBUG: Wrapped $alias_name $completion_function
local wrapper_name="${namespace}${alias_name}"
eval "
function ${wrapper_name}() {
let COMP_CWORD+=$num_alias_arguments
args=( \"${alias_arguments}\" )
COMP_WORDS=( $aliased_command \${args[@]} \"\${COMP_WORDS[@]:1}\" )
$completion_function
}
"
# To create the new completion we use the old one with two
# replacements:
# 1) Replace the function with the wrapper.
local new_completion=${completion/-F * /-F $wrapper_name }
# 2) Replace the command being completed with the alias.
new_completion="${new_completion% *} $alias_name"
eval "$new_completion"
}
# For each defined alias, extract the necessary elements and use them
# to call wrap_alias.
eval "$(alias -p | grep -v '[\";|&]' | sed -e 's/alias \([^=][^=]*\)='\''\([^ ][^ ]*\) *\(.*\)'\''/wrap_alias \1 \2 '\''\3'\'' /')"
unset wrap_alias
###########################
# xbindkeys configuration #
###########################
#
# Version: 0.1.3
#
# If you edit this, do not forget to uncomment any lines that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier (on my keyboard):
# Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# Another way to specifie a key is to use 'xev' and set the
# keycode with c:nnn or the modifier with m:nnn where nnn is
# the keycode or the state returned by xev
#
# This file is created by xbindkey_config
# The structure is :
# # Remark
# "command"
# m:xxx + c:xxx
# Shift+...
#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable
#"xbindkeys_show"
# control+shift + q
# horizontal scroll to the left
"xte 'mouseclick 6'"
Shift + b:4
# horizontal scroll to the right
"xte 'mouseclick 7'"
Shift + b:5
/bin/bash: q : commande introuvable
# End of xbindkeys configuration
; bind shift + vertical scroll to horizontal scroll events
;(xbindkey '(shift "b:4") "xte 'mouseclick 6'")
;(xbindkey '(shift "b:5") "xte 'mouseclick 7'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.