Commits

Alfredo Deza  committed 9d3ce61

.vimrc changed a lot, adding now since I am happy with it

  • Participants
  • Parent commits 652c23b

Comments (0)

Files changed (1)

+" Pathogen 
+call pathogen#runtime_append_all_bundles()
+
+filetype on            " enables filetype detection
+filetype plugin on     " enables filetype specific plugins
+
+" gundo
+nnoremap <Leader>u <ESC>:GundoToggle<CR>
+
+set nocompatible
+set backspace=indent,eol,start
+set vb
+
+" terminal width
+set wrap
+set textwidth=79
+set formatoptions=qrn1
+
 syntax on
+
 autocmd BufRead,BufNewFile *.py syntax on
 autocmd BufRead,BufNewFile *.py set ai
 autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,with,try,except,finally,def,class
+set tabstop=4 expandtab shiftwidth=4 softtabstop=4
 
-set tabstop=4 expandtab shiftwidth=4 softtabstop=4
 set ruler
+filetype plugin on 
 filetype indent on 
 
+" hide some files and remove stupid help
+let g:netrw_list_hide='^\.,.\(pyc\|pyo\|o\)$'
+
+" Change CWD automatically
+set nocompatible
+if has("gui_running")
+  set autochdir
+  colorscheme ir_black
+  au GUIEnter * set fullscreen
+  set lines=999 columns=999
+  highlight SpellBad term=underline gui=undercurl guisp=Orange
+
+endif
+
+
 " I have a dark terminal
 set background=dark
 
 " Python Main calling if with a second line and right spacing 
 iab pymain if __name__ == "__main__":<CR>     <ESC>
 
+" Python self.assertEqual :
+iab assertequal self.assertEqual(actual, expected)
+
+
+"***************
+" Mappings 
+"***************
+"
+" This helps for underlining with RST
+nnoremap <Leader>1 yypVr=
+nnoremap <Leader>2 yypVr-
+
 """""""""""""""""""""
 " Function Mappings
 """""""""""""""""""""
 " Highlight Search 
-nmap <silent> <C-a> <Esc>:call ToggleHLSearch()<CR>
+nmap <Leader>s <Esc>:call ToggleHLSearch()<CR>
 
 " set paste no paste
-nmap <silent> <C-c> <Esc>:call TogglePaste()<CR>
+nmap <Leader>p <Esc>:call TogglePaste()<CR>
 
 """"""""""""
 " Functions
 
 " The default for 'backspace' is very confusing to new users, so change it to a
 " more sensible value.  Add "set backspace&" to your ~/.vimrc to reset it.
-set backspace+=indent,eol,start
+"set backspace+=indent,eol,start
 
 
+" template language support (SGML / XML too)
+" ------------------------------------------
+" and disable taht stupid html rendering (like making stuff bold etc)
 
+fun! s:SelectHTML()
+let n = 1
+while n < 50 && n < line("$")
+  " check for jinja
+  if getline(n) =~ '{%\s*\(extends\|block\|macro\|set\|if\|for\|include\|trans\)\>'
+    set ft=htmljinja
+    return
+  endif
+  " check for django
+  if getline(n) =~ '{%\s*\(extends\|block\|comment\|ssi\|if\|for\|blocktrans\)\>'
+    set ft=htmldjango
+    return
+  endif
+  " check for mako
+    if getline(n) =~ '<%\(def\|inherit\)'
+      set ft=mako
+      return
+    endif
+    " check for genshi
+    if getline(n) =~ 'xmlns:py\|py:\(match\|for\|if\|def\|strip\|xmlns\)'
+      set ft=genshi
+      return
+    endif
+    let n = n + 1
+  endwhile
+  " go with html
+  set ft=html
+endfun
+
+autocmd FileType html,xhtml,xml,htmldjango,htmljinja,eruby,mako setlocal expandtab shiftwidth=2 tabstop=2 softtabstop=2
+autocmd BufNewFile,BufRead *.rhtml setlocal ft=eruby
+autocmd BufNewFile,BufRead *.mako setlocal ft=mako
+autocmd BufNewFile,BufRead *.tmpl setlocal ft=htmljinja
+autocmd BufNewFile,BufRead *.py_tmpl setlocal ft=python
+autocmd BufNewFile,BufRead *.html,*.htm  call s:SelectHTML()
+let html_no_rendering=1
+