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" )
2018-03-11 23:36:47 -04:00
let g :disablelinebreaks = 1
2014-07-14 10:30:02 -04:00
endif
2018-03-11 23:36:47 -04:00
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
2018-03-13 15:37:19 -04:00
if exists ( "+omnifunc" )
2014-06-04 03:18:29 -04:00
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: {{{
2016-11-28 14:12:12 -05:00
"enable more accurate syntax synchronization
autocmd BufEnter * :syntax sync fromstart
2024-03-06 16:27:56 -05:00
"set filetypes for various file extensions
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
2024-02-23 16:41:49 -05:00
autocmd BufNewFile , BufRead *eslintrc setlocal ft = json
2019-05-24 00:31:02 -04:00
autocmd BufNewFile , BufRead *.muttrc setlocal ft = muttrc
autocmd BufNewFile , BufRead *.neomuttrc setlocal ft = neomuttrc
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
2014-07-21 02:36:50 -04:00
2014-07-16 06:46:17 -04:00
"filtype specific settings
2016-11-28 14:12:12 -05:00
autocmd BufEnter , FileType sh setlocal iskeyword - = .
2024-03-06 16:27:56 -05:00
autocmd Filetype text , markdown , gitcommit , mail setlocal nonumber spell nolist linebreak textwidth = 80 tabstop = 2 shiftwidth = 2 breakat &vim breakat - = * breakat - = . breakat - = / breakat - = ? breakat - = , breakat - = : breakat - = ; breakat - = ! "set some defaults for word processing
2020-03-16 20:59:25 -04:00
autocmd Filetype text , gitcommit , mail setlocal wrap
2024-02-23 16:36:55 -05:00
autocmd FileType tmux setlocal commentstring = #\ %s "set the comment string to #
2020-10-25 20:56:01 -04:00
autocmd FileType scss setlocal iskeyword + = $
2023-04-05 21:56:43 -04:00
autocmd FileType javascript setlocal iskeyword + = - iskeyword + = .
2014-11-02 18:19:37 -05:00
"special side/bottom-bar settings to apply when opened
2022-04-15 00:13:36 -04:00
autocmd BufEnter , FileType qf , help * setlocal nowrap nocursorcolumn "disable text wrapping and the vertical cursor line
autocmd BufEnter , FileType qf setlocal scrolloff = 0 "don't scroll when clicking near the top or bottom of the list
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
2024-03-06 16:27:56 -05:00
"disable the whitespace plugin for vimfiler and the mail filetype
2014-12-10 23:26:38 -05:00
autocmd BufEnter , FileType vimfiler , mail hi ExtraWhitespace ctermbg = NONE guibg = NONE
2023-07-30 18:42:06 -04:00
"vimpager settings
if exists ( 'g:vimpager.enabled' )
set nonumber
endif
2014-06-04 03:18:29 -04:00
"}}}