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