Commit graph

310 commits

Author SHA1 Message Date
Marco Hinz 54ee02272c Make n/N work properly
For caveats see:

https://github.com/mhinz/vim-startify/issues/218#issuecomment-222962221

References #218.
2016-06-01 13:12:44 +02:00
Marco Hinz 3c3a835d8d Check user options properly
References #220.
2016-06-01 02:13:55 +02:00
Marco Hinz 977ee633e5 Don't make Startify a scratch buffer
It's a real file buffer now, since that is what most plugins assume
anyway.

We also give it a proper name, "Startify", because after `buftype=` it
would be listed as "[No Name]" instead of "[Scratch]", which is arguably
confusing.

Closes #214.
2016-06-01 01:02:40 +02:00
Marco Hinz e5ce53fbef Make g:startify_commands more flexible 2016-05-31 23:38:29 +02:00
Ernst Widerberg 9a833c5bc6 Add ex command list 2016-05-31 23:38:29 +02:00
Xandor Schiefer b16c8353e5 devicons: remove parentheses around symbols 2016-05-31 17:30:58 +02:00
Marco Hinz 8512fa3b1c Always put cursor on first entry
References #212.
2016-03-24 12:42:07 +01:00
Marco Hinz 5a45174657 Transformations: fall back to normal usage if no match 2016-03-21 11:25:30 +01:00
Marco Hinz c381ab79fc Transformations: allow patterns
The type of g:startify_transformations has to be a list of lists now.
The inner lists contain 2 elements, a pattern and either a string or a
funcref.

Example:

function! s:foo(filename)
  return fnamemodify(a:filename, ':t')
endfunction

let g:startify_transformations = [
      \ ['.*vimrc$', 'vimrc'],
      \ ['.*', function('s:foo')],
      \ ]

References #209.
2016-03-20 15:37:22 +01:00
Marco Hinz 570ef9e11f Don't add blank line for empty custom header
Closes #210.
2016-03-20 14:21:56 +01:00
Marco Hinz ffb80ec99e Add g:startify_transformations 2016-03-18 16:59:24 +01:00
Marco Hinz 41b53389af Make q work with 'buflisted' set
References #208.
2016-03-17 12:47:25 +01:00
Marco Hinz f90594bb9a Eval g:startify_custom_header if it's a string 2016-03-17 11:44:33 +01:00
Marco Hinz 994a85ac22 Refactoring: fortune.vim 2016-03-17 11:05:36 +01:00
Marco Hinz 6509329585 Fortune: use ' instead of `
Keep the fortune file ASCII-clean, according to:

http://english.stackexchange.com/questions/163480/which-is-the-correct-apostrophe-to-use-when-typing-quote-or-backtick
2016-03-15 01:42:55 +01:00
Marco Hinz 075423f45a Default custom header: use * for corners 2016-03-14 17:29:08 +01:00
Marco Hinz e845a3958c Default custom header: add box and cow! 2016-03-14 17:26:59 +01:00
Marco Hinz a4d8870d2f Add missing fortune.vim 2016-03-14 15:56:17 +01:00
Marco Hinz fa733c3e20 Show random quotes if g:startify_custom_header isn't set 2016-03-14 15:29:20 +01:00
Marco Hinz 193e0802ec Redraw screen after env hack 2016-03-07 15:58:03 +01:00
Sergey Vlasov f610be1431 Avoid 'Press Enter' message on session write 2016-03-07 16:28:52 +02:00
Marco Hinz 23e043cc82 Env: prevent 'press enter' prompt in small windows (only Vim) 2016-02-15 16:14:36 +01:00
Marco Hinz d14150d22b Env: only run for the "files" listing 2016-02-13 21:23:24 +01:00
Marco Hinz de965726eb Env: prefer shortest variable name
If several environment variables point to the same directory, prefer the one
with the shortest name.

References #197.
2016-02-12 18:06:35 +01:00
Marco Hinz c621e375a1 Make g:startify_use_env work on Windows 2016-02-12 17:43:10 +01:00
Marco Hinz 9e4a159637 New option: g:startify_use_env
References #197.
2016-02-12 14:26:33 +01:00
Marco Hinz 57252a4a56 Check if to be deleted session even exists 2016-02-02 15:01:00 +01:00
Marco Hinz 7994cae378 Add :SDelete! 2016-02-02 14:54:58 +01:00
Marco Hinz ec24c42b5c Never list __LAST__ as valid session 2016-02-02 14:44:07 +01:00
Marco Hinz 1c1c3abb80 Tests: add session.vader 2016-02-02 13:35:34 +01:00
Marco Hinz 8545f6f553 Put last used session marker in session directory 2016-01-12 15:11:03 +01:00
Marco Hinz e75c49a339 Shorter section headers
Use shorter section headers and add the current working directory to the 'dir'
list.

References #193.
2015-12-27 21:10:07 +01:00
Marco Hinz 295fe7a09a Avoid '&&' in system()
I assumed that every shell would support '&&'. Apparently this is not the case
for Fish: it uses 'and'...

Anyway, the simple solution is to avoid cd'ing in the proper directory first
and just using absolute paths for ln instead.

References #165.
2015-12-11 15:51:08 +01:00
Marco Hinz 720299cbf5 Make potential warning less obtrusive 2015-12-11 12:29:44 +01:00
Marco Hinz b81dfa54b9 Ignore <nowait> before 7.3.1261
References #183.

Helped-by: @timss
2015-11-22 02:07:00 +01:00
Marco Hinz cc5989711b Fix nowait logic
References #188.
2015-11-20 13:45:40 +01:00
Marco Hinz 06ff991d7f Always shorten 'files' entries to "~"
..no matter if g:startify_relative_path is set or not.
2015-11-17 02:53:11 +01:00
somini 5b43cef057 New option: g:startify_mapping_nowait
This option forces the use of <nowait> mappings.

This might be useful if you have global mappings that start with the same
characters as indexes from Startify.

References #180
Closes #186.
2015-11-16 12:32:28 +01:00
Marco Hinz 80384d9c05 :SL without argument loads last session on Unix
References #181.
2015-11-14 02:18:03 +01:00
Marco Hinz 1f7b1ab4dc Make 'e' and 'q' also <nowait>
Reported-by: @Konfekt
2015-11-09 19:38:16 +01:00
Marco Hinz b817cab23f Remove <nowait> for index mappings
<nowait> guards against global mappings.

Problem: However, having 2 local <nowait> mappings, '1' and '11', makes no
sense, since it would always go with the former.

Solution: Remove <nowait> from all dynamically created mappings and keep it
for the fixed ones (i, b, v, ...).

If you absolutely need a <nowait> mapping for a non-fixed mapping, e.g. 'g'
(and because you use vim-commentary which maps 'gc'), see
":h startify-autocmd":

    autocmd User Startified nnoremap <buffer><nowait><silent> g ...

References #180.

Reported-by: @noscripter
2015-11-09 11:58:21 +01:00
Marco Hinz c193556225 Add support for vim-devicons
Closes #177.
2015-11-08 02:52:17 +01:00
Konfekt 295c02f926 Resolve symlinks in MRU filter
For example, OpenSUSE uses a `.../vim/current` symlink for `$VIMRUNTIME`. The
skiplist now resolves these to filter them too.

Closes #184.
2015-11-06 18:10:48 +01:00
Marco Hinz df8b4e1fde Support for custom indices for g:startify_bookmarks
g:startify_bookmarks now supports custom indices directly. E.g.

    let g:startify_bookmarks = [ {'v': '~/.vimrc'} ]

References #176, #178.
2015-11-03 22:39:58 +01:00
Marco Hinz 0bb969178d Do not filter bookmarks anymore 2015-11-03 17:31:05 +01:00
Marco Hinz 61c1e360c8 Custom indices overwrite plugin mappings
References #178.
2015-11-03 16:01:23 +01:00
Marco Hinz ff4732bb30 Ignore <session>x.vim files in session path
These files can be used to set up additional things for a session and have to
be placed in the same directory as the session file.

See point 10 under `:h :mksession` for more information.

Since they are no real session files, Startify shouldn't list them either.

Closes #179.
2015-11-03 15:25:25 +01:00
somini 97b4e225be Improve mappings
This sets all the created mappings as `nowait`, meaning having global
mappings will still allow you to jump to a file instantly.

For example, if you have a commentary plugin and define a global mapping
of `gcc`, you can't use `g` without waiting (or clicking Esc right
away).

Closes #180.
2015-11-03 13:27:04 +01:00
Marco Hinz 6f886cdc48 Make window sizes equal 2015-08-20 09:32:19 +02:00
Marco Hinz 7f76635fce session_write(): error msg instead of exception
References #174.
2015-08-14 11:59:26 +02:00
Marco Hinz 695121f065 Change skiplist default + improve docs
Thanks for the feedback, @Osse.
2015-07-06 18:53:46 +02:00
Enrico Ghirardi 2ae8a96633 Use blackhole register when removing lines
During session save, when removing lines, we don't want to store the content
in the unnamed register, takes more time and changes clipboard content. Just
use the blackhole register.

References #167.
2015-06-12 19:48:03 +02:00
Marco Hinz 2c7807566c Only check user options for regular files
We don't "switch to dir"/"switch to VCS dir"/"autoload sessions" when opening
special entries ([e] and [q]) or sessions.

References #165.
2015-06-03 10:09:30 +02:00
Marco Hinz be611cd545 Call s:check_user_options() for all entries
References #165.
2015-06-02 23:19:53 +02:00
Marco Hinz 01a1038401 Small fixes 2015-06-02 23:18:36 +02:00
Marco Hinz 61cfce000c Don't overwrite the last regular entry with [q] 2015-06-02 22:26:59 +02:00
Marco Hinz ee674f99a8 Register e/q even if special is disabled 2015-06-02 09:35:42 +02:00
Marco Hinz f98dba25f2 :StartifyDebug should never fail 2015-06-02 09:18:05 +02:00
Marco Hinz 06b117451a Add s:register() 2015-06-02 09:07:14 +02:00
Marco Hinz be8bfe8513 Add missing entries
References #163.
2015-06-02 08:55:14 +02:00
Marco Hinz f59d93d5f4 Always use markers to open files 2015-06-01 17:21:52 +02:00
Marco Hinz 2ea22e2e7e Simplify marker implementation
This commit also fixes loading sessions via the new #open_buffers() method.

References #163.
2015-06-01 17:07:40 +02:00
Marco Hinz 07be6b5fa9 Handle bookmarks via #open_buffers()
References #164.
2015-06-01 14:36:03 +02:00
Marco Hinz 8fd4247218 Refactoring: handle all file opening in #open_buffers() 2015-05-28 17:16:09 +02:00
Marco Hinz d2af054a59 Escape '[' on Windows
Escape '[' as according to ":h wildcard", so it doesn't get interpreted as a
pattern, like "[0-9]".

References #161.
2015-05-28 13:12:04 +02:00
Marco Hinz acbce306b2 Use same open mechanism for all supported methods 2015-05-28 12:49:24 +02:00
Marco Hinz 51f64a28e8 Use feedkeys() properly #2
With mode 't' enabled, you'd get a timeout if you had indices 1 and 11 and
keyed in '1'.
2015-05-28 11:55:52 +02:00
Marco Hinz 7375e31f79 Use feedkeys() properly 2015-05-28 11:20:49 +02:00
Marco Hinz 167af9490a Don't skip encryption key prompt
References #162.
2015-05-28 11:13:18 +02:00
Marco Hinz d7adb1709f Proper filename escaping
A glob() is effectively undoing a fnameescape().

References #160.
2015-05-18 20:59:18 +02:00
Marco Hinz 1f42935fd6 Introduce g:startify_session_remove_lines
References #159.
2015-05-12 12:02:19 +02:00
Marco Hinz 9ef7fcb502 Small maintenance tasks 2015-04-28 15:34:11 +02:00
Marco Hinz eccf570aea Don't allow gj type mappings
Assuming a small screen and 'wrap' set:

The cursor is forced to stay in a certain column, so doing gj on a wrapped
line will jump into an area outside the position [x] and jump back into it
immediately effectively breaking navigation.

Solution: use local mappings that just do the usual h/j/k/l dance.

References #156.
2015-04-22 11:22:40 +02:00
Marco Hinz 3e143739d7 Expand '~' in the skiplist
The skiplist gets checked against normal Vim regular expressions. That also
means that you can't just use '~'; see ":h /\~".

That especially sneaky if you use variables that refer to directories within
your home directory.

Solution: expand them via fnamemodify().

References #154.
2015-04-20 02:46:36 +02:00
Pedro Nicolás Gómez 96ccdf7f15 Fix :SSave problem with wildmode
With these settings: wildmode=list and laststatus=2

When call the command :SSave and use <tab> for autocomplete, and choose any
session, then the message "Session already exists. Overwrite?  [y/n]" does not
appear on screen.

References #155.
2015-04-16 12:24:56 +02:00
Marco Hinz 36ff6db44a Fix :enew handling (again)
fugitive is run at VimEnter and for new buffers that are associated with
files.

Now fugitive commands will be available after start (in the Startify screen),
but it won't work after calling :Startify, since fugitive is designed that
way.

References #33.
2015-03-25 16:05:26 +01:00
Marco Hinz 08c0164a1b Introduce g:startify_enable_unsafe
References #149.
2015-03-06 16:12:17 +01:00
Marco Hinz 66083493ed Verbatim matching of path prefix
Closes #146.
2015-02-02 01:38:36 +01:00
Marco Hinz 362fa1d957 Fix autoloading of sessions from bookmarked directories
References #144.
2015-01-14 11:46:18 +01:00
Marco Hinz aea086205c Change meaning of g:startify_session_autoload
References #142.
2015-01-08 21:42:54 +01:00
coachshea b89114f359 Add :SClose
References #141.
2015-01-06 00:47:39 +01:00
Marco Hinz a8657753d6 Avoid unset w:startify_section_header_lines
Change w:startify_section_header_lines to b: to avoid it being unset on :split
and similar commands.

References #137.
2014-12-17 13:01:27 +01:00
Marco Hinz 22f1d58333 Fix last line #2
References #132.
2014-11-26 16:04:28 +01:00
Marco Hinz 8c3ff7f727 Remove unneeded copy() 2014-11-25 12:30:53 +01:00
Marco Hinz d3e2ebd3e3 Correct grammar: "last recently" -> "most recently"
Closes #129.
2014-11-25 12:19:59 +01:00
Marco Hinz 1becbe7724 Fix missing argument
References #130.
2014-11-24 21:46:26 +01:00
Daniel Hahler 5655c69459 s:close(): only use "b#" if it's different from "%"
Closes #127.
2014-11-24 11:24:00 +01:00
Marco Hinz 337e1a8c24 Refactoring: fix last line usage 2014-11-23 17:52:25 +01:00
Marco Hinz 8e9ef61087 Refactoring: make "dir" list always relative 2014-11-23 17:39:51 +01:00
Marco Hinz 3151fdf4b1 Refactoring: l:cnt -> s:entry_number 2014-11-23 17:17:22 +01:00
Daniel Hahler 1b6b53f2f9 Refactoring: show_dir and show_files
This de-duplicates the shared code, and adds some (first) improvements
to not stat all of v:oldfiles (twice).

If accepted, it allows for easily adding a cache for abs_path handling
etc.

 - Add _show_filtered_oldfiles and _get_filtered_oldfiles
 - Fixes g:startify_files_number<1
2014-11-23 10:26:13 +01:00
Marco Hinz 339cdae1af Expose "open buffers" functionality for mapping
References #123.
2014-11-22 18:15:29 +01:00
Daniel Hahler 697d008f1b Make all mappings silent
Closes #123.
2014-11-22 18:03:19 +01:00
Marco Hinz 82496e92aa Use input{save,restore}() 2014-11-20 14:21:01 +01:00
Daniel Hahler 07e10a15a0 Set StartifySection via syntax file
This keeps it highlighted after 'set ft=startify' etc.

References #117.
2014-11-16 15:09:00 +01:00
Marco Hinz e964a581d0 Only set customized &stl if it's empty
References #118.
2014-11-16 14:06:25 +01:00
Marco Hinz d17bc302d4 Fix switching to calling buffer
References #115.
2014-11-13 21:01:45 +01:00
Marco Hinz 7d36933f9c Don't truncate g:startify_session_savevars
References #113.
2014-10-23 12:13:05 +02:00
Marco Hinz 6a933d2c24 Don't start at 'vim -y'
References #111.
2014-09-29 11:38:04 +02:00
Marco Hinz af2368cd75 Sessions: only prune unlisted buffers from arglist
References #110.
2014-09-21 14:08:40 +02:00