Skip to content
This repository

adding global variables to disable every bundle #215

Closed
wants to merge 1 commit into from

3 participants

James Tomasino Steve Francia John Tyree
James Tomasino

This has come up before in several issues. I think it would be incredibly useful to have a variable capable of disabling any Bundle installed in spf13-vim. Since not every Bundle has an internal mechanism capable of doing this cleanly and they are all handled inconsistently when available, it seemed the best place to do this was in .vimrc.bundles.

I've kept a similar naming convention to existing disable variables.

g:override_spf13_bundle_{Bundle_Name_With_Underscore_Seperator}

For example:

g:override_spf13_bundle_vim_nerdtree_tabs
Steve Francia
Owner

I think this is a very interesting idea. I'd like to think about it a bit before merging it in. If we don't merge this in directly it will be something very similar based on it. Thanks for the commit.

Steve Francia
Owner

Thinking about this more, I like it, but the name seems incorrect. 'g:override_spf13_bundle_' ... override implies that we are providing something else instead.

I think we should use the term 'g:spf13_disable_bundle_*' instead. I think it's much more descriptive.

We also should add documentation for users to add this to their .vimrc.bundles.local file.

I'm thinking there may be a way to automate this as well. I'm looking into it.

James Tomasino

That's a great idea. I can update the variable names in my pull request branch if you'd like, or I can hold off if you think there's a way of automating the checks.

John Tyree
Collaborator

This has my vote. I've already had to replicate (and now maintain) two of these little bundle groups because I just wanted to remove one bundle from each.

What about a list of bundle names that should be disabled? Then you have one global variable and you can just do string comparison or something. The name strings are already well defined by .vimrc.bundles anyway..

Steve Francia
Owner
Steve Francia spf13 closed this November 27, 2012
Steve Francia
Owner

The commit 2d1b8f3 has the same functionality but in a different interface. I feel that this interface is much better as it follows the same interface as Bundle already does and doesn't add any additional maintenance.

It worked well for me, but please test it and let me know if it works for you.

Important to note is don't add the UnBundle to your .vimrc.bundles.local as it loads too early and will just result in the bundle being re-enabled.

James Tomasino

Absolutely brilliant. Thanks Steve

Li Yongyi WallaceYYLi referenced this pull request from a commit December 08, 2012
Bozhidar Batsov fixed #215 - made Prelude's auto-save optional (and improved it a bit…
… in the process of doing so)
f66a56a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 14, 2012
James Tomasino adding global variables to disable every bundle d4862f5
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 168 additions and 58 deletions. Show diff stats Hide diff stats

  1. 226  .vimrc.bundles
226  .vimrc.bundles
@@ -40,14 +40,24 @@
40 40
 
41 41
 " Bundles {
42 42
     " Deps
43  
-        Bundle 'gmarik/vundle'
44  
-        Bundle 'MarcWeber/vim-addon-mw-utils'
45  
-        Bundle 'tomtom/tlib_vim'
  43
+        if !exists("g:override_spf13_bundle_vundle")
  44
+            Bundle 'gmarik/vundle'
  45
+        endif
  46
+        if !exists("g:override_spf13_bundle_vim_addon_mw_utils")
  47
+            Bundle 'MarcWeber/vim-addon-mw-utils'
  48
+        endif
  49
+        if !exists("g:override_spf13_bundle_tlib_vim")
  50
+            Bundle 'tomtom/tlib_vim'
  51
+        endif
46 52
         if executable('ack-grep')
47 53
             let g:ackprg="ack-grep -H --nocolor --nogroup --column"
48  
-            Bundle 'mileszs/ack.vim'
  54
+            if !exists("g:override_spf13_bundle_ack")
  55
+                Bundle 'mileszs/ack.vim'
  56
+            endif
49 57
         elseif executable('ack')
50  
-            Bundle 'mileszs/ack.vim'
  58
+            if !exists("g:override_spf13_bundle_ack")
  59
+                Bundle 'mileszs/ack.vim'
  60
+            endif
51 61
         endif
52 62
 
53 63
     " Use local bundles if available {
@@ -74,90 +84,178 @@
74 84
 
75 85
     " General
76 86
         if count(g:spf13_bundle_groups, 'general')
77  
-            Bundle 'scrooloose/nerdtree'
78  
-            Bundle 'altercation/vim-colors-solarized'
79  
-            Bundle 'spf13/vim-colors'
80  
-            Bundle 'tpope/vim-surround'
81  
-            Bundle 'AutoClose'
82  
-            Bundle 'kien/ctrlp.vim'
83  
-            Bundle 'vim-scripts/sessionman.vim'
84  
-            Bundle 'matchit.zip'
85  
-            Bundle 'Lokaltog/vim-powerline'
86  
-            Bundle 'Lokaltog/vim-easymotion'
87  
-            Bundle 'godlygeek/csapprox'
88  
-            Bundle 'jistr/vim-nerdtree-tabs'
89  
-            Bundle 'flazz/vim-colorschemes'
90  
-            Bundle 'mbbill/undotree'
91  
-            Bundle 'myusuf3/numbers.vim'
92  
-            Bundle 'nathanaelkane/vim-indent-guides'
93  
-            Bundle 'vim-scripts/restore_view.vim'
  87
+            if !exists("g:override_spf13_bundle_nerdtree")
  88
+                Bundle 'scrooloose/nerdtree'
  89
+            endif
  90
+            if !exists("g:override_spf13_bundle_vim_colors_solarized")
  91
+                Bundle 'altercation/vim-colors-solarized'
  92
+            endif
  93
+            if !exists("g:override_spf13_bundle_vim_colors")
  94
+                Bundle 'spf13/vim-colors'
  95
+            endif
  96
+            if !exists("g:override_spf13_bundle_vim_surround")
  97
+                Bundle 'tpope/vim-surround'
  98
+            endif
  99
+            if !exists("g:override_spf13_bundle_AutoClose")
  100
+                Bundle 'AutoClose'
  101
+            endif
  102
+            if !exists("g:override_spf13_bundle_ctrlp")
  103
+                Bundle 'kien/ctrlp.vim'
  104
+            endif
  105
+            if !exists("g:override_spf13_bundle_sessionman")
  106
+                Bundle 'vim-scripts/sessionman.vim'
  107
+            endif
  108
+            if !exists("g:override_spf13_bundle_matchit")
  109
+                Bundle 'matchit.zip'
  110
+            endif
  111
+            if !exists("g:override_spf13_bundle_vim_powerline")
  112
+                Bundle 'Lokaltog/vim-powerline'
  113
+            endif
  114
+            if !exists("g:override_spf13_bundle_vim_easymotion")
  115
+                Bundle 'Lokaltog/vim-easymotion'
  116
+            endif
  117
+            if !exists("g:override_spf13_bundle_csapprox")
  118
+                Bundle 'godlygeek/csapprox'
  119
+            endif
  120
+            if !exists("g:override_spf13_bundle_vim_nerdtree_tabs")
  121
+                Bundle 'jistr/vim-nerdtree-tabs'
  122
+            endif
  123
+            if !exists("g:override_spf13_bundle_vim_colorschemes")
  124
+                Bundle 'flazz/vim-colorschemes'
  125
+            endif
  126
+            if !exists("g:override_spf13_bundle_undotree")
  127
+                Bundle 'mbbill/undotree'
  128
+            endif
  129
+            if !exists("g:override_spf13_bundle_numbers")
  130
+                Bundle 'myusuf3/numbers.vim'
  131
+            endif
  132
+            if !exists("g:override_spf13_bundle_vim_indent_guides")
  133
+                Bundle 'nathanaelkane/vim-indent-guides'
  134
+            endif
  135
+            if !exists("g:override_spf13_bundle_restore_view")
  136
+                Bundle 'vim-scripts/restore_view.vim'
  137
+            endif
94 138
         endif
95 139
 
96 140
     " General Programming
97 141
         if count(g:spf13_bundle_groups, 'programming')
98 142
             " Pick one of the checksyntax, jslint, or syntastic
99  
-            Bundle 'scrooloose/syntastic'
100  
-            Bundle 'tpope/vim-fugitive'
101  
-            Bundle 'mattn/webapi-vim'
102  
-            Bundle 'mattn/gist-vim'
103  
-            Bundle 'scrooloose/nerdcommenter'
104  
-            Bundle 'godlygeek/tabular'
105  
-            if executable('ctags')
106  
-                Bundle 'majutsushi/tagbar'
  143
+            if !exists("g:override_spf13_bundle_syntastic")
  144
+                Bundle 'scrooloose/syntastic'
  145
+            endif
  146
+            if !exists("g:override_spf13_bundle_vim_fugitive")
  147
+                Bundle 'tpope/vim-fugitive'
  148
+            endif
  149
+            if !exists("g:override_spf13_bundle_webapi_vim")
  150
+                Bundle 'mattn/webapi-vim'
  151
+            endif
  152
+            if !exists("g:override_spf13_bundle_gist_vim")
  153
+                Bundle 'mattn/gist-vim'
  154
+            endif
  155
+            if !exists("g:override_spf13_bundle_nerdcommenter")
  156
+                Bundle 'scrooloose/nerdcommenter'
  157
+            endif
  158
+            if !exists("g:override_spf13_bundle_tabular")
  159
+                Bundle 'godlygeek/tabular'
  160
+            endif
  161
+            if !exists("g:override_spf13_bundle_tagbar")
  162
+                if executable('ctags')
  163
+                    Bundle 'majutsushi/tagbar'
  164
+                endif
107 165
             endif
108 166
         endif
109 167
 
110 168
     " Snippets & AutoComplete
111 169
         if count(g:spf13_bundle_groups, 'snipmate')
112  
-            Bundle 'garbas/vim-snipmate'
113  
-            Bundle 'honza/snipmate-snippets'
114  
-            " Source support_function.vim to support snipmate-snippets.
115  
-            if filereadable(expand("~/.vim/bundle/snipmate-snippets/snippets/support_functions.vim"))
116  
-                source ~/.vim/bundle/snipmate-snippets/snippets/support_functions.vim
  170
+            if !exists("g:override_spf13_bundle_vim_snipmate")
  171
+                Bundle 'garbas/vim-snipmate'
  172
+            endif
  173
+            if !exists("g:override_spf13_bundle_snipmate_snippets")
  174
+                Bundle 'honza/snipmate-snippets'
  175
+                if !exists("g:override_spf13_bundle_snipmate_support_functions")
  176
+                    " Source support_function.vim to support snipmate-snippets.
  177
+                    if filereadable(expand("~/.vim/bundle/snipmate-snippets/snippets/support_functions.vim"))
  178
+                        source ~/.vim/bundle/snipmate-snippets/snippets/support_functions.vim
  179
+                    endif
  180
+                endif
117 181
             endif
118 182
         elseif count(g:spf13_bundle_groups, 'neocomplcache')
119  
-            Bundle 'Shougo/neocomplcache'
120  
-            Bundle 'Shougo/neosnippet'
121  
-            Bundle 'honza/snipmate-snippets'
  183
+            if !exists("g:override_spf13_bundle_neocomplcache")
  184
+                Bundle 'Shougo/neocomplcache'
  185
+            endif
  186
+            if !exists("g:override_spf13_bundle_neosnippet")
  187
+                Bundle 'Shougo/neosnippet'
  188
+            endif
  189
+            if !exists("g:override_spf13_bundle_snipmate_snippets")
  190
+                Bundle 'honza/snipmate-snippets'
  191
+            endif
122 192
         endif
123 193
 
124 194
     " PHP
125 195
         if count(g:spf13_bundle_groups, 'php')
126  
-            Bundle 'spf13/PIV'
  196
+            if !exists("g:override_spf13_bundle_PIV")
  197
+                Bundle 'spf13/PIV'
  198
+            endif
127 199
         endif
128 200
 
129 201
     " Python
130 202
         if count(g:spf13_bundle_groups, 'python')
131 203
             " Pick either python-mode or pyflakes & pydoc
132  
-            Bundle 'klen/python-mode'
133  
-            Bundle 'python.vim'
134  
-            Bundle 'python_match.vim'
135  
-            Bundle 'pythoncomplete'
  204
+            if !exists("g:override_spf13_bundle_python_mode")
  205
+                Bundle 'klen/python-mode'
  206
+            endif
  207
+            if !exists("g:override_spf13_bundle_python")
  208
+                Bundle 'python.vim'
  209
+            endif
  210
+            if !exists("g:override_spf13_bundle_python_match")
  211
+                Bundle 'python_match.vim'
  212
+            endif
  213
+            if !exists("g:override_spf13_bundle_pythoncomplete")
  214
+                Bundle 'pythoncomplete'
  215
+            endif
136 216
         endif
137 217
 
138 218
     " Javascript
139 219
         if count(g:spf13_bundle_groups, 'javascript')
140  
-            Bundle 'leshill/vim-json'
141  
-            Bundle 'groenewege/vim-less'
142  
-            Bundle 'pangloss/vim-javascript'
143  
-            Bundle 'briancollins/vim-jst'
  220
+            if !exists("g:override_spf13_bundle_vim_json")
  221
+                Bundle 'leshill/vim-json'
  222
+            endif
  223
+            if !exists("g:override_spf13_bundle_vim_less")
  224
+                Bundle 'groenewege/vim-less'
  225
+            endif
  226
+            if !exists("g:override_spf13_bundle_vim_javascript")
  227
+                Bundle 'pangloss/vim-javascript'
  228
+            endif
  229
+            if !exists("g:override_spf13_bundle_vim_jst")
  230
+                Bundle 'briancollins/vim-jst'
  231
+            endif
144 232
         endif
145 233
 
146 234
     " Java
147 235
         if count(g:spf13_bundle_groups, 'scala')
148  
-            Bundle 'derekwyatt/vim-scala'
149  
-            Bundle 'derekwyatt/vim-sbt'
  236
+            if !exists("g:override_spf13_bundle_vim_scala")
  237
+                Bundle 'derekwyatt/vim-scala'
  238
+            endif
  239
+            if !exists("g:override_spf13_bundle_vim_sbt")
  240
+                Bundle 'derekwyatt/vim-sbt'
  241
+            endif
150 242
         endif
151 243
 
152 244
     " HTML
153 245
         if count(g:spf13_bundle_groups, 'html')
154  
-            Bundle 'amirh/HTML-AutoCloseTag'
155  
-            Bundle 'hail2u/vim-css3-syntax'
  246
+            if !exists("g:override_spf13_bundle_HTML_AutoCloseTag")
  247
+                Bundle 'amirh/HTML-AutoCloseTag'
  248
+            endif
  249
+            if !exists("g:override_spf13_bundle_vim_css3_syntax")
  250
+                Bundle 'hail2u/vim-css3-syntax'
  251
+            endif
156 252
         endif
157 253
 
158 254
     " Ruby
159 255
         if count(g:spf13_bundle_groups, 'ruby')
160  
-            Bundle 'tpope/vim-rails'
  256
+            if !exists("g:override_spf13_bundle_vim_rails")
  257
+                Bundle 'tpope/vim-rails'
  258
+            endif
161 259
             let g:rubycomplete_buffer_loading = 1
162 260
             "let g:rubycomplete_classes_in_global = 1
163 261
             "let g:rubycomplete_rails = 1
@@ -165,16 +263,28 @@
165 263
 
166 264
     " Misc
167 265
         if count(g:spf13_bundle_groups, 'misc')
168  
-            Bundle 'tpope/vim-markdown'
169  
-            Bundle 'spf13/vim-preview'
170  
-            Bundle 'tpope/vim-cucumber'
171  
-            Bundle 'quentindecock/vim-cucumber-align-pipes'
172  
-            Bundle 'Puppet-Syntax-Highlighting'
  266
+            if !exists("g:override_spf13_bundle_vim_markdown")
  267
+                Bundle 'tpope/vim-markdown'
  268
+            endif
  269
+            if !exists("g:override_spf13_bundle_vim_preview")
  270
+                Bundle 'spf13/vim-preview'
  271
+            endif
  272
+            if !exists("g:override_spf13_bundle_vim_cucumber")
  273
+                Bundle 'tpope/vim-cucumber'
  274
+                if !exists("g:override_spf13_bundle_vim_cucumber_align_pipes")
  275
+                    Bundle 'quentindecock/vim-cucumber-align-pipes'
  276
+                endif
  277
+            endif
  278
+            if !exists("g:override_spf13_bundle_Puppet_Syntax_Highlighting")
  279
+                Bundle 'Puppet-Syntax-Highlighting'
  280
+            endif
173 281
         endif
174 282
 
175 283
     " Twig
176 284
         if count(g:spf13_bundle_groups, 'twig')
177  
-            Bundle 'beyondwords/vim-twig'
  285
+            if !exists("g:override_spf13_bundle_vim_twig")
  286
+                Bundle 'beyondwords/vim-twig'
  287
+            endif
178 288
         endif
179 289
     endif
180 290
 " }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.