Skip to content

Commit 729fda0

Browse files
committed
Add a helper script to launch a pristine Vim
1 parent 264796d commit 729fda0

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

clean-slate.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set foldmethod=syntax
2+
execute 'set runtimepath^=' . expand('<sfile>:p:h:h')
3+
execute 'set runtimepath^=' . expand('<sfile>:p:h')
4+
syntax on
5+
6+
runtime config.vim

config.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
" If you need to customize launch-vim's behavior (for example,
2+
" when trying to figure out what's going on with a particular
3+
" set of configuration values), you can put those in here

launch-vim

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
6+
use FindBin;
7+
use File::Spec;
8+
use Getopt::Long;
9+
10+
sub show_help {
11+
print << "END_USAGE";
12+
Usage: $0 [--help] [vim-options] [files]
13+
14+
Launches an instance of Vim with a clean slate (ie. without considering
15+
the user's configuration). Custom configuration can be dropped into
16+
$FindBin::Bin/config.vim
17+
END_USAGE
18+
exit 0;
19+
}
20+
21+
my $help;
22+
23+
my $ok = GetOptions(
24+
'h|help' => \$help,
25+
);
26+
27+
show_help if $help || !$ok;
28+
29+
my $config = File::Spec->catfile($FindBin::Bin, 'clean-slate.vim');
30+
exec 'vim', '-u', $config, @ARGV;

0 commit comments

Comments
 (0)