From 9b1192c42be7948f52cd13680729c034bc4cacb6 Mon Sep 17 00:00:00 2001 From: typebrook Date: Mon, 21 Jan 2019 23:08:48 +0800 Subject: update --- .bash_aliases | 101 ---------------------------------------------------------- .tigrc | 7 ---- .vimrc | 39 ----------------------- Makefile | 8 +++-- alias | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ keyboard | 5 +++ tigrc | 7 ++++ vimrc | 39 +++++++++++++++++++++++ 8 files changed, 157 insertions(+), 150 deletions(-) delete mode 100644 .bash_aliases delete mode 100644 .tigrc delete mode 100644 .vimrc create mode 100644 alias create mode 100644 keyboard create mode 100644 tigrc create mode 100644 vimrc diff --git a/.bash_aliases b/.bash_aliases deleted file mode 100644 index 2355208..0000000 --- a/.bash_aliases +++ /dev/null @@ -1,101 +0,0 @@ -# settings -alias al='vim ~/.bash_aliases && source ~/.bash_aliases' -alias sa='source ~/.bash_aliases' -alias vimrc='vim ~/.vimrc' -alias bashrc='vim ~/.bashrc' -alias tigrc='vim ~/.tigrc' - -# vim -alias v='vim' -alias vr='vim -R' - -# shell -alias ll='ls -lh' -alias ai='sudo apt-get install' -alias si='sudo snap install' -alias ss='sudo !!' -alias hg='history|grep' -alias r='ranger' - -# cd to certain directories -alias ..='cd ..' -alias ld='cd -' # last directory -alias cdd='cd ~/Downloads' -alias cdg='cd ~/git' -alias cds='cd ~/git/settings' -alias r='ranger' - -# git -alias g='git' -alias gls='git log -S' -alias gc='git clone' -alias check='git checkout' -alias checkout='git checkout' -alias stash='git stash' -alias commit='git commit' -alias ca='git commit --amend' -alias branch='git branch' -alias pull='git pull' -alias fetch='git fetch' -alias merge='git merge' -alias push='git push' -alias remote='git remote' -alias rebase='git rebase' - -# docker -alias dp='docker ps' -alias dpa='docker ps -a' -alias di='docker images' -alias dc='docker-compose run --rm' - -# ssh -alias keygen='ssh-keygen -t rsa -C "typebrook@gmail.com"' -alias topo='ssh typebrook@topo.tw' -alias ptt='ssh bbsu@ptt.cc' -alias geothings='ssh geothings@geobingan.info' -alias geothings-test='ssh geothings@test.geothings.tw' - -# tig -alias t='tig' -alias ta='tig --all' -alias ts='tig status' -alias tg='tig grep' -alias tr='tig refs' -alias tl='tig log' -alias ty='tig stash' - -# Android -alias debug='./gradlew app:installDebug && adb shell am start -n adb shell am start -n com.geothings.geobingan/.MainActivity_' -alias adbdefault='adb shell dumpsys package domain-preferred-apps' -alias adblist='adb shell dumpsys package d' -alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*' - -# gist -gist_list=~/gist/gist.list -alias gl='nl $gist_list' -alias gll='gist -l > $gist_list && nl $gist_list' -alias gi='_gistRead' -_gistRead() { - gist -r $(awk '{print $1}' $gist_list | awk -v row="$1" -F '/' 'FNR==row {print $NF}') $2 -} -alias note='gist -r 5dd936e91d9ae75ad77084da762f5c11 note > ~/gist/note && \ - vim ~/gist/note && \ - gist -u 5dd936e91d9ae75ad77084da762f5c11 ~/gist/note' -alias todo='gist -r 5dd936e91d9ae75ad77084da762f5c11 todo > ~/gist/todo && \ - vim ~/gist/todo && \ - gist -u 5dd936e91d9ae75ad77084da762f5c11 ~/gist/todo' - -# misc -alias co='curl -O' -alias taiwan='curl -O http://download.geofabrik.de/asia/taiwan-latest.osm.pbf' -alias x='xdg-open' -alias f='free -h' -alias yl='youtube-dl' -alias raw='echo "https://raw.githubusercontent.com"' -alias editor='select-editor' - -# tmp -alias cdo='cd ~/git/openmaptiles' -alias and='cd ~/git/geoBingAn.Android' -alias gdal='docker-compose run --rm gdal' -alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm' diff --git a/.tigrc b/.tigrc deleted file mode 100644 index 89ca787..0000000 --- a/.tigrc +++ /dev/null @@ -1,7 +0,0 @@ -bind stash D !?git stash drop %(stash) -bind stash A !?git stash apply %(stash) -bind status D !rm %(file) -bind refs d !?git branch -d %(branch) -bind main c !?git checkout %(commit) -bind main T !?git show %(tag) -bind generic 9 !@sh -c "echo -n %(commit) | head -c7 | xclip -selection c" diff --git a/.vimrc b/.vimrc deleted file mode 100644 index 2323fc0..0000000 --- a/.vimrc +++ /dev/null @@ -1,39 +0,0 @@ -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Custom Config -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -set cursorline -set number -set relativenumber -set showcmd -"set clipboard=unnamedplus -nmap :q - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => Make Alt key works on Gnome terminal -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Solution is here: https://stackoverflow.com/questions/6778961 -let c='a' -while c <= 'z' - exec "set =\e".c - exec "imap \e".c." " - let c = nr2char(1+char2nr(c)) -endw -set timeout ttimeoutlen=50 - - -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" => vim-plug -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" run :PlugInstall to install plugins - -call plug#begin('~/.vim/plugged') - -" Add indent line -Plug 'Yggdroot/indentLine' -Plug 'mileszs/ack.vim' -Plug 'tpope/vim-surround' -Plug 'lifepillar/pgsql.vim' - -" Initialize plugin system -call plug#end() diff --git a/Makefile b/Makefile index d3bce0f..b8d5dbb 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ +all: apply-alias apply-vim apply-tig + apply-alias: rm -f ~/.bash_aliases - ln -s `pwd`/.bash_aliases ~/.bash_aliases + ln -s `pwd`/alias ~/.bash_aliases apply-vim: rm -f ~/.vim_runtime/my_configs.vim - ln -s `pwd`/.vimrc ~/.vim_runtime/my_configs.vim + ln -s `pwd`/vimrc ~/.vim_runtime/my_configs.vim apply-tig: rm -f ~/.tigrc - ln -s `pwd`/.tigrc ~/.tigrc + ln -s `pwd`/tigrc ~/.tigrc push: git commit -am "update" git push diff --git a/alias b/alias new file mode 100644 index 0000000..cb58a67 --- /dev/null +++ b/alias @@ -0,0 +1,101 @@ +# settings +alias al='vim ~/.bash_aliases && source ~/.bash_aliases' +alias sa='source ~/.bash_aliases' +alias vimrc='vim ~/.vimrc' +alias bashrc='vim ~/.bashrc' +alias tigrc='vim ~/.tigrc' + +# vim +alias v='vim' +alias vr='vim -R' + +# shell +alias ll='ls -alh' +alias ai='sudo apt-get install' +alias si='sudo snap install' +alias ss='sudo !!' +alias hg='history|grep' +alias r='ranger' + +# cd to certain directories +alias ..='cd ..' +alias ld='cd -' # last directory +alias cdd='cd ~/Downloads' +alias cdg='cd ~/git' +alias cds='cd ~/git/settings' +alias r='ranger' + +# git +alias g='git' +alias gls='git log -S' +alias gc='git clone' +alias check='git checkout' +alias checkout='git checkout' +alias stash='git stash' +alias commit='git commit' +alias ca='git commit --amend' +alias branch='git branch' +alias pull='git pull' +alias fetch='git fetch' +alias merge='git merge' +alias push='git push' +alias remote='git remote' +alias rebase='git rebase' + +# docker +alias dp='docker ps' +alias dpa='docker ps -a' +alias di='docker images' +alias dc='docker-compose run --rm' + +# ssh +alias keygen='ssh-keygen -t rsa -C "typebrook@gmail.com"' +alias topo='ssh typebrook@topo.tw' +alias ptt='ssh bbsu@ptt.cc' +alias geothings='ssh geothings@geobingan.info' +alias geothings-test='ssh geothings@test.geothings.tw' + +# tig +alias t='tig' +alias ta='tig --all' +alias ts='tig status' +alias tg='tig grep' +alias tr='tig refs' +alias tl='tig log' +alias ty='tig stash' + +# Android +alias debug='./gradlew app:installDebug && adb shell am start -n adb shell am start -n com.geothings.geobingan/.MainActivity_' +alias adbdefault='adb shell dumpsys package domain-preferred-apps' +alias adblist='adb shell dumpsys package d' +alias rmcache='rm -rf ~/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/*' + +# gist +gist_list=~/gist/gist.list +alias gl='nl $gist_list' +alias gll='gist -l > $gist_list && nl $gist_list' +alias gi='_gistRead' +_gistRead() { + gist -r $(awk '{print $1}' $gist_list | awk -v row="$1" -F '/' 'FNR==row {print $NF}') $2 +} +alias note='gist -r 5dd936e91d9ae75ad77084da762f5c11 note > ~/gist/note && \ + vim ~/gist/note && \ + gist -u 5dd936e91d9ae75ad77084da762f5c11 ~/gist/note' +alias todo='gist -r 5dd936e91d9ae75ad77084da762f5c11 todo > ~/gist/todo && \ + vim ~/gist/todo && \ + gist -u 5dd936e91d9ae75ad77084da762f5c11 ~/gist/todo' + +# misc +alias co='curl -O' +alias taiwan='curl -O http://download.geofabrik.de/asia/taiwan-latest.osm.pbf' +alias x='xdg-open' +alias f='free -h' +alias yl='youtube-dl' +alias raw='echo "https://raw.githubusercontent.com"' +alias editor='select-editor' + +# tmp +alias cdo='cd ~/git/openmaptiles' +alias and='cd ~/git/geoBingAn.Android' +alias gdal='docker-compose run --rm gdal' +alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm' diff --git a/keyboard b/keyboard new file mode 100644 index 0000000..604dbd2 --- /dev/null +++ b/keyboard @@ -0,0 +1,5 @@ +XKBLAYOUT="us" +BACKSPACE="guess" +XKBMODEL="pc105" +XKBVARIANT="" +XKBOPTIONS="ctrl:nocaps" diff --git a/tigrc b/tigrc new file mode 100644 index 0000000..89ca787 --- /dev/null +++ b/tigrc @@ -0,0 +1,7 @@ +bind stash D !?git stash drop %(stash) +bind stash A !?git stash apply %(stash) +bind status D !rm %(file) +bind refs d !?git branch -d %(branch) +bind main c !?git checkout %(commit) +bind main T !?git show %(tag) +bind generic 9 !@sh -c "echo -n %(commit) | head -c7 | xclip -selection c" diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..2323fc0 --- /dev/null +++ b/vimrc @@ -0,0 +1,39 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Custom Config +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set cursorline +set number +set relativenumber +set showcmd +"set clipboard=unnamedplus +nmap :q + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => Make Alt key works on Gnome terminal +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Solution is here: https://stackoverflow.com/questions/6778961 +let c='a' +while c <= 'z' + exec "set =\e".c + exec "imap \e".c." " + let c = nr2char(1+char2nr(c)) +endw +set timeout ttimeoutlen=50 + + +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" => vim-plug +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" run :PlugInstall to install plugins + +call plug#begin('~/.vim/plugged') + +" Add indent line +Plug 'Yggdroot/indentLine' +Plug 'mileszs/ack.vim' +Plug 'tpope/vim-surround' +Plug 'lifepillar/pgsql.vim' + +" Initialize plugin system +call plug#end() -- cgit v1.2.3-70-g09d2