-
Notifications
You must be signed in to change notification settings - Fork 186
/
startify.txt
1205 lines (1006 loc) · 43.8 KB
/
startify.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*startify.txt* The fancy start screen.
*startify*
__ __ ___
/\ \__ /\ \__ __ /'___\
____\ \ ,_\ __ _ __\ \ ,_\/\_\/\ \__/ __ __
/',__\\ \ \/ /'__`\ /\`'__\ \ \/\/\ \ \ ,__\/\ \/\ \
/\__, `\\ \ \_/\ \L\.\_\ \ \/ \ \ \_\ \ \ \ \_/\ \ \_\ \
\/\____/ \ \__\ \__/.\_\\ \_\ \ \__\\ \_\ \_\ \/`____ \
\/___/ \/__/\/__/\/_/ \/_/ \/__/ \/_/\/_/ `/___/> \
/\___/
\/__/
by Marco Hinz~
>
If you use any of my plugins, please star them on GitHub. It's a great way
of getting feedback and gives me the kick to put more time into their
development.
If you encounter any bugs or have feature requests, just open an issue on
GitHub.
Thank you for flying mhi^ airlines. Get the Vim on!
<
==============================================================================
CONTENTS *startify-contents*
INTRO .......................................... |startify-intro|
USAGE .......................................... |startify-usage|
OPTIONS ........................................ |startify-options|
AUTOCMD ........................................ |startify-autocmd|
COMMANDS ....................................... |startify-commands|
MAPPINGS ....................................... |startify-mappings|
COLORS ......................................... |startify-colors|
MISC ........................................... |startify-misc|
FAQ ............................................ |startify-faq|
EXAMPLE ........................................ |startify-example|
==============================================================================
INTRO *startify-intro*
Startify is a plugin that shows recently used files, bookmarks, commands and
sessions that were saved to a certain directory.
==============================================================================
USAGE *startify-usage*
Startify basically provides two things:
1) If you start Vim without giving any filenames to it (or pipe stuff to it so
it reads from STDIN), startify will show a pretty start screen that shows
recently used files (using viminfo/shada) and sessions by default.
Additionally, you can define bookmarks (thus entries for files) and
commands that always should be available on the start screen.
You can either navigate to a certain menu entry and hit `<cr>` or just
enter the index (the index is whatever is written between the square
brackets on that line). You can even double-click anywhere on the line.
In addition, `e` creates an empty buffer, `i` creates an empty buffer and
jumps into insert mode, `q` quits either the buffer or, if there is no
other listed buffer left, Vim itself.
Moreover, you can open multiple buffers at once. Navigate to an entry and
hit either `b` (open in same window), `s` (open in split), `v` (open in
vertical split) or `t` (open in tab). You can do that for multiple entries.
You can also mix them. The order of the selections will be remembered.
Afterwards execute these actions via `<cr>`.
The uppercase variants of b/s/v/t enable the batchmode which lets you
select any entries without navigating there first. Every following index
will be opened in the currently active mode. E.g. to open the buffers with
the indices 0, 2, and 4, use `B024` instead of `bjjbjjb`. To disable
batchmode, just use the same uppercase key again, or any of the lowercase
variants.
When the selection is finished, Startify will close automatically. You can
reopen the screen via :Startify.
And you can define your own custom ascii art header!
2) The plugin eases the handling of loading and saving sessions by putting
sessions in a central directory.
:SLoad load a session |startify-:SLoad|
:SSave[!] save a session |startify-:SSave|
:SDelete[!] delete a session |startify-:SDelete|
:SClose close a session |startify-:SClose|
If ! is given, you won't get prompted.
It also supports session persistence, so once a session is loaded, it gets
saved automatically when Vim is quit: |g:startify_session_persistence|
==============================================================================
OPTIONS *startify-options*
Put these variables into your vimrc. The shown assignments are also the
default values.
Most used options:~
|g:startify_bookmarks|
|g:startify_change_to_dir|
|g:startify_change_to_vcs_root|
|g:startify_change_cmd|
|g:startify_custom_header|
|g:startify_enable_special|
|g:startify_list_order|
|g:startify_lists|
|g:startify_skiplist|
|g:startify_update_oldfiles|
Misc options:~
|g:startify_commands|
|g:startify_custom_footer|
|g:startify_custom_header_quotes|
|g:startify_custom_indices|
|g:startify_disable_at_vimenter|
|g:startify_enable_unsafe|
|g:startify_files_number|
|g:startify_fortune_use_unicode|
|g:startify_padding_left|
|g:startify_relative_path|
|g:startify_skiplist_server|
|g:startify_use_env|
Sessions:~
|g:startify_session_autoload|
|g:startify_session_before_save|
|g:startify_session_delete_buffers|
|g:startify_session_dir|
|g:startify_session_number|
|g:startify_session_persistence|
|g:startify_session_remove_lines|
|g:startify_session_savecmds|
|g:startify_session_savevars|
|g:startify_session_sort|
------------------------------------------------------------------------------
*g:startify_session_dir*
>
let g:startify_session_dir = '~/.vim/session'
<
The directory to save/load sessions to/from.
Defaults:~
Nvim: `$XDG_DATA_HOME/nvim/session` (`:echo stdpath('data')`)
Vim (Unix): `$HOME/.vim/session`
Vim (Windows): `$HOME/vimfiles/session`
------------------------------------------------------------------------------
*g:startify_list_order*
This option is DEPRECATED in favor of |g:startify_lists|.
------------------------------------------------------------------------------
*g:startify_lists*
>
let g:startify_lists = [
\ { 'type': 'files', 'header': [' MRU'] },
\ { 'type': 'dir', 'header': [' MRU '. getcwd()] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
<
Startify displays lists. Each list consists of a `type` and optionally a `header`
and custom `indices`.
The 'type' is either a string of a built-in type or a |Funcref|.
The 'header' is a list of strings, whereas each string will be put on its own
line in the header.
The 'indices' is a list of strings, which act as indices for the current list.
Opposed to the global |g:startify_custom_indices|, this is limited to the
current list.
Built-in types:~
'files'
This lists the most recently used files using viminfo. The number of files
is limited by |g:startify_files_number|.
'dir'
This lists the files from the current directory sorted by modification
time. The number of files is limited by |g:startify_files_number|.
'bookmarks'
This lists bookmarks, thus hardcoded files or directories that will always
be shown. Have a look at |g:startify_bookmarks|.
'sessions'
This lists all the sessions saved in the directory |g:startify_session_dir|.
'commands'
This lists commands defined in |g:startify_commands|.
Funcref type:~
The referenced function must return a list of dictionaries. Each dictionary
is an entry that consists of these keys:
'line' The text to display for this entry. (required)
'cmd' The Vim command to execute when the entry gets chosen.
(required unless 'path' is given)
'path' Points to a file. This way you can even use the standard markers
like `s` or `v` etc. to open multiple entries at once.
(required unless 'cmd' is given)
Example #1:~
>
function s:foobar()
return [
\ { 'line': 'foo', 'cmd': 'echo "FOO!"' },
\ { 'line': 'bar', 'cmd': 'echo "BAR!"' },
\ ]
endfunction
let g:startify_lists = [
\ { 'type': 'files', 'header': [' MRU:'] },
\ { 'type': function('s:foobar'), 'header': ['foo', ' and', ' bar'] },
\ ]
<
Example #2:~
This more practical example assumes a git repo at ~/repo and vim-fugitive
installed (for `:Git`).
>
function! s:list_commits()
let git = 'git -C ~/repo'
let commits = systemlist(git .' log --oneline | head -n10')
let git = 'G'. git[1:]
return map(commits, '{"line": matchstr(v:val, "\\s\\zs.*"), "cmd": "'. git .' show ". matchstr(v:val, "^\\x\\+") }')
endfunction
let g:startify_lists = [
\ { 'header': [' MRU'], 'type': 'files' },
\ { 'header': [' MRU '. getcwd()], 'type': 'dir' },
\ { 'header': [' Sessions'], 'type': 'sessions' },
\ { 'header': [' Commits'], 'type': function('s:list_commits') },
\ ]
<
NOTE: Headers are context-sensitive: If the list for a type is empty, the
header won't be shown.
NOTE: Headers use the StartifySection highlight group. See |startify-colors|.
------------------------------------------------------------------------------
*g:startify_bookmarks*
>
let g:startify_bookmarks = []
<
A list of files or directories to bookmark. The list can contain two kinds of
types. Either a path or a dictionary whereas the key is the custom index and
the value is the path.
Example:
>
let g:startify_bookmarks = [ {'c': '~/.vimrc'}, '~/.zshrc' ]
<
NOTE: Avoid using keys from |startify-mappings| if providing custom indices.
------------------------------------------------------------------------------
*g:startify_commands*
>
let g:startify_commands = []
<
A list of commands to execute on selection. Leading colons are optional. It
supports optional custom indices and/or command descriptions.
Example:
>
let g:startify_commands = [
\ ':help reference',
\ ['Vim Reference', 'h ref'],
\ {'h': 'h ref'},
\ {'m': ['My magical function', 'call Magic()']},
\ ]
<
NOTE: Avoid using keys from |startify-mappings| if providing custom indices.
------------------------------------------------------------------------------
*g:startify_files_number*
>
let g:startify_files_number = 10
<
The number of files to list.
------------------------------------------------------------------------------
*g:startify_update_oldfiles*
>
let g:startify_update_oldfiles = 0
<
Usually |v:oldfiles| only gets updated when Vim exits. Using this option updates
it on-the-fly, so that :Startify is always up-to-date.
------------------------------------------------------------------------------
*g:startify_session_autoload*
>
let g:startify_session_autoload = 0
<
If this option is enabled and you start Vim in a directory that contains a
`Session.vim`, that session will be loaded automatically. Otherwise it will be
shown as the top entry in the Startify buffer.
The same happens when you |:cd| to a directory that contains a `Session.vim`
and execute |:Startify|.
It also works if you open a bookmarked directory. See |g:startify_bookmarks|.
This is great way to create a portable project folder!
NOTE: This option is affected by |g:startify_session_delete_buffers|.
------------------------------------------------------------------------------
*g:startify_session_before_save*
>
let g:startify_session_before_save = []
<
This is a list of commands to be executed before saving a session.
Example:
>
let g:startify_session_before_save = [ 'silent! tabdo NERDTreeClose' ]
<
------------------------------------------------------------------------------
*g:startify_session_persistence*
>
let g:startify_session_persistence = 0
<
Automatically update sessions in two cases:
- Before leaving Vim
- Before loading a new session via :SLoad
This also works for sessions started with:
>
vim -S mysession.vim
<
------------------------------------------------------------------------------
*g:startify_session_delete_buffers*
>
let g:startify_session_delete_buffers = 1
<
Delete all buffers when loading or closing a session:
- When using |startify-:SLoad|.
- When using |startify-:SClose|.
- When using |g:startify_session_autoload|.
- When choosing a session from the Startify buffer.
NOTE: Buffers with unsaved changes are silently ignored.
------------------------------------------------------------------------------
*g:startify_change_to_dir*
>
let g:startify_change_to_dir = 1
<
When opening a file or bookmark, change to its directory.
You want to disable this, if you're using |'autochdir'| as well.
NOTE: It defaults to 1, because that was already the behaviour at the time
this option was introduced.
------------------------------------------------------------------------------
*g:startify_change_to_vcs_root*
>
let g:startify_change_to_vcs_root = 0
<
When opening a file or bookmark, seek and change to the root directory of the
VCS (if there is one).
At the moment only git, hg, bzr and svn are supported.
------------------------------------------------------------------------------
*g:startify_change_cmd*
>
let g:startify_change_cmd = 'lcd'
<
The default command for switching directories. Valid values:
'cd' (|:cd|)
'lcd' (|:lcd|)
'tcd' (|:tcd|)
Affects |g:startify_change_to_dir| and |g:startify_change_to_vcs_root|.
------------------------------------------------------------------------------
*g:startify_skiplist*
>
let g:startify_skiplist = []
<
A list of Vim regular expressions that is used to filter recently used files.
See |pattern.txt| for what patterns can be used.
The following patterns are filtered by default:
'runtime/doc/.*\.txt$'
'bundle/.*/doc/.*\.txt$'
'plugged/.*/doc/.*\.txt$'
'/.git/'
'fugitiveblame$'
escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc/.*\.txt$'
NOTE: Due to the nature of patterns, you can't just use "~/mysecret" but have
to use "$HOME .'/mysecret.txt'". The former would do something entirely
different: |/\~|.
NOTE: When using backslashes as path separators, escape them. Otherwise using
"C:\this\vim\path\is\problematic" would not match what you would expect, since
|/\v| is a pattern, too.
Example:
>
let g:startify_skiplist = [
\ '\.vimgolf',
\ '^/tmp',
\ '/project/.*/documentation',
\ escape(fnamemodify($HOME, ':p'), '\') .'mysecret.txt',
\ ]
<
------------------------------------------------------------------------------
*g:startify_fortune_use_unicode*
>
let g:startify_fortune_use_unicode = 0
<
By default, the fortune header uses ASCII characters, because they work for
everyone. If you set this option to 1 and your 'encoding' is "utf-8", Unicode
box-drawing characters will be used instead.
This is not the default, because users of East Asian languages often set
'ambiwidth' to "double" or make their terminal emulator treat characters of
ambiguous width as double width. Both would make the drawn box look funny.
For more information: http://unicode.org/reports/tr11
------------------------------------------------------------------------------
*g:startify_padding_left*
>
let g:startify_padding_left = 3
<
The number of spaces used for left padding.
------------------------------------------------------------------------------
*g:startify_skiplist_server*
>
let g:startify_skiplist_server = []
<
Do not create the startify buffer, if this is a Vim server instance with a
name contained in this list.
Example:
>
let g:startify_skiplist_server = [ 'GVIM' ]
<
------------------------------------------------------------------------------
*g:startify_enable_special*
>
let g:startify_enable_special = 1
<
Show <empty buffer> and <quit>.
------------------------------------------------------------------------------
*g:startify_enable_unsafe*
>
let g:startify_enable_unsafe = 0
<
Enable the option only in case you think Vim starts too slowly (because of
:Startify) or if you often edit files on remote filesystems.
It's called unsafe because it improves the time :Startify needs to execute by
reducing the amount of syscalls to the underlying operating system, but
sacrifices the precision of shown entries.
This could lead to inconsistences in the shown :Startify entries (e.g. the
same file could be shown twice, because one time file was opened via absolute
path and another time via symlink).
Currently this option does this:
- don't resolves symlinks (readlink(2))
- don't check every file if it's readable (stat(2))
- don't filter through the bookmark list
------------------------------------------------------------------------------
*g:startify_session_remove_lines*
>
let g:startify_session_remove_lines = []
<
Lines matching any of the patterns in this list, will be removed from the
session file.
Example:
>
let g:startify_session_remove_lines = ['setlocal', 'winheight']
<
Internally this simply does:
>
:global/setlocal/delete
:global/winheight/delete
<
So you can use any |pattern|.
NOTE: Take care not to mess up any expressions within the session file,
otherwise you'll probably get problems when trying to load it.
------------------------------------------------------------------------------
*g:startify_session_savevars*
>
let g:startify_session_savevars = []
<
Include a list of variables in here which you would like Startify to save into
the session file in addition to what Vim normally saves into the session file.
For example, Vim will not normally save all-lowercase global variables, which
are common for plugin settings. It may be advisable to include
|g:startify_session_savevars| and |g:startify_session_savecmds| into this list
so they are saved every time the session saves.
Example:
>
let g:startify_session_savevars = [
\ 'g:startify_session_savevars',
\ 'g:startify_session_savecmds',
\ 'g:random_plugin_use_feature'
\ ]
<
------------------------------------------------------------------------------
*g:startify_session_savecmds*
>
let g:startify_session_savecmds = []
<
Include a list of cmdline commands which Vim will run upon loading the
session. This can be useful to set various things (other than variables,
|g:startify_session_savevars| above) which Vim may not normally save into the
session file, as well as run external commands upon loading a session.
Example:
>
let g:startify_session_savecmds = [
\ 'silent !pdfreader ~/latexproject/main.pdf &'
\ ]
<
------------------------------------------------------------------------------
*g:startify_session_number*
>
let g:startify_session_number = 999
<
The maximum number of sessions to display. Makes the most sense together with
|g:startify_session_sort|.
------------------------------------------------------------------------------
*g:startify_session_sort*
>
let g:startify_session_sort = 0
<
Sort sessions by modification time (when the session files were written)
rather than alphabetically.
------------------------------------------------------------------------------
*g:startify_custom_indices*
>
let g:startify_custom_indices = []
<
Use any list of strings as indices instead of increasing numbers. If there are
more startify entries than actual items in the custom list, the remaining
entries will be filled using the default numbering scheme starting from 0.
Thus you can create your own indexing scheme that fits your keyboard layout.
You don't want to leave the home row, do you?!
Example:
>
let g:startify_custom_indices = ['f', 'g', 'h']
<
This would result in:
[f] /most/recently/used/file1
[g] /most/recently/used/file2
[h] /most/recently/used/file3
[0] /most/recently/used/file4
[1] /most/recently/used/file5
[2] /most/recently/used/file6
etc.
If you want numbers to start at 1 instead of 0, you could use this:
>
let g:startify_custom_indices = map(range(1,100), 'string(v:val)')
<
NOTE: There is no sanitizing going on, so you should know what you're doing!
Avoid using keys from |startify-mappings|.
------------------------------------------------------------------------------
*g:startify_custom_header*
>
let g:startify_custom_header = 'startify#pad(startify#fortune#cowsay())'
<
Define your own header.
This option takes a `list of strings`, whereas each string will be put on its
own line. If it is a simple `string`, it should evaluate to a list of strings.
Helper functions:~
startify#fortune#quote() random quote
startify#fortune#boxed(...) random quote in a box
startify#fortune#cowsay(...) random quote in a box + cow
The last two functions optionally take a quote in the list of strings format.
They also return a list of strings, suitable for this option.
startify#pad([strings]) pad strings in list according to
|g:startify_padding_left| or the default of 3
startify#center([strings]) center list of strings without removing
its strings indentations
Example #1:~
>
let g:startify_custom_header = [
\ ' ________ __ __ ',
\ ' __ /\_____ \/\ \\ \ ',
\ ' __ __ /\_\ ___ ___ \/___//''/''\ \ \\ \ ',
\ ' /\ \/\ \\/\ \ /'' __` __`\ /'' /'' \ \ \\ \_ ',
\ ' \ \ \_/ |\ \ \/\ \/\ \/\ \ /'' /''__ \ \__ ,__\',
\ ' \ \___/ \ \_\ \_\ \_\ \_\ /\_/ /\_\ \/_/\_\_/ ',
\ ' \/__/ \/_/\/_/\/_/\/_/ \// \/_/ \/_/ ',
\ ]
<
Example #2:~
>
let g:startify_custom_header =
\ startify#pad(split(system('fortune | cowsay'), '\n'))
<
Example #3:~
Let's assume you like the default boxed random quote, but not the ASCII art
cow. You'd rather have another small ASCII art come before the quote. No
problem!
>
let g:ascii = [
\ ' __',
\ '.--.--.|__|.--------.',
\ '| | || || |',
\ ' \___/ |__||__|__|__|',
\ ''
\]
let g:startify_custom_header = g:ascii + startify#fortune#boxed()
<
Looks great! But it's not on the same column as the indices below which makes
it look awkward. Let's indent the header by 3 spaces:
>
let g:startify_custom_header =
\ startify#pad(g:ascii + startify#fortune#boxed())
<
Ah, much better! There's only one issue left. If you set
g:startify_custom_header this way, it will only be done once. Hence spamming
:Startify will always show the same quote.
If you provide a string to it instead, Startify will evaluate it every time
:Startify is run:
>
let g:startify_custom_header =
\ 'startify#pad(g:ascii + startify#fortune#boxed())'
<
Happy customizing!
Also have a look at |startify-faq-08|.
------------------------------------------------------------------------------
*g:startify_custom_header_quotes*
If you don't set |g:startify_custom_header|, the internal cowsay implementation
with predefined random quotes will be used.
To use your own quotes, set this option to a list of quotes. Each quote is
either another list or a |Funcref| (see |expr-lambda|) that returns a list.
Each element of the inner lists is put on an own line in the custom header.
>
let g:startify_custom_header_quotes = [
\ ['quote #1'],
\ ['quote #2', 'using', 'three lines'],
\ {-> systemlist('echo quote #3')}
\ ]
<
If you want the predefined quotes as well, use this:
>
let g:startify_custom_header_quotes =
\ startify#fortune#predefined_quotes() + [['quote 1', 'quote 2']]
<
------------------------------------------------------------------------------
*g:startify_custom_footer*
>
let g:startify_custom_footer = ''
<
Same as the custom header, but shown at the bottom of the startify buffer.
------------------------------------------------------------------------------
*g:startify_disable_at_vimenter*
>
let g:startify_disable_at_vimenter = 0
<
Don't run Startify at Vim startup. You can still call it anytime via
:Startify.
-----------------------------------------------------------------------------
*g:startify_relative_path*
>
let g:startify_relative_path = 0
<
If the file is in or below the current working directory, use a relative path.
Otherwise an absolute path is used. The latter prevents hard to grasp entries
like `../../../../../foo`.
NOTE: This only applies to the "files" list, since the "dir" list is
relative by nature.
-----------------------------------------------------------------------------
*g:startify_use_env*
>
let g:startify_use_env = 0
<
Show environment variables in path, if their name is shorter than their value.
See |startify-colors| for highlighting them.
$PWD and $OLDPWD are ignored.
==============================================================================
AUTOCMD *startify-autocmd*
In certain situations Startify emits events which can be hooked into via
|autocmd|s. Those can be used for further customization.
StartifyReady~
When the Startify buffer is ready.
StartifyBufferOpened~
For each buffer that got opened by Startify. When you open multiple files at
once (see |startify-usage|), this event fires multiple times as well.
StartifyAllBuffersOpened~
No matter how many buffers you open, this event fires only once after the
last buffer was opened.
Example:
>
autocmd User StartifyReady let &l:stl = ' This statusline rocks!'
<
Or use it to disable single mappings: |startify-faq-16|.
NOTE: Autocmds don't nest by default. If you use any command that triggers new
events, be sure to add "nested": |autocmd-nested|.
==============================================================================
COMMANDS *startify-commands*
*startify-:Startify*
>
:Startify
<
Open the startify buffer.
*startify-:SSave*
*startify-:SDelete*
>
:SSave[!] [session]
:SDelete[!] [session]
<
Save or delete a session. If you don't specify a session name, it will prompt
you for one.
Use `:SSave!` or `:SDelete!` to always overwrite or delete an existing session.
*startify-:SLoad*
>
:SLoad[!] [session]
<
Load a session. If you don't specify a session name, it will prompt you for
one.
If the `!` is given, it tries to source the last used session (only Unix).
Providing only a part of the session name works too, if you complete the
argument with either <c-d> or <tab> afterwards.
NOTE: This command is affected by |g:startify_session_delete_buffers|.
*startify-:SClose*
>
:SClose
<
Save and close the current session, close all listed buffers, and open the
Startify buffer.
NOTE: This command is affected by |g:startify_session_delete_buffers|.
==============================================================================
MAPPINGS *startify-mappings*
Some things are remapped in the startify buffer..
>
q
<
Close startify. Also quit Vim if it is the only buffer.
>
e
<
Close startify and create a blank buffer.
>
i
<insert>
<
Close startify, create a blank buffer and jump into insert mode right away.
>
<2-LeftMouse>
<
Use a simple mouse click to open the targeted entry.
>
[any number that is shown between square brackets]
<
Open the entry with the given number.
>
b
s
v
t
<
Mark current entry to be opened in either the same window, in a split window,
in a vertical split window or in a new tab.
>
<cr>
<
Open all marked entries. If nothing was marked beforehand, just open the
current entry.
If you want to use another key instead of <cr>, put this in your vimrc:
>
autocmd User Startified nmap <buffer> o <plug>(startify-open-buffers)
<
==============================================================================
COLORS *startify-colors*
You can overwrite the highlight groups used by startify. The plugin defines
these groups:
Highlight group | Description | Default
------------------------------------------------------------------
| |
StartifyBracket | [,] | linked to Delimiter
StartifyFile | the actual file | linked to Identifier
StartifyFooter | the custom footer | linked to Title
StartifyHeader | the custom header | linked to Title
StartifyNumber | the numbers between [] | linked to Number
StartifyPath | the path to a file | linked to Directory
StartifySection | section headers | linked to Statement
StartifySelect | selected entries | linked to Title
StartifySlash | slashes in paths | linked to Delimiter
StartifySpecial | <empty buffer>,<quit> | linked to Comment
StartifyVar | environment variables | linked to StartifyPath
Example: (my terminal emulator supports 256 colors)
>
highlight StartifyBracket ctermfg=240
highlight StartifyFooter ctermfg=240
highlight StartifyHeader ctermfg=114
highlight StartifyNumber ctermfg=215
highlight StartifyPath ctermfg=245
highlight StartifySlash ctermfg=240
highlight StartifySpecial ctermfg=240
<
==============================================================================
MISC *startify-misc*
Changing the entry format:~
You can create a function `StartifyEntryFormat()` which returns a string that
gets evaluated in Startify. In that string, `entry_path` and `absolute_path`
will be replaced by their respective values.
`absolute_path` is self-explaining and `entry_path` is the same path but
potentially shortened, depending on options like |g:startify_relative_path|.
Let us assume you have vim-devicons installed. That plugin has a function
`WebDevIconsGetFileTypeSymbol()` which returns an icon depending on the given
file. Prepend the logo to each Startify entry by putting this in your vimrc:
>
function! StartifyEntryFormat()
return 'WebDevIconsGetFileTypeSymbol(absolute_path) ." ". entry_path'
endfunction
<
==============================================================================
FAQ *startify-faq*
|startify-faq-01| I want to use cursorline!
|startify-faq-02| Recent files aren't shown!
|startify-faq-03| I have broken colors when using sessions!
|startify-faq-04| How to disable common but unimportant files?
|startify-faq-05| Why is the Startify buffer not using buftype=nofile?
|startify-faq-06| How do I get both NERDTree and Startify working at
startup?
|startify-faq-07| The session autoload feature is not working!
|startify-faq-08| How do I center my header/footer?
|startify-faq-09| tmux-resurrect?
|startify-faq-10| Temporarily skip Startify at start?
|startify-faq-11| How to use the output of a command as header?
|startify-faq-12| There is an empty window with vim-plug!
|startify-faq-13| How to disable random quotes header?
|startify-faq-14| NERDTree with NERDTreeTabs does not work in gvim!
|startify-faq-15| Startify is cluttered with help files!
|startify-faq-16| How to disable single mappings?
|startify-faq-17| Run Startify for each new tab!
|startify-faq-18| Files from remote file system slow down startup!
------------------------------------------------------------------------------
*startify-faq-01*
I want to use cursorline!~
Startify issues a User event when it's finished. It can be used to set
buffer-local options etc.
>
autocmd User Startified setlocal cursorline
<
------------------------------------------------------------------------------
*startify-faq-02*
Recent files aren't shown!~
Perhaps the problem is that the viminfo file..
- doesn't exist
- is invalid
- is empty
- can't be read (check permissions)
I suggest the following steps:
1) Create a new directory:
>
$ mkdir -p ~/.vim/files/info
<
2) Put this into your vimrc:
>
set viminfo='100,n$HOME/.vim/files/info/viminfo
<
See |'viminfo'| for information about the second step and what it does
exactly.
------------------------------------------------------------------------------
*startify-faq-03*
I have broken colors when using sessions!~
Nothing this plugin could do about. Try playing around with 'sessionoptions'.
NOTE: Startify removes 'options' from the session options automatically,
because it's the source of many problems.
Some people swear it works for them with these settings:
>
set sessionoptions=blank,curdir,folds,help,tabpages,winpos
<
------------------------------------------------------------------------------
*startify-faq-04*
How to disable common but unimportant files?~
Use |g:startify_skiplist|.
------------------------------------------------------------------------------
*startify-faq-05*
Why is the Startify buffer not using buftype=nofile?~
Did you accidentally use |:write| in the Startify buffer and it was saved to
an actual file on disk? It's because buftype=nofile is not used.
This is done to improve compatibility with other plugins. When buftype=nofile
was set, plugins like CtrlP or NERDTree would open splits instead of reusing
the window showing the Startify buffer.
If you understand this but want it anyway, put this in your vimrc:
>
autocmd User Startified setlocal buftype=nofile
<
------------------------------------------------------------------------------
*startify-faq-06*
How do I get both NERDTree and Startify working at startup?~
Put this in your vimrc:
>
autocmd VimEnter *
\ if !argc()
\ | Startify
\ | NERDTree
\ | wincmd w
\ | endif