Advertisement
Guest User

Untitled

a guest
Oct 8th, 2008
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. " ^J jumps to the next marker
  2. " iabbr for for <+i+> in <+intervalo+>:<+i+>
  3. " Fun��o place holder (marcador de lugar)
  4. " pressionando Control-J ele pula para os locais <++>
  5. function! LoadFileTemplate()
  6. "silent! 0r ~/.vim/templates/%:e.tmpl
  7. syn match vimTemplateMarker "<+.\++>" containedin=ALL
  8. hi vimTemplateMarker guifg=#67a42c guibg=#112300 gui=bold
  9. endfunction
  10. function! JumpToNextPlaceholder()
  11. let old_query = getreg('/')
  12. echo search("<+.\\++>")
  13. exec "norm! c/+>/e\"
  14. call setreg('/', old_query)
  15. endfunction
  16. autocmd BufNewFile * :call LoadFileTemplate()
  17. nnoremap :call JumpToNextPlaceholder()a
  18. inoremap :call JumpToNextPlaceholder()a
  19.  
  20. "Agora um cabe�alho pronto para python
  21. " que define o tipo de arquivo e a tabula��o para dois espa�os
  22. " para inserir um cabe�alho destes basta digitar ,py em modo normal
  23. fun! BufNewFile_PY()
  24. normal(1G)
  25. :set ft=python
  26. :set ts=2
  27. call append(0, "#!/usr/bin/env python")
  28. call append(1, "# # -*- coding: ISO-8859-1 -*-")
  29. call append(2, "# Criado em:" . strftime("%a %d/%b/%Y hs %H:%M"))
  30. call append(3, "# Last Change: " . strftime("%a %d/%b/%Y hs %H:%M"))
  31. call append(4, "# Instituicao: <+nome+>")
  32. call append(5, "# Proposito do script: <+descreva+>")
  33. call append(6, "# Autor: <+seuNome+>")
  34. call append(7, "# site: <+seuSite+>")
  35. normal gg
  36. endfun
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement