The more, on Unix-like systems you can pipe the output of tools like find, locate, tar -t, ... directly into Vim executing this script by using - as filename. Examples: vim -u browser.vim arch-hurd-i386.files find . | vim -u browser.vim - locate nox | vim -u browser.vim - tar -tzf boost.tar.gz | vim -u browser.vim - set mouse=a set foldminlines=1 foldcolumn=2 fillchars="+" foldlevel=0 set foldmethod=expr set foldexpr=FileBrowserFoldExpr() set foldtext=FileBrowserFoldText() function FileBrowserFoldExpr() let line=getline(v:lnum) let n=strlen(substitute(line,'[^/]*','','g')) if (line=~'^.*/$') return '>'.n elseif (strpart(getline(v:lnum+1),0,strlen(line)+1)==line.'/') return '>'.(n+1) endif return n endfunction function FileBrowserFoldText() return getline(v:foldstart) . ' ... [' . (
Attributes | Values |
---|
rdfs:label
| - Folding of find locate tar-tf output
|
rdfs:comment
| - The more, on Unix-like systems you can pipe the output of tools like find, locate, tar -t, ... directly into Vim executing this script by using - as filename. Examples: vim -u browser.vim arch-hurd-i386.files find . | vim -u browser.vim - locate nox | vim -u browser.vim - tar -tzf boost.tar.gz | vim -u browser.vim - set mouse=a set foldminlines=1 foldcolumn=2 fillchars="+" foldlevel=0 set foldmethod=expr set foldexpr=FileBrowserFoldExpr() set foldtext=FileBrowserFoldText() function FileBrowserFoldExpr() let line=getline(v:lnum) let n=strlen(substitute(line,'[^/]*','','g')) if (line=~'^.*/$') return '>'.n elseif (strpart(getline(v:lnum+1),0,strlen(line)+1)==line.'/') return '>'.(n+1) endif return n endfunction function FileBrowserFoldText() return getline(v:foldstart) . ' ... [' . (
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Category
| |
Author
| |
Subpage
| |
Complexity
| |
Created
| |
ID
| |
NEXT
| |
abstract
| - The more, on Unix-like systems you can pipe the output of tools like find, locate, tar -t, ... directly into Vim executing this script by using - as filename. Examples: vim -u browser.vim arch-hurd-i386.files find . | vim -u browser.vim - locate nox | vim -u browser.vim - tar -tzf boost.tar.gz | vim -u browser.vim - set mouse=a set foldminlines=1 foldcolumn=2 fillchars="+" foldlevel=0 set foldmethod=expr set foldexpr=FileBrowserFoldExpr() set foldtext=FileBrowserFoldText() function FileBrowserFoldExpr() let line=getline(v:lnum) let n=strlen(substitute(line,'[^/]*','','g')) if (line=~'^.*/$') return '>'.n elseif (strpart(getline(v:lnum+1),0,strlen(line)+1)==line.'/') return '>'.(n+1) endif return n endfunction function FileBrowserFoldText() return getline(v:foldstart) . ' ... [' . (v:foldend-v:foldstart+1) . ' lines]' endfunction
|