Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Rewritten using vundle

  • Loading branch information...
commit 145a696306b01c49de5b78e20d93d861db1f536f 1 parent 8a05324
Swaroop C H authored July 27, 2011
2  LICENSE.txt
... ...
@@ -1,4 +1,4 @@
1  
-Copyright 2010 Swaroop C H
  1
+Copyright 2010-2011 Swaroop C H
2 2
 
3 3
 Licensed under the Apache License, Version 2.0 (the "License");
4 4
 you may not use this file except in compliance with the License.
28  README.md
Source Rendered
... ...
@@ -1,28 +0,0 @@
1  
-
2  
-# My Vim setup
3  
-
4  
-# Installation
5  
-
6  
-    if [[ "$OSTYPE" =~ "linux" ]] # Assumes Ubuntu
7  
-    then
8  
-        sudo apt-get install git curl subversion
9  
-    elif [[ "$OSTYPE" =~ "darwin" ]]
10  
-    then
11  
-        brew install git curl subversion
12  
-    else
13  
-        echo "Don't know how to install packages on $OSTYPE operating system"
14  
-        exit 1
15  
-    fi
16  
-
17  
-    mkdir -p "$HOME/code/"
18  
-    cd "$HOME/code/"
19  
-
20  
-    git clone git://github.com/swaroopch/dotvim.git
21  
-    cd dotvim
22  
-    git submodule update --init
23  
-
24  
-    bash install.bash
25  
-
26  
-    vim # Follow the instructions to download the Vim plugins
27  
-
28  
-    bash post_install.bash
8  README.textile
Source Rendered
... ...
@@ -0,0 +1,8 @@
  1
+h1. My Vim setup
  2
+
  3
+h2. Installation
  4
+
  5
+# Install "git":http://git-scm.com and "curl":http://curl.haxx.se
  6
+# @git clone git://github.com/swaroopch/dotvim.git@
  7
+# @cd dotvim@
  8
+# @bash install.sh@
3  gvimrc
... ...
@@ -1,5 +1,5 @@
1 1
 " Theme
2  
-colorscheme koehler
  2
+colorscheme solarized
3 3
 
4 4
 " Logical size of GVim window
5 5
 set lines=35 columns=99
@@ -12,7 +12,6 @@ set guioptions-=T
12 12
 if has('mac')
13 13
     set guifont=Monaco:h13
14 14
 elseif has('unix')
15  
-    "let &guifont="Monospace 10"
16 15
     let &guifont="DejaVu Sans Mono 10"
17 16
 endif
18 17
 
2  htmljinja/htmldjango.vim
... ...
@@ -1,2 +0,0 @@
1  
-set ft=htmljinja
2  
-call TagExpander()
27  htmljinja/htmljinja.vim
... ...
@@ -1,27 +0,0 @@
1  
-" Vim syntax file
2  
-" Language:	Jinja HTML template
3  
-" Maintainer:	Armin Ronacher <armin.ronacher@active-4.com>
4  
-" Last Change:	2007 Apr 8
5  
-
6  
-" For version 5.x: Clear all syntax items
7  
-" For version 6.x: Quit when a syntax file was already loaded
8  
-if version < 600
9  
-  syntax clear
10  
-elseif exists("b:current_syntax")
11  
-  finish
12  
-endif
13  
-
14  
-if !exists("main_syntax")
15  
-  let main_syntax = 'html'
16  
-endif
17  
-
18  
-if version < 600
19  
-  so <sfile>:p:h/jinja.vim
20  
-  so <sfile>:p:h/html.vim
21  
-else
22  
-  runtime! syntax/jinja.vim
23  
-  runtime! syntax/html.vim
24  
-  unlet b:current_syntax
25  
-endif
26  
-
27  
-let b:current_syntax = "htmljinja"
51  install.bash
... ...
@@ -1,51 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-## Check Bash Version
4  
-
5  
-if [ "$BASH_VERSION" = "" ]
6  
-then
7  
-    echo "I work only with Bash"
8  
-    exit 1
9  
-fi
10  
-
11  
-## Check Git is installed
12  
-if [[ $(which git) == "" ]]
13  
-then
14  
-    echo "Please ensure that git is installed"
15  
-    exit 1
16  
-fi
17  
-
18  
-## Check OS
19  
-
20  
-if [[ "$OSTYPE" == "darwin10.0" ]]
21  
-then
22  
-    export OS="mac"
23  
-    if [[ $(which brew) == "" ]]
24  
-    then
25  
-        echo "Please install brew ( http://mxcl.github.com/homebrew ) before proceeding."
26  
-        exit 1
27  
-    fi
28  
-elif [[ "$OSTYPE" == "linux-gnu" ]]
29  
-then
30  
-    export OS="linux"
31  
-else
32  
-    echo "Don't know what to do with '$OSTYPE' operating system"
33  
-    exit 1
34  
-fi
35  
-
36  
-# Assumption of directory location
37  
-DOTVIM="$HOME/code/dotvim"
38  
-cd $DOTVIM
39  
-
40  
-## Install vim files
41  
-
42  
-echo "Installing vimrc"
43  
-ln -s -f "$DOTVIM/vimrc" "$HOME/.vimrc"
44  
-ln -s -f "$DOTVIM/gvimrc" "$HOME/.gvimrc"
45  
-
46  
-# Put swap files in a specific location, to avoid Dropbox from spinning incessantly.
47  
-mkdir -p "$HOME/.vim/swapfiles/"
48  
-
49  
-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."
50  
-
51  
-unset OS
40  install.sh
... ...
@@ -0,0 +1,40 @@
  1
+#!/usr/bin/env bash
  2
+
  3
+# Git and Curl required
  4
+if [[ $(which git) == "" ]]
  5
+then
  6
+    echo "Install git ( http://git-scm.com ) first"
  7
+    exit 1
  8
+fi
  9
+if [[ $(which curl) == "" ]]
  10
+then
  11
+    echo "Install curl ( http://curl.haxx.se ) first"
  12
+    exit 1
  13
+fi
  14
+
  15
+# Download Vundle
  16
+mkdir -p ~/.vim/bundle
  17
+if [[ ! -d ~/.vim/bundle/vundle ]]
  18
+then
  19
+    git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
  20
+fi
  21
+
  22
+# Download upstart.vim
  23
+mkdir -p ~/.vim/syntax/
  24
+curl http://bazaar.launchpad.net/~upstart-devel/upstart/trunk/download/head:/upstart.vim-20090708195914-1n7k3bcwobwm4ag7-7/upstart.vim -o ~/.vim/syntax/upstart.vim
  25
+
  26
+# vimrc, gvimrc
  27
+ln -s -f $PWD/vimrc ~/.vimrc
  28
+ln -s -f $PWD/gvimrc ~/.gvimrc
  29
+
  30
+vim -c "BundleInstall" -c "quit"
  31
+
  32
+# Command-T post-download installation
  33
+if [[ -d ~/.vim/bundle/command-t ]]
  34
+then
  35
+    cd ~/.vim/bundle/command-t
  36
+    rake make
  37
+    cd -
  38
+fi
  39
+
  40
+echo "Finished"
72  post_install.bash
... ...
@@ -1,72 +0,0 @@
1  
-#!/usr/bin/env bash
2  
-
3  
-## Check OS
4  
-
5  
-if [[ "$OSTYPE" == "darwin10.0" ]]
6  
-then
7  
-    export OS="mac"
8  
-    if [[ $(which brew) == "" ]]
9  
-    then
10  
-        echo "Please install brew ( http://mxcl.github.com/homebrew ) before proceeding."
11  
-        exit 1
12  
-    fi
13  
-elif [[ "$OSTYPE" == "linux-gnu" ]]
14  
-then
15  
-    export OS="linux"
16  
-else
17  
-    echo "Don't know what to do with '$OSTYPE' operating system"
18  
-    exit 1
19  
-fi
20  
-
21  
-# Assumption of directory location
22  
-DOTVIM="$HOME/code/dotvim"
23  
-
24  
-## Post Installation
25  
-
26  
-if [[ -d "$DOTVIM/snipMate" ]]
27  
-then
28  
-    # FIXME Ugly but don't know how else to include custom snippets
29  
-    cat "$DOTVIM/snippets_more/eruby.snippets" >> "$DOTVIM/snipMate/snippets/eruby.snippets"
30  
-    cat "$DOTVIM/snippets_more/ruby.snippets" >> "$DOTVIM/snipMate/snippets/ruby.snippets"
31  
-    cat "$DOTVIM/snippets_more/python.snippets" >> "$DOTVIM/snipMate/snippets/python.snippets"
32  
-    cat "$DOTVIM/snippets_more/htmljinja.snippets" >> "$DOTVIM/snipMate/snippets/htmljinja.snippets"
33  
-fi
34  
-
35  
-## Install dependencies
36  
-
37  
-# ack
38  
-if [[ "$OS" == "linux" ]]
39  
-then
40  
-    if [[ -z $(dpkg -l | fgrep -i ack-grep) ]]
41  
-    then
42  
-        sudo apt-get install ack-grep
43  
-    fi
44  
-    sudo ln -s -f /usr/bin/ack-grep /usr/bin/ack
45  
-elif [[ "$OS" == "mac" ]]
46  
-then
47  
-    brew install ack
48  
-fi
49  
-
50  
-# command-t
51  
-cd $DOTVIM/Command-T/ruby/command-t
52  
-ruby extconf.rb
53  
-make
54  
-
55  
-## Custom files
56  
-
57  
-# HACK for htmljinja
58  
-mkdir -p "$HOME/.vim/syntax/"
59  
-ln -s -i "$DOTVIM/htmljinja/htmljinja.vim" "$HOME/.vim/syntax/htmljinja.vim"
60  
-mkdir -p "$HOME/.vim/ftplugin/"
61  
-ln -s -i "$DOTVIM/htmljinja/htmldjango.vim" "$HOME/.vim/ftplugin/htmldjango.vim"
62  
-
63  
-## Cleanup
64  
-
65  
-if [[ "$OS" == "mac" ]]
66  
-then
67  
-    brew cleanup
68  
-fi
69  
-
70  
-unset OS
71  
-
72  
-echo "Finished. Open Vim now!"
4  snippets_more/eruby.snippets
... ...
@@ -1,4 +0,0 @@
1  
-snippet %
2  
-	<% ${1} %>
3  
-snippet %%
4  
-	<%= ${1} %>
20  snippets_more/htmljinja.snippets
... ...
@@ -1,20 +0,0 @@
1  
-snippet %
2  
-	{% ${1} %}
3  
-snippet {
4  
-	{{ ${1} }}
5  
-snippet #
6  
-	{# ${1} #}
7  
-snippet block
8  
-	{% block ${1:name} %}
9  
-
10  
-	${2}
11  
-
12  
-	{% endblock $1 %}
13  
-snippet if
14  
-	{% if ${1} %}
15  
-		${2}
16  
-	{% endif %}
17  
-snippet for
18  
-	{% for ${1} in ${2} %}
19  
-		${3}
20  
-	{% endfor %}
3  snippets_more/python.snippets
... ...
@@ -1,3 +0,0 @@
1  
-snippet echo
2  
-	from pprint import pformat #DEBUG
3  
-	app.logger.debug("|ZZZ| ${1:variable_name} => \n----\n%s\n----", pformat($1)) #DEBUG
3  snippets_more/ruby.snippets
... ...
@@ -1,3 +0,0 @@
1  
-snippet echo
2  
-	puts "0xDEADBEEF" * 20 #DEBUG
3  
-	puts "${1:variable_name}=|#{$1.inspect}|" #DEBUG
1  vim-addon-manager
... ...
@@ -1 +0,0 @@
1  
-Subproject commit bf54de4e064eae34653e720524253290d81b6b47
116  vimrc
@@ -4,18 +4,54 @@
4 4
 "" Vim, not Vi.
5 5
 " This must be first, because it changes other options as a side effect.
6 6
 set nocompatible
7  
-
8  
-"" Vim Addon Manager
9  
-
10  
-function ActivateAddons()
11  
-  set runtimepath+=~/code/dotvim/vim-addon-manager
12  
-  try
13  
-    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'])
14  
-  catch /.*/
15  
-    echoerr v:exception
16  
-  endtry
17  
-endfunction
18  
-call ActivateAddons()
  7
+" required! by vundle
  8
+filetype off
  9
+
  10
+"" Vundle
  11
+"" See :help vundle for more details
  12
+set runtimepath+=~/.vim/bundle/vundle/
  13
+call vundle#rc()
  14
+
  15
+" let Vundle manage Vundle
  16
+" required! by vundle
  17
+Bundle 'gmarik/vundle'
  18
+
  19
+" Git Repos by http://vim-scripts.org ( get names from https://github.com/vim-scripts/following )
  20
+Bundle 'Conque-Shell'
  21
+Bundle 'JSON.vim'
  22
+Bundle 'Jinja'
  23
+Bundle 'Textile-for-VIM'
  24
+Bundle 'django.vim'
  25
+Bundle 'go.vim'
  26
+Bundle 'nginx.vim'
  27
+Bundle 'python.vim--Vasiliev'
  28
+Bundle 'ZoomWin'
  29
+
  30
+" Git Repos on GitHub
  31
+" Inspired from http://sontek.net/turning-vim-into-a-modern-python-ide
  32
+Bundle 'Lokaltog/vim-easymotion'
  33
+Bundle 'alfredodeza/pytest.vim'
  34
+Bundle 'altercation/vim-colors-solarized'
  35
+Bundle 'carlosvillu/coffeScript-VIM-Snippets'
  36
+Bundle 'ervandew/supertab'
  37
+Bundle 'fs111/pydoc.vim'
  38
+Bundle 'godlygeek/tabular'
  39
+Bundle 'kchmck/vim-coffee-script'
  40
+Bundle 'mattn/zencoding-vim'
  41
+Bundle 'mileszs/ack.vim'
  42
+Bundle 'mitechie/pyflakes-pathogen'
  43
+Bundle 'msanders/snipmate.vim'
  44
+Bundle 'scrooloose/nerdcommenter'
  45
+Bundle 'scrooloose/nerdtree'
  46
+Bundle 'sjl/gundo.vim'
  47
+Bundle 'sontek/rope-vim'
  48
+Bundle 'sukima/xmledit'
  49
+Bundle 'tpope/vim-fugitive'
  50
+Bundle 'tpope/vim-rails'
  51
+Bundle 'tpope/vim-surround'
  52
+
  53
+" Git Repos not on GitHub
  54
+Bundle 'git://git.wincent.com/command-t.git'
19 55
 
20 56
 "" General Settings
21 57
 
@@ -27,6 +63,7 @@ set fileformat=unix
27 63
 au BufNewFile * set fileformat=unix
28 64
 
29 65
 " Automatically indent when adding a curly bracket, etc.
  66
+" required! by vundle
30 67
 filetype plugin indent on
31 68
 set autoindent
32 69
 set smartindent
@@ -36,9 +73,7 @@ set shiftwidth=4
36 73
 set tabstop=4
37 74
 set expandtab
38 75
 set smarttab
39  
-
40  
-" Put swap files in a specific location, to avoid Dropbox from spinning incessantly.
41  
-set directory=~/.vim/swapfiles/
  76
+set backspace=indent,eol,start
42 77
 
43 78
 " Disable the F1 help key
44 79
 map <F1> <Esc>
@@ -80,6 +115,7 @@ set statusline=
80 115
 set statusline+=%-3.3n\                         " buffer number
81 116
 set statusline+=%f\                             " filename
82 117
 set statusline+=%h%m%r%w                        " status flags
  118
+set statusline+=%{fugitive#statusline()}        " git status
83 119
 set statusline+=\[%{strlen(&ft)?&ft:'none'}]    " file type
84 120
 set statusline+=%=                              " right align remainder
85 121
 set statusline+=0x%-8B                          " character value
@@ -272,6 +308,18 @@ EOF
272 308
     command O call Open()
273 309
     map <Leader>o :call Open()<CR>
274 310
 
  311
+" Add the virtualenv's site-packages to vim path
  312
+python << EOF
  313
+import os.path
  314
+import sys
  315
+import vim
  316
+if 'VIRTUAL_ENV' in os.environ:
  317
+    project_base_dir = os.environ['VIRTUAL_ENV']
  318
+    sys.path.insert(0, project_base_dir)
  319
+    activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
  320
+    execfile(activate_this, dict(__file__=activate_this))
  321
+EOF
  322
+
275 323
 endif " python
276 324
 
277 325
 " Remove the Windows ^M (copied from http://amix.dk/vim/vimrc.html)
@@ -295,17 +343,36 @@ nnoremap ' `
295 343
 nnoremap ` '
296 344
 
297 345
 " matchit
298  
-runtime macros/matchit.vim
  346
+runtime! macros/matchit.vim
299 347
 
300 348
 " Python
301 349
 let python_highlight_all=1
  350
+" For 'supertab' script
  351
+autocmd FileType python set omnifunc=pythoncomplete#Complete
  352
+let g:SuperTabDefaultCompletionType = "context"
  353
+set completeopt=menuone,longest,preview
  354
+
  355
+"" Script-specific configurations
302 356
 
303  
-" Conque Shell
304  
-" http://www.vim.org/scripts/script.php?script_id=2771
  357
+" For 'Lokaltog/vim-easymotion' script
  358
+let g:EasyMotion_leader_key = '<Leader>m'
  359
+
  360
+" For 'scrooloose/nerdcommenter' script
  361
+let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
  362
+map <leader>n :NERDTreeToggle<CR>
  363
+
  364
+" For 'ZoomWin' script
  365
+map <Leader><Leader> :ZoomWin<CR>
  366
+
  367
+" For 'mileszs/ack.vim' script
  368
+nmap <leader>a <Esc>:Ack!
  369
+
  370
+" For 'Conque-Shell' script
305 371
 map <Leader>e :<C-u>call conque_term#send_selected(visualmode())<CR><CR>
306 372
 command Shell :set nolist | ConqueTermSplit bash
307 373
 command PythonShell :set nolist | ConqueTermSplit python
308 374
 command RailsShell :set nolist | ConqueTermSplit rails console
  375
+"command FlaskShell :set nolist | ConqueTermSplit env DEV=yes python -i play.py
309 376
 
310 377
 " XML, HTML
311 378
 function TagExpander()
@@ -322,10 +389,17 @@ autocmd FileType php   call TagExpander()
322 389
 autocmd FileType htmljinja call TagExpander()
323 390
 
324 391
 " Ruby
  392
+autocmd BufRead,BufNewFile {Gemfile,Rakefile,config.ru} set ft=ruby
325 393
 autocmd FileType ruby set tabstop=2 shiftwidth=2
326 394
 
  395
+" Go ( http://www.go-lang.org )
  396
+autocmd BufRead,BufNewFile *.go set ft=go
  397
+
  398
+" YAML
  399
+autocmd FileType yaml set tabstop=2 shiftwidth=2
  400
+
327 401
 " JSON
328  
-autocmd BufRead,BufNewFile *.json setfiletype json
  402
+autocmd BufRead,BufNewFile *.json set ft=json foldmethod=syntax
329 403
 
330 404
 " Jinja files
331 405
 autocmd BufRead,BufNewFile */flask_application/templates/*.html set ft=htmljinja
@@ -337,6 +411,10 @@ let g:is_bash = 1
337 411
 nmap <F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
338 412
 imap <F3> <C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR>
339 413
 
  414
+" Default color scheme
  415
+" On Mac OS X, best used with iTerm2 and the solarized color scheme for iTerm2
  416
+colorscheme solarized
  417
+
340 418
 " Local config
341 419
 let vimrc_local = expand("~/.vimrc.local", ":p")
342 420
 if filereadable(vimrc_local)

0 notes on commit 145a696

Please sign in to comment.
Something went wrong with that request. Please try again.