Skip to content

Instantly share code, notes, and snippets.

@newhavengill
Last active August 29, 2015 14:24
Show Gist options
  • Save newhavengill/66c771deb8f0faa45459 to your computer and use it in GitHub Desktop.
Save newhavengill/66c771deb8f0faa45459 to your computer and use it in GitHub Desktop.
Basic server settings

My minimal setup for a server: Vim and bash config.

curl -fsSL "https://gist.githubusercontent.com/newhavengill/66c771deb8f0faa45459/raw/install.sh" | bash -e
# PS1='\[\033[31m\]\w\[\033[0m\] $ '
# PS1='${debian_chroot:+($debian_chroot)}\[\e[34m\]\u\[\e[0m\]@\h:\[\e[36m\]\W\[\e[0m\]\$ '
# PS1='\n[\!] `if [ $? = 0 ]; then echo \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[31m\]O.O\[\e[0m\]; fi` (\j) \[\e[36m\]\W\[\e[0m\]\n\$ ~> '
PS1='\n[\!] `if [ $? = 0 ]; then echo \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[31m\]O.O\[\e[0m\]; fi` \u@\h:\[\e[36m\]\w\[\e[0m\]\n\$${debian_chroot:+($debian_chroot)} \j> '
export EDITOR=vim
alias ll='ls -l'
alias la='ls -la'
curl -fsSL "https://gist.githubusercontent.com/newhavengill/66c771deb8f0faa45459/raw/vimrc" -o ~/.vimrc
curl -fsSL "https://gist.githubusercontent.com/newhavengill/66c771deb8f0faa45459/raw/bash_profile" >> ~/.bash_profile
set nocompatible " choose no compatibility with legacy vi
syntax enable
set encoding=utf-8
filetype plugin indent on " load file type plugins + indentation
"" Tweaks
set hidden " allow backgrounding buffers without writing them
set nonumber " line numbers aren't needed
set scrolloff=3 " have some context around the current line always on screen
set history=200 " remember more Ex commands
set synmaxcol=800 " don't try to highlight long lines
" Time out on key codes but not mappings. Makes terminal Vim work sanely
set notimeout
set ttimeout
set ttimeoutlen=100
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces (or set this to 4)
set expandtab " use spaces, not tabs (optional)
set backspace=indent,eol,start " backspace through everything in insert mode
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set gdefault " replace all matches per line (instead of just first)
"" Have Vim able to edit crontab files again
set backupskip=/tmp/*,/private/tmp/*"
"" Status line
set showcmd " display incomplete commands
if has("statusline") && !&cp
set laststatus=2 " always show the status bar
set statusline=%f\ %m\ %r " filename, modified, readonly
set statusline+=\ %l/%L[%p%%] " current line/total lines
set statusline+=\ %v[0x%B] " current column [hex char]
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment