Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

update README, submodules and move vimrc into repo

  • Loading branch information...
commit aaa7c755822e5ed425a6d8fa09b7bf3e1c6080f3 1 parent ec422e7
Sean Escriva authored
23 README
... ... @@ -0,0 +1,23 @@
  1 +Portable VIM config.
  2 +
  3 +Dependencies and setup steps, post git clone.
  4 +
  5 +ack-grep:
  6 +
  7 + apt-get install ack-grep
  8 +
  9 +pep8:
  10 +
  11 + easy_install pep8
  12 +
  13 +command-t:
  14 +
  15 + cd ~/.vim/bundle/command-t; rake make
  16 +
  17 +test integration for django-nose req:
  18 +
  19 + easy_install nose
  20 +
  21 +vimrc also tracked, to use:
  22 +
  23 + ln -s ~/.vim/vimrc ~/.vimrc
2  bundle/fugitive
... ... @@ -1 +1 @@
1   -Subproject commit 216c85afe0a3d3b57dc717c098334fd59afeb13e
  1 +Subproject commit c872a546751f1723766479528391cdada4aeb1ec
2  bundle/gundo
... ... @@ -1 +1 @@
1   -Subproject commit e7a1ecf24430808b6b92915d3c2e2bb84a429333
  1 +Subproject commit 584f1d52f827ed26bba774a1f77080f104af9894
2  bundle/solarized
... ... @@ -1 +1 @@
1   -Subproject commit 7a7e5c8818d717084730133ed6b84a3ffc9d0447
  1 +Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21
224 vimrc
... ... @@ -0,0 +1,224 @@
  1 +" New .vimrc: Very python dev specific setup, with minor additions for dealing
  2 +" with other workflow
  3 +"
  4 +" needed to setup pathogen
  5 +filetype off
  6 +call pathogen#runtime_append_all_bundles()
  7 +call pathogen#helptags()
  8 +
  9 +" code folding
  10 +set foldmethod=indent
  11 +set foldlevel=99
  12 +
  13 +"movement with edit more
  14 +map <c-j> <c-w>j
  15 +map <c-k> <c-w>k
  16 +map <c-l> <c-w>l
  17 +map <c-h> <c-w>h
  18 +
  19 +nmap Y y$
  20 +map ,ws :%s/\s$//<cr>
  21 +
  22 +if has("unix")
  23 + cmap %/ <C-R>=expand("%:p:h") . '/'<CR>
  24 +else
  25 + cmap %/ <C-R>=expand("%:p:h") . '\'<CR>
  26 +endif
  27 +
  28 +" Task list
  29 +map <leader>td <Plug>TaskList
  30 +" graphical undo, revision history
  31 +map <leader>g :GundoToggle<CR>
  32 +
  33 +" syntax and code indenting
  34 +syntax on
  35 +filetype on
  36 +filetype plugin indent on
  37 +colors solarized
  38 +set background=dark
  39 +
  40 +" don't let pyflakes use quickfix window
  41 +let g:pyflakes_use_quickfix = 0
  42 +" pep8 plugin to keep code more consistent
  43 +let g:pep8_map='<leader>8'
  44 +
  45 +
  46 +au FileType python set omnifunc=pythoncomplete#Complete
  47 +let g:SuperTabDefaultCompletionType = "context"
  48 +set completeopt=menuone,longest,preview
  49 +
  50 +" NERDTree file browser
  51 +map <leader>n :NERDTreeToggle<CR>
  52 +" also fuzzy text file search with command-t
  53 +" bound to <leader>t by default
  54 +
  55 +" minibufexpl settings
  56 +let g:miniBufExplMaxSize = 1
  57 +
  58 +" refactoring with Rope
  59 +map <leader>j :RopeGoToDefinition<CR>
  60 +map <leader>r :RopeRename<CR>
  61 +
  62 +" Searching with Ack plugin
  63 +nmap <Leader>a <Esc>:Ack!
  64 +let g:ackprg='ack-grep -H --nocolor nogroup --column'
  65 +
  66 +" Git integration via fugitive
  67 +" add %{fugitive#statusline()} to statusline
  68 +
  69 +" Test integration, depending on testing library
  70 +" for django-nose:
  71 +map <leader>dt : set makeprg python\ manage.py\ test\|:call MakeGreen()<CR>
  72 +
  73 +" py.test
  74 +" Execute tests
  75 +nmap <silent><leader>tf <Esc>:Pytest file<CR>
  76 +nmap <silent><leader>tc <Esc>:Pytest class<CR>
  77 +nmap <silent><leader>tm <Esc>:Pytest method<CR>
  78 +" cycle through test errors
  79 +nmap <silent><leader>tn <Esc>:Pytest next<CR>
  80 +nmap <silent><leader>tp <Esc>:Pytest previous<CR>
  81 +nmap <silent><leader>te <Esc>:Pytest error<CR>
  82 +
  83 +" virtualenv
  84 +" add virtualenv site-pacages to vim path so code completion works
  85 +"py << EOF
  86 +"import os.path
  87 +"import sys
  88 +"import vim
  89 +"
  90 +"if os.environ['VIRTUAL_ENV']:
  91 +" project_base_dir = os.environ['VIRTUAL_ENV']
  92 +" sys.path.insert(0, project_base_dir)
  93 +" activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
  94 +" execfile(activate_this, dict(__file__=activate_this))
  95 +"EOF
  96 +
  97 +"Django tip:
  98 +" add 'export DJANGO_SETTINGS_MODULE=project.settings' to env. to get code completion for django modules
  99 +
  100 +" Now customize the details. Most of this is taken from my old vimrc
  101 +set number
  102 +set autoindent
  103 +set autowrite
  104 +set backspace=2
  105 +" create ~/tmp/ if it doesn't exist and use ~/tmp to save the
  106 +" backups into. keeps your directories cleaner
  107 +if has("unix")
  108 + if !isdirectory(expand("~/tmp/."))
  109 + !mkdir -p ~/tmp/
  110 + endif
  111 +endif
  112 +set backup " make a backup and save it ~/tmp
  113 +set backupdir=~/tmp
  114 +set comments=b:#,:%,fb:-,n:>,n:) " comments default: sr:/*,mb:*,el:*/,://,b:#,:%,:XCOMM,n:>,fb:-
  115 +set cpo=aABceFsJWy " cpoptions
  116 +"set digraph " required if you need diacritics or use <C-k>
  117 +set display=lastline
  118 +set nocompatible " notcompatible with vi, gives us lots more functionality
  119 +set noerrorbells " be quiet
  120 +set esckeys " allow ESC-sequenzes in 'insert-mode'
  121 +set formatoptions=cqrt2 " Options for text format
  122 +set helpheight=20 " the mindestheight for ':help'
  123 +set hidden " dont close changed window
  124 +set ch=2 " Disable the 'Press RETURN...' - Messages
  125 +set history=500 " make the history longer
  126 +set hlsearch " highlighting for the 'hlsearch' option.
  127 +set noicon " :help noicon
  128 +set noignorecase " ignore case-sensitive while search also allow no-case-sensitive-search
  129 +set incsearch " dont highlight searchresults
  130 +set iskeyword=@,48-57,_,192-255,-,.,@-@ " enable the search for @, ., _ and -
  131 +set nojoinspaces " Insert two spaces after a '.', '?' and '!' with a join command.
  132 +set laststatus=2 " show statusline
  133 +set lazyredraw " no screenupdate during macro
  134 +set linebreak " wrap at 'breakat' no last char
  135 +
  136 +set magic
  137 +set matchpairs=(:),[:],{:},<:> " Optional
  138 +set modeline " enable modeline
  139 +set modelines=10 " double the default
  140 +set pastetoggle=<F12> " exit paste-mode (<F6>)
  141 +set report=0 " always report changes
  142 +set shiftwidth=4 " four spaces are one TAB
  143 +
  144 +" ignore these suffixes while ':edit'
  145 +set suffixes=.aux,.bak,.dvi,.gz,.idx,.log,.ps,.swp,.tar,.tgz,.tar,.zip
  146 +set shortmess=atIT " terse msgs + truncate filename + no :intro + truncate messages
  147 +set showbreak=+ " String to put at the start of lines that have been wrapped
  148 +set showcmd " Show (partial) command in status line
  149 +set showmatch " briefly jump to matching bracket
  150 +set matchtime=3 " highlight match for .3s
  151 +set showmode " display current mode
  152 +set smartcase " overrides 'ignorecase' when searching uppercase chars
  153 +set smarttab " <Tab> inserts 'shiftwidth' at beginning of line
  154 +set spellcapcheck= " don't check for caps
  155 +set splitbelow " :split opens window below current viewport
  156 +set softtabstop=4 " number of space <Tab> counts for, usually 4 or 8
  157 +set tabstop=4 " sensible default
  158 +set expandtab " spaces only thank you.
  159 +set nostartofline " controls moving cursor to first blank of the line
  160 +set switchbuf=useopen " behavior when switching between buffers
  161 +set textwidth=78 " where to break the line, 0 to disable
  162 +
  163 +"set notitle " don't set window title to 'titlestring'
  164 +set wildchar=<TAB> " type to start wildcard expansion in the command-line
  165 +set wildignore+=.log,.out,.o " ignore when doing tab completion
  166 +set novisualbell " visual bell instead of beeping.. or nothing ;)
  167 +
  168 +" tty - Stuff
  169 +set ttyfast
  170 +set ttybuiltin
  171 +set ttyscroll=999
  172 +set t_vb=
  173 +
  174 +set wildmenu " cmd-line completion operates in an enhanced mode
  175 +set wildmode=longest,list
  176 +set whichwrap=<,>,h,l " keys that move the cursor left/right to wrap
  177 +set winheight=5 " :help winheight
  178 +set nowritebackup " no backup before overwriting file, thats for weenies ;)
  179 +set nowrap " changes how text is displayed
  180 +
  181 +"GUI settings
  182 +set guifont=Inconsolata\ Medium\ 10
  183 +set go=Acgtm
  184 +
  185 +" Fxx Keys {{{
  186 +" user defined functions below
  187 +
  188 +map <F2> :call ToggleSpell()<CR>
  189 +imap <F2> <C-O>:call ToggleSpell()<CR>
  190 +
  191 +" <F3> saves current buffer
  192 +nmap <F3> :w<CR>
  193 +imap <F3> <C-O>:w<CR>
  194 +
  195 +" quick toggle highlight search (folke)
  196 +noremap <F4> :if 1 == &hls \| noh \| else \| set hls \| endif \| <CR>
  197 +
  198 +"nmap <F5> :make<CR>
  199 +"imap <F5> <C-O>:make<CR>
  200 +
  201 +" TODO setup TagList as pathogen bundle
  202 +"let Tlist_Exit_OnlyWindow=1
  203 +"let Tlist_Compact_Format=1
  204 +"let Tlist_Enable_Fold_Column=0
  205 +"nmap <F6> :TlistToggle<CR>
  206 +"imap <F6> :TlistToggle<CR>
  207 +
  208 +" Normal <F7> - <F12> are assigned to VimDebug plugin
  209 +"}}}
  210 +
  211 +" fast paragraph formatting
  212 +nnoremap Q gwap
  213 +nnoremap <C-q> gqap
  214 +" Remove single trailing whitespace
  215 +map ,ws :%s/\s$//<cr>
  216 +
  217 +" TITLESTRING {{{
  218 +set title titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~.:h\")})%)%(\ %a%)
  219 +" }}}
  220 +
  221 +" STATUSLINE {{{
  222 +" See >:h statusline< for more details
  223 +set statusline=%<[%n]\ %F\ \ Filetype=\%Y\ \ %r\ %1*%m%*%w%=%(Line:\ %l%)%4(%)Column:\ %5(%c%V/%{strlen(getline(line('.')))}%)\ %4(%)%p%%
  224 +"}}}

0 comments on commit aaa7c75

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