Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (50 sloc) 1.17 KB
Tests for 'directory' option.
- ".", in same dir as file
- "./dir", in directory relative to file
- "dir", in directory relative to current dir
:so small.vim
:set nocompatible viminfo+=nviminfo
:set dir=.,~
:/start of testfile/,/end of testfile/w! Xtest1
:" do an ls of the current dir to find the swap file (should not be there)
:if has("unix")
: !ls .X*.swp >test.out
: r !ls X*.swp >test.out
:!echo first line >>test.out
:e Xtest1
:if has("unix")
:" Do an ls of the current dir to find the swap file, remove the leading dot
:" to make the result the same for all systems.
: r!ls .X*.swp
: s/\.*X/X/
: .w >>test.out
: undo
: !ls X*.swp >>test.out
:!echo under Xtest1.swp >>test.out
:!mkdir Xtest2
:set dir=./Xtest2,.,~
:e Xtest1
:!ls X*.swp >>test.out
:!echo under under >>test.out
:!ls Xtest2 >>test.out
:!echo under Xtest1.swp >>test.out
:/start of testfile/,/end of testfile/w! Xtest2/Xtest3
:e Xtest2/Xtest3
:!ls Xtest2 >>test.out
:!echo under Xtest3 >>test.out
:!ls >>test.out
:!echo under Xtest3.swp >>test.out
start of testfile
line 2 Abcdefghij
line 3 Abcdefghij
end of testfile
Jump to Line
Something went wrong with that request. Please try again.