diff --git a/etc/soft/iterm/com.googlecode.iterm2.plist b/etc/soft/iterm/com.googlecode.iterm2.plist index 3df9be8..d5567b1 100644 Binary files a/etc/soft/iterm/com.googlecode.iterm2.plist and b/etc/soft/iterm/com.googlecode.iterm2.plist differ diff --git a/etc/soft/vim/vim/+plugins/vim-startify/CONTRIBUTING.md b/etc/soft/vim/vim/+plugins/vim-startify/CONTRIBUTING.md new file mode 100644 index 0000000..a01753e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/CONTRIBUTING.md @@ -0,0 +1,28 @@ +CONTRIBUTING +============ + +If you intend to contribute to this project, please keep some simple rules in +mind: + + - one commit per feature/fix + - the short commit message shouldn't be longer than 50 characters + - the short commit message should start with an uppercase character + - use the imperative for the short commit message + - don't finish the short commit message with a '.' + - don't use github-specific syntax to close an issue (I'll do that, when + merging into master) + - it's always a good idea to have a look at 'git log' to get an idea how to + format one's own commits + - if you have questions about a certain patch or feature requests, just open + a Github issue + +Examples +-------- + +``` +Bad: "fixed loop to start from 0 instead of 1" +Good: "Avoid off-by-one issue in skiplist loop" + +Bad: "fixed typo" +Good: "Docs: typo" +``` diff --git a/etc/soft/vim/vim/+plugins/vim-startify/LICENSE b/etc/soft/vim/vim/+plugins/vim-startify/LICENSE new file mode 100644 index 0000000..f5b3716 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2015 Marco Hinz + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/etc/soft/vim/vim/+plugins/vim-startify/README.md b/etc/soft/vim/vim/+plugins/vim-startify/README.md new file mode 100644 index 0000000..6ca7393 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/README.md @@ -0,0 +1,52 @@ +[![Build Status](https://travis-ci.org/mhinz/vim-startify.svg?branch=master)](https://travis-ci.org/mhinz/vim-startify) + +![vim-startify](https://raw.githubusercontent.com/mhinz/vim-startify/master/images/startify-logo.png) + +--- + +This plugin provides a start screen for Vim and Neovim. + +It provides **dynamically created headers or footers** and uses configurable +lists to show **recently used or bookmarked files** and **persistent sessions**. +All of this can be accessed in a **simple to use menu** that even allows to +**open multiple entries** at once. + +Startify doesn't get in your way and works out-of-the-box, but provides many +options for fine-grained customization. + +--- + +- [Installation & Documentation](#installation-and-documentation) +- [Plugin features in detail](https://github.com/mhinz/vim-startify/wiki/Plugin-features-in-detail) +- [Screenshot](#screenshot) +- [Author & Feedback](#author-and-feedback) + +--- + +## Installation and Documentation + +Use your favorite plugin manager. + +Using [vim-plug](https://github.com/junegunn/vim-plug): + + Plug 'mhinz/vim-startify' + +It works without any configuration, but you might want to look into the +documentation for further customization: + + :h startify + :h startify-faq + +## Screenshot + +![Startify in action!](https://github.com/mhinz/vim-startify/blob/master/images/startify-menu.png) + +That's it. A fancy start screen for Vim. + +_(Almost all visible features enabled. Colorscheme: +[vim-janah](https://github.com/mhinz/vim-janah).)_ + +## Author and Feedback + +If you like my plugins, please star them on Github. It's a great way of getting +feedback. Same goes for issues reports or feature requests. diff --git a/etc/soft/vim/vim/+plugins/vim-startify/autoload/startify.vim b/etc/soft/vim/vim/+plugins/vim-startify/autoload/startify.vim new file mode 100644 index 0000000..024a5bf --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/autoload/startify.vim @@ -0,0 +1,1126 @@ +" vim: et sw=2 sts=2 + +" Plugin: https://github.com/mhinz/vim-startify +" Description: A fancy start screen for Vim. +" Maintainer: Marco Hinz + +if exists('g:autoloaded_startify') || &compatible + finish +endif +let g:autoloaded_startify = 1 + +" Function: #get_lastline {{{1 +function! startify#get_lastline() abort + return b:startify.lastline + 1 +endfunction + +" Function: #get_separator {{{1 +function! startify#get_separator() abort + return !exists('+shellslash') || &shellslash ? '/' : '\' +endfunction + +" Function: #get_session_path {{{1 +function! startify#get_session_path() abort + if exists('g:startify_session_dir') + let path = g:startify_session_dir + elseif has('nvim') + let path = has('nvim-0.3.1') + \ ? stdpath('data').'/session' + \ : has('win32') + \ ? '~/AppData/Local/nvim-data/session' + \ : '~/.local/share/nvim/session' + else " Vim + let path = has('win32') + \ ? '~/vimfiles/session' + \ : '~/.vim/session' + endif + + return resolve(expand(path)) +endfunction + +" Function: #insane_in_the_membrane {{{1 +function! startify#insane_in_the_membrane(on_vimenter) abort + " Handle vim -y, vim -M. + if a:on_vimenter && (&insertmode || !&modifiable) + return + endif + + if !&hidden && &modified + call s:warn('Save your changes first.') + return + endif + + if !empty(v:servername) && exists('g:startify_skiplist_server') + for servname in g:startify_skiplist_server + if servname == v:servername + return + endif + endfor + endif + + if line2byte('$') != -1 + noautocmd enew + endif + + silent! setlocal + \ bufhidden=wipe + \ colorcolumn= + \ foldcolumn=0 + \ matchpairs= + \ nobuflisted + \ nocursorcolumn + \ nocursorline + \ nolist + \ nonumber + \ norelativenumber + \ nospell + \ noswapfile + \ signcolumn=no + \ synmaxcol& + if empty(&statusline) + setlocal statusline=\ startify + endif + + " Must be global so that it can be read by syntax/startify.vim. + let g:startify_header = exists('g:startify_custom_header') + \ ? s:set_custom_section(g:startify_custom_header) + \ : (exists('*strwidth') ? startify#pad(startify#fortune#cowsay()) : []) + if !empty(g:startify_header) + let g:startify_header += [''] " add blank line + endif + call append('$', g:startify_header) + + let b:startify = { + \ 'entries': {}, + \ 'indices': [], + \ 'leftmouse': 0, + \ 'tick': 0, + \ } + + if s:show_special + call append('$', [s:padding_left .'[e] ', '']) + endif + call s:register(line('$')-1, 'e', 'special', 'enew', '') + + let b:startify.entry_number = 0 + if filereadable('Session.vim') + call append('$', [s:padding_left .'[0] '. getcwd() . s:sep .'Session.vim', '']) + call s:register(line('$')-1, '0', 'session', + \ 'call startify#session_delete_buffers() | source', 'Session.vim') + let b:startify.entry_number = 1 + let l:show_session = 1 + endif + + if empty(v:oldfiles) + call s:warn("Can't read viminfo file. Read :help startify-faq-02") + endif + + let b:startify.section_header_lines = [] + + let lists = s:get_lists() + call s:show_lists(lists) + + silent $delete _ + + if s:show_special + call append('$', ['', s:padding_left .'[q] ']) + call s:register(line('$'), 'q', 'special', 'call s:close()', '') + else + " Don't overwrite the last regular entry, thus +1 + call s:register(line('$')+1, 'q', 'special', 'call s:close()', '') + endif + + " compute first line offset + let b:startify.firstline = 2 + let b:startify.firstline += len(g:startify_header) + " no special, no local Session.vim, but a section header + if !s:show_special && !exists('l:show_session') && has_key(lists[0], 'header') + let b:startify.firstline += len(lists[0].header) + 1 + endif + + let b:startify.lastline = line('$') + + let footer = exists('g:startify_custom_footer') + \ ? s:set_custom_section(g:startify_custom_footer) + \ : [] + if !empty(footer) + let footer = [''] + footer + endif + call append('$', footer) + + setlocal nomodifiable nomodified + + call s:set_mappings() + call cursor(b:startify.firstline, 5) + autocmd startify CursorMoved call s:set_cursor() + + silent! %foldopen! + normal! zb + set filetype=startify + + if exists('##DirChanged') + let b:startify.cwd = getcwd() + autocmd startify DirChanged if getcwd() !=# get(get(b:, 'startify', {}), 'cwd') | Startify | endif + endif + if exists('#User#Startified') + doautocmd User Startified + endif + if exists('#User#StartifyReady') + doautocmd User StartifyReady + endif +endfunction + +" Function: #session_load {{{1 +function! startify#session_load(source_last_session, ...) abort + if !isdirectory(s:session_dir) + echomsg 'The session directory does not exist: '. s:session_dir + return + elseif empty(startify#session_list_as_string('')) + echomsg 'There are no sessions...' + return + endif + + let session_path = s:session_dir . s:sep + + if a:0 + let session_path .= a:1 + elseif a:source_last_session && !has('win32') + let session_path .= '__LAST__' + else + call inputsave() + let session_path .= input( + \ 'Load this session: ', + \ fnamemodify(v:this_session, ':t'), + \ 'custom,startify#session_list_as_string') | redraw + call inputrestore() + endif + + if filereadable(session_path) + if get(g:, 'startify_session_persistence') && filewritable(v:this_session) + call startify#session_write(fnameescape(v:this_session)) + endif + call startify#session_delete_buffers() + execute 'source '. fnameescape(session_path) + call s:create_last_session_link(session_path) + else + echo 'No such file: '. session_path + endif +endfunction + +" Function: #session_save {{{1 +function! startify#session_save(bang, ...) abort + if !isdirectory(s:session_dir) + if exists('*mkdir') + echo 'The session directory does not exist: '. s:session_dir .'. Create it? [y/n]' + if (nr2char(getchar()) == 'y') + call mkdir(s:session_dir, 'p') + else + echo + return + endif + else + echo 'The session directory does not exist: '. s:session_dir + return + endif + endif + + call inputsave() + let this_session = fnamemodify(v:this_session, ':t') + if this_session ==# '__LAST__' + let this_session = '' + endif + let session_name = exists('a:1') + \ ? a:1 + \ : input('Save under this session name: ', this_session, 'custom,startify#session_list_as_string') | redraw + call inputrestore() + + if empty(session_name) + echo 'You gave an empty name!' + return + endif + + let session_path = s:session_dir . s:sep . session_name + if !filereadable(session_path) + call startify#session_write(fnameescape(session_path)) + echo 'Session saved under: '. session_path + return + endif + + echo 'Session already exists. Overwrite? [y/n]' | redraw + if a:bang || nr2char(getchar()) == 'y' + call startify#session_write(fnameescape(session_path)) + echo 'Session saved under: '. session_path + else + echo 'Did NOT save the session!' + endif +endfunction + +" Function: #session_close {{{1 +function! startify#session_close() abort + if exists('v:this_session') && filewritable(v:this_session) + call startify#session_write(fnameescape(v:this_session)) + let v:this_session = '' + endif + call startify#session_delete_buffers() + Startify +endfunction + +" Function: #session_write {{{1 +function! startify#session_write(session_path) + " preserve existing variables from savevars + if exists('g:startify_session_savevars') + let savevars = map(filter(copy(g:startify_session_savevars), 'exists(v:val)'), '"let ". v:val ." = ". strtrans(string(eval(v:val)))') + endif + + " if this function is called while being in the Startify buffer + " (by loading another session or running :SSave/:SLoad directly) + " switch back to the previous buffer before saving the session + if &filetype == 'startify' + let callingbuffer = bufnr('#') + if callingbuffer > 0 + execute 'buffer' callingbuffer + endif + endif + " prevent saving already deleted buffers that were in the arglist + for arg in argv() + if !buflisted(arg) + execute 'silent! argdelete' fnameescape(arg) + endif + endfor + " clean up session before saving it + for cmd in get(g:, 'startify_session_before_save', []) + execute cmd + endfor + + let ssop = &sessionoptions + set sessionoptions-=options + try + execute 'mksession!' a:session_path + catch + echohl ErrorMsg + echomsg v:exception + echohl NONE + return + finally + let &sessionoptions = ssop + endtry + + if exists('g:startify_session_remove_lines') + \ || exists('g:startify_session_savevars') + \ || exists('g:startify_session_savecmds') + silent execute 'split' a:session_path + + " remove lines from the session file + if exists('g:startify_session_remove_lines') + for pattern in g:startify_session_remove_lines + execute 'silent global/'. pattern .'/delete _' + endfor + endif + + " put variables from savevars into session file + if exists('savevars') && !empty(savevars) + call append(line('$')-3, savevars) + endif + + " put commands from savecmds into session file + if exists('g:startify_session_savecmds') + call append(line('$')-3, g:startify_session_savecmds) + endif + + setlocal bufhidden=delete + silent update + silent hide + endif + + call s:create_last_session_link(a:session_path) +endfunction + +" Function: #session_delete {{{1 +function! startify#session_delete(bang, ...) abort + if !isdirectory(s:session_dir) + echo 'The session directory does not exist: '. s:session_dir + return + elseif empty(startify#session_list_as_string('')) + echo 'There are no sessions...' + return + endif + + call inputsave() + let session_path = s:session_dir . s:sep . (exists('a:1') + \ ? a:1 + \ : input('Delete this session: ', fnamemodify(v:this_session, ':t'), 'custom,startify#session_list_as_string')) + call inputrestore() + + if !filereadable(session_path) + redraw | echo 'No such session: '. session_path + return + endif + + redraw | echo 'Really delete '. session_path .'? [y/n]' | redraw + if a:bang || nr2char(getchar()) == 'y' + if delete(session_path) == 0 + echo 'Deleted session '. session_path .'!' + else + echo 'Deletion failed!' + endif + else + echo 'Deletion aborted!' + endif +endfunction + +" Function: #session_delete_buffers {{{1 +function! startify#session_delete_buffers() + if get(g:, 'startify_session_delete_buffers', 1) + silent! %bdelete! + endif +endfunction + +" Function: #session_list {{{1 +function! startify#session_list(lead, ...) abort + return filter(map(split(globpath(s:session_dir, '*'.a:lead.'*'), '\n'), 'fnamemodify(v:val, ":t")'), 'v:val !=# "__LAST__"') +endfunction + +" Function: #session_list_as_string {{{1 +function! startify#session_list_as_string(lead, ...) abort + return join(filter(map(split(globpath(s:session_dir, '*'.a:lead.'*'), '\n'), 'fnamemodify(v:val, ":t")'), 'v:val !=# "__LAST__"'), "\n") +endfunction + +" Function: #debug {{{1 +function! startify#debug() + if exists('b:startify.entries') + for k in sort(keys(b:startify.entries)) + echomsg '['. k .'] = '. string(b:startify.entries[k]) + endfor + else + call s:warn('This is no Startify buffer!') + endif +endfunction + +" Function: #open_buffers {{{1 +function! startify#open_buffers(...) abort + if exists('a:1') " used in mappings + let entry = b:startify.entries[a:1] + if !empty(s:batchmode) && entry.type == 'file' + call startify#set_mark(s:batchmode, a:1) + else + call s:open_buffer(entry) + endif + return + endif + + let marked = filter(copy(b:startify.entries), 'v:val.marked') + if empty(marked) " open current entry + call s:open_buffer(b:startify.entries[line('.')]) + return + endif + + enew + setlocal nobuflisted + + " Open all marked entries. + for entry in sort(values(marked), 's:sort_by_tick') + call s:open_buffer(entry) + endfor + + wincmd = + + if exists('#User#StartifyAllBuffersOpened') + doautocmd User StartifyAllBuffersOpened + endif +endfunction + +" Function: #pad {{{1 +function! startify#pad(lines) abort + return map(copy(a:lines), 's:padding_left . v:val') +endfunction + +" Function: #center {{{1 +function! startify#center(lines) abort + let longest_line = max(map(copy(a:lines), 'strwidth(v:val)')) + return map(copy(a:lines), + \ 'repeat(" ", (&columns / 2) - (longest_line / 2) - 1) . v:val') +endfunction + +" Function: s:get_lists {{{1 +function! s:get_lists() abort + if exists('g:startify_lists') + return g:startify_lists + elseif exists('g:startify_list_order') + " Convert old g:startify_list_order format to newer g:startify_lists format. + let lists = [] + for item in g:startify_list_order + if type(item) == type([]) + let header = item + else + if exists('header') + let lists += [{ 'type': item, 'header': header }] + unlet header + else + let lists += [{ 'type': item }] + endif + endif + unlet item + endfor + return lists + else + return [ + \ { 'header': [s:padding_left .'MRU'], 'type': 'files' }, + \ { 'header': [s:padding_left .'MRU '. getcwd()], 'type': 'dir' }, + \ { 'header': [s:padding_left .'Sessions'], 'type': 'sessions' }, + \ { 'header': [s:padding_left .'Bookmarks'], 'type': 'bookmarks' }, + \ { 'header': [s:padding_left .'Commands'], 'type': 'commands' }, + \ ] + endif +endfunction + +" Function: s:show_lists {{{1 +function! s:show_lists(lists) abort + for list in a:lists + if !has_key(list, 'type') + continue + endif + + let b:startify.indices = copy(get(list, 'indices', [])) + + if type(list.type) == type('') + if has_key(list, 'header') + let s:last_message = list.header + endif + call s:show_{list.type}() + elseif type(list.type) == type(function('tr')) + try + let entries = list.type() + catch + call s:warn(v:exception) + continue + endtry + if empty(entries) + unlet! s:last_message + continue + endif + + if has_key(list, 'header') + let s:last_message = list.header + call s:print_section_header() + endif + + for entry in entries + let cmd = get(entry, 'cmd', 'edit') + let path = get(entry, 'path', '') + let type = get(entry, 'type', empty(path) ? 'special' : 'file') + let index = s:get_index_as_string() + call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . entry.line) + call s:register(line('$'), index, type, cmd, path) + endfor + call append('$', '') + else + call s:warn('Wrong format for g:startify_lists: '. string(list)) + endif + endfor +endfunction + +" Function: s:open_buffer {{{1 +function! s:open_buffer(entry) + if a:entry.type == 'special' + execute a:entry.cmd + elseif a:entry.type == 'session' + execute a:entry.cmd a:entry.path + elseif a:entry.type == 'file' + if line2byte('$') == -1 + execute 'edit' a:entry.path + else + if a:entry.cmd == 'tabnew' + wincmd = + endif + execute a:entry.cmd a:entry.path + endif + call s:check_user_options(a:entry.path) + endif + if exists('#User#StartifyBufferOpened') + doautocmd User StartifyBufferOpened + endif +endfunction + +" Function: s:set_custom_section {{{1 +function! s:set_custom_section(section) abort + if type(a:section) == type([]) + return copy(a:section) + elseif type(a:section) == type('') + return empty(a:section) ? [] : eval(a:section) + endif + return [] +endfunction + +" Function: s:display_by_path {{{1 +function! s:display_by_path(path_prefix, path_format, use_env) abort + let oldfiles = call(get(g:, 'startify_enable_unsafe') ? 's:filter_oldfiles_unsafe' : 's:filter_oldfiles', + \ [a:path_prefix, a:path_format, a:use_env]) + + let entry_format = "s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) ." + if exists('*StartifyEntryFormat') + let entry_format .= StartifyEntryFormat() + else + let entry_format .= 'entry_path' + endif + + if !empty(oldfiles) + if exists('s:last_message') + call s:print_section_header() + endif + + for [absolute_path, entry_path] in oldfiles + let index = s:get_index_as_string() + call append('$', eval(entry_format)) + if has('win32') + let absolute_path = substitute(absolute_path, '\[', '\[[]', 'g') + endif + call s:register(line('$'), index, 'file', 'edit', absolute_path) + endfor + + call append('$', '') + endif +endfunction + +" Function: s:filter_oldfiles {{{1 +function! s:filter_oldfiles(path_prefix, path_format, use_env) abort + let path_prefix = '\V'. escape(a:path_prefix, '\') + let counter = s:numfiles + let entries = {} + let oldfiles = [] + + for fname in v:oldfiles + if counter <= 0 + break + endif + + if s:is_in_skiplist(fname) + " https://github.com/mhinz/vim-startify/issues/353 + continue + endif + + let absolute_path = fnamemodify(resolve(fname), ":p") + " filter duplicates, bookmarks and entries from the skiplist + if has_key(entries, absolute_path) + \ || !filereadable(absolute_path) + \ || s:is_in_skiplist(absolute_path) + \ || match(absolute_path, path_prefix) + continue + endif + + let entry_path = '' + if s:tf + let entry_path = s:transform(absolute_path) + endif + if empty(entry_path) + let entry_path = fnamemodify(absolute_path, a:path_format) + endif + + let entries[absolute_path] = 1 + let counter -= 1 + let oldfiles += [[fnameescape(absolute_path), entry_path]] + endfor + + if a:use_env + call s:init_env() + for i in range(len(oldfiles)) + for [k,v] in s:env + let p = oldfiles[i][0] + if !stridx(tolower(p), tolower(v)) + let oldfiles[i][1] = printf('$%s%s', k, p[len(v):]) + break + endif + endfor + endfor + endif + + return oldfiles +endfunction + +" Function: s:filter_oldfiles_unsafe {{{1 +function! s:filter_oldfiles_unsafe(path_prefix, path_format, use_env) abort + let path_prefix = '\V'. escape(a:path_prefix, '\') + let counter = s:numfiles + let entries = {} + let oldfiles = [] + let is_dir = escape(s:sep, '\') . '$' + + for fname in v:oldfiles + if counter <= 0 + break + endif + + if s:is_in_skiplist(fname) + " https://github.com/mhinz/vim-startify/issues/353 + continue + endif + + let absolute_path = glob(fnamemodify(fname, ":p")) + if empty(absolute_path) + \ || has_key(entries, absolute_path) + \ || (absolute_path =~ is_dir) + \ || match(absolute_path, path_prefix) + \ || s:is_in_skiplist(absolute_path) + continue + endif + + let entry_path = fnamemodify(absolute_path, a:path_format) + let entries[absolute_path] = 1 + let counter -= 1 + let oldfiles += [[fnameescape(absolute_path), entry_path]] + endfor + + return oldfiles +endfunction + +" Function: s:show_dir {{{1 +function! s:show_dir() abort + return s:display_by_path(getcwd() . s:sep, ':.', 0) +endfunction + +" Function: s:show_files {{{1 +function! s:show_files() abort + return s:display_by_path('', s:relative_path, get(g:, 'startify_use_env')) +endfunction + +" Function: s:show_sessions {{{1 +function! s:show_sessions() abort + let limit = get(g:, 'startify_session_number', 999) - 1 + if limit <= -1 + return + endif + + let sfiles = split(globpath(s:session_dir, '*'), '\n') + let sfiles = filter(sfiles, 'v:val !~# "__LAST__$"') + let sfiles = filter(sfiles, + \ '!(v:val =~# "x\.vim$" && index(sfiles, v:val[:-6].".vim") >= 0)') + if empty(sfiles) + if exists('s:last_message') + unlet s:last_message + endif + return + endif + + if exists('s:last_message') + call s:print_section_header() + endif + + if get(g:, 'startify_session_sort') + function! s:sort_by_mtime(foo, bar) + let foo = getftime(a:foo) + let bar = getftime(a:bar) + return foo == bar ? 0 : (foo < bar ? 1 : -1) + endfunction + call sort(sfiles, 's:sort_by_mtime') + endif + + for i in range(len(sfiles)) + let index = s:get_index_as_string() + let fname = fnamemodify(sfiles[i], ':t') + let dname = sfiles[i] ==# v:this_session ? fname.' (*)' : fname + call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . dname) + if has('win32') + let fname = substitute(fname, '\[', '\[[]', 'g') + endif + call s:register(line('$'), index, 'session', 'SLoad', fname) + if i == limit + break + endif + endfor + + call append('$', '') +endfunction + +" Function: s:show_bookmarks {{{1 +function! s:show_bookmarks() abort + if !exists('g:startify_bookmarks') || empty(g:startify_bookmarks) + return + endif + + if exists('s:last_message') + call s:print_section_header() + endif + + for bookmark in g:startify_bookmarks + if type(bookmark) == type({}) + let [index, path] = items(bookmark)[0] + else " string + let [index, path] = [s:get_index_as_string(), bookmark] + endif + + let entry_path = '' + if s:tf + let entry_path = s:transform(fnamemodify(resolve(expand(path)), ':p')) + endif + if empty(entry_path) + let entry_path = path + endif + call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . entry_path) + + if has('win32') + let path = substitute(path, '\[', '\[[]', 'g') + endif + call s:register(line('$'), index, 'file', 'edit', fnameescape(expand(path))) + + unlet bookmark " avoid type mismatch for heterogeneous lists + endfor + + call append('$', '') +endfunction + +" Function: s:show_commands {{{1 +function! s:show_commands() abort + if !exists('g:startify_commands') || empty(g:startify_commands) + return + endif + + if exists('s:last_message') + call s:print_section_header() + endif + + for entry in g:startify_commands + if type(entry) == type({}) " with custom index + let [index, command] = items(entry)[0] + else + let command = entry + let index = s:get_index_as_string() + endif + " If no list is given, the description is the command itself. + let [desc, cmd] = type(command) == type([]) ? command : [command, command] + + call append('$', s:padding_left .'['. index .']'. repeat(' ', (3 - strlen(index))) . desc) + call s:register(line('$'), index, 'special', cmd, '') + + unlet entry command + endfor + + call append('$', '') +endfunction + +" Function: s:is_in_skiplist {{{1 +function! s:is_in_skiplist(arg) abort + for regexp in s:skiplist + try + if a:arg =~# regexp + return 1 + endif + catch + call s:warn('Pattern '. string(regexp) .' threw an exception. Read :help g:startify_skiplist') + endtry + endfor +endfunction + +" Function: s:set_cursor {{{1 +function! s:set_cursor() abort + let b:startify.oldline = exists('b:startify.newline') ? b:startify.newline : 2 + len(s:padding_left) + let b:startify.newline = line('.') + + " going up (-1) or down (1) + if b:startify.oldline == b:startify.newline + \ && col('.') != s:fixed_column + \ && !b:startify.leftmouse + let movement = 2 * (col('.') > s:fixed_column) - 1 + let b:startify.newline += movement + else + let movement = 2 * (b:startify.newline > b:startify.oldline) - 1 + let b:startify.leftmouse = 0 + endif + + " skip section headers lines until an entry is found + while index(b:startify.section_header_lines, b:startify.newline) != -1 + let b:startify.newline += movement + endwhile + + " skip blank lines between lists + if empty(getline(b:startify.newline)) + let b:startify.newline += movement + endif + + " don't go beyond first or last entry + let b:startify.newline = max([b:startify.firstline, min([b:startify.lastline, b:startify.newline])]) + + call cursor(b:startify.newline, s:fixed_column) +endfunction + +" Function: s:set_mappings {{{1 +function! s:set_mappings() abort + nnoremap i :enew startinsert + nnoremap :enew startinsert + nnoremap b :call startify#set_mark('B') + nnoremap s :call startify#set_mark('S') + nnoremap t :call startify#set_mark('T') + nnoremap v :call startify#set_mark('V') + nnoremap B :call startify#set_batchmode('B') + nnoremap S :call startify#set_batchmode('S') + nnoremap T :call startify#set_batchmode('T') + nnoremap V :call startify#set_batchmode('V') + nnoremap :call startify#open_buffers() + nnoremap :call leftmouse() + nnoremap <2-LeftMouse> :call startify#open_buffers() + nnoremap :enew execute 'normal! "'.(v:register=='"'?'*':v:register).'gp' + + " Without these mappings n/N wouldn't work properly, since autocmds always + " force the cursor back on the index. + nnoremap n ' j'[v:searchforward].'n' + nnoremap N 'j '[v:searchforward].'N' + + function! s:leftmouse() + " feedkeys() triggers CursorMoved which calls s:set_cursor() which checks + " .leftmouse. + let b:startify.leftmouse = 1 + call feedkeys("\", 'nt') + endfunction + + function! s:compare_by_index(foo, bar) + return a:foo.index - a:bar.index + endfunction + + for entry in sort(values(b:startify.entries), 's:compare_by_index') + execute 'nnoremap ' entry.index + \ ':call startify#open_buffers('. string(entry.line) .')' + endfor +endfunction + +" Function: #set_batchmode {{{1 +function! startify#set_batchmode(batchmode) abort + let s:batchmode = (a:batchmode == s:batchmode) ? '' : a:batchmode + echo empty(s:batchmode) ? 'Batchmode off' : 'Batchmode: '. s:batchmode +endfunction + +" Function: #set_mark {{{1 +function! startify#set_mark(type, ...) abort + if a:0 + let entryline = a:1 + else + call startify#set_batchmode('') + let entryline = line('.') + endif + let entry = b:startify.entries[entryline] + + if entry.type != 'file' + return + endif + + let default_cmds = { + \ 'B': 'edit', + \ 'S': 'split', + \ 'V': 'vsplit', + \ 'T': 'tabnew', + \ } + + let origline = line('.') + execute entryline + let index = expand('') + setlocal modifiable + + if entry.marked && index[0] == a:type + let entry.cmd = 'edit' + let entry.marked = 0 + execute 'normal! ci]'. entry.index + else + let entry.cmd = default_cmds[a:type] + let entry.marked = 1 + let entry.tick = b:startify.tick + let b:startify.tick += 1 + execute 'normal! ci]'. repeat(a:type, len(index)) + endif + + setlocal nomodifiable nomodified + " Reset cursor to fixed column, which is important for s:set_cursor(). + call cursor(origline, s:fixed_column) +endfunction + +" Function: s:sort_by_tick {{{1 +function! s:sort_by_tick(one, two) + return a:one.tick - a:two.tick +endfunction + +" Function: s:check_user_options {{{1 +function! s:check_user_options(path) abort + let session = a:path . s:sep .'Session.vim' + + if get(g:, 'startify_session_autoload') && filereadable(glob(session)) + execute 'silent bwipeout' a:path + call startify#session_delete_buffers() + execute 'source' session + return + endif + + if get(g:, 'startify_change_to_vcs_root') && s:cd_to_vcs_root(a:path) + return + endif + + if get(g:, 'startify_change_to_dir', 1) + if isdirectory(a:path) + execute 'lcd' a:path + else + let dir = fnamemodify(a:path, ':h') + if isdirectory(dir) + execute 'lcd' dir + else + " Do nothing. E.g. a:path == `scp://foo/bar` + endif + endif + endif +endfunction + +" Function: s:cd_to_vcs_root {{{1 +function! s:cd_to_vcs_root(path) abort + let dir = fnamemodify(a:path, ':p:h') + for vcs in [ '.git', '.hg', '.bzr', '.svn' ] + let root = finddir(vcs, dir .';') + if !empty(root) + execute 'lcd' fnameescape(fnamemodify(root, ':h')) + return 1 + endif + endfor + return 0 +endfunction + +" Function: s:close {{{1 +function! s:close() abort + if len(filter(range(0, bufnr('$')), 'buflisted(v:val)')) - &buflisted + if bufloaded(bufnr('#')) && bufnr('#') != bufnr('%') + buffer # + else + bnext + endif + else + quit + endif +endfunction + +" Function: s:get_index_as_string {{{1 +function! s:get_index_as_string() abort + if !empty(b:startify.indices) + return remove(b:startify.indices, 0) + elseif exists('g:startify_custom_indices') + let listlen = len(g:startify_custom_indices) + if b:startify.entry_number < listlen + let idx = g:startify_custom_indices[b:startify.entry_number] + else + let idx = string(b:startify.entry_number - listlen) + endif + else + let idx = string(b:startify.entry_number) + endif + + let b:startify.entry_number += 1 + + return idx +endfunction + +" Function: s:print_section_header {{{1 +function! s:print_section_header() abort + $ + let curline = line('.') + + for lnum in range(curline, curline + len(s:last_message) + 1) + call add(b:startify.section_header_lines, lnum) + endfor + + call append('$', s:last_message + ['']) + unlet s:last_message +endfunction + +" Function: s:register {{{1 +function! s:register(line, index, type, cmd, path) + let b:startify.entries[a:line] = { + \ 'index': a:index, + \ 'type': a:type, + \ 'line': a:line, + \ 'cmd': a:cmd, + \ 'path': a:path, + \ 'marked': 0, + \ } +endfunction + +" Function: s:create_last_session_link {{{1 +function! s:create_last_session_link(session_path) + if !has('win32') && a:session_path !~# '__LAST__$' + let cmd = printf('ln -sf %s %s', + \ shellescape(fnamemodify(a:session_path, ':t')), + \ shellescape(s:session_dir .'/__LAST__')) + call system(cmd) + if v:shell_error + call s:warn("Can't create 'last used session' symlink.") + endif + endif +endfunction + +" Function: s:init_env {{{1 +function! s:init_env() + let s:env = [] + let ignore = { + \ 'HOME': 1, + \ 'OLDPWD': 1, + \ 'PWD': 1, + \ } + + function! s:get_env() + redir => s + silent! execute "norm!:ec$\'\\\\'\" + redir END + redraw + return split(s) + endfunction + + function! s:compare_by_key_len(foo, bar) + return len(a:foo[0]) - len(a:bar[0]) + endfunction + function! s:compare_by_val_len(foo, bar) + return len(a:bar[1]) - len(a:foo[1]) + endfunction + + for k in s:get_env() + silent! execute "let v = eval('$'.k)" + if has('win32') ? (v[1] != ':') : (v[0] != '/') + \ || has_key(ignore, k) + \ || len(k) > len(v) + continue + endif + call insert(s:env, [k,v], 0) + endfor + + let s:env = sort(s:env, 's:compare_by_key_len') + let s:env = sort(s:env, 's:compare_by_val_len') +endfunction + +" Function: s:transform {{{1 +function s:transform(absolute_path) + for [k,V] in g:startify_transformations + if a:absolute_path =~ k + return type(V) == type('') ? V : V(a:absolute_path) + endif + unlet V + endfor + return '' +endfunction + +" Function: s:warn {{{1 +function! s:warn(msg) abort + echohl WarningMsg + echomsg 'startify: '. a:msg + echohl NONE +endfunction + +" Init: values {{{1 +let s:sep = startify#get_separator() + +let s:numfiles = get(g:, 'startify_files_number', 10) +let s:show_special = get(g:, 'startify_enable_special', 1) +let s:relative_path = get(g:, 'startify_relative_path') ? ':~:.' : ':p:~' +let s:tf = exists('g:startify_transformations') +let s:session_dir = startify#get_session_path() + +let s:skiplist = get(g:, 'startify_skiplist', [ + \ 'runtime/doc/.*\.txt', + \ 'bundle/.*/doc/.*\.txt', + \ 'plugged/.*/doc/.*\.txt', + \ '/.git/', + \ 'fugitiveblame$', + \ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc/.*\.txt', + \ ]) + +let s:padding_left = repeat(' ', get(g:, 'startify_padding_left', 3)) +let s:fixed_column = len(s:padding_left) + 2 +let s:batchmode = '' diff --git a/etc/soft/vim/vim/+plugins/vim-startify/autoload/startify/fortune.vim b/etc/soft/vim/vim/+plugins/vim-startify/autoload/startify/fortune.vim new file mode 100644 index 0000000..9745c37 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/autoload/startify/fortune.vim @@ -0,0 +1,243 @@ +scriptencoding utf-8 + +" Function: s:get_random_offset {{{1 +function! s:get_random_offset(max) abort + return str2nr(matchstr(reltimestr(reltime()), '\.\zs\d\+')[1:]) % a:max +endfunction + +" Function: s:draw_box {{{1 +function! s:draw_box(lines) abort + let longest_line = max(map(copy(a:lines), 'strwidth(v:val)')) + let top_bottom_without_corners = repeat(s:char_top_bottom, longest_line + 2) + let top = s:char_top_left . top_bottom_without_corners . s:char_top_right + let bottom = s:char_bottom_left . top_bottom_without_corners . s:char_bottom_right + let lines = [top] + for l in a:lines + let offset = longest_line - strwidth(l) + let lines += [s:char_sides . ' '. l . repeat(' ', offset) .' ' . s:char_sides] + endfor + let lines += [bottom] + return lines +endfunction + +" Function: #quote {{{1 +function! startify#fortune#quote() abort + return s:quotes[s:get_random_offset(len(s:quotes))] +endfunction + +" Function: #boxed {{{1 +function! startify#fortune#boxed(...) abort + let wrapped_quote = [] + if a:0 && type(a:1) == type([]) + let quote = a:1 + else + let Quote = startify#fortune#quote() + let quote = type(Quote) == type(function('tr')) ? Quote() : Quote + endif + for line in quote + let wrapped_quote += split(line, '\%50c.\{-}\zs\s', 1) + endfor + let wrapped_quote = s:draw_box(wrapped_quote) + return wrapped_quote +endfunction + +" Function: #cowsay {{{1 +function! startify#fortune#cowsay(...) abort + if a:0 + let quote = a:0 && type(a:1) == type([]) ? a:1 : startify#fortune#quote() + let s:char_top_bottom = get(a:000, 1, s:char_top_bottom) + let s:char_sides = get(a:000, 2, s:char_sides) + let s:char_top_left = get(a:000, 3, s:char_top_left) + let s:char_top_right = get(a:000, 4, s:char_top_right) + let s:char_bottom_right = get(a:000, 5, s:char_bottom_right) + let s:char_bottom_left = get(a:000, 6, s:char_bottom_left) + else + let quote = startify#fortune#quote() + endif + let boxed_quote = startify#fortune#boxed(quote) + return boxed_quote + s:cow +endfunction + +" Function: #predefined_quotes {{{1 +function! startify#fortune#predefined_quotes() abort + return s:predefined_quotes +endfunction + +" Variables {{{1 +let s:cow = [ + \ ' o', + \ ' o ^__^', + \ ' o (oo)\_______', + \ ' (__)\ )\/\', + \ ' ||----w |', + \ ' || ||', + \ ] + +let s:unicode = &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode') + +let s:char_top_bottom = ['-', '─'][s:unicode] +let s:char_sides = ['|', '│'][s:unicode] +let s:char_top_left = ['*', '╭'][s:unicode] +let s:char_top_right = ['*', '╮'][s:unicode] +let s:char_bottom_right = ['*', '╯'][s:unicode] +let s:char_bottom_left = ['*', '╰'][s:unicode] + +let s:predefined_quotes = [ + \ ["Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.", '', '- Brian Kernighan'], + \ ["If you don't finish then you're just busy, not productive."], + \ ['Adapting old programs to fit new machines usually means adapting new machines to behave like old ones.', '', '- Alan Perlis'], + \ ['Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.', '', '- Alan Perlis'], + \ ['It is easier to change the specification to fit the program than vice versa.', '', '- Alan Perlis'], + \ ['Simplicity does not precede complexity, but follows it.', '', '- Alan Perlis'], + \ ['Optimization hinders evolution.', '', '- Alan Perlis'], + \ ['Recursion is the root of computation since it trades description for time.', '', '- Alan Perlis'], + \ ['It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.', '', '- Alan Perlis'], + \ ['There is nothing quite so useless as doing with great efficiency something that should not be done at all.', '', '- Peter Drucker'], + \ ["If you don't fail at least 90% of the time, you're not aiming high enough.", '', '- Alan Kay'], + \ ['I think a lot of new programmers like to use advanced data structures and advanced language features as a way of demonstrating their ability. I call it the lion-tamer syndrome. Such demonstrations are impressive, but unless they actually translate into real wins for the project, avoid them.', '', '- Glyn Williams'], + \ ['I would rather die of passion than of boredom.', '', '- Vincent Van Gogh'], + \ ['If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual.'], + \ ["The computing scientist's main challenge is not to get confused by the complexities of his own making.", '', '- Edsger W. Dijkstra'], + \ ["Progress in a fixed context is almost always a form of optimization. Creative acts generally don't stay in the context that they are in.", '', '- Alan Kay'], + \ ['The essence of XML is this: the problem it solves is not hard, and it does not solve the problem well.', '', '- Phil Wadler'], + \ ['A good programmer is someone who always looks both ways before crossing a one-way street.', '', '- Doug Linder'], + \ ['Patterns mean "I have run out of language."', '', '- Rich Hickey'], + \ ['Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.', '', '- John Woods'], + \ ['Unix was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things.'], + \ ['Contrary to popular belief, Unix is user friendly. It just happens to be very selective about who it decides to make friends with.'], + \ ['Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.'], + \ ['There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.', '', '- C.A.R. Hoare'], + \ ["If you don't make mistakes, you're not working on hard enough problems.", '', '- Frank Wilczek'], + \ ["If you don't start with a spec, every piece of code you write is a patch.", '', '- Leslie Lamport'], + \ ['Caches are bugs waiting to happen.', '', '- Rob Pike'], + \ ['Abstraction is not about vagueness, it is about being precise at a new semantic level.', '', '- Edsger W. Dijkstra'], + \ ["dd is horrible on purpose. It's a joke about OS/360 JCL. But today it's an internationally standardized joke. I guess that says it all.", '', '- Rob Pike'], + \ ['All loops are infinite ones for faulty RAM modules.'], + \ ['All idioms must be learned. Good idioms only need to be learned once.', '', '- Alan Cooper'], + \ ['For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled.', '', '- Richard Feynman'], + \ ['If programmers were electricians, parallel programmers would be bomb disposal experts. Both cut wires.', '', '- Bartosz Milewski'], + \ ['Computers are harder to maintain at high altitude. Thinner air means less cushion between disk heads and platters. Also more radiation.'], + \ ['Almost every programming language is overrated by its practitioners.', '', '- Larry Wall'], + \ ['Fancy algorithms are slow when n is small, and n is usually small.', '', '- Rob Pike'], + \ ['Methods are just functions with a special first argument.', '', '- Andrew Gerrand'], + \ + \ ['Care about your craft.', '', 'Why spend your life developing software unless you care about doing it well?'], + \ ["Provide options, don't make lame excuses.", '', "Instead of excuses, provide options. Don't say it can't be done; explain what can be done."], + \ ['Be a catalyst for change.', '', "You can't force change on people. Instead, show them how the future might be and help them participate in creating it."], + \ ['Make quality a requirements issue.', '', "Involve your users in determining the project's real quality requirements."], + \ ['Critically analyze what you read and hear.', '', "Don't be swayed by vendors, media hype, or dogma. Analyze information in terms of you and your project."], + \ ["DRY - Don't Repeat Yourself.", '', 'Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.'], + \ ['Eliminate effects between unrelated things.', '', 'Design components that are self-contained, independent, and have a single, well-defined purpose.'], + \ ['Use tracer bullets to find the target.', '', 'Tracer bullets let you home in on your target by trying things and seeing how close they land.'], + \ ['Program close to the problem domain.', '', "Design and code in your user's language."], + \ ['Iterate the schedule with the code.', '', 'Use experience you gain as you implement to refine the project time scales.'], + \ ['Use the power of command shells.', '', "Use the shell when graphical user interfaces don't cut it."], + \ ['Always use source code control.', '', 'Source code control is a time machine for your work - you can go back.'], + \ ["Don't panic when debugging", '', 'Take a deep breath and THINK! about what could be causing the bug.'], + \ ["Don't assume it - prove it.", '', 'Prove your assumptions in the actual environment - with real data and boundary conditions.'], + \ ['Write code that writes code.', '', 'Code generators increase your productivity and help avoid duplication.'], + \ ['Design With contracts.', '', 'Use contracts to document and verify that code does no more and no less than it claims to do.'], + \ ['Use assertions to prevent the impossible.', '', 'Assertions validate your assumptions. Use them to protect your code from an uncertain world.'], + \ ['Finish what you start.', '', 'Where possible, the routine or object that allocates a resource should be responsible for deallocating it.'], + \ ["Configure, don't integrate.", '', 'Implement technology choices for an application as configuration options, not through integration or engineering.'], + \ ['Analyze workflow to improve concurrency.', '', "Exploit concurrency in your user's workflow."], + \ ['Always design for concurrency.', '', "Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions."], + \ ['Use blackboards to coordinate workflow.', '', 'Use blackboards to coordinate disparate facts and agents, while maintaining independence and isolation among participants.'], + \ ['Estimate the order of your algorithms.', '', 'Get a feel for how long things are likely to take before you write code.'], + \ ['Refactor early, refactor often.', '', 'Just as you might weed and rearrange a garden, rewrite, rework, and re-architect code when it needs it. Fix the root of the problem.'], + \ ['Test your software, or your users will.', '', "Test ruthlessly. Don't make your users find bugs for you."], + \ ["Don't gather requirements - dig for them.", '', "Requirements rarely lie on the surface. They're buried deep beneath layers of assumptions, misconceptions, and politics."], + \ ['Abstractions live longer than details.', '', 'Invest in the abstraction, not the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies.'], + \ ["Don't think outside the box - find the box.", '', 'When faced with an impossible problem, identify the real constraints. Ask yourself: "Does it have to be done this way? Does it have to be done at all?"'], + \ ['Some things are better done than described.', '', "Don't fall into the specification spiral - at some point you need to start coding."], + \ ["Costly tools don't produce better designs.", '', 'Beware of vendor hype, industry dogma, and the aura of the price tag. Judge tools on their merits.'], + \ ["Don't use manual procedures.", '', 'A shell script or batch file will execute the same instructions, in the same order, time after time.'], + \ ["Coding ain't done 'til all the Tests run.", '', "'Nuff said."], + \ ['Test state coverage, not code coverage.', '', "Identify and test significant program states. Just testing lines of code isn't enough."], + \ ['English is just a programming language.', '', 'Write documents as you would write code: honor the DRY principle, use metadata, MVC, automatic generation, and so on.'], + \ ["Gently exceed your users' expectations.", '', "Come to understand your users' expectations, then deliver just that little bit more."], + \ ['Think about your work.', '', 'Turn off the autopilot and take control. Constantly critique and appraise your work.'], + \ ["Don't live with broken windows.", '', 'Fix bad designs, wrong decisions, and poor code when you see them.'], + \ ['Remember the big picture.', '', "Don't get so engrossed in the details that you forget to check what's happening around you."], + \ ['Invest regularly in your knowledge portfolio.', '', 'Make learning a habit.'], + \ ["It's both what you say and the way you say it.", '', "There's no point in having great ideas if you don't communicate them effectively."], + \ ['Make it easy to reuse.', '', "If it's easy to reuse, people will. Create an environment that supports reuse."], + \ ['There are no final decisions.', '', 'No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.'], + \ ['Prototype to learn.', '', 'Prototyping is a learning experience. Its value lies not in the code you produce, but in the lessons you learn.'], + \ ['Estimate to avoid surprises.', '', "Estimate before you start. You'll spot potential problems up front."], + \ ['Keep knowledge in plain text.', '', "Plain text won't become obsolete. It helps leverage your work and simplifies debugging and testing."], + \ ['Use a single editor well.', '', 'The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.'], + \ ['Fix the problem, not the blame.', '', "It doesn't really matter whether the bug is your fault or someone else's - it is still your problem, and it still needs to be fixed."], + \ ["\"select\" isn't broken.", '', 'It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.'], + \ ['Learn a text manipulation language.', '', 'You spend a large part of each day working with text. Why not have the computer do some of it for you?'], + \ ["You can't write perfect software.", '', "Software can't be perfect. Protect your code and users from the inevitable errors."], + \ ['Crash early.', '', 'A dead program normally does a lot less damage than a crippled one.'], + \ ['Use exceptions for exceptional problems.', '', 'Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things.'], + \ ['Minimize coupling between modules.', '', 'Avoid coupling by writing "shy" code and applying the Law of Demeter.'], + \ ['Put abstractions in code, details in metadata.', '', 'Program for the general case, and put the specifics outside the compiled code base.'], + \ ['Design using services.', '', 'Design in terms of services-independent, concurrent objects behind well-defined, consistent interfaces.'], + \ ['Separate views from models.', '', 'Gain flexibility at low cost by designing your application in terms of models and views.'], + \ ["Don't program by coincidence.", '', "Rely only on reliable things. Beware of accidental complexity, and don't confuse a happy coincidence with a purposeful plan."], + \ ['Test your estimates.', '', "Mathematical analysis of algorithms doesn't tell you everything. Try timing your code in its target environment."], + \ ['Design to test.', '', 'Start thinking about testing before you write a line of code.'], + \ ["Don't use wizard code you don't understand.", '', 'Wizards can generate reams of code. Make sure you understand all of it before you incorporate it into your project.'], + \ ['Work with a user to think like a user.', '', "It's the best way to gain insight into how the system will really be used."], + \ ['Use a project glossary.', '', 'Create and maintain a single source of all the specific terms and vocabulary for a project.'], + \ ["Start when you're ready.", '', "You've been building experience all your life. Don't ignore niggling doubts."], + \ ["Don't be a slave to formal methods.", '', "Don't blindly adopt any technique without putting it into the context of your development practices and capabilities."], + \ ['Organize teams around functionality.', '', "Don't separate designers from coders, testers from data modelers. Build teams the way you build code."], + \ ['Test early. Test often. Test automatically.', '', 'Tests that run with every build are much more effective than test plans that sit on a shelf.'], + \ ['Use saboteurs to test your testing.', '', 'Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.'], + \ ['Find bugs once.', '', 'Once a human tester finds a bug, it should be the last time a human tester finds that bug. Automatic tests should check for it from then on.'], + \ ['Sign your work.', '', 'Craftsmen of an earlier age were proud to sign their work. You should be, too.'], + \ ['Think twice, code once.'], + \ ['No matter how far down the wrong road you have gone, turn back now.'], + \ ['Why do we never have time to do it right, but always have time to do it over?'], + \ ['Weeks of programming can save you hours of planning.'], + \ ['To iterate is human, to recurse divine.', '', '- L. Peter Deutsch'], + \ ['Computers are useless. They can only give you answers.', '', '- Pablo Picasso'], + \ ['The question of whether computers can think is like the question of whether submarines can swim.', '', '- Edsger W. Dijkstra'], + \ ["It's ridiculous to live 100 years and only be able to remember 30 million bytes. You know, less than a compact disc. The human condition is really becoming more obsolete every minute.", '', '- Marvin Minsky'], + \ ["The city's central computer told you? R2D2, you know better than to trust a strange computer!", '', '- C3PO'], + \ ['Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.', '', '- Alan Kay'], + \ ["I've finally learned what \"upward compatible\" means. It means we get to keep all our old mistakes.", '', '- Dennie van Tassel'], + \ ["There are two major products that come out of Berkeley: LSD and UNIX. We don't believe this to be a coincidence.", '', '- Jeremy S. Anderson'], + \ ["The bulk of all patents are crap. Spending time reading them is stupid. It's up to the patent owner to do so, and to enforce them.", '', '- Linus Torvalds'], + \ ['Controlling complexity is the essence of computer programming.', '', '- Brian Kernighan'], + \ ['Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges, and it causes end-user and administrator frustration.', '', '- Ray Ozzie'], + \ ['The function of good software is to make the complex appear to be simple.', '', '- Grady Booch'], + \ ["There's an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone.", '', '- Bjarne Stroustrup'], + \ ['There are only two industries that refer to their customers as "users".', '', '- Edward Tufte'], + \ ['Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.', '', '- Larry Wall'], + \ ['Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.', '', '- Eric S. Raymond'], + \ ['Optimism is an occupational hazard of programming; feedback is the treatment.', '', '- Kent Beck'], + \ ['First, solve the problem. Then, write the code.', '', '- John Johnson'], + \ ['Measuring programming progress by lines of code is like measuring aircraft building progress by weight.', '', '- Bill Gates'], + \ ["Don't worry if it doesn't work right. If everything did, you'd be out of a job.", '', "- Mosher's Law of Software Engineering"], + \ ['A LISP programmer knows the value of everything, but the cost of nothing.', '', '- Alan J. Perlis'], + \ ['All problems in computer science can be solved with another level of indirection.', '', '- David Wheeler'], + \ ['Functions delay binding; data structures induce binding. Moral: Structure data late in the programming process.', '', '- Alan J. Perlis'], + \ ['Easy things should be easy and hard things should be possible.', '', '- Larry Wall'], + \ ['Nothing is more permanent than a temporary solution.'], + \ ["If you can't explain something to a six-year-old, you really don't understand it yourself.", '', '- Albert Einstein'], + \ ['All programming is an exercise in caching.', '', '- Terje Mathisen'], + \ ['Software is hard.', '', '- Donald Knuth'], + \ ['They did not know it was impossible, so they did it!', '', '- Mark Twain'], + \ ['The object-oriented model makes it easy to build up programs by accretion. What this often means, in practice, is that it provides a structured way to write spaghetti code.', '', '- Paul Graham'], + \ ['Question: How does a large software project get to be one year late?', 'Answer: One day at a time!'], + \ ['The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.', '', '- Tom Cargill'], + \ ["In software, we rarely have meaningful requirements. Even if we do, the only measure of success that matters is whether our solution solves the customer's shifting idea of what their problem is.", '', '- Jeff Atwood'], + \ ['If debugging is the process of removing bugs, then programming must be the process of putting them in.', '', '- Edsger W. Dijkstra'], + \ ['640K ought to be enough for anybody.', '', '- Bill Gates, 1981'], + \ ['To understand recursion, one must first understand recursion.', '', '- Stephen Hawking'], + \ ['Developing tolerance for imperfection is the key factor in turning chronic starters into consistent finishers.', '', '- Jon Acuff'], + \ ['Every great developer you know got there by solving problems they were unqualified to solve until they actually did it.', '', '- Patrick McKenzie'], + \ ["The average user doesn't give a damn what happens, as long as (1) it works and (2) it's fast.", '', '- Daniel J. Bernstein'], + \ ['Walking on water and developing software from a specification are easy if both are frozen.', '', '- Edward V. Berard'], + \ ['Be curious. Read widely. Try new things. I think a lot of what people call intelligence boils down to curiosity.', '', '- Aaron Swartz'], + \ ['What one programmer can do in one month, two programmers can do in two months.', '', '- Frederick P. Brooks'], + \ ] + +let s:quotes = exists('g:startify_custom_header_quotes') + \ ? g:startify_custom_header_quotes + \ : startify#fortune#predefined_quotes() diff --git a/etc/soft/vim/vim/+plugins/vim-startify/doc/startify.txt b/etc/soft/vim/vim/+plugins/vim-startify/doc/startify.txt new file mode 100644 index 0000000..5de7280 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/doc/startify.txt @@ -0,0 +1,1182 @@ +*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 `` 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 ``. + + 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_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-senstive: 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 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 = [ + \ 'echo "Cleaning up before saving.."', + \ 'silent! NERDTreeTabsClose' + \ ] +< +------------------------------------------------------------------------------ + *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. + +------------------------------------------------------------------------------ + *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_skiplist* +> + let g:startify_skiplist = [ + \ 'COMMIT_EDITMSG', + \ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc', + \ 'bundle/.*/doc', + \ ] +< +A list of Vim regular expressions that is used to filter recently used files. +See |pattern.txt| for what patterns can be used. + +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: |/\~|. When using backslashes as path separators, escape them. +Otherwise using "C:\this\vim\path\is\problematic" would not match what you +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 drawed 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 and . +------------------------------------------------------------------------------ + *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 or 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 + +< +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. +> + +< +Open all marked entries. If nothing was marked beforehand, just open the +current entry. + +If you want to use another key instead of , put this in your vimrc: +> + autocmd User Startified nmap o (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 | , | 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 don't want the start screen 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 +< +------------------------------------------------------------------------------ + *startify-faq-07* +The session autoload feature is not working!~ + +Do you have NERDTree installed by any chance? If so, try this: +> + let NERDTreeHijackNetrw = 0 +< +------------------------------------------------------------------------------ + *startify-faq-08* +How do I center my header/footer?~ +> + let g:startify_custom_header = + \ 'startify#center(startify#fortune#cowsay())' +< +------------------------------------------------------------------------------ + *startify-faq-09* +tmux-resurrect?~ + +If you use tmux-resurrect to restore your tmux environment, you can use :SLoad +to load your last used session right away: +> + set -g @resurrect-processes '"vim->vim +SLoad"' +< +------------------------------------------------------------------------------ + *startify-faq-10* +Temporarily skip Startify at start?~ + +In some cases you might need to skip Startify at start. E.g. +> + vim +VimwikiMakeDiaryNote +< +Startify would interfere in this case. A simple way to avoid that would be: +> + vim --cmd 'let g:startify_disable_at_vimenter = 1' +VimwikiMakeDiaryNote +< +------------------------------------------------------------------------------ + *startify-faq-11* +How to use the output of a command as header?~ +> + redir => test + silent echo 'one' + silent echo 'two' + silent echo 'three' + redir END + + let g:startify_custom_header = + \ map(split(test), 'repeat(" ", 10) . v:val') +< +|:redir| puts a string into 'test'. Then we turn it into a list of strings. +Then we shift each string to the right by 10 spaces. Afterwards we add an +empty string to the list, which results in an empty line in the header. + +------------------------------------------------------------------------------ + *startify-faq-12* +There is an empty window with vim-plug!~ + +After start there might be only the Startify buffer which is marked as +|unlisted-buffer|. The problem arises if you use :PlugUpdate followed by 'D' +to see the changes. An empty window! + +The actual problem is that Vim won't close the last listed buffer. Try this: +> + $ vim -u NONE -N + :set nobuflisted + :new + :bd +< +It won't close the buffer and therefore the window. This also happens in +vim-plug. Note that this is no bug in neither plugin, it's a Vim weirdness. + +Workaround #1:~ +> + autocmd User Startified setlocal buflisted +< +In some cases this could break other plugins at start (I look at you +NERDTree), but works well most of the time. + +Workaround #2:~ +> + let g:plug_window = 'enew' " or maybe 'tabnew' +< +This will open the plug buffer in the current window instead of creating a new +window on the left side. Mind that this will also close the Startify buffer +since it will be hidden. + +------------------------------------------------------------------------------ + *startify-faq-13* +How to disable random quotes header?~ +> + let g:startify_custom_header = [] +< +See |g:startify_custom_header|. + +------------------------------------------------------------------------------ + *startify-faq-14* +NERDTree with NERDTreeTabs does not work in gvim!~ + +Mind that `https://github.com/jistr/vim-nerdtree-tabs` is no longer maintained +and has quite some issues. + +Anyway, this particular issue can be resolved in different ways. See: + + https://github.com/mhinz/vim-startify/issues/24 + +------------------------------------------------------------------------------ + *startify-faq-15* +Startify is cluttered with help files!~ + +Everytime you use |:h|, you open a file from the Vim runtime directory or of +an installed plugin. By default, Startify detects these files and skips them. + +This works for most use cases, but not for all. + +If the default fails for you and the Startify buffer is cluttered with help +files, add that path to the skiplist yourself: |g:startify_skiplist|. + +------------------------------------------------------------------------------ + *startify-faq-16* +How to disable single mappings?~ + +Use |startify-autocmd|: +> + autocmd User Startified for key in ['b','s','t','v'] | + \ execute 'nunmap ' key | endfor +< +------------------------------------------------------------------------------ + *startify-faq-17* +Run Startify for each new tab!~ +> + if has('nvim') + autocmd TabNewEntered * Startify + else + autocmd BufWinEnter * + \ if !exists('t:startify_new_tab') + \ && empty(expand('%')) + \ && empty(&l:buftype) + \ && &l:modifiable | + \ let t:startify_new_tab = 1 | + \ Startify | + \ endif + endif +< +NOTE: I do not recommend this. It can lead to all kinds of issues, so you +should know exactly what the above code does. E.g. any plugin using |:tabnew| +is probably expecting an empty buffer afterwards, but it won't be empty, it +will be filled with the Startify buffer and fail. I suggest mapping +`:Startify` to something convenient instead. + +------------------------------------------------------------------------------ + *startify-faq-18* +Files from remote file system slow down startup!~ + +I/O actions like resolving symbolic links or checking if a file is readable +can be very slow on some remote file systems (Samba, NFS, FUSE, etc.) Even +more so when done for many files. + +In that case it is often better to add the mount point of the remote file +system to |g:startify_skiplist|: +> + let g:startify_skiplist = ['^/mnt/nfs'] +< +============================================================================== +EXAMPLE *startify-example* +> + autocmd User Startified setlocal cursorline + + let g:startify_enable_special = 0 + let g:startify_files_number = 8 + let g:startify_relative_path = 1 + let g:startify_change_to_dir = 1 + let g:startify_update_oldfiles = 1 + let g:startify_session_autoload = 1 + let g:startify_session_persistence = 1 + + let g:startify_skiplist = [ + \ 'COMMIT_EDITMSG', + \ 'bundle/.*/doc', + \ '/data/repo/neovim/runtime/doc', + \ '/Users/mhi/local/vim/share/vim/vim74/doc', + \ ] + + let g:startify_bookmarks = [ + \ { 'c': '~/.vim/vimrc' }, + \ '~/golfing', + \ ] + + let g:startify_custom_header = + \ startify#fortune#cowsay('', '═','║','╔','╗','╝','╚') + + let g:startify_custom_footer = + \ ['', " Vim is charityware. Please read ':help uganda'.", ''] + + hi StartifyBracket ctermfg=240 + hi StartifyFile ctermfg=147 + hi StartifyFooter ctermfg=240 + hi StartifyHeader ctermfg=114 + hi StartifyNumber ctermfg=215 + hi StartifyPath ctermfg=245 + hi StartifySlash ctermfg=240 + hi StartifySpecial ctermfg=240 +< +============================================================================== +vim: tw=78 diff --git a/etc/soft/vim/vim/+plugins/vim-startify/images/startify-logo.png b/etc/soft/vim/vim/+plugins/vim-startify/images/startify-logo.png new file mode 100644 index 0000000..ce02396 Binary files /dev/null and b/etc/soft/vim/vim/+plugins/vim-startify/images/startify-logo.png differ diff --git a/etc/soft/vim/vim/+plugins/vim-startify/images/startify-menu.png b/etc/soft/vim/vim/+plugins/vim-startify/images/startify-menu.png new file mode 100644 index 0000000..464fd3b Binary files /dev/null and b/etc/soft/vim/vim/+plugins/vim-startify/images/startify-menu.png differ diff --git a/etc/soft/vim/vim/+plugins/vim-startify/plugin/startify.vim b/etc/soft/vim/vim/+plugins/vim-startify/plugin/startify.vim new file mode 100644 index 0000000..96bbc5a --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/plugin/startify.vim @@ -0,0 +1,67 @@ +" vim: et sw=2 sts=2 + +" Plugin: https://github.com/mhinz/vim-startify +" Description: A fancy start screen for Vim. +" Maintainer: Marco Hinz + +if exists('g:loaded_startify') || &cp + finish +endif +let g:loaded_startify = 1 +let g:startify_locked = 0 + +if !get(g:, 'startify_disable_at_vimenter') && (!has('nvim') || has('nvim-0.3.5')) + " Only for Nvim v0.3.5+: https://github.com/neovim/neovim/issues/9885 + set shortmess+=I +endif + +augroup startify + autocmd VimEnter * nested call s:on_vimenter() + autocmd VimLeavePre * nested call s:on_vimleavepre() + autocmd QuickFixCmdPre *vimgrep* let g:startify_locked = 1 + autocmd QuickFixCmdPost *vimgrep* let g:startify_locked = 0 +augroup END + +function! s:update_oldfiles(file) + if g:startify_locked || !exists('v:oldfiles') + return + endif + let idx = index(v:oldfiles, a:file) + if idx != -1 + call remove(v:oldfiles, idx) + endif + call insert(v:oldfiles, a:file, 0) +endfunction + +function! s:on_vimenter() + if !argc() && line2byte('$') == -1 + if get(g:, 'startify_session_autoload') && filereadable('Session.vim') + source Session.vim + elseif !get(g:, 'startify_disable_at_vimenter') + call startify#insane_in_the_membrane(1) + endif + endif + if get(g:, 'startify_update_oldfiles') + call map(v:oldfiles, 'fnamemodify(v:val, ":p")') + autocmd startify BufNewFile,BufRead,BufFilePre * + \ call s:update_oldfiles(expand(':p')) + endif + autocmd! startify VimEnter +endfunction + +function! s:on_vimleavepre() + if get(g:, 'startify_session_persistence') + \ && exists('v:this_session') + \ && filewritable(v:this_session) + call startify#session_write(fnameescape(v:this_session)) + endif +endfunction + +command! -nargs=? -bar -bang -complete=customlist,startify#session_list SLoad call startify#session_load(0, ) +command! -nargs=? -bar -bang -complete=customlist,startify#session_list SSave call startify#session_save(0, ) +command! -nargs=? -bar -bang -complete=customlist,startify#session_list SDelete call startify#session_delete(0, ) +command! -nargs=0 -bar SClose call startify#session_close() +command! -nargs=0 -bar Startify call startify#insane_in_the_membrane(0) +command! -nargs=0 -bar StartifyDebug call startify#debug() + +nnoremap (startify-open-buffers) :call startify#open_buffers() diff --git a/etc/soft/vim/vim/+plugins/vim-startify/syntax/startify.vim b/etc/soft/vim/vim/+plugins/vim-startify/syntax/startify.vim new file mode 100644 index 0000000..aa0e118 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/syntax/startify.vim @@ -0,0 +1,55 @@ +" vim: et sw=2 sts=2 + +" Plugin: https://github.com/mhinz/vim-startify +" Description: A fancy start screen for Vim. +" Maintainer: Marco Hinz + +if exists("b:current_syntax") + finish +endif + +let s:sep = startify#get_separator() +let s:padding_left = repeat(' ', get(g:, 'startify_padding_left', 3)) + +syntax sync fromstart + +execute 'syntax match StartifyBracket /.*\%'. (len(s:padding_left) + 6) .'c/ contains= + \ StartifyNumber, + \ StartifySelect' +syntax match StartifySpecial /\V\|/ +syntax match StartifyNumber /^\s*\[\zs[^BSVT]\{-}\ze\]/ +syntax match StartifySelect /^\s*\[\zs[BSVT]\{-}\ze\]/ +syntax match StartifyVar /\$[^\/]\+/ +syntax match StartifyFile /.*/ contains= + \ StartifyBracket, + \ StartifyPath, + \ StartifySpecial, + +execute 'syntax match StartifySlash /\'. s:sep .'/' +execute 'syntax match StartifyPath /\%'. (len(s:padding_left) + 6) .'c.*\'. s:sep .'/ contains=StartifySlash,StartifyVar' + +execute 'syntax region StartifyHeader start=/\%1l/ end=/\%'. (len(g:startify_header) + 2) .'l/' + +if exists('g:startify_custom_footer') + execute 'syntax region StartifyFooter start=/\%'. startify#get_lastline() .'l/ end=/\_.*/' +endif + +if exists('b:startify.section_header_lines') + for line in b:startify.section_header_lines + execute 'syntax region StartifySection start=/\%'. line .'l/ end=/$/' + endfor +endif + +highlight default link StartifyBracket Delimiter +highlight default link StartifyFile Identifier +highlight default link StartifyFooter Title +highlight default link StartifyHeader Title +highlight default link StartifyNumber Number +highlight default link StartifyPath Directory +highlight default link StartifySection Statement +highlight default link StartifySelect Title +highlight default link StartifySlash Delimiter +highlight default link StartifySpecial Comment +highlight default link StartifyVar StartifyPath + +let b:current_syntax = 'startify' diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/feature/buffer.vader b/etc/soft/vim/vim/+plugins/vim-startify/test/feature/buffer.vader new file mode 100644 index 0000000..0891ea7 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/feature/buffer.vader @@ -0,0 +1,14 @@ +Before: + enew! + Startify + +Execute (Check buffer options): + AssertEqual 'startify', &filetype + AssertEqual 'wipe', &bufhidden + AssertEqual '', &buftype + AssertEqual 0, &buflisted + AssertEqual 0, &cursorcolumn + AssertEqual 0, &cursorline + AssertEqual 0, &list + AssertEqual 0, &number + AssertEqual 0, &swapfile diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/feature/mapping.vader b/etc/soft/vim/vim/+plugins/vim-startify/test/feature/mapping.vader new file mode 100644 index 0000000..aba6461 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/feature/mapping.vader @@ -0,0 +1,20 @@ +Before: + enew! + Startify + +Do (Open new buffer in insert "foo"): + ifoo +Expect (Buffer contains only "foo"): + foo + +Do (Open new buffer in normal mode and insert "bar"): + eibar +Expect (Buffer contains only "bar"): + bar + +Given (Buffer that contains only "quux"): + quux +Do (Quit Startify buffer via 'q'): + q +Expect (Buffer before :Startify was called): + quux diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/feature/session.vader b/etc/soft/vim/vim/+plugins/vim-startify/test/feature/session.vader new file mode 100644 index 0000000..88fb531 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/feature/session.vader @@ -0,0 +1,22 @@ +Before: + enew! + +Execute (:SSave foo | SClose): + edit include/testfile.txt + SSave foo + SClose +Do (q): + q +Expect (): + + +Execute (:SLoad foo): + SLoad foo +Expect (textfile.txt): + This is just a simple test file. + Foo, bar, quux. + +Execute (Session: :SDelete! foo): + AssertEqual filereadable(g:startify_session_dir.'/foo'), 1 + SDelete! foo + AssertEqual filereadable(g:startify_session_dir.'/foo'), 0 diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/include/testfile.txt b/etc/soft/vim/vim/+plugins/vim-startify/test/include/testfile.txt new file mode 100644 index 0000000..01ad94a --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/include/testfile.txt @@ -0,0 +1,2 @@ +This is just a simple test file. +Foo, bar, quux. diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/run b/etc/soft/vim/vim/+plugins/vim-startify/test/run new file mode 100755 index 0000000..f39bc33 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/run @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +# Change to directory of this script. +cd "${0%/*}" + +# Look for existing vader installation. +vader=( ${HOME}/.vim/*bundle*/vader*/plugin/vader.vim ) +if [ -f ${vader[0]} ]; then + # Remove "plugin/vader.vim" suffix. + vader=${vader[0]%/*/*} +fi + +if [ -d $vader ]; then + [[ ! -L vader.vim ]] && ln -s $vader vader.vim +else + git clone https://github.com/junegunn/vader.vim.git +fi + +# Provide viminfo during tests, remove it on exit. +cp viminfo viminfo.tmp +trap "{ rm viminfo.tmp; }" EXIT + +TERM=ansi HOME=/dev/null vim -XNu vimrc -i viminfo.tmp -c 'Vader! feature/*.vader' diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/session/.gitkeep b/etc/soft/vim/vim/+plugins/vim-startify/test/session/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/viminfo b/etc/soft/vim/vim/+plugins/vim-startify/test/viminfo new file mode 100644 index 0000000..fb458ed --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/viminfo @@ -0,0 +1,2 @@ +> ../plugin/startify.vim + " 1 0 diff --git a/etc/soft/vim/vim/+plugins/vim-startify/test/vimrc b/etc/soft/vim/vim/+plugins/vim-startify/test/vimrc new file mode 100644 index 0000000..2729be5 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-startify/test/vimrc @@ -0,0 +1,13 @@ +filetype off + +set runtimepath+=vader.vim +set runtimepath+=.. + +filetype plugin on +syntax enable + +set hidden + +let g:startify_session_dir = 'session' +let g:startify_relative_path = 1 +let g:startify_custom_header = [] diff --git a/etc/soft/vim/vimrc b/etc/soft/vim/vimrc index 4b9f65d..dfaa162 100644 --- a/etc/soft/vim/vimrc +++ b/etc/soft/vim/vimrc @@ -877,5 +877,15 @@ imap