1
0
Fork 0
mirror of synced 2024-11-05 00:48:57 -05:00
ultimate-vim/vimrcs/filetypes.vim
Maksim Pecherskiy 686d2e7d43 Cleanup.
2014-10-27 13:32:12 -07:00

82 lines
2.5 KiB
VimL

""""""""""""""""""""""""""""""
" => Python section
""""""""""""""""""""""""""""""
let python_highlight_all = 1
au FileType python syn keyword pythonDecorator True None False self
au BufNewFile,BufRead *.jinja set syntax=htmljinja
au BufNewFile,BufRead *.mako set ft=mako
au FileType python map <buffer> F :set foldmethod=indent<cr>
au FileType python inoremap <buffer> $r return
au FileType python inoremap <buffer> $i import
au FileType python inoremap <buffer> $p print
au FileType python inoremap <buffer> $f #--- PH ----------------------------------------------<esc>FP2xi
au FileType python map <buffer> <leader>1 /class
au FileType python map <buffer> <leader>2 /def
au FileType python map <buffer> <leader>C ?class
au FileType python map <buffer> <leader>D ?def
""""""""""""""""""""""""""""""
" => JavaScript section
"""""""""""""""""""""""""""""""
au FileType javascript call JavaScriptFold()
au FileType javascript setl fen
au FileType javascript setl nocindent
au FileType javascript imap <c-t> $log();<esc>hi
au FileType javascript imap <c-a> alert();<esc>hi
au FileType javascript inoremap <buffer> $r return
au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi
function! JavaScriptFold()
setl foldmethod=syntax
setl foldlevelstart=1
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
function! FoldText()
return substitute(getline(v:foldstart), '{.*', '{...}', '')
endfunction
setl foldtext=FoldText()
endfunction
""""""""""""""""""""""""""""""
" => CoffeeScript section
"""""""""""""""""""""""""""""""
function! CoffeeScriptFold()
setl foldmethod=indent
setl foldlevelstart=1
endfunction
au FileType coffee call CoffeeScriptFold()
au FileType gitcommit call setpos('.', [0, 1, 1, 0])
""""""""""""""""""""""""""""""
" => Markdown / Prose section
"""""""""""""""""""""""""""""""
function! WordProcessor()
"setl textwidth=80
"setl foldcolumn=10
"setl columns=100
:Goyo
endfunction
" md is markdown
autocmd FileType markdown,mkd call WordProcessor()
"autocmd BufRead,BufNewFile *.md set filetype=markdown
"
"let g:pencil#wrapModeDefault = 'soft' " or 'hard'
"let g:pencil#textwidth = 80
"let g:pencil#mode_indicators = {'hard': '␍', 'soft': '⤸', 'off': '',}
"let g:airline_section_x = '%{PencilMode()}'
"augroup pencil
" autocmd!
" autocmd FileType markdown,mkd,md call pencil#init()
" autocmd FileType text call pencil#init({'wrap': 'hard'})
"augroup END