Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 1 | " Vim syntax file |
Bram Moolenaar | c873442 | 2012-06-01 22:38:45 +0200 | [diff] [blame] | 2 | " Maintainer: Thilo Six |
| 3 | " Contact: <vim-dev at vim dot org> |
| 4 | " http://www.vim.org/maillist.php#vim-dev |
| 5 | " |
| 6 | " Description: display directory content inside Vim with syntax |
| 7 | " highlighting |
| 8 | " File: runtime/syntax/dirpager.vim |
Bram Moolenaar | d592deb | 2022-06-17 15:42:40 +0100 | [diff] [blame] | 9 | " Last Change: 2022 Jun 14 |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 10 | " Modeline: vim: ts=8:sw=2:sts=2: |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 11 | " |
Bram Moolenaar | c873442 | 2012-06-01 22:38:45 +0200 | [diff] [blame] | 12 | " Credits: dirpager.vim is derived from Nikolai Weibulls dircolors.vim |
| 13 | " |
| 14 | " License: VIM License |
| 15 | " Vim is Charityware, see ":help Uganda" |
| 16 | " |
| 17 | " Usage: $ ls -la | view -c "set ft=dirpager" - |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 18 | " |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 19 | " |
| 20 | ",----[ ls(1posix) ]-------------------------------------------------- |
| 21 | " |
| 22 | " The <entry type> character shall describe the type of file, as |
| 23 | " follows: |
| 24 | " |
| 25 | " d Directory. |
| 26 | " b Block special file. |
| 27 | " c Character special file. |
| 28 | " l (ell) Symbolic link. |
| 29 | " p FIFO. |
| 30 | " - Regular file. |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 31 | " |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 32 | |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 33 | if exists("b:current_syntax") || &compatible |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 34 | finish |
| 35 | endif |
| 36 | |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 37 | setlocal nowrap |
| 38 | |
| 39 | syn keyword DirPagerTodo contained FIXME TODO XXX NOTE |
| 40 | |
| 41 | syn region DirPagerExe start='^...x\|^......x\|^.........x' end='$' contains=DirPagerTodo,@Spell |
| 42 | syn region DirPagerDir start='^d' end='$' contains=DirPagerTodo,@Spell |
| 43 | syn region DirPagerLink start='^l' end='$' contains=DirPagerTodo,@Spell |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 44 | syn region DirPagerSpecial start='^b' end='$' contains=DirPagerTodo,@Spell |
| 45 | syn region DirPagerSpecial start='^c' end='$' contains=DirPagerTodo,@Spell |
| 46 | syn region DirPagerFifo start='^p' end='$' contains=DirPagerTodo,@Spell |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 47 | |
| 48 | hi def link DirPagerTodo Todo |
| 49 | hi def DirPagerExe ctermfg=Green guifg=Green |
| 50 | hi def DirPagerDir ctermfg=Blue guifg=Blue |
| 51 | hi def DirPagerLink ctermfg=Cyan guifg=Cyan |
Bram Moolenaar | f1568ec | 2011-12-14 21:17:39 +0100 | [diff] [blame] | 52 | hi def DirPagerSpecial ctermfg=Yellow guifg=Yellow |
| 53 | hi def DirPagerFifo ctermfg=Brown guifg=Brown |
Bram Moolenaar | 8e5af3e | 2011-04-28 19:02:44 +0200 | [diff] [blame] | 54 | |
| 55 | let b:current_syntax = "dirpager" |
| 56 | |