Browse Source

Remove several unused git plugins

Most plugins are not used anymore; some (eg. pathogen) have been
replaced by native Vim features, some will be replaced using new Vim's
plugin system.
Alois Mahdal 2 years ago
parent
commit
2631c131f6
83 changed files with 0 additions and 19820 deletions
  1. 0
    328
      dotfiles/vim/autoload/pathogen.vim
  2. 0
    257
      dotfiles/vim/bundle/fugitive/doc/fugitive.txt
  3. 0
    2041
      dotfiles/vim/bundle/fugitive/plugin/fugitive.vim
  4. 0
    1
      dotfiles/vim/bundle/html5.vim
  5. 0
    1
      dotfiles/vim/bundle/lh-vim-lib/.VimballRecord
  6. 0
    150
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/askvim.vim
  7. 0
    102
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/buffer.vim
  8. 0
    271
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/buffer/dialog.vim
  9. 0
    226
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/command.vim
  10. 0
    97
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/common.vim
  11. 0
    78
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/encoding.vim
  12. 0
    78
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/env.vim
  13. 0
    70
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/event.vim
  14. 0
    120
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/float.vim
  15. 0
    217
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/function.vim
  16. 0
    179
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/graph/tsort.vim
  17. 0
    95
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/icomplete.vim
  18. 0
    376
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/list.vim
  19. 0
    477
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/menu.vim
  20. 0
    127
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/option.vim
  21. 0
    366
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/path.vim
  22. 0
    96
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/position.vim
  23. 0
    153
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/syntax.vim
  24. 0
    58
      dotfiles/vim/bundle/lh-vim-lib/autoload/lh/visual.vim
  25. 0
    1368
      dotfiles/vim/bundle/lh-vim-lib/doc/lh-vim-lib.txt
  26. 0
    139
      dotfiles/vim/bundle/lh-vim-lib/doc/tags
  27. 0
    6778
      dotfiles/vim/bundle/lh-vim-lib/lh-vim-lib-3.1.1.vmb
  28. 0
    10
      dotfiles/vim/bundle/lh-vim-lib/lh-vim-lib-addon-info.txt
  29. 0
    20
      dotfiles/vim/bundle/lh-vim-lib/lh-vim-lib.README
  30. 0
    87
      dotfiles/vim/bundle/lh-vim-lib/macros/menu-map.vim
  31. 0
    60
      dotfiles/vim/bundle/lh-vim-lib/mkVba/mk-lh-vim-lib.vim
  32. 0
    57
      dotfiles/vim/bundle/lh-vim-lib/plugin/let.vim
  33. 0
    48
      dotfiles/vim/bundle/lh-vim-lib/plugin/lhvl.vim
  34. 0
    490
      dotfiles/vim/bundle/lh-vim-lib/plugin/ui-functions.vim
  35. 0
    105
      dotfiles/vim/bundle/lh-vim-lib/plugin/words_tools.vim
  36. 0
    288
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/function.vim
  37. 0
    167
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/list.vim
  38. 0
    180
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/path.vim
  39. 0
    85
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-Fargs2String.vim
  40. 0
    67
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-askmenu.vim
  41. 0
    69
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-command.vim
  42. 0
    56
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-menu-map.vim
  43. 0
    86
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-toggle-menu.vim
  44. 0
    122
      dotfiles/vim/bundle/lh-vim-lib/tests/lh/topological-sort.vim
  45. 0
    56
      dotfiles/vim/bundle/perlcritic/ftplugin/perl/perlcritic.vim
  46. 0
    1
      dotfiles/vim/bundle/python-syntax
  47. 0
    1
      dotfiles/vim/bundle/syntastic
  48. 0
    1
      dotfiles/vim/bundle/targets
  49. 0
    3
      dotfiles/vim/bundle/tracwiki/ftdetect/tracwiki.vim
  50. 0
    114
      dotfiles/vim/bundle/tracwiki/syntax/tracwiki.vim
  51. 0
    1
      dotfiles/vim/bundle/vim-airline
  52. 0
    1
      dotfiles/vim/bundle/vim-airline-themes
  53. 0
    88
      dotfiles/vim/bundle/vim-flake8/README.mdown
  54. 0
    102
      dotfiles/vim/bundle/vim-flake8/ftplugin/python_flake8.vim
  55. 0
    1
      dotfiles/vim/bundle/vim-gitgutter
  56. 0
    27
      dotfiles/vim/bundle/vim-gutentags/.github/ISSUE_TEMPLATE/bug_report.md
  57. 0
    1
      dotfiles/vim/bundle/vim-gutentags/.gitignore
  58. 0
    3
      dotfiles/vim/bundle/vim-gutentags/.hgignore
  59. 0
    1
      dotfiles/vim/bundle/vim-gutentags/.hgtags
  60. 0
    60
      dotfiles/vim/bundle/vim-gutentags/CONTRIBUTING.md
  61. 0
    23
      dotfiles/vim/bundle/vim-gutentags/LICENSE
  62. 0
    81
      dotfiles/vim/bundle/vim-gutentags/README.md
  63. 0
    705
      dotfiles/vim/bundle/vim-gutentags/autoload/gutentags.vim
  64. 0
    93
      dotfiles/vim/bundle/vim-gutentags/autoload/gutentags/cscope.vim
  65. 0
    294
      dotfiles/vim/bundle/vim-gutentags/autoload/gutentags/ctags.vim
  66. 0
    122
      dotfiles/vim/bundle/vim-gutentags/autoload/gutentags/gtags_cscope.vim
  67. 0
    728
      dotfiles/vim/bundle/vim-gutentags/doc/gutentags.txt
  68. 0
    124
      dotfiles/vim/bundle/vim-gutentags/plat/unix/update_scopedb.sh
  69. 0
    155
      dotfiles/vim/bundle/vim-gutentags/plat/unix/update_tags.sh
  70. 0
    120
      dotfiles/vim/bundle/vim-gutentags/plat/win32/update_scopedb.cmd
  71. 0
    191
      dotfiles/vim/bundle/vim-gutentags/plat/win32/update_tags.cmd
  72. 0
    114
      dotfiles/vim/bundle/vim-gutentags/plugin/gutentags.vim
  73. 0
    2
      dotfiles/vim/bundle/vim-gutentags/res/ctags_recursive.options
  74. 0
    1
      dotfiles/vim/bundle/vim-jinja
  75. 0
    1
      dotfiles/vim/bundle/vim-less
  76. 0
    1
      dotfiles/vim/bundle/vim-markdown
  77. 0
    3
      dotfiles/vim/bundle/vim-moin/filetype.vim
  78. 0
    143
      dotfiles/vim/bundle/vim-moin/syntax/moin.vim
  79. 0
    1
      dotfiles/vim/bundle/vim-pairs
  80. 0
    1
      dotfiles/vim/bundle/vim-swap
  81. 0
    1
      dotfiles/vim/bundle/vimtodo
  82. 0
    187
      dotfiles/vim/plugin/local_vimrc.vim
  83. 0
    22
      dotfiles/vim/vimrc

+ 0
- 328
dotfiles/vim/autoload/pathogen.vim View File

@@ -1,328 +0,0 @@
1
-" pathogen.vim - path option manipulation
2
-" Maintainer:   Tim Pope <http://tpo.pe/>
3
-" Version:      2.2
4
-
5
-" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
6
-"
7
-" For management of individually installed plugins in ~/.vim/bundle (or
8
-" ~\vimfiles\bundle), adding `call pathogen#infect()` to the top of your
9
-" .vimrc is the only other setup necessary.
10
-"
11
-" The API is documented inline below.  For maximum ease of reading,
12
-" :set foldmethod=marker
13
-
14
-if exists("g:loaded_pathogen") || &cp
15
-  finish
16
-endif
17
-let g:loaded_pathogen = 1
18
-
19
-function! s:warn(msg)
20
-  if &verbose
21
-    echohl WarningMsg
22
-    echomsg a:msg
23
-    echohl NONE
24
-  endif
25
-endfunction
26
-
27
-" Point of entry for basic default usage.  Give a relative path to invoke
28
-" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke
29
-" pathogen#surround().  For backwards compatibility purposes, a full path that
30
-" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories()
31
-" instead.
32
-function! pathogen#infect(...) abort " {{{1
33
-  for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}']
34
-    if path =~# '^[^\\/]\+$'
35
-      call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
36
-      call pathogen#incubate(path . '/{}')
37
-    elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$'
38
-      call pathogen#incubate(path)
39
-    elseif path =~# '[\\/]\%({}\|\*\)$'
40
-      call pathogen#surround(path)
41
-    else
42
-      call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
43
-      call pathogen#surround(path . '/{}')
44
-    endif
45
-  endfor
46
-  call pathogen#cycle_filetype()
47
-  return ''
48
-endfunction " }}}1
49
-
50
-" Split a path into a list.
51
-function! pathogen#split(path) abort " {{{1
52
-  if type(a:path) == type([]) | return a:path | endif
53
-  let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
54
-  return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
55
-endfunction " }}}1
56
-
57
-" Convert a list to a path.
58
-function! pathogen#join(...) abort " {{{1
59
-  if type(a:1) == type(1) && a:1
60
-    let i = 1
61
-    let space = ' '
62
-  else
63
-    let i = 0
64
-    let space = ''
65
-  endif
66
-  let path = ""
67
-  while i < a:0
68
-    if type(a:000[i]) == type([])
69
-      let list = a:000[i]
70
-      let j = 0
71
-      while j < len(list)
72
-        let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
73
-        let path .= ',' . escaped
74
-        let j += 1
75
-      endwhile
76
-    else
77
-      let path .= "," . a:000[i]
78
-    endif
79
-    let i += 1
80
-  endwhile
81
-  return substitute(path,'^,','','')
82
-endfunction " }}}1
83
-
84
-" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
85
-function! pathogen#legacyjoin(...) abort " {{{1
86
-  return call('pathogen#join',[1] + a:000)
87
-endfunction " }}}1
88
-
89
-" Remove duplicates from a list.
90
-function! pathogen#uniq(list) abort " {{{1
91
-  let i = 0
92
-  let seen = {}
93
-  while i < len(a:list)
94
-    if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
95
-      call remove(a:list,i)
96
-    elseif a:list[i] ==# ''
97
-      let i += 1
98
-      let empty = 1
99
-    else
100
-      let seen[a:list[i]] = 1
101
-      let i += 1
102
-    endif
103
-  endwhile
104
-  return a:list
105
-endfunction " }}}1
106
-
107
-" \ on Windows unless shellslash is set, / everywhere else.
108
-function! pathogen#separator() abort " {{{1
109
-  return !exists("+shellslash") || &shellslash ? '/' : '\'
110
-endfunction " }}}1
111
-
112
-" Convenience wrapper around glob() which returns a list.
113
-function! pathogen#glob(pattern) abort " {{{1
114
-  let files = split(glob(a:pattern),"\n")
115
-  return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
116
-endfunction "}}}1
117
-
118
-" Like pathogen#glob(), only limit the results to directories.
119
-function! pathogen#glob_directories(pattern) abort " {{{1
120
-  return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
121
-endfunction "}}}1
122
-
123
-" Turn filetype detection off and back on again if it was already enabled.
124
-function! pathogen#cycle_filetype() " {{{1
125
-  if exists('g:did_load_filetypes')
126
-    filetype off
127
-    filetype on
128
-  endif
129
-endfunction " }}}1
130
-
131
-" Check if a bundle is disabled.  A bundle is considered disabled if it ends
132
-" in a tilde or its basename or full name is included in the list
133
-" g:pathogen_disabled.
134
-function! pathogen#is_disabled(path) " {{{1
135
-  if a:path =~# '\~$'
136
-    return 1
137
-  elseif !exists("g:pathogen_disabled")
138
-    return 0
139
-  endif
140
-  let sep = pathogen#separator()
141
-  let blacklist = g:pathogen_disabled
142
-  return index(blacklist, strpart(a:path, strridx(a:path, sep)+1)) != -1 && index(blacklist, a:path) != 1
143
-endfunction "}}}1
144
-
145
-" Prepend the given directory to the runtime path and append its corresponding
146
-" after directory.  If the directory is already included, move it to the
147
-" outermost position.  Wildcards are added as is.  Ending a path in /{} causes
148
-" all subdirectories to be added (except those in g:pathogen_disabled).
149
-function! pathogen#surround(path) abort " {{{1
150
-  let sep = pathogen#separator()
151
-  let rtp = pathogen#split(&rtp)
152
-  if a:path =~# '[\\/]{}$'
153
-    let path = fnamemodify(a:path[0:-4], ':p:s?[\\/]\=$??')
154
-    let before = filter(pathogen#glob_directories(path.sep.'*'), '!pathogen#is_disabled(v:val)')
155
-    let after  = filter(reverse(pathogen#glob_directories(path.sep."*".sep."after")), '!pathogen#is_disabled(v:val[0:-7])')
156
-    call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
157
-  else
158
-    let path = fnamemodify(a:path, ':p:s?[\\/]\=$??')
159
-    let before = [path]
160
-    let after = [path . sep . 'after']
161
-    call filter(rtp, 'index(before + after, v:val) == -1')
162
-  endif
163
-  let &rtp = pathogen#join(before, rtp, after)
164
-  return &rtp
165
-endfunction " }}}1
166
-
167
-" Prepend all subdirectories of path to the rtp, and append all 'after'
168
-" directories in those subdirectories.  Deprecated.
169
-function! pathogen#runtime_prepend_subdirectories(path) " {{{1
170
-  call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#surround('.string(a:path.'/{}').')')
171
-  return pathogen#surround(a:path . pathogen#separator() . '{}')
172
-endfunction " }}}1
173
-
174
-" For each directory in the runtime path, add a second entry with the given
175
-" argument appended.  If the argument ends in '/{}', add a separate entry for
176
-" each subdirectory.  The default argument is 'bundle/{}', which means that
177
-" .vim/bundle/*, $VIM/vimfiles/bundle/*, $VIMRUNTIME/bundle/*,
178
-" $VIM/vim/files/bundle/*/after, and .vim/bundle/*/after will be added (on
179
-" UNIX).
180
-function! pathogen#incubate(...) abort " {{{1
181
-  let sep = pathogen#separator()
182
-  let name = a:0 ? a:1 : 'bundle/{}'
183
-  if "\n".s:done_bundles =~# "\\M\n".name."\n"
184
-    return ""
185
-  endif
186
-  let s:done_bundles .= name . "\n"
187
-  let list = []
188
-  for dir in pathogen#split(&rtp)
189
-    if dir =~# '\<after$'
190
-      if name =~# '{}$'
191
-        let list +=  filter(pathogen#glob_directories(substitute(dir,'after$',name[0:-3],'').'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
192
-      else
193
-        let list += [dir, substitute(dir, 'after$', '', '') . name . sep . 'after']
194
-      endif
195
-    else
196
-      if name =~# '{}$'
197
-        let list +=  [dir] + filter(pathogen#glob_directories(dir.sep.name[0:-3].'*[^~]'), '!pathogen#is_disabled(v:val)')
198
-      else
199
-        let list += [dir . sep . name, dir]
200
-      endif
201
-    endif
202
-  endfor
203
-  let &rtp = pathogen#join(pathogen#uniq(list))
204
-  return 1
205
-endfunction " }}}1
206
-
207
-" Deprecated alias for pathogen#incubate().
208
-function! pathogen#runtime_append_all_bundles(...) abort " {{{1
209
-  if a:0
210
-    call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#incubate('.string(a:1.'/{}').')')
211
-  else
212
-    call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#incubate()')
213
-  endif
214
-  return call('pathogen#incubate', map(copy(a:000),'v:val . "/{}"'))
215
-endfunction
216
-
217
-let s:done_bundles = ''
218
-" }}}1
219
-
220
-" Invoke :helptags on all non-$VIM doc directories in runtimepath.
221
-function! pathogen#helptags() abort " {{{1
222
-  let sep = pathogen#separator()
223
-  for glob in pathogen#split(&rtp)
224
-    for dir in split(glob(glob), "\n")
225
-      if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
226
-        helptags `=dir.'/doc'`
227
-      endif
228
-    endfor
229
-  endfor
230
-endfunction " }}}1
231
-
232
-command! -bar Helptags :call pathogen#helptags()
233
-
234
-" Execute the given command.  This is basically a backdoor for --remote-expr.
235
-function! pathogen#execute(...) abort " {{{1
236
-  for command in a:000
237
-    execute command
238
-  endfor
239
-  return ''
240
-endfunction " }}}1
241
-
242
-" Like findfile(), but hardcoded to use the runtimepath.
243
-function! pathogen#runtime_findfile(file,count) abort "{{{1
244
-  let rtp = pathogen#join(1,pathogen#split(&rtp))
245
-  let file = findfile(a:file,rtp,a:count)
246
-  if file ==# ''
247
-    return ''
248
-  else
249
-    return fnamemodify(file,':p')
250
-  endif
251
-endfunction " }}}1
252
-
253
-" Backport of fnameescape().
254
-function! pathogen#fnameescape(string) abort " {{{1
255
-  if exists('*fnameescape')
256
-    return fnameescape(a:string)
257
-  elseif a:string ==# '-'
258
-    return '\-'
259
-  else
260
-    return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
261
-  endif
262
-endfunction " }}}1
263
-
264
-if exists(':Vedit')
265
-  finish
266
-endif
267
-
268
-let s:vopen_warning = 0
269
-
270
-function! s:find(count,cmd,file,lcd) " {{{1
271
-  let rtp = pathogen#join(1,pathogen#split(&runtimepath))
272
-  let file = pathogen#runtime_findfile(a:file,a:count)
273
-  if file ==# ''
274
-    return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
275
-  endif
276
-  if !s:vopen_warning
277
-    let s:vopen_warning = 1
278
-    let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
279
-  else
280
-    let warning = ''
281
-  endif
282
-  if a:lcd
283
-    let path = file[0:-strlen(a:file)-2]
284
-    execute 'lcd `=path`'
285
-    return a:cmd.' '.pathogen#fnameescape(a:file) . warning
286
-  else
287
-    return a:cmd.' '.pathogen#fnameescape(file) . warning
288
-  endif
289
-endfunction " }}}1
290
-
291
-function! s:Findcomplete(A,L,P) " {{{1
292
-  let sep = pathogen#separator()
293
-  let cheats = {
294
-        \'a': 'autoload',
295
-        \'d': 'doc',
296
-        \'f': 'ftplugin',
297
-        \'i': 'indent',
298
-        \'p': 'plugin',
299
-        \'s': 'syntax'}
300
-  if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
301
-    let request = cheats[a:A[0]].a:A[1:-1]
302
-  else
303
-    let request = a:A
304
-  endif
305
-  let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
306
-  let found = {}
307
-  for path in pathogen#split(&runtimepath)
308
-    let path = expand(path, ':p')
309
-    let matches = split(glob(path.sep.pattern),"\n")
310
-    call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
311
-    call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
312
-    for match in matches
313
-      let found[match] = 1
314
-    endfor
315
-  endfor
316
-  return sort(keys(found))
317
-endfunction " }}}1
318
-
319
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve       :execute s:find(<count>,'edit<bang>',<q-args>,0)
320
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit    :execute s:find(<count>,'edit<bang>',<q-args>,0)
321
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen    :execute s:find(<count>,'edit<bang>',<q-args>,1)
322
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit   :execute s:find(<count>,'split',<q-args>,<bang>1)
323
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit  :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
324
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
325
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit   :execute s:find(<count>,'pedit',<q-args>,<bang>1)
326
-command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread    :execute s:find(<count>,'read',<q-args>,<bang>1)
327
-
328
-" vim:set et sw=2:

+ 0
- 257
dotfiles/vim/bundle/fugitive/doc/fugitive.txt View File

@@ -1,257 +0,0 @@
1
-*fugitive.txt*  A Git wrapper so awesome, it should be illegal
2
-
3
-Author:  Tim Pope <vimNOSPAM@tpope.org>         *fugitive-author*
4
-License: Same terms as Vim itself (see |license|)
5
-
6
-This plugin is only available if 'compatible' is not set.
7
-
8
-INTRODUCTION                                    *fugitive*
9
-
10
-Install in ~/.vim, or in ~\vimfiles if you're on Windows and feeling lucky.
11
-Vim 7.2 is recommended as it ships with syntax highlighting for many Git file
12
-types.
13
-
14
-If you're in a hurry to get started, here are some things to try:
15
-
16
-In any file in your repository, run |:Gedit| HEAD.  Press <CR> to jump to the
17
-current branch.  Press <CR> again to jump to the top most commit.  Keep using
18
-<CR> to explore parent commits, trees, and blobs.  Use C in a tree or blob to
19
-get back to the commit.
20
-
21
-Edit a file in the work tree and make some changes.  Use |:Gdiff| to open up
22
-the indexed version.  Use |do| and |dp| on various hunks to bring the files in
23
-sync, or use |:Gread| to pull in all changes.  Write the indexed version to
24
-stage the file.
25
-
26
-Run |:Gstatus| to check your repository's status.  Use "-" to stage and reset
27
-files and "p" to add/reset --patch them.  Invoke |:Gcommit| to commit your
28
-changes.
29
-
30
-Run |:Gblame| in a work tree file to see a blame in a vertical split.  Press
31
-<CR> on any line to reopen and reblame that file as it stood in that commit.
32
-Press o or O on any line to inspect that commit in a split or a tab.
33
-
34
-Run |:Ggrep| to search the work tree or history.  Run |:Gmove| to rename a
35
-file.  Run |:Gremove| to delete a file.
36
-
37
-COMMANDS                                        *fugitive-commands*
38
-
39
-These commands are local to the buffers in which they work (generally, buffers
40
-that are part of Git repositories).
41
-
42
-                                                *fugitive-:Git*
43
-:Git [args]             Run an arbitrary git command. Similar to :!git [args]
44
-                        but chdir to the repository tree first.
45
-
46
-                                                *fugitive-:Gcd*
47
-:Gcd [directory]        |:cd| relative to the repository.
48
-
49
-                                                *fugitive-:Glcd*
50
-:Glcd [directory]       |:lcd| relative to the repository.
51
-
52
-                                                *fugitive-:Gstatus*
53
-:Gstatus                Bring up the output of git-status in the preview
54
-                        window.  In addition to standard motions, you can
55
-                        use <C-N> and <C-P> to jump from filename to
56
-                        filename.  Press C to invoke |:Gcommit|.  Press D to
57
-                        |:Gdiff| the file on the cursor line, or ds to
58
-                        |:Gsdiff|.  Press - to stage or unstage the file on
59
-                        the cursor line.  Press p to do so on a per hunk basis
60
-                        (--patch).  All of D, -, and p have a different,
61
-                        sensible (and hopefully intuitive) behavior when
62
-                        invoked on a heading rather than a file name.
63
-
64
-                                                *fugitive-:Gcommit*
65
-:Gcommit [args]         A wrapper around git-commit.  If there is nothing
66
-                        to commit, |:Gstatus| is called instead.  Unless the
67
-                        arguments given would skip the invocation of an editor
68
-                        (e.g., -m), a split window will be used to obtain a
69
-                        commit message.  Write and close that window (:wq or
70
-                        |:Gwrite|) to finish the commit.  Unlike when running
71
-                        the actual git-commit command, it is possible (but
72
-                        unadvisable) to muck with the index with commands like
73
-                        git-add and git-reset while a commit message is
74
-                        pending.
75
-
76
-                                                *fugitive-:Ggrep*
77
-:Ggrep [args]           |:grep| with git-grep as 'grepprg'.
78
-
79
-                                                *fugitive-:Glog*
80
-:Glog [args]            Load all previous revisions of the current file into
81
-                        the quickfix list.  Additional git-log arguments can
82
-                        be given (for example, --reverse).  If "--" appears as
83
-                        an argument, no file specific filtering is done, and
84
-                        commits are loaded into the quickfix list.
85
-
86
-                                        *fugitive-:Gedit* *fugitive-:Ge*
87
-:Gedit [revision]       |:edit| a |fugitive-revision|.
88
-
89
-                                                *fugitive-:Gsplit*
90
-:Gsplit [revision]      |:split| a |fugitive-revision|.
91
-
92
-                                                *fugitive-:Gvsplit*
93
-:Gvsplit [revision]     |:vsplit| a |fugitive-revision|.
94
-
95
-                                                *fugitive-:Gtabedit*
96
-:Gtabedit [revision]    |:tabedit| a |fugitive-revision|
97
-
98
-                                                *fugitive-:Gpedit*
99
-:Gpedit [revision]      |:pedit| a |fugitive-revision|
100
-
101
-                                                *fugitive-:Gread*
102
-:Gread [revision]       Empty the buffer and |:read| a |fugitive-revision|.
103
-                        When the argument is omitted, this is similar to
104
-                        git-checkout on a work tree file or git-add on a stage
105
-                        file, but without writing anything to disk.
106
-
107
-:{range}Gread [revision]
108
-                        |:read| in a |fugitive-revision| after {range}.
109
-
110
-                                                *fugitive-:Gwrite*
111
-:Gwrite                 Write to the current file's path and stage the results.
112
-                        When run in a work tree file, it is effectively git
113
-                        add.  Elsewhere, it is effectively git-checkout.  A
114
-                        great deal of effort is expended to behave sensibly
115
-                        when the work tree or index version of the file is
116
-                        open in another buffer.
117
-
118
-:Gwrite {path}          You can give |:Gwrite| an explicit path of where in
119
-                        the work tree to write.  You can also give a path like
120
-                        :0:foo.txt or even :0 to write to just that stage in
121
-                        the index.
122
-
123
-                                                *fugitive-:Gwq*
124
-:Gwq [path]             Like |:Gwrite| followed by |:quit| if the write
125
-                        succeeded.
126
-
127
-:Gwq! [path]            Like |:Gwrite|! followed by |:quit|! if the write
128
-                        succeeded.
129
-
130
-                                                *fugitive-:Gdiff*
131
-:Gdiff [revision]       Perform a |vimdiff| against the current file in the
132
-                        given revision.  With no argument, the version in the
133
-                        index is used (which means a three-way diff during a
134
-                        merge conflict, making it a git-mergetool
135
-                        alternative).  The newer of the two files is placed
136
-                        to the right.  Use |do| and |dp| and write to the
137
-                        index file to simulate "git add --patch".
138
-
139
-                                                *fugitive-:Gsdiff*
140
-:Gsdiff [revision]      Like |:Gdiff|, but split horizontally.
141
-
142
-                                                *fugitive-:Gvdiff*
143
-:Gvdiff [revision]      Identical to |:Gdiff|.  For symmetry with |:Gsdiff|.
144
-
145
-                                                *fugitive-:Gmove*
146
-:Gmove {destination}    Wrapper around git-mv that renames the buffer
147
-                        afterward.  The destination is relative to the current
148
-                        directory except when started with a /, in which case
149
-                        it is relative to the work tree.  Add a ! to pass -f.
150
-
151
-                                                *fugitive-:Gremove*
152
-:Gremove                Wrapper around git-rm that deletes the buffer
153
-                        afterward.  When invoked in an index file, --cached is
154
-                        passed.  Add a ! to pass -f and forcefully discard the
155
-                        buffer.
156
-
157
-                                                *fugitive-:Gblame*
158
-:Gblame [flags]         Run git-blame on the file and open the results in a
159
-                        scroll bound vertical split.  Press enter on a line to
160
-                        reblame the file as it was in that commit.  You can
161
-                        give any of ltwfsMC as flags and they will be passed
162
-                        along to git-blame.
163
-
164
-:[range]Gblame [flags]  Run git-blame on the given range.
165
-
166
-                                                *fugitive-:Gbrowse*
167
-:[range]Gbrowse         If the remote for the current branch is on GitHub,
168
-                        open the current file, blob, tree, commit, or tag
169
-                        (with git-web--browse) on GitHub.  Otherwise, open the
170
-                        current file, blob, tree, commit, or tag in
171
-                        git-instaweb (if you have issues, verify you can run
172
-                        "git instaweb" from a terminal).  If a range is given,
173
-                        it is appropriately appended to the URL as an anchor.
174
-
175
-:[range]Gbrowse!        Like :Gbrowse, but put the URL on the clipboard rather
176
-                        than opening it.
177
-
178
-:[range]Gbrowse {revision}
179
-                        Like :Gbrowse, but for a given |fugitive-revision|.  A
180
-                        useful value here is -, which ties the URL to the
181
-                        latest commit rather than a volatile branch.
182
-
183
-:[range]Gbrowse [...]@{remote}
184
-                        Force using the given remote rather than the remote
185
-                        for the current branch.  The remote is used to
186
-                        determine which GitHub repository to link to.
187
-
188
-MAPPINGS                                        *fugitive-mappings*
189
-
190
-These maps are available in Git objects.
191
-
192
-                                                *fugitive-<CR>*
193
-<CR>                    Jump to the revision under the cursor.
194
-
195
-                                                *fugitive-o*
196
-o                       Jump to the revision under the cursor in a new split.
197
-
198
-                                                *fugitive-O*
199
-O                       Jump to the revision under the cursor in a new tab.
200
-
201
-                                                *fugitive-~*
202
-~                       Go to the current file in the [count]th first
203
-                        ancestor.
204
-
205
-                                                *fugitive-P*
206
-P                       Go to the current file in the [count]th parent.
207
-
208
-                                                *fugitive-C*
209
-C                       Go to the commit containing the current file.
210
-
211
-                                                *fugitive-a*
212
-a                       Show the current tag, commit, or tree in an alternate
213
-                        format.
214
-
215
-SPECIFYING REVISIONS                            *fugitive-revision*
216
-
217
-Fugitive revisions are similar to Git revisions as defined in the "SPECIFYING
218
-REVISIONS" section in the git-rev-parse man page.  For commands that accept an
219
-optional revision, the default is the file in the index for work tree files
220
-and the work tree file for everything else.  Example revisions follow.
221
-
222
-Revision        Meaning ~
223
-HEAD            .git/HEAD
224
-master          .git/refs/heads/master
225
-HEAD^{}         The commit referenced by HEAD
226
-HEAD^           The parent of the commit referenced by HEAD
227
-HEAD:           The tree referenced by HEAD
228
-/HEAD           The file named HEAD in the work tree
229
-Makefile        The file named Makefile in the work tree
230
-HEAD^:Makefile  The file named Makefile in the parent of HEAD
231
-:Makefile       The file named Makefile in the index (writable)
232
--               The current file in HEAD
233
-^               The current file in the previous commit
234
-~3              The current file 3 commits ago
235
-:               .git/index (Same as |:Gstatus|)
236
-:0              The current file in the index
237
-:1              The current file's common ancestor during a conflict
238
-:2              The current file in the target branch during a conflict
239
-:3              The current file in the merged branch during a conflict
240
-:/foo           The most recent commit with "foo" in the message
241
-
242
-STATUSLINE                                      *fugitive-statusline*
243
-
244
-                                                *fugitive#statusline()*
245
-Add %{fugitive#statusline()} to your statusline to get an indicator including
246
-the current branch and the currently edited file's commit.  If you don't have
247
-a statusline, this one matches the default when 'ruler' is set:
248
->
249
-    set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P
250
-<
251
-ABOUT                                           *fugitive-about*
252
-
253
-Grab the latest version or report a bug on GitHub:
254
-
255
-http://github.com/tpope/vim-fugitive
256
-
257
- vim:tw=78:et:ft=help:norl:

+ 0
- 2041
dotfiles/vim/bundle/fugitive/plugin/fugitive.vim
File diff suppressed because it is too large
View File


+ 0
- 1
dotfiles/vim/bundle/html5.vim

@@ -1 +0,0 @@
1
-Subproject commit 3db896baa26839b866db3db5d8997cc830874a24

+ 0
- 1
dotfiles/vim/bundle/lh-vim-lib/.VimballRecord View File

@@ -1 +0,0 @@
1
-lh-vim-lib-3.1.1.vmb: call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/askvim.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/buffer.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/buffer/dialog.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/command.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/common.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/encoding.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/env.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/event.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/float.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/function.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/graph/tsort.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/icomplete.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/list.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/menu.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/option.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/path.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/position.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/syntax.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//autoload/lh/visual.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//doc/lh-vim-lib.txt')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//lh-vim-lib-addon-info.txt')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//lh-vim-lib.README')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//macros/menu-map.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//mkVba/mk-lh-vim-lib.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//plugin/let.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//plugin/lhvl.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//plugin/ui-functions.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//plugin/words_tools.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/function.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/list.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/path.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/test-Fargs2String.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/test-askmenu.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/test-command.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/test-menu-map.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/test-toggle-menu.vim')|call delete('/home/lennycz/Dropbox/Config/dotfiles/vim/bundle/lh-vim-lib/.//tests/lh/topological-sort.vim')

+ 0
- 150
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/askvim.vim View File

@@ -1,150 +0,0 @@
1
-"=============================================================================
2
-" $Id: askvim.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/askvim.vim                                    {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	17th Apr 2007
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (17th Apr 2007)
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Defines functions that asks vim what it is relinquish to tell us
14
-" 	- menu
15
-" 
16
-"------------------------------------------------------------------------
17
-" Installation:	
18
-" 	Drop it into {rtp}/autoload/lh/
19
-" 	Vim 7+ required.
20
-" History:	
21
-" 	v2.0.0:
22
-" 	v3.0.0: GPLv3
23
-" TODO:		«missing features»
24
-" }}}1
25
-"=============================================================================
26
-
27
-
28
-"=============================================================================
29
-let s:cpo_save=&cpo
30
-set cpo&vim
31
-
32
-"------------------------------------------------------------------------
33
-" ## Functions {{{1
34
-" # Debug {{{2
35
-function! lh#askvim#verbose(level)
36
-  let s:verbose = a:level
37
-endfunction
38
-
39
-function! s:Verbose(expr)
40
-  if exists('s:verbose') && s:verbose
41
-    echomsg a:expr
42
-  endif
43
-endfunction
44
-
45
-function! lh#askvim#debug(expr)
46
-  return eval(a:expr)
47
-endfunction
48
-
49
-"------------------------------------------------------------------------
50
-" # Public {{{2
51
-" Function: lh#askvim#exe(command) {{{3
52
-function! lh#askvim#Exe(command)
53
-  echomsg 'lh#askvim#Exe() is deprecated, use lh#askvim#exe()'
54
-  return lh#askvim#exe(a:command)
55
-endfunction
56
-
57
-function! lh#askvim#exe(command)
58
-  let save_a = @a
59
-  try 
60
-    silent! redir @a
61
-    silent! exe a:command
62
-    redir END
63
-  finally
64
-    " Always restore everything
65
-    let res = @a
66
-    let @a = save_a
67
-    return res
68
-  endtry
69
-endfunction
70
-
71
-
72
-" Function: lh#askvim#menu(menuid) {{{3
73
-function! s:AskOneMenu(menuact, res)
74
-  let sKnown_menus = lh#askvim#exe(a:menuact)
75
-  let lKnown_menus = split(sKnown_menus, '\n')
76
-  " echo string(lKnown_menus)
77
-
78
-  " 1- search for the menuid
79
-  " todo: fix the next line to correctly interpret "stuff\.stuff" and
80
-  " "stuff\\.stuff".
81
-  let menuid_parts = split(a:menuact, '\.')
82
-
83
-  let simplifiedKnown_menus = deepcopy(lKnown_menus)
84
-  call map(simplifiedKnown_menus, 'substitute(v:val, "&", "", "g")')
85
-  " let idx = lh#list#match(simplifiedKnown_menus, '^\d\+\s\+'.menuid_parts[-1])
86
-  let idx = match(simplifiedKnown_menus, '^\d\+\s\+'.menuid_parts[-1])
87
-  if idx == -1
88
-    " echo "not found"
89
-    return
90
-  endif
91
-  " echo "l[".idx."]=".lKnown_menus[idx]
92
-
93
-  if empty(a:res)
94
-    let a:res.priority = matchstr(lKnown_menus[idx], '\d\+\ze\s\+.*')
95
-    let a:res.name     = matchstr(lKnown_menus[idx], '\d\+\s\+\zs.*')
96
-    let a:res.actions  = {}
97
-  " else
98
-  "   what if the priority isn't the same?
99
-  endif
100
-
101
-  " 2- search for the menu definition
102
-  let idx += 1
103
-  while idx != len(lKnown_menus)
104
-    echo "l[".idx."]=".lKnown_menus[idx]
105
-    " should not happen
106
-    if lKnown_menus[idx] =~ '^\d\+' | break | endif
107
-
108
-    " :h showing-menus
109
-    " -> The format of the result of the call to Exe() seems to be:
110
-    "    ^ssssMns-sACTION$
111
-    "    s == 1 whitespace
112
-    "    M == mode (inrvcs)
113
-    "    n == noremap(*)/script(&)
114
-    "    - == disable(-)/of not
115
-    let act = {}
116
-    let menu_def = matchlist(lKnown_menus[idx],
117
-	  \ '^\s*\([invocs]\)\([&* ]\) \([- ]\) \(.*\)$')
118
-    if len(menu_def) > 4
119
-      let act.mode        = menu_def[1]
120
-      let act.nore_script = menu_def[2]
121
-      let act.disabled    = menu_def[3]
122
-      let act.action      = menu_def[4]
123
-    else
124
-      echomsg string(menu_def)
125
-      echoerr "lh#askvim#menu(): Cannot decode ``".lKnown_menus[idx]."''"
126
-    endif
127
-    
128
-    let a:res.actions["mode_" . act.mode] = act
129
-
130
-    let idx += 1
131
-  endwhile
132
-
133
-  " n- Return the result
134
-  return a:res
135
-endfunction
136
-
137
-function! lh#askvim#menu(menuid, modes)
138
-  let res = {}
139
-  let i = 0
140
-  while i != strlen(a:modes)
141
-    call s:AskOneMenu(a:modes[i].'menu '.a:menuid, res)
142
-    let i += 1
143
-  endwhile
144
-  return res
145
-endfunction
146
-" Functions }}}1
147
-"------------------------------------------------------------------------
148
-let &cpo=s:cpo_save
149
-"=============================================================================
150
-" vim600: set fdm=marker:

+ 0
- 102
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/buffer.vim View File

@@ -1,102 +0,0 @@
1
-"=============================================================================
2
-" $Id: buffer.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/buffer.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" Licence:      GPLv3
7
-" Version:	3.0.0
8
-" Created:	23rd Jan 2007
9
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
10
-"------------------------------------------------------------------------
11
-" Description:	
12
-" 	Defines functions that help finding windows and handling buffers.
13
-" 
14
-"------------------------------------------------------------------------
15
-" Installation:	
16
-" 	Drop it into {rtp}/autoload/lh/
17
-" 	Vim 7+ required.
18
-" History:	
19
-"	v1.0.0 First Version
20
-" 	(*) Functions moved from searchInRuntimeTime  
21
-" 	v2.2.0
22
-" 	(*) new function: lh#buffer#list()
23
-"       v3.0.0 GPLv3
24
-" TODO:	
25
-" }}}1
26
-"=============================================================================
27
-
28
-
29
-"=============================================================================
30
-let s:cpo_save=&cpo
31
-set cpo&vim
32
-
33
-" ## Functions {{{1
34
-"------------------------------------------------------------------------
35
-" # Debug {{{2
36
-function! lh#buffer#verbose(level)
37
-  let s:verbose = a:level
38
-endfunction
39
-
40
-function! s:Verbose(expr)
41
-  if exists('s:verbose') && s:verbose
42
-    echomsg a:expr
43
-  endif
44
-endfunction
45
-
46
-function! lh#buffer#debug(expr)
47
-  return eval(a:expr)
48
-endfunction
49
-
50
-"------------------------------------------------------------------------
51
-" # Public {{{2
52
-
53
-" Function: lh#buffer#find({filename}) {{{3
54
-" If {filename} is opened in a window, jump to this window, otherwise return -1
55
-" Moved from searchInRuntimeTime.vim
56
-function! lh#buffer#find(filename)
57
-  let b = bufwinnr(a:filename)
58
-  if b == -1 | return b | endif
59
-  exe b.'wincmd w'
60
-  return b
61
-endfunction
62
-function! lh#buffer#Find(filename)
63
-  return lh#buffer#find(a:filename)
64
-endfunction
65
-
66
-" Function: lh#buffer#jump({filename},{cmd}) {{{3
67
-function! lh#buffer#jump(filename, cmd)
68
-  if lh#buffer#find(a:filename) != -1 | return | endif
69
-  exe a:cmd . ' ' . a:filename
70
-endfunction
71
-function! lh#buffer#Jump(filename, cmd)
72
-  return lh#buffer#jump(a:filename, a:cmd)
73
-endfunction
74
-
75
-" Function: lh#buffer#scratch({bname},{where}) {{{3
76
-function! lh#buffer#scratch(bname, where)
77
-  try
78
-    silent exe a:where.' sp '.a:bname
79
-  catch /.*/
80
-    throw "Can't open a buffer named '".a:bname."'!"
81
-  endtry
82
-  setlocal bt=nofile bh=wipe nobl noswf ro
83
-endfunction
84
-function! lh#buffer#Scratch(bname, where)
85
-  return lh#buffer#scratch(a:bname, a:where)
86
-endfunction
87
-
88
-" Function: lh#buffer#list() {{{3
89
-function! lh#buffer#list()
90
-  let all = range(0, bufnr('$'))
91
-  " let res = lh#list#transform_if(all, [], 'v:1_', 'buflisted')
92
-  let res = lh#list#copy_if(all, [], 'buflisted')
93
-  return res
94
-endfunction
95
-" Ex: Names of the buffers listed
96
-"  -> echo lh#list#transform(lh#buffer#list(), [], "bufname")
97
-" Ex: wipeout empty buffers listed
98
-"  -> echo 'bw'.join(lh#list#copy_if(range(0, bufnr('$')), [], 'buflisted(v:1_) && empty(bufname(v:1_))'), ' ')
99
-"=============================================================================
100
-let &cpo=s:cpo_save
101
-"=============================================================================
102
-" vim600: set fdm=marker:

+ 0
- 271
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/buffer/dialog.vim View File

@@ -1,271 +0,0 @@
1
-"=============================================================================
2
-" $Id: dialog.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/buffer/dialog.vim                            {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	21st Sep 2007
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	«description»
13
-" 
14
-"------------------------------------------------------------------------
15
-" Installation:	
16
-" 	Drop it into {rtp}/autoload/lh/
17
-" 	Vim 7+ required.
18
-" History:	
19
-"	v1.0.0 First Version
20
-" 	(*) Functions imported from Mail_mutt_alias.vim
21
-"       v3.0.0  GPLv3
22
-" TODO:		
23
-" 	(*) --abort-- line
24
-" 	(*) custom messages
25
-" 	(*) do not mess with search history
26
-" 	(*) support any &magic
27
-" 	(*) syntax
28
-" 	(*) add number/letters
29
-" 	(*) tag with '[x] ' instead of '* '
30
-" }}}1
31
-"=============================================================================
32
-
33
-
34
-"=============================================================================
35
-let s:cpo_save=&cpo
36
-set cpo&vim
37
-
38
-
39
-
40
-"=============================================================================
41
-" ## Globals {{{1
42
-let s:LHdialog = {}
43
-
44
-"=============================================================================
45
-" ## Functions {{{1
46
-" # Debug {{{2
47
-function! lh#buffer#dialog#verbose(level)
48
-  let s:verbose = a:level
49
-endfunction
50
-
51
-function! s:Verbose(expr)
52
-  if exists('s:verbose') && s:verbose
53
-    echomsg a:expr
54
-  endif
55
-endfunction
56
-
57
-function! lh#buffer#dialog#debug(expr)
58
-  return eval(a:expr)
59
-endfunction
60
-
61
-
62
-"=============================================================================
63
-" # Dialog functions {{{2
64
-"------------------------------------------------------------------------
65
-function! s:Mappings(abuffer)
66
-  " map <enter> to edit a file, also dbl-click
67
-  exe "nnoremap <silent> <buffer> <esc>         :silent call ".a:abuffer.action."(-1, ".a:abuffer.id.")<cr>"
68
-  exe "nnoremap <silent> <buffer> q             :call lh#buffer#dialog#select(-1, ".a:abuffer.id.")<cr>"
69
-  exe "nnoremap <silent> <buffer> <cr>          :call lh#buffer#dialog#select(line('.'), ".a:abuffer.id.")<cr>"
70
-  " nnoremap <silent> <buffer> <2-LeftMouse> :silent call <sid>GrepEditFileLine(line("."))<cr>
71
-  " nnoremap <silent> <buffer> Q	  :call <sid>Reformat()<cr>
72
-  " nnoremap <silent> <buffer> <Left>	  :set tabstop-=1<cr>
73
-  " nnoremap <silent> <buffer> <Right>	  :set tabstop+=1<cr>
74
-  if a:abuffer.support_tagging
75
-    nnoremap <silent> <buffer> t	  :silent call <sid>ToggleTag(line("."))<cr>
76
-    nnoremap <silent> <buffer> <space>	  :silent call <sid>ToggleTag(line("."))<cr>
77
-  endif
78
-  nnoremap <silent> <buffer> <tab>	  :silent call <sid>NextChoice('')<cr>
79
-  nnoremap <silent> <buffer> <S-tab>	  :silent call <sid>NextChoice('b')<cr>
80
-  exe "nnoremap <silent> <buffer> h	  :silent call <sid>ToggleHelp(".a:abuffer.id.")<cr>"
81
-endfunction
82
-
83
-"----------------------------------------
84
-" Tag / untag the current choice {{{
85
-function! s:ToggleTag(lineNum)
86
-   if a:lineNum > s:Help_NbL()
87
-      " If tagged
88
-      if (getline(a:lineNum)[0] == '*')
89
-	let b:NbTags = b:NbTags - 1
90
-	silent exe a:lineNum.'s/^\* /  /e'
91
-      else
92
-	let b:NbTags = b:NbTags + 1
93
-	silent exe a:lineNum.'s/^  /* /e'
94
-      endif
95
-      " Move after the tag ; there is something with the two previous :s. They
96
-      " don't leave the cursor at the same position.
97
-      silent! normal! 3|
98
-      call s:NextChoice('') " move to the next choice
99
-    endif
100
-endfunction
101
-" }}}
102
-
103
-function! s:Help_NbL()
104
-  " return 1 + nb lines of BuildHelp
105
-  return 2 + len(b:dialog['help_'.b:dialog.help_type])
106
-endfunction
107
-"----------------------------------------
108
-" Go to the Next (/previous) possible choice. {{{
109
-function! s:NextChoice(direction)
110
-  " echomsg "next!"
111
-  call search('^[ *]\s*\zs\S\+', a:direction)
112
-endfunction
113
-" }}}
114
-
115
-"------------------------------------------------------------------------
116
-
117
-function! s:RedisplayHelp(dialog)
118
-  silent! 2,$g/^@/d_
119
-  normal! gg
120
-  for help in a:dialog['help_'.a:dialog.help_type]
121
-    silent put=help
122
-  endfor
123
-endfunction
124
-
125
-function! lh#buffer#dialog#update(dialog)
126
-  set noro
127
-  exe (s:Help_NbL()+1).',$d_'
128
-  for choice in a:dialog.choices
129
-    silent $put='  '.choice
130
-  endfor
131
-  set ro
132
-endfunction
133
-
134
-function! s:Display(dialog, atitle)
135
-  set noro
136
-  0 put = a:atitle
137
-  call s:RedisplayHelp(a:dialog)
138
-  for choice in a:dialog.choices
139
-    silent $put='  '.choice
140
-  endfor
141
-  set ro
142
-  exe s:Help_NbL()+1
143
-endfunction
144
-
145
-function! s:ToggleHelp(bufferId)
146
-  call lh#buffer#find(a:bufferId)
147
-  call b:dialog.toggle_help()
148
-endfunction
149
-
150
-function! lh#buffer#dialog#toggle_help() dict
151
-  let self.help_type 
152
-	\ = (self.help_type == 'short')
153
-	\ ? 'long'
154
-	\ : 'short'
155
-  call s:RedisplayHelp(self)
156
-endfunction
157
-
158
-function! lh#buffer#dialog#new(bname, title, where, support_tagging, action, choices)
159
-  " The ID will be the buffer id
160
-  let res = {}
161
-  let where_it_started = getpos('.')
162
-  let where_it_started[0] = bufnr('%')
163
-  let res.where_it_started = where_it_started
164
-
165
-  try
166
-    call lh#buffer#scratch(a:bname, a:where)
167
-  catch /.*/
168
-    echoerr v:exception
169
-    return res
170
-  endtry
171
-  let res.id              = bufnr('%')
172
-  let b:NbTags            = 0
173
-  let b:dialog            = res
174
-  let s:LHdialog[res.id]  = res
175
-  let res.help_long       = []
176
-  let res.help_short      = []
177
-  let res.help_type       = 'short'
178
-  let res.support_tagging = a:support_tagging
179
-  let res.action	  = a:action
180
-  let res.choices	  = a:choices
181
-
182
-  " Long help
183
-  call lh#buffer#dialog#add_help(res, '@| <cr>, <double-click>    : select this', 'long')
184
-  call lh#buffer#dialog#add_help(res, '@| <esc>, q                : Abort', 'long')
185
-  if a:support_tagging
186
-    call lh#buffer#dialog#add_help(res, '@| <t>, <space>            : Tag/Untag the current item', 'long')
187
-  endif
188
-  call lh#buffer#dialog#add_help(res, '@| <up>/<down>, <tab>, +/- : Move between entries', 'long')
189
-  call lh#buffer#dialog#add_help(res, '@|', 'long')
190
-  " call lh#buffer#dialog#add_help(res, '@| h                       : Toggle help', 'long')
191
-  call lh#buffer#dialog#add_help(res, '@+'.repeat('-', winwidth(bufwinnr(res.id))-3), 'long')
192
-  " Short Help
193
-  " call lh#buffer#dialog#add_help(res, '@| h                       : Toggle help', 'short')
194
-  call lh#buffer#dialog#add_help(res, '@+'.repeat('-', winwidth(bufwinnr(res.id))-3), 'short')
195
-
196
-  let res.toggle_help = function("lh#buffer#dialog#toggle_help")
197
-  let title = '@  ' . a:title
198
-  let helpstr = '| Toggle (h)elp'
199
-  let title = title 
200
-	\ . repeat(' ', winwidth(bufwinnr(res.id))-lh#encoding#strlen(title)-lh#encoding#strlen(helpstr)-1)
201
-	\ . helpstr
202
-  call s:Display(res, title)
203
- 
204
-  call s:Mappings(res)
205
-  return res
206
-endfunction
207
-
208
-function! lh#buffer#dialog#add_help(abuffer, text, help_type)
209
-  call add(a:abuffer['help_'.a:help_type],a:text)
210
-endfunction
211
-
212
-"=============================================================================
213
-function! lh#buffer#dialog#quit()
214
-  let bufferId = b:dialog.where_it_started[0]
215
-  echohl WarningMsg
216
-  echo "Abort"
217
-  echohl None
218
-  quit
219
-  call lh#buffer#find(bufferId)
220
-endfunction
221
-
222
-" Function: lh#buffer#dialog#select(line, bufferId [,overriden-action])
223
-function! lh#buffer#dialog#select(line, bufferId, ...)
224
-  if a:line == -1
225
-    call lh#buffer#dialog#quit()
226
-    return
227
-  " elseif a:line <= s:Help_NbL() + 1
228
-  elseif a:line <= s:Help_NbL() 
229
-    echoerr "Unselectable item"
230
-    return 
231
-  else
232
-    let dialog = s:LHdialog[a:bufferId]
233
-    let results = { 'dialog' : dialog, 'selection' : []  }
234
-
235
-    if b:NbTags == 0
236
-      " -1 because first index is 0
237
-      " let results = [ dialog.choices[a:line - s:Help_NbL() - 1] ]
238
-      let results.selection = [ a:line - s:Help_NbL() - 1 ]
239
-    else
240
-      silent g/^* /call add(results.selection, line('.')-s:Help_NbL()-1)
241
-    endif
242
-  endif
243
-
244
-  if a:0 > 0 " action overriden
245
-    exe 'call '.dialog.action.'(results, a:000)'
246
-  else
247
-    exe 'call '.dialog.action.'(results)'
248
-  endif
249
-endfunction
250
-function! lh#buffer#dialog#Select(line, bufferId, ...)
251
-  echomsg "lh#buffer#dialog#Select() is deprecated, use lh#buffer#dialog#select() instead"
252
-  if a:0 > 0 " action overriden
253
-    exe 'call lh#buffer#dialog#select(a:line,  a:bufferId, a:1)'
254
-  else
255
-    exe 'call lh#buffer#dialog#select(a:line,  a:bufferId)'
256
-  endif
257
-endfunction
258
-
259
-function! Action(results)
260
-  let dialog = a:results.dialog
261
-  let choices = dialog.choices
262
-  for r in a:results.selection
263
-    echomsg '-> '.choices[r]
264
-  endfor
265
-endfunction
266
-
267
-
268
-"=============================================================================
269
-let &cpo=s:cpo_save
270
-"=============================================================================
271
-" vim600: set fdm=marker:

+ 0
- 226
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/command.vim View File

@@ -1,226 +0,0 @@
1
-"=============================================================================
2
-" $Id: command.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/command.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	08th Jan 2007
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (08th Jan 2007)
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Helpers to define commands that:
14
-" 	- support subcommands
15
-" 	- support autocompletion
16
-" 
17
-"------------------------------------------------------------------------
18
-" Installation:	
19
-" 	Drop it into {rtp}/autoload/lh/
20
-" 	Vim 7+ required.
21
-" History:	
22
-"       v3.0.0: GPLv3
23
-" 	v2.0.0: Code moved from other plugins
24
-" TODO:		«missing features»
25
-" }}}1
26
-"=============================================================================
27
-
28
-
29
-"=============================================================================
30
-let s:cpo_save=&cpo
31
-set cpo&vim
32
-
33
-" ## Debug {{{1
34
-function! lh#command#verbose(level)
35
-  let s:verbose = a:level
36
-endfunction
37
-
38
-function! s:Verbose(expr)
39
-  if exists('s:verbose') && s:verbose
40
-    echomsg a:expr
41
-  endif
42
-endfunction
43
-
44
-function! lh#command#debug(expr)
45
-  return eval(a:expr)
46
-endfunction
47
-
48
-"------------------------------------------------------------------------
49
-" ## Functions {{{1
50
-
51
-" Tool functions {{{2
52
-" Function: lh#command#Fargs2String(aList) {{{3
53
-" @param[in,out] aList list of params from <f-args>
54
-" @see tests/lh/test-Fargs2String.vim
55
-function! lh#command#Fargs2String(aList)
56
-  if empty(a:aList) | return '' | endif
57
-
58
-  let quote_char = a:aList[0][0] 
59
-  let res = a:aList[0]
60
-  call remove(a:aList, 0)
61
-  if quote_char !~ '["'."']"
62
-    return res
63
-  endif
64
-  " else
65
-  let end_string = '[^\\]\%(\\\\\)*'.quote_char.'$'
66
-  while !empty(a:aList) && res !~ end_string 
67
-    let res .= ' ' . a:aList[0]
68
-    call remove(a:aList, 0)
69
-  endwhile
70
-  return res
71
-endfunction
72
-
73
-"------------------------------------------------------------------------
74
-" ## Experimental Functions {{{1
75
-
76
-" Internal functions        {{{2
77
-" Function: s:SaveData({Data})                             {{{3
78
-" @param Data Command definition
79
-" Saves {Data} as s:Data{s:data_id++}. The definition will be used by
80
-" automatically generated commands.
81
-" @return s:data_id
82
-let s:data_id = 0
83
-function! s:SaveData(Data)
84
-  if has_key(a:Data, "command_id")
85
-    " Avoid data duplication
86
-    return a:Data.command_id
87
-  else
88
-    let s:Data{s:data_id} = a:Data
89
-    let id = s:data_id
90
-    let s:data_id += 1
91
-    let a:Data.command_id = id
92
-    return id
93
-  endif
94
-endfunction
95
-
96
-" BTWComplete(ArgLead, CmdLine, CursorPos):      Auto-complete {{{3
97
-function! lh#command#complete(ArgLead, CmdLine, CursorPos)
98
-  let tmp = substitute(a:CmdLine, '\s*\S*', 'Z', 'g')
99
-  let pos = strlen(tmp)
100
-  if 0
101
-    call confirm( "AL = ". a:ArgLead."\nCL = ". a:CmdLine."\nCP = ".a:CursorPos
102
-	  \ . "\ntmp = ".tmp."\npos = ".pos
103
-	  \, '&Ok', 1)
104
-  endif
105
-
106
-  if     2 == pos
107
-    " First argument: a command
108
-    return s:commands
109
-  elseif 3 == pos
110
-    " Second argument: first arg of the command
111
-    if     -1 != match(a:CmdLine, '^BTW\s\+echo')
112
-      return s:functions . "\n" . s:variables
113
-    elseif -1 != match(a:CmdLine, '^BTW\s\+\%(help\|?\)')
114
-    elseif -1 != match(a:CmdLine, '^BTW\s\+\%(set\|add\)\%(local\)\=')
115
-      " Adds a filter
116
-      " let files =         globpath(&rtp, 'compiler/BT-*')
117
-      " let files = files . globpath(&rtp, 'compiler/BT_*')
118
-      " let files = files . globpath(&rtp, 'compiler/BT/*')
119
-      let files = s:FindFilter('*')
120
-      let files = substitute(files,
121
-	    \ '\(^\|\n\).\{-}compiler[\\/]BTW[-_\\/]\(.\{-}\)\.vim\>\ze\%(\n\|$\)',
122
-	    \ '\1\2', 'g')
123
-      return files
124
-    elseif -1 != match(a:CmdLine, '^BTW\s\+remove\%(local\)\=')
125
-      " Removes a filter
126
-      return substitute(s:FiltersList(), ',', '\n', 'g')
127
-    endif
128
-  endif
129
-  " finally: unknown
130
-  echoerr 'BTW: unespected parameter ``'. a:ArgLead ."''"
131
-  return ''
132
-endfunction
133
-
134
-function! s:BTW(command, ...)
135
-  " todo: check a:0 > 1
136
-  if     'set'      == a:command | let g:BTW_build_tool = a:1
137
-    if exists('b:BTW_build_tool')
138
-      let b:BTW_build_tool = a:1
139
-    endif
140
-  elseif 'setlocal'     == a:command | let b:BTW_build_tool = a:1
141
-  elseif 'add'          == a:command | call s:AddFilter('g', a:1)
142
-  elseif 'addlocal'     == a:command | call s:AddFilter('b', a:1)
143
-    " if exists('b:BTW_filters_list') " ?????
144
-    " call s:AddFilter('b', a:1)
145
-    " endif
146
-  elseif 'remove'       == a:command | call s:RemoveFilter('g', a:1)
147
-  elseif 'removelocal'  == a:command | call s:RemoveFilter('b', a:1)
148
-  elseif 'rebuild'      == a:command " wait for s:ReconstructToolsChain()
149
-  elseif 'echo'         == a:command | exe "echo s:".a:1
150
-    " echo s:{a:f1} ## don't support «echo s:f('foo')»
151
-  elseif 'reloadPlugin' == a:command
152
-    let g:force_reload_BuildToolsWrapper = 1
153
-    let g:BTW_BTW_in_use = 1
154
-    exe 'so '.s:sfile
155
-    unlet g:force_reload_BuildToolsWrapper
156
-    unlet g:BTW_BTW_in_use
157
-    return
158
-  elseif a:command =~ '\%(help\|?\)'
159
-    call s:Usage()
160
-    return
161
-  endif
162
-  call s:ReconstructToolsChain()
163
-endfunction
164
-
165
-" ##############################################################
166
-" Public functions          {{{2
167
-
168
-function! s:FindSubcommand(definition, subcommand)
169
-  for arg in a:definition.arguments
170
-    if arg.name == a:subcommand
171
-      return arg
172
-    endif
173
-  endfor
174
-  throw "NF"
175
-endfunction
176
-
177
-function! s:execute_function(definition, params)
178
-    if len(a:params) < 1
179
-      throw "(lh#command) Not enough arguments"
180
-    endif
181
-  let l:Fn = a:definition.action
182
-  echo "calling ".string(l:Fn)
183
-  echo "with ".string(a:params)
184
-  " call remove(a:params, 0)
185
-  call l:Fn(a:params)
186
-endfunction
187
-
188
-function! s:execute_sub_commands(definition, params)
189
-  try
190
-    if len(a:params) < 1
191
-      throw "(lh#command) Not enough arguments"
192
-    endif
193
-    let subcommand = s:FindSubcommand(a:definition, a:params[0])
194
-    call remove(a:params, 0)
195
-    call s:int_execute(subcommand, a:params)
196
-  catch /NF.*/
197
-    throw "(lh#command) Unexpected subcommand `".a:params[0]."'."
198
-  endtry
199
-endfunction
200
-
201
-function! s:int_execute(definition, params)
202
-  echo "params=".string(a:params)
203
-  call s:execute_{a:definition.arg_type}(a:definition, a:params)
204
-endfunction
205
-
206
-function! s:execute(definition, ...)
207
-  try
208
-    let params = copy(a:000)
209
-    call s:int_execute(a:definition, params)
210
-  catch /(lh#command).*/
211
-    echoerr v:exception . " in `".a:definition.name.' '.join(a:000, ' ')."'"
212
-  endtry
213
-endfunction
214
-
215
-function! lh#command#new(definition)
216
-  let cmd_name = a:definition.name
217
-  " Save the definition as an internal script variable
218
-  let id = s:SaveData(a:definition)
219
-  exe "command! -nargs=* ".cmd_name." :call s:execute(s:Data".id.", <f-args>)"
220
-endfunction
221
-
222
-" Functions }}}1
223
-"------------------------------------------------------------------------
224
-let &cpo=s:cpo_save
225
-"=============================================================================
226
-" vim600: set fdm=marker:

+ 0
- 97
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/common.vim View File

@@ -1,97 +0,0 @@
1
-"=============================================================================
2
-" $Id: common.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/common.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	07th Oct 2006
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (08th Feb 2008)
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Some common functions for:
14
-" 	- displaying error messages
15
-" 	- checking dependencies
16
-" 
17
-"------------------------------------------------------------------------
18
-" Installation:	
19
-" 	Drop it into {rtp}/autoload/lh/
20
-" 	Vim 7+ required.
21
-" History:	
22
-"       v3.0.0
23
-"       - GPLv3
24
-" 	v2.1.1
25
-" 	- New function: lh#common#echomsg_multilines()
26
-" 	- lh#common#warning_msg() supports multilines messages
27
-"
28
-" 	v2.0.0:
29
-" 	- Code moved from other plugins
30
-" }}}1
31
-"=============================================================================
32
-
33
-
34
-"=============================================================================
35
-let s:cpo_save=&cpo
36
-set cpo&vim
37
-"------------------------------------------------------------------------
38
-" Functions {{{1
39
-
40
-" Function: lh#common#echomsg_multilines {{{2
41
-function! lh#common#echomsg_multilines(text)
42
-  let lines = split(a:text, "[\n\r]")
43
-  for line in lines
44
-    echomsg line
45
-  endfor
46
-endfunction
47
-function! lh#common#echomsgMultilines(text)
48
-  return lh#common#echomsg_multilines(a:text)
49
-endfunction
50
-
51
-" Function: lh#common#error_msg {{{2
52
-function! lh#common#error_msg(text)
53
-  if has('gui_running')
54
-    call confirm(a:text, '&Ok', '1', 'Error')
55
-  else
56
-    " echohl ErrorMsg
57
-    echoerr a:text
58
-    " echohl None
59
-  endif
60
-endfunction 
61
-function! lh#common#ErrorMsg(text)
62
-  return lh#common#error_msg(a:text)
63
-endfunction
64
-
65
-" Function: lh#common#warning_msg {{{2
66
-function! lh#common#warning_msg(text)
67
-  echohl WarningMsg
68
-  " echomsg a:text
69
-  call lh#common#echomsg_multilines(a:text)
70
-  echohl None
71
-endfunction 
72
-function! lh#common#WarningMsg(text)
73
-  return lh#common#warning_msg(a:text)
74
-endfunction
75
-
76
-" Dependencies {{{2
77
-function! lh#common#check_deps(Symbol, File, path, plugin) " {{{3
78
-  if !exists(a:Symbol)
79
-    exe "runtime ".a:path.a:File
80
-    if !exists(a:Symbol)
81
-      call lh#common#error_msg( a:plugin.': Requires <'.a:File.'>')
82
-      return 0
83
-    endif
84
-  endif
85
-  return 1
86
-endfunction
87
-
88
-function! lh#common#CheckDeps(Symbol, File, path, plugin) " {{{3
89
-  echomsg "lh#common#CheckDeps() is deprecated, use lh#common#check_deps() instead."
90
-  return lh#common#check_deps(a:Symbol, a:File, a:path, a:plugin)
91
-endfunction
92
-
93
-" Functions }}}1
94
-"------------------------------------------------------------------------
95
-let &cpo=s:cpo_save
96
-"=============================================================================
97
-" vim600: set fdm=marker:

+ 0
- 78
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/encoding.vim View File

@@ -1,78 +0,0 @@
1
-"=============================================================================
2
-" $Id: encoding.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/encoding.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	21st Feb 2008
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Defines functions that help managing various encodings
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	
17
-" 	Drop it into {rtp}/autoload/lh/
18
-" 	Vim 7+ required.
19
-" History:	
20
-"       v3.0.0:
21
-"       (*) GPLv3
22
-" 	v2.2.2:
23
-" 	(*) new mb_strings functions: strlen, strpart, at
24
-" 	v2.0.7:
25
-" 	(*) lh#encoding#Iconv() copied from map-tools
26
-" TODO:		«missing features»
27
-" }}}1
28
-"=============================================================================
29
-
30
-let s:cpo_save=&cpo
31
-set cpo&vim
32
-"------------------------------------------------------------------------
33
-" Exported functions {{{2
34
-" Function: lh#encoding#iconv(expr, from, to)  " {{{3
35
-" Unlike |iconv()|, this wrapper returns {expr} when we know no convertion can
36
-" be acheived.
37
-function! lh#encoding#iconv(expr, from, to)
38
-  " call Dfunc("s:ICONV(".a:expr.','.a:from.','.a:to.')')
39
-  if has('multi_byte') && 
40
-	\ ( has('iconv') || has('iconv/dyn') ||
41
-	\ ((a:from=~'latin1\|utf-8') && (a:to=~'latin1\|utf-8')))
42
-    " call confirm('encoding: '.&enc."\nto:".a:to, "&Ok", 1)
43
-    " call Dret("s:ICONV convert=".iconv(a:expr, a:from, a:to))
44
-    return iconv(a:expr,a:from,a:to)
45
-  else
46
-    " Cannot convert
47
-    " call Dret("s:ICONV  no convert=".a:expr)
48
-    return a:expr
49
-  endif
50
-endfunction
51
-
52
-
53
-" Function: lh#encoding#at(mb_string, i) " {{{3
54
-" @return i-th character in a mb_string
55
-" @parem mb_string multi-bytes string
56
-" @param i 0-indexed position
57
-function! lh#encoding#at(mb_string, i)
58
-  return matchstr(a:mb_string, '.', 0, a:i+1)
59
-endfunction
60
-
61
-" Function: lh#encoding#strpart(mb_string, pos, length) " {{{3
62
-" @return {length} extracted characters from {position} in multi-bytes string.
63
-" @parem mb_string multi-bytes string
64
-" @param p 0-indexed position
65
-" @param l length of the string to extract
66
-function! lh#encoding#strpart(mb_string, p, l)
67
-  return matchstr(a:mb_string, '.\{'.a:l.'}', 0, a:p+1)
68
-endfunction
69
-
70
-" Function: lh#encoding#strlen(mb_string) " {{{3
71
-" @return the length of the multi-bytes string.
72
-function! lh#encoding#strlen(mb_string)
73
-  return strlen(substitute(a:mb_string, '.', 'a', 'g'))
74
-endfunction
75
-"------------------------------------------------------------------------
76
-let &cpo=s:cpo_save
77
-"=============================================================================
78
-" vim600: set fdm=marker:

+ 0
- 78
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/env.vim View File

@@ -1,78 +0,0 @@
1
-"=============================================================================
2
-" $Id: env.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:         autoload/lh/env.vim                               {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      19th Jul 2010
10
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:
13
-"       Functions related to environment (variables)
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:
17
-"       Drop this file into {rtp}/autoload/lh
18
-"       Requires Vim7+
19
-" History:      
20
-" 	v2.2.1: First Version
21
-"       v3.0.0: GPLv3
22
-" TODO:         «missing features»
23
-" }}}1
24
-"=============================================================================
25
-
26
-let s:cpo_save=&cpo
27
-set cpo&vim
28
-"------------------------------------------------------------------------
29
-" ## Misc Functions     {{{1
30
-" # Version {{{2
31
-let s:k_version = 300
32
-function! lh#env#version()
33
-  return s:k_version
34
-endfunction
35
-
36
-" # Debug   {{{2
37
-let s:verbose = 0
38
-function! lh#env#verbose(...)
39
-  if a:0 > 0 | let s:verbose = a:1 | endif
40
-  return s:verbose
41
-endfunction
42
-
43
-function! s:Verbose(expr)
44
-  if s:verbose
45
-    echomsg a:expr
46
-  endif
47
-endfunction
48
-
49
-function! lh#env#debug(expr)
50
-  return eval(a:expr)
51
-endfunction
52
-
53
-
54
-"------------------------------------------------------------------------
55
-" ## Exported functions {{{1
56
-function! lh#env#expand_all(string)
57
-  let res = ''
58
-  let tail = a:string
59
-  while !empty(tail)
60
-    let [ all, head, var, tail; dummy ] = matchlist(tail, '\(.\{-}\)\%(${\(.\{-}\)}\)\=\(.*\)')
61
-    if empty(var)
62
-      let res .= tail
63
-      break
64
-    else
65
-      let res .= head
66
-      let val = eval('$'.var)
67
-      let res .= val
68
-    endif
69
-  endwhile
70
-  return res
71
-endfunction
72
-"------------------------------------------------------------------------
73
-" ## Internal functions {{{1
74
-
75
-"------------------------------------------------------------------------
76
-let &cpo=s:cpo_save
77
-"=============================================================================
78
-" vim600: set fdm=marker:

+ 0
- 70
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/event.vim View File

@@ -1,70 +0,0 @@
1
-"=============================================================================
2
-" $Id: event.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/event.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	15th Feb 2008
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Function to help manage vim |autocommand-events|
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:
17
-" 	Drop it into {rtp}/autoload/lh/
18
-" 	Vim 7+ required.
19
-" History:
20
-" 	v2.0.6: Creation
21
-"       v3.0.0: GPLv3
22
-" TODO:		
23
-" }}}1
24
-"=============================================================================
25
-
26
-let s:cpo_save=&cpo
27
-set cpo&vim
28
-
29
-"------------------------------------------------------------------------
30
-" ## Functions {{{1
31
-" # Debug {{{2
32
-function! lh#event#verbose(level)
33
-  let s:verbose = a:level
34
-endfunction
35
-
36
-function! s:Verbose(expr)
37
-  if exists('s:verbose') && s:verbose
38
-    echomsg a:expr
39
-  endif
40
-endfunction
41
-
42
-function! lh#event#debug(expr)
43
-  return eval(a:expr)
44
-endfunction
45
-
46
-"------------------------------------------------------------------------
47
-" # Event Registration {{{2
48
-function! s:RegisteredOnce(cmd, group)
49
-  " We can't delete the current augroup autocommand => increment a counter
50
-  if !exists('s:'.a:group) || s:{a:group} == 0 
51
-    let s:{a:group} = 1
52
-    exe a:cmd
53
-  endif
54
-endfunction
55
-
56
-function! lh#event#register_for_one_execution_at(event, cmd, group)
57
-  let group = a:group.'_once'
58
-  let s:{group} = 0
59
-  exe 'augroup '.group
60
-  au!
61
-  exe 'au '.a:event.' '.expand('%:p').' call s:RegisteredOnce('.string(a:cmd).','.string(group).')'
62
-  augroup END
63
-endfunction
64
-function! lh#event#RegisterForOneExecutionAt(event, cmd, group)
65
-  return lh#event#register_for_one_execution_at(a:event, a:cmd, a:group)
66
-endfunction
67
-"------------------------------------------------------------------------
68
-let &cpo=s:cpo_save
69
-"=============================================================================
70
-" vim600: set fdm=marker:

+ 0
- 120
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/float.vim View File

@@ -1,120 +0,0 @@
1
-"=============================================================================
2
-" $Id: float.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:         autoload/lh/float.vim                             {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      16th Nov 2010
10
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:
13
-"       Defines functions related to |expr-float| numbers
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:
17
-"       Drop this file into {rtp}/autoload/lh
18
-"       Requires Vim7+
19
-" History:     
20
-"       v2.0.0: first version
21
-"       v3.0.0: GPLv3
22
-" TODO:
23
-" }}}1
24
-"=============================================================================
25
-
26
-let s:cpo_save=&cpo
27
-set cpo&vim
28
-"------------------------------------------------------------------------
29
-" ## Misc Functions     {{{1
30
-" # Version {{{2
31
-let s:k_version = 300
32
-function! lh#float#version()
33
-  return s:k_version
34
-endfunction
35
-
36
-" # Debug   {{{2
37
-let s:verbose = 0
38
-function! lh#float#verbose(...)
39
-  if a:0 > 0 | let s:verbose = a:1 | endif
40
-  return s:verbose
41
-endfunction
42
-
43
-function! s:Verbose(expr)
44
-  if s:verbose
45
-    echomsg a:expr
46
-  endif
47
-endfunction
48
-
49
-function! lh#float#debug(expr)
50
-  return eval(a:expr)
51
-endfunction
52
-
53
-
54
-"------------------------------------------------------------------------
55
-" ## Exported functions {{{1
56
-
57
-" # lh#float#min(list) {{{2
58
-function! lh#float#min(list)
59
-  let am = lh#float#arg_min(a:list)
60
-  return a:list[am]
61
-endfunction
62
-
63
-function! lh#float#arg_min(list)
64
-  if empty(a:list) | return -1 | endif
65
-  let m = type(a:list[0]) == type(0.0) ? a:list[0] : str2float(a:list[0])
66
-  let p = 0
67
-  let i = 1
68
-  while i != len(a:list)
69
-    let e = a:list[i]
70
-    if type(e) != type(0.0) |
71
-      let v = str2float(e)
72
-    else
73
-      let v = e
74
-    endif
75
-    if v < m
76
-      let m = v
77
-      let p = i
78
-    endif
79
-    let i += 1
80
-  endwhile
81
-  return p
82
-endfunction
83
-
84
-
85
-" # lh#float#max(list) {{{2
86
-function! lh#float#max(list)
87
-  let am = lh#float#arg_max(a:list)
88
-  return a:list[am]
89
-endfunction
90
-
91
-function! lh#float#arg_max(list)
92
-  if empty(a:list) | return -1 | endif
93
-  let m = type(a:list[0]) == type(0.0) ? a:list[0] : str2float(a:list[0])
94
-  let p = 0
95
-  let i = 1
96
-  while i != len(a:list)
97
-    let e = a:list[i]
98
-    if type(e) != type(0.0) |
99
-      let v = str2float(e)
100
-    else
101
-      let v = e
102
-    endif
103
-    if v > m
104
-      let m = v
105
-      let p = i
106
-    endif
107
-    let i += 1
108
-  endwhile
109
-  return p
110
-endfunction
111
-
112
-
113
-
114
-"------------------------------------------------------------------------
115
-" ## Internal functions {{{1
116
-
117
-"------------------------------------------------------------------------
118
-let &cpo=s:cpo_save
119
-"=============================================================================
120
-" vim600: set fdm=marker:

+ 0
- 217
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/function.vim View File

@@ -1,217 +0,0 @@
1
-"=============================================================================
2
-" $Id: function.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/function.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	03rd Nov 2008
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Implements:
14
-" 	- lh#function#bind()
15
-" 	- lh#function#execute()
16
-" 	- lh#function#prepare()
17
-" 	- a binded function type
18
-" 
19
-"------------------------------------------------------------------------
20
-" Installation:	
21
-" 	Drop it into {rtp}/autoload/lh/
22
-" 	Vim 7+ required.
23
-" History:	
24
-"       v2.2.0: first implementation
25
-"       v3.0.0: GPLv3
26
-" TODO:		«missing features»
27
-" }}}1
28
-"=============================================================================
29
-
30
-let s:cpo_save=&cpo
31
-set cpo&vim
32
-"------------------------------------------------------------------------
33
-
34
-" ## Functions {{{1
35
-" # Debug {{{2
36
-function! lh#function#verbose(level)
37
-  let s:verbose = a:level
38
-endfunction
39
-
40
-function! s:Verbose(expr)
41
-  if exists('s:verbose') && s:verbose
42
-    echomsg a:expr
43
-  endif
44
-endfunction
45
-
46
-function! lh#function#debug(expr)
47
-  return eval(a:expr)
48
-endfunction
49
-
50
-" # Function: s:Join(arguments...) {{{2
51
-function! s:Join(args)
52
-  let res = ''
53
-  if len(a:args) > 0
54
-    let res = string(a:args[0])
55
-    let i = 1
56
-    while i != len(a:args)
57
-      let res.=','.string(a:args[i])
58
-      let i += 1
59
-    endwhile
60
-  endif
61
-  return res
62
-endfunction
63
-
64
-" # Function: s:DoBindList(arguments...) {{{2
65
-function! s:DoBindList(formal, real)
66
-  let args = []
67
-  for arg in a:formal
68
-    if type(arg)==type('string') && arg =~ '^v:\d\+_$'
69
-      let new = a:real[matchstr(arg, 'v:\zs\d\+\ze_')-1]
70
-    elseif type(arg)==type('string')
71
-      let new = eval(s:DoBindEvaluatedString(arg, a:real))
72
-    else
73
-      let new = arg
74
-    endif
75
-    call add(args, new)
76
-    unlet new
77
-    unlet arg
78
-  endfor
79
-  return args
80
-endfunction
81
-
82
-" # Function: s:DoBindString(arguments...) {{{2
83
-function! s:DoBindString(expr, real)
84
-  let expr = substitute(a:expr, '\<v:\(\d\+\)_\>', a:real.'[\1-1]', 'g')
85
-  return expr
86
-endfunction
87
-
88
-function! s:ToString(expr)
89
-  return  type(a:expr) != type('')
90
-	\ ? string(a:expr)
91
-	\ : (a:expr)
92
-endfunction
93
-
94
-function! s:DoBindEvaluatedString(expr, real)
95
-  let expr = a:expr
96
-  let p = 0
97
-  while 1
98
-    let p = match(expr, '\<v:\d\+_\>', p)
99
-    if -1 == p | break | endif
100
-    let e = matchend(expr, '\<v:\d\+_\>', p)
101
-    let n = eval(expr[p+2 : e-2])
102
-    " let new = (type(a:real[n-1])==type('') && a:real[n-1]=~ '\<v:\d\+_\>')
103
-	  " \ ? a:real[n-1]
104
-	  " \ : string(a:real[n-1])
105
-    let new = s:ToString(a:real[n-1])
106
-    " let new = string(a:real[n-1]) " -> bind_counpound vars
107
-    let expr = ((p>0) ? (expr[0:p-1]) : '') . new . expr[e : -1]
108
-    " echo expr
109
-    let p += len(new)
110
-    " silent! unlet new
111
-  endwhile
112
-
113
-  return expr
114
-endfunction
115
-
116
-" # Function: s:Execute(arguments...) {{{2
117
-function! s:Execute(args) dict
118
-  if type(self.function) == type(function('exists'))
119
-    let args = s:DoBindList(self.args, a:args)
120
-    " echomsg '##'.string(self.function).'('.join(args, ',').')'
121
-    let res = eval(string(self.function).'('.s:Join(args).')')
122
-  elseif type(self.function) == type('string')
123
-    let expr = s:DoBindString(self.function, 'a:args')
124
-    let res = eval(expr)
125
-  elseif type(self.function) == type({})
126
-    return self.function.execute(a:args)
127
-  else
128
-    throw "lh#functor#execute: unpected function type: ".type(self.function)
129
-  endif
130
-  return res
131
-endfunction
132
-
133
-" # Function: lh#function#prepare(function, arguments_list) {{{2
134
-function! lh#function#prepare(Fn, arguments_list)
135
-  if     type(a:Fn) == type(function('exists'))
136
-    let expr = string(a:Fn).'('.s:Join(a:arguments_list).')'
137
-    return expr
138
-  elseif type(a:Fn) == type('string')
139
-    if a:Fn =~ '^[a-zA-Z0-9_#]\+$'
140
-      let expr = string(function(a:Fn)).'('.s:Join(a:arguments_list).')'
141
-      return expr
142
-    else
143
-      let expr = s:DoBindString(a:Fn, 'a:000')
144
-      return expr
145
-    endif
146
-  else
147
-    throw "lh#function#prepare(): {Fn} argument of type ".type(a:Fn). " is unsupported"
148
-  endif
149
-endfunction
150
-
151
-" # Function: lh#function#execute(function, arguments...) {{{2
152
-function! lh#function#execute(Fn, ...)
153
-  if type(a:Fn) == type({}) && has_key(a:Fn, 'execute')
154
-    return a:Fn.execute(a:000)
155
-  else
156
-    let expr = lh#function#prepare(a:Fn, a:000)
157
-    return eval(expr)
158
-  endif
159
-endfunction
160
-
161
-" # Function: lh#function#bind(function, arguments...) {{{2
162
-function! lh#function#bind(Fn, ...)
163
-  let args = copy(a:000)
164
-  if type(a:Fn) == type('string') && a:Fn =~ '^[a-zA-Z0-9_#]\+$'
165
-	\ && exists('*'.a:Fn)
166
-    let Fn = function(a:Fn)
167
-  elseif type(a:Fn) == type({})
168
-    " echo string(a:Fn).'('.string(a:000).')'
169
-    " Rebinding another binded function
170
-    " TASSERT has_key(a:Fn, 'function')
171
-    " TASSERT has_key(a:Fn, 'execute')
172
-    " TASSERT has_key(a:Fn, 'args')
173
-    let Fn = a:Fn.function
174
-    let N = len(a:Fn.args)
175
-    if N != 0 " args to rebind
176
-      let i = 0
177
-      let t_args = [] " necessary to avoid type changes
178
-      while i != N
179
-	silent! unlet arg
180
-	let arg = a:Fn.args[i]
181
-	if arg =~ 'v:\d\+_$'
182
-	  let arg2 = eval(s:DoBindString(arg, string(args)))
183
-	  " echo arg."-(".string(args).")->".string(arg2)
184
-	  unlet arg
185
-	  let arg = arg2
186
-	  unlet arg2
187
-	endif
188
-	call add(t_args, arg)
189
-	let i += 1
190
-      endwhile
191
-      unlet a:Fn.args
192
-      let a:Fn.args = t_args
193
-    else " expression to fix
194
-      " echo Fn
195
-      " echo s:DoBindString(Fn, string(args))
196
-      " echo eval(string(s:DoBindString(Fn, string(args))))
197
-      let Fn = (s:DoBindEvaluatedString(Fn, args))
198
-    endif
199
-    let args = a:Fn.args
200
-  else
201
-    let Fn = a:Fn
202
-  endif
203
-
204
-  let binded_fn = {
205
-	\ 'function': Fn,
206
-	\ 'args':     args,
207
-	\ 'execute':  function('s:Execute')
208
-	\}
209
-  return binded_fn
210
-endfunction
211
-
212
-" }}1
213
-"------------------------------------------------------------------------
214
-let &cpo=s:cpo_save
215
-"=============================================================================
216
-" vim600: set fdm=marker:
217
-" Vim: let g:UTfiles='tests/lh/function.vim'

+ 0
- 179
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/graph/tsort.vim View File

@@ -1,179 +0,0 @@
1
-"=============================================================================
2
-" $Id: tsort.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/tsort.vim                        {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	21st Apr 2008
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	Library functions for Topological Sort
13
-" 
14
-"------------------------------------------------------------------------
15
-" 	Drop the file into {rtp}/autoload/lh/graph
16
-" History:	«history»
17
-" TODO:		«missing features»
18
-" }}}1
19
-"=============================================================================
20
-
21
-let s:cpo_save=&cpo
22
-set cpo&vim
23
-
24
-"------------------------------------------------------------------------
25
-" ## Debug {{{1
26
-function! lh#graph#tsort#verbose(level)
27
-  let s:verbose = a:level
28
-endfunction
29
-
30
-function! s:Verbose(expr)
31
-  if exists('s:verbose') && s:verbose
32
-    echomsg a:expr
33
-  endif
34
-endfunction
35
-
36
-function! lh#graph#tsort#debug(expr)
37
-  return eval(a:expr)
38
-endfunction
39
-
40
-"------------------------------------------------------------------------
41
-"## Helper functions                         {{{1
42
-"# s:Successors_fully_defined(node)          {{{2
43
-function! s:Successors_fully_defined(node) dict
44
-  if has_key(self.table, a:node)
45
-    return self.table[a:node]
46
-  else
47
-    return []
48
-  endif
49
-endfunction
50
-
51
-"# s:Successors_lazy(node)                   {{{2
52
-function! s:Successors_lazy(node) dict
53
-  if !has_key(self.table, a:node)
54
-    let nodes = self.fetch(a:node)
55
-    let self.table[a:node] = nodes
56
-    " if len(nodes) > 0
57
-      " let self.nb += 1
58
-    " endif
59
-    return nodes
60
-  else
61
-    return self.table[a:node]
62
-  endif
63
-endfunction
64
-
65
-"# s:PrepareDAG(dag)                         {{{2
66
-function! s:PrepareDAG(dag)
67
-  if type(a:dag) == type(function('has_key'))
68
-    let dag = { 
69
-	  \ 'successors': function('s:Successors_lazy'),
70
-	  \ 'fetch'     : a:dag,
71
-	  \ 'table' 	: {}
72
-	  \}
73
-  else
74
-    let dag = { 
75
-	  \ 'successors': function('s:Successors_fully_defined'),
76
-	  \ 'table' 	: deepcopy(a:dag)
77
-	  \}
78
-  endif
79
-  return dag
80
-endfunction
81
-
82
-"## Depth-first search (recursive)           {{{1
83
-" Do not detect cyclic graphs
84
-
85
-"# lh#graph#tsort#depth(dag, start_nodes)    {{{2
86
-function! lh#graph#tsort#depth(dag, start_nodes)
87
-  let dag = s:PrepareDAG(a:dag)
88
-  let results = []
89
-  let visited_nodes = { 'Visited':function('s:Visited')}
90
-  call s:RecursiveDTSort(dag, a:start_nodes, results, visited_nodes)
91
-  call reverse(results)
92
-  return results
93
-endfunction
94
-
95
-"# The real, recursive, T-Sort               {{{2
96
-"see boost.graph for a non recursive implementation
97
-function! s:RecursiveDTSort(dag, start_nodes, results, visited_nodes)
98
-  for node in a:start_nodes
99
-    let visited = a:visited_nodes.Visited(node)
100
-    if     visited == 1 | continue " done
101
-    elseif visited == 2 | throw "Tsort: cyclic graph detected: ".node
102
-    endif
103
-    let a:visited_nodes[node] = 2 " visiting
104
-    let succs = a:dag.successors(node)
105
-    try
106
-      call s:RecursiveDTSort(a:dag, succs, a:results, a:visited_nodes)
107
-    catch /Tsort:/
108
-      throw v:exception.'>'.node
109
-    endtry
110
-    let a:visited_nodes[node] = 1 " visited
111
-    call add(a:results, node)
112
-  endfor
113
-endfunction
114
-
115
-function! s:Visited(node) dict 
116
-  return has_key(self, a:node) ? self[a:node] : 0
117
-endfunction
118
-
119
-"## Breadth-first search (non recursive)     {{{1
120
-"# lh#graph#tsort#breadth(dag, start_nodes)  {{{2
121
-" warning: This implementation does not work with lazy dag, but only with fully
122
-" defined ones
123
-function! lh#graph#tsort#breadth(dag, start_nodes)
124
-  let result = []
125
-  let dag = s:PrepareDAG(a:dag)
126
-  let queue = deepcopy(a:start_nodes)
127
-
128
-  while len(queue) > 0
129
-    let node = remove(queue, 0)
130
-    " echomsg "result <- ".node
131
-    call add(result, node)
132
-    let successors = dag.successors(node)
133
-    while len(successors) > 0
134
-      let m = s:RemoveEdgeFrom(dag, node)
135
-      " echomsg "graph loose ".node."->".m
136
-      if !s:HasIncomingEgde(dag, m)
137
-	" echomsg "queue <- ".m
138
-        call add(queue, m)
139
-      endif
140
-    endwhile
141
-  endwhile
142
-  if !s:Empty(dag)
143
-    throw "Tsort: cyclic graph detected: "
144
-  endif
145
-  return result
146
-endfunction
147
-
148
-function! s:HasIncomingEgde(dag, node)
149
-  for node in keys(a:dag.table)
150
-    if type(a:dag.table[node]) != type([])
151
-      continue
152
-    endif
153
-    if index(a:dag.table[node], a:node) != -1
154
-      return 1
155
-    endif
156
-  endfor
157
-  return 0
158
-endfunction
159
-function! s:RemoveEdgeFrom(dag, node)
160
-  let successors = a:dag.successors(a:node)
161
-  if len(successors) > 0
162
-    let successor = remove(successors, 0)
163
-    if len(successors) == 0
164
-      " echomsg "finished with ->".a:node
165
-      call remove(a:dag.table, a:node)
166
-    endif
167
-    return successor
168
-  endif
169
-  throw "No more edges from ".a:node
170
-endfunction
171
-function! s:Empty(dag)
172
-  " echomsg "len="len(a:dag.table)
173
-  return len(a:dag.table) == 0
174
-endfunction
175
-" }}}1
176
-"------------------------------------------------------------------------
177
-let &cpo=s:cpo_save
178
-"=============================================================================
179
-" vim600: set fdm=marker

+ 0
- 95
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/icomplete.vim View File

@@ -1,95 +0,0 @@
1
-"=============================================================================
2
-" $Id$
3
-" File:         autoload/lh/icomplete.vim                         {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      03rd Jan 2011
10
-" Last Update:  $Date$
11
-"------------------------------------------------------------------------
12
-" Description:
13
-"       Helpers functions to build |ins-completion-menu|
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:
17
-"       Drop this file into {rtp}/autoload/lh
18
-"       Requires Vim7+
19
-" History:
20
-"       v3.0.0: GPLv3
21
-" 	v2.2.4: first version
22
-" TODO:
23
-" 	- We are not able to detect the end of the completion mode. As a
24
-" 	consequence we can't prevent c/for<space> to trigger an abbreviation
25
-" 	instead of the right template file.
26
-" 	In an ideal world, there would exist an event post |complete()|
27
-" }}}1
28
-"=============================================================================
29
-
30
-let s:cpo_save=&cpo
31
-set cpo&vim
32
-"------------------------------------------------------------------------
33
-" ## Misc Functions     {{{1
34
-" # Version {{{2
35
-let s:k_version = 300
36
-function! lh#icomplete#version()
37
-  return s:k_version
38
-endfunction
39
-
40
-" # Debug   {{{2
41
-let s:verbose = 0
42
-function! lh#icomplete#verbose(...)
43
-  if a:0 > 0 | let s:verbose = a:1 | endif
44
-  return s:verbose
45
-endfunction
46
-
47
-function! s:Verbose(expr)
48
-  if s:verbose
49
-    echomsg a:expr
50
-  endif
51
-endfunction
52
-
53
-function! lh#icomplete#debug(expr)
54
-  return eval(a:expr)
55
-endfunction
56
-
57
-
58
-"------------------------------------------------------------------------
59
-" ## Exported functions {{{1
60
-" Function: lh#icomplete#run(startcol, matches, Hook) {{{2
61
-function! lh#icomplete#run(startcol, matches, Hook)
62
-  call lh#icomplete#_register_hook(a:Hook)
63
-  call complete(a:startcol, a:matches)
64
-  return ''
65
-endfunction
66
-
67
-"------------------------------------------------------------------------
68
-" ## Internal functions {{{1
69
-" Function: lh#icomplete#_clear_key_bindings() {{{2
70
-function! lh#icomplete#_clear_key_bindings()
71
-  iunmap <cr>
72
-  iunmap <c-y>
73
-  iunmap <esc>
74
-  " iunmap <space>
75
-  " iunmap <tab>
76
-endfunction
77
-
78
-" Function: lh#icomplete#_register_hook(Hook) {{{2
79
-function! lh#icomplete#_register_hook(Hook)
80
-  exe 'inoremap <silent> <cr> <cr><c-\><c-n>:call' .a:Hook . '()<cr>'
81
-  exe 'inoremap <silent> <c-y> <c-y><c-\><c-n>:call' .a:Hook . '()<cr>'
82
-  " <c-o><Nop> doesn't work as expected... 
83
-  " To stay in INSERT-mode:
84
-  " inoremap <silent> <esc> <c-e><c-o>:<cr>
85
-  " To return into NORMAL-mode:
86
-  inoremap <silent> <esc> <c-e><esc>
87
-
88
-  call lh#event#register_for_one_execution_at('InsertLeave',
89
-	\ ':call lh#icomplete#_clear_key_bindings()', 'CompleteGroup')
90
-endfunction
91
-
92
-"------------------------------------------------------------------------
93
-let &cpo=s:cpo_save
94
-"=============================================================================
95
-" vim600: set fdm=marker:

+ 0
- 376
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/list.vim View File

@@ -1,376 +0,0 @@
1
-"=============================================================================
2
-" $Id: list.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:         autoload/lh/list.vim                                      {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"               <URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      17th Apr 2007
10
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (17th Apr 2007)
11
-"------------------------------------------------------------------------
12
-" Description:  
13
-"       Defines functions related to |Lists|
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation: 
17
-"       Drop it into {rtp}/autoload/lh/
18
-"       Vim 7+ required.
19
-" History:      
20
-"       v3.0.0:
21
-"       (*) GPLv3
22
-"       v2.2.2:
23
-"       (*) new functions: lh#list#remove(), lh#list#matches(),
24
-"           lh#list#not_found().
25
-"       v2.2.1:
26
-"       (*) use :unlet in :for loop to support heterogeneous lists
27
-"       (*) binary search algorithms (upper_bound, lower_bound, equal_range)
28
-"       v2.2.0:
29
-"       (*) new functions: lh#list#accumulate, lh#list#transform,
30
-"           lh#list#transform_if, lh#list#find_if, lh#list#copy_if,
31
-"           lh#list#subset, lh#list#intersect
32
-"       (*) the functions are compatible with lh#function functors
33
-"       v2.1.1: 
34
-"       (*) unique_sort
35
-"       v2.0.7:
36
-"       (*) Bug fix: lh#list#Match()
37
-"       v2.0.6:
38
-"       (*) lh#list#Find_if() supports search predicate, and start index
39
-"       (*) lh#list#Match() supports start index
40
-"       v2.0.0:
41
-" TODO:         «missing features»
42
-" }}}1
43
-"=============================================================================
44
-
45
-
46
-"=============================================================================
47
-let s:cpo_save=&cpo
48
-set cpo&vim
49
-
50
-"------------------------------------------------------------------------
51
-" ## Functions {{{1
52
-" # Debug {{{2
53
-function! lh#list#verbose(level)
54
-  let s:verbose = a:level
55
-endfunction
56
-
57
-function! s:Verbose(expr)
58
-  if exists('s:verbose') && s:verbose
59
-    echomsg a:expr
60
-  endif
61
-endfunction
62
-
63
-function! lh#list#debug(expr)
64
-  return eval(a:expr)
65
-endfunction
66
-
67
-"------------------------------------------------------------------------
68
-" # Public {{{2
69
-" Function: lh#list#Transform(input, output, action) {{{3
70
-" deprecated version
71
-function! lh#list#Transform(input, output, action)
72
-  let new = map(copy(a:input), a:action)
73
-  let res = extend(a:output,new)
74
-  return res
75
-
76
-  for element in a:input
77
-    let action = substitute(a:action, 'v:val','element', 'g')
78
-    let res = eval(action)
79
-    call add(a:output, res)
80
-    unlet element " for heterogeneous lists
81
-  endfor
82
-  return a:output
83
-endfunction
84
-
85
-function! lh#list#transform(input, output, action)
86
-  for element in a:input
87
-    let res = lh#function#execute(a:action, element)
88
-    call add(a:output, res)
89
-    unlet element " for heterogeneous lists
90
-  endfor
91
-  return a:output
92
-endfunction
93
-
94
-function! lh#list#transform_if(input, output, action, predicate)
95
-  for element in a:input
96
-    if lh#function#execute(a:predicate, element)
97
-      let res = lh#function#execute(a:action, element)
98
-      call add(a:output, res)
99
-    endif
100
-    unlet element " for heterogeneous lists
101
-  endfor
102
-  return a:output
103
-endfunction
104
-
105
-function! lh#list#copy_if(input, output, predicate)
106
-  for element in a:input
107
-    if lh#function#execute(a:predicate, element)
108
-      call add(a:output, element)
109
-    endif
110
-    unlet element " for heterogeneous lists
111
-  endfor
112
-  return a:output
113
-endfunction
114
-
115
-function! lh#list#accumulate(input, transformation, accumulator)
116
-  let transformed = lh#list#transform(a:input, [], a:transformation)
117
-  let res = lh#function#execute(a:accumulator, transformed)
118
-  return res
119
-endfunction
120
-
121
-" Function: lh#list#match(list, to_be_matched [, idx]) {{{3
122
-function! lh#list#match(list, to_be_matched, ...)
123
-  let idx = (a:0>0) ? a:1 : 0
124
-  while idx < len(a:list)
125
-    if match(a:list[idx], a:to_be_matched) != -1
126
-      return idx
127
-    endif
128
-    let idx += 1
129
-  endwhile
130
-  return -1
131
-endfunction
132
-function! lh#list#Match(list, to_be_matched, ...)
133
-  let idx = (a:0>0) ? a:1 : 0
134
-  return lh#list#match(a:list, a:to_be_matched, idx)
135
-endfunction
136
-
137
-" Function: lh#list#matches(list, to_be_matched [,idx]) {{{3
138
-" Return the list of indices that match {to_be_matched}
139
-function! lh#list#matches(list, to_be_matched, ...)
140
-  let res = []
141
-  let idx = (a:0>0) ? a:1 : 0
142
-  while idx < len(a:list)
143
-    if match(a:list[idx], a:to_be_matched) != -1
144
-      let res += [idx]
145
-    endif
146
-    let idx += 1
147
-  endwhile
148
-  return res
149
-endfunction
150
-
151
-" Function: lh#list#Find_if(list, predicate [, predicate-arguments] [, start-pos]) {{{3
152
-function! lh#list#Find_if(list, predicate, ...)
153
-  " Parameters
154
-  let idx = 0
155
-  let args = []
156
-  if a:0 == 2
157
-    let idx = a:2
158
-    let args = a:1
159
-  elseif a:0 == 1
160
-    if type(a:1) == type([])
161
-      let args = a:1
162
-    elseif type(a:1) == type(42)
163
-      let idx = a:1
164
-    else
165
-      throw "lh#list#Find_if: unexpected argument type"
166
-    endif
167
-  elseif a:0 != 0
168
-      throw "lh#list#Find_if: unexpected number of arguments: lh#list#Find_if(list, predicate [, predicate-arguments] [, start-pos])"
169
-  endif
170
-
171
-  " The search loop
172
-  while idx != len(a:list)
173
-    let predicate = substitute(a:predicate, 'v:val', 'a:list['.idx.']', 'g')
174
-    let predicate = substitute(predicate, 'v:\(\d\+\)_', 'args[\1-1]', 'g')
175
-    let res = eval(predicate)
176
-    " echomsg string(predicate) . " --> " . res
177
-    if res | return idx | endif
178
-    let idx += 1
179
-  endwhile
180
-  return -1
181
-endfunction
182
-
183
-" Function: lh#list#find_if(list, predicate [, predicate-arguments] [, start-pos]) {{{3
184
-function! lh#list#find_if(list, predicate, ...)
185
-  " Parameters
186
-  let idx = 0
187
-  let args = []
188
-  if a:0 == 1
189
-    let idx = a:1
190
-  elseif a:0 != 0
191
-      throw "lh#list#find_if: unexpected number of arguments: lh#list#find_if(list, predicate [, start-pos])"
192
-  endif
193
-
194
-  " The search loop
195
-  while idx != len(a:list)
196
-    " let predicate = substitute(a:predicate, 'v:val', 'a:list['.idx.']', 'g')
197
-    let res = lh#function#execute(a:predicate, a:list[idx])
198
-    if res | return idx | endif
199
-    let idx += 1
200
-  endwhile
201
-  return -1
202
-endfunction
203
-
204
-" Function: lh#list#lower_bound(sorted_list, value  [, first[, last]]) {{{3
205
-function! lh#list#lower_bound(list, val, ...)
206
-  let first = 0
207
-  let last = len(a:list)
208
-  if a:0 >= 1     | let first = a:1
209
-  elseif a:0 >= 2 | let last = a:2
210
-  elseif a:0 > 2
211
-      throw "lh#list#lower_bound: unexpected number of arguments: lh#list#lower_bound(sorted_list, value  [, first[, last]])"
212
-  endif
213
-
214
-  let len = last - first
215
-
216
-  while len > 0
217
-    let half = len / 2
218
-    let middle = first + half
219
-    if a:list[middle] < a:val
220
-      let first = middle + 1
221
-      let len -= half + 1
222
-    else
223
-      let len = half
224
-    endif
225
-  endwhile
226
-  return first
227
-endfunction
228
-
229
-" Function: lh#list#upper_bound(sorted_list, value  [, first[, last]]) {{{3
230
-function! lh#list#upper_bound(list, val, ...)
231
-  let first = 0
232
-  let last = len(a:list)
233
-  if a:0 >= 1     | let first = a:1
234
-  elseif a:0 >= 2 | let last = a:2
235
-  elseif a:0 > 2
236
-      throw "lh#list#upper_bound: unexpected number of arguments: lh#list#upper_bound(sorted_list, value  [, first[, last]])"
237
-  endif
238
-
239
-  let len = last - first
240
-
241
-  while len > 0
242
-    let half = len / 2
243
-    let middle = first + half
244
-    if a:val < a:list[middle]
245
-      let len = half
246
-    else
247
-      let first = middle + 1
248
-      let len -= half + 1
249
-    endif
250
-  endwhile
251
-  return first
252
-endfunction
253
-
254
-" Function: lh#list#equal_range(sorted_list, value  [, first[, last]]) {{{3
255
-" @return [f, l], where
256
-"   f : First position where {value} could be inserted
257
-"   l : Last position where {value} could be inserted
258
-function! lh#list#equal_range(list, val, ...)
259
-  let first = 0
260
-  let last = len(a:list)
261
-
262
-  " Parameters
263
-  if a:0 >= 1     | let first = a:1
264
-  elseif a:0 >= 2 | let last  = a:2
265
-  elseif a:0 > 2
266
-      throw "lh#list#equal_range: unexpected number of arguments: lh#list#equal_range(sorted_list, value  [, first[, last]])"
267
-  endif
268
-
269
-  " The search loop ( == STLPort's equal_range)
270
-
271
-  let len = last - first
272
-  while len > 0
273
-    let half = len / 2
274
-    let middle = first + half
275
-    if a:list[middle] < a:val
276
-      let first = middle + 1
277
-      let len -= half + 1
278
-    elseif a:val < a:list[middle]
279
-      let len = half
280
-    else
281
-      let left = lh#list#lower_bound(a:list, a:val, first, middle)
282
-      let right = lh#list#upper_bound(a:list, a:val, middle+1, first+len)
283
-      return [left, right]
284
-    endif
285
-
286
-    " let predicate = substitute(a:predicate, 'v:val', 'a:list['.idx.']', 'g')
287
-    " let res = lh#function#execute(a:predicate, a:list[idx])
288
-  endwhile
289
-  return [first, first]
290
-endfunction
291
-
292
-" Function: lh#list#not_found(range) {{{3
293
-" @return whether the range returned from equal_range is empty (i.e. element not fount)
294
-function! lh#list#not_found(range)
295
-  return a:range[0] == a:range[1]
296
-endfunction
297
-
298
-" Function: lh#list#unique_sort(list [, func]) {{{3
299
-" See also http://vim.wikia.com/wiki/Unique_sorting
300
-"
301
-" Works like sort(), optionally taking in a comparator (just like the
302
-" original), except that duplicate entries will be removed.
303
-" todo: support another argument that act as an equality predicate
304
-function! lh#list#unique_sort(list, ...)
305
-  let dictionary = {}
306
-  for i in a:list
307
-    let dictionary[string(i)] = i
308
-  endfor
309
-  let result = []
310
-  " echo join(values(dictionary),"\n")
311
-  if ( exists( 'a:1' ) )
312
-    let result = sort( values( dictionary ), a:1 )
313
-  else
314
-    let result = sort( values( dictionary ) )
315
-  endif
316
-  return result
317
-endfunction
318
-
319
-function! lh#list#unique_sort2(list, ...)
320
-  let list = copy(a:list)
321
-  if ( exists( 'a:1' ) )
322
-    call sort(list, a:1 )
323
-  else
324
-    call sort(list)
325
-  endif
326
-  if len(list) <= 1 | return list | endif
327
-  let result = [ list[0] ]
328
-  let last = list[0]
329
-  let i = 1
330
-  while i < len(list)
331
-    if last != list[i]
332
-      let last = list[i]
333
-      call add(result, last)
334
-    endif
335
-    let i += 1
336
-  endwhile
337
-  return result
338
-endfunction
339
-
340
-" Function: lh#list#subset(list, indices) {{{3
341
-function! lh#list#subset(list, indices)
342
-  let result=[]
343
-  for e in a:indices
344
-    call add(result, a:list[e])
345
-  endfor
346
-  return result
347
-endfunction
348
-
349
-" Function: lh#list#remove(list, indices) {{{3
350
-function! lh#list#remove(list, indices)
351
-  " assert(is_sorted(indices))
352
-  let idx = reverse(copy(a:indices))
353
-  for i in idx
354
-    call remove(a:list, i)
355
-  endfor
356
-  return a:list
357
-endfunction
358
-
359
-" Function: lh#list#intersect(list1, list2) {{{3
360
-function! lh#list#intersect(list1, list2)
361
-  let result = copy(a:list1)
362
-  call filter(result, 'index(a:list2, v:val) >= 0')
363
-  return result
364
-
365
-  for e in a:list1
366
-    if index(a:list2, e) > 0
367
-      call result(result, e)
368
-    endif
369
-  endfor
370
-endfunction
371
-
372
-" Functions }}}1
373
-"------------------------------------------------------------------------
374
-let &cpo=s:cpo_save
375
-"=============================================================================
376
-" vim600: set fdm=marker:

+ 0
- 477
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/menu.vim View File

@@ -1,477 +0,0 @@
1
-"=============================================================================
2
-" $Id: menu.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/menu.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	13th Oct 2006
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (07th Dec 2010)
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Defines the global function lh#menu#def_menu
14
-" 	Aimed at (ft)plugin writers.
15
-" 
16
-"------------------------------------------------------------------------
17
-" Installation:	
18
-" 	Drop this file into {rtp}/autoload/lh/
19
-" 	Requires Vim 7+
20
-" History:	
21
-" 	v2.0.0:	Moving to vim7
22
-" 	v2.0.1:	:Toggle echoes the new value
23
-" 	v2.2.0: Support environment variables
24
-" 	        Only one :Toggle command is defined.
25
-" 	v2.2.3: :Toggle can directly set the final value
26
-" 	       (prefer this way of proceeding to update the menu to the new
27
-" 	       value)
28
-" 	       :Toggle suports auto-completion on possible values
29
-" 	v2.2.6: Toggle menus are silent, but not the actions executed
30
-"       v3.0.0: GPLv3
31
-" TODO:		
32
-" 	* Should the argument to :Toggle be simplified to use the variable name
33
-" 	instead ? May be a banged :Toggle! could work on the real variable
34
-" 	name, and on the real value.
35
-" 	* show all possible values in a sub menu (on demand)
36
-" }}}1
37
-"=============================================================================
38
-
39
-
40
-"=============================================================================
41
-let s:cpo_save=&cpo
42
-set cpo&vim
43
-"------------------------------------------------------------------------
44
-" ## Internal Variables {{{1
45
-let s:k_Toggle_cmd = 'Toggle'
46
-if !exists('s:toggle_commands')
47
-  let s:toggle_commands = {}
48
-endif
49
-
50
-"------------------------------------------------------------------------
51
-" ## Functions {{{1
52
-" # Version {{{2
53
-let s:k_version = 300
54
-function! lh#menu#version()
55
-  return s:k_version
56
-endfunction
57
-
58
-" # Debug   {{{2
59
-let s:verbose = 0
60
-function! lh#menu#verbose(...)
61
-  if a:0 > 0 | let s:verbose = a:1 | endif
62
-  return s:verbose
63
-endfunction
64
-
65
-function! s:Verbose(expr)
66
-  if exists('s:verbose') && s:verbose
67
-    echomsg a:expr
68
-  endif
69
-endfunction
70
-
71
-function! lh#menu#debug(expr)
72
-  return eval(a:expr)
73
-endfunction
74
-
75
-
76
-"------------------------------------------------------------------------
77
-" # Common stuff       {{{2
78
-" Function: lh#menu#text({text})                             {{{3
79
-" @return a text to be used in menus where "\" and spaces have been escaped.
80
-function! lh#menu#text(text)
81
-  return escape(a:text, '\ ')
82
-endfunction
83
-
84
-" # Toggling menu item {{{2
85
-" Function: s:Fetch({Data},{key})                          {{{3
86
-" @param[in] Data Menu-item definition
87
-" @param[in] key  Table table from which the result will be fetched
88
-" @return the current value, or text, whose index is Data.idx_crt_value.
89
-function! s:Fetch(Data, key)
90
-  let len = len(a:Data[a:key])
91
-  if a:Data.idx_crt_value >= len | let a:Data.idx_crt_value = 0 | endif
92
-  let value = a:Data[a:key][a:Data.idx_crt_value]
93
-  return value
94
-endfunction
95
-
96
-" Function: s:Search({Data},{value})                       {{{3
97
-" Searches for the index of {value} in {Data.values} list. Return 0 if not
98
-" found.
99
-function! s:Search(Data, value)
100
-  let idx = index(a:Data.values, a:value)
101
-  " echo a:Data.variable . "[".idx."] == " . a:value
102
-  return idx > 0 ? idx : 0 " default is first element
103
-endfunction
104
-
105
-" Function: s:SearchText({Data},{value})                   {{{3
106
-" Searches for the index of {value} in {Data.values/text} list.
107
-" Returns -1 if not found.
108
-function! s:SearchText(Data, value)
109
-  let labels_key = s:MenuKey(a:Data)
110
-  let list = a:Data[labels_key]
111
-  let idx = index(list, a:value)
112
-  return idx
113
-endfunction
114
-
115
-" Function: s:Set({Data})                                  {{{3
116
-" @param[in,out] Data Menu item definition
117
-"
118
-" Sets the global variable associated to the menu item according to the item's
119
-" current value.
120
-function! s:Set(Data)
121
-  let value = a:Data.values[a:Data.idx_crt_value]
122
-  let variable = a:Data.variable
123
-  if variable[0] == '$' " environment variabmes
124
-    exe "let ".variable." = ".string(value)
125
-  else
126
-    let g:{variable} = value
127
-  endif
128
-  if has_key(a:Data, "actions")
129
-    let l:Action = a:Data.actions[a:Data.idx_crt_value]
130
-    if type(l:Action) == type(function('tr'))
131
-      call l:Action()
132
-    else
133
-      exe l:Action
134
-    endif
135
-  endif
136
-  if has_key(a:Data, "hook")
137
-    let l:Action = a:Data.hook
138
-    if type(l:Action) == type(function('tr'))
139
-      call a:Data.hook()
140
-    else
141
-      exe l:Action
142
-    endif
143
-  endif
144
-  return value
145
-endfunction
146
-
147
-" Function: s:MenuKey({Data})                              {{{3
148
-" @return the table name from which the current value name (to dsplay in the
149
-" menu) must be fetched. 
150
-" Priority is given to the optional "texts" table over the madatory "values" table.
151
-function! s:MenuKey(Data)
152
-  if has_key(a:Data, "texts")
153
-    let menu_id = "texts"
154
-  else
155
-    let menu_id = "values"
156
-  endif
157
-  return menu_id
158
-endfunction
159
-
160
-" Function: s:SetTextValue({Data},{TextValue})             {{{3
161
-" Force the value of the variable to the one associated to the {TextValue}
162
-" The menu, and the variable are updated in consequence.
163
-function! s:SetTextValue(Data, text)
164
-  " Where the texts for values must be fetched
165
-  let labels_key = s:MenuKey(a:Data)
166
-  " Fetch the old current value 
167
-  let old = s:Fetch(a:Data, labels_key)
168
-  let new_idx = s:SearchText(a:Data, a:text)
169
-  if -1 == new_idx
170
-    throw "toggle-menu: unsupported value for {".(a:Data.variable)."}"
171
-  endif
172
-  if a:Data.idx_crt_value == new_idx
173
-    " value unchanged => abort
174
-    return 
175
-  endif
176
-
177
-  " Remove the entry from the menu
178
-  call s:ClearMenu(a:Data.menu, old)
179
-
180
-  " Cycle/increment the current value
181
-  let a:Data.idx_crt_value = new_idx
182
-  " Fetch it
183
-  let new = s:Fetch(a:Data,labels_key)
184
-  " Add the updated entry in the menu
185
-  call s:UpdateMenu(a:Data.menu, new, a:Data.command)
186
-  " Update the binded global variable
187
-  let value = s:Set(a:Data)
188
-  echo a:Data.variable.'='.value
189
-endfunction
190
-
191
-" Function: s:NextValue({Data})                            {{{3
192
-" Change the value of the variable to the next in the list of value.
193
-" The menu, and the variable are updated in consequence.
194
-function! s:NextValue(Data)
195
-  " Where the texts for values must be fetched
196
-  let labels_key = s:MenuKey(a:Data)
197
-  " Fetch the old current value 
198
-  let old = s:Fetch(a:Data, labels_key)
199
-
200
-  " Remove the entry from the menu
201
-  call s:ClearMenu(a:Data.menu, old)
202
-
203
-  " Cycle/increment the current value
204
-  let a:Data.idx_crt_value += 1
205
-  " Fetch it
206
-  let new = s:Fetch(a:Data,labels_key)
207
-  " Add the updated entry in the menu
208
-  call s:UpdateMenu(a:Data.menu, new, a:Data.command)
209
-  " Update the binded global variable
210
-  let value = s:Set(a:Data)
211
-  echo a:Data.variable.'='.value
212
-endfunction
213
-
214
-" Function: s:ClearMenu({Menu}, {text})                    {{{3
215
-" Removes a menu item
216
-"
217
-" @param[in] Menu.priority Priority of the new menu-item
218
-" @param[in] Menu.name     Name of the new menu-item
219
-" @param[in] text          Text of the previous value of the variable binded
220
-function! s:ClearMenu(Menu, text)
221
-  if has('gui_running')
222
-    let name = substitute(a:Menu.name, '&', '', 'g')
223
-    let cmd = 'unmenu '.lh#menu#text(name.'<tab>('.a:text.')')
224
-    silent! exe cmd
225
-  endif
226
-endfunction
227
-
228
-" Function: s:UpdateMenu({Menu}, {text}, {command})        {{{3
229
-" Adds a new menu item, with the text associated to the current value in
230
-" braces.
231
-"
232
-" @param[in] Menu.priority Priority of the new menu-item
233
-" @param[in] Menu.name     Name of the new menu-item
234
-" @param[in] text          Text of the current value of the variable binded to
235
-"                          the menu-item
236
-" @param[in] command       Toggle command to execute when the menu-item is selected
237
-function! s:UpdateMenu(Menu, text, command)
238
-  if has('gui_running')
239
-    let cmd = 'nnoremenu <silent> '.a:Menu.priority.' '.
240
-	  \ lh#menu#text(a:Menu.name.'<tab>('.a:text.')').
241
-	  \ ' :'.s:k_Toggle_cmd.' '.a:command."\<cr>"
242
-    silent! exe cmd
243
-  endif
244
-endfunction
245
-
246
-" Function: s:SaveData({Data})                             {{{3
247
-" @param Data Menu-item definition
248
-" Saves {Data} as s:Data{s:data_id++}. The definition will be used by
249
-" automatically generated commands.
250
-" @return s:data_id
251
-let s:data_id = 0
252
-function! s:SaveData(Data)
253
-  let s:Data{s:data_id} = a:Data
254
-  let id = s:data_id
255
-  let s:data_id += 1
256
-  return id
257
-endfunction
258
-
259
-" Function: lh#menu#def_toggle_item({Data})                  {{{3
260
-" @param Data.idx_crt_value
261
-" @param Data.definitions == [ {value:, menutext: } ]
262
-" @param Data.menu        == { name:, position: }
263
-"
264
-" Sets a toggle-able menu-item defined by {Data}.
265
-"
266
-function! lh#menu#def_toggle_item(Data)
267
-  " Save the menu data as an internal script variable
268
-  let id = s:SaveData(a:Data)
269
-
270
-  " If the index of the current value hasn't been set, fetch it from the
271
-  " associated variable
272
-  if !has_key(a:Data, "idx_crt_value")
273
-    " Fetch the value of the associated variable
274
-    let value = lh#option#get(a:Data.variable, 0, 'g')
275
-    " echo a:Data.variable . " <- " . value
276
-    " Update the index of the current value
277
-    let a:Data.idx_crt_value  = s:Search(a:Data, value)
278
-  endif
279
-
280
-  " Name of the auto-matically generated toggle command
281
-  let cmdName = substitute(a:Data.menu.name, '[^a-zA-Z_]', '', 'g')
282
-  " Lazy definition of the command
283
-  if 2 != exists(':'.s:k_Toggle_cmd) 
284
-    exe 'command! -nargs=+ -complete=custom,lh#menu#_toggle_complete '
285
-	  \ . s:k_Toggle_cmd . ' :call s:Toggle(<f-args>)'
286
-  endif
287
-  " silent exe 'command! -nargs=0 '.cmdName.' :call s:NextValue(s:Data'.id.')'
288
-  let s:toggle_commands[cmdName] = eval('s:Data'.id)
289
-  let a:Data["command"] = cmdName
290
-
291
-  " Add the menu entry according to the current value
292
-  call s:UpdateMenu(a:Data.menu, s:Fetch(a:Data, s:MenuKey(a:Data)), cmdName)
293
-  " Update the associated global variable
294
-  call s:Set(a:Data)
295
-endfunction
296
-
297
-
298
-"------------------------------------------------------------------------
299
-function! s:Toggle(cmdName, ...)
300
-  if !has_key(s:toggle_commands, a:cmdName)
301
-    throw "toggle-menu: unknown toggable variable ".a:cmdName
302
-  endif
303
-  let data = s:toggle_commands[a:cmdName]
304
-  if a:0 > 0
305
-    call s:SetTextValue(data, a:1)
306
-  else
307
-    call s:NextValue(data)
308
-  endif
309
-endfunction
310
-
311
-function! lh#menu#_toggle_complete(ArgLead, CmdLine, CursorPos)
312
-  let cmdline = split(a:CmdLine)
313
-  " echomsg "cmd line: " . string(cmdline)." # ". (a:CmdLine =~ ' $')
314
-  let nb_args = len(cmdline)
315
-  if (a:CmdLine !~ ' $')
316
-    let nb_args -= 1
317
-  endif
318
-  " echomsg "nb args: ". nb_args
319
-  if nb_args < 2 
320
-    return join(keys(s:toggle_commands),"\n")
321
-  elseif nb_args == 2
322
-    let variable = cmdline[1]
323
-    if !has_key(s:toggle_commands, variable)
324
-      throw "toggle-menu: unknown toggable variable ".variable
325
-    endif
326
-    let data = s:toggle_commands[variable]
327
-    let labels_key = s:MenuKey(data)
328
-    " echomsg "keys: ".string(data[labels_key])
329
-    return join(data[labels_key], "\n")
330
-  else
331
-    return ''
332
-  endif
333
-endfunction
334
-
335
-"------------------------------------------------------------------------
336
-" # IVN Menus          {{{2
337
-" Function: s:CTRL_O({cmd})                                {{{3
338
-" Build the command (sequence of ':ex commands') to be executed from
339
-" INSERT-mode.
340
-function! s:CTRL_O(cmd)
341
-  return substitute(a:cmd, '\(^\|<CR>\):', '\1\<C-O>:', 'g')
342
-endfunction
343
-
344
-" Function: lh#menu#is_in_visual_mode()                    {{{3
345
-function! lh#menu#is_in_visual_mode()
346
-  return exists('s:is_in_visual_mode') && s:is_in_visual_mode
347
-endfunction
348
-
349
-" Function: lh#menu#_CMD_and_clear_v({cmd})                 {{{3
350
-" Internal function that executes the command and then clears the @v buffer
351
-" todo: save and restore @v, 
352
-function! lh#menu#_CMD_and_clear_v(cmd)
353
-  try 
354
-    let s:is_in_visual_mode = 1
355
-    exe a:cmd
356
-  finally
357
-    let @v=''
358
-    silent! unlet s:is_in_visual_mode
359
-  endtry
360
-endfunction
361
-
362
-" Function: s:Build_CMD({prefix},{cmd})                    {{{3
363
-" build the exact command to execute regarding the mode it is dedicated
364
-function! s:Build_CMD(prefix, cmd)
365
-  if a:cmd[0] != ':' | return ' ' . a:cmd
366
-  endif
367
-  if     a:prefix[0] == "i"  | return ' ' . <SID>CTRL_O(a:cmd)
368
-  elseif a:prefix[0] == "n"  | return ' ' . a:cmd
369
-  elseif a:prefix[0] == "v" 
370
-    if match(a:cmd, ":VCall") == 0
371
-      return substitute(a:cmd, ':VCall', ' :call', ''). "\<cr>gV"
372
-      " gV exit select-mode if we where in it!
373
-    else
374
-      return
375
-	    \ " \"vy\<C-C>:call lh#menu#_CMD_and_clear_v('" . 
376
-	    \ substitute(a:cmd, "<CR>$", '', '') ."')\<cr>"
377
-    endif
378
-  elseif a:prefix[0] == "c"  | return " \<C-C>" . a:cmd
379
-  else                       | return ' ' . a:cmd
380
-  endif
381
-endfunction
382
-
383
-" Function: lh#menu#map_all({map_type}, [{map args}...)   {{{3
384
-" map the command to all the modes required
385
-function! lh#menu#map_all(map_type,...)
386
-  let nore   = (match(a:map_type, '[aincv]*noremap') != -1) ? "nore" : ""
387
-  let prefix = matchstr(substitute(a:map_type, nore, '', ''), '[aincv]*')
388
-  if a:1 == "<buffer>" | let i = 3 | let binding = a:1 . ' ' . a:2
389
-  else                 | let i = 2 | let binding = a:1
390
-  endif
391
-  let binding = '<silent> ' . binding
392
-  let cmd = a:{i}
393
-  let i +=  1
394
-  while i <= a:0
395
-    let cmd .=  ' ' . a:{i}
396
-    let i +=  1
397
-  endwhile
398
-  let build_cmd = nore . 'map ' . binding
399
-  while strlen(prefix)
400
-    if prefix[0] == "a" | let prefix = "incv"
401
-    else
402
-      execute prefix[0] . build_cmd . <SID>Build_CMD(prefix[0],cmd)
403
-      let prefix = strpart(prefix, 1)
404
-    endif
405
-  endwhile
406
-endfunction
407
-
408
-" Function: lh#menu#make({prefix},{code},{text},{binding},...) {{{3
409
-" Build the menu and map its associated binding to all the modes required
410
-function! lh#menu#make(prefix, code, text, binding, ...)
411
-  let nore   = (match(a:prefix, '[aincv]*nore') != -1) ? "nore" : ""
412
-  let prefix = matchstr(substitute(a:prefix, nore, '', ''), '[aincv]*')
413
-  let b = (a:1 == "<buffer>") ? 1 : 0
414
-  let i = b + 1 
415
-  let cmd = a:{i}
416
-  let i += 1
417
-  while i <= a:0
418
-    let cmd .=  ' ' . a:{i}
419
-    let i += 1
420
-  endwhile
421
-  let build_cmd = nore . "menu <silent> " . a:code . ' ' . lh#menu#text(a:text) 
422
-  if strlen(a:binding) != 0
423
-    let build_cmd .=  '<tab>' . 
424
-	  \ substitute(lh#menu#text(a:binding), '&', '\0\0', 'g')
425
-    if prefix == 'i' && exists('*IMAP')
426
-      if b != 0
427
-        call IMAP(a:binding, cmd, &ft)
428
-      else
429
-        call IMAP(a:binding, cmd)
430
-      endif
431
-    else
432
-      if b != 0
433
-        call lh#menu#map_all(prefix.nore."map", ' <buffer> '.a:binding, cmd)
434
-      else
435
-        call lh#menu#map_all(prefix.nore."map", a:binding, cmd)
436
-      endif
437
-    endif
438
-  endif
439
-  if has("gui_running")
440
-    while strlen(prefix)
441
-      execute <SID>BMenu(b).prefix[0].build_cmd.<SID>Build_CMD(prefix[0],cmd)
442
-      let prefix = strpart(prefix, 1)
443
-    endwhile
444
-  endif
445
-endfunction
446
-
447
-" Function: s:BMenu({b})                                   {{{3
448
-" If <buffermenu.vim> is installed and the menu should be local, then the
449
-" apropriate string is returned.
450
-function! s:BMenu(b)
451
-  let res = (a:b && exists(':Bmenu') 
452
-	\     && (1 == lh#option#get("want_buffermenu_or_global_disable", 1, "bg"))
453
-	\) ? 'B' : ''
454
-  " call confirm("BMenu(".a:b.")=".res, '&Ok', 1)
455
-  return res
456
-endfunction
457
-
458
-" Function: lh#menu#IVN_make(...)                          {{{3
459
-function! lh#menu#IVN_make(code, text, binding, i_cmd, v_cmd, n_cmd, ...)
460
-  " nore options
461
-  let nore_i = (a:0 > 0) ? ((a:1 != 0) ? 'nore' : '') : ''
462
-  let nore_v = (a:0 > 1) ? ((a:2 != 0) ? 'nore' : '') : ''
463
-  let nore_n = (a:0 > 2) ? ((a:3 != 0) ? 'nore' : '') : ''
464
-  " 
465
-  call lh#menu#make('i'.nore_i,a:code,a:text, a:binding, '<buffer>', a:i_cmd)
466
-  call lh#menu#make('v'.nore_v,a:code,a:text, a:binding, '<buffer>', a:v_cmd)
467
-  if strlen(a:n_cmd) != 0
468
-    call lh#menu#make('n'.nore_n,a:code,a:text, a:binding, '<buffer>', a:n_cmd)
469
-  endif
470
-endfunction
471
-
472
-"
473
-" Functions }}}1
474
-"------------------------------------------------------------------------
475
-let &cpo=s:cpo_save
476
-"=============================================================================
477
-" vim600: set fdm=marker:

+ 0
- 127
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/option.vim View File

@@ -1,127 +0,0 @@
1
-"=============================================================================
2
-" $Id: option.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/option.vim                                    {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	24th Jul 2004
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (07th Oct 2006)
11
-"------------------------------------------------------------------------
12
-" Description:
13
-" 	Defines the global function lh#option#get().
14
-"       Aimed at (ft)plugin writers.
15
-" 
16
-"------------------------------------------------------------------------
17
-" Installation:
18
-" 	Drop this file into {rtp}/autoload/lh/
19
-" 	Requires Vim 7+
20
-" History:	
21
-"       v3.0.0
22
-"       (*) GPLv3
23
-" 	v2.0.6
24
-" 	(*) lh#option#add() add values to a vim list |option|
25
-" 	v2.0.5
26
-" 	(*) lh#option#get_non_empty() manages Lists and Dictionaries
27
-" 	(*) lh#option#get() doesn't test emptyness anymore
28
-" 	v2.0.0
29
-" 		Code moved from {rtp}/macros/ 
30
-" }}}1
31
-"=============================================================================
32
-
33
-
34
-"=============================================================================
35
-let s:cpo_save=&cpo
36
-set cpo&vim
37
-
38
-"------------------------------------------------------------------------
39
-" ## Functions {{{1
40
-" # Debug {{{2
41
-function! lh#option#verbose(level)
42
-  let s:verbose = a:level
43
-endfunction
44
-
45
-function! s:Verbose(expr)
46
-  if exists('s:verbose') && s:verbose
47
-    echomsg a:expr
48
-  endif
49
-endfunction
50
-
51
-function! lh#option#debug(expr)
52
-  return eval(a:expr)
53
-endfunction
54
-
55
-" # Public {{{2
56
-" Function: lh#option#get(name, default [, scope])            {{{3
57
-" @return b:{name} if it exists, or g:{name} if it exists, or {default}
58
-" otherwise
59
-" The order of the variables checked can be specified through the optional
60
-" argument {scope}
61
-function! lh#option#get(name,default,...)
62
-  let scope = (a:0 == 1) ? a:1 : 'bg'
63
-  let name = a:name
64
-  let i = 0
65
-  while i != strlen(scope)
66
-    if exists(scope[i].':'.name)
67
-      " \ && (0 != strlen({scope[i]}:{name}))
68
-      return {scope[i]}:{name}
69
-    endif
70
-    let i += 1
71
-  endwhile 
72
-  return a:default
73
-endfunction
74
-function! lh#option#Get(name,default,...)
75
-  let scope = (a:0 == 1) ? a:1 : 'bg'
76
-  return lh#option#get(a:name, a:default, scope)
77
-endfunction
78
-
79
-function! s:IsEmpty(variable)
80
-  if     type(a:variable) == type('string') | return 0 == strlen(a:variable)
81
-  elseif type(a:variable) == type(42)       | return 0 == a:variable
82
-  elseif type(a:variable) == type([])       | return 0 == len(a:variable)
83
-  elseif type(a:variable) == type({})       | return 0 == len(a:variable)
84
-  else                                      | return false
85
-  endif
86
-endfunction
87
-
88
-" Function: lh#option#get_non_empty(name, default [, scope])  {{{3
89
-" @return of b:{name}, g:{name}, or {default} the first which exists and is not empty 
90
-" The order of the variables checked can be specified through the optional
91
-" argument {scope}
92
-function! lh#option#get_non_empty(name,default,...)
93
-  let scope = (a:0 == 1) ? a:1 : 'bg'
94
-  let name = a:name
95
-  let i = 0
96
-  while i != strlen(scope)
97
-    if exists(scope[i].':'.name) && !s:IsEmpty({scope[i]}:{name})
98
-      return {scope[i]}:{name}
99
-    endif
100
-    let i += 1
101
-  endwhile 
102
-  return a:default
103
-endfunction
104
-function! lh#option#GetNonEmpty(name,default,...)
105
-  let scope = (a:0 == 1) ? a:1 : 'bg'
106
-  return lh#option#get_non_empty(a:name, a:default, scope)
107
-endfunction
108
-
109
-" Function: lh#option#add(name, values)                       {{{3
110
-" Add fields to a vim option.
111
-" @param values list of values to add
112
-" @example let lh#option#add('l:tags', ['.tags'])
113
-function! lh#option#add(name,values)
114
-  let values = type(a:values) == type([])
115
-        \ ? copy(a:values)
116
-        \ : [a:values]
117
-  let old = split(eval('&'.a:name), ',')
118
-  let new = filter(values, 'match(old, v:val) < 0')
119
-  let val = join(old+new, ',')
120
-  exe 'let &'.a:name.' = val'
121
-endfunction
122
-
123
-" Functions }}}1
124
-"------------------------------------------------------------------------
125
-let &cpo=s:cpo_save
126
-"=============================================================================
127
-" vim600: set fdm=marker:

+ 0
- 366
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/path.vim View File

@@ -1,366 +0,0 @@
1
-"=============================================================================
2
-" $Id: path.vim 606 2012-05-31 17:09:46Z luc.hermitte@gmail.com $
3
-" File:		autoload/lh/path.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.1.1
9
-" Created:	23rd Jan 2007
10
-" Last Update:	$Date
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-"       Functions related to the handling of pathnames
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	
17
-" 	Drop this file into {rtp}/autoload/lh
18
-" 	Requires Vim7+
19
-" History:	
20
-"	v 1.0.0 First Version
21
-" 	(*) Functions moved from searchInRuntimeTime  
22
-" 	v 2.0.1
23
-" 	(*) lh#path#Simplify() becomes like |simplify()| except for trailing
24
-" 	v 2.0.2
25
-" 	(*) lh#path#SelectOne() 
26
-" 	(*) lh#path#ToRelative() 
27
-" 	v 2.0.3
28
-" 	(*) lh#path#GlobAsList() 
29
-" 	v 2.0.4
30
-" 	(*) lh#path#StripStart()
31
-" 	v 2.0.5
32
-" 	(*) lh#path#StripStart() interprets '.' as getcwd()
33
-" 	v 2.2.0
34
-" 	(*) new functions: lh#path#common(), lh#path#to_dirname(),
35
-" 	    lh#path#depth(), lh#path#relative_to(), lh#path#to_regex(),
36
-" 	    lh#path#find()
37
-" 	(*) lh#path#simplify() fixed
38
-" 	(*) lh#path#to_relative() use simplify()
39
-" 	v 2.2.2
40
-" 	(*) lh#path#strip_common() fixed
41
-" 	(*) lh#path#simplify() new optional parameter: make_relative_to_pwd
42
-" 	v 2.2.5
43
-" 	(*) fix lh#path#to_dirname('') -> return ''
44
-" 	v 2.2.6
45
-" 	(*) fix lh#path#glob_as_list() does not return the same path several
46
-" 	    times
47
-" 	v 2.2.7
48
-" 	(*) fix lh#path#strip_start() to strip as much as possible.
49
-" 	(*) lh#path#glob_as_list() changed to handle **
50
-"       v 3.0.0
51
-"       (*) GPLv3
52
-"       v 3.1.0
53
-"       (*) lh#path#glob_as_list accepts a new option: mustSort which value
54
-"       true by default.
55
-"       v 3.1.1
56
-"       (*) lh#path#strip_start() shall support very big lists of dirnames now.
57
-" TODO:
58
-"       (*) Decide what #depth('../../bar') shall return
59
-"       (*) Fix #simplify('../../bar')
60
-" }}}1
61
-"=============================================================================
62
-
63
-
64
-"=============================================================================
65
-" Avoid global reinclusion {{{1
66
-let s:cpo_save=&cpo
67
-set cpo&vim
68
-
69
-"=============================================================================
70
-" ## Functions {{{1
71
-" # Version {{{2
72
-let s:k_version = 310
73
-function! lh#path#version()
74
-  return s:k_version
75
-endfunction
76
-
77
-" # Debug {{{2
78
-let s:verbose = 0
79
-function! lh#path#verbose(...)
80
-  if a:0 > 0 | let s:verbose = a:1 | endif
81
-  return s:verbose
82
-endfunction
83
-
84
-function! s:Verbose(expr)
85
-  if s:verbose
86
-    echomsg a:expr
87
-  endif
88
-endfunction
89
-
90
-function! lh#path#debug(expr)
91
-  return eval(a:expr)
92
-endfunction
93
-
94
-"=============================================================================
95
-" # Public {{{2
96
-" Function: lh#path#simplify({pathname}, [make_relative_to_pwd=true]) {{{3
97
-" Like |simplify()|, but also strip the leading './'
98
-" It seems unable to simplify '..\' when compiled without +shellslash
99
-function! lh#path#simplify(pathname, ...)
100
-  let make_relative_to_pwd = a:0 == 0 || a:1 == 1
101
-  let pathname = simplify(a:pathname)
102
-  let pathname = substitute(pathname, '^\%(\.[/\\]\)\+', '', '')
103
-  let pathname = substitute(pathname, '\([/\\]\)\%(\.[/\\]\)\+', '\1', 'g')
104
-  if make_relative_to_pwd
105
-    let pwd = getcwd().'/'
106
-    let pathname = substitute(pathname, '^'.lh#path#to_regex(pwd), '', 'g')
107
-  endif
108
-  return pathname
109
-endfunction
110
-function! lh#path#Simplify(pathname)
111
-  return lh#path#simplify(a:pathname)
112
-endfunction
113
-
114
-" Function: lh#path#common({pathnames}) {{{3
115
-" Find the common leading path between all pathnames
116
-function! lh#path#common(pathnames)
117
-  " assert(len(pathnames)) > 1
118
-  let common = a:pathnames[0]
119
-  let i = 1
120
-  while i < len(a:pathnames)
121
-    let fcrt = a:pathnames[i]
122
-    " pathnames should not contain @
123
-    " let common = matchstr(common.'@@'.fcrt, '^\zs\(.*[/\\]\)\ze.\{-}@@\1.*$')
124
-    let common = matchstr(common.'@@'.fcrt, '^\zs\(.*\>\)\ze.\{-}@@\1\>.*$')
125
-    if strlen(common) == 0
126
-      " No need to further checks
127
-      break
128
-    endif
129
-    let i += 1
130
-  endwhile
131
-  return common
132
-endfunction
133
-
134
-" Function: lh#path#strip_common({pathnames}) {{{3
135
-" Find the common leading path between all pathnames, and strip it
136
-function! lh#path#strip_common(pathnames)
137
-  " assert(len(pathnames)) > 1
138
-  let common = lh#path#common(a:pathnames)
139
-  let common = lh#path#to_dirname(common)
140
-  let l = strlen(common)
141
-  if l == 0
142
-    return a:pathnames
143
-  else
144
-  let pathnames = a:pathnames
145
-  call map(pathnames, 'strpart(v:val, '.l.')' )
146
-  return pathnames
147
-  endif
148
-endfunction
149
-function! lh#path#StripCommon(pathnames)
150
-  return lh#path#strip_common(a:pathnames)
151
-endfunction
152
-
153
-" Function: lh#path#is_absolute_path({path}) {{{3
154
-function! lh#path#is_absolute_path(path)
155
-  return a:path =~ '^/'
156
-	\ . '\|^[a-zA-Z]:[/\\]'
157
-	\ . '\|^[/\\]\{2}'
158
-  "    Unix absolute path 
159
-  " or Windows absolute path
160
-  " or UNC path
161
-endfunction
162
-function! lh#path#IsAbsolutePath(path)
163
-  return lh#path#is_absolute_path(a:path)
164
-endfunction
165
-
166
-" Function: lh#path#is_url({path}) {{{3
167
-function! lh#path#is_url(path)
168
-  " todo: support UNC paths and other urls
169
-  return a:path =~ '^\%(https\=\|s\=ftp\|dav\|fetch\|file\|rcp\|rsynch\|scp\)://'
170
-endfunction
171
-function! lh#path#IsURL(path)
172
-  return lh#path#is_url(a:path)
173
-endfunction
174
-
175
-" Function: lh#path#select_one({pathnames},{prompt}) {{{3
176
-function! lh#path#select_one(pathnames, prompt)
177
-  if len(a:pathnames) > 1
178
-    let simpl_pathnames = deepcopy(a:pathnames) 
179
-    let simpl_pathnames = lh#path#strip_common(simpl_pathnames)
180
-    let simpl_pathnames = [ '&Cancel' ] + simpl_pathnames
181
-    " Consider guioptions+=c is case of difficulties with the gui
182
-    let selection = confirm(a:prompt, join(simpl_pathnames,"\n"), 1, 'Question')
183
-    let file = (selection == 1) ? '' : a:pathnames[selection-2]
184
-    return file
185
-  elseif len(a:pathnames) == 0
186
-    return ''
187
-  else
188
-    return a:pathnames[0]
189
-  endif
190
-endfunction
191
-function! lh#path#SelectOne(pathnames, prompt)
192
-  return lh#path#select_one(a:pathnames, a:prompt)
193
-endfunction
194
-
195
-" Function: lh#path#to_relative({pathname}) {{{3
196
-function! lh#path#to_relative(pathname)
197
-  let newpath = fnamemodify(a:pathname, ':p:.')
198
-  let newpath = simplify(newpath)
199
-  return newpath
200
-endfunction
201
-function! lh#path#ToRelative(pathname)
202
-  return lh#path#to_relative(a:pathname)
203
-endfunction
204
-
205
-" Function: lh#path#to_dirname({dirname}) {{{3
206
-" todo: use &shellslash
207
-function! lh#path#to_dirname(dirname)
208
-  let dirname = a:dirname . (empty(a:dirname) || a:dirname[-1:] =~ '[/\\]' ? '' : '/')
209
-  return dirname
210
-endfunction
211
-
212
-" Function: lh#path#depth({dirname}) {{{3
213
-" todo: make a choice about "negative" paths like "../../foo"
214
-function! lh#path#depth(dirname)
215
-  if empty(a:dirname) | return 0 | endif
216
-  let dirname = lh#path#to_dirname(a:dirname)
217
-  let dirname = lh#path#simplify(dirname)
218
-  if lh#path#is_absolute_path(dirname)
219
-    let dirname = matchstr(dirname, '.\{-}[/\\]\zs.*')
220
-  endif
221
-  let depth = len(substitute(dirname, '[^/\\]\+[/\\]', '#', 'g'))
222
-  return depth
223
-endfunction
224
-
225
-" Function: lh#path#relative_to({from}, {to}) {{{3
226
-" @param two directories
227
-" @return a directories delta that ends with a '/' (may depends on
228
-" &shellslash)
229
-function! lh#path#relative_to(from, to)
230
-  " let from = fnamemodify(a:from, ':p')
231
-  " let to   = fnamemodify(a:to  , ':p')
232
-  let from = lh#path#to_dirname(a:from)
233
-  let to   = lh#path#to_dirname(a:to  )
234
-  let [from, to] = lh#path#strip_common([from, to])
235
-  let nb_up =  lh#path#depth(from)
236
-  return repeat('../', nb_up).to
237
-
238
-  " cannot rely on :cd (as it alters things, and doesn't work with
239
-  " non-existant paths)
240
-  let pwd = getcwd()
241
-  exe 'cd '.a:to
242
-  let res = lh#path#to_relative(a:from)
243
-  exe 'cd '.pwd
244
-  return res
245
-endfunction
246
-
247
-" Function: lh#path#glob_as_list({pathslist}, {expr} [, mustSort=1]) {{{3
248
-function! s:GlobAsList(pathslist, expr,  mustSort)
249
-  let pathslist = type(a:pathslist) == type([]) ? join(a:pathslist, ',') : a:pathslist
250
-  let sResult = globpath(pathslist, a:expr)
251
-  let lResult = split(sResult, '\n')
252
-  " workaround a non feature of wildignore: it does not ignore directories
253
-  for ignored_pattern in split(&wildignore,',')
254
-    if stridx(ignored_pattern,'/') != -1
255
-      call filter(lResult, 'v:val !~ '.string(ignored_pattern))
256
-    endif
257
-  endfor
258
-  return a:mustSort ? lh#list#unique_sort(lResult) : lResult
259
-endfunction
260
-
261
-function! lh#path#glob_as_list(pathslist, expr, ...)
262
-  let mustSort = (a:0 > 0) ? (a:1) : 0
263
-  if type(a:expr) == type('string')
264
-    return s:GlobAsList(a:pathslist, a:expr, mustSort)
265
-  elseif type(a:expr) == type([])
266
-    let res = []
267
-    for expr in a:expr
268
-      call extend(res, s:GlobAsList(a:pathslist, expr, mustSort))
269
-    endfor
270
-    return res
271
-  else
272
-    throw "Unexpected type for a:expression"
273
-  endif
274
-endfunction
275
-function! lh#path#GlobAsList(pathslist, expr)
276
-  return lh#path#glob_as_list(a:pathslist, a:expr)
277
-endfunction
278
-
279
-" Function: lh#path#strip_start({pathname}, {pathslist}) {{{3
280
-" Strip occurrence of paths from {pathslist} in {pathname}
281
-" @param[in] {pathname} name to simplify
282
-" @param[in] {pathslist} list of pathname (can be a |string| of pathnames
283
-" separated by ",", of a |List|).
284
-function! lh#path#strip_start(pathname, pathslist)
285
-  if type(a:pathslist) == type('string')
286
-    " let strip_re = escape(a:pathslist, '\\.')
287
-    " let strip_re = '^' . substitute(strip_re, ',', '\\|^', 'g')
288
-    let pathslist = split(a:pathslist, ',')
289
-  elseif type(a:pathslist) == type([])
290
-    let pathslist = deepcopy(a:pathslist)
291
-  else
292
-    throw "Unexpected type for a:pathname"
293
-  endif
294
-
295
-  " apply a realpath like operation
296
-  let nb_paths = len(pathslist) " set before the loop
297
-  let i = 0
298
-  while i != nb_paths
299
-    if pathslist[i] =~ '^\.\%(/\|$\)'
300
-      let path2 = getcwd().pathslist[i][1:]
301
-      call add(pathslist, path2)
302
-    endif
303
-    let i += 1
304
-  endwhile
305
-  " replace path separators by a regex that can match them
306
-  call map(pathslist, 'substitute(v:val, "[\\\\/]", "[\\\\/]", "g")')
307
-  " echomsg string(pathslist)
308
-  " escape .
309
-  call map(pathslist, '"^".escape(v:val, ".")')
310
-  " handle "**" as anything
311
-  call map(pathslist, 'substitute(v:val, "\\*\\*", "\\\\%([^\\\\/]*[\\\\/]\\\\)*", "g")')
312
-  " reverse the list to use the real best match, which is "after"
313
-  call reverse(pathslist)
314
-  if 0
315
-    " build the strip regex
316
-    let strip_re = join(pathslist, '\|')
317
-    " echomsg strip_re
318
-    let best_match = substitute(a:pathname, '\%('.strip_re.'\)[/\\]\=', '', '')
319
-  else
320
-    let best_match = ''
321
-    for path in pathslist
322
-      let a_match = substitute(a:pathname, '\%('.path.'\)[/\\]\=', '', '')
323
-      if len(a_match) < len(best_match) || empty(best_match)
324
-        let best_match = a_match
325
-      endif
326
-    endfor
327
-  endif
328
-  return best_match
329
-endfunction
330
-function! lh#path#StripStart(pathname, pathslist)
331
-  return lh#path#strip_start(a:pathname, a:pathslist)
332
-endfunction
333
-
334
-" Function: lh#path#to_regex({pathname}) {{{3
335
-function! lh#path#to_regex(path)
336
-  let regex = substitute(a:path, '[/\\]', '[/\\\\]', 'g')
337
-  return regex
338
-endfunction
339
-
340
-" Function: lh#path#find({pathname}, {regex}) {{{3
341
-function! lh#path#find(paths, regex)
342
-  let paths = (type(a:paths) == type([]))
343
-	\ ? (a:paths) 
344
-	\ : split(a:paths,',')
345
-  for path in paths
346
-    if match(path ,a:regex) != -1
347
-      return path
348
-    endif
349
-  endfor
350
-  return ''
351
-endfunction
352
-
353
-" Function: lh#path#vimfiles() {{{3
354
-function! lh#path#vimfiles()
355
-  let expected_win = $HOME . '/vimfiles'
356
-  let expected_nix = $HOME . '/.vim'
357
-  let what =  lh#path#to_regex($HOME.'/').'\(vimfiles\|.vim\)'
358
-  " Comment what
359
-  let z = lh#path#find(&rtp,what)
360
-  return z
361
-endfunction
362
-" }}}1
363
-"=============================================================================
364
-let &cpo=s:cpo_save
365
-"=============================================================================
366
-" vim600: set fdm=marker:

+ 0
- 96
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/position.vim View File

@@ -1,96 +0,0 @@
1
-"=============================================================================
2
-" $Id: position.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		autoload/lh/position.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	05th Sep 2007
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (05th Sep 2007)
11
-"------------------------------------------------------------------------
12
-" Description:	«description»
13
-" 
14
-"------------------------------------------------------------------------
15
-" Installation:
16
-" 	Drop it into {rtp}/autoload/lh/
17
-" 	Vim 7+ required.
18
-" History:	«history»
19
-" 	v1.0.0:
20
-" 		Creation
21
-"       v3.0.0: GPLv3
22
-" TODO:		
23
-" }}}1
24
-"=============================================================================
25
-
26
-
27
-"=============================================================================
28
-let s:cpo_save=&cpo
29
-set cpo&vim
30
-"------------------------------------------------------------------------
31
-" ## Functions {{{1
32
-" # Debug {{{2
33
-function! lh#position#verbose(level)
34
-  let s:verbose = a:level
35
-endfunction
36
-
37
-function! s:Verbose(expr)
38
-  if exists('s:verbose') && s:verbose
39
-    echomsg a:expr
40
-  endif
41
-endfunction
42
-
43
-function! lh#position#debug(expr)
44
-  return eval(a:expr)
45
-endfunction
46
-
47
-
48
-"------------------------------------------------------------------------
49
-" # Public {{{2
50
-" Function: lh#position#is_before {{{3
51
-" @param[in] positions as those returned from |getpos()|
52
-" @return whether lhs_pos is before rhs_pos
53
-function! lh#position#is_before(lhs_pos, rhs_pos)
54
-  if a:lhs_pos[0] != a:rhs_pos[0]
55
-    throw "Positions from incompatible buffers can't be ordered"
56
-  endif
57
-  "1 test lines
58
-  "2 test cols
59
-  let before 
60
-	\ = (a:lhs_pos[1] == a:rhs_pos[1])
61
-	\ ? (a:lhs_pos[2] < a:rhs_pos[2])
62
-	\ : (a:lhs_pos[1] < a:rhs_pos[1])
63
-  return before
64
-endfunction
65
-function! lh#position#IsBefore(lhs_pos, rhs_pos)
66
-  return lh#position#is_before(a:lhs_pos, a:rhs_pos)
67
-endfunction
68
-
69
-
70
-" Function: lh#position#char_at_mark {{{3
71
-" @return the character at a given mark (|mark|)
72
-function! lh#position#char_at_mark(mark)
73
-  let c = getline(a:mark)[col(a:mark)-1]
74
-  return c
75
-endfunction
76
-function! lh#position#CharAtMark(mark)
77
-return lh#position#char_at_mark(a:mark)
78
-endfunction
79
-
80
-" Function: lh#position#char_at_pos {{{3
81
-" @return the character at a given position (|getpos()|)
82
-function! lh#position#char_at_pos(pos)
83
-  let c = getline(a:pos[1])[(a:pos[2])-1]
84
-  return c
85
-endfunction
86
-function! lh#position#CharAtPos(pos)
87
-  return  lh#position#char_at_pos(a:pos)
88
-endfunction
89
-
90
-
91
-
92
-" Functions }}}1
93
-"------------------------------------------------------------------------
94
-let &cpo=s:cpo_save
95
-"=============================================================================
96
-" vim600: set fdm=marker:

+ 0
- 153
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/syntax.vim View File

@@ -1,153 +0,0 @@
1
-"=============================================================================
2
-" $Id: syntax.vim 558 2012-04-10 08:00:00Z luc.hermitte $
3
-" File:		autoload/lh/syntax.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.1.0
9
-" Created:	05th Sep 2007
10
-" Last Update:	$Date: 2012-04-10 10:00:00 +0200 (mar 10 avr 2012) $ (05th Sep 2007)
11
-"------------------------------------------------------------------------
12
-" Description:	«description»
13
-" 
14
-"------------------------------------------------------------------------
15
-" Installation:
16
-" 	Drop it into {rtp}/autoload/lh/
17
-" 	Vim 7+ required.
18
-" History:	«history»
19
-" 	v1.0.0:
20
-" 		Creation ;
21
-" 		Functions moved from lhVimSpell
22
-"       v3.0.0: GPLv3
23
-"       v3.1.0: lh#syntax#is_a_comment()
24
-" TODO:
25
-" 	function, to inject "contained", see lhVimSpell approach
26
-" }}}1
27
-"=============================================================================
28
-
29
-
30
-"=============================================================================
31
-let s:cpo_save=&cpo
32
-set cpo&vim
33
-"------------------------------------------------------------------------
34
-" ## Functions {{{1
35
-" # Debug {{{2
36
-function! lh#syntax#verbose(level)
37
-  let s:verbose = a:level
38
-endfunction
39
-
40
-function! s:Verbose(expr)
41
-  if exists('s:verbose') && s:verbose
42
-    echomsg a:expr
43
-  endif
44
-endfunction
45
-
46
-function! lh#syntax#debug(expr)
47
-  return eval(a:expr)
48
-endfunction
49
-
50
-" # Public {{{2
51
-" Functions: Show name of the syntax kind of a character {{{3
52
-function! lh#syntax#name_at(l,c, ...)
53
-  let what = a:0 > 0 ? a:1 : 0
54
-  return synIDattr(synID(a:l, a:c, what),'name')
55
-endfunction
56
-function! lh#syntax#NameAt(l,c, ...)
57
-  let what = a:0 > 0 ? a:1 : 0
58
-  return lh#syntax#name_at(a:l, a:c, what)
59
-endfunction
60
-
61
-function! lh#syntax#name_at_mark(mark, ...)
62
-  let what = a:0 > 0 ? a:1 : 0
63
-  return lh#syntax#name_at(line(a:mark), col(a:mark), what)
64
-endfunction
65
-function! lh#syntax#NameAtMark(mark, ...)
66
-  let what = a:0 > 0 ? a:1 : 0
67
-  return lh#syntax#name_at_mark(a:mark, what)
68
-endfunction
69
-
70
-" Functions: skip string, comment, character, doxygen {{{3
71
-func! lh#syntax#skip_at(l,c)
72
-  return lh#syntax#name_at(a:l,a:c) =~? 'string\|comment\|character\|doxygen'
73
-endfun
74
-func! lh#syntax#SkipAt(l,c)
75
-  return lh#syntax#skip_at(a:l,a:c)
76
-endfun
77
-
78
-func! lh#syntax#skip()
79
-  return lh#syntax#skip_at(line('.'), col('.'))
80
-endfun
81
-func! lh#syntax#Skip()
82
-  return lh#syntax#skip()
83
-endfun
84
-
85
-func! lh#syntax#skip_at_mark(mark)
86
-  return lh#syntax#skip_at(line(a:mark), col(a:mark))
87
-endfun
88
-func! lh#syntax#SkipAtMark(mark)
89
-  return lh#syntax#skip_at_mark(a:mark)
90
-endfun
91
-
92
-" Command: :SynShow Show current syntax kind                      {{{3
93
-command! SynShow echo 'hi<'.lh#syntax#name_at_mark('.',1).'> trans<'
94
-      \ lh#syntax#name_at_mark('.',0).'> lo<'.
95
-      \ synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name').'>   ## '
96
-      \ lh#list#transform(synstack(line("."), col(".")), [], 'synIDattr(v:1_, "name")')
97
-
98
-
99
-" Function: lh#syntax#list_raw(name) : string                     {{{3
100
-function! lh#syntax#list_raw(name)
101
-  let a_save = @a
102
-  try
103
-    redir @a
104
-    exe 'silent! syn list '.a:name
105
-    redir END
106
-    let res = @a
107
-  finally
108
-    let @a = a_save
109
-  endtry
110
-  return res
111
-endfunction
112
-
113
-" Function: lh#syntax#list(name) : List                           {{{3
114
-function! lh#syntax#list(name)
115
-  let raw = lh#syntax#list_raw(a:name)
116
-  let res = [] 
117
-  let lines = split(raw, '\n')
118
-  let started = 0
119
-  for l in lines
120
-    if started
121
-      let li = (l =~ 'links to') ? '' : l
122
-    elseif l =~ 'xxx'
123
-      let li = matchstr(l, 'xxx\s*\zs.*')
124
-      let started = 1
125
-    else
126
-      let li = ''
127
-    endif
128
-    if strlen(li) != 0
129
-      let li = substitute(li, 'contained\S*\|transparent\|nextgroup\|skipwhite\|skipnl\|skipempty', '', 'g')
130
-      let kinds = split(li, '\s\+')
131
-      call extend(res, kinds)
132
-    endif
133
-  endfor
134
-  return res
135
-endfunction
136
-
137
-" Function: lh#syntax#is_a_comment(mark) : bool                   {{{3
138
-function! lh#syntax#is_a_comment(mark)
139
-  let stack = synstack(line(a:mark), col(a:mark))
140
-  for syn in stack
141
-    if synIDattr(syn, 'name') =~? 'comment'
142
-      return 1
143
-    endif
144
-  endfor
145
-  return 0
146
-endfunction
147
-
148
-
149
-" Functions }}}1
150
-"------------------------------------------------------------------------
151
-let &cpo=s:cpo_save
152
-"=============================================================================
153
-" vim600: set fdm=marker:

+ 0
- 58
dotfiles/vim/bundle/lh-vim-lib/autoload/lh/visual.vim View File

@@ -1,58 +0,0 @@
1
-"=============================================================================
2
-" $Id$
3
-" File:		autoload/lh/visual.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	08th Sep 2008
10
-" Last Update:	$Date$
11
-"------------------------------------------------------------------------
12
-" 	Helpers functions releated to the visual mode
13
-" 
14
-"------------------------------------------------------------------------
15
-" 	Drop it into {rtp}/autoload/lh/
16
-" 	Vim 7+ required.
17
-" History:	
18
-"       v3.0.0: GPLv3
19
-" 	v2.2.5: lh#visual#cut()
20
-" 	v2.0.6: First appearance
21
-" TODO:		«missing features»
22
-" }}}1
23
-"=============================================================================
24
-
25
-let s:cpo_save=&cpo
26
-set cpo&vim
27
-"------------------------------------------------------------------------
28
-" Functions {{{1
29
-
30
-" Function: lh#visual#selection()                              {{{3
31
-" @return the text currently selected
32
-function! lh#visual#selection()
33
-  try
34
-    let a_save = @a
35
-    normal! gv"ay
36
-    return @a
37
-  finally
38
-    let @a = a_save
39
-  endtry
40
-endfunction
41
-
42
-" Function: lh#visual#cut()                                    {{{3
43
-" @return and delete the text currently selected
44
-function! lh#visual#cut()
45
-  try
46
-    let a_save = @a
47
-    normal! gv"ad
48
-    return @a
49
-  finally
50
-    let @a = a_save
51
-  endtry
52
-endfunction
53
-
54
-" Functions }}}1
55
-"------------------------------------------------------------------------
56
-let &cpo=s:cpo_save
57
-"=============================================================================
58
-" vim600: set fdm=marker:

+ 0
- 1368
dotfiles/vim/bundle/lh-vim-lib/doc/lh-vim-lib.txt
File diff suppressed because it is too large
View File


+ 0
- 139
dotfiles/vim/bundle/lh-vim-lib/doc/tags View File

@@ -1,139 +0,0 @@
1
-[gb]:want_buffermenu_or_global_disable	lh-vim-lib.txt	/*[gb]:want_buffermenu_or_global_disable*
2
-lh#askvim#Exe()	lh-vim-lib.txt	/*lh#askvim#Exe()*
3
-lh#askvim#exe()	lh-vim-lib.txt	/*lh#askvim#exe()*
4
-lh#askvim#menu()	lh-vim-lib.txt	/*lh#askvim#menu()*
5
-lh#buffer#Find()	lh-vim-lib.txt	/*lh#buffer#Find()*
6
-lh#buffer#Jump()	lh-vim-lib.txt	/*lh#buffer#Jump()*
7
-lh#buffer#Scratch()	lh-vim-lib.txt	/*lh#buffer#Scratch()*
8
-lh#buffer#dialog#	lh-vim-lib.txt	/*lh#buffer#dialog#*
9
-lh#buffer#dialog#add_help()	lh-vim-lib.txt	/*lh#buffer#dialog#add_help()*
10
-lh#buffer#dialog#new()	lh-vim-lib.txt	/*lh#buffer#dialog#new()*
11
-lh#buffer#dialog#quit()	lh-vim-lib.txt	/*lh#buffer#dialog#quit()*
12
-lh#buffer#dialog#select()	lh-vim-lib.txt	/*lh#buffer#dialog#select()*
13
-lh#buffer#dialog#update()	lh-vim-lib.txt	/*lh#buffer#dialog#update()*
14
-lh#buffer#find()	lh-vim-lib.txt	/*lh#buffer#find()*
15
-lh#buffer#jump()	lh-vim-lib.txt	/*lh#buffer#jump()*
16
-lh#buffer#list()	lh-vim-lib.txt	/*lh#buffer#list()*
17
-lh#buffer#scratch()	lh-vim-lib.txt	/*lh#buffer#scratch()*
18
-lh#command#Fargs2String()	lh-vim-lib.txt	/*lh#command#Fargs2String()*
19
-lh#command#complete()	lh-vim-lib.txt	/*lh#command#complete()*
20
-lh#command#new()	lh-vim-lib.txt	/*lh#command#new()*
21
-lh#common#CheckDeps()	lh-vim-lib.txt	/*lh#common#CheckDeps()*
22
-lh#common#ErrorMsg()	lh-vim-lib.txt	/*lh#common#ErrorMsg()*
23
-lh#common#WarningMsg()	lh-vim-lib.txt	/*lh#common#WarningMsg()*
24
-lh#common#check_deps()	lh-vim-lib.txt	/*lh#common#check_deps()*
25
-lh#common#echomsgMultilines()	lh-vim-lib.txt	/*lh#common#echomsgMultilines()*
26
-lh#common#echomsg_multilines()	lh-vim-lib.txt	/*lh#common#echomsg_multilines()*
27
-lh#common#error_msg()	lh-vim-lib.txt	/*lh#common#error_msg()*
28
-lh#common#warning_msg()	lh-vim-lib.txt	/*lh#common#warning_msg()*
29
-lh#encoding#at()	lh-vim-lib.txt	/*lh#encoding#at()*
30
-lh#encoding#iconv()	lh-vim-lib.txt	/*lh#encoding#iconv()*
31
-lh#encoding#strlen()	lh-vim-lib.txt	/*lh#encoding#strlen()*
32
-lh#encoding#strpart()	lh-vim-lib.txt	/*lh#encoding#strpart()*
33
-lh#event#RegisterForOneExecutionAt()	lh-vim-lib.txt	/*lh#event#RegisterForOneExecutionAt()*
34
-lh#event#register_for_one_execution_at()	lh-vim-lib.txt	/*lh#event#register_for_one_execution_at()*
35
-lh#float#arg_max()	lh-vim-lib.txt	/*lh#float#arg_max()*
36
-lh#float#arg_min()	lh-vim-lib.txt	/*lh#float#arg_min()*
37
-lh#float#max()	lh-vim-lib.txt	/*lh#float#max()*
38
-lh#float#min()	lh-vim-lib.txt	/*lh#float#min()*
39
-lh#function#bind()	lh-vim-lib.txt	/*lh#function#bind()*
40
-lh#function#execute()	lh-vim-lib.txt	/*lh#function#execute()*
41
-lh#function#prepare()	lh-vim-lib.txt	/*lh#function#prepare()*
42
-lh#graph#tsort#breadth()	lh-vim-lib.txt	/*lh#graph#tsort#breadth()*
43
-lh#graph#tsort#depth()	lh-vim-lib.txt	/*lh#graph#tsort#depth()*
44
-lh#icomplete#run()	lh-vim-lib.txt	/*lh#icomplete#run()*
45
-lh#list#Find_if()	lh-vim-lib.txt	/*lh#list#Find_if()*
46
-lh#list#Match()	lh-vim-lib.txt	/*lh#list#Match()*
47
-lh#list#Transform()	lh-vim-lib.txt	/*lh#list#Transform()*
48
-lh#list#accumulate()	lh-vim-lib.txt	/*lh#list#accumulate()*
49
-lh#list#copy_if()	lh-vim-lib.txt	/*lh#list#copy_if()*
50
-lh#list#equal_range()	lh-vim-lib.txt	/*lh#list#equal_range()*
51
-lh#list#find_if()	lh-vim-lib.txt	/*lh#list#find_if()*
52
-lh#list#intersect()	lh-vim-lib.txt	/*lh#list#intersect()*
53
-lh#list#lower_bound()	lh-vim-lib.txt	/*lh#list#lower_bound()*
54
-lh#list#match()	lh-vim-lib.txt	/*lh#list#match()*
55
-lh#list#matches()	lh-vim-lib.txt	/*lh#list#matches()*
56
-lh#list#not_found()	lh-vim-lib.txt	/*lh#list#not_found()*
57
-lh#list#remove()	lh-vim-lib.txt	/*lh#list#remove()*
58
-lh#list#subset()	lh-vim-lib.txt	/*lh#list#subset()*
59
-lh#list#transform()	lh-vim-lib.txt	/*lh#list#transform()*
60
-lh#list#transform_if()	lh-vim-lib.txt	/*lh#list#transform_if()*
61
-lh#list#unique_sort()	lh-vim-lib.txt	/*lh#list#unique_sort()*
62
-lh#list#unique_sort2()	lh-vim-lib.txt	/*lh#list#unique_sort2()*
63
-lh#list#upper_bound()	lh-vim-lib.txt	/*lh#list#upper_bound()*
64
-lh#menu#IVN_make()	lh-vim-lib.txt	/*lh#menu#IVN_make()*
65
-lh#menu#def_toggle_item()	lh-vim-lib.txt	/*lh#menu#def_toggle_item()*
66
-lh#menu#is_in_visual_mode()	lh-vim-lib.txt	/*lh#menu#is_in_visual_mode()*
67
-lh#menu#make()	lh-vim-lib.txt	/*lh#menu#make()*
68
-lh#menu#make()_modes	lh-vim-lib.txt	/*lh#menu#make()_modes*
69
-lh#menu#map_all()	lh-vim-lib.txt	/*lh#menu#map_all()*
70
-lh#menu#text()	lh-vim-lib.txt	/*lh#menu#text()*
71
-lh#option#Get()	lh-vim-lib.txt	/*lh#option#Get()*
72
-lh#option#GetNonEmpty()	lh-vim-lib.txt	/*lh#option#GetNonEmpty()*
73
-lh#option#get()	lh-vim-lib.txt	/*lh#option#get()*
74
-lh#option#get_non_empty()	lh-vim-lib.txt	/*lh#option#get_non_empty()*
75
-lh#path#GlobAsList()	lh-vim-lib.txt	/*lh#path#GlobAsList()*
76
-lh#path#IsAbsolutePath()	lh-vim-lib.txt	/*lh#path#IsAbsolutePath()*
77
-lh#path#IsURL()	lh-vim-lib.txt	/*lh#path#IsURL()*
78
-lh#path#SelectOne()	lh-vim-lib.txt	/*lh#path#SelectOne()*
79
-lh#path#Simplify()	lh-vim-lib.txt	/*lh#path#Simplify()*
80
-lh#path#StripCommon()	lh-vim-lib.txt	/*lh#path#StripCommon()*
81
-lh#path#StripStart()	lh-vim-lib.txt	/*lh#path#StripStart()*
82
-lh#path#ToRelative()	lh-vim-lib.txt	/*lh#path#ToRelative()*
83
-lh#path#common()	lh-vim-lib.txt	/*lh#path#common()*
84
-lh#path#depth()	lh-vim-lib.txt	/*lh#path#depth()*
85
-lh#path#dirname()	lh-vim-lib.txt	/*lh#path#dirname()*
86
-lh#path#find()	lh-vim-lib.txt	/*lh#path#find()*
87
-lh#path#glob_as_list()	lh-vim-lib.txt	/*lh#path#glob_as_list()*
88
-lh#path#is_absolute_path()	lh-vim-lib.txt	/*lh#path#is_absolute_path()*
89
-lh#path#is_url()	lh-vim-lib.txt	/*lh#path#is_url()*
90
-lh#path#relative_to()	lh-vim-lib.txt	/*lh#path#relative_to()*
91
-lh#path#select_one()	lh-vim-lib.txt	/*lh#path#select_one()*
92
-lh#path#simplify()	lh-vim-lib.txt	/*lh#path#simplify()*
93
-lh#path#strip_common()	lh-vim-lib.txt	/*lh#path#strip_common()*
94
-lh#path#strip_start()	lh-vim-lib.txt	/*lh#path#strip_start()*
95
-lh#path#to_regex()	lh-vim-lib.txt	/*lh#path#to_regex()*
96
-lh#path#to_relative()	lh-vim-lib.txt	/*lh#path#to_relative()*
97
-lh#position#CharAtMark()	lh-vim-lib.txt	/*lh#position#CharAtMark()*
98
-lh#position#CharAtPos()	lh-vim-lib.txt	/*lh#position#CharAtPos()*
99
-lh#position#IsBefore()	lh-vim-lib.txt	/*lh#position#IsBefore()*
100
-lh#position#char_at_mark()	lh-vim-lib.txt	/*lh#position#char_at_mark()*
101
-lh#position#char_at_pos()	lh-vim-lib.txt	/*lh#position#char_at_pos()*
102
-lh#position#is_before()	lh-vim-lib.txt	/*lh#position#is_before()*
103
-lh#syntax#NameAt()	lh-vim-lib.txt	/*lh#syntax#NameAt()*
104
-lh#syntax#NameAtMark()	lh-vim-lib.txt	/*lh#syntax#NameAtMark()*
105
-lh#syntax#Skip()	lh-vim-lib.txt	/*lh#syntax#Skip()*
106
-lh#syntax#SkipAt()	lh-vim-lib.txt	/*lh#syntax#SkipAt()*
107
-lh#syntax#SkipAtMark()	lh-vim-lib.txt	/*lh#syntax#SkipAtMark()*
108
-lh#syntax#is_a_comment()	lh-vim-lib.txt	/*lh#syntax#is_a_comment()*
109
-lh#syntax#list()	lh-vim-lib.txt	/*lh#syntax#list()*
110
-lh#syntax#list_raw()	lh-vim-lib.txt	/*lh#syntax#list_raw()*
111
-lh#syntax#name_at()	lh-vim-lib.txt	/*lh#syntax#name_at()*
112
-lh#syntax#name_at_mark()	lh-vim-lib.txt	/*lh#syntax#name_at_mark()*
113
-lh#syntax#skip()	lh-vim-lib.txt	/*lh#syntax#skip()*
114
-lh#syntax#skip_at()	lh-vim-lib.txt	/*lh#syntax#skip_at()*
115
-lh#syntax#skip_at_mark()	lh-vim-lib.txt	/*lh#syntax#skip_at_mark()*
116
-lh#visual#cut()	lh-vim-lib.txt	/*lh#visual#cut()*
117
-lh#visual#selection()	lh-vim-lib.txt	/*lh#visual#selection()*
118
-lh-vim-lib.txt	lh-vim-lib.txt	/*lh-vim-lib.txt*
119
-lhvl#buffer	lh-vim-lib.txt	/*lhvl#buffer*
120
-lhvl#command	lh-vim-lib.txt	/*lhvl#command*
121
-lhvl#completion	lh-vim-lib.txt	/*lhvl#completion*
122
-lhvl#function	lh-vim-lib.txt	/*lhvl#function*
123
-lhvl#functor	lh-vim-lib.txt	/*lhvl#functor*
124
-lhvl#graph	lh-vim-lib.txt	/*lhvl#graph*
125
-lhvl#list	lh-vim-lib.txt	/*lhvl#list*
126
-lhvl#menu	lh-vim-lib.txt	/*lhvl#menu*
127
-lhvl#misc	lh-vim-lib.txt	/*lhvl#misc*
128
-lhvl#path	lh-vim-lib.txt	/*lhvl#path*
129
-lhvl#syntax	lh-vim-lib.txt	/*lhvl#syntax*
130
-lhvl-:Toggle	lh-vim-lib.txt	/*lhvl-:Toggle*
131
-lhvl-contents	lh-vim-lib.txt	/*lhvl-contents*
132
-lhvl-dialog	lh-vim-lib.txt	/*lhvl-dialog*
133
-lhvl-dialog-select-callback	lh-vim-lib.txt	/*lhvl-dialog-select-callback*
134
-lhvl-functions	lh-vim-lib.txt	/*lhvl-functions*
135
-lhvl-presentation	lh-vim-lib.txt	/*lhvl-presentation*
136
-s:PostInit()	lh-vim-lib.txt	/*s:PostInit()*
137
-scratch	lh-vim-lib.txt	/*scratch*
138
-v:1_	lh-vim-lib.txt	/*v:1_*
139
-v:2_	lh-vim-lib.txt	/*v:2_*

+ 0
- 6778
dotfiles/vim/bundle/lh-vim-lib/lh-vim-lib-3.1.1.vmb
File diff suppressed because it is too large
View File


+ 0
- 10
dotfiles/vim/bundle/lh-vim-lib/lh-vim-lib-addon-info.txt View File

@@ -1,10 +0,0 @@
1
-{
2
-  "name" : "lh-vim-lib",
3
-  "version" : "dev",
4
-  "author" : "Luc Hermitte <http://code.google.com/p/lh-vim/wiki/contact>",
5
-  "maintainer" : "Luc Hermitte <http://code.google.com/p/lh-vim/wiki/contact>",
6
-  "repository" : {"type": "svn", "url": "http://lh-vim.googlecode.com/svn/vim-lib/trunk"},
7
-  "dependencies" : {},
8
-  "description" : "Library of VimL functions",
9
-  "homepage" : "http://code.google.com/p/lh-vim/wiki/lhVimLib"
10
-}

+ 0
- 20
dotfiles/vim/bundle/lh-vim-lib/lh-vim-lib.README View File

@@ -1,20 +0,0 @@
1
-			   ------------------
2
-			    lh-vim-lib 3.1.0
3
-			   ------------------
4
-
5
-lh-vim-lib is a library plugin for vim v7+. It is just a collection of
6
-functions that are meant to be used by script writers.
7
-
8
-Audience      : Vim script writers
9
-Requirements  : Vim 7.1, Vim 7.3 for some functions
10
-Required by   : Just a few other plugins for the moment
11
-Author        : Luc Hermitte
12
-License       : GPLv3 with exceptions
13
-                http://code.google.com/p/lh-vim/wiki/License
14
-More Help At  : http://code.google.com/p/lh-vim/wiki/lhVimLib
15
-Vim script#214: http://www.vim.org/scripts/script.php?script_id=214
16
-Repository    :
17
-	svn checkout http://lh-vim.googlecode.com/svn/vim-lib/trunk lh-vim-lib
18
-VAM           :
19
-	http://code.google.com/p/lh-vim/source/browse/vim-lib/trunk/lh-vim-lib-addon-info.txt
20
-

+ 0
- 87
dotfiles/vim/bundle/lh-vim-lib/macros/menu-map.vim View File

@@ -1,87 +0,0 @@
1
-"===========================================================================
2
-" $Id: menu-map.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		macros/menu-map.vim
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-" 		<URL:http://code.google.com/p/lh-vim/>
6
-"
7
-" Purpose:	Define functions to build mappings and menus at the same time
8
-"
9
-" License:      GPLv3 with exceptions
10
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
11
-" Version:	3.0.0
12
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (02nd Dec 2006)
13
-"
14
-" Last Changes: {{{
15
-"       Version 3.0.0:
16
-"               GPLv3
17
-" 	Version 2.0.0:
18
-" 		Moved to vim7, 
19
-" 		Functions moved to {rtp}/autoload/
20
-" 	Version 1.6.2: 
21
-" 		(*) Silent mappings and menus
22
-" 	Version 1.6. : 
23
-" 		(*) Uses has('gui_running') instead of has('gui') to check if
24
-" 		we can generate the menu.
25
-" 	Version 1.5. : 
26
-" 		(*) visual mappings launched from select-mode don't end with
27
-" 		    text still selected -- applied to :VCalls
28
-" 	Version 1.4. : 
29
-" 		(*) address obfuscated for spammers
30
-" 		(*) support the local option 
31
-" 		    b:want_buffermenu_or_global_disable if we don't want
32
-" 		    buffermenu to be used systematically.
33
-" 		    0 -> buffer menu not used
34
-" 		    1 -> buffer menu used
35
-" 		    2 -> the VimL developper will use a global disable.
36
-" 		    cf.:   tex-maps.vim:: s:SimpleMenu()
37
-" 		       and texmenus.vim
38
-" 	Version 1.3. :
39
-"		(*) add continuation lines support ; cf 'cpoptions'
40
-" 	Version 1.2. :
41
-" 		(*) Code folded.
42
-" 		(*) Take advantage of buffermenu.vim if present for local
43
-" 		    menus.
44
-" 		(*) If non gui is available, the menus won't be defined
45
-" 	Version 1.1. :
46
-"               (*) Bug corrected : 
47
-"                   vnore(map\|menu) does not imply v+n(map\|menu) any more
48
-" }}}
49
-"
50
-" Inspired By:	A function from Benji Fisher
51
-"
52
-" TODO:		(*) no menu if no gui.
53
-"
54
-"===========================================================================
55
-
56
-if exists("g:loaded_menu_map") | finish | endif
57
-let g:loaded_menu_map = 1  
58
-
59
-"" line continuation used here ??
60
-let s:cpo_save = &cpo
61
-set cpo&vim
62
-
63
-"=========================================================================
64
-" Commands {{{
65
-command! -nargs=+ -bang      MAP      map<bang> <args>
66
-command! -nargs=+           IMAP     imap       <args>
67
-command! -nargs=+           NMAP     nmap       <args>
68
-command! -nargs=+           CMAP     cmap       <args>
69
-command! -nargs=+           VMAP     vmap       <args>
70
-command! -nargs=+           AMAP
71
-      \       call lh#menu#map_all('amap', <f-args>)
72
-
73
-command! -nargs=+ -bang  NOREMAP  noremap<bang> <args>
74
-command! -nargs=+       INOREMAP inoremap       <args>
75
-command! -nargs=+       NNOREMAP nnoremap       <args>
76
-command! -nargs=+       CNOREMAP cnoremap       <args>
77
-command! -nargs=+       VNOREMAP vnoremap       <args>
78
-command! -nargs=+       ANOREMAP
79
-      \       call lh#menu#map_all('anoremap', <f-args>)
80
-" }}}
81
-
82
-" End !
83
-let &cpo = s:cpo_save
84
-finish
85
-
86
-"=========================================================================
87
-" vim600: set fdm=marker:

+ 0
- 60
dotfiles/vim/bundle/lh-vim-lib/mkVba/mk-lh-vim-lib.vim View File

@@ -1,60 +0,0 @@
1
-"=============================================================================
2
-" $Id: mk-lh-vim-lib.vim 606 2012-05-31 17:09:46Z luc.hermitte@gmail.com $
3
-" File:		mkVba/mk-lh-lib.vim
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.1.1
9
-let s:version = '3.1.1'
10
-" Created:	06th Nov 2007
11
-" Last Update:	$Date: 2012-05-31 19:09:46 +0200 (jeu 31 mai 2012) $
12
-"------------------------------------------------------------------------
13
-cd <sfile>:p:h
14
-try 
15
-  let save_rtp = &rtp
16
-  let &rtp = expand('<sfile>:p:h:h').','.&rtp
17
-  exe '24,$MkVimball! lh-vim-lib-'.s:version
18
-  set modifiable
19
-  set buftype=
20
-finally
21
-  let &rtp = save_rtp
22
-endtry
23
-finish
24
-autoload/lh/askvim.vim
25
-autoload/lh/buffer.vim
26
-autoload/lh/buffer/dialog.vim
27
-autoload/lh/command.vim
28
-autoload/lh/common.vim
29
-autoload/lh/encoding.vim
30
-autoload/lh/env.vim
31
-autoload/lh/event.vim
32
-autoload/lh/float.vim
33
-autoload/lh/function.vim
34
-autoload/lh/graph/tsort.vim
35
-autoload/lh/icomplete.vim
36
-autoload/lh/list.vim
37
-autoload/lh/menu.vim
38
-autoload/lh/option.vim
39
-autoload/lh/path.vim
40
-autoload/lh/position.vim
41
-autoload/lh/syntax.vim
42
-autoload/lh/visual.vim
43
-doc/lh-vim-lib.txt
44
-lh-vim-lib-addon-info.txt
45
-lh-vim-lib.README
46
-macros/menu-map.vim
47
-mkVba/mk-lh-vim-lib.vim
48
-plugin/let.vim
49
-plugin/lhvl.vim
50
-plugin/ui-functions.vim
51
-plugin/words_tools.vim
52
-tests/lh/function.vim
53
-tests/lh/list.vim
54
-tests/lh/path.vim
55
-tests/lh/test-Fargs2String.vim
56
-tests/lh/test-askmenu.vim
57
-tests/lh/test-command.vim
58
-tests/lh/test-menu-map.vim
59
-tests/lh/test-toggle-menu.vim
60
-tests/lh/topological-sort.vim

+ 0
- 57
dotfiles/vim/bundle/lh-vim-lib/plugin/let.vim View File

@@ -1,57 +0,0 @@
1
-"=============================================================================
2
-" $Id: let.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:         plugin/let.vim                                    {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      31st May 2010
10
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:
13
-"       Defines a command :LetIfUndef that sets a variable if undefined
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:
17
-"       Drop this file into {rtp}/plugin
18
-"       Requires Vim7+
19
-" History:      
20
-" 	v2.2.1: first version of this command into lh-vim-lib
21
-" 	v3.0.0: GPLv3
22
-" TODO: 
23
-" }}}1
24
-"=============================================================================
25
-
26
-" Avoid global reinclusion {{{1
27
-let s:k_version = 300
28
-if &cp || (exists("g:loaded_let")
29
-      \ && (g:loaded_let >= s:k_version)
30
-      \ && !exists('g:force_reload_let'))
31
-  finish
32
-endif
33
-let g:loaded_let = s:k_version
34
-let s:cpo_save=&cpo
35
-set cpo&vim
36
-" Avoid global reinclusion }}}1
37
-"------------------------------------------------------------------------
38
-" Commands and Mappings {{{1
39
-command! -nargs=+ LetIfUndef call s:LetIfUndef(<f-args>)
40
-" Commands and Mappings }}}1
41
-"------------------------------------------------------------------------
42
-" Functions {{{1
43
-" Note: most functions are best placed into
44
-" autoload/«your-initials»/«let».vim
45
-" Keep here only the functions are are required when the plugin is loaded,
46
-" like functions that help building a vim-menu for this plugin.
47
-function! s:LetIfUndef(var, value)
48
-  if !exists(a:var)
49
-    let {a:var} = eval(a:value)
50
-  endif
51
-endfunction
52
-
53
-" Functions }}}1
54
-"------------------------------------------------------------------------
55
-let &cpo=s:cpo_save
56
-"=============================================================================
57
-" vim600: set fdm=marker:

+ 0
- 48
dotfiles/vim/bundle/lh-vim-lib/plugin/lhvl.vim View File

@@ -1,48 +0,0 @@
1
-"=============================================================================
2
-" $Id: lhvl.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		plugin/lhvl.vim                                   {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	27th Apr 2010
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-"       Non-function resources from lh-vim-lib
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	
17
-"       Drop the file into {rtp}/plugin
18
-" History:	
19
-"       v2.2.1  first version
20
-"       v3.0.0  GPLv3
21
-" TODO:		«missing features»
22
-" }}}1
23
-"=============================================================================
24
-
25
-" Avoid global reinclusion {{{1
26
-let s:k_version = 300
27
-if &cp || (exists("g:loaded_lhvl")
28
-      \ && (g:loaded_lhvl >= s:k_version)
29
-      \ && !exists('g:force_reload_lhvl'))
30
-  finish
31
-endif
32
-let g:loaded_lhvl = s:k_version
33
-let s:cpo_save=&cpo
34
-set cpo&vim
35
-" Avoid global reinclusion }}}1
36
-"------------------------------------------------------------------------
37
-" Commands and Mappings {{{1
38
-" Moved from lh-cpp
39
-command! PopSearch :call histdel('search', -1)| let @/=histget('search',-1)
40
-
41
-" Commands and Mappings }}}1
42
-"------------------------------------------------------------------------
43
-" Functions {{{1
44
-" Functions }}}1
45
-"------------------------------------------------------------------------
46
-let &cpo=s:cpo_save
47
-"=============================================================================
48
-" vim600: set fdm=marker:

+ 0
- 490
dotfiles/vim/bundle/lh-vim-lib/plugin/ui-functions.vim View File

@@ -1,490 +0,0 @@
1
-"=============================================================================
2
-" File:         plugin/ui-functions.vim                                  {{{1
3
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
4
-"               <URL:http://code.google.com/p/lh-vim/>
5
-" License:      GPLv3 with exceptions
6
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
7
-" Version:      3.0.0
8
-" Created:      18th nov 2002
9
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (19th Mar 2012)
10
-"------------------------------------------------------------------------
11
-" Description:  Functions for the interaction with a User Interface.
12
-"               The UI can be graphical or textual.
13
-"               At first, this was designed to ease the syntax of
14
-"               mu-template's templates.
15
-"
16
-" Option:       {{{2
17
-"       {[bg]:ui_type} 
18
-"               = "g\%[ui]", 
19
-"               = "t\%[ext]" ; the call must not be |:silent|
20
-"               = "f\%[te]"
21
-" }}}2
22
-"------------------------------------------------------------------------
23
-" Installation: Drop this into one of your {rtp}/plugin/ directories.
24
-" History:      {{{2
25
-"    v0.01 Initial Version
26
-"    v0.02
27
-"       (*) Code "factorisations" 
28
-"       (*) Help on <F1> enhanced.
29
-"       (*) Small changes regarding the parameter accepted
30
-"       (*) Function SWITCH
31
-"    v0.03
32
-"       (*) Small bug fix with INPUT()
33
-"    v0.04
34
-"       (*) New function: WHICH()
35
-"    v0.05
36
-"       (*) In vim7e, inputdialog() returns a trailing '\n'. INPUT() strips the
37
-"           NL character.
38
-"    v0.06
39
-"       (*) :s/echoerr/throw/ => vim7 only
40
-"    v2.2.0
41
-"       (*) menu to switch the ui_type
42
-"    v2.2.6
43
-"       (*) CONFIRM() and WHICH() accept lists of {choices}
44
-"    v3.0.0  GPLv3
45
-" 
46
-" TODO:         {{{2
47
-"       (*) Save the hl-User1..9 before using them
48
-"       (*) Possibility other than &statusline:
49
-"           echohl User1 |echon "bla"|echohl User2|echon "bli"|echohl None
50
-"       (*) Wraps too long choices-line (length > term-width)
51
-"       (*) Add to the documentation: "don't use CTRL-C to abort !!"
52
-"       (*) Look if I need to support 'wildmode'
53
-"       (*) 3rd mode: return string for FTE
54
-"       (*) 4th mode: interaction in a scratch buffer
55
-"
56
-" }}}1
57
-"=============================================================================
58
-" Avoid reinclusion {{{1
59
-" 
60
-if exists("g:loaded_ui_functions") && !exists('g:force_reload_ui_functions')
61
-  finish 
62
-endif
63
-let g:loaded_ui_functions = 1
64
-let s:cpo_save=&cpo
65
-set cpo&vim
66
-" }}}1
67
-"------------------------------------------------------------------------
68
-" External functions {{{1
69
-" Function: IF(var, then, else) {{{2
70
-function! IF(var,then, else)
71
-  let o = s:Opt_type() " {{{3
72
-  if     o =~ 'g\%[ui]\|t\%[ext]' " {{{4
73
-    return a:var ? a:then : a:else
74
-  elseif o =~ 'f\%[te]'           " {{{4
75
-    return s:if_fte(a:var, a:then, a:else)
76
-  else                    " {{{4
77
-    throw "UI-Fns::IF(): Unkonwn user-interface style (".o.")"
78
-  endif
79
-  " }}}3
80
-endfunction
81
-
82
-" Function: SWITCH(var, case, action [, case, action] [default_action]) {{{2
83
-function! SWITCH(var, ...)
84
-  let o = s:Opt_type() " {{{3
85
-  if     o =~ 'g\%[ui]\|t\%[ext]' " {{{4
86
-    let explicit_def = ((a:0 % 2) == 1)
87
-    let default      = explicit_def ? a:{a:0} : ''
88
-    let i = a:0 - 1 - explicit_def
89
-    while i > 0
90
-      if a:var == a:{i}
91
-        return a:{i+1}
92
-      endif
93
-      let i -=  2
94
-    endwhile
95
-    return default
96
-  elseif o =~ 'f\%[te]'           " {{{4
97
-    return s:if_fte(a:var, a:then, a:else)
98
-  else                    " {{{4
99
-    throw "UI-Fns::SWITCH(): Unkonwn user-interface style (".o.")"
100
-  endif
101
-  " }}}3
102
-endfunction
103
-
104
-" Function: CONFIRM(text [, choices [, default [, type]]]) {{{2
105
-function! CONFIRM(text, ...)
106
-  " 1- Check parameters {{{3
107
-  if a:0 > 4 " {{{4
108
-    throw "UI-Fns::CONFIRM(): too many parameters"
109
-    return 0
110
-  endif
111
-  " build the parameters string {{{4
112
-  let i = 1
113
-  while i <= a:0
114
-    if i == 1
115
-      if type(a:1) == type([])
116
-        let params = string(join(a:1, "\n"))
117
-      else
118
-        let params = 'a:{1}'
119
-      endif
120
-    else      | let params .= ',a:{'.i.'}'
121
-    endif
122
-    let i +=  1
123
-  endwhile
124
-  " 2- Choose the correct way to execute according to the option {{{3
125
-  let o = s:Opt_type()
126
-  if     o =~ 'g\%[ui]'  " {{{4
127
-    exe 'return confirm(a:text,'.params.')'
128
-  elseif o =~ 't\%[ext]' " {{{4
129
-    if !has('gui_running') && has('dialog_con')
130
-      exe 'return confirm(a:text,'.params.')'
131
-    else
132
-      exe 'return s:confirm_text("none", a:text,'.params.')'
133
-    endif
134
-  elseif o =~ 'f\%[te]'  " {{{4
135
-      exe 'return s:confirm_fte(a:text,'.params.')'
136
-  else               " {{{4
137
-    throw "UI-Fns::CONFIRM(): Unkonwn user-interface style (".o.")"
138
-  endif
139
-  " }}}3
140
-endfunction
141
-
142
-" Function: INPUT(prompt [, default ]) {{{2
143
-function! INPUT(prompt, ...)
144
-  " 1- Check parameters {{{3
145
-  if a:0 > 4 " {{{4
146
-    throw "UI-Fns::INPUT(): too many parameters"
147
-    return 0
148
-  endif
149
-  " build the parameters string {{{4
150
-  let i = 1 | let params = ''
151
-  while i <= a:0
152
-    if i == 1 | let params = 'a:{1}'
153
-    else      | let params .= ',a:{'.i.'}'
154
-    endif
155
-    let i +=  1
156
-  endwhile
157
-  " 2- Choose the correct way to execute according to the option {{{3
158
-  let o = s:Opt_type()
159
-  if     o =~ 'g\%[ui]'  " {{{4
160
-    exe 'return matchstr(inputdialog(a:prompt,'.params.'), ".\\{-}\\ze\\n\\=$")'
161
-  elseif o =~ 't\%[ext]' " {{{4
162
-    exe 'return input(a:prompt,'.params.')'
163
-  elseif o =~ 'f\%[te]'  " {{{4
164
-      exe 'return s:input_fte(a:prompt,'.params.')'
165
-  else               " {{{4
166
-    throw "UI-Fns::INPUT(): Unkonwn user-interface style (".o.")"
167
-  endif
168
-  " }}}3
169
-endfunction
170
-
171
-" Function: COMBO(prompt, choice [, ... ]) {{{2
172
-function! COMBO(prompt, ...)
173
-  " 1- Check parameters {{{3
174
-  if a:0 > 4 " {{{4
175
-    throw "UI-Fns::COMBO(): too many parameters"
176
-    return 0
177
-  endif
178
-  " build the parameters string {{{4
179
-  let i = 1
180
-  while i <= a:0
181
-    if i == 1 | let params = 'a:{1}'
182
-    else      | let params .=  ',a:{'.i.'}'
183
-    endif
184
-    let i +=  1
185
-  endwhile
186
-  " 2- Choose the correct way to execute according to the option {{{3
187
-  let o = s:Opt_type()
188
-  if     o =~ 'g\%[ui]'  " {{{4
189
-    exe 'return confirm(a:prompt,'.params.')'
190
-  elseif o =~ 't\%[ext]' " {{{4
191
-    exe 'return s:confirm_text("combo", a:prompt,'.params.')'
192
-  elseif o =~ 'f\%[te]'  " {{{4
193
-    exe 'return s:combo_fte(a:prompt,'.params.')'
194
-  else               " {{{4
195
-    throw "UI-Fns::COMBO(): Unkonwn user-interface style (".o.")"
196
-  endif
197
-  " }}}3
198
-endfunction
199
-
200
-" Function: WHICH(function, prompt, choice [, ... ]) {{{2
201
-function! WHICH(fn, prompt, ...)
202
-  " 1- Check parameters {{{3
203
-  " build the parameters string {{{4
204
-  let i = 1
205
-  while i <= a:0
206
-    if i == 1 
207
-      if type(a:1) == type([])
208
-        let choices = a:1
209
-      else
210
-        let choices = split(a:1, "\n")
211
-      endif
212
-      let params = 'a:{1}'
213
-    else      | let params .=  ',a:{'.i.'}'
214
-    endif
215
-    let i +=  1
216
-  endwhile
217
-  " 2- Execute the function {{{3
218
-  exe 'let which = '.a:fn.'(a:prompt,'.params.')'
219
-  if     0 >= which | return ''
220
-  else
221
-    return substitute(choices[which-1], '&', '', '')
222
-  endif
223
-  " }}}3
224
-endfunction
225
-
226
-" Function: CHECK(prompt, choice [, ... ]) {{{2
227
-function! CHECK(prompt, ...)
228
-  " 1- Check parameters {{{3
229
-  if a:0 > 4 " {{{4
230
-    throw "UI-Fns::CHECK(): too many parameters"
231
-    return 0
232
-  endif
233
-  " build the parameters string {{{4
234
-  let i = 1
235
-  while i <= a:0
236
-    if i == 1 | let params = 'a:{1}'
237
-    else      | let params .=  ',a:{'.i.'}'
238
-    endif
239
-    let i +=  1
240
-  endwhile
241
-  " 2- Choose the correct way to execute according to the option {{{3
242
-  let o = s:Opt_type()
243
-  if     o =~ 'g\%[ui]'  " {{{4
244
-    exe 'return s:confirm_text("check", a:prompt,'.params.')'
245
-  elseif o =~ 't\%[ext]' " {{{4
246
-    exe 'return s:confirm_text("check", a:prompt,'.params.')'
247
-  elseif o =~ 'f\%[te]'  " {{{4
248
-      exe 'return s:check_fte(a:prompt,'.params.')'
249
-  else               " {{{4
250
-    throw "UI-Fns::CHECK(): Unkonwn user-interface style (".o.")"
251
-  endif
252
-  " }}}3
253
-endfunction
254
-
255
-" }}}1
256
-"------------------------------------------------------------------------
257
-" Options setting {{{1
258
-let s:OptionData = {
259
-      \ "variable": "ui_type",
260
-      \ "idx_crt_value": 1,
261
-      \ "values": ['gui', 'text', 'fte'],
262
-      \ "menu": { "priority": '500.2700', "name": '&Plugin.&LH.&UI type'}
263
-      \}
264
-
265
-call lh#menu#def_toggle_item(s:OptionData)
266
-
267
-" }}}1
268
-"------------------------------------------------------------------------
269
-" Internal functions {{{1
270
-function! s:Option(name, default) " {{{2
271
-  if     exists('b:ui_'.a:name) | return b:ui_{a:name}
272
-  elseif exists('g:ui_'.a:name) | return g:ui_{a:name}
273
-  else                          | return a:default
274
-  endif
275
-endfunction
276
-
277
-
278
-function! s:Opt_type() " {{{2
279
-  return s:Option('type', 'gui')
280
-endfunction
281
-
282
-"
283
-" Function: s:status_line(current, hl [, choices] ) {{{2
284
-"     a:current: current item
285
-"     a:hl     : Generic, Warning, Error
286
-function! s:status_line(current, hl, ...)
287
-  " Highlightning {{{3
288
-  if     a:hl == "Generic"  | let hl = '%1*'
289
-  elseif a:hl == "Warning"  | let hl = '%2*'
290
-  elseif a:hl == "Error"    | let hl = '%3*'
291
-  elseif a:hl == "Info"     | let hl = '%4*'
292
-  elseif a:hl == "Question" | let hl = '%5*'
293
-  else                      | let hl = '%1*'
294
-  endif
295
-  
296
-  " Build the string {{{3
297
-  let sl_choices = '' | let i = 1
298
-  while i <= a:0
299
-    if i == a:current
300
-      let sl_choices .=  ' '. hl . 
301
-            \ substitute(a:{i}, '&\(.\)', '%6*\1'.hl, '') . '%* '
302
-    else
303
-      let sl_choices .=  ' ' . 
304
-            \ substitute(a:{i}, '&\(.\)', '%6*\1%*', '') . ' '
305
-    endif
306
-    let i +=  1
307
-  endwhile
308
-  " }}}3
309
-  return sl_choices
310
-endfunction
311
-
312
-
313
-" Function: s:confirm_text(box, text [, choices [, default [, type]]]) {{{2
314
-function! s:confirm_text(box, text, ...)
315
-  let help = "/<esc>/<s-tab>/<tab>/<left>/<right>/<cr>/<F1>"
316
-  " 1- Retrieve the parameters       {{{3
317
-  let choices = ((a:0>=1) ? a:1 : '&Ok')
318
-  let default = ((a:0>=2) ? a:2 : (('check' == a:box) ? 0 : 1))
319
-  let type    = ((a:0>=3) ? a:3 : 'Generic')
320
-  if     'none'  == a:box | let prefix = ''
321
-  elseif 'combo' == a:box | let prefix = '( )_'
322
-  elseif 'check' == a:box | let prefix = '[ ]_'
323
-    let help = '/ '.help
324
-  else                    | let prefix = ''
325
-  endif
326
-
327
-
328
-  " 2- Retrieve the proposed choices {{{3
329
-  " Prepare the hot keys
330
-  let i = 0
331
-  while i != 26
332
-    let hotkey_{nr2char(i+65)} = 0
333
-    let i += 1
334
-  endwhile
335
-  let hotkeys = '' | let help_k = '/'
336
-  " Parse the choices
337
-  let i = 0
338
-  while choices != ""
339
-    let i +=  1
340
-    let item    = matchstr(choices, "^.\\{-}\\ze\\(\n\\|$\\)")
341
-    let choices = matchstr(choices, "\n\\zs.*$")
342
-    " exe 'anoremenu ]'.a:text.'.'.item.' :let s:choice ='.i.'<cr>'
343
-    if ('check' == a:box) && (strlen(default)>=i) && (1 == default[i-1])
344
-      " let choice_{i} = '[X]' . substitute(item, '&', '', '')
345
-      let choice_{i} = '[X]_' . item
346
-    else
347
-      " let choice_{i} = prefix . substitute(item, '&', '', '')
348
-      let choice_{i} = prefix . item
349
-    endif
350
-    if i == 1
351
-      let list_choices = 'choice_{1}'
352
-    else
353
-      let list_choices .=  ',choice_{'.i.'}'
354
-    endif
355
-    " Update the hotkey.
356
-    let key = toupper(matchstr(choice_{i}, '&\zs.\ze'))
357
-    let hotkey_{key} = i
358
-    let hotkeys .=  tolower(key) . toupper(key)
359
-    let help_k .=  tolower(key)
360
-  endwhile
361
-  let nb_choices = i
362
-  if default > nb_choices | let default = nb_choices | endif
363
-
364
-  " 3- Run an interactive text menu  {{{3
365
-  " Note: emenu can not be used through ":exe" {{{4
366
-  " let wcm = &wcm
367
-  " set wcm=<tab>
368
-  " exe ':emenu ]'.a:text.'.'."<tab>"
369
-  " let &wcm = wcm
370
-  " 3.1- Preparations for the statusline {{{4
371
-  " save the statusline
372
-  let sl = &l:statusline
373
-  " Color schemes for selected item {{{5
374
-  :hi User1 term=inverse,bold cterm=inverse,bold ctermfg=Yellow 
375
-        \ guifg=Black guibg=Yellow
376
-  :hi User2 term=inverse,bold cterm=inverse,bold ctermfg=LightRed
377
-        \ guifg=Black guibg=LightRed
378
-  :hi User3 term=inverse,bold cterm=inverse,bold ctermfg=Red 
379
-        \ guifg=Black guibg=Red
380
-  :hi User4 term=inverse,bold cterm=inverse,bold ctermfg=Cyan
381
-        \ guifg=Black guibg=Cyan
382
-  :hi User5 term=inverse,bold cterm=inverse,bold ctermfg=LightYellow
383
-        \ guifg=Black guibg=LightYellow
384
-  :hi User6 term=inverse,bold cterm=inverse,bold ctermfg=LightGray
385
-        \ guifg=DarkRed guibg=LightGray
386
-  " }}}5
387
-
388
-  " 3.2- Interactive loop                {{{4
389
-  let help =  "\r-- Keys available (".help_k.help.")"
390
-  " item selected at the start
391
-  let i = ('check' != a:box) ? default : 1
392
-  let direction = 0 | let toggle = 0
393
-  while 1
394
-    if 'combo' == a:box
395
-      let choice_{i} = substitute(choice_{i}, '^( )', '(*)', '')
396
-    endif
397
-    " Colored statusline
398
-    " Note: unfortunately the 'statusline' is a global option, {{{
399
-    " not a local one. I the hope that may change, as it does not provokes any
400
-    " error, I use '&l:statusline'. }}}
401
-    exe 'let &l:statusline=s:status_line(i, type,'. list_choices .')'
402
-    if has(':redrawstatus')
403
-      redrawstatus!
404
-    else
405
-      redraw!
406
-    endif
407
-    " Echo the current selection
408
-    echo "\r". a:text.' '.substitute(choice_{i}, '&', '', '')
409
-    " Wait the user to hit a key
410
-    let key=getchar()
411
-    let complType=nr2char(key)
412
-    " If the key hit matched awaited keys ...
413
-    if -1 != stridx(" \<tab>\<esc>\<enter>".hotkeys,complType) ||
414
-          \ (key =~ "\<F1>\\|\<right>\\|\<left>\\|\<s-tab>")
415
-      if key           == "\<F1>"                       " Help      {{{5
416
-        redraw!
417
-        echohl StatusLineNC
418
-        echo help
419
-        echohl None
420
-        let key=getchar()
421
-        let complType=nr2char(key)
422
-      endif
423
-      " TODO: support CTRL-D
424
-      if     complType == "\<enter>"                    " Validate  {{{5
425
-        break
426
-      elseif complType == " "                           " check box {{{5
427
-        let toggle = 1
428
-      elseif complType == "\<esc>"                      " Abort     {{{5
429
-        let i = -1 | break
430
-      elseif complType == "\<tab>" || key == "\<right>" " Next      {{{5
431
-        let direction = 1
432
-      elseif key =~ "\<left>\\|\<s-tab>"                " Previous  {{{5
433
-        let direction = -1
434
-      elseif -1 != stridx(hotkeys, complType )          " Hotkeys     {{{5
435
-        if '' == complType  | continue | endif
436
-        let direction = hotkey_{toupper(complType)} - i
437
-        let toggle = 1
438
-      " else
439
-      endif
440
-      " }}}5
441
-    endif
442
-    if direction != 0 " {{{5
443
-      if 'combo' == a:box
444
-        let choice_{i} = substitute(choice_{i}, '^(\*)', '( )', '')
445
-      endif
446
-      let i +=  direction
447
-      if     i > nb_choices | let i = 1 
448
-      elseif i == 0         | let i = nb_choices
449
-      endif
450
-      let direction = 0
451
-    endif
452
-    if toggle == 1    " {{{5
453
-      if 'check' == a:box
454
-        let choice_{i} = ((choice_{i}[1] == ' ')? '[X]' : '[ ]') 
455
-              \ . strpart(choice_{i}, 3)
456
-      endif
457
-      let toggle = 0
458
-    endif
459
-  endwhile " }}}4
460
-  " 4- Terminate                     {{{3
461
-  " Clear screen
462
-  redraw!
463
-
464
-  " Restore statusline
465
-  let &l:statusline=sl
466
-  " Return
467
-  if (i == -1) || ('check' != a:box)
468
-    return i
469
-  else
470
-    let r = '' | let i = 1
471
-    while i <= nb_choices
472
-      let r .=  ((choice_{i}[1] == 'X') ? '1' : '0')
473
-      let i +=  1
474
-    endwhile
475
-    return r
476
-  endif
477
-endfunction
478
-" }}}1
479
-"------------------------------------------------------------------------
480
-" Functions that insert fte statements {{{1
481
-" Function: s:if_fte(var, then, else) {{{2
482
-" Function: s:confirm_fte(text, [, choices [, default [, type]]]) {{{2
483
-" Function: s:input_fte(prompt [, default]) {{{2
484
-" Function: s:combo_fte(prompt, choice [, ...]) {{{2
485
-" Function: s:check_fte(prompt, choice [, ...]) {{{2
486
-" }}}1
487
-"------------------------------------------------------------------------
488
-let &cpo=s:cpo_save
489
-"=============================================================================
490
-" vim600: set fdm=marker:

+ 0
- 105
dotfiles/vim/bundle/lh-vim-lib/plugin/words_tools.vim View File

@@ -1,105 +0,0 @@
1
-" File:		plugin/words_tools.vim
2
-" Author:	Luc Hermitte <hermitte {at} free {dot} fr>
3
-" 		<URL:http://code.google.com/p/lh-vim/>
4
-" License:      GPLv3 with exceptions
5
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
6
-" Version:      3.0.0
7
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $ (19th Mar 2012)
8
-" Purpose:	Define functions better than expand("<cword>")
9
-"
10
-" Note:		They are expected to be used in insert mode (thanks to <c-r>
11
-"               or <c-o>)
12
-"
13
-"===========================================================================
14
-
15
-" Return the current keyword, uses spaces to delimitate {{{1
16
-function! GetNearestKeyword()
17
-  let c = col ('.')-1
18
-  let ll = getline('.')
19
-  let ll1 = strpart(ll,0,c)
20
-  let ll1 = matchstr(ll1,'\k*$')
21
-  let ll2 = strpart(ll,c,strlen(ll)-c+1)
22
-  let ll2 = matchstr(ll2,'^\k*')
23
-  " let ll2 = strpart(ll2,0,match(ll2,'$\|\s'))
24
-  return ll1.ll2
25
-endfunction
26
-
27
-" Return the current word, uses spaces to delimitate {{{1
28
-function! GetNearestWord()
29
-  let c = col ('.')-1
30
-  let l = line('.')
31
-  let ll = getline(l)
32
-  let ll1 = strpart(ll,0,c)
33
-  let ll1 = matchstr(ll1,'\S*$')
34
-  let ll2 = strpart(ll,c,strlen(ll)-c+1)
35
-  let ll2 = strpart(ll2,0,match(ll2,'$\|\s'))
36
-  ""echo ll1.ll2
37
-  return ll1.ll2
38
-endfunction
39
-
40
-" Return the word before the cursor, uses spaces to delimitate {{{1
41
-" Rem : <cword> is the word under or after the cursor
42
-function! GetCurrentWord()
43
-  let c = col ('.')-1
44
-  let l = line('.')
45
-  let ll = getline(l)
46
-  let ll1 = strpart(ll,0,c)
47
-  let ll1 = matchstr(ll1,'\S*$')
48
-  if strlen(ll1) == 0
49
-    return ll1
50
-  else
51
-    let ll2 = strpart(ll,c,strlen(ll)-c+1)
52
-    let ll2 = strpart(ll2,0,match(ll2,'$\|\s'))
53
-    return ll1.ll2
54
-  endif
55
-endfunction
56
-
57
-" Return the keyword before the cursor, uses \k to delimitate {{{1
58
-" Rem : <cword> is the word under or after the cursor
59
-function! GetCurrentKeyword()
60
-  let c = col ('.')-1
61
-  let l = line('.')
62
-  let ll = getline(l)
63
-  let ll1 = strpart(ll,0,c)
64
-  let ll1 = matchstr(ll1,'\k*$')
65
-  if strlen(ll1) == 0
66
-    return ll1
67
-  else
68
-    let ll2 = strpart(ll,c,strlen(ll)-c+1)
69
-    let ll2 = matchstr(ll2,'^\k*')
70
-    " let ll2 = strpart(ll2,0,match(ll2,'$\|\s'))
71
-    return ll1.ll2
72
-  endif
73
-endfunction
74
-
75
-" Extract the word before the cursor,  {{{1
76
-" use keyword definitions, skip latter spaces (see "bla word_accepted ")
77
-function! GetPreviousWord()
78
-  let lig = getline(line('.'))
79
-  let lig = strpart(lig,0,col('.')-1)
80
-  return matchstr(lig, '\<\k*\>\s*$')
81
-endfunction
82
-
83
-" GetLikeCTRL_W() retrieves the characters that i_CTRL-W deletes. {{{1
84
-" Initial need by Hari Krishna Dara <hari_vim@yahoo.com>
85
-" Last ver:
86
-" Pb: "if strlen(w) ==  " --> ") ==  " instead of just "==  ".
87
-" There still exists a bug regarding the last char of a line. VIM bug ?
88
-function! GetLikeCTRL_W()
89
-  let lig = getline(line('.'))
90
-  let lig = strpart(lig,0,col('.')-1)
91
-  " treat ending spaces apart.
92
-  let s = matchstr(lig, '\s*$')
93
-  let lig = strpart(lig, 0, strlen(lig)-strlen(s))
94
-  " First case : last characters belong to a "word"
95
-  let w = matchstr(lig, '\<\k\+\>$')
96
-  if strlen(w) == 0
97
-    " otherwise, they belong to a "non word" (without any space)
98
-    let w = substitute(lig, '.*\(\k\|\s\)', '', 'g')
99
-  endif
100
-  return w . s
101
-endfunction
102
-
103
-" }}}1
104
-"========================================================================
105
-" vim60: set fdm=marker:

+ 0
- 288
dotfiles/vim/bundle/lh-vim-lib/tests/lh/function.vim View File

@@ -1,288 +0,0 @@
1
-"=============================================================================
2
-" $Id: function.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		tests/lh/function.vim                                   {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	03rd Nov 2008
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Tests for autoload/lh/function.vim
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	«install details»
17
-" History:	«history»
18
-" TODO:		«missing features»
19
-" }}}1
20
-"=============================================================================
21
-
22
-UTSuite [lh-vim-lib] Testing lh#function plugin
23
-
24
-runtime autoload/lh/function.vim
25
-
26
-let s:cpo_save=&cpo
27
-set cpo&vim
28
-"------------------------------------------------------------------------
29
-function! Test(...)
30
-  let nb = len(a:000)
31
-  " echo "test(".nb.':' .join(a:000, ' -- ')')'
32
-  let i =0
33
-  while i!= len(a:000)
34
-    echo "Test: type(".i.")=".type(a:000[i]).' --> '. string(a:000[i])
35
-    let i += 1
36
-  endwhile
37
-endfunction
38
-
39
-function! Print(...)
40
-  let res = lh#list#accumulate([1,2,'foo'], 'string', 'join(v:1_, " ## ")')
41
-  return res
42
-endfunction
43
-
44
-function! Id(...)
45
-  return copy(a:000)
46
-endfunction
47
-
48
-function! s:TestId()
49
-  let r = Id(1, 'string', [0], [[1]], {'ffo':42}, function('exists'), 1.2)
50
-  Assert! len(r) == 7
51
-  Assert! should#be#number (r[0])
52
-  Assert! should#be#string (r[1])
53
-  Assert! should#be#list   (r[2])
54
-  Assert! should#be#list   (r[3])
55
-  Assert! should#be#dict   (r[4])
56
-  Assert! should#be#funcref(r[5])
57
-  Assert! should#be#float  (r[6])
58
-  Assert r[0] == 1
59
-  Assert r[1] == 'string'
60
-  Assert r[2] == [0]
61
-  Assert r[3] == [[1]]
62
-  Assert r[4].ffo == 42
63
-  Assert r[5] == function('exists')
64
-  Assert r[6] == 1.2
65
-endfunction
66
-
67
-function! s:Test_bind()
68
-  " lh#function#bind + lh#function#execute
69
-  let rev4 = lh#function#bind(function('Id'), 'v:4_', 42, 'v:3_', 'v:2_', 'v:1_')
70
-  let r = lh#function#execute(rev4, 1,'two','three', [4,5])
71
-  Assert! len(r) == 5
72
-  Assert! should#be#list   (r[0])
73
-  Assert! should#be#number (r[1])
74
-  Assert! should#be#string (r[2])
75
-  Assert! should#be#string (r[3])
76
-  Assert! should#be#number (r[4])
77
-
78
-  Assert r[0] == [4,5]
79
-  Assert r[1] == 42
80
-  Assert r[2] == 'three'
81
-  Assert r[3] == 'two'
82
-  Assert r[4] == 1
83
-endfunction
84
-
85
-function! s:Test_bind_compound_vars()
86
-  " lh#function#bind + lh#function#execute
87
-  let rev4 = lh#function#bind(function('Id'), 'v:4_', 'v:1_ . v:2_', 'v:3_', 'v:2_', 'v:1_')
88
-  let r = lh#function#execute(rev4, 1,'two','three', [4,5])
89
-  Assert! len(r) == 5
90
-  Assert! should#be#list   (r[0])
91
-  Assert! should#be#string (r[1])
92
-  Assert! should#be#string (r[2])
93
-  Assert! should#be#string (r[3])
94
-  Assert! should#be#number (r[4])
95
-
96
-  Assert r[0] == [4,5]
97
-  Assert r[1] == '1two'
98
-  Assert r[2] == 'three'
99
-  Assert r[3] == 'two'
100
-  Assert r[4] == 1
101
-endfunction
102
-
103
-
104
-function! s:Test_execute_func_string_name()
105
-  " function name as string
106
-  let r = lh#function#execute('Id', 1,'two',3)
107
-  Assert! len(r) == 3
108
-  Assert! should#be#number (r[0])
109
-  Assert! should#be#string (r[1])
110
-  Assert! should#be#number (r[2])
111
-  Assert r[0] == 1
112
-  Assert r[1] == 'two'
113
-  Assert r[2] == 3
114
-endfunction
115
-
116
-function! s:Test_execute_string_expr()
117
-  " exp as binded-string
118
-  let r = lh#function#execute('Id(12,len(v:2_).v:2_, 42, v:3_, v:1_)', 1,'two',3)
119
-  Assert! len(r) == 5
120
-  Assert! should#be#number (r[0])
121
-  Assert! should#be#string (r[1])
122
-  Assert! should#be#number (r[2])
123
-  Assert! should#be#number (r[3])
124
-  Assert! should#be#number (r[4])
125
-  Assert r[0] == 12
126
-  Assert r[1] == len('two').'two'
127
-  Assert r[2] == 42
128
-  Assert r[3] == 3
129
-  Assert r[4] == 1
130
-endfunction
131
-
132
-function! s:Test_execute_func()
133
-  " calling a function() + bind
134
-  let r = lh#function#execute(function('Id'), 1,'two','v:1_',['a',42])
135
-  Assert! len(r) == 4
136
-  Assert! should#be#number (r[0])
137
-  Assert! should#be#string (r[1])
138
-  Assert! should#be#string (r[2])
139
-  Assert! should#be#list   (r[3])
140
-  Assert r[0] == 1
141
-  Assert r[1] == 'two'
142
-  Assert r[2] == 'v:1_'
143
-  Assert r[3] == ['a', 42]
144
-endfunction
145
-"------------------------------------------------------------------------
146
-function! s:Test_bind_func_string_name_AND_execute()
147
-  " function name as string
148
-  let rev3 = lh#function#bind('Id', 'v:3_', 12, 'v:2_', 'v:1_')
149
-  let r = lh#function#execute(rev3, 1,'two',3)
150
-
151
-  Assert! len(r) == 4
152
-  Assert! should#be#number (r[0])
153
-  Assert! should#be#number (r[1])
154
-  Assert! should#be#string (r[2])
155
-  Assert! should#be#number (r[3])
156
-  Assert r[0] == 3
157
-  Assert r[1] == 12
158
-  Assert r[2] == 'two'
159
-  Assert r[3] == 1
160
-endfunction
161
-
162
-function! s:Test_bind_string_expr_AND_execute()
163
-" expressions as string
164
-  let rev3 = lh#function#bind('Id(12,len(v:2_).v:2_, 42, v:3_, v:1_)')
165
-  let r = lh#function#execute(rev3, 1,'two',3)
166
-  Assert! len(r) == 5
167
-  Assert! should#be#number (r[0])
168
-  Assert! should#be#string (r[1])
169
-  Assert! should#be#number (r[2])
170
-  Assert! should#be#number (r[3])
171
-  Assert! should#be#number (r[4])
172
-  Assert r[0] == 12
173
-  Assert r[1] == len('two').'two'
174
-  Assert r[2] == 42
175
-  Assert r[3] == 3
176
-  Assert r[4] == 1
177
-endfunction
178
-
179
-function! s:Test_double_bind_func_name()
180
-  let f1 = lh#function#bind('Id', 1, 2, 'v:1_', 4, 'v:2_')
181
-  " Comment "f1=".string(f1)
182
-  let r = lh#function#execute(f1, 3, 5)
183
-  Assert! len(r) == 5
184
-  let i = 0
185
-  while i != len(r)
186
-    Assert! should#be#number (r[i])
187
-    Assert r[i] == i+1
188
-    let i += 1
189
-  endwhile
190
-
191
-  " f2
192
-  let f2 = lh#function#bind(f1, 'v:1_', 5)
193
-  " Comment "f2=f1(v:1_, 5)=".string(f2)
194
-  let r = lh#function#execute(f2, 3)
195
-  Assert! len(r) == 5
196
-  let i = 0
197
-  while i != len(r)
198
-    Assert! should#be#number (r[i])
199
-    " echo "?? ".(r[i])."==".(i+1)
200
-    Assert r[i] == i+1
201
-    let i += 1
202
-  endwhile
203
-endfunction
204
-
205
-function! s:Test_double_bind_func()
206
-  let f1 = lh#function#bind(function('Id'), 1, 2, 'v:1_', 4, 'v:2_')
207
-  " Comment "f1=".string(f1)
208
-  let r = lh#function#execute(f1, 3, 5)
209
-  Assert! len(r) == 5
210
-  let i = 0
211
-  while i != len(r)
212
-    Assert! should#be#number (r[i])
213
-    Assert r[i] == i+1
214
-    let i += 1
215
-  endwhile
216
-
217
-  " f2
218
-  let f2 = lh#function#bind(f1, 'v:1_', 5)
219
-  " Comment "f2=f1(v:1_, 5)=".string(f2)
220
-  let r = lh#function#execute(f2, 3)
221
-  Assert! len(r) == 5
222
-  let i = 0
223
-  while i != len(r)
224
-    Assert! should#be#number (r[i])
225
-    Assert r[i] == i+1
226
-    let i += 1
227
-  endwhile
228
-endfunction
229
-
230
-function! s:Test_double_bind_func_cplx()
231
-  let g:bar = "bar"
232
-  let f1 = lh#function#bind(function('Id'), 1, 2, 'v:1_', 4, 'v:2_', 'v:3_', 'v:4_', 'v:5_', 'v:6_', 'v:7_')
233
-  " Comment "2bcpl# f1=".string(f1)
234
-  let f2 = lh#function#bind(f1, 'len(g:bar.v:1_)+v:1_', [1,2], '[v:1_, v:2_]', 4,5,6,7)
235
-
236
-  " let f2 = lh#function#bind(f1, 'v:1_', 5, 'foo', g:bar, 'len(g:bar.v:1_)+v:1_', [1,2], '[v:1_, v:2_]')
237
-  " Comment "2bcpl# f2=f1(v:1_, 5)=".string(f2)
238
-
239
-  let r = lh#function#execute(f2, 42, "foo")
240
-  Assert! 0 && "not ready"
241
-  Comment "2bcpl# ".string(r)
242
-endfunction
243
-
244
-function! s:Test_double_bind_expr()
245
-  let f1 = lh#function#bind('Id(1, 2, v:1_, v:3_, v:2_)')
246
-  Comment "2be# f1=".string(f1)
247
-  let r = lh#function#execute(f1, 3, 5, 4)
248
-  Comment "2be# ".string(r)
249
-  Assert! len(r) == 5
250
-  let i = 0
251
-  while i != len(r)
252
-    Assert! should#be#number (r[i])
253
-    Assert r[i] == i+1
254
-    let i += 1
255
-  endwhile
256
-
257
-  " f2
258
-  let f2 = lh#function#bind(f1, 'v:1_', '"foo"', [])
259
-  Comment "2be# f2=f1(v:1_, 5)=".string(f2)
260
-  let r = lh#function#execute(f2, 3)
261
-  Comment "2be# ".string(r)
262
-  Assert! len(r) == 5
263
-  let i = 0
264
-  while i != len(r)-2
265
-    Assert! should#be#number (r[i])
266
-    Assert r[i] == i+1
267
-    let i += 1
268
-  endwhile
269
-
270
-  Assert! should#be#list (r[-2])
271
-  Assert r[-2] == []
272
-  Assert! should#be#string (r[-1])
273
-  Assert r[-1] == 'foo'
274
-endfunction
275
-
276
-"todo: write double-binded tests for all kind of binded parameters:
277
-" 'len(g:bar)'
278
-" 42
279
-" []
280
-" v:1_ + len(v:2_.v:3_)
281
-" '"foo"'
282
-" v:1_
283
-
284
-"------------------------------------------------------------------------
285
-
286
-let &cpo=s:cpo_save
287
-"=============================================================================
288
-" vim600: set fdm=marker:

+ 0
- 167
dotfiles/vim/bundle/lh-vim-lib/tests/lh/list.vim View File

@@ -1,167 +0,0 @@
1
-"=============================================================================
2
-" $Id: list.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		tests/lh/list.vim                                      {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	19th Nov 2008
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Tests for autoload/lh/list.vim
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	«install details»
17
-" History:	«history»
18
-" TODO:		«missing features»
19
-" }}}1
20
-"=============================================================================
21
-
22
-UTSuite [lh-vim-lib] Testing lh#list functions
23
-
24
-runtime autoload/lh/function.vim
25
-runtime autoload/lh/list.vim
26
-let s:cpo_save=&cpo
27
-set cpo&vim
28
-"------------------------------------------------------------------------
29
-" Find_if
30
-function! s:Test_Find_If_string_predicate()
31
-    :let b = { 'min': 12, 'max': 42 }
32
-    :let l = [ 1, 5, 48, 25, 5, 28, 6]
33
-    :let i = lh#list#Find_if(l, 'v:val>v:1_.min  && v:val<v:1_.max && v:val%v:2_==0', [b, 2] )
34
-    " echo i . '/' . len(l)
35
-    Assert i == 5
36
-    Assert l[i] == 28
37
-    " :echo l[i]
38
-endfunction
39
-
40
-function! s:Test_Find_If_functor_predicate()
41
-    :let l = [ 1, 5, 48, 25, 5, 28, 6]
42
-    :let i = lh#list#find_if(l, 'v:1_>12  && v:1_<42 && v:1_%2==0')
43
-    " echo i . '/' . len(l)
44
-    Assert i == 5
45
-    Assert l[i] == 28
46
-    " :echo l[i]
47
-endfunction
48
-
49
-function! s:Test_find_if_double_bind()
50
-    :let b = { 'min': 12, 'max': 42 }
51
-    :let l = [ 1, 5, 48, 25, 5, 28, 6]
52
-    :let f = lh#function#bind( 'v:3_>v:1_.min  && v:3_<v:1_.max && v:3_%v:2_==0') 
53
-    :let p = lh#function#bind(f, b,2,'v:1_') 
54
-    :let i = lh#list#find_if(l, p)
55
-    :echo l[i]
56
-endfunction
57
-" double bind is not yet operational
58
-UTIgnore Test_find_if_double_bind
59
-
60
-"------------------------------------------------------------------------
61
-" Unique Sorting
62
-function! CmpNumbers(lhs, rhs)
63
-  if     a:lhs < a:rhs  | return -1
64
-  elseif a:lhs == a:rhs | return 0
65
-  else              | return +1
66
-  endif
67
-endfunction
68
-
69
-function! s:Test_sort()
70
-    :let l = [ 1, 5, 48, 25, 5, 28, 6]
71
-    :let expected = [ 1, 5, 6, 25, 28, 48]
72
-    :let s = lh#list#unique_sort(l, "CmpNumbers") 
73
-    " Comment string(s)
74
-    Assert s == expected
75
-endfunction
76
-
77
-function! s:Test_sort2()
78
-    :let l = [ 1, 5, 48, 25, 5, 28, 6]
79
-    :let expected = [ 1, 5, 6, 25, 28, 48]
80
-    :let s = lh#list#unique_sort2(l, "CmpNumbers") 
81
-    " Comment string(s)
82
-    Assert s == expected
83
-endfunction
84
-
85
-"------------------------------------------------------------------------
86
-" Searchs
87
-function! s:TestBinarySearches()
88
-  let v1 = [ -3, -2, -1, -1, 0, 0, 1, 2, 3, 4, 6 ]
89
-  let i = lh#list#lower_bound(v1, 3)
90
-  Assert v1[i] == 3
91
-  let i = lh#list#upper_bound(v1, 3)
92
-  Assert v1[i] == 4
93
-  let r = lh#list#equal_range(v1, 3)
94
-  Assert v1[r[0]:r[1]-1] == [3]
95
-
96
-  let i = lh#list#lower_bound(v1, -1)
97
-  Assert v1[i] == -1
98
-  let i = lh#list#upper_bound(v1, -1)
99
-  Assert v1[i] == 0
100
-  let r = lh#list#equal_range(v1, -1)
101
-  Assert v1[r[0]:r[1]-1] == [-1, -1]
102
-
103
-  let i = lh#list#lower_bound(v1, 5)
104
-  Assert v1[i] == 6
105
-  let i = lh#list#upper_bound(v1, 5)
106
-  Assert v1[i] == 6
107
-  let r = lh#list#equal_range(v1, 5)
108
-  Assert v1[r[0]:r[1]-1] == []
109
-
110
-  Assert len(v1) == lh#list#lower_bound(v1, 10)
111
-  Assert len(v1) == lh#list#upper_bound(v1, 10)
112
-  Assert [len(v1), len(v1)] == lh#list#equal_range(v1, 10)
113
-endfunction
114
-
115
-"------------------------------------------------------------------------
116
-" accumulate
117
-
118
-function! s:Test_accumulate_len_strings()
119
-  let strings = [ 'foo', 'bar', 'toto' ]
120
-  let len = eval(lh#list#accumulate(strings, 'strlen', 'join(v:1_,  "+")'))
121
-  Assert len == 3+3+4
122
-endfunction
123
-
124
-function! s:Test_accumulate_join()
125
-  let ll = [ 1, 2, 'foo', ['bar'] ]
126
-  let res = lh#list#accumulate(ll, 'string', 'join(v:1_,  " ## ")')
127
-  Assert res == "1 ## 2 ## 'foo' ## ['bar']"
128
-  " This test will fail because it seems :for each loop cannot iterate on
129
-  " heterogeneous containers
130
-endfunction
131
-
132
-"------------------------------------------------------------------------
133
-" Copy_if
134
-function! s:Test_copy_if()
135
-    :let l = [ 1, 25, 5, 48, 25, 5, 28, 6]
136
-    :let expected = [ 25, 48, 25, 28, 6]
137
-    :let s = lh#list#copy_if(l, [], "v:1_ > 5") 
138
-    " Comment string(s)
139
-    Assert s == expected
140
-endfunction
141
-
142
-"------------------------------------------------------------------------
143
-" subset
144
-function! s:Test_subset()
145
-    :let l = [ 1, 25, 5, 48, 25, 5, 28, 6]
146
-    :let indices = [ 0, 5, 7, 3 ]
147
-    :let expected = [ 1, 5, 6, 48 ]
148
-    :let s = lh#list#subset(l, indices) 
149
-    " Comment string(s)
150
-    Assert s == expected
151
-endfunction
152
-
153
-"------------------------------------------------------------------------
154
-" intersect
155
-function! s:Test_intersect()
156
-    :let l1 = [ 1, 25, 7, 48, 26, 5, 28, 6]
157
-    :let l2 = [ 3, 8, 7, 25, 6 ]
158
-    :let expected = [ 25, 7, 6 ]
159
-    :let s = lh#list#intersect(l1, l2) 
160
-    " Comment string(s)
161
-    Assert s == expected
162
-endfunction
163
-
164
-"------------------------------------------------------------------------
165
-let &cpo=s:cpo_save
166
-"=============================================================================
167
-" vim600: set fdm=marker:

+ 0
- 180
dotfiles/vim/bundle/lh-vim-lib/tests/lh/path.vim View File

@@ -1,180 +0,0 @@
1
-"=============================================================================
2
-" $Id: path.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		tests/lh/path.vim                                      {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	28th May 2009
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:
13
-" 	Tests for autoload/lh/path.vim
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	«install details»
17
-" History:	«history»
18
-" TODO:		«missing features»
19
-" }}}1
20
-"=============================================================================
21
-
22
-UTSuite [lh-vim-lib] Testing lh#path functions
23
-
24
-runtime autoload/lh/path.vim
25
-let s:cpo_save=&cpo
26
-set cpo&vim
27
-"------------------------------------------------------------------------
28
-function! s:Test_simplify()
29
-  Assert lh#path#simplify('a/b/c') == 'a/b/c'
30
-  Assert lh#path#simplify('a/b/./c') == 'a/b/c'
31
-  Assert lh#path#simplify('./a/b/./c') == 'a/b/c'
32
-  Assert lh#path#simplify('./a/../b/./c') == 'b/c'
33
-  Assert lh#path#simplify('../a/../b/./c') == '../b/c'
34
-  Assert lh#path#simplify('a\b\c') == 'a\b\c'
35
-  Assert lh#path#simplify('a\b\.\c') == 'a\b\c'
36
-  Assert lh#path#simplify('.\a\b\.\c') == 'a\b\c'
37
-  if exists('+shellslash')
38
-    Assert lh#path#simplify('.\a\..\b\.\c') == 'b\c'
39
-    Assert lh#path#simplify('..\a\..\b\.\c') == '..\b\c'
40
-  endif
41
-endfunction
42
-
43
-function! s:Test_strip_common()
44
-  let paths = ['foo/bar/file', 'foo/file', 'foo/foo/file']
45
-  let expected = [ 'bar/file', 'file', 'foo/file']
46
-  Assert lh#path#strip_common(paths) == expected
47
-endfunction
48
-
49
-function! s:Test_common()
50
-  " Pick one ...
51
-  Assert 'foo/' == lh#path#common(['foo/bar/dir', 'foo'])
52
-  Assert 'foo/bar/' == lh#path#common(['foo/bar/dir', 'foo/bar'])
53
-  Assert 'foo/' == lh#path#common(['foo/bar/dir', 'foo/bar2'])
54
-
55
-  Assert 'foo' == lh#path#common(['foo/bar/dir', 'foo'])
56
-  Assert 'foo/bar' == lh#path#common(['foo/bar/dir', 'foo/bar'])
57
-  Assert 'foo' == lh#path#common(['foo/bar/dir', 'foo/bar2'])
58
-endfunction
59
-
60
-function! s:Test_strip_start()
61
-  let expected = 'template/bar.template'
62
-  Assert lh#path#strip_start($HOME.'/.vim/template/bar.template',
63
-	\ [ $HOME.'/.vim', $HOME.'/vimfiles', '/usr/local/share/vim' ]) 
64
-	\ == expected
65
-
66
-  Assert lh#path#strip_start($HOME.'/vimfiles/template/bar.template',
67
-	\ [ $HOME.'/.vim', $HOME.'/vimfiles', '/usr/local/share/vim' ]) 
68
-	\ == expected
69
-
70
-  Assert lh#path#strip_start('/usr/local/share/vim/template/bar.template',
71
-	\ [ $HOME.'/.vim', $HOME.'/vimfiles', '/usr/local/share/vim' ]) 
72
-	\ == expected
73
-endfunction
74
-
75
-function! s:Test_IsAbsolutePath()
76
-  " nix paths
77
-  Assert lh#path#is_absolute_path('/usr/local')
78
-  Assert lh#path#is_absolute_path($HOME)
79
-  Assert ! lh#path#is_absolute_path('./usr/local')
80
-  Assert ! lh#path#is_absolute_path('.usr/local')
81
-
82
-  " windows paths
83
-  Assert lh#path#is_absolute_path('e:\usr\local')
84
-  Assert ! lh#path#is_absolute_path('.\usr\local')
85
-  Assert ! lh#path#is_absolute_path('.usr\local')
86
-
87
-  " UNC paths
88
-  Assert lh#path#is_absolute_path('\\usr\local')
89
-  Assert lh#path#is_absolute_path('//usr/local')
90
-endfunction
91
-
92
-function! s:Test_IsURL()
93
-  " nix paths
94
-  Assert ! lh#path#is_url('/usr/local')
95
-  Assert ! lh#path#is_url($HOME)
96
-  Assert ! lh#path#is_url('./usr/local')
97
-  Assert ! lh#path#is_url('.usr/local')
98
-
99
-  " windows paths
100
-  Assert ! lh#path#is_url('e:\usr\local')
101
-  Assert ! lh#path#is_url('.\usr\local')
102
-  Assert ! lh#path#is_url('.usr\local')
103
-
104
-  " UNC paths
105
-  Assert ! lh#path#is_url('\\usr\local')
106
-  Assert ! lh#path#is_url('//usr/local')
107
-
108
-  " URLs
109
-  Assert lh#path#is_url('http://www.usr/local')
110
-  Assert lh#path#is_url('https://www.usr/local')
111
-  Assert lh#path#is_url('ftp://www.usr/local')
112
-  Assert lh#path#is_url('sftp://www.usr/local')
113
-  Assert lh#path#is_url('dav://www.usr/local')
114
-  Assert lh#path#is_url('fetch://www.usr/local')
115
-  Assert lh#path#is_url('file://www.usr/local')
116
-  Assert lh#path#is_url('rcp://www.usr/local')
117
-  Assert lh#path#is_url('rsynch://www.usr/local')
118
-  Assert lh#path#is_url('scp://www.usr/local')
119
-endfunction
120
-
121
-function! s:Test_ToRelative()
122
-  let pwd = getcwd()
123
-  Assert lh#path#to_relative(pwd.'/foo/bar') == 'foo/bar'
124
-  Assert lh#path#to_relative(pwd.'/./foo') == 'foo'
125
-  Assert lh#path#to_relative(pwd.'/foo/../bar') == 'bar'
126
-
127
-  " Does not work yet as it returns an absolute path it that case
128
-  Assert lh#path#to_relative(pwd.'/../bar') == '../bar'
129
-endfunction
130
-
131
-function! s:Test_relative_path()
132
-  Assert lh#path#relative_to('foo/bar/dir', 'foo') == '../../'
133
-  Assert lh#path#relative_to('foo', 'foo/bar/dir') == 'bar/dir/'
134
-  Assert lh#path#relative_to('foo/bar', 'foo/bar2/dir') == '../bar2/dir/'
135
-
136
-  let pwd = getcwd()
137
-  Assert lh#path#relative_to(pwd ,pwd.'/../bar') == '../bar/'
138
-endfunction
139
-
140
-function! s:Test_search_vimfiles()
141
-  let expected_win = $HOME . '/vimfiles'
142
-  let expected_nix = $HOME . '/.vim'
143
-  let what =  lh#path#to_regex($HOME.'/').'\(vimfiles\|.vim\)'
144
-  " Comment what
145
-  let z = lh#path#find(&rtp,what)
146
-  if has('win16')||has('win32')||has('win64')
147
-    Assert z == expected_win
148
-  else
149
-    Assert z == expected_nix
150
-  endif
151
-endfunction
152
-
153
-function! s:Test_path_depth()
154
-  Assert 0 == lh#path#depth('.')
155
-  Assert 0 == lh#path#depth('./')
156
-  Assert 0 == lh#path#depth('.\')
157
-  Assert 1 == lh#path#depth('toto')
158
-  Assert 1 == lh#path#depth('toto/')
159
-  Assert 1 == lh#path#depth('toto\')
160
-  Assert 1 == lh#path#depth('toto/.')
161
-  Assert 1 == lh#path#depth('toto\.')
162
-  Assert 1 == lh#path#depth('toto/./.')
163
-  Assert 1 == lh#path#depth('toto\.\.')
164
-  Assert 0 == lh#path#depth('toto/..')
165
-  if exists('+shellslash')
166
-    Assert 0 == lh#path#depth('toto\..')
167
-  endif
168
-  Assert 2 == lh#path#depth('toto/titi/')
169
-  Assert 2 == lh#path#depth('toto\titi\')
170
-  Assert 2 == lh#path#depth('/toto/titi/')
171
-  Assert 2 == lh#path#depth('c:/toto/titi/')
172
-  Assert 2 == lh#path#depth('c:\toto/titi/')
173
-" todo: make a choice about "negative" paths like "../../foo"
174
-  Assert -1 == lh#path#depth('../../foo')
175
-endfunction
176
-
177
-"------------------------------------------------------------------------
178
-let &cpo=s:cpo_save
179
-"=============================================================================
180
-" vim600: set fdm=marker:

+ 0
- 85
dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-Fargs2String.vim View File

@@ -1,85 +0,0 @@
1
-"=============================================================================
2
-" $Id: test-Fargs2String.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		tests/lh/test-Fargs2String.vim                           {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	16th Apr 2007
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	Tests for lh-vim-lib . lh#command#Fargs2String
13
-" 
14
-"------------------------------------------------------------------------
15
-" Installation:	
16
-" 	Relies on the version «patched by myself|1?» of vim_units
17
-" History:	«history»
18
-" TODO:		«missing features»
19
-" }}}1
20
-"=============================================================================
21
-
22
-function! s:TestEmpty()
23
-  let empty = []
24
-  let res = lh#command#Fargs2String(empty)
25
-  call VUAssertEquals(len(empty), 0, 'Expected empty', 22)
26
-  call VUAssertEquals(res, '', 'Expected empty result', 23)
27
-endfunction
28
-
29
-function! s:TestSimpleText1()
30
-  let expected = 'text'
31
-  let one = [ expected ]
32
-  let res = lh#command#Fargs2String(one)
33
-  call VUAssertEquals(len(one), 0, 'Expected empty', 27)
34
-  call VUAssertEquals(res, expected, 'Expected a simple result', 28)
35
-endfunction
36
-
37
-function! s:TestSimpleTextN()
38
-  let expected = 'text'
39
-  let list = [ expected , 'stuff1', 'stuff2']
40
-  let res = lh#command#Fargs2String(list)
41
-  call VUAssertEquals(len(list), 2, 'Expected not empty', 38)
42
-  call VUAssertEquals(res, expected, 'Expected a simple result', 39)
43
-endfunction
44
-
45
-function! s:TestComposedN()
46
-  let expected = '"a several tokens string"'
47
-  let list = [ '"a', 'several', 'tokens', 'string"', 'stuff1', 'stuff2']
48
-  let res = lh#command#Fargs2String(list)
49
-  call VUAssertEquals(len(list), 2, 'Expected not empty', 46)
50
-  call VUAssertEquals(res, expected, 'Expected a composed string', 47)
51
-  call VUAssertEquals(list, ['stuff1', 'stuff2'], 'Expected a list', 48)
52
-  call VUAssertNotSame(list, ['stuff1', 'stuff2'], 'Expected different lists', 49)
53
-endfunction
54
-
55
-function! s:TestComposed1()
56
-  let expected = '"string"'
57
-  let list = [ '"string"', 'stuff1', 'stuff2']
58
-  let res = lh#command#Fargs2String(list)
59
-  call VUAssertEquals(len(list), 2, 'Expected not empty', 56)
60
-  call VUAssertEquals(res, expected, 'Expected a string', 57)
61
-  call VUAssertEquals(list, ['stuff1', 'stuff2'], 'Expected a list', 58)
62
-  call VUAssertNotSame(list, ['stuff1', 'stuff2'], 'Expected different lists', 59)
63
-endfunction
64
-
65
-function! s:TestInvalidString()
66
-  let expected = '"a string'
67
-  let list = [ '"a', 'string']
68
-  let res = lh#command#Fargs2String(list)
69
-  call VUAssertEquals(len(list), 0, 'Expected empty', 66)
70
-  call VUAssertEquals(res, expected, 'Expected an invalid string', 67)
71
-endfunction
72
-
73
-function! AllTests()
74
-  call s:TestEmpty()
75
-  call s:TestSimpleText1()
76
-  call s:TestSimpleTextN()
77
-  call s:TestComposed1()
78
-  call s:TestComposedN()
79
-endfunction
80
-
81
-" call VURunnerRunTest('AllTests')
82
-VURun % AllTests
83
-
84
-"=============================================================================
85
-" vim600: set fdm=marker:

+ 0
- 67
dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-askmenu.vim View File

@@ -1,67 +0,0 @@
1
-"=============================================================================
2
-" $Id: test-askmenu.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		tests/test-buffer-menu.vim                                {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	18th Apr 2007
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	
13
-" 	Test units for buffermenu.vim
14
-" 
15
-"------------------------------------------------------------------------
16
-" Installation:	Requires:
17
-" 	(*) Vim 7.0+
18
-" 	(*) vim_units.vim v0.2/1.0?
19
-" 	    Vimscript # «???»
20
-" 	(*) lh-vim-lib (lh#ask#menu)
21
-"
22
-" User Manual:
23
-" 	Source this file.
24
-"
25
-" History:	
26
-" (*) 17th Apr 2007: First version 
27
-" TODO:		«missing features»
28
-" }}}1
29
-"=============================================================================
30
-
31
-
32
-
33
-"=============================================================================
34
-let s:cpo_save=&cpo
35
-"------------------------------------------------------------------------
36
-" Functions {{{1
37
-
38
-function! TestAskMenu()
39
-  imenu          42.40.10 &LH-Tests.&Menu.&ask.i       iask
40
-  inoremenu      42.40.10 &LH-Tests.&Menu.&ask.inore   inoreask
41
-  nmenu          42.40.10 &LH-Tests.&Menu.&ask.n       nask
42
-  nnoremenu      42.40.10 &LH-Tests.&Menu.&ask.nnore   nnoreask
43
-  nmenu <script> 42.40.10 &LH-Tests.&Menu.&ask.nscript nscriptask
44
-  nnoremenu <script> 42.40.10 &LH-Tests.&Menu.&ask.nnnscript nnscriptask
45
-
46
-  vmenu          42.40.10 &LH-Tests.&Menu.&ask.v     vask
47
-  vnoremenu      42.40.10 &LH-Tests.&Menu.&ask.vnore vnoreask
48
-
49
-  call s:CheckInMode('i', 'i')
50
-
51
-endfunction
52
-
53
-function! s:CheckInMode(mode, name)
54
-  let g:menu = lh#askvim#menu('LH-Tests.Menu.ask.'.a:name, a:mode)
55
-  let g:name = a:name
56
-  " VUAssert 55 Equals g:menu.name     g:name     "Name mismatch"
57
-  " VUAssert 56 Equals g:menu.priority '42.40.10' "Priority mismatch"
58
-  " VUAssert 57 Fail "parce qu'il le faut bien"
59
-  echomsg "name= ".g:menu.name
60
-  echomsg "prio= ".g:menu.priority
61
-endfunction
62
-
63
-" Functions }}}1
64
-"------------------------------------------------------------------------
65
-let &cpo=s:cpo_save
66
-"=============================================================================
67
-" vim600: set fdm=marker:

+ 0
- 69
dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-command.vim View File

@@ -1,69 +0,0 @@
1
-" $Id: test-command.vim 156 2010-05-07 00:54:36Z luc.hermitte $
2
-" Tests for lh-vim-lib . lh#command
3
-
4
-" FindFilter(filter):                            Helper {{{3
5
-function! s:FindFilter(filter)
6
-  let filter = a:filter . '.vim'
7
-  let result =globpath(&rtp, "compiler/BTW-".filter) . "\n" .
8
-	\ globpath(&rtp, "compiler/BTW_".filter). "\n" .
9
-	\ globpath(&rtp, "compiler/BTW/".filter)
10
-  let result = substitute(result, '\n\n', '\n', 'g')
11
-  let result = substitute(result, '^\n', '', 'g')
12
-  return result
13
-endfunction
14
-
15
-function! s:ComplFilter(filter)
16
-  let files = s:FindFilter('*')
17
-  let files = substitute(files,
18
-	\ '\(^\|\n\).\{-}compiler[\\/]BTW[-_\\/]\(.\{-}\)\.vim\>\ze\%(\n\|$\)',
19
-	\ '\1\2', 'g')
20
-  return files
21
-endfunction
22
-
23
-function! s:Add()
24
-endfunction
25
-
26
-let s:v1 = 'v1'
27
-let s:v2 = 2
28
-
29
-function! s:Foo(i)
30
-  return a:i*a:i
31
-endfunction
32
-
33
-function! s:echo(params)
34
-  echo s:{join(a:params, '')}
35
-endfunction
36
-
37
-function! Echo(params)
38
-  " echo "Echo(".string(a:params).')'
39
-  let expr = 's:'.join(a:params, '')
40
-  " echo expr
41
-  exe 'echo '.expr
42
-endfunction
43
-
44
-let TBTWcommand = {
45
-      \ "name"      : "TBT",
46
-      \ "arg_type"  : "sub_commands",
47
-      \ "arguments" :
48
-      \     [
49
-      \       { "name"      : "echo",
50
-      \		"arg_type"  : "function",
51
-      \         "arguments" : "v1,v2",
52
-      \         "action": function("\<sid>echo") },
53
-      \       { "name"      : "Echo",
54
-      \		"arg_type"  : "function",
55
-      \         "arguments" : "v1,v2",
56
-      \         "action": function("Echo") },
57
-      \       { "name"  : "help" },
58
-      \       { "name"  : "add",
59
-      \         "arguments": function("s:ComplFilter"),
60
-      \         "action" : function("s:Add") }
61
-      \     ]
62
-      \ }
63
-
64
-call lh#command#new(TBTWcommand)
65
-
66
-nnoremap µ :call lh#command#new(TBTWcommand)<cr>
67
-
68
-"=============================================================================
69
-" vim600: set fdm=marker:

+ 0
- 56
dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-menu-map.vim View File

@@ -1,56 +0,0 @@
1
-"=============================================================================
2
-" $Id: test-menu-map.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:		tests/lh/test-menu-map.vim                               {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:	3.0.0
9
-" Created:	05th Dec 2006
10
-" Last Update:	$Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:	Tests for lh-vim-lib . lh#menu#
13
-" 
14
-"------------------------------------------------------------------------
15
-" Installation:	«install details»
16
-" History:	«history»
17
-" TODO:		«missing features»
18
-" }}}1
19
-"=============================================================================
20
-
21
-
22
-" let g:want_buffermenu_or_global_disable = 1
23
-" let b:want_buffermenu_or_global_disable = 1
24
-" echo lh#option#get("want_buffermenu_or_global_disable", 1, "bg")
25
-
26
-" Call a command (':Command')
27
-call lh#menu#make("nic", '42.50.340',
28
-      \ '&LH-Tests.&Menu-Make.Build Ta&gs', "<C-L>g",
29
-      \ '<buffer>',
30
-      \ ":echo 'TeXtags'<CR>")
31
-
32
-" With '{' expanding to '{}××', or '{}' regarding the mode
33
-call lh#menu#IVN_make('42.50.360.200',
34
-      \ '&LH-Tests.&Menu-Make.&Insert.\toto{}', ']toto',
35
-      \ '\\toto{',
36
-      \ '{%i\\toto<ESC>%l',
37
-      \ "viw]toto")
38
-
39
-" Noremap for the visual maps
40
-call lh#menu#IVN_make('42.50.360.200',
41
-      \ '&LH-Tests.&Menu-Make.&Insert.\titi{}', ']titi',
42
-      \ '\\titi{',
43
-      \ '<ESC>`>a}<ESC>`<i\\titi{<ESC>%l',
44
-      \ "viw]titi",
45
-      \ 0, 1, 0)
46
-
47
-" Noremap for the insert and visual maps
48
-call lh#menu#IVN_make('42.50.360.200',
49
-      \ '&LH-Tests.&Menu-Make.&Insert.<tata></tata>', ']tata',
50
-      \ '<tata></tata><esc>?<<CR>i', 
51
-      \ '<ESC>`>a</tata><ESC>`<i<tata><ESC>/<\\/tata>/e1<CR>',
52
-      \ "viw]tata", 
53
-      \ 1, 1, 0)
54
-
55
-"=============================================================================
56
-" vim600: set fdm=marker:

+ 0
- 86
dotfiles/vim/bundle/lh-vim-lib/tests/lh/test-toggle-menu.vim View File

@@ -1,86 +0,0 @@
1
-"=============================================================================
2
-" $Id: test-toggle-menu.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:         tests/lh/test-toggle-menu.vim                            {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"               <URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      17th Apr 2007
10
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:  
13
-"       Tests for lh-vim-lib . lh#menu#def_toggle_item()
14
-"
15
-"------------------------------------------------------------------------
16
-" Installation: «install details»
17
-" History:      «history»
18
-" TODO:         «missing features»
19
-" }}}1
20
-"=============================================================================
21
-
22
-runtime autoload/lh/menu.vim
23
-
24
-let Data = {
25
-      \ "variable": "bar",
26
-      \ "idx_crt_value": 1,
27
-      \ "values": [ 'a', 'b', 'c', 'd' ],
28
-      \ "menu": { "priority": '42.50.10', "name": '&LH-Tests.&TogMenu.&bar'}
29
-      \}
30
-
31
-call lh#menu#def_toggle_item(Data)
32
-
33
-let Data2 = {
34
-      \ "variable": "foo",
35
-      \ "idx_crt_value": 3,
36
-      \ "texts": [ 'un', 'deux', 'trois', 'quatre' ],
37
-      \ "values": [ 1, 2, 3, 4 ],
38
-      \ "menu": { "priority": '42.50.11', "name": '&LH-Tests.&TogMenu.&foo'}
39
-      \}
40
-
41
-call lh#menu#def_toggle_item(Data2)
42
-
43
-" No default
44
-let Data3 = {
45
-      \ "variable": "nodef",
46
-      \ "texts": [ 'one', 'two', 'three', 'four' ],
47
-      \ "values": [ 1, 2, 3, 4 ],
48
-      \ "menu": { "priority": '42.50.12', "name": '&LH-Tests.&TogMenu.&nodef'}
49
-      \}
50
-call lh#menu#def_toggle_item(Data3)
51
-
52
-" No default
53
-let g:def = 2
54
-let Data4 = {
55
-      \ "variable": "def",
56
-      \ "values": [ 1, 2, 3, 4 ],
57
-      \ "menu": { "priority": '42.50.13', "name": '&LH-Tests.&TogMenu.&def'}
58
-      \}
59
-call lh#menu#def_toggle_item(Data4)
60
-
61
-" What follows does not work because we can't build an exportable FuncRef on top
62
-" of a script local function
63
-" finish
64
-
65
-function! s:getSNR()
66
-  if !exists("s:SNR")
67
-    let s:SNR=matchstr(expand("<sfile>"), "<SNR>\\d\\+_\\zegetSNR$")
68
-  endif
69
-  return s:SNR 
70
-endfunction
71
-
72
-function! s:Yes()
73
-  echomsg "Yes"
74
-endfunction
75
-
76
-function! s:No()
77
-  echomsg "No"
78
-endfunction
79
-let Data4 = {
80
-      \ "variable": "yesno",
81
-      \ "values": [ 1, 2 ],
82
-      \ "text": [ "No", "Yes" ],
83
-      \ "actions": [ function(s:getSNR()."No"), function(s:getSNR()."Yes") ],
84
-      \ "menu": { "priority": '42.50.20', "name": '&LH-Tests.&TogMenu.&yesno'}
85
-      \}
86
-call lh#menu#def_toggle_item(Data4)

+ 0
- 122
dotfiles/vim/bundle/lh-vim-lib/tests/lh/topological-sort.vim View File

@@ -1,122 +0,0 @@
1
-"=============================================================================
2
-" $Id: topological-sort.vim 520 2012-03-19 18:09:15Z luc.hermitte $
3
-" File:         tests/lh/topological-sort.vim                            {{{1
4
-" Author:       Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"               <URL:http://code.google.com/p/lh-vim/>
6
-" License:      GPLv3 with exceptions
7
-"               <URL:http://code.google.com/p/lh-vim/wiki/License>
8
-" Version:      3.0.0
9
-" Created:      17th Apr 2008
10
-" Last Update:  $Date: 2012-03-19 19:09:15 +0100 (Mon, 19 Mar 2012) $
11
-"------------------------------------------------------------------------
12
-" Description:  «description»
13
-"
14
-"------------------------------------------------------------------------
15
-" Installation: «install details»
16
-" History:      «history»
17
-" TODO:         «missing features»
18
-" }}}1
19
-"=============================================================================
20
-
21
-let s:cpo_save=&cpo
22
-set cpo&vim
23
-"------------------------------------------------------------------------
24
-UTSuite [lh-vim-lib] topological sort
25
-
26
-" Fully defineds DAGs {{{1
27
-
28
-" A Direct Acyclic Graph {{{2
29
-let s:dag1 = {}
30
-let s:dag1[7] = [11, 8]
31
-let s:dag1[5] = [11]
32
-let s:dag1[3] = [8, 10]
33
-let s:dag1[11] = [2, 9, 10]
34
-let s:dag1[8] = [9]
35
-
36
-" A Direct Cyclic Graph {{{2
37
-let s:dcg1 = deepcopy(s:dag1)
38
-let s:dcg1[9] = [11]
39
-
40
-" Check routine: are the elements correctly sorted? {{{2
41
-function! s:DoTestOrder(elements)
42
-  Assert! len(a:elements) == 8
43
-  Assert index(a:elements, 7) < index(a:elements, 11)
44
-  Assert index(a:elements, 7) < index(a:elements, 8)
45
-  Assert index(a:elements, 5) < index(a:elements, 11)
46
-  Assert index(a:elements, 3) < index(a:elements, 8)
47
-  Assert index(a:elements, 3) < index(a:elements, 10)
48
-  Assert index(a:elements, 11) < index(a:elements, 2)
49
-  Assert index(a:elements, 11) < index(a:elements, 9)
50
-  Assert index(a:elements, 11) < index(a:elements, 10)
51
-  Assert index(a:elements, 8) < index(a:elements, 9)
52
-endfunction
53
-
54
-" Test DAG1 {{{2
55
-function! s:TestDAG_depth()
56
-  let res = lh#graph#tsort#depth(s:dag1, [3, 5,7])
57
-  call s:DoTestOrder(res)
58
-  echo "D(s:dag1)=".string(res)
59
-endfunction
60
-
61
-function! s:TestDAG_breadth()
62
-  let res = lh#graph#tsort#breadth(s:dag1, [3, 5,7])
63
-  call s:DoTestOrder(res)
64
-  echo "B(s:dag1)=".string(res)
65
-endfunction
66
-
67
-" Test DCG1 {{{2
68
-function! s:TestDCG_depth()
69
-  let expr = 'lh#graph#tsort#depth('.string(s:dcg1).', [3, 5,7])'
70
-  Assert should#throw(expr, 'Tsort: cyclic graph detected')
71
-endfunction
72
-
73
-function! s:TestDCG_breadth()
74
-  let expr = 'lh#graph#tsort#breadth('.string(s:dcg1).', [3, 5,7])'
75
-  Assert should#throw(expr, 'Tsort: cyclic graph detected')
76
-endfunction
77
-
78
-" Lazzy Evaluated DAGs {{{1
79
-
80
-" Emulated lazzyness {{{2
81
-" The time-consumings evaluation function
82
-let s:called = 0
83
-function! Fetch(node)
84
-  let s:called += 1
85
-  return has_key(s:dag1, a:node) ? (s:dag1[a:node]) : []
86
-endfunction
87
-
88
-" Test Fetch on a DAG {{{2
89
-function! s:TestDAG_fetch()
90
-  let s:called = 0
91
-  let res = lh#graph#tsort#depth(function('Fetch'), [3,5,7])
92
-  call s:DoTestOrder(res)
93
-  echo "D(fetch)=".string(res)
94
-  echo "Fetch has been evaluated ".s:called." times / ".len(res)
95
-  Assert s:called == len(res)
96
-endfunction
97
-
98
-
99
-" Setup/Teardown functions {{{1
100
-" display the test name before each assertion
101
-function! s:Setup()
102
-  if exists('g:UT_print_test')
103
-    let s:old_print_test = g:UT_print_test
104
-  endif
105
-  let g:UT_print_test = 1
106
-endfunction
107
-
108
-function! s:Teardown()
109
-  if exists('s:old_print_test')
110
-    let g:UT_print_test = s:old_print_test 
111
-    unlet s:old_print_test
112
-  else
113
-    unlet g:UT_print_test
114
-  endif
115
-endfunction
116
-
117
-
118
-" }}}1
119
-let &cpo=s:cpo_save
120
-"=============================================================================
121
-" vim600: set fdm=marker:
122
-

+ 0
- 56
dotfiles/vim/bundle/perlcritic/ftplugin/perl/perlcritic.vim View File

@@ -1,56 +0,0 @@
1
-" To change mapping, just put
2
-" let g:perlcritic_map='whatever'
3
-" in your .vimrc
4
-" To change the color of
5
-function! <SID>PerlCritic()
6
-  set lazyredraw
7
-  " Close any existing cwindows.
8
-  cclose
9
-  let l:grepformat_save = &grepformat
10
-  let l:grepprogram_save = &grepprg
11
-  set grepformat&vim
12
-  set grepformat&vim
13
-  let &grepformat = '%f:%l:%m'
14
-  let &grepprg = 'perlcritic_vim'
15
-  if &readonly == 0 | update | endif
16
-  silent! grep! %
17
-  let &grepformat = l:grepformat_save
18
-  let &grepprg = l:grepprogram_save
19
-  let l:mod_total = 0
20
-  let l:win_count = 1
21
-  " Determine correct window height
22
-  windo let l:win_count = l:win_count + 1
23
-  if l:win_count <= 2 | let l:win_count = 4 | endif
24
-  windo let l:mod_total = l:mod_total + winheight(0)/l:win_count |
25
-        \ execute 'resize +'.l:mod_total
26
-  " Open cwindow
27
-  execute 'belowright copen '.l:mod_total
28
-  nnoremap <buffer> <silent> c :cclose<CR>
29
-  set nolazyredraw
30
-  redraw!
31
-  let tlist=getqflist() ", 'get(v:val, ''bufnr'')')
32
-  if empty(tlist)
33
-	  if !hlexists('GreenBar')
34
-		  hi GreenBar term=reverse ctermfg=white ctermbg=darkgreen guifg=white guibg=darkgreen
35
-	  endif
36
-	  echohl GreenBar
37
-	  echomsg "Perl::Critic correct"
38
-	  echohl None
39
-	  cclose
40
-  endif
41
-endfunction
42
-
43
-  if !exists('g:perlcritic_map')
44
-    let g:perlcritic_map='<F5>'
45
-  endif
46
-if ( !hasmapto('<SID>PerlCritic()') && (maparg(g:perlcritic_map) == '') )
47
-  exe 'nnoremap <silent> '. g:perlcritic_map .' :call <SID>PerlCritic()<CR>'
48
-"  map <F5> :call <SID>PerlCritic()<CR>
49
-"  map! <F5> :call <SID>PerlCritic()<CR>
50
-else
51
-  if ( !has("gui_running") || has("win32") )
52
-    echo "Python Perl::Critic Error: No Key mapped.\n".
53
-          \ g:perlcritic_map ." is taken and a replacement was not assigned."
54
-  endif
55
-endif
56
-

+ 0
- 1
dotfiles/vim/bundle/python-syntax

@@ -1 +0,0 @@
1
-Subproject commit 1df5e5aaf8c7050795e2994329a23b3fd24eb161

+ 0
- 1
dotfiles/vim/bundle/syntastic

@@ -1 +0,0 @@
1
-Subproject commit 0336c35c0b10b46d85cdd9c3df721f978429e82c

+ 0
- 1
dotfiles/vim/bundle/targets

@@ -1 +0,0 @@
1
-Subproject commit a79447f261e4b8b4327557aa03726f3849334b84

+ 0
- 3
dotfiles/vim/bundle/tracwiki/ftdetect/tracwiki.vim View File

@@ -1,3 +0,0 @@
1
-" By Daniel Hahler
2
-au BufRead,BufNewFile *.tracwiki if &ft == '' | setfiletype tracwiki | endif
3
-

+ 0
- 114
dotfiles/vim/bundle/tracwiki/syntax/tracwiki.vim View File

@@ -1,114 +0,0 @@
1
-" Vim syntax file for Trac wiki syntax
2
-"
3
-" Language:     trac wiki
4
-" Maintainer:   Caleb Constantine <cadamantine@gmail.com>
5
-" Last Change:  22 Nov 2010
6
-" Version: 0.5
7
-
8
-" Modified extensively from wiki.vim, by Andreas Kneib,
9
-" http://www.vim.org/scripts/script.php?script_id=725
10
-
11
-" To use this syntax file:
12
-"
13
-" - Put the file in your syntax directory, e.g. ~/.vim/syntax,
14
-"   $HOME/vimfiles/syntax (see :help syntax).
15
-" - Enable file type detection. One method is to add the following to your
16
-"   filetype.vim file, which is usually located in ~/.vim or $HOME/vimfiles
17
-"   (create it if not present, see :help filetype):
18
-"
19
-"       augroup tracwiki
20
-"           au! BufRead,BufNewFile *.tracwiki   setfiletype tracwiki
21
-"       augroup END
22
-"
23
-" TODO: 
24
-" - Highlight tables.
25
-" - Highlight Blockquotes
26
-" - Highlight Numbered (ordered) lists
27
-" - Highlight Processors. Some processors can have there own syntax highlight,
28
-"   e.g. rst. Pull in syntax for these from existing syntax files.
29
-" - Some wiki formatting is allowed inside discussion citations
30
-"   (tracDisussion). We don't currently support that but we should.
31
-
32
-
33
-" Quit if syntax file is already loaded
34
-if version < 600
35
-  syntax clear
36
-elseif exists("b:current_syntax")
37
-  finish
38
-endif
39
-
40
-syn region  tracVerb        start="{\{3}" end="}\{3}"
41
-syn region  tracVerb        start="`" end="`"
42
-
43
-syn region  tracHead        start="^=\{1,5} " end="=\{1,5} *\(#[^ ]\+\)\?"
44
-syn match   tracLine        "^----$"
45
-
46
-syn region tracItalic       start=+''+ end=+''+ containedin=tracHead contains=tracEscape
47
-syn region tracBold         start=+'''+ end=+'''+ containedin=tracHead contains=tracEscape
48
-syn region tracBoldItalic   start=+'''''+ end=+'''''+ containedin=tracHead contains=tracEscape
49
-syn region tracUnderline    start=+__+hs=s+2 end=+__+he=e-2 containedin=tracHead contains=tracEscape
50
-syn region tracStrike       start=+\~\~+ end=+\~\~+ containedin=tracHead contains=tracEscape
51
-syn region tracSuper        start=+\^+ end=+\^+ containedin=tracHead contains=tracEscape
52
-syn region tracSub          start=+,,+ end=+,,+ containedin=tracHead contains=tracEscape
53
-
54
-" This may need to be fine tuned.
55
-syn match tracEscape        "![^ ]\+\( \|$\)" contained
56
-syn region tracEscape       start=+!\[+ end=+\]+
57
-
58
-syn region  tracLink        start=+\[+ end=+\]+
59
-syn match   tracRawLink     "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]" contains=@NoSpell
60
-syn match   tracPageName    "\<\(wiki:\)\?\([A-Z][a-z]\+\)\{2,}\>\([#/]\<\([A-Z][a-z]\+\)\{2,}\>\)*"
61
-
62
-" Trac links
63
-"
64
-" Tickets
65
-syn match   tracLinks      "#\d\+"
66
-" Reports
67
-syn match   tracLinks     "{\d\+}"
68
-" Change sets. Make sure defined after tracLink otherwise syntax will break.
69
-syn match   tracLinks     "\<r\d\+"
70
-" Revision log. Make sure defined after tracLink otherwise syntax will break.
71
-syn match   tracLinks     "\<r\d\+:\d\+"
72
-syn match   tracLinks     "\[\d\+:\d\+\(/[^]]\+\)*\]"
73
-" General form, type:id (where id represents the number, name or path of the
74
-" item)
75
-syn match   tracLinks     `\<\(wiki\|source\|attachment\|milestone\|diff\|log\|report\|changeset\|comment\|ticket\):\(".\+"\|'.\+'\|\(\S\+\)\+\)`
76
-
77
-" Change sets. Make sure defined after tracLink and before tracLinks otherwise
78
-" syntax will break.
79
-syn region  tracMacro       start=+\[\[+ end=+\]\]+
80
-
81
-syn match   tracListItem    "^\s\+[*-]\s\+"
82
-syn match   tracDefList     "^\s.\+::" 
83
-
84
-syn region  tracDisussion   start="^>" end="$"
85
-
86
-syn match   tracEscape      "!\<\([A-Z][a-z]\+\)\{2,}\>\([#/]\<\([A-Z][a-z]\+\)\{2,}\>\)*"
87
-
88
-" The default highlighting.
89
-  
90
-hi def link tracLinks        Function
91
-hi def link tracHead         Type
92
-hi def link tracLine         Type
93
-hi def link tracVerb         String
94
-hi def      tracBold          term=bold cterm=bold gui=bold
95
-hi def      tracItalic        term=italic cterm=italic gui=italic
96
-hi def      tracUnderline     term=underline cterm=underline gui=underline
97
-hi def      tracBoldItalic    term=bold,italic cterm=bold,italic gui=bold,italic
98
-hi def link tracEscape       Special
99
-hi def link tracStrike       Statement
100
-hi def link tracSuper        Statement
101
-hi def link tracSub          Statement
102
-hi def link tracLink         Function
103
-hi def link tracRawLink      Function
104
-hi def link tracPageName     Function
105
-hi def link tracListItem     Operator
106
-hi def link tracDefList      tracBoldItalic
107
-hi def link tracMacro        PreProc
108
-hi def link tracDisussion    Comment
109
-
110
-hi def link tracCurlyError  Error
111
-
112
-let b:current_syntax = "trac"
113
-
114
-"vim: tw=78:ft=vim:ts=8

+ 0
- 1
dotfiles/vim/bundle/vim-airline

@@ -1 +0,0 @@
1
-Subproject commit c213f2ac44292a6c5548872e63acb0648cc07a9a

+ 0
- 1
dotfiles/vim/bundle/vim-airline-themes

@@ -1 +0,0 @@
1
-Subproject commit b85165844240fe0b9121df487679a320e053abc7

+ 0
- 88
dotfiles/vim/bundle/vim-flake8/README.mdown View File

@@ -1,88 +0,0 @@
1
-vim-flake8
2
-==========
3
-`vim-flake8` is a Vim plugin that runs the currently open file through Flake8,
4
-a static syntax and style checker for Python source code.  It supersedes both
5
-[vim-pyflakes](https://github.com/nvie/vim-pyflakes) and
6
-[vim-pep8](https://github.com/nvie/vim-pep8).
7
-
8
-[Flake8](http://pypi.python.org/pypi/flake8/) is a wrapper around PyFlakes 
9
-(static syntax checker), PEP8 (style checker) 
10
-and Ned's MacCabe script (complexity checker).
11
-
12
-
13
-Installation
14
-------------
15
-Use [vim-pathogen](https://github.com/tpope/vim-pathogen) if you're not using
16
-it already.  Make sure you've installed the [flake8](http://pypi.python.org/pypi/flake8/) package.
17
-Then, simply put the contents of this repository in your
18
-`~/.vim/bundle` directory.
19
-
20
-Usage
21
------
22
-1. Open a Python file
23
-2. Press `<F7>` to run `flake8` on it
24
-
25
-It shows the errors inside a quickfix window, which will allow your to quickly
26
-jump to the error locations by simply pressing [Enter].
27
-
28
-
29
-Customization
30
--------------
31
-If you don't want to use the `<F7>` key for flake8-checking, simply remap it to
32
-another key.  It autodetects whether it has been remapped and won't register
33
-the `<F7>` key if so.  For example, to remap it to `<F3>` instead, use:
34
-
35
-    autocmd FileType python map <buffer> <F3> :call Flake8()<CR>
36
-
37
-To add builtins, in your .vimrc:
38
-
39
-    let g:flake8_builtins="_,apply"
40
-
41
-To ignore errors, in your .vimrc:
42
-
43
-    let g:flake8_ignore="E501,W293"
44
-
45
-If you want to change the max line length for PEP8:
46
-
47
-    let g:flake8_max_line_length=99
48
-
49
-To set the maximum [McCabe complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) before a warning is issued:
50
-
51
-    let g:flake8_max_complexity=10
52
-
53
-To customize the location of your flake8 binary, set `g:flake8_cmd`:
54
-
55
-    let g:flake8_cmd="/opt/strangebin/flake8000"
56
-
57
-
58
-Tips
59
-----
60
-A tip might be to run the Flake8 check every time you write a Python file, to
61
-enable this, add the following line to your `.vimrc` file (thanks
62
-[Godefroid](http://github.com/gotcha)!):
63
-
64
-    autocmd BufWritePost *.py call Flake8()
65
-
66
-This plugin goes well together with the following plugin:
67
-
68
-- [PyUnit](http://github.com/nvie/vim-pyunit) (unit test helper under `<F8>`
69
-  and `<F9>`)
70
-
71
-
72
-History
73
--------
74
-
75
-1.3: Added the following options:
76
-
77
-     - `g:flake8_builtins="_,apply"`
78
-     - `g:flake8_max_complexity=10`
79
-
80
-1.2: Added the following options:
81
-
82
-     - `g:flake8_cmd="/opt/strangebin/flake8000"`
83
-     - `g:flake8_max_line_length=120`
84
-     - `g:flake8_ignore="E501,W293"`
85
-
86
-1.1: Added `g:flake8_ignore` option.
87
-
88
-1.0: Initial version.

+ 0
- 102
dotfiles/vim/bundle/vim-flake8/ftplugin/python_flake8.vim View File

@@ -1,102 +0,0 @@
1
-"
2
-" Python filetype plugin for running flake8
3
-" Language:     Python (ft=python)
4
-" Maintainer:   Vincent Driessen <vincent@3rdcloud.com>
5
-" Version:      Vim 7 (may work with lower Vim versions, but not tested)
6
-" URL:          http://github.com/nvie/vim-flake8
7
-"
8
-" Only do this when not done yet for this buffer
9
-if exists("b:loaded_flake8_ftplugin")
10
-    finish
11
-endif
12
-let b:loaded_flake8_ftplugin=1
13
-
14
-if !exists("*Flake8()")
15
-    function Flake8()
16
-        if exists("g:flake8_cmd")
17
-            let s:flake8_cmd=g:flake8_cmd
18
-        else
19
-            let s:flake8_cmd="flake8"
20
-        endif
21
-
22
-        if !executable(s:flake8_cmd)
23
-            echoerr "File " . s:flake8_cmd . " not found. Please install it first."
24
-            return
25
-        endif
26
-
27
-        set lazyredraw   " delay redrawing
28
-        cclose           " close any existing cwindows
29
-
30
-        " store old grep settings (to restore later)
31
-        let l:old_gfm=&grepformat
32
-        let l:old_gp=&grepprg
33
-
34
-        " write any changes before continuing
35
-        if &readonly == 0
36
-            update
37
-        endif
38
-
39
-        " read config
40
-        if exists("g:flake8_builtins")
41
-            let s:flake8_builtins_opt=" --builtins=".g:flake8_builtins
42
-        else
43
-            let s:flake8_builtins_opt=""
44
-        endif
45
-
46
-        if exists("g:flake8_ignore")
47
-            let s:flake8_ignores=" --ignore=".g:flake8_ignore
48
-        else
49
-            let s:flake8_ignores=""
50
-        endif
51
-
52
-        if exists("g:flake8_max_line_length")
53
-            let s:flake8_max_line_length=" --max-line-length=".g:flake8_max_line_length
54
-        else
55
-            let s:flake8_max_line_length=""
56
-        endif
57
-
58
-        if exists("g:flake8_max_complexity")
59
-            let s:flake8_max_complexity=" --max-complexity=".g:flake8_max_complexity
60
-        else
61
-            let s:flake8_max_complexity=""
62
-        endif
63
-
64
-        " perform the grep itself
65
-        let &grepformat="%f:%l:%c: %m\,%f:%l: %m"
66
-        let &grepprg=s:flake8_cmd.s:flake8_builtins_opt.s:flake8_ignores.s:flake8_max_line_length.s:flake8_max_complexity
67
-        silent! grep! %
68
-
69
-        " restore grep settings
70
-        let &grepformat=l:old_gfm
71
-        let &grepprg=l:old_gp
72
-
73
-        " open cwindow
74
-        let has_results=getqflist() != []
75
-        if has_results
76
-            execute 'belowright copen'
77
-            setlocal wrap
78
-            nnoremap <buffer> <silent> c :cclose<CR>
79
-            nnoremap <buffer> <silent> q :cclose<CR>
80
-        endif
81
-
82
-        set nolazyredraw
83
-        redraw!
84
-
85
-        if has_results == 0
86
-            " Show OK status
87
-            hi Green ctermfg=green
88
-            echohl Green
89
-            echon "Flake8 check OK"
90
-            echohl
91
-        endif
92
-    endfunction
93
-endif
94
-
95
-" Add mappings, unless the user didn't want this.
96
-" The default mapping is registered under to <F7> by default, unless the user
97
-" remapped it already (or a mapping exists already for <F7>)
98
-if !exists("no_plugin_maps") && !exists("no_flake8_maps")
99
-    if !hasmapto('Flake8(')
100
-        noremap <buffer> <F7> :call Flake8()<CR>
101
-    endif
102
-endif

+ 0
- 1
dotfiles/vim/bundle/vim-gitgutter

@@ -1 +0,0 @@
1
-Subproject commit c75c83df531881008f8cf903eab7cd68bc19ff7a

+ 0
- 27
dotfiles/vim/bundle/vim-gutentags/.github/ISSUE_TEMPLATE/bug_report.md View File

@@ -1,27 +0,0 @@
1
----
2
-name: Bug report
3
-about: Something's wrong?
4
-
5
----
6
-
7
-**Describe the bug**
8
-Describe what the bug is about, and what you expected. Don't forget to format things nicely with Markdown. If applicable, post screenshots.
9
-
10
-**Steps to reproduce**
11
-1. Do this '...'
12
-2. Do that '...'
13
-3. Etc.
14
-
15
-**Share your setup**
16
-- What OS and version of Vim are you using?
17
-- What version of `ctags`, `gtags`, or whatever do you have installed?
18
-- Are you using `g:gutentags_cache_dir`?
19
-
20
-**Post the logs**
21
-- Run `:let g:gutentags_trace = 1`.
22
-- Reproduce the bug.
23
-- Run `:messages` and show the messages that Gutentags posted.
24
-- Look for the `tags.log` file that Gutentags' script left behind, and post its contents.
25
-
26
-**Additional context**
27
-Add any other context about the problem here.

+ 0
- 1
dotfiles/vim/bundle/vim-gutentags/.gitignore View File

@@ -1 +0,0 @@
1
-doc/tags

+ 0
- 3
dotfiles/vim/bundle/vim-gutentags/.hgignore View File

@@ -1,3 +0,0 @@
1
-syntax:regexp
2
-(^|/)tags$
3
-

+ 0
- 1
dotfiles/vim/bundle/vim-gutentags/.hgtags View File

@@ -1 +0,0 @@
1
-06c496e010b403703643284b12893c1f92b3e756 v1.0.0

+ 0
- 60
dotfiles/vim/bundle/vim-gutentags/CONTRIBUTING.md View File

@@ -1,60 +0,0 @@
1
-
2
-# Contributing
3
-
4
-You're thinking of contributing something to one of my projects? Oh my, I'm
5
-quite honoured! Here's what you need to know.
6
-
7
-
8
-## Writing
9
-
10
-Clone the repository from either [BitBucket][] (if you're into Mercurial) or
11
-[GitHub][] (if you're into Git).
12
-
13
-Next, create a branch for your work -- don't work directly on the `defaut` or
14
-`master` branch. Instead, in Mercurial:
15
-
16
-  $ hg bookmark my-fix
17
-
18
-Or, in Git:
19
-
20
-  $ git checkout -b my-fix master
21
-
22
-Make your changes. Don't write anything that's not related to the fix you're
23
-trying to contribute to the project.
24
-
25
-Write a simple, concise commit message. Gutentags isn't a big piece of code so
26
-no need for strict message formats, so don't get fancy.
27
-
28
-
29
-## Testing
30
-
31
-If you can, try and test your changes on multiple platforms -- Ubuntu, MacOS,
32
-and Windows are supposed to be supported.
33
-
34
-Also try to test your changes with:
35
-
36
-1. `g:gutentags_cache_dir` enabled and disabled.
37
-2. A repository with spaces in its root path.
38
-3. A repository with files and folders that have spaces in them.
39
-
40
-If you're on NeoVim, try and test on a "normal" Vim.
41
-
42
-
43
-## Pushing
44
-
45
-Once everything's fine, go on BitBucket or GitHub (again, depending on your
46
-favorite source control tool) and create a fork if you haven't done so yet. Push
47
-your changes to your fork, and create a pull request. Check the documentation of
48
-either code portal for more information.
49
-
50
-Don't worry if you don't see any reply from me for a while. My turn around time
51
-is measured in weeks, sometimes in months. This is normal -- I've got a job,
52
-a family, and open-source hacking is only one of many awesome hobbies I spend my
53
-limited free time on.
54
-
55
-That's it for now! And thanks a lot for contributing!
56
-
57
-
58
-[bitbucket]: https://bitbucket.org/ludovicchabant/vim-gutentags
59
-[github]: https://github.com/ludovicchabant/vim-gutentags
60
-

+ 0
- 23
dotfiles/vim/bundle/vim-gutentags/LICENSE View File

@@ -1,23 +0,0 @@
1
-
2
-The MIT License (MIT)
3
-
4
-Copyright (c) 2014 Ludovic Chabant
5
-
6
-Permission is hereby granted, free of charge, to any person obtaining a copy
7
-of this software and associated documentation files (the "Software"), to deal
8
-in the Software without restriction, including without limitation the rights
9
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
-copies of the Software, and to permit persons to whom the Software is
11
-furnished to do so, subject to the following conditions:
12
-
13
-The above copyright notice and this permission notice shall be included in
14
-all copies or substantial portions of the Software.
15
-
16
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
-THE SOFTWARE.
23
-

+ 0
- 81
dotfiles/vim/bundle/vim-gutentags/README.md View File

@@ -1,81 +0,0 @@
1
-
2
-# Gutentags
3
-
4
-Gutentags is a plugin that takes care of the much needed management of tags
5
-files in Vim. It will (re)generate tag files as you work while staying
6
-completely out of your way. It will even do its best to keep those tag files
7
-out of your way too. It has no dependencies and just works.
8
-
9
-
10
-## How?
11
-
12
-Install Gutentags like any other Vim plugin. I recommend something like
13
-[Pathogen][], so you can go:
14
-
15
-    cd ~/.vim/bundle
16
-    hg clone https://bitbucket.org/ludovicchabant/vim-gutentags
17
-
18
-If you're more into Git than Mercurial:
19
-
20
-    git clone https://github.com/ludovicchabant/vim-gutentags.git
21
-
22
-Then you only need to do a `:call pathogen#helptags()` to generate the
23
-documentation tags (how ironic, eh?) and you can access Gutentags' help pages
24
-with `help gutentags`.
25
-
26
-
27
-## What?
28
-
29
-In order to generate tag files, Gutentags will have to figure out what's in
30
-your project. To do this, it will locate well-known project root markers like
31
-SCM folders (`.git`, `.hg`, etc.), any custom tags you define (with
32
-`gutentags_project_root`), and even things you may have defined already with
33
-other plugins, like [CtrlP][].
34
-
35
-If the current file you're editing is found to be in such a project, Gutentags
36
-will make sure the tag file for that project is up to date. Then, as you work
37
-in files in that project, it will partially re-generate the tag file. Every
38
-time you save, it will silently, in the background, update the tags for that
39
-file.
40
-
41
-Usually, ctags can only append tags to an existing tag file, so Gutentags
42
-removes the tags for the current file first, to make sure the tag file is
43
-always consistent with the source code.
44
-
45
-Also, Gutentags is clever enough to not stumble upon itself by triggering
46
-multiple ctags processes if you save files too fast, or your project is really
47
-big.
48
-
49
-
50
-## Why?
51
-
52
-There are some similar Vim plugins out there ("vim-tags", "vim-autotag",
53
-"vim-automatic-ctags", etc.). They all fail on one or more of the requirements
54
-I set for myself with Gutentags:
55
-
56
-* No other dependency than running Vim: no Python, Ruby, or whatever.
57
-* Cross-platform: should work on at least Ubuntu, Mac, and Windows.
58
-* Incremental tags generation: don't re-generate the whole project all the time.
59
-  This may be fine for small projects, but it doesn't scale.
60
-* External process management: if the ctags process is taking a long time, don't
61
-  run another one because I saved a file again.
62
-* Keep the tag file consistent: don't just append the current file's tags to the
63
-  tag file, otherwise you will still "see" tags for deleted or renamed classes
64
-  and functions.
65
-* Automatically create the tag file: you open something from a freshly forked
66
-  project, it should start indexing it automatically, just like in Sublime Text
67
-  or Visual Studio or any other IDE.
68
-
69
-I hope Gutentags will bring you as much closure as me regarding tag files. I know
70
-I don't want to have to think about it, and probably neither do you.
71
-
72
-
73
-# Related Projects
74
-
75
-* [gutentags_plus](https://github.com/skywind3000/gutentags_plus): handles
76
-  switching between `cscope` databases automatically before performing a search
77
-  query.
78
-
79
-[Pathogen]: https://github.com/tpope/vim-pathogen
80
-[ctrlp]: https://github.com/kien/ctrlp.vim
81
-

+ 0
- 705
dotfiles/vim/bundle/vim-gutentags/autoload/gutentags.vim View File

@@ -1,705 +0,0 @@
1
-" gutentags.vim - Automatic ctags management for Vim
2
-
3
-" Utilities {{{
4
-
5
-function! gutentags#chdir(path)
6
-    if has('nvim')
7
-        let chdir = haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd'
8
-    else
9
-        let chdir = haslocaldir() ? 'lcd' : 'cd'
10
-    endif
11
-    execute chdir a:path
12
-endfunction
13
-
14
-" Throw an exception message.
15
-function! gutentags#throw(message)
16
-    throw "gutentags: " . a:message
17
-endfunction
18
-
19
-" Show an error message.
20
-function! gutentags#error(message)
21
-    let v:errmsg = "gutentags: " . a:message
22
-    echoerr v:errmsg
23
-endfunction
24
-
25
-" Show a warning message.
26
-function! gutentags#warning(message)
27
-    echohl WarningMsg
28
-    echom "gutentags: " . a:message
29
-    echohl None
30
-endfunction
31
-
32
-" Prints a message if debug tracing is enabled.
33
-function! gutentags#trace(message, ...)
34
-    if g:gutentags_trace || (a:0 && a:1)
35
-        let l:message = "gutentags: " . a:message
36
-        echom l:message
37
-    endif
38
-endfunction
39
-
40
-" Strips the ending slash in a path.
41
-function! gutentags#stripslash(path)
42
-    return fnamemodify(a:path, ':s?[/\\]$??')
43
-endfunction
44
-
45
-" Normalizes the slashes in a path.
46
-function! gutentags#normalizepath(path)
47
-    if exists('+shellslash') && &shellslash
48
-        return substitute(a:path, '\v/', '\\', 'g')
49
-    elseif has('win32')
50
-        return substitute(a:path, '\v/', '\\', 'g')
51
-    else
52
-        return a:path
53
-    endif
54
-endfunction
55
-
56
-" Shell-slashes the path (opposite of `normalizepath`).
57
-function! gutentags#shellslash(path)
58
-    if exists('+shellslash') && !&shellslash
59
-        return substitute(a:path, '\v\\', '/', 'g')
60
-    else
61
-        return a:path
62
-    endif
63
-endfunction
64
-
65
-" Gets a file path in the correct `plat` folder.
66
-function! gutentags#get_plat_file(filename) abort
67
-    return g:gutentags_plat_dir . a:filename . g:gutentags_script_ext
68
-endfunction
69
-
70
-" Gets a file path in the resource folder.
71
-function! gutentags#get_res_file(filename) abort
72
-    return g:gutentags_res_dir . a:filename
73
-endfunction
74
-
75
-" Generate a path for a given filename in the cache directory.
76
-function! gutentags#get_cachefile(root_dir, filename) abort
77
-    if gutentags#is_path_rooted(a:filename)
78
-        return a:filename
79
-    endif
80
-    let l:tag_path = gutentags#stripslash(a:root_dir) . '/' . a:filename
81
-    if g:gutentags_cache_dir != ""
82
-        " Put the tag file in the cache dir instead of inside the
83
-        " project root.
84
-        let l:tag_path = g:gutentags_cache_dir . '/' .
85
-                    \tr(l:tag_path, '\/: ', '---_')
86
-        let l:tag_path = substitute(l:tag_path, '/\-', '/', '')
87
-        let l:tag_path = substitute(l:tag_path, '[\-_]*$', '', '')
88
-    endif
89
-    let l:tag_path = gutentags#normalizepath(l:tag_path)
90
-    return l:tag_path
91
-endfunction
92
-
93
-" Makes sure a given command starts with an executable that's in the PATH.
94
-function! gutentags#validate_cmd(cmd) abort
95
-    if !empty(a:cmd) && executable(split(a:cmd)[0])
96
-        return a:cmd
97
-    endif
98
-    return ""
99
-endfunction
100
-
101
-" Makes an appropriate command line for use with `job_start` by converting
102
-" a list of possibly quoted arguments into a single string on Windows, or
103
-" into a list of unquoted arguments on Unix/Mac.
104
-if has('win32') || has('win64')
105
-    function! gutentags#make_args(cmd) abort
106
-        return join(a:cmd, ' ')
107
-    endfunction
108
-else
109
-    function! gutentags#make_args(cmd) abort
110
-        let l:outcmd = []
111
-        for cmdarg in a:cmd
112
-            " Thanks Vimscript... you can use negative integers for strings
113
-            " in the slice notation, but not for indexing characters :(
114
-            let l:arglen = strlen(cmdarg)
115
-            if (cmdarg[0] == '"' && cmdarg[l:arglen - 1] == '"') || 
116
-                        \(cmdarg[0] == "'" && cmdarg[l:arglen - 1] == "'")
117
-                call add(l:outcmd, cmdarg[1:-2])
118
-            else
119
-                call add(l:outcmd, cmdarg)
120
-            endif
121
-        endfor
122
-        return l:outcmd
123
-    endfunction
124
-endif
125
-
126
-" Returns whether a path is rooted.
127
-if has('win32') || has('win64')
128
-    function! gutentags#is_path_rooted(path) abort
129
-        return len(a:path) >= 2 && (
130
-                    \a:path[0] == '/' || a:path[0] == '\' || a:path[1] == ':')
131
-    endfunction
132
-else
133
-    function! gutentags#is_path_rooted(path) abort
134
-        return !empty(a:path) && a:path[0] == '/'
135
-    endfunction
136
-endif
137
-
138
-" }}}
139
-
140
-" Gutentags Setup {{{
141
-
142
-let s:known_files = []
143
-let s:known_projects = {}
144
-
145
-function! s:cache_project_root(path) abort
146
-    let l:result = {}
147
-
148
-    for proj_info in g:gutentags_project_info
149
-        let l:filematch = get(proj_info, 'file', '')
150
-        if l:filematch != '' && filereadable(a:path . '/'. l:filematch)
151
-            let l:result = copy(proj_info)
152
-            break
153
-        endif
154
-
155
-        let l:globmatch = get(proj_info, 'glob', '')
156
-        if l:globmatch != '' && glob(a:path . '/' . l:globmatch) != ''
157
-            let l:result = copy(proj_info)
158
-            break
159
-        endif
160
-    endfor
161
-
162
-    let s:known_projects[a:path] = l:result
163
-endfunction
164
-
165
-function! gutentags#get_project_file_list_cmd(path) abort
166
-    if type(g:gutentags_file_list_command) == type("")
167
-        return gutentags#validate_cmd(g:gutentags_file_list_command)
168
-    elseif type(g:gutentags_file_list_command) == type({})
169
-        let l:markers = get(g:gutentags_file_list_command, 'markers', [])
170
-        if type(l:markers) == type({})
171
-            for [marker, file_list_cmd] in items(l:markers)
172
-                if !empty(globpath(a:path, marker, 1))
173
-                    return gutentags#validate_cmd(file_list_cmd)
174
-                endif
175
-            endfor
176
-        endif
177
-        return get(g:gutentags_file_list_command, 'default', "")
178
-    endif
179
-    return ""
180
-endfunction
181
-
182
-" Finds the first directory with a project marker by walking up from the given
183
-" file path.
184
-function! gutentags#get_project_root(path) abort
185
-    if g:gutentags_project_root_finder != ''
186
-        return call(g:gutentags_project_root_finder, [a:path])
187
-    endif
188
-    return gutentags#default_get_project_root(a:path)
189
-endfunction
190
-
191
-" Default implementation for finding project markers... useful when a custom
192
-" finder (`g:gutentags_project_root_finder`) wants to fallback to the default
193
-" behaviour.
194
-function! gutentags#default_get_project_root(path) abort
195
-    let l:path = gutentags#stripslash(a:path)
196
-    let l:previous_path = ""
197
-    let l:markers = g:gutentags_project_root[:]
198
-    if g:gutentags_add_ctrlp_root_markers && exists('g:ctrlp_root_markers')
199
-        for crm in g:ctrlp_root_markers
200
-            if index(l:markers, crm) < 0
201
-                call add(l:markers, crm)
202
-            endif
203
-        endfor
204
-    endif
205
-    while l:path != l:previous_path
206
-        for root in l:markers
207
-            if !empty(globpath(l:path, root, 1))
208
-                let l:proj_dir = simplify(fnamemodify(l:path, ':p'))
209
-                let l:proj_dir = gutentags#stripslash(l:proj_dir)
210
-                if l:proj_dir == ''
211
-                    call gutentags#trace("Found project marker '" . root .
212
-                                \"' at the root of your file-system! " .
213
-                                \" That's probably wrong, disabling " .
214
-                                \"gutentags for this file...",
215
-                                \1)
216
-                    call gutentags#throw("Marker found at root, aborting.")
217
-                endif
218
-                for ign in g:gutentags_exclude_project_root
219
-                    if l:proj_dir == ign
220
-                        call gutentags#trace(
221
-                                    \"Ignoring project root '" . l:proj_dir .
222
-                                    \"' because it is in the list of ignored" .
223
-                                    \" projects.")
224
-                        call gutentags#throw("Ignore project: " . l:proj_dir)
225
-                    endif
226
-                endfor
227
-                return l:proj_dir
228
-            endif
229
-        endfor
230
-        let l:previous_path = l:path
231
-        let l:path = fnamemodify(l:path, ':h')
232
-    endwhile
233
-    call gutentags#throw("Can't figure out what tag file to use for: " . a:path)
234
-endfunction
235
-
236
-" Get info on the project we're inside of.
237
-function! gutentags#get_project_info(path) abort
238
-    return get(s:known_projects, a:path, {})
239
-endfunction
240
-
241
-" Setup gutentags for the current buffer.
242
-function! gutentags#setup_gutentags() abort
243
-    if exists('b:gutentags_files') && !g:gutentags_debug
244
-        " This buffer already has gutentags support.
245
-        return
246
-    endif
247
-
248
-    " Don't setup gutentags for anything that's not a normal buffer
249
-    " (so don't do anything for help buffers and quickfix windows and
250
-    "  other such things)
251
-    " Also don't do anything for the default `[No Name]` buffer you get
252
-    " after starting Vim.
253
-    if &buftype != '' || 
254
-          \(bufname('%') == '' && !g:gutentags_generate_on_empty_buffer)
255
-        return
256
-    endif
257
-
258
-    " Don't setup gutentags for things that don't need it, or that could
259
-    " cause problems.
260
-    if index(g:gutentags_exclude_filetypes, &filetype) >= 0
261
-        return
262
-    endif
263
-
264
-    " Let the user specify custom ways to disable Gutentags.
265
-    if g:gutentags_init_user_func != '' &&
266
-                \!call(g:gutentags_init_user_func, [expand('%:p')])
267
-        call gutentags#trace("Ignoring '" . bufname('%') . "' because of " .
268
-                    \"custom user function.")
269
-        return
270
-    endif
271
-
272
-    " Try and find what tags file we should manage.
273
-    call gutentags#trace("Scanning buffer '" . bufname('%') . "' for gutentags setup...")
274
-    try
275
-        let l:buf_dir = expand('%:p:h', 1)
276
-        if g:gutentags_resolve_symlinks
277
-            let l:buf_dir = fnamemodify(resolve(expand('%:p', 1)), ':p:h')
278
-        endif
279
-        if !exists('b:gutentags_root')
280
-            let b:gutentags_root = gutentags#get_project_root(l:buf_dir)
281
-        endif
282
-        if !len(b:gutentags_root)
283
-            call gutentags#trace("no valid project root.. no gutentags support.")
284
-            return
285
-        endif
286
-        if filereadable(b:gutentags_root . '/.notags')
287
-            call gutentags#trace("'.notags' file found... no gutentags support.")
288
-            return
289
-        endif
290
-
291
-        if !has_key(s:known_projects, b:gutentags_root)
292
-            call s:cache_project_root(b:gutentags_root)
293
-        endif
294
-        if g:gutentags_trace
295
-            let l:projnfo = gutentags#get_project_info(b:gutentags_root)
296
-            if l:projnfo != {}
297
-                call gutentags#trace("Setting project type to ".l:projnfo['type'])
298
-            else
299
-                call gutentags#trace("No specific project type.")
300
-            endif
301
-        endif
302
-
303
-        let b:gutentags_files = {}
304
-        for module in g:gutentags_modules
305
-            call call("gutentags#".module."#init", [b:gutentags_root])
306
-        endfor
307
-    catch /^gutentags\:/
308
-        call gutentags#trace("No gutentags support for this buffer.")
309
-        return
310
-    endtry
311
-
312
-    " We know what tags file to manage! Now set things up.
313
-    call gutentags#trace("Setting gutentags for buffer '".bufname('%')."'")
314
-
315
-    " Autocommands for updating the tags on save.
316
-    " We need to pass the buffer number to the callback function in the rare
317
-    " case that the current buffer is changed by another `BufWritePost`
318
-    " callback. This will let us get that buffer's variables without causing
319
-    " errors.
320
-    let l:bn = bufnr('%')
321
-    execute 'augroup gutentags_buffer_' . l:bn
322
-    execute '  autocmd!'
323
-    execute '  autocmd BufWritePost <buffer=' . l:bn . '> call s:write_triggered_update_tags(' . l:bn . ')'
324
-    execute 'augroup end'
325
-
326
-    " Miscellaneous commands.
327
-    command! -buffer -bang GutentagsUpdate :call s:manual_update_tags(<bang>0)
328
-
329
-    " Add these tags files to the known tags files.
330
-    for module in keys(b:gutentags_files)
331
-        let l:tagfile = b:gutentags_files[module]
332
-        let l:found = index(s:known_files, l:tagfile)
333
-        if l:found < 0
334
-            call add(s:known_files, l:tagfile)
335
-
336
-            " Generate this new file depending on settings and stuff.
337
-            if g:gutentags_enabled
338
-                if g:gutentags_generate_on_missing && !filereadable(l:tagfile)
339
-                    call gutentags#trace("Generating missing tags file: " . l:tagfile)
340
-                    call s:update_tags(l:bn, module, 1, 1)
341
-                elseif g:gutentags_generate_on_new
342
-                    call gutentags#trace("Generating tags file: " . l:tagfile)
343
-                    call s:update_tags(l:bn, module, 1, 1)
344
-                endif
345
-            endif
346
-        endif
347
-    endfor
348
-endfunction
349
-
350
-" }}}
351
-
352
-"  Job Management {{{
353
-
354
-" List of queued-up jobs, and in-progress jobs, per module.
355
-let s:update_queue = {}
356
-let s:update_in_progress = {}
357
-for module in g:gutentags_modules
358
-    let s:update_queue[module] = []
359
-    let s:update_in_progress[module] = []
360
-endfor
361
-
362
-function! gutentags#add_job(module, tags_file, data) abort
363
-    call add(s:update_in_progress[a:module], [a:tags_file, a:data])
364
-endfunction
365
-
366
-function! gutentags#find_job_index_by_tags_file(module, tags_file) abort
367
-    let l:idx = -1
368
-    for upd_info in s:update_in_progress[a:module]
369
-        let l:idx += 1
370
-        if upd_info[0] == a:tags_file
371
-            return l:idx
372
-        endif
373
-    endfor
374
-    return -1
375
-endfunction
376
-
377
-function! gutentags#find_job_index_by_data(module, data) abort
378
-    let l:idx = -1
379
-    for upd_info in s:update_in_progress[a:module]
380
-        let l:idx += 1
381
-        if upd_info[1] == a:data
382
-            return l:idx
383
-        endif
384
-    endfor
385
-    return -1
386
-endfunction
387
-
388
-function! gutentags#get_job_tags_file(module, job_idx) abort
389
-    return s:update_in_progress[a:module][a:job_idx][0]
390
-endfunction
391
-
392
-function! gutentags#get_job_data(module, job_idx) abort
393
-    return s:update_in_progress[a:module][a:job_idx][1]
394
-endfunction
395
-
396
-function! gutentags#remove_job(module, job_idx) abort
397
-    let l:tags_file = s:update_in_progress[a:module][a:job_idx][0]
398
-    call remove(s:update_in_progress[a:module], a:job_idx)
399
-
400
-    " Run the user callback for finished jobs.
401
-    silent doautocmd User GutentagsUpdated
402
-
403
-    " See if we had any more updates queued up for this.
404
-    let l:qu_idx = -1
405
-    for qu_info in s:update_queue[a:module]
406
-        let l:qu_idx += 1
407
-        if qu_info[0] == l:tags_file
408
-            break
409
-        endif
410
-    endfor
411
-    if l:qu_idx >= 0
412
-        let l:qu_info = s:update_queue[a:module][l:qu_idx]
413
-        call remove(s:update_queue[a:module], l:qu_idx)
414
-
415
-        if bufexists(l:qu_info[1])
416
-            call gutentags#trace("Finished ".a:module." job, ".
417
-                        \"running queued update for '".l:tags_file."'.")
418
-            call s:update_tags(l:qu_info[1], a:module, l:qu_info[2], 2)
419
-        else
420
-            call gutentags#trace("Finished ".a:module." job, ".
421
-                        \"but skipping queued update for '".l:tags_file."' ".
422
-                        \"because originating buffer doesn't exist anymore.")
423
-        endif
424
-    else
425
-        call gutentags#trace("Finished ".a:module." job.")
426
-    endif
427
-endfunction
428
-
429
-function! gutentags#remove_job_by_data(module, data) abort
430
-    let l:idx = gutentags#find_job_index_by_data(a:module, a:data)
431
-    call gutentags#remove_job(a:module, l:idx)
432
-endfunction
433
-
434
-" }}}
435
-
436
-"  Tags File Management {{{
437
-
438
-" (Re)Generate the tags file for the current buffer's file.
439
-function! s:manual_update_tags(bang) abort
440
-    let l:restore_prev_trace = 0
441
-    let l:prev_trace = g:gutentags_trace
442
-    if &verbose > 0
443
-        let g:gutentags_trace = 1
444
-        let l:restore_prev_trace = 1
445
-    endif
446
-
447
-    try
448
-        let l:bn = bufnr('%')
449
-        for module in g:gutentags_modules
450
-            call s:update_tags(l:bn, module, a:bang, 0)
451
-        endfor
452
-        silent doautocmd User GutentagsUpdating
453
-    finally
454
-        if l:restore_prev_trace
455
-            let g:gutentags_trace = l:prev_trace
456
-        endif
457
-    endtry
458
-endfunction
459
-
460
-" (Re)Generate the tags file for a buffer that just go saved.
461
-function! s:write_triggered_update_tags(bufno) abort
462
-    if g:gutentags_enabled && g:gutentags_generate_on_write
463
-        for module in g:gutentags_modules
464
-            call s:update_tags(a:bufno, module, 0, 2)
465
-        endfor
466
-    endif
467
-    silent doautocmd User GutentagsUpdating
468
-endfunction
469
-
470
-" Update the tags file for the current buffer's file.
471
-" write_mode:
472
-"   0: update the tags file if it exists, generate it otherwise.
473
-"   1: always generate (overwrite) the tags file.
474
-"
475
-" queue_mode:
476
-"   0: if an update is already in progress, report it and abort.
477
-"   1: if an update is already in progress, abort silently.
478
-"   2: if an update is already in progress, queue another one.
479
-function! s:update_tags(bufno, module, write_mode, queue_mode) abort
480
-    " Figure out where to save.
481
-    let l:buf_gutentags_files = getbufvar(a:bufno, 'gutentags_files')
482
-    let l:tags_file = l:buf_gutentags_files[a:module]
483
-    let l:proj_dir = getbufvar(a:bufno, 'gutentags_root')
484
-
485
-    " Check that there's not already an update in progress.
486
-    let l:in_progress_idx = gutentags#find_job_index_by_tags_file(
487
-                \a:module, l:tags_file)
488
-    if l:in_progress_idx >= 0
489
-        if a:queue_mode == 2
490
-            let l:needs_queuing = 1
491
-            for qu_info in s:update_queue[a:module]
492
-                if qu_info[0] == l:tags_file
493
-                    let l:needs_queuing = 0
494
-                    break
495
-                endif
496
-            endfor
497
-            if l:needs_queuing
498
-                call add(s:update_queue[a:module], 
499
-                            \[l:tags_file, a:bufno, a:write_mode])
500
-            endif
501
-            call gutentags#trace("Tag file '" . l:tags_file . 
502
-                        \"' is already being updated. Queuing it up...")
503
-        elseif a:queue_mode == 1
504
-            call gutentags#trace("Tag file '" . l:tags_file .
505
-                        \"' is already being updated. Skipping...")
506
-        elseif a:queue_mode == 0
507
-            echom "gutentags: The tags file is already being updated, " .
508
-                        \"please try again later."
509
-        else
510
-            call gutentags#throw("Unknown queue mode: " . a:queue_mode)
511
-        endif
512
-
513
-        " Don't update the tags right now.
514
-        return
515
-    endif
516
-
517
-    " Switch to the project root to make the command line smaller, and make
518
-    " it possible to get the relative path of the filename to parse if we're
519
-    " doing an incremental update.
520
-    let l:prev_cwd = getcwd()
521
-    call gutentags#chdir(fnameescape(l:proj_dir))
522
-    try
523
-        call call("gutentags#".a:module."#generate",
524
-                    \[l:proj_dir, l:tags_file,
525
-                    \ {
526
-                    \   'write_mode': a:write_mode,
527
-                    \ }])
528
-    catch /^gutentags\:/
529
-        echom "Error while generating ".a:module." file:"
530
-        echom v:exception
531
-    finally
532
-        " Restore the current directory...
533
-        call gutentags#chdir(fnameescape(l:prev_cwd))
534
-    endtry
535
-endfunction
536
-
537
-" }}}
538
-
539
-" Utility Functions {{{
540
-
541
-function! gutentags#rescan(...)
542
-    if exists('b:gutentags_files')
543
-        unlet b:gutentags_files
544
-    endif
545
-    if a:0 && a:1
546
-        let l:trace_backup = g:gutentags_trace
547
-        let l:gutentags_trace = 1
548
-    endif
549
-    call gutentags#setup_gutentags()
550
-    if a:0 && a:1
551
-        let g:gutentags_trace = l:trace_backup
552
-    endif
553
-endfunction
554
-
555
-function! gutentags#toggletrace(...)
556
-    let g:gutentags_trace = !g:gutentags_trace
557
-    if a:0 > 0
558
-        let g:gutentags_trace = a:1
559
-    endif
560
-    if g:gutentags_trace
561
-        echom "gutentags: Tracing is enabled."
562
-    else
563
-        echom "gutentags: Tracing is disabled."
564
-    endif
565
-    echom ""
566
-endfunction
567
-
568
-function! gutentags#fake(...)
569
-    let g:gutentags_fake = !g:gutentags_fake
570
-    if a:0 > 0
571
-        let g:gutentags_fake = a:1
572
-    endif
573
-    if g:gutentags_fake
574
-        echom "gutentags: Now faking gutentags."
575
-    else
576
-        echom "gutentags: Now running gutentags for real."
577
-    endif
578
-    echom ""
579
-endfunction
580
-
581
-function! gutentags#default_io_cb(chan, msg) abort
582
-    call gutentags#trace('[job output]: '.string(a:msg))
583
-endfunction
584
-
585
-if has('nvim')
586
-    " Neovim job API.
587
-    function! s:nvim_job_exit_wrapper(real_cb, job, exit_code, event_type) abort
588
-        call call(a:real_cb, [a:job, a:exit_code])
589
-    endfunction
590
-
591
-    function! s:nvim_job_out_wrapper(real_cb, job, lines, event_type) abort
592
-        call call(a:real_cb, [a:job, a:lines])
593
-    endfunction
594
-
595
-    function! gutentags#build_default_job_options(module) abort
596
-       " Neovim kills jobs on exit, which is what we want.
597
-       let l:job_opts = {
598
-                \'on_exit': function(
599
-                \    '<SID>nvim_job_exit_wrapper',
600
-                \    ['gutentags#'.a:module.'#on_job_exit']),
601
-                \'on_stdout': function(
602
-                \    '<SID>nvim_job_out_wrapper',
603
-                \    ['gutentags#default_io_cb']),
604
-                \'on_stderr': function(
605
-                \    '<SID>nvim_job_out_wrapper',
606
-                \    ['gutentags#default_io_cb'])
607
-                \}
608
-       return l:job_opts
609
-    endfunction
610
-
611
-    function! gutentags#start_job(cmd, opts) abort
612
-        return jobstart(a:cmd, a:opts)
613
-    endfunction
614
-else
615
-    " Vim8 job API.
616
-    function! gutentags#build_default_job_options(module) abort
617
-        let l:job_opts = {
618
-                 \'exit_cb': 'gutentags#'.a:module.'#on_job_exit',
619
-                 \'out_cb': 'gutentags#default_io_cb',
620
-                 \'err_cb': 'gutentags#default_io_cb',
621
-                 \'stoponexit': 'term'
622
-                 \}
623
-        return l:job_opts
624
-    endfunction
625
-
626
-    function! gutentags#start_job(cmd, opts) abort
627
-        return job_start(a:cmd, a:opts)
628
-    endfunction
629
-endif
630
-
631
-" Returns which modules are currently generating something for the
632
-" current buffer.
633
-function! gutentags#inprogress()
634
-    " Does this buffer have gutentags enabled?
635
-    if !exists('b:gutentags_files')
636
-        return []
637
-    endif
638
-
639
-    " Find any module that has a job in progress for any of this buffer's
640
-    " tags files.
641
-    let l:modules_in_progress = []
642
-    for [module, tags_file] in items(b:gutentags_files)
643
-        let l:jobidx = gutentags#find_job_index_by_tags_file(module, tags_file)
644
-        if l:jobidx >= 0
645
-            call add(l:modules_in_progress, module)
646
-        endif
647
-    endfor
648
-    return l:modules_in_progress
649
-endfunction
650
-
651
-" }}}
652
-
653
-" Statusline Functions {{{
654
-
655
-" Prints whether a tag file is being generated right now for the current
656
-" buffer in the status line.
657
-"
658
-" Arguments can be passed:
659
-" - args 1 and 2 are the prefix and suffix, respectively, of whatever output,
660
-"   if any, is going to be produced.
661
-"   (defaults to empty strings)
662
-" - arg 3 is the text to be shown if tags are currently being generated.
663
-"   (defaults to the name(s) of the modules currently generating).
664
-
665
-function! gutentags#statusline(...) abort
666
-    let l:modules_in_progress = gutentags#inprogress()
667
-    if empty(l:modules_in_progress)
668
-       return ''
669
-    endif
670
-
671
-    let l:prefix = ''
672
-    let l:suffix = ''
673
-    if a:0 > 0
674
-       let l:prefix = a:1
675
-    endif
676
-    if a:0 > 1
677
-       let l:suffix = a:2
678
-    endif
679
-
680
-    if a:0 > 2
681
-       let l:genmsg = a:3
682
-    else
683
-       let l:genmsg = join(l:modules_in_progress, ',')
684
-    endif
685
-
686
-    return l:prefix.l:genmsg.l:suffix
687
-endfunction
688
-
689
-" Same as `gutentags#statusline`, but the only parameter is a `Funcref` or
690
-" function name that will get passed the list of modules currently generating
691
-" something. This formatter function should return the string to display in
692
-" the status line.
693
-
694
-function! gutentags#statusline_cb(fmt_cb, ...) abort
695
-    let l:modules_in_progress = gutentags#inprogress()
696
-
697
-    if (a:0 == 0 || !a:1) && empty(l:modules_in_progress)
698
-       return ''
699
-    endif
700
-
701
-    return call(a:fmt_cb, [l:modules_in_progress])
702
-endfunction
703
-
704
-" }}}
705
-

+ 0
- 93
dotfiles/vim/bundle/vim-gutentags/autoload/gutentags/cscope.vim View File

@@ -1,93 +0,0 @@
1
-" Cscope module for Gutentags
2
-
3
-if !has('cscope')
4
-    throw "Can't enable the cscope module for Gutentags, this Vim has ".
5
-                \"no support for cscope files."
6
-endif
7
-
8
-" Global Options {{{
9
-
10
-if !exists('g:gutentags_cscope_executable')
11
-    let g:gutentags_cscope_executable = 'cscope'
12
-endif
13
-
14
-if !exists('g:gutentags_scopefile')
15
-    let g:gutentags_scopefile = 'cscope.out'
16
-endif
17
-
18
-if !exists('g:gutentags_auto_add_cscope')
19
-    let g:gutentags_auto_add_cscope = 1
20
-endif
21
-
22
-if !exists('g:gutentags_cscope_build_inverted_index')
23
-    let g:gutentags_cscope_build_inverted_index = 0
24
-endif
25
-
26
-" }}}
27
-
28
-" Gutentags Module Interface {{{
29
-
30
-let s:runner_exe = gutentags#get_plat_file('update_scopedb')
31
-let s:unix_redir = (&shellredir =~# '%s') ? &shellredir : &shellredir . ' %s'
32
-let s:added_dbs = []
33
-
34
-function! gutentags#cscope#init(project_root) abort
35
-    let l:dbfile_path = gutentags#get_cachefile(
36
-                \a:project_root, g:gutentags_scopefile)
37
-    let b:gutentags_files['cscope'] = l:dbfile_path
38
-
39
-    if g:gutentags_auto_add_cscope && filereadable(l:dbfile_path)
40
-        if index(s:added_dbs, l:dbfile_path) < 0
41
-            call add(s:added_dbs, l:dbfile_path)
42
-            silent! execute 'cs add ' . fnameescape(l:dbfile_path)
43
-        endif
44
-    endif
45
-endfunction
46
-
47
-function! gutentags#cscope#generate(proj_dir, tags_file, gen_opts) abort
48
-    let l:cmd = [s:runner_exe]
49
-    let l:cmd += ['-e', g:gutentags_cscope_executable]
50
-    let l:cmd += ['-p', a:proj_dir]
51
-    let l:cmd += ['-f', a:tags_file]
52
-    let l:file_list_cmd =
53
-        \ gutentags#get_project_file_list_cmd(a:proj_dir)
54
-    if !empty(l:file_list_cmd)
55
-        let l:cmd += ['-L', '"' . l:file_list_cmd . '"']
56
-    endif
57
-    if g:gutentags_cscope_build_inverted_index
58
-        let l:cmd += ['-I']
59
-    endif
60
-    let l:cmd = gutentags#make_args(l:cmd)
61
-
62
-    call gutentags#trace("Running: " . string(l:cmd))
63
-    call gutentags#trace("In:      " . getcwd())
64
-    if !g:gutentags_fake
65
-		let l:job_opts = gutentags#build_default_job_options('cscope')
66
-        let l:job = gutentags#start_job(l:cmd, l:job_opts)
67
-        call gutentags#add_job('cscope', a:tags_file, l:job)
68
-    else
69
-        call gutentags#trace("(fake... not actually running)")
70
-    endif
71
-endfunction
72
-
73
-function! gutentags#cscope#on_job_exit(job, exit_val) abort
74
-    let l:job_idx = gutentags#find_job_index_by_data('cscope', a:job)
75
-    let l:dbfile_path = gutentags#get_job_tags_file('cscope', l:job_idx)
76
-    call gutentags#remove_job('cscope', l:job_idx)
77
-
78
-    if a:exit_val == 0
79
-        if index(s:added_dbs, l:dbfile_path) < 0
80
-            call add(s:added_dbs, l:dbfile_path)
81
-            silent! execute 'cs add ' . fnameescape(l:dbfile_path)
82
-        else
83
-            silent! execute 'cs reset'
84
-        endif
85
-    else
86
-        call gutentags#warning(
87
-                    \"cscope job failed, returned: ".
88
-                    \string(a:exit_val))
89
-    endif
90
-endfunction
91
-
92
-" }}}
93
-

+ 0
- 294
dotfiles/vim/bundle/vim-gutentags/autoload/gutentags/ctags.vim View File

@@ -1,294 +0,0 @@
1
-" Ctags module for Gutentags
2
-
3
-" Global Options {{{
4
-
5
-let g:gutentags_ctags_executable = get(g:, 'gutentags_ctags_executable', 'ctags')
6
-let g:gutentags_ctags_tagfile = get(g:, 'gutentags_ctags_tagfile', 'tags')
7
-let g:gutentags_ctags_auto_set_tags = get(g:, 'gutentags_ctags_auto_set_tags', 1)
8
-
9
-let g:gutentags_ctags_options_file = get(g:, 'gutentags_ctags_options_file', '.gutctags')
10
-let g:gutentags_ctags_check_tagfile = get(g:, 'gutentags_ctags_check_tagfile', 0)
11
-let g:gutentags_ctags_extra_args = get(g:, 'gutentags_ctags_extra_args', [])
12
-let g:gutentags_ctags_post_process_cmd = get(g:, 'gutentags_ctags_post_process_cmd', '')
13
-
14
-let g:gutentags_ctags_exclude = get(g:, 'gutentags_ctags_exclude', [])
15
-let g:gutentags_ctags_exclude_wildignore = get(g:, 'gutentags_ctags_exclude_wildignore', 1)
16
-
17
-" Backwards compatibility.
18
-function! s:_handleOldOptions() abort
19
-    let l:renamed_options = {
20
-                \'gutentags_exclude': 'gutentags_ctags_exclude',
21
-                \'gutentags_tagfile': 'gutentags_ctags_tagfile',
22
-                \'gutentags_auto_set_tags': 'gutentags_ctags_auto_set_tags'
23
-                \}
24
-    for key in keys(l:renamed_options)
25
-        if exists('g:'.key)
26
-            let newname = l:renamed_options[key]
27
-            echom "gutentags: Option 'g:'".key." has been renamed to ".
28
-                        \"'g:'".newname." Please update your vimrc."
29
-            let g:[newname] = g:[key]
30
-        endif
31
-    endfor
32
-endfunction
33
-call s:_handleOldOptions()
34
-" }}}
35
-
36
-" Gutentags Module Interface {{{
37
-
38
-let s:did_check_exe = 0
39
-let s:runner_exe = gutentags#get_plat_file('update_tags')
40
-let s:unix_redir = (&shellredir =~# '%s') ? &shellredir : &shellredir . ' %s'
41
-let s:wildignores_options_path = ''
42
-let s:last_wildignores = ''
43
-
44
-function! gutentags#ctags#init(project_root) abort
45
-    " Figure out the path to the tags file.
46
-    " Check the old name for this option, too, before falling back to the
47
-    " globally defined name.
48
-    let l:tagfile = getbufvar("", 'gutentags_ctags_tagfile',
49
-                \getbufvar("", 'gutentags_tagfile', 
50
-                \g:gutentags_ctags_tagfile))
51
-    let b:gutentags_files['ctags'] = gutentags#get_cachefile(
52
-                \a:project_root, l:tagfile)
53
-
54
-    " Set the tags file for Vim to use.
55
-    if g:gutentags_ctags_auto_set_tags
56
-        execute 'setlocal tags^=' . fnameescape(b:gutentags_files['ctags'])
57
-    endif
58
-
59
-    " Check if the ctags executable exists.
60
-    if s:did_check_exe == 0
61
-        if g:gutentags_enabled && executable(expand(g:gutentags_ctags_executable, 1)) == 0
62
-            let g:gutentags_enabled = 0
63
-            echoerr "Executable '".g:gutentags_ctags_executable."' can't be found. "
64
-                        \."Gutentags will be disabled. You can re-enable it by "
65
-                        \."setting g:gutentags_enabled back to 1."
66
-        endif
67
-        let s:did_check_exe = 1
68
-    endif
69
-endfunction
70
-
71
-function! gutentags#ctags#generate(proj_dir, tags_file, gen_opts) abort
72
-    let l:write_mode = a:gen_opts['write_mode']
73
-
74
-    let l:tags_file_exists = filereadable(a:tags_file)
75
-    let l:tags_file_relative = fnamemodify(a:tags_file, ':.')
76
-    let l:tags_file_is_local = len(l:tags_file_relative) < len(a:tags_file)
77
-
78
-    if l:tags_file_exists && g:gutentags_ctags_check_tagfile
79
-        let l:first_lines = readfile(a:tags_file, '', 1)
80
-        if len(l:first_lines) == 0 || stridx(l:first_lines[0], '!_TAG_') != 0
81
-            call gutentags#throw(
82
-                        \"File ".a:tags_file." doesn't appear to be ".
83
-                        \"a ctags file. Please delete it and run ".
84
-                        \":GutentagsUpdate!.")
85
-            return
86
-        endif
87
-    endif
88
-
89
-    if empty(g:gutentags_cache_dir) && l:tags_file_is_local
90
-        " If we don't use the cache directory, we can pass relative paths
91
-        " around.
92
-        "
93
-        " Note that if we don't do this and pass a full path for the project
94
-        " root, some `ctags` implementations like Exhuberant Ctags can get
95
-        " confused if the paths have spaces -- but not if you're *in* the root 
96
-        " directory, for some reason... (which we are, our caller in
97
-        " `autoload/gutentags.vim` changed it).
98
-        let l:actual_proj_dir = '.'
99
-        let l:actual_tags_file = l:tags_file_relative
100
-    else
101
-        " else: the tags file goes in a cache directory, so we need to specify
102
-        " all the paths absolutely for `ctags` to do its job correctly.
103
-        let l:actual_proj_dir = a:proj_dir
104
-        let l:actual_tags_file = a:tags_file
105
-    endif
106
-
107
-    " Build the command line.
108
-    let l:cmd = [s:runner_exe]
109
-    let l:cmd += ['-e', '"' . s:get_ctags_executable(a:proj_dir) . '"']
110
-    let l:cmd += ['-t', '"' . l:actual_tags_file . '"']
111
-    let l:cmd += ['-p', '"' . l:actual_proj_dir . '"']
112
-    if l:write_mode == 0 && l:tags_file_exists
113
-        let l:cur_file_path = expand('%:p')
114
-        if empty(g:gutentags_cache_dir) && l:tags_file_is_local
115
-            let l:cur_file_path = fnamemodify(l:cur_file_path, ':.')
116
-        endif
117
-        let l:cmd += ['-s', '"' . l:cur_file_path . '"']
118
-    else
119
-        let l:file_list_cmd = gutentags#get_project_file_list_cmd(l:actual_proj_dir)
120
-        if !empty(l:file_list_cmd)
121
-            if match(l:file_list_cmd, '///') > 0
122
-                let l:suffopts = split(l:file_list_cmd, '///')
123
-                let l:suffoptstr = l:suffopts[1]
124
-                let l:file_list_cmd = l:suffopts[0]
125
-                if l:suffoptstr == 'absolute'
126
-                    let l:cmd += ['-A']
127
-                endif
128
-            endif
129
-            let l:cmd += ['-L', '"' . l:file_list_cmd. '"']
130
-        endif
131
-    endif
132
-    if empty(get(l:, 'file_list_cmd', ''))
133
-        " Pass the Gutentags recursive options file before the project
134
-        " options file, so that users can override --recursive.
135
-        " Omit --recursive if this project uses a file list command.
136
-        let l:cmd += ['-o', '"' . gutentags#get_res_file('ctags_recursive.options') . '"']
137
-    endif
138
-    if !empty(g:gutentags_ctags_extra_args)
139
-        let l:cmd += ['-O', shellescape(join(g:gutentags_ctags_extra_args))]
140
-    endif
141
-    if !empty(g:gutentags_ctags_post_process_cmd)
142
-        let l:cmd += ['-P', shellescape(g:gutentags_ctags_post_process_cmd)]
143
-    endif
144
-    let l:proj_options_file = a:proj_dir . '/' .
145
-                \g:gutentags_ctags_options_file
146
-    if filereadable(l:proj_options_file)
147
-        let l:proj_options_file = s:process_options_file(
148
-                    \a:proj_dir, l:proj_options_file)
149
-        let l:cmd += ['-o', '"' . l:proj_options_file . '"']
150
-    endif
151
-    if g:gutentags_ctags_exclude_wildignore
152
-        call s:generate_wildignore_options()
153
-        if !empty(s:wildignores_options_path)
154
-            let l:cmd += ['-x', shellescape('@'.s:wildignores_options_path, 1)]
155
-        endif
156
-    endif
157
-    for exc in g:gutentags_ctags_exclude
158
-        let l:cmd += ['-x', '"' . exc . '"']
159
-    endfor
160
-    if g:gutentags_pause_after_update
161
-        let l:cmd += ['-c']
162
-    endif
163
-    if g:gutentags_trace
164
-        let l:cmd += ['-l', '"' . l:actual_tags_file . '.log"']
165
-    endif
166
-    let l:cmd = gutentags#make_args(l:cmd)
167
-
168
-    call gutentags#trace("Running: " . string(l:cmd))
169
-    call gutentags#trace("In:      " . getcwd())
170
-    if !g:gutentags_fake
171
-        let l:job_opts = gutentags#build_default_job_options('ctags')
172
-        let l:job = gutentags#start_job(l:cmd, l:job_opts)
173
-        call gutentags#add_job('ctags', a:tags_file, l:job)
174
-    else
175
-        call gutentags#trace("(fake... not actually running)")
176
-    endif
177
-endfunction
178
-
179
-function! gutentags#ctags#on_job_exit(job, exit_val) abort
180
-    call gutentags#remove_job_by_data('ctags', a:job)
181
-
182
-    if a:exit_val != 0
183
-        call gutentags#warning("ctags job failed, returned: ".
184
-                    \string(a:exit_val))
185
-    endif
186
-endfunction
187
-
188
-" }}}
189
-
190
-" Utilities {{{
191
-
192
-" Get final ctags executable depending whether a filetype one is defined
193
-function! s:get_ctags_executable(proj_dir) abort
194
-    "Only consider the main filetype in cases like 'python.django'
195
-    let l:ftype = get(split(&filetype, '\.'), 0, '')
196
-    let l:proj_info = gutentags#get_project_info(a:proj_dir)
197
-    let l:type = get(l:proj_info, 'type', l:ftype)
198
-    let exepath = exists('g:gutentags_ctags_executable_{l:type}')
199
-        \ ? g:gutentags_ctags_executable_{l:type} : g:gutentags_ctags_executable
200
-    return expand(exepath, 1)
201
-endfunction
202
-
203
-function! s:generate_wildignore_options() abort
204
-    if s:last_wildignores == &wildignore
205
-        " The 'wildignore' setting didn't change since last time we did this.
206
-        call gutentags#trace("Wildignore options file is up to date.")
207
-        return
208
-    endif
209
-
210
-    if s:wildignores_options_path == ''
211
-        if empty(g:gutentags_cache_dir)
212
-            let s:wildignores_options_path = tempname()
213
-        else
214
-            let s:wildignores_options_path = 
215
-                        \gutentags#stripslash(g:gutentags_cache_dir).
216
-                        \'/_wildignore.options'
217
-        endif
218
-    endif
219
-
220
-    call gutentags#trace("Generating wildignore options: ".s:wildignores_options_path)
221
-    let l:opt_lines = []
222
-    for ign in split(&wildignore, ',')
223
-        call add(l:opt_lines, ign)
224
-    endfor
225
-    call writefile(l:opt_lines, s:wildignores_options_path)
226
-    let s:last_wildignores = &wildignore
227
-endfunction
228
-
229
-function! s:process_options_file(proj_dir, path) abort
230
-    if empty(g:gutentags_cache_dir)
231
-        " If we're not using a cache directory to store tag files, we can
232
-        " use the options file straight away.
233
-        return a:path
234
-    endif
235
-
236
-    " See if we need to process the options file.
237
-    let l:do_process = 0
238
-    let l:proj_dir = gutentags#stripslash(a:proj_dir)
239
-    let l:out_path = gutentags#get_cachefile(l:proj_dir, 'options')
240
-    if !filereadable(l:out_path)
241
-        call gutentags#trace("Processing options file '".a:path."' because ".
242
-                    \"it hasn't been processed yet.")
243
-        let l:do_process = 1
244
-    elseif getftime(a:path) > getftime(l:out_path)
245
-        call gutentags#trace("Processing options file '".a:path."' because ".
246
-                    \"it has changed.")
247
-        let l:do_process = 1
248
-    endif
249
-    if l:do_process == 0
250
-        " Nothing's changed, return the existing processed version of the
251
-        " options file.
252
-        return l:out_path
253
-    endif
254
-
255
-    " We have to process the options file. Right now this only means capturing
256
-    " all the 'exclude' rules, and rewrite them to make them absolute.
257
-    "
258
-    " This is because since `ctags` is run with absolute paths (because we
259
-    " want the tag file to be in a cache directory), it will do its path
260
-    " matching with absolute paths too, so the exclude rules need to be
261
-    " absolute.
262
-    let l:lines = readfile(a:path)
263
-    let l:outlines = []
264
-    for line in l:lines
265
-        let l:exarg_idx = matchend(line, '\v^\-\-exclude=')
266
-        if l:exarg_idx < 0
267
-            call add(l:outlines, line)
268
-            continue
269
-        endif
270
-
271
-        " Don't convert things that don't look like paths.
272
-        let l:exarg = strpart(line, l:exarg_idx + 1)
273
-        let l:do_convert = 1
274
-        if l:exarg[0] == '@'   " Manifest file path
275
-            let l:do_convert = 0
276
-        endif
277
-        if stridx(l:exarg, '/') < 0 && stridx(l:exarg, '\\') < 0   " Filename
278
-            let l:do_convert = 0
279
-        endif
280
-        if l:do_convert == 0
281
-            call add(l:outlines, line)
282
-            continue
283
-        endif
284
-
285
-        let l:fullp = l:proj_dir . gutentags#normalizepath('/'.l:exarg)
286
-        let l:ol = '--exclude='.l:fullp
287
-        call add(l:outlines, l:ol)
288
-    endfor
289
-
290
-    call writefile(l:outlines, l:out_path)
291
-    return l:out_path
292
-endfunction
293
-
294
-" }}}

+ 0
- 122
dotfiles/vim/bundle/vim-gutentags/autoload/gutentags/gtags_cscope.vim View File

@@ -1,122 +0,0 @@
1
-" gtags_cscope module for Gutentags
2
-
3
-if !has('cscope')
4
-    throw "Can't enable the gtags-cscope module for Gutentags, "
5
-                \"this Vim has no support for cscope files."
6
-endif
7
-
8
-" Global Options {{{
9
-
10
-if !exists('g:gutentags_gtags_executable')
11
-    let g:gutentags_gtags_executable = 'gtags'
12
-endif
13
-
14
-if !exists('g:gutentags_gtags_dbpath')
15
-    let g:gutentags_gtags_dbpath = ''
16
-endif
17
-
18
-if !exists('g:gutentags_gtags_options_file')
19
-    let g:gutentags_gtags_options_file = '.gutgtags'
20
-endif
21
-
22
-if !exists('g:gutentags_gtags_cscope_executable')
23
-    let g:gutentags_gtags_cscope_executable = 'gtags-cscope'
24
-endif
25
-
26
-if !exists('g:gutentags_auto_add_gtags_cscope')
27
-    let g:gutentags_auto_add_gtags_cscope = 1
28
-endif
29
-
30
-" }}}
31
-
32
-" Gutentags Module Interface {{{
33
-
34
-let s:added_db_files = {}
35
-
36
-function! s:add_db(db_file) abort
37
-    if filereadable(a:db_file)
38
-        call gutentags#trace(
39
-                    \"Adding cscope DB file: " . a:db_file)
40
-        set nocscopeverbose
41
-        execute 'cs add ' . fnameescape(a:db_file)
42
-        set cscopeverbose
43
-        let s:added_db_files[a:db_file] = 1
44
-    else
45
-        call gutentags#trace(
46
-                    \"Not adding cscope DB file because it doesn't " .
47
-                    \"exist yet: " . a:db_file)
48
-    endif
49
-endfunction
50
-
51
-function! gutentags#gtags_cscope#init(project_root) abort
52
-    let l:db_path = gutentags#get_cachefile(
53
-                \a:project_root, g:gutentags_gtags_dbpath)
54
-    let l:db_path = gutentags#stripslash(l:db_path)
55
-    let l:db_file = l:db_path . '/GTAGS'
56
-    let l:db_file = gutentags#normalizepath(l:db_file)
57
-
58
-    if !isdirectory(l:db_path)
59
-        call mkdir(l:db_path, 'p')
60
-    endif
61
-
62
-    let b:gutentags_files['gtags_cscope'] = l:db_file
63
-
64
-    execute 'set cscopeprg=' . fnameescape(g:gutentags_gtags_cscope_executable)
65
-
66
-    " The combination of gtags-cscope, vim's cscope and global files is
67
-    " a bit flaky. Environment variables are safer than vim passing
68
-    " paths around and interpreting input correctly.
69
-    let $GTAGSDBPATH = l:db_path
70
-    let $GTAGSROOT = a:project_root
71
-
72
-    if g:gutentags_auto_add_gtags_cscope && 
73
-                \!has_key(s:added_db_files, l:db_file)
74
-        let s:added_db_files[l:db_file] = 0
75
-        call s:add_db(l:db_file)
76
-    endif
77
-endfunction
78
-
79
-function! gutentags#gtags_cscope#generate(proj_dir, tags_file, gen_opts) abort
80
-    " gtags doesn't honour GTAGSDBPATH and GTAGSROOT, so PWD and dbpath
81
-    " have to be set
82
-    let l:db_path = fnamemodify(a:tags_file, ':p:h')
83
-
84
-    let l:proj_options_file = a:proj_dir . '/' . g:gutentags_gtags_options_file
85
-
86
-    let l:cmd = ['"'.g:gutentags_gtags_executable.'"']
87
-    if filereadable(l:proj_options_file)
88
-        let l:proj_options = readfile(l:proj_options_file)
89
-        let l:cmd += l:proj_options
90
-    endif
91
-    let l:cmd += ['--incremental', '"'.l:db_path.'"']
92
-    let l:cmd = gutentags#make_args(l:cmd)
93
-
94
-    call gutentags#trace("Running: " . string(l:cmd))
95
-    call gutentags#trace("In:      " . getcwd())
96
-    if !g:gutentags_fake
97
-        let l:job_opts = gutentags#build_default_job_options('gtags_cscope')
98
-        let l:job = gutentags#start_job(l:cmd, l:job_opts)
99
-        call gutentags#add_job('gtags_cscope', a:tags_file, l:job)
100
-    else
101
-        call gutentags#trace("(fake... not actually running)")
102
-    endif
103
-    call gutentags#trace("")
104
-endfunction
105
-
106
-function! gutentags#gtags_cscope#on_job_exit(job, exit_val) abort
107
-    let l:job_idx = gutentags#find_job_index_by_data('gtags_cscope', a:job)
108
-    let l:dbfile_path = gutentags#get_job_tags_file('gtags_cscope', l:job_idx)
109
-    call gutentags#remove_job('gtags_cscope', l:job_idx)
110
-
111
-    if g:gutentags_auto_add_gtags_cscope
112
-        call s:add_db(l:dbfile_path)
113
-    endif
114
-
115
-    if a:exit_val != 0
116
-        call gutentags#warning(
117
-                    \"gtags-cscope job failed, returned: ".
118
-                    \string(a:exit_val))
119
-    endif
120
-endfunction
121
-
122
-" }}}

+ 0
- 728
dotfiles/vim/bundle/vim-gutentags/doc/gutentags.txt View File

@@ -1,728 +0,0 @@
1
-*gutentags.txt*  Automatic ctags management for VIM
2
-      ___           ___           ___           ___           ___     
3
-     /\__\         /\  \         /\__\         /\__\         /\  \    
4
-    /:/ _/_        \:\  \       /:/  /        /:/ _/_        \:\  \   
5
-   /:/ /\  \        \:\  \     /:/__/        /:/ /\__\        \:\  \  
6
-  /:/ /::\  \   ___  \:\  \   /::\  \       /:/ /:/ _/_   _____\:\  \ 
7
- /:/__\/\:\__\ /\  \  \:\__\ /:/\:\  \     /:/_/:/ /\__\ /::::::::\__\
8
- \:\  \ /:/  / \:\  \ /:/  / \/__\:\  \    \:\/:/ /:/  / \:\~~\~~\/__/
9
-  \:\  /:/  /   \:\  /:/  /       \:\__\    \::/_/:/  /   \:\  \      
10
-   \:\/:/  /     \:\/:/  /         \/__/     \:\/:/  /     \:\  \     
11
-    \::/  /       \::/  /                     \::/  /       \:\__\    
12
-     \/__/         \/__/                       \/__/         \/__/    
13
-        ___           ___           ___           ___     
14
-       /\__\         /\  \         /\__\         /\__\    
15
-      /:/  /        /::\  \       /:/ _/_       /:/ _/_   
16
-     /:/__/        /:/\:\  \     /:/ /\  \     /:/ /\  \  
17
-    /::\  \       /:/ /::\  \   /:/ /::\  \   /:/ /::\  \ 
18
-   /:/\:\  \     /:/_/:/\:\__\ /:/__\/\:\__\ /:/_/:/\:\__\
19
-   \/__\:\  \    \:\/:/  \/__/ \:\  \ /:/  / \:\/:/ /:/  /
20
-        \:\__\    \::/__/       \:\  /:/  /   \::/ /:/  / 
21
-         \/__/     \:\  \        \:\/:/  /     \/_/:/  /  
22
-                    \:\__\        \::/  /        /:/  /   
23
-                     \/__/         \/__/         \/__/    
24
-
25
-
26
-                GUTENTAGS REFERENCE MANUAL
27
-                    by Ludovic Chabant
28
-
29
-                                                *gutentags*
30
-
31
-1. Introduction             |gutentags-intro|
32
-2. Commands                 |gutentags-commands|
33
-3. Status Line              |gutentags-status-line|
34
-4. Global Settings          |gutentags-settings|
35
-5. Project Settings         |gutentags-project-settings|
36
-
37
-=============================================================================
38
-1. Introduction                                 *gutentags-intro*
39
-
40
-Gutentags is a plugin that takes care of the much needed management of tags
41
-files in Vim. It will (re)generate tag files as you work while staying
42
-completely out of your way. It will even do its best to keep those tag files
43
-out of your way too. It has no dependencies and just works.
44
-
45
-In order to generate tag files, Gutentags will have to figure out what's in
46
-your project. To do this, it will locate well-known project root markers like
47
-SCM folders (.git, .hg, etc.), any custom tags you define (with
48
-|gutentags_project_root|), and even things you may have defined already with
49
-other plugins, like CtrlP.
50
-
51
-If the current file you're editing is found to be in such a project, Gutentags
52
-will make sure the tag file for that project is up to date. Then, as you work
53
-in files in that project, it will partially re-generate the tag file. Every
54
-time you save, it will silently, in the background, update the tags for that
55
-file.
56
-
57
-Usually, `ctags` can only append tags to an existing tag file, so Gutentags
58
-removes the tags for the current file first, to make sure the tag file is
59
-always consistent with the source code.
60
-
61
-Also, Gutentags is clever enough to not stumble upon itself by triggering
62
-multiple ctags processes if you save files too fast, or if your project is
63
-really big.
64
-
65
-
66
-1.1 Requirements
67
-                                                *gutentags-ctags-requirements*
68
-
69
-If you're using the `ctags` modules (which is the default and only working one
70
-at this point, really), you will need a `tags` generator that supports the
71
-following arguments:
72
-
73
-* `-f` (to specify the output file)
74
-* `--append` (to append to an existing file while keeping it sorted)
75
-* `--exclude` (to exclude file patterns)
76
-* `--options` (to specify an options file)
77
-
78
-This means you probably want Exuberant Ctags or Universal Ctags. The basic
79
-old BSD Ctags WON'T WORK. Other language-specific versions may or may not
80
-work. Check with their help or man page.
81
-
82
-
83
-1.2 Similar Plugins
84
-                                                *gutentags-similar-plugins*
85
-
86
-There are some similar Vim plugins out there ("vim-tags", "vim-autotag",
87
-"vim-automatic-ctags", etc.). They all fail on one or more of the requirements
88
-I set for myself with Gutentags:
89
-
90
-* No other dependency than running Vim: no Python, Ruby, or whatever.
91
-* Cross-platform: should work on at least Mac and Windows.
92
-* Incremental tags generation: don't re-generate the whole project all the
93
-  time. This may be fine for small projects, but it doesn't scale.
94
-* External process management: if the ctags process is taking a long time,
95
-  don't run another one because I saved the file again.
96
-* Keep the tag file consistent: don't just append the current file's tags to
97
-  the tag file, otherwise you will still "see" tags for deleted or renamed
98
-  classes and functions.
99
-* Automatically create the tag file: you open something from a freshly forked
100
-  project, it should start indexing it automatically, just like in Sublime Text 
101
-  or Visual Studio or any other IDE.
102
-
103
-
104
-=============================================================================
105
-2. Commands                                     *gutentags-commands*
106
-
107
-                                                *gutentags-project-commands*
108
-The following commands are only available in buffers that have been found to
109
-belong to a project that should be managed by Gutentags. See
110
-|gutentags_project_root| for how Gutentags figures out the project a file
111
-belongs to. When no project is found (i.e. the file is not under any of the
112
-known project markers), Gutentags is disabled for that buffer, and the
113
-following commands and remarks don't apply.
114
-
115
-If you want to force-disable Gutentags for a given project even though it does
116
-match one of the items in |gutentags_project_root|, create a file named
117
-"`.notags`" at the root of the project.
118
-
119
-The tag file that Gutentags creates and manages will be named after
120
-|gutentags_ctags_tagfile|, relative to the project's root directory. When
121
-Gutentags finds a valid project root, it will prepend the tag file's path to
122
-'tags', unless |gutentags_ctags_auto_set_tags| is set to 0. This is to make
123
-sure Vim will use that file first.
124
-
125
-If a file managed by Gutentags is opened and no tag file already exists,
126
-Gutentags will start generating it right away in the background, unless 
127
-|gutentags_generate_on_missing| is set to 0. If you have a large project, you
128
-may want to know when Gutentags is generating tags: see
129
-|gutentags-status-line| to display an indicator in your status line.
130
-
131
-When a file managed by Gutentags is saved, the tag file will be incrementally
132
-updated, i.e. references to the recently saved file are removed, and that file
133
-is re-parsed for tags, with the result being merged into the tag file. This
134
-makes the tag file 100% consistent with the latest changes. This doesn't
135
-happen however if |gutentags_generate_on_write| is set to 0, in which case you
136
-have to run |GutentagsUpdate| manually.
137
-
138
-
139
-                                                *:GutentagsUpdate*
140
-:GutentagsUpdate
141
-                        Forces an update of the current tag file with the
142
-                        current buffer. If tags are already being generated,
143
-                        you will be notified and the command will abort.
144
-
145
-:GutentagsUpdate!
146
-                        Like |GutentagsUpdate|, but updates the current tags
147
-                        file with the whole project instead of just the
148
-                        current buffer.
149
-
150
-
151
-Some debugging/troubleshooting commands are also available if the
152
-|gutentags_define_advanced_commands| global setting is set to 1.
153
-
154
-                                                *:GutentagsToggleEnabled*
155
-:GutentagsToggleEnabled
156
-                        Disables and re-enables Gutentags.
157
-                        When Gutentags is disabled, it won't update your tag
158
-                        file when you save a buffer. It will however still
159
-                        look for project markers as you open new buffers so
160
-                        that they can start working again when you re-enable
161
-                        Gutentags.
162
-
163
-                        {only available when
164
-                        |gutentags_define_advanced_commands| is set}
165
-
166
-                                                *GutentagsToggleTrace*
167
-:GutentagsToggleTrace
168
-                        If you want to keep an eye on what Gutentags is doing,
169
-                        you can enable tracing. This will show messages every
170
-                        time Gutentags does something. It can get annoying
171
-                        quickly, since it will require you to press a key to
172
-                        dismiss those messages, but it can be useful to
173
-                        troubleshoot a problem.
174
-                        In addition to messages in Vim, it will also make
175
-                        Gutentags redirect the output of the tag generation
176
-                        script to a `.log` file in the project root.
177
-
178
-                        {only available when
179
-                        |gutentags_define_advanced_commands| is set}
180
-
181
-
182
-Gutentags also has some user auto-commands (see |User| and |:doautocmd|):
183
-
184
-                                                *GutentagsUpdating*
185
-GutentagsUpdating
186
-                        This auto-command is triggered when a background
187
-                        update job has started.
188
-
189
-                                                *GutentagsUpdated*
190
-GutentagsUpdated
191
-                        This auto-command is triggered when a background
192
-                        update job has finished.
193
-
194
-
195
-=============================================================================
196
-3.  Status Line                                 *gutentags-status-line*
197
-
198
-Tag file generation can take a while if you're working on a project big
199
-enough. In that case, you may want to know when `ctags` is running, so you
200
-have a heads up if some of the tags aren't recognized yet.
201
-
202
-                                                *gutentags#statusline()*
203
-You can display an indicator of tag generation progress in your |status-line|
204
-with the following function: >
205
-        :set statusline+=%{gutentags#statusline()}
206
-
207
-The function will, by default, print a list of modules in the status line. So
208
-if the `ctags` module (see |g:gutentags_modules|) is currently generating
209
-a tags file, you will see "ctags" printed in the status line. If nothing is
210
-happening, nothing will be printed in the status line.
211
-
212
-You can pass some parameters to customize this:
213
-
214
-1. A prefix string (defaults to `""`).
215
-2. A suffix string (defaults to `""`).
216
-3. The text to print (defaults to the names of modules currently generating
217
-   something).
218
-
219
-So using `gutentags#statusline('[', ']')` would print `"[ctags]"` instead of
220
-`"ctags"`.
221
-
222
-Because Gutentags runs the tag generation in the background, the statusline
223
-indicator might stay there even after the background process has ended. It
224
-would only go away when Vim decides to refresh the statusline. You can force
225
-refresh it in a callback on |GutentagsUpdating| and |GutentagsUpdated|.
226
-
227
-For instance, with the `lightline` plugin:
228
-
229
-        augroup MyGutentagsStatusLineRefresher
230
-            autocmd!
231
-            autocmd User GutentagsUpdating call lightline#update()
232
-            autocmd User GutentagsUpdated call lightline#update()
233
-        augroup END
234
-
235
-                                                *gutentags#statusline_cb*
236
-As an alternative to the previous function, `gutentags#statusline_cb` takes
237
-a single parameter which should be a |Funcref| or a function name. This
238
-function should take a list of active module names, and return a string. This
239
-lets you completely control what the status line will print.
240
-
241
-For instance:
242
-        function! s:get_gutentags_status(mods) abort
243
-            let l:msg = ''
244
-            if index(a:mods, 'ctags') >= 0
245
-               let l:msg .= '♨'
246
-             endif
247
-             if index(a:mods, 'cscope') >= 0
248
-               let l:msg .= '♺'
249
-             endif
250
-             return l:msg
251
-        endfunction
252
-
253
-        :set statusline+=%{gutentags#statusline_cb(
254
-                    \function('<SID>get_gutentags_status'))}
255
-
256
-By default, the callback function doesn't get called if no tags generation is
257
-currently happening. You can pass `1` as a second argument so that the
258
-callback function is always called.
259
-
260
-
261
-=============================================================================
262
-4. Global Settings                              *gutentags-settings*
263
-
264
-The following settings can be defined in your |vimrc| to change the default
265
-behaviour of Gutentags.
266
-
267
-                                                *gutentags_enabled*
268
-g:gutentags_enabled
269
-                        Defines whether Gutentags should be enabled. When
270
-                        disabled, Gutentags will still scan for project root
271
-                        markers when opening buffers. This is so that when you
272
-                        re-enable Gutentags, you won't have some buffers
273
-                        mysteriously working while others (those open last)
274
-                        don't.
275
-                        Defaults to `1`.
276
-
277
-                                                *gutentags_trace*
278
-g:gutentags_trace
279
-                        When true, Gutentags will spit out debugging
280
-                        information as Vim messages (which you can later read
281
-                        with |:messages|). It also runs its background scripts
282
-                        with extra parameters to log activity to a `tags.log`
283
-                        file that you can also inspect for more information.
284
-
285
-                        Note: you can run `:verbose GutentagsUpdate` to
286
-                        temporarily set |g:gutentags_trace| to `1` for that
287
-                        update only.
288
-
289
-                        Defaults to `0`.
290
-
291
-                                                *gutentags_dont_load*
292
-g:gutentags_dont_load
293
-                        Prevents Gutentags from loading at all on Vim startup.
294
-
295
-                        The difference between this and |gutentags_enabled| is
296
-                        that |gutentags_enabled| can be turned on and off in
297
-                        the same Vim session -- Gutentags as a plugin stays
298
-                        loaded and will keep track of what happened while it
299
-                        was disabled. However, |gutentags_dont_load| only
300
-                        works on Vim startup and will prevent Gutentags from
301
-                        loading at all, as if it wasn't there.
302
-
303
-                                                *gutentags_modules*
304
-g:gutentags_modules
305
-                        A list of modules to load with Gutentags. Each module
306
-                        is responsible for generating a specific type of tags
307
-                        file.
308
-                        Valid values are:
309
-
310
-                        - `ctags`: generates a `tags` file using
311
-                          a `ctags`-compatible program like Exhuberant Ctags
312
-                          or Universal Ctags.
313
-
314
-                        - `cscope`: generates a code database file using
315
-                          `cscope`.
316
-
317
-                        - `gtags_cscope`: same as `cscope` but uses GNU's
318
-                          `gtags` executable and database.
319
-
320
-                        Defaults to `[ctags]`.
321
-
322
-                                                *gutentags_project_root*
323
-g:gutentags_project_root
324
-                        When a buffer is loaded, Gutentags will figure out if
325
-                        it's part of a project that should have tags managed
326
-                        automatically. To do this, it looks for "root markers"
327
-                        in the current file's directory and its parent
328
-                        directories. If it finds any of those markers,
329
-                        Gutentags will be enabled for the project, and a tags
330
-                        file named after |gutentags_ctags_tagfile| will be 
331
-                        created at the project root.
332
-                        Defaults to `[]` (an empty |List|).
333
-                        A list of default markers will be appended to the
334
-                        user-defined ones unless
335
-                        |gutentags_add_default_project_roots| is set to 0.
336
-
337
-                                            *gutentags_add_default_project_roots*
338
-g:gutentags_add_default_project_roots
339
-                        Defines whether Gutentags should always define some
340
-                        default project roots (see |gutentags_project_root|).
341
-                        This can be useful to prevent unnecessary disk access
342
-                        when Gutentags searches for a project root.
343
-                        The default markers are:
344
-                        `['.git', '.hg', '.svn', '.bzr', '_darcs', '_darcs', '_FOSSIL_', '.fslckout']`
345
-
346
-                                            *gutentags_add_ctrlp_root_markers*
347
-g:gutentags_add_ctrlp_root_markers
348
-                        If Gutentags finds `g:ctrlp_root_markers` (used by the
349
-                        CtrlP plugin), it will append those root markers to
350
-                        the existing ones (see |g:gutentags_project_root|).
351
-                        Set this to 0 to stop it from happening.
352
-                        Defaults to 1.
353
-
354
-                                                *gutentags_exclude_filetypes*
355
-g:gutentags_exclude_filetypes
356
-                        A |List| of file types (see |'filetype'|) that Gutentags
357
-                        should ignore. When a buffer is opened, if its
358
-                        'filetype' is found in this list, Gutentags features
359
-                        won't be available for this buffer.
360
-                        Defaults to an empty list (`[]`).
361
-
362
-                                                *gutentags_exclude_project_root*
363
-g:gutentags_exclude_project_root
364
-                        A list of project roots to generally ignore. If a file
365
-                        is opened inside one of those projects, Gutentags
366
-                        won't be activated. This is similar to placing
367
-                        a `.notags` file in the root of those projects, but
368
-                        can be useful when you don't want to, or can't, place
369
-                        such a file there.
370
-                        Defaults to `['/usr/local']`, which is the folder where
371
-                        Homebrew is known to create a Git directory by default
372
-                        on MacOS.
373
-
374
-                                                *gutentags_project_root_finder*
375
-g:gutentags_project_root_finder
376
-                        When a buffer is loaded, Gutentags uses a default
377
-                        (internal) implementation to find that file's
378
-                        project's root directory, using settings like
379
-                        |g:gutentags_project_root|. When you specify
380
-                        |g:gutentags_project_root_finder|, you can tell
381
-                        Gutentags to use a custom implementation, such as
382
-                        `vim-projectroot`. The value of this setting must be
383
-                        the name of a function that takes a single string
384
-                        argument (the path to the current buffer's file) and
385
-                        returns a string value (the project's root directory).
386
-                        Defaults to `''`.
387
-                        Note: when set, the called implementation will
388
-                        possibly ignore |g:gutentags_project_root|.
389
-                        Note: an implementation can fallback to the default
390
-                        behaviour by calling
391
-                        `gutentags#default_get_project_root`.
392
-
393
-                                                *gutentags_generate_on_missing*
394
-g:gutentags_generate_on_missing
395
-                        If set to 1, Gutentags will start generating an initial
396
-                        tag file if a file is open in a project where no tags
397
-                        file is found. See |gutentags_project_root| for how
398
-                        Gutentags locates the project.
399
-                        When set to 0, Gutentags will only generate the first
400
-                        time the file is saved (if
401
-                        |gutentags_generate_on_write| is set to 1), or when
402
-                        |GutentagsUpdate| or |GutentagsGenerate| is run.
403
-                        Defaults to 1.
404
-
405
-                                                *gutentags_generate_on_new*
406
-g:gutentags_generate_on_new
407
-                        If set to 1, Gutentags will start generating the tag
408
-                        file when a new project is open. A new project is
409
-                        considered open when a buffer is created for a file
410
-                        whose corresponding tag file has not been "seen" yet
411
-                        in the current Vim session -- which pretty much means
412
-                        when you open the first file in a given source control
413
-                        repository.
414
-                        When set to 0, Gutentags won't do anything special.
415
-                        See also |gutentags_generate_on_missing| and
416
-                        |gutentags_generate_on_write|.
417
-                        Defaults to 1.
418
-
419
-                                                *gutentags_generate_on_write*
420
-g:gutentags_generate_on_write
421
-                        If set to 1, Gutentags will update the current
422
-                        project's tag file when a file inside that project is
423
-                        saved. See |gutentags_project_root| for how Gutentags
424
-                        locates the project.
425
-                        When set to 0, Gutentags won't do anything on save.
426
-                        This means that the project's tag file won't reflect
427
-                        the latest changes, and you will have to run
428
-                        |GutentagsUpdate| manually.
429
-                        Defaults to 1.
430
-
431
-                                            *gutentags_generate_on_empty_buffer*
432
-g:gutentags_generate_on_empty_buffer
433
-                        If set to 1, Gutentags will start generating the tag
434
-                        file even if there's no buffer currently open, as long
435
-                        as the current working directory (as returned by
436
-                        |:cd|) is inside a known project.
437
-                        This is useful if you want Gutentags to generate the
438
-                        tag file right after opening Vim.
439
-                        Defaults to 0.
440
-
441
-                                                *gutentags_background_update*
442
-g:gutentags_background_update
443
-                        Specifies whether the process that updates the tags
444
-                        file should be run in the background or in the
445
-                        foreground. If run in the foreground, Vim will block
446
-                        until the process is complete.
447
-                        Defaults to 1.
448
-
449
-                                                *gutentags_cache_dir*
450
-g:gutentags_cache_dir
451
-                        Specifies a directory in which to create all the tags
452
-                        files, instead of writing them at the root of each
453
-                        project. This is handy to keep tags files from
454
-                        polluting many directories all across your computer.
455
-
456
-                                            *gutentags_resolve_symlinks*
457
-g:gutentags_resolve_symlinks
458
-                        When set to 1, Gutentags will resolve any symlinks in
459
-                        the current buffer's path in order to find the project
460
-                        it belongs to. This is what you want if you're editing
461
-                        a symlink located outside of the project, and it
462
-                        points to a file inside the project. However, this is
463
-                        maybe not what you want if the symlink itself is
464
-                        part of the project.
465
-                        Defaults to 0.
466
-                        
467
-                                            *gutentags_init_user_func*
468
-g:gutentags_init_user_func
469
-                        When set to a non-empty string, it is expected to be
470
-                        the name of a function that will be called when a file
471
-                        is opened in a project. The function gets passed the
472
-                        path of the file and if it returns 0, Gutentags won't
473
-                        be enabled for that file.
474
-
475
-                        You can use this to manually set buffer-local
476
-                        settings:
477
-                        
478
-                        * `b:gutentags_ctags_tagfile` (see |gutentags_ctags_tagfile|).
479
-
480
-                        This setting was previously called 
481
-                        `gutentags_enabled_user_func`. The old setting is
482
-                        still used as a fallback.
483
-
484
-                        Defaults to "".
485
-
486
-                                            *gutentags_define_advanced_commands*
487
-g:gutentags_define_advanced_commands
488
-                        Defines some advanced commands like
489
-                        |GutentagsToggleEnabled| and |GutentagsUnlock|.
490
-
491
-                                            *gutentags_project_info*
492
-g:gutentags_project_info
493
-                        Defines ways for Gutentags to figure out what kind of
494
-                        project any given file belongs to. This should be
495
-                        a list of dictionaries:
496
-
497
-                        let g:gutentags_project_info = []
498
-                        call add(g:gutentags_project_info, {...})
499
-
500
-                        Each dictionary item must contain at least a `type`
501
-                        key, indicating the type of project:
502
-
503
-                        {"type": "python"}
504
-
505
-                        Other items will be used to figure out if a project is
506
-                        of the given type.
507
-
508
-                        "file": any existing file with this path (relative to
509
-                        the project root) will make the current project match
510
-                        the given info.
511
-
512
-                        "glob": any result found with this glob pattern
513
-                        (relative to the project root) will make the current
514
-                        project match the given info. See |glob()| for more
515
-                        information.
516
-
517
-                        Gutentags adds by default the following definitions:
518
-
519
-                        call add(g:gutentags_project_info, {'type': 'python', 'file': 'setup.py'})
520
-                        call add(g:gutentags_project_info, {'type': 'ruby', 'file': 'Gemfile'})
521
-
522
-                        This means, for example, that you can use
523
-                        `g:gutentags_ctags_executable_ruby` out of the box.
524
-                        See |gutentags_ctags_executable_{filetype}| for more
525
-                        information.
526
-
527
-                                            *gutentags_file_list_command*
528
-g:gutentags_file_list_command
529
-                        Specifies command(s) to use to list files for which
530
-                        tags should be generated, instead of recursively
531
-                        examining all files within the project root. When
532
-                        invoked, file list commands will execute in the
533
-                        project root directory.
534
-
535
-                        This setting is useful in projects using source
536
-                        control to restrict tag generation to only files
537
-                        tracked in the repository.
538
-
539
-                        This variable may be set in one of two ways. If
540
-                        set as a |String|, the specified command will be used to
541
-                        list files for all projects. For example: >
542
-
543
-                         let g:gutentags_file_list_command = 'find . -type f'
544
-<
545
-                        If set as a |Dictionary|, this variable should be set
546
-                        as a mapping of project root markers to the desired
547
-                        file list command for that root marker. (See
548
-                        |gutentags_project_root| for how Gutentags uses root
549
-                        markers to locate the project.) For example: >
550
-
551
-                         let g:gutentags_file_list_command = {
552
-                             \ 'markers': {
553
-                                 \ '.git': 'git ls-files',
554
-                                 \ '.hg': 'hg files',
555
-                                 \ },
556
-                             \ }
557
-<
558
-                        Note: If a custom ctags executable is specified, it
559
-                        must support the '-L' command line option in order to
560
-                        read the list of files to be examined.
561
-
562
-
563
-The following settings are valid for the `ctags` module.
564
-
565
-                                                *gutentags_ctags_executable*
566
-g:gutentags_ctags_executable
567
-                        Specifies the ctags executable to launch.
568
-                        Defaults to `ctags`.
569
-
570
-                                     *gutentags_ctags_executable_{filetype}*
571
-g:gutentags_ctags_executable_{type}
572
-                        Specifies the ctags executable to launch for a project
573
-                        of type {type}. See |gutentags_project_info| for more
574
-                        information.
575
-                        IMPORTANT: please see |gutentags-ctags-requirements|.
576
-                        Example: >
577
-                         let g:gutentags_ctags_executable_ruby = 'foobar'
578
-<
579
-
580
-                                                *gutentags_ctags_tagfile*
581
-g:gutentags_ctags_tagfile
582
-                        Specifies the name of the tag file to create. This
583
-                        will be appended to the project's root. See
584
-                        |gutentags_project_root| for how Gutentags locates the
585
-                        project.
586
-                        Defaults to `tags`.
587
-
588
-                                                *gutentags_ctags_exclude*
589
-g:gutentags_ctags_exclude
590
-                        A list of file patterns to pass to the
591
-                        |gutentags_ctags_executable| so that they will be
592
-                        excluded from parsing for the tags generation.
593
-                        See also |gutentags_ctags_exclude_wildignore|.
594
-                        Defaults to `[]` (an empty |List|).
595
-
596
-                                                *gutentags_ctags_exclude_wildignore*
597
-g:gutentags_ctags_exclude_wildignore
598
-                        When 1, Gutentags will automatically pass your
599
-                        'wildignore' file patterns to the 
600
-                        |gutentags_ctags_executable| so that they are ignored.
601
-                        Set also |gutentags_ctags_exclude| to pass custom
602
-                        patterns.
603
-                        Defaults to 1.
604
-
605
-                                                *gutentags_ctags_auto_set_tags*
606
-g:gutentags_ctags_auto_set_tags
607
-                        If set to 1, Gutentags will automatically prepend
608
-                        'tags' with the exact path to the tag file for the
609
-                        current project. See |gutentags_project_root| for how
610
-                        Gutentags locates the project.
611
-                        When set to 0, Gutentags doesn't change 'tags', and
612
-                        this means that whatever tag file it generates may
613
-                        not be picked up by Vim. See |tagfiles()| to know what
614
-                        tag files Vim knows about.
615
-                        Defaults to 1.
616
-
617
-                                                *gutentags_ctags_extra_args*
618
-g:gutentags_ctags_extra_args
619
-                        A list of arguments to pass to `ctags`.
620
-                        Defaults to `[]`.
621
-
622
-                                                *gutentags_ctags_post_process_cmd*
623
-g:gutentags_ctags_post_process_cmd
624
-                        If defined, the tags generation script will run the
625
-                        command with an argument that points to a temporary
626
-                        copy of the tags file. If the post-process step is
627
-                        modifying the tags file, it needs to do so in-place.
628
-                        This is useful for cleaning up a tags file that may
629
-                        contain tags with non-ASCII names that somehow upsets
630
-                        Vim.
631
-                        Defaults to `""` (an empty |String|).
632
-
633
-
634
-The following settings are valid for the `cscope` module.
635
-
636
-                                                *gutentags_cscope_executable*
637
-g:gutentags_cscope_executable
638
-                        Specifies the name or path of the `cscope` executable
639
-                        to use to generate the code database.
640
-                        Defaults to `"cscope"`.
641
-
642
-                                                *gutentags_scopefile*
643
-g:gutentags_scopefile
644
-                        Specifies the name of the scope file to create. This
645
-                        will be appended to the project's root. See
646
-                        |gutentags_project_root| for how Gutentags locates the
647
-                        project.
648
-                        Defaults to `"cscope.out"`.
649
-
650
-                                                *gutentags_auto_add_cscope*
651
-g:gutentags_auto_add_cscope
652
-                        If set to 1, Gutentags will automatically add the
653
-                        generated code database to Vim by running `:cs add`
654
-                        (see |:cscope|).
655
-                        Defaults to 1.
656
-
657
-                                                *gutentags_cscope_build_inverted_index*
658
-g:gutentags_cscope_build_inverted_index
659
-                        If set to 1, Gutentags will make `cscope` build an
660
-                        inverted index.
661
-                        Defaults to 0.
662
-
663
-
664
-The following settings are valid for the `gtags_cscope` module.
665
-
666
-                                                *gutentags_gtags_executable*
667
-g:gutentags_gtags_executable
668
-                        Specifies the name or path of the `gtags` executable
669
-                        to use to generate the code database.
670
-                        Defaults to `"gtags"`.
671
-
672
-                                                *gutentags_gtags_cscope_executable*
673
-g:gutentags_gtags_cscope_executable
674
-                        Specifies the name or path of the `gtags-cscope`
675
-                        executable to use to generate the code database.
676
-                        Defaults to `"gtags-cscope"`.
677
-
678
-                                                *gutentags_gtags_dbpath*
679
-g:gutentags_gtags_dbpath
680
-                        Path from the cache directory (|gutentags_cache_dir|
681
-                        or project root) to the folder containing the
682
-                        definition database file (usually called `GTAGS`).
683
-                        Defaults to `""`.
684
-
685
-                                                *gutentags_gtags_options_file*
686
-g:gutentags_gtags_options_file
687
-                        The name of a file that will be looked for in
688
-                        a project root directory. The file is expected to
689
-                        contain `gtags` options (one per line).
690
-                        Defaults to `".gutgtags"`.
691
-
692
-                                                *gutentags_auto_add_gtags_cscope*
693
-g:gutentags_auto_add_gtags_cscope
694
-                        If set to 1, Gutentags will automatically add the
695
-                        generated code database to Vim by running `:cs add`
696
-                        (see |:cscope|).
697
-                        Defaults to 1.
698
-
699
-People using `cscope` or `gtags_cscope` across multiple projects in the same
700
-Vim instance might be interested in the `gutentags_plus` plugin, which handles
701
-switching databases automatically before performing a query.
702
-See https://github.com/skywind3000/gutentags_plus.
703
-
704
-=============================================================================
705
-5. Project Settings                             *gutentags-project-settings*
706
-
707
-Gutentags can be customized to some extent on a per-project basis with the
708
-following files present in the project root directory:
709
-
710
-                                                *gutentags-.gutctags*
711
-`.gutctags`: if this file exists, Ctags will be told to load additional
712
-command-line parameters by reading it line by line (see the Ctags
713
-documentation for more information).
714
-
715
-Note that for complex reasons, Gutentags can't run `ctags` from the project
716
-root if you're using |gutentags_cache_dir|, so if the `.gutctags` file exists,
717
-it will be pre-processed in order to make all `--exclude=` clauses into
718
-absolute paths (by prepending the project root). The resulting file will be
719
-saved into the cache directory, and passed to `ctags` via the `--options=`
720
-parameter. If you're _not_ using |gutentags_cache_dir|, the `.gutctags` file
721
-is _not_ pre-processed, and is passed as-is via the `--options=` parameter.
722
-
723
-                                                *gutentags-.notags*
724
-`.notags`: if this file exists, Gutentags will be disabled completely for that
725
-project.
726
-
727
-
728
- vim:tw=78:et:ft=help:norl:

+ 0
- 124
dotfiles/vim/bundle/vim-gutentags/plat/unix/update_scopedb.sh View File

@@ -1,124 +0,0 @@
1
-#!/bin/sh
2
-
3
-set -e
4
-
5
-PROG_NAME=$0
6
-CSCOPE_EXE=cscope
7
-CSCOPE_ARGS=
8
-DB_FILE=cscope.out
9
-PROJECT_ROOT=
10
-FILE_LIST_CMD=
11
-BUILD_INVERTED_INDEX=0
12
-
13
-ShowUsage() {
14
-    echo "Usage:"
15
-    echo "    $PROG_NAME <options>"
16
-    echo ""
17
-    echo "    -e [exe=cscope]:      The cscope executable to run"
18
-    echo "    -f [file=cscope.out]: The path to the ctags file to update"
19
-    echo "    -p [dir=]:            The path to the project root"
20
-    echo "    -L [cmd=]:            The file list command to run"
21
-    echo "    -I:                   Builds an inverted index"
22
-    echo ""
23
-}
24
-
25
-
26
-while getopts "h?e:f:p:L:I" opt; do
27
-    case $opt in
28
-        h|\?)
29
-            ShowUsage
30
-            exit 0
31
-            ;;
32
-        e)
33
-            CSCOPE_EXE=$OPTARG
34
-            ;;
35
-        f)
36
-            DB_FILE=$OPTARG
37
-            ;;
38
-        p)
39
-            PROJECT_ROOT=$OPTARG
40
-            ;;
41
-        L)
42
-            FILE_LIST_CMD=$OPTARG
43
-            ;;
44
-        I)
45
-            BUILD_INVERTED_INDEX=1
46
-            ;;
47
-    esac
48
-done
49
-
50
-shift $((OPTIND - 1))
51
-
52
-if [ "$1" != "" ]; then
53
-    echo "Invalid Argument: $1"
54
-    exit 1
55
-fi
56
-
57
-echo "Locking cscope DB file..."
58
-echo $$ > "$DB_FILE.lock"
59
-
60
-# Remove lock and temp file if script is stopped unexpectedly.
61
-CleanUp() {
62
-    rm -f "$DB_FILE.lock" "$DB_FILE.files" "$DB_FILE.temp"
63
-    if [ "$BUILD_INVERTED_INDEX" -eq 1 ]; then
64
-        rm -f "$DB_FILE.temp.in" "$DB_FILE.temp.po"
65
-    fi
66
-}
67
-
68
-trap CleanUp INT QUIT TERM EXIT
69
-
70
-PREVIOUS_DIR=$(pwd)
71
-if [ -d "$PROJECT_ROOT" ]; then
72
-    cd "$PROJECT_ROOT"
73
-fi
74
-
75
-if [ -n "${FILE_LIST_CMD}" ]; then
76
-    if [ "${PROJECT_ROOT}" = "." ]; then
77
-        eval "$FILE_LIST_CMD" | while read -r l; do
78
-            echo "\"${l}\""
79
-        done > "${DB_FILE}.files"
80
-    else
81
-        # If using a tags cache directory, use absolute paths
82
-        eval "$FILE_LIST_CMD" | while read -r l; do
83
-            echo "\"${PROJECT_ROOT%/}/${l}\""
84
-        done > "${DB_FILE}.files"
85
-    fi
86
-else
87
-    find . -type f ! -name ${DB_FILE} | while read -r l; do
88
-        echo "\"${l}\""
89
-    done > "${DB_FILE}.files"
90
-fi
91
-
92
-if [ ! -s "${DB_FILE}.files" ]; then
93
-    echo "There is no files to generate cscope DB"
94
-    exit
95
-fi
96
-
97
-CSCOPE_ARGS="${CSCOPE_ARGS} -i ${DB_FILE}.files"
98
-
99
-if [ "$BUILD_INVERTED_INDEX" -eq 1 ]; then
100
-    CSCOPE_ARGS="$CSCOPE_ARGS -q"
101
-fi
102
-
103
-echo "Running cscope"
104
-echo "$CSCOPE_EXE $CSCOPE_ARGS -b -k -f \"$DB_FILE.temp\""
105
-"$CSCOPE_EXE" $CSCOPE_ARGS -v -b -k -f "$DB_FILE.temp"
106
-
107
-if [ -d "$PROJECT_ROOT" ]; then
108
-    cd "$PREVIOUS_DIR"
109
-fi
110
-
111
-echo "Replacing cscope DB file"
112
-if [ "$BUILD_INVERTED_INDEX" -eq 1 ]; then
113
-    echo "mv -f \"$DB_FILE.temp.in\" \"$DB_FILE.in\""
114
-    mv -f "$DB_FILE.temp.in" "$DB_FILE.in"
115
-    echo "mv -f \"$DB_FILE.temp.po\" \"$DB_FILE.po\""
116
-    mv -f "$DB_FILE.temp.po" "$DB_FILE.po"
117
-fi
118
-echo "mv -f \"$DB_FILE.temp\" \"$DB_FILE\""
119
-mv -f "$DB_FILE.temp" "$DB_FILE"
120
-
121
-echo "Unlocking cscope DB file..."
122
-rm -f "$DB_FILE.lock"
123
-
124
-echo "Done."

+ 0
- 155
dotfiles/vim/bundle/vim-gutentags/plat/unix/update_tags.sh View File

@@ -1,155 +0,0 @@
1
-#!/bin/sh
2
-
3
-set -e
4
-
5
-PROG_NAME=$0
6
-CTAGS_EXE=ctags
7
-CTAGS_ARGS=
8
-TAGS_FILE=tags
9
-PROJECT_ROOT=
10
-LOG_FILE=
11
-FILE_LIST_CMD=
12
-FILE_LIST_CMD_IS_ABSOLUTE=0
13
-UPDATED_SOURCE=
14
-POST_PROCESS_CMD=
15
-PAUSE_BEFORE_EXIT=0
16
-
17
-
18
-ShowUsage() {
19
-    echo "Usage:"
20
-    echo "    $PROG_NAME <options>"
21
-    echo ""
22
-    echo "    -e [exe=ctags]: The ctags executable to run"
23
-    echo "    -t [file=tags]: The path to the ctags file to update"
24
-    echo "    -p [dir=]:      The path to the project root"
25
-    echo "    -l [file=]:     The path to a log file"
26
-    echo "    -L [cmd=]:      The file list command to run"
27
-    echo "    -A:             Specifies that the file list command returns "
28
-    echo "                    absolute paths"
29
-    echo "    -s [file=]:     The path to the source file that needs updating"
30
-    echo "    -x [pattern=]:  A pattern of files to exclude"
31
-    echo "    -o [options=]:  An options file to read additional options from"
32
-    echo "    -O [params=]:   Parameters to pass to ctags"
33
-    echo "    -P [cmd=]:      Post process command to run on the tags file"
34
-    echo "    -c:             Ask for confirmation before exiting"
35
-    echo ""
36
-}
37
-
38
-
39
-while getopts "h?e:x:t:p:l:L:s:o:O:P:cA" opt; do
40
-    case $opt in
41
-        h|\?)
42
-            ShowUsage
43
-            exit 0
44
-            ;;
45
-        e)
46
-            CTAGS_EXE=$OPTARG
47
-            ;;
48
-        x)
49
-            CTAGS_ARGS="$CTAGS_ARGS --exclude=$OPTARG"
50
-            ;;
51
-        t)
52
-            TAGS_FILE=$OPTARG
53
-            ;;
54
-        p)
55
-            PROJECT_ROOT=$OPTARG
56
-            ;;
57
-        l)
58
-            LOG_FILE=$OPTARG
59
-            ;;
60
-        L)
61
-            FILE_LIST_CMD=$OPTARG
62
-            ;;
63
-        A)
64
-            FILE_LIST_CMD_IS_ABSOLUTE=1
65
-            ;;
66
-        s)
67
-            UPDATED_SOURCE=$OPTARG
68
-            ;;
69
-        c)
70
-            PAUSE_BEFORE_EXIT=1
71
-            ;;
72
-        o)
73
-            CTAGS_ARGS="$CTAGS_ARGS --options=$OPTARG"
74
-            ;;
75
-        O)
76
-            CTAGS_ARGS="$CTAGS_ARGS $OPTARG"
77
-            ;;
78
-        P)
79
-            POST_PROCESS_CMD=$OPTARG
80
-            ;;
81
-    esac
82
-done
83
-
84
-shift $((OPTIND - 1))
85
-
86
-if [ "$1" != "" ]; then
87
-    echo "Invalid Argument: $1"
88
-    exit 1
89
-fi
90
-
91
-echo "Locking tags file..."
92
-echo $$ > "$TAGS_FILE.lock"
93
-
94
-# Remove lock and temp file if script is stopped unexpectedly.
95
-trap 'errorcode=$?; rm -f "$TAGS_FILE.lock" "$TAGS_FILE.files" "$TAGS_FILE.temp"; exit $errorcode' INT QUIT TERM EXIT
96
-
97
-INDEX_WHOLE_PROJECT=1
98
-if [ -f "$TAGS_FILE" ]; then
99
-    if [ "$UPDATED_SOURCE" != "" ]; then
100
-        echo "Removing references to: $UPDATED_SOURCE"
101
-        tab="	"
102
-        cmd="grep --text -Ev '^[^$tab]+$tab$UPDATED_SOURCE$tab' '$TAGS_FILE' > '$TAGS_FILE.temp'"
103
-        echo "$cmd"
104
-        eval "$cmd" || true
105
-        INDEX_WHOLE_PROJECT=0
106
-    fi
107
-fi
108
-
109
-if [ $INDEX_WHOLE_PROJECT -eq 1 ]; then
110
-    if [ -n "${FILE_LIST_CMD}" ]; then
111
-        if [ "${PROJECT_ROOT}" = "." ] || [ $FILE_LIST_CMD_IS_ABSOLUTE -eq 1 ]; then
112
-            echo "Running file list command"
113
-            echo "eval $FILE_LIST_CMD > \"${TAGS_FILE}.files\""
114
-            eval $FILE_LIST_CMD > "${TAGS_FILE}.files"
115
-        else
116
-            # If using a tags cache directory, use absolute paths
117
-            echo "Running file list command, patching for absolute paths"
118
-            echo "eval $FILE_LIST_CMD"
119
-            eval $FILE_LIST_CMD | while read -r l; do
120
-                echo "${PROJECT_ROOT%/}/${l}"
121
-            done > "${TAGS_FILE}.files"
122
-        fi
123
-        CTAGS_ARGS="${CTAGS_ARGS} -L "${TAGS_FILE}.files""
124
-    else
125
-        CTAGS_ARGS="${CTAGS_ARGS} "${PROJECT_ROOT}""
126
-    fi
127
-
128
-    echo "Running ctags on whole project"
129
-    echo "$CTAGS_EXE -f \"$TAGS_FILE.temp\" $CTAGS_ARGS"
130
-    $CTAGS_EXE -f "$TAGS_FILE.temp" $CTAGS_ARGS
131
-else
132
-    echo "Running ctags on \"$UPDATED_SOURCE\""
133
-    echo "$CTAGS_EXE -f \"$TAGS_FILE.temp\" $CTAGS_ARGS --append \"$UPDATED_SOURCE\""
134
-    $CTAGS_EXE -f "$TAGS_FILE.temp" $CTAGS_ARGS --append "$UPDATED_SOURCE"
135
-fi
136
-
137
-if [ "$POST_PROCESS_CMD" != "" ]; then
138
-    echo "Running post process"
139
-    echo "$POST_PROCESS_CMD \"$TAGS_FILE.temp\""
140
-    $POST_PROCESS_CMD "$TAGS_FILE.temp"
141
-fi
142
-
143
-echo "Replacing tags file"
144
-echo "mv -f \"$TAGS_FILE.temp\" \"$TAGS_FILE\""
145
-mv -f "$TAGS_FILE.temp" "$TAGS_FILE"
146
-
147
-echo "Unlocking tags file..."
148
-rm -f "$TAGS_FILE.lock"
149
-
150
-echo "Done."
151
-
152
-if [ $PAUSE_BEFORE_EXIT -eq 1 ]; then
153
-    printf "Press ENTER to exit..."
154
-    read -r
155
-fi

+ 0
- 120
dotfiles/vim/bundle/vim-gutentags/plat/win32/update_scopedb.cmd View File

@@ -1,120 +0,0 @@
1
-@echo off
2
-setlocal EnableExtensions EnableDelayedExpansion
3
-
4
-rem ==========================================
5
-rem            PARSE ARGUMENTS
6
-rem ==========================================
7
-
8
-set CSCOPE_EXE=cscope
9
-set CSCOPE_ARGS=
10
-set DB_FILE=cscope.out
11
-set FILE_LIST_CMD=
12
-set LOG_FILE=
13
-set BUILD_INVERTED_INDEX=0
14
-
15
-:ParseArgs
16
-if [%1]==[] goto :DoneParseArgs
17
-if [%1]==[-e] (
18
-    set CSCOPE_EXE=%~2
19
-    shift
20
-    goto :LoopParseArgs
21
-)
22
-if [%1]==[-f] (
23
-    set DB_FILE=%~2
24
-    shift
25
-    goto :LoopParseArgs
26
-)
27
-if [%1]==[-p] (
28
-    set PROJ_ROOT=%~2
29
-    shift
30
-    goto :LoopParseArgs
31
-)
32
-if [%1]==[-L] (
33
-    set FILE_LIST_CMD=%~2
34
-    shift
35
-    goto :LoopParseArgs
36
-)
37
-if [%1]==[-l] (
38
-    set LOG_FILE=%~2
39
-    shift
40
-    goto :LoopParseArgs
41
-)
42
-if [%1]==[-I] (
43
-    set BUILD_INVERTED_INDEX=1
44
-    goto :LoopParseArgs
45
-)
46
-echo Invalid Argument: %1
47
-goto :Usage
48
-
49
-:LoopParseArgs
50
-shift
51
-goto :ParseArgs
52
-
53
-:DoneParseArgs
54
-
55
-
56
-rem ==========================================
57
-rem             GENERATE DATABASE
58
-rem ==========================================
59
-
60
-if [%LOG_FILE%]==[] set LOG_FILE=CON
61
-
62
-echo Locking db file > %LOG_FILE%
63
-echo locked > "%DB_FILE%.lock"
64
-
65
-echo Running cscope >> %LOG_FILE%
66
-if NOT ["%FILE_LIST_CMD%"]==[""] (
67
-    if ["%PROJECT_ROOT%"]==["."] (
68
-        for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo "%%F">%DB_FILE%.files
69
-    ) else (
70
-        rem Potentially useful:
71
-        rem http://stackoverflow.com/questions/9749071/cmd-iterate-stdin-piped-from-another-command
72
-        for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo "%PROJECT_ROOT%\%%F">%DB_FILE%.files
73
-    )
74
-) ELSE (
75
-    for /F "usebackq delims=" %%F in (`dir /S /B /A-D .`) do @echo "%%F">%DB_FILE%.files
76
-)
77
-
78
-set FILESIZE=0
79
-for /F %%F in ("%DB_FILE%.files") do set FILESIZE=%%~zF
80
-if %FILESIZE% EQU 0 (
81
-    echo There is no files to generate cscope DB
82
-    goto :EOF
83
-)
84
-
85
-set CSCOPE_ARGS=%CSCOPE_ARGS% -i %DB_FILE%.files
86
-if ["%BUILD_INVERTED_INDEX%"]==["1"] (
87
-    set CSCOPE_ARGS=%CSCOPE_ARGS% -q
88
-)
89
-"%CSCOPE_EXE%" %CSCOPE_ARGS% -b -k -f "%DB_FILE%"
90
-if ERRORLEVEL 1 (
91
-    echo ERROR: Cscope executable returned non-zero code. >> %LOG_FILE%
92
-)
93
-
94
-echo Unlocking db file >> %LOG_FILE%
95
-del /F "%DB_FILE%.files" "%DB_FILE%.lock"
96
-if ERRORLEVEL 1 (
97
-    echo ERROR: Unable to remove file lock. >> %LOG_FILE%
98
-)
99
-
100
-echo Done. >> %LOG_FILE%
101
-
102
-goto :EOF
103
-
104
-
105
-rem ==========================================
106
-rem                 USAGE
107
-rem ==========================================
108
-
109
-:Usage
110
-echo Usage:
111
-echo    %~n0 ^<options^>
112
-echo.
113
-echo    -e [exe=cscope]:             The cscope executable to run
114
-echo    -f [file=cscope.out]:        The path to the database file to create
115
-echo    -p [dir=]:                   The path to the project root
116
-echo    -L [cmd=]:                   The file list command to run
117
-echo    -l [log=]:                   The log file to output to
118
-echo    -I:                          Builds an inverted index
119
-echo.
120
-

+ 0
- 191
dotfiles/vim/bundle/vim-gutentags/plat/win32/update_tags.cmd View File

@@ -1,191 +0,0 @@
1
-@echo off
2
-setlocal EnableExtensions EnableDelayedExpansion
3
-
4
-rem ==========================================
5
-rem            PARSE ARGUMENTS
6
-rem ==========================================
7
-
8
-set CTAGS_EXE=ctags
9
-set CTAGS_ARGS=
10
-set TAGS_FILE=tags
11
-set PROJECT_ROOT=
12
-set FILE_LIST_CMD=
13
-set FILE_LIST_CMD_IS_ABSOLUTE=0
14
-set UPDATED_SOURCE=
15
-set POST_PROCESS_CMD=
16
-set PAUSE_BEFORE_EXIT=0
17
-set LOG_FILE=
18
-
19
-:ParseArgs
20
-if [%1]==[] goto :DoneParseArgs
21
-if [%1]==[-e] (
22
-    set CTAGS_EXE=%~2
23
-    shift
24
-    goto :LoopParseArgs
25
-)
26
-if [%1]==[-x] (
27
-    set CTAGS_ARGS=%CTAGS_ARGS% --exclude=%2
28
-    shift
29
-    goto :LoopParseArgs
30
-)
31
-if [%1]==[-t] (
32
-    set TAGS_FILE=%~2
33
-    shift
34
-    goto :LoopParseArgs
35
-)
36
-if [%1]==[-p] (
37
-    set PROJECT_ROOT=%~2
38
-    shift
39
-    goto :LoopParseArgs
40
-)
41
-if [%1]==[-L] (
42
-    set FILE_LIST_CMD=%~2
43
-    shift
44
-    goto :LoopParseArgs
45
-)
46
-if [%1]==[-A] (
47
-    set FILE_LIST_CMD_IS_ABSOLUTE=1
48
-    goto :LoopParseArgs
49
-)
50
-if [%1]==[-s] (
51
-    set UPDATED_SOURCE=%~2
52
-    shift
53
-    goto :LoopParseArgs
54
-)
55
-if [%1]==[-c] (
56
-    set PAUSE_BEFORE_EXIT=1
57
-    goto :LoopParseArgs
58
-)
59
-if [%1]==[-l] (
60
-    set LOG_FILE=%~2
61
-    shift
62
-    goto :LoopParseArgs
63
-)
64
-if [%1]==[-o] (
65
-    set CTAGS_ARGS=%CTAGS_ARGS% --options=%2
66
-    shift
67
-    goto :LoopParseArgs
68
-)
69
-if [%1]==[-O] (
70
-    set CTAGS_ARGS=%CTAGS_ARGS% %~2
71
-    shift
72
-    goto :LoopParseArgs
73
-)
74
-if [%1]==[-P] (
75
-    set POST_PROCESS_CMD=%~2
76
-    shift
77
-    goto :LoopParseArgs
78
-)
79
-echo Invalid Argument: %1
80
-goto :Usage
81
-
82
-:LoopParseArgs
83
-shift
84
-goto :ParseArgs
85
-
86
-:DoneParseArgs
87
-
88
-
89
-rem ==========================================
90
-rem               GENERATE TAGS
91
-rem ==========================================
92
-
93
-if [%LOG_FILE%]==[] set LOG_FILE=CON
94
-
95
-echo Locking tags file... > %LOG_FILE%
96
-echo locked > "%TAGS_FILE%.lock"
97
-
98
-set INDEX_WHOLE_PROJECT=1
99
-if exist "%TAGS_FILE%" (
100
-    if not ["%UPDATED_SOURCE%"]==[""] (
101
-        echo Removing references to: %UPDATED_SOURCE% >> %LOG_FILE%
102
-        echo findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" ^> "%TAGS_FILE%.temp" >> %LOG_FILE%
103
-        findstr /V /C:"%UPDATED_SOURCE%" "%TAGS_FILE%" > "%TAGS_FILE%.temp"
104
-        set CTAGS_ARGS=%CTAGS_ARGS% --append "%UPDATED_SOURCE%"
105
-        set INDEX_WHOLE_PROJECT=0
106
-    )
107
-)
108
-if ["%INDEX_WHOLE_PROJECT%"]==["1"] (
109
-    if not ["%FILE_LIST_CMD%"]==[""] (
110
-        echo Running file list command >> %LOG_FILE%
111
-        set use_raw_list=0
112
-        if ["%PROJECT_ROOT%"]==["."] set use_raw_list=1
113
-        if ["%FILE_LIST_CMD_IS_ABSOLUTE%"]==["1"] set use_raw_list=1
114
-        rem No idea why we need to use delayed expansion here to make it work :(
115
-        if ["!use_raw_list!"]==["1"] (
116
-            echo call %FILE_LIST_CMD% ^> %TAGS_FILE%.files >> %LOG_FILE%
117
-            call %FILE_LIST_CMD% > %TAGS_FILE%.files
118
-        ) else (
119
-            rem Potentially useful:
120
-            rem http://stackoverflow.com/questions/9749071/cmd-iterate-stdin-piped-from-another-command
121
-            echo call %FILE_LIST_CMD% -- with loop for prepending project root >> %LOG_FILE%
122
-            type NUL > %TAGS_FILE%.files
123
-            for /F "usebackq delims=" %%F in (`%FILE_LIST_CMD%`) do @echo %PROJECT_ROOT%\%%F >> %TAGS_FILE%.files
124
-        )
125
-        set CTAGS_ARGS=%CTAGS_ARGS% -L %TAGS_FILE%.files
126
-    ) else (
127
-        set CTAGS_ARGS=%CTAGS_ARGS% "%PROJECT_ROOT%"
128
-    )
129
-)
130
-
131
-echo Running ctags >> %LOG_FILE%
132
-echo call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% >> %LOG_FILE%
133
-call "%CTAGS_EXE%" -f "%TAGS_FILE%.temp" %CTAGS_ARGS% >> %LOG_FILE% 2>&1
134
-if ERRORLEVEL 1 (
135
-    echo ERROR: Ctags executable returned non-zero code. >> %LOG_FILE%
136
-    goto :Unlock
137
-)
138
-
139
-if not ["%POST_PROCESS_CMD%"]==[""] (
140
-    echo Running post process >> %LOG_FILE%
141
-    echo call %POST_PROCESS_CMD% %TAGS_FILE%.temp >> %LOG_FILE%
142
-    call %POST_PROCESS_CMD% %TAGS_FILE%.temp >> %LOG_FILE% 2>&1
143
-    if ERRORLEVEL 1 (
144
-        echo ERROR: Post process returned non-zero code. >> %LOG_FILE%
145
-        goto :Unlock
146
-    )
147
-)
148
-
149
-echo Replacing tags file >> %LOG_FILE%
150
-echo move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE%
151
-move /Y "%TAGS_FILE%.temp" "%TAGS_FILE%" >> %LOG_FILE% 2>&1
152
-if ERRORLEVEL 1 (
153
-    echo ERROR: Unable to rename temp tags file into actual tags file. >> %LOG_FILE%
154
-    goto :Unlock
155
-)
156
-
157
-:Unlock
158
-echo Unlocking tags file... >> %LOG_FILE%
159
-del /F "%TAGS_FILE%.files" "%TAGS_FILE%.lock"
160
-if ERRORLEVEL 1 (
161
-    echo ERROR: Unable to remove file lock. >> %LOG_FILE%
162
-)
163
-
164
-echo Done. >> %LOG_FILE%
165
-if [%PAUSE_BEFORE_EXIT%]==[1] (
166
-    pause
167
-)
168
-
169
-goto :EOF
170
-
171
-
172
-rem ==========================================
173
-rem                 USAGE
174
-rem ==========================================
175
-
176
-:Usage
177
-echo Usage:
178
-echo    %~n0 ^<options^>
179
-echo.
180
-echo    -e [exe=ctags]: The ctags executable to run
181
-echo    -t [file=tags]: The path to the ctags file to update
182
-echo    -p [dir=]:      The path to the project root
183
-echo    -L [cmd=]:      The file list command to run
184
-echo    -A:             Specifies that the file list command returns
185
-echo                    absolute paths
186
-echo    -s [file=]:     The path to the source file that needs updating
187
-echo    -l [log=]:      The log file to output to
188
-echo    -o [options=]:  An options file to read additional options from
189
-echo    -c:             Ask for confirmation before exiting
190
-echo.
191
-

+ 0
- 114
dotfiles/vim/bundle/vim-gutentags/plugin/gutentags.vim View File

@@ -1,114 +0,0 @@
1
-" gutentags.vim - Automatic ctags management for Vim
2
-" Maintainer:   Ludovic Chabant <http://ludovic.chabant.com>
3
-" Version:      2.0.0
4
-
5
-" Globals {{{
6
-
7
-if (&cp || get(g:, 'gutentags_dont_load', 0))
8
-    finish
9
-endif
10
-
11
-if v:version < 704
12
-    echoerr "gutentags: this plugin requires vim >= 7.4."
13
-    finish
14
-endif
15
-
16
-if !(has('job') || (has('nvim') && exists('*jobwait')))
17
-    echoerr "gutentags: this plugin requires the job API from Vim8 or Neovim."
18
-    finish
19
-endif
20
-
21
-let g:gutentags_debug = get(g:, 'gutentags_debug', 0)
22
-
23
-if (exists('g:loaded_gutentags') && !g:gutentags_debug)
24
-    finish
25
-endif
26
-if (exists('g:loaded_gutentags') && g:gutentags_debug)
27
-    echom "Reloaded gutentags."
28
-endif
29
-let g:loaded_gutentags = 1
30
-
31
-let g:gutentags_trace = get(g:, 'gutentags_trace', 0)
32
-let g:gutentags_fake = get(g:, 'gutentags_fake', 0)
33
-let g:gutentags_background_update = get(g:, 'gutentags_background_update', 1)
34
-let g:gutentags_pause_after_update = get(g:, 'gutentags_pause_after_update', 0)
35
-let g:gutentags_enabled = get(g:, 'gutentags_enabled', 1)
36
-let g:gutentags_modules = get(g:, 'gutentags_modules', ['ctags'])
37
-
38
-let g:gutentags_init_user_func = get(g:, 'gutentags_init_user_func', 
39
-            \get(g:, 'gutentags_enabled_user_func', ''))
40
-
41
-let g:gutentags_add_ctrlp_root_markers = get(g:, 'gutentags_add_ctrlp_root_markers', 1)
42
-let g:gutentags_add_default_project_roots = get(g:, 'gutentags_add_default_project_roots', 1)
43
-let g:gutentags_project_root = get(g:, 'gutentags_project_root', [])
44
-if g:gutentags_add_default_project_roots
45
-    let g:gutentags_project_root += ['.git', '.hg', '.svn', '.bzr', '_darcs', '_FOSSIL_', '.fslckout']
46
-endif
47
-
48
-let g:gutentags_project_root_finder = get(g:, 'gutentags_project_root_finder', '')
49
-
50
-let g:gutentags_project_info = get(g:, 'gutentags_project_info', [])
51
-call add(g:gutentags_project_info, {'type': 'python', 'file': 'setup.py'})
52
-call add(g:gutentags_project_info, {'type': 'ruby', 'file': 'Gemfile'})
53
-
54
-let g:gutentags_exclude_filetypes = get(g:, 'gutentags_exclude_filetypes', [])
55
-let g:gutentags_exclude_project_root = get(g:, 'gutentags_exclude_project_root', ['/usr/local'])
56
-let g:gutentags_resolve_symlinks = get(g:, 'gutentags_resolve_symlinks', 0)
57
-let g:gutentags_generate_on_new = get(g:, 'gutentags_generate_on_new', 1)
58
-let g:gutentags_generate_on_missing = get(g:, 'gutentags_generate_on_missing', 1)
59
-let g:gutentags_generate_on_write = get(g:, 'gutentags_generate_on_write', 1)
60
-let g:gutentags_generate_on_empty_buffer = get(g:, 'gutentags_generate_on_empty_buffer', 0)
61
-let g:gutentags_file_list_command = get(g:, 'gutentags_file_list_command', '')
62
-
63
-let g:gutentags_use_jobs = get(g:, 'gutentags_use_jobs', has('job'))
64
-
65
-if !exists('g:gutentags_cache_dir')
66
-    let g:gutentags_cache_dir = ''
67
-elseif !empty(g:gutentags_cache_dir)
68
-    " Make sure we get an absolute/resolved path (e.g. expanding `~/`), and
69
-    " strip any trailing slash.
70
-    let g:gutentags_cache_dir = fnamemodify(g:gutentags_cache_dir, ':p')
71
-    let g:gutentags_cache_dir = fnamemodify(g:gutentags_cache_dir, ':s?[/\\]$??')
72
-endif
73
-
74
-let g:gutentags_define_advanced_commands = get(g:, 'gutentags_define_advanced_commands', 0)
75
-
76
-if g:gutentags_cache_dir != '' && !isdirectory(g:gutentags_cache_dir)
77
-    call mkdir(g:gutentags_cache_dir, 'p')
78
-endif
79
-
80
-if has('win32')
81
-    let g:gutentags_plat_dir = expand('<sfile>:h:h:p') . "\\plat\\win32\\"
82
-    let g:gutentags_res_dir = expand('<sfile>:h:h:p') . "\\res\\"
83
-    let g:gutentags_script_ext = '.cmd'
84
-else
85
-    let g:gutentags_plat_dir = expand('<sfile>:h:h:p') . '/plat/unix/'
86
-    let g:gutentags_res_dir = expand('<sfile>:h:h:p') . '/res/'
87
-    let g:gutentags_script_ext = '.sh'
88
-endif
89
-
90
-" }}}
91
-
92
-" Gutentags Setup {{{
93
-
94
-augroup gutentags_detect
95
-    autocmd!
96
-    autocmd BufNewFile,BufReadPost *  call gutentags#setup_gutentags()
97
-    autocmd VimEnter               *  if expand('<amatch>')==''|call gutentags#setup_gutentags()|endif
98
-augroup end
99
-
100
-" }}}
101
-
102
-" Toggles and Miscellaneous Commands {{{
103
-
104
-if g:gutentags_define_advanced_commands
105
-    command! GutentagsToggleEnabled :let g:gutentags_enabled=!g:gutentags_enabled
106
-    command! GutentagsToggleTrace   :call gutentags#toggletrace()
107
-endif
108
-
109
-if g:gutentags_debug
110
-    command! GutentagsToggleFake    :call gutentags#fake()
111
-endif
112
-
113
-" }}}
114
-

+ 0
- 2
dotfiles/vim/bundle/vim-gutentags/res/ctags_recursive.options View File

@@ -1,2 +0,0 @@
1
---recurse=yes
2
-

+ 0
- 1
dotfiles/vim/bundle/vim-jinja

@@ -1 +0,0 @@
1
-Subproject commit 8d330a7aaf0763d080dc82204b4aaba6ac0605c6

+ 0
- 1
dotfiles/vim/bundle/vim-less

@@ -1 +0,0 @@
1
-Subproject commit 6e818d5614d5fc18d95a48c92b89e6db39f9e3d6

+ 0
- 1
dotfiles/vim/bundle/vim-markdown

@@ -1 +0,0 @@
1
-Subproject commit da5a7ac96f517e0fd6f886bc3fbe27156ca1f946

+ 0
- 3
dotfiles/vim/bundle/vim-moin/filetype.vim View File

@@ -1,3 +0,0 @@
1
-augroup filetypedetect
2
-au BufNewFile,BufRead *.moin setf moin
3
-augroup END

+ 0
- 143
dotfiles/vim/bundle/vim-moin/syntax/moin.vim View File

@@ -1,143 +0,0 @@
1
-" Vim syntax file
2
-" Language:     MoinMoin
3
-" Maintainer:   Michael Lamertz <mike@perl-ronin.de>
4
-" Contributors: David O'Callaghan <david.ocallaghan@cs.tcd.ie>
5
-"               Tony Garland <Tony.Garland@fluke.com>
6
-"               Ingo Karkat <ingo@karkat.de>
7
-" Last Change:  27-Jan-2008
8
-"   27-Jan-2008 Incorporated syntax changes of MoinMoin 1.6; the
9
-"               syntax version is configurable via g:moin_version (globally) or
10
-"               b:moin_version (for the current buffer only). 
11
-"               Small BFs: 'elsif', 'did_acedb_...'.
12
-"   22-Aug-2007 Added moinEmbedded highlighting. 
13
-"   08-May-2007 Added contains=@NoSpell for URLs, Email, pragmas and
14
-"               (configurable via g:moin_spell_wikiwords) WikiWords. 
15
-
16
-" Bugs:         Parsing of mixed bold-italic not yet implemented
17
-"               Tables not yet implemented
18
-
19
-if version < 600
20
-    syntax clear
21
-elseif exists("b:current_syntax")
22
-    finish
23
-endif
24
-
25
-function! s:GetMoinVersion()
26
-    if exists('b:moin_version')
27
-        return b:moin_version
28
-    elseif exists('g:moin_version')
29
-        return g:moin_version
30
-    else
31
-        return 999
32
-    endif
33
-endfunction
34
-
35
-" headings
36
-syn match       moinHeader              /^\(=\{1,5}\).*\1$/
37
-
38
-" inline markup
39
-syn match       moinItalic              /\('\{2}\)[^']\+\1/
40
-syn match       moinBold                /\('\{3}\)[^']\+\1/
41
-syn match       moinBoldItalic          /\('\{5}\)[^']\+\1/
42
-syn match       moinUnderline           /\(_\{2}\).\{-}\1/
43
-syn match       moinSubscript           /\(,\{2}\).\{-}\1/
44
-syn match       moinSuperscript         /\(\^\).\{-}\1/
45
-syn match       moinTypewriter          /\(`\).\{-}\1/
46
-if s:GetMoinVersion() < 160
47
-    syn match       moinMacro               /\[\{2}.\{-}\]\{2}/
48
-else
49
-    syn match       moinMacro               /<\{2}.\{-}>\{2}/
50
-endif
51
-
52
-" Codeblocks
53
-syn region      moinPreformatted        start=/{{{/ end=/}}}/
54
-
55
-" Links
56
-if exists('g:moin_spell_wikiwords')
57
-    syn match       moinWikiWord            /\(\w\+:\)\?\u[a-z0-9]\+\u[a-z0-9]\+\(\u[a-z0-9]\+\)*/
58
-    syn match       moinSubLink             /\(\w\+\|\.\.\)\?\// nextgroup=moinWikiWord
59
-else
60
-    syn match       moinWikiWord            /\(\w\+:\)\?\u[a-z0-9]\+\u[a-z0-9]\+\(\u[a-z0-9]\+\)*/ contains=@NoSpell
61
-    syn match       moinSubLink             /\(\w\+\|\.\.\)\?\// nextgroup=moinWikiWord contains=@NoSpell
62
-endif
63
-syn match       moinNormalURL           /\w\+:\/\/\S\+/ contains=@NoSpell
64
-syn match       moinEmail               /\S\+@\S\+/ contains=@NoSpell
65
-if s:GetMoinVersion() < 160
66
-    syn match       moinBracketLink         /\[[^[\]]\+\]/ contains=@NoSpell
67
-    syn match       moinEmbedded            /attachment:\S\+/ contains=@NoSpell
68
-    syn match       moinEmbedded            /inline:\S\+/ contains=@NoSpell
69
-else
70
-    syn match       moinBracketLink         /\[\{2}.\{-}\]\{2}/ contains=@NoSpell
71
-    syn match       moinEmbedded            /{\{2}[^{].\{-}}\{2}/ contains=@NoSpell
72
-endif
73
-
74
-
75
-" lists
76
-syn match       moinBulletList          /^\(\s\+\)\zs\*\ze\s/
77
-syn match       moinNumberedList        /^\(\s\+\)\zs1\.\ze\s/
78
-syn match       moinAlphalist           /^\(\s\+\)\zsa\.\ze\s/
79
-syn match       moinRomanlist           /^\(\s\+\)\zsi\.\ze\s/
80
-syn match       moinBigromanlist        /^\(\s\+\)\zsI\.\ze\s/
81
-syn match       moinDescriptionlist     /^\(\s\+\)\zs.\{-}::\ze\s/
82
-
83
-" rules
84
-syn match       moinRule                /^-\{4,}/
85
-
86
-" comments/pragmas
87
-syn match       moinComment             /^##.*$/
88
-syn match       moinPragma              /^#\w\+.*$/ contains=@NoSpell
89
-
90
-" variables
91
-syn match       moinVariable            /@\w\+@/
92
-
93
-
94
-" Define the default highlighting.
95
-" For version 5.7 and earlier: only when not done already
96
-" For version 5.8 and later: only when an item doesn't have highlighting yet
97
-if version >= 508 || !exists("did_moin_syn_inits")
98
-    if version < 508
99
-        let did_moin_syn_inits = 1
100
-        command -nargs=+ HiLink hi link <args>
101
-    else
102
-        command -nargs=+ HiLink hi def link <args>
103
-    endif
104
-
105
-    HiLink      moinHeader              Function
106
-
107
-    HiLink      moinItalic              Identifier
108
-    HiLink      moinBold                Identifier
109
-    HiLink      moinBoldItalic          Identifier
110
-    HiLink      moinUnderline           Identifier
111
-    HiLink      moinSubscript           Identifier
112
-    HiLink      moinSuperscript         Identifier
113
-    HiLink      moinTypewriter          Identifier
114
-    HiLink      moinMacro               Define
115
-    HiLink      moinPragma              Define
116
-    HiLink      moinEmbedded            Include
117
-
118
-    HiLink      moinPreformatted        String
119
-
120
-    HiLink      moinWikiWord            Statement
121
-    HiLink      moinBracketLink         Statement
122
-    HiLink      moinNormalURL           Statement
123
-    HiLink      moinSubLink             Statement
124
-    HiLink      moinInterLink           Statement
125
-    HiLink      moinEmail               Statement
126
-
127
-    HiLink      moinBulletList          Type
128
-    HiLink      moinNumberedList        Type
129
-    HiLink      moinAlphalist           Type
130
-    HiLink      moinRomanlist           Type
131
-    HiLink      moinBigromanlist        Type
132
-    HiLink      moinDescriptionlist     Type
133
-
134
-    HiLink      moinRule                Special
135
-
136
-    HiLink      moinComment             Comment
137
-
138
-    HiLink      moinVariable            Macro
139
-
140
-    delcommand HiLink
141
-endif
142
-
143
-let b:current_syntax = "moin"

+ 0
- 1
dotfiles/vim/bundle/vim-pairs

@@ -1 +0,0 @@
1
-Subproject commit 997380116fe00cd5c250efaf269c70e4e0006880

+ 0
- 1
dotfiles/vim/bundle/vim-swap

@@ -1 +0,0 @@
1
-Subproject commit 0906e48d0bfaa8ada4c594dcfb0913bf352c4124

+ 0
- 1
dotfiles/vim/bundle/vimtodo

@@ -1 +0,0 @@
1
-Subproject commit d977c98e5d6a7a5dfb75a7a4faed3e88865031bc

+ 0
- 187
dotfiles/vim/plugin/local_vimrc.vim View File

@@ -1,187 +0,0 @@
1
-"=============================================================================
2
-" $Id$
3
-" File:		plugin/local_vimrc.vim                                     {{{1
4
-" Author:	Luc Hermitte <EMAIL:hermitte {at} free {dot} fr>
5
-"		<URL:http://code.google.com/p/lh-vim/>
6
-" Version:	1.10
7
-" Created:	09th Apr 2003
8
-" Last Update:	10th Apr 2012
9
-" License:      GPLv3
10
-"------------------------------------------------------------------------
11
-" Description:	Solution to Yakov Lerner's question on Vim ML {{{2
12
-"	Search for a _vimrc_local.vim file in the parents directories and
13
-"	source it if found.
14
-"
15
-"	Initial Question:
16
-"	"Is it possible, after sourcing ~/.exrc, to traverse from $HOME down
17
-"	 to cwd, and source .exrc from every directory if present ?
18
-"	 (And if cwd is not under $HOME, just source ~/.exrc).
19
-"	 What do I put into .vimrc to do this ?
20
-" 
21
-"	"Example: current dir is ~/a/b/c. Files are sourced in this order:
22
-"	 ~/.exrc, then ~/a/.exrc, ~/a/b/.exrc, ~/a/b/c/.exrc.
23
-"	 No messages if some of .exrc does not exist."
24
-" }}}2
25
-"------------------------------------------------------------------------
26
-" Installation:	{{{2
27
-" 	0- Set g:local_vimrc in your .vimrc if you wish to use filenames other
28
-" 	   than '_vimrc_local.vim'
29
-" 	a- Drop this plugin into a {rtp}/plugin/ directory, and install
30
-" 	   lh-vim-lib.
31
-" 	b- Define _vimrc_local.vim files into your directories
32
-"
33
-" 	   Ideally, each foo/bar/_vimrc_local.vim should be defined the same
34
-" 	   way as a ftplugin, i.e.: {{{3
35
-"		" Global stuff that needs to be updated/override
36
-"		let g:bar = 'bar'  " YES! This is a global variable!
37
-"		
38
-"		" Local stuff that needs to be defined once for each buffer
39
-"		if exists('b:foo_bar_local_vimrc') | finish | endif
40
-"		let b:foo_bar_local_vimrc = 1
41
-"		setlocal xxx
42
-"		nnoremap <buffer> foo :call <sid>s:Foo()<cr>
43
-"		let b:foo = 'foo'
44
-"		
45
-"		" Global stuff that needs to be defined once only => functions
46
-"		if exists('g:foo_bar_local_vimrc') | finish | endif
47
-"		let g:foo_bar_local_vimrc = 1
48
-"		function s:Foo()
49
-"		  ...
50
-"		endfunction
51
-"	c- In order to load the local variable before a skeleton is read, ask
52
-"	   the maintainer of template-file expander pluin to explicitly execute
53
-"	   :SourceLocalVimrc before doing the actual expansion.
54
-"
55
-" History:	{{{2
56
-"	v1.10   s:k_version in local_vimrc files is automatically incremented
57
-"	        on saving
58
-"	v1.9    New command :SourceLocalVimrc in order to explicitly load the
59
-"	        local-vimrc file before creating new files from a template (We
60
-"	        can't just rely on BufNewFile as there is no guaranty
61
-"	        local_vimrc's BufNewFile will be called before the one from the
62
-"	        Template Expander Plugin => it's up to the TEP to call the
63
-"	        function)
64
-"	v1.8    No more infinite recursion on file in non existent paths.
65
-"	        + patch from cristiklein to support paths with spaces
66
-"	v1.7    Don't search a local vimrc with remote paths (ftp://, http, ... )
67
-"	v1.6    Sometimes root path is Z:\\, which is quite odd
68
-"	v1.5    The auto-command is moved to the au-group LocalVimrc
69
-"	v1.4	Stop the recursion when we get to // or \\ (UNC paths)
70
-"	v1.3    More comments.
71
-"	        Trace of the directories searched when 'verbose' >= 2
72
-"	v1.2	Stops at $HOME or at root (/)
73
-" 	v1.1	Uses _vimrc_local.vim
74
-" 	v1.0	Initial solution
75
-" TODO:		{{{2
76
-" 	(*) Add option to stop looking at $HOME or elsewhere
77
-" 	    ([bg]:lv_stop_at : string, default $HOME) 
78
-" See also: alternative scripts: #441, #3393, #1860, ...
79
-" }}}1
80
-"=============================================================================
81
-
82
-"=============================================================================
83
-" Avoid global reinclusion {{{1
84
-let s:k_version = 109
85
-if exists("g:loaded_local_vimrc") 
86
-      \ && (g:loaded_local_vimrc >= s:k_version)
87
-      \ && !exists('g:force_reload_local_vimrc')
88
-  finish 
89
-endif
90
-let g:loaded_local_vimrc_vim = s:k_version
91
-let s:cpo_save=&cpo
92
-set cpo&vim
93
-" Avoid global reinclusion }}}1
94
-"------------------------------------------------------------------------
95
-" Commands {{{1
96
-command! -nargs=0 SourceLocalVimrc call s:Main(expand('%:p'))
97
-
98
-" Functions {{{1
99
-" Name of the files used                                              {{{2
100
-function! s:LocalVimrcName()
101
-  return exists('g:local_vimrc') ? g:local_vimrc : '_vimrc_local.vim'
102
-endfunction
103
-
104
-let s:local_vimrc = s:LocalVimrcName()
105
-
106
-" Value of $HOME -- actually a regex.                                 {{{2
107
-let s:home = substitute($HOME, '/\|\\', '[/\\\\]', 'g')
108
-
109
-" Regex used to determine when we must stop looking for local-vimrc's {{{2
110
-" Sometimes paths appears as Z:\\ ....
111
-let s:re_last_path = '^/\=$\|^[A-Za-z]:[/\\]\+$\|^//$\|^\\\\$'. 
112
-      \ ((s:home != '') ? ('\|^'.s:home.'$') : '')
113
-
114
-" The main function                                                   {{{2
115
-function! s:SourceLocal(path)
116
-  let up_path = fnamemodify(a:path,':h')
117
-  if up_path == '.' " likelly a non existant path
118
-    if ! isdirectory(a:path)
119
-      call lh#common#warning_msg("[local_vimrc] The current file '".expand('%:p:')."' seems to be in a non-existant directory: '".a:path."'")
120
-    endif
121
-    let up_path = getcwd()
122
-  endif
123
-  " call confirm('crt='.a:path."\nup=".up_path."\n$HOME=".s:home, '&Ok', 1)
124
-  " echomsg ('crt='.a:path."\nup=".up_path."\n$HOME=".s:home)
125
-  if (a:path !~ s:re_last_path)
126
-    if (up_path !~ s:re_last_path)
127
-      " Recursive call: first check the parent directory
128
-      call s:SourceLocal(up_path)
129
-    elseif filereadable(up_path.'/'.s:local_vimrc)
130
-      " Terminal condition: try to source the upper(/uppest?) local-vimrc
131
-      if &verbose >= 2
132
-	echo 'Check '.up_path.' for '.s:local_vimrc.' ... found!'
133
-      endif
134
-      exe 'source '.escape(up_path.'/'.s:local_vimrc, ' \$,')
135
-    elseif &verbose >= 2
136
-      echo 'Check '.up_path.' for '.s:local_vimrc.' ... none!'
137
-    endif
138
-  endif
139
-
140
-  " In all case, try to source the local-vimrc present in the directory
141
-  " currently considered
142
-  if filereadable(a:path.'/'.s:local_vimrc)
143
-    if &verbose >= 2
144
-      echo 'Check '.a:path.' for '.s:local_vimrc.' ... found!'
145
-    endif
146
-    exe 'source '.escape(a:path.'/'.s:local_vimrc, ' \$,')
147
-  elseif &verbose >= 2
148
-    echo 'Check '.a:path.' for '.s:local_vimrc.' ... none!'
149
-  endif
150
-endfunction
151
-
152
-function! s:CheckForbiddenPath(path)
153
-  let ok = a:path !~ '^\(s\=ftp:\|s\=http:\|scp:\|^$\)'
154
-  return ok
155
-endfunction
156
-
157
-function! s:Main(path)
158
-  " echomsg 'Sourcing: '.a:path
159
-  if !s:CheckForbiddenPath(a:path) 
160
-    return
161
-  else
162
-    call s:SourceLocal(a:path)
163
-  endif
164
-endfunction
165
-
166
-" Update s:k_version in local_vimrc files                             {{{2
167
-function! s:IncrementVersionOnSave()
168
-  let l = search('let s:k_version', 'n')
169
-  if l > 0
170
-    let nl = substitute(getline(l), '\(let\s\+s:k_version\s*=\s*\)\(\d\+\)\s*$', '\=submatch(1).(1+submatch(2))', '')
171
-    call setline(l, nl)
172
-  endif
173
-endfunction
174
-
175
-" Auto-command                                                        {{{2
176
-" => automate the loading of local-vimrc's every time we change buffers 
177
-aug LocalVimrc
178
-  au!
179
-  au BufEnter * :call s:Main(expand('<afile>:p:h'))
180
-  exe 'au BufWritePre '.s:local_vimrc . ' call s:IncrementVersionOnSave()'
181
-aug END
182
-
183
-" Functions }}}1
184
-"------------------------------------------------------------------------
185
-let &cpo=s:cpo_save
186
-"=============================================================================
187
-" vim600: set fdm=marker:

+ 0
- 22
dotfiles/vim/vimrc View File

@@ -3,46 +3,24 @@
3 3
 " ....... "
4 4
 " PLUGINS "
5 5
 " ''''''' "
6
-execute pathogen#infect()
7 6
 
8 7
 let g:netrw_banner=0
9 8
 let g:netrw_liststyle=3
10 9
 
11
-let g:gutentags_exclude_project_root=['/home/amahdal/vcs.tests/distribution']
12
-let g:gutentags_ctags_tagfile='.git/tags'
13
-
14 10
 let g:local_vimrc=".vimrc_local.vim"
15 11
 let python_highlight_all = 1
16 12
 let g:vim_markdown_folding_disabled=1
17 13
 let g:swap_custom_ops = ['and', 'or']
18 14
 
19
-nmap <F6> :SyntasticCheck<CR>
20
-
21 15
 set statusline+=%#warningmsg#
22
-set statusline+=%{SyntasticStatuslineFlag()}
23 16
 set statusline+=%*
24 17
 
25
-let g:syntastic_always_populate_loc_list = 1
26
-let g:syntastic_auto_loc_list = 0
27
-let g:syntastic_check_on_open = 0
28
-let g:syntastic_check_on_wq = 0
29
-
30
-let g:syntastic_mode_map = {
31
-  \ "mode": "active",
32
-  \ "active_filetypes": ["bash"],
33
-  \ "passive_filetypes": ["python"] }
34
-
35
-let g:syntastic_check_on_open = 1
36
-let g:syntastic_lua_checkers = ["luac", "luacheck"]
37
-let g:syntastic_lua_luacheck_args = "--no-unused-args"
38
-
39 18
 let g:gitgutter_sign_added = '✚'
40 19
 let g:gitgutter_sign_modified = '❱'
41 20
 let g:gitgutter_sign_removed = '❌'
42 21
 let g:gitgutter_sign_removed_first_line = '^'
43 22
 let g:gitgutter_sign_modified_removed = '❰'
44 23
 
45
-let g:airline_theme = 'zenburn'
46 24
 
47 25
 
48 26
 " ..................... "