5690
|
1 Test filename modifiers vim: set ft=vim :
|
|
2
|
|
3 STARTTEST
|
|
4 :source small.vim
|
|
5 :%delete _
|
|
6 :set shell=sh
|
|
7 :set shellslash
|
|
8 :let tab="\t"
|
|
9 :command -nargs=1 Put :let expr=<q-args> | $put =expr.tab.strtrans(string(eval(expr)))
|
|
10 :let $HOME=fnamemodify('.', ':p:h:h:h')
|
|
11 :Put fnamemodify('.', ':p' )[-1:]
|
|
12 :Put fnamemodify('.', ':p:h' )[-1:]
|
|
13 :Put fnamemodify('test.out', ':p' )[-1:]
|
|
14 :Put fnamemodify('test.out', ':.' )
|
|
15 :Put fnamemodify('../testdir/a', ':.' )
|
|
16 :Put fnamemodify('test.out', ':~' )
|
|
17 :Put fnamemodify('../testdir/a', ':~' )
|
|
18 :Put fnamemodify('../testdir/a', ':t' )
|
|
19 :Put fnamemodify('.', ':p:t' )
|
|
20 :Put fnamemodify('test.out', ':p:t' )
|
|
21 :Put fnamemodify('test.out', ':p:e' )
|
|
22 :Put fnamemodify('test.out', ':p:t:e' )
|
|
23 :Put fnamemodify('abc.fb2.tar.gz', ':r' )
|
|
24 :Put fnamemodify('abc.fb2.tar.gz', ':r:r' )
|
|
25 :Put fnamemodify('abc.fb2.tar.gz', ':r:r:r' )
|
|
26 :Put substitute(fnamemodify('abc.fb2.tar.gz', ':p:r:r'), '.*\(src/testdir/.*\)', '\1', '')
|
|
27 :Put fnamemodify('abc.fb2.tar.gz', ':e' )
|
|
28 :Put fnamemodify('abc.fb2.tar.gz', ':e:e' )
|
|
29 :Put fnamemodify('abc.fb2.tar.gz', ':e:e:e' )
|
|
30 :Put fnamemodify('abc.fb2.tar.gz', ':e:e:e:e')
|
|
31 :Put fnamemodify('abc.fb2.tar.gz', ':e:e:r' )
|
|
32 :Put fnamemodify('abc def', ':S' )
|
|
33 :Put fnamemodify('abc" "def', ':S' )
|
|
34 :Put fnamemodify('abc"%"def', ':S' )
|
|
35 :Put fnamemodify('abc'' ''def', ':S' )
|
|
36 :Put fnamemodify('abc''%''def', ':S' )
|
|
37 :Put fnamemodify("abc\ndef", ':S' )
|
|
38 :set shell=tcsh
|
|
39 :Put fnamemodify("abc\ndef", ':S' )
|
|
40 :$put ='vim: ts=8'
|
|
41 :1 delete _
|
|
42 :w! test.out
|
|
43 :qa!
|
|
44 ENDTEST
|
|
45
|