- add user informations
$ git config --global user.name "Tim Chen"
$ git config --global user.email "inferno6562@gmail.com"
- add some useful configs
$ git config --global core.editor "vim"
$ git config --global alias.graph "log --graph --decorate --oneline"
$ git config --global push.default simple
- display branch name on shell (re-login is required)
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
config vimrc
- edit vimrc
- add configs
" custom settings
set nu
set tabstop=2
set shiftwidth=2
set mouse=a
set incsearch
filetype indent on
set bg=dark
color darkblue
hi LineNr cterm=bold ctermfg=DarkGrey ctermbg=NONE
hi CursorLineNr cterm=bold ctermfg=Green ctermbg=NONE
inoremap ( ()<Esc>i
inoremap " ""<Esc>i
inoremap ' ''<Esc>i
inoremap [ []<Esc>i
inoremap { {}<Esc>i
get ctrlp.vim
- clone ctrlp.vim
$ cd ~/.vim
$ git clone https://github.com/ctrlpvim/ctrlp.vim.git bundle/ctrlp.vim
- add to
~/.vimrc
set runtimepath^=~/.vim/bundle/ctrlp.vim
- run on vim's command line
:helptags ~/.vim/bundle/ctrlp.vim/doc
- restart vim and check
:help ctrlp.txt
generate SSH keys for github/gitlab
- generate SSH keys
$ ssh-keygen
$ cat ~/.ssh/id_rsa.pub
- copy output and paste to github and gitlab
install rails 5 and 6
- install rails at current gemset
- create a new gemset
$ rvm gemset create rails600
- switch to rails600
- list all rails version and install latest one(current latest version is 6.0.0.rc1)
$ gem list rails --remote --pre --all | grep -i "^rails "
$ gem install rails -v 6.0.0.rc1