Skip to content

Commit

Permalink
Vim: Merge vim/filetypes.vim into plugins.vim, and rename it to exten…
Browse files Browse the repository at this point in the history
…sions.vim
  • Loading branch information
cypher committed Jun 14, 2016
1 parent 1529bf4 commit 1dce62b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 48 deletions.
49 changes: 49 additions & 0 deletions vim/plugins.vim → vim/extensions.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" FileType specific settings
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" Some languages should always use 4-space indent
autocmd FileType python setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType sql setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType javascript setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType html setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType htmldjango setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType rust setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType swift setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType c setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType go setlocal autoindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab


" Handy for running go tests
" autocmd FileType go map <leader>t :w<CR> :set makeprg=go\ test<CR> :make<CR>


" .inc files are Django templates
autocmd BufRead,BufNewFile {*.inc} set filetype=jinja


" Thorfile, Rakefile and Gemfile are Ruby
autocmd BufRead,BufNewFile {Gemfile,Rakefile,Thorfile,config.ru} setlocal filetype=ruby


" Customize markdown file settings
autocmd FileType *.md set wrap|set linebreak|set nolist
autocmd FileType *.markdown set wrap|set linebreak|set nolist
autocmd BufRead,BufNewFile *.md set filetype=markdown

" Spell-check Markdown files
autocmd FileType markdown setlocal spell

" Git Commit
" (Spell check, max line length of 72)
autocmd Filetype gitcommit setlocal spell textwidth=72


" Always turn on syntax highlighting for diffs
augroup PatchDiffHighlight
autocmd!
autocmd FileType diff syntax enable
augroup END


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugins
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Expand All @@ -8,6 +56,7 @@ au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces


" vim-commentary settings
autocmd FileType sql set commentstring=--\ %s
autocmd FileType vim set commentstring=\"\ %s
Expand Down
46 changes: 0 additions & 46 deletions vim/filetypes.vim

This file was deleted.

3 changes: 1 addition & 2 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ call pathogen#infect()
source $HOME/.vim/basics.vim
source $HOME/.vim/bindings.vim
source $HOME/.vim/editing.vim
source $HOME/.vim/plugins.vim
source $HOME/.vim/window.vim
source $HOME/.vim/filetypes.vim
source $HOME/.vim/extensions.vim

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Load local config
Expand Down

0 comments on commit 1dce62b

Please sign in to comment.