Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rewritten using vundle

  • Loading branch information...
commit 145a696306b01c49de5b78e20d93d861db1f536f 1 parent 8a05324
Swaroop C H authored
2  LICENSE.txt
View
@@ -1,4 +1,4 @@
-Copyright 2010 Swaroop C H
+Copyright 2010-2011 Swaroop C H
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
28 README.md
View
@@ -1,28 +0,0 @@
-
-# My Vim setup
-
-# Installation
-
- if [[ "$OSTYPE" =~ "linux" ]] # Assumes Ubuntu
- then
- sudo apt-get install git curl subversion
- elif [[ "$OSTYPE" =~ "darwin" ]]
- then
- brew install git curl subversion
- else
- echo "Don't know how to install packages on $OSTYPE operating system"
- exit 1
- fi
-
- mkdir -p "$HOME/code/"
- cd "$HOME/code/"
-
- git clone git://github.com/swaroopch/dotvim.git
- cd dotvim
- git submodule update --init
-
- bash install.bash
-
- vim # Follow the instructions to download the Vim plugins
-
- bash post_install.bash
8 README.textile
View
@@ -0,0 +1,8 @@
+h1. My Vim setup
+
+h2. Installation
+
+# Install "git":http://git-scm.com and "curl":http://curl.haxx.se
+# @git clone git://github.com/swaroopch/dotvim.git@
+# @cd dotvim@
+# @bash install.sh@
3  gvimrc
View
@@ -1,5 +1,5 @@
" Theme
-colorscheme koehler
+colorscheme solarized
" Logical size of GVim window
set lines=35 columns=99
@@ -12,7 +12,6 @@ set guioptions-=T
if has('mac')
set guifont=Monaco:h13
elseif has('unix')
- "let &guifont="Monospace 10"
let &guifont="DejaVu Sans Mono 10"
endif
2  htmljinja/htmldjango.vim
View
@@ -1,2 +0,0 @@
-set ft=htmljinja
-call TagExpander()
27 htmljinja/htmljinja.vim
View
@@ -1,27 +0,0 @@
-" Vim syntax file
-" Language: Jinja HTML template
-" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
-" Last Change: 2007 Apr 8
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-if !exists("main_syntax")
- let main_syntax = 'html'
-endif
-
-if version < 600
- so <sfile>:p:h/jinja.vim
- so <sfile>:p:h/html.vim
-else
- runtime! syntax/jinja.vim
- runtime! syntax/html.vim
- unlet b:current_syntax
-endif
-
-let b:current_syntax = "htmljinja"
51 install.bash
View
@@ -1,51 +0,0 @@
-#!/usr/bin/env bash
-
-## Check Bash Version
-
-if [ "$BASH_VERSION" = "" ]
-then
- echo "I work only with Bash"
- exit 1
-fi
-
-## Check Git is installed
-if [[ $(which git) == "" ]]
-then
- echo "Please ensure that git is installed"
- exit 1
-fi
-
-## Check OS
-
-if [[ "$OSTYPE" == "darwin10.0" ]]
-then
- export OS="mac"
- if [[ $(which brew) == "" ]]
- then
- echo "Please install brew ( http://mxcl.github.com/homebrew ) before proceeding."
- exit 1
- fi
-elif [[ "$OSTYPE" == "linux-gnu" ]]
-then
- export OS="linux"
-else
- echo "Don't know what to do with '$OSTYPE' operating system"
- exit 1
-fi
-
-# Assumption of directory location
-DOTVIM="$HOME/code/dotvim"
-cd $DOTVIM
-
-## Install vim files
-
-echo "Installing vimrc"
-ln -s -f "$DOTVIM/vimrc" "$HOME/.vimrc"
-ln -s -f "$DOTVIM/gvimrc" "$HOME/.gvimrc"
-
-# Put swap files in a specific location, to avoid Dropbox from spinning incessantly.
-mkdir -p "$HOME/.vim/swapfiles/"
-
-echo "Open Vim in a separate window NOW, keep pressing 'y' and return key until Vim exits. Press enter key in this window when done."
-
-unset OS
40 install.sh
View
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Git and Curl required
+if [[ $(which git) == "" ]]
+then
+ echo "Install git ( http://git-scm.com ) first"
+ exit 1
+fi
+if [[ $(which curl) == "" ]]
+then
+ echo "Install curl ( http://curl.haxx.se ) first"
+ exit 1
+fi
+
+# Download Vundle
+mkdir -p ~/.vim/bundle
+if [[ ! -d ~/.vim/bundle/vundle ]]
+then
+ git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
+fi
+
+# Download upstart.vim
+mkdir -p ~/.vim/syntax/
+curl http://bazaar.launchpad.net/~upstart-devel/upstart/trunk/download/head:/upstart.vim-20090708195914-1n7k3bcwobwm4ag7-7/upstart.vim -o ~/.vim/syntax/upstart.vim
+
+# vimrc, gvimrc
+ln -s -f $PWD/vimrc ~/.vimrc
+ln -s -f $PWD/gvimrc ~/.gvimrc
+
+vim -c "BundleInstall" -c "quit"
+
+# Command-T post-download installation
+if [[ -d ~/.vim/bundle/command-t ]]
+then
+ cd ~/.vim/bundle/command-t
+ rake make
+ cd -
+fi
+
+echo "Finished"
72 post_install.bash
View
@@ -1,72 +0,0 @@
-#!/usr/bin/env bash
-
-## Check OS
-
-if [[ "$OSTYPE" == "darwin10.0" ]]
-then
- export OS="mac"
- if [[ $(which brew) == "" ]]
- then
- echo "Please install brew ( http://mxcl.github.com/homebrew ) before proceeding."
- exit 1
- fi
-elif [[ "$OSTYPE" == "linux-gnu" ]]
-then
- export OS="linux"
-else
- echo "Don't know what to do with '$OSTYPE' operating system"
- exit 1
-fi
-
-# Assumption of directory location
-DOTVIM="$HOME/code/dotvim"
-
-## Post Installation
-
-if [[ -d "$DOTVIM/snipMate" ]]
-then
- # FIXME Ugly but don't know how else to include custom snippets
- cat "$DOTVIM/snippets_more/eruby.snippets" >> "$DOTVIM/snipMate/snippets/eruby.snippets"
- cat "$DOTVIM/snippets_more/ruby.snippets" >> "$DOTVIM/snipMate/snippets/ruby.snippets"
- cat "$DOTVIM/snippets_more/python.snippets" >> "$DOTVIM/snipMate/snippets/python.snippets"
- cat "$DOTVIM/snippets_more/htmljinja.snippets" >> "$DOTVIM/snipMate/snippets/htmljinja.snippets"
-fi
-
-## Install dependencies
-
-# ack
-if [[ "$OS" == "linux" ]]
-then
- if [[ -z $(dpkg -l | fgrep -i ack-grep) ]]
- then
- sudo apt-get install ack-grep
- fi
- sudo ln -s -f /usr/bin/ack-grep /usr/bin/ack
-elif [[ "$OS" == "mac" ]]
-then
- brew install ack
-fi
-
-# command-t
-cd $DOTVIM/Command-T/ruby/command-t
-ruby extconf.rb
-make
-
-## Custom files
-
-# HACK for htmljinja
-mkdir -p "$HOME/.vim/syntax/"
-ln -s -i "$DOTVIM/htmljinja/htmljinja.vim" "$HOME/.vim/syntax/htmljinja.vim"
-mkdir -p "$HOME/.vim/ftplugin/"
-ln -s -i "$DOTVIM/htmljinja/htmldjango.vim" "$HOME/.vim/ftplugin/htmldjango.vim"
-
-## Cleanup
-
-if [[ "$OS" == "mac" ]]
-then
- brew cleanup
-fi
-
-unset OS
-
-echo "Finished. Open Vim now!"
4 snippets_more/eruby.snippets
View
@@ -1,4 +0,0 @@
-snippet %
- <% ${1} %>
-snippet %%
- <%= ${1} %>
20 snippets_more/htmljinja.snippets
View
@@ -1,20 +0,0 @@
-snippet %
- {% ${1} %}
-snippet {
- {{ ${1} }}
-snippet #
- {# ${1} #}
-snippet block
- {% block ${1:name} %}
-
- ${2}
-
- {% endblock $1 %}
-snippet if
- {% if ${1} %}
- ${2}
- {% endif %}
-snippet for
- {% for ${1} in ${2} %}
- ${3}
- {% endfor %}
3  snippets_more/python.snippets
View
@@ -1,3 +0,0 @@
-snippet echo
- from pprint import pformat #DEBUG
- app.logger.debug("|ZZZ| ${1:variable_name} => \n----\n%s\n----", pformat($1)) #DEBUG
3  snippets_more/ruby.snippets
View
@@ -1,3 +0,0 @@
-snippet echo
- puts "0xDEADBEEF" * 20 #DEBUG
- puts "${1:variable_name}=|#{$1.inspect}|" #DEBUG
1  vim-addon-manager
@@ -1 +0,0 @@
-Subproject commit bf54de4e064eae34653e720524253290d81b6b47
116 vimrc
View
@@ -4,18 +4,54 @@
"" Vim, not Vi.
" This must be first, because it changes other options as a side effect.
set nocompatible
-
-"" Vim Addon Manager
-
-function ActivateAddons()
- set runtimepath+=~/code/dotvim/vim-addon-manager
- try
- call scriptmanager#Activate(['snipMate', 'ack', 'Command-T', 'Conque_Shell', 'Align294', 'xmledit', 'The_NERD_tree', 'The_NERD_Commenter', 'surround', 'Jinja', 'Textile_for_VIM', 'JSON', 'inkpot', 'python790', 'rails', 'VOoM_-_Vim_Outliner_of_Markers', 'DrawIt'])
- catch /.*/
- echoerr v:exception
- endtry
-endfunction
-call ActivateAddons()
+" required! by vundle
+filetype off
+
+"" Vundle
+"" See :help vundle for more details
+set runtimepath+=~/.vim/bundle/vundle/
+call vundle#rc()
+
+" let Vundle manage Vundle
+" required! by vundle
+Bundle 'gmarik/vundle'
+
+" Git Repos by http://vim-scripts.org ( get names from https://github.com/vim-scripts/following )
+Bundle 'Conque-Shell'
+Bundle 'JSON.vim'
+Bundle 'Jinja'
+Bundle 'Textile-for-VIM'
+Bundle 'django.vim'
+Bundle 'go.vim'
+Bundle 'nginx.vim'
+Bundle 'python.vim--Vasiliev'
+Bundle 'ZoomWin'
+
+" Git Repos on GitHub
+" Inspired from http://sontek.net/turning-vim-into-a-modern-python-ide
+Bundle 'Lokaltog/vim-easymotion'
+Bundle 'alfredodeza/pytest.vim'
+Bundle 'altercation/vim-colors-solarized'
+Bundle 'carlosvillu/coffeScript-VIM-Snippets'
+Bundle 'ervandew/supertab'
+Bundle 'fs111/pydoc.vim'
+Bundle 'godlygeek/tabular'
+Bundle 'kchmck/vim-coffee-script'
+Bundle 'mattn/zencoding-vim'
+Bundle 'mileszs/ack.vim'
+Bundle 'mitechie/pyflakes-pathogen'
+Bundle 'msanders/snipmate.vim'
+Bundle 'scrooloose/nerdcommenter'
+Bundle 'scrooloose/nerdtree'
+Bundle 'sjl/gundo.vim'
+Bundle 'sontek/rope-vim'
+Bundle 'sukima/xmledit'
+Bundle 'tpope/vim-fugitive'
+Bundle 'tpope/vim-rails'
+Bundle 'tpope/vim-surround'
+
+" Git Repos not on GitHub
+Bundle 'git://git.wincent.com/command-t.git'
"" General Settings
@@ -27,6 +63,7 @@ set fileformat=unix
au BufNewFile * set fileformat=unix
" Automatically indent when adding a curly bracket, etc.
+" required! by vundle
filetype plugin indent on
set autoindent
set smartindent
@@ -36,9 +73,7 @@ set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
-
-" Put swap files in a specific location, to avoid Dropbox from spinning incessantly.
-set directory=~/.vim/swapfiles/
+set backspace=indent,eol,start
" Disable the F1 help key
map <F1> <Esc>
@@ -80,6 +115,7 @@ set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " filename
set statusline+=%h%m%r%w " status flags
+set statusline+=%{fugitive#statusline()} " git status
set statusline+=\[%{strlen(&ft)?&ft:'none'}] " file type
set statusline+=%= " right align remainder
set statusline+=0x%-8B " character value
@@ -272,6 +308,18 @@ EOF
command O call Open()
map <Leader>o :call Open()<CR>
+" Add the virtualenv's site-packages to vim path
+python << EOF
+import os.path
+import sys
+import vim
+if 'VIRTUAL_ENV' in os.environ:
+ project_base_dir = os.environ['VIRTUAL_ENV']
+ sys.path.insert(0, project_base_dir)
+ activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
+ execfile(activate_this, dict(__file__=activate_this))
+EOF
+
endif " python
" Remove the Windows ^M (copied from http://amix.dk/vim/vimrc.html)
@@ -295,17 +343,36 @@ nnoremap ' `
nnoremap ` '
" matchit
-runtime macros/matchit.vim
+runtime! macros/matchit.vim
" Python
let python_highlight_all=1
+" For 'supertab' script
+autocmd FileType python set omnifunc=pythoncomplete#Complete
+let g:SuperTabDefaultCompletionType = "context"
+set completeopt=menuone,longest,preview
+
+"" Script-specific configurations
-" Conque Shell
-" http://www.vim.org/scripts/script.php?script_id=2771
+" For 'Lokaltog/vim-easymotion' script
+let g:EasyMotion_leader_key = '<Leader>m'
+
+" For 'scrooloose/nerdcommenter' script
+let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
+map <leader>n :NERDTreeToggle<CR>
+
+" For 'ZoomWin' script
+map <Leader><Leader> :ZoomWin<CR>
+
+" For 'mileszs/ack.vim' script
+nmap <leader>a <Esc>:Ack!
+
+" For 'Conque-Shell' script
map <Leader>e :<C-u>call conque_term#send_selected(visualmode())<CR><CR>
command Shell :set nolist | ConqueTermSplit bash
command PythonShell :set nolist | ConqueTermSplit python
command RailsShell :set nolist | ConqueTermSplit rails console
+"command FlaskShell :set nolist | ConqueTermSplit env DEV=yes python -i play.py
" XML, HTML
function TagExpander()
@@ -322,10 +389,17 @@ autocmd FileType php call TagExpander()
autocmd FileType htmljinja call TagExpander()
" Ruby
+autocmd BufRead,BufNewFile {Gemfile,Rakefile,config.ru} set ft=ruby
autocmd FileType ruby set tabstop=2 shiftwidth=2
+" Go ( http://www.go-lang.org )
+autocmd BufRead,BufNewFile *.go set ft=go
+
+" YAML
+autocmd FileType yaml set tabstop=2 shiftwidth=2
+
" JSON
-autocmd BufRead,BufNewFile *.json setfiletype json
+autocmd BufRead,BufNewFile *.json set ft=json foldmethod=syntax
" Jinja files
autocmd BufRead,BufNewFile */flask_application/templates/*.html set ft=htmljinja
@@ -337,6 +411,10 @@ let g:is_bash = 1
nmap <F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
imap <F3> <C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR>
+" Default color scheme
+" On Mac OS X, best used with iTerm2 and the solarized color scheme for iTerm2
+colorscheme solarized
+
" Local config
let vimrc_local = expand("~/.vimrc.local", ":p")
if filereadable(vimrc_local)
Please sign in to comment.
Something went wrong with that request. Please try again.