~gpanders/dotfiles

c6af6125fd336ae6ef3e8849a6cb811b41431545 — Greg Anders 2 years ago e759c3b
Move file type specific options to ftplugin directory
A vim/.vim/ftplugin/cmake.vim => vim/.vim/ftplugin/cmake.vim +2 -0
@@ 0,0 1,2 @@
" CMake
setlocal cms=#%s

A vim/.vim/ftplugin/cpp.vim => vim/.vim/ftplugin/cpp.vim +10 -0
@@ 0,0 1,10 @@
" C / C++
setlocal sw=2
setlocal ts=2
setlocal sts=2
setlocal cms=//%s
setlocal cin

if executable('clang-format')
  setlocal formatprg=clang-format
endif

A vim/.vim/ftplugin/crontab.vim => vim/.vim/ftplugin/crontab.vim +3 -0
@@ 0,0 1,3 @@
" crontab
setlocal nobackup
setlocal nowritebackup

A vim/.vim/ftplugin/python.vim => vim/.vim/ftplugin/python.vim +5 -0
@@ 0,0 1,5 @@
" Python specific settings
setlocal sw=4
setlocal ts=4
setlocal sts=4 kp=pydoc
noremap <silent> <buffer> gz :botright sp <Bar> term python<CR>

A vim/.vim/ftplugin/tex.vim => vim/.vim/ftplugin/tex.vim +4 -0
@@ 0,0 1,4 @@
" LaTeX
setlocal nocursorline
setlocal norelativenumber
:NoMatchParen

A vim/.vim/ftplugin/vim.vim => vim/.vim/ftplugin/vim.vim +2 -0
@@ 0,0 1,2 @@
" Vim
setlocal fdm=marker

M vim/.vimrc => vim/.vimrc +0 -22
@@ 277,34 277,12 @@ augroup vimrc
  " Open the quickfix window after any grep search
  au QuickFixCmdPost *grep* cwindow

  " File-type specific configuration {{{
  " C / C++
  au FileType c,cpp setlocal sw=2 ts=2 sts=2 cms=//%s cin

  " CMake
  au FileType cmake setlocal cms=#%s

  " Python
  au FileType python setlocal sw=4 ts=4 sts=4 kp=pydoc
  au FileType python noremap <silent> <buffer> gz :botright sp <Bar> term python<CR>

  " LaTeX
  au FileType tex setlocal nocursorline norelativenumber
  au FileType tex :NoMatchParen

  " Vim
  au FileType vim setlocal fdm=marker

  " crontab
  au FileType crontab setlocal nobackup nowritebackup

  " term
  au TermOpen * startinsert

  " Press q to close certain windows
  au FileType help,qf nnoremap <silent> <buffer> q :q<CR>
  au FileType netrw nnoremap <silent> <buffer> qq :Rex<CR>
  " }}}

augroup END
" }}}