Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sontek/dotfiles
Browse files Browse the repository at this point in the history
Conflicts:
	_vimrc
  • Loading branch information
sontek committed May 28, 2011
2 parents 04c1d3a + 22d8561 commit 1b737d0
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 36 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@
[submodule "_vim/bundle/ropevim"]
path = _vim/bundle/ropevim
url = https://github.com/sontek/rope-vim.git
[submodule "_vim/bundle/acp"]
path = _vim/bundle/acp
url = https://github.com/vim-scripts/AutoComplPop.git
7 changes: 7 additions & 0 deletions _bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ if [ -x "/Applications/MacVim.app/Contents/MacOS/Vim" ]; then
PATH=/Applications/MacVim.app/Contents/MacOS/:$PATH
fi

PATH=/usr/local/sbin:$PATH:/usr/local/mysql/bin
export PATH


Expand All @@ -164,6 +165,12 @@ parse_svn_repository_root() {
svn info 2>/dev/null | sed -ne 's#^Repository Root: ##p'
}

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

source /usr/local/bin/virtualenvwrapper.sh

export EDITOR=vim

# Add git and svn branch names
export PS1="$PS1\$(parse_git_branch)\$(parse_svn_branch) "
export EDITOR=vim
1 change: 1 addition & 0 deletions _vim/bundle/acp
Submodule acp added at 0b075c
1 change: 0 additions & 1 deletion _vim/bundle/supertab
Submodule supertab deleted from 21cd55
92 changes: 57 additions & 35 deletions _vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
" Plugins included
" ==========================================================
" Pathogen
" Better Management of VIM plugins
" Better Management of VIM plugins
"
" GunDo
" Visual Undo in vim with diff's to check the differences
Expand All @@ -21,7 +21,7 @@
" Runs your Python tests in Vim.
"
" Commant-T
" Allows easy search and opening of files within a given path
" Allows easy search and opening of files within a given path
"
" Snipmate
" Configurable snippets to avoid re-typing common comands
Expand All @@ -45,20 +45,24 @@
" Allows you to surround text with open/close tags
"
" Py.test
" Run py.test test's from within vim
" Run py.test test's from within vim
"
" MakeGreen
" Generic test runner that works with nose
"
" ==========================================================
" Shortcuts
" Shortcuts
" ==========================================================
set nocompatible " Don't be compatible with vi
let mapleader="," " change the leader to be a comma vs slash

" Seriously, guys. It's not like :W is bound to anything anyway.
command! W :w

" sudo write this
cmap W! w !sudo tee % >/dev/null

" Toggle the tasklist
map <leader>td <Plug>TaskList
Expand Down Expand Up @@ -103,8 +107,8 @@ map <leader>n :NERDTreeToggle<CR>
" Run command-t file search
map <leader>f :CommandT<CR>
" Ack searching
nmap <leader>a <Esc>:Ack!
" Ack searching
nmap <leader>a <Esc>:Ack!
" Load the Gundo window
map <leader>g :GundoToggle<CR>
Expand All @@ -123,7 +127,7 @@ call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

" ==========================================================
" Basic Settings
" Basic Settings
" ==========================================================
syntax on " syntax highlighing
filetype on " try to detect filetypes
Expand All @@ -135,12 +139,20 @@ set title " show title in console title bar
set wildmenu " Menu completion in command mode on <Tab>
set wildmode=full " <Tab> cycles between all matching choices.

" don't bell or blink
set noerrorbells
set vb t_vb=

" Ignore these files when completing
set wildignore+=*.o,*.obj,.git,*.pyc
set wildignore+=*.o,*.obj,.git,*.pyc
set grepprg=ack-grep " replace the default grep program with ack

" Auto change the directory to the current file I'm working on
"autocmd BufEnter * lcd %:p:h
" Set working directory
nnoremap <leader>. :lcd %:p:h<CR>
" Disable the colorcolumn when switching modes. Make sure this is the
" first autocmd for the filetype here
autocmd FileType * setlocal colorcolumn=0

""" Insert completion
" don't select first item, follow typing in autocomplete
Expand All @@ -160,7 +172,6 @@ set virtualedit=block " Let cursor move past the last char in <C-v> mode
set scrolloff=3 " Keep 3 context lines above and below the cursor
set backspace=2 " Allow backspacing over autoindent, EOL, and BOL
set showmatch " Briefly jump to a paren once it's balanced
set matchtime=2 " (for only .2 seconds).
set nowrap " don't wrap text
set linebreak " don't wrap textin the middle of a word
set autoindent " always set autoindenting on
Expand All @@ -173,6 +184,7 @@ set shiftround " rounds indent to a multiple of shiftwidth
set matchpairs+=<:> " show matching <> (html mainly) as well
set foldmethod=indent " allow us to fold on indents
set foldlevel=99 " don't fold by default
set foldcolumn=1 " show the fold column

" don't outdent hashes
inoremap # #
Expand All @@ -198,7 +210,7 @@ set report=0 " : commands always print changed line count.
set shortmess+=a " Use [+]/[RO]/[w] for modified/readonly/written.
set ruler " Show some info, even without statuslines.
set laststatus=2 " Always show statusline, even if only 1 window.
set statusline=%<%f\ (%{&ft})%=%-19(%3l,%02c%03V%)%{fugitive#statusline()}
set statusline=[%l,%v\ %P%M]\ %f\ %r%h%w\ (%{&ff})\ %{fugitive#statusline()}

" displays tabs with :set list & displays when a line runs off-screen
set listchars=tab:>-,eol:$,trail:-,precedes:<,extends:>
Expand All @@ -207,44 +219,54 @@ set list
""" Searching and Patterns
set ignorecase " Default to using case insensitive searches,
set smartcase " unless uppercase letters are used in the regex.
set smarttab " Handle tabs more intelligently
set hlsearch " Highlight searches by default.
set incsearch " Incrementally search while typing a /regex

"""" Display
colorscheme vividchalk

" Quit window on <leader>q
nnoremap <leader>q :q<CR>
"
" hide matches on <leader>space
nnoremap <leader><space> :nohlsearch<cr>
" Remove trailing whitespace on <leader>S
nnoremap <leader>S :%s/\s\+$//<cr>:let @/=''<CR>
" Select the item in the list with enter
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" ==========================================================
" Python
" Javascript
" ==========================================================
au BufRead *.js set makeprg=jslint\ %

" Don't allow snipmate to take over tab
autocmd VimEnter * ino <c-j> <c-r>=TriggerSnippet()<cr>
" Use tab to scroll through autocomplete menus
autocmd VimEnter * imap <expr> <Tab> pumvisible() ? "<C-N>" : "<Tab>"
autocmd VimEnter * imap <expr> <S-Tab> pumvisible() ? "<C-P>" : "<S-Tab>"
snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>
let g:acp_completeoptPreview=1

" ===========================================================
" FileType specific changes
" ============================================================
" Mako/HTML
autocmd BufNewFile,BufRead *.mako,*.mak setlocal ft=html
autocmd FileType html,xhtml,xml,css setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2

" Python
"au BufRead *.py compiler nose
au FileType python set omnifunc=pythoncomplete#Complete
au FileType python setlocal expandtab shiftwidth=4 tabstop=8 softtabstop=4 smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with
au BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m

" Don't let pyflakes use the quickfix window
let g:pyflakes_use_quickfix = 0

" turn of hlsearch and update pyflakes on enter
au BufRead,BufNewFile *.py nnoremap <buffer><CR> :nohlsearch\|:call PressedEnter()<cr>
nnoremap <buffer><CR> :nohlsearch\|:call PressedEnter()<cr>

" clear the search buffer when hitting return and update pyflakes checks
function! PressedEnter()
:nohlsearch
if &filetype == 'python'
:PyflakesUpdate
end
endfunction

" ==========================================================
" Javascript
" ==========================================================
au BufRead *.js set makeprg=jslint\ %

" ==========================================================
" SuperTab - Allows us to get code completion with tab
" ==========================================================
" Try different completion methods depending on its context
let g:SuperTabDefaultCompletionType = "context"

" Add the virtualenv's site-packages to vim path
py << EOF
Expand Down

0 comments on commit 1b737d0

Please sign in to comment.