From 716f2259afba676832aedf49397a83be61e8c99f Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Wed, 4 Jun 2014 03:18:29 -0400 Subject: [PATCH] Disabled linebreaks globally by default and added a variable to get them back. Added the linebreak variable and another one I'd missed before to the vimrc.user creation in the update script. Added a second general settings file called "after.vim" for settings that need to be loaded after everything else. Updated maintainer tag to my real name. --- README.md | 2 ++ update | 13 ++++++----- vim/colors/darkcloud.vim | 2 +- vim/config/after.vim | 48 ++++++++++++++++++++++++++++++++++++++++ vim/config/keyboard.vim | 2 +- vim/config/plugins.vim | 6 ++--- vim/config/settings.vim | 41 ++++------------------------------ vimrc | 5 ++++- 8 files changed, 70 insertions(+), 49 deletions(-) create mode 100644 vim/config/after.vim diff --git a/README.md b/README.md index 0a19361..b5c72a5 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ ## Configuration ## * **Configure Variables**: The following variables can be added to _vim/vimrc.user_ and have their values set to the values you require: + * **g:disablelinebreaks**: 1 = Override filetype plugins so linebreaks never occur | 0 = Linebreaks are disabled by default, but filetype plugins can override this setting (_default_: 1) * **g:autostartfiler**: 1 = Start the filer file manager when vim is run and the buffer is empty | 0 = Do nothing when vim is run and the buffer is empty (_default_: 1) * **g:autostartchecker**: 1 = Check syntax once an appropriate file is loaded | 0 = Check syntax only after syntax checking is toggled on (_default_: 0) * **g:autostarttagbar**: 1 = Have the tagbar load automatically when a compatible format is run | 0 = The tagbar will stay hidden until triggered on demand with its toggle (_default_: 0) @@ -125,4 +126,5 @@ * Many other authors have their work contained in this repo, most of which are self contained in the vim/bundle directory. I also used the Vim jellybean theme as a basis for the Darkcloud theme, which is maintained by NanoTech ## License ## + All projects cloned in the vim/bundle folder are separate and have their own licenses. Everything else is released under the MIT license. diff --git a/update b/update index 9ddc09a..584a116 100755 --- a/update +++ b/update @@ -4,13 +4,16 @@ cd "${0%/*}" # create the user vimrc file in the directory if it doesn't already exist +[[ ! -d vim ]] && install -d vim if [ ! -e vim/vimrc.user ]; then echo "Creating user configuration file 'vim/vimrc.user'..." - if [ -d vim ] && [ -w vim ]; then - echo -e '"Syntax Checking Autostart: (1:start toggled on | 0: start toggled off)\nlet g:autostartchecker=1\n' >> vim/vimrc.user - echo -e '"Vim Starts With The Tagbar Open: (1:start open | 0:start closed)\nlet g:autostarttagbar=0\n' >> vim/vimrc.user - echo -e '"Powerline Font Support: (1:enabled | 0:disabled)\nlet g:powerlinefonts=1\n' >> vim/vimrc.user - echo -e '"GVim Font Selection: (term font set by terminal)\nset guifont=Droid\ Sans\ Mono\ 12' >> vim/vimrc.user + if [ -w vim ]; then + echo -e '"Disable Linebreaks: (*1:force disabled globally | 0: disabled by default)\n"let g:disablelinebreaks=0\n' >> vim/vimrc.user + echo -e '"Autostart Filer: (*1:filer loads in new empty buffers | 0: filer must be triggered)\n"let g:autostartfiler=0\n' >> vim/vimrc.user + echo -e '"Syntax Autostart: (1:start toggled on | *0: start toggled off)\n"let g:autostartchecker=1\n' >> vim/vimrc.user + echo -e '"Tagbar Autostart: (1:start open | *0:start closed)\n"let g:autostarttagbar=1\n' >> vim/vimrc.user + echo -e '"Powerline Fonts: (1:enabled | *0:disabled)\n"let g:powerlinefonts=1 "(set powerline font for gvim and terminal when enabled)\n' >> vim/vimrc.user + echo -e '"GVim Font Selection: (Escaping spaces and use powerline if appropriate)\nset guifont=Monospace\ 12' >> vim/vimrc.user fi echo fi diff --git a/vim/colors/darkcloud.vim b/vim/colors/darkcloud.vim index 5ee8169..45b1cd2 100644 --- a/vim/colors/darkcloud.vim +++ b/vim/colors/darkcloud.vim @@ -2,7 +2,7 @@ " " " Darkcloud Vim Config: theme " " -" Maintainer: Prurigro (prurigro-at-gmail-dot-com) " +" Maintainer: Kevin MacMartin (prurigro@gmail.com) " " Website: https://github.com/prurigro/darkcloud-vimconfig " " " " License: MIT " diff --git a/vim/config/after.vim b/vim/config/after.vim new file mode 100644 index 0000000..f79e788 --- /dev/null +++ b/vim/config/after.vim @@ -0,0 +1,48 @@ +"============================================================" +" " +" Darkcloud Vim Config: settings to load after all else " +" " +" Maintainer: Kevin MacMartin (prurigro@gmail.com) " +" 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 + +"disable linebreaks by default or override all of them (default: 1) +if !exists("g:disablelinebreaks")|let g:disablelinebreaks=1|endif +if (g:disablelinebreaks == 1) + autocmd VimEnter * set tw=0 nolinebreak +else + set tw=0 nolinebreak +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 + +"FILETPE AND SYNTAX: {{{ + "misc filtype specific settings + autocmd FileType gitcommit,notes,mail,notmuch,text setlocal spell + autocmd FileType notes,mail,notmuch,mkd,text setlocal nonumber + autocmd FileType mail,notmuch,text setlocal wrap + autocmd FileType notes setlocal tw=80 + autocmd FileType help* wincmd L "help windows always open vertically + autocmd FileType help* vertical resize 80 "set the window size to 80 cols + autocmd FileType help* setlocal nocursorline "remove the horizontal cursor line + autocmd BufEnter,FileType qf,help* setlocal nowrap nocursorcolumn "disable text wrapping and the vertical cursor line + autocmd BufEnter,FileType extradite setlocal number + + "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 + autocmd BufEnter,FileType vimfiler hi ExtraWhitespace ctermbg=NONE guibg=NONE +"}}} diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index a767750..ee774e5 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -2,7 +2,7 @@ " " " Darkcloud Vim Config: keyboard settings " " " -" Maintainer: Prurigro (prurigro-at-gmail-dot-com) " +" Maintainer: Kevin MacMartin (prurigro@gmail.com) " " Website: https://github.com/prurigro/darkcloud-vimconfig " " " " License: MIT " diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim index 0e62d0b..17e7a7c 100644 --- a/vim/config/plugins.vim +++ b/vim/config/plugins.vim @@ -2,7 +2,7 @@ " " " Darkcloud Vim Config: plugin settings " " " -" Maintainer: Prurigro (prurigro-at-gmail-dot-com) " +" Maintainer: Kevin MacMartin (prurigro@gmail.com) " " Website: https://github.com/prurigro/darkcloud-vimconfig " " " " License: MIT " @@ -148,9 +148,7 @@ "VIM FILER: {{{ "autostart filer when vim opens to an empty buffer (default: 1) - if !exists("g:autostartfiler") - let g:autostartfiler=1 - endif + if !exists("g:autostartfiler")|let g:autostartfiler=1|endif if (g:autostartfiler == 1) autocmd VimEnter * if !argc() | VimFiler -quit -project | endif endif diff --git a/vim/config/settings.vim b/vim/config/settings.vim index 77efe88..1ec2dae 100644 --- a/vim/config/settings.vim +++ b/vim/config/settings.vim @@ -2,7 +2,7 @@ " " " Darkcloud Vim Config: main settings " " " -" Maintainer: Prurigro (prurigro-at-gmail-dot-com) " +" Maintainer: Kevin MacMartin (prurigro@gmail.com) " " Website: https://github.com/prurigro/darkcloud-vimconfig " " " " License: MIT " @@ -43,10 +43,8 @@ set list listchars=tab:>-,trail:- "display tabs as: >--- and trailing spaces as: - set autochdir "current dir is file dir set history=250 "undo history - set timeoutlen=1000 ttimeoutlen=0 "shorten the timeout length of escapes + set timeoutlen=800 ttimeoutlen=0 "shorten the timeout length of escapes set whichwrap=b,s,<,>,[,] "allow the cursor to wrap lines - set textwidth=0 "set an unlimited text width before breaking the line when line breaks are enabled - set nolinebreak "disable linebreaks, though this will be overridden by filetype plugins set showmatch "show matching open bracket when closed bracket is inserted set matchtime=5 "the amount of time the matching bracket will highlight set smarttab expandtab autoindent tabstop=4 shiftwidth=4 "configure tabs @@ -55,12 +53,7 @@ set diffopt=foldcolumn:0,filler "vimdiff default settings set formatoptions=roqnl12 "how automatic formatting is to be done set foldmethod=syntax foldcolumn=1 foldlevel=3 "fold layers 3 or more deep - let &showbreak=" " "when linewrap is enabled, show wrapped lines with +++ - - "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 + let &showbreak="_" "highlight wrapped lines when linewrap is enabled "enable tab completion in command mode and configure how it handles extensions set completeopt=longest,menuone @@ -72,7 +65,7 @@ "FILETYPES AND SYNTAX: SETTINGS FOR FILETYPES AND ASSOCIATED SYNTAX {{{ filetype plugin indent on - syntax on "turn syntax highlighting on + syntax on "set matching filenames to matching filenames autocmd BufNewFile,BufRead *.aspx,*.asmx,*.ascx,*.master setf aspnet @@ -80,32 +73,6 @@ autocmd BufNewFile,BufRead pacman.conf,yaourtrc setf sh autocmd BufNewFile,BufRead archversion.conf setf archversion autocmd BufNewFile,BufRead cjdroute.conf,cjdmaid.conf setf json - - "misc filtype specific settings - autocmd FileType gitcommit,notes,mail,notmuch,text setlocal spell - autocmd FileType notes,mail,notmuch,mkd,text setlocal nonumber - autocmd FileType mail,notmuch,text setlocal wrap - autocmd FileType notes setlocal textwidth=80 - autocmd FileType help* wincmd L "help windows always open vertically - autocmd FileType help* vertical resize 80 "set the window size to 80 cols - autocmd FileType help* setlocal nocursorline "remove the horizontal cursor line - autocmd BufEnter,FileType qf,help* setlocal nowrap nocursorcolumn "disable text wrapping and the vertical cursor line - autocmd BufEnter,FileType extradite setlocal number - - "settings for buffers in diff mode - autocmd VimEnter,FilterWritePre * if &diff|setlocal nofoldenable|endif - autocmd VimEnter * if &diff|wincmd H|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 - - "disable the whitespace plugin for vimfiler - autocmd BufEnter,FileType vimfiler hi ExtraWhitespace ctermbg=NONE guibg=NONE "}}} "GVIM: GUI CONFIG OPTIONS {{{ diff --git a/vimrc b/vimrc index f176f9e..ec86172 100644 --- a/vimrc +++ b/vimrc @@ -2,7 +2,7 @@ " " " Darkcloud Vim Config: vimrc " " " -" Maintainer: Prurigro (prurigro-at-gmail-dot-com) " +" Maintainer: Kevin MacMartin (prurigro@gmail.com) " " Website: https://github.com/prurigro/darkcloud-vimconfig " " " " License: MIT " @@ -45,4 +45,7 @@ "Load Colour Scheme: colorscheme darkcloud + + "Load After Config: + runtime config/after.vim "}}}