Permalink
Browse files

Merge branch 'master' of git://github.com/mathiasbynens/dotfiles

* 'master' of git://github.com/mathiasbynens/dotfiles:
  .vimrc: Make tabs as wide as two spaces.
  Add .vimrc, heavily based on the one @gf3 uses. Fixes #4.
  Link to the issue tracker for suggestions.
  Sexier file sourcing.
  Add a link to @janmoesen’s tilde repository.

Conflicts:
	.bash_profile
  • Loading branch information...
2 parents df643f6 + 52819c6 commit a2e4dce2d30b17452d3462e1b82dc5f016d0c566 @ebetancourt committed Oct 19, 2011
Showing with 68 additions and 2 deletions.
  1. +2 −0 .bash_profile
  2. +64 −0 .vimrc
  3. +2 −2 README.md
View
@@ -4,6 +4,7 @@ for file in bash_prompt exports aliases functions extra elliot_custom; do
file="$HOME/.$file"
[ -e "$file" ] && source "$file"
done
+unset file
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob
@@ -12,4 +13,5 @@ shopt -s nocaseglob
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
# Add tab completion for `defaults read|write NSGlobalDomain`
+# You could just use `-g` instead, but I like being explicit
complete -W "NSGlobalDomain" defaults
View
64 .vimrc
@@ -0,0 +1,64 @@
+" Make vim more useful
+set nocompatible
+" Allow cursor keys in insert mode
+set esckeys
+" Optimize for fast terminal connections
+set ttyfast
+" Add the g flag to search/replace by default
+set gdefault
+" Use UTF-8 without BOM
+set encoding=utf-8 nobomb
+" Change mapleader
+let mapleader=","
+" Don’t add empty newlines at the end of files
+set binary
+set noeol
+
+" Enable line numbers
+set number
+" Enable syntax highlighting
+syntax on
+" Highlight current line
+set cursorline
+" Make tabs as wide as two spaces
+set tabstop=2
+" Show “invisible” characters
+set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
+set list
+" Highlight searches
+set hlsearch
+" Ignore case of searches
+set ignorecase
+" Highlight dynamically as pattern is typed
+set incsearch
+" Always show status line
+set laststatus=2
+" Enable mouse in all modes
+set mouse=a
+" Disable error bells
+set noerrorbells
+" Don’t reset cursor to start of line when moving around.
+set nostartofline
+" Show the cursor position
+set ruler
+" Don’t show the intro message when starting vim
+set shortmess=atI
+" Show the current mode
+set showmode
+" Show the filename in the window titlebar
+set title
+" Use relative line numbers
+set relativenumber
+au BufReadPost * set relativenumber
+" Start scrolling three lines before the horizontal window border
+set scrolloff=3
+
+" Strip trailing whitespace (,ss)
+function! StripWhitespace ()
+ let save_cursor = getpos(".")
+ let old_query = getreg('/')
+ :%s/\s\+$//e
+ call setpos('.', save_cursor)
+ call setreg('/', old_query)
+endfunction
+noremap <leader>ss :call StripWhitespace ()<CR>
View
@@ -24,6 +24,6 @@ Suggestions/improvements
## Thanks to…
* [Gianni Chiappetta](http://gf3.ca/) for sharing his [amazing collection of dotfiles](https://github.com/gf3/dotfiles)
* [Matijs Brinkhuis](http://hotfusion.nl/) and his [homedir repository](https://github.com/matijs/homedir)
-* [Jan Moesen](http://jan.moesen.nu/) (who will hopefully take [his `.bash_profile`](https://gist.github.com/1156154) and make it into a full `dotfiles` repo some day)
+* [Jan Moesen](http://jan.moesen.nu/) and his [ancient `.bash_profile`](https://gist.github.com/1156154) + [shiny tilde repository](https://github.com/janmoesen/tilde)
* [Tim Esselens](http://devel.datif.be/)
-* anyone who [contributed a patch](https://github.com/mathiasbynens/dotfiles/contributors) or made a helpful suggestion
+* anyone who [contributed a patch](https://github.com/mathiasbynens/dotfiles/contributors) or [made a helpful suggestion](https://github.com/mathiasbynens/dotfiles/issues)

0 comments on commit a2e4dce

Please sign in to comment.