2014-06-04 03:18:29 -04:00
"============================================================"
" "
2014-07-16 06:46:17 -04:00
" Darkcloud Vim Config: settings to load after "
2014-06-04 03:18:29 -04:00
" "
2014-06-17 01:49:46 -04:00
" By: Kevin MacMartin (prurigro@gmail.com) "
2014-06-04 03:18:29 -04:00
" Website: https://github.com/prurigro/darkcloud-vimconfig "
" "
" License: MIT "
" "
"============================================================"
"load the system version of matchit if another hasn't already been
if ! exists ( 'g:loaded_matchit' ) && findfile ( 'plugin/matchit.vim' , &rtp ) = = # ''
runtime ! macros /matchit .vim
endif
2014-10-21 11:16:46 -04:00
"when enabled, this will override each file type default and disable all line breaks (default: 1)
2014-07-14 10:30:02 -04:00
if ! exists ( "g:disablelinebreaks" )
let g :disablelinebreaks = 1
endif
2014-06-04 03:18:29 -04:00
if ( g :disablelinebreaks = = 1 )
2014-12-10 23:26:38 -05:00
autocmd VimEnter * set textwidth = 0
2014-06-04 03:18:29 -04:00
endif
"enable omnicompletion for any filetype without that has syntax highlighting
if has ( "autocmd" ) && exists ( "+omnifunc" )
autocmd VimEnter , Filetype * if &omnifunc = = "" | setlocal omnifunc = syntaxcomplete #Complete | endif
endif
2015-02-27 11:21:28 -05:00
"prevent warnings when changing read-only files
autocmd FileChangedRO * nested set noreadonly
2014-06-04 03:18:29 -04:00
"FILETPE AND SYNTAX: {{{
2014-07-21 02:36:50 -04:00
"set given filenames to various filetypes
2014-08-11 00:58:56 -04:00
autocmd BufNewFile , BufRead *.aspx , *.asmx , *.ascx , *.master setlocal ft = aspnet
autocmd BufNewFile , BufRead *.gradle setlocal ft = groovy
2015-02-26 21:40:56 -05:00
autocmd BufNewFile , BufRead *cjdroute .conf , *cjdmaid .conf setlocal ft = json
autocmd BufNewFile , BufRead *ircd .conf setlocal ft = json
2014-08-11 00:58:56 -04:00
autocmd BufNewFile , BufRead *muttrc setlocal ft = muttrc
2015-02-26 21:40:56 -05:00
autocmd BufNewFile , BufRead *pacman .conf setlocal ft = conf
2014-08-11 00:58:56 -04:00
autocmd BufNewFile , BufRead *vimpagerrc setlocal ft = vim
2015-02-26 21:40:56 -05:00
autocmd BufNewFile , BufRead *yaourtrc setlocal ft = sh
2014-07-21 02:36:50 -04:00
2014-07-16 06:46:17 -04:00
"filename specific settings
2015-02-26 21:40:56 -05:00
autocmd BufEnter , FileType sh setlocal iskeyword - = .
2014-07-16 06:46:17 -04:00
"filtype specific settings
2014-10-22 03:41:50 -04:00
autocmd Filetype text , mkd , mkdc , gitcommit , notes , mail , notmuch , rst , taskreport setlocal nonumber spell nolist linebreak breakat &vim breakat - = * breakat - = . breakat - = / breakat - = ? breakat - = , breakat - = : breakat - = ; breakat - = ! "set some defaults for word processing
autocmd Filetype text , gitcommit , notes , mail , notmuch , rst , taskreport setlocal wrap
2014-10-31 02:06:55 -04:00
autocmd FileType tmux , taskrc setlocal commentstring = #\ %s "set the comment string to #
autocmd FileType slrnrc setlocal commentstring = %%\ %s "set the comment string to %
2014-11-02 18:19:37 -05:00
"special side/bottom-bar settings to apply when opened
2014-07-16 23:29:44 -04:00
autocmd BufEnter , FileType taskreport , qf , help * setlocal nowrap nocursorcolumn "disable text wrapping and the vertical cursor line
2014-07-16 06:36:25 -04:00
autocmd BufEnter , FileType extradite setlocal number "enable line numbers in extradite
2014-11-02 18:19:37 -05:00
autocmd BufEnter , FileType help * setlocal nocursorline "remove the horizontal cursor line
2014-12-01 08:46:34 -05:00
"load in an 80 char vertical split if the window is wider than 140 characters
autocmd BufEnter , FileType help * if ( winwidth ( 0 ) > = 110 ) | wincmd L | vertical resize 80 | endif
2014-06-04 03:18:29 -04:00
"settings for buffers in diff mode
autocmd VimEnter , FilterWritePre * if &diff | setlocal nofoldenable | endif
autocmd VimEnter * if &diff | wincmd H | endif
"disable the whitespace plugin for vimfiler
2014-12-10 23:26:38 -05:00
autocmd BufEnter , FileType vimfiler , mail hi ExtraWhitespace ctermbg = NONE guibg = NONE
autocmd BufEnter , FileType mail set textwidth = 0
2014-06-04 03:18:29 -04:00
"}}}