Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Version 0.6

- [gbw]tselectfiles_prefix: Remove prefix from filenames in list
- [gbw]tselectfiles_limit variable
- [wbg]:tselectfiles_filter_rx is used only when no directory is given on the command line.
- Require tlib >= 0.18
- If the filename matches an entry in g:tselectfiles_filedescription_rx, use the expression there to construct a file description (eg the file's first line)
- Option to run vimgrep on selected files.
- tselectfiles#BaseFilter(): Set b:tselectfiles_filter_rx to something useful.
- tselectfiles#BaseFilter(): takes 2 optional arguments to substitute a rx in the current buffer's filename.
- tselectfiles_filter_rx: Set as array
- Problem when browsing single directories
  • Loading branch information...
commit c7828f4bb72c92b9616cc5bed1518b76a6b43bc7 1 parent a3dae2c
Tom Link authored October 05, 2008 vim-scripts committed October 17, 2010
457  autoload/tselectfiles.vim
... ...
@@ -0,0 +1,457 @@
  1
+" tselectfiles.vim
  2
+" @Author:      Thomas Link (mailto:micathom AT gmail com?subject=[vim])
  3
+" @Website:     http://www.vim.org/account/profile.php?user_id=4037
  4
+" @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
  5
+" @Created:     2007-10-15.
  6
+" @Last Change: 2008-10-03.
  7
+" @Revision:    0.0.179
  8
+
  9
+if &cp || exists("loaded_tselectfiles_autoload")
  10
+    finish
  11
+endif
  12
+let loaded_tselectfiles_autoload = 1
  13
+
  14
+
  15
+let s:select_files_files = {}
  16
+
  17
+
  18
+function! s:CacheID() "{{{3
  19
+    return s:select_files_dir . string(s:select_files_pattern)
  20
+endf
  21
+
  22
+
  23
+function! s:PrepareSelectFiles(hide)
  24
+    " TLogVAR a:hide
  25
+    " let filter = s:select_files_dir . s:select_files_pattern.pattern
  26
+    " TLogVAR filter
  27
+    let rv = []
  28
+    for pattern in s:select_files_pattern.pattern
  29
+        let rv += split(globpath(s:select_files_dir, pattern), '\n')
  30
+    endfor
  31
+    " TLogVAR rv
  32
+    if a:hide
  33
+        call filter(rv, 'v:val !~ g:tselectfiles_hidden_rx')
  34
+    endif
  35
+    " call TLogDBG(string(s:select_files_pattern))
  36
+    if s:select_files_pattern.mode == 'r'
  37
+        if s:select_files_pattern.limit == 0
  38
+            call sort(filter(rv, '!isdirectory(v:val)'))
  39
+        else
  40
+            call sort(map(rv, 'isdirectory(v:val) ? tlib#dir#CanonicName(v:val) : v:val'))
  41
+            if !empty(get(s:select_files_pattern, 'predecessor', ''))
  42
+                " call TLogDBG(get(s:select_files_pattern, 'predecessor'))
  43
+                call insert(rv, tlib#dir#CanonicName(s:select_files_pattern.predecessor))
  44
+            endif
  45
+        endif
  46
+    else
  47
+        call sort(map(rv, 'isdirectory(v:val) ? v:val."/" : v:val'))
  48
+        let rv += g:tselectfiles_favourites
  49
+        " TLogVAR rv
  50
+        " call TLogDBG(string(split(s:select_files_dir, '[^\\]\zs,')))
  51
+        for phf in split(s:select_files_dir, '[^\\]\zs,')
  52
+            let ph = tlib#dir#CanonicName(fnamemodify(tlib#dir#PlainName(phf), ':h'))
  53
+            " TLogVAR ph, phf
  54
+            " call TLogDBG(s:select_files_dir)
  55
+            if ph != tlib#dir#CanonicName(phf)
  56
+                " TLogVAR ph, phf
  57
+                " call insert(rv, ph .'../')
  58
+                call insert(rv, ph)
  59
+            endif
  60
+        endfor
  61
+    endif
  62
+    return rv
  63
+endf
  64
+
  65
+
  66
+function! s:UseCache() "{{{3
  67
+    let use_cache = tlib#var#Get('tselectfiles_use_cache', 'bg')
  68
+    let no_cache  = tlib#var#Get('tselectfiles_no_cache_rx', 'bg')
  69
+    let rv = use_cache && (empty(no_cache) || s:select_files_dir !~ no_cache)
  70
+    " TLogVAR rv
  71
+    return rv
  72
+endf
  73
+
  74
+
  75
+function! tselectfiles#GetFileList(world, mode, hide)
  76
+    if s:UseCache()
  77
+        let id = s:CacheID()
  78
+        if a:mode =~ '\(!\|\d\)$' || a:mode == 'scan' || !has_key(s:select_files_files, id)
  79
+            if a:mode =~ '!$'
  80
+                let s:select_files_files = {}
  81
+            endif
  82
+            " TLogVAR id
  83
+            let s:select_files_files[id] = s:PrepareSelectFiles(a:hide)
  84
+        endif
  85
+        let rv = s:select_files_files[id]
  86
+    else
  87
+        let rv = s:PrepareSelectFiles(a:hide)
  88
+    endif
  89
+    let a:world.base = rv
  90
+    " TLogVAR a:world.base
  91
+    " let a:world.files = rv
  92
+    " let a:world.base  = map(copy(rv), 'tselectfiles#FormatEntry(a:world, v:val)')
  93
+endf
  94
+
  95
+
  96
+function! tselectfiles#AgentPostprocess(world, result)
  97
+    if a:result[0 : 2] == '...'
  98
+        let item = s:select_files_prefix . a:result[3 : -1]
  99
+    else
  100
+        let item = a:result
  101
+    endif
  102
+    let item = resolve(item)
  103
+    " TLogVAR item
  104
+    " TLogDBG len(a:world.list)
  105
+    if isdirectory(item)
  106
+        if s:select_files_pattern.limit > 0
  107
+            let s:select_files_pattern.predecessor = s:select_files_dir
  108
+        endif
  109
+        let s:select_files_dir = fnamemodify(item, ':p')
  110
+        return [s:ResetInputList(a:world, ''), '']
  111
+    endif
  112
+    return [a:world, item]
  113
+endf
  114
+
  115
+
  116
+function! tselectfiles#AgentOpenDir(world, selected)
  117
+    let dir = input('DIR: ', '', 'dir')
  118
+    echo
  119
+    if dir != ''
  120
+        let s:select_files_dir = fnamemodify(dir, ':p')
  121
+        return s:ResetInputList(a:world, '')
  122
+    endif
  123
+    return a:world
  124
+endf
  125
+
  126
+
  127
+" function! tselectfiles#AgentSelect(world, selected) "{{{3
  128
+"     let fname = a:world.GetBaseItem(a:world.prefidx)
  129
+"     if !filereadable(fname) && s:UseCache()
  130
+"         echom 'TSelectFile: Out-dated cache? File not readable: '. fname
  131
+"         return s:ResetInputList(a:world)
  132
+"     else
  133
+"         call a:world.SelectItem('toggle', a:world.prefidx)
  134
+"         " let a:world.state = 'display keepcursor'
  135
+"         let a:world.state = 'redisplay'
  136
+"         return a:world
  137
+"     endif
  138
+" endf
  139
+
  140
+
  141
+function! tselectfiles#AgentReset(world, selected) "{{{3
  142
+    return s:ResetInputList(a:world)
  143
+endf
  144
+
  145
+
  146
+function! s:DeleteFile(file)
  147
+    let doit = input('Really delete file '. string(a:file) .'? (y/N) ', s:delete_this_file_default)
  148
+    echo
  149
+    if doit ==? 'y'
  150
+        if doit ==# 'Y'
  151
+            let s:delete_this_file_default = 'y'
  152
+        endif
  153
+        call delete(a:file)
  154
+        echom 'Delete file: '. a:file
  155
+        let bn = bufnr(a:file)
  156
+        if bn != -1 && bufloaded(bn)
  157
+            let doit = input('Delete corresponding buffer '. bn .' too? (y/N) ')
  158
+            if doit ==? 'y'
  159
+                exec 'bdelete '. bn
  160
+            endif
  161
+        endif
  162
+    endif
  163
+endf
  164
+
  165
+
  166
+function! tselectfiles#AgentDeleteFile(world, selected)
  167
+    call a:world.CloseScratch()
  168
+    let s:delete_this_file_default = ''
  169
+    for file in a:selected
  170
+        call s:DeleteFile(file)
  171
+    endfor
  172
+    return s:ResetInputList(a:world)
  173
+endf
  174
+
  175
+
  176
+function! tselectfiles#Grep(world, selected)
  177
+    let grep_pattern = input('Grep pattern: ')
  178
+    if !empty(grep_pattern)
  179
+        call a:world.CloseScratch()
  180
+        cexpr []
  181
+        for filename in a:selected
  182
+            if filereadable(filename)
  183
+                " TLogVAR filename
  184
+                exec 'silent! vimgrepadd /'. escape(grep_pattern, '/') .'/j '. tlib#arg#Ex(filename)
  185
+            endif
  186
+        endfor
  187
+        if !empty(getqflist()) && !empty(g:tselectfiles_show_quickfix_list)
  188
+            exec g:tselectfiles_show_quickfix_list
  189
+        endif
  190
+    endif
  191
+    call a:world.ResetSelected()
  192
+    return a:world
  193
+endf
  194
+
  195
+
  196
+function! s:Preview(file) "{{{3
  197
+    exec 'pedit '. escape(a:file, '%# ')
  198
+    let s:tselectfiles_previewedfile = a:file
  199
+endf
  200
+
  201
+
  202
+function! s:ClosePreview() "{{{3
  203
+    if exists('s:tselectfiles_previewedfile')
  204
+        pclose
  205
+        unlet! s:tselectfiles_previewedfile
  206
+    endif
  207
+endf
  208
+
  209
+
  210
+function! tselectfiles#ViewFile(world, selected) "{{{3
  211
+    " TLogVAR a:selected
  212
+    if empty(a:selected)
  213
+        call a:world.RestoreOrigin()
  214
+        return a:world
  215
+    else
  216
+        call a:world.SetOrigin()
  217
+        return tlib#agent#ViewFile(a:world, a:selected)
  218
+    endif
  219
+endf
  220
+
  221
+
  222
+function! tselectfiles#AgentPreviewFile(world, selected)
  223
+    let file = a:selected[0]
  224
+    if !exists('s:tselectfiles_previewedfile') || file != s:tselectfiles_previewedfile
  225
+        call s:Preview(file)
  226
+        let a:world.state = 'redisplay'
  227
+    else
  228
+        call s:ClosePreview()
  229
+        let a:world.state = 'display'
  230
+    endif
  231
+    return a:world
  232
+endf
  233
+
  234
+
  235
+function! s:ConfirmCopyMove(query, src, dest)
  236
+    echo
  237
+    echo 'From: '. a:src
  238
+    echo 'To:   '. a:dest
  239
+    let ok = input(a:query .'(y/n) ', 'y')
  240
+    echo
  241
+    return ok[0] ==? 'y'
  242
+endf
  243
+
  244
+
  245
+function! s:CopyFile(src, dest, confirm)
  246
+    if a:src != '' && a:dest != '' && (!a:confirm || s:ConfirmCopyMove('Copy now?', a:src, a:dest))
  247
+        let fc = readfile(a:src, 'b')
  248
+        if writefile(fc, a:dest, 'b') == 0
  249
+            echom 'Copy file "'. a:src .'" -> "'. a:dest
  250
+        else
  251
+            echom 'Failed: Copy file "'. a:src .'" -> "'. a:dest
  252
+        endif
  253
+    endif
  254
+endf
  255
+
  256
+
  257
+function! tselectfiles#AgentCopyFile(world, selected)
  258
+    for file in a:selected
  259
+        let name = input('Copy "'. file .'" to: ', file)
  260
+        echo
  261
+        call s:CopyFile(file, name, 0)
  262
+    endfor
  263
+    return s:ResetInputList(a:world)
  264
+endf
  265
+
  266
+
  267
+function! s:RenameFile(file, name, confirm)
  268
+    if a:name != '' && (!a:confirm || s:ConfirmCopyMove('Rename now?', a:file, a:name))
  269
+        call rename(a:file, a:name)
  270
+        echom 'Rename file "'. a:file .'" -> "'. a:name
  271
+        if bufloaded(a:file)
  272
+            exec 'buffer! '. bufnr('^'. a:file .'$')
  273
+            exec 'file! '. tlib#arg#Ex(a:name)
  274
+            echom 'Rename buffer: '. a:file .' -> '. a:name
  275
+        endif
  276
+    endif
  277
+endf
  278
+
  279
+
  280
+function! tselectfiles#AgentRenameFile(world, selected)
  281
+    let s:rename_this_file_pattern = ''
  282
+    let s:rename_this_file_subst   = ''
  283
+    call a:world.CloseScratch()
  284
+    for file in a:selected
  285
+        let name = input('Rename "'. file .'" to: ', file)
  286
+        echo
  287
+        call s:RenameFile(file, name, 0)
  288
+    endfor
  289
+    return s:ResetInputList(a:world)
  290
+endf
  291
+
  292
+function! tselectfiles#AgentBatchRenameFile(world, selected)
  293
+    let pattern = input('Rename pattern (whole path): ')
  294
+    if pattern != ''
  295
+        echo 'Pattern: '. pattern
  296
+        let subst = input('Rename substitution: ')
  297
+        if subst != ''
  298
+            call a:world.CloseScratch()
  299
+            for file in a:selected
  300
+                let name = substitute(file, pattern, subst, 'g')
  301
+                call s:RenameFile(file, name, 1)
  302
+            endfor
  303
+        endif
  304
+    endif
  305
+    echo
  306
+    return s:ResetInputList(a:world)
  307
+endf
  308
+
  309
+
  310
+function! tselectfiles#AgentSelectBackups(world, selected)
  311
+    let a:world.filter = g:tselectfiles_suffixes
  312
+    let a:world.state  = 'display'
  313
+    return a:world
  314
+endf
  315
+
  316
+
  317
+function! s:ResetInputList(world, ...) "{{{3
  318
+    let mode = a:0 >= 1 ? a:1 : 'scan'
  319
+    let a:world.state  = 'reset'
  320
+    call tselectfiles#GetFileList(a:world, mode, get(a:world, 'hide', 1))
  321
+    let a:world.picked = 0
  322
+    return a:world
  323
+endf
  324
+
  325
+
  326
+function! tselectfiles#AgentHide(world, selected)
  327
+    let hidden = get(a:world, 'hide', 1)
  328
+    let a:world.hide = hidden ? 0 : 1
  329
+    let a:world.state = 'reset'
  330
+    return s:ResetInputList(a:world)
  331
+endf
  332
+
  333
+
  334
+function! tselectfiles#FormatFirstLine(filename) "{{{3
  335
+    if filereadable(a:filename)
  336
+        let lines = readfile(a:filename)
  337
+        for l in lines
  338
+            if !empty(l)
  339
+                return printf('%-20s %s', fnamemodify(a:filename, ':t'), l)
  340
+            endif
  341
+        endfor
  342
+    endif
  343
+    return a:filename
  344
+endf
  345
+
  346
+
  347
+function! tselectfiles#FormatVikiMetaDataOrFirstLine(filename) "{{{3
  348
+    if filereadable(a:filename)
  349
+        let lines = readfile(a:filename)
  350
+        let acc   = []
  351
+        let cont  = 0
  352
+        for l in lines
  353
+            if cont || l =~ '^\(\*\|\s*#\(TI\|AU\|DATE\|VAR\)\)' || empty(acc)
  354
+                let cont = 0
  355
+                if l =~ '\\$'
  356
+                    let l = substitute(l, '\\\s*$', '', '')
  357
+                    let cont = 1
  358
+                endif
  359
+                if l =~ '\S'
  360
+                    call add(acc, l)
  361
+                endif
  362
+            else
  363
+                break
  364
+            endif
  365
+        endfor
  366
+        return printf('%-20s %s', fnamemodify(a:filename, ':t'), join(acc, ' | '))
  367
+    endif
  368
+    return a:filename
  369
+endf
  370
+
  371
+
  372
+function! tselectfiles#FormatEntry(world, filename) "{{{3
  373
+    " \ {'tlib_UseInputListScratch': 'call world.Highlight_filename()'},
  374
+    let display_format = 'a:world.FormatFilename(%s)'
  375
+    let filename = fnamemodify(a:filename, ':p')
  376
+    let prefix_end = len(s:select_files_prefix) - 1
  377
+    if filename[0 : prefix_end] ==# s:select_files_prefix
  378
+        let filename = '...' . filename[prefix_end + 1 : -1]
  379
+    endif
  380
+    " TLogVAR filename
  381
+    for [rx, fn] in items(g:tselectfiles_filedescription_rx)
  382
+        " TLogVAR rx, fn
  383
+        if filename =~ rx
  384
+            let a:world.display_as_filenames = 0
  385
+            let display_format = fn
  386
+            break
  387
+        endif
  388
+    endfor
  389
+    " TLogVAR display_format
  390
+    return eval(call(function("printf"), a:world.FormatArgs(display_format, filename)))
  391
+endf
  392
+
  393
+
  394
+function! tselectfiles#SelectFiles(mode, dir)
  395
+    " TLogVAR a:mode, a:dir
  396
+    let s:select_files_buffer = bufnr('%')
  397
+    let s:select_files_mode   = a:mode
  398
+    if empty(a:dir) || a:dir == '*'
  399
+        let s:select_files_dir = tlib#var#Get('tselectfiles_dir', 'bg', escape(expand('%:p:h'), ','))
  400
+        let s:select_files_prefix = tlib#var#Get('tselectfiles_prefix', 'wbg')
  401
+        let filter = [[''], [tlib#var#Get('tselectfiles_filter_rx', 'wbg')]]
  402
+        " TLogVAR filter
  403
+    else
  404
+        let s:select_files_dir = escape(fnamemodify(a:dir, ':p:h'), ',')
  405
+        let s:select_files_prefix = ''
  406
+        let filter = ''
  407
+    endif
  408
+    " call TLogVAR('s:select_files_dir=', s:select_files_dir)
  409
+    let world = copy(g:tselectfiles_world)
  410
+    let world.state_handlers = [
  411
+                \ {'state': '\<reset\>', 'exec': 'call tselectfiles#GetFileList(world, '. string(a:mode) .', 1)'},
  412
+                \ ]
  413
+    if a:mode =~ '^n'
  414
+        let s:select_files_pattern = {'mode': 'n', 'pattern': ['*']}
  415
+        call s:InstallDirHandler(world)
  416
+    elseif a:mode =~ '^r'
  417
+        let s:select_files_pattern = {'mode': 'r', 'pattern': []}
  418
+        let s:select_files_pattern.limit = tlib#var#Get('tselectfiles_limit', 'wbg', 0)
  419
+        if s:select_files_pattern.limit == 0
  420
+            call add(s:select_files_pattern.pattern, '**')
  421
+        else
  422
+            call s:InstallDirHandler(world)
  423
+            for i in range(1, s:select_files_pattern.limit)
  424
+                call add(s:select_files_pattern.pattern, join(repeat(['*'], i), '/'))
  425
+            endfor
  426
+        endif
  427
+    else
  428
+        echoerr 'TSelectFile: Unknown mode: '. a:mode
  429
+    endif
  430
+    call tselectfiles#GetFileList(world, a:mode, 1)
  431
+    let world = tlib#World#New(world)
  432
+    if !empty(filter)
  433
+        call world.SetInitialFilter(filter)
  434
+    endif
  435
+    let world.display_as_filenames = 1
  436
+    let world.tlib_UseInputListScratch = 'if world.display_as_filenames | call world.Highlight_filename() | endif'
  437
+    let fs = tlib#input#ListW(world)
  438
+    call s:ClosePreview()
  439
+endf
  440
+
  441
+
  442
+function! s:InstallDirHandler(world) "{{{3
  443
+    let a:world.post_handlers = [{'postprocess': '', 'agent': 'tselectfiles#AgentPostprocess'}]
  444
+endf
  445
+
  446
+
  447
+" :display: tselectfiles#BaseFilter(?rx='', ?replace='')
  448
+function! tselectfiles#BaseFilter(...) "{{{3
  449
+    let file = expand('%:t:r')
  450
+    if a:0 >= 1
  451
+        let rplc = a:0 >= 2 ? a:2 : ''
  452
+        let file = substitute(file, a:1, rplc, 'g')
  453
+    endif
  454
+    let b:tselectfiles_filter_rx = join(split(file, '\A'), '\|')
  455
+    return b:tselectfiles_filter_rx
  456
+endf
  457
+
52  doc/tselectfiles.txt
@@ -46,19 +46,24 @@ Suggested maps (to be set in ~/.vimrc): >
46 46
     noremap <m-f>       :TSelectFiles<cr>
47 47
 
48 48
 
49  
-------------------------------------------------------------------------
  49
+========================================================================
50 50
 Contents~
51 51
 
52 52
     plugin/tselectfiles.vim
53  
-        g:tselectfiles_use_cache ..... |g:tselectfiles_use_cache|
54  
-        g:tselectfiles_no_cache_rx ... |g:tselectfiles_no_cache_rx|
55  
-        g:tselectfiles_filter_rx ..... |g:tselectfiles_filter_rx|
56  
-        TSelectFiles ................. |TSelectFiles()|
57  
-        :TSelectFiles ................ |:TSelectFiles|
58  
-        :TSelectFilesInSubdirs ....... |:TSelectFilesInSubdirs|
59  
-
60  
-
61  
-------------------------------------------------------------------------
  53
+        g:tselectfiles_use_cache ............ |g:tselectfiles_use_cache|
  54
+        g:tselectfiles_no_cache_rx .......... |g:tselectfiles_no_cache_rx|
  55
+        g:tselectfiles_filter_rx ............ |g:tselectfiles_filter_rx|
  56
+        g:tselectfiles_limit ................ |g:tselectfiles_limit|
  57
+        g:tselectfiles_filedescription_rx ... |g:tselectfiles_filedescription_rx|
  58
+        g:tselectfiles_world ................ |g:tselectfiles_world|
  59
+        g:tselectfiles_suffixes ............. |g:tselectfiles_suffixes|
  60
+        g:tselectfiles_hidden_rx ............ |g:tselectfiles_hidden_rx|
  61
+        g:tselectfiles_show_quickfix_list ... |g:tselectfiles_show_quickfix_list|
  62
+        :TSelectFiles ....................... |:TSelectFiles|
  63
+        :TSelectFilesInSubdirs .............. |:TSelectFilesInSubdirs|
  64
+
  65
+
  66
+========================================================================
62 67
 plugin/tselectfiles.vim~
63 68
 
64 69
                                                     *g:tselectfiles_use_cache*
@@ -75,8 +80,29 @@ g:tselectfiles_no_cache_rx     (default: '')
75 80
 g:tselectfiles_filter_rx       (default: '')
76 81
     Retain only files matching this rx. (per window, per buffer, global)
77 82
 
78  
-                                                    *TSelectFiles()*
79  
-TSelectFiles(mode, filter)
  83
+                                                    *g:tselectfiles_limit*
  84
+g:tselectfiles_limit           (default: 0)
  85
+    The max depth when globbing directories recursively. 0 = no limit.
  86
+
  87
+                                                    *g:tselectfiles_filedescription_rx*
  88
+g:tselectfiles_filedescription_rx (default: {})
  89
+    A dictionary of REGEXP => FUNCREF(filename) -> String describing the 
  90
+    file (DEFAULT: the filename).
  91
+
  92
+                                                    *g:tselectfiles_world*
  93
+g:tselectfiles_world           (default: {)
  94
+
  95
+                                                    *g:tselectfiles_suffixes*
  96
+g:tselectfiles_suffixes        (default: printf('\(%s\)\$', join(map(split(&suffixes, ','), 'v:val'), '\|')))
  97
+
  98
+                                                    *g:tselectfiles_hidden_rx*
  99
+g:tselectfiles_hidden_rx       (default: '\V\(/.\|/CVS\|/.attic\|.svn\|'. g:tselectfiles_suffixes .'\)\(\[\\/]\|\$\)')
  100
+
  101
+                                                    *g:tselectfiles_show_quickfix_list*
  102
+g:tselectfiles_show_quickfix_list (default: 'TRagcw')
  103
+    " TBD: cwindow doesn't currently work as expected
  104
+    TLet g:tselectfiles_show_quickfix_list = exists(':TRagcw') ? 'TRagcw' : 'cwindow'
  105
+    The command that is run to show the quickfix list after running grep.
80 106
 
81 107
                                                     *:TSelectFiles*
82 108
 :TSelectFiles[!] [DIR]
@@ -96,3 +122,5 @@ TSelectFiles(mode, filter)
96 122
     value will be used if available.
97 123
 
98 124
 
  125
+
  126
+vim:tw=78:fo=tcq2:isk=!-~,^*,^|,^":ts=8:ft=help:norl:
424  plugin/tselectfiles.vim
... ...
@@ -1,20 +1,20 @@
1 1
 " tselectfile.vim -- A simplicistic files selector/browser (sort of)
2  
-" @Author:      Thomas Link (mailto:micathom AT gmail com?subject=[vim])
  2
+" @Author:      Thomas Link (micathom AT gmail com?subject=[vim])
3 3
 " @Website:     http://www.vim.org/account/profile.php?user_id=4037
4 4
 " @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
5 5
 " @Created:     2007-04-16.
6  
-" @Last Change: 2007-09-10.
7  
-" @Revision:    0.4.453
  6
+" @Last Change: 2008-10-01.
  7
+" @Revision:    522
8 8
 " GetLatestVimScripts: 1865 1 tselectfiles.vim
9 9
 
10 10
 if &cp || exists("loaded_tselectfile")
11 11
     finish
12 12
 endif
13  
-if !exists('loaded_tlib') || loaded_tlib < 13
14  
-    echoerr "tlib >= 0.13 is required"
  13
+if !exists('loaded_tlib') || loaded_tlib < 18
  14
+    echoerr "tlib >= 0.18 is required"
15 15
     finish
16 16
 endif
17  
-let loaded_tselectfile = 4
  17
+let loaded_tselectfile = 6
18 18
 
19 19
 " Whether to cache directory listings (in memory). (per buffer, global)
20 20
 " If 0, disable the use of cached file listings all together.
@@ -27,46 +27,68 @@ TLet g:tselectfiles_no_cache_rx = ''
27 27
 " Retain only files matching this rx. (per window, per buffer, global)
28 28
 TLet g:tselectfiles_filter_rx = ''
29 29
 
  30
+" The max depth when globbing directories recursively. 0 = no limit.
  31
+TLet g:tselectfiles_limit = 0
  32
+
  33
+" A dictionary of REGEXP => FUNCREF(filename) -> String describing the 
  34
+" file (DEFAULT: the filename).
  35
+TLet g:tselectfiles_filedescription_rx = {}
  36
+
30 37
 " Use these dirs (a comma separated list, see |globpath()|). (per window, per buffer, global)
31 38
 " TLet g:tselectfiles_dir = ''
32 39
 
33  
-let s:select_files_files = {}
  40
+TLet g:tselectfiles_world = {
  41
+            \ 'type': 'm',
  42
+            \ 'query': 'Select files',
  43
+            \ 'scratch': '__ttoc__',
  44
+            \ 'return_agent': 'tselectfiles#ViewFile',
  45
+            \ 'display_format': 'tselectfiles#FormatEntry(world, %s)',
  46
+            \ 'pick_last_item': 0,
  47
+            \ 'key_handlers': [
  48
+                \ {'key':  4,  'agent': 'tselectfiles#AgentDeleteFile',      'key_name': '<c-d>', 'help': 'Delete file(s)'},
  49
+                \ {'key': 18,  'agent': 'tselectfiles#AgentReset'},
  50
+                \ {'key': 19,  'agent': 'tlib#agent#EditFileInSplit',        'key_name': '<c-s>', 'help': 'Edit files (split)'},
  51
+                \ {'key': 22,  'agent': 'tlib#agent#EditFileInVSplit',       'key_name': '<c-v>', 'help': 'Edit files (vertical split)'},
  52
+                \ {'key': 20,  'agent': 'tlib#agent#EditFileInTab',          'key_name': '<c-t>', 'help': 'Edit files (new tab)'},
  53
+                \ {'key': 23,  'agent': 'tselectfiles#ViewFile',             'key_name': '<c-w>', 'help': 'View file in window'},
  54
+                \ {'key': 21,  'agent': 'tselectfiles#AgentRenameFile',      'key_name': '<c-u>', 'help': 'Rename file(s)'},
  55
+                \ {'key': 3,   'agent': 'tlib#agent#CopyItems',              'key_name': '<c-c>', 'help': 'Copy file name(s)'},
  56
+                \ {'key': 11,  'agent': 'tselectfiles#AgentCopyFile',        'key_name': '<c-k>', 'help': 'Copy file(s)'},
  57
+                \ {'key': 16,  'agent': 'tselectfiles#AgentPreviewFile',     'key_name': '<c-p>', 'help': 'Preview file'},
  58
+                \ {'key':  2,  'agent': 'tselectfiles#AgentBatchRenameFile', 'key_name': '<c-b>', 'help': 'Batch rename file(s)'},
  59
+                \ {'key': 126, 'agent': 'tselectfiles#AgentSelectBackups',   'key_name': '~',     'help': 'Select backup(s)'},
  60
+                \ {'key': 9,   'agent': 'tlib#agent#ShowInfo',               'key_name': '<c-i>', 'help': 'Show info'},
  61
+                \ {'key': 24,  'agent': 'tselectfiles#AgentHide',            'key_name': '<c-x>', 'help': 'Hide some files'},
  62
+                \ {'key':  7,  'agent': 'tselectfiles#Grep',                 'key_name': '<c-g>', 'help': 'Run vimgrep on selected files'},
  63
+                \ {'key': 28,  'agent': 'tlib#agent#ToggleStickyList',       'key_name': '<c-\>', 'help': 'Toggle sticky'},
  64
+            \ ],
  65
+            \ }
  66
+            " \ 'scratch_vertical': (&lines > &co),
  67
+                \ ]
34 68
 
35  
-function! s:SNR()
36  
-    return matchstr(expand('<sfile>'), '<SNR>\d\+_\zeSNR$')
37  
-endf
  69
+TLet g:tselectfiles_suffixes = printf('\(%s\)\$', join(map(split(&suffixes, ','), 'v:val'), '\|'))
38 70
 
39  
-function! s:SuffixesRx()
40  
-    return printf('\(%s\)\$', join(map(split(&suffixes, ','), 'v:val'), '\|'))
41  
-endf
  71
+TLet g:tselectfiles_hidden_rx = '\V\(/.\|/CVS\|/.attic\|.svn\|'. g:tselectfiles_suffixes .'\)\(\[\\/]\|\$\)'
42 72
 
43  
-if !exists('g:tselectfiles_handlers')
44  
-    " \ {'key': 35, 'agent': s:SNR() .'AgentSelect'},
45  
-    let g:tselectfiles_handlers = [
46  
-                \ {'key':  4, 'agent': s:SNR() .'AgentDeleteFile',      'key_name': '<c-d>', 'help': 'Delete file(s)'},
47  
-                \ {'key': 18, 'agent': s:SNR() .'AgentReset'},
48  
-                \ {'key': 19, 'agent': 'tlib#agent#EditFileInSplit',    'key_name': '<c-s>', 'help': 'Edit files (split)'},
49  
-                \ {'key': 22, 'agent': 'tlib#agent#EditFileInVSplit',   'key_name': '<c-v>', 'help': 'Edit files (vertical split)'},
50  
-                \ {'key': 20, 'agent': 'tlib#agent#EditFileInTab',      'key_name': '<c-t>', 'help': 'Edit files (new tab)'},
51  
-                \ {'key': 23, 'agent': 'tlib#agent#ViewFile',           'key_name': '<c-w>', 'help': 'View file in window'},
52  
-                \ {'key': 21, 'agent': s:SNR() .'AgentRenameFile',      'key_name': '<c-u>', 'help': 'Rename file(s)'},
53  
-                \ {'key': 3,  'agent': 'tlib#agent#CopyItems',          'key_name': '<c-c>', 'help': 'Copy file name(s)'},
54  
-                \ {'key': 11, 'agent': s:SNR() .'AgentCopyFile',        'key_name': '<c-k>', 'help': 'Copy file(s)'},
55  
-                \ {'key': 16, 'agent': s:SNR() .'AgentPreviewFile',     'key_name': '<c-p>', 'help': 'Preview file'},
56  
-                \ {'key':  2, 'agent': s:SNR() .'AgentBatchRenameFile', 'key_name': '<c-b>', 'help': 'Batch rename file(s)'},
57  
-                \ {'key': 126, 'agent': s:SNR() .'AgentSelectBackups',  'key_name': '~',     'help': 'Select backup(s)'},
58  
-                \ {'key': 9,  'agent': 'tlib#agent#ShowInfo',           'key_name': '<c-i>', 'help': 'Show info'},
59  
-                \ {'key': 24, 'agent': s:SNR() .'AgentHide',            'key_name': '<c-x>', 'help': 'Hide some files'},
60  
-                \ {'display_format': 'filename'},
61  
-                \ {'return_agent': 'tlib#agent#ViewFile'},
62  
-                \ {'pick_last_item': 0},
63  
-                \ ]
64  
-                " \ {'key': 15, 'agent': s:SNR() .'AgentOpenDir',         'key_name': '<c-o>', 'help': 'Open dir'},
  73
+" " TBD: cwindow doesn't currently work as expected
  74
+" TLet g:tselectfiles_show_quickfix_list = exists(':TRagcw') ? 'TRagcw' : 'cwindow'
  75
+if exists(':TRagcw')
  76
+    " The command that is run to show the quickfix list after running grep.
  77
+    TLet g:tselectfiles_show_quickfix_list = 'TRagcw'
65 78
 endif
66 79
 
67  
-if !exists('g:tselectfiles_hidden')
68  
-    let g:tselectfiles_hidden_rx = '\V\(/.\|/CVS\|/.attic\|.svn\|'. s:SuffixesRx() .'\)\(\[\\/]\|\$\)'
69  
-endif
  80
+" TLet g:tselectfiles_dir_edit = 'TSelectFiles'
  81
+" 
  82
+" if !empty(g:tselectfiles_dir_edit)
  83
+"     if exists('g:loaded_netrwPlugin')
  84
+"         au! FileExplorer BufEnter
  85
+"     endif
  86
+"     augroup TSelectFiles
  87
+"         autocmd!
  88
+"         autocmd BufEnter * silent! if isdirectory(expand("<amatch>")) | exec g:tselectfiles_dir_edit .' '. expand("<amatch>") | endif
  89
+"     augroup END
  90
+" endif
  91
+
70 92
 
71 93
 if !exists('g:tselectfiles_favourites')
72 94
     if has('win16') || has('win32') || has('win64')
@@ -84,309 +106,6 @@ if !exists('g:tselectfiles_favourites')
84 106
 endif
85 107
 
86 108
 
87  
-function! s:CacheID() "{{{3
88  
-    return s:select_files_dir . s:select_files_pattern
89  
-endf
90  
-
91  
-
92  
-function! s:PrepareSelectFiles(hide)
93  
-    " TLogVAR a:hide
94  
-    let filter = s:select_files_dir . s:select_files_pattern
95  
-    " TLogVAR filter
96  
-    let rv = split(globpath(s:select_files_dir, s:select_files_pattern), '\n')
97  
-    " TLogVAR rv
98  
-    if a:hide
99  
-        call filter(rv, 'v:val !~ g:tselectfiles_hidden_rx')
100  
-    endif
101  
-    " let subset = tlib#var#Get('tselectfiles_filter_rx', 'wbg')
102  
-    " if !empty(subset)
103  
-    "     call filter(rv, 'v:val =~ subset')
104  
-    " endif
105  
-    if s:select_files_pattern == '**'
106  
-        call sort(filter(rv, '!isdirectory(v:val)'))
107  
-    else
108  
-        call sort(map(rv, 'isdirectory(v:val) ? v:val."/" : v:val'))
109  
-        let rv += g:tselectfiles_favourites
110  
-        " call TLogDBG(string(split(s:select_files_dir, '[^\\]\zs,')))
111  
-        for phf in split(s:select_files_dir, '[^\\]\zs,')
112  
-            let ph = fnamemodify(phf, ':h')
113  
-            " TLogVAR ph
114  
-            " call TLogDBG(s:select_files_dir)
115  
-            if ph != phf
116  
-                if ph[-1] !~ '[\/]'
117  
-                    let ph .= '/'
118  
-                endif
119  
-                call insert(rv, ph .'../')
120  
-            endif
121  
-        endfor
122  
-    endif
123  
-    return rv
124  
-endf
125  
-
126  
-
127  
-function! s:UseCache() "{{{3
128  
-    let use_cache = tlib#var#Get('tselectfiles_use_cache', 'bg')
129  
-    let no_cache  = tlib#var#Get('tselectfiles_no_cache_rx', 'bg')
130  
-    let rv = use_cache && (empty(no_cache) || s:select_files_dir !~ no_cache)
131  
-    " TLogVAR rv
132  
-    return rv
133  
-endf
134  
-
135  
-
136  
-function! s:GetFileList(mode, hide)
137  
-    if s:UseCache()
138  
-        let id = s:CacheID()
139  
-        if a:mode =~ '\(!\|\d\)$' || a:mode == 'scan' || !has_key(s:select_files_files, id)
140  
-            if a:mode =~ '!$'
141  
-                let s:select_files_files = {}
142  
-            endif
143  
-            " TLogVAR id
144  
-            let s:select_files_files[id] = s:PrepareSelectFiles(a:hide)
145  
-        endif
146  
-        return s:select_files_files[id]
147  
-    else
148  
-        return s:PrepareSelectFiles(a:hide)
149  
-    endif
150  
-endf
151  
-
152  
-
153  
-function! s:AgentPostprocess(world, result)
154  
-    let item = resolve(a:result)
155  
-    " TLogVAR item
156  
-    " TLogDBG len(a:world.list)
157  
-    if isdirectory(item)
158  
-        let s:select_files_dir = fnamemodify(item, ':p')
159  
-        return [s:ResetInputList(a:world, ''), '']
160  
-    endif
161  
-    return [a:world, a:result]
162  
-endf
163  
-
164  
-
165  
-function! s:AgentOpenDir(world, selected)
166  
-    let dir = input('DIR: ', '', 'dir')
167  
-    echo
168  
-    if dir != ''
169  
-        let s:select_files_dir = fnamemodify(dir, ':p')
170  
-        return s:ResetInputList(a:world, '')
171  
-    endif
172  
-    return a:world
173  
-endf
174  
-
175  
-
176  
-" function! s:AgentSelect(world, selected) "{{{3
177  
-"     let fname = a:world.GetBaseItem(a:world.prefidx)
178  
-"     if !filereadable(fname) && s:UseCache()
179  
-"         echom 'TSelectFile: Out-dated cache? File not readable: '. fname
180  
-"         return s:ResetInputList(a:world)
181  
-"     else
182  
-"         call a:world.SelectItem('toggle', a:world.prefidx)
183  
-"         " let a:world.state = 'display keepcursor'
184  
-"         let a:world.state = 'redisplay'
185  
-"         return a:world
186  
-"     endif
187  
-" endf
188  
-
189  
-
190  
-function! s:AgentReset(world, selected) "{{{3
191  
-    return s:ResetInputList(a:world)
192  
-endf
193  
-
194  
-
195  
-function! s:DeleteFile(file)
196  
-    let doit = input('Really delete file "'. a:file .'"? (y/N) ', s:delete_this_file_default)
197  
-    echo
198  
-    if doit ==? 'y'
199  
-        if doit ==# 'Y'
200  
-            let s:delete_this_file_default = 'y'
201  
-        endif
202  
-        call delete(a:file)
203  
-        echom 'Delete file: '. a:file
204  
-        let bn = bufnr(a:file)
205  
-        if bn != -1 && bufloaded(bn)
206  
-            let doit = input('Delete corresponding buffer '. bn .' too? (y/N) ')
207  
-            if doit ==? 'y'
208  
-                exec 'bdelete '. bn
209  
-            endif
210  
-        endif
211  
-    endif
212  
-endf
213  
-
214  
-
215  
-function! s:AgentDeleteFile(world, selected)
216  
-    call a:world.CloseScratch()
217  
-    let s:delete_this_file_default = ''
218  
-    for file in a:selected
219  
-        call s:DeleteFile(file)
220  
-    endfor
221  
-    return s:ResetInputList(a:world)
222  
-endf
223  
-
224  
-
225  
-function! s:Preview(file) "{{{3
226  
-    exec 'pedit '. escape(a:file, '%#\ ')
227  
-    let s:tselectfiles_previewedfile = a:file
228  
-endf
229  
-
230  
-
231  
-function! s:ClosePreview() "{{{3
232  
-    if exists('s:tselectfiles_previewedfile')
233  
-        pclose
234  
-        unlet! s:tselectfiles_previewedfile
235  
-    endif
236  
-endf
237  
-
238  
-
239  
-function! s:AgentPreviewFile(world, selected)
240  
-    let file = a:selected[0]
241  
-    if !exists('s:tselectfiles_previewedfile') || file != s:tselectfiles_previewedfile
242  
-        call s:Preview(file)
243  
-        let a:world.state = 'redisplay'
244  
-    else
245  
-        call s:ClosePreview()
246  
-        let a:world.state = 'display'
247  
-    endif
248  
-    return a:world
249  
-endf
250  
-
251  
-
252  
-function! s:ConfirmCopyMove(query, src, dest)
253  
-    echo
254  
-    echo 'From: '. a:src
255  
-    echo 'To:   '. a:dest
256  
-    let ok = input(a:query .'(y/n) ', 'y')
257  
-    echo
258  
-    return ok[0] ==? 'y'
259  
-endf
260  
-
261  
-
262  
-function! s:CopyFile(src, dest, confirm)
263  
-    if a:src != '' && a:dest != '' && (!a:confirm || s:ConfirmCopyMove('Copy now?', a:src, a:dest))
264  
-        let fc = readfile(a:src, 'b')
265  
-        if writefile(fc, a:dest, 'b') == 0
266  
-            echom 'Copy file "'. a:src .'" -> "'. a:dest
267  
-        else
268  
-            echom 'Failed: Copy file "'. a:src .'" -> "'. a:dest
269  
-        endif
270  
-    endif
271  
-endf
272  
-
273  
-
274  
-function! s:AgentCopyFile(world, selected)
275  
-    for file in a:selected
276  
-        let name = input('Copy "'. file .'" to: ', file)
277  
-        echo
278  
-        call s:CopyFile(file, name, 0)
279  
-    endfor
280  
-    return s:ResetInputList(a:world)
281  
-endf
282  
-
283  
-
284  
-function! s:RenameFile(file, name, confirm)
285  
-    if a:name != '' && (!a:confirm || s:ConfirmCopyMove('Rename now?', a:file, a:name))
286  
-        call rename(a:file, a:name)
287  
-        echom 'Rename file "'. a:file .'" -> "'. a:name
288  
-        if bufloaded(a:file)
289  
-            exec 'buffer! '. tlib#arg#Ex(a:file)
290  
-            exec 'file! '. tlib#arg#Ex(a:name)
291  
-            echom 'Rename buffer: '. a:file .' -> '. a:name
292  
-        endif
293  
-    endif
294  
-endf
295  
-
296  
-
297  
-function! s:AgentRenameFile(world, selected)
298  
-    let s:rename_this_file_pattern = ''
299  
-    let s:rename_this_file_subst   = ''
300  
-    call a:world.CloseScratch()
301  
-    for file in a:selected
302  
-        let name = input('Rename "'. file .'" to: ', file)
303  
-        echo
304  
-        call s:RenameFile(file, name, 0)
305  
-    endfor
306  
-    return s:ResetInputList(a:world)
307  
-endf
308  
-
309  
-function! s:AgentBatchRenameFile(world, selected)
310  
-    let pattern = input('Rename pattern (whole path): ')
311  
-    if pattern != ''
312  
-        echo 'Pattern: '. pattern
313  
-        let subst = input('Rename substitution: ')
314  
-        if subst != ''
315  
-            call a:world.CloseScratch()
316  
-            for file in a:selected
317  
-                let name = substitute(file, pattern, subst, 'g')
318  
-                call s:RenameFile(file, name, 1)
319  
-            endfor
320  
-        endif
321  
-    endif
322  
-    echo
323  
-    return s:ResetInputList(a:world)
324  
-endf
325  
-
326  
-
327  
-function! s:AgentSelectBackups(world, selected)
328  
-    let a:world.filter = s:SuffixesRx()
329  
-    let a:worldstate   = 'display'
330  
-    return a:world
331  
-endf
332  
-
333  
-
334  
-function! s:ResetInputList(world, ...) "{{{3
335  
-    let mode = a:0 >= 1 ? a:1 : 'scan'
336  
-    let a:world.state  = 'reset'
337  
-    let a:world.base   = s:GetFileList(mode, get(a:world, 'hide', 1))
338  
-    let a:world.picked = 0
339  
-    return a:world
340  
-endf
341  
-
342  
-
343  
-function! s:AgentHide(world, selected)
344  
-    let hidden = get(a:world, 'hide', 1)
345  
-    let a:world.hide = hidden ? 0 : 1
346  
-    let a:world.state = 'reset'
347  
-    return s:ResetInputList(a:world)
348  
-endf
349  
-
350  
-
351  
-function! TSelectFiles(mode, filter)
352  
-    " TLogVAR a:mode, a:filter
353  
-    let s:select_files_buffer = bufnr('%')
354  
-    let s:select_files_mode   = a:mode
355  
-    if empty(a:filter)
356  
-        let s:select_files_dir = tlib#var#Get('tselectfiles_dir', 'bg', escape(expand('%:p:h'), ','))
357  
-    else
358  
-        let s:select_files_dir = escape(fnamemodify(a:filter, ':p:h'), ',')
359  
-    endif
360  
-    " call TLogVAR('s:select_files_dir=', s:select_files_dir)
361  
-    let handlers = copy(g:tselectfiles_handlers)
362  
-    let handlers += [
363  
-                \ {'state': '\<reset\>', 'exec': 'let world.base = '. s:SNR().'GetFileList('. string(a:mode) .', 1)'},
364  
-                \ ]
365  
-                
366  
-    let filter = tlib#var#Get('tselectfiles_filter_rx', 'wbg')
367  
-    " TLogVAR filter
368  
-    if !empty(filter)
369  
-        call add(handlers, {'filter': filter})
370  
-    endif
371  
-    if a:mode =~ '^n'
372  
-        let s:select_files_pattern = '*'
373  
-        call add(handlers, {'postprocess': '', 'agent': s:SNR() .'AgentPostprocess'})
374  
-    elseif a:mode =~ '^r'
375  
-        let s:select_files_pattern = '**'
376  
-    else
377  
-        echoerr 'TSelectFile: Unknown mode: '. a:mode
378  
-    endif
379  
-    let fl = s:GetFileList(a:mode, 1)
380  
-    " TLogVAR fl
381  
-    " let s:select_files_files  = tlib#var#Get('tselect_files_files', 'b', {})
382  
-    let fs = tlib#input#List('m', 'Select files', fl, handlers)
383  
-    " let b:tselect_files_files = s:select_files_files
384  
-    call s:ClosePreview()
385  
-    " if !empty(fs)
386  
-    "     call tlib#file#With('edit', 'buffer', fs)
387  
-    " endif
388  
-endf
389  
-
390 109
 " :display: :TSelectFiles[!] [DIR]
391 110
 " Open/delete/rename files in the current directory.
392 111
 " A [!] forces the commands to rescan the directory. Otherwise a cached 
@@ -394,14 +113,14 @@ endf
394 113
 " You can also type <c-r> to force rescanning a directory, which could 
395 114
 " be necessary if the file system were changed (e.g. by creating a new 
396 115
 " file or by some external command)
397  
-command! -bang -nargs=? -complete=dir TSelectFiles call TSelectFiles("normal<bang>".v:count, <q-args>)
  116
+command! -bang -nargs=? -complete=dir TSelectFiles call tselectfiles#SelectFiles("normal<bang>".v:count, <q-args>)
398 117
 
399 118
 " Recursively show all files in the current directory and subdirectories 
400 119
 " (don't show favourites and ".."); don't use this command when you're 
401 120
 " at /.
402 121
 " A [!] forces the commands to rescan the directory. Otherwise a cached 
403 122
 " value will be used if available.
404  
-command! -bang -nargs=? -complete=dir TSelectFilesInSubdirs call TSelectFiles("recursive<bang>".v:count, <q-args>)
  123
+command! -bang -nargs=? -complete=dir TSelectFilesInSubdirs call tselectfiles#SelectFiles("recursive<bang>".v:count, <q-args>)
405 124
 
406 125
 
407 126
 finish
@@ -441,3 +160,22 @@ also be set per buffer.
441 160
 - Renamed some variables from tselectfile_* to tselectfiles_*.
442 161
 - Can be "suspended" (i.e. you can switch back to the orignal window)
443 162
 
  163
+0.5
  164
+- [wbg]:tselectfiles_filter_rx is used only when no directory is given 
  165
+on the command line.
  166
+- Require tlib >= 0.18
  167
+- If the filename matches an entry in g:tselectfiles_filedescription_rx, 
  168
+use the expression there to construct a file description (eg the file's 
  169
+first line)
  170
+- Option to run vimgrep on selected files.
  171
+- tselectfiles#BaseFilter(): Set b:tselectfiles_filter_rx to something 
  172
+useful.
  173
+- tselectfiles#BaseFilter(): takes 2 optional arguments to substitute a 
  174
+rx in the current buffer's filename.
  175
+
  176
+0.6
  177
+- tselectfiles_filter_rx: Set as array
  178
+- [gbw]tselectfiles_prefix: Remove prefix from filenames in list
  179
+- [gbw]tselectfiles_limit variable
  180
+- Problem when browsing single directories
  181
+

0 notes on commit c7828f4

Please sign in to comment.
Something went wrong with that request. Please try again.