Last active
November 4, 2016 14:12
-
-
Save alexmchale/f04f3b3697f6e5c650adce44ba05fddc to your computer and use it in GitHub Desktop.
Shell script to setup a session of bash per my preferences
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl 'https://gist.githubusercontent.com/alexmchale/f04f3b3697f6e5c650adce44ba05fddc/raw/setup.sh' > /tmp/.atm.sh && source /tmp/.atm.sh | |
# SETUP STARTING | |
cat > /tmp/.atm.vim <<EOF | |
set nocompatible | |
set ch=1 | |
set mousehide | |
set shiftwidth=2 | |
set softtabstop=2 | |
set tabstop=24 | |
set smartindent | |
set expandtab | |
set ruler | |
set ai | |
set background=dark | |
set nobackup | |
set nowritebackup | |
set noswapfile | |
set bs=2 | |
set cinoptions+=:0g0 | |
set history=50 | |
set gdefault | |
set showmatch | |
set matchpairs+=<:> | |
set showmode | |
set nowrap | |
set mouse-=a | |
set noincsearch | |
set number | |
set go-=rL | |
set wildignore+=*.o,1.8.7,.git,*.obj,*/tmp/*,*.zip,*.swp,*.min.js | |
set scrolloff=10 | |
set modeline | |
set modelines=5 | |
set laststatus=2 | |
set nocursorline | |
set nocursorcolumn | |
" Disable all bells | |
set vb t_vb="" | |
autocmd VimEnter * set vb t_vb= | |
au! GuiEnter * set vb t_vb= | |
map! <BackSpace> | |
map ; : | |
" Show end of line whitespace as an error | |
match ErrorMsg / \+$/ | |
syntax on | |
" Page controls | |
noremap <C-J> <PageDown> | |
noremap <C-K> <PageUp> | |
" Define a command for switching Ruby hashes to 1.9 syntax | |
command! -bar -range=% NotRocket :<line1>,<line2>s/:\(\w\+\)\s*=>/\1:/e | |
command! -bar -range=% YesRocket :<line1>,<line2>s/\(\w\+\):/:\1 =>/e | |
" Editing | |
nmap <C-i> ciw | |
vmap <C-i> c | |
syn sync fromstart | |
" Force the syntax for some common filenames. | |
au BufReadPost Gemfile set syntax=ruby | |
au BufReadPost Rakefile set syntax=ruby | |
au BufReadPost *.task set syntax=ruby | |
au BufRead,BufNewFile *.csvbuilder setfiletype ruby | |
au BufRead,BufNewFile *.json.jbuilder set ft=ruby | |
au BufRead,BufNewFile *.go set ts=4 sw=4 syntax=go softtabstop=0 noexpandtab | |
au BufRead,BufNewFile *.java set ts=4 sw=4 syntax=java softtabstop=0 expandtab | |
au BufRead,BufNewFile Makefile set ts=4 sw=4 syntax=make softtabstop=0 noexpandtab | |
au FileType perl set ts=4 sw=4 syntax=perl softtabstop=0 noexpandtab | |
au FileType php set ts=4 sw=4 syntax=php softtabstop=0 noexpandtab | |
EOF | |
export GIT_AUTHOR_NAME="Alex McHale" | |
export GIT_AUTHOR_EMAIL="[email protected]" | |
export GIT_COMMITTER_NAME="Alex McHale" | |
export GIT_COMMITTER_EMAIL="[email protected]" | |
alias gs="git status --short --branch" | |
alias gd="git diff" | |
alias gds="git diff --staged" | |
alias ls="ls --color=auto" | |
alias vim="vim -u /tmp/.atm.vim" | |
alias gla="git log --date=\"short\" --format=\"%Cred%h %Cgreen%s%Cblue%d %Cred(%aN %ad)\"" | |
# SETUP COMPLETE | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment