Skip to content

Instantly share code, notes, and snippets.

@koddsson
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koddsson/1b1bd6a093794f9cfc6c to your computer and use it in GitHub Desktop.
Save koddsson/1b1bd6a093794f9cfc6c to your computer and use it in GitHub Desktop.
Server setup
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y git
git clone https://gist.github.com/1b1bd6a093794f9cfc6c.git server-setup
cd server-setup
sh setup.sh
cd ..
rm -rf server-setup
# Currently only for ubuntu servers
# This script assumes that bootstrap.sh is calling this.
# Install requirements
sudo apt-get install -y python-setuptools zsh curl autojump python vim
# Install oh-my-zsh
curl -L http://install.ohmyz.sh | sh
# Install python dependencies
sudo easy_install pip
sudo pip install pip --upgrade
sudo pip install virtualenv --upgrade
sudo pip install virtualenvwrapper --upgrade
# Get the configs into place
mv zshrc ~/.zshrc
mv vimrc ~/.vimrc
sudo chsh -s "$(command -v zsh)" "${USER}"
mkdir ~/.vim/colors/
wget https://raw.githubusercontent.com/jnurmine/Zenburn/master/colors/zenburn.vim -P ~/.vim/colors/
# Setup plugin manager for vim and install all the plugins
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/vundle'
Plugin 'scrooloose/nerdtree'
Plugin 'bling/vim-airline'
Plugin 'kien/ctrlp.vim'
call vundle#end() " required
filetype plugin indent on " required!
syntax enable
colors zenburn
"Bindings
let mapleader = "," "Set the leader as ,
set spell
set spelllang=en
set number " Numbered lines
set incsearch " Jumps to next match while typing
" Set horizontal and vertical lines
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
set cursorline cursorcolumn
" Good old dont go over 80characters line.
set colorcolumn=80
" Make it impossible to go over 80 characters
"set tw=80 " Currently not working.
" Set the encryption method to blowfish!
set cm=blowfish
" Automatically re-read files on change.
set autoread
" --------------------------
" Buffers! They are a thing!
" --------------------------
" My preference with using buffers. See `:h hidden` for more details
set hidden
" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
nmap <leader>T :enew<cr>
" Move to the next buffer
nmap gt :bnext<CR>
" Move to the previous buffer
nmap gT :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <leader>bq :bp <BAR> bd #<CR>
" Show all open buffers and their status
nmap <leader>bl :ls<CR>
" Rebind ctrl-p to invoke ctrlp in mixed mode.
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlPMixed'
let g:ctrlp_clear_cache_on_exit = 0 " Cache ctrlp results
" Bind <leader>g to jump to definition using ctags.
nnoremap <leader>g :CtrlPTag<cr>
"Airline options
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1 " Enable the list of buffers
let g:airline#extensions#tabline#fnamemod = ':t' " Show just the filename
" Tab/Spaces
set softtabstop=4 shiftwidth=4 expandtab " Sets tabs to four spaces
autocmd FileType java :setlocal sw=4 ts=4 sts=4 " Two spaces for CSS files
autocmd FileType html :setlocal sw=2 ts=2 sts=2 " Two spaces for HTML files
autocmd FileType css :setlocal sw=2 ts=2 sts=2 " Two spaces for CSS files
autocmd FileType javascript :setlocal sw=2 ts=2 sts=2 " Two spaces for JS files
autocmd FileType clj :setlocal sw=2 ts=2 sts=2 " Two spaces for clojure files
autocmd FileType cljs :setlocal sw=2 ts=2 sts=2 " Two spaces for clojure files
autocmd FileType py :setlocal sw=4 ts=4 sts=4 " Two spaces for clojure files
" ------------------
" NERDTree
" ------------------
"nmap <C-i> :NERDTreeToggle<CR>
nmap <leader>f :NERDTreeFind<CR>
nmap <leader>n :NERDTree<cr> "I'm probably never gonna use this.
nmap <leader>p :exec '!python' shellescape(@%, 1)<cr>
" Return to last edit position when opening files (You want this!)
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Remember info about open buffers on close
set viminfo^=%
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="norm"
DEFAULT_USER="koddsson"
# Set keyboard rate to reasonablesness
xset r rate 200 100
# Disable caps lock
setxkbmap -option ctrl:nocaps
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias latest="ls -Art|tail -n1"
alias fucking=""
alias plz='sudo'
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Uncomment this to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want to disable command autocorrection
# DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment following line if you want to shown in the command execution time stamp
# in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|
# yyyy-mm-dd
# HIST_STAMPS="mm/dd/yyyy"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git python virtualenv virtualenvwrapper autojump)
source $ZSH/oh-my-zsh.sh
[[ -n "$DISPLAY" && "$TERM" = "xterm" ]] && export TERM=xterm-256color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment