Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hellogerard/dotfiles
base: 85dbf783b8
...
head fork: hellogerard/dotfiles
compare: fa22e21749
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 120 additions and 29 deletions.
  1. +98 −17 linux/.vimrc
  2. +4 −1 mac/.vimrc
  3. +18 −11 msys/.vimrc
View
115 linux/.vimrc
@@ -1,38 +1,119 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Generally global options
+"
+
+" Vim is not compatible with vi, which is more useful
set nocompatible
+" Ignore case by default when searching
+set ic
-set diffexpr=MyDiff()
-function MyDiff()
- let opt = ''
- if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
- if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
- silent execute '!diff -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out
-endfunction
+" Do not ignore case if the search pattern contains uppercase characters
+set smartcase
-set ic
-set shiftwidth=4
+" Highlight search matches
+set hlsearch
+
+" Incremental search
+set incsearch
+
+" Backspace through everything in insert mode
+set backspace=indent,eol,start
+
+" Number of spaces to use for tab characters
set tabstop=4
+
+" Number of spaces to use for indents
+set shiftwidth=4
+
+" Use shiftwidth spaces for indents instead of tabs
set expandtab
+
+" Use shiftwidth spaces for tab characters
+" (also backspace deletes shiftwidth chars)
+set smarttab
+
+" Copy indent from current line when starting new line
set autoindent
+
+" For C-like programs, indent smartly e.g. after opening braces
set smartindent
-set smartcase
-set cindent
-set cinoptions=>4
-set formatoptions=cqro
+
+" c = auto-wrap comments using textwidth
+" r = automatically insert the current comment leader in command mode
+" o = automatically insert the current comment leader in insert mode
+" q = allow formatting with "gq"
+set formatoptions=croq
+
+" Maximum width of text that is being inserted
set textwidth=80
+
+" ' = maximum number of previously edited files to be remembered
set viminfo='1
+
+" Show the line and column number of the cursor position, and percentage of file
set ruler
+
+" When a bracket, paren, etc. is inserted, briefly jump to the matching one
set showmatch
+
+" Show possible commands during command-line completion
set wildmenu
+
+" Show possible files during file-line completion
set wildmode=list:longest
+
+" Always show the status line
set laststatus=2
-set smarttab
+
+" Save modified file when changing buffers
set autowrite
+
+" no swapfiles
set noswapfile
set nobackup
set nowb
-set term=xterm
+
+" Turn syntax highlighting on according to filetype
syntax on
-"highlight Normal guibg=grey95
+
+" Vim will look for filetype plugins
+filetype plugin on
+
+" Use vim-included diff for diffing files
+set diffexpr=MyDiff()
+function MyDiff()
+ let opt = ''
+ if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
+ if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
+ silent execute '!diff -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out
+endfunction
+
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Set filetype options (mostly indentation)
+"
+
+autocmd FileType html setlocal shiftwidth=2 tabstop=2
+autocmd FileType css setlocal shiftwidth=2 tabstop=2
+autocmd FileType smarty setlocal shiftwidth=2 tabstop=2
+autocmd FileType yaml setlocal shiftwidth=2 tabstop=2
+autocmd FileType ruby setlocal shiftwidth=2 tabstop=2
+autocmd FileType eruby setlocal shiftwidth=2 tabstop=2
+autocmd FileType haml setlocal shiftwidth=2 tabstop=2
+autocmd FileType scss setlocal shiftwidth=2 tabstop=2
+autocmd FileType sass setlocal shiftwidth=2 tabstop=2
+autocmd BufRead,BufNewFile *.phtml set shiftwidth=2 tabstop=2
+autocmd FileType php setlocal comments=s1:/*,mb:*,ex:*/,://,:#
+
+
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Colors and highlighting
+"
+
+" Set terminal
+set term=xterm
+
+" Set color scheme
colorscheme elflord
-"set gfn=Courier_New:h10:b:cANSI
View
5 mac/.vimrc
@@ -17,6 +17,9 @@ set hlsearch
" Incremental search
set incsearch
+" Backspace through everything in insert mode
+set backspace=indent,eol,start
+
" Number of spaces to use for tab characters
set tabstop=4
@@ -116,4 +119,4 @@ autocmd FileType php setlocal comments=s1:/*,mb:*,ex:*/,://,:#
"colorscheme elflord
" Set gvim font
-"set gfn=Courier_New:h10:b:cANSI
+set gfn=Courier_New:h9:w5:b:cANSI
View
29 msys/.vimrc
@@ -17,6 +17,9 @@ set hlsearch
" Incremental search
set incsearch
+" Backspace through everything in insert mode
+set backspace=indent,eol,start
+
" Number of spaces to use for tab characters
set tabstop=4
@@ -77,6 +80,15 @@ syntax on
" Vim will look for filetype plugins
filetype plugin on
+" Use vim-included diff for diffing files
+set diffexpr=MyDiff()
+function MyDiff()
+ let opt = ''
+ if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
+ if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
+ silent execute '!diff -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out
+endfunction
+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set filetype options (mostly indentation)
@@ -97,19 +109,14 @@ autocmd FileType php setlocal comments=s1:/*,mb:*,ex:*/,://,:#
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-" Might not want to include below for shell accounts
+" GUI vim options - might not want to include below for shell accounts
"
-" Set gvim window colors and font
+" Set gvim highlighting
"highlight Normal guibg=grey95
+
+" Set gvim color scheme
colorscheme desert
-set gfn=Courier_New:h9:w5:b:cANSI
-" Use vim-included diff for diffing files
-set diffexpr=MyDiff()
-function MyDiff()
- let opt = ''
- if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
- if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
- silent execute '!diff -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out
-endfunction
+" Set gvim font
+set gfn=Courier_New:h9:w5:b:cANSI

No commit comments for this range

Something went wrong with that request. Please try again.