vimrc

old vimrc

Positionner le fichier suivant dans le répertoire utilisateur : ~/.vimrc

set nocompatible
set history=500
set tw=80
set ts=2
set sts=2
set sw=2
set et
set wrap
set ai
set ic
sy on
autocmd BufRead,BufNewFile *.py set ts=4 
autocmd BufRead,BufNewFile *.py set sw=4

"" Python helpers
"tags $ cd ~/dawap/sandbox/; ctags -R .
set tags=~/dawap/sandbox/tags

" inspect inheritance diagram in python code
map m :!clear; grep -E 'class \|def ' % 

imap ,class class (object):<ESC>0f a
imap ,def def (self):<ESC>0/self<CR>i

" Latax shortcut
imap ,tt {\tt }<ESC>ha
imap ,em {\em }<ESC>ha
imap ,blue {\blue }<ESC>ha
imap ,red {\red }<ESC>ha
imap ,section \section{}<ESC>ha
imap ,be \begin{}<CR>  <CR><ESC>i\end{}<ESC>kkla

" Beamer structures
imap ,itemize \begin{itemize}<CR>  \item <CR>\end{itemize}<ESC>hhhhhhhhhhhhXXkfmA

"STL sturctures
imap ,stl <?xml version="1.0" encoding="UTF-8"?><CR><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<CR> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><CR><ESC>i<stl:block xmlns="http://www.w3.org/1999/xhtml"<CR>           xmlns:stl="http://xml.itools.org/namespaces/stl"><CR><CR><CR><ESC>i</stl:block><ESC>kA   <ESC>i  


" XHTML structures
imap ,xhtml <?xml version="1.0" encoding="UTF-8"?><CR><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<CR>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <CR><html xmlns="http://www.w3.org/1999/xhtml"><CR>  <head><CR>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><CR><title>Hello world</title><CR><ESC>i  </head><CR><body><CR>  <CR><ESC>i </body><CR><ESC>i</html><ESC>kkA

imap ,com <!--   --><ESC>F i
imap ,ul <ul><CR>  <li></li><CR><li></li><CR></ul><ESC>0xxkkf>a
imap ,ol <ol><CR>  <li></li><CR><li></li><CR></ol><ESC>0xxkkf>a
imap ,li <li></li><ESC>0f>a
imap ,dt <dt></dt><ESC>0f>a
imap ,$ ${}<ESC>i
imap ,img <img src=""/><ESC>0f"a

imap ,aa <a href=""></a><ESC>0f"a
imap ,bloc <stl:block if=""><CR><CR></stl:block><ESC>kk0f"a
imap ,inli <stl:inline if=""></stl:inline><ESC>0f"a
imap ,span <span class=""></span><ESC>0f"a

imap ,h1 <h1></h1><ESC>0f>a
imap ,h2 <h2></h2><ESC>0f>a
imap ,h3 <h3></h3><ESC>0f>a
imap ,div <div class=""></div><ESC>0f>a
imap ,br <br/><ESC>A

imap ,pre <pre></pre><ESC>0f>a
imap ,pp <p></p><ESC>0f>a
imap ,bb <b></b><ESC>hhhha
imap ,ii <i></i><ESC>hhhha
imap ,in <CR><CR><ESC>ki  
imap ,tr <tr><CR>  <td></td><CR><td></td><CR></tr><ESC>hhhhXXkkllllla
imap ,td <td></td><CR><td></td><ESC>hhhhki

imap ,form <form action="" method="post" enctype="multipart/form-data"><CR><CR>  <input type="submit" value="Send"><CR></form><ESC>hhhhhhXXkkk0f"li 

imap ,input <input type="text" name=""/><ESC>0f>hhi
imap ,file <input type="file" name=""/><ESC>0f>hhi
imap ,hidden <input type="hidden" name=""/><ESC>0f>hhi

imap ,sele <select name=""><CR>  <option value="a" selected="True"/><CR><option value="b"/><CR></select><ESC>hhhhhhhhXXXkkk0f"li

imap ,checkbox  <input type="checkbox" name="miam" value="choco"/>choco<CR><input type="checkbox" name="miam" value="coffe"/>coffe<ESC>k0/miam<CR>dwi

imap ,radio  <input type="radio" name="sex" value="M"/>M<CR><input type="radio" name="sex" value="F"/>F<ESC>k0fsi

imap ,ta <table cellpadding="0" cellspacing="0"><CR>  <tr><CR>  <th></th><CR><th></th><CR></tr><ESC>hhhhXXA<CR><tr><CR>  <td></td><CR><td></td><CR></tr><ESC>hhhhXXA<CR></table><ESC>0xxkkkkkkkf>a


map ^T :w!<CR>:!aspell  --language-tag=fr  check %<CR>:e! %<CR>
map T :w!<CR>:!aspell  --language-tag=fr  check %<CR>:e! %<CR>
map E :w!<CR>:!aspell  --language-tag=en  check %<CR>:e! %<CR>