Permalink
Browse files

some vimrc clean up

  • Loading branch information...
1 parent df846fc commit ad4729a2254c0e65f04a7e619a511c361287fcaa @netoxico committed Apr 25, 2012
Showing with 88 additions and 98 deletions.
  1. +88 −98 vim/vimrc
View
186 vim/vimrc
@@ -2,31 +2,25 @@
"Author: Ernesto Vargas
"Source: https://github.com/netoxico/dotfiles/vim
+" Pathogen----------------------------------------------------------------- {{{
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype on
filetype plugin indent on
+" }}}
+" Basic options ----------------------------------------------------------- {{{
+set background=light
+colorscheme solarized
-set nocompatible
-set number
-
-syntax on
-
-set background=dark
-colorscheme molokai
+let mapleader = ","
+inoremap jj <ESC>
-" Basic options ----------------------------------------------------------- {{{
if has("gui_running")
set colorcolumn=+1
set guioptions-=m
set guioptions-=T
- "set guifont=Menlo:h13"
set guifont=Menlo\ Regular\ for\ Powerline:h12
- " Different cursors for different modes.
- set guicursor=n-c:block-Cursor-blinkon0
- set guicursor+=v:block-vCursor-blinkon0
- set guicursor+=i-ci:ver20-iCursor
highlight SpellBad term=underline gui=undercurl guisp=Orange
if !exists("g:vimrcloaded")
winpos 0 0
@@ -38,11 +32,10 @@ if has("gui_running")
let g:vimrcloaded = 1
endif
endif
-:nohls
-
-let mapleader = ","
-inoremap jj <ESC>
+:nohls
+syntax on
+set number
set encoding=utf-8
set modelines=0
set hidden
@@ -74,68 +67,36 @@ set formatoptions=qrn1
set timeoutlen=500
set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)
-
-"Full Screen"
-inoremap <F8> <ESC>:set invfullscreen<CR>a
-nnoremap <F8> :set invfullscreen<CR>
-vnoremap <F8> :set invfullscreen<CR>
" }}}
+" Folding settings ---------------------------------------------------------{{{
+set foldcolumn=0
+set foldenable
+set foldlevel=0
+set foldmethod=marker
+set foldtext=FoldText()
+set foldlevelstart=0
-"Fold Html Tag"
-au BufNewFile,BufRead *.html map <leader>ft Vatzf
-
-"Code completion
-imap ,<tab> <C-x><C-o>
-
-"set wildmenu
-"set completeopt=longest,menuone,preview
-"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
-"inoremap <expr> <C-p> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>up>" : ""<CR>'
-"inoremap <expr> <C-n> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
-
-let g:netrw_list_hide= '.*\.pyc$,^\.git/$,\.project$,\.pydevproject$,^\.settings/$,^\.svn/$,\.swp$'
-
-"Tagbar
-nmap <F6> :TagbarToggle<CR>
-
-"Powerline for vim
-set nocompatible " Disable vi-compatibility
-set laststatus=2 " Always show the statusline
-
-"PeepOpen map
-map <leader><leader> <Plug>PeepOpen
-
-:command! SortCSSBraceContents :g#\({\n\)\@<=#.,/}/sort
-
-"Edit vimrc file in a new tab
-nnoremap <F4> :tabedit $MYVIMRC<CR>
-
-"Dropbox NOTES
-nnoremap <F2> :tabedit ~/Dropbox/NOTES.txt<CR>
-
-"BufExplorer
-nnoremap <F3> :BufExplorer<CR>
-"Pep8
-let g:pep8_map=',8'
-
-"Load the current buffer in Firefox - Mac specific.
-abbrev ff :! open -a firefox.app %:p<cr>
-
-"Load the current buffer in Google Chrome
-abbrev gc :! open -a "Google Chrome" %:p<cr>
+nnoremap <Space> za
+vnoremap <Space> za
+nnoremap zO zCzO
-"sort css brace content
-:nmap <F7> :g#\({\n\)\@<=#.,/}/sort<CR>
+function! MyFoldText()
+ let line = getline(v:foldstart)
-"Edit snippet files
-nnoremap <F5> :tabedit ~/.vim/snippets/<CR>
+ let nucolwidth = &fdc + &number * &numberwidth
+ let windowwidth = winwidth(0) - nucolwidth - 3
+ let foldedlinecount = v:foldend - v:foldstart
-"Source the vimrc file after saving it. This way, you don't have to reload
-"Vim to see the changes.
-if has("autocmd")
- autocmd bufwritepost .vimrc source $MYVIMRC
-endif
+ " expand tabs into spaces
+ let onetab = strpart(' ', 0, &tabstop)
+ let line = substitute(line, '\t', onetab, 'g')
+ let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
+ let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
+ return line . '' . repeat(" ",fillcharcount) . foldedlinecount . '' . ' '
+endfunction
+set foldtext=MyFoldText()
+" }}}
" Django -------------------------------------------------------------------{{{
au BufNewFile,BufRead *.html setlocal filetype=htmldjango
@@ -152,37 +113,66 @@ au BufNewFile,BufRead forms.py setlocal filetype=python.django
au BufNewFile,BufRead urls.py setlocal nowrap
au BufNewFile,BufRead settings.py normal! zR
au BufNewFile,BufRead dashboard.py normal! zR
-" }}}
-"NERD Tree Settings
+" }}}
+" Powerline for vim --------------------------------------------------------{{{
+set nocompatible
+set laststatus=2
+" }}}
+" PeepOpen map -------------------------------------------------------------{{{
+map <leader><leader> <Plug>PeepOpen
+" }}}
+" NERD Tree Settings -------------------------------------------------------{{{
nnoremap <F1> <esc>:NERDTreeToggle<CR>
let NERDTreeIgnore=['.vim$', '\~$', '.*\.pyc$', 'pip-log\.txt$', 'whoosh_index', 'xapian_index', '.*.pid', 'monitor.py', '.*-fixtures-.*.json', '.*\.o']
+" }}}
+" F Maps -------------------------------------------------------------------{{{
+"Dropbox NOTES
+nnoremap <F2> :tabedit ~/Dropbox/NOTES.txt<CR>
+"BufExplorer
+nnoremap <F3> :BufExplorer<CR>
+"Edit vimrc file in a new tab
+nnoremap <F4> :tabedit $MYVIMRC<CR>
+"Edit snippet files
+nnoremap <F5> :tabedit ~/.vim/snippets/<CR>
+"Tagbar
+nmap <F6> :TagbarToggle<CR>
+"sort css brace content
+:nmap <F7> :g#\({\n\)\@<=#.,/}/sort<CR>
+"Full Screen"
+inoremap <F8> <ESC>:set invfullscreen<CR>a
+nnoremap <F8> :set invfullscreen<CR>
+vnoremap <F8> :set invfullscreen<CR>
+" }}}
+" Browser stuff-------------------------------------------------------------{{{
+"Load the current buffer in Firefox - Mac specific.
+abbrev ff :! open -a firefox.app %:p<cr>
+"Load the current buffer in Google Chrome
+abbrev gc :! open -a "Google Chrome" %:p<cr>
+" }}}
+" Other --------------------------------------------------------------------{{{
-" Folding settings ---------------------------------------------------------{{{
-set foldcolumn=0
-set foldenable
-set foldlevel=0
-set foldmethod=marker
-set foldtext=FoldText()
-set foldlevelstart=0
+"Fold Html Tag"
+au BufNewFile,BufRead *.html map <leader>ft Vatzf
-nnoremap <Space> za
-vnoremap <Space> za
-nnoremap zO zCzO
+"Code completion
+"imap ,<tab> <C-x><C-o>
-function! MyFoldText()
- let line = getline(v:foldstart)
+"set wildmenu
+"set completeopt=longest,menuone,preview
+"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
+"inoremap <expr> <C-p> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>up>" : ""<CR>'
+"inoremap <expr> <C-n> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
- let nucolwidth = &fdc + &number * &numberwidth
- let windowwidth = winwidth(0) - nucolwidth - 3
- let foldedlinecount = v:foldend - v:foldstart
+let g:netrw_list_hide= '.*\.pyc$,^\.git/$,\.project$,\.pydevproject$,^\.settings/$,^\.svn/$,\.swp$'
- " expand tabs into spaces
- let onetab = strpart(' ', 0, &tabstop)
- let line = substitute(line, '\t', onetab, 'g')
+:command! SortCSSBraceContents :g#\({\n\)\@<=#.,/}/sort
- let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
- let fillcharcount = windowwidth - len(line) - len(foldedlinecount)
- return line . '' . repeat(" ",fillcharcount) . foldedlinecount . '' . ' '
-endfunction
-set foldtext=MyFoldText()
+"Pep8
+let g:pep8_map=',8'
+
+"Source the vimrc file after saving it. This way, you don't have to reload
+"Vim to see the changes.
+if has("autocmd")
+ autocmd bufwritepost .vimrc source $MYVIMRC
+endif
" }}}

0 comments on commit ad4729a

Please sign in to comment.