diff --git a/.gitignore b/.gitignore index c2ad8d6..ace1d73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ _vim/.config/coc # autoload -> Mackup -_vim/autoload +_vim/.vim/autoload *.swl *.swm diff --git a/_py/.pyenv/version b/_python/.pyenv/version similarity index 100% rename from _py/.pyenv/version rename to _python/.pyenv/version diff --git a/_py/piplist b/_python/piplist similarity index 100% rename from _py/piplist rename to _python/piplist diff --git a/_rclone/.config/rclone/rclone.conf b/_rclone/.config/rclone/rclone.conf deleted file mode 100644 index bab7115..0000000 --- a/_rclone/.config/rclone/rclone.conf +++ /dev/null @@ -1,10 +0,0 @@ -[Gdrive] -type = drive -token = {"access_token":"ya29.a0AfH6SMC94oERvbNgKRN-qi5E60-RRzWITpQZsy1U5IrmXT7XlZQKpWqOmXAVNntbX6z-MbZvn5VZN5FznXe5DgDEUZ0b2LUGV1o0Of1K3-UrRIaGp79mIYkHHnDNXhNMw-EGLmBlBY27deJ1CiFVnFW4uBpFRzDe1oXe","token_type":"Bearer","refresh_token":"1//0eRjGRiYpKs38CgYIARAAGA4SNwF-L9IrzHqvverQvwbRNGdMPYJx7fjmjz31Y6KgcrrrsH7T4nzTEHd4utAWDco1XZeddTG5UQs","expiry":"2020-06-22T00:50:35.631108+09:00"} -root_folder_id = 0AA3jO9R6L612Uk9PVA -scope = drive - -[Dbox] -type = dropbox -token = {"access_token":"qhLkMHvjUAAAAAAAAAABY5fioc_270AMsj7M6jcsrJshNsdqc5uXzUhPcUr8rmVR","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"} - diff --git a/_rclone/rclone_conf_deleted.txt b/_rclone/rclone_conf_deleted.txt new file mode 100644 index 0000000..3566bd9 --- /dev/null +++ b/_rclone/rclone_conf_deleted.txt @@ -0,0 +1 @@ +check rclone.conf at Dropbox \ No newline at end of file diff --git a/_vim/.config/coc/extensions/db.json b/_vim/.config/coc/extensions/db.json deleted file mode 100644 index 83511f0..0000000 --- a/_vim/.config/coc/extensions/db.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lastUpdate": 1591147287154 -} \ No newline at end of file diff --git a/_vim/.config/coc/extensions/package.json b/_vim/.config/coc/extensions/package.json deleted file mode 100644 index a55cc5a..0000000 --- a/_vim/.config/coc/extensions/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "dependencies": { - "coc-actions": ">=1.4.0", - "coc-css": ">=1.2.3", - "coc-dictionary": ">=1.2.2", - "coc-emoji": ">=1.2.3", - "coc-eslint": ">=1.2.7", - "coc-flow": ">=0.1.3", - "coc-go": ">=0.7.0", - "coc-highlight": ">=1.2.5", - "coc-html": ">=1.2.4", - "coc-json": ">=1.2.6", - "coc-lists": ">=1.3.8", - "coc-markdownlint": ">=1.4.0", - "coc-marketplace": ">=1.7.0", - "coc-prettier": ">=1.1.14", - "coc-python": ">=1.2.12", - "coc-sh": ">=0.4.0", - "coc-snippets": ">=2.1.26", - "coc-stylelint": ">=1.1.0", - "coc-stylelintplus": ">=1.0.4", - "coc-svg": ">=0.0.13", - "coc-syntax": ">=1.2.4", - "coc-tag": ">=1.2.4", - "coc-tsserver": ">=1.5.1", - "coc-utils": ">=0.0.13", - "coc-yaml": ">=1.0.4" - } -} \ No newline at end of file diff --git a/_vim/.vim/autoload/plug.vim b/_vim/.vim/autoload/plug.vim deleted file mode 100644 index bc02f03..0000000 --- a/_vim/.vim/autoload/plug.vim +++ /dev/null @@ -1,2664 +0,0 @@ -" vim-plug: Vim plugin manager -" ============================ -" -" Download plug.vim and put it in ~/.vim/autoload -" -" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ -" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -" -" Edit your .vimrc -" -" call plug#begin('~/.vim/plugged') -" -" " Make sure you use single quotes -" -" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align -" Plug 'junegunn/vim-easy-align' -" -" " Any valid git URL is allowed -" Plug 'https://github.com/junegunn/vim-github-dashboard.git' -" -" " Multiple Plug commands can be written in a single line using | separators -" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' -" -" " On-demand loading -" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -" Plug 'tpope/vim-fireplace', { 'for': 'clojure' } -" -" " Using a non-master branch -" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } -" -" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above) -" Plug 'fatih/vim-go', { 'tag': '*' } -" -" " Plugin options -" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } -" -" " Plugin outside ~/.vim/plugged with post-update hook -" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } -" -" " Unmanaged plugin (manually installed and updated) -" Plug '~/my-prototype-plugin' -" -" " Initialize plugin system -" call plug#end() -" -" Then reload .vimrc and :PlugInstall to install plugins. -" -" Plug options: -" -"| Option | Description | -"| ----------------------- | ------------------------------------------------ | -"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use | -"| `rtp` | Subdirectory that contains Vim plugin | -"| `dir` | Custom directory for the plugin | -"| `as` | Use different name for the plugin | -"| `do` | Post-update hook (string or funcref) | -"| `on` | On-demand loading: Commands or ``-mappings | -"| `for` | On-demand loading: File types | -"| `frozen` | Do not update unless explicitly specified | -" -" More information: https://github.com/junegunn/vim-plug -" -" -" Copyright (c) 2017 Junegunn Choi -" -" MIT License -" -" 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. - -if exists('g:loaded_plug') - finish -endif -let g:loaded_plug = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let s:plug_src = 'https://github.com/junegunn/vim-plug.git' -let s:plug_tab = get(s:, 'plug_tab', -1) -let s:plug_buf = get(s:, 'plug_buf', -1) -let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') -let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) -let s:vim8 = has('patch-8.0.0039') && exists('*job_start') -if s:is_win && &shellslash - set noshellslash - let s:me = resolve(expand(':p')) - set shellslash -else - let s:me = resolve(expand(':p')) -endif -let s:base_spec = { 'branch': 'master', 'frozen': 0 } -let s:TYPE = { -\ 'string': type(''), -\ 'list': type([]), -\ 'dict': type({}), -\ 'funcref': type(function('call')) -\ } -let s:loaded = get(s:, 'loaded', {}) -let s:triggers = get(s:, 'triggers', {}) - -if s:is_win - function! s:plug_call(fn, ...) - let shellslash = &shellslash - try - set noshellslash - return call(a:fn, a:000) - finally - let &shellslash = shellslash - endtry - endfunction -else - function! s:plug_call(fn, ...) - return call(a:fn, a:000) - endfunction -endif - -function! s:plug_getcwd() - return s:plug_call('getcwd') -endfunction - -function! s:plug_fnamemodify(fname, mods) - return s:plug_call('fnamemodify', a:fname, a:mods) -endfunction - -function! s:plug_expand(fmt) - return s:plug_call('expand', a:fmt, 1) -endfunction - -function! s:plug_tempname() - return s:plug_call('tempname') -endfunction - -function! plug#begin(...) - if a:0 > 0 - let s:plug_home_org = a:1 - let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) - elseif exists('g:plug_home') - let home = s:path(g:plug_home) - elseif !empty(&rtp) - let home = s:path(split(&rtp, ',')[0]) . '/plugged' - else - return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') - endif - if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp - return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') - endif - - let g:plug_home = home - let g:plugs = {} - let g:plugs_order = [] - let s:triggers = {} - - call s:define_commands() - return 1 -endfunction - -function! s:define_commands() - command! -nargs=+ -bar Plug call plug#() - if !executable('git') - return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') - endif - if has('win32') - \ && &shellslash - \ && (&shell =~# 'cmd\.exe' || &shell =~# 'powershell\.exe') - return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') - endif - if !has('nvim') - \ && (has('win32') || has('win32unix')) - \ && !has('multi_byte') - return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') - endif - command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) - command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) - command! -nargs=0 -bar -bang PlugClean call s:clean(0) - command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif - command! -nargs=0 -bar PlugStatus call s:status() - command! -nargs=0 -bar PlugDiff call s:diff() - command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(0, ) -endfunction - -function! s:to_a(v) - return type(a:v) == s:TYPE.list ? a:v : [a:v] -endfunction - -function! s:to_s(v) - return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" -endfunction - -function! s:glob(from, pattern) - return s:lines(globpath(a:from, a:pattern)) -endfunction - -function! s:source(from, ...) - let found = 0 - for pattern in a:000 - for vim in s:glob(a:from, pattern) - execute 'source' s:esc(vim) - let found = 1 - endfor - endfor - return found -endfunction - -function! s:assoc(dict, key, val) - let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) -endfunction - -function! s:ask(message, ...) - call inputsave() - echohl WarningMsg - let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) - echohl None - call inputrestore() - echo "\r" - return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 -endfunction - -function! s:ask_no_interrupt(...) - try - return call('s:ask', a:000) - catch - return 0 - endtry -endfunction - -function! s:lazy(plug, opt) - return has_key(a:plug, a:opt) && - \ (empty(s:to_a(a:plug[a:opt])) || - \ !isdirectory(a:plug.dir) || - \ len(s:glob(s:rtp(a:plug), 'plugin')) || - \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) -endfunction - -function! plug#end() - if !exists('g:plugs') - return s:err('plug#end() called without calling plug#begin() first') - endif - - if exists('#PlugLOD') - augroup PlugLOD - autocmd! - augroup END - augroup! PlugLOD - endif - let lod = { 'ft': {}, 'map': {}, 'cmd': {} } - - if exists('g:did_load_filetypes') - filetype off - endif - for name in g:plugs_order - if !has_key(g:plugs, name) - continue - endif - let plug = g:plugs[name] - if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') - let s:loaded[name] = 1 - continue - endif - - if has_key(plug, 'on') - let s:triggers[name] = { 'map': [], 'cmd': [] } - for cmd in s:to_a(plug.on) - if cmd =~? '^.\+' - if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) - call s:assoc(lod.map, cmd, name) - endif - call add(s:triggers[name].map, cmd) - elseif cmd =~# '^[A-Z]' - let cmd = substitute(cmd, '!*$', '', '') - if exists(':'.cmd) != 2 - call s:assoc(lod.cmd, cmd, name) - endif - call add(s:triggers[name].cmd, cmd) - else - call s:err('Invalid `on` option: '.cmd. - \ '. Should start with an uppercase letter or ``.') - endif - endfor - endif - - if has_key(plug, 'for') - let types = s:to_a(plug.for) - if !empty(types) - augroup filetypedetect - call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') - augroup END - endif - for type in types - call s:assoc(lod.ft, type, name) - endfor - endif - endfor - - for [cmd, names] in items(lod.cmd) - execute printf( - \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "", , , , %s)', - \ cmd, string(cmd), string(names)) - endfor - - for [map, names] in items(lod.map) - for [mode, map_prefix, key_prefix] in - \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] - execute printf( - \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', - \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) - endfor - endfor - - for [ft, names] in items(lod.ft) - augroup PlugLOD - execute printf('autocmd FileType %s call lod_ft(%s, %s)', - \ ft, string(ft), string(names)) - augroup END - endfor - - call s:reorg_rtp() - filetype plugin indent on - if has('vim_starting') - if has('syntax') && !exists('g:syntax_on') - syntax enable - end - else - call s:reload_plugins() - endif -endfunction - -function! s:loaded_names() - return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') -endfunction - -function! s:load_plugin(spec) - call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') -endfunction - -function! s:reload_plugins() - for name in s:loaded_names() - call s:load_plugin(g:plugs[name]) - endfor -endfunction - -function! s:trim(str) - return substitute(a:str, '[\/]\+$', '', '') -endfunction - -function! s:version_requirement(val, min) - for idx in range(0, len(a:min) - 1) - let v = get(a:val, idx, 0) - if v < a:min[idx] | return 0 - elseif v > a:min[idx] | return 1 - endif - endfor - return 1 -endfunction - -function! s:git_version_requirement(...) - if !exists('s:git_version') - let s:git_version = map(split(split(s:system(['git', '--version']))[2], '\.'), 'str2nr(v:val)') - endif - return s:version_requirement(s:git_version, a:000) -endfunction - -function! s:progress_opt(base) - return a:base && !s:is_win && - \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' -endfunction - -function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) -endfunction - -if s:is_win - function! s:path(path) - return s:trim(substitute(a:path, '/', '\', 'g')) - endfunction - - function! s:dirpath(path) - return s:path(a:path) . '\' - endfunction - - function! s:is_local_plug(repo) - return a:repo =~? '^[a-z]:\|^[%~]' - endfunction - - " Copied from fzf - function! s:wrap_cmds(cmds) - let cmds = [ - \ '@echo off', - \ 'setlocal enabledelayedexpansion'] - \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) - \ + ['endlocal'] - if has('iconv') - if !exists('s:codepage') - let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) - endif - return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) - endif - return map(cmds, 'v:val."\r"') - endfunction - - function! s:batchfile(cmd) - let batchfile = s:plug_tempname().'.bat' - call writefile(s:wrap_cmds(a:cmd), batchfile) - let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) - if &shell =~# 'powershell\.exe' - let cmd = '& ' . cmd - endif - return [batchfile, cmd] - endfunction -else - function! s:path(path) - return s:trim(a:path) - endfunction - - function! s:dirpath(path) - return substitute(a:path, '[/\\]*$', '/', '') - endfunction - - function! s:is_local_plug(repo) - return a:repo[0] =~ '[/$~]' - endfunction -endif - -function! s:err(msg) - echohl ErrorMsg - echom '[vim-plug] '.a:msg - echohl None -endfunction - -function! s:warn(cmd, msg) - echohl WarningMsg - execute a:cmd 'a:msg' - echohl None -endfunction - -function! s:esc(path) - return escape(a:path, ' ') -endfunction - -function! s:escrtp(path) - return escape(a:path, ' ,') -endfunction - -function! s:remove_rtp() - for name in s:loaded_names() - let rtp = s:rtp(g:plugs[name]) - execute 'set rtp-='.s:escrtp(rtp) - let after = globpath(rtp, 'after') - if isdirectory(after) - execute 'set rtp-='.s:escrtp(after) - endif - endfor -endfunction - -function! s:reorg_rtp() - if !empty(s:first_rtp) - execute 'set rtp-='.s:first_rtp - execute 'set rtp-='.s:last_rtp - endif - - " &rtp is modified from outside - if exists('s:prtp') && s:prtp !=# &rtp - call s:remove_rtp() - unlet! s:middle - endif - - let s:middle = get(s:, 'middle', &rtp) - let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') - let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') - let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') - \ . ','.s:middle.',' - \ . join(map(afters, 'escape(v:val, ",")'), ',') - let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') - let s:prtp = &rtp - - if !empty(s:first_rtp) - execute 'set rtp^='.s:first_rtp - execute 'set rtp+='.s:last_rtp - endif -endfunction - -function! s:doautocmd(...) - if exists('#'.join(a:000, '#')) - execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) - endif -endfunction - -function! s:dobufread(names) - for name in a:names - let path = s:rtp(g:plugs[name]) - for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin'] - if len(finddir(dir, path)) - if exists('#BufRead') - doautocmd BufRead - endif - return - endif - endfor - endfor -endfunction - -function! plug#load(...) - if a:0 == 0 - return s:err('Argument missing: plugin name(s) required') - endif - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 - let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') - if !empty(unknowns) - let s = len(unknowns) > 1 ? 's' : '' - return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) - end - let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') - if !empty(unloaded) - for name in unloaded - call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - endfor - call s:dobufread(unloaded) - return 1 - end - return 0 -endfunction - -function! s:remove_triggers(name) - if !has_key(s:triggers, a:name) - return - endif - for cmd in s:triggers[a:name].cmd - execute 'silent! delc' cmd - endfor - for map in s:triggers[a:name].map - execute 'silent! unmap' map - execute 'silent! iunmap' map - endfor - call remove(s:triggers, a:name) -endfunction - -function! s:lod(names, types, ...) - for name in a:names - call s:remove_triggers(name) - let s:loaded[name] = 1 - endfor - call s:reorg_rtp() - - for name in a:names - let rtp = s:rtp(g:plugs[name]) - for dir in a:types - call s:source(rtp, dir.'/**/*.vim') - endfor - if a:0 - if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) - execute 'runtime' a:1 - endif - call s:source(rtp, a:2) - endif - call s:doautocmd('User', name) - endfor -endfunction - -function! s:lod_ft(pat, names) - let syn = 'syntax/'.a:pat.'.vim' - call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) - execute 'autocmd! PlugLOD FileType' a:pat - call s:doautocmd('filetypeplugin', 'FileType') - call s:doautocmd('filetypeindent', 'FileType') -endfunction - -function! s:lod_cmd(cmd, bang, l1, l2, args, names) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) -endfunction - -function! s:lod_map(map, names, with_prefix, prefix) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - let extra = '' - while 1 - let c = getchar(0) - if c == 0 - break - endif - let extra .= nr2char(c) - endwhile - - if a:with_prefix - let prefix = v:count ? v:count : '' - let prefix .= '"'.v:register.a:prefix - if mode(1) == 'no' - if v:operator == 'c' - let prefix = "\" . prefix - endif - let prefix .= v:operator - endif - call feedkeys(prefix, 'n') - endif - call feedkeys(substitute(a:map, '^', "\", '') . extra) -endfunction - -function! plug#(repo, ...) - if a:0 > 1 - return s:err('Invalid number of arguments (1..2)') - endif - - try - let repo = s:trim(a:repo) - let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec - let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) - let spec = extend(s:infer_properties(name, repo), opts) - if !has_key(g:plugs, name) - call add(g:plugs_order, name) - endif - let g:plugs[name] = spec - let s:loaded[name] = get(s:loaded, name, 0) - catch - return s:err(v:exception) - endtry -endfunction - -function! s:parse_options(arg) - let opts = copy(s:base_spec) - let type = type(a:arg) - if type == s:TYPE.string - let opts.tag = a:arg - elseif type == s:TYPE.dict - call extend(opts, a:arg) - if has_key(opts, 'dir') - let opts.dir = s:dirpath(s:plug_expand(opts.dir)) - endif - else - throw 'Invalid argument type (expected: string or dictionary)' - endif - return opts -endfunction - -function! s:infer_properties(name, repo) - let repo = a:repo - if s:is_local_plug(repo) - return { 'dir': s:dirpath(s:plug_expand(repo)) } - else - if repo =~ ':' - let uri = repo - else - if repo !~ '/' - throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) - endif - let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') - let uri = printf(fmt, repo) - endif - return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } - endif -endfunction - -function! s:install(force, names) - call s:update_impl(0, a:force, a:names) -endfunction - -function! s:update(force, names) - call s:update_impl(1, a:force, a:names) -endfunction - -function! plug#helptags() - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - for spec in values(g:plugs) - let docd = join([s:rtp(spec), 'doc'], '/') - if isdirectory(docd) - silent! execute 'helptags' s:esc(docd) - endif - endfor - return 1 -endfunction - -function! s:syntax() - syntax clear - syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber - syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX - syn match plugNumber /[0-9]\+[0-9.]*/ contained - syn match plugBracket /[[\]]/ contained - syn match plugX /x/ contained - syn match plugDash /^-/ - syn match plugPlus /^+/ - syn match plugStar /^*/ - syn match plugMessage /\(^- \)\@<=.*/ - syn match plugName /\(^- \)\@<=[^ ]*:/ - syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ - syn match plugTag /(tag: [^)]\+)/ - syn match plugInstall /\(^+ \)\@<=[^:]*/ - syn match plugUpdate /\(^* \)\@<=[^:]*/ - syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag - syn match plugEdge /^ \X\+$/ - syn match plugEdge /^ \X*/ contained nextgroup=plugSha - syn match plugSha /[0-9a-f]\{7,9}/ contained - syn match plugRelDate /([^)]*)$/ contained - syn match plugNotLoaded /(not loaded)$/ - syn match plugError /^x.*/ - syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ - syn match plugH2 /^.*:\n-\+$/ - syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean - hi def link plug1 Title - hi def link plug2 Repeat - hi def link plugH2 Type - hi def link plugX Exception - hi def link plugBracket Structure - hi def link plugNumber Number - - hi def link plugDash Special - hi def link plugPlus Constant - hi def link plugStar Boolean - - hi def link plugMessage Function - hi def link plugName Label - hi def link plugInstall Function - hi def link plugUpdate Type - - hi def link plugError Error - hi def link plugDeleted Ignore - hi def link plugRelDate Comment - hi def link plugEdge PreProc - hi def link plugSha Identifier - hi def link plugTag Constant - - hi def link plugNotLoaded Comment -endfunction - -function! s:lpad(str, len) - return a:str . repeat(' ', a:len - len(a:str)) -endfunction - -function! s:lines(msg) - return split(a:msg, "[\r\n]") -endfunction - -function! s:lastline(msg) - return get(s:lines(a:msg), -1, '') -endfunction - -function! s:new_window() - execute get(g:, 'plug_window', 'vertical topleft new') -endfunction - -function! s:plug_window_exists() - let buflist = tabpagebuflist(s:plug_tab) - return !empty(buflist) && index(buflist, s:plug_buf) >= 0 -endfunction - -function! s:switch_in() - if !s:plug_window_exists() - return 0 - endif - - if winbufnr(0) != s:plug_buf - let s:pos = [tabpagenr(), winnr(), winsaveview()] - execute 'normal!' s:plug_tab.'gt' - let winnr = bufwinnr(s:plug_buf) - execute winnr.'wincmd w' - call add(s:pos, winsaveview()) - else - let s:pos = [winsaveview()] - endif - - setlocal modifiable - return 1 -endfunction - -function! s:switch_out(...) - call winrestview(s:pos[-1]) - setlocal nomodifiable - if a:0 > 0 - execute a:1 - endif - - if len(s:pos) > 1 - execute 'normal!' s:pos[0].'gt' - execute s:pos[1] 'wincmd w' - call winrestview(s:pos[2]) - endif -endfunction - -function! s:finish_bindings() - nnoremap R :call retry() - nnoremap D :PlugDiff - nnoremap S :PlugStatus - nnoremap U :call status_update() - xnoremap U :call status_update() - nnoremap ]] :silent! call section('') - nnoremap [[ :silent! call section('b') -endfunction - -function! s:prepare(...) - if empty(s:plug_getcwd()) - throw 'Invalid current working directory. Cannot proceed.' - endif - - for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] - if exists(evar) - throw evar.' detected. Cannot proceed.' - endif - endfor - - call s:job_abort() - if s:switch_in() - if b:plug_preview == 1 - pc - endif - enew - else - call s:new_window() - endif - - nnoremap q :if b:plug_preview==1pcendifbd - if a:0 == 0 - call s:finish_bindings() - endif - let b:plug_preview = -1 - let s:plug_tab = tabpagenr() - let s:plug_buf = winbufnr(0) - call s:assign_name() - - for k in ['', 'L', 'o', 'X', 'd', 'dd'] - execute 'silent! unmap ' k - endfor - setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell - if exists('+colorcolumn') - setlocal colorcolumn= - endif - setf vim-plug - if exists('g:syntax_on') - call s:syntax() - endif -endfunction - -function! s:assign_name() - " Assign buffer name - let prefix = '[Plugins]' - let name = prefix - let idx = 2 - while bufexists(name) - let name = printf('%s (%s)', prefix, idx) - let idx = idx + 1 - endwhile - silent! execute 'f' fnameescape(name) -endfunction - -function! s:chsh(swap) - let prev = [&shell, &shellcmdflag, &shellredir] - if !s:is_win - set shell=sh - endif - if a:swap - if &shell =~# 'powershell\.exe' || &shell =~# 'pwsh$' - let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s' - elseif &shell =~# 'sh' || &shell =~# 'cmd\.exe' - set shellredir=>%s\ 2>&1 - endif - endif - return prev -endfunction - -function! s:bang(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(a:0) - " FIXME: Escaping is incomplete. We could use shellescape with eval, - " but it won't work on Windows. - let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') - execute "normal! :execute g:_plug_bang\\" - finally - unlet g:_plug_bang - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - return v:shell_error ? 'Exit status: ' . v:shell_error : '' -endfunction - -function! s:regress_bar() - let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') - call s:progress_bar(2, bar, len(bar)) -endfunction - -function! s:is_updated(dir) - return !empty(s:system_chomp(['git', 'log', '--pretty=format:%h', 'HEAD...HEAD@{1}'], a:dir)) -endfunction - -function! s:do(pull, force, todo) - for [name, spec] in items(a:todo) - if !isdirectory(spec.dir) - continue - endif - let installed = has_key(s:update.new, name) - let updated = installed ? 0 : - \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) - if a:force || installed || updated - execute 'cd' s:esc(spec.dir) - call append(3, '- Post-update hook for '. name .' ... ') - let error = '' - let type = type(spec.do) - if type == s:TYPE.string - if spec.do[0] == ':' - if !get(s:loaded, name, 0) - let s:loaded[name] = 1 - call s:reorg_rtp() - endif - call s:load_plugin(spec) - try - execute spec.do[1:] - catch - let error = v:exception - endtry - if !s:plug_window_exists() - cd - - throw 'Warning: vim-plug was terminated by the post-update hook of '.name - endif - else - let error = s:bang(spec.do) - endif - elseif type == s:TYPE.funcref - try - let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') - call spec.do({ 'name': name, 'status': status, 'force': a:force }) - catch - let error = v:exception - endtry - else - let error = 'Invalid hook type' - endif - call s:switch_in() - call setline(4, empty(error) ? (getline(4) . 'OK') - \ : ('x' . getline(4)[1:] . error)) - if !empty(error) - call add(s:update.errors, name) - call s:regress_bar() - endif - cd - - endif - endfor -endfunction - -function! s:hash_match(a, b) - return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 -endfunction - -function! s:checkout(spec) - let sha = a:spec.commit - let output = s:system(['git', 'rev-parse', 'HEAD'], a:spec.dir) - if !v:shell_error && !s:hash_match(sha, s:lines(output)[0]) - let output = s:system( - \ 'git fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) - endif - return output -endfunction - -function! s:finish(pull) - let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) - if new_frozen - let s = new_frozen > 1 ? 's' : '' - call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) - endif - call append(3, '- Finishing ... ') | 4 - redraw - call plug#helptags() - call plug#end() - call setline(4, getline(4) . 'Done!') - redraw - let msgs = [] - if !empty(s:update.errors) - call add(msgs, "Press 'R' to retry.") - endif - if a:pull && len(s:update.new) < len(filter(getline(5, '$'), - \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) - call add(msgs, "Press 'D' to see the updated changes.") - endif - echo join(msgs, ' ') - call s:finish_bindings() -endfunction - -function! s:retry() - if empty(s:update.errors) - return - endif - echo - call s:update_impl(s:update.pull, s:update.force, - \ extend(copy(s:update.errors), [s:update.threads])) -endfunction - -function! s:is_managed(name) - return has_key(g:plugs[a:name], 'uri') -endfunction - -function! s:names(...) - return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) -endfunction - -function! s:check_ruby() - silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") - if !exists('g:plug_ruby') - redraw! - return s:warn('echom', 'Warning: Ruby interface is broken') - endif - let ruby_version = split(g:plug_ruby, '\.') - unlet g:plug_ruby - return s:version_requirement(ruby_version, [1, 8, 7]) -endfunction - -function! s:update_impl(pull, force, args) abort - let sync = index(a:args, '--sync') >= 0 || has('vim_starting') - let args = filter(copy(a:args), 'v:val != "--sync"') - let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? - \ remove(args, -1) : get(g:, 'plug_threads', 16) - - let managed = filter(copy(g:plugs), 's:is_managed(v:key)') - let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : - \ filter(managed, 'index(args, v:key) >= 0') - - if empty(todo) - return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) - endif - - if !s:is_win && s:git_version_requirement(2, 3) - let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' - let $GIT_TERMINAL_PROMPT = 0 - for plug in values(todo) - let plug.uri = substitute(plug.uri, - \ '^https://git::@github\.com', 'https://github.com', '') - endfor - endif - - if !isdirectory(g:plug_home) - try - call mkdir(g:plug_home, 'p') - catch - return s:err(printf('Invalid plug directory: %s. '. - \ 'Try to call plug#begin with a valid directory', g:plug_home)) - endtry - endif - - if has('nvim') && !exists('*jobwait') && threads > 1 - call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') - endif - - let use_job = s:nvim || s:vim8 - let python = (has('python') || has('python3')) && !use_job - let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() - - let s:update = { - \ 'start': reltime(), - \ 'all': todo, - \ 'todo': copy(todo), - \ 'errors': [], - \ 'pull': a:pull, - \ 'force': a:force, - \ 'new': {}, - \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, - \ 'bar': '', - \ 'fin': 0 - \ } - - call s:prepare(1) - call append(0, ['', '']) - normal! 2G - silent! redraw - - let s:clone_opt = [] - if get(g:, 'plug_shallow', 1) - call extend(s:clone_opt, ['--depth', '1']) - if s:git_version_requirement(1, 7, 10) - call add(s:clone_opt, '--no-single-branch') - endif - endif - - if has('win32unix') || has('wsl') - call extend(s:clone_opt, ['-c', 'core.eol=lf', '-c', 'core.autocrlf=input']) - endif - - let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' - - " Python version requirement (>= 2.7) - if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 - redir => pyv - silent python import platform; print platform.python_version() - redir END - let python = s:version_requirement( - \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) - endif - - if (python || ruby) && s:update.threads > 1 - try - let imd = &imd - if s:mac_gui - set noimd - endif - if ruby - call s:update_ruby() - else - call s:update_python() - endif - catch - let lines = getline(4, '$') - let printed = {} - silent! 4,$d _ - for line in lines - let name = s:extract_name(line, '.', '') - if empty(name) || !has_key(printed, name) - call append('$', line) - if !empty(name) - let printed[name] = 1 - if line[0] == 'x' && index(s:update.errors, name) < 0 - call add(s:update.errors, name) - end - endif - endif - endfor - finally - let &imd = imd - call s:update_finish() - endtry - else - call s:update_vim() - while use_job && sync - sleep 100m - if s:update.fin - break - endif - endwhile - endif -endfunction - -function! s:log4(name, msg) - call setline(4, printf('- %s (%s)', a:msg, a:name)) - redraw -endfunction - -function! s:update_finish() - if exists('s:git_terminal_prompt') - let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt - endif - if s:switch_in() - call append(3, '- Updating ...') | 4 - for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) - let [pos, _] = s:logpos(name) - if !pos - continue - endif - if has_key(spec, 'commit') - call s:log4(name, 'Checking out '.spec.commit) - let out = s:checkout(spec) - elseif has_key(spec, 'tag') - let tag = spec.tag - if tag =~ '\*' - let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) - if !v:shell_error && !empty(tags) - let tag = tags[0] - call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) - call append(3, '') - endif - endif - call s:log4(name, 'Checking out '.tag) - let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) - else - let branch = get(spec, 'branch', 'master') - call s:log4(name, 'Merging origin/'.s:esc(branch)) - let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' - \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) - endif - if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && - \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) - call s:log4(name, 'Updating submodules. This may take a while.') - let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) - endif - let msg = s:format_message(v:shell_error ? 'x': '-', name, out) - if v:shell_error - call add(s:update.errors, name) - call s:regress_bar() - silent execute pos 'd _' - call append(4, msg) | 4 - elseif !empty(out) - call setline(pos, msg[0]) - endif - redraw - endfor - silent 4 d _ - try - call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) - catch - call s:warn('echom', v:exception) - call s:warn('echo', '') - return - endtry - call s:finish(s:update.pull) - call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') - call s:switch_out('normal! gg') - endif -endfunction - -function! s:job_abort() - if (!s:nvim && !s:vim8) || !exists('s:jobs') - return - endif - - for [name, j] in items(s:jobs) - if s:nvim - silent! call jobstop(j.jobid) - elseif s:vim8 - silent! call job_stop(j.jobid) - endif - if j.new - call s:rm_rf(g:plugs[name].dir) - endif - endfor - let s:jobs = {} -endfunction - -function! s:last_non_empty_line(lines) - let len = len(a:lines) - for idx in range(len) - let line = a:lines[len-idx-1] - if !empty(line) - return line - endif - endfor - return '' -endfunction - -function! s:job_out_cb(self, data) abort - let self = a:self - let data = remove(self.lines, -1) . a:data - let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') - call extend(self.lines, lines) - " To reduce the number of buffer updates - let self.tick = get(self, 'tick', -1) + 1 - if !self.running || self.tick % len(s:jobs) == 0 - let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') - let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) - call s:log(bullet, self.name, result) - endif -endfunction - -function! s:job_exit_cb(self, data) abort - let a:self.running = 0 - let a:self.error = a:data != 0 - call s:reap(a:self.name) - call s:tick() -endfunction - -function! s:job_cb(fn, job, ch, data) - if !s:plug_window_exists() " plug window closed - return s:job_abort() - endif - call call(a:fn, [a:job, a:data]) -endfunction - -function! s:nvim_cb(job_id, data, event) dict abort - return (a:event == 'stdout' || a:event == 'stderr') ? - \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : - \ s:job_cb('s:job_exit_cb', self, 0, a:data) -endfunction - -function! s:spawn(name, cmd, opts) - let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'new': get(a:opts, 'new', 0) } - let s:jobs[a:name] = job - - if s:nvim - if has_key(a:opts, 'dir') - let job.cwd = a:opts.dir - endif - let argv = a:cmd - call extend(job, { - \ 'on_stdout': function('s:nvim_cb'), - \ 'on_stderr': function('s:nvim_cb'), - \ 'on_exit': function('s:nvim_cb'), - \ }) - let jid = s:plug_call('jobstart', argv, job) - if jid > 0 - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = [jid < 0 ? argv[0].' is not executable' : - \ 'Invalid arguments (or job table is full)'] - endif - elseif s:vim8 - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"script": 0})')) - if has_key(a:opts, 'dir') - let cmd = s:with_cd(cmd, a:opts.dir, 0) - endif - let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] - let jid = job_start(s:is_win ? join(argv, ' ') : argv, { - \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'err_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), - \ 'err_mode': 'raw', - \ 'out_mode': 'raw' - \}) - if job_status(jid) == 'run' - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = ['Failed to start job'] - endif - else - let job.lines = s:lines(call('s:system', has_key(a:opts, 'dir') ? [a:cmd, a:opts.dir] : [a:cmd])) - let job.error = v:shell_error != 0 - let job.running = 0 - endif -endfunction - -function! s:reap(name) - let job = s:jobs[a:name] - if job.error - call add(s:update.errors, a:name) - elseif get(job, 'new', 0) - let s:update.new[a:name] = 1 - endif - let s:update.bar .= job.error ? 'x' : '=' - - let bullet = job.error ? 'x' : '-' - let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) - call s:log(bullet, a:name, empty(result) ? 'OK' : result) - call s:bar() - - call remove(s:jobs, a:name) -endfunction - -function! s:bar() - if s:switch_in() - let total = len(s:update.all) - call setline(1, (s:update.pull ? 'Updating' : 'Installing'). - \ ' plugins ('.len(s:update.bar).'/'.total.')') - call s:progress_bar(2, s:update.bar, total) - call s:switch_out() - endif -endfunction - -function! s:logpos(name) - let max = line('$') - for i in range(4, max > 4 ? max : 4) - if getline(i) =~# '^[-+x*] '.a:name.':' - for j in range(i + 1, max > 5 ? max : 5) - if getline(j) !~ '^ ' - return [i, j - 1] - endif - endfor - return [i, i] - endif - endfor - return [0, 0] -endfunction - -function! s:log(bullet, name, lines) - if s:switch_in() - let [b, e] = s:logpos(a:name) - if b > 0 - silent execute printf('%d,%d d _', b, e) - if b > winheight('.') - let b = 4 - endif - else - let b = 4 - endif - " FIXME For some reason, nomodifiable is set after :d in vim8 - setlocal modifiable - call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) - call s:switch_out() - endif -endfunction - -function! s:update_vim() - let s:jobs = {} - - call s:bar() - call s:tick() -endfunction - -function! s:tick() - let pull = s:update.pull - let prog = s:progress_opt(s:nvim || s:vim8) -while 1 " Without TCO, Vim stack is bound to explode - if empty(s:update.todo) - if empty(s:jobs) && !s:update.fin - call s:update_finish() - let s:update.fin = 1 - endif - return - endif - - let name = keys(s:update.todo)[0] - let spec = remove(s:update.todo, name) - let new = empty(globpath(spec.dir, '.git', 1)) - - call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') - redraw - - let has_tag = has_key(spec, 'tag') - if !new - let [error, _] = s:git_validate(spec, 0) - if empty(error) - if pull - let cmd = ['git', 'fetch'] - if has_tag && !empty(globpath(spec.dir, '.git/shallow')) - call extend(cmd, ['--depth', '99999999']) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, cmd, { 'dir': spec.dir }) - else - let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } - endif - else - let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } - endif - else - let cmd = ['git', 'clone'] - if !has_tag - call extend(cmd, s:clone_opt) - endif - if !empty(prog) - call add(cmd, prog) - endif - call s:spawn(name, extend(cmd, [spec.uri, s:trim(spec.dir)]), { 'new': 1 }) - endif - - if !s:jobs[name].running - call s:reap(name) - endif - if len(s:jobs) >= s:update.threads - break - endif -endwhile -endfunction - -function! s:update_python() -let py_exe = has('python') ? 'python' : 'python3' -execute py_exe "<< EOF" -import datetime -import functools -import os -try: - import queue -except ImportError: - import Queue as queue -import random -import re -import shutil -import signal -import subprocess -import tempfile -import threading as thr -import time -import traceback -import vim - -G_NVIM = vim.eval("has('nvim')") == '1' -G_PULL = vim.eval('s:update.pull') == '1' -G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 -G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) -G_CLONE_OPT = ' '.join(vim.eval('s:clone_opt')) -G_PROGRESS = vim.eval('s:progress_opt(1)') -G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) -G_STOP = thr.Event() -G_IS_WIN = vim.eval('s:is_win') == '1' - -class PlugError(Exception): - def __init__(self, msg): - self.msg = msg -class CmdTimedOut(PlugError): - pass -class CmdFailed(PlugError): - pass -class InvalidURI(PlugError): - pass -class Action(object): - INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] - -class Buffer(object): - def __init__(self, lock, num_plugs, is_pull): - self.bar = '' - self.event = 'Updating' if is_pull else 'Installing' - self.lock = lock - self.maxy = int(vim.eval('winheight(".")')) - self.num_plugs = num_plugs - - def __where(self, name): - """ Find first line with name in current buffer. Return line num. """ - found, lnum = False, 0 - matcher = re.compile('^[-+x*] {0}:'.format(name)) - for line in vim.current.buffer: - if matcher.search(line) is not None: - found = True - break - lnum += 1 - - if not found: - lnum = -1 - return lnum - - def header(self): - curbuf = vim.current.buffer - curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) - - num_spaces = self.num_plugs - len(self.bar) - curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') - - with self.lock: - vim.command('normal! 2G') - vim.command('redraw') - - def write(self, action, name, lines): - first, rest = lines[0], lines[1:] - msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] - msg.extend([' ' + line for line in rest]) - - try: - if action == Action.ERROR: - self.bar += 'x' - vim.command("call add(s:update.errors, '{0}')".format(name)) - elif action == Action.DONE: - self.bar += '=' - - curbuf = vim.current.buffer - lnum = self.__where(name) - if lnum != -1: # Found matching line num - del curbuf[lnum] - if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): - lnum = 3 - else: - lnum = 3 - curbuf.append(msg, lnum) - - self.header() - except vim.error: - pass - -class Command(object): - CD = 'cd /d' if G_IS_WIN else 'cd' - - def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): - self.cmd = cmd - if cmd_dir: - self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) - self.timeout = timeout - self.callback = cb if cb else (lambda msg: None) - self.clean = clean if clean else (lambda: None) - self.proc = None - - @property - def alive(self): - """ Returns true only if command still running. """ - return self.proc and self.proc.poll() is None - - def execute(self, ntries=3): - """ Execute the command with ntries if CmdTimedOut. - Returns the output of the command if no Exception. - """ - attempt, finished, limit = 0, False, self.timeout - - while not finished: - try: - attempt += 1 - result = self.try_command() - finished = True - return result - except CmdTimedOut: - if attempt != ntries: - self.notify_retry() - self.timeout += limit - else: - raise - - def notify_retry(self): - """ Retry required for command, notify user. """ - for count in range(3, 0, -1): - if G_STOP.is_set(): - raise KeyboardInterrupt - msg = 'Timeout. Will retry in {0} second{1} ...'.format( - count, 's' if count != 1 else '') - self.callback([msg]) - time.sleep(1) - self.callback(['Retrying ...']) - - def try_command(self): - """ Execute a cmd & poll for callback. Returns list of output. - Raises CmdFailed -> return code for Popen isn't 0 - Raises CmdTimedOut -> command exceeded timeout without new output - """ - first_line = True - - try: - tfile = tempfile.NamedTemporaryFile(mode='w+b') - preexec_fn = not G_IS_WIN and os.setsid or None - self.proc = subprocess.Popen(self.cmd, stdout=tfile, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, shell=True, - preexec_fn=preexec_fn) - thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) - thrd.start() - - thread_not_started = True - while thread_not_started: - try: - thrd.join(0.1) - thread_not_started = False - except RuntimeError: - pass - - while self.alive: - if G_STOP.is_set(): - raise KeyboardInterrupt - - if first_line or random.random() < G_LOG_PROB: - first_line = False - line = '' if G_IS_WIN else nonblock_read(tfile.name) - if line: - self.callback([line]) - - time_diff = time.time() - os.path.getmtime(tfile.name) - if time_diff > self.timeout: - raise CmdTimedOut(['Timeout!']) - - thrd.join(0.5) - - tfile.seek(0) - result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] - - if self.proc.returncode != 0: - raise CmdFailed([''] + result) - - return result - except: - self.terminate() - raise - - def terminate(self): - """ Terminate process and cleanup. """ - if self.alive: - if G_IS_WIN: - os.kill(self.proc.pid, signal.SIGINT) - else: - os.killpg(self.proc.pid, signal.SIGTERM) - self.clean() - -class Plugin(object): - def __init__(self, name, args, buf_q, lock): - self.name = name - self.args = args - self.buf_q = buf_q - self.lock = lock - self.tag = args.get('tag', 0) - - def manage(self): - try: - if os.path.exists(self.args['dir']): - self.update() - else: - self.install() - with self.lock: - thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) - except PlugError as exc: - self.write(Action.ERROR, self.name, exc.msg) - except KeyboardInterrupt: - G_STOP.set() - self.write(Action.ERROR, self.name, ['Interrupted!']) - except: - # Any exception except those above print stack trace - msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) - self.write(Action.ERROR, self.name, msg.split('\n')) - raise - - def install(self): - target = self.args['dir'] - if target[-1] == '\\': - target = target[0:-1] - - def clean(target): - def _clean(): - try: - shutil.rmtree(target) - except OSError: - pass - return _clean - - self.write(Action.INSTALL, self.name, ['Installing ...']) - callback = functools.partial(self.write, Action.INSTALL, self.name) - cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( - '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], - esc(target)) - com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - - def repo_uri(self): - cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' - command = Command(cmd, self.args['dir'], G_TIMEOUT,) - result = command.execute(G_RETRIES) - return result[-1] - - def update(self): - actual_uri = self.repo_uri() - expect_uri = self.args['uri'] - regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') - ma = regex.match(actual_uri) - mb = regex.match(expect_uri) - if ma is None or mb is None or ma.groups() != mb.groups(): - msg = ['', - 'Invalid URI: {0}'.format(actual_uri), - 'Expected {0}'.format(expect_uri), - 'PlugClean required.'] - raise InvalidURI(msg) - - if G_PULL: - self.write(Action.UPDATE, self.name, ['Updating ...']) - callback = functools.partial(self.write, Action.UPDATE, self.name) - fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' - cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) - com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - else: - self.write(Action.DONE, self.name, ['Already installed']) - - def write(self, action, name, msg): - self.buf_q.put((action, name, msg)) - -class PlugThread(thr.Thread): - def __init__(self, tname, args): - super(PlugThread, self).__init__() - self.tname = tname - self.args = args - - def run(self): - thr.current_thread().name = self.tname - buf_q, work_q, lock = self.args - - try: - while not G_STOP.is_set(): - name, args = work_q.get_nowait() - plug = Plugin(name, args, buf_q, lock) - plug.manage() - work_q.task_done() - except queue.Empty: - pass - -class RefreshThread(thr.Thread): - def __init__(self, lock): - super(RefreshThread, self).__init__() - self.lock = lock - self.running = True - - def run(self): - while self.running: - with self.lock: - thread_vim_command('noautocmd normal! a') - time.sleep(0.33) - - def stop(self): - self.running = False - -if G_NVIM: - def thread_vim_command(cmd): - vim.session.threadsafe_call(lambda: vim.command(cmd)) -else: - def thread_vim_command(cmd): - vim.command(cmd) - -def esc(name): - return '"' + name.replace('"', '\"') + '"' - -def nonblock_read(fname): - """ Read a file with nonblock flag. Return the last line. """ - fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) - buf = os.read(fread, 100000).decode('utf-8', 'replace') - os.close(fread) - - line = buf.rstrip('\r\n') - left = max(line.rfind('\r'), line.rfind('\n')) - if left != -1: - left += 1 - line = line[left:] - - return line - -def main(): - thr.current_thread().name = 'main' - nthreads = int(vim.eval('s:update.threads')) - plugs = vim.eval('s:update.todo') - mac_gui = vim.eval('s:mac_gui') == '1' - - lock = thr.Lock() - buf = Buffer(lock, len(plugs), G_PULL) - buf_q, work_q = queue.Queue(), queue.Queue() - for work in plugs.items(): - work_q.put(work) - - start_cnt = thr.active_count() - for num in range(nthreads): - tname = 'PlugT-{0:02}'.format(num) - thread = PlugThread(tname, (buf_q, work_q, lock)) - thread.start() - if mac_gui: - rthread = RefreshThread(lock) - rthread.start() - - while not buf_q.empty() or thr.active_count() != start_cnt: - try: - action, name, msg = buf_q.get(True, 0.25) - buf.write(action, name, ['OK'] if not msg else msg) - buf_q.task_done() - except queue.Empty: - pass - except KeyboardInterrupt: - G_STOP.set() - - if mac_gui: - rthread.stop() - rthread.join() - -main() -EOF -endfunction - -function! s:update_ruby() - ruby << EOF - module PlugStream - SEP = ["\r", "\n", nil] - def get_line - buffer = '' - loop do - char = readchar rescue return - if SEP.include? char.chr - buffer << $/ - break - else - buffer << char - end - end - buffer - end - end unless defined?(PlugStream) - - def esc arg - %["#{arg.gsub('"', '\"')}"] - end - - def killall pid - pids = [pid] - if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM - pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } - else - unless `which pgrep 2> /dev/null`.empty? - children = pids - until children.empty? - children = children.map { |pid| - `pgrep -P #{pid}`.lines.map { |l| l.chomp } - }.flatten - pids += children - end - end - pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } - end - end - - def compare_git_uri a, b - regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} - regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) - end - - require 'thread' - require 'fileutils' - require 'timeout' - running = true - iswin = VIM::evaluate('s:is_win').to_i == 1 - pull = VIM::evaluate('s:update.pull').to_i == 1 - base = VIM::evaluate('g:plug_home') - all = VIM::evaluate('s:update.todo') - limit = VIM::evaluate('get(g:, "plug_timeout", 60)') - tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 - nthr = VIM::evaluate('s:update.threads').to_i - maxy = VIM::evaluate('winheight(".")').to_i - vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ - cd = iswin ? 'cd /d' : 'cd' - tot = VIM::evaluate('len(s:update.todo)') || 0 - bar = '' - skip = 'Already installed' - mtx = Mutex.new - take1 = proc { mtx.synchronize { running && all.shift } } - logh = proc { - cnt = bar.length - $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" - $curbuf[2] = '[' + bar.ljust(tot) + ']' - VIM::command('normal! 2G') - VIM::command('redraw') - } - where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } - log = proc { |name, result, type| - mtx.synchronize do - ing = ![true, false].include?(type) - bar += type ? '=' : 'x' unless ing - b = case type - when :install then '+' when :update then '*' - when true, nil then '-' else - VIM::command("call add(s:update.errors, '#{name}')") - 'x' - end - result = - if type || type.nil? - ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] - elsif result =~ /^Interrupted|^Timeout/ - ["#{b} #{name}: #{result}"] - else - ["#{b} #{name}"] + result.lines.map { |l| " " << l } - end - if lnum = where.call(name) - $curbuf.delete lnum - lnum = 4 if ing && lnum > maxy - end - result.each_with_index do |line, offset| - $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) - end - logh.call - end - } - bt = proc { |cmd, name, type, cleanup| - tried = timeout = 0 - begin - tried += 1 - timeout += limit - fd = nil - data = '' - if iswin - Timeout::timeout(timeout) do - tmp = VIM::evaluate('tempname()') - system("(#{cmd}) > #{tmp}") - data = File.read(tmp).chomp - File.unlink tmp rescue nil - end - else - fd = IO.popen(cmd).extend(PlugStream) - first_line = true - log_prob = 1.0 / nthr - while line = Timeout::timeout(timeout) { fd.get_line } - data << line - log.call name, line.chomp, type if name && (first_line || rand < log_prob) - first_line = false - end - fd.close - end - [$? == 0, data.chomp] - rescue Timeout::Error, Interrupt => e - if fd && !fd.closed? - killall fd.pid - fd.close - end - cleanup.call if cleanup - if e.is_a?(Timeout::Error) && tried < tries - 3.downto(1) do |countdown| - s = countdown > 1 ? 's' : '' - log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type - sleep 1 - end - log.call name, 'Retrying ...', type - retry - end - [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] - end - } - main = Thread.current - threads = [] - watcher = Thread.new { - if vim7 - while VIM::evaluate('getchar(1)') - sleep 0.1 - end - else - require 'io/console' # >= Ruby 1.9 - nil until IO.console.getch == 3.chr - end - mtx.synchronize do - running = false - threads.each { |t| t.raise Interrupt } unless vim7 - end - threads.each { |t| t.join rescue nil } - main.kill - } - refresh = Thread.new { - while true - mtx.synchronize do - break unless running - VIM::command('noautocmd normal! a') - end - sleep 0.2 - end - } if VIM::evaluate('s:mac_gui') == 1 - - clone_opt = VIM::evaluate('s:clone_opt').join(' ') - progress = VIM::evaluate('s:progress_opt(1)') - nthr.times do - mtx.synchronize do - threads << Thread.new { - while pair = take1.call - name = pair.first - dir, uri, tag = pair.last.values_at *%w[dir uri tag] - exists = File.directory? dir - ok, result = - if exists - chdir = "#{cd} #{iswin ? dir : esc(dir)}" - ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil - current_uri = data.lines.to_a.last - if !ret - if data =~ /^Interrupted|^Timeout/ - [false, data] - else - [false, [data.chomp, "PlugClean required."].join($/)] - end - elsif !compare_git_uri(current_uri, uri) - [false, ["Invalid URI: #{current_uri}", - "Expected: #{uri}", - "PlugClean required."].join($/)] - else - if pull - log.call name, 'Updating ...', :update - fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' - bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil - else - [true, skip] - end - end - else - d = esc dir.sub(%r{[\\/]+$}, '') - log.call name, 'Installing ...', :install - bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { - FileUtils.rm_rf dir - } - end - mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok - log.call name, result, ok - end - } if running - end - end - threads.each { |t| t.join rescue nil } - logh.call - refresh.kill if refresh - watcher.kill -EOF -endfunction - -function! s:shellesc_cmd(arg, script) - let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') - return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') -endfunction - -function! s:shellesc_ps1(arg) - return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" -endfunction - -function! s:shellesc_sh(arg) - return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" -endfunction - -" Escape the shell argument based on the shell. -" Vim and Neovim's shellescape() are insufficient. -" 1. shellslash determines whether to use single/double quotes. -" Double-quote escaping is fragile for cmd.exe. -" 2. It does not work for powershell. -" 3. It does not work for *sh shells if the command is executed -" via cmd.exe (ie. cmd.exe /c sh -c command command_args) -" 4. It does not support batchfile syntax. -" -" Accepts an optional dictionary with the following keys: -" - shell: same as Vim/Neovim 'shell' option. -" If unset, fallback to 'cmd.exe' on Windows or 'sh'. -" - script: If truthy and shell is cmd.exe, escape for batchfile syntax. -function! plug#shellescape(arg, ...) - if a:arg =~# '^[A-Za-z0-9_/:.-]\+$' - return a:arg - endif - let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {} - let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh') - let script = get(opts, 'script', 1) - if shell =~# 'cmd\.exe' - return s:shellesc_cmd(a:arg, script) - elseif shell =~# 'powershell\.exe' || shell =~# 'pwsh$' - return s:shellesc_ps1(a:arg) - endif - return s:shellesc_sh(a:arg) -endfunction - -function! s:glob_dir(path) - return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') -endfunction - -function! s:progress_bar(line, bar, total) - call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') -endfunction - -function! s:compare_git_uri(a, b) - " See `git help clone' - " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] - " [git@] github.com[:port] : junegunn/vim-plug [.git] - " file:// / junegunn/vim-plug [/] - " / junegunn/vim-plug [/] - let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' - let ma = matchlist(a:a, pat) - let mb = matchlist(a:b, pat) - return ma[1:2] ==# mb[1:2] -endfunction - -function! s:format_message(bullet, name, message) - if a:bullet != 'x' - return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] - else - let lines = map(s:lines(a:message), '" ".v:val') - return extend([printf('x %s:', a:name)], lines) - endif -endfunction - -function! s:with_cd(cmd, dir, ...) - let script = a:0 > 0 ? a:1 : 1 - return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) -endfunction - -function! s:system(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - if type(a:cmd) == s:TYPE.list - " Neovim's system() supports list argument to bypass the shell - " but it cannot set the working directory for the command. - " Assume that the command does not rely on the shell. - if has('nvim') && a:0 == 0 - return system(a:cmd) - endif - let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})')) - if &shell =~# 'powershell\.exe' - let cmd = '& ' . cmd - endif - else - let cmd = a:cmd - endif - if a:0 > 0 - let cmd = s:with_cd(cmd, a:1, type(a:cmd) != s:TYPE.list) - endif - if s:is_win && type(a:cmd) != s:TYPE.list - let [batchfile, cmd] = s:batchfile(cmd) - endif - return system(cmd) - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry -endfunction - -function! s:system_chomp(...) - let ret = call('s:system', a:000) - return v:shell_error ? '' : substitute(ret, '\n$', '', '') -endfunction - -function! s:git_validate(spec, check_branch) - let err = '' - if isdirectory(a:spec.dir) - let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir)) - let remote = result[-1] - if v:shell_error - let err = join([remote, 'PlugClean required.'], "\n") - elseif !s:compare_git_uri(remote, a:spec.uri) - let err = join(['Invalid URI: '.remote, - \ 'Expected: '.a:spec.uri, - \ 'PlugClean required.'], "\n") - elseif a:check_branch && has_key(a:spec, 'commit') - let result = s:lines(s:system('git rev-parse HEAD 2>&1', a:spec.dir)) - let sha = result[-1] - if v:shell_error - let err = join(add(result, 'PlugClean required.'), "\n") - elseif !s:hash_match(sha, a:spec.commit) - let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', - \ a:spec.commit[:6], sha[:6]), - \ 'PlugUpdate required.'], "\n") - endif - elseif a:check_branch - let branch = result[0] - " Check tag - if has_key(a:spec, 'tag') - let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) - if a:spec.tag !=# tag && a:spec.tag !~ '\*' - let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', - \ (empty(tag) ? 'N/A' : tag), a:spec.tag) - endif - " Check branch - elseif a:spec.branch !=# branch - let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', - \ branch, a:spec.branch) - endif - if empty(err) - let [ahead, behind] = split(s:lastline(s:system([ - \ 'git', 'rev-list', '--count', '--left-right', - \ printf('HEAD...origin/%s', a:spec.branch) - \ ], a:spec.dir)), '\t') - if !v:shell_error && ahead - if behind - " Only mention PlugClean if diverged, otherwise it's likely to be - " pushable (and probably not that messed up). - let err = printf( - \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" - \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind) - else - let err = printf("Ahead of origin/%s by %d commit(s).\n" - \ .'Cannot update until local changes are pushed.', - \ a:spec.branch, ahead) - endif - endif - endif - endif - else - let err = 'Not found' - endif - return [err, err =~# 'PlugClean'] -endfunction - -function! s:rm_rf(dir) - if isdirectory(a:dir) - call s:system(s:is_win - \ ? 'rmdir /S /Q '.plug#shellescape(a:dir) - \ : ['rm', '-rf', a:dir]) - endif -endfunction - -function! s:clean(force) - call s:prepare() - call append(0, 'Searching for invalid plugins in '.g:plug_home) - call append(1, '') - - " List of valid directories - let dirs = [] - let errs = {} - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - if !s:is_managed(name) - call add(dirs, spec.dir) - else - let [err, clean] = s:git_validate(spec, 1) - if clean - let errs[spec.dir] = s:lines(err)[0] - else - call add(dirs, spec.dir) - endif - endif - let cnt += 1 - call s:progress_bar(2, repeat('=', cnt), total) - normal! 2G - redraw - endfor - - let allowed = {} - for dir in dirs - let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 - let allowed[dir] = 1 - for child in s:glob_dir(dir) - let allowed[child] = 1 - endfor - endfor - - let todo = [] - let found = sort(s:glob_dir(g:plug_home)) - while !empty(found) - let f = remove(found, 0) - if !has_key(allowed, f) && isdirectory(f) - call add(todo, f) - call append(line('$'), '- ' . f) - if has_key(errs, f) - call append(line('$'), ' ' . errs[f]) - endif - let found = filter(found, 'stridx(v:val, f) != 0') - end - endwhile - - 4 - redraw - if empty(todo) - call append(line('$'), 'Already clean.') - else - let s:clean_count = 0 - call append(3, ['Directories to delete:', '']) - redraw! - if a:force || s:ask_no_interrupt('Delete all directories?') - call s:delete([6, line('$')], 1) - else - call setline(4, 'Cancelled.') - nnoremap d :set opfunc=delete_opg@ - nmap dd d_ - xnoremap d :call delete_op(visualmode(), 1) - echo 'Delete the lines (d{motion}) to delete the corresponding directories' - endif - endif - 4 - setlocal nomodifiable -endfunction - -function! s:delete_op(type, ...) - call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) -endfunction - -function! s:delete(range, force) - let [l1, l2] = a:range - let force = a:force - while l1 <= l2 - let line = getline(l1) - if line =~ '^- ' && isdirectory(line[2:]) - execute l1 - redraw! - let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) - let force = force || answer > 1 - if answer - call s:rm_rf(line[2:]) - setlocal modifiable - call setline(l1, '~'.line[1:]) - let s:clean_count += 1 - call setline(4, printf('Removed %d directories.', s:clean_count)) - setlocal nomodifiable - endif - endif - let l1 += 1 - endwhile -endfunction - -function! s:upgrade() - echo 'Downloading the latest version of vim-plug' - redraw - let tmp = s:plug_tempname() - let new = tmp . '/plug.vim' - - try - let out = s:system(['git', 'clone', '--depth', '1', s:plug_src, tmp]) - if v:shell_error - return s:err('Error upgrading vim-plug: '. out) - endif - - if readfile(s:me) ==# readfile(new) - echo 'vim-plug is already up-to-date' - return 0 - else - call rename(s:me, s:me . '.old') - call rename(new, s:me) - unlet g:loaded_plug - echo 'vim-plug has been upgraded' - return 1 - endif - finally - silent! call s:rm_rf(tmp) - endtry -endfunction - -function! s:upgrade_specs() - for spec in values(g:plugs) - let spec.frozen = get(spec, 'frozen', 0) - endfor -endfunction - -function! s:status() - call s:prepare() - call append(0, 'Checking plugins') - call append(1, '') - - let ecnt = 0 - let unloaded = 0 - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - let is_dir = isdirectory(spec.dir) - if has_key(spec, 'uri') - if is_dir - let [err, _] = s:git_validate(spec, 1) - let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] - else - let [valid, msg] = [0, 'Not found. Try PlugInstall.'] - endif - else - if is_dir - let [valid, msg] = [1, 'OK'] - else - let [valid, msg] = [0, 'Not found.'] - endif - endif - let cnt += 1 - let ecnt += !valid - " `s:loaded` entry can be missing if PlugUpgraded - if is_dir && get(s:loaded, name, -1) == 0 - let unloaded = 1 - let msg .= ' (not loaded)' - endif - call s:progress_bar(2, repeat('=', cnt), total) - call append(3, s:format_message(valid ? '-' : 'x', name, msg)) - normal! 2G - redraw - endfor - call setline(1, 'Finished. '.ecnt.' error(s).') - normal! gg - setlocal nomodifiable - if unloaded - echo "Press 'L' on each line to load plugin, or 'U' to update" - nnoremap L :call status_load(line('.')) - xnoremap L :call status_load(line('.')) - end -endfunction - -function! s:extract_name(str, prefix, suffix) - return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') -endfunction - -function! s:status_load(lnum) - let line = getline(a:lnum) - let name = s:extract_name(line, '-', '(not loaded)') - if !empty(name) - call plug#load(name) - setlocal modifiable - call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) - setlocal nomodifiable - endif -endfunction - -function! s:status_update() range - let lines = getline(a:firstline, a:lastline) - let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') - if !empty(names) - echo - execute 'PlugUpdate' join(names) - endif -endfunction - -function! s:is_preview_window_open() - silent! wincmd P - if &previewwindow - wincmd p - return 1 - endif -endfunction - -function! s:find_name(lnum) - for lnum in reverse(range(1, a:lnum)) - let line = getline(lnum) - if empty(line) - return '' - endif - let name = s:extract_name(line, '-', '') - if !empty(name) - return name - endif - endfor - return '' -endfunction - -function! s:preview_commit() - if b:plug_preview < 0 - let b:plug_preview = !s:is_preview_window_open() - endif - - let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') - if empty(sha) - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) - return - endif - - if exists('g:plug_pwindow') && !s:is_preview_window_open() - execute g:plug_pwindow - execute 'e' sha - else - execute 'pedit' sha - wincmd P - endif - setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - execute 'silent %!' cmd - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - setlocal nomodifiable - nnoremap q :q - wincmd p -endfunction - -function! s:section(flags) - call search('\(^[x-] \)\@<=[^:]\+:', a:flags) -endfunction - -function! s:format_git_log(line) - let indent = ' ' - let tokens = split(a:line, nr2char(1)) - if len(tokens) != 5 - return indent.substitute(a:line, '\s*$', '', '') - endif - let [graph, sha, refs, subject, date] = tokens - let tag = matchstr(refs, 'tag: [^,)]\+') - let tag = empty(tag) ? ' ' : ' ('.tag.') ' - return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) -endfunction - -function! s:append_ul(lnum, text) - call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) -endfunction - -function! s:diff() - call s:prepare() - call append(0, ['Collecting changes ...', '']) - let cnts = [0, 0] - let bar = '' - let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') - call s:progress_bar(2, bar, len(total)) - for origin in [1, 0] - let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) - if empty(plugs) - continue - endif - call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') - for [k, v] in plugs - let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..' - let cmd = ['git', 'log', '--graph', '--color=never'] - if s:git_version_requirement(2, 10, 0) - call add(cmd, '--no-show-signature') - endif - call extend(cmd, ['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range]) - if has_key(v, 'rtp') - call extend(cmd, ['--', v.rtp]) - endif - let diff = s:system_chomp(cmd, v.dir) - if !empty(diff) - let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' - call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) - let cnts[origin] += 1 - endif - let bar .= '=' - call s:progress_bar(2, bar, len(total)) - normal! 2G - redraw - endfor - if !cnts[origin] - call append(5, ['', 'N/A']) - endif - endfor - call setline(1, printf('%d plugin(s) updated.', cnts[0]) - \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) - - if cnts[0] || cnts[1] - nnoremap (plug-preview) :silent! call preview_commit() - if empty(maparg("\", 'n')) - nmap (plug-preview) - endif - if empty(maparg('o', 'n')) - nmap o (plug-preview) - endif - endif - if cnts[0] - nnoremap X :call revert() - echo "Press 'X' on each block to revert the update" - endif - normal! gg - setlocal nomodifiable -endfunction - -function! s:revert() - if search('^Pending updates', 'bnW') - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || - \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' - return - endif - - call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) - setlocal modifiable - normal! "_dap - setlocal nomodifiable - echo 'Reverted' -endfunction - -function! s:snapshot(force, ...) abort - call s:prepare() - setf vim - call append(0, ['" Generated by vim-plug', - \ '" '.strftime("%c"), - \ '" :source this file in vim to restore the snapshot', - \ '" or execute: vim -S snapshot.vim', - \ '', '', 'PlugUpdate!']) - 1 - let anchor = line('$') - 3 - let names = sort(keys(filter(copy(g:plugs), - \'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)'))) - for name in reverse(names) - let sha = s:system_chomp(['git', 'rev-parse', '--short', 'HEAD'], g:plugs[name].dir) - if !empty(sha) - call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) - redraw - endif - endfor - - if a:0 > 0 - let fn = s:plug_expand(a:1) - if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) - return - endif - call writefile(getline(1, '$'), fn) - echo 'Saved as '.a:1 - silent execute 'e' s:esc(fn) - setf vim - endif -endfunction - -function! s:split_rtp() - return split(&rtp, '\\\@`-mappings | -"| `for` | On-demand loading: File types | -"| `frozen` | Do not update unless explicitly specified | -" -" More information: https://github.com/junegunn/vim-plug -" -" -" Copyright (c) 2017 Junegunn Choi -" -" MIT License -" -" 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. - -if exists('g:loaded_plug') - finish -endif -let g:loaded_plug = 1 - -let s:cpo_save = &cpo -set cpo&vim - -let s:plug_src = 'https://github.com/junegunn/vim-plug.git' -let s:plug_tab = get(s:, 'plug_tab', -1) -let s:plug_buf = get(s:, 'plug_buf', -1) -let s:mac_gui = has('gui_macvim') && has('gui_running') -let s:is_win = has('win32') -let s:nvim = has('nvim-0.2') || (has('nvim') && exists('*jobwait') && !s:is_win) -let s:vim8 = has('patch-8.0.0039') && exists('*job_start') -if s:is_win && &shellslash - set noshellslash - let s:me = resolve(expand(':p')) - set shellslash -else - let s:me = resolve(expand(':p')) -endif -let s:base_spec = { 'branch': 'master', 'frozen': 0 } -let s:TYPE = { -\ 'string': type(''), -\ 'list': type([]), -\ 'dict': type({}), -\ 'funcref': type(function('call')) -\ } -let s:loaded = get(s:, 'loaded', {}) -let s:triggers = get(s:, 'triggers', {}) - -if s:is_win - function! s:plug_call(fn, ...) - let shellslash = &shellslash - try - set noshellslash - return call(a:fn, a:000) - finally - let &shellslash = shellslash - endtry - endfunction -else - function! s:plug_call(fn, ...) - return call(a:fn, a:000) - endfunction -endif - -function! s:plug_getcwd() - return s:plug_call('getcwd') -endfunction - -function! s:plug_fnamemodify(fname, mods) - return s:plug_call('fnamemodify', a:fname, a:mods) -endfunction - -function! s:plug_expand(fmt) - return s:plug_call('expand', a:fmt, 1) -endfunction - -function! s:plug_tempname() - return s:plug_call('tempname') -endfunction - -function! plug#begin(...) - if a:0 > 0 - let s:plug_home_org = a:1 - let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p')) - elseif exists('g:plug_home') - let home = s:path(g:plug_home) - elseif !empty(&rtp) - let home = s:path(split(&rtp, ',')[0]) . '/plugged' - else - return s:err('Unable to determine plug home. Try calling plug#begin() with a path argument.') - endif - if s:plug_fnamemodify(home, ':t') ==# 'plugin' && s:plug_fnamemodify(home, ':h') ==# s:first_rtp - return s:err('Invalid plug home. '.home.' is a standard Vim runtime path and is not allowed.') - endif - - let g:plug_home = home - let g:plugs = {} - let g:plugs_order = [] - let s:triggers = {} - - call s:define_commands() - return 1 -endfunction - -function! s:define_commands() - command! -nargs=+ -bar Plug call plug#() - if !executable('git') - return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') - endif - if has('win32') - \ && &shellslash - \ && (&shell =~# 'cmd\.exe' || &shell =~# 'powershell\.exe') - return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.') - endif - if !has('nvim') - \ && (has('win32') || has('win32unix')) - \ && !has('multi_byte') - return s:err('Vim needs +multi_byte feature on Windows to run shell commands. Enable +iconv for best results.') - endif - command! -nargs=* -bar -bang -complete=customlist,s:names PlugInstall call s:install(0, []) - command! -nargs=* -bar -bang -complete=customlist,s:names PlugUpdate call s:update(0, []) - command! -nargs=0 -bar -bang PlugClean call s:clean(0) - command! -nargs=0 -bar PlugUpgrade if s:upgrade() | execute 'source' s:esc(s:me) | endif - command! -nargs=0 -bar PlugStatus call s:status() - command! -nargs=0 -bar PlugDiff call s:diff() - command! -nargs=? -bar -bang -complete=file PlugSnapshot call s:snapshot(0, ) -endfunction - -function! s:to_a(v) - return type(a:v) == s:TYPE.list ? a:v : [a:v] -endfunction - -function! s:to_s(v) - return type(a:v) == s:TYPE.string ? a:v : join(a:v, "\n") . "\n" -endfunction - -function! s:glob(from, pattern) - return s:lines(globpath(a:from, a:pattern)) -endfunction - -function! s:source(from, ...) - let found = 0 - for pattern in a:000 - for vim in s:glob(a:from, pattern) - execute 'source' s:esc(vim) - let found = 1 - endfor - endfor - return found -endfunction - -function! s:assoc(dict, key, val) - let a:dict[a:key] = add(get(a:dict, a:key, []), a:val) -endfunction - -function! s:ask(message, ...) - call inputsave() - echohl WarningMsg - let answer = input(a:message.(a:0 ? ' (y/N/a) ' : ' (y/N) ')) - echohl None - call inputrestore() - echo "\r" - return (a:0 && answer =~? '^a') ? 2 : (answer =~? '^y') ? 1 : 0 -endfunction - -function! s:ask_no_interrupt(...) - try - return call('s:ask', a:000) - catch - return 0 - endtry -endfunction - -function! s:lazy(plug, opt) - return has_key(a:plug, a:opt) && - \ (empty(s:to_a(a:plug[a:opt])) || - \ !isdirectory(a:plug.dir) || - \ len(s:glob(s:rtp(a:plug), 'plugin')) || - \ len(s:glob(s:rtp(a:plug), 'after/plugin'))) -endfunction - -function! plug#end() - if !exists('g:plugs') - return s:err('plug#end() called without calling plug#begin() first') - endif - - if exists('#PlugLOD') - augroup PlugLOD - autocmd! - augroup END - augroup! PlugLOD - endif - let lod = { 'ft': {}, 'map': {}, 'cmd': {} } - - if exists('g:did_load_filetypes') - filetype off - endif - for name in g:plugs_order - if !has_key(g:plugs, name) - continue - endif - let plug = g:plugs[name] - if get(s:loaded, name, 0) || !s:lazy(plug, 'on') && !s:lazy(plug, 'for') - let s:loaded[name] = 1 - continue - endif - - if has_key(plug, 'on') - let s:triggers[name] = { 'map': [], 'cmd': [] } - for cmd in s:to_a(plug.on) - if cmd =~? '^.\+' - if empty(mapcheck(cmd)) && empty(mapcheck(cmd, 'i')) - call s:assoc(lod.map, cmd, name) - endif - call add(s:triggers[name].map, cmd) - elseif cmd =~# '^[A-Z]' - let cmd = substitute(cmd, '!*$', '', '') - if exists(':'.cmd) != 2 - call s:assoc(lod.cmd, cmd, name) - endif - call add(s:triggers[name].cmd, cmd) - else - call s:err('Invalid `on` option: '.cmd. - \ '. Should start with an uppercase letter or ``.') - endif - endfor - endif - - if has_key(plug, 'for') - let types = s:to_a(plug.for) - if !empty(types) - augroup filetypedetect - call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') - augroup END - endif - for type in types - call s:assoc(lod.ft, type, name) - endfor - endif - endfor - - for [cmd, names] in items(lod.cmd) - execute printf( - \ 'command! -nargs=* -range -bang -complete=file %s call s:lod_cmd(%s, "", , , , %s)', - \ cmd, string(cmd), string(names)) - endfor - - for [map, names] in items(lod.map) - for [mode, map_prefix, key_prefix] in - \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']] - execute printf( - \ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")', - \ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix) - endfor - endfor - - for [ft, names] in items(lod.ft) - augroup PlugLOD - execute printf('autocmd FileType %s call lod_ft(%s, %s)', - \ ft, string(ft), string(names)) - augroup END - endfor - - call s:reorg_rtp() - filetype plugin indent on - if has('vim_starting') - if has('syntax') && !exists('g:syntax_on') - syntax enable - end - else - call s:reload_plugins() - endif -endfunction - -function! s:loaded_names() - return filter(copy(g:plugs_order), 'get(s:loaded, v:val, 0)') -endfunction - -function! s:load_plugin(spec) - call s:source(s:rtp(a:spec), 'plugin/**/*.vim', 'after/plugin/**/*.vim') -endfunction - -function! s:reload_plugins() - for name in s:loaded_names() - call s:load_plugin(g:plugs[name]) - endfor -endfunction - -function! s:trim(str) - return substitute(a:str, '[\/]\+$', '', '') -endfunction - -function! s:version_requirement(val, min) - for idx in range(0, len(a:min) - 1) - let v = get(a:val, idx, 0) - if v < a:min[idx] | return 0 - elseif v > a:min[idx] | return 1 - endif - endfor - return 1 -endfunction - -function! s:git_version_requirement(...) - if !exists('s:git_version') - let s:git_version = map(split(split(s:system('git --version'))[2], '\.'), 'str2nr(v:val)') - endif - return s:version_requirement(s:git_version, a:000) -endfunction - -function! s:progress_opt(base) - return a:base && !s:is_win && - \ s:git_version_requirement(1, 7, 1) ? '--progress' : '' -endfunction - -function! s:rtp(spec) - return s:path(a:spec.dir . get(a:spec, 'rtp', '')) -endfunction - -if s:is_win - function! s:path(path) - return s:trim(substitute(a:path, '/', '\', 'g')) - endfunction - - function! s:dirpath(path) - return s:path(a:path) . '\' - endfunction - - function! s:is_local_plug(repo) - return a:repo =~? '^[a-z]:\|^[%~]' - endfunction - - " Copied from fzf - function! s:wrap_cmds(cmds) - let cmds = [ - \ '@echo off', - \ 'setlocal enabledelayedexpansion'] - \ + (type(a:cmds) == type([]) ? a:cmds : [a:cmds]) - \ + ['endlocal'] - if has('iconv') - if !exists('s:codepage') - let s:codepage = libcallnr('kernel32.dll', 'GetACP', 0) - endif - return map(cmds, printf('iconv(v:val."\r", "%s", "cp%d")', &encoding, s:codepage)) - endif - return map(cmds, 'v:val."\r"') - endfunction - - function! s:batchfile(cmd) - let batchfile = s:plug_tempname().'.bat' - call writefile(s:wrap_cmds(a:cmd), batchfile) - let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0}) - if &shell =~# 'powershell\.exe' - let cmd = '& ' . cmd - endif - return [batchfile, cmd] - endfunction -else - function! s:path(path) - return s:trim(a:path) - endfunction - - function! s:dirpath(path) - return substitute(a:path, '[/\\]*$', '/', '') - endfunction - - function! s:is_local_plug(repo) - return a:repo[0] =~ '[/$~]' - endfunction -endif - -function! s:err(msg) - echohl ErrorMsg - echom '[vim-plug] '.a:msg - echohl None -endfunction - -function! s:warn(cmd, msg) - echohl WarningMsg - execute a:cmd 'a:msg' - echohl None -endfunction - -function! s:esc(path) - return escape(a:path, ' ') -endfunction - -function! s:escrtp(path) - return escape(a:path, ' ,') -endfunction - -function! s:remove_rtp() - for name in s:loaded_names() - let rtp = s:rtp(g:plugs[name]) - execute 'set rtp-='.s:escrtp(rtp) - let after = globpath(rtp, 'after') - if isdirectory(after) - execute 'set rtp-='.s:escrtp(after) - endif - endfor -endfunction - -function! s:reorg_rtp() - if !empty(s:first_rtp) - execute 'set rtp-='.s:first_rtp - execute 'set rtp-='.s:last_rtp - endif - - " &rtp is modified from outside - if exists('s:prtp') && s:prtp !=# &rtp - call s:remove_rtp() - unlet! s:middle - endif - - let s:middle = get(s:, 'middle', &rtp) - let rtps = map(s:loaded_names(), 's:rtp(g:plugs[v:val])') - let afters = filter(map(copy(rtps), 'globpath(v:val, "after")'), '!empty(v:val)') - let rtp = join(map(rtps, 'escape(v:val, ",")'), ',') - \ . ','.s:middle.',' - \ . join(map(afters, 'escape(v:val, ",")'), ',') - let &rtp = substitute(substitute(rtp, ',,*', ',', 'g'), '^,\|,$', '', 'g') - let s:prtp = &rtp - - if !empty(s:first_rtp) - execute 'set rtp^='.s:first_rtp - execute 'set rtp+='.s:last_rtp - endif -endfunction - -function! s:doautocmd(...) - if exists('#'.join(a:000, '#')) - execute 'doautocmd' ((v:version > 703 || has('patch442')) ? '' : '') join(a:000) - endif -endfunction - -function! s:dobufread(names) - for name in a:names - let path = s:rtp(g:plugs[name]) - for dir in ['ftdetect', 'ftplugin', 'after/ftdetect', 'after/ftplugin'] - if len(finddir(dir, path)) - if exists('#BufRead') - doautocmd BufRead - endif - return - endif - endfor - endfor -endfunction - -function! plug#load(...) - if a:0 == 0 - return s:err('Argument missing: plugin name(s) required') - endif - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - let names = a:0 == 1 && type(a:1) == s:TYPE.list ? a:1 : a:000 - let unknowns = filter(copy(names), '!has_key(g:plugs, v:val)') - if !empty(unknowns) - let s = len(unknowns) > 1 ? 's' : '' - return s:err(printf('Unknown plugin%s: %s', s, join(unknowns, ', '))) - end - let unloaded = filter(copy(names), '!get(s:loaded, v:val, 0)') - if !empty(unloaded) - for name in unloaded - call s:lod([name], ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - endfor - call s:dobufread(unloaded) - return 1 - end - return 0 -endfunction - -function! s:remove_triggers(name) - if !has_key(s:triggers, a:name) - return - endif - for cmd in s:triggers[a:name].cmd - execute 'silent! delc' cmd - endfor - for map in s:triggers[a:name].map - execute 'silent! unmap' map - execute 'silent! iunmap' map - endfor - call remove(s:triggers, a:name) -endfunction - -function! s:lod(names, types, ...) - for name in a:names - call s:remove_triggers(name) - let s:loaded[name] = 1 - endfor - call s:reorg_rtp() - - for name in a:names - let rtp = s:rtp(g:plugs[name]) - for dir in a:types - call s:source(rtp, dir.'/**/*.vim') - endfor - if a:0 - if !s:source(rtp, a:1) && !empty(s:glob(rtp, a:2)) - execute 'runtime' a:1 - endif - call s:source(rtp, a:2) - endif - call s:doautocmd('User', name) - endfor -endfunction - -function! s:lod_ft(pat, names) - let syn = 'syntax/'.a:pat.'.vim' - call s:lod(a:names, ['plugin', 'after/plugin'], syn, 'after/'.syn) - execute 'autocmd! PlugLOD FileType' a:pat - call s:doautocmd('filetypeplugin', 'FileType') - call s:doautocmd('filetypeindent', 'FileType') -endfunction - -function! s:lod_cmd(cmd, bang, l1, l2, args, names) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - execute printf('%s%s%s %s', (a:l1 == a:l2 ? '' : (a:l1.','.a:l2)), a:cmd, a:bang, a:args) -endfunction - -function! s:lod_map(map, names, with_prefix, prefix) - call s:lod(a:names, ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin']) - call s:dobufread(a:names) - let extra = '' - while 1 - let c = getchar(0) - if c == 0 - break - endif - let extra .= nr2char(c) - endwhile - - if a:with_prefix - let prefix = v:count ? v:count : '' - let prefix .= '"'.v:register.a:prefix - if mode(1) == 'no' - if v:operator == 'c' - let prefix = "\" . prefix - endif - let prefix .= v:operator - endif - call feedkeys(prefix, 'n') - endif - call feedkeys(substitute(a:map, '^', "\", '') . extra) -endfunction - -function! plug#(repo, ...) - if a:0 > 1 - return s:err('Invalid number of arguments (1..2)') - endif - - try - let repo = s:trim(a:repo) - let opts = a:0 == 1 ? s:parse_options(a:1) : s:base_spec - let name = get(opts, 'as', s:plug_fnamemodify(repo, ':t:s?\.git$??')) - let spec = extend(s:infer_properties(name, repo), opts) - if !has_key(g:plugs, name) - call add(g:plugs_order, name) - endif - let g:plugs[name] = spec - let s:loaded[name] = get(s:loaded, name, 0) - catch - return s:err(v:exception) - endtry -endfunction - -function! s:parse_options(arg) - let opts = copy(s:base_spec) - let type = type(a:arg) - if type == s:TYPE.string - let opts.tag = a:arg - elseif type == s:TYPE.dict - call extend(opts, a:arg) - if has_key(opts, 'dir') - let opts.dir = s:dirpath(s:plug_expand(opts.dir)) - endif - else - throw 'Invalid argument type (expected: string or dictionary)' - endif - return opts -endfunction - -function! s:infer_properties(name, repo) - let repo = a:repo - if s:is_local_plug(repo) - return { 'dir': s:dirpath(s:plug_expand(repo)) } - else - if repo =~ ':' - let uri = repo - else - if repo !~ '/' - throw printf('Invalid argument: %s (implicit `vim-scripts'' expansion is deprecated)', repo) - endif - let fmt = get(g:, 'plug_url_format', 'https://git::@github.com/%s.git') - let uri = printf(fmt, repo) - endif - return { 'dir': s:dirpath(g:plug_home.'/'.a:name), 'uri': uri } - endif -endfunction - -function! s:install(force, names) - call s:update_impl(0, a:force, a:names) -endfunction - -function! s:update(force, names) - call s:update_impl(1, a:force, a:names) -endfunction - -function! plug#helptags() - if !exists('g:plugs') - return s:err('plug#begin was not called') - endif - for spec in values(g:plugs) - let docd = join([s:rtp(spec), 'doc'], '/') - if isdirectory(docd) - silent! execute 'helptags' s:esc(docd) - endif - endfor - return 1 -endfunction - -function! s:syntax() - syntax clear - syntax region plug1 start=/\%1l/ end=/\%2l/ contains=plugNumber - syntax region plug2 start=/\%2l/ end=/\%3l/ contains=plugBracket,plugX - syn match plugNumber /[0-9]\+[0-9.]*/ contained - syn match plugBracket /[[\]]/ contained - syn match plugX /x/ contained - syn match plugDash /^-/ - syn match plugPlus /^+/ - syn match plugStar /^*/ - syn match plugMessage /\(^- \)\@<=.*/ - syn match plugName /\(^- \)\@<=[^ ]*:/ - syn match plugSha /\%(: \)\@<=[0-9a-f]\{4,}$/ - syn match plugTag /(tag: [^)]\+)/ - syn match plugInstall /\(^+ \)\@<=[^:]*/ - syn match plugUpdate /\(^* \)\@<=[^:]*/ - syn match plugCommit /^ \X*[0-9a-f]\{7,9} .*/ contains=plugRelDate,plugEdge,plugTag - syn match plugEdge /^ \X\+$/ - syn match plugEdge /^ \X*/ contained nextgroup=plugSha - syn match plugSha /[0-9a-f]\{7,9}/ contained - syn match plugRelDate /([^)]*)$/ contained - syn match plugNotLoaded /(not loaded)$/ - syn match plugError /^x.*/ - syn region plugDeleted start=/^\~ .*/ end=/^\ze\S/ - syn match plugH2 /^.*:\n-\+$/ - syn keyword Function PlugInstall PlugStatus PlugUpdate PlugClean - hi def link plug1 Title - hi def link plug2 Repeat - hi def link plugH2 Type - hi def link plugX Exception - hi def link plugBracket Structure - hi def link plugNumber Number - - hi def link plugDash Special - hi def link plugPlus Constant - hi def link plugStar Boolean - - hi def link plugMessage Function - hi def link plugName Label - hi def link plugInstall Function - hi def link plugUpdate Type - - hi def link plugError Error - hi def link plugDeleted Ignore - hi def link plugRelDate Comment - hi def link plugEdge PreProc - hi def link plugSha Identifier - hi def link plugTag Constant - - hi def link plugNotLoaded Comment -endfunction - -function! s:lpad(str, len) - return a:str . repeat(' ', a:len - len(a:str)) -endfunction - -function! s:lines(msg) - return split(a:msg, "[\r\n]") -endfunction - -function! s:lastline(msg) - return get(s:lines(a:msg), -1, '') -endfunction - -function! s:new_window() - execute get(g:, 'plug_window', 'vertical topleft new') -endfunction - -function! s:plug_window_exists() - let buflist = tabpagebuflist(s:plug_tab) - return !empty(buflist) && index(buflist, s:plug_buf) >= 0 -endfunction - -function! s:switch_in() - if !s:plug_window_exists() - return 0 - endif - - if winbufnr(0) != s:plug_buf - let s:pos = [tabpagenr(), winnr(), winsaveview()] - execute 'normal!' s:plug_tab.'gt' - let winnr = bufwinnr(s:plug_buf) - execute winnr.'wincmd w' - call add(s:pos, winsaveview()) - else - let s:pos = [winsaveview()] - endif - - setlocal modifiable - return 1 -endfunction - -function! s:switch_out(...) - call winrestview(s:pos[-1]) - setlocal nomodifiable - if a:0 > 0 - execute a:1 - endif - - if len(s:pos) > 1 - execute 'normal!' s:pos[0].'gt' - execute s:pos[1] 'wincmd w' - call winrestview(s:pos[2]) - endif -endfunction - -function! s:finish_bindings() - nnoremap R :call retry() - nnoremap D :PlugDiff - nnoremap S :PlugStatus - nnoremap U :call status_update() - xnoremap U :call status_update() - nnoremap ]] :silent! call section('') - nnoremap [[ :silent! call section('b') -endfunction - -function! s:prepare(...) - if empty(s:plug_getcwd()) - throw 'Invalid current working directory. Cannot proceed.' - endif - - for evar in ['$GIT_DIR', '$GIT_WORK_TREE'] - if exists(evar) - throw evar.' detected. Cannot proceed.' - endif - endfor - - call s:job_abort() - if s:switch_in() - if b:plug_preview == 1 - pc - endif - enew - else - call s:new_window() - endif - - nnoremap q :if b:plug_preview==1pcendifbd - if a:0 == 0 - call s:finish_bindings() - endif - let b:plug_preview = -1 - let s:plug_tab = tabpagenr() - let s:plug_buf = winbufnr(0) - call s:assign_name() - - for k in ['', 'L', 'o', 'X', 'd', 'dd'] - execute 'silent! unmap ' k - endfor - setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline modifiable nospell - if exists('+colorcolumn') - setlocal colorcolumn= - endif - setf vim-plug - if exists('g:syntax_on') - call s:syntax() - endif -endfunction - -function! s:assign_name() - " Assign buffer name - let prefix = '[Plugins]' - let name = prefix - let idx = 2 - while bufexists(name) - let name = printf('%s (%s)', prefix, idx) - let idx = idx + 1 - endwhile - silent! execute 'f' fnameescape(name) -endfunction - -function! s:chsh(swap) - let prev = [&shell, &shellcmdflag, &shellredir] - if !s:is_win && a:swap - set shell=sh shellredir=>%s\ 2>&1 - endif - return prev -endfunction - -function! s:bang(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(a:0) - " FIXME: Escaping is incomplete. We could use shellescape with eval, - " but it won't work on Windows. - let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%') - execute "normal! :execute g:_plug_bang\\" - finally - unlet g:_plug_bang - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - return v:shell_error ? 'Exit status: ' . v:shell_error : '' -endfunction - -function! s:regress_bar() - let bar = substitute(getline(2)[1:-2], '.*\zs=', 'x', '') - call s:progress_bar(2, bar, len(bar)) -endfunction - -function! s:is_updated(dir) - return !empty(s:system_chomp('git log --pretty=format:"%h" "HEAD...HEAD@{1}"', a:dir)) -endfunction - -function! s:do(pull, force, todo) - for [name, spec] in items(a:todo) - if !isdirectory(spec.dir) - continue - endif - let installed = has_key(s:update.new, name) - let updated = installed ? 0 : - \ (a:pull && index(s:update.errors, name) < 0 && s:is_updated(spec.dir)) - if a:force || installed || updated - execute 'cd' s:esc(spec.dir) - call append(3, '- Post-update hook for '. name .' ... ') - let error = '' - let type = type(spec.do) - if type == s:TYPE.string - if spec.do[0] == ':' - if !get(s:loaded, name, 0) - let s:loaded[name] = 1 - call s:reorg_rtp() - endif - call s:load_plugin(spec) - try - execute spec.do[1:] - catch - let error = v:exception - endtry - if !s:plug_window_exists() - cd - - throw 'Warning: vim-plug was terminated by the post-update hook of '.name - endif - else - let error = s:bang(spec.do) - endif - elseif type == s:TYPE.funcref - try - let status = installed ? 'installed' : (updated ? 'updated' : 'unchanged') - call spec.do({ 'name': name, 'status': status, 'force': a:force }) - catch - let error = v:exception - endtry - else - let error = 'Invalid hook type' - endif - call s:switch_in() - call setline(4, empty(error) ? (getline(4) . 'OK') - \ : ('x' . getline(4)[1:] . error)) - if !empty(error) - call add(s:update.errors, name) - call s:regress_bar() - endif - cd - - endif - endfor -endfunction - -function! s:hash_match(a, b) - return stridx(a:a, a:b) == 0 || stridx(a:b, a:a) == 0 -endfunction - -function! s:checkout(spec) - let sha = a:spec.commit - let output = s:system('git rev-parse HEAD', a:spec.dir) - if !v:shell_error && !s:hash_match(sha, s:lines(output)[0]) - let output = s:system( - \ 'git fetch --depth 999999 && git checkout '.plug#shellescape(sha).' --', a:spec.dir) - endif - return output -endfunction - -function! s:finish(pull) - let new_frozen = len(filter(keys(s:update.new), 'g:plugs[v:val].frozen')) - if new_frozen - let s = new_frozen > 1 ? 's' : '' - call append(3, printf('- Installed %d frozen plugin%s', new_frozen, s)) - endif - call append(3, '- Finishing ... ') | 4 - redraw - call plug#helptags() - call plug#end() - call setline(4, getline(4) . 'Done!') - redraw - let msgs = [] - if !empty(s:update.errors) - call add(msgs, "Press 'R' to retry.") - endif - if a:pull && len(s:update.new) < len(filter(getline(5, '$'), - \ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'")) - call add(msgs, "Press 'D' to see the updated changes.") - endif - echo join(msgs, ' ') - call s:finish_bindings() -endfunction - -function! s:retry() - if empty(s:update.errors) - return - endif - echo - call s:update_impl(s:update.pull, s:update.force, - \ extend(copy(s:update.errors), [s:update.threads])) -endfunction - -function! s:is_managed(name) - return has_key(g:plugs[a:name], 'uri') -endfunction - -function! s:names(...) - return sort(filter(keys(g:plugs), 'stridx(v:val, a:1) == 0 && s:is_managed(v:val)')) -endfunction - -function! s:check_ruby() - silent! ruby require 'thread'; VIM::command("let g:plug_ruby = '#{RUBY_VERSION}'") - if !exists('g:plug_ruby') - redraw! - return s:warn('echom', 'Warning: Ruby interface is broken') - endif - let ruby_version = split(g:plug_ruby, '\.') - unlet g:plug_ruby - return s:version_requirement(ruby_version, [1, 8, 7]) -endfunction - -function! s:update_impl(pull, force, args) abort - let sync = index(a:args, '--sync') >= 0 || has('vim_starting') - let args = filter(copy(a:args), 'v:val != "--sync"') - let threads = (len(args) > 0 && args[-1] =~ '^[1-9][0-9]*$') ? - \ remove(args, -1) : get(g:, 'plug_threads', 16) - - let managed = filter(copy(g:plugs), 's:is_managed(v:key)') - let todo = empty(args) ? filter(managed, '!v:val.frozen || !isdirectory(v:val.dir)') : - \ filter(managed, 'index(args, v:key) >= 0') - - if empty(todo) - return s:warn('echo', 'No plugin to '. (a:pull ? 'update' : 'install')) - endif - - if !s:is_win && s:git_version_requirement(2, 3) - let s:git_terminal_prompt = exists('$GIT_TERMINAL_PROMPT') ? $GIT_TERMINAL_PROMPT : '' - let $GIT_TERMINAL_PROMPT = 0 - for plug in values(todo) - let plug.uri = substitute(plug.uri, - \ '^https://git::@github\.com', 'https://github.com', '') - endfor - endif - - if !isdirectory(g:plug_home) - try - call mkdir(g:plug_home, 'p') - catch - return s:err(printf('Invalid plug directory: %s. '. - \ 'Try to call plug#begin with a valid directory', g:plug_home)) - endtry - endif - - if has('nvim') && !exists('*jobwait') && threads > 1 - call s:warn('echom', '[vim-plug] Update Neovim for parallel installer') - endif - - let use_job = s:nvim || s:vim8 - let python = (has('python') || has('python3')) && !use_job - let ruby = has('ruby') && !use_job && (v:version >= 703 || v:version == 702 && has('patch374')) && !(s:is_win && has('gui_running')) && threads > 1 && s:check_ruby() - - let s:update = { - \ 'start': reltime(), - \ 'all': todo, - \ 'todo': copy(todo), - \ 'errors': [], - \ 'pull': a:pull, - \ 'force': a:force, - \ 'new': {}, - \ 'threads': (python || ruby || use_job) ? min([len(todo), threads]) : 1, - \ 'bar': '', - \ 'fin': 0 - \ } - - call s:prepare(1) - call append(0, ['', '']) - normal! 2G - silent! redraw - - let s:clone_opt = get(g:, 'plug_shallow', 1) ? - \ '--depth 1' . (s:git_version_requirement(1, 7, 10) ? ' --no-single-branch' : '') : '' - - if has('win32unix') || has('wsl') - let s:clone_opt .= ' -c core.eol=lf -c core.autocrlf=input' - endif - - let s:submodule_opt = s:git_version_requirement(2, 8) ? ' --jobs='.threads : '' - - " Python version requirement (>= 2.7) - if python && !has('python3') && !ruby && !use_job && s:update.threads > 1 - redir => pyv - silent python import platform; print platform.python_version() - redir END - let python = s:version_requirement( - \ map(split(split(pyv)[0], '\.'), 'str2nr(v:val)'), [2, 6]) - endif - - if (python || ruby) && s:update.threads > 1 - try - let imd = &imd - if s:mac_gui - set noimd - endif - if ruby - call s:update_ruby() - else - call s:update_python() - endif - catch - let lines = getline(4, '$') - let printed = {} - silent! 4,$d _ - for line in lines - let name = s:extract_name(line, '.', '') - if empty(name) || !has_key(printed, name) - call append('$', line) - if !empty(name) - let printed[name] = 1 - if line[0] == 'x' && index(s:update.errors, name) < 0 - call add(s:update.errors, name) - end - endif - endif - endfor - finally - let &imd = imd - call s:update_finish() - endtry - else - call s:update_vim() - while use_job && sync - sleep 100m - if s:update.fin - break - endif - endwhile - endif -endfunction - -function! s:log4(name, msg) - call setline(4, printf('- %s (%s)', a:msg, a:name)) - redraw -endfunction - -function! s:update_finish() - if exists('s:git_terminal_prompt') - let $GIT_TERMINAL_PROMPT = s:git_terminal_prompt - endif - if s:switch_in() - call append(3, '- Updating ...') | 4 - for [name, spec] in items(filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && (s:update.force || s:update.pull || has_key(s:update.new, v:key))')) - let [pos, _] = s:logpos(name) - if !pos - continue - endif - if has_key(spec, 'commit') - call s:log4(name, 'Checking out '.spec.commit) - let out = s:checkout(spec) - elseif has_key(spec, 'tag') - let tag = spec.tag - if tag =~ '\*' - let tags = s:lines(s:system('git tag --list '.plug#shellescape(tag).' --sort -version:refname 2>&1', spec.dir)) - if !v:shell_error && !empty(tags) - let tag = tags[0] - call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag)) - call append(3, '') - endif - endif - call s:log4(name, 'Checking out '.tag) - let out = s:system('git checkout -q '.plug#shellescape(tag).' -- 2>&1', spec.dir) - else - let branch = get(spec, 'branch', 'master') - call s:log4(name, 'Merging origin/'.s:esc(branch)) - let out = s:system('git checkout -q '.plug#shellescape(branch).' -- 2>&1' - \. (has_key(s:update.new, name) ? '' : ('&& git merge --ff-only '.plug#shellescape('origin/'.branch).' 2>&1')), spec.dir) - endif - if !v:shell_error && filereadable(spec.dir.'/.gitmodules') && - \ (s:update.force || has_key(s:update.new, name) || s:is_updated(spec.dir)) - call s:log4(name, 'Updating submodules. This may take a while.') - let out .= s:bang('git submodule update --init --recursive'.s:submodule_opt.' 2>&1', spec.dir) - endif - let msg = s:format_message(v:shell_error ? 'x': '-', name, out) - if v:shell_error - call add(s:update.errors, name) - call s:regress_bar() - silent execute pos 'd _' - call append(4, msg) | 4 - elseif !empty(out) - call setline(pos, msg[0]) - endif - redraw - endfor - silent 4 d _ - try - call s:do(s:update.pull, s:update.force, filter(copy(s:update.all), 'index(s:update.errors, v:key) < 0 && has_key(v:val, "do")')) - catch - call s:warn('echom', v:exception) - call s:warn('echo', '') - return - endtry - call s:finish(s:update.pull) - call setline(1, 'Updated. Elapsed time: ' . split(reltimestr(reltime(s:update.start)))[0] . ' sec.') - call s:switch_out('normal! gg') - endif -endfunction - -function! s:job_abort() - if (!s:nvim && !s:vim8) || !exists('s:jobs') - return - endif - - for [name, j] in items(s:jobs) - if s:nvim - silent! call jobstop(j.jobid) - elseif s:vim8 - silent! call job_stop(j.jobid) - endif - if j.new - call s:rm_rf(g:plugs[name].dir) - endif - endfor - let s:jobs = {} -endfunction - -function! s:last_non_empty_line(lines) - let len = len(a:lines) - for idx in range(len) - let line = a:lines[len-idx-1] - if !empty(line) - return line - endif - endfor - return '' -endfunction - -function! s:job_out_cb(self, data) abort - let self = a:self - let data = remove(self.lines, -1) . a:data - let lines = map(split(data, "\n", 1), 'split(v:val, "\r", 1)[-1]') - call extend(self.lines, lines) - " To reduce the number of buffer updates - let self.tick = get(self, 'tick', -1) + 1 - if !self.running || self.tick % len(s:jobs) == 0 - let bullet = self.running ? (self.new ? '+' : '*') : (self.error ? 'x' : '-') - let result = self.error ? join(self.lines, "\n") : s:last_non_empty_line(self.lines) - call s:log(bullet, self.name, result) - endif -endfunction - -function! s:job_exit_cb(self, data) abort - let a:self.running = 0 - let a:self.error = a:data != 0 - call s:reap(a:self.name) - call s:tick() -endfunction - -function! s:job_cb(fn, job, ch, data) - if !s:plug_window_exists() " plug window closed - return s:job_abort() - endif - call call(a:fn, [a:job, a:data]) -endfunction - -function! s:nvim_cb(job_id, data, event) dict abort - return a:event == 'stdout' ? - \ s:job_cb('s:job_out_cb', self, 0, join(a:data, "\n")) : - \ s:job_cb('s:job_exit_cb', self, 0, a:data) -endfunction - -function! s:spawn(name, cmd, opts) - let job = { 'name': a:name, 'running': 1, 'error': 0, 'lines': [''], - \ 'new': get(a:opts, 'new', 0) } - let s:jobs[a:name] = job - let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir, 0) : a:cmd - let argv = s:is_win ? ['cmd', '/s', '/c', '"'.cmd.'"'] : ['sh', '-c', cmd] - - if s:nvim - call extend(job, { - \ 'on_stdout': function('s:nvim_cb'), - \ 'on_exit': function('s:nvim_cb'), - \ }) - let jid = s:plug_call('jobstart', argv, job) - if jid > 0 - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = [jid < 0 ? argv[0].' is not executable' : - \ 'Invalid arguments (or job table is full)'] - endif - elseif s:vim8 - let jid = job_start(s:is_win ? join(argv, ' ') : argv, { - \ 'out_cb': function('s:job_cb', ['s:job_out_cb', job]), - \ 'exit_cb': function('s:job_cb', ['s:job_exit_cb', job]), - \ 'out_mode': 'raw' - \}) - if job_status(jid) == 'run' - let job.jobid = jid - else - let job.running = 0 - let job.error = 1 - let job.lines = ['Failed to start job'] - endif - else - let job.lines = s:lines(call('s:system', [cmd])) - let job.error = v:shell_error != 0 - let job.running = 0 - endif -endfunction - -function! s:reap(name) - let job = s:jobs[a:name] - if job.error - call add(s:update.errors, a:name) - elseif get(job, 'new', 0) - let s:update.new[a:name] = 1 - endif - let s:update.bar .= job.error ? 'x' : '=' - - let bullet = job.error ? 'x' : '-' - let result = job.error ? join(job.lines, "\n") : s:last_non_empty_line(job.lines) - call s:log(bullet, a:name, empty(result) ? 'OK' : result) - call s:bar() - - call remove(s:jobs, a:name) -endfunction - -function! s:bar() - if s:switch_in() - let total = len(s:update.all) - call setline(1, (s:update.pull ? 'Updating' : 'Installing'). - \ ' plugins ('.len(s:update.bar).'/'.total.')') - call s:progress_bar(2, s:update.bar, total) - call s:switch_out() - endif -endfunction - -function! s:logpos(name) - let max = line('$') - for i in range(4, max > 4 ? max : 4) - if getline(i) =~# '^[-+x*] '.a:name.':' - for j in range(i + 1, max > 5 ? max : 5) - if getline(j) !~ '^ ' - return [i, j - 1] - endif - endfor - return [i, i] - endif - endfor - return [0, 0] -endfunction - -function! s:log(bullet, name, lines) - if s:switch_in() - let [b, e] = s:logpos(a:name) - if b > 0 - silent execute printf('%d,%d d _', b, e) - if b > winheight('.') - let b = 4 - endif - else - let b = 4 - endif - " FIXME For some reason, nomodifiable is set after :d in vim8 - setlocal modifiable - call append(b - 1, s:format_message(a:bullet, a:name, a:lines)) - call s:switch_out() - endif -endfunction - -function! s:update_vim() - let s:jobs = {} - - call s:bar() - call s:tick() -endfunction - -function! s:tick() - let pull = s:update.pull - let prog = s:progress_opt(s:nvim || s:vim8) -while 1 " Without TCO, Vim stack is bound to explode - if empty(s:update.todo) - if empty(s:jobs) && !s:update.fin - call s:update_finish() - let s:update.fin = 1 - endif - return - endif - - let name = keys(s:update.todo)[0] - let spec = remove(s:update.todo, name) - let new = empty(globpath(spec.dir, '.git', 1)) - - call s:log(new ? '+' : '*', name, pull ? 'Updating ...' : 'Installing ...') - redraw - - let has_tag = has_key(spec, 'tag') - if !new - let [error, _] = s:git_validate(spec, 0) - if empty(error) - if pull - let fetch_opt = (has_tag && !empty(globpath(spec.dir, '.git/shallow'))) ? '--depth 99999999' : '' - call s:spawn(name, printf('git fetch %s %s 2>&1', fetch_opt, prog), { 'dir': spec.dir }) - else - let s:jobs[name] = { 'running': 0, 'lines': ['Already installed'], 'error': 0 } - endif - else - let s:jobs[name] = { 'running': 0, 'lines': s:lines(error), 'error': 1 } - endif - else - call s:spawn(name, - \ printf('git clone %s %s %s %s 2>&1', - \ has_tag ? '' : s:clone_opt, - \ prog, - \ plug#shellescape(spec.uri, {'script': 0}), - \ plug#shellescape(s:trim(spec.dir), {'script': 0})), { 'new': 1 }) - endif - - if !s:jobs[name].running - call s:reap(name) - endif - if len(s:jobs) >= s:update.threads - break - endif -endwhile -endfunction - -function! s:update_python() -let py_exe = has('python') ? 'python' : 'python3' -execute py_exe "<< EOF" -import datetime -import functools -import os -try: - import queue -except ImportError: - import Queue as queue -import random -import re -import shutil -import signal -import subprocess -import tempfile -import threading as thr -import time -import traceback -import vim - -G_NVIM = vim.eval("has('nvim')") == '1' -G_PULL = vim.eval('s:update.pull') == '1' -G_RETRIES = int(vim.eval('get(g:, "plug_retries", 2)')) + 1 -G_TIMEOUT = int(vim.eval('get(g:, "plug_timeout", 60)')) -G_CLONE_OPT = vim.eval('s:clone_opt') -G_PROGRESS = vim.eval('s:progress_opt(1)') -G_LOG_PROB = 1.0 / int(vim.eval('s:update.threads')) -G_STOP = thr.Event() -G_IS_WIN = vim.eval('s:is_win') == '1' - -class PlugError(Exception): - def __init__(self, msg): - self.msg = msg -class CmdTimedOut(PlugError): - pass -class CmdFailed(PlugError): - pass -class InvalidURI(PlugError): - pass -class Action(object): - INSTALL, UPDATE, ERROR, DONE = ['+', '*', 'x', '-'] - -class Buffer(object): - def __init__(self, lock, num_plugs, is_pull): - self.bar = '' - self.event = 'Updating' if is_pull else 'Installing' - self.lock = lock - self.maxy = int(vim.eval('winheight(".")')) - self.num_plugs = num_plugs - - def __where(self, name): - """ Find first line with name in current buffer. Return line num. """ - found, lnum = False, 0 - matcher = re.compile('^[-+x*] {0}:'.format(name)) - for line in vim.current.buffer: - if matcher.search(line) is not None: - found = True - break - lnum += 1 - - if not found: - lnum = -1 - return lnum - - def header(self): - curbuf = vim.current.buffer - curbuf[0] = self.event + ' plugins ({0}/{1})'.format(len(self.bar), self.num_plugs) - - num_spaces = self.num_plugs - len(self.bar) - curbuf[1] = '[{0}{1}]'.format(self.bar, num_spaces * ' ') - - with self.lock: - vim.command('normal! 2G') - vim.command('redraw') - - def write(self, action, name, lines): - first, rest = lines[0], lines[1:] - msg = ['{0} {1}{2}{3}'.format(action, name, ': ' if first else '', first)] - msg.extend([' ' + line for line in rest]) - - try: - if action == Action.ERROR: - self.bar += 'x' - vim.command("call add(s:update.errors, '{0}')".format(name)) - elif action == Action.DONE: - self.bar += '=' - - curbuf = vim.current.buffer - lnum = self.__where(name) - if lnum != -1: # Found matching line num - del curbuf[lnum] - if lnum > self.maxy and action in set([Action.INSTALL, Action.UPDATE]): - lnum = 3 - else: - lnum = 3 - curbuf.append(msg, lnum) - - self.header() - except vim.error: - pass - -class Command(object): - CD = 'cd /d' if G_IS_WIN else 'cd' - - def __init__(self, cmd, cmd_dir=None, timeout=60, cb=None, clean=None): - self.cmd = cmd - if cmd_dir: - self.cmd = '{0} {1} && {2}'.format(Command.CD, cmd_dir, self.cmd) - self.timeout = timeout - self.callback = cb if cb else (lambda msg: None) - self.clean = clean if clean else (lambda: None) - self.proc = None - - @property - def alive(self): - """ Returns true only if command still running. """ - return self.proc and self.proc.poll() is None - - def execute(self, ntries=3): - """ Execute the command with ntries if CmdTimedOut. - Returns the output of the command if no Exception. - """ - attempt, finished, limit = 0, False, self.timeout - - while not finished: - try: - attempt += 1 - result = self.try_command() - finished = True - return result - except CmdTimedOut: - if attempt != ntries: - self.notify_retry() - self.timeout += limit - else: - raise - - def notify_retry(self): - """ Retry required for command, notify user. """ - for count in range(3, 0, -1): - if G_STOP.is_set(): - raise KeyboardInterrupt - msg = 'Timeout. Will retry in {0} second{1} ...'.format( - count, 's' if count != 1 else '') - self.callback([msg]) - time.sleep(1) - self.callback(['Retrying ...']) - - def try_command(self): - """ Execute a cmd & poll for callback. Returns list of output. - Raises CmdFailed -> return code for Popen isn't 0 - Raises CmdTimedOut -> command exceeded timeout without new output - """ - first_line = True - - try: - tfile = tempfile.NamedTemporaryFile(mode='w+b') - preexec_fn = not G_IS_WIN and os.setsid or None - self.proc = subprocess.Popen(self.cmd, stdout=tfile, - stderr=subprocess.STDOUT, - stdin=subprocess.PIPE, shell=True, - preexec_fn=preexec_fn) - thrd = thr.Thread(target=(lambda proc: proc.wait()), args=(self.proc,)) - thrd.start() - - thread_not_started = True - while thread_not_started: - try: - thrd.join(0.1) - thread_not_started = False - except RuntimeError: - pass - - while self.alive: - if G_STOP.is_set(): - raise KeyboardInterrupt - - if first_line or random.random() < G_LOG_PROB: - first_line = False - line = '' if G_IS_WIN else nonblock_read(tfile.name) - if line: - self.callback([line]) - - time_diff = time.time() - os.path.getmtime(tfile.name) - if time_diff > self.timeout: - raise CmdTimedOut(['Timeout!']) - - thrd.join(0.5) - - tfile.seek(0) - result = [line.decode('utf-8', 'replace').rstrip() for line in tfile] - - if self.proc.returncode != 0: - raise CmdFailed([''] + result) - - return result - except: - self.terminate() - raise - - def terminate(self): - """ Terminate process and cleanup. """ - if self.alive: - if G_IS_WIN: - os.kill(self.proc.pid, signal.SIGINT) - else: - os.killpg(self.proc.pid, signal.SIGTERM) - self.clean() - -class Plugin(object): - def __init__(self, name, args, buf_q, lock): - self.name = name - self.args = args - self.buf_q = buf_q - self.lock = lock - self.tag = args.get('tag', 0) - - def manage(self): - try: - if os.path.exists(self.args['dir']): - self.update() - else: - self.install() - with self.lock: - thread_vim_command("let s:update.new['{0}'] = 1".format(self.name)) - except PlugError as exc: - self.write(Action.ERROR, self.name, exc.msg) - except KeyboardInterrupt: - G_STOP.set() - self.write(Action.ERROR, self.name, ['Interrupted!']) - except: - # Any exception except those above print stack trace - msg = 'Trace:\n{0}'.format(traceback.format_exc().rstrip()) - self.write(Action.ERROR, self.name, msg.split('\n')) - raise - - def install(self): - target = self.args['dir'] - if target[-1] == '\\': - target = target[0:-1] - - def clean(target): - def _clean(): - try: - shutil.rmtree(target) - except OSError: - pass - return _clean - - self.write(Action.INSTALL, self.name, ['Installing ...']) - callback = functools.partial(self.write, Action.INSTALL, self.name) - cmd = 'git clone {0} {1} {2} {3} 2>&1'.format( - '' if self.tag else G_CLONE_OPT, G_PROGRESS, self.args['uri'], - esc(target)) - com = Command(cmd, None, G_TIMEOUT, callback, clean(target)) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - - def repo_uri(self): - cmd = 'git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url' - command = Command(cmd, self.args['dir'], G_TIMEOUT,) - result = command.execute(G_RETRIES) - return result[-1] - - def update(self): - actual_uri = self.repo_uri() - expect_uri = self.args['uri'] - regex = re.compile(r'^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$') - ma = regex.match(actual_uri) - mb = regex.match(expect_uri) - if ma is None or mb is None or ma.groups() != mb.groups(): - msg = ['', - 'Invalid URI: {0}'.format(actual_uri), - 'Expected {0}'.format(expect_uri), - 'PlugClean required.'] - raise InvalidURI(msg) - - if G_PULL: - self.write(Action.UPDATE, self.name, ['Updating ...']) - callback = functools.partial(self.write, Action.UPDATE, self.name) - fetch_opt = '--depth 99999999' if self.tag and os.path.isfile(os.path.join(self.args['dir'], '.git/shallow')) else '' - cmd = 'git fetch {0} {1} 2>&1'.format(fetch_opt, G_PROGRESS) - com = Command(cmd, self.args['dir'], G_TIMEOUT, callback) - result = com.execute(G_RETRIES) - self.write(Action.DONE, self.name, result[-1:]) - else: - self.write(Action.DONE, self.name, ['Already installed']) - - def write(self, action, name, msg): - self.buf_q.put((action, name, msg)) - -class PlugThread(thr.Thread): - def __init__(self, tname, args): - super(PlugThread, self).__init__() - self.tname = tname - self.args = args - - def run(self): - thr.current_thread().name = self.tname - buf_q, work_q, lock = self.args - - try: - while not G_STOP.is_set(): - name, args = work_q.get_nowait() - plug = Plugin(name, args, buf_q, lock) - plug.manage() - work_q.task_done() - except queue.Empty: - pass - -class RefreshThread(thr.Thread): - def __init__(self, lock): - super(RefreshThread, self).__init__() - self.lock = lock - self.running = True - - def run(self): - while self.running: - with self.lock: - thread_vim_command('noautocmd normal! a') - time.sleep(0.33) - - def stop(self): - self.running = False - -if G_NVIM: - def thread_vim_command(cmd): - vim.session.threadsafe_call(lambda: vim.command(cmd)) -else: - def thread_vim_command(cmd): - vim.command(cmd) - -def esc(name): - return '"' + name.replace('"', '\"') + '"' - -def nonblock_read(fname): - """ Read a file with nonblock flag. Return the last line. """ - fread = os.open(fname, os.O_RDONLY | os.O_NONBLOCK) - buf = os.read(fread, 100000).decode('utf-8', 'replace') - os.close(fread) - - line = buf.rstrip('\r\n') - left = max(line.rfind('\r'), line.rfind('\n')) - if left != -1: - left += 1 - line = line[left:] - - return line - -def main(): - thr.current_thread().name = 'main' - nthreads = int(vim.eval('s:update.threads')) - plugs = vim.eval('s:update.todo') - mac_gui = vim.eval('s:mac_gui') == '1' - - lock = thr.Lock() - buf = Buffer(lock, len(plugs), G_PULL) - buf_q, work_q = queue.Queue(), queue.Queue() - for work in plugs.items(): - work_q.put(work) - - start_cnt = thr.active_count() - for num in range(nthreads): - tname = 'PlugT-{0:02}'.format(num) - thread = PlugThread(tname, (buf_q, work_q, lock)) - thread.start() - if mac_gui: - rthread = RefreshThread(lock) - rthread.start() - - while not buf_q.empty() or thr.active_count() != start_cnt: - try: - action, name, msg = buf_q.get(True, 0.25) - buf.write(action, name, ['OK'] if not msg else msg) - buf_q.task_done() - except queue.Empty: - pass - except KeyboardInterrupt: - G_STOP.set() - - if mac_gui: - rthread.stop() - rthread.join() - -main() -EOF -endfunction - -function! s:update_ruby() - ruby << EOF - module PlugStream - SEP = ["\r", "\n", nil] - def get_line - buffer = '' - loop do - char = readchar rescue return - if SEP.include? char.chr - buffer << $/ - break - else - buffer << char - end - end - buffer - end - end unless defined?(PlugStream) - - def esc arg - %["#{arg.gsub('"', '\"')}"] - end - - def killall pid - pids = [pid] - if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM - pids.each { |pid| Process.kill 'INT', pid.to_i rescue nil } - else - unless `which pgrep 2> /dev/null`.empty? - children = pids - until children.empty? - children = children.map { |pid| - `pgrep -P #{pid}`.lines.map { |l| l.chomp } - }.flatten - pids += children - end - end - pids.each { |pid| Process.kill 'TERM', pid.to_i rescue nil } - end - end - - def compare_git_uri a, b - regex = %r{^(?:\w+://)?(?:[^@/]*@)?([^:/]*(?::[0-9]*)?)[:/](.*?)(?:\.git)?/?$} - regex.match(a).to_a.drop(1) == regex.match(b).to_a.drop(1) - end - - require 'thread' - require 'fileutils' - require 'timeout' - running = true - iswin = VIM::evaluate('s:is_win').to_i == 1 - pull = VIM::evaluate('s:update.pull').to_i == 1 - base = VIM::evaluate('g:plug_home') - all = VIM::evaluate('s:update.todo') - limit = VIM::evaluate('get(g:, "plug_timeout", 60)') - tries = VIM::evaluate('get(g:, "plug_retries", 2)') + 1 - nthr = VIM::evaluate('s:update.threads').to_i - maxy = VIM::evaluate('winheight(".")').to_i - vim7 = VIM::evaluate('v:version').to_i <= 703 && RUBY_PLATFORM =~ /darwin/ - cd = iswin ? 'cd /d' : 'cd' - tot = VIM::evaluate('len(s:update.todo)') || 0 - bar = '' - skip = 'Already installed' - mtx = Mutex.new - take1 = proc { mtx.synchronize { running && all.shift } } - logh = proc { - cnt = bar.length - $curbuf[1] = "#{pull ? 'Updating' : 'Installing'} plugins (#{cnt}/#{tot})" - $curbuf[2] = '[' + bar.ljust(tot) + ']' - VIM::command('normal! 2G') - VIM::command('redraw') - } - where = proc { |name| (1..($curbuf.length)).find { |l| $curbuf[l] =~ /^[-+x*] #{name}:/ } } - log = proc { |name, result, type| - mtx.synchronize do - ing = ![true, false].include?(type) - bar += type ? '=' : 'x' unless ing - b = case type - when :install then '+' when :update then '*' - when true, nil then '-' else - VIM::command("call add(s:update.errors, '#{name}')") - 'x' - end - result = - if type || type.nil? - ["#{b} #{name}: #{result.lines.to_a.last || 'OK'}"] - elsif result =~ /^Interrupted|^Timeout/ - ["#{b} #{name}: #{result}"] - else - ["#{b} #{name}"] + result.lines.map { |l| " " << l } - end - if lnum = where.call(name) - $curbuf.delete lnum - lnum = 4 if ing && lnum > maxy - end - result.each_with_index do |line, offset| - $curbuf.append((lnum || 4) - 1 + offset, line.gsub(/\e\[./, '').chomp) - end - logh.call - end - } - bt = proc { |cmd, name, type, cleanup| - tried = timeout = 0 - begin - tried += 1 - timeout += limit - fd = nil - data = '' - if iswin - Timeout::timeout(timeout) do - tmp = VIM::evaluate('tempname()') - system("(#{cmd}) > #{tmp}") - data = File.read(tmp).chomp - File.unlink tmp rescue nil - end - else - fd = IO.popen(cmd).extend(PlugStream) - first_line = true - log_prob = 1.0 / nthr - while line = Timeout::timeout(timeout) { fd.get_line } - data << line - log.call name, line.chomp, type if name && (first_line || rand < log_prob) - first_line = false - end - fd.close - end - [$? == 0, data.chomp] - rescue Timeout::Error, Interrupt => e - if fd && !fd.closed? - killall fd.pid - fd.close - end - cleanup.call if cleanup - if e.is_a?(Timeout::Error) && tried < tries - 3.downto(1) do |countdown| - s = countdown > 1 ? 's' : '' - log.call name, "Timeout. Will retry in #{countdown} second#{s} ...", type - sleep 1 - end - log.call name, 'Retrying ...', type - retry - end - [false, e.is_a?(Interrupt) ? "Interrupted!" : "Timeout!"] - end - } - main = Thread.current - threads = [] - watcher = Thread.new { - if vim7 - while VIM::evaluate('getchar(1)') - sleep 0.1 - end - else - require 'io/console' # >= Ruby 1.9 - nil until IO.console.getch == 3.chr - end - mtx.synchronize do - running = false - threads.each { |t| t.raise Interrupt } unless vim7 - end - threads.each { |t| t.join rescue nil } - main.kill - } - refresh = Thread.new { - while true - mtx.synchronize do - break unless running - VIM::command('noautocmd normal! a') - end - sleep 0.2 - end - } if VIM::evaluate('s:mac_gui') == 1 - - clone_opt = VIM::evaluate('s:clone_opt') - progress = VIM::evaluate('s:progress_opt(1)') - nthr.times do - mtx.synchronize do - threads << Thread.new { - while pair = take1.call - name = pair.first - dir, uri, tag = pair.last.values_at *%w[dir uri tag] - exists = File.directory? dir - ok, result = - if exists - chdir = "#{cd} #{iswin ? dir : esc(dir)}" - ret, data = bt.call "#{chdir} && git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url", nil, nil, nil - current_uri = data.lines.to_a.last - if !ret - if data =~ /^Interrupted|^Timeout/ - [false, data] - else - [false, [data.chomp, "PlugClean required."].join($/)] - end - elsif !compare_git_uri(current_uri, uri) - [false, ["Invalid URI: #{current_uri}", - "Expected: #{uri}", - "PlugClean required."].join($/)] - else - if pull - log.call name, 'Updating ...', :update - fetch_opt = (tag && File.exist?(File.join(dir, '.git/shallow'))) ? '--depth 99999999' : '' - bt.call "#{chdir} && git fetch #{fetch_opt} #{progress} 2>&1", name, :update, nil - else - [true, skip] - end - end - else - d = esc dir.sub(%r{[\\/]+$}, '') - log.call name, 'Installing ...', :install - bt.call "git clone #{clone_opt unless tag} #{progress} #{uri} #{d} 2>&1", name, :install, proc { - FileUtils.rm_rf dir - } - end - mtx.synchronize { VIM::command("let s:update.new['#{name}'] = 1") } if !exists && ok - log.call name, result, ok - end - } if running - end - end - threads.each { |t| t.join rescue nil } - logh.call - refresh.kill if refresh - watcher.kill -EOF -endfunction - -function! s:shellesc_cmd(arg, script) - let escaped = substitute('"'.a:arg.'"', '[&|<>()@^!"]', '^&', 'g') - return substitute(escaped, '%', (a:script ? '%' : '^') . '&', 'g') -endfunction - -function! s:shellesc_ps1(arg) - return "'".substitute(escape(a:arg, '\"'), "'", "''", 'g')."'" -endfunction - -function! s:shellesc_sh(arg) - return "'".substitute(a:arg, "'", "'\\\\''", 'g')."'" -endfunction - -function! plug#shellescape(arg, ...) - let opts = a:0 > 0 && type(a:1) == s:TYPE.dict ? a:1 : {} - let shell = get(opts, 'shell', s:is_win ? 'cmd.exe' : 'sh') - let script = get(opts, 'script', 1) - if shell =~# 'cmd\.exe' - return s:shellesc_cmd(a:arg, script) - elseif shell =~# 'powershell\.exe' || shell =~# 'pwsh$' - return s:shellesc_ps1(a:arg) - endif - return s:shellesc_sh(a:arg) -endfunction - -function! s:glob_dir(path) - return map(filter(s:glob(a:path, '**'), 'isdirectory(v:val)'), 's:dirpath(v:val)') -endfunction - -function! s:progress_bar(line, bar, total) - call setline(a:line, '[' . s:lpad(a:bar, a:total) . ']') -endfunction - -function! s:compare_git_uri(a, b) - " See `git help clone' - " https:// [user@] github.com[:port] / junegunn/vim-plug [.git] - " [git@] github.com[:port] : junegunn/vim-plug [.git] - " file:// / junegunn/vim-plug [/] - " / junegunn/vim-plug [/] - let pat = '^\%(\w\+://\)\='.'\%([^@/]*@\)\='.'\([^:/]*\%(:[0-9]*\)\=\)'.'[:/]'.'\(.\{-}\)'.'\%(\.git\)\=/\?$' - let ma = matchlist(a:a, pat) - let mb = matchlist(a:b, pat) - return ma[1:2] ==# mb[1:2] -endfunction - -function! s:format_message(bullet, name, message) - if a:bullet != 'x' - return [printf('%s %s: %s', a:bullet, a:name, s:lastline(a:message))] - else - let lines = map(s:lines(a:message), '" ".v:val') - return extend([printf('x %s:', a:name)], lines) - endif -endfunction - -function! s:with_cd(cmd, dir, ...) - let script = a:0 > 0 ? a:1 : 1 - return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd) -endfunction - -function! s:system(cmd, ...) - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - return system(cmd) - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry -endfunction - -function! s:system_chomp(...) - let ret = call('s:system', a:000) - return v:shell_error ? '' : substitute(ret, '\n$', '', '') -endfunction - -function! s:git_validate(spec, check_branch) - let err = '' - if isdirectory(a:spec.dir) - let result = s:lines(s:system('git rev-parse --abbrev-ref HEAD 2>&1 && git config -f .git/config remote.origin.url', a:spec.dir)) - let remote = result[-1] - if v:shell_error - let err = join([remote, 'PlugClean required.'], "\n") - elseif !s:compare_git_uri(remote, a:spec.uri) - let err = join(['Invalid URI: '.remote, - \ 'Expected: '.a:spec.uri, - \ 'PlugClean required.'], "\n") - elseif a:check_branch && has_key(a:spec, 'commit') - let result = s:lines(s:system('git rev-parse HEAD 2>&1', a:spec.dir)) - let sha = result[-1] - if v:shell_error - let err = join(add(result, 'PlugClean required.'), "\n") - elseif !s:hash_match(sha, a:spec.commit) - let err = join([printf('Invalid HEAD (expected: %s, actual: %s)', - \ a:spec.commit[:6], sha[:6]), - \ 'PlugUpdate required.'], "\n") - endif - elseif a:check_branch - let branch = result[0] - " Check tag - if has_key(a:spec, 'tag') - let tag = s:system_chomp('git describe --exact-match --tags HEAD 2>&1', a:spec.dir) - if a:spec.tag !=# tag && a:spec.tag !~ '\*' - let err = printf('Invalid tag: %s (expected: %s). Try PlugUpdate.', - \ (empty(tag) ? 'N/A' : tag), a:spec.tag) - endif - " Check branch - elseif a:spec.branch !=# branch - let err = printf('Invalid branch: %s (expected: %s). Try PlugUpdate.', - \ branch, a:spec.branch) - endif - if empty(err) - let [ahead, behind] = split(s:lastline(s:system(printf( - \ 'git rev-list --count --left-right HEAD...origin/%s', - \ a:spec.branch), a:spec.dir)), '\t') - if !v:shell_error && ahead - if behind - " Only mention PlugClean if diverged, otherwise it's likely to be - " pushable (and probably not that messed up). - let err = printf( - \ "Diverged from origin/%s (%d commit(s) ahead and %d commit(s) behind!\n" - \ .'Backup local changes and run PlugClean and PlugUpdate to reinstall it.', a:spec.branch, ahead, behind) - else - let err = printf("Ahead of origin/%s by %d commit(s).\n" - \ .'Cannot update until local changes are pushed.', - \ a:spec.branch, ahead) - endif - endif - endif - endif - else - let err = 'Not found' - endif - return [err, err =~# 'PlugClean'] -endfunction - -function! s:rm_rf(dir) - if isdirectory(a:dir) - call s:system((s:is_win ? 'rmdir /S /Q ' : 'rm -rf ') . plug#shellescape(a:dir)) - endif -endfunction - -function! s:clean(force) - call s:prepare() - call append(0, 'Searching for invalid plugins in '.g:plug_home) - call append(1, '') - - " List of valid directories - let dirs = [] - let errs = {} - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - if !s:is_managed(name) - call add(dirs, spec.dir) - else - let [err, clean] = s:git_validate(spec, 1) - if clean - let errs[spec.dir] = s:lines(err)[0] - else - call add(dirs, spec.dir) - endif - endif - let cnt += 1 - call s:progress_bar(2, repeat('=', cnt), total) - normal! 2G - redraw - endfor - - let allowed = {} - for dir in dirs - let allowed[s:dirpath(s:plug_fnamemodify(dir, ':h:h'))] = 1 - let allowed[dir] = 1 - for child in s:glob_dir(dir) - let allowed[child] = 1 - endfor - endfor - - let todo = [] - let found = sort(s:glob_dir(g:plug_home)) - while !empty(found) - let f = remove(found, 0) - if !has_key(allowed, f) && isdirectory(f) - call add(todo, f) - call append(line('$'), '- ' . f) - if has_key(errs, f) - call append(line('$'), ' ' . errs[f]) - endif - let found = filter(found, 'stridx(v:val, f) != 0') - end - endwhile - - 4 - redraw - if empty(todo) - call append(line('$'), 'Already clean.') - else - let s:clean_count = 0 - call append(3, ['Directories to delete:', '']) - redraw! - if a:force || s:ask_no_interrupt('Delete all directories?') - call s:delete([6, line('$')], 1) - else - call setline(4, 'Cancelled.') - nnoremap d :set opfunc=delete_opg@ - nmap dd d_ - xnoremap d :call delete_op(visualmode(), 1) - echo 'Delete the lines (d{motion}) to delete the corresponding directories' - endif - endif - 4 - setlocal nomodifiable -endfunction - -function! s:delete_op(type, ...) - call s:delete(a:0 ? [line("'<"), line("'>")] : [line("'["), line("']")], 0) -endfunction - -function! s:delete(range, force) - let [l1, l2] = a:range - let force = a:force - while l1 <= l2 - let line = getline(l1) - if line =~ '^- ' && isdirectory(line[2:]) - execute l1 - redraw! - let answer = force ? 1 : s:ask('Delete '.line[2:].'?', 1) - let force = force || answer > 1 - if answer - call s:rm_rf(line[2:]) - setlocal modifiable - call setline(l1, '~'.line[1:]) - let s:clean_count += 1 - call setline(4, printf('Removed %d directories.', s:clean_count)) - setlocal nomodifiable - endif - endif - let l1 += 1 - endwhile -endfunction - -function! s:upgrade() - echo 'Downloading the latest version of vim-plug' - redraw - let tmp = s:plug_tempname() - let new = tmp . '/plug.vim' - - try - let out = s:system(printf('git clone --depth 1 %s %s', plug#shellescape(s:plug_src), plug#shellescape(tmp))) - if v:shell_error - return s:err('Error upgrading vim-plug: '. out) - endif - - if readfile(s:me) ==# readfile(new) - echo 'vim-plug is already up-to-date' - return 0 - else - call rename(s:me, s:me . '.old') - call rename(new, s:me) - unlet g:loaded_plug - echo 'vim-plug has been upgraded' - return 1 - endif - finally - silent! call s:rm_rf(tmp) - endtry -endfunction - -function! s:upgrade_specs() - for spec in values(g:plugs) - let spec.frozen = get(spec, 'frozen', 0) - endfor -endfunction - -function! s:status() - call s:prepare() - call append(0, 'Checking plugins') - call append(1, '') - - let ecnt = 0 - let unloaded = 0 - let [cnt, total] = [0, len(g:plugs)] - for [name, spec] in items(g:plugs) - let is_dir = isdirectory(spec.dir) - if has_key(spec, 'uri') - if is_dir - let [err, _] = s:git_validate(spec, 1) - let [valid, msg] = [empty(err), empty(err) ? 'OK' : err] - else - let [valid, msg] = [0, 'Not found. Try PlugInstall.'] - endif - else - if is_dir - let [valid, msg] = [1, 'OK'] - else - let [valid, msg] = [0, 'Not found.'] - endif - endif - let cnt += 1 - let ecnt += !valid - " `s:loaded` entry can be missing if PlugUpgraded - if is_dir && get(s:loaded, name, -1) == 0 - let unloaded = 1 - let msg .= ' (not loaded)' - endif - call s:progress_bar(2, repeat('=', cnt), total) - call append(3, s:format_message(valid ? '-' : 'x', name, msg)) - normal! 2G - redraw - endfor - call setline(1, 'Finished. '.ecnt.' error(s).') - normal! gg - setlocal nomodifiable - if unloaded - echo "Press 'L' on each line to load plugin, or 'U' to update" - nnoremap L :call status_load(line('.')) - xnoremap L :call status_load(line('.')) - end -endfunction - -function! s:extract_name(str, prefix, suffix) - return matchstr(a:str, '^'.a:prefix.' \zs[^:]\+\ze:.*'.a:suffix.'$') -endfunction - -function! s:status_load(lnum) - let line = getline(a:lnum) - let name = s:extract_name(line, '-', '(not loaded)') - if !empty(name) - call plug#load(name) - setlocal modifiable - call setline(a:lnum, substitute(line, ' (not loaded)$', '', '')) - setlocal nomodifiable - endif -endfunction - -function! s:status_update() range - let lines = getline(a:firstline, a:lastline) - let names = filter(map(lines, 's:extract_name(v:val, "[x-]", "")'), '!empty(v:val)') - if !empty(names) - echo - execute 'PlugUpdate' join(names) - endif -endfunction - -function! s:is_preview_window_open() - silent! wincmd P - if &previewwindow - wincmd p - return 1 - endif -endfunction - -function! s:find_name(lnum) - for lnum in reverse(range(1, a:lnum)) - let line = getline(lnum) - if empty(line) - return '' - endif - let name = s:extract_name(line, '-', '') - if !empty(name) - return name - endif - endfor - return '' -endfunction - -function! s:preview_commit() - if b:plug_preview < 0 - let b:plug_preview = !s:is_preview_window_open() - endif - - let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}') - if empty(sha) - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir) - return - endif - - if exists('g:plug_pwindow') && !s:is_preview_window_open() - execute g:plug_pwindow - execute 'e' sha - else - execute 'pedit' sha - wincmd P - endif - setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable - let batchfile = '' - try - let [sh, shellcmdflag, shrd] = s:chsh(1) - let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha - if s:is_win - let [batchfile, cmd] = s:batchfile(cmd) - endif - execute 'silent %!' cmd - finally - let [&shell, &shellcmdflag, &shellredir] = [sh, shellcmdflag, shrd] - if s:is_win && filereadable(batchfile) - call delete(batchfile) - endif - endtry - setlocal nomodifiable - nnoremap q :q - wincmd p -endfunction - -function! s:section(flags) - call search('\(^[x-] \)\@<=[^:]\+:', a:flags) -endfunction - -function! s:format_git_log(line) - let indent = ' ' - let tokens = split(a:line, nr2char(1)) - if len(tokens) != 5 - return indent.substitute(a:line, '\s*$', '', '') - endif - let [graph, sha, refs, subject, date] = tokens - let tag = matchstr(refs, 'tag: [^,)]\+') - let tag = empty(tag) ? ' ' : ' ('.tag.') ' - return printf('%s%s%s%s%s (%s)', indent, graph, sha, tag, subject, date) -endfunction - -function! s:append_ul(lnum, text) - call append(a:lnum, ['', a:text, repeat('-', len(a:text))]) -endfunction - -function! s:diff() - call s:prepare() - call append(0, ['Collecting changes ...', '']) - let cnts = [0, 0] - let bar = '' - let total = filter(copy(g:plugs), 's:is_managed(v:key) && isdirectory(v:val.dir)') - call s:progress_bar(2, bar, len(total)) - for origin in [1, 0] - let plugs = reverse(sort(items(filter(copy(total), (origin ? '' : '!').'(has_key(v:val, "commit") || has_key(v:val, "tag"))')))) - if empty(plugs) - continue - endif - call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:') - for [k, v] in plugs - let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..' - let cmd = 'git log --graph --color=never ' - \ . (s:git_version_requirement(2, 10, 0) ? '--no-show-signature ' : '') - \ . join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 'plug#shellescape(v:val)')) - if has_key(v, 'rtp') - let cmd .= ' -- '.plug#shellescape(v.rtp) - endif - let diff = s:system_chomp(cmd, v.dir) - if !empty(diff) - let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : '' - call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)'))) - let cnts[origin] += 1 - endif - let bar .= '=' - call s:progress_bar(2, bar, len(total)) - normal! 2G - redraw - endfor - if !cnts[origin] - call append(5, ['', 'N/A']) - endif - endfor - call setline(1, printf('%d plugin(s) updated.', cnts[0]) - \ . (cnts[1] ? printf(' %d plugin(s) have pending updates.', cnts[1]) : '')) - - if cnts[0] || cnts[1] - nnoremap (plug-preview) :silent! call preview_commit() - if empty(maparg("\", 'n')) - nmap (plug-preview) - endif - if empty(maparg('o', 'n')) - nmap o (plug-preview) - endif - endif - if cnts[0] - nnoremap X :call revert() - echo "Press 'X' on each block to revert the update" - endif - normal! gg - setlocal nomodifiable -endfunction - -function! s:revert() - if search('^Pending updates', 'bnW') - return - endif - - let name = s:find_name(line('.')) - if empty(name) || !has_key(g:plugs, name) || - \ input(printf('Revert the update of %s? (y/N) ', name)) !~? '^y' - return - endif - - call s:system('git reset --hard HEAD@{1} && git checkout '.plug#shellescape(g:plugs[name].branch).' --', g:plugs[name].dir) - setlocal modifiable - normal! "_dap - setlocal nomodifiable - echo 'Reverted' -endfunction - -function! s:snapshot(force, ...) abort - call s:prepare() - setf vim - call append(0, ['" Generated by vim-plug', - \ '" '.strftime("%c"), - \ '" :source this file in vim to restore the snapshot', - \ '" or execute: vim -S snapshot.vim', - \ '', '', 'PlugUpdate!']) - 1 - let anchor = line('$') - 3 - let names = sort(keys(filter(copy(g:plugs), - \'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)'))) - for name in reverse(names) - let sha = s:system_chomp('git rev-parse --short HEAD', g:plugs[name].dir) - if !empty(sha) - call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha)) - redraw - endif - endfor - - if a:0 > 0 - let fn = s:plug_expand(a:1) - if filereadable(fn) && !(a:force || s:ask(a:1.' already exists. Overwrite?')) - return - endif - call writefile(getline(1, '$'), fn) - echo 'Saved as '.a:1 - silent execute 'e' s:esc(fn) - setf vim - endif -endfunction - -function! s:split_rtp() - return split(&rtp, '\\\@ - Coc Logo + Logo

Make your Vim/Neovim as smart as VSCode.

- Software License - Bountysource - Actions - Doc + Software License + Actions + Codecov Coverage Status + Doc Gitter

--- -Coc is an intellisense engine for Vim/Neovim. +Gif -Gif +_Custom popup menu with snippet support_ -_True snippet and additional text editing support_ +## Why? -Check out [Wiki](https://github.com/neoclide/coc.nvim/wiki), or -[doc/coc.txt](doc/coc.txt) for the Vim interface. +- 🚀 **Fast**: separated NodeJS process that does not block your vim most of the time. +- 💎 **Reliable**: typed language, tested with CI. +- 🌟 **Featured**: all LSP 3.16 features are supported, see `:h coc-lsp`. +- ❤️ **Flexible**: [configured like VSCode](https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file), [extensions work like in VSCode](https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions) ## Quick Start -Install [nodejs](https://nodejs.org/en/download/) when necessary: +Make sure use vim >= 8.1.1719 or neovim >= 0.4.0. -```sh -curl -sL install-node.now.sh/lts | bash +Install [nodejs](https://nodejs.org/en/download/) >= 14.14: + +```bash +curl -sL install-node.vercel.app/lts | bash ``` For [vim-plug](https://github.com/junegunn/vim-plug) users: ```vim -" Use release branch (Recommend) +" Use release branch (recommend) Plug 'neoclide/coc.nvim', {'branch': 'release'} -" Or build from source code by use yarn: https://yarnpkg.com -Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} +" Or build from source code by using yarn: https://yarnpkg.com +Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'} ``` in your `.vimrc` or `init.vim`, then restart Vim and run `:PlugInstall`. Checkout [Install -coc.nvim](https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim) Wiki for +coc.nvim](https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim) for more info. -**Note**: The first time building from source code may be slow. +You **have to** install coc extension or configure language servers for +LSP support. + +Install extensions like: + + :CocInstall coc-json coc-tsserver + +Or configure language server in `coc-settings.json` opened by +`:CocConfig`, like: + +```json +{ + "languageserver": { + "go": { + "command": "gopls", + "rootPatterns": ["go.mod"], + "trace.server": "verbose", + "filetypes": ["go"] + } + } +} +``` + +Checkout wiki for more details: + +- [Completion with sources](https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources) +- [Using the configuration file](https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file) +- [Using coc extensions](https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions) +- [Configure language servers](https://github.com/neoclide/coc.nvim/wiki/Language-servers) +- [F.A.Q](https://github.com/neoclide/coc.nvim/wiki/F.A.Q) + +Checkout `:h coc-nvim` for vim interface. ## Example vim configuration @@ -56,56 +91,51 @@ doesn't change your key-mappings or Vim options. This is done as much as possible to avoid conflict with your other plugins. **❗️Important**: Some Vim plugins could change key mappings. Please use -`:verbose imap ` to make sure that your keymap has taken effect. +command like`:verbose imap ` to make sure that your keymap has taken effect. ```vim -" TextEdit might fail if hidden is not set. -set hidden - " Some servers have issues with backup files, see #649. set nobackup set nowritebackup -" Give more space for displaying messages. -set cmdheight=2 - " Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable " delays and poor user experience. set updatetime=300 -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c - " Always show the signcolumn, otherwise it would shift the text each time " diagnostics appear/become resolved. set signcolumn=yes " Use tab for trigger completion with characters ahead and navigate. +" NOTE: There's always complete item selected by default, you may want to enable +" no select by `"suggest.noselect": true` in your configuration file. " NOTE: Use command ':verbose imap ' to make sure tab is not mapped by " other plugin before putting this into your config. inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : \ coc#refresh() -inoremap pumvisible() ? "\" : "\" +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" -function! s:check_back_space() abort +" Make to accept selected completion item or notify coc.nvim to format +" u breaks current undo, please make your own choice. +inoremap coc#pum#visible() ? coc#pum#confirm() + \: "\u\\=coc#on_enter()\" + +function! CheckBackspace() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction " Use to trigger completion. -inoremap coc#refresh() - -" Use to confirm completion, `u` means break undo chain at current -" position. Coc only does snippet and additional edit on confirm. -if exists('*complete_info') - inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" +if has('nvim') + inoremap coc#refresh() else - imap pumvisible() ? "\" : "\u\" + inoremap coc#refresh() endif " Use `[g` and `]g` to navigate diagnostics +" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) @@ -116,13 +146,13 @@ nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. -nnoremap K :call show_documentation() +nnoremap K :call ShowDocumentation() -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') else - call CocAction('doHover') + call feedkeys('K', 'in') endif endfunction @@ -149,65 +179,269 @@ augroup end xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected) -" Remap keys for applying codeAction to the current line. +" Remap keys for applying codeAction to the current buffer. nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) -" Introduce function text object +" Run the Code Lens action on the current line. +nmap cl (coc-codelens-action) + +" Map function and class text objects " NOTE: Requires 'textDocument.documentSymbol' support from the language server. xmap if (coc-funcobj-i) -xmap af (coc-funcobj-a) omap if (coc-funcobj-i) +xmap af (coc-funcobj-a) omap af (coc-funcobj-a) +xmap ic (coc-classobj-i) +omap ic (coc-classobj-i) +xmap ac (coc-classobj-a) +omap ac (coc-classobj-a) + +" Remap and for scroll float windows/popups. +if has('nvim-0.4.0') || has('patch-8.2.0750') + nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" +endif -" Use for selections ranges. -" NOTE: Requires 'textDocument/selectionRange' support from the language server. -" coc-tsserver, coc-python are the examples of servers that support it. -nmap (coc-range-select) -xmap (coc-range-select) +" Use CTRL-S for selections ranges. +" Requires 'textDocument/selectionRange' support of language server. +nmap (coc-range-select) +xmap (coc-range-select) " Add `:Format` command to format current buffer. -command! -nargs=0 Format :call CocAction('format') +command! -nargs=0 Format :call CocActionAsync('format') " Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', ) " Add `:OR` command for organize imports of the current buffer. -command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') +command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport') " Add (Neo)Vim's native statusline support. " NOTE: Please see `:h coc-status` for integrations with external plugins that " provide custom statusline: lightline.vim, vim-airline. set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} -" Mappings using CoCList: +" Mappings for CoCList " Show all diagnostics. -nnoremap a :CocList diagnostics +nnoremap a :CocList diagnostics " Manage extensions. -nnoremap e :CocList extensions +nnoremap e :CocList extensions " Show commands. -nnoremap c :CocList commands +nnoremap c :CocList commands " Find symbol of current document. -nnoremap o :CocList outline +nnoremap o :CocList outline " Search workspace symbols. -nnoremap s :CocList -I symbols +nnoremap s :CocList -I symbols " Do default action for next item. -nnoremap j :CocNext +nnoremap j :CocNext " Do default action for previous item. -nnoremap k :CocPrev +nnoremap k :CocPrev " Resume latest coc list. -nnoremap p :CocListResume +nnoremap p :CocListResume +``` + +## Example lua configuration + +NOTE: This works in Neovim 0.7.0dev+ only. + +```lua +-- Some servers have issues with backup files, see #649. +vim.opt.backup = false +vim.opt.writebackup = false + +-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable +-- delays and poor user experience. +vim.opt.updatetime = 300 + +-- Always show the signcolumn, otherwise it would shift the text each time +-- diagnostics appear/become resolved. +vim.opt.signcolumn = "yes" + +local keyset = vim.keymap.set +-- Auto complete +function _G.check_back_space() + local col = vim.fn.col('.') - 1 + return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil +end + +-- Use tab for trigger completion with characters ahead and navigate. +-- NOTE: There's always complete item selected by default, you may want to enable +-- no select by `"suggest.noselect": true` in your configuration file. +-- NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +-- other plugin before putting this into your config. +local opts = {silent = true, noremap = true, expr = true, replace_keycodes = false} +keyset("i", "", 'coc#pum#visible() ? coc#pum#next(1) : v:lua.check_back_space() ? "" : coc#refresh()', opts) +keyset("i", "", [[coc#pum#visible() ? coc#pum#prev(1) : "\"]], opts) + +-- Make to accept selected completion item or notify coc.nvim to format +-- u breaks current undo, please make your own choice. +keyset("i", "", [[coc#pum#visible() ? coc#pum#confirm() : "\u\\=coc#on_enter()\"]], opts) + +-- Use to trigger snippets +keyset("i", "", "(coc-snippets-expand-jump)") +-- Use to trigger completion. +keyset("i", "", "coc#refresh()", {silent = true, expr = true}) + +-- Use `[g` and `]g` to navigate diagnostics +-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +keyset("n", "[g", "(coc-diagnostic-prev)", {silent = true}) +keyset("n", "]g", "(coc-diagnostic-next)", {silent = true}) + +-- GoTo code navigation. +keyset("n", "gd", "(coc-definition)", {silent = true}) +keyset("n", "gy", "(coc-type-definition)", {silent = true}) +keyset("n", "gi", "(coc-implementation)", {silent = true}) +keyset("n", "gr", "(coc-references)", {silent = true}) + + +-- Use K to show documentation in preview window. +function _G.show_docs() + local cw = vim.fn.expand('') + if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then + vim.api.nvim_command('h ' .. cw) + elseif vim.api.nvim_eval('coc#rpc#ready()') then + vim.fn.CocActionAsync('doHover') + else + vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw) + end +end +keyset("n", "K", 'lua _G.show_docs()', {silent = true}) + + +-- Highlight the symbol and its references when holding the cursor. +vim.api.nvim_create_augroup("CocGroup", {}) +vim.api.nvim_create_autocmd("CursorHold", { + group = "CocGroup", + command = "silent call CocActionAsync('highlight')", + desc = "Highlight symbol under cursor on CursorHold" +}) + + +-- Symbol renaming. +keyset("n", "rn", "(coc-rename)", {silent = true}) + + +-- Formatting selected code. +keyset("x", "f", "(coc-format-selected)", {silent = true}) +keyset("n", "f", "(coc-format-selected)", {silent = true}) + + +-- Setup formatexpr specified filetype(s). +vim.api.nvim_create_autocmd("FileType", { + group = "CocGroup", + pattern = "typescript,json", + command = "setl formatexpr=CocAction('formatSelected')", + desc = "Setup formatexpr specified filetype(s)." +}) + +-- Update signature help on jump placeholder. +vim.api.nvim_create_autocmd("User", { + group = "CocGroup", + pattern = "CocJumpPlaceholder", + command = "call CocActionAsync('showSignatureHelp')", + desc = "Update signature help on jump placeholder" +}) + + +-- Applying codeAction to the selected region. +-- Example: `aap` for current paragraph +local opts = {silent = true, nowait = true} +keyset("x", "a", "(coc-codeaction-selected)", opts) +keyset("n", "a", "(coc-codeaction-selected)", opts) + +-- Remap keys for applying codeAction to the current buffer. +keyset("n", "ac", "(coc-codeaction)", opts) + + +-- Apply AutoFix to problem on the current line. +keyset("n", "qf", "(coc-fix-current)", opts) + + +-- Run the Code Lens action on the current line. +keyset("n", "cl", "(coc-codelens-action)", opts) + + +-- Map function and class text objects +-- NOTE: Requires 'textDocument.documentSymbol' support from the language server. +keyset("x", "if", "(coc-funcobj-i)", opts) +keyset("o", "if", "(coc-funcobj-i)", opts) +keyset("x", "af", "(coc-funcobj-a)", opts) +keyset("o", "af", "(coc-funcobj-a)", opts) +keyset("x", "ic", "(coc-classobj-i)", opts) +keyset("o", "ic", "(coc-classobj-i)", opts) +keyset("x", "ac", "(coc-classobj-a)", opts) +keyset("o", "ac", "(coc-classobj-a)", opts) + + +-- Remap and for scroll float windows/popups. +---@diagnostic disable-next-line: redefined-local +local opts = {silent = true, nowait = true, expr = true} +keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) +keyset("n", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) +keyset("i", "", + 'coc#float#has_scroll() ? "=coc#float#scroll(1)" : ""', opts) +keyset("i", "", + 'coc#float#has_scroll() ? "=coc#float#scroll(0)" : ""', opts) +keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(1) : ""', opts) +keyset("v", "", 'coc#float#has_scroll() ? coc#float#scroll(0) : ""', opts) + + +-- Use CTRL-S for selections ranges. +-- Requires 'textDocument/selectionRange' support of language server. +keyset("n", "", "(coc-range-select)", {silent = true}) +keyset("x", "", "(coc-range-select)", {silent = true}) + + +-- Add `:Format` command to format current buffer. +vim.api.nvim_create_user_command("Format", "call CocAction('format')", {}) + +-- " Add `:Fold` command to fold current buffer. +vim.api.nvim_create_user_command("Fold", "call CocAction('fold', )", {nargs = '?'}) + +-- Add `:OR` command for organize imports of the current buffer. +vim.api.nvim_create_user_command("OR", "call CocActionAsync('runCommand', 'editor.action.organizeImport')", {}) + +-- Add (Neo)Vim's native statusline support. +-- NOTE: Please see `:h coc-status` for integrations with external plugins that +-- provide custom statusline: lightline.vim, vim-airline. +vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}") + +-- Mappings for CoCList +-- code actions and coc stuff +---@diagnostic disable-next-line: redefined-local +local opts = {silent = true, nowait = true} +-- Show all diagnostics. +keyset("n", "a", ":CocList diagnostics", opts) +-- Manage extensions. +keyset("n", "e", ":CocList extensions", opts) +-- Show commands. +keyset("n", "c", ":CocList commands", opts) +-- Find symbol of current document. +keyset("n", "o", ":CocList outline", opts) +-- Search workspace symbols. +keyset("n", "s", ":CocList -I symbols", opts) +-- Do default action for next item. +keyset("n", "j", ":CocNext", opts) +-- Do default action for previous item. +keyset("n", "k", ":CocPrev", opts) +-- Resume latest coc list. +keyset("n", "p", ":CocListResume", opts) ``` ## Articles - [coc.nvim 插件体系介绍](https://zhuanlan.zhihu.com/p/65524706) - [CocList 入坑指南](https://zhuanlan.zhihu.com/p/71846145) -- [Create coc.nvim extension to improve Vim - experience](https://medium.com/@chemzqm/create-coc-nvim-extension-to-improve-vim-experience-4461df269173) +- [Create coc.nvim extension to improve Vim experience](https://medium.com/@chemzqm/create-coc-nvim-extension-to-improve-vim-experience-4461df269173) +- [How to write a coc.nvim extension (and why)](https://samroeca.com/coc-plugin.html) -## Trouble shooting +## Troubleshooting Try these steps when you have problem with coc.nvim. @@ -225,8 +459,365 @@ Try these steps when you have problem with coc.nvim. - If something is not working, [create an issue](https://github.com/neoclide/coc.nvim/issues/new). - +## Backers + +[Become a backer](https://opencollective.com/cocnvim#backer) and get your image on our README on GitHub with a link to your site. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +## Contributors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Qiming zhao

💻

Heyward Fann

💻

Raidou

💻

kevinhwang91

💻

年糕小豆汤

💻

Avi Dessauer

💻

最上川

💻

Yatao Li

💻

wongxy

💻

Sam McCall

💻

Samuel Roeca

💻

Amirali Esmaeili

💻

Jack Rowlingson

💻

Jaehwang Jung

💻

Antoine

💻

Cosmin Popescu

💻

Duc Nghiem Xuan

💻

Francisco Lopes

💻

daquexian

💻

dependabot[bot]

💻

greenkeeper[bot]

💻

Chris Kipp

💻

Dmytro Meleshko

💻

Kirill Bobyrev

💻

Gontran Baerts

💻

Andy

💻

Cheng JIANG

💻

Corin

💻

Daniel Zhang

💻

Ferdinand Bachmann

💻

Guangqing Chen

💻

Jade Meskill

💻

Jasper Poppe

💻

Jean Jordaan

💻

Kid

💻

Pieter van Loon

💻

Robert Liebowitz

💻

Seth Messer

💻

UncleBill

💻

ZERO

💻

fsouza

💻

XiaoZhang

💻

whyreal

💻

yehuohan

💻

バクダンくん

💻

Raphael

💻

tbodt

💻

Aaron McDaid

💻

Aasif Versi

💻

Abner Silva

💻

Adam Stankiewicz

💻

Adamansky Anton

💻

Ahmed El Gabri

💻

Alexandr Kondratev

💻

Andrew Shim

💻

Andy Lindeman

💻

Augustin

💻

Bastien Orivel

💻

Ben Lu

💻

Ben

💻

Brendan Roy

💻

brianembry

💻

br

💻

Cason Adams

💻

Chang Y

💻

Chayoung You

💻

Chen Lijun

💻

Chen Mulong

💻

Chris Weyl

💻

dezza

💻

Cody Allen

💻

Damien Rajon

💻

Daniel Eriksson

💻

Daniel Jenson

💻

David Mejorado

💻

Deric Pang

💻

Ding Tao

💻

Doron Behar

💻

Egor Kovetskiy

💻

ElKowar

💻

Emeliov Dmitrii

💻

Fabian Becker

💻

FallenWarrior2k

💻

Fausto Núñez Alberro

💻

Felipe Ramos

💻

Fredrik Borg

💻

Gavin Sim

💻

Gibson Fahnestock

💻

Giovanni Giordano

💻

Gopal Adhikari

💻

Hanh Le

💻

hedy

💻

Hendrik Lammers

💻

Henry Barreto

💻

Hugo

💻

Jackie Li

💻

Jakub Nowak

💻

James Pickard

💻

Jia Sui

💻

Ellie Hermaszewska

💻

Joel Bradshaw

💻

John Carlo Roberto

💻

Jonas Holst Damtoft

💻

Jonathan Lehman

💻

Joosep Alviste

💻

Josa Gesell

💻

Joshua Rubin

💻

Julian Grinblat

💻

Julian Valentin

💻

KabbAmine

💻

Kay Gosho

💻

Kenny Huynh

💻

Kevin Rambaud

💻

Kian Cross

💻

Kristijan Husak

💻

NullVoxPopuli

💻

Lasse Peters

💻

Noel Errenil

💻

LinArcX

💻

Liu-Cheng Xu

💻

Marc

💻

Marius Gawrisch

💻

Mark Hintz

💻

Mathieu Le Tiec

💻

Matt White

💻

Matthew Evans

💻

Me1onRind

💻

Qyriad

💻

Narcis B.

💻

Neur1n

💻

Nicolas Dermine

💻

Noah

💻

PENG Rui

💻

Paco

💻

Peng Guanwen

💻

Petter Wahlman

💻

Pooya Moradi

💻

Quade Morrison

💻

Ralf Vogler

💻

Ran Chen

💻

Ricardo García Vega

💻

Rick Jones

💻

Ryan Christian

💻

Salo

💻

Sam Nolan

💻

Saurav

💻

Sean Mackesey

💻

Sheel Patel

💻

Solomon Ng

💻

Sri Kadimisetty

💻

Stephen Prater

💻

Sune Kibsgaard

💻

Aquaakuma

💻

Takumi Kawase

💻

The Blob SCP

💻

Tomasz N

💻

Tomoyuki Harada

💻

Tony Fettes

💻

Tony Narlock

💻

Tony Wang

💻

Victor Quach

💻

Whisperity

💻

William Turner

💻

Xiaochao Dong

💻

Hugh Hou

💻

Jackie Li

💻

Zachary Freed

💻

akiyosi

💻

alexjg

💻

aste4

💻

clyfish

💻

dev7ba

💻

diartyz

💻

doza-daniel

💻

equal-l2

💻

fong

💻

hexh

💻

hhiraba

💻

ic-768

💻

javiertury

💻

karasu

💻

kevineato

💻

Eduardo Costa

💻

micchy326

💻

midchildan

💻

minefuto

💻

miyanokomiya

💻

miyaviee

💻

monkoose

💻 🐛

mujx

💻

mvilim

💻

naruaway

💻

piersy

💻

ryantig

💻

rydesun

💻

sc00ter

💻

smhc

💻

Sam Kaplan

💻

tasuten

💻

todesking

💻

typicode

💻

李鸣飞

💻

Ikko Ashimine

📖

Rammiah

🐛

Alisue

🐛

bigshans

📖

Robert Boyd III

🐛

Yuki Iwanaga

💻

SpringHack

🐛

Lucas Burns

📖

qiqiboy

💻

timsu92

📖

Shawn M Moore

💻

Aaron U'Ren

🐛

SeniorMars

📖

牧羊犬真Q

📖
+ + + + + + + + + + + + +This project follows the [all-contributors](https://allcontributors.org) specification. +Contributions of any kind are welcome! ## License -MIT +Anti 996 diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc.vim index a14e015..310d87a 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc.vim @@ -1,7 +1,7 @@ +scriptencoding utf-8 let g:coc#_context = {'start': 0, 'preselect': -1,'candidates': []} let g:coc_user_config = get(g:, 'coc_user_config', {}) let g:coc_global_extensions = get(g:, 'coc_global_extensions', []) -let g:coc_cygqwin_path_prefixes = get(g:, 'coc_cygqwin_path_prefixes', {}) let g:coc_selected_text = '' let g:coc_vim_commands = [] let s:watched_keys = [] @@ -10,6 +10,7 @@ let s:error_sign = get(g:, 'coc_status_error_sign', has('mac') ? '❌ ' : 'E') let s:warning_sign = get(g:, 'coc_status_warning_sign', has('mac') ? '⚠️ ' : 'W') let s:select_api = exists('*nvim_select_popupmenu_item') let s:callbacks = {} +let s:hide_pum = has('nvim-0.6.1') || has('patch-8.2.3389') function! coc#expandable() abort return coc#rpc#request('snippetCheck', [1, 0]) @@ -31,109 +32,73 @@ function! coc#add_command(id, cmd, ...) call coc#rpc#notify('addCommand', [config]) endfunction -function! coc#refresh() abort - return "\=coc#start()\" -endfunction - function! coc#on_enter() - if !coc#rpc#ready() - return '' - endif - if s:is_vim - call coc#rpc#notify('CocAutocmd', ['Enter', bufnr('%')]) - else - call coc#rpc#request('CocAutocmd', ['Enter', bufnr('%')]) - endif + call coc#rpc#notify('CocAutocmd', ['Enter', bufnr('%')]) return '' endfunction function! coc#_insert_key(method, key, ...) abort + let prefix = '' if get(a:, 1, 1) - call coc#_cancel() + if pumvisible() + if s:hide_pum + let prefix = "\\" + else + let g:coc_disable_space_report = 1 + let prefix = "\\" + endif + endif endif - return "\=coc#rpc#".a:method."('doKeymap', ['".a:key."'])\" + return prefix."\=coc#rpc#".a:method."('doKeymap', ['".a:key."'])\" endfunction function! coc#_complete() abort let items = get(g:coc#_context, 'candidates', []) let preselect = get(g:coc#_context, 'preselect', -1) - call complete( - \ g:coc#_context.start + 1, - \ items) + let startcol = g:coc#_context.start + 1 if s:select_api && len(items) && preselect != -1 + noa call complete(startcol, items) call nvim_select_popupmenu_item(preselect, v:false, v:false, {}) + " use specific key to preselect item at once + call feedkeys("\\" , 'i') + else + if pumvisible() + let g:coc_disable_complete_done = 1 + endif + call complete(startcol, items) endif return '' endfunction -function! coc#_do_complete(start, items, preselect) +function! coc#_do_complete(start, items, preselect, changedtick) + if b:changedtick != a:changedtick + return + endif let g:coc#_context = { \ 'start': a:start, \ 'candidates': a:items, \ 'preselect': a:preselect \} - if mode() =~# 'i' && &paste != 1 - call feedkeys("\CocRefresh", 'i') - endif -endfunction - -function! coc#_select_confirm() - if !exists('##TextChangedP') - return "\" + if mode() =~# 'i' + call coc#_complete() endif - let hasSelected = coc#rpc#request('hasSelected', []) - if hasSelected | return "\" | endif - return "\\" endfunction -function! coc#_selected() - if !pumvisible() | return 0 | endif - return coc#rpc#request('hasSelected', []) -endfunction - -function! coc#_hide() abort - if !pumvisible() | return | endif - call feedkeys("\", 'in') -endfunction - -function! coc#_cancel() - call coc#util#close_popup() - " hack for close pum - if pumvisible() && &paste != 1 - let g:coc#_context = {'start': 0, 'preselect': -1,'candidates': []} - call feedkeys("\CocRefresh", 'i') - endif -endfunction - -function! coc#_select() abort - if !pumvisible() | return | endif - call feedkeys("\", 'in') -endfunction - -function! coc#start(...) - let opt = coc#util#get_complete_option() - call CocActionAsync('startCompletion', extend(opt, get(a:, 1, {}))) - return '' +function! coc#_cancel(...) + call coc#pum#close() endfunction " used for statusline function! coc#status() let info = get(b:, 'coc_diagnostic_info', {}) let msgs = [] - if get(info, 'error', 0) + if !empty(info) && get(info, 'error', 0) call add(msgs, s:error_sign . info['error']) endif - if get(info, 'warning', 0) + if !empty(info) && get(info, 'warning', 0) call add(msgs, s:warning_sign . info['warning']) endif - return s:trim(join(msgs, ' ') . ' ' . get(g:, 'coc_status', '')) -endfunction - -function! s:trim(str) - if exists('*trim') - return trim(a:str) - endif - return substitute(a:str, '\s\+$', '', '') + return coc#compat#trim(join(msgs, ' ') . ' ' . get(g:, 'coc_status', '')) endfunction function! coc#config(section, value) @@ -167,24 +132,10 @@ function! s:GlobalChange(dict, key, val) call coc#rpc#notify('GlobalChange', [a:key, get(a:val, 'old', v:null), get(a:val, 'new', v:null)]) endfunction -function! coc#_map() - if !s:select_api | return | endif - for i in range(1, 9) - exe 'inoremap '.i.' call nvim_select_popupmenu_item('.(i - 1).', v:true, v:true, {})' - endfor -endfunction - -function! coc#_unmap() - if !s:select_api | return | endif - for i in range(1, 9) - exe 'silent! iunmap '.i - endfor -endfunction - function! coc#on_notify(id, method, Cb) let key = a:id. '-'.a:method let s:callbacks[key] = a:Cb - call coc#rpc#notify('registNotification', [a:id, a:method]) + call coc#rpc#notify('registerNotification', [a:id, a:method]) endfunction function! coc#do_notify(id, method, result) @@ -194,3 +145,39 @@ function! coc#do_notify(id, method, result) call Fn(a:result) endif endfunction + +function! coc#start(...) + let opt = coc#util#get_complete_option() + call CocActionAsync('startCompletion', extend(opt, get(a:, 1, {}))) + return '' +endfunction + +function! coc#refresh() abort + return "\=coc#start()\" +endfunction + +function! coc#_select_confirm() abort + call timer_start(10, { -> coc#pum#select_confirm()}) + return s:is_vim || has('nvim-0.5.0') ? "\" : "\\" +endfunction + +function! coc#complete_indent() abort + let curpos = getcurpos() + let indent_len = len(matchstr(getline('.'), '^\s*')) + let startofline = &startofline + let virtualedit = &virtualedit + set nostartofline + set virtualedit=all + normal! == + let &startofline = startofline + let &virtualedit = virtualedit + let shift = len(matchstr(getline('.'), '^\s*')) - indent_len + let curpos[2] += shift + let curpos[4] += shift + call cursor(curpos[1:]) + if shift != 0 + if s:is_vim + call timer_start(0, { -> execute('redraw')}) + endif + endif +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/api.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/api.vim index bc0db2d..cced938 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/api.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/api.vim @@ -1,28 +1,44 @@ " ============================================================================ " Description: Client api used by vim8 " Author: Qiming Zhao -" Licence: MIT licence -" Last Modified: June 28, 2019 +" Licence: Anti 996 licence +" Last Modified: Jun 03, 2022 " ============================================================================ if has('nvim') | finish | endif +scriptencoding utf-8 let s:funcs = {} -let s:prop_id = 1000 +let s:prop_offset = get(g:, 'coc_text_prop_offset', 1000) let s:namespace_id = 1 let s:namespace_cache = {} +let s:max_src_id = 1000 +" bufnr => max textprop id +let s:buffer_id = {} +" srcId => list of types +let s:id_types = {} " helper {{ function! s:buf_line_count(bufnr) abort if bufnr('%') == a:bufnr return line('$') endif + if exists('*getbufinfo') + let info = getbufinfo(a:bufnr) + if empty(info) + return 0 + endif + " vim 8.1 has getbufinfo but no linecount + if has_key(info[0], 'linecount') + return info[0]['linecount'] + endif + endif if exists('*getbufline') let lines = getbufline(a:bufnr, 1, '$') return len(lines) endif let curr = bufnr('%') - execute 'buffer '.a:bufnr + execute 'noa buffer '.a:bufnr let n = line('$') - execute 'buffer '.curr + execute 'noa buffer '.curr return n endfunction @@ -72,14 +88,20 @@ function! s:funcs.list_wins() abort return map(getwininfo(), 'v:val["winid"]') endfunction +function s:inspect_type(v) abort + let types = ['Number', 'String', 'Funcref', 'List', 'Dictionary', 'Float', 'Boolean', 'Null'] + return get(types, type(a:v), 'Unknown') +endfunction + function! s:funcs.call_atomic(calls) let res = [] - for [key, arglist] in a:calls + for i in range(len(a:calls)) + let [key, arglist] = a:calls[i] let name = key[5:] try call add(res, call(s:funcs[name], arglist)) catch /.*/ - return [res, v:exception] + return [res, [i, "VimException(".s:inspect_type(v:exception).")", v:exception . ' on '.v:throwpoint]] endtry endfor return [res, v:null] @@ -108,6 +130,12 @@ function! s:funcs.command(command) abort call timer_start(0, {-> s:execute(a:command)}) else execute a:command + let err = get(g:, 'errmsg', '') + " get error from python script run. + if !empty(err) + unlet g:errmsg + throw err + endif endif endfunction @@ -121,7 +149,7 @@ function! s:funcs.get_api_info() endfunction function! s:funcs.list_bufs() - return map(getbufinfo({'buflisted': 1}), 'v:val["bufnr"]') + return map(getbufinfo({'bufloaded': 1}), 'v:val["bufnr"]') endfunction function! s:funcs.feedkeys(keys, mode, escape_csi) @@ -129,7 +157,7 @@ function! s:funcs.feedkeys(keys, mode, escape_csi) endfunction function! s:funcs.list_runtime_paths() - return split(&runtimepath, ',') + return globpath(&runtimepath, '', 0, 1) endfunction function! s:funcs.command_output(cmd) @@ -186,14 +214,18 @@ endfunction function! s:funcs.out_write(str) echon a:str + call timer_start(0, {-> s:execute('redraw')}) endfunction function! s:funcs.err_write(str) - echoerr a:str + "echoerr a:str endfunction function! s:funcs.err_writeln(str) - echoerr a:str + echohl ErrorMsg + echom a:str + echohl None + call timer_start(0, {-> s:execute('redraw')}) endfunction function! s:funcs.create_namespace(name) abort @@ -215,12 +247,10 @@ endfunction " buffer methods {{ function! s:funcs.buf_set_option(bufnr, name, val) let val = a:val - if type(val) == type(v:true) - if val == v:true - let val = 1 - else - let val = 0 - endif + if val is v:true + let val = 1 + elseif val is v:false + let val = 0 endif return setbufvar(a:bufnr, '&'.a:name, val) endfunction @@ -241,68 +271,61 @@ function! s:funcs.buf_get_mark(bufnr, name) return [line("'" . a:name), col("'" . a:name)] endfunction -function! s:funcs.buf_add_highlight(bufnr, srcId, hlGroup, line, colStart, colEnd) abort - if !has('textprop') +function! s:funcs.buf_add_highlight(bufnr, srcId, hlGroup, line, colStart, colEnd, ...) abort + if !has('patch-8.1.1719') return endif - let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr - let key = 'Coc'.a:hlGroup - if empty(prop_type_get(key)) - call prop_type_add(key, {'highlight': a:hlGroup, 'combine': 1}) - endif - let total = strlen(getbufline(bufnr, a:line + 1)[0]) - let end = a:colEnd - if end == -1 - let end = total + if a:srcId == 0 + let srcId = s:max_src_id + 1 + let s:max_src_id = srcId else - let end = min([end, total]) + let srcId = a:srcId endif - if end <= a:colStart - return + let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr + let type = srcId == -1 ? a:hlGroup : a:hlGroup.'_'.srcId + let types = get(s:id_types, srcId, []) + if index(types, type) == -1 + call add(types, type) + let s:id_types[srcId] = types + if empty(prop_type_get(type)) + call prop_type_add(type, extend({'highlight': a:hlGroup}, get(a:, 1, {}))) + endif endif - let id = 0 - if a:srcId != -1 - let cached = getbufvar(bufnr, 'prop_namespace_'.a:srcId, []) - let id = s:prop_id - let s:prop_id = id + 1 - call add(cached, id) - call setbufvar(bufnr, 'prop_namespace_'.a:srcId, cached) + let end = a:colEnd == -1 ? strlen(getbufline(bufnr, a:line + 1)[0]) + 1 : a:colEnd + 1 + if end < a:colStart + 1 + return endif + let id = s:generate_id(a:bufnr) try - call prop_add(a:line + 1, a:colStart + 1, {'length': end - a:colStart, 'bufnr': bufnr, 'type': key, 'id': id}) + call prop_add(a:line + 1, a:colStart + 1, {'bufnr': bufnr, 'type': type, 'id': id, 'end_col': end}) catch /^Vim\%((\a\+)\)\=:E967/ " ignore 967 endtry + if a:srcId == 0 + " return generated srcId + return srcId + endif endfunction function! s:funcs.buf_clear_namespace(bufnr, srcId, startLine, endLine) abort - if !has('textprop') + if !has('patch-8.1.1719') return endif + let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr + let start = a:startLine + 1 + let end = a:endLine == -1 ? len(getbufline(bufnr, 1, '$')) : a:endLine if a:srcId == -1 - if a:endLine == -1 - call prop_clear(a:startLine + 1, {'bufnr': a:bufnr}) - else - call prop_clear(a:startLine + 1, a:endLine + 1, {'bufnr': a:bufnr}) + if has_key(s:buffer_id, a:bufnr) + unlet s:buffer_id[a:bufnr] endif + call prop_clear(start, end, {'bufnr' : bufnr}) else - let cached = getbufvar(a:bufnr, 'prop_namespace_'.a:srcId, []) - if empty(cached) - return - endif - call setbufvar(a:bufnr, 'prop_namespace_'.a:srcId, []) - for id in cached - if a:endLine == -1 - if a:startLine == 0 && a:endLine == -1 - call prop_remove({'id':id, 'bufnr': a:bufnr}) - elseif a:endLine != -1 - call prop_remove({'id':id, 'bufnr': a:bufnr}, a:startLine, a:endLine) - else - let len = s:buf_line_count(a:bufnr) - call prop_remove({'id':id, 'bufnr': a:bufnr}, a:startLine, len) - endif - else - endif + for type in get(s:id_types, a:srcId, []) + try + call prop_remove({'bufnr': bufnr, 'all': 1, 'type': type}, start, end) + catch /^Vim\%((\a\+)\)\=:E968/ + " ignore 968 + endtry endfor endif endfunction @@ -332,9 +355,13 @@ function! s:funcs.buf_get_lines(bufnr, start, end, strict) abort endfunction function! s:funcs.buf_set_lines(bufnr, start, end, strict, ...) abort + let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr + if !bufloaded(bufnr) + return + endif let replacement = get(a:, 1, []) - let lineCount = s:buf_line_count(a:bufnr) - let startLnum = a:start >= 0 ? a:start + 1 : lineCount + a:start + 1 + let lineCount = s:buf_line_count(bufnr) + let startLnum = a:start >= 0 ? a:start + 1 : lineCount + a:start + 2 let end = a:end >= 0 ? a:end : lineCount + a:end + 1 if end == lineCount + 1 let end = lineCount @@ -342,13 +369,13 @@ function! s:funcs.buf_set_lines(bufnr, start, end, strict, ...) abort let delCount = end - (startLnum - 1) let changeBuffer = 0 let curr = bufnr('%') - if a:bufnr != curr && !exists('*setbufline') + if bufnr != curr && !exists('*setbufline') let changeBuffer = 1 - exe 'buffer '.a:bufnr + exe 'buffer '.bufnr endif - let storeView = winsaveview() - if a:bufnr == curr || changeBuffer + if bufnr == curr || changeBuffer " replace + let storeView = winsaveview() if delCount == len(replacement) call setline(startLnum, replacement) else @@ -358,8 +385,18 @@ function! s:funcs.buf_set_lines(bufnr, start, end, strict, ...) abort if delCount let start = startLnum + len(replacement) let saved_reg = @" - silent execute start . ','.(start + delCount - 1).'d' + if has('clipboard') + let system_reg = @* + endif + if exists('*deletebufline') + silent call deletebufline(curr, start, start + delCount - 1) + else + silent execute start . ','.(start + delCount - 1).'d' + endif let @" = saved_reg + if has('clipboard') + let @* = system_reg + endif endif endif call winrestview(storeView) @@ -370,19 +407,26 @@ function! s:funcs.buf_set_lines(bufnr, start, end, strict, ...) abort " replace if delCount == len(replacement) " 8.0.1039 - call setbufline(a:bufnr, startLnum, replacement) + call setbufline(bufnr, startLnum, replacement) else if len(replacement) " 8.10037 - call appendbufline(a:bufnr, startLnum - 1, replacement) + call appendbufline(bufnr, startLnum - 1, replacement) endif if delCount let start = startLnum + len(replacement) + let saved_reg = @" + if has('clipboard') + let system_reg = @* + endif "8.1.0039 - call deletebufline(a:bufnr, start, start + delCount - 1) + silent call deletebufline(bufnr, start, start + delCount - 1) + let @" = saved_reg + if has('clipboard') + let @* = system_reg + endif endif endif - call winrestview(storeView) endif endfunction @@ -406,7 +450,14 @@ function! s:funcs.buf_set_var(bufnr, name, val) endfunction function! s:funcs.buf_del_var(bufnr, name) - call setbufvar(a:bufnr, a:name, v:null) + if bufnr == bufnr('%') + execute 'unlet! b:'.a:name + elseif exists('*win_execute') + let winid = coc#compat#buf_win_id(a:bufnr) + if winid != -1 + call win_execute(winid, 'unlet! b:'.a:name) + endif + endif endfunction function! s:funcs.buf_get_option(bufnr, name) @@ -439,66 +490,101 @@ function! s:funcs.win_get_width(win_id) abort return winwidth(a:win_id) endfunction +if exists('*win_execute') + function! s:win_execute(win_id, cmd, ...) abort + let ref = get(a:000, 0, v:null) + let cmd = ref is v:null ? a:cmd : 'let ref["out"] = ' . a:cmd + call win_execute(a:win_id, cmd) + endfunction +else + function! s:win_execute(win_id, cmd, ...) abort + let ref = get(a:000, 0, v:null) + let cmd = ref is v:null ? a:cmd : 'let ref["out"] = ' . a:cmd + let winid = win_getid() + if winid == a:win_id + execute cmd + else + let goto_status = win_gotoid(a:win_id) + if !goto_status + return + endif + execute cmd + call win_gotoid(winid) + endif + endfunction +endif + +function! s:get_tabnr(winid) abort + let ref = {} + call s:win_execute(a:winid, 'tabpagenr()', ref) + return get(ref, 'out', 0) +endfunction + function! s:funcs.win_get_cursor(win_id) abort - let winid = win_getid() - call win_gotoid(a:win_id) - let pos = [line('.'), col('.')-1] - call win_gotoid(winid) - return pos + let ref = {} + call s:win_execute(a:win_id, "[line('.'), col('.')-1]", ref) + return get(ref, 'out', 0) endfunction -function! s:funcs.win_get_var(win_id, name) abort - return gettabwinvar(0, a:win_id, a:name) +function! s:funcs.win_get_var(win_id, name, ...) abort + let tabnr = s:get_tabnr(a:win_id) + if tabnr + return gettabwinvar(tabnr, a:win_id, a:name, get(a:, 1, v:null)) + endif + throw 'window '.a:win_id. ' not a visible window' endfunction function! s:funcs.win_set_width(win_id, width) abort - let winid = win_getid() - call win_gotoid(a:win_id) - execute 'vertical resize '.a:width - call win_gotoid(winid) + call s:win_execute(a:win_id, 'vertical resize '.a:width) +endfunction + +function! s:funcs.win_set_buf(win_id, buf_id) abort + call s:win_execute(a:win_id, 'buffer '.a:buf_id) endfunction function! s:funcs.win_get_option(win_id, name) abort - return gettabwinvar(0, a:win_id, '&'.a:name) + let tabnr = s:get_tabnr(a:win_id) + if tabnr + return gettabwinvar(tabnr, a:win_id, '&'.a:name) + endif + throw 'window '.a:win_id. ' not a valid window' endfunction function! s:funcs.win_set_height(win_id, height) abort - let winnr = win_id2win(a:win_id) - if winnr != 0 - let curr = winnr() - if winnr == curr - execute 'resize '.a:height - else - execute winnr.'wincmd w' - execute 'resize '.a:height - wincmd p - endif - endif + return s:win_execute(a:win_id, 'resize '.a:height) endfunction function! s:funcs.win_set_option(win_id, name, value) abort let val = a:value - if type(val) == type(v:true) - if val == v:true - let val = 1 - else - let val = 0 - endif + if val is v:true + let val = 1 + elseif val is v:false + let val = 0 + endif + let tabnr = s:get_tabnr(a:win_id) + if tabnr + call settabwinvar(tabnr, a:win_id, '&'.a:name, val) + else + throw 'window '.a:win_id. ' not a valid window' endif - call setwinvar(a:win_id, '&'.a:name, val) endfunction function! s:funcs.win_set_var(win_id, name, value) abort - call setwinvar(a:win_id, a:name, a:value) + let tabnr = s:get_tabnr(a:win_id) + if tabnr + call settabwinvar(tabnr, a:win_id, a:name, a:value) + else + throw "Invalid window id ".a:win_id + endif endfunction function! s:funcs.win_del_var(win_id, name) abort - call settabwinvar(0, a:win_id, a:name, v:null) + call s:win_execute(a:win_id, 'unlet! w:'.a:name) endfunction function! s:funcs.win_is_valid(win_id) abort let info = getwininfo(a:win_id) - return !empty(info) + return empty(info) ? v:false : v:true endfunction function! s:funcs.win_get_number(win_id) abort @@ -510,33 +596,21 @@ function! s:funcs.win_get_number(win_id) abort endfunction function! s:funcs.win_set_cursor(win_id, pos) abort - let winnr = win_id2win(a:win_id) - if winnr != 0 - let [line, col] = a:pos - let curr = winnr() - if winnr == curr - call cursor(line, col + 1) - else - execute winnr.'wincmd w' - call cursor(line, col + 1) - execute curr.'wincmd w' - endif - endif + let [line, col] = a:pos + call s:win_execute(a:win_id, 'call cursor('.line.','.(col + 1).')') endfunction function! s:funcs.win_close(win_id, ...) abort - let curr = win_getid(a:win_id) - call win_gotoid(a:win_id) - close! - call win_gotoid(curr) + let force = get(a:, 1, 0) + call s:win_execute(a:win_id, 'close'.(force ? '!' : '')) endfunction function! s:funcs.win_get_tabpage(win_id) abort - let info = getwininfo(a:win_id) - if !info + let tabnr = s:get_tabnr(a:win_id) + if !tabnr throw 'Invalid window id '.a:win_id endif - return info[0]['tabnr'] + return tabnr endfunction " }} @@ -571,8 +645,35 @@ function! s:funcs.tabpage_get_win(tabnr) let wnr = tabpagewinnr(a:tabnr) return win_getid(wnr, a:tabnr) endfunction + +function! s:generate_id(bufnr) abort + let max = get(s:buffer_id, a:bufnr, s:prop_offset) + let id = max + 1 + let s:buffer_id[a:bufnr] = id + return id +endfunction " }} +function! coc#api#get_types(srcId) abort + return get(s:id_types, a:srcId, []) +endfunction + +function! coc#api#get_id_types() abort + return s:id_types +endfunction + +function! coc#api#create_type(srcId, hlGroup, opts) abort + let type = a:hlGroup.'_'.a:srcId + let types = get(s:id_types, a:srcId, []) + if index(types, type) == -1 + call add(types, type) + let s:id_types[a:srcId] = types + let combine = get(a:opts, 'hl_mode', 'combine') ==# 'combine' + call prop_type_add(type, {'highlight': a:hlGroup, 'combine': combine}) + endif + return type +endfunction + function! coc#api#func_names() abort return keys(s:funcs) endfunction @@ -583,12 +684,21 @@ function! coc#api#call(method, args) abort try let res = call(s:funcs[a:method], a:args) catch /.*/ - let err = v:exception + let err = v:exception .' on api "'.a:method.'" '.json_encode(a:args) endtry return [err, res] endfunction +function! coc#api#exec(method, args) abort + return call(s:funcs[a:method], a:args) +endfunction + function! coc#api#notify(method, args) abort - call call(s:funcs[a:method], a:args) + try + call call(s:funcs[a:method], a:args) + catch /.*/ + let g:b = v:exception + call coc#rpc#notify('nvim_error_event', [0, v:exception.' on api "'.a:method.'" '.json_encode(a:args)]) + endtry endfunction " vim: set sw=2 ts=2 sts=2 et tw=78 foldmarker={{,}} foldmethod=marker foldlevel=0: diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/client.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/client.vim index 603b2fa..e9a9d01 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/client.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/client.vim @@ -1,9 +1,11 @@ +scriptencoding utf-8 let s:root = expand(':h:h:h') let s:is_vim = !has('nvim') let s:is_win = has("win32") || has("win64") let s:clients = {} if get(g:, 'node_client_debug', 0) + echohl WarningMsg | echo '[coc.nvim] Enable g:node_client_debug could impact your vim experience' | echohl None let $NODE_CLIENT_LOG_LEVEL = 'debug' if exists('$NODE_CLIENT_LOG_FILE') let s:logfile = resolve($NODE_CLIENT_LOG_FILE) @@ -36,28 +38,35 @@ endfunction function! s:start() dict if self.running | return | endif + if !isdirectory(getcwd()) + echohl Error | echon '[coc.nvim] Current cwd is not a valid directory.' | echohl None + return + endif + let timeout = string(get(g:, 'coc_channel_timeout', 30)) + let tmpdir = fnamemodify(tempname(), ':p:h') if s:is_vim + if get(g:, 'node_client_debug', 0) + let file = tmpdir . '/coc.log' + call ch_logfile(file, 'w') + echohl MoreMsg | echo '[coc.nvim] channel log to '.file | echohl None + endif let options = { \ 'in_mode': 'json', \ 'out_mode': 'json', \ 'err_mode': 'nl', \ 'err_cb': {channel, message -> s:on_stderr(self.name, split(message, "\n"))}, \ 'exit_cb': {channel, code -> s:on_exit(self.name, code)}, + \ 'env': { + \ 'NODE_NO_WARNINGS': '1', + \ 'VIM_NODE_RPC': '1', + \ 'COC_NVIM': '1', + \ 'COC_CHANNEL_TIMEOUT': timeout, + \ 'TMPDIR': tmpdir, + \ } \} if has("patch-8.1.350") let options['noblock'] = 1 endif - if has("patch-8.0.0902") - let options['env'] = { - \ 'VIM_NODE_RPC': '1', - \ 'COC_NVIM': '1', - \ 'COC_CHANNEL_TIMEOUT': get(g:, 'coc_channel_timeout', 30), - \ } - else - let $VIM_NODE_RPC = 1 - let $COC_NVIM = 1 - let $COC_CHANNEL_TIMEOUT = get(g:, 'coc_channel_timeout', 30) - endif let job = job_start(self.command, options) let status = job_status(job) if status !=# 'run' @@ -68,14 +77,47 @@ function! s:start() dict let self['running'] = 1 let self['channel'] = job_getchannel(job) else - let chan_id = jobstart(self.command, { + let original = {} + let opts = { \ 'rpc': 1, \ 'on_stderr': {channel, msgs -> s:on_stderr(self.name, msgs)}, \ 'on_exit': {channel, code -> s:on_exit(self.name, code)}, - \ 'env': { - \ 'COC_CHANNEL_TIMEOUT': get(g:, 'coc_channel_timeout', 30) - \ } - \}) + \ } + if has('nvim-0.5.0') + " could use env option + let opts['env'] = { + \ 'COC_NVIM': '1', + \ 'NODE_NO_WARNINGS': '1', + \ 'COC_CHANNEL_TIMEOUT': timeout, + \ 'TMPDIR': tmpdir + \ } + else + if exists('*getenv') + let original = { + \ 'NODE_NO_WARNINGS': getenv('NODE_NO_WARNINGS'), + \ 'TMPDIR': getenv('TMPDIR'), + \ } + endif + if exists('*setenv') + call setenv('COC_NVIM', '1') + call setenv('NODE_NO_WARNINGS', '1') + call setenv('COC_CHANNEL_TIMEOUT', timeout) + call setenv('TMPDIR', tmpdir) + else + let $NODE_NO_WARNINGS = 1 + let $TMPDIR = tmpdir + endif + endif + let chan_id = jobstart(self.command, opts) + if !empty(original) + if exists('*setenv') + for key in keys(original) + call setenv(key, original[key]) + endfor + else + let $TMPDIR = original['TMPDIR'] + endif + endif if chan_id <= 0 echohl Error | echom 'Failed to start '.self.name.' service' | echohl None return @@ -89,9 +131,41 @@ function! s:on_stderr(name, msgs) if get(g:, 'coc_vim_leaving', 0) | return | endif let data = filter(copy(a:msgs), '!empty(v:val)') if empty(data) | return | endif - let client = a:name ==# 'coc' ? '' : ' client '.a:name - let data[0] = '[coc.nvim]'.client.' error: ' . data[0] - call coc#util#echo_messages('Error', data) + let client = a:name ==# 'coc' ? '[coc.nvim]' : '['.a:name.']' + let data[0] = client.': '.data[0] + if a:name ==# 'coc' && len(filter(copy(data), 'v:val =~# "SyntaxError: Unexpected token"')) + call coc#client#check_version() + endif + if get(g:, 'coc_disable_uncaught_error', 0) | return | endif + call coc#ui#echo_messages('Error', data) +endfunction + +function! coc#client#check_version() abort + if (has_key(g:, 'coc_node_path')) + let node = expand(g:coc_node_path) + else + let node = $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH + endif + let output = system(node . ' --version') + let msgs = [] + if v:shell_error + let msgs = ['Unexpected result from node --version'] + split(output, '\n') + else + let ms = matchlist(output, 'v\(\d\+\).\(\d\+\).\(\d\+\)') + if empty(ms) + let msgs = ['Unable to detect version of node, make sure your node executable is http://nodejs.org/'] + elseif str2nr(ms[1]) < 14 || (str2nr(ms[1]) == 14 && str2nr(ms[2]) < 14) + let msgs = ['Current Node.js version '.trim(output).' < 14.14.0 ', 'Please upgrade your node.js'] + endif + endif + if !empty(msgs) + call coc#notify#create(msgs, { + \ 'borderhighlight': 'CocErrorSign', + \ 'highlight': 'Normal', + \ 'timeout': 50000, + \ 'kind': 'error', + \ }) + endif endfunction function! s:on_exit(name, code) abort diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/color.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/color.vim new file mode 100644 index 0000000..b5d569d --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/color.vim @@ -0,0 +1,626 @@ +scriptencoding utf-8 + +let s:activate = "" +let s:quit = "" +if has("gui_macvim") && has('gui_running') + let s:app = "MacVim" +elseif $TERM_PROGRAM ==# "Apple_Terminal" + let s:app = "Terminal" +elseif $TERM_PROGRAM ==# "iTerm.app" + let s:app = "iTerm2" +elseif has('mac') + let s:app = "System Events" + let s:quit = "quit" + let s:activate = 'activate' +endif + +let s:patterns = {} +let s:patterns['hex'] = '\v#?(\x{2})(\x{2})(\x{2})' +let s:patterns['shortHex'] = '\v#(\x{1})(\x{1})(\x{1})' + +let s:xterm_colors = { + \ '0': '#000000', '1': '#800000', '2': '#008000', '3': '#808000', '4': '#000080', + \ '5': '#800080', '6': '#008080', '7': '#c0c0c0', '8': '#808080', '9': '#ff0000', + \ '10': '#00ff00', '11': '#ffff00', '12': '#0000ff', '13': '#ff00ff', '14': '#00ffff', + \ '15': '#ffffff', '16': '#000000', '17': '#00005f', '18': '#000087', '19': '#0000af', + \ '20': '#0000df', '21': '#0000ff', '22': '#005f00', '23': '#005f5f', '24': '#005f87', + \ '25': '#005faf', '26': '#005fdf', '27': '#005fff', '28': '#008700', '29': '#00875f', + \ '30': '#008787', '31': '#0087af', '32': '#0087df', '33': '#0087ff', '34': '#00af00', + \ '35': '#00af5f', '36': '#00af87', '37': '#00afaf', '38': '#00afdf', '39': '#00afff', + \ '40': '#00df00', '41': '#00df5f', '42': '#00df87', '43': '#00dfaf', '44': '#00dfdf', + \ '45': '#00dfff', '46': '#00ff00', '47': '#00ff5f', '48': '#00ff87', '49': '#00ffaf', + \ '50': '#00ffdf', '51': '#00ffff', '52': '#5f0000', '53': '#5f005f', '54': '#5f0087', + \ '55': '#5f00af', '56': '#5f00df', '57': '#5f00ff', '58': '#5f5f00', '59': '#5f5f5f', + \ '60': '#5f5f87', '61': '#5f5faf', '62': '#5f5fdf', '63': '#5f5fff', '64': '#5f8700', + \ '65': '#5f875f', '66': '#5f8787', '67': '#5f87af', '68': '#5f87df', '69': '#5f87ff', + \ '70': '#5faf00', '71': '#5faf5f', '72': '#5faf87', '73': '#5fafaf', '74': '#5fafdf', + \ '75': '#5fafff', '76': '#5fdf00', '77': '#5fdf5f', '78': '#5fdf87', '79': '#5fdfaf', + \ '80': '#5fdfdf', '81': '#5fdfff', '82': '#5fff00', '83': '#5fff5f', '84': '#5fff87', + \ '85': '#5fffaf', '86': '#5fffdf', '87': '#5fffff', '88': '#870000', '89': '#87005f', + \ '90': '#870087', '91': '#8700af', '92': '#8700df', '93': '#8700ff', '94': '#875f00', + \ '95': '#875f5f', '96': '#875f87', '97': '#875faf', '98': '#875fdf', '99': '#875fff', + \ '100': '#878700', '101': '#87875f', '102': '#878787', '103': '#8787af', '104': '#8787df', + \ '105': '#8787ff', '106': '#87af00', '107': '#87af5f', '108': '#87af87', '109': '#87afaf', + \ '110': '#87afdf', '111': '#87afff', '112': '#87df00', '113': '#87df5f', '114': '#87df87', + \ '115': '#87dfaf', '116': '#87dfdf', '117': '#87dfff', '118': '#87ff00', '119': '#87ff5f', + \ '120': '#87ff87', '121': '#87ffaf', '122': '#87ffdf', '123': '#87ffff', '124': '#af0000', + \ '125': '#af005f', '126': '#af0087', '127': '#af00af', '128': '#af00df', '129': '#af00ff', + \ '130': '#af5f00', '131': '#af5f5f', '132': '#af5f87', '133': '#af5faf', '134': '#af5fdf', + \ '135': '#af5fff', '136': '#af8700', '137': '#af875f', '138': '#af8787', '139': '#af87af', + \ '140': '#af87df', '141': '#af87ff', '142': '#afaf00', '143': '#afaf5f', '144': '#afaf87', + \ '145': '#afafaf', '146': '#afafdf', '147': '#afafff', '148': '#afdf00', '149': '#afdf5f', + \ '150': '#afdf87', '151': '#afdfaf', '152': '#afdfdf', '153': '#afdfff', '154': '#afff00', + \ '155': '#afff5f', '156': '#afff87', '157': '#afffaf', '158': '#afffdf', '159': '#afffff', + \ '160': '#df0000', '161': '#df005f', '162': '#df0087', '163': '#df00af', '164': '#df00df', + \ '165': '#df00ff', '166': '#df5f00', '167': '#df5f5f', '168': '#df5f87', '169': '#df5faf', + \ '170': '#df5fdf', '171': '#df5fff', '172': '#df8700', '173': '#df875f', '174': '#df8787', + \ '175': '#df87af', '176': '#df87df', '177': '#df87ff', '178': '#dfaf00', '179': '#dfaf5f', + \ '180': '#dfaf87', '181': '#dfafaf', '182': '#dfafdf', '183': '#dfafff', '184': '#dfdf00', + \ '185': '#dfdf5f', '186': '#dfdf87', '187': '#dfdfaf', '188': '#dfdfdf', '189': '#dfdfff', + \ '190': '#dfff00', '191': '#dfff5f', '192': '#dfff87', '193': '#dfffaf', '194': '#dfffdf', + \ '195': '#dfffff', '196': '#ff0000', '197': '#ff005f', '198': '#ff0087', '199': '#ff00af', + \ '200': '#ff00df', '201': '#ff00ff', '202': '#ff5f00', '203': '#ff5f5f', '204': '#ff5f87', + \ '205': '#ff5faf', '206': '#ff5fdf', '207': '#ff5fff', '208': '#ff8700', '209': '#ff875f', + \ '210': '#ff8787', '211': '#ff87af', '212': '#ff87df', '213': '#ff87ff', '214': '#ffaf00', + \ '215': '#ffaf5f', '216': '#ffaf87', '217': '#ffafaf', '218': '#ffafdf', '219': '#ffafff', + \ '220': '#ffdf00', '221': '#ffdf5f', '222': '#ffdf87', '223': '#ffdfaf', '224': '#ffdfdf', + \ '225': '#ffdfff', '226': '#ffff00', '227': '#ffff5f', '228': '#ffff87', '229': '#ffffaf', + \ '230': '#ffffdf', '231': '#ffffff', '232': '#080808', '233': '#121212', '234': '#1c1c1c', + \ '235': '#262626', '236': '#303030', '237': '#3a3a3a', '238': '#444444', '239': '#4e4e4e', + \ '240': '#585858', '241': '#606060', '242': '#666666', '243': '#767676', '244': '#808080', + \ '245': '#8a8a8a', '246': '#949494', '247': '#9e9e9e', '248': '#a8a8a8', '249': '#b2b2b2', + \ '250': '#bcbcbc', '251': '#c6c6c6', '252': '#d0d0d0', '253': '#dadada', '254': '#e4e4e4', + \ '255': '#eeeeee'} + +let s:xterm_16colors = { +\ 'black': '#000000', +\ 'darkblue': '#00008B', +\ 'darkgreen': '#00CD00', +\ 'darkcyan': '#00CDCD', +\ 'darkred': '#CD0000', +\ 'darkmagenta': '#8B008B', +\ 'brown': '#CDCD00', +\ 'darkyellow': '#CDCD00', +\ 'lightgrey': '#E5E5E5', +\ 'lightgray': '#E5E5E5', +\ 'gray': '#E5E5E5', +\ 'grey': '#E5E5E5', +\ 'darkgrey': '#7F7F7F', +\ 'darkgray': '#7F7F7F', +\ 'blue': '#5C5CFF', +\ 'lightblue': '#5C5CFF', +\ 'green': '#00FF00', +\ 'lightgreen': '#00FF00', +\ 'cyan': '#00FFFF', +\ 'lightcyan': '#00FFFF', +\ 'red': '#FF0000', +\ 'lightred': '#FF0000', +\ 'magenta': '#FF00FF', +\ 'lightmagenta': '#FF00FF', +\ 'yellow': '#FFFF00', +\ 'lightyellow': '#FFFF00', +\ 'white': '#FFFFFF', +\ } + +let s:w3c_color_names = { +\ 'aliceblue': '#F0F8FF', +\ 'antiquewhite': '#FAEBD7', +\ 'aqua': '#00FFFF', +\ 'aquamarine': '#7FFFD4', +\ 'azure': '#F0FFFF', +\ 'beige': '#F5F5DC', +\ 'bisque': '#FFE4C4', +\ 'black': '#000000', +\ 'blanchedalmond': '#FFEBCD', +\ 'blue': '#0000FF', +\ 'blueviolet': '#8A2BE2', +\ 'brown': '#A52A2A', +\ 'burlywood': '#DEB887', +\ 'cadetblue': '#5F9EA0', +\ 'chartreuse': '#7FFF00', +\ 'chocolate': '#D2691E', +\ 'coral': '#FF7F50', +\ 'cornflowerblue': '#6495ED', +\ 'cornsilk': '#FFF8DC', +\ 'crimson': '#DC143C', +\ 'cyan': '#00FFFF', +\ 'darkblue': '#00008B', +\ 'darkcyan': '#008B8B', +\ 'darkgoldenrod': '#B8860B', +\ 'darkgray': '#A9A9A9', +\ 'darkgreen': '#006400', +\ 'darkkhaki': '#BDB76B', +\ 'darkmagenta': '#8B008B', +\ 'darkolivegreen': '#556B2F', +\ 'darkorange': '#FF8C00', +\ 'darkorchid': '#9932CC', +\ 'darkred': '#8B0000', +\ 'darksalmon': '#E9967A', +\ 'darkseagreen': '#8FBC8F', +\ 'darkslateblue': '#483D8B', +\ 'darkslategray': '#2F4F4F', +\ 'darkturquoise': '#00CED1', +\ 'darkviolet': '#9400D3', +\ 'deeppink': '#FF1493', +\ 'deepskyblue': '#00BFFF', +\ 'dimgray': '#696969', +\ 'dodgerblue': '#1E90FF', +\ 'firebrick': '#B22222', +\ 'floralwhite': '#FFFAF0', +\ 'forestgreen': '#228B22', +\ 'fuchsia': '#FF00FF', +\ 'gainsboro': '#DCDCDC', +\ 'ghostwhite': '#F8F8FF', +\ 'gold': '#FFD700', +\ 'goldenrod': '#DAA520', +\ 'gray': '#808080', +\ 'green': '#008000', +\ 'greenyellow': '#ADFF2F', +\ 'honeydew': '#F0FFF0', +\ 'hotpink': '#FF69B4', +\ 'indianred': '#CD5C5C', +\ 'indigo': '#4B0082', +\ 'ivory': '#FFFFF0', +\ 'khaki': '#F0E68C', +\ 'lavender': '#E6E6FA', +\ 'lavenderblush': '#FFF0F5', +\ 'lawngreen': '#7CFC00', +\ 'lemonchiffon': '#FFFACD', +\ 'lightblue': '#ADD8E6', +\ 'lightcoral': '#F08080', +\ 'lightcyan': '#E0FFFF', +\ 'lightgoldenrodyellow': '#FAFAD2', +\ 'lightgray': '#D3D3D3', +\ 'lightgreen': '#90EE90', +\ 'lightpink': '#FFB6C1', +\ 'lightsalmon': '#FFA07A', +\ 'lightseagreen': '#20B2AA', +\ 'lightskyblue': '#87CEFA', +\ 'lightslategray': '#778899', +\ 'lightsteelblue': '#B0C4DE', +\ 'lightyellow': '#FFFFE0', +\ 'lime': '#00FF00', +\ 'limegreen': '#32CD32', +\ 'linen': '#FAF0E6', +\ 'magenta': '#FF00FF', +\ 'maroon': '#800000', +\ 'mediumaquamarine': '#66CDAA', +\ 'mediumblue': '#0000CD', +\ 'mediumorchid': '#BA55D3', +\ 'mediumpurple': '#9370D8', +\ 'mediumseagreen': '#3CB371', +\ 'mediumslateblue': '#7B68EE', +\ 'mediumspringgreen': '#00FA9A', +\ 'mediumturquoise': '#48D1CC', +\ 'mediumvioletred': '#C71585', +\ 'midnightblue': '#191970', +\ 'mintcream': '#F5FFFA', +\ 'mistyrose': '#FFE4E1', +\ 'moccasin': '#FFE4B5', +\ 'navajowhite': '#FFDEAD', +\ 'navy': '#000080', +\ 'oldlace': '#FDF5E6', +\ 'olive': '#808000', +\ 'olivedrab': '#6B8E23', +\ 'orange': '#FFA500', +\ 'orangered': '#FF4500', +\ 'orchid': '#DA70D6', +\ 'palegoldenrod': '#EEE8AA', +\ 'palegreen': '#98FB98', +\ 'paleturquoise': '#AFEEEE', +\ 'palevioletred': '#D87093', +\ 'papayawhip': '#FFEFD5', +\ 'peachpuff': '#FFDAB9', +\ 'peru': '#CD853F', +\ 'pink': '#FFC0CB', +\ 'plum': '#DDA0DD', +\ 'powderblue': '#B0E0E6', +\ 'purple': '#800080', +\ 'red': '#FF0000', +\ 'rosybrown': '#BC8F8F', +\ 'royalblue': '#4169E1', +\ 'saddlebrown': '#8B4513', +\ 'salmon': '#FA8072', +\ 'sandybrown': '#F4A460', +\ 'seagreen': '#2E8B57', +\ 'seashell': '#FFF5EE', +\ 'sienna': '#A0522D', +\ 'silver': '#C0C0C0', +\ 'skyblue': '#87CEEB', +\ 'slateblue': '#6A5ACD', +\ 'slategray': '#708090', +\ 'snow': '#FFFAFA', +\ 'springgreen': '#00FF7F', +\ 'steelblue': '#4682B4', +\ 'tan': '#D2B48C', +\ 'teal': '#008080', +\ 'thistle': '#D8BFD8', +\ 'tomato': '#FF6347', +\ 'turquoise': '#40E0D0', +\ 'violet': '#EE82EE', +\ 'wheat': '#F5DEB3', +\ 'white': '#FFFFFF', +\ 'whitesmoke': '#F5F5F5', +\ 'yellow': '#FFFF00', +\ 'yellowgreen': '#9ACD32' +\ } + +" Returns an approximate grey index for the given grey level +fun! s:grey_number(x) + if &t_Co == 88 + if a:x < 23 + return 0 + elseif a:x < 69 + return 1 + elseif a:x < 103 + return 2 + elseif a:x < 127 + return 3 + elseif a:x < 150 + return 4 + elseif a:x < 173 + return 5 + elseif a:x < 196 + return 6 + elseif a:x < 219 + return 7 + elseif a:x < 243 + return 8 + else + return 9 + endif + else + if a:x < 14 + return 0 + else + let l:n = (a:x - 8) / 10 + let l:m = (a:x - 8) % 10 + if l:m < 5 + return l:n + else + return l:n + 1 + endif + endif + endif +endfun + +" Returns the actual grey level represented by the grey index +fun! s:grey_level(n) + if &t_Co == 88 + if a:n == 0 + return 0 + elseif a:n == 1 + return 46 + elseif a:n == 2 + return 92 + elseif a:n == 3 + return 115 + elseif a:n == 4 + return 139 + elseif a:n == 5 + return 162 + elseif a:n == 6 + return 185 + elseif a:n == 7 + return 208 + elseif a:n == 8 + return 231 + else + return 255 + endif + else + if a:n == 0 + return 0 + else + return 8 + (a:n * 10) + endif + endif +endfun + +" Returns the palette index for the given grey index +fun! s:grey_colour(n) + if &t_Co == 88 + if a:n == 0 + return 16 + elseif a:n == 9 + return 79 + else + return 79 + a:n + endif + else + if a:n == 0 + return 16 + elseif a:n == 25 + return 231 + else + return 231 + a:n + endif + endif +endfun + +" Returns an approximate colour index for the given colour level +fun! s:rgb_number(x) + if &t_Co == 88 + if a:x < 69 + return 0 + elseif a:x < 172 + return 1 + elseif a:x < 230 + return 2 + else + return 3 + endif + else + if a:x < 75 + return 0 + else + let l:n = (a:x - 55) / 40 + let l:m = (a:x - 55) % 40 + if l:m < 20 + return l:n + else + return l:n + 1 + endif + endif + endif +endfun + +" Returns the palette index for the given R/G/B colour indices +fun! s:rgb_colour(x, y, z) + if &t_Co == 88 + return 16 + (a:x * 16) + (a:y * 4) + a:z + else + return 16 + (a:x * 36) + (a:y * 6) + a:z + endif +endfun + +" Returns the actual colour level for the given colour index +fun! s:rgb_level(n) + if &t_Co == 88 + if a:n == 0 + return 0 + elseif a:n == 1 + return 139 + elseif a:n == 2 + return 205 + else + return 255 + endif + else + if a:n == 0 + return 0 + else + return 55 + (a:n * 40) + endif + endif +endfun + +" Returns the palette index to approximate the given R/G/B colour levels +fun! s:colour(r, g, b) + " Get the closest grey + let l:gx = s:grey_number(a:r) + let l:gy = s:grey_number(a:g) + let l:gz = s:grey_number(a:b) + + " Get the closest colour + let l:x = s:rgb_number(a:r) + let l:y = s:rgb_number(a:g) + let l:z = s:rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = s:grey_level(l:gx) - a:r + let l:dgg = s:grey_level(l:gy) - a:g + let l:dgb = s:grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = s:rgb_level(l:gx) - a:r + let l:dg = s:rgb_level(l:gy) - a:g + let l:db = s:rgb_level(l:gz) - a:b + let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) + if l:dgrey < l:drgb + " Use the grey + return s:grey_colour(l:gx) + else + " Use the colour + return s:rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return s:rgb_colour(l:x, l:y, l:z) + endif +endfun + +function! coc#color#term2rgb(term) abort + if a:term < 0 || a:term > 255 + return '#000000' + endif + return s:xterm_colors[a:term] +endfunction + +function! coc#color#rgb2term(rgb) + let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 + let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 + let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 + return s:colour(l:r, l:g, l:b) +endfunction + +function! coc#color#rgbToHex(...) + let [r, g, b] = ( a:0==1 ? a:1 : a:000 ) + let num = printf('%02x', float2nr(r)) . '' + \ . printf('%02x', float2nr(g)) . '' + \ . printf('%02x', float2nr(b)) . '' + return '#' . num +endfunction + +function! coc#color#hexToRgb(color) + if type(a:color) == 2 + let color = printf('%x', a:color) + else + let color = a:color + end + let matches = matchlist(color, s:patterns['hex']) + let factor = 0x1 + if empty(matches) + let matches = matchlist(color, s:patterns['shortHex']) + let factor = 0x10 + end + if len(matches) < 4 + echohl Error + echom 'Couldnt parse ' . string(color) . ' ' . string(matches) + echohl None + return + end + let r = str2nr(matches[1], 16) * factor + let g = str2nr(matches[2], 16) * factor + let b = str2nr(matches[3], 16) * factor + return [r, g, b] +endfunction + +" @params String color The color +" @params {Number|String|Float} [amount=5] The percentage of light +function! coc#color#lighten(color, ...) + let amount = a:0 ? + \(type(a:1) < 2 ? + \str2float(a:1) : a:1 ) + \: 5.0 + if(amount < 1.0) + let amount = 1.0 + amount + else + let amount = 1.0 + (amount / 100.0) + end + let rgb = coc#color#hexToRgb(a:color) + let rgb = map(rgb, 'v:val * amount') + let rgb = map(rgb, 'v:val > 255.0 ? 255.0 : v:val') + let rgb = map(rgb, 'float2nr(v:val)') + let hex = coc#color#rgbToHex(rgb) + return hex +endfunction + +" @params String color The color +" @params {Number|String|Float} [amount=5] The percentage of darkness +function! coc#color#darken(color, ...) + let amount = a:0 ? + \(type(a:1) < 2 ? + \str2float(a:1) : a:1 ) + \: 5.0 + if(amount < 1.0) + let amount = 1.0 - amount + else + let amount = 1.0 - (amount / 100.0) + end + if(amount < 0.0) + let amount = 0.0 | end + let rgb = coc#color#hexToRgb(a:color) + let rgb = map(rgb, 'v:val * amount') + let rgb = map(rgb, 'v:val > 255.0 ? 255.0 : v:val') + let rgb = map(rgb, 'float2nr(v:val)') + let hex = coc#color#rgbToHex(rgb) + return hex +endfu + +function! coc#color#luminance(rgb) abort + let vals = [] + for val in a:rgb + let val = (val + 0.0)/255 + if val <= 0.03928 + call add(vals, val/12.92) + else + call add(vals, pow((val + 0.055)/1.055, 2.4)) + endif + endfor + return vals[0] * 0.2126 + vals[1] * 0.7152 + vals[2] * 0.0722 +endfunction + +function! coc#color#contrast(rgb1, rgb2) abort + let lnum1 = coc#color#luminance(a:rgb1) + let lnum2 = coc#color#luminance(a:rgb2) + let brightest = lnum1 > lnum2 ? lnum1 : lnum2 + let darkest = lnum1 < lnum2 ? lnum1 : lnum2 + return (brightest + 0.05) / (darkest + 0.05) +endfunction + +function! coc#color#hex_contrast(hex1, hex2) abort + return coc#color#contrast(coc#color#hexToRgb(a:hex1), coc#color#hexToRgb(a:hex2)) +endfunction + +function! coc#color#nameToHex(name, term) abort + if a:term + return has_key(s:xterm_16colors, a:name) ? s:xterm_16colors[a:name] : v:null + endif + return has_key(s:w3c_color_names, a:name) ? s:w3c_color_names[a:name] : v:null +endfunction + +" [r, g, b] ['255', '255', '255'] +" return ['65535', '65535', '65535'] or return v:false to cancel +function! coc#color#pick_color(default_color) + if has('mac') + let default_color = map(a:default_color, {idx, val -> str2nr(val) * 65535 / 255 }) + " This is the AppleScript magic: + let ascrpt = ['-e "tell application \"' . s:app . '\""', + \ '-e "' . s:activate . '"', + \ "-e \"set AppleScript's text item delimiters to {\\\",\\\"}\"", + \ '-e "set theColor to (choose color default color {' . default_color[0] . ", " . default_color[1] . ", " . default_color[2] . '}) as text"', + \ '-e "' . s:quit . '"', + \ '-e "end tell"', + \ '-e "return theColor"'] + let res = trim(system("osascript " . join(ascrpt, ' ') . " 2>/dev/null")) + if empty(res) + return v:false + else + return split(trim(res), ',') + endif + endif + + let hex_color = printf('#%02x%02x%02x', a:default_color[0], a:default_color[1], a:default_color[2]) + + if has('unix') + if executable('zenity') + let res = trim(system('zenity --title="Select a color" --color-selection --color="' . hex_color . '" 2> /dev/null')) + if empty(res) + return v:false + else + " res format is rgb(255,255,255) + return map(split(res[4:-2], ','), {idx, val -> string(str2nr(trim(val)) * 65535 / 255)}) + endif + endif + endif + + let rgb = v:false + if !has('python') + echohl Error | echom 'python support required, checkout :echo has(''python'')' | echohl None + return + endif + try + execute 'py import gtk' + catch /.*/ + echohl Error | echom 'python gtk module not found' | echohl None + return + endtry +python << endpython + +import vim +import gtk, sys + +# message strings +wnd_title_insert = "Insert a color" + +csd = gtk.ColorSelectionDialog(wnd_title_insert) +cs = csd.colorsel + +cs.set_current_color(gtk.gdk.color_parse(vim.eval("hex_color"))) + +cs.set_current_alpha(65535) +cs.set_has_opacity_control(False) +# cs.set_has_palette(int(vim.eval("s:display_palette"))) + +if csd.run()==gtk.RESPONSE_OK: + c = cs.get_current_color() + s = [str(int(c.red)),',',str(int(c.green)),',',str(int(c.blue))] + thecolor = ''.join(s) + vim.command(":let rgb = split('%s',',')" % thecolor) + +csd.destroy() + +endpython + return rgb +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/compat.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/compat.vim new file mode 100644 index 0000000..eb88e29 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/compat.vim @@ -0,0 +1,222 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') + +" first window id for bufnr +" builtin bufwinid returns window of current tab only +function! coc#compat#buf_win_id(bufnr) abort + let info = filter(getwininfo(), 'v:val["bufnr"] =='.a:bufnr) + if empty(info) + return -1 + endif + return info[0]['winid'] +endfunction + +function! coc#compat#buf_set_lines(bufnr, start, end, replacement) abort + if s:is_vim + call coc#api#exec('buf_set_lines', [a:bufnr, a:start, a:end, 0, a:replacement]) + else + call nvim_buf_set_lines(a:bufnr, a:start, a:end, 0, a:replacement) + endif +endfunction + +function! coc#compat#buf_line_count(bufnr) abort + if exists('*nvim_buf_line_count') + return nvim_buf_line_count(a:bufnr) + endif + if bufnr('%') == a:bufnr + return line('$') + endif + if exists('*getbufinfo') + let info = getbufinfo(a:bufnr) + if empty(info) + return 0 + endif + " vim 8.1 has getbufinfo but no linecount + if has_key(info[0], 'linecount') + return info[0]['linecount'] + endif + endif + if exists('*getbufline') + let lines = getbufline(a:bufnr, 1, '$') + return len(lines) + endif + let curr = bufnr('%') + execute 'noa buffer '.a:bufnr + let n = line('$') + execute 'noa buffer '.curr + return n +endfunction + +function! coc#compat#prepend_lines(bufnr, replacement) abort + if exists('*appendbufline') + call appendbufline(a:bufnr, 0, a:replacement) + elseif !s:is_vim + call nvim_buf_set_lines(a:bufnr, 0, 0, 0, a:replacement) + else + throw 'appendbufline() required for prepend lines.' + endif +endfunction + +function! coc#compat#win_is_valid(winid) abort + if exists('*nvim_win_is_valid') + return nvim_win_is_valid(a:winid) + endif + return !empty(getwininfo(a:winid)) +endfunction + +" clear matches by window id, not throw on none exists window. +" may not work on vim < 8.1.1084 & neovim < 0.4.0 +function! coc#compat#clear_matches(winid) abort + if !coc#compat#win_is_valid(a:winid) + return + endif + let curr = win_getid() + if curr == a:winid + call clearmatches() + return + endif + if s:is_vim + if has('patch-8.1.1084') + call clearmatches(a:winid) + endif + else + if exists('*nvim_set_current_win') + noa call nvim_set_current_win(a:winid) + call clearmatches() + noa call nvim_set_current_win(curr) + endif + endif +endfunction + +function! coc#compat#matchaddpos(group, pos, priority, winid) abort + let curr = win_getid() + if curr == a:winid + call matchaddpos(a:group, a:pos, a:priority, -1) + else + if s:is_vim + if has('patch-8.1.0218') + call matchaddpos(a:group, a:pos, a:priority, -1, {'window': a:winid}) + endif + else + call matchaddpos(a:group, a:pos, a:priority, -1, {'window': a:winid}) + endif + endif +endfunction + +function! coc#compat#buf_del_var(bufnr, name) abort + if !bufloaded(a:bufnr) + return + endif + if exists('*nvim_buf_del_var') + silent! call nvim_buf_del_var(a:bufnr, a:name) + else + if a:bufnr == bufnr('%') + execute 'unlet! b:'.a:name + elseif exists('*win_execute') + let winid = coc#compat#buf_win_id(a:bufnr) + if winid != -1 + call win_execute(winid, 'unlet! b:'.a:name) + endif + endif + endif +endfunction + +" hlGroup, pos, priority +function! coc#compat#matchaddgroups(winid, groups) abort + for group in a:groups + call matchaddpos(group['hlGroup'], [group['pos']], group['priority'], -1, {'window': a:winid}) + endfor +endfunction + +function! coc#compat#del_var(name) abort + if exists('*nvim_del_var') + silent! call nvim_del_var(a:name) + else + execute 'unlet! '.a:name + endif +endfunction + +" remove keymap for specific buffer +function! coc#compat#buf_del_keymap(bufnr, mode, lhs) abort + if !bufloaded(a:bufnr) + return + endif + if exists('*nvim_buf_del_keymap') + try + call nvim_buf_del_keymap(a:bufnr, a:mode, a:lhs) + catch /^Vim\%((\a\+)\)\=:E5555/ + " ignore keymap doesn't exist + endtry + return + endif + if bufnr == a:bufnr + execute 'silent! '.a:mode.'unmap '.a:lhs + return + endif + if exists('*win_execute') + let winid = coc#compat#buf_win_id(a:bufnr) + if winid != -1 + call win_execute(winid, a:mode.'unmap '.a:lhs, 'silent!') + endif + endif +endfunction + +function! coc#compat#buf_add_keymap(bufnr, mode, lhs, rhs, opts) abort + if !bufloaded(a:bufnr) + return + endif + if exists('*nvim_buf_set_keymap') + call nvim_buf_set_keymap(a:bufnr, a:mode, a:lhs, a:rhs, a:opts) + else + let cmd = a:mode . 'noremap ' + for key in keys(a:opts) + if get(a:opts, key, 0) + let cmd .= '<'.key.'>' + endif + endfor + let cmd .= ' '.a:lhs.' '.a:rhs + if bufnr('%') == a:bufnr + execute cmd + elseif exists('*win_execute') + let winid = coc#compat#buf_win_id(a:bufnr) + if winid != -1 + call win_execute(winid, cmd) + endif + endif + endif +endfunction + +" execute command or list of commands in window +function! coc#compat#execute(winid, command, ...) abort + if exists('*win_execute') + if type(a:command) == v:t_string + keepalt call win_execute(a:winid, a:command, get(a:, 1, '')) + elseif type(a:command) == v:t_list + keepalt call win_execute(a:winid, join(a:command, "\n"), get(a:, 1, '')) + endif + elseif has('nvim') + if !nvim_win_is_valid(a:winid) + return + endif + let curr = nvim_get_current_win() + noa keepalt call nvim_set_current_win(a:winid) + if type(a:command) == v:t_string + exe get(a:, 1, '').' '.a:command + elseif type(a:command) == v:t_list + for cmd in a:command + exe get(a:, 1, '').' '.cmd + endfor + endif + noa keepalt call nvim_set_current_win(curr) + else + throw 'win_execute does not exist, please upgrade vim.' + endif +endfunc + +function! coc#compat#trim(str) + if exists('*trim') + return trim(a:str) + endif + " TODO trim from beginning + return substitute(a:str, '\s\+$', '', '') +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/cursor.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/cursor.vim new file mode 100644 index 0000000..d9cfa2c --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/cursor.vim @@ -0,0 +1,60 @@ +scriptencoding utf-8 + +" Position of cursor relative to screen cell +function! coc#cursor#screen_pos() abort + let nr = winnr() + let [row, col] = win_screenpos(nr) + return [row + winline() - 2, col + wincol() - 2] +endfunction + +function! coc#cursor#move_by_col(delta) + let pos = getcurpos() + call cursor(pos[1], pos[2] + a:delta) +endfunction + +" Get cursor position. +function! coc#cursor#position() + return [line('.') - 1, strchars(strpart(getline('.'), 0, col('.') - 1))] +endfunction + +" Move cursor to position. +function! coc#cursor#move_to(line, character) abort + let content = getline(a:line + 1) + let pre = strcharpart(content, 0, a:character) + let col = strlen(pre) + 1 + call cursor(a:line + 1, col) +endfunction + +" Character offset of current cursor, vim provide bytes offset only. +function! coc#cursor#char_offset() abort + let offset = 0 + let lnum = line('.') + for i in range(1, lnum) + if i == lnum + let offset += strchars(strpart(getline('.'), 0, col('.')-1)) + else + let offset += strchars(getline(i)) + 1 + endif + endfor + return offset +endfunction + +" Returns latest selection range +function! coc#cursor#get_selection(char) abort + let m = a:char ? 'char' : visualmode() + if empty(m) + return v:null + endif + let [_, sl, sc, soff] = getpos(m ==# 'char' ? "'[" : "'<") + let [_, el, ec, eoff] = getpos(m ==# 'char' ? "']" : "'>") + let start_idx = coc#string#get_character(getline(sl), sc) + if m ==# 'V' + return [sl - 1, start_idx, el, 0] + endif + let line = getline(el) + let end_idx = coc#string#get_character(line, ec) + if m !=# 'char' + let end_idx = end_idx == strchars(line) ? end_idx : end_idx + 1 + endif + return [sl - 1, start_idx, el - 1, end_idx] +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/dialog.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/dialog.vim new file mode 100644 index 0000000..3f9e0c4 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/dialog.vim @@ -0,0 +1,667 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') +let s:root = expand(':h:h:h') +let s:prompt_win_bufnr = 0 +let s:list_win_bufnr = 0 +let s:prompt_win_width = get(g:, 'coc_prompt_win_width', 32) +let s:frames = ['· ', '·· ', '···', ' ··', ' ·', ' '] +let s:sign_group = 'PopUpCocDialog' +let s:detail_bufnr = 0 + +" Float window aside pum +function! coc#dialog#create_pum_float(lines, config) abort + let winid = coc#float#get_float_by_kind('pumdetail') + if empty(a:lines) || !coc#pum#visible() + if winid + call coc#float#close(winid) + endif + return + endif + let pumbounding = coc#pum#info() + let border = get(a:config, 'border', []) + let pw = pumbounding['width'] + (pumbounding['border'] ? 0 : get(pumbounding, 'scrollbar', 0)) + let rp = &columns - pumbounding['col'] - pw + let showRight = pumbounding['col'] > rp ? 0 : 1 + let maxWidth = showRight ? coc#math#min(rp - 1, a:config['maxWidth']) : coc#math#min(pumbounding['col'] - 1, a:config['maxWidth']) + let bh = get(border, 0 ,0) + get(border, 2, 0) + let maxHeight = &lines - pumbounding['row'] - &cmdheight - 1 - bh + if maxWidth <= 2 || maxHeight < 1 + return v:null + endif + let width = 0 + for line in a:lines + let dw = max([1, strdisplaywidth(line)]) + let width = max([width, dw + 2]) + endfor + let width = float2nr(coc#math#min(maxWidth, width)) + let ch = coc#string#content_height(a:lines, width - 2) + let height = float2nr(coc#math#min(maxHeight, ch)) + let lines = map(a:lines, {_, s -> s =~# '^─' ? repeat('─', width - 2 + (s:is_vim && ch > height ? -1 : 0)) : s}) + let opts = { + \ 'lines': lines, + \ 'highlights': get(a:config, 'highlights', []), + \ 'relative': 'editor', + \ 'col': showRight ? pumbounding['col'] + pw : pumbounding['col'] - width, + \ 'row': pumbounding['row'], + \ 'height': height, + \ 'width': width - 2 + (s:is_vim && ch > height ? -1 : 0), + \ 'scrollinside': showRight ? 0 : 1, + \ 'codes': get(a:config, 'codes', []), + \ } + for key in ['border', 'highlight', 'borderhighlight', 'winblend', 'focusable', 'shadow', 'rounded'] + if has_key(a:config, key) + let opts[key] = a:config[key] + endif + endfor + call s:close_auto_hide_wins(winid) + let result = coc#float#create_float_win(winid, s:detail_bufnr, opts) + if empty(result) + return + endif + let s:detail_bufnr = result[1] + call setwinvar(result[0], 'kind', 'pumdetail') + if !s:is_vim + call coc#float#nvim_scrollbar(result[0]) + endif +endfunction + +" Float window below/above cursor +function! coc#dialog#create_cursor_float(winid, bufnr, lines, config) abort + if coc#prompt#activated() + return v:null + endif + let pumAlignTop = get(a:config, 'pumAlignTop', 0) + let modes = get(a:config, 'modes', ['n', 'i', 'ic', 's']) + let mode = mode() + let currbuf = bufnr('%') + let pos = [line('.'), col('.')] + if index(modes, mode) == -1 + return v:null + endif + if !s:is_vim && !has('nvim-0.5.0') && mode ==# 'i' + " helps to fix undo issue, don't know why. + call feedkeys("\u", 'n') + endif + if mode ==# 's' && has('patch-8.2.4969') && !has('patch-8.2.4996') + echohl WarningMsg | echon 'Popup not created to avoid issue #10466 on vim >= 8.2.4969' | echohl None + return v:null + endif + let dimension = coc#dialog#get_config_cursor(a:lines, a:config) + if empty(dimension) + return v:null + endif + if coc#pum#visible() && ((pumAlignTop && dimension['row'] <0)|| (!pumAlignTop && dimension['row'] > 0)) + return v:null + endif + let width = dimension['width'] + let lines = map(a:lines, {_, s -> s =~# '^─' ? repeat('─', width) : s}) + let config = extend(extend({'lines': lines, 'relative': 'cursor'}, a:config), dimension) + call s:close_auto_hide_wins(a:winid) + let res = coc#float#create_float_win(a:winid, a:bufnr, config) + if empty(res) + return v:null + endif + let alignTop = dimension['row'] < 0 + let winid = res[0] + let bufnr = res[1] + redraw + if has('nvim') + call coc#float#nvim_scrollbar(winid) + endif + return [currbuf, pos, winid, bufnr, alignTop] +endfunction + +" Create float window for input +function! coc#dialog#create_prompt_win(title, default, opts) abort + call s:close_auto_hide_wins() + let bufnr = has('nvim') ? s:prompt_win_bufnr : 0 + if s:is_vim + execute 'hi link CocPopupTerminal '.get(a:opts, 'highlight', 'CocFloating') + let node = expand(get(g:, 'coc_node_path', 'node')) + let bufnr = term_start([node, s:root . '/bin/prompt.js', a:default], { + \ 'term_rows': 1, + \ 'term_highlight': 'CocPopupTerminal', + \ 'hidden': 1, + \ 'term_finish': 'close' + \ }) + call term_setapi(bufnr, 'Coc') + call setbufvar(bufnr, 'current', type(a:default) == v:t_string ? a:default : '') + endif + let config = s:get_prompt_dimension(a:title, a:default, a:opts) + let res = coc#float#create_float_win(0, bufnr, extend(config, { + \ 'style': 'minimal', + \ 'border': get(a:opts, 'border', [1,1,1,1]), + \ 'rounded': get(a:opts, 'rounded', 1), + \ 'prompt': 1, + \ 'title': a:title, + \ 'lines': s:is_vim ? v:null : [a:default], + \ 'highlight': get(a:opts, 'highlight', 'CocFloating'), + \ 'borderhighlight': [get(a:opts, 'borderhighlight', 'CocFloating')], + \ })) + if empty(res) + return + endif + let winid = res[0] + let bufnr = res[1] + if has('nvim') + let s:prompt_win_bufnr = res[1] + call sign_unplace(s:sign_group, { 'buffer': s:prompt_win_bufnr }) + call nvim_set_current_win(winid) + inoremap + inoremap pumvisible() ? "\" : "\" + exe 'imap ' + exe 'nnoremap :call coc#float#close('.winid.')' + exe 'inoremap "\=coc#dialog#prompt_insert(getline(''.''))\\"' + if get(a:opts, 'list', 0) + for key in ['', '', '', '', '', '', '', '', ''] + " Can't use < in remap + let escaped = key ==# '' ? "C-@" : strcharpart(key, 1, strchars(key) - 2) + exe 'inoremap '.key.' call coc#rpc#notify("PromptKeyPress", ['.bufnr.', "'.escaped.'"])' + endfor + endif + call feedkeys('A', 'in') + endif + call coc#util#do_autocmd('CocOpenFloatPrompt') + if s:is_vim + let pos = popup_getpos(winid) + " width height row col + let dimension = [pos['width'], pos['height'], pos['line'] - 1, pos['col'] - 1] + else + let id = coc#float#get_related(winid, 'border') + if !has('nvim-0.6.0') + redraw + endif + let pos = nvim_win_get_position(id) + let dimension = [nvim_win_get_width(id), nvim_win_get_height(id), pos[0], pos[1]] + endif + return [bufnr, winid, dimension] +endfunction + +" Create list window under target window +function! coc#dialog#create_list(target, dimension, opts) abort + let maxHeight = get(a:opts, 'maxHeight', 10) + let height = max([1, len(get(a:opts, 'lines', []))]) + let height = min([maxHeight, height, &lines - &cmdheight - 1 - a:dimension['row'] + a:dimension['height']]) + let chars = get(a:opts, 'rounded', 1) ? ['╯', '╰'] : ['┘', '└'] + let config = extend(copy(a:opts), { + \ 'relative': 'editor', + \ 'row': a:dimension['row'] + a:dimension['height'], + \ 'col': a:dimension['col'], + \ 'width': a:dimension['width'] - 2, + \ 'height': height, + \ 'border': [1, 1, 1, 1], + \ 'scrollinside': 1, + \ 'borderchars': extend(['─', '│', '─', '│', '├', '┤'], chars) + \ }) + let bufnr = 0 + let result = coc#float#create_float_win(0, s:list_win_bufnr, config) + if empty(result) + return + endif + let winid = result[0] + call coc#float#add_related(winid, a:target) + call setwinvar(winid, 'auto_height', get(a:opts, 'autoHeight', 1)) + call setwinvar(winid, 'max_height', maxHeight) + call setwinvar(winid, 'target_winid', a:target) + call setwinvar(winid, 'kind', 'list') + call coc#dialog#check_scroll_vim(a:target) + return result +endfunction + +" Create menu picker for pick single item +function! coc#dialog#create_menu(lines, config) abort + call s:close_auto_hide_wins() + let highlight = get(a:config, 'highlight', 'CocFloating') + let borderhighlight = get(a:config, 'borderhighlight', [highlight]) + let relative = get(a:config, 'relative', 'cursor') + let lines = copy(a:lines) + let content = get(a:config, 'content', '') + let maxWidth = get(a:config, 'maxWidth', 80) + let highlights = get(a:config, 'highlights', []) + let contentCount = 0 + if !empty(content) + let contentLines = coc#string#reflow(split(content, '\r\?\n'), maxWidth) + let contentCount = len(contentLines) + let lines = extend(contentLines, lines) + if !empty(highlights) + for item in highlights + let item['lnum'] = item['lnum'] + contentCount + endfor + endif + endif + let opts = { + \ 'lines': lines, + \ 'highlight': highlight, + \ 'title': get(a:config, 'title', ''), + \ 'borderhighlight': borderhighlight, + \ 'maxWidth': maxWidth, + \ 'maxHeight': get(a:config, 'maxHeight', 80), + \ 'rounded': get(a:config, 'rounded', 0), + \ 'border': [1, 1, 1, 1], + \ 'highlights': highlights, + \ 'relative': relative, + \ } + if relative ==# 'editor' + let dimension = coc#dialog#get_config_editor(lines, opts) + else + let dimension = coc#dialog#get_config_cursor(lines, opts) + endif + call extend(opts, dimension) + let ids = coc#float#create_float_win(0, s:prompt_win_bufnr, opts) + if empty(ids) + return + endif + let s:prompt_win_bufnr = ids[1] + call coc#dialog#set_cursor(ids[0], ids[1], contentCount + 1) + redraw + if has('nvim') + call coc#float#nvim_scrollbar(ids[0]) + endif + return [ids[0], ids[1], contentCount] +endfunction + +" Create dialog at center of screen +function! coc#dialog#create_dialog(lines, config) abort + call s:close_auto_hide_wins() + " dialog always have borders + let title = get(a:config, 'title', '') + let buttons = get(a:config, 'buttons', []) + let highlight = get(a:config, 'highlight', 'CocFloating') + let borderhighlight = get(a:config, 'borderhighlight', [highlight]) + let opts = { + \ 'title': title, + \ 'rounded': get(a:config, 'rounded', 0), + \ 'relative': 'editor', + \ 'border': [1,1,1,1], + \ 'close': get(a:config, 'close', 1), + \ 'highlight': highlight, + \ 'highlights': get(a:config, 'highlights', []), + \ 'buttons': buttons, + \ 'borderhighlight': borderhighlight, + \ 'getchar': get(a:config, 'getchar', 0) + \ } + call extend(opts, coc#dialog#get_config_editor(a:lines, a:config)) + let bufnr = coc#float#create_buf(0, a:lines) + let res = coc#float#create_float_win(0, bufnr, opts) + if empty(res) + return + endif + if get(a:config, 'cursorline', 0) + call coc#dialog#place_sign(bufnr, 1) + endif + if has('nvim') + redraw + call coc#float#nvim_scrollbar(res[0]) + endif + return res +endfunction + +function! coc#dialog#prompt_confirm(title, cb) abort + call s:close_auto_hide_wins() + if s:is_vim && exists('*popup_dialog') + try + call popup_dialog(a:title. ' (y/n)?', { + \ 'highlight': 'Normal', + \ 'filter': 'popup_filter_yesno', + \ 'callback': {id, res -> a:cb(v:null, res)}, + \ 'borderchars': get(g:, 'coc_borderchars', ['─', '│', '─', '│', '╭', '╮', '╯', '╰']), + \ 'borderhighlight': ['MoreMsg'] + \ }) + catch /.*/ + call a:cb(v:exception) + endtry + return + endif + let text = ' '. a:title . ' (y/n)? ' + let maxWidth = coc#math#min(78, &columns - 2) + let width = coc#math#min(maxWidth, strdisplaywidth(text)) + let maxHeight = &lines - &cmdheight - 1 + let height = coc#math#min(maxHeight, float2nr(ceil(str2float(string(strdisplaywidth(text)))/width))) + let arr = coc#float#create_float_win(0, s:prompt_win_bufnr, { + \ 'col': &columns/2 - width/2 - 1, + \ 'row': maxHeight/2 - height/2 - 1, + \ 'width': width, + \ 'height': height, + \ 'border': [1,1,1,1], + \ 'focusable': v:false, + \ 'relative': 'editor', + \ 'highlight': 'Normal', + \ 'borderhighlight': 'MoreMsg', + \ 'style': 'minimal', + \ 'lines': [text], + \ }) + if empty(arr) + call a:cb('Window create failed!') + return + endif + let winid = arr[0] + let s:prompt_win_bufnr = arr[1] + call sign_unplace(s:sign_group, { 'buffer': s:prompt_win_bufnr }) + let res = 0 + redraw + " same result as vim + while 1 + let key = nr2char(getchar()) + if key == "\" + let res = -1 + break + elseif key == "\" || key == 'n' || key == 'N' + let res = 0 + break + elseif key == 'y' || key == 'Y' + let res = 1 + break + endif + endw + call coc#float#close(winid) + call a:cb(v:null, res) +endfunction + +function! coc#dialog#get_config_editor(lines, config) abort + let title = get(a:config, 'title', '') + let maxheight = min([get(a:config, 'maxHeight', 78), &lines - &cmdheight - 6]) + let maxwidth = min([get(a:config, 'maxWidth', 78), &columns - 2]) + let buttons = get(a:config, 'buttons', []) + let minwidth = s:min_btns_width(buttons) + if maxheight <= 0 || maxwidth <= 0 || minwidth > maxwidth + throw 'Not enough spaces for float window' + endif + let ch = 0 + let width = min([strdisplaywidth(title) + 1, maxwidth]) + for line in a:lines + let dw = max([1, strdisplaywidth(line)]) + if dw < maxwidth && dw > width + let width = dw + elseif dw >= maxwidth + let width = maxwidth + endif + let ch += float2nr(ceil(str2float(string(dw))/maxwidth)) + endfor + let width = max([minwidth, width]) + let height = coc#math#min(ch ,maxheight) + return { + \ 'row': &lines/2 - (height + 4)/2, + \ 'col': &columns/2 - (width + 2)/2, + \ 'width': width, + \ 'height': height, + \ } +endfunction + +function! coc#dialog#prompt_insert(text) abort + call coc#rpc#notify('PromptInsert', [a:text, bufnr('%')]) + return '' +endfunction + +" Dimension of window with lines relative to cursor +" Width & height excludes border & padding +function! coc#dialog#get_config_cursor(lines, config) abort + let preferTop = get(a:config, 'preferTop', 0) + let title = get(a:config, 'title', '') + let border = get(a:config, 'border', []) + if empty(border) && len(title) + let border = [1, 1, 1, 1] + endif + let bh = get(border, 0, 0) + get(border, 2, 0) + let vh = &lines - &cmdheight - 1 + if vh <= 0 + return v:null + endif + let maxWidth = coc#math#min(get(a:config, 'maxWidth', &columns - 1), &columns - 1) + if maxWidth < 3 + return v:null + endif + let maxHeight = coc#math#min(get(a:config, 'maxHeight', vh), vh) + let width = coc#math#min(40, strdisplaywidth(title)) + 3 + for line in a:lines + let dw = max([1, strdisplaywidth(line)]) + let width = max([width, dw + 2]) + endfor + let width = coc#math#min(maxWidth, width) + let ch = coc#string#content_height(a:lines, width - 2) + let [lineIdx, colIdx] = coc#cursor#screen_pos() + " How much we should move left + let offsetX = coc#math#min(get(a:config, 'offsetX', 0), colIdx) + let showTop = 0 + let hb = vh - lineIdx -1 + if lineIdx > bh + 2 && (preferTop || (lineIdx > hb && hb < ch + bh)) + let showTop = 1 + endif + let height = coc#math#min(maxHeight, ch + bh, showTop ? lineIdx - 1 : hb) + if height <= bh + return v:null + endif + let col = - max([offsetX, colIdx - (&columns - 1 - width)]) + let row = showTop ? - height + bh : 1 + return { + \ 'row': row, + \ 'col': col, + \ 'width': width - 2, + \ 'height': height - bh + \ } +endfunction + +function! coc#dialog#change_border_hl(winid, hlgroup) abort + if !hlexists(a:hlgroup) + return + endif + if s:is_vim + if coc#float#valid(a:winid) + call popup_setoptions(a:winid, {'borderhighlight': repeat([a:hlgroup], 4)}) + redraw + endif + else + let winid = coc#float#get_related(a:winid, 'border') + if winid > 0 + call setwinvar(winid, '&winhl', 'Normal:'.a:hlgroup) + endif + endif +endfunction + +function! coc#dialog#change_title(winid, title) abort + if s:is_vim + if coc#float#valid(a:winid) + call popup_setoptions(a:winid, {'title': a:title}) + redraw + endif + else + let winid = coc#float#get_related(a:winid, 'border') + if winid > 0 + let bufnr = winbufnr(winid) + let line = getbufline(bufnr, 1)[0] + let top = strcharpart(line, 0, 1) + \.repeat('─', strchars(line) - 2) + \.strcharpart(line, strchars(line) - 1, 1) + if !empty(a:title) + let top = coc#string#compose(top, 1, a:title.' ') + endif + call nvim_buf_set_lines(bufnr, 0, 1, v:false, [top]) + endif + endif +endfunction + +function! coc#dialog#change_loading(winid, loading) abort + if coc#float#valid(a:winid) + let winid = coc#float#get_related(a:winid, 'loading') + if !a:loading && winid > 0 + call coc#float#close(winid) + endif + if a:loading && winid == 0 + let bufnr = s:create_loading_buf() + if s:is_vim + let pos = popup_getpos(a:winid) + let winid = popup_create(bufnr, { + \ 'line': pos['line'] + 1, + \ 'col': pos['col'] + pos['width'] - 4, + \ 'maxheight': 1, + \ 'maxwidth': 3, + \ 'zindex': 999, + \ 'highlight': get(popup_getoptions(a:winid), 'highlight', 'CocFloating') + \ }) + else + let pos = nvim_win_get_position(a:winid) + let width = nvim_win_get_width(a:winid) + let opts = { + \ 'relative': 'editor', + \ 'row': pos[0], + \ 'col': pos[1] + width - 3, + \ 'focusable': v:false, + \ 'width': 3, + \ 'height': 1, + \ 'style': 'minimal', + \ } + if has('nvim-0.5.1') + let opts['zindex'] = 900 + endif + let winid = nvim_open_win(bufnr, v:false, opts) + call setwinvar(winid, '&winhl', getwinvar(a:winid, '&winhl')) + endif + call setwinvar(winid, 'kind', 'loading') + call setbufvar(bufnr, 'target_winid', a:winid) + call setbufvar(bufnr, 'popup', winid) + call coc#float#add_related(winid, a:winid) + endif + endif +endfunction + +" Update list with new lines and highlights +function! coc#dialog#update_list(winid, bufnr, lines, highlights) abort + if coc#window#tabnr(a:winid) == tabpagenr() + if getwinvar(a:winid, 'auto_height', 0) + let row = coc#float#get_row(a:winid) + " core height + let height = max([1, len(copy(a:lines))]) + let height = min([getwinvar(a:winid, 'max_height', 10), height, &lines - &cmdheight - 1 - row]) + let curr = s:is_vim ? popup_getpos(a:winid)['core_height'] : nvim_win_get_height(a:winid) + let delta = height - curr + if delta != 0 + call coc#float#change_height(a:winid, delta) + endif + endif + call coc#compat#buf_set_lines(a:bufnr, 0, -1, a:lines) + call coc#highlight#add_highlights(a:winid, [], a:highlights) + if s:is_vim + let target = getwinvar(a:winid, 'target_winid', -1) + if target != -1 + call coc#dialog#check_scroll_vim(target) + endif + call win_execute(a:winid, 'exe 1') + endif + endif +endfunction + +" Fix width of prompt window same as list window on scrollbar change +function! coc#dialog#check_scroll_vim(winid) abort + if s:is_vim && coc#float#valid(a:winid) + let winid = coc#float#get_related(a:winid, 'list') + if winid + redraw + let pos = popup_getpos(winid) + let width = pos['width'] + (pos['scrollbar'] ? 1 : 0) + if width != popup_getpos(a:winid)['width'] + call popup_move(a:winid, { + \ 'minwidth': width - 2, + \ 'maxwidth': width - 2, + \ }) + endif + endif + endif +endfunction + +function! coc#dialog#set_cursor(winid, bufnr, line) abort + if s:is_vim + call coc#compat#execute(a:winid, 'exe '.a:line, 'silent!') + call popup_setoptions(a:winid, {'cursorline' : 1}) + call popup_setoptions(a:winid, {'cursorline' : 0}) + else + call nvim_win_set_cursor(a:winid, [a:line, 0]) + endif + call coc#dialog#place_sign(a:bufnr, a:line) +endfunction + +function! coc#dialog#place_sign(bufnr, line) abort + call sign_unplace(s:sign_group, { 'buffer': a:bufnr }) + if a:line > 0 + call sign_place(6, s:sign_group, 'CocCurrentLine', a:bufnr, {'lnum': a:line}) + endif +endfunction + +" Could be center(with optional marginTop) or cursor +function! s:get_prompt_dimension(title, default, opts) abort + let relative = get(a:opts, 'position', 'cursor') ==# 'cursor' ? 'cursor' : 'editor' + let curr = win_screenpos(winnr())[1] + wincol() - 2 + let minWidth = get(a:opts, 'minWidth', s:prompt_win_width) + let width = min([max([strwidth(a:default) + 2, strwidth(a:title) + 2, minWidth]), &columns - 2]) + if get(a:opts, 'maxWidth', 0) + let width = min([width, a:opts['maxWidth']]) + endif + if relative ==# 'cursor' + let [lineIdx, colIdx] = coc#cursor#screen_pos() + if width == &columns - 2 + let col = 0 - curr + else + let col = curr + width <= &columns - 2 ? 0 : curr + width - &columns + 2 + endif + let config = { + \ 'row': lineIdx == 0 ? 1 : 0, + \ 'col': colIdx == 0 ? 0 : col - 1, + \ } + else + let marginTop = get(a:opts, 'marginTop', v:null) + if marginTop is v:null + let row = (&lines - &cmdheight - 2) / 2 + else + let row = marginTop < 2 ? 1 : min([marginTop, &columns - &cmdheight]) + endif + let config = { + \ 'col': float2nr((&columns - width) / 2), + \ 'row': row - s:is_vim, + \ } + endif + return extend(config, {'relative': relative, 'width': width, 'height': 1}) +endfunction + +function! s:min_btns_width(buttons) abort + if empty(a:buttons) + return 0 + endif + let minwidth = len(a:buttons)*3 - 1 + for txt in a:buttons + let minwidth = minwidth + strdisplaywidth(txt) + endfor + return minwidth +endfunction + +" Close windows that should auto hide +function! s:close_auto_hide_wins(...) abort + let winids = coc#float#get_float_win_list() + let except = get(a:, 1, 0) + for id in winids + if except && id == except + continue + endif + if coc#window#get_var(id, 'autohide', 0) + call coc#float#close(id) + endif + endfor +endfunction + +function! s:create_loading_buf() abort + let bufnr = coc#float#create_buf(0) + call s:change_loading_buf(bufnr, 0) + return bufnr +endfunction + +function! s:change_loading_buf(bufnr, idx) abort + if bufloaded(a:bufnr) + let target = getbufvar(a:bufnr, 'target_winid', v:null) + if !empty(target) && !coc#float#valid(target) + call coc#float#close(getbufvar(a:bufnr, 'popup')) + return + endif + let line = get(s:frames, a:idx, ' ') + call setbufline(a:bufnr, 1, line) + call coc#highlight#add_highlight(a:bufnr, -1, 'CocNotificationProgress', 0, 0, -1) + let idx = a:idx == len(s:frames) - 1 ? 0 : a:idx + 1 + call timer_start(100, { -> s:change_loading_buf(a:bufnr, idx)}) + endif +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/dict.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/dict.vim new file mode 100644 index 0000000..00c494b --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/dict.vim @@ -0,0 +1,32 @@ +scriptencoding utf-8 + +function! coc#dict#equal(one, two) abort + for key in keys(a:one) + if a:one[key] != a:two[key] + return 0 + endif + endfor + return 1 +endfunction + +" Return new dict with keys removed +function! coc#dict#omit(dict, keys) abort + let res = {} + for key in keys(a:dict) + if index(a:keys, key) == -1 + let res[key] = a:dict[key] + endif + endfor + return res +endfunction + +" Return new dict with keys only +function! coc#dict#pick(dict, keys) abort + let res = {} + for key in keys(a:dict) + if index(a:keys, key) != -1 + let res[key] = a:dict[key] + endif + endfor + return res +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/float.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/float.vim new file mode 100644 index 0000000..56ddb45 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/float.vim @@ -0,0 +1,1445 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') +let s:borderchars = get(g:, 'coc_borderchars', ['─', '│', '─', '│', '┌', '┐', '┘', '└']) +let s:rounded_borderchars = s:borderchars[0:3] + ['╭', '╮', '╯', '╰'] +let s:borderjoinchars = get(g:, 'coc_border_joinchars', ['┬', '┤', '┴', '├']) +let s:popup_list_api = exists('*popup_list') +" Popup ids, used when popup_list() doesn't exist +let s:popup_list = [] +let s:pad_bufnr = -1 + +" Check visible float/popup exists. +function! coc#float#has_float(...) abort + return len(coc#float#get_float_win_list(get(a:, 1, 0))) > 0 +endfunction + +function! coc#float#close_all(...) abort + let winids = coc#float#get_float_win_list(get(a:, 1, 0)) + for id in winids + try + call coc#float#close(id) + catch /E5555:/ + " ignore + endtry + endfor +endfunction + +function! coc#float#jump() abort + if has('nvim') + let winids = coc#float#get_float_win_list() + if !empty(winids) + call win_gotoid(winids[0]) + endif + endif +endfunction + +function! coc#float#valid(winid) abort + if a:winid <= 0 + return 0 + endif + if !s:is_vim + if !nvim_win_is_valid(a:winid) + return 0 + endif + return !empty(nvim_win_get_config(a:winid)['relative']) + endif + try + return !empty(popup_getpos(a:winid)) + catch /^Vim\%((\a\+)\)\=:E993/ + " not a popup window + return 0 + endtry +endfunction + +function! coc#float#get_height(winid) abort + if !s:is_vim + let borderwin = coc#float#get_related(a:winid, 'border') + if borderwin + return nvim_win_get_height(borderwin) + endif + return nvim_win_get_height(a:winid) + endif + return get(popup_getpos(a:winid), 'height', 0) +endfunction + +function! coc#float#change_height(winid, delta) abort + if s:is_vim + let curr = get(popup_getpos(a:winid), 'core_height', v:null) + if curr isnot v:null + call popup_move(a:winid, { + \ 'maxheight': max([1, curr + a:delta]), + \ 'minheight': max([1, curr + a:delta]), + \ }) + endif + else + let winids = copy(coc#window#get_var(a:winid, 'related', [])) + call filter(winids, 'index(["border","pad","scrollbar"],coc#window#get_var(v:val,"kind","")) >= 0') + call add(winids, a:winid) + for winid in winids + if coc#window#get_var(winid, 'kind', '') ==# 'border' + let bufnr = winbufnr(winid) + if a:delta > 0 + call appendbufline(bufnr, 1, repeat(getbufline(bufnr, 2), a:delta)) + else + call deletebufline(bufnr, 2, 2 - a:delta - 1) + endif + endif + let height = nvim_win_get_height(winid) + call nvim_win_set_height(winid, max([1, height + a:delta])) + endfor + endif +endfunction + +" create or config float window, returns [winid, bufnr], config including: +" - relative: could be 'editor' 'cursor' +" - row: line count relative to editor/cursor, nagetive number means abover cursor. +" - col: column count relative to editor/cursor, nagetive number means left of cursor. +" - width: content width without border and title. +" - height: content height without border and title. +" - lines: (optional) lines to insert, default to v:null. +" - title: (optional) title. +" - border: (optional) border as number list, like [1, 1, 1 ,1]. +" - cursorline: (optional) enable cursorline when is 1. +" - autohide: (optional) window should be closed on CursorMoved when is 1. +" - highlight: (optional) highlight of window, default to 'CocFloating' +" - borderhighlight: (optional) should be array or string for border highlights, +" highlight all borders with first value. +" - close: (optional) show close button when is 1. +" - highlights: (optional) highlight items. +" - buttons: (optional) array of button text for create buttons at bottom. +" - codes: (optional) list of CodeBlock. +" - winblend: (optional) winblend option for float window, neovim only. +" - shadow: (optional) use shadow as border style, neovim only. +" - focusable: (optional) neovim only, default to true. +" - scrollinside: (optional) neovim only, create scrollbar inside window. +" - rounded: (optional) use rounded borderchars, ignored when borderchars exists. +" - borderchars: (optional) borderchars, should be length of 8 +" - nopad: (optional) not add pad when 1 +" - index: (optional) line index +function! coc#float#create_float_win(winid, bufnr, config) abort + let lines = get(a:config, 'lines', v:null) + let bufnr = a:bufnr + try + let bufnr = coc#float#create_buf(a:bufnr, lines, 'hide') + catch /E523:/ + " happens when using getchar() #3921 + return [] + endtry + let lnum = max([1, get(a:config, 'index', 0) + 1]) + " use exists + if a:winid && coc#float#valid(a:winid) + if s:is_vim + let [line, col] = s:popup_position(a:config) + let opts = { + \ 'firstline': 1, + \ 'line': line, + \ 'col': col, + \ 'minwidth': a:config['width'], + \ 'minheight': a:config['height'], + \ 'maxwidth': a:config['width'], + \ 'maxheight': a:config['height'], + \ 'title': get(a:config, 'title', ''), + \ 'highlight': get(a:config, 'highlight', 'CocFloating'), + \ 'borderhighlight': [s:get_borderhighlight(a:config)], + \ } + if !s:empty_border(get(a:config, 'border', [])) + let opts['border'] = a:config['border'] + endif + call popup_setoptions(a:winid, opts) + call win_execute(a:winid, 'exe '.lnum) + call coc#float#vim_buttons(a:winid, a:config) + call s:add_highlights(a:winid, a:config, 0) + return [a:winid, winbufnr(a:winid)] + else + let config = s:convert_config_nvim(a:config, 0) + let hlgroup = get(a:config, 'highlight', 'CocFloating') + let current = getwinvar(a:winid, '&winhl', '') + let winhl = coc#util#merge_winhl(current, [['Normal', hlgroup], ['FoldColumn', hlgroup], ['Search', '']]) + if winhl !=# current + call setwinvar(a:winid, '&winhl', winhl) + endif + call nvim_win_set_buf(a:winid, bufnr) + call nvim_win_set_config(a:winid, config) + call nvim_win_set_cursor(a:winid, [lnum, 0]) + call coc#float#nvim_create_related(a:winid, config, a:config) + call s:add_highlights(a:winid, a:config, 0) + return [a:winid, bufnr] + endif + endif + let winid = 0 + if s:is_vim + let [line, col] = s:popup_position(a:config) + let title = get(a:config, 'title', '') + let buttons = get(a:config, 'buttons', []) + let hlgroup = get(a:config, 'highlight', 'CocFloating') + let nopad = get(a:config, 'nopad', 0) + let border = s:empty_border(get(a:config, 'border', [])) ? [0, 0, 0, 0] : a:config['border'] + let opts = { + \ 'title': title, + \ 'line': line, + \ 'col': col, + \ 'fixed': 1, + \ 'padding': [0, !nopad && !border[1], 0, !nopad && !border[3]], + \ 'borderchars': s:get_borderchars(a:config), + \ 'highlight': hlgroup, + \ 'minwidth': a:config['width'], + \ 'minheight': a:config['height'], + \ 'maxwidth': a:config['width'], + \ 'maxheight': a:config['height'], + \ 'close': get(a:config, 'close', 0) ? 'button' : 'none', + \ 'border': border, + \ 'callback': { -> coc#float#on_close(winid)}, + \ 'borderhighlight': [s:get_borderhighlight(a:config)], + \ 'scrollbarhighlight': 'CocFloatSbar', + \ 'thumbhighlight': 'CocFloatThumb', + \ } + let winid = popup_create(bufnr, opts) + if !s:popup_list_api + call add(s:popup_list, winid) + endif + call s:set_float_defaults(winid, a:config) + call win_execute(winid, 'exe '.lnum) + call coc#float#vim_buttons(winid, a:config) + else + let config = s:convert_config_nvim(a:config, 1) + let border = get(a:config, 'border', []) + if has('nvim-0.5.0') && get(a:config, 'shadow', 0) && empty(get(a:config, 'buttons', v:null)) && empty(get(border, 2, 0)) + let config['border'] = 'shadow' + endif + noa let winid = nvim_open_win(bufnr, 0, config) + if winid is 0 + return [] + endif + " cursorline highlight not work on old neovim + call s:set_float_defaults(winid, a:config) + call nvim_win_set_cursor(winid, [lnum, 0]) + call coc#float#nvim_create_related(winid, config, a:config) + call coc#float#nvim_set_winblend(winid, get(a:config, 'winblend', v:null)) + endif + call s:add_highlights(winid, a:config, 1) + let g:coc_last_float_win = winid + call coc#util#do_autocmd('CocOpenFloat') + return [winid, bufnr] +endfunction + +function! coc#float#nvim_create_related(winid, config, opts) abort + let related = getwinvar(a:winid, 'related', []) + let exists = !empty(related) + let border = get(a:opts, 'border', []) + let borderhighlight = s:get_borderhighlight(a:opts) + let buttons = get(a:opts, 'buttons', []) + let pad = !get(a:opts, 'nopad', 0) && (empty(border) || get(border, 1, 0) == 0) + let shadow = get(a:opts, 'shadow', 0) + if get(a:opts, 'close', 0) + call coc#float#nvim_close_btn(a:config, a:winid, border, borderhighlight, related) + elseif exists + call coc#float#close_related(a:winid, 'close') + endif + if !empty(buttons) + call coc#float#nvim_buttons(a:config, a:winid, buttons, get(a:opts, 'getchar', 0), get(border, 2, 0), pad, borderhighlight, shadow, related) + elseif exists + call coc#float#close_related(a:winid, 'buttons') + endif + if !s:empty_border(border) + let borderchars = s:get_borderchars(a:opts) + call coc#float#nvim_border_win(a:config, borderchars, a:winid, border, get(a:opts, 'title', ''), !empty(buttons), borderhighlight, shadow, related) + elseif exists + call coc#float#close_related(a:winid, 'border') + endif + " Check right border + if pad + call coc#float#nvim_right_pad(a:config, a:winid, shadow, related) + elseif exists + call coc#float#close_related(a:winid, 'pad') + endif + call setwinvar(a:winid, 'related', filter(related, 'nvim_win_is_valid(v:val)')) +endfunction + +" border window for neovim, content config with border +function! coc#float#nvim_border_win(config, borderchars, winid, border, title, hasbtn, hlgroup, shadow, related) abort + let winid = coc#float#get_related(a:winid, 'border') + let row = a:border[0] ? a:config['row'] - 1 : a:config['row'] + let col = a:border[3] ? a:config['col'] - 1 : a:config['col'] + let width = a:config['width'] + a:border[1] + a:border[3] + let height = a:config['height'] + a:border[0] + a:border[2] + (a:hasbtn ? 2 : 0) + let lines = coc#float#create_border_lines(a:border, a:borderchars, a:title, a:config['width'], a:config['height'], a:hasbtn) + let bufnr = winid ? winbufnr(winid) : 0 + let bufnr = coc#float#create_buf(bufnr, lines) + let opt = { + \ 'relative': a:config['relative'], + \ 'width': width, + \ 'height': height, + \ 'row': row, + \ 'col': col, + \ 'focusable': v:false, + \ 'style': 'minimal', + \ } + if has('nvim-0.5.0') && a:shadow && !a:hasbtn && a:border[2] + let opt['border'] = 'shadow' + let opt['noautocmd'] = 1 + endif + if winid + call nvim_win_set_config(winid, opt) + call setwinvar(winid, '&winhl', 'Normal:'.a:hlgroup.',Search:') + else + noa let winid = nvim_open_win(bufnr, 0, opt) + call setwinvar(winid, 'delta', -1) + let winhl = 'Normal:'.a:hlgroup.',Search:' + call s:nvim_add_related(winid, a:winid, 'border', winhl, a:related) + endif +endfunction + +" neovim only +function! coc#float#nvim_close_btn(config, winid, border, hlgroup, related) abort + let winid = coc#float#get_related(a:winid, 'close') + let config = { + \ 'relative': a:config['relative'], + \ 'width': 1, + \ 'height': 1, + \ 'row': get(a:border, 0, 0) ? a:config['row'] - 1 : a:config['row'], + \ 'col': a:config['col'] + a:config['width'], + \ 'focusable': v:true, + \ 'style': 'minimal', + \ } + if has('nvim-0.5.1') + let config['zindex'] = 300 + endif + if winid + call nvim_win_set_config(winid, coc#dict#pick(config, ['relative', 'row', 'col'])) + else + let bufnr = coc#float#create_buf(0, ['X']) + noa let winid = nvim_open_win(bufnr, 0, config) + let winhl = 'Normal:'.a:hlgroup.',Search:' + call s:nvim_add_related(winid, a:winid, 'close', winhl, a:related) + endif +endfunction + +" Create padding window by config of current window & border config +function! coc#float#nvim_right_pad(config, winid, shadow, related) abort + let winid = coc#float#get_related(a:winid, 'pad') + let config = { + \ 'relative': a:config['relative'], + \ 'width': 1, + \ 'height': a:config['height'], + \ 'row': a:config['row'], + \ 'col': a:config['col'] + a:config['width'], + \ 'focusable': v:false, + \ 'style': 'minimal', + \ } + if has('nvim-0.5.1') + let config['zindex'] = 300 + endif + if has('nvim-0.5.0') && a:shadow + let config['border'] = 'shadow' + endif + if winid && nvim_win_is_valid(winid) + if has('nvim-0.5.0') + call nvim_win_set_config(winid, coc#dict#pick(config, ['relative', 'row', 'col'])) + call nvim_win_set_height(winid, config['height']) + return + endif + noa call nvim_win_close(winid, 1) + endif + let s:pad_bufnr = bufloaded(s:pad_bufnr) ? s:pad_bufnr : coc#float#create_buf(0, repeat([''], &lines), 'hide') + noa let winid = nvim_open_win(s:pad_bufnr, 0, config) + call s:nvim_add_related(winid, a:winid, 'pad', '', a:related) +endfunction + +" draw buttons window for window with config +function! coc#float#nvim_buttons(config, winid, buttons, getchar, borderbottom, pad, borderhighlight, shadow, related) abort + let winid = coc#float#get_related(a:winid, 'buttons') + let width = a:config['width'] + (a:pad ? 1 : 0) + let config = { + \ 'row': a:config['row'] + a:config['height'], + \ 'col': a:config['col'], + \ 'width': width, + \ 'height': 2 + (a:borderbottom ? 1 : 0), + \ 'relative': a:config['relative'], + \ 'focusable': 1, + \ 'style': 'minimal', + \ } + if has('nvim-0.5.1') + let config['zindex'] = 300 + if a:shadow + let config['border'] = 'shadow' + endif + endif + if winid + let bufnr = winbufnr(winid) + call s:create_btns_buffer(bufnr, width, a:buttons, a:borderbottom) + call nvim_win_set_config(winid, config) + else + let bufnr = s:create_btns_buffer(0, width, a:buttons, a:borderbottom) + noa let winid = nvim_open_win(bufnr, 0, config) + if winid + call s:nvim_add_related(winid, a:winid, 'buttons', '', a:related) + call s:nvim_create_keymap(winid) + endif + endif + if bufnr + call nvim_buf_clear_namespace(bufnr, -1, 0, -1) + call nvim_buf_add_highlight(bufnr, 1, a:borderhighlight, 0, 0, -1) + if a:borderbottom + call nvim_buf_add_highlight(bufnr, 1, a:borderhighlight, 2, 0, -1) + endif + let vcols = getbufvar(bufnr, 'vcols', []) + " TODO need change vol to col + for col in vcols + call nvim_buf_add_highlight(bufnr, 1, a:borderhighlight, 1, col, col + 3) + endfor + if a:getchar + let keys = s:gen_filter_keys(getbufline(bufnr, 2)[0]) + call matchaddpos('MoreMsg', map(keys[0], "[2,v:val]"), 99, -1, {'window': winid}) + call timer_start(10, {-> coc#float#getchar(winid, keys[1])}) + endif + endif +endfunction + +function! coc#float#getchar(winid, keys) abort + let ch = coc#prompt#getc() + let target = getwinvar(a:winid, 'target_winid', 0) + if ch ==# "\" + call coc#float#close(target) + return + endif + if ch ==# "\" + if getwinvar(v:mouse_winid, 'kind', '') ==# 'close' + call coc#float#close(target) + return + endif + if v:mouse_winid == a:winid && v:mouse_lnum == 2 + let vcols = getbufvar(winbufnr(a:winid), 'vcols', []) + let col = v:mouse_col - 1 + if index(vcols, col) < 0 + let filtered = filter(vcols, 'v:val < col') + call coc#rpc#notify('FloatBtnClick', [winbufnr(target), len(filtered)]) + call coc#float#close(target) + return + endif + endif + else + let idx = index(a:keys, ch) + if idx >= 0 + call coc#rpc#notify('FloatBtnClick', [winbufnr(target), idx]) + call coc#float#close(target) + return + endif + endif + call coc#float#getchar(a:winid, a:keys) +endfunction + +" Create or refresh scrollbar for winid +" Need called on create, config, buffer change, scrolled +function! coc#float#nvim_scrollbar(winid) abort + if s:is_vim + return + endif + let winids = nvim_tabpage_list_wins(nvim_get_current_tabpage()) + if index(winids, a:winid) == -1 + return + endif + let config = nvim_win_get_config(a:winid) + let [row, column] = nvim_win_get_position(a:winid) + let relative = 'editor' + if row == 0 && column == 0 + " fix bad value when ext_multigrid is enabled. https://github.com/neovim/neovim/issues/11935 + let [row, column] = [config.row, config.col] + let relative = config.relative + endif + let width = nvim_win_get_width(a:winid) + let height = nvim_win_get_height(a:winid) + let bufnr = winbufnr(a:winid) + let cw = getwinvar(a:winid, '&foldcolumn', 0) ? width - 1 : width + let ch = coc#float#content_height(bufnr, cw, getwinvar(a:winid, '&wrap')) + let closewin = coc#float#get_related(a:winid, 'close') + let border = getwinvar(a:winid, 'border', []) + let scrollinside = getwinvar(a:winid, 'scrollinside', 0) && get(border, 1, 0) + let winblend = getwinvar(a:winid, '&winblend', 0) + let move_down = closewin && !get(border, 0, 0) + let id = coc#float#get_related(a:winid, 'scrollbar') + if ch <= height || height <= 1 + " no scrollbar, remove exists + if id + call s:close_win(id, 1) + endif + return + endif + if move_down + let height = height - 1 + endif + call coc#float#close_related(a:winid, 'pad') + let sbuf = id ? winbufnr(id) : 0 + let sbuf = coc#float#create_buf(sbuf, repeat([' '], height)) + let opts = { + \ 'row': move_down ? row + 1 : row, + \ 'col': column + width - scrollinside, + \ 'relative': relative, + \ 'width': 1, + \ 'height': height, + \ 'focusable': v:false, + \ 'style': 'minimal', + \ } + if has('nvim-0.5.1') + let opts['zindex'] = get(config, 'zindex', 50) + endif + if has('nvim-0.5.0') && s:has_shadow(config) + let opts['border'] = 'shadow' + endif + if id + call nvim_win_set_config(id, opts) + else + noa let id = nvim_open_win(sbuf, 0 , opts) + if id == 0 + return + endif + if winblend + call setwinvar(id, '&winblend', winblend) + endif + call setwinvar(id, 'kind', 'scrollbar') + call setwinvar(id, 'target_winid', a:winid) + call coc#float#add_related(id, a:winid) + endif + if !scrollinside + call coc#float#nvim_scroll_adjust(a:winid) + endif + let thumb_height = max([1, float2nr(floor(height * (height + 0.0)/ch))]) + let wininfo = getwininfo(a:winid)[0] + let start = 0 + if wininfo['topline'] != 1 + " needed for correct getwininfo + let firstline = wininfo['topline'] + let lastline = s:nvim_get_botline(firstline, height, cw, bufnr) + let linecount = nvim_buf_line_count(winbufnr(a:winid)) + if lastline >= linecount + let start = height - thumb_height + else + let start = max([1, float2nr(round((height - thumb_height + 0.0)*(firstline - 1.0)/(ch - height)))]) + endif + endif + " add highlights + call nvim_buf_clear_namespace(sbuf, -1, 0, -1) + for idx in range(0, height - 1) + if idx >= start && idx < start + thumb_height + call nvim_buf_add_highlight(sbuf, -1, 'CocFloatThumb', idx, 0, 1) + else + call nvim_buf_add_highlight(sbuf, -1, 'CocFloatSbar', idx, 0, 1) + endif + endfor +endfunction + +function! coc#float#create_border_lines(border, borderchars, title, width, height, hasbtn) abort + let borderchars = a:borderchars + let list = [] + if a:border[0] + let top = (a:border[3] ? borderchars[4]: '') + \.repeat(borderchars[0], a:width) + \.(a:border[1] ? borderchars[5] : '') + if !empty(a:title) + let top = coc#string#compose(top, 1, a:title.' ') + endif + call add(list, top) + endif + let mid = (a:border[3] ? borderchars[3]: '') + \.repeat(' ', a:width) + \.(a:border[1] ? borderchars[1] : '') + call extend(list, repeat([mid], a:height + (a:hasbtn ? 2 : 0))) + if a:hasbtn + let list[len(list) - 2] = (a:border[3] ? s:borderjoinchars[3]: '') + \.repeat(' ', a:width) + \.(a:border[1] ? s:borderjoinchars[1] : '') + endif + if a:border[2] + let bot = (a:border[3] ? borderchars[7]: '') + \.repeat(borderchars[2], a:width) + \.(a:border[1] ? borderchars[6] : '') + call add(list, bot) + endif + return list +endfunction + +" Close float window by id +function! coc#float#close(winid, ...) abort + let noautocmd = get(a:, 1, 0) + call coc#float#close_related(a:winid) + call s:close_win(a:winid, noautocmd) + return 1 +endfunction + +" Get visible float windows +function! coc#float#get_float_win_list(...) abort + let res = [] + let list_all = get(a:, 1, 0) + if s:is_vim + if s:popup_list_api + return filter(popup_list(), 'popup_getpos(v:val)["visible"]'.(list_all ? '' : '&& getwinvar(v:val, "float", 0)')) + endif + return filter(s:popup_list, 's:popup_visible(v:val)') + else + let res = [] + for i in range(1, winnr('$')) + let id = win_getid(i) + let config = nvim_win_get_config(id) + if empty(config) || empty(config['relative']) + continue + endif + " ignore border & button window & others + if list_all == 0 && !getwinvar(id, 'float', 0) + continue + endif + call add(res, id) + endfor + return res + endif + return [] +endfunction + +function! coc#float#get_float_by_kind(kind) abort + if s:is_vim + if s:popup_list_api + return get(filter(popup_list(), 'popup_getpos(v:val)["visible"] && getwinvar(v:val, "kind", "") ==# "'.a:kind.'"'), 0, 0) + endif + return get(filter(s:popup_list, 's:popup_visible(v:val) && getwinvar(v:val, "kind", "") ==# "'.a:kind.'"'), 0, 0) + else + let res = [] + for i in range(1, winnr('$')) + let winid = win_getid(i) + let config = nvim_win_get_config(winid) + if !empty(config['relative']) && getwinvar(winid, 'kind', '') ==# a:kind + return winid + endif + endfor + endif + return 0 +endfunction + +" Check if a float window is scrollable +function! coc#float#scrollable(winid) abort + let bufnr = winbufnr(a:winid) + if bufnr == -1 + return 0 + endif + if s:is_vim + let pos = popup_getpos(a:winid) + if get(pos, 'scrollbar', 0) + return 1 + endif + let ch = coc#float#content_height(bufnr, pos['core_width'], getwinvar(a:winid, '&wrap')) + return ch > pos['core_height'] + else + let height = nvim_win_get_height(a:winid) + let width = nvim_win_get_width(a:winid) + if width > 1 && getwinvar(a:winid, '&foldcolumn', 0) + " since we use foldcolumn for left padding + let width = width - 1 + endif + let ch = coc#float#content_height(bufnr, width, getwinvar(a:winid, '&wrap')) + return ch > height + endif +endfunction + +function! coc#float#has_scroll() abort + let win_ids = filter(coc#float#get_float_win_list(), 'coc#float#scrollable(v:val)') + return !empty(win_ids) +endfunction + +function! coc#float#scroll(forward, ...) + if !has('nvim-0.4.0') && !has('patch-8.2.0750') + throw 'coc#float#scroll() requires nvim >= 0.4.0 or vim >= 8.2.0750' + endif + let amount = get(a:, 1, 0) + let winids = filter(coc#float#get_float_win_list(), 'coc#float#scrollable(v:val) && getwinvar(v:val,"kind","") !=# "pum"') + if empty(winids) + return mode() =~ '^i' || mode() ==# 'v' ? "" : "\" + endif + for winid in winids + call s:scroll_win(winid, a:forward, amount) + endfor + return mode() =~ '^i' || mode() ==# 'v' ? "" : "\" +endfunction + +function! coc#float#scroll_win(winid, forward, amount) abort + let opts = s:get_options(a:winid) + let lines = getbufline(winbufnr(a:winid), 1, '$') + let maxfirst = s:max_firstline(lines, opts['height'], opts['width']) + let topline = opts['topline'] + let height = opts['height'] + let width = opts['width'] + let scrolloff = getwinvar(a:winid, '&scrolloff', 0) + if a:forward && topline >= maxfirst + return + endif + if !a:forward && topline == 1 + return + endif + if a:amount == 0 + let topline = s:get_topline(opts['topline'], lines, a:forward, height, width) + else + let topline = topline + (a:forward ? a:amount : - a:amount) + endif + let topline = a:forward ? min([maxfirst, topline]) : max([1, topline]) + let lnum = s:get_cursorline(topline, lines, scrolloff, width, height) + call s:win_setview(a:winid, topline, lnum) + let top = s:get_options(a:winid)['topline'] + " not changed + if top == opts['topline'] + if a:forward + call s:win_setview(a:winid, topline + 1, lnum + 1) + else + call s:win_setview(a:winid, topline - 1, lnum - 1) + endif + endif +endfunction + +function! coc#float#content_height(bufnr, width, wrap) abort + if !bufloaded(a:bufnr) + return 0 + endif + if !a:wrap + return coc#compat#buf_line_count(a:bufnr) + endif + let lines = has('nvim') ? nvim_buf_get_lines(a:bufnr, 0, -1, 0) : getbufline(a:bufnr, 1, '$') + return coc#string#content_height(lines, a:width) +endfunction + +function! coc#float#nvim_refresh_scrollbar(winid) abort + let id = coc#float#get_related(a:winid, 'scrollbar') + if id && nvim_win_is_valid(id) + call coc#float#nvim_scrollbar(a:winid) + endif +endfunction + +function! coc#float#on_close(winid) abort + let winids = coc#float#get_float_win_list() + for winid in winids + let target = getwinvar(winid, 'target_winid', -1) + if target == a:winid + call coc#float#close(winid) + endif + endfor +endfunction + +" Close related windows, or specific kind +function! coc#float#close_related(winid, ...) abort + if !coc#float#valid(a:winid) + return + endif + let timer = coc#window#get_var(a:winid, 'timer', 0) + if timer + call timer_stop(timer) + endif + let kind = get(a:, 1, '') + let winids = coc#window#get_var(a:winid, 'related', []) + for id in winids + let curr = coc#window#get_var(id, 'kind', '') + if empty(kind) || curr ==# kind + if curr == 'list' + call coc#float#close(id, 1) + elseif s:is_vim + " vim doesn't throw + noa call popup_close(id) + else + silent! noa call nvim_win_close(id, 1) + endif + endif + endfor +endfunction + +" Close related windows if target window is not visible. +function! coc#float#check_related() abort + let invalids = [] + let ids = coc#float#get_float_win_list(1) + for id in ids + let target = getwinvar(id, 'target_winid', 0) + if target && index(ids, target) == -1 + call add(invalids, id) + endif + endfor + if s:is_vim && !s:popup_list_api + let s:popup_list = filter(ids, "index(invalids, v:val) == -1") + endif + for id in invalids + call coc#float#close(id) + endfor +endfunction + +" Show float window/popup for user confirm. +" Create buttons popup on vim +function! coc#float#vim_buttons(winid, config) abort + if !has('patch-8.2.0750') + return + endif + let related = getwinvar(a:winid, 'related', []) + let winid = coc#float#get_related(a:winid, 'buttons') + let btns = get(a:config, 'buttons', []) + if empty(btns) + if winid + call s:close_win(winid, 1) + " fix padding + let opts = popup_getoptions(a:winid) + let padding = get(opts, 'padding', v:null) + if !empty(padding) + let padding[2] = padding[2] - 2 + endif + call popup_setoptions(a:winid, {'padding': padding}) + endif + return + endif + let border = get(a:config, 'border', v:null) + if !winid + " adjusting popup padding + let opts = popup_getoptions(a:winid) + let padding = get(opts, 'padding', v:null) + if type(padding) == 7 + let padding = [0, 0, 2, 0] + elseif len(padding) == 0 + let padding = [1, 1, 3, 1] + else + let padding[2] = padding[2] + 2 + endif + call popup_setoptions(a:winid, {'padding': padding}) + endif + let borderhighlight = get(get(a:config, 'borderhighlight', []), 0, '') + let pos = popup_getpos(a:winid) + let bw = empty(border) ? 0 : get(border, 1, 0) + get(border, 3, 0) + let borderbottom = empty(border) ? 0 : get(border, 2, 0) + let borderleft = empty(border) ? 0 : get(border, 3, 0) + let width = pos['width'] - bw + get(pos, 'scrollbar', 0) + let bufnr = s:create_btns_buffer(winid ? winbufnr(winid): 0,width, btns, borderbottom) + let height = 2 + (borderbottom ? 1 : 0) + let keys = s:gen_filter_keys(getbufline(bufnr, 2)[0]) + let options = { + \ 'filter': {id, key -> coc#float#vim_filter(id, key, keys[1])}, + \ 'highlight': get(opts, 'highlight', 'CocFloating') + \ } + let config = { + \ 'line': pos['line'] + pos['height'] - height, + \ 'col': pos['col'] + borderleft, + \ 'minwidth': width, + \ 'minheight': height, + \ 'maxwidth': width, + \ 'maxheight': height, + \ } + if winid != 0 + call popup_move(winid, config) + call popup_setoptions(winid, options) + call win_execute(winid, 'call clearmatches()') + else + let options = extend({ + \ 'filtermode': 'nvi', + \ 'padding': [0, 0, 0, 0], + \ 'fixed': 1, + \ 'zindex': 99, + \ }, options) + call extend(options, config) + let winid = popup_create(bufnr, options) + if !s:popup_list_api + call add(s:popup_list, winid) + endif + endif + if winid != 0 + if !empty(borderhighlight) + call coc#highlight#add_highlight(bufnr, -1, borderhighlight, 0, 0, -1) + call coc#highlight#add_highlight(bufnr, -1, borderhighlight, 2, 0, -1) + call win_execute(winid, 'call matchadd("'.borderhighlight.'", "'.s:borderchars[1].'")') + endif + call setwinvar(winid, 'kind', 'buttons') + call setwinvar(winid, 'target_winid', a:winid) + call add(related, winid) + call setwinvar(a:winid, 'related', related) + call matchaddpos('MoreMsg', map(keys[0], "[2,v:val]"), 99, -1, {'window': winid}) + endif +endfunction + +function! coc#float#nvim_float_click() abort + let kind = getwinvar(win_getid(), 'kind', '') + if kind == 'buttons' + if line('.') != 2 + return + endif + let vw = strdisplaywidth(strpart(getline('.'), 0, col('.') - 1)) + let vcols = getbufvar(bufnr('%'), 'vcols', []) + if index(vcols, vw) >= 0 + return + endif + let idx = 0 + if !empty(vcols) + let filtered = filter(vcols, 'v:val < vw') + let idx = idx + len(filtered) + endif + let winid = win_getid() + let target = getwinvar(winid, 'target_winid', 0) + if target + call coc#rpc#notify('FloatBtnClick', [winbufnr(target), idx]) + call coc#float#close(target) + endif + elseif kind == 'close' + let target = getwinvar(win_getid(), 'target_winid', 0) + call coc#float#close(target) + endif +endfunction + +" Add mapping if necessary +function! coc#float#nvim_win_enter(winid) abort + let kind = getwinvar(a:winid, 'kind', '') + if kind == 'buttons' || kind == 'close' + if empty(maparg('', 'n')) + nnoremap :call coc#float#nvim_float_click() + endif + endif +endfunction + +function! coc#float#vim_filter(winid, key, keys) abort + let key = tolower(a:key) + let idx = index(a:keys, key) + let target = getwinvar(a:winid, 'target_winid', 0) + if target && idx >= 0 + call coc#rpc#notify('FloatBtnClick', [winbufnr(target), idx]) + call coc#float#close(target) + return 1 + endif + return 0 +endfunction + +function! coc#float#get_related(winid, kind, ...) abort + if coc#float#valid(a:winid) + for winid in coc#window#get_var(a:winid, 'related', []) + if coc#window#get_var(winid, 'kind', '') ==# a:kind + return winid + endif + endfor + endif + return get(a:, 1, 0) +endfunction + +function! coc#float#get_row(winid) abort + let winid = s:is_vim ? a:winid : coc#float#get_related(a:winid, 'border', a:winid) + if coc#float#valid(winid) + if s:is_vim + let pos = popup_getpos(winid) + return pos['line'] - 1 + endif + let pos = nvim_win_get_position(winid) + return pos[0] + endif +endfunction + +" Create temporarily buffer with optional lines and &bufhidden +function! coc#float#create_buf(bufnr, ...) abort + if a:bufnr > 0 && bufloaded(a:bufnr) + let bufnr = a:bufnr + else + if s:is_vim + noa let bufnr = bufadd('') + noa call bufload(bufnr) + call setbufvar(bufnr, '&buflisted', 0) + else + noa let bufnr = nvim_create_buf(v:false, v:true) + endif + let bufhidden = get(a:, 2, 'wipe') + call setbufvar(bufnr, '&buftype', 'nofile') + call setbufvar(bufnr, '&bufhidden', bufhidden) + call setbufvar(bufnr, '&swapfile', 0) + call setbufvar(bufnr, '&undolevels', -1) + " neovim's bug + call setbufvar(bufnr, '&modifiable', 1) + endif + let lines = get(a:, 1, v:null) + if type(lines) == v:t_list + if has('nvim') + call nvim_buf_set_lines(bufnr, 0, -1, v:false, lines) + else + silent noa call setbufline(bufnr, 1, lines) + silent noa call deletebufline(bufnr, len(lines) + 1, '$') + endif + endif + return bufnr +endfunction + +" Change border window & close window when scrollbar is shown. +function! coc#float#nvim_scroll_adjust(winid) abort + let winid = coc#float#get_related(a:winid, 'border') + if !winid + return + endif + let bufnr = winbufnr(winid) + let lines = nvim_buf_get_lines(bufnr, 0, -1, 0) + if len(lines) >= 2 + let cw = nvim_win_get_width(a:winid) + let width = nvim_win_get_width(winid) + if width - cw != 1 + (strcharpart(lines[1], 0, 1) ==# s:borderchars[3] ? 1 : 0) + return + endif + call nvim_win_set_width(winid, width + 1) + let lastline = len(lines) - 1 + for i in range(0, lastline) + let line = lines[i] + if i == 0 + let add = s:borderchars[0] + elseif i == lastline + let add = s:borderchars[2] + else + let add = ' ' + endif + let prev = strcharpart(line, 0, strchars(line) - 1) + let lines[i] = prev . add . coc#string#last_character(line) + endfor + call nvim_buf_set_lines(bufnr, 0, -1, 0, lines) + " Move right close button + if coc#window#get_var(a:winid, 'right', 0) == 0 + let id = coc#float#get_related(a:winid, 'close') + if id + let [row, col] = nvim_win_get_position(id) + call nvim_win_set_config(id, { + \ 'relative': 'editor', + \ 'row': row, + \ 'col': col + 1, + \ }) + endif + elseif has('nvim-0.6.0') + " Move winid and all related left by 1 + let winids = [a:winid] + coc#window#get_var(a:winid, 'related', []) + for winid in winids + if nvim_win_is_valid(winid) + if coc#window#get_var(winid, 'kind', '') != 'close' + let config = nvim_win_get_config(winid) + let [row, column] = [config.row, config.col] + call nvim_win_set_config(winid, { + \ 'row': row, + \ 'col': column - 1, + \ 'relative': 'editor', + \ }) + endif + endif + endfor + endif + endif +endfunction + +function! coc#float#nvim_set_winblend(winid, winblend) abort + if a:winblend is v:null + return + endif + call coc#window#set_var(a:winid, '&winblend', a:winblend) + for winid in coc#window#get_var(a:winid, 'related', []) + call coc#window#set_var(winid, '&winblend', a:winblend) + endfor +endfunction + +function! s:popup_visible(id) abort + let pos = popup_getpos(a:id) + if !empty(pos) && get(pos, 'visible', 0) + return 1 + endif + return 0 +endfunction + +function! s:convert_config_nvim(config, create) abort + let valids = ['relative', 'win', 'anchor', 'width', 'height', 'bufpos', 'col', 'row', 'focusable'] + let result = coc#dict#pick(a:config, valids) + let border = get(a:config, 'border', []) + if !s:empty_border(border) + if result['relative'] ==# 'cursor' && result['row'] < 0 + " move top when has bottom border + if get(border, 2, 0) + let result['row'] = result['row'] - 1 + endif + else + " move down when has top border + if get(border, 0, 0) && !get(a:config, 'prompt', 0) + let result['row'] = result['row'] + 1 + endif + endif + " move right when has left border + if get(border, 3, 0) + let result['col'] = result['col'] + 1 + endif + let result['width'] = float2nr(result['width'] + 1 - get(border,3, 0)) + else + let result['width'] = float2nr(result['width'] + (get(a:config, 'nopad', 0) ? 0 : 1)) + endif + if has('nvim-0.5.1') && a:create + let result['noautocmd'] = v:true + endif + let result['height'] = float2nr(result['height']) + return result +endfunction + +function! s:create_btns_buffer(bufnr, width, buttons, borderbottom) abort + let n = len(a:buttons) + let spaces = a:width - n + 1 + let tw = 0 + for txt in a:buttons + let tw += strdisplaywidth(txt) + endfor + if spaces < tw + throw 'window is too small for buttons.' + endif + let ds = (spaces - tw)/n + let dl = ds/2 + let dr = ds%2 == 0 ? ds/2 : ds/2 + 1 + let btnline = '' + let idxes = [] + for idx in range(0, n - 1) + let txt = toupper(a:buttons[idx][0]).a:buttons[idx][1:] + let btnline .= repeat(' ', dl).txt.repeat(' ', dr) + if idx != n - 1 + call add(idxes, strdisplaywidth(btnline)) + let btnline .= s:borderchars[1] + endif + endfor + let lines = [repeat(s:borderchars[0], a:width), btnline] + if a:borderbottom + call add(lines, repeat(s:borderchars[0], a:width)) + endif + for idx in idxes + let lines[0] = strcharpart(lines[0], 0, idx).s:borderjoinchars[0].strcharpart(lines[0], idx + 1) + if a:borderbottom + let lines[2] = strcharpart(lines[0], 0, idx).s:borderjoinchars[2].strcharpart(lines[0], idx + 1) + endif + endfor + let bufnr = coc#float#create_buf(a:bufnr, lines) + call setbufvar(bufnr, 'vcols', idxes) + return bufnr +endfunction + +function! s:gen_filter_keys(line) abort + let cols = [] + let used = [] + let next = 1 + for idx in range(0, strchars(a:line) - 1) + let ch = strcharpart(a:line, idx, 1) + let nr = char2nr(ch) + if next + if (nr >= 65 && nr <= 90) || (nr >= 97 && nr <= 122) + let lc = tolower(ch) + if index(used, lc) < 0 && (!s:is_vim || empty(maparg(lc, 'n'))) + let col = len(strcharpart(a:line, 0, idx)) + 1 + call add(used, lc) + call add(cols, col) + let next = 0 + endif + endif + else + if ch == s:borderchars[1] + let next = 1 + endif + endif + endfor + return [cols, used] +endfunction + +function! s:close_win(winid, noautocmd) abort + if a:winid <= 0 + return + endif + " vim not throw for none exists winid + if s:is_vim + call popup_close(a:winid) + else + if nvim_win_is_valid(a:winid) + if a:noautocmd + noa call nvim_win_close(a:winid, 1) + else + call nvim_win_close(a:winid, 1) + endif + endif + endif +endfunction + +function! s:nvim_create_keymap(winid) abort + if exists('*nvim_buf_set_keymap') + let bufnr = winbufnr(a:winid) + call nvim_buf_set_keymap(bufnr, 'n', '', ':call coc#float#nvim_float_click()', { + \ 'silent': v:true, + \ 'nowait': v:true + \ }) + else + let curr = win_getid() + let m = mode() + if m == 'n' || m == 'i' || m == 'ic' + noa call win_gotoid(a:winid) + nnoremap :call coc#float#nvim_float_click() + noa call win_gotoid(curr) + endif + endif +endfunction + +" getwininfo is buggy on neovim, use topline, width & height should for content +function! s:nvim_get_botline(topline, height, width, bufnr) abort + let lines = getbufline(a:bufnr, a:topline, a:topline + a:height - 1) + let botline = a:topline + let count = 0 + for i in range(0, len(lines) - 1) + let w = max([1, strdisplaywidth(lines[i])]) + let lh = float2nr(ceil(str2float(string(w))/a:width)) + let count = count + lh + let botline = a:topline + i + if count >= a:height + break + endif + endfor + return botline +endfunction + +" get popup position for vim8 based on config of neovim float window +function! s:popup_position(config) abort + let relative = get(a:config, 'relative', 'editor') + let border = get(a:config, 'border', [0, 0, 0, 0]) + let delta = get(border, 0, 0) + get(border, 2, 0) + if relative ==# 'cursor' + if a:config['row'] < 0 + let delta = - delta + elseif a:config['row'] == 0 + let delta = - get(border, 0, 0) + else + let delta = 0 + endif + return [s:popup_cursor(a:config['row'] + delta), s:popup_cursor(a:config['col'])] + endif + return [a:config['row'] + 1, a:config['col'] + 1] +endfunction + +function! coc#float#add_related(winid, target) abort + let arr = coc#window#get_var(a:target, 'related', []) + if index(arr, a:winid) >= 0 + return + endif + call add(arr, a:winid) + call coc#window#set_var(a:target, 'related', arr) +endfunction + +function! s:popup_cursor(n) abort + if a:n == 0 + return 'cursor' + endif + if a:n < 0 + return 'cursor'.a:n + endif + return 'cursor+'.a:n +endfunction + +" max firstline of lines, height > 0, width > 0 +function! s:max_firstline(lines, height, width) abort + let max = len(a:lines) + let remain = a:height + for line in reverse(copy(a:lines)) + let w = max([1, strdisplaywidth(line)]) + let dh = float2nr(ceil(str2float(string(w))/a:width)) + if remain - dh < 0 + break + endif + let remain = remain - dh + let max = max - 1 + endfor + return min([len(a:lines), max + 1]) +endfunction + +" Get best lnum by topline +function! s:get_cursorline(topline, lines, scrolloff, width, height) abort + let lastline = len(a:lines) + if a:topline == lastline + return lastline + endif + let bottomline = a:topline + let used = 0 + for lnum in range(a:topline, lastline) + let w = max([1, strdisplaywidth(a:lines[lnum - 1])]) + let dh = float2nr(ceil(str2float(string(w))/a:width)) + if used + dh >= a:height || lnum == lastline + let bottomline = lnum + break + endif + let used += dh + endfor + let cursorline = a:topline + a:scrolloff + if cursorline + a:scrolloff > bottomline + " unable to satisfy scrolloff + let cursorline = (a:topline + bottomline)/2 + endif + return cursorline +endfunction + +" Get firstline for full scroll +function! s:get_topline(topline, lines, forward, height, width) abort + let used = 0 + let lnums = a:forward ? range(a:topline, len(a:lines)) : reverse(range(1, a:topline)) + let topline = a:forward ? len(a:lines) : 1 + for lnum in lnums + let w = max([1, strdisplaywidth(a:lines[lnum - 1])]) + let dh = float2nr(ceil(str2float(string(w))/a:width)) + if used + dh >= a:height + let topline = lnum + break + endif + let used += dh + endfor + if topline == a:topline + if a:forward + let topline = min([len(a:lines), topline + 1]) + else + let topline = max([1, topline - 1]) + endif + endif + return topline +endfunction + +" topline content_height content_width +function! s:get_options(winid) abort + if has('nvim') + let width = nvim_win_get_width(a:winid) + if coc#window#get_var(a:winid, '&foldcolumn', 0) + let width = width - 1 + endif + let info = getwininfo(a:winid)[0] + return { + \ 'topline': info['topline'], + \ 'height': nvim_win_get_height(a:winid), + \ 'width': width + \ } + else + let pos = popup_getpos(a:winid) + return { + \ 'topline': pos['firstline'], + \ 'width': pos['core_width'], + \ 'height': pos['core_height'] + \ } + endif +endfunction + +function! s:win_setview(winid, topline, lnum) abort + if has('nvim') + call coc#compat#execute(a:winid, 'call winrestview({"lnum":'.a:lnum.',"topline":'.a:topline.'})') + call timer_start(10, { -> coc#float#nvim_refresh_scrollbar(a:winid) }) + else + call coc#compat#execute(a:winid, 'exe '.a:lnum) + call popup_setoptions(a:winid, { + \ 'firstline': a:topline, + \ }) + endif +endfunction + +function! s:set_float_defaults(winid, config) abort + if !s:is_vim + let hlgroup = get(a:config, 'highlight', 'CocFloating') + call setwinvar(a:winid, '&winhl', 'Normal:'.hlgroup.',FoldColumn:'.hlgroup.',Search:') + call setwinvar(a:winid, 'border', get(a:config, 'border', [])) + call setwinvar(a:winid, 'scrollinside', get(a:config, 'scrollinside', 0)) + if !get(a:config, 'nopad', 0) + call setwinvar(a:winid, '&foldcolumn', s:nvim_enable_foldcolumn(get(a:config, 'border', v:null))) + endif + call setwinvar(a:winid, '&signcolumn', 'no') + call setwinvar(a:winid, '&cursorcolumn', 0) + else + call setwinvar(a:winid, '&foldcolumn', 0) + endif + if !s:is_vim || !has("patch-8.2.3100") + call setwinvar(a:winid, '&number', 0) + call setwinvar(a:winid, '&relativenumber', 0) + call setwinvar(a:winid, '&cursorline', 0) + endif + call setwinvar(a:winid, '&foldenable', 0) + call setwinvar(a:winid, '&colorcolumn', '') + call setwinvar(a:winid, '&spell', 0) + call setwinvar(a:winid, '&linebreak', 1) + call setwinvar(a:winid, '&conceallevel', 0) + call setwinvar(a:winid, '&list', 0) + call setwinvar(a:winid, '&wrap', !get(a:config, 'cursorline', 0)) + if s:is_vim || has('nvim-0.5.0') + call setwinvar(a:winid, '&scrolloff', 0) + endif + if has('nvim-0.6.0') || has("patch-8.1.2281") + call setwinvar(a:winid, '&showbreak', 'NONE') + endif + if exists('*win_execute') + call win_execute(a:winid, 'setl fillchars+=eob:\ ') + endif + if get(a:config, 'autohide', 0) + call setwinvar(a:winid, 'autohide', 1) + endif + call setwinvar(a:winid, 'float', 1) +endfunction + +function! s:nvim_add_related(winid, target, kind, winhl, related) abort + if a:winid <= 0 + return + endif + " minimal not work + if !has('nvim-0.4.3') + call setwinvar(a:winid, '&colorcolumn', '') + call setwinvar(a:winid, '&number', 0) + call setwinvar(a:winid, '&relativenumber', 0) + call setwinvar(a:winid, '&foldcolumn', 0) + call setwinvar(a:winid, '&signcolumn', 0) + call setwinvar(a:winid, '&list', 0) + endif + let winhl = empty(a:winhl) ? coc#window#get_var(a:target, '&winhl', '') : a:winhl + call setwinvar(a:winid, '&winhl', winhl) + call setwinvar(a:winid, 'target_winid', a:target) + call setwinvar(a:winid, 'kind', a:kind) + call add(a:related, a:winid) +endfunction + +function! s:nvim_enable_foldcolumn(border) abort + if a:border is 1 + return 0 + endif + if type(a:border) == v:t_list && get(a:border, 3, 0) == 1 + return 0 + endif + return 1 +endfunction + +function! s:add_highlights(winid, config, create) abort + let codes = get(a:config, 'codes', []) + let highlights = get(a:config, 'highlights', []) + if empty(codes) && empty(highlights) && a:create + return + endif + let bgGroup = get(a:config, 'highlight', 'CocFloating') + for obj in codes + let hlGroup = get(obj, 'hlGroup', v:null) + if !empty(hlGroup) + let obj['hlGroup'] = coc#highlight#compose_hlgroup(hlGroup, bgGroup) + endif + endfor + call coc#highlight#add_highlights(a:winid, codes, highlights) +endfunction + +function! s:empty_border(border) abort + if empty(a:border) || empty(filter(copy(a:border), 'v:val != 0')) + return 1 + endif + return 0 +endfunction + +function! s:get_borderchars(config) abort + let borderchars = get(a:config, 'borderchars', []) + if !empty(borderchars) + return borderchars + endif + return get(a:config, 'rounded', 0) ? s:rounded_borderchars : s:borderchars +endfunction + +function! s:scroll_win(winid, forward, amount) abort + if s:is_vim + call coc#float#scroll_win(a:winid, a:forward, a:amount) + else + call timer_start(0, { -> coc#float#scroll_win(a:winid, a:forward, a:amount)}) + endif +endfunction + +function! s:get_borderhighlight(config) abort + let hlgroup = get(a:config, 'highlight', 'CocFloating') + let borderhighlight = get(a:config, 'borderhighlight', v:null) + if empty(borderhighlight) + return hlgroup + endif + let highlight = type(borderhighlight) == 3 ? borderhighlight[0] : borderhighlight + return coc#highlight#compose_hlgroup(highlight, hlgroup) +endfunction + +function! s:has_shadow(config) abort + let border = get(a:config, 'border', []) + let filtered = filter(copy(border), 'type(v:val) == 3 && get(v:val, 1, "") ==# "FloatShadow"') + return len(filtered) > 0 +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/helper.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/helper.vim new file mode 100644 index 0000000..8bdc9b8 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/helper.vim @@ -0,0 +1,148 @@ +scriptencoding utf-8 +" Helper methods for viml + +function! coc#helper#get_charactor(line, col) abort + return strchars(strpart(a:line, 0, a:col - 1)) +endfunction + +function! coc#helper#last_character(line) abort + return strcharpart(a:line, strchars(a:line) - 1, 1) +endfunction + +function! coc#helper#obj_equal(one, two) abort + for key in keys(a:one) + if a:one[key] != a:two[key] + return 0 + endif + endfor + return 1 +endfunction + +" get change between two lines +function! coc#helper#str_diff(curr, previous, col) abort + let end = strpart(a:curr, a:col - 1) + let start = strpart(a:curr, 0, a:col -1) + let endOffset = 0 + let startOffset = 0 + let currLen = strchars(a:curr) + let prevLen = strchars(a:previous) + if len(end) + let endLen = strchars(end) + for i in range(min([prevLen, endLen])) + if strcharpart(end, endLen - 1 - i, 1) ==# strcharpart(a:previous, prevLen -1 -i, 1) + let endOffset = endOffset + 1 + else + break + endif + endfor + endif + let remain = endOffset == 0 ? a:previous : strcharpart(a:previous, 0, prevLen - endOffset) + if len(remain) + for i in range(min([strchars(remain), strchars(start)])) + if strcharpart(remain, i, 1) ==# strcharpart(start, i ,1) + let startOffset = startOffset + 1 + else + break + endif + endfor + endif + return { + \ 'start': startOffset, + \ 'end': prevLen - endOffset, + \ 'text': strcharpart(a:curr, startOffset, currLen - startOffset - endOffset) + \ } +endfunction + +function! coc#helper#str_apply(content, diff) abort + let totalLen = strchars(a:content) + let endLen = totalLen - a:diff['end'] + return strcharpart(a:content, 0, a:diff['start']).a:diff['text'].strcharpart(a:content, a:diff['end'], endLen) +endfunction + +" insert inserted to line at position, use ... when result is too long +" line should only contains character has strwidth equals 1 +function! coc#helper#str_compose(line, position, inserted) abort + let width = strwidth(a:line) + let text = a:inserted + let res = a:line + let need_truncate = a:position + strwidth(text) + 1 > width + if need_truncate + let remain = width - a:position - 3 + if remain < 2 + " use text for full line, use first & end of a:line, ignore position + let res = strcharpart(a:line, 0, 1) + let w = strwidth(res) + for i in range(strchars(text)) + let c = strcharpart(text, i, 1) + let a = strwidth(c) + if w + a <= width - 1 + let w = w + a + let res = res.c + endif + endfor + let res = res.strcharpart(a:line, w) + else + let res = strcharpart(a:line, 0, a:position) + let w = strwidth(res) + for i in range(strchars(text)) + let c = strcharpart(text, i, 1) + let a = strwidth(c) + if w + a <= width - 3 + let w = w + a + let res = res.c + endif + endfor + let res = res.'..' + let w = w + 2 + let res = res.strcharpart(a:line, w) + endif + else + let first = strcharpart(a:line, 0, a:position) + let res = first.text.strcharpart(a:line, a:position + strwidth(text)) + endif + return res +endfunction + +" Return new dict with keys removed +function! coc#helper#dict_omit(dict, keys) abort + let res = {} + for key in keys(a:dict) + if index(a:keys, key) == -1 + let res[key] = a:dict[key] + endif + endfor + return res +endfunction + +" Return new dict with keys only +function! coc#helper#dict_pick(dict, keys) abort + let res = {} + for key in keys(a:dict) + if index(a:keys, key) != -1 + let res[key] = a:dict[key] + endif + endfor + return res +endfunction + +" support for float values +function! coc#helper#min(first, ...) abort + let val = a:first + for i in range(0, len(a:000) - 1) + if a:000[i] < val + let val = a:000[i] + endif + endfor + return val +endfunction + +" support for float values +function! coc#helper#max(first, ...) abort + let val = a:first + for i in range(0, len(a:000) - 1) + if a:000[i] > val + let val = a:000[i] + endif + endfor + return val +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/highlight.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/highlight.vim new file mode 100644 index 0000000..194a888 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/highlight.vim @@ -0,0 +1,803 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') +let s:clear_match_by_window = has('nvim-0.6.0') || has('patch-8.1.1084') +let s:set_extmark = has('nvim') && exists('*nvim_buf_set_extmark') +let s:prop_offset = get(g:, 'coc_text_prop_offset', 1000) +let s:namespace_map = {} +let s:ns_id = 1 +let s:diagnostic_hlgroups = ['CocErrorHighlight', 'CocWarningHighlight', 'CocInfoHighlight', 'CocHintHighlight', 'CocDeprecatedHighlight', 'CocUnusedHighlight'] +" Maximum count to highlight each time. +let g:coc_highlight_maximum_count = get(g:, 'coc_highlight_maximum_count', 100) +let s:term = &termguicolors == 0 && !has('gui_running') + +if has('nvim-0.5.0') && s:clear_match_by_window == 0 + try + call getmatches(0) + let s:clear_match_by_window = 1 + catch /^Vim\%((\a\+)\)\=:E118/ + " ignored + endtry +endif + +" Update buffer region by region. +function! coc#highlight#buffer_update(bufnr, key, highlights, ...) abort + if !bufloaded(a:bufnr) + return + endif + if empty(a:highlights) + call coc#highlight#clear_highlight(a:bufnr, a:key, 0, -1) + return + endif + let priority = get(a:, 1, v:null) + let changedtick = getbufvar(a:bufnr, 'changedtick', 0) + if type(get(a:, 2, v:null)) == 0 && changedtick > a:2 + return + endif + let hls = map(copy(a:highlights), "{'hlGroup':v:val[0],'lnum':v:val[1],'colStart':v:val[2],'colEnd':v:val[3],'combine':get(v:val,4,1),'start_incl':get(v:val,5,0),'end_incl':get(v:val,6,0)}") + if len(hls) <= g:coc_highlight_maximum_count || get(g:, 'coc_node_env', '') ==# 'test' + call coc#highlight#update_highlights(a:bufnr, a:key, hls, 0, -1, priority) + return + endif + let linecount = coc#compat#buf_line_count(a:bufnr) + let groups = s:group_hls(hls, linecount) + call s:update_highlights_timer(a:bufnr, changedtick, a:key, priority, groups, 0) +endfunction + +" Update highlights by check exists highlights. +" 0 based, end exclusive start and end +function! coc#highlight#update_highlights(bufnr, key, highlights, ...) abort + let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr + if !bufloaded(bufnr) + return + endif + let start = get(a:, 1, 0) + let end = get(a:, 2, -1) + if end == 0 + return + endif + let linecount = coc#compat#buf_line_count(a:bufnr) + if end >= linecount + let end = -1 + endif + if empty(a:highlights) + call coc#highlight#clear_highlight(bufnr, a:key, start, end) + return + endif + let priority = get(a:, 3, v:null) + let total = len(a:highlights) + " index list that exists with current highlights + let exists = [] + let ns = coc#highlight#create_namespace(a:key) + if has('nvim-0.5.0') || exists('*prop_list') + let endLnum = end < 0 ? linecount - 1 : end - 1 + let firstLnum = a:highlights[0]['lnum'] + if firstLnum > start + call coc#highlight#clear_highlight(bufnr, a:key, start, firstLnum) + let start = firstLnum + endif + let lastLnum = a:highlights[total - 1]['lnum'] + if lastLnum < endLnum + call coc#highlight#clear_highlight(bufnr, a:key, lastLnum + 1, endLnum + 1) + let endLnum = lastLnum + endif + let current = coc#highlight#get_highlights(bufnr, a:key, start, endLnum) + let currIndex = 0 + if !empty(current) + for [lnum, items] in s:to_group(current) + let indexes = [] + let currIndexes = range(0, len(items) - 1) + let removeIndexes = [] + while currIndex != total + let hi = a:highlights[currIndex] + if hi['lnum'] == lnum + let findIndex = -1 + for idx in currIndexes + let item = items[idx] + if hi['hlGroup'] ==# item[0] && hi['colStart'] == item[2] && hi['colEnd'] == item[3] + call add(indexes, currIndex) + let findIndex = idx + break + elseif item[2] > hi['colStart'] + break + endif + endfor + if findIndex != -1 + call filter(currIndexes, 'v:val != '.findIndex) + endif + elseif hi['lnum'] > lnum + break + endif + let currIndex = currIndex + 1 + endwhile + for idx in currIndexes + if s:is_vim + call prop_remove({'bufnr': bufnr, 'id': items[idx][4]}) + else + call nvim_buf_del_extmark(bufnr, ns, items[idx][4]) + endif + endfor + call extend(exists, indexes) + endfor + endif + else + call coc#highlight#clear_highlight(bufnr, a:key, start, end) + endif + let indexes = range(0, total - 1) + if !empty(exists) + let indexes = filter(indexes, 'index(exists, v:val) == -1') + endif + for idx in indexes + let hi = a:highlights[idx] + let opts = { + \ 'combine': get(hi, 'combine', 0), + \ 'start_incl': get(hi, 'start_incl', 0), + \ 'end_incl': get(hi, 'end_incl', 0), + \ } + if type(priority) == 0 + let opts['priority'] = s:get_priority(a:key, hi['hlGroup'], priority) + endif + call coc#highlight#add_highlight(bufnr, ns, hi['hlGroup'], hi['lnum'], hi['colStart'], hi['colEnd'], opts) + endfor +endfunction + +" Get list of highlights by range or all buffer. +" 0 based line, start_col and end_col +" 0 based start & end line, end inclusive. +function! coc#highlight#get_highlights(bufnr, key, ...) abort + if !bufloaded(a:bufnr) + return v:null + endif + if !has_key(s:namespace_map, a:key) + return [] + endif + let start = get(a:, 1, 0) + let end = get(a:, 2, -1) + if has('nvim-0.5.0') + return v:lua.require('coc.highlight').getHighlights(a:bufnr, a:key, start, end) + endif + let res = [] + let ns = s:namespace_map[a:key] + if exists('*prop_list') + let types = coc#api#get_types(ns) + if empty(types) + return res + endif + " Could filter by end_lnum and types + if has('patch-8.2.3652') + let endLnum = end == -1 ? -1 : end + 1 + for prop in prop_list(start + 1, {'bufnr': a:bufnr, 'types': types, 'end_lnum': endLnum}) + if prop['start'] == 0 || prop['end'] == 0 + " multi line textprop are not supported, simply ignore it + continue + endif + let startCol = prop['col'] - 1 + let endCol = startCol + prop['length'] + call add(res, [s:prop_type_hlgroup(prop['type']), prop['lnum'] - 1, startCol, endCol, prop['id']]) + endfor + else + if end == -1 + let end = coc#compat#buf_line_count(a:bufnr) + else + let end = end + 1 + endif + for line in range(start + 1, end) + for prop in prop_list(line, {'bufnr': a:bufnr}) + if index(types, prop['type']) == -1 || prop['start'] == 0 || prop['end'] == 0 + " multi line textprop are not supported, simply ignore it + continue + endif + let startCol = prop['col'] - 1 + let endCol = startCol + prop['length'] + call add(res, [s:prop_type_hlgroup(prop['type']), line - 1, startCol, endCol, prop['id']]) + endfor + endfor + endif + else + throw 'Get highlights requires neovim 0.5.0 or vim support prop_list' + endif + return res +endfunction + +" Add multiple highlights to buffer. +" type HighlightItem = [hlGroup, lnum, colStart, colEnd, combine?, start_incl?, end_incl?] +function! coc#highlight#set(bufnr, key, highlights, priority) abort + if !bufloaded(a:bufnr) + return + endif + let ns = coc#highlight#create_namespace(a:key) + if has('nvim-0.5.0') + call v:lua.require('coc.highlight').set(a:bufnr, ns, a:highlights, a:priority) + else + if len(a:highlights) > g:coc_highlight_maximum_count + call s:add_highlights_timer(a:bufnr, ns, a:highlights, a:priority) + else + call s:add_highlights(a:bufnr, ns, a:highlights, a:priority) + endif + endif +endfunction + +" Clear highlights by 0 based line numbers. +function! coc#highlight#clear(bufnr, key, lnums) abort + if !bufloaded(a:bufnr) || empty(a:lnums) + return + endif + let ns = coc#highlight#create_namespace(a:key) + for lnum in a:lnums + if has('nvim') + call nvim_buf_clear_namespace(a:bufnr, ns, lnum, lnum + 1) + else + call coc#api#exec('buf_clear_namespace', [a:bufnr, ns, lnum, lnum + 1]) + endif + endfor + " clear highlights in invalid line. + if has('nvim') + let linecount = nvim_buf_line_count(a:bufnr) + call nvim_buf_clear_namespace(a:bufnr, ns, linecount, -1) + endif +endfunction + +function! coc#highlight#del_markers(bufnr, key, ids) abort + if !bufloaded(a:bufnr) + return + endif + let ns = coc#highlight#create_namespace(a:key) + for id in a:ids + if s:is_vim + call prop_remove({'bufnr': a:bufnr, 'id': id}) + else + call nvim_buf_del_extmark(a:bufnr, ns, id) + endif + endfor +endfunction + +" highlight LSP range, +function! coc#highlight#ranges(bufnr, key, hlGroup, ranges, ...) abort + let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr + if !bufloaded(bufnr) || !exists('*getbufline') + return + endif + let opts = get(a:, 1, {}) + let synmaxcol = getbufvar(a:bufnr, '&synmaxcol', 1000) + if synmaxcol == 0 + let synmaxcol = 1000 + endif + let synmaxcol = min([synmaxcol, 1000]) + let srcId = coc#highlight#create_namespace(a:key) + for range in a:ranges + let start = range['start'] + let end = range['end'] + for lnum in range(start['line'] + 1, end['line'] + 1) + let arr = getbufline(bufnr, lnum) + let line = empty(arr) ? '' : arr[0] + if empty(line) + continue + endif + if start['character'] > synmaxcol || end['character'] > synmaxcol + continue + endif + " TODO don't know how to count UTF16 code point, should work most cases. + let colStart = lnum == start['line'] + 1 ? strlen(strcharpart(line, 0, start['character'])) : 0 + let colEnd = lnum == end['line'] + 1 ? strlen(strcharpart(line, 0, end['character'])) : strlen(line) + if colStart == colEnd + continue + endif + call coc#highlight#add_highlight(bufnr, srcId, a:hlGroup, lnum - 1, colStart, colEnd, opts) + endfor + endfor +endfunction + +function! coc#highlight#add_highlight(bufnr, src_id, hl_group, line, col_start, col_end, ...) abort + let opts = get(a:, 1, {}) + let priority = get(opts, 'priority', v:null) + if !s:is_vim + if s:set_extmark && a:src_id != -1 + " get(opts, 'start_incl', 0) ? v:true : v:false, + try + call nvim_buf_set_extmark(a:bufnr, a:src_id, a:line, a:col_start, { + \ 'end_col': a:col_end, + \ 'hl_group': a:hl_group, + \ 'hl_mode': get(opts, 'combine', 1) ? 'combine' : 'replace', + \ 'right_gravity': v:true, + \ 'end_right_gravity': v:false, + \ 'priority': type(priority) == 0 ? min([priority, 4096]) : 4096, + \ }) + catch /^Vim\%((\a\+)\)\=:E5555/ + " the end_col could be invalid, ignore this error + endtry + else + call nvim_buf_add_highlight(a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end) + endif + else + call coc#api#exec('buf_add_highlight', [a:bufnr, a:src_id, a:hl_group, a:line, a:col_start, a:col_end, opts]) + endif +endfunction + +function! coc#highlight#clear_highlight(bufnr, key, start_line, end_line) abort + let bufnr = a:bufnr == 0 ? bufnr('%') : a:bufnr + if !bufloaded(bufnr) + return + endif + let src_id = coc#highlight#create_namespace(a:key) + if has('nvim') + call nvim_buf_clear_namespace(a:bufnr, src_id, a:start_line, a:end_line) + else + call coc#api#exec('buf_clear_namespace', [a:bufnr, src_id, a:start_line, a:end_line]) + endif +endfunction + +" highlight buffer in winid with CodeBlock &HighlightItems +" export interface HighlightItem { +" lnum: number // 0 based +" hlGroup: string +" colStart: number // 0 based +" colEnd: number +" } +" export interface CodeBlock { +" filetype?: string +" hlGroup?: string +" startLine: number // 0 based +" endLine: number +" } +function! coc#highlight#add_highlights(winid, codes, highlights) abort + if get(g:, 'coc_node_env', '') ==# 'test' + call setwinvar(a:winid, 'highlights', a:highlights) + endif + " clear highlights + call coc#compat#execute(a:winid, 'syntax clear') + let bufnr = winbufnr(a:winid) + call coc#highlight#clear_highlight(bufnr, -1, 0, -1) + if !empty(a:codes) + call coc#highlight#highlight_lines(a:winid, a:codes) + endif + if !empty(a:highlights) + for item in a:highlights + let hlGroup = item['hlGroup'] + let opts = hlGroup =~# 'Search$' ? {'priority': 999, 'combine': 1} : {} + call coc#highlight#add_highlight(bufnr, -1, hlGroup, item['lnum'], item['colStart'], item['colEnd']) + endfor + endif +endfunction + + +" Add highlights to line groups of winid, support hlGroup and filetype +" config should have startLine, endLine (0 based, end excluded) and filetype or hlGroup +" endLine should > startLine and endLine is excluded +" +" export interface CodeBlock { +" filetype?: string +" hlGroup?: string +" startLine: number // 0 based +" endLine: number +" } +function! coc#highlight#highlight_lines(winid, blocks) abort + let region_id = 1 + let defined = [] + let cmds = [] + for config in a:blocks + let start = config['startLine'] + 1 + let end = config['endLine'] == -1 ? len(getbufline(winbufnr(a:winid), 1, '$')) + 1 : config['endLine'] + 1 + let filetype = get(config, 'filetype', '') + let hlGroup = get(config, 'hlGroup', '') + if !empty(hlGroup) + call add(cmds, 'syntax region '.hlGroup.' start=/\%'.start.'l/ end=/\%'.end.'l/') + else + let filetype = matchstr(filetype, '\v^\w+') + if empty(filetype) || filetype == 'txt' || index(get(g:, 'coc_markdown_disabled_languages', []), filetype) != -1 + continue + endif + if index(defined, filetype) == -1 + call add(cmds, 'syntax include @'.toupper(filetype).' syntax/'.filetype.'.vim') + call add(cmds, 'unlet! b:current_syntax') + call add(defined, filetype) + endif + call add(cmds, 'syntax region CodeBlock'.region_id.' start=/\%'.start.'l/ end=/\%'.end.'l/ contains=@'.toupper(filetype).' keepend') + let region_id = region_id + 1 + endif + endfor + if !empty(cmds) + call coc#compat#execute(a:winid, cmds, 'silent!') + endif +endfunction + +function! coc#highlight#compose(fg, bg) abort + let fgId = synIDtrans(hlID(a:fg)) + let bgId = synIDtrans(hlID(a:bg)) + let isGuiReversed = synIDattr(fgId, 'reverse', 'gui') !=# '1' || synIDattr(bgId, 'reverse', 'gui') !=# '1' + let guifg = isGuiReversed ? synIDattr(fgId, 'fg', 'gui') : synIDattr(fgId, 'bg', 'gui') + let guibg = isGuiReversed ? synIDattr(bgId, 'bg', 'gui') : synIDattr(bgId, 'fg', 'gui') + let isCtermReversed = synIDattr(fgId, 'reverse', 'cterm') !=# '1' || synIDattr(bgId, 'reverse', 'cterm') !=# '1' + let ctermfg = isCtermReversed ? synIDattr(fgId, 'fg', 'cterm') : synIDattr(fgId, 'bg', 'cterm') + let ctermbg = isCtermReversed ? synIDattr(bgId, 'bg', 'cterm') : synIDattr(bgId, 'fg', 'cterm') + let bold = synIDattr(fgId, 'bold') ==# '1' + let italic = synIDattr(fgId, 'italic') ==# '1' + let underline = synIDattr(fgId, 'underline') ==# '1' + let cmd = '' + if !empty(guifg) + let cmd .= ' guifg=' . guifg + endif + if !empty(ctermfg) + let cmd .= ' ctermfg=' . ctermfg + elseif guifg =~# '^#' + let cmd .= ' ctermfg=' . coc#color#rgb2term(strpart(guifg, 1)) + endif + if !empty(guibg) + let cmd .= ' guibg=' . guibg + endif + if !empty(ctermbg) + let cmd .= ' ctermbg=' . ctermbg + elseif guibg =~# '^#' + let cmd .= ' ctermbg=' . coc#color#rgb2term(strpart(guibg, 1)) + endif + if bold + let cmd .= ' cterm=bold gui=bold' + elseif italic + let cmd .= ' cterm=italic gui=italic' + elseif underline + let cmd .= ' cterm=underline gui=underline' + endif + return cmd +endfunction + +" Compose hlGroups with foreground and background colors. +function! coc#highlight#compose_hlgroup(fgGroup, bgGroup) abort + let hlGroup = 'Fg'.a:fgGroup.'Bg'.a:bgGroup + if a:fgGroup ==# a:bgGroup + return a:fgGroup + endif + if hlexists(hlGroup) && match(execute('hi '.hlGroup, 'silent!'), 'cleared') == -1 + return hlGroup + endif + let cmd = coc#highlight#compose(a:fgGroup, a:bgGroup) + if empty(cmd) + return 'Normal' + endif + execute 'silent hi ' . hlGroup . cmd + return hlGroup +endfunction + +" hlGroup id, key => 'fg' | 'bg', kind => 'cterm' | 'gui' +function! coc#highlight#get_color(id, key, kind) abort + if synIDattr(a:id, 'reverse', a:kind) !=# '1' + return synIDattr(a:id, a:key, a:kind) + endif + return synIDattr(a:id, a:key ==# 'bg' ? 'fg' : 'bg', a:kind) +endfunction + +function! coc#highlight#get_hl_command(id, key, cterm, gui) abort + let cterm = coc#highlight#get_color(a:id, a:key, 'cterm') + let gui = coc#highlight#get_color(a:id, a:key, 'gui') + let cmd = ' cterm'.a:key.'=' . (empty(cterm) ? a:cterm : cterm) + let cmd .= ' gui'.a:key.'=' . (empty(gui) ? a:gui : gui) + return cmd +endfunction + +function! coc#highlight#reversed(id) abort + let gui = has('gui_running') || &termguicolors == 1 + if synIDattr(synIDtrans(a:id), 'reverse', gui ? 'gui' : 'cterm') == '1' + return 1 + endif + return 0 +endfunction + +function! coc#highlight#get_contrast(group1, group2) abort + let normal = coc#highlight#get_hex_color(synIDtrans(hlID('Normal')), 'bg', '#000000') + let bg1 = coc#highlight#get_hex_color(synIDtrans(hlID(a:group1)), 'bg', normal) + let bg2 = coc#highlight#get_hex_color(synIDtrans(hlID(a:group2)), 'bg', normal) + return coc#color#hex_contrast(bg1, bg2) +endfunction + +" Darken or lighten background +function! coc#highlight#create_bg_command(group, amount) abort + let id = synIDtrans(hlID(a:group)) + let normal = coc#highlight#get_hex_color(synIDtrans(hlID('Normal')), 'bg', &background ==# 'dark' ? '#282828' : '#fefefe') + let bg = coc#highlight#get_hex_color(id, 'bg', normal) + let hex = a:amount > 0 ? coc#color#darken(bg, a:amount) : coc#color#lighten(bg, -a:amount) + let ctermbg = coc#color#rgb2term(strpart(hex, 1)) + if s:term && !s:check_ctermbg(id, ctermbg) && abs(a:amount) < 20.0 + return coc#highlight#create_bg_command(a:group, a:amount * 2) + endif + return 'ctermbg=' . ctermbg.' guibg=' . hex +endfunction + +function! coc#highlight#get_hex_color(id, kind, fallback) abort + let attr = coc#highlight#get_color(a:id, a:kind, s:term ? 'cterm' : 'gui') + let hex = s:to_hex_color(attr, s:term) + if empty(hex) && !s:term + let attr = coc#highlight#get_color(a:id, a:kind, 'cterm') + let hex = s:to_hex_color(attr, 1) + endif + return empty(hex) ? a:fallback : hex +endfunction + +function! s:check_ctermbg(id, cterm) abort + let attr = coc#highlight#get_color(a:id, 'bg', 'cterm') + if empty(attr) + let attr = coc#highlight#get_color(synIDtrans(hlID('Normal')), 'bg', 'cterm') + endif + if attr ==# a:cterm + return 0 + endif + return 1 +endfunction + +function! s:to_hex_color(color, term) abort + if empty(a:color) + return '' + endif + if a:color =~# '^#\x\+$' + return a:color + endif + if a:term && a:color =~# '^\d\+$' + return coc#color#term2rgb(a:color) + endif + let hex = coc#color#nameToHex(tolower(a:color), a:term) + return empty(hex) ? '' : hex +endfunction + +" add matches for winid, use 0 for current window. +function! coc#highlight#match_ranges(winid, bufnr, ranges, hlGroup, priority) abort + let winid = a:winid == 0 ? win_getid() : a:winid + let bufnr = a:bufnr == 0 ? winbufnr(winid) : a:bufnr + if empty(getwininfo(winid)) || (a:bufnr != 0 && winbufnr(a:winid) != a:bufnr) + " not valid + return [] + endif + if !s:clear_match_by_window + let curr = win_getid() + if has('nvim') + noa call nvim_set_current_win(winid) + else + noa call win_gotoid(winid) + endif + endif + let ids = [] + for range in a:ranges + let pos = [] + let start = range['start'] + let end = range['end'] + for lnum in range(start['line'] + 1, end['line'] + 1) + let arr = getbufline(bufnr, lnum) + let line = empty(arr) ? '' : arr[0] + if empty(line) + continue + endif + let colStart = lnum == start['line'] + 1 ? strlen(strcharpart(line, 0, start['character'])) + 1 : 1 + let colEnd = lnum == end['line'] + 1 ? strlen(strcharpart(line, 0, end['character'])) + 1 : strlen(line) + 1 + if colStart == colEnd + continue + endif + call add(pos, [lnum, colStart, colEnd - colStart]) + endfor + if !empty(pos) + let opts = s:clear_match_by_window ? {'window': a:winid} : {} + let i = 1 + let l = [] + for p in pos + call add(l, p) + if i % 8 == 0 + let id = matchaddpos(a:hlGroup, l, a:priority, -1, opts) + call add(ids, id) + let l = [] + endif + let i += 1 + endfor + if !empty(l) + let id = matchaddpos(a:hlGroup, l, a:priority, -1, opts) + call add(ids, id) + endif + endif + endfor + if !s:clear_match_by_window + if has('nvim') + noa call nvim_set_current_win(curr) + else + noa call win_gotoid(curr) + endif + endif + return ids +endfunction + +" Clear matches by hlGroup regexp. +function! coc#highlight#clear_match_group(winid, match) abort + let winid = a:winid == 0 ? win_getid() : a:winid + if empty(getwininfo(winid)) + " not valid + return + endif + if s:clear_match_by_window + let arr = filter(getmatches(winid), 'v:val["group"] =~# "'.a:match.'"') + for item in arr + call matchdelete(item['id'], winid) + endfor + else + let curr = win_getid() + let switch = exists('*nvim_set_current_win') && curr != winid + if switch + noa call nvim_set_current_win(a:winid) + endif + if win_getid() == winid + let arr = filter(getmatches(), 'v:val["group"] =~# "'.a:match.'"') + for item in arr + call matchdelete(item['id']) + endfor + endif + if switch + noa call nvim_set_current_win(curr) + endif + endif +endfunction + +" Clear matches by match ids, use 0 for current win. +function! coc#highlight#clear_matches(winid, ids) + let winid = a:winid == 0 ? win_getid() : a:winid + if empty(getwininfo(winid)) + " not valid + return + endif + if s:clear_match_by_window + for id in a:ids + try + call matchdelete(id, winid) + catch /^Vim\%((\a\+)\)\=:E803/ + " ignore + endtry + endfor + else + let curr = win_getid() + let switch = exists('*nvim_set_current_win') && curr != winid + if switch + noa call nvim_set_current_win(a:winid) + endif + if win_getid() == winid + for id in a:ids + try + call matchdelete(id) + catch /^Vim\%((\a\+)\)\=:E803/ + " ignore + endtry + endfor + endif + if switch + noa call nvim_set_current_win(curr) + endif + endif +endfunction + +function! coc#highlight#clear_all() abort + for src_id in values(s:namespace_map) + for bufnr in map(getbufinfo({'bufloaded': 1}), 'v:val["bufnr"]') + if has('nvim') + call nvim_buf_clear_namespace(bufnr, src_id, 0, -1) + else + call coc#api#exec('buf_clear_namespace', [bufnr, src_id, 0, -1]) + endif + endfor + endfor +endfunction + +function! coc#highlight#create_namespace(key) abort + if type(a:key) == 0 + return a:key + endif + if has_key(s:namespace_map, a:key) + return s:namespace_map[a:key] + endif + if has('nvim') + let s:namespace_map[a:key] = nvim_create_namespace('coc-'.a:key) + else + let s:namespace_map[a:key] = s:ns_id + let s:ns_id = s:ns_id + 1 + endif + return s:namespace_map[a:key] +endfunction + +function! coc#highlight#get_syntax_name(lnum, col) + return synIDattr(synIDtrans(synID(a:lnum,a:col,1)),"name") +endfunction + +function! s:prop_type_hlgroup(type) abort + return substitute(a:type, '_\d\+$', '', '') +endfunction + +function! s:update_highlights_timer(bufnr, changedtick, key, priority, groups, idx) abort + if getbufvar(a:bufnr, 'changedtick', 0) != a:changedtick + return + endif + let group = get(a:groups, a:idx, v:null) + if empty(group) + return + endif + if empty(group['highlights']) + call coc#highlight#clear_highlight(a:bufnr, a:key, group['start'], group['end']) + else + call coc#highlight#update_highlights(a:bufnr, a:key, group['highlights'], group['start'], group['end'], a:priority) + endif + if a:idx < len(a:groups) - 1 + call timer_start(50, { -> s:update_highlights_timer(a:bufnr, a:changedtick, a:key, a:priority, a:groups, a:idx + 1)}) + endif +endfunction + +function! s:add_highlights_timer(bufnr, ns, highlights, priority) abort + let hls = [] + let next = [] + for i in range(0, len(a:highlights) - 1) + if i < g:coc_highlight_maximum_count + call add(hls, a:highlights[i]) + else + call add(next, a:highlights[i]) + endif + endfor + call s:add_highlights(a:bufnr, a:ns, hls, a:priority) + if len(next) + call timer_start(30, {->s:add_highlights_timer(a:bufnr, a:ns, next, a:priority)}) + endif +endfunction + +function! s:add_highlights(bufnr, ns, highlights, priority) abort + for item in a:highlights + let opts = { + \ 'priority': a:priority, + \ 'combine': get(item, 4, 1) ? 1 : 0, + \ 'start_incl': get(item, 5, 0) ? 1 : 0, + \ 'end_incl': get(item, 6, 0) ? 1 : 0, + \ } + call coc#highlight#add_highlight(a:bufnr, a:ns, item[0], item[1], item[2], item[3], opts) + endfor +endfunction + +function! s:to_group(items) abort + let res = [] + let before = v:null + for item in a:items + if empty(before) || before[0] != item[1] + let before = [item[1], [item]] + call add(res, before) + else + call add(before[1], item) + endif + endfor + return res +endfunction + +function! s:get_priority(key, hlGroup, priority) abort + if a:hlGroup ==# 'CocListSearch' + return 2048 + endif + if a:hlGroup ==# 'CocSearch' + return 999 + endif + if strpart(a:key, 0, 10) !=# 'diagnostic' + return a:priority + endif + return a:priority - index(s:diagnostic_hlgroups, a:hlGroup) +endfunction + +function! s:group_hls(hls, linecount) abort + " start, end, highlights + let groups = [] + if empty(a:hls) + call add(groups, {'start': 0, 'end': a:linecount, 'highlights': []}) + return groups + endif + let start = 0 + let highlights = [] + let lastLnum = -1 + for item in a:hls + let lnum = item['lnum'] + if lnum >= a:linecount + break + endif + if len(highlights) < g:coc_highlight_maximum_count || lnum == lastLnum + call add(highlights, item) + let lastLnum = lnum + else + call add(groups, {'start': start, 'end': lastLnum + 1, 'highlights': highlights}) + let highlights = [] + let start = lastLnum + 1 + call add(highlights, item) + let lastLnum = lnum + endif + endfor + call add(groups, {'start': start, 'end': a:linecount, 'highlights': highlights}) + return groups +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/list.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/list.vim index 19cd858..30e0a3a 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/list.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/list.vim @@ -1,173 +1,42 @@ -let s:activated = 0 +scriptencoding utf-8 let s:is_vim = !has('nvim') -let s:saved_ve = &t_ve -let s:saved_cursor = &guicursor -let s:gui = has('gui_running') || has('nvim') - -function! coc#list#get_chars() - return { - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '' : "\", - \ '' : "\", - \ '' : "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '<2-LeftMouse>': "\<2-LeftMouse>", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \ '': "\", - \} -endfunction - -function! coc#list#getc() abort - let c = getchar() - return type(c) == type(0) ? nr2char(c) : c -endfunction +let s:prefix = '[List Preview]' +let s:sign_group = 'CocList' +" filetype detect could be slow. +let s:filetype_map = { + \ 'c': 'c', + \ 'py': 'python', + \ 'vim': 'vim', + \ 'ts': 'typescript', + \ 'js': 'javascript', + \ 'html': 'html', + \ 'css': 'css' + \ } function! coc#list#getchar() abort - let input = coc#list#getc() - if 1 != &iminsert - return input - endif - "a language keymap is activated, so input must be resolved to the mapped values. - let partial_keymap = mapcheck(input, "l") - while partial_keymap !=# "" - let full_keymap = maparg(input, "l") - if full_keymap ==# "" && len(input) >= 3 "HACK: assume there are no keymaps longer than 3. - return input - elseif full_keymap ==# partial_keymap - return full_keymap - endif - let c = coc#list#getc() - if c ==# "\" || c ==# "\" - "if the short sequence has a valid mapping, return that. - if !empty(full_keymap) - return full_keymap - endif - return input - endif - let input .= c - let partial_keymap = mapcheck(input, "l") - endwhile - return input -endfunction - -function! coc#list#prompt_start() abort - call timer_start(100, {-> coc#list#start_prompt()}) + return coc#prompt#getchar() endfunction -function! coc#list#start_prompt() - if s:activated | return | endif - if !get(g:, 'coc_disable_transparent_cursor', 0) - if s:gui - if has('nvim-0.5.0') && !empty(s:saved_cursor) - set guicursor+=a:ver1-CocCursorTransparent/lCursor - endif - elseif s:is_vim - set t_ve= - endif - endif - let s:activated = 1 - try - while s:activated - let ch = coc#list#getchar() - if ch ==# "\u26d4" - break - endif - if ch ==# "\" || ch ==# "\" || ch ==# "\" - continue - else - call coc#rpc#notify('InputChar', [ch, getcharmod()]) - endif - endwhile - catch /^Vim:Interrupt$/ - let s:activated = 0 - call coc#rpc#notify('InputChar', ["\"]) - return - endtry - let s:activated = 0 -endfunction - -function! coc#list#setlines(lines, append) - let total = line('$') +function! coc#list#setlines(bufnr, lines, append) if a:append - silent call append(line('$'), a:lines) + silent call appendbufline(a:bufnr, '$', a:lines) else - silent call append(0, a:lines) - let n = len(a:lines) + 1 - let saved_reg = @" - silent execute n.',$d' - let @" = saved_reg + if exists('*deletebufline') + silent call deletebufline(a:bufnr, len(a:lines) + 1, '$') + else + let n = len(a:lines) + 1 + let saved_reg = @" + silent execute n.',$d' + let @" = saved_reg + endif + silent call setbufline(a:bufnr, 1, a:lines) endif endfunction function! coc#list#options(...) let list = ['--top', '--tab', '--normal', '--no-sort', '--input', '--strict', \ '--regex', '--interactive', '--number-select', '--auto-preview', - \ '--ignore-case'] + \ '--ignore-case', '--no-quit', '--first', '--reverse'] if get(g:, 'coc_enabled', 0) let names = coc#rpc#request('listNames', []) call extend(list, names) @@ -175,22 +44,9 @@ function! coc#list#options(...) return join(list, "\n") endfunction -function! coc#list#stop_prompt(...) - if get(a:, 1, 0) == 0 && !get(g:, 'coc_disable_transparent_cursor',0) - " neovim has bug with revert empty &guicursor - if s:gui && !empty(s:saved_cursor) - if has('nvim-0.5.0') - set guicursor+=a:ver1-Cursor/lCursor - let &guicursor = s:saved_cursor - endif - elseif s:is_vim - let &t_ve = s:saved_ve - endif - endif - if s:activated - let s:activated = 0 - call feedkeys("\u26d4", 'int') - endif +function! coc#list#names(...) abort + let names = coc#rpc#request('listNames', []) + return join(names, "\n") endfunction function! coc#list#status(name) @@ -199,7 +55,6 @@ function! coc#list#status(name) endfunction function! coc#list#create(position, height, name, numberSelect) - nohlsearch if a:position ==# 'tab' execute 'silent tabe list:///'.a:name else @@ -207,60 +62,251 @@ function! coc#list#create(position, height, name, numberSelect) execute 'resize '.a:height endif if a:numberSelect + setl norelativenumber setl number else setl nonumber - setl foldcolumn=2 + setl norelativenumber endif - return [bufnr('%'), win_getid()] + return [bufnr('%'), win_getid(), tabpagenr()] +endfunction + +" close list windows +function! coc#list#clean_up() abort + for i in range(1, winnr('$')) + let bufname = bufname(winbufnr(i)) + if bufname =~# 'list://' + execute i.'close!' + endif + endfor endfunction function! coc#list#setup(source) let b:list_status = {} - let statusParts = [ - \ '%#CocListMode#-- %{get(b:list_status, "mode")} --%*', - \ '%{get(g:, "coc_list_loading_status", "")}', - \ '%{get(b:list_status, "args", "")}', - \ '(%L/%{get(b:list_status, "total", "")})', - \ '%=', - \ '%#CocListPath# %{get(b:list_status, "cwd", "")} %l/%L%*' - \ ] - call setwinvar(winnr(), '&statusline', join(statusParts, ' ')) setl buftype=nofile nobuflisted nofen nowrap - setl norelativenumber bufhidden=wipe cursorline winfixheight - setl tabstop=1 nolist nocursorcolumn + setl norelativenumber bufhidden=wipe nocursorline winfixheight + setl tabstop=1 nolist nocursorcolumn undolevels=-1 setl signcolumn=auto + if has('nvim-0.5.0') || has('patch-8.1.0864') + setl scrolloff=0 + endif setl filetype=list syntax case ignore let source = a:source[8:] let name = toupper(source[0]).source[1:] execute 'syntax match Coc'.name.'Line /\v^.*$/' - nnoremap c + if !s:is_vim + " Repeat press and would invoke on vim + nnoremap c + endif +endfunction + +function! coc#list#select(bufnr, line) abort + if !empty(a:bufnr) && bufloaded(a:bufnr) + call sign_unplace(s:sign_group, { 'buffer': a:bufnr }) + if a:line > 0 + call sign_place(6, s:sign_group, 'CocListCurrent', a:bufnr, {'lnum': a:line}) + endif + endif endfunction +" Check if previewwindow exists on current tab. function! coc#list#has_preview() for i in range(1, winnr('$')) - let preview = getwinvar(i, '&previewwindow') + let preview = getwinvar(i, 'previewwindow', getwinvar(i, '&previewwindow', 0)) if preview - return 1 + return i endif endfor return 0 endfunction -function! coc#list#restore(winid, height) - let res = win_gotoid(a:winid) - if res == 0 | return | endif - if winnr('$') == 1 +" Get previewwindow from tabnr, use 0 for current tab +function! coc#list#get_preview(...) abort + let tabnr = get(a:, 1, 0) == 0 ? tabpagenr() : a:1 + let info = gettabinfo(tabnr) + if !empty(info) + for win in info[0]['windows'] + if gettabwinvar(tabnr, win, 'previewwindow', 0) + return win + endif + endfor + endif + return -1 +endfunction + +function! coc#list#scroll_preview(dir) abort + let winnr = coc#list#has_preview() + if !winnr return endif - execute 'resize '.a:height - if s:is_vim - redraw + let winid = win_getid(winnr) + if exists('*win_execute') + call win_execute(winid, "normal! ".(a:dir ==# 'up' ? "\" : "\")) + else + let id = win_getid() + noa call win_gotoid(winid) + execute "normal! ".(a:dir ==# 'up' ? "\" : "\") + noa call win_gotoid(id) + endif +endfunction + +function! coc#list#close_preview(tabnr) abort + let winid = coc#list#get_preview(a:tabnr) + if winid != -1 + call coc#window#close(winid) + endif +endfunction + +" Improve preview performance by reused window & buffer. +" lines - list of lines +" config.position - could be 'below' 'top' 'tab'. +" config.winid - id of original window. +" config.name - (optional )name of preview buffer. +" config.splitRight - (optional) split to right when 1. +" config.lnum - (optional) current line number +" config.filetype - (optional) filetype of lines. +" config.hlGroup - (optional) highlight group. +" config.maxHeight - (optional) max height of window, valid for 'below' & 'top' position. +function! coc#list#preview(lines, config) abort + let name = fnamemodify(get(a:config, 'name', ''), ':.') + let lines = a:lines + if empty(lines) + if get(a:config, 'scheme', 'file') != 'file' + let bufnr = s:load_buffer(name) + let lines = bufnr == 0 ? [''] : getbufline(bufnr, 1, '$') + else + " Show empty lines so not close window. + let lines = [''] + endif + endif + let winid = coc#list#get_preview(0) + let bufnr = winid == -1 ? 0 : winbufnr(winid) + " Try reuse buffer & window + let bufnr = coc#float#create_buf(bufnr, lines) + if bufnr == 0 + return endif + call setbufvar(bufnr, '&synmaxcol', 500) + let filetype = get(a:config, 'filetype', '') + let extname = matchstr(name, '\.\zs[^.]\+$') + if empty(filetype) && !empty(extname) + let filetype = get(s:filetype_map, extname, '') + endif + let range = get(a:config, 'range', v:null) + let targetRange = get(a:config, 'targetRange', v:null) + let hlGroup = get(a:config, 'hlGroup', 'Search') + let lnum = get(a:config, 'lnum', 1) + let position = get(a:config, 'position', 'below') + let original = get(a:config, 'winid', -1) + if winid == -1 + let change = position != 'tab' && get(a:config, 'splitRight', 0) + let curr = win_getid() + if change + if original && win_id2win(original) + noa call win_gotoid(original) + else + noa wincmd t + endif + execute 'noa belowright vert sb '.bufnr + let winid = win_getid() + elseif position == 'tab' || get(a:config, 'splitRight', 0) + execute 'noa belowright vert sb '.bufnr + let winid = win_getid() + else + let mod = position == 'top' ? 'below' : 'above' + let height = s:get_height(lines, a:config) + execute 'noa '.mod.' sb +resize\ '.height.' '.bufnr + let winid = win_getid() + endif + noa call winrestview({"lnum": lnum ,"topline":s:get_topline(a:config, lnum, winid)}) + call s:set_preview_options(winid) + noa call win_gotoid(curr) + else + let height = s:get_height(lines, a:config) + if height > 0 + if s:is_vim + let curr = win_getid() + noa call win_gotoid(winid) + execute 'silent! noa resize '.height + noa call win_gotoid(curr) + else + call nvim_win_set_height(winid, height) + endif + endif + call coc#compat#execute(winid, ['syntax clear', 'noa call winrestview({"lnum":'.lnum.',"topline":'.s:get_topline(a:config, lnum, winid).'})']) + endif + call setwinvar(winid, '&foldenable', 0) + if s:prefix.' '.name != bufname(bufnr) + if s:is_vim + call win_execute(winid, 'noa file '.fnameescape(s:prefix.' '.name), 'silent!') + else + silent! noa call nvim_buf_set_name(bufnr, s:prefix.' '.name) + endif + endif + " highlights + if !empty(filetype) + let start = max([0, lnum - 300]) + let end = min([len(lines), lnum + 300]) + call coc#highlight#highlight_lines(winid, [{'filetype': filetype, 'startLine': start, 'endLine': end}]) + call coc#compat#execute(winid, 'syn sync fromstart') + else + call coc#compat#execute(winid, 'filetype detect') + let ft = getbufvar(bufnr, '&filetype', '') + if !empty(extname) && !empty(ft) + let s:filetype_map[extname] = ft + endif + endif + call sign_unplace('CocCursorLine', {'buffer': bufnr}) + call coc#compat#execute(winid, 'call clearmatches()') + if !s:is_vim + " vim send to buffer on FocusLost, and other cases + call coc#compat#execute(winid, 'nnoremap :call CocActionAsync("listCancel")') + endif + if !empty(targetRange) + for lnum in range(targetRange['start']['line'] + 1, targetRange['end']['line'] + 1) + call sign_place(0, 'CocCursorLine', 'CocListCurrent', bufnr, {'lnum': lnum}) + endfor + else + call sign_unplace('CocCursorLine', { 'buffer': bufnr }) + endif + if !empty(range) + call coc#highlight#match_ranges(winid, bufnr, [range], hlGroup, 10) + endif +endfunction + +function! s:get_height(lines, config) abort + if get(a:config, 'splitRight', 0) || get(a:config, 'position', 'below') == 'tab' + return 0 + endif + let height = min([get(a:config, 'maxHeight', 10), len(a:lines), &lines - &cmdheight - 2]) + return height +endfunction + +function! s:load_buffer(name) abort + if exists('*bufadd') && exists('*bufload') + let bufnr = bufadd(a:name) + call bufload(bufnr) + return bufnr + endif + return 0 +endfunction + +function! s:get_topline(config, lnum, winid) abort + let toplineStyle = get(a:config, 'toplineStyle', 'offset') + if toplineStyle == 'middle' + return max([1, a:lnum - winheight(a:winid)/2]) + endif + + let toplineOffset = get(a:config, 'toplineOffset', 3) + return max([1, a:lnum - toplineOffset]) endfunction -function! coc#list#set_height(height) abort - if winnr('$') == 1| return | endif - execute 'resize '.a:height +function! s:set_preview_options(winid) abort + call setwinvar(a:winid, '&foldmethod', 'manual') + call setwinvar(a:winid, '&signcolumn', 'no') + call setwinvar(a:winid, '&number', 1) + call setwinvar(a:winid, '&cursorline', 0) + call setwinvar(a:winid, '&relativenumber', 0) + call setwinvar(a:winid, 'previewwindow', 1) endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/math.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/math.vim new file mode 100644 index 0000000..27757b9 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/math.vim @@ -0,0 +1,11 @@ + +" support for float values +function! coc#math#min(first, ...) abort + let val = a:first + for i in range(0, len(a:000) - 1) + if a:000[i] < val + let val = a:000[i] + endif + endfor + return val +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/notify.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/notify.vim new file mode 100644 index 0000000..ba6199b --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/notify.vim @@ -0,0 +1,532 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') +let s:utf = &encoding =~# '^utf' +let s:error_icon = get(g:, 'coc_notify_error_icon', s:utf ? '' : 'E') +let s:warning_icon = get(g:, 'coc_notify_warning_icon', s:utf ? '⚠' : 'W') +let s:info_icon = get(g:, 'coc_notify_info_icon', s:utf ? '' : 'I') +let s:interval = get(g:, 'coc_notify_interval', s:is_vim ? 50 : 20) +let s:phl = 'CocNotificationProgress' +let s:progress_char = '─' +let s:duration = 300.0 +let s:winids = [] + +" Valid notify winids on current tab +function! coc#notify#win_list() abort + call filter(s:winids, 'coc#float#valid(v:val)') + return filter(copy(s:winids), '!empty(getwinvar(v:val,"float"))') +endfunction + +function! coc#notify#close_all() abort + for winid in coc#notify#win_list() + call coc#notify#close(winid) + endfor +endfunction + +" Do action for winid or first notify window with actions. +function! coc#notify#do_action(...) abort + let winids = a:0 > 0 ? a:000 : coc#notify#win_list() + for winid in winids + if coc#float#valid(winid) && getwinvar(winid, 'closing', 0) != 1 + let actions = getwinvar(winid, 'actions', []) + if !empty(actions) + let items = map(copy(actions), '(v:key + 1).". ".v:val') + let msg = join(getbufline(winbufnr(winid), 1, '$'), ' ') + call coc#ui#quickpick(msg, items, {err, res -> s:on_action(err, res, winid) }) + break + endif + endif + endfor +endfunction + +" Copy notification contents +function! coc#notify#copy() abort + let lines = [] + for winid in coc#notify#win_list() + let key = getwinvar(winid, 'key', v:null) + if type(key) == v:t_string + call extend(lines, json_decode(key)['lines']) + endif + endfor + if empty(lines) + echohl WarningMsg | echon 'No content to copy' | echohl None + return + endif + call setreg('*', join(lines, "\n")) +endfunction + +" Show source name in window +function! coc#notify#show_sources() abort + if !exists('*getbufline') || !exists('*appendbufline') + throw "getbufline and appendbufline functions required, please upgrade your vim." + endif + let winids = filter(coc#notify#win_list(), 'coc#window#get_var(v:val,"closing") != 1') + for winid in winids + let key = getwinvar(winid, 'key', v:null) + if type(key) == v:t_string + let bufnr = winbufnr(winid) + let obj = json_decode(key) + let sourcename = get(obj, 'source', '') + let lnum = get(obj, 'kind', '') ==# 'progress' ? 1 : 0 + let content = get(getbufline(bufnr, lnum + 1), 0, '') + if empty(sourcename) || content ==# sourcename + continue + endif + call appendbufline(bufnr, lnum, sourcename) + call coc#highlight#add_highlight(bufnr, -1, 'Title', lnum, 0, -1) + call coc#float#scroll_win(winid, 0, 1) + endif + endfor + redra +endfunction + +function! coc#notify#close_by_source(source) abort + let winids = filter(coc#notify#win_list(), 'coc#window#get_var(v:val,"closing") != 1') + for winid in winids + let key = getwinvar(winid, 'key', v:null) + if type(key) == v:t_string + let obj = json_decode(key) + if get(obj, 'source', '') ==# a:source + call coc#notify#close(winid) + endif + endif + endfor +endfunction + +" Cancel auto hide +function! coc#notify#keep() abort + for winid in coc#notify#win_list() + call s:cancel(winid, 'close_timer') + endfor +endfunction + +" borderhighlight - border highlight [string] +" maxWidth - max content width, default 60 [number] +" minWidth - minimal width [number] +" maxHeight - max content height, default 10 [number] +" highlight - default highlight [string] +" winblend - winblend [number] +" timeout - auto close timeout, default 5000 [number] +" title - title text +" marginRight - margin right, default 10 [number] +" focusable - focusable [number] +" source - source name [string] +" kind - kind for create icon [string] +" actions - action names [string[]] +function! coc#notify#create(lines, config) abort + let actions = get(a:config, 'actions', []) + let key = json_encode(extend({'lines': a:lines}, a:config)) + let winid = s:find_win(key) + let kind = get(a:config, 'kind', '') + let row = 0 + if winid != -1 + let row = getwinvar(winid, 'top', 0) + call filter(s:winids, 'v:val != '.winid) + call coc#float#close(winid, 1) + let winid = v:null + endif + let opts = coc#dict#pick(a:config, ['highlight', 'borderhighlight', 'focusable', 'shadow']) + let border = has_key(opts, 'borderhighlight') ? [1, 1, 1, 1] : [] + let icon = s:get_icon(kind, get(a:config, 'highlight', 'CocFloating')) + let margin = get(a:config, 'marginRight', 10) + let maxWidth = min([&columns - margin - 2, get(a:config, 'maxWidth', 80)]) + if maxWidth <= 0 + throw 'No enough spaces for notification' + endif + let lines = map(copy(a:lines), 'tr(v:val, "\t", " ")') + if has_key(a:config, 'title') + if !empty(border) + let opts['title'] = a:config['title'] + else + let lines = [a:config['title']] + lines + endif + endif + let width = max(map(copy(lines), 'strwidth(v:val)')) + (empty(icon) ? 1 : 3) + if width > maxWidth + let lines = coc#string#reflow(lines, maxWidth) + let width = max(map(copy(lines), 'strwidth(v:val)')) + (empty(icon) ? 1 : 3) + endif + let highlights = [] + if !empty(icon) + let ic = icon['text'] + if empty(lines) + call add(lines, ic) + else + let lines[0] = ic.' '.lines[0] + endif + call add(highlights, {'lnum': 0, 'hlGroup': icon['hl'], 'colStart': 0, 'colEnd': strlen(ic)}) + endif + let actionText = join(actions, ' ') + call map(lines, 'v:key == 0 ? v:val : repeat(" ", '.(empty(icon) ? 0 : 2).').v:val') + let minWidth = get(a:config, 'minWidth', kind ==# 'progress' ? 30 : 10) + let width = max(extend(map(lines + [get(opts, 'title', '').' '], 'strwidth(v:val)'), [minWidth, strwidth(actionText) + 1])) + let width = min([maxWidth, width]) + let height = min([get(a:config, 'maxHeight', 3), len(lines)]) + if kind ==# 'progress' + let lines = [repeat(s:progress_char, width)] + lines + let height = height + 1 + endif + if !empty(actions) + let before = max([width - strwidth(actionText), 0]) + let lines = lines + [repeat(' ', before).actionText] + let height = height + 1 + call s:add_action_highlights(before, height - 1, highlights, actions) + endif + if row == 0 + let wintop = coc#notify#get_top() + let row = wintop - height - (empty(border) ? 0 : 2) - 1 + if !s:is_vim && !empty(border) + let row = row + 1 + endif + endif + let col = &columns - margin - width + if s:is_vim && !empty(border) + let col = col - 2 + endif + let winblend = 60 + " Avoid animate for transparent background. + if get(a:config, 'winblend', 30) == 0 && empty(synIDattr(synIDtrans(hlID(get(opts, 'highlight', 'CocFloating'))), 'bg', 'gui')) + let winblend = 0 + endif + call extend(opts, { + \ 'relative': 'editor', + \ 'width': width, + \ 'height': height, + \ 'col': col, + \ 'row': row + 1, + \ 'lines': lines, + \ 'rounded': 1, + \ 'highlights': highlights, + \ 'winblend': winblend, + \ 'border': border, + \ }) + let result = coc#float#create_float_win(0, 0, opts) + if empty(result) + throw 'Unable to create notify window' + endif + let winid = result[0] + let bufnr = result[1] + call setwinvar(winid, 'right', 1) + call setwinvar(winid, 'kind', 'notification') + call setwinvar(winid, 'top', row) + call setwinvar(winid, 'key', key) + call setwinvar(winid, 'actions', actions) + call setwinvar(winid, 'source', get(a:config, 'source', '')) + call setwinvar(winid, 'border', !empty(border)) + call coc#float#nvim_scrollbar(winid) + call add(s:winids, winid) + let from = {'row': opts['row'], 'winblend': opts['winblend']} + let to = {'row': row, 'winblend': get(a:config, 'winblend', 30)} + call timer_start(s:interval, { -> s:animate(winid, from, to, 0)}) + if kind ==# 'progress' + call timer_start(s:interval, { -> s:progress(winid, width, 0, -1)}) + endif + if !s:is_vim + call coc#compat#buf_add_keymap(bufnr, 'n', '', ':call coc#notify#nvim_click('.winid.')', { + \ 'silent': v:true, + \ 'nowait': v:true + \ }) + endif + " Enable auto close + if empty(actions) && kind !=# 'progress' + let timer = timer_start(get(a:config, 'timeout', 10000), { -> coc#notify#close(winid)}) + call setwinvar(winid, 'close_timer', timer) + endif + return [winid, bufnr] +endfunction + +function! coc#notify#nvim_click(winid) abort + if getwinvar(a:winid, 'closing', 0) + return + endif + call s:cancel(a:winid, 'close_timer') + let actions = getwinvar(a:winid, 'actions', []) + if !empty(actions) + let character = strpart(getline('.'), col('.') - 1, 1) + if character =~# '^\k' + let word = expand('') + let idx = index(actions, word) + if idx != -1 + call coc#rpc#notify('FloatBtnClick', [winbufnr(a:winid), idx]) + call coc#notify#close(a:winid) + endif + endif + endif +endfunction + +function! coc#notify#on_close(winid) abort + if index(s:winids, a:winid) >= 0 + call filter(s:winids, 'v:val != '.a:winid) + call coc#notify#reflow() + endif +endfunction + +function! coc#notify#get_top() abort + let mintop = min(map(coc#notify#win_list(), 'coc#notify#get_win_top(v:val)')) + if mintop != 0 + return mintop + endif + return &lines - &cmdheight - (&laststatus == 0 ? 0 : 1 ) +endfunction + +function! coc#notify#get_win_top(winid) abort + let row = getwinvar(a:winid, 'top', 0) + if row == 0 + return row + endif + return row - (s:is_vim ? 0 : getwinvar(a:winid, 'border', 0)) +endfunction + +" Close with timer +function! coc#notify#close(winid) abort + if !coc#float#valid(a:winid) || coc#window#get_var(a:winid, 'closing', 0) == 1 + return + endif + if !coc#window#visible(a:winid) + call coc#float#close(a:winid, 1) + return + endif + let row = coc#window#get_var(a:winid, 'top') + if type(row) != v:t_number + call coc#float#close(a:winid) + return + endif + call coc#window#set_var(a:winid, 'closing', 1) + call s:cancel(a:winid) + let winblend = coc#window#get_var(a:winid, 'winblend', 0) + let curr = s:is_vim ? {'row': row} : {'winblend': winblend} + let dest = s:is_vim ? {'row': row + 1} : {'winblend': winblend == 0 ? 0 : 60} + call s:animate(a:winid, curr, dest, 0, 1) +endfunction + +function! s:add_action_highlights(before, lnum, highlights, actions) abort + let colStart = a:before + for text in a:actions + let w = strwidth(text) + call add(a:highlights, { + \ 'lnum': a:lnum, + \ 'hlGroup': 'CocNotificationButton', + \ 'colStart': colStart, + \ 'colEnd': colStart + w + \ }) + let colStart = colStart + w + 1 + endfor +endfunction + +function! s:on_action(err, idx, winid) abort + if !empty(a:err) + throw a:err + endif + if a:idx > 0 + call coc#rpc#notify('FloatBtnClick', [winbufnr(a:winid), a:idx - 1]) + call coc#notify#close(a:winid) + endif +endfunction + +function! s:cancel(winid, ...) abort + let name = get(a:, 1, 'timer') + let timer = coc#window#get_var(a:winid, name) + if !empty(timer) + call timer_stop(timer) + call coc#window#set_var(a:winid, name, v:null) + endif +endfunction + +function! s:progress(winid, total, curr, index) abort + if !coc#float#valid(a:winid) + return + endif + if coc#window#visible(a:winid) + let total = a:total + let idx = float2nr(a:curr/5.0)%total + if idx != a:index + " update percent + let bufnr = winbufnr(a:winid) + let percent = coc#window#get_var(a:winid, 'percent') + if !empty(percent) + let width = strchars(get(getbufline(bufnr, 1), 0, '')) + let line = repeat(s:progress_char, width - 4).printf('%4s', percent) + let total = width - 4 + call setbufline(bufnr, 1, line) + endif + let message = coc#window#get_var(a:winid, 'message') + if !empty(message) + let linecount = coc#compat#buf_line_count(bufnr) + let hasAction = !empty(coc#window#get_var(a:winid, 'actions', [])) + if getbufvar(bufnr, 'message', 0) == 0 + call appendbufline(bufnr, linecount - hasAction, message) + call setbufvar(bufnr, 'message', 1) + call coc#float#change_height(a:winid, 1) + let tabnr = coc#window#tabnr(a:winid) + call coc#notify#reflow(tabnr) + else + call setbufline(bufnr, linecount - hasAction, message) + endif + endif + let bytes = strlen(s:progress_char) + call coc#highlight#clear_highlight(bufnr, -1, 0, 1) + let colStart = bytes * idx + if idx + 4 <= total + let colEnd = bytes * (idx + 4) + call coc#highlight#add_highlight(bufnr, -1, s:phl, 0, colStart, colEnd) + else + let colEnd = bytes * total + call coc#highlight#add_highlight(bufnr, -1, s:phl, 0, colStart, colEnd) + call coc#highlight#add_highlight(bufnr, -1, s:phl, 0, 0, bytes * (idx + 4 - total)) + endif + endif + call timer_start(s:interval, { -> s:progress(a:winid, total, a:curr + 1, idx)}) + else + " Not block CursorHold event + call timer_start(&updatetime + 100, { -> s:progress(a:winid, a:total, a:curr, a:index)}) + endif +endfunction + +" Optional row & winblend +function! s:config_win(winid, props) abort + let change_row = has_key(a:props, 'row') + if s:is_vim + if change_row + call popup_move(a:winid, {'line': a:props['row'] + 1}) + endif + else + if change_row + let [row, column] = nvim_win_get_position(a:winid) + call nvim_win_set_config(a:winid, { + \ 'row': a:props['row'], + \ 'col': column, + \ 'relative': 'editor', + \ }) + call s:nvim_move_related(a:winid, a:props['row']) + endif + call coc#float#nvim_set_winblend(a:winid, get(a:props, 'winblend', v:null)) + call coc#float#nvim_refresh_scrollbar(a:winid) + endif +endfunction + +function! s:nvim_move_related(winid, row) abort + let winids = coc#window#get_var(a:winid, 'related') + if empty(winids) + return + endif + for winid in winids + if nvim_win_is_valid(winid) + let [row, column] = nvim_win_get_position(winid) + let delta = coc#window#get_var(winid, 'delta', 0) + call nvim_win_set_config(winid, { + \ 'row': a:row + delta, + \ 'col': column, + \ 'relative': 'editor', + \ }) + endif + endfor +endfunction + +function! s:animate(winid, from, to, prev, ...) abort + if !coc#float#valid(a:winid) + return + endif + let curr = a:prev + s:interval + let percent = coc#math#min(curr / s:duration, 1) + let props = s:get_props(a:from, a:to, percent) + call s:config_win(a:winid, props) + let close = get(a:, 1, 0) + if percent < 1 + call timer_start(s:interval, { -> s:animate(a:winid, a:from, a:to, curr, close)}) + elseif close + call filter(s:winids, 'v:val != '.a:winid) + let tabnr = coc#window#tabnr(a:winid) + if tabnr != -1 + call coc#float#close(a:winid, 1) + call coc#notify#reflow(tabnr) + endif + endif +endfunction + +function! coc#notify#reflow(...) abort + let tabnr = get(a:, 1, tabpagenr()) + let winids = filter(copy(s:winids), 'coc#window#tabnr(v:val) == '.tabnr.' && coc#window#get_var(v:val,"closing") != 1') + if empty(winids) + return + endif + let animate = tabnr == tabpagenr() + let wins = map(copy(winids), {_, val -> { + \ 'winid': val, + \ 'row': coc#window#get_var(val,'top',0), + \ 'top': coc#window#get_var(val,'top',0) - (s:is_vim ? 0 : coc#window#get_var(val, 'border', 0)), + \ 'height': coc#float#get_height(val), + \ }}) + call sort(wins, {a, b -> b['top'] - a['top']}) + let bottom = &lines - &cmdheight - (&laststatus == 0 ? 0 : 1 ) + let moved = 0 + for item in wins + let winid = item['winid'] + let delta = bottom - (item['top'] + item['height'] + 1) + if delta != 0 + call s:cancel(winid) + let dest = item['row'] + delta + call coc#window#set_var(winid, 'top', dest) + if animate + call s:move_win_timer(winid, {'row': item['row']}, {'row': dest}, 0) + else + call s:config_win(winid, {'row': dest}) + endif + let moved = moved + delta + endif + let bottom = item['top'] + delta + endfor +endfunction + +function! s:move_win_timer(winid, from, to, curr) abort + if !coc#float#valid(a:winid) + return + endif + if coc#window#get_var(a:winid, 'closing', 0) == 1 + return + endif + let percent = coc#math#min(a:curr / s:duration, 1) + let next = a:curr + s:interval + if a:curr > 0 + call s:config_win(a:winid, s:get_props(a:from, a:to, percent)) + endif + if percent < 1 + let timer = timer_start(s:interval, { -> s:move_win_timer(a:winid, a:from, a:to, next)}) + call coc#window#set_var(a:winid, 'timer', timer) + endif +endfunction + +function! s:find_win(key) abort + for winid in coc#notify#win_list() + if getwinvar(winid, 'key', '') ==# a:key + return winid + endif + endfor + return -1 +endfunction + +function! s:get_icon(kind, bg) abort + if a:kind ==# 'info' + return {'text': s:info_icon, 'hl': coc#highlight#compose_hlgroup('CocInfoSign', a:bg)} + endif + if a:kind ==# 'warning' + return {'text': s:warning_icon, 'hl': coc#highlight#compose_hlgroup('CocWarningSign', a:bg)} + endif + if a:kind ==# 'error' + return {'text': s:error_icon, 'hl': coc#highlight#compose_hlgroup('CocErrorSign', a:bg)} + endif + return v:null +endfunction + +" percent should be float +function! s:get_props(from, to, percent) abort + let obj = {} + for key in keys(a:from) + let changed = a:to[key] - a:from[key] + if !s:is_vim && key ==# 'row' + " Could be float + let obj[key] = a:from[key] + changed * a:percent + else + let obj[key] = a:from[key] + float2nr(round(changed * a:percent)) + endif + endfor + return obj +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/prompt.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/prompt.vim new file mode 100644 index 0000000..b452f95 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/prompt.vim @@ -0,0 +1,216 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') +let s:activated = 0 +let s:session_names = [] +let s:saved_ve = &t_ve +let s:saved_cursor = &guicursor +let s:gui = has('gui_running') || has('nvim') + +let s:char_map = { + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\":'' , + \ "\":'' , + \ "\":'', + \ "\":'', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\<2-LeftMouse>": '<2-LeftMouse>', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ "\": '', + \ } + +function! coc#prompt#getc() abort + let c = getchar() + return type(c) is 0 ? nr2char(c) : c +endfunction + +function! coc#prompt#getchar() abort + let input = coc#prompt#getc() + if 1 != &iminsert + return input + endif + "a language keymap is activated, so input must be resolved to the mapped values. + let partial_keymap = mapcheck(input, 'l') + while partial_keymap !=# '' + let dict = maparg(input, 'l', 0, 1) + if empty(dict) || get(dict, 'expr', 0) + return input + endif + let full_keymap = get(dict, 'rhs', '') + if full_keymap ==# "" && len(input) >= 3 "HACK: assume there are no keymaps longer than 3. + return input + elseif full_keymap ==# partial_keymap + return full_keymap + endif + let c = coc#prompt#getc() + if c ==# "\" || c ==# "\" + "if the short sequence has a valid mapping, return that. + if !empty(full_keymap) + return full_keymap + endif + return input + endif + let input .= c + let partial_keymap = mapcheck(input, 'l') + endwhile + return input +endfunction + +function! coc#prompt#start_prompt(session) abort + let s:session_names = s:filter(s:session_names, a:session) + call add(s:session_names, a:session) + if s:activated | return | endif + if s:is_vim + call s:start_prompt_vim() + else + call s:start_prompt() + endif +endfunction + +function! s:start_prompt_vim() abort + call timer_start(10, {-> s:start_prompt()}) +endfunction + +function! s:start_prompt() + if s:activated | return | endif + if !get(g:, 'coc_disable_transparent_cursor', 0) + if s:gui + if has('nvim-0.5.0') && !empty(s:saved_cursor) + set guicursor+=a:ver1-CocCursorTransparent/lCursor + endif + elseif s:is_vim + set t_ve= + endif + endif + let s:activated = 1 + try + while s:activated + let ch = coc#prompt#getchar() + if ch ==# "\" || ch ==# "\" || ch ==# "\" + continue + else + let curr = s:current_session() + let mapped = get(s:char_map, ch, ch) + if !empty(curr) + call coc#rpc#notify('InputChar', [curr, mapped, getcharmod()]) + endif + if mapped == '' + let s:session_names = [] + call s:reset() + break + endif + endif + endwhile + catch /^Vim:Interrupt$/ + let s:activated = 0 + call coc#rpc#notify('InputChar', [s:current_session(), '', 0]) + let s:session_names = [] + call s:reset() + return + endtry + let s:activated = 0 +endfunction + +function! coc#prompt#stop_prompt(session) + let s:session_names = s:filter(s:session_names, a:session) + if len(s:session_names) + return + endif + if s:activated + let s:activated = 0 + call s:reset() + call feedkeys("\", 'int') + endif +endfunction + +function! coc#prompt#activated() abort + return s:activated +endfunction + +function! s:reset() abort + if !get(g:, 'coc_disable_transparent_cursor',0) + " neovim has bug with revert empty &guicursor + if s:gui && !empty(s:saved_cursor) + if has('nvim-0.5.0') + set guicursor+=a:ver1-Cursor/lCursor + let &guicursor = s:saved_cursor + endif + elseif s:is_vim + let &t_ve = s:saved_ve + endif + endif + echo "" +endfunction + +function! s:current_session() abort + if empty(s:session_names) + return v:null + endif + return s:session_names[len(s:session_names) - 1] +endfunction + +function! s:filter(list, id) abort + return filter(copy(a:list), 'v:val !=# a:id') +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/pum.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/pum.vim new file mode 100644 index 0000000..8e6ad19 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/pum.vim @@ -0,0 +1,547 @@ +scriptencoding utf-8 +let s:is_vim = !has('nvim') +let s:pum_bufnr = 0 +let s:pum_winid = 0 +let s:pum_index = -1 +let s:pum_size = 0 +let s:inserted = 0 +let s:virtual_text = 0 +let s:virtual_text_ns = coc#highlight#create_namespace('pum-virtual') +let s:ignore = s:is_vim || has('nvim-0.5.0') ? "\" : "\\" +let s:hide_pum = has('nvim-0.6.1') || has('patch-8.2.3389') +let s:virtual_text_support = has('nvim-0.5.0') || has('patch-9.0.0067') +let s:prop_id = 0 +let s:reversed = 0 +let s:check_hl_group = 0 + +if s:is_vim && s:virtual_text_support + if empty(prop_type_get('CocPumVirtualText')) + call prop_type_add('CocPumVirtualText', {'highlight': 'CocPumVirtualText'}) + endif +endif + +function! coc#pum#visible() abort + if !s:pum_winid + return 0 + endif + return getwinvar(s:pum_winid, 'float', 0) == 1 +endfunction + +function! coc#pum#winid() abort + return s:pum_winid +endfunction + +function! coc#pum#close_detail() abort + let winid = coc#float#get_float_by_kind('pumdetail') + if winid + call coc#float#close(winid, 1) + if s:is_vim + call timer_start(0, { -> execute('redraw')}) + endif + endif +endfunction + +function! coc#pum#close(...) abort + if coc#float#valid(s:pum_winid) + if get(a:, 1, '') ==# 'cancel' + let input = getwinvar(s:pum_winid, 'input', '') + let s:pum_index = -1 + call s:insert_word(input) + call s:on_pum_change(0) + doautocmd TextChangedI + elseif get(a:, 1, '') ==# 'confirm' + let words = getwinvar(s:pum_winid, 'words', []) + if s:pum_index >= 0 + let word = get(words, s:pum_index, '') + call s:insert_word(word) + endif + doautocmd TextChangedI + endif + call s:close_pum() + if !get(a:, 2, 0) + let pretext = strpart(getline('.'), 0, col('.') - 1) + call coc#rpc#notify('CompleteStop', [get(a:, 1, ''), pretext]) + endif + endif +endfunction + +function! coc#pum#select_confirm() abort + if s:pum_index < 0 + let s:pum_index = 0 + call s:on_pum_change(0) + endif + call coc#pum#close('confirm') +endfunction + +function! coc#pum#insert() abort + call timer_start(10, { -> s:insert_current()}) + return s:ignore +endfunction + +function! coc#pum#_close() abort + if coc#float#valid(s:pum_winid) + call s:close_pum() + if s:is_vim + call timer_start(0, { -> execute('redraw')}) + endif + endif +endfunction + +function! s:insert_current() abort + if coc#float#valid(s:pum_winid) + if s:pum_index >= 0 + let words = getwinvar(s:pum_winid, 'words', []) + let word = get(words, s:pum_index, '') + call s:insert_word(word) + endif + doautocmd TextChangedI + call s:close_pum() + let pretext = strpart(getline('.'), 0, col('.') - 1) + call coc#rpc#notify('CompleteStop', ['', pretext]) + endif +endfunction + +function! s:close_pum() abort + call s:clear_virtual_text() + call coc#float#close(s:pum_winid, 1) + let s:pum_winid = 0 + let s:pum_size = 0 + let winid = coc#float#get_float_by_kind('pumdetail') + if winid + call coc#float#close(winid, 1) + endif +endfunction + +function! coc#pum#next(insert) abort + call timer_start(10, { -> s:navigate(1, a:insert)}) + return s:ignore +endfunction + +function! coc#pum#prev(insert) abort + call timer_start(10, { -> s:navigate(0, a:insert)}) + return s:ignore +endfunction + +function! coc#pum#stop() abort + call timer_start(10, { -> coc#pum#close()}) + return s:ignore +endfunction + +function! coc#pum#cancel() abort + call timer_start(10, { -> coc#pum#close('cancel')}) + return s:ignore +endfunction + +function! coc#pum#confirm() abort + call timer_start(10, { -> coc#pum#close('confirm')}) + return s:ignore +endfunction + +function! coc#pum#select(index, insert, confirm) abort + if !coc#float#valid(s:pum_winid) + return '' + endif + if a:index == -1 + call coc#pum#close('cancel') + return '' + endif + if a:index < 0 || a:index >= s:pum_size + throw 'index out of range ' . a:index + endif + call s:select_by_index(a:index, a:insert) + if a:confirm + call coc#pum#close('confirm') + endif + return '' +endfunction + +function! coc#pum#info() abort + let bufnr = winbufnr(s:pum_winid) + let words = getwinvar(s:pum_winid, 'words', []) + let word = s:pum_index < 0 ? '' : get(words, s:pum_index, '') + let pretext = strpart(getline('.'), 0, col('.') - 1) + if s:is_vim + let pos = popup_getpos(s:pum_winid) + let border = has_key(popup_getoptions(s:pum_winid), 'border') + let add = pos['scrollbar'] && border ? 1 : 0 + return { + \ 'word': word, + \ 'index': s:pum_index, + \ 'scrollbar': pos['scrollbar'], + \ 'row': pos['line'] - 1, + \ 'col': pos['col'] - 1, + \ 'width': pos['width'] + add, + \ 'height': pos['height'], + \ 'size': s:pum_size, + \ 'border': border, + \ 'inserted': s:inserted ? v:true : v:false, + \ 'reversed': s:reversed ? v:true : v:false, + \ } + else + let scrollbar = coc#float#get_related(s:pum_winid, 'scrollbar') + let winid = coc#float#get_related(s:pum_winid, 'border', s:pum_winid) + let pos = nvim_win_get_position(winid) + return { + \ 'word': word, + \ 'index': s:pum_index, + \ 'scrollbar': scrollbar && nvim_win_is_valid(scrollbar) ? 1 : 0, + \ 'row': pos[0], + \ 'col': pos[1], + \ 'width': nvim_win_get_width(winid), + \ 'height': nvim_win_get_height(winid), + \ 'size': s:pum_size, + \ 'border': winid != s:pum_winid, + \ 'inserted': s:inserted ? v:true : v:false, + \ 'reversed': s:reversed ? v:true : v:false, + \ } + endif +endfunction + +function! coc#pum#scroll(forward) abort + if coc#pum#visible() + let height = s:get_height(s:pum_winid) + if s:pum_size > height + call timer_start(10, { -> s:scroll_pum(a:forward, height, s:pum_size)}) + endif + endif + return s:ignore +endfunction + +function! s:get_height(winid) abort + if has('nvim') + return nvim_win_get_height(a:winid) + endif + return get(popup_getpos(a:winid), 'core_height', 0) +endfunction + +function! s:scroll_pum(forward, height, size) abort + let topline = s:get_topline(s:pum_winid) + if !a:forward && topline == 1 + if s:pum_index >= 0 + call s:select_line(s:pum_winid, 1) + call s:on_pum_change(1) + endif + return + endif + if a:forward && topline + a:height - 1 >= a:size + if s:pum_index >= 0 + call s:select_line(s:pum_winid, a:size) + call s:on_pum_change(1) + endif + return + endif + call coc#float#scroll_win(s:pum_winid, a:forward, a:height) + if s:pum_index >= 0 + let lnum = s:pum_index + 1 + let topline = s:get_topline(s:pum_winid) + if lnum >= topline && lnum <= topline + a:height - 1 + return + endif + call s:select_line(s:pum_winid, topline) + call s:on_pum_change(1) + endif +endfunction + +function! s:get_topline(winid) abort + if has('nvim') + let info = getwininfo(a:winid)[0] + return info['topline'] + else + let pos = popup_getpos(a:winid) + return pos['firstline'] + endif +endfunction + +function! s:navigate(next, insert) abort + if !coc#float#valid(s:pum_winid) + return + endif + let index = s:get_index(a:next) + call s:select_by_index(index, a:insert) +endfunction + +function! s:select_by_index(index, insert) abort + let lnum = a:index == -1 ? 0 : s:index_to_lnum(a:index) + call s:set_cursor(s:pum_winid, lnum) + if !s:is_vim + call coc#float#nvim_scrollbar(s:pum_winid) + endif + if a:insert + let s:inserted = 1 + if a:index < 0 + let input = getwinvar(s:pum_winid, 'input', '') + call s:insert_word(input) + call coc#pum#close_detail() + else + let words = getwinvar(s:pum_winid, 'words', []) + let word = get(words, a:index, '') + call s:insert_word(word) + endif + doautocmd TextChangedP + endif + call s:on_pum_change(1) +endfunction + +function! s:get_index(next) abort + if a:next + let index = s:pum_index + 1 == s:pum_size ? -1 : s:pum_index + 1 + else + let index = s:pum_index == -1 ? s:pum_size - 1 : s:pum_index - 1 + endif + return index +endfunction + +function! s:insert_word(word) abort + let parts = getwinvar(s:pum_winid, 'parts', []) + if !empty(parts) && mode() ==# 'i' + let curr = getline('.') + if curr ==# parts[0].a:word.parts[1] + return + endif + let saved_completeopt = &completeopt + if saved_completeopt =~ 'menuone' + noa set completeopt=menu + endif + noa call complete(strlen(parts[0]) + 1, [{ 'empty': v:true, 'word': a:word }]) + " exit complete state + if s:hide_pum + call feedkeys("\\", 'in') + else + let g:coc_disable_space_report = 1 + call feedkeys("\\", 'in') + endif + execute 'noa set completeopt='.saved_completeopt + endif +endfunction + +" create or update pum with lines, CompleteOption and config. +" return winid & dimension +function! coc#pum#create(lines, opt, config) abort + if mode() !=# 'i' || a:opt['line'] != line('.') + return + endif + let len = col('.') - a:opt['col'] - 1 + if len < 0 + return + endif + let input = len == 0 ? '' : strpart(getline('.'), a:opt['col'], len) + if input !=# a:opt['input'] + return + endif + let config = s:get_pum_dimension(a:lines, a:opt['col'], a:config) + if empty(config) + return + endif + let s:reversed = get(a:config, 'reverse', 0) && config['row'] < 0 + let s:virtual_text = s:virtual_text_support && a:opt['virtualText'] + let s:pum_size = len(a:lines) + let s:pum_index = a:opt['index'] + let lnum = s:index_to_lnum(s:pum_index) + call extend(config, { + \ 'lines': s:reversed ? reverse(copy(a:lines)) : a:lines, + \ 'relative': 'cursor', + \ 'nopad': 1, + \ 'cursorline': 1, + \ 'index': lnum - 1, + \ 'focusable': v:false + \ }) + call extend(config, coc#dict#pick(a:config, ['highlight', 'rounded', 'highlights', 'winblend', 'shadow', 'border', 'borderhighlight'])) + if s:reversed + for item in config['highlights'] + let item['lnum'] = s:pum_size - item['lnum'] - 1 + endfor + endif + if empty(get(config, 'winblend', 0)) && exists('&pumblend') + let config['winblend'] = &pumblend + endif + let result = coc#float#create_float_win(s:pum_winid, s:pum_bufnr, config) + if empty(result) + return + endif + let s:inserted = 0 + let s:pum_winid = result[0] + let s:pum_bufnr = result[1] + call setwinvar(s:pum_winid, 'above', config['row'] < 0) + let firstline = s:get_firstline(lnum, s:pum_size, config['height']) + if s:is_vim + call popup_setoptions(s:pum_winid, { 'firstline': firstline }) + else + call coc#compat#execute(s:pum_winid, 'call winrestview({"lnum":'.lnum.',"topline":'.firstline.'})') + endif + call coc#dialog#place_sign(s:pum_bufnr, s:pum_index == -1 ? 0 : lnum) + " content before col and content after cursor + let linetext = getline('.') + let parts = [strpart(linetext, 0, a:opt['col']), strpart(linetext, col('.') - 1)] + call setwinvar(s:pum_winid, 'input', input) + call setwinvar(s:pum_winid, 'parts', parts) + call setwinvar(s:pum_winid, 'words', a:opt['words']) + call setwinvar(s:pum_winid, 'kind', 'pum') + if !s:is_vim + if s:pum_size > config['height'] + redraw + call coc#float#nvim_scrollbar(s:pum_winid) + else + call coc#float#close_related(s:pum_winid, 'scrollbar') + endif + endif + call s:on_pum_change(0) +endfunction + +function! s:get_firstline(lnum, total, height) abort + if a:lnum <= a:height + return 1 + endif + return min([a:total - a:height + 1, a:lnum - (a:height*2/3)]) +endfunction + +function! s:on_pum_change(move) abort + if coc#float#valid(s:pum_winid) + if s:virtual_text + call s:insert_virtual_text() + endif + let ev = extend(coc#pum#info(), {'move': a:move ? v:true : v:false}) + call coc#rpc#notify('CocAutocmd', ['MenuPopupChanged', ev, win_screenpos(winnr())[0] + winline() - 2]) + endif +endfunction + +function! s:index_to_lnum(index) abort + if s:reversed + if a:index <= 0 + return s:pum_size + endif + return s:pum_size - a:index + endif + return max([1, a:index + 1]) +endfunction + +function! s:get_pum_dimension(lines, col, config) abort + let linecount = len(a:lines) + let [lineIdx, colIdx] = coc#cursor#screen_pos() + let bh = empty(get(a:config, 'border', [])) ? 0 : 2 + let columns = &columns + let pumwidth = max([15, &pumwidth]) + let width = min([columns, max([pumwidth, a:config['width']])]) + let vh = &lines - &cmdheight - 1 - !empty(&tabline) + if vh <= 0 + return v:null + endif + let pumheight = empty(&pumheight) ? vh : &pumheight + let showTop = getwinvar(s:pum_winid, 'above', v:null) + if type(showTop) != v:t_number + if vh - lineIdx - bh - 1 < min([pumheight, linecount]) && vh - lineIdx < min([10, vh/2]) + let showTop = 1 + else + let showTop = 0 + endif + endif + let height = showTop ? min([lineIdx - bh - !empty(&tabline), linecount, pumheight]) : min([vh - lineIdx - bh - 1, linecount, pumheight]) + if height <= 0 + return v:null + endif + let col = - (col('.') - a:col - 1) - 1 + let row = showTop ? - height : 1 + let delta = colIdx + col + if width > pumwidth && delta + width > columns + let width = max([columns - delta, pumwidth]) + endif + if delta < 0 + let col = col - delta + elseif delta + width > columns + let col = max([-colIdx, col - (delta + width - columns)]) + endif + return { + \ 'row': row, + \ 'col': col, + \ 'width': width, + \ 'height': height + \ } +endfunction + +" can't use coc#dialog#set_cursor on vim8, don't know why +function! s:set_cursor(winid, line) abort + if s:is_vim + let pos = popup_getpos(a:winid) + let core_height = pos['core_height'] + let lastline = pos['firstline'] + core_height - 1 + if a:line > lastline + call popup_setoptions(a:winid, { + \ 'firstline': pos['firstline'] + a:line - lastline, + \ }) + elseif a:line < pos['firstline'] + if s:reversed + call popup_setoptions(a:winid, { + \ 'firstline': a:line == 0 ? s:pum_size - core_height + 1 : a:line - core_height + 1, + \ }) + else + call popup_setoptions(a:winid, { + \ 'firstline': max([1, a:line]), + \ }) + endif + endif + endif + call s:select_line(a:winid, a:line) +endfunction + +function! s:select_line(winid, line) abort + let s:pum_index = s:reversed ? (a:line == 0 ? -1 : s:pum_size - a:line) : a:line - 1 + let lnum = s:reversed ? (a:line == 0 ? s:pum_size : a:line) : max([1, a:line]) + if s:is_vim + call coc#compat#execute(a:winid, 'exe '.lnum) + else + call nvim_win_set_cursor(a:winid, [lnum, 0]) + endif + call coc#dialog#place_sign(s:pum_bufnr, a:line == 0 ? 0 : lnum) +endfunction + +function! s:insert_virtual_text() abort + let bufnr = bufnr('%') + if !s:virtual_text || s:pum_index < 0 + call s:clear_virtual_text() + else + " Check if could create + let insert = '' + let line = line('.') - 1 + let words = getwinvar(s:pum_winid, 'words', []) + let word = get(words, s:pum_index, '') + let parts = getwinvar(s:pum_winid, 'parts', []) + let start = strlen(parts[0]) + let input = strpart(getline('.'), start, col('.') - 1 - start) + if strchars(word) > strchars(input) && strcharpart(word, 0, strchars(input)) ==# input + let insert = strcharpart(word, strchars(input)) + endif + if s:is_vim + if s:prop_id != 0 + call prop_remove({'id': s:prop_id}, line + 1, line + 1) + endif + if !empty(insert) + let s:prop_id = prop_add(line + 1, col('.'), { + \ 'text': insert, + \ 'type': 'CocPumVirtualText' + \ }) + endif + else + call nvim_buf_clear_namespace(bufnr, s:virtual_text_ns, line, line + 1) + if !empty(insert) + let opts = { + \ 'hl_mode': 'combine', + \ 'virt_text': [[insert, 'CocPumVirtualText']], + \ 'virt_text_pos': 'overlay', + \ 'virt_text_win_col': virtcol('.') - 1, + \ } + call nvim_buf_set_extmark(bufnr, s:virtual_text_ns, line, col('.') - 1, opts) + endif + endif + endif +endfunction + +function! s:clear_virtual_text() abort + if s:virtual_text_support + if s:is_vim + if s:prop_id != 0 + call prop_remove({'id': s:prop_id}) + endif + else + call nvim_buf_clear_namespace(bufnr('%'), s:virtual_text_ns, 0, -1) + endif + endif +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/rpc.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/rpc.vim index 4a1796c..7a69b73 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/rpc.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/rpc.vim @@ -1,15 +1,16 @@ +scriptencoding utf-8 let s:is_win = has("win32") || has("win64") let s:client = v:null let s:name = 'coc' let s:is_vim = !has('nvim') function! coc#rpc#start_server() - if $NODE_ENV ==# 'test' + if get(g:, 'coc_node_env', '') ==# 'test' " server already started let s:client = coc#client#create(s:name, []) - let s:client['running'] = 1 - let s:client['chan_id'] = get(g:, 'coc_node_channel_id', 0) - call dictwatcheradd(g:, 'coc_node_channel_id', function('s:ChannelSet')) + let chan_id = get(g:, 'coc_node_channel_id', 0) + let s:client['running'] = chan_id != 0 + let s:client['chan_id'] = chan_id return endif if empty(s:client) @@ -35,12 +36,12 @@ function! coc#rpc#ready() return 1 endfunction -function! s:ChannelSet(dict, key, val) - let chan_id = get(a:val, 'new', 0) - if empty(s:client) | return | endif - let s:client['running'] = 1 - let s:client['chan_id'] = chan_id - call dictwatcherdel(g:, 'coc_node_channel_id', function('s:ChannelSet')) +function! coc#rpc#set_channel(chan_id) abort + let g:coc_node_channel_id = a:chan_id + if a:chan_id != 0 + let s:client['running'] = 1 + let s:client['chan_id'] = a:chan_id + endif endfunction function! coc#rpc#kill() @@ -76,11 +77,9 @@ function! coc#rpc#restart() if empty(s:client) call coc#rpc#start_server() else - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - execute i.'wincmd c' - endif - endfor + call coc#highlight#clear_all() + call coc#ui#sign_unplace() + call coc#float#close_all() call coc#rpc#request('detach', []) sleep 100m let s:client['command'] = coc#util#job_command() @@ -121,11 +120,11 @@ endfunction " send async response to server function! coc#rpc#async_request(id, method, args) - let l:Cb = {err, res -> coc#rpc#notify('nvim_async_response_event', [a:id, err, res])} + let l:Cb = {err, ... -> coc#rpc#notify('nvim_async_response_event', [a:id, err, get(a:000, 0, v:null)])} let args = a:args + [l:Cb] try call call(a:method, args) catch /.*/ - call coc#rpc#notify('nvim_async_response_event', [a:id, v:exception]) + call coc#rpc#notify('nvim_async_response_event', [a:id, v:exception, v:null]) endtry endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/snippet.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/snippet.vim index acb75dc..b8ecd8f 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/snippet.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/snippet.vim @@ -1,5 +1,8 @@ +scriptencoding utf-8 let s:is_vim = !has('nvim') let s:map_next = 1 +let s:map_prev = 1 +let s:cmd_mapping = has('nvim') || has('patch-8.2.1978') function! coc#snippet#_select_mappings() if !get(g:, 'coc_selectmode_mapping', 1) @@ -24,29 +27,68 @@ function! coc#snippet#_select_mappings() snoremap "_c endfunction -function! coc#snippet#show_choices(lnum, col, len, values) abort +function! coc#snippet#cursor(lnum, col) abort let m = mode() - call cursor(a:lnum, a:col + a:len) - if m !=# 'i' | startinsert | endif - call timer_start(20, { -> coc#_do_complete(a:col - 1, a:values, 0)}) + call cursor(a:lnum, a:col) + if m !=# 'i' + call feedkeys("\i", 'in') + endif +endfunction + +function! coc#snippet#show_choices(lnum, col, len, values) abort + call coc#snippet#cursor(a:lnum, a:col + a:len) + let changedtick = b:changedtick + call timer_start(20, { -> coc#_do_complete(a:col - 1, a:values, 0, changedtick)}) redraw endfunction -function! coc#snippet#enable() +function! coc#snippet#enable(...) + if get(b:, 'coc_snippet_active', 0) == 1 + return + endif + let complete = get(a:, 1, 0) let b:coc_snippet_active = 1 call coc#snippet#_select_mappings() let nextkey = get(g:, 'coc_snippet_next', '') let prevkey = get(g:, 'coc_snippet_prev', '') - nnoremap :call coc#rpc#request('snippetCancel', []) - if maparg(nextkey, 'i') =~# 'expand-jump' + if maparg(nextkey, 'i') =~# 'snippet' let s:map_next = 0 endif - if s:map_next - execute 'inoremap '.nextkey." =coc#rpc#request('snippetNext', [])" + if maparg(prevkey, 'i') =~# 'snippet' + let s:map_prev = 0 endif - execute 'inoremap '.prevkey." =coc#rpc#request('snippetPrev', [])" - execute 'snoremap '.prevkey." :call coc#rpc#request('snippetPrev', [])" - execute 'snoremap '.nextkey." :call coc#rpc#request('snippetNext', [])" + if !empty(nextkey) + if s:map_next + execute 'inoremap '.nextkey." =coc#snippet#jump(1, ".complete.")" + endif + execute 'snoremap '.nextkey." :call coc#snippet#jump(1, ".complete.")" + endif + if !empty(prevkey) + if s:map_prev + execute 'inoremap '.prevkey." =coc#snippet#jump(0, ".complete.")" + endif + execute 'snoremap '.prevkey." :call coc#snippet#jump(0, ".complete.")" + endif +endfunction + +function! coc#snippet#prev() abort + call coc#rpc#request('snippetPrev', []) + return '' +endfunction + +function! coc#snippet#next() abort + call coc#rpc#request('snippetNext', []) + return '' +endfunction + +function! coc#snippet#jump(direction, complete) abort + if a:direction == 1 && a:complete && pumvisible() + let pre = exists('*complete_info') && complete_info()['selected'] == -1 ? "\" : '' + call feedkeys(pre."\", 'in') + return '' + endif + call coc#rpc#request(a:direction == 1 ? 'snippetNext' : 'snippetPrev', []) + return '' endfunction function! coc#snippet#disable() @@ -56,11 +98,62 @@ function! coc#snippet#disable() let b:coc_snippet_active = 0 let nextkey = get(g:, 'coc_snippet_next', '') let prevkey = get(g:, 'coc_snippet_prev', '') - silent! nunmap if s:map_next silent! execute 'iunmap '.nextkey endif - silent! execute 'iunmap '.prevkey + if s:map_prev + silent! execute 'iunmap '.prevkey + endif silent! execute 'sunmap '.prevkey silent! execute 'sunmap '.nextkey endfunction + +function! coc#snippet#select(start, end, text) abort + if coc#pum#visible() + call coc#pum#close() + endif + if mode() == 's' + call feedkeys("\", 'in') + endif + if &selection ==# 'exclusive' + let cursor = coc#snippet#to_cursor(a:start) + call cursor([cursor[0], cursor[1]]) + let cmd = '' + let cmd .= mode()[0] ==# 'i' ? "\".(col('.') == 1 ? '' : 'l') : '' + let cmd .= printf('v%s', strchars(a:text) . 'l') + let cmd .= "\" + else + let cursor = coc#snippet#to_cursor(a:end) + call cursor([cursor[0], cursor[1] - 1]) + let len = strchars(a:text) - 1 + let cmd = '' + let cmd .= mode()[0] ==# 'i' ? "\l" : '' + let cmd .= printf('v%s', len > 0 ? len . 'h' : '') + let cmd .= "o\" + endif + call feedkeys(cmd, 'n') +endfunction + +function! coc#snippet#move(position) abort + let m = mode() + if m == 's' + call feedkeys("\", 'in') + elseif coc#pum#visible() + call coc#pum#close() + endif + let pos = coc#snippet#to_cursor(a:position) + call cursor(pos) + if pos[1] > strlen(getline(pos[0])) + startinsert! + else + startinsert + endif +endfunction + +function! coc#snippet#to_cursor(position) abort + let line = getline(a:position.line + 1) + if line is v:null + return [a:position.line + 1, a:position.character + 1] + endif + return [a:position.line + 1, byteidx(line, a:position.character) + 1] +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/string.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/string.vim new file mode 100644 index 0000000..aac2792 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/string.vim @@ -0,0 +1,156 @@ +scriptencoding utf-8 + +function! coc#string#get_character(line, col) abort + return strchars(strpart(a:line, 0, a:col - 1)) +endfunction + +function! coc#string#last_character(line) abort + return strcharpart(a:line, strchars(a:line) - 1, 1) +endfunction + +function! coc#string#reflow(lines, width) abort + let lines = [] + let currlen = 0 + let parts = [] + for line in a:lines + for part in split(line, '\s\+') + let w = strwidth(part) + if currlen + w + 1 >= a:width + if len(parts) > 0 + call add(lines, join(parts, ' ')) + endif + if w >= a:width + call add(lines, part) + let currlen = 0 + let parts = [] + else + let currlen = w + let parts = [part] + endif + continue + endif + call add(parts, part) + let currlen = currlen + w + 1 + endfor + endfor + if len(parts) > 0 + call add(lines, join(parts, ' ')) + endif + return empty(lines) ? [''] : lines +endfunction + +" Used when 'wrap' and 'linebreak' is enabled +function! coc#string#content_height(lines, width) abort + let len = 0 + let pattern = empty(&breakat) ? '.\zs' : '['.substitute(&breakat, '\([\[\]]\)', '\\\1', 'g').']\zs' + for line in a:lines + if strwidth(line) <= a:width + let len += 1 + else + let currlen = 0 + for part in split(line, pattern) + let wl = strwidth(part) + if currlen == 0 && wl > 0 + let len += 1 + endif + let delta = currlen + wl - a:width + if delta >= 0 + let len = len + (delta > 0) + let currlen = delta == 0 ? 0 : wl + if wl >= a:width + let currlen = wl%a:width + let len += float2nr(ceil(wl/(a:width + 0.0))) - (currlen == 0) + endif + else + let currlen = currlen + wl + endif + endfor + endif + endfor + return len +endfunction + +" get change between two lines +function! coc#string#diff(curr, previous, col) abort + let end = strpart(a:curr, a:col - 1) + let start = strpart(a:curr, 0, a:col -1) + let endOffset = 0 + let startOffset = 0 + let currLen = strchars(a:curr) + let prevLen = strchars(a:previous) + if len(end) + let endLen = strchars(end) + for i in range(min([prevLen, endLen])) + if strcharpart(end, endLen - 1 - i, 1) ==# strcharpart(a:previous, prevLen -1 -i, 1) + let endOffset = endOffset + 1 + else + break + endif + endfor + endif + let remain = endOffset == 0 ? a:previous : strcharpart(a:previous, 0, prevLen - endOffset) + if len(remain) + for i in range(min([strchars(remain), strchars(start)])) + if strcharpart(remain, i, 1) ==# strcharpart(start, i ,1) + let startOffset = startOffset + 1 + else + break + endif + endfor + endif + return { + \ 'start': startOffset, + \ 'end': prevLen - endOffset, + \ 'text': strcharpart(a:curr, startOffset, currLen - startOffset - endOffset) + \ } +endfunction + +function! coc#string#apply(content, diff) abort + let totalLen = strchars(a:content) + let endLen = totalLen - a:diff['end'] + return strcharpart(a:content, 0, a:diff['start']).a:diff['text'].strcharpart(a:content, a:diff['end'], endLen) +endfunction + +" insert inserted to line at position, use ... when result is too long +" line should only contains character has strwidth equals 1 +function! coc#string#compose(line, position, inserted) abort + let width = strwidth(a:line) + let text = a:inserted + let res = a:line + let need_truncate = a:position + strwidth(text) + 1 > width + if need_truncate + let remain = width - a:position - 3 + if remain < 2 + " use text for full line, use first & end of a:line, ignore position + let res = strcharpart(a:line, 0, 1) + let w = strwidth(res) + for i in range(strchars(text)) + let c = strcharpart(text, i, 1) + let a = strwidth(c) + if w + a <= width - 1 + let w = w + a + let res = res . c + endif + endfor + let res = res.strcharpart(a:line, w) + else + let res = strcharpart(a:line, 0, a:position) + let w = strwidth(res) + for i in range(strchars(text)) + let c = strcharpart(text, i, 1) + let a = strwidth(c) + if w + a <= width - 3 + let w = w + a + let res = res . c + endif + endfor + let res = res.'..' + let w = w + 2 + let res = res . strcharpart(a:line, w) + endif + else + let first = strcharpart(a:line, 0, a:position) + let res = first . text . strcharpart(a:line, a:position + strwidth(text)) + endif + return res +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/task.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/task.vim index 2ef00a1..80ff02f 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/task.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/task.vim @@ -1,13 +1,17 @@ " ============================================================================ " Description: Manage long running tasks. " Author: Qiming Zhao -" Licence: MIT licence +" Licence: Anti 966 licence " Version: 0.1 -" Last Modified: April 08, 2019 +" Last Modified: Dec 12, 2020 " ============================================================================ +scriptencoding utf-8 let s:is_vim = !has('nvim') let s:running_task = {} +" neovim emit strings that part of lines. +let s:out_remain_text = {} +let s:err_remain_text = {} function! coc#task#start(id, opts) if coc#task#running(a:id) @@ -15,6 +19,7 @@ function! coc#task#start(id, opts) endif let cmd = [a:opts['cmd']] + get(a:opts, 'args', []) let cwd = get(a:opts, 'cwd', getcwd()) + let env = get(a:opts, 'env', {}) " cmd args cwd pty if s:is_vim let options = { @@ -24,6 +29,7 @@ function! coc#task#start(id, opts) \ 'err_cb': {channel, message -> s:on_stderr(a:id, [message])}, \ 'out_cb': {channel, message -> s:on_stdout(a:id, [message])}, \ 'exit_cb': {channel, code -> s:on_exit(a:id, code)}, + \ 'env': env, \} if has("patch-8.1.350") let options['noblock'] = 1 @@ -41,15 +47,31 @@ function! coc#task#start(id, opts) else let options = { \ 'cwd': cwd, - \ 'on_stderr': {channel, msgs -> s:on_stderr(a:id, filter(msgs, 'v:val !=""'))}, - \ 'on_stdout': {channel, msgs -> s:on_stdout(a:id, filter(msgs, 'v:val !=""'))}, + \ 'on_stderr': {channel, msgs -> s:on_stderr(a:id, msgs)}, + \ 'on_stdout': {channel, msgs -> s:on_stdout(a:id, msgs)}, \ 'on_exit': {channel, code -> s:on_exit(a:id, code)}, \ 'detach': get(a:opts, 'detach', 0), \} + let original = {} + if !empty(env) + if has('nvim-0.5.0') + let options['env'] = env + elseif exists('*setenv') && exists('*getenv') + for key in keys(env) + let original[key] = getenv(key) + call setenv(key, env[key]) + endfor + endif + endif if get(a:opts, 'pty', 0) let options['pty'] = 1 endif let chan_id = jobstart(cmd, options) + if !empty(original) + for key in keys(original) + call setenv(key, original[key]) + endfor + endif if chan_id <= 0 echohl Error | echom 'Failed to start '.a:id.' task' | echohl None return v:false @@ -76,6 +98,10 @@ endfunction function! s:on_exit(id, code) abort if get(g:, 'coc_vim_leaving', 0) | return | endif + if has('nvim') + let s:out_remain_text[a:id] = '' + let s:err_remain_text[a:id] = '' + endif if has_key(s:running_task, a:id) call remove(s:running_task, a:id) endif @@ -84,14 +110,58 @@ endfunction function! s:on_stderr(id, msgs) if get(g:, 'coc_vim_leaving', 0) | return | endif - if len(a:msgs) + if empty(a:msgs) + return + endif + if s:is_vim call coc#rpc#notify('TaskStderr', [a:id, a:msgs]) + else + let remain = get(s:err_remain_text, a:id, '') + let eof = (a:msgs == ['']) + let msgs = copy(a:msgs) + if len(remain) > 0 + if msgs[0] == '' + let msgs[0] = remain + else + let msgs[0] = remain . msgs[0] + endif + endif + let last = msgs[len(msgs) - 1] + let s:err_remain_text[a:id] = len(last) > 0 ? last : '' + " all lines from 0 to n - 2 + if len(msgs) > 1 + call coc#rpc#notify('TaskStderr', [a:id, msgs[:len(msgs)-2]]) + elseif eof && len(msgs[0]) > 0 + call coc#rpc#notify('TaskStderr', [a:id, msgs]) + endif endif endfunction function! s:on_stdout(id, msgs) - if len(a:msgs) + if empty(a:msgs) + return + endif + if s:is_vim call coc#rpc#notify('TaskStdout', [a:id, a:msgs]) + else + let remain = get(s:out_remain_text, a:id, '') + let eof = (a:msgs == ['']) + let msgs = copy(a:msgs) + if len(remain) > 0 + if msgs[0] == '' + let msgs[0] = remain + else + let msgs[0] = remain . msgs[0] + endif + endif + let last = msgs[len(msgs) - 1] + let s:out_remain_text[a:id] = len(last) > 0 ? last : '' + " all lines from 0 to n - 2 + if len(msgs) > 1 + call coc#rpc#notify('TaskStdout', [a:id, msgs[:len(msgs)-2]]) + elseif eof && len(msgs[0]) > 0 + call coc#rpc#notify('TaskStdout', [a:id, msgs]) + endif endif endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/terminal.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/terminal.vim index 5713565..b0dbe6d 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/terminal.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/terminal.vim @@ -1,40 +1,57 @@ +scriptencoding utf-8 let s:is_vim = !has('nvim') let s:channel_map = {} let s:is_win = has('win32') || has('win64') " start terminal, return [bufnr, pid] -function! coc#terminal#start(cmd, cwd, env) abort +function! coc#terminal#start(cmd, cwd, env, strict) abort if s:is_vim && !has('terminal') throw 'terminal feature not supported by current vim.' endif let cwd = empty(a:cwd) ? getcwd() : a:cwd - execute 'belowright 8new +setl\ buftype=nofile' + execute 'belowright '.get(g:, 'coc_terminal_height', 8).'new +setl\ buftype=nofile' setl winfixheight setl norelativenumber setl nonumber setl bufhidden=hide if exists('#User#CocTerminalOpen') - exe 'doautocmd User CocTerminalOpen' + exe 'doautocmd User CocTerminalOpen' endif let bufnr = bufnr('%') + let env = {} + let original = {} + if !empty(a:env) + " use env option when possible + if s:is_vim + let env = copy(a:env) + elseif exists('*setenv') + for key in keys(a:env) + let original[key] = getenv(key) + call setenv(key, a:env[key]) + endfor + endif + endif function! s:OnExit(status) closure + call coc#rpc#notify('CocAutocmd', ['TermExit', bufnr, a:status]) if a:status == 0 execute 'silent! bd! '.bufnr endif endfunction if has('nvim') - if !empty(a:env) - for key in keys(a:env) - execute 'let $'.key." = '".a:env[key]."'" - endfor - endif let job_id = termopen(a:cmd, { \ 'cwd': cwd, - \ 'pty': 1, + \ 'pty': v:true, \ 'on_exit': {job, status -> s:OnExit(status)}, + \ 'env': env, + \ 'clear_env': a:strict ? v:true : v:false \ }) + if !empty(original) && exists('*setenv') + for key in keys(original) + call setenv(key, original[key]) + endfor + endif if job_id == 0 throw 'create terminal job failed' endif @@ -49,7 +66,7 @@ function! coc#terminal#start(cmd, cwd, env) abort \ 'term_finish': 'close', \ 'exit_cb': {job, status -> s:OnExit(status)}, \ 'curwin': 1, - \ 'env': a:env, + \ 'env': env, \}) if res == 0 throw 'create terminal job failed' @@ -67,14 +84,16 @@ function! coc#terminal#send(bufnr, text, add_new_line) abort if has('nvim') let lines = split(a:text, '\v\r?\n') if a:add_new_line && !empty(lines[len(lines) - 1]) - call add(lines, '') + if s:is_win + call add(lines, "\r\n") + else + call add(lines, '') + endif endif call chansend(chan, lines) - let winnr = bufwinnr(a:bufnr) - if winnr != -1 - exe 'noa '.winnr.'wincmd w' - exe 'noa normal! G' - exe 'noa '.wincmd p + let winid = bufwinid(a:bufnr) + if winid != -1 + call coc#compat#execute(winid, 'noa normal! G') endif else if !a:add_new_line diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/ui.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/ui.vim new file mode 100644 index 0000000..2708fae --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/ui.vim @@ -0,0 +1,471 @@ +let s:is_vim = !has('nvim') +let s:is_win = has('win32') || has('win64') +let s:is_mac = has('mac') +let s:sign_api = exists('*sign_getplaced') && exists('*sign_place') +let s:sign_groups = [] +let s:outline_preview_bufnr = 0 + +" Check and +function! coc#ui#check_pum_keymappings() abort + for key in ['', '', '', ''] + let arg = maparg(key, 'i', 0, 1) + if get(arg, 'expr', 0) + let rhs = get(arg, 'rhs', '') + if rhs =~# '\"', 'coc#pum#next(1)', '') + let rhs = substitute(rhs, '\c"\\"', 'coc#pum#prev(1)', '') + let rhs = substitute(rhs, '\c"\\"', 'coc#pum#confirm()', '') + execute 'inoremap '.arg['lhs'].' '.rhs + endif + endif + endfor +endfunction + +function! coc#ui#quickpick(title, items, cb) abort + if exists('*popup_menu') + function! s:QuickpickHandler(id, result) closure + call a:cb(v:null, a:result) + endfunction + function! s:QuickpickFilter(id, key) closure + for i in range(1, len(a:items)) + if a:key == string(i) + call popup_close(a:id, i) + return 1 + endif + endfor + " No shortcut, pass to generic filter + return popup_filter_menu(a:id, a:key) + endfunction + try + call popup_menu(a:items, { + \ 'title': a:title, + \ 'filter': function('s:QuickpickFilter'), + \ 'callback': function('s:QuickpickHandler'), + \ }) + redraw + catch /.*/ + call a:cb(v:exception) + endtry + else + let res = inputlist([a:title] + a:items) + call a:cb(v:null, res) + endif +endfunction + +" cmd, cwd +function! coc#ui#open_terminal(opts) abort + if s:is_vim && !exists('*term_start') + echohl WarningMsg | echon "Your vim doesn't have terminal support!" | echohl None + return + endif + if get(a:opts, 'position', 'bottom') ==# 'bottom' + let p = '5new' + else + let p = 'vnew' + endif + execute 'belowright '.p.' +setl\ buftype=nofile ' + setl buftype=nofile + setl winfixheight + setl norelativenumber + setl nonumber + setl bufhidden=wipe + if exists('#User#CocTerminalOpen') + exe 'doautocmd User CocTerminalOpen' + endif + let cmd = get(a:opts, 'cmd', '') + let autoclose = get(a:opts, 'autoclose', 1) + if empty(cmd) + throw 'command required!' + endif + let cwd = get(a:opts, 'cwd', getcwd()) + let keepfocus = get(a:opts, 'keepfocus', 0) + let bufnr = bufnr('%') + let Callback = get(a:opts, 'Callback', v:null) + + function! s:OnExit(status) closure + let content = join(getbufline(bufnr, 1, '$'), "\n") + if a:status == 0 && autoclose == 1 + execute 'silent! bd! '.bufnr + endif + if !empty(Callback) + call call(Callback, [a:status, bufnr, content]) + endif + endfunction + + if has('nvim') + call termopen(cmd, { + \ 'cwd': cwd, + \ 'on_exit': {job, status -> s:OnExit(status)}, + \}) + else + if s:is_win + let cmd = 'cmd.exe /C "'.cmd.'"' + endif + call term_start(cmd, { + \ 'cwd': cwd, + \ 'exit_cb': {job, status -> s:OnExit(status)}, + \ 'curwin': 1, + \}) + endif + if keepfocus + wincmd p + endif + return bufnr +endfunction + +" run command in terminal +function! coc#ui#run_terminal(opts, cb) + let cmd = get(a:opts, 'cmd', '') + if empty(cmd) + return a:cb('command required for terminal') + endif + let opts = { + \ 'cmd': cmd, + \ 'cwd': get(a:opts, 'cwd', getcwd()), + \ 'keepfocus': get(a:opts, 'keepfocus', 0), + \ 'Callback': {status, bufnr, content -> a:cb(v:null, {'success': status == 0 ? v:true : v:false, 'bufnr': bufnr, 'content': content})} + \} + call coc#ui#open_terminal(opts) +endfunction + +function! coc#ui#echo_hover(msg) + echohl MoreMsg + echo a:msg + echohl None + let g:coc_last_hover_message = a:msg +endfunction + +function! coc#ui#echo_messages(hl, msgs) + if a:hl !~# 'Error' && (mode() !~# '\v^(i|n)$') + return + endif + let msgs = filter(copy(a:msgs), '!empty(v:val)') + if empty(msgs) + return + endif + execute 'echohl '.a:hl + echom a:msgs[0] + redraw + echo join(msgs, "\n") + echohl None +endfunction + +function! coc#ui#preview_info(lines, filetype, ...) abort + pclose + keepalt new +setlocal\ previewwindow|setlocal\ buftype=nofile|setlocal\ noswapfile|setlocal\ wrap [Document] + setl bufhidden=wipe + setl nobuflisted + setl nospell + exe 'setl filetype='.a:filetype + setl conceallevel=0 + setl nofoldenable + for command in a:000 + execute command + endfor + call append(0, a:lines) + exe "normal! z" . len(a:lines) . "\" + exe "normal! gg" + wincmd p +endfunction + +function! coc#ui#open_files(files) + let bufnrs = [] + " added on latest vim8 + if exists('*bufadd') && exists('*bufload') + for file in a:files + let file = fnamemodify(file, ':.') + if bufloaded(file) + call add(bufnrs, bufnr(file)) + else + let bufnr = bufadd(file) + call bufload(file) + call add(bufnrs, bufnr) + call setbufvar(bufnr, '&buflisted', 1) + endif + endfor + else + noa keepalt 1new +setl\ bufhidden=wipe + for file in a:files + let file = fnamemodify(file, ':.') + execute 'noa edit +setl\ bufhidden=hide '.fnameescape(file) + if &filetype ==# '' + filetype detect + endif + call add(bufnrs, bufnr('%')) + endfor + noa close + endif + doautocmd BufEnter + return bufnrs +endfunction + +function! coc#ui#echo_lines(lines) + echo join(a:lines, "\n") +endfunction + +function! coc#ui#echo_signatures(signatures) abort + if pumvisible() | return | endif + echo "" + for i in range(len(a:signatures)) + call s:echo_signature(a:signatures[i]) + if i != len(a:signatures) - 1 + echon "\n" + endif + endfor +endfunction + +function! s:echo_signature(parts) + for part in a:parts + let hl = get(part, 'type', 'Normal') + let text = get(part, 'text', '') + if !empty(text) + execute 'echohl '.hl + execute "echon '".substitute(text, "'", "''", 'g')."'" + echohl None + endif + endfor +endfunction + +function! coc#ui#iterm_open(dir) + return s:osascript( + \ 'if application "iTerm2" is not running', + \ 'error', + \ 'end if') && s:osascript( + \ 'tell application "iTerm2"', + \ 'tell current window', + \ 'create tab with default profile', + \ 'tell current session', + \ 'write text "cd ' . a:dir . '"', + \ 'write text "clear"', + \ 'activate', + \ 'end tell', + \ 'end tell', + \ 'end tell') +endfunction + +function! s:osascript(...) abort + let args = join(map(copy(a:000), '" -e ".shellescape(v:val)'), '') + call s:system('osascript'. args) + return !v:shell_error +endfunction + +function! s:system(cmd) + let output = system(a:cmd) + if v:shell_error && output !=# "" + echohl Error | echom output | echohl None + return + endif + return output +endfunction + +function! coc#ui#set_lines(bufnr, changedtick, original, replacement, start, end, changes, cursor, col) abort + if !bufloaded(a:bufnr) + return + endif + let delta = 0 + if !empty(a:col) + let delta = col('.') - a:col + endif + if getbufvar(a:bufnr, 'changedtick') > a:changedtick && bufnr('%') == a:bufnr + " try apply current line change + let lnum = line('.') + " change for current line + if a:end - a:start == 1 && a:end == lnum && len(a:replacement) == 1 + let idx = a:start - lnum + 1 + let previous = get(a:original, idx, 0) + if type(previous) == 1 + let content = getline('.') + if previous !=# content + let diff = coc#string#diff(content, previous, col('.')) + let changed = get(a:replacement, idx, 0) + if type(changed) == 1 && strcharpart(previous, 0, diff['end']) ==# strcharpart(changed, 0, diff['end']) + let applied = coc#string#apply(changed, diff) + let replacement = copy(a:replacement) + let replacement[idx] = applied + call coc#compat#buf_set_lines(a:bufnr, a:start, a:end, replacement) + return + endif + endif + endif + endif + endif + if exists('*nvim_buf_set_text') && !empty(a:changes) + for item in reverse(copy(a:changes)) + call nvim_buf_set_text(a:bufnr, item[1], item[2], item[3], item[4], item[0]) + endfor + else + call coc#compat#buf_set_lines(a:bufnr, a:start, a:end, a:replacement) + endif + if !empty(a:cursor) + call cursor(a:cursor[0], a:cursor[1] + delta) + endif +endfunction + +function! coc#ui#change_lines(bufnr, list) abort + if !bufloaded(a:bufnr) | return v:null | endif + undojoin + if exists('*setbufline') + for [lnum, line] in a:list + call setbufline(a:bufnr, lnum + 1, line) + endfor + elseif a:bufnr == bufnr('%') + for [lnum, line] in a:list + call setline(lnum + 1, line) + endfor + else + let bufnr = bufnr('%') + exe 'noa buffer '.a:bufnr + for [lnum, line] in a:list + call setline(lnum + 1, line) + endfor + exe 'noa buffer '.bufnr + endif +endfunction + +function! coc#ui#open_url(url) + if has('mac') && executable('open') + call system('open '.a:url) + return + endif + if executable('xdg-open') + call system('xdg-open '.a:url) + return + endif + call system('cmd /c start "" /b '. substitute(a:url, '&', '^&', 'g')) + if v:shell_error + echohl Error | echom 'Failed to open '.a:url | echohl None + return + endif +endfunction + +function! coc#ui#rename_file(oldPath, newPath, write) abort + let bufnr = bufnr(a:oldPath) + if bufnr == -1 + throw 'Unable to get bufnr of '.a:oldPath + endif + if a:oldPath =~? a:newPath && (s:is_mac || s:is_win) + return coc#ui#safe_rename(bufnr, a:oldPath, a:newPath, a:write) + endif + if bufloaded(a:newPath) + execute 'silent bdelete! '.bufnr(a:newPath) + endif + let current = bufnr == bufnr('%') + let bufname = fnamemodify(a:newPath, ":~:.") + let filepath = fnamemodify(bufname(bufnr), '%:p') + let winid = coc#compat#buf_win_id(bufnr) + let curr = -1 + if winid == -1 + let curr = win_getid() + let file = fnamemodify(bufname(bufnr), ':.') + execute 'keepalt tab drop '.fnameescape(bufname(bufnr)) + let winid = win_getid() + endif + call coc#compat#execute(winid, 'keepalt file '.fnameescape(bufname), 'silent') + call coc#compat#execute(winid, 'doautocmd BufEnter') + if a:write + call coc#compat#execute(winid, 'noa write!', 'silent') + call delete(filepath, '') + endif + if curr != -1 + call win_gotoid(curr) + endif + return bufnr +endfunction + +" System is case in sensitive and newPath have different case. +function! coc#ui#safe_rename(bufnr, oldPath, newPath, write) abort + let winid = win_getid() + let lines = getbufline(a:bufnr, 1, '$') + execute 'keepalt tab drop '.fnameescape(fnamemodify(a:oldPath, ':.')) + let view = winsaveview() + execute 'keepalt bwipeout! '.a:bufnr + if a:write + call delete(a:oldPath, '') + endif + execute 'keepalt edit '.fnameescape(fnamemodify(a:newPath, ':~:.')) + let bufnr = bufnr('%') + call coc#compat#buf_set_lines(bufnr, 0, -1, lines) + if a:write + execute 'noa write' + endif + call winrestview(view) + call win_gotoid(winid) + return bufnr +endfunction + +function! coc#ui#sign_unplace() abort + if exists('*sign_unplace') + for group in s:sign_groups + call sign_unplace(group) + endfor + endif +endfunction + +function! coc#ui#update_signs(bufnr, group, signs) abort + if !s:sign_api || !bufloaded(a:bufnr) + return + endif + call sign_unplace(a:group, {'buffer': a:bufnr}) + for def in a:signs + let opts = {'lnum': def['lnum']} + if has_key(def, 'priority') + let opts['priority'] = def['priority'] + endif + call sign_place(0, a:group, def['name'], a:bufnr, opts) + endfor +endfunction + +function! coc#ui#outline_preview(config) abort + let view_id = get(w:, 'cocViewId', '') + if view_id !=# 'OUTLINE' + return + endif + let wininfo = get(getwininfo(win_getid()), 0, v:null) + if empty(wininfo) + return + endif + let border = get(a:config, 'border', v:true) + let th = &lines - &cmdheight - 2 + let range = a:config['range'] + let height = min([range['end']['line'] - range['start']['line'] + 1, th - 4]) + let to_left = &columns - wininfo['wincol'] - wininfo['width'] < wininfo['wincol'] + let start_lnum = range['start']['line'] + 1 + let end_lnum = range['end']['line'] + 1 - start_lnum > &lines ? start_lnum + &lines : range['end']['line'] + 1 + let lines = getbufline(a:config['bufnr'], start_lnum, end_lnum) + let content_width = max(map(copy(lines), 'strdisplaywidth(v:val)')) + let width = min([content_width, a:config['maxWidth'], to_left ? wininfo['wincol'] - 3 : &columns - wininfo['wincol'] - wininfo['width']]) + let filetype = getbufvar(a:config['bufnr'], '&filetype') + let cursor_row = coc#cursor#screen_pos()[0] + let config = { + \ 'relative': 'editor', + \ 'row': cursor_row - 1 + height < th ? cursor_row - (border ? 1 : 0) : th - height - (border ? 1 : -1), + \ 'col': to_left ? wininfo['wincol'] - 4 - width : wininfo['wincol'] + wininfo['width'], + \ 'width': width, + \ 'height': height, + \ 'lines': lines, + \ 'border': border ? [1,1,1,1] : v:null, + \ 'rounded': get(a:config, 'rounded', 1) ? 1 : 0, + \ 'winblend': a:config['winblend'], + \ 'highlight': a:config['highlight'], + \ 'borderhighlight': a:config['borderhighlight'], + \ } + let winid = coc#float#get_float_by_kind('outline-preview') + let result = coc#float#create_float_win(winid, s:outline_preview_bufnr, config) + if empty(result) + return v:null + endif + call setwinvar(result[0], 'kind', 'outline-preview') + let s:outline_preview_bufnr = result[1] + if !empty(filetype) + call coc#compat#execute(result[0], 'setfiletype '.filetype) + endif + return result[1] +endfunction + +function! coc#ui#outline_close_preview() abort + let winid = coc#float#get_float_by_kind('outline-preview') + if winid + call coc#float#close(winid) + endif +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/util.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/util.vim index 15de1c6..1687013 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/coc/util.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/util.vim @@ -1,146 +1,103 @@ +scriptencoding utf-8 let s:root = expand(':h:h:h') let s:is_win = has('win32') || has('win64') let s:is_vim = !has('nvim') +let s:vim_api_version = 32 -let s:activate = "" -let s:quit = "" -if has("gui_macvim") && has('gui_running') - let s:app = "MacVim" -elseif $TERM_PROGRAM ==# "Apple_Terminal" - let s:app = "Terminal" -elseif $TERM_PROGRAM ==# "iTerm.app" - let s:app = "iTerm2" -elseif has('mac') - let s:app = "System Events" - let s:quit = "quit" - let s:activate = 'activate' -endif - -function! coc#util#has_preview() - for i in range(1, winnr('$')) - if getwinvar(i, '&previewwindow') - return i +function! coc#util#remote_fns(name) + let fns = ['init', 'complete', 'should_complete', 'refresh', 'get_startcol', 'on_complete', 'on_enter'] + let res = [] + for fn in fns + if exists('*coc#source#'.a:name.'#'.fn) + call add(res, fn) endif endfor - return 0 + return res endfunction -function! coc#util#has_float() - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - return 1 +function! coc#util#merge_winhl(curr, hls) abort + let highlightMap = {} + for parts in map(split(a:curr, ','), 'split(v:val, ":")') + if len(parts) == 2 + let highlightMap[parts[0]] = parts[1] endif endfor - return 0 -endfunction - -function! coc#util#get_float() - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - return win_getid(i) - endif + for item in a:hls + let highlightMap[item[0]] = item[1] endfor - return 0 + return join(map(items(highlightMap), 'v:val[0].":".v:val[1]'), ',') endfunction -function! coc#util#float_hide() - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - let winid = win_getid(i) - call coc#util#close_win(winid) - endif - endfor +function! coc#util#do_complete(name, opt, cb) abort + let handler = 'coc#source#'.a:name.'#complete' + let l:Cb = {res -> a:cb(v:null, res)} + let args = [a:opt, l:Cb] + call call(handler, args) endfunction -function! coc#util#float_jump() - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - exe i.'wincmd w' - return - endif - endfor +function! coc#util#suggest_variables(bufnr) abort + return { + \ 'disable': getbufvar(a:bufnr, 'coc_suggest_disable', 0), + \ 'disabled_sources': getbufvar(a:bufnr, 'coc_disabled_sources', []), + \ 'blacklist': getbufvar(a:bufnr, 'coc_suggest_blacklist', []), + \ } endfunction -function! coc#util#float_scrollable() - let winnr = winnr() - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - let wid = win_getid(i) - let h = nvim_win_get_height(wid) - let buf = nvim_win_get_buf(wid) - let lineCount = nvim_buf_line_count(buf) - return lineCount > h - endif - endfor - return 0 +function! coc#util#api_version() abort + return s:vim_api_version endfunction -function! coc#util#float_scroll(forward) - let key = a:forward ? "\" : "\" - let winnr = winnr() - for i in range(1, winnr('$')) - if getwinvar(i, 'float') - return i."\w".key."\p" - endif - endfor - return "" +function! coc#util#semantic_hlgroups() abort + let res = split(execute('hi'), "\n") + let filtered = filter(res, "v:val =~# '^CocSem'") + return map(filtered, "matchstr(v:val,'\\v^CocSem\\w+')") endfunction " get cursor position function! coc#util#cursor() - let pos = getcurpos() - let content = pos[2] == 1 ? '' : getline('.')[0: pos[2] - 2] - return [pos[1] - 1, strchars(content)] + return [line('.') - 1, strchars(strpart(getline('.'), 0, col('.') - 1))] endfunction -function! coc#util#close_win(id) - if !has('nvim') && exists('*popup_close') - call popup_close(a:id) - return - endif - if exists('*nvim_win_close') - if nvim_win_is_valid(a:id) - call nvim_win_close(a:id, 1) - endif - else - let winnr = win_id2win(a:id) - if winnr > 0 - execute winnr.'close!' - endif - endif +function! coc#util#change_info() abort + return {'lnum': line('.'), 'col': col('.'), 'line': getline('.'), 'changedtick': b:changedtick} endfunction -function! coc#util#close(id) abort - if exists('*nvim_win_close') - if nvim_win_is_valid(a:id) - call nvim_win_close(a:id, 1) - endif - else - let winnr = win_id2win(a:id) - if winnr > 0 - execute winnr.'close!' - endif - endif +function! coc#util#jumpTo(line, character) abort + echohl WarningMsg | echon 'coc#util#jumpTo is deprecated, use coc#cursor#move_to instead.' | echohl None + call coc#cursor#move_to(a:line, a:character) endfunction -function! coc#util#win_position() - let nr = winnr() - let [row, col] = win_screenpos(nr) - return [row + winline() - 2, col + wincol() - 2] +function! coc#util#root_patterns() abort + return coc#rpc#request('rootPatterns', [bufnr('%')]) endfunction -function! coc#util#close_popup() - if s:is_vim - if exists('*popup_close') - call popup_close(get(g:, 'coc_popup_id', 0)) - endif - else - for winnr in range(1, winnr('$')) - if getwinvar(winnr, 'popup', 0) - exe winnr.'close!' - endif - endfor +function! coc#util#get_config(key) abort + return coc#rpc#request('getConfig', [a:key]) +endfunction + +function! coc#util#open_terminal(opts) abort + return coc#ui#open_terminal(a:opts) +endfunction + +function! coc#util#synname() abort + return synIDattr(synID(line('.'), col('.') - 1, 1), 'name') +endfunction + +function! coc#util#setline(lnum, line) + keepjumps call setline(a:lnum, a:line) +endfunction + +function! coc#util#path_replace_patterns() abort + if has('win32unix') && exists('g:coc_cygqwin_path_prefixes') + echohl WarningMsg + echon 'g:coc_cygqwin_path_prefixes is deprecated, use g:coc_uri_prefix_replace_patterns instead' + echohl None + return g:coc_cygqwin_path_prefixes + endif + if exists('g:coc_uri_prefix_replace_patterns') + return g:coc_uri_prefix_replace_patterns endif + return v:null endfunction function! coc#util#version() @@ -152,98 +109,102 @@ function! coc#util#version() return lines[0] endfunction -function! coc#util#valid_state() - if s:is_vim && mode() !=# 'n' +function! coc#util#check_refresh(bufnr) + if !bufloaded(a:bufnr) return 0 endif - if get(g: , 'EasyMotion_loaded', 0) - return EasyMotion#is_active() != 1 + if getbufvar(a:bufnr, 'coc_diagnostic_disable', 0) + return 0 endif return 1 endfunction -function! coc#util#open_file(cmd, file) - let file = fnameescape(a:file) - execute a:cmd .' '.file -endfunction - -function! coc#util#platform() - if s:is_win - return 'windows' +function! coc#util#diagnostic_info(bufnr, checkInsert) abort + let checked = coc#util#check_refresh(a:bufnr) + if !checked + return v:null endif - if has('mac') || has('macvim') - return 'mac' + if a:checkInsert && mode() =~# '^i' + return v:null endif - return 'linux' -endfunction - -function! coc#util#remote_fns(name) - let fns = ['init', 'complete', 'should_complete', 'refresh', 'get_startcol', 'on_complete', 'on_enter'] - let res = [] - for fn in fns - if exists('*coc#source#'.a:name.'#'.fn) - call add(res, fn) + let locationlist = '' + let winid = -1 + for info in getwininfo() + if info['bufnr'] == a:bufnr + let winid = info['winid'] + let locationlist = get(getloclist(winid, {'title': 1}), 'title', '') + break endif endfor - return res + return { + \ 'bufnr': bufnr('%'), + \ 'winid': winid, + \ 'lnum': line('.'), + \ 'locationlist': locationlist + \ } +endfunction + +function! coc#util#open_file(cmd, file) + execute a:cmd .' '.fnameescape(fnamemodify(a:file, ':~:.')) + return bufnr('%') endfunction function! coc#util#job_command() - let node = expand(get(g:, 'coc_node_path', 'node')) + if (has_key(g:, 'coc_node_path')) + let node = expand(g:coc_node_path) + else + let node = $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH + endif if !executable(node) echohl Error | echom '[coc.nvim] "'.node.'" is not executable, checkout https://nodejs.org/en/download/' | echohl None return endif - let bundle = s:root.'/build/index.js' - if filereadable(bundle) && !get(g:, 'coc_force_debug', 0) - return [node] + get(g:, 'coc_node_args', ['--no-warnings']) + [s:root.'/build/index.js'] - endif - let file = s:root.'/lib/attach.js' - if !filereadable(file) - if !filereadable(bundle) - echohl Error | echom '[coc.nvim] javascript file not found, please compile the code or use release branch.' | echohl None + if !filereadable(s:root.'/build/index.js') + if isdirectory(s:root.'/src') + echohl Error | echom '[coc.nvim] build/index.js not found, please install dependencies and compile coc.nvim by: yarn install' | echohl None else - echohl Error | echom '[coc.nvim] compiled javascript file not found, remove let g:coc_force_debug = 1 in your vimrc.' | echohl None + echohl Error | echon '[coc.nvim] your coc.nvim is broken.' | echohl None endif return endif - return [node] + get(g:, 'coc_node_args', ['--no-warnings']) + [s:root.'/bin/server.js'] -endfunction - -function! coc#util#echo_hover(msg) - echohl MoreMsg - echo a:msg - echohl None - let g:coc_last_hover_message = a:msg -endfunction - -function! coc#util#execute(cmd) - silent exe a:cmd - if &filetype ==# '' - filetype detect - endif - if s:is_vim - redraw! - endif + return [node] + get(g:, 'coc_node_args', ['--no-warnings']) + [s:root.'/build/index.js'] endfunction function! coc#util#jump(cmd, filepath, ...) abort + if a:cmd != 'pedit' + silent! normal! m' + endif let path = a:filepath if (has('win32unix')) let path = substitute(a:filepath, '\v\\', '/', 'g') endif let file = fnamemodify(path, ":~:.") - if a:cmd =~# '^tab' - exe a:cmd.' '.fnameescape(file) - if !empty(get(a:, 1, [])) - call cursor(a:1[0], a:1[1]) + if a:cmd == 'pedit' + let extra = empty(get(a:, 1, [])) ? '' : '+'.(a:1[0] + 1) + exe 'pedit '.extra.' '.fnameescape(file) + return + elseif a:cmd == 'drop' && exists('*bufadd') + let dstbuf = bufadd(path) + let binfo = getbufinfo(dstbuf) + if len(binfo) == 1 && empty(binfo[0].windows) + exec 'buffer '.dstbuf + let &buflisted = 1 + else + exec 'drop '.fnameescape(file) endif + elseif a:cmd == 'edit' && bufloaded(file) + exe 'b '.bufnr(file) else - if !empty(get(a:, 1, [])) - exe a:cmd.' +call\ cursor('.a:1[0].','.a:1[1].')'.' '.fnameescape(file) - else - exe a:cmd.' '.fnameescape(file) + call s:safer_open(a:cmd, file) + endif + if !empty(get(a:, 1, [])) + let line = getline(a:1[0] + 1) + " TODO need to use utf16 here + let col = byteidx(line, a:1[1]) + 1 + if col == 0 + let col = 999 endif + call cursor(a:1[0] + 1, col) endif if &filetype ==# '' filetype detect @@ -253,68 +214,35 @@ function! coc#util#jump(cmd, filepath, ...) abort endif endfunction -function! coc#util#jumpTo(line, character) abort - let content = getline(a:line + 1) - let pre = strcharpart(content, 0, a:character) - let col = strlen(pre) + 1 - call cursor(a:line + 1, col) -endfunction - -function! coc#util#echo_messages(hl, msgs) - if empty(a:msgs) | return | endif - if a:hl !~# 'Error' && (mode() !~# '\v^(i|n)$') - return - endif - let msgs = filter(copy(a:msgs), '!empty(v:val)') - execute 'echohl '.a:hl - echom a:msgs[0] - redraw - echo join(msgs, "\n") - echohl None -endfunction - -function! coc#util#echo_lines(lines) - echo join(a:lines, "\n") -endfunction - -function! coc#util#timer(method, args) - call timer_start(0, { -> s:Call(a:method, a:args)}) -endfunction - -function! s:Call(method, args) - try - call call(a:method, a:args) - redraw - catch /.*/ - return 0 - endtry -endfunction +function! s:safer_open(cmd, file) abort + " How to support :pedit and :drop? + let is_supported_cmd = index(["edit", "split", "vsplit", "tabe"], a:cmd) >= 0 -function! coc#util#is_preview(bufnr) - let wnr = bufwinnr(a:bufnr) - if wnr == -1 | return 0 | endif - return getwinvar(wnr, '&previewwindow') -endfunction + " Use special handling only for URI. + let looks_like_uri = match(a:file, "^.*://") >= 0 -function! coc#util#get_bufoptions(bufnr) abort - if !bufloaded(a:bufnr) | return v:null | endif - let bufname = bufname(a:bufnr) - return { - \ 'bufname': bufname, - \ 'size': getfsize(bufname), - \ 'eol': getbufvar(a:bufnr, '&eol'), - \ 'variables': s:variables(a:bufnr), - \ 'fullpath': empty(bufname) ? '' : fnamemodify(bufname, ':p'), - \ 'buftype': getbufvar(a:bufnr, '&buftype'), - \ 'filetype': getbufvar(a:bufnr, '&filetype'), - \ 'iskeyword': getbufvar(a:bufnr, '&iskeyword'), - \ 'changedtick': getbufvar(a:bufnr, 'changedtick'), - \} + if looks_like_uri && is_supported_cmd && has('win32') && exists('*bufadd') + " Workaround a bug for Win32 paths. + " + " reference: + " - https://github.com/vim/vim/issues/541 + " - https://github.com/neoclide/coc-java/issues/82 + " - https://github.com/vim-jp/issues/issues/6 + let buf = bufadd(a:file) + if a:cmd != 'edit' + " Open split, tab, etc. by a:cmd. + exe a:cmd + endif + " Set current buffer to the file + exe 'keepjumps buffer ' . buf + else + exe a:cmd.' '.fnameescape(a:file) + endif endfunction -function! s:variables(bufnr) abort - let info = getbufinfo({'bufnr':a:bufnr, 'variables': 1}) - let variables = copy(info[0]['variables']) +function! coc#util#variables(bufnr) abort + let info = getbufinfo(a:bufnr) + let variables = empty(info) ? {} : copy(info[0]['variables']) for key in keys(variables) if key !~# '\v^coc' unlet variables[key] @@ -323,122 +251,6 @@ function! s:variables(bufnr) abort return variables endfunction -function! coc#util#root_patterns() abort - return coc#rpc#request('rootPatterns', [bufnr('%')]) -endfunction - -function! coc#util#get_config(key) abort - return coc#rpc#request('getConfig', [a:key]) -endfunction - -function! coc#util#on_error(msg) abort - echohl Error | echom '[coc.nvim] '.a:msg | echohl None -endfunction - -function! coc#util#preview_info(info, filetype, ...) abort - pclose - keepalt new +setlocal\ previewwindow|setlocal\ buftype=nofile|setlocal\ noswapfile|setlocal\ wrap [Document] - setl bufhidden=wipe - setl nobuflisted - setl nospell - exe 'setl filetype='.a:filetype - setl conceallevel=2 - setl nofoldenable - for command in a:000 - execute command - endfor - let lines = a:info - call append(0, lines) - exe "normal! z" . len(lines) . "\" - exe "normal! gg" - wincmd p -endfunction - -function! coc#util#get_config_home() - if !empty(get(g:, 'coc_config_home', '')) - return expand(g:coc_config_home) - endif - if exists('$VIMCONFIG') - return resolve($VIMCONFIG) - endif - if has('nvim') - if exists('$XDG_CONFIG_HOME') - return resolve($XDG_CONFIG_HOME."/nvim") - endif - if s:is_win - return resolve($HOME.'/AppData/Local/nvim') - endif - return resolve($HOME.'/.config/nvim') - else - if s:is_win - return resolve($HOME."/vimfiles") - endif - return resolve($HOME.'/.vim') - endif -endfunction - -function! coc#util#get_data_home() - if !empty(get(g:, 'coc_data_home', '')) - return resolve(expand(g:coc_data_home)) - endif - if exists('$XDG_CONFIG_HOME') - return resolve($XDG_CONFIG_HOME."/coc") - endif - if s:is_win - return resolve($HOME.'/AppData/Local/coc') - endif - return resolve($HOME.'/.config/coc') -endfunction - -function! coc#util#get_input() - let pos = getcurpos() - let line = getline('.') - let l:start = pos[2] - 1 - while l:start > 0 && line[l:start - 1] =~# '\k' - let l:start -= 1 - endwhile - return pos[2] == 1 ? '' : line[l:start : pos[2] - 2] -endfunction - -function! coc#util#move_cursor(delta) - let pos = getcurpos() - call cursor(pos[1], pos[2] + a:delta) -endfunction - -function! coc#util#get_complete_option() - let disabled = get(b:, 'coc_suggest_disable', 0) - if disabled | return | endif - let blacklist = get(b:, 'coc_suggest_blacklist', []) - let pos = getcurpos() - let l:start = pos[2] - 1 - let line = getline(pos[1]) - for char in reverse(split(line[0: l:start - 1], '\zs')) - if l:start > 0 && char =~# '\k' - let l:start = l:start - strlen(char) - else - break - endif - endfor - let input = pos[2] == 1 ? '' : line[l:start : pos[2] - 2] - if !empty(blacklist) && index(blacklist, input) >= 0 - return - endif - let synname = synIDattr(synID(pos[1], l:start, 1),"name") - return { - \ 'word': matchstr(line[l:start : ], '^\k\+'), - \ 'input': input, - \ 'line': line, - \ 'filetype': &filetype, - \ 'filepath': expand('%:p'), - \ 'bufnr': bufnr('%'), - \ 'linenr': pos[1], - \ 'colnr' : pos[2], - \ 'col': l:start, - \ 'synname': synname, - \ 'blacklist': blacklist, - \} -endfunction - function! coc#util#with_callback(method, args, cb) function! s:Cb() closure try @@ -452,225 +264,34 @@ function! coc#util#with_callback(method, args, cb) call timer_start(timeout, {-> s:Cb() }) endfunction -function! coc#util#quickpick(title, items, cb) abort - if exists('*popup_menu') - function! s:QuickpickHandler(id, result) closure - call a:cb(v:null, a:result) - endfunction - function! s:QuickpickFilter(id, key) closure - for i in range(1, len(a:items)) - if a:key == string(i) - call popup_close(a:id, i) - return 1 - endif - endfor - " No shortcut, pass to generic filter - return popup_filter_menu(a:id, a:key) - endfunction - try - call popup_menu(a:items, #{ - \ title: a:title, - \ filter: function('s:QuickpickFilter'), - \ callback: function('s:QuickpickHandler'), - \ }) - catch /.*/ - call a:cb(v:exception) - endtry - else - let res = inputlist([a:title] + a:items) - call a:cb(v:null, res) - endif -endfunction - -function! coc#util#prompt(title, cb) abort - if exists('*popup_dialog') - function! s:PromptHandler(id, result) closure - call a:cb(v:null, a:result) - endfunction - try - call popup_dialog(a:title. ' (y/n)', #{ - \ filter: 'popup_filter_yesno', - \ callback: function('s:PromptHandler'), - \ }) - catch /.*/ - call a:cb(v:exception) - endtry - elseif !s:is_vim && exists('*confirm') - let choice = confirm(a:title, "&Yes\n&No") - call a:cb(v:null, choice == 1) - else - echohl MoreMsg - echom a:title.' (y/n)' - echohl None - let confirm = nr2char(getchar()) - redraw! - if !(confirm ==? "y" || confirm ==? "\r") - echohl Moremsg | echo 'Cancelled.' | echohl None - return 0 - call a:cb(v:null, 0) - end - call a:cb(v:null, 1) - endif -endfunction - -function! coc#util#add_matchids(ids) - let w:coc_matchids = get(w:, 'coc_matchids', []) + a:ids -endfunction - -function! coc#util#prompt_confirm(title) - if exists('*confirm') && !s:is_vim - let choice = confirm(a:title, "&Yes\n&No") - return choice == 1 - else - echohl MoreMsg - echom a:title.' (y/n)' - echohl None - let confirm = nr2char(getchar()) - redraw! - if !(confirm ==? "y" || confirm ==? "\r") - echohl Moremsg | echo 'Cancelled.' | echohl None - return 0 - end - return 1 - endif -endfunction - -function! coc#util#get_syntax_name(lnum, col) - return synIDattr(synIDtrans(synID(a:lnum,a:col,1)),"name") -endfunction - -function! coc#util#echo_signatures(signatures) abort - if pumvisible() | return | endif - echo "" - for i in range(len(a:signatures)) - call s:echo_signature(a:signatures[i]) - if i != len(a:signatures) - 1 - echon "\n" - endif - endfor -endfunction - -function! s:echo_signature(parts) - for part in a:parts - let hl = get(part, 'type', 'Normal') - let text = get(part, 'text', '') - if !empty(text) - execute 'echohl '.hl - execute "echon '".substitute(text, "'", "''", 'g')."'" - echohl None - endif - endfor -endfunction - -function! coc#util#unplace_signs(bufnr, sign_ids) - if !bufloaded(a:bufnr) | return | endif - for id in a:sign_ids - execute 'silent! sign unplace '.id.' buffer='.a:bufnr - endfor -endfunction - -function! coc#util#setline(lnum, line) - keepjumps call setline(a:lnum, a:line) -endfunction - -" cmd, cwd -function! coc#util#open_terminal(opts) abort - if s:is_vim && !exists('*term_start') - echohl WarningMsg | echon "Your vim doesn't have terminal support!" | echohl None - return - endif - if get(a:opts, 'position', 'bottom') ==# 'bottom' - let p = '5new' - else - let p = 'vnew' - endif - execute 'belowright '.p.' +setl\ buftype=nofile ' - setl buftype=nofile - setl winfixheight - setl norelativenumber - setl nonumber - setl bufhidden=wipe - let cmd = get(a:opts, 'cmd', '') - let autoclose = get(a:opts, 'autoclose', 1) - if empty(cmd) - throw 'command required!' - endif - let cwd = get(a:opts, 'cwd', getcwd()) - let keepfocus = get(a:opts, 'keepfocus', 0) - let bufnr = bufnr('%') - let Callback = get(a:opts, 'Callback', v:null) - - function! s:OnExit(status) closure - let content = join(getbufline(bufnr, 1, '$'), "\n") - if a:status == 0 && autoclose == 1 - execute 'silent! bd! '.bufnr - endif - if !empty(Callback) - call call(Callback, [a:status, bufnr, content]) - endif - endfunction - - if has('nvim') - call termopen(cmd, { - \ 'cwd': cwd, - \ 'on_exit': {job, status -> s:OnExit(status)}, - \}) - else - if s:is_win - let cmd = 'cmd.exe /C "'.cmd.'"' - endif - call term_start(cmd, { - \ 'cwd': cwd, - \ 'exit_cb': {job, status -> s:OnExit(status)}, - \ 'curwin': 1, - \}) - endif - if keepfocus - wincmd p - endif - return bufnr -endfunction - -" run command in terminal -function! coc#util#run_terminal(opts, cb) - let cmd = get(a:opts, 'cmd', '') - if empty(cmd) - return a:cb('command required for terminal') - endif - let opts = { - \ 'cmd': cmd, - \ 'cwd': get(a:opts, 'cwd', getcwd()), - \ 'keepfocus': get(a:opts, 'keepfocus', 0), - \ 'Callback': {status, bufnr, content -> a:cb(v:null, {'success': status == 0 ? v:true : v:false, 'bufnr': bufnr, 'content': content})} - \} - call coc#util#open_terminal(opts) +function! coc#util#timer(method, args) + call timer_start(0, { -> s:Call(a:method, a:args)}) endfunction -function! coc#util#getpid() - if !has('win32unix') - return getpid() - endif - - let cmd = 'cat /proc/' . getpid() . '/winpid' - return substitute(system(cmd), '\v\n', '', 'gi') +function! s:Call(method, args) + try + call call(a:method, a:args) + redraw + catch /.*/ + return 0 + endtry endfunction function! coc#util#vim_info() return { + \ 'apiversion': s:vim_api_version, \ 'mode': mode(), + \ 'config': get(g:, 'coc_user_config', {}), \ 'floating': has('nvim') && exists('*nvim_open_win') ? v:true : v:false, \ 'extensionRoot': coc#util#extension_root(), - \ 'watchExtensions': get(g:, 'coc_watch_extensions', []), \ 'globalExtensions': get(g:, 'coc_global_extensions', []), - \ 'config': get(g:, 'coc_user_config', {}), - \ 'pid': coc#util#getpid(), - \ 'columns': &columns, \ 'lines': &lines, + \ 'columns': &columns, \ 'cmdheight': &cmdheight, + \ 'pid': coc#util#getpid(), \ 'filetypeMap': get(g:, 'coc_filetype_map', {}), \ 'version': coc#util#version(), - \ 'completeOpt': &completeopt, - \ 'pumevent': exists('##MenuPopupChanged') || exists('##CompleteChanged'), + \ 'pumevent': 1, \ 'isVim': has('nvim') ? v:false : v:true, \ 'isCygwin': has('win32unix') ? v:true : v:false, \ 'isMacvim': has('gui_macvim') ? v:true : v:false, @@ -678,131 +299,47 @@ function! coc#util#vim_info() \ 'colorscheme': get(g:, 'colors_name', ''), \ 'workspaceFolders': get(g:, 'WorkspaceFolders', v:null), \ 'background': &background, - \ 'runtimepath': &runtimepath, + \ 'runtimepath': join(globpath(&runtimepath, '', 0, 1), ','), \ 'locationlist': get(g:,'coc_enable_locationlist', 1), \ 'progpath': v:progpath, \ 'guicursor': &guicursor, - \ 'textprop': has('textprop') && has('patch-8.1.1522') && !has('nvim') ? v:true : v:false, - \} -endfunction - -function! coc#util#highlight_options() - return { - \ 'colorscheme': get(g:, 'colors_name', ''), - \ 'background': &background, - \ 'runtimepath': &runtimepath, + \ 'pumwidth': exists('&pumwidth') ? &pumwidth : 15, + \ 'tabCount': tabpagenr('$'), + \ 'updateHighlight': has('nvim-0.5.0') || has('textprop') ? v:true : v:false, + \ 'vimCommands': get(g:, 'coc_vim_commands', []), + \ 'sign': exists('*sign_place') && exists('*sign_unplace'), + \ 'ambiguousIsNarrow': &ambiwidth ==# 'single' ? v:true : v:false, + \ 'textprop': has('textprop') ? v:true : v:false, + \ 'virtualText': has('nvim-0.5.0') || has('patch-9.0.0067') ? v:true : v:false, + \ 'dialog': has('nvim-0.4.0') || has('popupwin') ? v:true : v:false, + \ 'semanticHighlights': coc#util#semantic_hlgroups() \} endfunction -" used by vim -function! coc#util#get_content(bufnr) - if !bufexists(a:bufnr) | return '' | endif +function! coc#util#all_state() return { - \ 'content': join(getbufline(a:bufnr, 1, '$'), "\n"), - \ 'changedtick': getbufvar(a:bufnr, 'changedtick') + \ 'bufnr': bufnr('%'), + \ 'winid': win_getid(), + \ 'bufnrs': map(getbufinfo({'bufloaded': 1}),'v:val["bufnr"]'), + \ 'winids': map(getwininfo(),'v:val["winid"]'), \ } endfunction -" used for TextChangedI with InsertCharPre -function! coc#util#get_changeinfo() - return { - \ 'lnum': line('.'), - \ 'line': getline('.'), - \ 'changedtick': b:changedtick, - \} -endfunction - -" show diff of current buffer -function! coc#util#diff_content(lines) abort - let tmpfile = tempname() - setl foldenable - call writefile(a:lines, tmpfile) - let ft = &filetype - diffthis - execute 'vs '.tmpfile - execute 'setf ' . ft - diffthis - setl foldenable -endfunction - -function! coc#util#clear_signs() - let buflist = filter(range(1, bufnr('$')), 'buflisted(v:val)') - for b in buflist - let signIds = [] - let lines = split(execute('sign place buffer='.b), "\n") - for line in lines - let ms = matchlist(line, 'id=\(\d\+\)\s\+name=Coc') - if len(ms) > 0 - call add(signIds, ms[1]) - endif - endfor - call coc#util#unplace_signs(b, signIds) - endfor -endfunction - -function! coc#util#clearmatches(ids, ...) - let winid = get(a:, 1, 0) - if winid != 0 && win_getid() != winid - return - endif - for id in a:ids - try - call matchdelete(id) - catch /.*/ - " matches have been cleared in other ways, - endtry - endfor - let exists = get(w:, 'coc_matchids', []) - if !empty(exists) - call filter(w:coc_matchids, 'index(a:ids, v:val) == -1') - endif -endfunction - -function! coc#util#open_url(url) - if has('mac') && executable('open') - call system('open '.a:url) - return - endif - if executable('xdg-open') - call system('xdg-open '.a:url) - return - endif - call system('cmd /c start "" /b '. substitute(a:url, '&', '^&', 'g')) - if v:shell_error - echohl Error | echom 'Failed to open '.a:url | echohl None - return - endif -endfunction - -function! coc#util#install(...) abort - let opts = get(a:, 1, {}) - if !isdirectory(s:root.'/src') - echohl WarningMsg | echon '[coc.nvim] coc#util#install not needed for release branch.' | echohl None - return - endif - echohl WarningMsg | echon '[coc.nvim] coc#util#install support will be removed, please use release branch of coc.nvim' | echohl None - let cmd = (s:is_win ? 'install.cmd' : './install.sh') . ' nightly' - let cwd = getcwd() - exe 'lcd '.s:root - exe '!'.cmd - exe 'lcd '.cwd - call coc#rpc#restart() -endfunction - -function! coc#util#do_complete(name, opt, cb) abort - let handler = 'coc#source#'.a:name.'#complete' - let l:Cb = {res -> a:cb(v:null, res)} - let args = [a:opt, l:Cb] - call call(handler, args) +function! coc#util#install() abort + let yarncmd = get(g:, 'coc_install_yarn_cmd', executable('yarnpkg') ? 'yarnpkg' : 'yarn') + call coc#ui#open_terminal({ + \ 'cwd': s:root, + \ 'cmd': yarncmd.' install --frozen-lockfile --ignore-engines', + \ 'autoclose': 0, + \ }) endfunction function! coc#util#extension_root() abort - if !empty($COC_TEST) + if get(g:, 'coc_node_env', '') ==# 'test' return s:root.'/src/__tests__/extensions' endif if !empty(get(g:, 'coc_extension_root', '')) - echohl WarningMsg | echon "g:coc_extension_root variable is deprecated, use g:coc_data_home as parent folder of extensions." | echohl None - return resolve(expand(g:coc_extension_root)) + echohl Error | echon 'g:coc_extension_root not used any more, use g:coc_data_home instead' | echohl None endif return coc#util#get_data_home().'/extensions' endfunction @@ -812,7 +349,7 @@ function! coc#util#update_extensions(...) abort if async call coc#rpc#notify('updateExtensions', []) else - call coc#rpc#request('updateExtensions', []) + call coc#rpc#request('updateExtensions', [v:true]) endif endfunction @@ -828,224 +365,284 @@ endfunction function! coc#util#do_autocmd(name) abort if exists('#User#'.a:name) - exe 'doautocmd User '.a:name + exe 'doautocmd User '.a:name endif endfunction function! coc#util#rebuild() let dir = coc#util#extension_root() if !isdirectory(dir) | return | endif - call coc#util#open_terminal({ + call coc#ui#open_terminal({ \ 'cwd': dir, \ 'cmd': 'npm rebuild', \ 'keepfocus': 1, \}) endfunction -" content of first echo line -function! coc#util#echo_line() - let str = '' - let line = &lines - (&cmdheight - 1) - for i in range(1, &columns - 1) - let nr = screenchar(line, i) - let str = str . nr2char(nr) - endfor - return str +function! coc#util#unmap(bufnr, keys) abort + if bufnr('%') == a:bufnr + for key in a:keys + exe 'silent! nunmap '.key + endfor + endif endfunction -" [r, g, b] ['255', '255', '255'] -" return ['65535', '65535', '65535'] or return v:false to cancel -function! coc#util#pick_color(default_color) - if has('mac') - let default_color = map(a:default_color, {idx, val -> str2nr(val) * 65535 / 255 }) - " This is the AppleScript magic: - let s:ascrpt = ['-e "tell application \"' . s:app . '\""', - \ '-e "' . s:activate . '"', - \ "-e \"set AppleScript's text item delimiters to {\\\",\\\"}\"", - \ '-e "set theColor to (choose color default color {' . default_color[0] . ", " . default_color[1] . ", " . default_color[2] . '}) as text"', - \ '-e "' . s:quit . '"', - \ '-e "end tell"', - \ '-e "return theColor"'] - let res = trim(system("osascript " . join(s:ascrpt, ' ') . " 2>/dev/null")) - if empty(res) - return v:false - else - return split(trim(res), ',') - endif - endif +function! coc#util#refactor_foldlevel(lnum) abort + if a:lnum <= 2 | return 0 | endif + let line = getline(a:lnum) + if line =~# '^\%u3000\s*$' | return 0 | endif + return 1 +endfunction - let hex_color = printf('#%02x%02x%02x', a:default_color[0], a:default_color[1], a:default_color[2]) +function! coc#util#refactor_fold_text(lnum) abort + let range = '' + let info = get(b:line_infos, a:lnum, []) + if !empty(info) + let range = info[0].':'.info[1] + endif + return trim(getline(a:lnum)[3:]).' '.range +endfunction - if has('unix') - if executable('zenity') - let res = trim(system('zenity --title="Select a color" --color-selection --color="' . hex_color . '" 2> /dev/null')) - if empty(res) - return v:false - else - " res format is rgb(255,255,255) - return map(split(res[4:-2], ','), {idx, val -> string(str2nr(trim(val)) * 65535 / 255)}) - endif +" get tabsize & expandtab option +function! coc#util#get_format_opts(bufnr) abort + let bufnr = a:bufnr && bufloaded(a:bufnr) ? a:bufnr : bufnr('%') + let tabsize = getbufvar(bufnr, '&shiftwidth') + if tabsize == 0 + let tabsize = getbufvar(bufnr, '&tabstop') + endif + return { + \ 'tabsize': tabsize, + \ 'expandtab': getbufvar(bufnr, '&expandtab'), + \ 'insertFinalNewline': getbufvar(bufnr, '&eol'), + \ 'trimTrailingWhitespace': getbufvar(bufnr, 'coc_trim_trailing_whitespace', 0), + \ 'trimFinalNewlines': getbufvar(bufnr, 'coc_trim_final_newlines', 0) + \ } +endfunction + +function! coc#util#get_editoroption(winid) abort + if !coc#compat#win_is_valid(a:winid) + return v:null + endif + if has('nvim') && exists('*nvim_win_get_config') + " avoid float window + let config = nvim_win_get_config(a:winid) + if !empty(get(config, 'relative', '')) + return v:null endif endif - - let rgb = v:false - if !has('python') - echohl Error | echom 'python support required, checkout :echo has(''python'')' | echohl None - return + let info = getwininfo(a:winid)[0] + let bufnr = info['bufnr'] + let buftype = getbufvar(bufnr, '&buftype') + " avoid window for other purpose. + if buftype !=# '' && buftype !=# 'acwrite' + return v:null endif - try - execute 'py import gtk' - catch /.*/ - echohl Error | echom 'python gtk module not found' | echohl None - return - endtry -python << endpython - -import vim -import gtk, sys - -# message strings -wnd_title_insert = "Insert a color" - -csd = gtk.ColorSelectionDialog(wnd_title_insert) -cs = csd.colorsel - -cs.set_current_color(gtk.gdk.color_parse(vim.eval("hex_color"))) - -cs.set_current_alpha(65535) -cs.set_has_opacity_control(False) -# cs.set_has_palette(int(vim.eval("s:display_palette"))) - -if csd.run()==gtk.RESPONSE_OK: - c = cs.get_current_color() - s = [str(int(c.red)),',',str(int(c.green)),',',str(int(c.blue))] - thecolor = ''.join(s) - vim.command(":let rgb = split('%s',',')" % thecolor) - -csd.destroy() - -endpython - return rgb + let tabSize = getbufvar(bufnr, '&shiftwidth') + if tabSize == 0 + let tabSize = getbufvar(bufnr, '&tabstop') + endif + return { + \ 'bufnr': bufnr, + \ 'winid': a:winid, + \ 'winids': map(getwininfo(), 'v:val["winid"]'), + \ 'tabpagenr': info['tabnr'], + \ 'winnr': winnr(), + \ 'visibleRanges': s:visible_ranges(a:winid), + \ 'tabSize': tabSize, + \ 'insertSpaces': getbufvar(bufnr, '&expandtab') ? v:true : v:false + \ } endfunction -function! coc#util#iterm_open(dir) - return s:osascript( - \ 'if application "iTerm2" is not running', - \ 'error', - \ 'end if') && s:osascript( - \ 'tell application "iTerm2"', - \ 'tell current window', - \ 'create tab with default profile', - \ 'tell current session', - \ 'write text "cd ' . a:dir . '"', - \ 'write text "clear"', - \ 'activate', - \ 'end tell', - \ 'end tell', - \ 'end tell') +function! coc#util#getpid() + if !has('win32unix') + return getpid() + endif + let cmd = 'cat /proc/' . getpid() . '/winpid' + return substitute(system(cmd), '\v\n', '', 'gi') endfunction -function! s:osascript(...) abort - let args = join(map(copy(a:000), '" -e ".shellescape(v:val)'), '') - call s:system('osascript'. args) - return !v:shell_error +" Get indentkeys for indent on TextChangedP, consider = for word indent only. +function! coc#util#get_indentkeys() abort + if empty(&indentexpr) + return '' + endif + if &indentkeys !~# '=' + return '' + endif + return &indentkeys endfunction -function! s:system(cmd) - let output = system(a:cmd) - if v:shell_error && output !=# "" - echohl Error | echom output | echohl None - return +function! coc#util#get_bufoptions(bufnr, max) abort + if !bufloaded(a:bufnr) | return v:null | endif + let bufname = bufname(a:bufnr) + let buftype = getbufvar(a:bufnr, '&buftype') + let size = coc#util#bufsize(a:bufnr) + let lines = v:null + if getbufvar(a:bufnr, 'coc_enabled', 1) + \ && (buftype == '' || buftype == 'acwrite' || getbufvar(a:bufnr, 'coc_force_attach', 0)) + \ && size != -2 + \ && size < a:max + let lines = getbufline(a:bufnr, 1, '$') endif - return output + return { + \ 'bufnr': a:bufnr, + \ 'size': size, + \ 'lines': lines, + \ 'winid': bufwinid(a:bufnr), + \ 'bufname': bufname, + \ 'buftype': buftype, + \ 'previewwindow': v:false, + \ 'eol': getbufvar(a:bufnr, '&eol'), + \ 'indentkeys': coc#util#get_indentkeys(), + \ 'variables': coc#util#variables(a:bufnr), + \ 'filetype': getbufvar(a:bufnr, '&filetype'), + \ 'iskeyword': getbufvar(a:bufnr, '&iskeyword'), + \ 'changedtick': getbufvar(a:bufnr, 'changedtick'), + \ 'fullpath': empty(bufname) ? '' : fnamemodify(bufname, ':p'), + \} endfunction -function! coc#util#pclose() - for i in range(1, winnr('$')) - if getwinvar(i, '&previewwindow') - pclose - redraw - endif - endfor +function! coc#util#bufsize(bufnr) abort + if bufnr('%') == a:bufnr + return line2byte(line("$") + 1) + endif + let bufname = bufname(a:bufnr) + if !getbufvar(a:bufnr, '&modified') && filereadable(bufname) + return getfsize(bufname) + endif + return strlen(join(getbufline(a:bufnr, 1, '$'), '\n')) endfunction -function! coc#util#init_virtual_hl() - let names = ['Error', 'Warning', 'Info', 'Hint'] - for name in names - if !hlexists('Coc'.name.'VirtualText') - exe 'hi default link Coc'.name.'VirtualText Coc'.name.'Sign' +function! coc#util#get_config_home() + if !empty(get(g:, 'coc_config_home', '')) + return resolve(expand(g:coc_config_home)) + endif + if exists('$VIMCONFIG') + return resolve($VIMCONFIG) + endif + if has('nvim') + if exists('$XDG_CONFIG_HOME') + return resolve($XDG_CONFIG_HOME."/nvim") endif - endfor -endfunction - -function! coc#util#set_buf_var(bufnr, name, val) abort - if !bufloaded(a:bufnr) | return | endif - call setbufvar(a:bufnr, a:name, a:val) + if s:is_win + return resolve($HOME.'/AppData/Local/nvim') + endif + return resolve($HOME.'/.config/nvim') + else + if s:is_win + return resolve($HOME."/vimfiles") + endif + return resolve($HOME.'/.vim') + endif endfunction -function! coc#util#change_lines(bufnr, list) abort - if !bufloaded(a:bufnr) | return | endif - let bufnr = bufnr('%') - let changeBuffer = bufnr != a:bufnr - if changeBuffer - exe 'buffer '.a:bufnr - endif - for [lnum, line] in a:list - call setline(lnum + 1, line) - endfor - if changeBuffer - exe 'buffer '.bufnr +function! coc#util#get_data_home() + if !empty(get(g:, 'coc_data_home', '')) + let dir = resolve(expand(g:coc_data_home)) + else + if exists('$XDG_CONFIG_HOME') + let dir = resolve($XDG_CONFIG_HOME."/coc") + else + if s:is_win + let dir = resolve(expand('~/AppData/Local/coc')) + else + let dir = resolve(expand('~/.config/coc')) + endif + endif endif - if s:is_vim - redraw + if !isdirectory(dir) + call coc#notify#create(['creating coc.nvim data directory: '.dir], { + \ 'borderhighlight': 'CocInfoSign', + \ 'timeout': 5000, + \ 'kind': 'info', + \ }) + call mkdir(dir, "p", 0755) endif + return dir endfunction -function! coc#util#unmap(bufnr, keys) abort - if bufnr('%') == a:bufnr - for key in a:keys - exe 'silent! nunmap '.key - endfor +function! coc#util#get_complete_option() + if get(b:,"coc_suggest_disable",0) + return v:null endif + let pos = getcurpos() + let line = getline(pos[1]) + let input = matchstr(strpart(line, 0, pos[2] - 1), '\k*$') + let col = pos[2] - strlen(input) + let position = { + \ 'line': line('.')-1, + \ 'character': strchars(strpart(getline('.'), 0, col('.') - 1)) + \ } + return { + \ 'word': matchstr(strpart(line, col - 1), '^\k\+'), + \ 'position': position, + \ 'input': empty(input) ? '' : input, + \ 'line': line, + \ 'filetype': &filetype, + \ 'filepath': expand('%:p'), + \ 'bufnr': bufnr('%'), + \ 'linenr': pos[1], + \ 'colnr' : pos[2], + \ 'col': col - 1, + \ 'changedtick': b:changedtick, + \ 'blacklist': get(b:, 'coc_suggest_blacklist', []), + \ 'disabled': get(b:, 'coc_disabled_sources', []), + \ 'indentkeys': coc#util#get_indentkeys() + \} endfunction -function! coc#util#open_files(files) - let bufnrs = [] - " added on latest vim8 - if exists('*bufadd') && exists('*bufload') - for file in a:files - let bufnr = bufadd(file) - call bufload(file) - call add(bufnrs, bufnr(file)) - call setbufvar(bufnr, '&buflisted', 1) - endfor - else - noa keepalt 1new +setl\ bufhidden=wipe - for file in a:files - execute 'noa edit +setl\ bufhidden=hide '.fnameescape(file) - if &filetype ==# '' - filetype detect - endif - call add(bufnrs, bufnr('%')) - endfor - noa close +" used by vim +function! coc#util#get_buf_lines(bufnr, changedtick) + if !bufloaded(a:bufnr) + return v:null + endif + let changedtick = getbufvar(a:bufnr, 'changedtick') + if changedtick == a:changedtick + return v:null endif - doautocmd BufEnter - return bufnrs + return { + \ 'lines': getbufline(a:bufnr, 1, '$'), + \ 'changedtick': getbufvar(a:bufnr, 'changedtick') + \ } endfunction -function! coc#util#refactor_foldlevel(lnum) abort - if a:lnum <= 2 | return 0 | endif - let line = getline(a:lnum) - if line =~# '^\%u3000\s*$' | return 0 | endif - return 1 +" used for TextChangedI with InsertCharPre +function! coc#util#get_changeinfo() + return { + \ 'bufnr': bufnr('%'), + \ 'lnum': line('.'), + \ 'line': getline('.'), + \ 'changedtick': b:changedtick, + \} endfunction -function! coc#util#refactor_fold_text(lnum) abort - let range = '' - let info = get(b:line_infos, a:lnum, []) - if !empty(info) - let range = info[0].':'.info[1] - endif - return trim(getline(a:lnum)[3:]).' '.range +function! s:visible_ranges(winid) abort + let info = getwininfo(a:winid)[0] + let res = [] + if !has_key(info, 'topline') || !has_key(info, 'botline') + return res + endif + let begin = 0 + let curr = info['topline'] + let max = info['botline'] + if win_getid() != a:winid + return [[curr, max]] + endif + while curr <= max + let closedend = foldclosedend(curr) + if closedend == -1 + let begin = begin == 0 ? curr : begin + if curr == max + call add(res, [begin, curr]) + endif + let curr = curr + 1 + else + if begin != 0 + call add(res, [begin, curr - 1]) + let begin = closedend + 1 + endif + let curr = closedend + 1 + endif + endwhile + return res endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/vtext.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/vtext.vim new file mode 100644 index 0000000..f334779 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/vtext.vim @@ -0,0 +1,36 @@ +let s:is_vim = !has('nvim') +let s:virtual_text_support = has('nvim-0.5.0') || has('patch-9.0.0067') +let s:text_options = has('patch-9.0.0121') + +" opts.hl_mode default to 'combine'. +" opts.col not used on neovim. +" opts.virt_text_win_col neovim only. +" opts.text_align could be 'after' 'right' 'below', vim9 only. +" opts.text_wrap could be 'wrap' and 'truncate', vim9 only. +function! coc#vtext#add(bufnr, src_id, line, blocks, opts) abort + if !s:virtual_text_support + return + endif + if s:is_vim + for [text, hl] in a:blocks + let type = coc#api#create_type(a:src_id, hl, a:opts) + let column = get(a:opts, 'col', 0) + let opts = { 'text': text, 'type': type } + if s:text_options && column == 0 + let opts['text_align'] = get(a:opts, 'text_align', 'after') + let opts['text_wrap'] = get(a:opts, 'text_wrap', 'truncate') + endif + call prop_add(a:line + 1, column, opts) + endfor + else + let opts = { + \ 'virt_text': a:blocks, + \ 'hl_mode': get(a:opts, 'hl_mode', 'combine'), + \ } + if has('nvim-0.5.1') && has_key(a:opts, 'virt_text_win_col') + let opts['virt_text_win_col'] = a:opts['virt_text_win_col'] + let opts['virt_text_pos'] = 'overlay' + endif + call nvim_buf_set_extmark(a:bufnr, a:src_id, a:line, 0, opts) + endif +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/coc/window.vim b/_vim/.vim/plugged/coc.nvim/autoload/coc/window.vim new file mode 100644 index 0000000..5c99fc8 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/autoload/coc/window.vim @@ -0,0 +1,205 @@ +let g:coc_max_treeview_width = get(g:, 'coc_max_treeview_width', 40) +let s:is_vim = !has('nvim') + +" Get tabpagenr of winid, return -1 if window doesn't exist +function! coc#window#tabnr(winid) abort + if exists('*nvim_win_get_tabpage') + try + return nvim_win_get_tabpage(a:winid) + catch /Invalid window id/ + return -1 + endtry + endif + if exists('*win_execute') + let ref = {} + call win_execute(a:winid, 'let ref["out"] = tabpagenr()') + return get(ref, 'out', -1) + elseif !s:is_vim + let info = getwininfo(a:winid) + return empty(info) ? -1 : info[0]['tabnr'] + else + throw 'win_execute() does not exist, please upgrade your vim.' + endif +endfunction + +function! coc#window#get_cursor(winid) abort + if exists('*nvim_win_get_cursor') + return nvim_win_get_cursor(a:winid) + endif + return coc#api#exec('win_get_cursor', [a:winid]) +endfunction + +" Check if winid visible on current tabpage +function! coc#window#visible(winid) abort + if s:is_vim + if coc#window#tabnr(a:winid) != tabpagenr() + return 0 + endif + " Check possible hidden popup + try + return get(popup_getpos(a:winid), 'visible', 0) == 1 + catch /^Vim\%((\a\+)\)\=:E993/ + return 1 + endtry + endif + if !nvim_win_is_valid(a:winid) + return 0 + endif + return coc#window#tabnr(a:winid) == tabpagenr() +endfunction + +" Return v:null when name or window doesn't exist, +" 'getwinvar' only works on window of current tab +function! coc#window#get_var(winid, name, ...) abort + if !s:is_vim + try + if a:name =~# '^&' + return nvim_win_get_option(a:winid, a:name[1:]) + else + return nvim_win_get_var(a:winid, a:name) + endif + catch /E5555/ + return get(a:, 1, v:null) + endtry + else + try + return coc#api#exec('win_get_var', [a:winid, a:name, get(a:, 1, v:null)]) + catch /.*/ + return get(a:, 1, v:null) + endtry + endif +endfunction + +" Not throw like setwinvar +function! coc#window#set_var(winid, name, value) abort + try + if !s:is_vim + if a:name =~# '^&' + call nvim_win_set_option(a:winid, a:name[1:], a:value) + else + call nvim_win_set_var(a:winid, a:name, a:value) + endif + else + call coc#api#exec('win_set_var', [a:winid, a:name, a:value]) + endif + catch /Invalid window id/ + " ignore + endtry +endfunction + +function! coc#window#is_float(winid) abort + if s:is_vim + if exists('*popup_list') + return index(popup_list(), a:winid) != -1 + else + try + return !empty(popup_getpos(a:winid)) + catch /^Vim\%((\a\+)\)\=:E993/ + return 0 + endtry + endif + return 0 + elseif exists('*nvim_win_get_config') + let config = nvim_win_get_config(a:winid) + return !empty(config) && !empty(get(config, 'relative', '')) + endif +endfunction + +function! coc#window#set_height(winid, height) abort + if empty(getwininfo(a:winid)) + return + endif + if exists('*nvim_win_set_height') + call nvim_win_set_height(a:winid, a:height) + else + call coc#compat#execute(a:winid, 'noa resize '.a:height, 'silent') + endif +endfunction + +function! coc#window#adjust_width(winid) abort + let bufnr = winbufnr(a:winid) + if bufloaded(bufnr) + let maxwidth = 0 + let lines = getbufline(bufnr, 1, '$') + if len(lines) > 2 + call coc#compat#execute(a:winid, 'setl nowrap') + for line in lines + let w = strwidth(line) + if w > maxwidth + let maxwidth = w + endif + endfor + endif + if maxwidth > winwidth(a:winid) + call coc#compat#execute(a:winid, 'vertical resize '.min([maxwidth, g:coc_max_treeview_width])) + endif + endif +endfunction + +" Get single window by window variable, current tab only +function! coc#window#find(key, val) abort + for i in range(1, winnr('$')) + let res = getwinvar(i, a:key) + if res == a:val + return win_getid(i) + endif + endfor + return -1 +endfunction + +" Visible buffer numbers +function! coc#window#bufnrs() abort + let winids = [] + if exists('*nvim_list_wins') + let winids = nvim_list_wins() + else + let winids = map(getwininfo(), 'v:val["winid"]') + endif + return uniq(map(winids, 'winbufnr(v:val)')) +endfunction + +" Avoid errors +function! coc#window#close(winid) abort + if empty(a:winid) || a:winid == -1 + return + endif + if exists('*nvim_win_is_valid') && exists('*nvim_win_close') + if nvim_win_is_valid(a:winid) + call nvim_win_close(a:winid, 1) + endif + elseif exists('*win_execute') + call coc#compat#execute(a:winid, 'noa close!', 'silent!') + else + let curr = win_getid() + if curr == a:winid + silent! close! + else + let res = win_gotoid(a:winid) + if res + silent! close! + call win_gotoid(curr) + endif + endif + endif +endfunction + +function! coc#window#visible_range(bufnr) abort + let winid = bufwinid(a:bufnr) + if winid == -1 + return v:null + endif + let info = getwininfo(winid)[0] + return [info['topline'], info['botline']] +endfunction + +function! coc#window#visible_ranges(bufnr) abort + let wins = gettabinfo(tabpagenr())[0]['windows'] + let res = [] + for id in wins + let info = getwininfo(id)[0] + if info['bufnr'] == a:bufnr + call add(res, [info['topline'], info['botline']]) + endif + endfor + return res +endfunction diff --git a/_vim/.vim/plugged/coc.nvim/autoload/health/coc.vim b/_vim/.vim/plugged/coc.nvim/autoload/health/coc.vim index 10f1a62..24fbab4 100644 --- a/_vim/.vim/plugged/coc.nvim/autoload/health/coc.vim +++ b/_vim/.vim/plugged/coc.nvim/autoload/health/coc.vim @@ -1,25 +1,40 @@ +scriptencoding utf-8 let s:root = expand(':h:h:h') -function! s:checkEnvironment() abort - let valid = 1 - if !has('nvim-0.3.0') - let valid = 0 - call health#report_error('Neovim version not satisfied, 0.3.0 and above required') +function! s:checkVim(test, name, patchlevel) abort + if a:test + if !has(a:patchlevel) + call health#report_error(a:name . ' version not satisfied, ' . a:patchlevel . ' and above required') + return 0 + else + call health#report_ok(a:name . ' version satisfied') + return 1 + endif endif - let node = get(g:, 'coc_node_path', 'node') + return 0 +endfunction + +function! s:checkEnvironment() abort + let valid + \ = s:checkVim(has('nvim'), 'nvim', 'nvim-0.4.0') + \ + s:checkVim(!has('nvim'), 'vim', 'patch-8.1.1719') + let node = get(g:, 'coc_node_path', $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH) if !executable(node) let valid = 0 call health#report_error('Executable node.js not found, install node.js from http://nodejs.org/') endif let output = system(node . ' --version') if v:shell_error && output !=# "" - echohl Error | echom output | echohl None - return + let valid = 0 + call health#report_error(output) endif let ms = matchlist(output, 'v\(\d\+\).\(\d\+\).\(\d\+\)') - if empty(ms) || str2nr(ms[1]) < 8 || (str2nr(ms[1]) == 8 && str2nr(ms[2]) < 10) + if empty(ms) + let valid = 0 + call health#report_error('Unable to detect version of node, make sure your node executable is http://nodejs.org/') + elseif str2nr(ms[1]) < 14 || (str2nr(ms[1]) == 14 && str2nr(ms[2]) < 14) let valid = 0 - call health#report_error('Node.js version '.output.' < 8.10.0, please upgrade node.js') + call health#report_warn('Node.js version '.trim(output).' < 14.14.0, please upgrade node.js') endif if valid call health#report_ok('Environment check passed') @@ -29,6 +44,9 @@ function! s:checkEnvironment() abort silent pyx print("") catch /.*/ call health#report_warn('pyx command not work, some extensions may fail to work, checkout ":h pythonx"') + if has('nvim') + call health#report_warn('Install pynvim by command: pip install pynvim --upgrade') + endif endtry endif return valid @@ -36,15 +54,10 @@ endfunction function! s:checkCommand() let file = s:root.'/build/index.js' - if filereadable(file) && !get(g:, 'coc_force_debug', 0) - call health#report_ok('Javascript bundle found') - return - endif - let file = s:root.'/lib/attach.js' - if !filereadable(file) - call health#report_error('Javascript entry not found, run ":call coc#util#install()" to fix it.') + if filereadable(file) + call health#report_ok('Javascript bundle build/index.js found') else - call health#report_ok('Build javascript found') + call health#report_error('Javascript entry not found, please compile coc.nvim by esbuild.') endif endfunction @@ -67,7 +80,7 @@ function! s:checkAutocmd() endfor endfunction -function! s:checkInitailize() abort +function! s:checkInitialize() abort if coc#client#is_running('coc') call health#report_ok('Service started') return 1 @@ -82,6 +95,6 @@ endfunction function! health#coc#check() abort call s:checkEnvironment() call s:checkCommand() - call s:checkInitailize() + call s:checkInitialize() call s:checkAutocmd() endfunction diff --git a/_vim/.vim/plugged/coc.nvim/data/schema.json b/_vim/.vim/plugged/coc.nvim/data/schema.json index b5142e5..3a05bdc 100644 --- a/_vim/.vim/plugged/coc.nvim/data/schema.json +++ b/_vim/.vim/plugged/coc.nvim/data/schema.json @@ -1,8 +1,69 @@ { - "$schema": "http://json-schema.org/draft-06/schema", + "$schema": "http://json-schema.org/draft-07/schema#", "description": "Configuration file for coc.nvim", "additionalProperties": false, "definitions": { + "float": { + "type": "object", + "properties": { + "border": { + "type": "boolean", + "default": false, + "description": "Set to true to use borders." + }, + "rounded": { + "type": "boolean", + "default": false, + "description": "Use rounded borders when border is true." + }, + "highlight": { + "type": "string", + "default": "CocFloating", + "description": "Background highlight group of float window." + }, + "title": { + "type": "string", + "default": "", + "description": "Title used by float window." + }, + "borderhighlight": { + "type": "string", + "default": "CocFloating", + "description": "Border highlight group of float window." + }, + "close": { + "type": "boolean", + "default": false, + "description": "Set to true to draw close icon" + }, + "maxWidth": { + "type": "integer", + "description": "Maximum width of float window, include border." + }, + "maxHeight": { + "type": "integer", + "minimum": 2, + "description": "Maximum height of float window, include border." + }, + "focusable": { + "type": "boolean", + "default": true, + "description": "Enable focus by user actions (wincmds, mouse events), neovim only." + }, + "shadow": { + "type": "boolean", + "default": false, + "description": "Drop shadow effect by blending with the background, neovim only." + }, + "winblend": { + "type": "integer", + "default": 0, + "minimum": 0, + "maximum": 100, + "description": "Enables pseudo-transparency by set 'winblend' option of window, neovim only." + } + } + }, "languageServerBase": { "type": "object", "properties": { @@ -18,22 +79,67 @@ "disableDynamicRegister": { "type": "boolean", "default": false, - "description": "Disable dynamic registerCapability feature for this languageserver to avoid duplicated feature regstration." + "description": "Disable dynamic registerCapability feature for this languageserver to avoid duplicate feature registration." }, - "disableWorkspaceFolders": { + "disableSnippetCompletion": { "type": "boolean", "default": false, - "description": "Disable workspaceFolders feature for this languageserver." + "description": "Disable completion snippet feature for this languageserver, the languageserver may not respect it." }, - "disableDiagnostics": { - "type": "boolean", - "default": false, - "description": "Disable handle diagnostics for this languageserver." + "disabledFeatures": { + "type": "array", + "default": [], + "description": "Disabled features for this languageserver.", + "items": { + "type": "string", + "enum": [ + "completion", + "configuration", + "workspaceFolders", + "diagnostics", + "willSave", + "willSaveUntil", + "didSaveTextDocument", + "fileSystemWatcher", + "hover", + "signatureHelp", + "definition", + "references", + "documentHighlight", + "documentSymbol", + "workspaceSymbol", + "codeAction", + "codeLens", + "formatting", + "documentFormatting", + "documentRangeFormatting", + "documentOnTypeFormatting", + "rename", + "documentLink", + "executeCommand", + "pullConfiguration", + "typeDefinition", + "implementation", + "declaration", + "color", + "foldingRange", + "selectionRange", + "progress", + "callHierarchy", + "linkedEditing", + "inlayHint", + "inlineValue", + "typeHierarchy", + "pullDiagnostic", + "fileEvents", + "semanticTokens" + ] + } }, - "disableCompletion": { - "type": "boolean", - "default": false, - "description": "Disable completion feature for this languageserver." + "formatterPriority": { + "type": "number", + "default": 0, + "description": "Priority of this languageserver's formatter." }, "env": { "type": "object", @@ -77,7 +183,7 @@ "additionalSchemes": { "type": "array", "default": [], - "description": "Additional uri schemes, default schemes including file & untitled.", + "description": "Additional URI schemes, default schemes including file & untitled.", "items": { "type": "string" } @@ -90,7 +196,7 @@ }, "progressOnInitialization": { "type": "boolean", - "default": true, + "default": false, "description": "Enable progress report on languageserver initialize." }, "initializationOptions": { @@ -108,6 +214,18 @@ "default": "off", "enum": ["off", "messages", "verbose"], "description": "Trace level of communication between server and client" + }, + "trace.server.verbosity": { + "type": "string", + "default": "off", + "enum": ["off", "messages", "verbose"], + "description": "Trace level of communication between server and client" + }, + "trace.server.format": { + "type": "string", + "default": "text", + "enum": ["text", "json"], + "description": "Text format of trace messages." } } }, @@ -126,10 +244,10 @@ "default": "127.0.0.1", "description": "Host of server" }, - "disableWorkspaceFolders": {}, + "disableSnippetCompletion": {}, "disableDynamicRegister": {}, - "disableDiagnostics": {}, - "disableCompletion": {}, + "disabledFeatures": {}, + "formatterPriority": {}, "enable": {}, "rootPatterns": {}, "requireRootPattern": {}, @@ -141,7 +259,9 @@ "initializationOptions": {}, "settings": {}, "stdioEncoding": {}, - "trace.server": {} + "trace.server": {}, + "trace.server.verbosity": {}, + "trace.server.format": {} } }, "languageServerModule": { @@ -153,7 +273,7 @@ "module": { "type": "string", "default": "", - "description": "Absolute path of javascript file, should works in IPC mode" + "description": "Absolute path of Javascript file, should works in IPC mode" }, "args": { "type": "array", @@ -171,7 +291,7 @@ "execArgv": { "type": "array", "default": [], - "description": "Argv passed to node when using module, normally used for debugging, ex: [\"--nolazy\", \"--inspect-brk=6045\"]", + "description": "ARGV passed to node when using module, normally used for debugging, ex: [\"--nolazy\", \"--inspect-brk=6045\"]", "items": { "type": "string" } @@ -190,9 +310,9 @@ "env": {}, "enable": {}, "disableDynamicRegister": {}, - "disableWorkspaceFolders": {}, - "disableDiagnostics": {}, - "disableCompletion": {}, + "disableSnippetCompletion": {}, + "disabledFeatures": {}, + "formatterPriority": {}, "rootPatterns": {}, "requireRootPattern": {}, "ignoredRootPaths": {}, @@ -203,7 +323,9 @@ "initializationOptions": {}, "stdioEncoding": {}, "settings": {}, - "trace.server": {} + "trace.server": {}, + "trace.server.verbosity": {}, + "trace.server.format": {} } }, "languageServerCommand": { @@ -239,9 +361,9 @@ "env": {}, "enable": {}, "disableDynamicRegister": {}, - "disableWorkspaceFolders": {}, - "disableDiagnostics": {}, - "disableCompletion": {}, + "disableSnippetCompletion": {}, + "disabledFeatures": {}, + "formatterPriority": {}, "rootPatterns": {}, "requireRootPattern": {}, "ignoredRootPaths": {}, @@ -252,768 +374,1765 @@ "initializationOptions": {}, "stdioEncoding": {}, "settings": {}, - "trace.server": {} + "trace.server": {}, + "trace.server.verbosity": {}, + "trace.server.format": {} } } }, "properties": { - "http.proxy": { + "callHierarchy.enableTooltip": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Enable tooltip to show relative filepath of call hierarchy." + }, + "callHierarchy.openCommand": { "type": "string", - "default": "", - "description": "http proxy uri, used for extensions that send request. Format: proxy-server:1234 or user:password@prox-server:1234 with auth support" + "scope": "application", + "default": "edit", + "description": "Open command for callHierarchy tree view." }, - "http.proxyStrictSSL": { - "type": "boolean", - "default": true + "callHierarchy.splitCommand": { + "type": "string", + "scope": "application", + "default": "botright 30vs", + "description": "Window split command used by callHierarchy tree view." }, - "https.rejectUnauthorized": { + "coc.preferences.bracketEnterImprove": { "type": "boolean", + "scope": "language-overridable", + "description": "Improve enter inside bracket `<> {} [] ()` by add new empty line below and place cursor to it. Works with `coc#on_enter()`", "default": true }, - "npm.binPath": { - "type": "string", - "default": "npm", - "description": "Command or absolute path to npm or yarn." - }, - "suggest.enablePreselect": { + "coc.preferences.currentFunctionSymbolAutoUpdate": { "type": "boolean", - "description": "Enable preselect feature, only works on neovim", + "scope": "language-overridable", + "description": "Automatically update the value of b:coc_current_function on CursorHold event", "default": false }, - "suggest.maxPreviewWidth": { - "type": "number", - "default": 80, - "description": "Maximum width of floating preview window." - }, - "suggest.enablePreview": { + "coc.preferences.enableLinkedEditing": { "type": "boolean", - "description": "Add preview option to completeopt, default: false.", - "default": false + "scope": "language-overridable", + "default": false, + "description": "Enable linked editing support." }, - "suggest.floatEnable": { + "coc.preferences.enableMarkdown": { "type": "boolean", - "description": "Enable floating window for documentation when possible.", + "scope": "application", + "description": "Tell the language server that markdown text format is supported, note that markdown text may not rendered as expected.", "default": true }, - "suggest.labelMaxLength": { - "type": "number", - "description": "Max length of abbr that shown as label of complete item.", - "default": 200 - }, - "suggest.detailMaxLength": { - "type": "number", - "description": "Max length of detail that should be shown in popup menu.", - "default": 100 + "coc.preferences.enableMessageDialog": { + "type": "boolean", + "scope": "application", + "default": false, + "description": "Enable messages shown in notification dialog." }, - "suggest.detailField": { - "type": "string", - "default": "menu", - "description": "Where to add the detail in complete item when it's less than max length.", - "enum": ["abbr", "menu", "preview"] + "coc.preferences.excludeImageLinksInMarkdownDocument": { + "type": "boolean", + "description": "Exclude image links from markdown text in float window.", + "scope": "application", + "default": true }, - "suggest.autoTrigger": { + "coc.preferences.extensionUpdateCheck": { "type": "string", - "default": "always", - "description": "How should completion be triggered", - "enum": ["always", "trigger", "none"] - }, - "suggest.languageSourcePriority": { - "type": "number", - "default": 99, - "description": "Priority of language sources." + "scope": "application", + "default": "never", + "description": "Interval for check extension update, could be daily, weekly, never", + "enum": ["daily", "weekly", "never"] }, - "suggest.numberSelect": { + "coc.preferences.floatActions": { "type": "boolean", - "description": "Input number to select complete item, it could wrong when using and to select complete item", - "default": false + "scope": "application", + "description": "Set to false to disable float/popup support for actions menu.", + "default": true }, - "suggest.disableKind": { - "type": "boolean", - "description": "Remove kind field from vim complete item.", - "default": false + "coc.preferences.formatOnSaveFiletypes": { + "type": "array", + "scope": "resource", + "default": [], + "description": "Filetypes that should run format on save.", + "items": { + "type": "string" + } }, - "suggest.disableMenu": { + "coc.preferences.formatOnType": { "type": "boolean", - "description": "Remove menu field from vim complete item.", + "scope": "language-overridable", + "description": "Set to true to enable formatting on typing", "default": false }, - "suggest.disableMenuShortcut": { - "type": "boolean", - "description": "Disable shortcut of completion source in menu.", - "default": false + "coc.preferences.formatOnTypeFiletypes": { + "type": "array", + "default": [], + "scope": "resource", + "description": "Filetypes that should run format on typing. Only take effect when `coc.preferences.formatOnType` set `true`", + "items": { + "type": "string" + } }, - "suggest.snippetIndicator": { + "coc.preferences.jumpCommand": { + "anyOf": [ + { + "type": "string", + "enum": [ + "edit", + "split", + "vsplit", + "tabe", + "drop", + "tab drop", + "pedit" + ] + }, + { "type": "string", "minimum": 1 } + ], + "scope": "application", + "description": "Command used for location jump, like goto definition, goto references etc. Can be also a custom command that gives file as an argument.", + "default": "edit" + }, + "coc.preferences.maxFileSize": { "type": "string", - "default": "~", - "description": "The character used in abbr of complete item to indicate the item could be expand as snippet." + "scope": "application", + "default": "10MB", + "description": "Maximum file size in bytes that coc.nvim should handle, default '10MB'" }, - "suggest.maxCompleteItemCount": { - "type": "number", - "default": 50, - "description": "Maximum number of complete items shown in vim" + "coc.preferences.messageLevel": { + "type": "string", + "scope": "application", + "description": "Message level for filter echoed messages, could be 'more', 'warning' and 'error'", + "default": "more", + "enum": ["more", "warning", "error"] }, - "suggest.preferCompleteThanJumpPlaceholder": { + "coc.preferences.promptInput": { "type": "boolean", - "description": "Confirm completion instead of jump to next placeholder when completion is activated.", - "default": false + "description": "Use prompt buffer in float window for user input.", + "scope": "application", + "default": true }, - "suggest.fixInsertedWord": { + "coc.preferences.renameFillCurrent": { "type": "boolean", - "description": "Make inserted word replace word characters after cursor position.", - "default": true + "scope": "application", + "default": true, + "description": "Disable to stop Refactor-Rename float/popup window from populating with old name in the New Name field." }, - "suggest.localityBonus": { + "coc.preferences.rootPatterns": { + "type": "array", + "default": [".git", ".hg", ".projections.json"], + "scope": "application", + "description": "Root patterns to resolve workspaceFolder from parent folders of opened files, resolved from up to down.", + "items": { + "type": "string" + } + }, + "coc.preferences.silentAutoupdate": { "type": "boolean", - "description": "Boost suggestions that appear closer to the cursor position.", + "description": "Not open split window with update status when performing auto update.", + "scope": "application", "default": true }, - "suggest.triggerAfterInsertEnter": { + "coc.preferences.useQuickfixForLocations": { "type": "boolean", - "description": "Trigger completion after InsertEnter, auto trigger should be 'always' to enable this option", + "scope": "application", + "description": "Use vim's quickfix list for jump locations,\n need restart on change.", "default": false }, - "suggest.timeout": { + "coc.preferences.watchmanPath": { + "type": "string", + "scope": "application", + "description": "executable path for https://facebook.github.io/watchman/, detected from $PATH by default", + "default": null + }, + "coc.preferences.willSaveHandlerTimeout": { "type": "integer", - "default": 5000, - "minimum": 500, - "maximum": 15000, - "description": "Timeout for completion, in miliseconds." + "scope": "application", + "default": 500, + "minimum": 200, + "maximum": 5000, + "description": "Will save handler timeout" }, - "suggest.minTriggerInputLength": { - "type": "number", - "default": 1, - "description": "Mininal input length for trigger completion, default 1" + "coc.source.around.disableSyntaxes": { + "type": "array", + "default": [], + "scope": "application", + "items": { + "type": "string" + } }, - "suggest.triggerCompletionWait": { + "coc.source.around.enable": { + "type": "boolean", + "scope": "application", + "default": true + }, + "coc.source.around.priority": { "type": "integer", - "default": 60, - "minimum": 50, - "maximum": 300, - "description": "Wait time between trigger character type and completion start, for wait server content synchronize." + "scope": "application", + "default": 1 }, - "suggest.echodocSupport": { - "type": "boolean", - "default": false, - "description": "When enabled, add function signature to user_data.signature to support echodoc.vim" + "coc.source.around.shortcut": { + "type": "string", + "scope": "application", + "default": "A" }, - "suggest.acceptSuggestionOnCommitCharacter": { - "type": "boolean", - "default": false, - "description": "Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character. Requires CompleteChanged event to work." + "coc.source.buffer.disableSyntaxes": { + "type": "array", + "default": [], + "scope": "application", + "items": { + "type": "string" + } }, - "suggest.noselect": { + "coc.source.buffer.enable": { "type": "boolean", - "description": "Not make vim select first item on completion start", + "scope": "application", "default": true }, - "suggest.keepCompleteopt": { + "coc.source.buffer.ignoreGitignore": { "type": "boolean", - "description": "When enabled, completeopt is not overriden, auto completion will be disabled if completeopt doesn't have noinsert and noselect.", - "default": false + "default": true, + "scope": "application", + "description": "Ignore git ignored files for buffer words" }, - "suggest.lowPrioritySourceLimit": { + "coc.source.buffer.priority": { "type": "integer", - "minimum": 1, - "maximum": 100, - "description": "Max items count for source priority lower than 90." + "scope": "application", + "default": 1 }, - "suggest.highPrioritySourceLimit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "description": "Max items count for source priority bigger than or equal to 90." + "coc.source.buffer.shortcut": { + "type": "string", + "scope": "application", + "default": "B" }, - "suggest.removeDuplicateItems": { + "coc.source.file.disableSyntaxes": { + "type": "array", + "default": [], + "scope": "application", + "items": { + "type": "string" + } + }, + "coc.source.file.enable": { "type": "boolean", - "description": "Remove completion items with duplicated word for all sources, snippet items are excluded.", - "default": false + "scope": "application", + "default": true }, - "suggest.defaultSortMethod": { - "type": "string", - "description": "Default sorting behavior for suggested completion items.", - "default": "length", - "enum": ["length", "alphabetical"] + "coc.source.file.ignoreHidden": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Ignore completion for hidden files" }, - "suggest.completionItemKindLabels": { - "type": "object", - "default": {}, - "description": "Set custom labels to completion items' kinds.", - "properties": { - "text": { "type": "string" }, - "method": { "type": "string" }, - "function": { "type": "string" }, - "constructor": { "type": "string" }, - "field": { "type": "string" }, - "variable": { "type": "string" }, - "class": { "type": "string" }, - "interface": { "type": "string" }, - "module": { "type": "string" }, - "property": { "type": "string" }, - "unit": { "type": "string" }, - "value": { "type": "string" }, - "enum": { "type": "string" }, - "keyword": { "type": "string" }, - "snippet": { "type": "string" }, - "color": { "type": "string" }, - "file": { "type": "string" }, - "reference": { "type": "string" }, - "folder": { "type": "string" }, - "enumMember": { "type": "string" }, - "constant": { "type": "string" }, - "struct": { "type": "string" }, - "event": { "type": "string" }, - "operator": { "type": "string" }, - "typeParameter": { "type": "string" }, - "default": { "type": "string" } - }, - "additionalProperties": false + "coc.source.file.ignorePatterns": { + "type": "array", + "scope": "application", + "default": [], + "description": "Ignore patterns of matcher", + "items": { + "type": "string" + } }, - "suggest.invalidInsertCharacters": { + "coc.source.file.priority": { + "type": "integer", + "scope": "application", + "default": 10 + }, + "coc.source.file.shortcut": { + "type": "string", + "scope": "application", + "default": "F" + }, + "coc.source.file.triggerCharacters": { "type": "array", + "default": ["/", "\\"], + "scope": "application", "items": { "type": "string" - }, - "description": "Invalid character for strip valid word when inserting text of complete item.", - "default": [" ", "(", "<", "{", "[", "\r", "\n"] + } }, - "suggest.asciiCharactersOnly": { - "type": "boolean", - "description": "Suggest ASCII characters only", - "default": false + "coc.source.file.trimSameExts": { + "type": "array", + "scope": "application", + "default": [".ts", ".js"], + "description": "Trim same extension on file completion", + "items": { + "type": "string" + } }, - "diagnostic.enable": { + "codeLens.enable": { "type": "boolean", - "description": "Set to false to disable diagnostic display", - "default": true + "scope": "language-overridable", + "description": "Enable codeLens feature, require neovim with set virtual text feature.", + "default": false }, - "diagnostic.level": { + "codeLens.position": { "type": "string", - "description": "Used for filter diagnostics by diagnostic severity.", - "default": "hint", - "enum": ["hint", "information", "warning", "error"] + "scope": "resource", + "enum": ["top", "eol", "right_align"], + "description": "Position of codeLens, requires nvim >= 0.6.0", + "default": "top" }, - "diagnostic.checkCurrentLine": { - "type": "boolean", - "description": "When enabled, show all diagnostics of current line if there are none at the current position.", - "default": false + "codeLens.separator": { + "type": "string", + "scope": "resource", + "description": "Separator text for codeLens in virtual text", + "default": "" }, - "diagnostic.messageTarget": { + "codeLens.subseparator": { "type": "string", - "description": "Diagnostic message target.", - "default": "float", - "enum": ["echo", "float"] + "scope": "resource", + "description": "Subseparator between codeLenses in virtual text", + "default": " " }, - "diagnostic.messageDelay": { + "colors.filetypes": { + "type": "array", + "default": [], + "scope": "resource", + "description": "Filetypes that should be enabled for colors highlight feature, use \"*\" for all filetypes.", + "items": { + "type": "string" + } + }, + "colors.highlightPriority": { "type": "number", - "description": "How long to wait (in milliseconds) before displaying the diagnostic message with echo or float", - "default": 250 + "scope": "resource", + "description": "Priority for colors highlights, works on vim8 and neovim >= 0.6.0", + "default": 1000, + "maximum": 4096 + }, + "cursors.cancelKey": { + "type": "string", + "scope": "application", + "default": "", + "description": "Key used for cancel cursors session." + }, + "cursors.nextKey": { + "type": "string", + "scope": "application", + "default": "", + "description": "Key used for jump to next cursors position." + }, + "cursors.previousKey": { + "type": "string", + "scope": "application", + "default": "", + "description": "Key used for jump to previous cursors position." }, - "diagnostic.joinMessageLines": { + "cursors.wrapscan": { "type": "boolean", - "description": "Join lines messages to reduce lines of floating window.", - "default": false + "scope": "application", + "default": true, + "description": "Searches wrap around the first or last cursors range." }, - "diagnostic.refreshOnInsertMode": { + "diagnostic.autoRefresh": { "type": "boolean", - "description": "Enable diagnostic refresh on insert mode, default false.", - "default": false + "scope": "language-overridable", + "description": "Enable automatically refresh diagnostics, use diagnosticRefresh action when it's disabled.", + "default": true }, - "diagnostic.refreshAfterSave": { + "diagnostic.checkCurrentLine": { "type": "boolean", - "description": "Only refresh diagnostics after save, default false.", + "scope": "language-overridable", + "description": "When enabled, show all diagnostics of current line if there are none at the current position.", "default": false }, "diagnostic.displayByAle": { "type": "boolean", + "scope": "language-overridable", "description": "Use Ale for display diagnostics in vim, will disable coc for display diagnostics, restart required on change.", "default": false }, - "diagnostic.virtualText": { - "type": "boolean", - "description": "Use NeoVim virtual text to display diagnostics", - "default": false - }, - "diagnostic.virtualTextPrefix": { - "type": "string", - "description": "The prefix added virtual text diagnostics", - "default": " " - }, - "diagnostic.virtualTextLines": { - "type": "number", - "description": "The number of non empty lines from a diagnostic to display", - "default": 3 - }, - "diagnostic.virtualTextLineSeparator": { - "type": "string", - "description": "The text that will mark a line end from the diagnostic message", - "default": " \\ " - }, - "diagnostic.enableSign": { + "diagnostic.enable": { "type": "boolean", - "default": true, - "description": "Enable signs for diagnostics." + "scope": "language-overridable", + "description": "Set to false to disable diagnostic display", + "default": true }, "diagnostic.enableHighlightLineNumber": { "type": "boolean", + "scope": "application", "default": true, - "description": "Enable highlighting line numbers for diagnostics, only works with neovim and diagnostic.enableSign is true." + "description": "Enable highlighting line numbers for diagnostics, only works with neovim." }, "diagnostic.enableMessage": { "type": "string", + "scope": "application", "default": "always", - "description": "When to enable echo messages of diagnostics.", + "description": "When to enable show messages of diagnostics.", "enum": ["always", "jump", "never"] }, - "diagnostic.locationlist": { + "diagnostic.enableSign": { "type": "boolean", - "description": "Create location list for error & warning", - "default": true + "scope": "language-overridable", + "default": true, + "description": "Enable signs for diagnostics." + }, + "diagnostic.errorSign": { + "type": "string", + "scope": "application", + "description": "Text of error sign", + "default": ">>" + }, + "diagnostic.filetypeMap": { + "type": "object", + "scope": "application", + "description": "A map between buffer filetype and the filetype assigned to diagnostics. To syntax highlight diagnostics with their parent buffer type use `\"default\": \"bufferType\"`", + "default": {} + }, + "diagnostic.floatConfig": { + "type": "object", + "scope": "application", + "description": "Configure float window style of diagnostic message.", + "allOf": [{ "$ref": "#/definitions/float" }], + "additionalProperties": false, + "properties": { + "border": {}, + "rounded": {}, + "highlight": {}, + "borderhighlight": {}, + "title": {}, + "close": {}, + "maxHeight": {}, + "maxWidth": {}, + "winblend": {}, + "focusable": {}, + "shadow": {} + } + }, + "diagnostic.format": { + "type": "string", + "scope": "language-overridable", + "description": "Define the diagnostic format that shown in float window or echoed, available parts: source, code, severity, message", + "default": "%message (%source%code)" }, - "diagnostic.highlightOffset": { + "diagnostic.highlightLimit": { "type": "number", - "description": "Offset number of buffer.addHighlight, neovim only.", + "scope": "language-overridable", + "description": "Limit count for highlighted diagnostics, too many diagnostic highlights could make vim stop responding", "default": 1000 }, - "diagnostic.signOffset": { + "diagnostic.highlightPriority": { "type": "number", - "description": "Offset number of sign", - "default": 1000 + "scope": "language-overridable", + "description": "Priority for diagnostic highlights, works on vim8 and neovim >= 0.6.0", + "default": 4096, + "maximum": 4096, + "minimum": 110 }, - "diagnostic.errorSign": { + "diagnostic.hintSign": { "type": "string", - "description": "Text of error sign", + "scope": "application", + "description": "Text of hint sign", "default": ">>" }, - "diagnostic.warningSign": { - "type": "string", - "description": "Text of warning sign", - "default": "⚠" - }, "diagnostic.infoSign": { "type": "string", + "scope": "application", "description": "Text of info sign", "default": ">>" }, - "diagnostic.hintSign": { + "diagnostic.level": { "type": "string", - "description": "Text of hint sign", - "default": ">>" + "scope": "resource", + "description": "Used for filter diagnostics by diagnostic severity.", + "default": "hint", + "enum": ["hint", "information", "warning", "error"] }, - "diagnostic.maxWindowHeight": { - "type": "number", - "description": "Maximum height of diagnostics floating window.", - "default": 8 + "diagnostic.locationlistLevel": { + "type": ["string", "null"], + "scope": "language-overridable", + "description": "Filter diagnostics in locationlist.", + "default": null, + "enum": ["hint", "information", "warning", "error"] }, - "diagnostic.maxWindowWidth": { + "diagnostic.locationlistUpdate": { + "type": "boolean", + "scope": "language-overridable", + "description": "Update locationlist on diagnostics change, only works with locationlist opened by :CocDiagnostics command and first window of associated buffer.", + "default": true + }, + "diagnostic.messageDelay": { "type": "number", - "description": "Maximum width of diagnostics floating window.", - "default": 80 + "scope": "application", + "description": "How long to wait (in milliseconds) before displaying the diagnostic message with echo or float", + "default": 200 }, - "diagnostic.filetypeMap": { - "type": "object", - "description": "A map between buffer filetype and the filetype assigned to diagnostics. To syntax highlight diagnostics withs their parent buffer type use '\"default\": \"bufferType\"'", - "default": {} + "diagnostic.messageLevel": { + "type": ["string", "null"], + "scope": "language-overridable", + "description": "Filter diagnostic message in float window/popup.", + "default": null, + "enum": ["hint", "information", "warning", "error"] }, - "diagnostic.format": { + "diagnostic.messageTarget": { "type": "string", - "description": "Define the diagnostic format. Available parts: source, code, severity, message", - "default": "[%source%code] [%severity] %message" + "scope": "language-overridable", + "description": "Diagnostic message target.", + "default": "float", + "enum": ["echo", "float"] }, - "diagnostic.separateRelatedInformationAsDiagnostics": { + "diagnostic.refreshOnInsertMode": { "type": "boolean", - "default": false, - "description": "Separate related information as diagnostics" + "scope": "language-overridable", + "description": "Enable diagnostic refresh on insert mode, default false.", + "default": false }, - "signature.enable": { + "diagnostic.separateRelatedInformationAsDiagnostics": { "type": "boolean", - "description": "Enable signature help when trigger character typed, require restart service on change.", - "default": true - }, - "signature.triggerSignatureWait": { - "type": "integer", - "default": 50, - "minimum": 50, - "maximum": 300, - "description": "Timeout for trigger signature help, in miliseconds." - }, - "signature.target": { - "type": "string", - "description": "Target of signature help, use float when possible by default.", - "enum": ["float", "echo"] - }, - "signature.floatMaxWidth": { - "type": "integer", - "default": 60, - "description": "Max width of signature float window." + "default": false, + "scope": "application", + "description": "Separate related information as diagnostics." }, - "signature.preferShownAbove": { + "diagnostic.showDeprecated": { "type": "boolean", - "description": "Show signature help float window above cursor when possible, require restart service on change.", - "default": true + "default": true, + "scope": "language-overridable", + "description": "Show diagnostics with deprecated tag." }, - "signature.hideOnTextChange": { + "diagnostic.showUnused": { "type": "boolean", - "description": "Hide signature float window when text changed, require restart service on change.", - "default": false + "default": true, + "scope": "language-overridable", + "description": "Show diagnostics with unused tag, affects highlight, sign, virtual text, message" + }, + "diagnostic.signLevel": { + "type": ["string", "null"], + "scope": "language-overridable", + "description": "Filter diagnostics displayed in signcolumn.", + "default": null, + "enum": ["hint", "information", "warning", "error"] }, - "signature.maxWindowHeight": { + "diagnostic.signPriority": { "type": "number", - "description": "Maximum height of floating signature help window.", - "default": 8 + "scope": "resource", + "description": "Priority of diagnostic signs, default to 10", + "default": 10 }, - "codeLens.enable": { + "diagnostic.virtualText": { "type": "boolean", - "description": "Enable codeLens feature, require neovim with set virtual text feature.", + "scope": "language-overridable", + "description": "Use virtual text to display diagnostics, requires neovim >= 0.5.0 or vim >= 9.0.0067.", "default": false }, - "codeLens.separator": { - "type": "string", - "description": "Separator text for codeLens in virtual text", - "default": "‣" - }, - "refactor.openCommand": { + "diagnostic.virtualTextAlign": { "type": "string", - "description": "Open command for refactor window.", - "default": "vsplit" + "scope": "language-overridable", + "description": "Position of virtual text, default 'after'. Vim9 only", + "default": "after", + "enum": ["after", "right", "below"] }, - "refactor.beforeContext": { - "type": "number", - "default": 3, - "description": "Print num lines of leading context before each match." + "diagnostic.virtualTextCurrentLineOnly": { + "type": "boolean", + "scope": "language-overridable", + "description": "Only show virtualText diagnostic on current cursor line", + "default": true }, - "refactor.afterContext": { - "type": "number", - "default": 3, - "description": "Print num lines of trailing context after each match." + "diagnostic.virtualTextFormat": { + "type": "string", + "scope": "language-overridable", + "description": "Define the virtual text diagnostic format, available parts: source, code, severity, message", + "default": "%message" + }, + "diagnostic.virtualTextLevel": { + "type": ["string", "null"], + "scope": "language-overridable", + "description": "Filter diagnostic message in virtual text by level", + "default": null, + "enum": ["hint", "information", "warning", "error"] }, - "workspace.ignoredFiletypes": { - "type": "array", - "default": ["markdown", "log", "txt", "help"], - "description": "Filetypes that should be ignored for resolve workspace folder.", - "items": { - "type": "string" - } + "diagnostic.virtualTextLimitInOneLine": { + "type": "integer", + "scope": "language-overridable", + "minimum": 1, + "description": "The maximum number of diagnostic messages to disaply in one line", + "default": 999 }, - "list.indicator": { + "diagnostic.virtualTextLineSeparator": { "type": "string", - "default": ">", - "description": "The characer used as first characer in prompt line" + "scope": "language-overridable", + "description": "The text that will mark a line end from the diagnostic message", + "default": " \\ " }, - "list.interactiveDebounceTime": { + "diagnostic.virtualTextLines": { "type": "number", - "default": 100, - "description": "Debouce time for input change on interactive mode." + "scope": "language-overridable", + "description": "The number of non empty lines from a diagnostic to display", + "default": 3 }, - "list.maxHeight": { + "diagnostic.virtualTextPrefix": { + "type": "string", + "scope": "language-overridable", + "description": "The prefix added virtual text diagnostics", + "default": " " + }, + "diagnostic.virtualTextWinCol": { + "type": ["number", "null"], + "scope": "language-overridable", + "description": "Window column number to align virtual text, neovim only.", + "default": null + }, + "diagnostic.warningSign": { + "type": "string", + "scope": "application", + "description": "Text of warning sign", + "default": "⚠" + }, + "dialog.confirmKey": { + "type": "string", + "default": "", + "scope": "application", + "description": "Confirm key for confirm selection used by menu and picker, you can always use to cancel." + }, + "dialog.floatBorderHighlight": { + "type": ["string", "null"], + "default": null, + "scope": "application", + "description": "Highlight group for border of dialog window/popup, default to 'CocFloating'" + }, + "dialog.floatHighlight": { + "type": ["string", "null"], + "default": null, + "scope": "application", + "description": "Highlight group for dialog window/popup, default to 'CocFloating'" + }, + "dialog.maxHeight": { "type": "number", - "default": 10, - "description": "Maximum height of list window." + "default": 30, + "scope": "application", + "description": "Maximum height of dialog window." }, - "list.signOffset": { + "dialog.maxWidth": { "type": "number", - "default": 900, - "description": "Sign offset of list, should be different from other plugins." + "default": 80, + "scope": "application", + "description": "Maximum width of dialog window." }, - "list.selectedSignText": { + "dialog.pickerButtonShortcut": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Show shortcut in buttons of picker dialog window/popup, used when dialog.pickerButtons is true." + }, + "dialog.pickerButtons": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Show buttons for picker dialog window/popup." + }, + "dialog.rounded": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "use rounded border for dialog window." + }, + "dialog.shortcutHighlight": { "type": "string", - "default": "*", - "description": "Sign text for selected lines." + "default": "MoreMsg", + "scope": "application", + "description": "Highlight group for shortcut character in menu dialog, default to 'MoreMsg'" }, - "list.extendedSearchMode": { + "documentHighlight.priority": { + "type": "number", + "default": -1, + "scope": "resource", + "description": "Match priority used by document highlight, see ':h matchadd'" + }, + "documentHighlight.timeout": { + "type": "integer", + "default": 300, + "minimum": 200, + "maximum": 5000, + "scope": "resource", + "description": "Timeout for document highlight, in milliseconds." + }, + "floatFactory.floatConfig": { + "type": "object", + "scope": "application", + "description": "Configure default style float window/popup created by float factory (created around cursor and automatically closed)", + "allOf": [{ "$ref": "#/definitions/float" }], + "additionalProperties": false, + "properties": { + "border": {}, + "rounded": {}, + "highlight": {}, + "borderhighlight": {}, + "title": {}, + "close": {}, + "maxWidth": {}, + "maxHeight": {}, + "winblend": {}, + "focusable": {}, + "shadow": {} + } + }, + "hover.autoHide": { "type": "boolean", + "scope": "application", "default": true, - "description": "Enable extended search mode which allows multiple search patterns delimited by spaces." + "description": "Automatically hide hover float window on CursorMove or InsertEnter." }, - "list.autoResize": { + "hover.floatConfig": { + "type": "object", + "scope": "application", + "description": "Configure float window style of hover documents.", + "allOf": [{ "$ref": "#/definitions/float" }], + "additionalProperties": false, + "properties": { + "border": {}, + "rounded": {}, + "highlight": {}, + "borderhighlight": {}, + "title": {}, + "close": {}, + "maxHeight": {}, + "maxWidth": {}, + "winblend": {}, + "focusable": {}, + "shadow": {} + } + }, + "hover.previewMaxHeight": { + "type": "number", + "scope": "resource", + "default": 12, + "description": "Max height of preview window for hover." + }, + "hover.target": { + "type": "string", + "default": "float", + "scope": "resource", + "description": "Target to show hover information, default is floating window when possible.", + "enum": ["preview", "echo", "float"] + }, + "http.proxy": { + "type": "string", + "default": "", + "pattern": "^https?://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$", + "description": "The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables.", + "scope": "application" + }, + "http.proxyAuthorization": { + "type": ["null", "string"], + "description": "The value to send as the `Proxy-Authorization` header for every network request.", + "default": null, + "scope": "application" + }, + "http.proxyCA": { + "type": "string", + "description": "CA (file) to use as Certificate Authority", + "default": null, + "scope": "application" + }, + "http.proxyStrictSSL": { "type": "boolean", + "description": "Controls whether the proxy server certificate should be verified against the list of supplied CAs", "default": true, - "description": "Enable auto resize feature." + "scope": "application" }, - "list.limitLines": { + "inlayHint.enable": { + "type": "boolean", + "default": true, + "scope": "language-overridable", + "description": "Enable inlay hint support" + }, + "inlayHint.enableParameter": { + "type": "boolean", + "scope": "language-overridable", + "default": true, + "description": "Enable inlay hints for parameters." + }, + "inlayHint.display": { + "type": "boolean", + "scope": "language-overridable", + "default": true, + "description": "Display inlay hints." + }, + "inlayHint.filetypes": { + "type": ["array", "null"], + "scope": "application", + "description": "Filetypes that enable inlayHint, all filetypes are enabled by default", + "deprecationMessage": "Use inlayHint.enable with language scope instead", + "default": null, + "items": { + "type": "string" + } + }, + "inlayHint.parameterSeparator": { + "type": "string", + "scope": "language-overridable", + "default": "", + "description": "Separator for parameter inlay hint, neovim only." + }, + "inlayHint.refreshOnInsertMode": { + "type": "boolean", + "default": false, + "scope": "language-overridable", + "description": "Refresh inlayHints on insert mode." + }, + "inlayHint.subSeparator": { + "type": "string", + "scope": "language-overridable", + "default": " ", + "description": "Separator for chained inlay hints, neovim only." + }, + "inlayHint.typeSeparator": { + "type": "string", + "scope": "language-overridable", + "default": "", + "description": "Separator for type inlay hint, neovim only." + }, + "links.tooltip": { + "type": "boolean", + "scope": "application", + "description": "Show tooltip of link under cursor on CursorHold, neovim only", + "default": false + }, + "list.alignColumns": { + "type": "boolean", + "default": false, + "scope": "application", + "description": "Whether to align lists in columns, default: `false`" + }, + "list.extendedSearchMode": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Enable extended search mode which allows multiple search patterns delimited by spaces." + }, + "list.height": { + "type": "number", + "scope": "application", + "default": 10, + "description": "Height of split list window." + }, + "list.indicator": { + "type": "string", + "default": ">", + "scope": "application", + "description": "The character used as first character in prompt line." + }, + "list.insertMappings": { + "type": "object", + "scope": "application", + "default": {}, + "description": "Custom keymappings on insert mode." + }, + "list.interactiveDebounceTime": { "type": "number", - "default": 30000, + "default": 100, + "scope": "application", + "description": "Debounce time for input change on interactive mode." + }, + "list.limitLines": { + "type": ["number", "null"], + "scope": "application", + "default": null, "description": "Limit lines for list buffer." }, "list.maxPreviewHeight": { "type": "number", + "scope": "application", "default": 12, "description": "Max height for preview window of list." }, - "list.previewSplitRight": { + "list.menuAction": { "type": "boolean", "default": false, - "description": "Use vsplit for preview window." + "scope": "application", + "description": "Use menu picker instead of confirm() for choose action." + }, + "list.nextKeymap": { + "type": "string", + "scope": "application", + "default": "", + "description": "Key used for select next line on insert mode." + }, + "list.normalMappings": { + "type": "object", + "scope": "application", + "default": {}, + "description": "Custom keymappings on normal mode." }, "list.previewHighlightGroup": { "type": "string", + "scope": "application", "default": "Search", "description": "Highlight group used for highlight the range in preview window." }, - "list.nextKeymap": { + "list.previewSplitRight": { + "type": "boolean", + "scope": "application", + "default": false, + "description": "Use vsplit for preview window." + }, + "list.previewToplineOffset": { + "type": "number", + "scope": "application", + "default": 3, + "description": "Topline offset for list previews" + }, + "list.previewToplineStyle": { + "type": "string", + "scope": "application", + "default": "offset", + "description": "Topline style for list previews", + "enum": ["offset", "middle"] + }, + "list.previousKeymap": { + "type": "string", + "scope": "application", + "default": "", + "description": "Key used for select previous line on insert mode." + }, + "list.selectedSignText": { + "type": "string", + "scope": "application", + "default": "*", + "description": "Sign text for selected lines." + }, + "list.signOffset": { + "type": "number", + "scope": "application", + "default": 900, + "description": "Sign offset of list, should be different from other plugins." + }, + "list.smartCase": { + "type": "boolean", + "default": false, + "scope": "application", + "description": "Use smartcase match for fuzzy match and strict match, --ignore-case will be ignored, may not affect interactive list." + }, + "list.source.diagnostics.includeCode": { + "type": "boolean", + "scope": "application", + "description": "Whether to show the diagnostic code in the list.", + "default": true + }, + "list.source.diagnostics.pathFormat": { + "type": "string", + "scope": "application", + "description": "Decide how the filepath is shown in the list.", + "enum": ["full", "short", "filename", "hidden"], + "default": "full" + }, + "list.source.outline.ctagsFiletypes": { + "type": "array", + "scope": "application", + "default": [], + "description": "Filetypes that should use ctags for outline instead of language server.", + "items": { + "type": "string" + } + }, + "list.source.symbols.excludes": { + "type": "array", + "scope": "application", + "default": [], + "description": "Patterns of minimatch for filepath to exclude from symbols list.", + "items": { + "type": "string" + } + }, + "list.statusLineSegments": { + "type": ["array", "null"], + "scope": "application", + "default": [ + "%#CocListMode#-- %{coc#list#status(\"mode\")} --%*", + "%{coc#list#status(\"loading\")}", + "%{coc#list#status(\"args\")}", + "(%L/%{coc#list#status(\"total\")})", + "%=", + "%#CocListPath# %{coc#list#status(\"cwd\")} %l/%L%*" + ], + "items": { + "types": "string" + }, + "description": "An array of statusline segments that will be used to draw the status line for list windows." + }, + "notification.statusLineProgress": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Show progress notification in status line, instead of float window/popup." + }, + "notification.border": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Enable rounded border for notification windows." + }, + "notification.disabledProgressSources": { + "type": "array", + "default": [], + "scope": "application", + "description": "Sources that should be disabled for message progress, use * to disable all message only progresses", + "items": { + "type": "string" + } + }, + "notification.focusable": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Enable focus by user actions (wincmds, mouse events), neovim only." + }, + "notification.highlightGroup": { + "type": "string", + "default": "Normal", + "scope": "application", + "description": "Highlight group of notification dialog." + }, + "notification.marginRight": { + "type": "integer", + "default": 10, + "scope": "application", + "description": "Margin right to the right of editor window." + }, + "notification.maxHeight": { + "type": "integer", + "default": 10, + "scope": "application", + "description": "Maximum content height of notification dialog." + }, + "notification.maxWidth": { + "type": "integer", + "default": 60, + "scope": "application", + "description": "Maximum content width of notification dialog." + }, + "notification.minProgressWidth": { + "type": "integer", + "default": 30, + "scope": "application", + "description": "Minimal with of progress notification." + }, + "notification.timeout": { + "type": "integer", + "default": 10000, + "scope": "application", + "description": "Timeout for auto close notifications, in milliseconds." + }, + "notification.winblend": { + "type": "integer", + "default": 30, + "minimum": 0, + "maximum": 100, + "scope": "application", + "description": "Winblend option of notification window, neovim only." + }, + "npm.binPath": { + "type": "string", + "scope": "application", + "default": "npm", + "description": "Command or absolute path to npm or yarn." + }, + "outline.autoPreview": { + "type": "boolean", + "scope": "application", + "default": false, + "description": "Enable auto preview on cursor move." + }, + "outline.autoWidth": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Automatically increase window width to avoid wrapped lines." + }, + "outline.checkBufferSwitch": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Recreate outline view after user changed to another buffer on current tab." + }, + "outline.codeActionKinds": { + "type": "array", + "scope": "application", + "default": ["", "quickfix", "refactor"], + "description": "Filter code actions in actions menu by kinds.", + "items": { + "type": "string", + "enum": ["", "quickfix", "refactor", "source"] + } + }, + "outline.detailAsDescription": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Show detail as description aside with label, when false detail will be shown in tooltip on cursor hold." + }, + "outline.expandLevel": { + "type": "number", + "scope": "application", + "default": 1, + "description": "Expand level of tree nodes." + }, + "outline.followCursor": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Reveal item in outline tree on cursor hold." + }, + "outline.keepWindow": { + "type": "boolean", + "scope": "application", + "default": false, + "description": "Jump back to original window after outline is shown." + }, + "outline.previewBorder": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Use border for preview window." + }, + "outline.previewBorderHighlightGroup": { + "type": "string", + "scope": "application", + "default": "Normal", + "description": "Border highlight group of preview window." + }, + "outline.previewBorderRounded": { + "type": "boolean", + "scope": "application", + "default": false, + "description": "Use rounded border for preview window." + }, + "outline.previewHighlightGroup": { + "type": "string", + "scope": "application", + "default": "Normal", + "description": "Highlight group of preview window." + }, + "outline.previewMaxWidth": { + "type": "number", + "scope": "application", + "default": 80, + "description": "Max width of preview window." + }, + "outline.previewWinblend": { + "type": "integer", + "scope": "application", + "default": 0, + "minimum": 0, + "maximum": 100, + "description": "Enables pseudo-transparency by set 'winblend' option of window, neovim only." + }, + "outline.showLineNumber": { + "type": "boolean", + "scope": "application", + "default": true, + "description": "Show line number of symbols." + }, + "outline.sortBy": { + "type": "string", + "scope": "application", + "default": "category", + "description": "Sort method for symbols.", + "enum": ["position", "name", "category"] + }, + "outline.splitCommand": { + "type": "string", + "scope": "application", + "default": "botright 30vs", + "description": "Window split command used by outline." + }, + "outline.switchSortKey": { + "type": "string", + "scope": "application", + "default": "", + "description": "The key used to switch sort method for symbols provider of current tree view." + }, + "outline.togglePreviewKey": { + "type": "string", + "scope": "application", + "default": "p", + "description": "The key used to toggle auto preview feature." + }, + "pullDiagnostic.ignored": { + "type": "array", + "default": [], + "scope": "application", + "description": "Minimatch patterns to match full filepath that should be ignored for pullDiagnostic.", + "items": { + "type": "string" + } + }, + "pullDiagnostic.onChange": { + "type": "boolean", + "default": true, + "scope": "language-overridable", + "description": "Whether to pull for diagnostics on document change." + }, + "pullDiagnostic.onSave": { + "type": "boolean", + "default": false, + "scope": "language-overridable", + "description": "Whether to pull for diagnostics on document save." + }, + "pullDiagnostic.workspace": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Whether to pull for workspace diagnostics when possible." + }, + "refactor.afterContext": { + "type": "number", + "scope": "application", + "default": 3, + "description": "Print num lines of trailing context after each match." + }, + "refactor.beforeContext": { + "type": "number", + "scope": "application", + "default": 3, + "description": "Print num lines of leading context before each match." + }, + "refactor.openCommand": { + "type": "string", + "scope": "application", + "description": "Open command for refactor window.", + "default": "vsplit" + }, + "refactor.saveToFile": { + "type": "boolean", + "scope": "application", + "description": "Save changed buffer to file when write refactor buffer with ':noa wa' command.", + "default": true + }, + "refactor.showMenu": { + "type": "string", + "scope": "application", + "default": "", + "description": "Refactor buffer local mapping to bring up menu for this chunk." + }, + "semanticTokens.combinedModifiers": { + "type": "array", + "scope": "language-overridable", + "description": "Semantic token modifiers that should have highlight combined with syntax highlights.", + "default": ["deprecated"], + "items": { + "type": "string" + } + }, + "semanticTokens.enable": { + "type": "boolean", + "default": false, + "scope": "language-overridable", + "description": "Enable semantic tokens support" + }, + "semanticTokens.filetypes": { + "type": ["array", "null"], + "scope": "resource", + "description": "Filetypes that enable semantic tokens highlighting or [\"*\"] for any filetype", + "deprecationMessage": "Use semanticTokens.enable with language scope instead", + "default": null, + "items": { + "type": "string" + } + }, + "semanticTokens.highlightPriority": { + "type": "number", + "scope": "language-overridable", + "description": "Priority for semantic tokens highlight.", + "default": 2048, + "maximum": 4096 + }, + "semanticTokens.incrementTypes": { + "type": "array", + "scope": "language-overridable", + "description": "Semantic token types that should increase highlight when insert at the start and end position of token.", + "default": ["variable", "string", "parameter"], + "items": { + "type": "string" + } + }, + "signature.enable": { + "type": "boolean", + "scope": "language-overridable", + "description": "Enable show signature help when trigger character typed.", + "default": true + }, + "signature.floatConfig": { + "type": "object", + "scope": "application", + "description": "Configure float window style of signature documents.", + "allOf": [{ "$ref": "#/definitions/float" }], + "additionalProperties": false, + "properties": { + "border": {}, + "rounded": {}, + "highlight": {}, + "borderhighlight": {}, + "title": {}, + "close": {}, + "maxHeight": {}, + "maxWidth": {}, + "winblend": {}, + "focusable": {}, + "shadow": {} + } + }, + "signature.hideOnTextChange": { + "type": "boolean", + "scope": "language-overridable", + "description": "Hide signature float window when text changed on insert mode.", + "default": false + }, + "signature.preferShownAbove": { + "type": "boolean", + "scope": "application", + "description": "Show signature help float window above cursor when possible, require restart service on change.", + "default": true + }, + "signature.target": { + "type": "string", + "scope": "language-overridable", + "description": "Target of signature help, use float when possible by default.", + "default": "float", + "enum": ["float", "echo"] + }, + "signature.triggerSignatureWait": { + "type": "integer", + "scope": "language-overridable", + "default": 500, + "minimum": 200, + "maximum": 1000, + "description": "Timeout for trigger signature help, in milliseconds." + }, + "snippet.choicesMenuPicker": { + "type": "boolean", + "scope": "resource", + "description": "Use menu picker instead of popup menu for choices placeholder.", + "default": false + }, + "snippet.highlight": { + "type": "boolean", + "scope": "resource", + "description": "Use highlight group 'CocSnippetVisual' to highlight placeholders with same index of current one.", + "default": false + }, + "snippet.nextPlaceholderOnDelete": { + "type": "boolean", + "scope": "resource", + "description": "Automatically jump to the next placeholder when the current one is completely deleted.", + "default": false + }, + "snippet.statusText": { + "type": "string", + "scope": "application", + "default": "SNIP", + "description": "Text shown in statusline to indicate snippet session is activated." + }, + "suggest.acceptSuggestionOnCommitCharacter": { + "type": "boolean", + "default": false, + "scope": "language-overridable", + "description": "Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character. Requires CompleteChanged event to work." + }, + "suggest.asciiCharactersOnly": { + "type": "boolean", + "description": "Trigger suggest with ASCII characters only", + "scope": "language-overridable", + "default": false + }, + "suggest.asciiMatch": { + "type": "boolean", + "description": "Convert unicode characters to ascii for match", + "scope": "language-overridable", + "default": true + }, + "suggest.autoTrigger": { + "type": "string", + "scope": "language-overridable", + "default": "always", + "description": "How should completion be triggered", + "enum": ["always", "trigger", "none"] + }, + "suggest.completionItemKindLabels": { + "type": "object", + "default": {}, + "scope": "application", + "description": "Set custom labels to completion items' kinds.", + "properties": { + "text": { "type": "string" }, + "method": { "type": "string" }, + "function": { "type": "string" }, + "constructor": { "type": "string" }, + "field": { "type": "string" }, + "variable": { "type": "string" }, + "class": { "type": "string" }, + "interface": { "type": "string" }, + "module": { "type": "string" }, + "property": { "type": "string" }, + "unit": { "type": "string" }, + "value": { "type": "string" }, + "enum": { "type": "string" }, + "keyword": { "type": "string" }, + "snippet": { "type": "string" }, + "color": { "type": "string" }, + "file": { "type": "string" }, + "reference": { "type": "string" }, + "folder": { "type": "string" }, + "enumMember": { "type": "string" }, + "constant": { "type": "string" }, + "struct": { "type": "string" }, + "event": { "type": "string" }, + "operator": { "type": "string" }, + "typeParameter": { "type": "string" }, + "default": { "type": "string" } + }, + "additionalProperties": false + }, + "suggest.defaultSortMethod": { "type": "string", - "default": "", - "description": "Key used for select next line on insert mode." + "description": "Default sorting behavior for suggested completion items.", + "default": "length", + "scope": "language-overridable", + "enum": ["length", "alphabetical", "none"] }, - "list.previousKeymap": { + "suggest.detailField": { "type": "string", - "default": "", - "description": "Key used for select previous line on insert mode." + "scope": "application", + "default": "preview", + "description": "Where to show the detail text of CompleteItem from LS.", + "enum": ["abbr", "preview"] }, - "list.normalMappings": { - "type": "object", - "default": {}, - "description": "Custom keymappings on normal mode." + "suggest.detailMaxLength": { + "type": "number", + "scope": "application", + "description": "Max length of detail that should be shown in popup menu.", + "deprecationMessage": "Use suggest.labelMaxLength instead.", + "default": 100 }, - "list.insertMappings": { + "suggest.enablePreselect": { + "type": "boolean", + "scope": "application", + "description": "Enable preselect feature of LSP, works when suggest.noselect is false.", + "default": true + }, + "suggest.fixInsertedWord": { + "type": "boolean", + "description": "Make inserted word replace word characters after cursor position.", + "scope": "application", + "default": true + }, + "suggest.floatConfig": { "type": "object", - "default": {}, - "description": "Custom keymappings on insert mode." + "scope": "application", + "description": "Configure style of popup menu and documentation window of completion.", + "allOf": [{ "$ref": "#/definitions/float" }], + "additionalProperties": false, + "properties": { + "border": {}, + "rounded": {}, + "highlight": {}, + "borderhighlight": {}, + "maxWidth": {}, + "winblend": {}, + "shadow": {} + } }, - "list.source.outline.ctagsFilestypes": { + "suggest.formatItems": { "type": "array", - "default": [], - "description": "Filetypes that should use ctags for outline instead of language server.", + "scope": "application", "items": { - "type": "string" - } + "enum": ["abbr", "menu", "kind", "shortcut"] + }, + "contains": { + "enum": ["abbr"] + }, + "uniqueItems": true, + "description": "Items shown in popup menu in order.", + "default": ["abbr", "menu", "kind", "shortcut"] }, - "cursors.cancelKey": { - "type": "string", - "default": "", - "description": "Key used for cancel cursors session." + "suggest.highPrioritySourceLimit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "scope": "language-overridable", + "description": "Max items count for source priority bigger than or equal to 90." }, - "cursors.nextKey": { - "type": "string", - "default": "", - "description": "Key used for jump to next cursors position. " + "suggest.ignoreRegexps": { + "type": "array", + "scope": "language-overridable", + "items": { + "type": "string" + }, + "description": "Regexps to ignore when trigger suggest", + "default": [] }, - "cursors.previousKey": { - "type": "string", - "default": "", - "description": "Key used for jump to previous cursors position." + "suggest.invalidInsertCharacters": { + "type": "array", + "items": { + "type": "string" + }, + "scope": "application", + "description": "Invalid character for strip valid word when inserting text of complete item.", + "default": [" ", "(", "<", "{", "[", "\r", "\n"] }, - "coc.preferences.maxFileSize": { - "type": "string", - "default": "10MB", - "description": "Maximum file size in bytes that coc.nvim should handle, default '10MB'" + "suggest.labelMaxLength": { + "type": "number", + "scope": "application", + "description": "Max length of abbr that shown as label of complete item.", + "default": 200 }, - "coc.preferences.promptWorkspaceEdit": { - "type": "boolean", - "description": "Prompt confirm from user for workspace edit.", - "default": true + "suggest.languageSourcePriority": { + "type": "number", + "default": 99, + "scope": "language-overridable", + "description": "Priority of language sources." }, - "coc.preferences.useQuickfixForLocations": { + "suggest.localityBonus": { "type": "boolean", - "description": "Use vim's quickfix list for jump locations,\n need restart on change.", - "default": false - }, - "coc.preferences.extensionUpdateCheck": { - "type": "string", - "default": "daily", - "description": "Interval for check extension update, could be daily, weekly, never", - "enum": ["daily", "weekly", "never"] + "description": "Controls whether sorting favors words that appear close to the cursor.", + "scope": "language-overridable", + "default": true }, - "coc.preferences.snippetStatusText": { - "type": "string", - "default": "SNIP", - "description": "Text shown in statusline to indicate snippet session is activated." + "suggest.lowPrioritySourceLimit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "scope": "language-overridable", + "description": "Max items count for source priority lower than 90." }, - "coc.preferences.hoverTarget": { - "type": "string", - "description": "Target to show hover information, default is floating window when possible.", - "enum": ["preview", "echo", "float"] + "suggest.maxCompleteItemCount": { + "type": "number", + "default": 50, + "scope": "language-overridable", + "description": "Maximum number of complete items shown in vim" }, - "coc.preferences.colorSupport": { - "type": "boolean", - "description": "Enable color highlight if language server support it.", - "default": true + "suggest.minTriggerInputLength": { + "type": "integer", + "default": 1, + "scope": "language-overridable", + "description": "Minimal input length for trigger completion, default 1" }, - "coc.preferences.previewAutoClose": { + "suggest.noselect": { "type": "boolean", - "description": "Auto close preview window on cursor move.", - "default": true + "scope": "application", + "description": "Not make vim select first item on popupmenu shown", + "default": false }, - "coc.preferences.currentFunctionSymbolAutoUpdate": { + "suggest.preferCompleteThanJumpPlaceholder": { "type": "boolean", - "description": "Automatically update the value of b:coc_current_function on CursorHold event", + "description": "Confirm completion instead of jump to next placeholder when completion is activated.", + "scope": "resource", "default": false }, - "coc.preferences.formatOnSaveFiletypes": { - "type": "array", - "default": [], - "description": "Filetypes that should run format on save.", - "items": { - "type": "string" + "suggest.pumFloatConfig": { + "type": ["object", "null"], + "scope": "application", + "description": "Configure style of popup menu, suggest.floatConfig is used when not specified.", + "allOf": [{ "$ref": "#/definitions/float" }], + "additionalProperties": false, + "default": null, + "properties": { + "border": {}, + "rounded": {}, + "highlight": {}, + "borderhighlight": {}, + "winblend": {}, + "shadow": {} } }, - "coc.preferences.formatOnInsertLeave": { + "suggest.removeDuplicateItems": { "type": "boolean", - "description": "Trigger format on type when insert leave by send \n to the server.", + "description": "Remove completion items with duplicated word for all sources, snippet items are excluded.", + "scope": "language-overridable", "default": false }, - "coc.preferences.enableFloatHighlight": { + "suggest.reversePumAboveCursor": { "type": "boolean", - "description": "Enable highlight for floating window.", - "default": true - }, - "coc.preferences.rootPatterns": { - "type": "array", - "default": [".git", ".hg", ".projections.json"], - "description": "Root patterns to resolve workspaceFolder from parent folders of opened files, resolved from up to down.", - "items": { - "type": "string" - } - }, - "coc.preferences.watchmanPath": { - "type": "string", - "description": "executable path for https://facebook.github.io/watchman/, detected from $PATH by default", - "default": null + "scope": "application", + "description": "Reverse order of complete items when pum shown above cursor.", + "default": false }, - "coc.preferences.jumpCommand": { + "suggest.selection": { "type": "string", - "description": "Command used for location jump, like goto definition, goto references etc.", - "default": "edit" + "scope": "application", + "default": "first", + "description": "Controls how suggestions are pre-selected when showing the suggest list.", + "enum": ["first", "recentlyUsed", "recentlyUsedByPrefix"] }, - "coc.preferences.messageLevel": { + "suggest.snippetIndicator": { "type": "string", - "description": "Message level for filter echoed messages, could be 'more', 'warning' and 'error'", - "default": "more", - "enum": ["more", "warning", "error"] + "default": "~", + "scope": "application", + "description": "The character used in abbr of complete item to indicate the item could be expand as snippet." }, - "coc.preferences.bracketEnterImprove": { + "suggest.snippetsSupport": { "type": "boolean", - "description": "Improve enter inside bracket `<> {} [] ()` by add new empty line below and place cursor to it. Works with `coc#on_enter()`", + "scope": "language-overridable", + "description": "Set to false to disable snippets support of completion.", "default": true }, - "coc.preferences.formatOnType": { + "suggest.timeout": { + "type": "integer", + "default": 5000, + "minimum": 500, + "maximum": 15000, + "scope": "language-overridable", + "description": "Timeout for completion, in milliseconds." + }, + "suggest.triggerAfterInsertEnter": { "type": "boolean", - "description": "Set to true to enable format on type", + "description": "Trigger completion after InsertEnter, auto trigger should be 'always' to enable this option", + "scope": "language-overridable", "default": false }, - "coc.preferences.formatOnTypeFiletypes": { - "type": "array", - "default": [], - "description": "Filetypes that should run format on typing. Only take effect when `coc.preferences.formatOnType` set `true`", - "items": { - "type": "string" - } - }, - "coc.preferences.highlightTimeout": { + "suggest.triggerCompletionWait": { "type": "integer", - "default": 500, - "minimum": 200, - "maximum": 5000, - "description": "Highlight timeout for buffer in floating window." + "default": 0, + "minimum": 0, + "maximum": 50, + "scope": "language-overridable", + "description": "Wait time between text change and completion start, cancel completion when text changed during wait." }, - "coc.preferences.snippets.enable": { + "suggest.virtualText": { "type": "boolean", - "description": "Set to false to disable snippets support.", - "default": true + "scope": "application", + "description": "Show virtual text for insert word of selected item, requires neovim >= 0.5.0 or vim >= 9.0.0067", + "default": false }, - "coc.source.around.enable": { - "type": "boolean", - "default": true + "tree.closedIcon": { + "type": "string", + "scope": "application", + "default": "+", + "description": "Closed icon of tree view." }, - "coc.source.around.firstMatch": { - "type": "boolean", - "description": "Filter complete items by first letter strict match.", - "default": true + "tree.key.actions": { + "type": "string", + "scope": "application", + "default": "", + "description": "Trigger key to invoke actions." }, - "coc.source.around.shortcut": { + "tree.key.activeFilter": { "type": "string", - "default": "A" + "scope": "application", + "default": "f", + "description": "Trigger key active filter." }, - "coc.source.around.priority": { - "type": "integer", - "default": 1 + "tree.key.close": { + "type": "string", + "scope": "application", + "default": "", + "description": "Trigger key to dispose the tree and close tree window." }, - "coc.source.around.disableSyntaxes": { - "type": "array", - "default": [], - "items": { - "type": "string" - } + "tree.key.collapseAll": { + "type": "string", + "scope": "application", + "default": "M", + "description": "Trigger key to collapse all tree node." }, - "coc.source.buffer.enable": { - "type": "boolean", - "default": true + "tree.key.invoke": { + "type": "string", + "scope": "application", + "default": "", + "description": "Trigger key to invoke default command of current node or selection." }, - "coc.source.buffer.shortcut": { + "tree.key.selectNext": { "type": "string", - "default": "B" + "scope": "application", + "default": "", + "description": "Trigger key to select next item during filter." }, - "coc.source.buffer.priority": { - "type": "integer", - "default": 1 + "tree.key.selectPrevious": { + "type": "string", + "scope": "application", + "default": "", + "description": "Trigger key to select previous item during filter." }, - "coc.source.buffer.firstMatch": { - "type": "boolean", - "description": "Filter complete items by first letter strict match.", - "default": true + "tree.key.toggle": { + "type": "string", + "scope": "application", + "default": "t", + "description": "Trigger key to toggle expand state of tree node, does nothing with leaf node." }, - "coc.source.buffer.ignoreGitignore": { - "type": "boolean", - "default": true, - "description": "Ignore git ignored files for buffer words" + "tree.key.toggleSelection": { + "type": "string", + "scope": "application", + "default": "", + "description": "Trigger key to select/unselect item" }, - "coc.source.buffer.disableSyntaxes": { - "type": "array", - "default": [], - "items": { - "type": "string" - } + "tree.openedIcon": { + "type": "string", + "scope": "application", + "default": "-", + "description": "Opened icon of tree view." }, - "coc.source.file.enable": { + "typeHierarchy.enableTooltip": { "type": "boolean", - "default": true + "scope": "application", + "default": true, + "description": "Enable tooltip to show relative filepath of type hierarchy." }, - "coc.source.file.shortcut": { + "typeHierarchy.openCommand": { "type": "string", - "default": "F" + "scope": "application", + "default": "edit", + "description": "Open command for type hierarchy tree view." }, - "coc.source.file.priority": { - "type": "integer", - "default": 10 + "typeHierarchy.splitCommand": { + "type": "string", + "scope": "application", + "default": "botright 30vs", + "description": "Window split command used by type hierarchy tree view." }, - "coc.source.file.disableSyntaxes": { + "workspace.bottomUpFiletypes": { "type": "array", "default": [], + "scope": "application", + "description": "Filetypes that should have workspace folder should resolved from base directory of file, or [\"*\"] for any filetype.", "items": { "type": "string" } }, - "coc.source.file.triggerCharacters": { + "workspace.ignoredFiletypes": { "type": "array", - "default": ["/"], + "default": [], + "scope": "resource", + "description": "Filetypes that should be ignored for workspace folder resolve.", "items": { "type": "string" } }, - "coc.source.file.trimSameExts": { + "workspace.ignoredFolders": { "type": "array", - "default": [".ts", ".js"], - "description": "Trim same extension on file completion", + "default": ["$HOME"], + "scope": "application", + "description": "List of folders that should not be resolved as workspace folder, environment variables and minimatch patterns can be used.", "items": { "type": "string" } }, - "coc.source.file.ignoreHidden": { + "workspace.openOutputCommand": { + "type": "string", + "default": "vs", + "scope": "resource", + "description": "Command used to open output channel." + }, + "workspace.openResourceCommand": { + "type": "string", + "default": "tab drop", + "scope": "application", + "description": "Command to open files that not loaded, load files as hidden buffers when empty." + }, + "workspace.workspaceFolderCheckCwd": { "type": "boolean", "default": true, - "description": "Ignore completion for hidden files" + "scope": "application", + "description": "Whether the current working directory should be used first when checking patterns match for workspace folder." }, - "coc.source.file.ignorePatterns": { - "type": "array", - "default": [], - "description": "Ignore patterns of matcher", - "items": { - "type": "string" - } + "workspace.workspaceFolderFallbackCwd": { + "type": "boolean", + "default": true, + "scope": "application", + "description": "Use current working directory as workspace folder when no root patterns resolved." }, "languageserver": { "type": "object", "default": {}, - "description": "Dictionary of languageservers, key is used as id of languageserver.", + "scope": "resource", + "description": "Dictionary of languageservers, key is used as id of languageserver, restart coc.nvim required after change.", "patternProperties": { "^[_a-zA-Z]+$": { "oneOf": [ diff --git a/_vim/.vim/plugged/coc.nvim/doc/coc-config.txt b/_vim/.vim/plugged/coc.nvim/doc/coc-config.txt new file mode 100644 index 0000000..14e4466 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/doc/coc-config.txt @@ -0,0 +1,1754 @@ +*coc-config.txt* NodeJS client for Vim & Neovim. + +CONTENTS + +Call hierarchy |coc-config-callHierarchy| +CodeLens |coc-config-codeLens| +Colors |coc-config-colors| +Completion |coc-config-suggest| +Cursors |coc-config-cursors| +Diagnostics |coc-config-diagnostic| +Dialog |coc-config-dialog| +Document highlight |coc-config-documentHighlight| +Float factory |coc-config-floatFactory| +Hover |coc-config-hover| +Http |coc-config-http| +Inlay hint |coc-config-inlayHint| +Links |coc-config-links| +List |coc-config-list| +Notification |coc-config-notification| +Npm |coc-config-npm| +Outline |coc-config-outline| +Pull diagnostics |coc-config-pullDiagnostic| +Refactor |coc-config-refactor| +Semantic tokens |coc-config-semanticTokens| +Signature |coc-config-signature| +Tree |coc-config-tree| +Type hierarchy |coc-config-typeHierarchy| +Workspace |coc-config-workspace| +Preferences |coc-config-preferences| +Float |coc-config-float| +Language server |coc-config-languageserver| + +============================================================================== +BUILTIN CONFIGURATIONS *coc-config* + +Builtin configurations of coc.nvim, it's recommended to use `coc-json` +extension for completion and validation support. + +------------------------------------------------------------------------------ +CallHierarchy~ + *coc-config-callHierarchy* +"callHierarchy.enableTooltip" *coc-config-callHierarchy-enableTooltip* + + Enable tooltip to show relative filepath of call hierarchy item. + + Scope: `application`, default: `true` + +"callHierarchy.openCommand" *coc-config-callHierarchy-openCommand* + + Open command for call hierarchy tree view. + + Scope: `application`, default: `"edit"` + +"callHierarchy.splitCommand" *coc-config-callHierarchy-splitCommand* + + Window split command used by call hierarchy tree view. + + Scope: `application`, default: `"botright 30vs"` + +------------------------------------------------------------------------------ +CodeLens~ + *coc-config-codeLens* +"codeLens.enable" *coc-config-codeLens-enable* + + Enable codeLens feature, require neovim with set virtual text feature. + + Scope: `language-overridable`, default: `false` + +"codeLens.position" *coc-config-codeLens-position* + + Position of codeLens, requires nvim >= 0.6.0. + + Scope: `resource`, default: `"top"` + +"codeLens.separator" *coc-config-codeLens-separator* + + Separator text for codeLens in virtual text. + + Scope: `resource`, default: `""` + +"codeLens.subseparator" *coc-config-codeLens-subseparator* + + Subseparator between codeLenses in virtual text. + + Scope: `resource`, default: `" "` + +------------------------------------------------------------------------------ +Colors~ + *coc-config-colors* +"colors.filetypes" *coc-config-colors-filetypes* + + Filetypes that should be enabled for colors highlight feature, use "*" + for all filetypes. + + Scope: `resource`, default: `[]` + +"colors.highlightPriority" *coc-config-colors-highlightPriority* + + Priority for colors highlights, works on vim8 and neovim >= 0.6.0. + + Scope: `resource`, default: `1000` + +------------------------------------------------------------------------------ +Cursors~ + *coc-config-cursors* +"cursors.cancelKey" *coc-config-cursors-cancelKey* + + Key used for cancel cursors session. + + Scope: `application`, default: `""` + +"cursors.nextKey" *coc-config-cursors-nextKey* + + Key used for jump to next cursors position. + + Scope: `application`, default: `""` + +"cursors.previousKey" *coc-config-cursors-previousKey* + + Key used for jump to previous cursors position. + + Scope: `application`, default: `""` + +"cursors.wrapscan" *coc-config-cursors-wrapscan* + + Searches wrap around the first or last cursors range. + + Scope: `application`, default: `true` + +------------------------------------------------------------------------------ +Diagnostic~ + *coc-config-diagnostic* +"diagnostic.autoRefresh" *coc-config-diagnostic-autoRefresh* + + Enable automatically refresh diagnostics, use diagnosticRefresh action + when it's disabled. + + Scope: `language-overridable`, default: `true` + +"diagnostic.checkCurrentLine" *coc-config-diagnostic-checkCurrentLine* + + When enabled, show all diagnostics of current line if there are none at + the current position. + + Scope: `language-overridable`, default: `false` + +"diagnostic.displayByAle" *coc-config-diagnostic-displayByAle* + + Use Ale for display diagnostics in vim, will disable coc for display + diagnostics, restart required on change. + + Scope: `language-overridable`, default: `false` + +"diagnostic.enable" *coc-config-diagnostic-enable* + + Set to false to disable diagnostic display. + + Scope: `language-overridable`, default: `true` + +"diagnostic.enableHighlightLineNumber" *coc-config-diagnostic-enableHighlightLineNumber* + + Enable highlighting line numbers for diagnostics, only works with neovim. + + Scope: `application`, default: `true` + +"diagnostic.enableMessage" *coc-config-diagnostic-enableMessage* + + When to enable show messages of diagnostics. + + Scope: `application`, default: `"always"` + +"diagnostic.enableSign" *coc-config-diagnostic-enableSign* + + Enable signs for diagnostics. + + Scope: `language-overridable`, default: `true` + +"diagnostic.errorSign" *coc-config-diagnostic-errorSign* + + Text of error sign. + + Scope: `application`, default: `">>"` + +"diagnostic.filetypeMap" *coc-config-diagnostic-filetypeMap* + + A map between buffer filetype and the filetype assigned to diagnostics. + To syntax highlight diagnostics with their parent buffer type use `" + default": "bufferType"`. + + Scope: `application`, default: `{}` + +"diagnostic.floatConfig" *coc-config-diagnostic-floatConfig* + + Configuration of floating window/popup for diagnostic messages, see + |coc-config-float|. + + Scope: `application`, default: `null` + +"diagnostic.format" *coc-config-diagnostic-format* + + Define the diagnostic format that shown in float window or echoed, + available parts: source, code, severity, message. + + Scope: `language-overridable`, default: `"%message (%source%code)"` + +"diagnostic.highlightLimit" *coc-config-diagnostic-highlightLimit* + + Limit count for highlighted diagnostics, too many diagnostic highlights + could make vim stop responding. + + Scope: `language-overridable`, default: `1000` + +"diagnostic.highlightPriority" *coc-config-diagnostic-highlightPriority* + + Priority for diagnostic highlights, works on vim8 and neovim >= 0.6.0. + + Scope: `language-overridable`, default: `4096` + +"diagnostic.hintSign" *coc-config-diagnostic-hintSign* + + Text of hint sign. + + Scope: `application`, default: `">>"` + +"diagnostic.infoSign" *coc-config-diagnostic-infoSign* + + Text of info sign. + + Scope: `application`, default: `">>"` + +"diagnostic.level" *coc-config-diagnostic-level* + + Used for filter diagnostics by diagnostic severity. + + Scope: `resource`, default: `"hint"` + +"diagnostic.locationlistLevel" *coc-config-diagnostic-locationlistLevel* + + Filter diagnostics in locationlist. + + Scope: `language-overridable`, default: `null` + +"diagnostic.locationlistUpdate" *coc-config-diagnostic-locationlistUpdate* + + Update locationlist on diagnostics change, only works with locationlist + opened by :CocDiagnostics command and first window of associated buffer. + + Scope: `language-overridable`, default: `true` + +"diagnostic.messageDelay" *coc-config-diagnostic-messageDelay* + + How long to wait (in milliseconds) before displaying the diagnostic + message with echo or float + + Scope: `application`, default: `200` + +"diagnostic.messageLevel" *coc-config-diagnostic-messageLevel* + + Filter diagnostic message in float window/popup. + + Scope: `language-overridable`, default: `null` + +"diagnostic.messageTarget" *coc-config-diagnostic-messageTarget* + + Diagnostic message target. + + Scope: `language-overridable`, default: `"float"` + +"diagnostic.refreshOnInsertMode" *coc-config-diagnostic-refreshOnInsertMode* + + Enable diagnostic refresh on insert mode, default false. + + Scope: `language-overridable`, default: `false` + +"diagnostic.separateRelatedInformationAsDiagnostics" *coc-config-diagnostic-separateRelatedInformationAsDiagnostics* + + Separate related information as diagnostics. + + Scope: `application`, default: `false` + +"diagnostic.showDeprecated" *coc-config-diagnostic-showDeprecated* + + Show diagnostics with deprecated tag. + + Scope: `language-overridable`, default: `true` + +"diagnostic.showUnused" *coc-config-diagnostic-showUnused* + + Show diagnostics with unused tag, affects highlight, sign, virtual + text , message. + + Scope: `language-overridable`, default: `true` + +"diagnostic.signLevel" *coc-config-diagnostic-signLevel* + + Filter diagnostics displayed in signcolumn. + + Scope: `language-overridable`, default: `null` + +"diagnostic.signPriority" *coc-config-diagnostic-signPriority* + + Priority of diagnostic signs. + + Scope: `resource`, default: `10` + +"diagnostic.virtualText" *coc-config-diagnostic-virtualText* + + Use virtual text to display diagnostics, requires neovim >= 0.5.0 or + vim >= 9.0.0067. + + Scope: `language-overridable`, default: `false` + +"diagnostic.virtualTextAlign" *coc-config-diagnostic-virtualTextAlign* + + Position of virtual text. Vim9 only. + + Scope: `language-overridable`, default: `"after"` + +"diagnostic.virtualTextCurrentLineOnly" *coc-config-diagnostic-virtualTextCurrentLineOnly* + + Only show virtualText diagnostic on current cursor line. + + Scope: `language-overridable`, default: `true` + +"diagnostic.virtualTextFormat" *coc-config-diagnostic-virtualTextFormat* + + Define the virtual text diagnostic format, available parts: source, code + , severity, message. + + Scope: `language-overridable`, default: `"%message"` + +"diagnostic.virtualTextLevel" *coc-config-diagnostic-virtualTextLevel* + + Filter diagnostic message in virtual text by level. + + Scope: `language-overridable`, default: `null` + +"diagnostic.virtualTextLimitInOneLine" *coc-config-diagnostic-virtualTextLimitInOneLine* + + The maximum number of diagnostic messages to disaply in one line. + + Scope: `language-overridable`, default: `999` + +"diagnostic.virtualTextLineSeparator" *coc-config-diagnostic-virtualTextLineSeparator* + + The text that will mark a line end from the diagnostic message. + + Scope: `language-overridable`, default: `" \ "` + +"diagnostic.virtualTextLines" *coc-config-diagnostic-virtualTextLines* + + The number of non empty lines from a diagnostic to display. + + Scope: `language-overridable`, default: `3` + +"diagnostic.virtualTextPrefix" *coc-config-diagnostic-virtualTextPrefix* + + The prefix added virtual text diagnostics. + + Scope: `language-overridable`, default: `" "` + +"diagnostic.virtualTextWinCol" *coc-config-diagnostic-virtualTextWinCol* + + Window column number to align virtual text, neovim only. + + Scope: `language-overridable`, default: `null` + +"diagnostic.warningSign" *coc-config-diagnostic-warningSign* + + Text of warning sign. + + Scope: `application`, default: `"⚠"` + +------------------------------------------------------------------------------ +Dialog~ + *coc-config-dialog* +"dialog.confirmKey" *coc-config-dialog-confirmKey* + + Confirm key for confirm selection used by menu and picker, you can + always use to cancel. + + Scope: `application`, default: `""` + +"dialog.floatBorderHighlight" *coc-config-dialog-floatBorderHighlight* + + Highlight group for border of dialog window/popup, use 'CocFloating' + when not specified. + + Scope: `application`, default: `null` + +"dialog.floatHighlight" *coc-config-dialog-floatHighlight* + + Highlight group for dialog window/popup, use 'CocFloating' when not + specified. + + Scope: `application`, default: `null` + +"dialog.maxHeight" *coc-config-dialog-maxHeight* + + Maximum height of dialog window. + + Scope: `application`, default: `30` + +"dialog.maxWidth" *coc-config-dialog-maxWidth* + + Maximum width of dialog window. + + Scope: `application`, default: `80` + +"dialog.pickerButtonShortcut" *coc-config-dialog-pickerButtonShortcut* + + Show shortcut in buttons of picker dialog window/popup, used when dialog + .pickerButtons is true. + + Scope: `application`, default: `true` + +"dialog.pickerButtons" *coc-config-dialog-pickerButtons* + + Show buttons for picker dialog window/popup. + + Scope: `application`, default: `true` + +"dialog.rounded" *coc-config-dialog-rounded* + + use rounded border for dialog window. + + Scope: `application`, default: `true` + +"dialog.shortcutHighlight" *coc-config-dialog-shortcutHighlight* + + Highlight group for shortcut character in menu dialog. + + Scope: `application`, default: `"MoreMsg"` + +------------------------------------------------------------------------------ +DocumentHighlight~ + *coc-config-documentHighlight* +"documentHighlight.priority" *coc-config-documentHighlight-priority* + + Match priority used by document highlight, see ':h matchadd'. + + Scope: `resource`, default: `-1` + +"documentHighlight.timeout" *coc-config-documentHighlight-timeout* + + Timeout for document highlight, in milliseconds. + + Scope: `resource`, default: `300` + +------------------------------------------------------------------------------ +FloatFactory~ + *coc-config-floatFactory* +"floatFactory.floatConfig" *coc-config-floatFactory-floatConfig* + + Configure default float window/popup style created by float factory + (created around cursor and automatically closed), properties of + |coc-config-float| are used. + + Scope: `application`, default: `null` + +------------------------------------------------------------------------------ +Hover~ + *coc-config-hover* +"hover.autoHide" *coc-config-hover-autoHide* + + Automatically hide hover float window on CursorMove or InsertEnter. + + Scope: `application`, default: `true` + +"hover.floatConfig" *coc-config-hover-floatConfig* + + Configuration of floating window/popup for hover documents, see + |coc-config-float|. + + Scope: `application`, default: `null` + +"hover.previewMaxHeight" *coc-config-hover-previewMaxHeight* + + Max height of preview window for hover. + + Scope: `resource`, default: `12` + +"hover.target" *coc-config-hover-target* + + Target to show hover information, could be `float`, `echo` or + `preview`. + + Scope: `resource`, default: `float` + +------------------------------------------------------------------------------ +Http proxy~ + *coc-config-http* +"http.proxy" *coc-config-http-proxy* + + The proxy setting to use. If not set, will be inherited from the ` + http_proxy` and `https_proxy` environment variables. + + Scope: `application`, default: `""` + +"http.proxyAuthorization" *coc-config-http-proxyAuthorization* + + The value to send as the `Proxy-Authorization` header for every network + request. + + Scope: `application`, default: `null` + +"http.proxyCA" *coc-config-http-proxyCA* + + CA (file) to use as Certificate Authority> + + Scope: `application`, default: `null` + +"http.proxyStrictSSL" *coc-config-http-proxyStrictSSL* + + Controls whether the proxy server certificate should be verified + against the list of supplied CAs. + + Scope: `application`, default: `true` + +------------------------------------------------------------------------------ +InlayHint~ + *coc-config-inlayHint* +"inlayHint.enable" *coc-config-inlayHint-enable* + + Enable inlay hint support. + + Scope: `language-overridable`, default: `true` + +"inlayHint.enableParameter" *coc-config-inlayHint-enableParameter* + + Enable inlay hints for parameters. + + Scope: `language-overridable`, default: `true` + +"inlayHint.display" coc-config-inlayHint-display + + Display inlay hints. Toggle with :CocCommand document.toggleInlayHint + + Scope: `language-overridable`, default: true + +"inlayHint.parameterSeparator" *coc-config-inlayHint-parameterSeparator* + + Separator for parameter inlay hint, neovim only. + + Scope: `language-overridable`, default: `""` + +"inlayHint.refreshOnInsertMode" *coc-config-inlayHint-refreshOnInsertMode* + + Refresh inlayHints on insert mode. + + Scope: `language-overridable`, default: `false` + +"inlayHint.subSeparator" *coc-config-inlayHint-subSeparator* + + Separator for chained inlay hints, neovim only. + + Scope: `language-overridable`, default: `" "` + +"inlayHint.typeSeparator" *coc-config-inlayHint-typeSeparator* + + Separator for type inlay hint, neovim only. + + Scope: `language-overridable`, default: `""` + +------------------------------------------------------------------------------ +Links~ + *coc-config-links* +"links.tooltip" *coc-config-links-tooltip* + + Show tooltip of link under cursor on CursorHold, neovim only. + + Scope: `application`, default: `false` + +------------------------------------------------------------------------------ +List~ + *coc-config-list* +"list.alignColumns" *coc-config-list-alignColumns* + + Whether to align lists in columns. + + Scope: `application`, default: `false` + +"list.extendedSearchMode" *coc-config-list-extendedSearchMode* + + Enable extended search mode which allows multiple search patterns + delimited by spaces. + + Scope: `application`, default: `true` + +"list.height" *coc-config-list-height* + + Height of split list window. + + Scope: `application`, default: `10` + +"list.indicator" *coc-config-list-indicator* + + The character used as first character in prompt line. + + Scope: `application`, default: `">"` + +"list.insertMappings" *coc-config-list-insertMappings* + + Custom keymappings on insert mode. + + Scope: `application`, default: `{}` + +"list.interactiveDebounceTime" *coc-config-list-interactiveDebounceTime* + + Debounce time for input change on interactive mode. + + Scope: `application`, default: `100` + +"list.limitLines" *coc-config-list-limitLines* + + Limit lines for list buffer. + + Scope: `application`, default: `null` + +"list.maxPreviewHeight" *coc-config-list-maxPreviewHeight* + + Max height for preview window of list. + + Scope: `application`, default: `12` + +"list.menuAction" *coc-config-list-menuAction* + + Use menu picker instead of confirm() for choose action. + + Scope: `application`, default: `false` + +"list.nextKeymap" *coc-config-list-nextKeymap* + + Key used for select next line on insert mode. + + Scope: `application`, default: `""` + +"list.normalMappings" *coc-config-list-normalMappings* + + Custom keymappings on normal mode. + + Scope: `application`, default: `{}` + +"list.previewHighlightGroup" *coc-config-list-previewHighlightGroup* + + Highlight group used for highlight the range in preview window. + + Scope: `application`, default: `"Search"` + +"list.previewSplitRight" *coc-config-list-previewSplitRight* + + Use vsplit for preview window. + + Scope: `application`, default: `false` + +"list.previewToplineOffset" *coc-config-list-previewToplineOffset* + + Topline offset for list previews + + Scope: `application`, default: `3` + +"list.previewToplineStyle" *coc-config-list-previewToplineStyle* + + Topline style for list previews + + Scope: `application`, default: `"offset"` + +"list.previousKeymap" *coc-config-list-previousKeymap* + + Key used for select previous line on insert mode. + + Scope: `application`, default: `""` + +"list.selectedSignText" *coc-config-list-selectedSignText* + + Sign text for selected lines. + + Scope: `application`, default: `"*"` + +"list.signOffset" *coc-config-list-signOffset* + + Sign offset of list, should be different from other plugins. + + Scope: `application`, default: `900` + +"list.smartCase" *coc-config-list-smartCase* + + Use smartcase match for fuzzy match and strict match, --ignore-case + will be ignored, may not affect interactive list. + + Scope: `application`, default: `false` + +"list.source.diagnostics.includeCode" *coc-config-list-source-diagnostics-includeCode* + + Whether to show the diagnostic code in the list. + + Scope: `application`, default: `true` + +"list.source.diagnostics.pathFormat" *coc-config-list-source-diagnostics-pathFormat* + + Decide how the filepath is shown in the list. + + Scope: `application`, default: `"full"` + +"list.source.outline.ctagsFiletypes" *coc-config-list-source-outline-ctagsFiletypes* + + Filetypes that should use ctags for outline instead of language server. + + Scope: `application`, default: `[]` + +"list.source.symbols.excludes" *coc-config-list-source-symbols-excludes* + + Patterns of minimatch for filepath to exclude from symbols list. + + Scope: `application`, default: `[]` + +"list.statusLineSegments" *coc-config-list-statusLineSegments* + + An array of statusline segments that will be used to draw the status + line for list windows. + + Scope: `application`. + +------------------------------------------------------------------------------ +Notification~ + *coc-config-notification* +"notification.border" *coc-config-notification-border* + + Enable rounded border for notification windows. + + Scope: `application`, default: `true` + +"notification.disabledProgressSources" *coc-config-notification-disabledProgressSources* + + Sources that should be disabled for message progress, use * to disable + all progresses. + + Scope: `application`, default: `[]` + +"notification.focusable" *coc-config-notification-focusable* + + Enable focus by user actions (wincmds, mouse events), neovim only. + + Scope: `application`, default: `true` + +"notification.highlightGroup" *coc-config-notification-highlightGroup* + + Highlight group of notification dialog. + + Scope: `application`, default: `"Normal"` + +"notification.marginRight" *coc-config-notification-marginRight* + + Margin right to the right of editor window. + + Scope: `application`, default: `10` + +"notification.maxHeight" *coc-config-notification-maxHeight* + + Maximum content height of notification dialog. + + Scope: `application`, default: `10` + +"notification.maxWidth" *coc-config-notification-maxWidth* + + Maximum content width of notification dialog. + + Scope: `application`, default: `60` + +"notification.minProgressWidth" *coc-config-notification-minProgressWidth* + + Minimal with of progress notification. + + Scope: `application`, default: `30` + +"notification.statusLineProgress" *coc-config-notification-statusLineProgress* + + Show progress notification in status line, instead of use float + window/popup. + +"notification.timeout" *coc-config-notification-timeout* + + Timeout for auto close notifications, in milliseconds. + + Scope: `application`, default: `10000` + +"notification.winblend" *coc-config-notification-winblend* + + Winblend option of notification window, neovim only. + + Scope: `application`, default: `30` + +------------------------------------------------------------------------------ +Npm~ + *coc-config-npm* +"npm.binPath" *coc-config-npm-binPath* + + Command or absolute path to npm or yarn for global extension + install/uninstall. + + Scope: `application`, default: `"npm"` + +------------------------------------------------------------------------------ +Outline~ + *coc-config-outline* +"outline.autoPreview" *coc-config-outline-autoPreview* + + Enable auto preview on cursor move. + + Scope: `application`, default: `false` + +"outline.autoWidth" *coc-config-outline-autoWidth* + + Automatically increase window width to avoid wrapped lines. + + Scope: `application`, default: `true` + +"outline.checkBufferSwitch" *coc-config-outline-checkBufferSwitch* + + Recreate outline view after user changed to another buffer on current + tab. + + Scope: `application`, default: `true` + +"outline.codeActionKinds" *coc-config-outline-codeActionKinds* + + Filter code actions in actions menu by kinds. + + Scope: `application`, default: `["","quickfix","refactor"]` + +"outline.detailAsDescription" *coc-config-outline-detailAsDescription* + + Show detail as description aside with label, when false detail will be + shown in tooltip on cursor hold. + + Scope: `application`, default: `true` + +"outline.expandLevel" *coc-config-outline-expandLevel* + + Expand level of tree nodes. + + Scope: `application`, default: `1` + +"outline.followCursor" *coc-config-outline-followCursor* + + Reveal item in outline tree on cursor hold. + + Scope: `application`, default: `true` + +"outline.keepWindow" *coc-config-outline-keepWindow* + + Jump back to original window after outline is shown. + + Scope: `application`, default: `false` + +"outline.previewBorder" *coc-config-outline-previewBorder* + + Use border for preview window. + + Scope: `application`, default: `true` + +"outline.previewBorderHighlightGroup" *coc-config-outline-previewBorderHighlightGroup* + + Border highlight group of preview window. + + Scope: `application`, default: `"Normal"` + +"outline.previewBorderRounded" *coc-config-outline-previewBorderRounded* + + Use rounded border for preview window. + + Scope: `application`, default: `false` + +"outline.previewHighlightGroup" *coc-config-outline-previewHighlightGroup* + + Highlight group of preview window. + + Scope: `application`, default: `"Normal"` + +"outline.previewMaxWidth" *coc-config-outline-previewMaxWidth* + + Max width of preview window. + + Scope: `application`, default: `80` + +"outline.previewWinblend" *coc-config-outline-previewWinblend* + + Enables pseudo-transparency by set 'winblend' option of window, neovim + only. + + Scope: `application`, default: `0` + +"outline.showLineNumber" *coc-config-outline-showLineNumber* + + Show line number of symbols. + + Scope: `application`, default: `true` + +"outline.sortBy" *coc-config-outline-sortBy* + + Default sort method for symbols outline. + + Scope: `application`, default: `"category"` + +"outline.splitCommand" *coc-config-outline-splitCommand* + + Window split command used by outline. + + Scope: `application`, default: `"botright 30vs"` + +"outline.switchSortKey" *coc-config-outline-switchSortKey* + + The key used to switch sort method for symbols provider of current + tree view. + + Scope: `application`, default: `""` + +"outline.togglePreviewKey" *coc-config-outline-togglePreviewKey* + + The key used to toggle auto preview feature. + + Scope: `application`, default: `"p"` + +------------------------------------------------------------------------------ +PullDiagnostic~ + *coc-config-pullDiagnostic* +"pullDiagnostic.ignored" *coc-config-pullDiagnostic-ignored* + + Minimatch patterns to match full filepath that should be ignored for + pullDiagnostic. + + Scope: `application`, default: `[]` + +"pullDiagnostic.onChange" *coc-config-pullDiagnostic-onChange* + + Whether to pull for diagnostics on document change. + + Scope: `language-overridable`, default: `true` + +"pullDiagnostic.onSave" *coc-config-pullDiagnostic-onSave* + + Whether to pull for diagnostics on document save. + + Scope: `language-overridable`, default: `false` + +"pullDiagnostic.workspace" *coc-config-pullDiagnostic-workspace* + + Whether to pull for workspace diagnostics when possible. + + Scope: `application`, default: `true` + +------------------------------------------------------------------------------ +Refactor~ + *coc-config-refactor* +"refactor.afterContext" *coc-config-refactor-afterContext* + + Print num lines of trailing context after each match. + + Scope: `application`, default: `3` + +"refactor.beforeContext" *coc-config-refactor-beforeContext* + + Print num lines of leading context before each match. + + Scope: `application`, default: `3` + +"refactor.openCommand" *coc-config-refactor-openCommand* + + Open command for refactor window. + + Scope: `application`, default: `"vsplit"` + +"refactor.saveToFile" *coc-config-refactor-saveToFile* + + Save changed buffer to file when write refactor buffer with ':noa wa' + command. + + Scope: `application`, default: `true` + +"refactor.showMenu" *coc-config-refactor-showMenu* + + Refactor buffer local mapping to bring up menu for this chunk. + + Scope: `application`, default: `""` + +------------------------------------------------------------------------------ +SemanticTokens~ + *coc-config-semanticTokens* +"semanticTokens.combinedModifiers" *coc-config-semanticTokens-combinedModifiers* + + Semantic token modifiers that should have highlight combined with + syntax highlights. + + Scope: `language-overridable`, default: `["deprecated"]` + +"semanticTokens.enable" *coc-config-semanticTokens-enable* + + Enable semantic tokens support. + + Scope: `language-overridable`, default: `false` + +"semanticTokens.highlightPriority" *coc-config-semanticTokens-highlightPriority* + + Priority for semantic tokens highlight. + + Scope: `language-overridable`, default: `2048` + +"semanticTokens.incrementTypes" *coc-config-semanticTokens-incrementTypes* + + Semantic token types that should increase highlight when insert at the + start and end position of token. + + Scope: `language-overridable`, default: `["variable","string","parameter"]` + +------------------------------------------------------------------------------ +Signature~ + *coc-config-signature* +"signature.enable" *coc-config-signature-enable* + + Enable show signature help when trigger character typed. + + Scope: `language-overridable`, default: `true` + +"signature.floatConfig" *coc-config-signature-floatConfig* + + Configuration of floating window/popup for signature documents, see + |coc-config-float|. + + Scope: `application`, default: `null` + +"signature.hideOnTextChange" *coc-config-signature-hideOnTextChange* + + Hide signature float window when text changed on insert mode. + + Scope: `language-overridable`, default: `false` + +"signature.preferShownAbove" *coc-config-signature-preferShownAbove* + + Show signature help float window above cursor when possible, require + restart coc.nvim on change. + + Scope: `application`, default: `true` + +"signature.target" *coc-config-signature-target* + + Target of signature help, use float when possible by default. + + Scope: `language-overridable`, default: `"float"` + +"signature.triggerSignatureWait" *coc-config-signature-triggerSignatureWait* + + Timeout for trigger signature help, in milliseconds. + + Scope: `language-overridable`, default: `500` + +------------------------------------------------------------------------------ +Snippet~ + *coc-config-snippet* +"snippet.choicesMenuPicker" *coc-config-snippet-choicesMenuPicker* + + Use menu picker instead of popup menu for choices placeholder. + + Scope: `resource`, default: `false` + +"snippet.highlight" *coc-config-snippet-highlight* + + Use highlight group 'CocSnippetVisual' to highlight placeholders with + same index of current one. + + Scope: `resource`, default: `false` + +"snippet.nextPlaceholderOnDelete" *coc-config-snippet-nextPlaceholderOnDelete* + + Automatically jump to the next placeholder when the current one is + completely deleted. + + Scope: `resource`, default: `false` + +"snippet.statusText" *coc-config-snippet-statusText* + + Text shown in statusline to indicate snippet session is activated. + + Scope: `application`, default: `"SNIP"` + +------------------------------------------------------------------------------ +Suggest~ + *coc-config-suggest* +"suggest.acceptSuggestionOnCommitCharacter" *coc-config-suggest-acceptSuggestionOnCommitCharacter* + + Controls whether suggestions should be accepted on commit characters. + For example, in JavaScript, the semi-colon (`;`) can be a commit + character that accepts a suggestion and types that character. Requires + CompleteChanged event to work. + + Scope: `language-overridable`, default: `false` + +"suggest.asciiCharactersOnly" *coc-config-suggest-asciiCharactersOnly* + + Trigger suggest with ASCII characters only. + + Scope: `language-overridable`, default: `false` + +"suggest.asciiMatch" *coc-config-suggest-asciiMatch* + + Convert unicode characters to ascii for match. + + Scope: `language-overridable`, default: `true` + +"suggest.autoTrigger" *coc-config-suggest-autoTrigger* + + How should completion be triggered, could be `"always"`, `"trigger"` + or `"none"`. + + Scope: `language-overridable`, default: `"always"` + +"suggest.completionItemKindLabels" *coc-config-suggest-completionItemKindLabels* + + Set custom labels to completion items' kinds. + Default value: > + { + "text": "v", + "method": "f", + "function": "f", + "constructor": "f", + "field": "m", + "variable": "v", + "class": "C", + "interface": "I", + "module": "M", + "property": "m", + "unit": "U", + "value": "v", + "enum": "E", + "keyword": "k", + "snippet": "S", + "color": "v", + "file": "F", + "reference": "r", + "folder": "F", + "enumMember": "m", + "constant": "v", + "struct": "S", + "event": "E", + "operator": "O", + "typeParameter": "T", + "default": "" + } +< + Scope: `application` + +"suggest.defaultSortMethod" *coc-config-suggest-defaultSortMethod* + + Default sorting behavior when trigger is empty, could be `"length"`, + `"alphabetical"` or `"none"`. + + Scope: `language-overridable`, default: `"length"` + +"suggest.detailField" *coc-config-suggest-detailField* + + Where to show the detail text of CompleteItem from language server. + + Scope: `application`, default: `"preview"` + +"suggest.enablePreselect" *coc-config-suggest-enablePreselect* + + Enable preselect feature, works when |coc-config-suggest-noselect| is + false. + + Scope: `application`, default: `true` + +"suggest.fixInsertedWord" *coc-config-suggest-fixInsertedWord* + + Make inserted word replace word characters after cursor position. + + Scope: `application`, default: `true` + +"suggest.floatConfig" *coc-config-suggest-floatConfig* + + Configure style of popup menu and documentation window for completion, + see |coc-config-float|. + + Note: some properties not work, including: "title", "focusable", + "close" and "maxHeight" (use 'pumheight' option for maximum height of + popup menu). + + Note: "maxWidth" not works for popup menu, use + |coc-config-suggest-detailMaxLength| instead. + +"suggest.formatItems" *coc-config-suggest-formatItems* + + Items shown in popup menu in order. + + Scope: `application`, default: `["abbr","menu","kind","shortcut"]` + +"suggest.highPrioritySourceLimit" *coc-config-suggest-highPrioritySourceLimit* + + Max items count for source priority bigger than or equal to 90. + + Scope: `language-overridable`, default: `null` + +"suggest.ignoreRegexps" *coc-config-suggest-ignoreRegexps* + + Regexps to ignore when trigger suggest. + + Scope: `language-overridable`, default: `[]` + +"suggest.invalidInsertCharacters" *coc-config-suggest-invalidInsertCharacters* + + Invalid character for strip valid word when inserting text of complete + item. + + Scope: `application`, default: `[" ","(","<","{","[","\r","\n"]` + +"suggest.labelMaxLength" *coc-config-suggest-labelMaxLength* + + Max length of abbr that shown as label of complete item. + + Scope: `application`, default: `200` + +"suggest.languageSourcePriority" *coc-config-suggest-languageSourcePriority* + + Priority of language sources. + + Scope: `language-overridable`, default: `99` + +"suggest.localityBonus" *coc-config-suggest-localityBonus* + + Boost suggestions that appear closer to the cursor position. + + Scope: `language-overridable`, default: `true` + +"suggest.lowPrioritySourceLimit" *coc-config-suggest-lowPrioritySourceLimit* + + Max items count for source priority lower than 90. + + Scope: `language-overridable`, default: `null` + +"suggest.maxCompleteItemCount" *coc-config-suggest-maxCompleteItemCount* + + Maximum number of complete items shown in vim. + + Scope: `language-overridable`, default: `50` + +"suggest.minTriggerInputLength" *coc-config-suggest-minTriggerInputLength* + + Minimal input length for trigger completion. + + Scope: `language-overridable`, default: `1` + +"suggest.noselect" *coc-config-suggest-noselect* + + Not make vim select first item on popupmenu shown. + + Scope: `application`, default: `false` + +"suggest.preferCompleteThanJumpPlaceholder" *coc-config-suggest-preferCompleteThanJumpPlaceholder* + + Confirm completion instead of jump to next placeholder when completion + is activated. + + Scope: `resource`, default: `false` + +"suggest.pumFloatConfig" *coc-config-suggest-pumFloatConfig* + + Configure style of popup menu, |coc-config-suggest-floatConfig| is + used when not specified, see |coc-config-float|. + + Available properties: "border", "rounded", "highlight", + "borderhighlight", "winblend" and "shadow". + + Note: 'winblend' option is used for custom popup menu when not + configured, use 'pumwidth' for minimal width of popup menu and + 'pumheight' for maximum height of popup menu. + + Scope: `application`, default: `null` + +"suggest.removeDuplicateItems" *coc-config-suggest-removeDuplicateItems* + + Remove completion items with duplicated word for all sources, snippet + items are excluded. + + Scope: `language-overridable`, default: `false` + +"suggest.reversePumAboveCursor" *coc-config-suggest-reversePumAboveCursor* + + Reverse order of complete items when pum shown above cursor. + + Scope: `application`, default: `false` + +"suggest.selection" *coc-config-suggest-selection* + + Controls how suggestions are pre-selected when showing the suggest list. + + Scope: `application`, default: `"first"` + +"suggest.snippetIndicator" *coc-config-suggest-snippetIndicator* + + The character used in abbr of complete item to indicate the item could + be expand as snippet. + + Scope: `application`, default: `"~"` + +"suggest.snippetsSupport" *coc-config-suggest-snippetsSupport* + + Set to false to disable snippets support of completion. + + Scope: `language-overridable`, default: `true` + +"suggest.timeout" *coc-config-suggest-timeout* + + Timeout for completion, in milliseconds. + + Scope: `language-overridable`, default: `5000` + +"suggest.triggerAfterInsertEnter" *coc-config-suggest-triggerAfterInsertEnter* + + Trigger completion after InsertEnter, |coc-config-suggest-autoTrigger| + should be 'always' to enable this option + + Scope: `language-overridable`, default: `false` + +"suggest.triggerCompletionWait" *coc-config-suggest-triggerCompletionWait* + + Wait time between text change and completion start, cancel completion + when text changed during wait. + + Scope: `language-overridable`, default: `0` + +"suggest.virtualText" *coc-config-suggest-virtualText* + + Show virtual text for insert word of selected item, requires + neovim >= 0.5.0 or vim >= 9.0.0067. + + Scope: `application`, default: `false` + +------------------------------------------------------------------------------ +Tree~ + *coc-config-tree* +"tree.closedIcon" *coc-config-tree-closedIcon* + + Closed icon of tree view. + + Scope: `application`, default: `"+"` + +"tree.key.actions" *coc-config-tree-key-actions* + + Trigger key to invoke actions. + + Scope: `application`, default: `""` + +"tree.key.activeFilter" *coc-config-tree-key-activeFilter* + + Trigger key active filter. + + Scope: `application`, default: `"f"` + +"tree.key.close" *coc-config-tree-key-close* + + Trigger key to dispose the tree and close tree window. + + Scope: `application`, default: `""` + +"tree.key.collapseAll" *coc-config-tree-key-collapseAll* + + Trigger key to collapse all tree node. + + Scope: `application`, default: `"M"` + +"tree.key.invoke" *coc-config-tree-key-invoke* + + Trigger key to invoke default command of current node or selection. + + Scope: `application`, default: `""` + +"tree.key.selectNext" *coc-config-tree-key-selectNext* + + Trigger key to select next item during filter. + + Scope: `application`, default: `""` + +"tree.key.selectPrevious" *coc-config-tree-key-selectPrevious* + + Trigger key to select previous item during filter. + + Scope: `application`, default: `""` + +"tree.key.toggle" *coc-config-tree-key-toggle* + + Trigger key to toggle expand state of tree node, does nothing with leaf + node. + + Scope: `application`, default: `"t"` + +"tree.key.toggleSelection" *coc-config-tree-key-toggleSelection* + + Trigger key to select/unselect item. + + Scope: `application`, default: `""` + +"tree.openedIcon" *coc-config-tree-openedIcon* + + Opened icon of tree view. + + Scope: `application`, default: `"-"` + +------------------------------------------------------------------------------ +TypeHierarchy~ + *coc-config-typeHierarchy* +"typeHierarchy.enableTooltip" *coc-config-typeHierarchy-enableTooltip* + + Enable tooltip to show relative filepath of type hierarchy item. + + Scope: `application`, default: `true` + +"typeHierarchy.openCommand" *coc-config-typeHierarchy-openCommand* + + Open command for type hierarchy tree view. + + Scope: `application`, default: `"edit"` + +"typeHierarchy.splitCommand" *coc-config-typeHierarchy-splitCommand* + + Window split command used by type hierarchy tree view. + + Scope: `application`, default: `"botright 30vs"` + +------------------------------------------------------------------------------ +Workspace~ + *coc-config-workspace* +"workspace.bottomUpFiletypes" *coc-config-workspace-bottomUpFiletypes* + + Filetypes that should have workspace folder should resolved from base + directory of file, or ["*"] for any filetype. + + Scope: `application`, default: `[]` + +"workspace.ignoredFiletypes" *coc-config-workspace-ignoredFiletypes* + + Filetypes that should be ignored for workspace folder resolve. + + Scope: `resource`, default: `[]` + +"workspace.ignoredFolders" *coc-config-workspace-ignoredFolders* + + List of folders that should not be resolved as workspace folder, + environment variables and minimatch patterns can be used. + + Scope: `application`, default: `["$HOME"]` + +"workspace.openOutputCommand" *coc-config-workspace-openOutputCommand* + + Command used to open output channel. + + Scope: `resource`, default: `"vs"` + +"workspace.openResourceCommand" *coc-config-workspace-openResourceCommand* + + Command to open files that not loaded, load files as hidden buffers + when empty. + + Scope: `application`, default: `"tab drop"` + +"workspace.workspaceFolderCheckCwd" *coc-config-workspace-workspaceFolderCheckCwd* + + Whether the current working directory should be used first when + checking patterns match for workspace folder. + + Scope: `application`, default: `true` + +"workspace.workspaceFolderFallbackCwd" *coc-config-workspace-workspaceFolderFallbackCwd* + + Use current working directory as workspace folder when no root + patterns resolved. + + Scope: `application`, default: `true` + +------------------------------------------------------------------------------ +Preferences~ + *coc-config-preferences* +"coc.preferences.bracketEnterImprove" *coc-preferences-bracketEnterImprove* + + Improve enter inside bracket `<> {} [] ()` by add new empty line below + and place cursor to it. Works with `coc#on_enter()` + + Scope: `language-overridable`, default: `true` + +"coc.preferences.currentFunctionSymbolAutoUpdate" *coc-preferences-currentFunctionSymbolAutoUpdate* + + Automatically update the value of b:coc_current_function on CursorHold + event + + Scope: `language-overridable`, default: `false` + +"coc.preferences.enableLinkedEditing" *coc-preferences-enableLinkedEditing* + + Enable linked editing support. + + Scope: `language-overridable`, default: `false` + +"coc.preferences.enableMarkdown" *coc-preferences-enableMarkdown* + + Tell the language server that markdown text format is supported, note + that markdown text may not rendered as expected. + + Scope: `application`, default: `true` + +"coc.preferences.enableMessageDialog" *coc-preferences-enableMessageDialog* + + Enable messages shown in notification dialog. + + Scope: `application`, default: `false` + +"coc.preferences.excludeImageLinksInMarkdownDocument" *coc-preferences-excludeImageLinksInMarkdownDocument* + + Exclude image links from markdown text in float window. + + Scope: `application`, default: `true` + +"coc.preferences.extensionUpdateCheck" *coc-preferences-extensionUpdateCheck* + + Interval for check extension update, could be "daily", "weekly" or + "never" + + Scope: `application`, default: `"never"` + +"coc.preferences.floatActions" *coc-preferences-floatActions* + + Set to false to disable float/popup support for actions menu. + + Scope: `application`, default: `true` + +"coc.preferences.formatOnSaveFiletypes" *coc-preferences-formatOnSaveFiletypes* + + Filetypes that should run format on save. + + Scope: `resource`, default: `[]` + +"coc.preferences.formatOnType" *coc-preferences-formatOnType* + + Set to true to enable formatting on typing + + Scope: `language-overridable`, default: `false` + +"coc.preferences.formatOnTypeFiletypes" *coc-preferences-formatOnTypeFiletypes* + + Filetypes that should run format on typing. Only take effect when `coc. + preferences.formatOnType` set `true` + + Scope: `resource`, default: `[]` + +"coc.preferences.jumpCommand" *coc-preferences-jumpCommand* + + Command used for location jump, like goto definition, goto references + etc. Can be also a custom command that gives file as an argument. + + Scope: `application`, default: `"edit"` + +"coc.preferences.maxFileSize" *coc-preferences-maxFileSize* + + Maximum file size in bytes that coc.nvim should handle, default + '10MB'. + + Scope: `application`, default: `"10MB"` + +"coc.preferences.messageLevel" *coc-preferences-messageLevel* + + Message level for filter echoed messages, could be 'more', 'warning' + and 'error' + + Scope: `application`, default: `"more"` + +"coc.preferences.promptInput" *coc-preferences-promptInput* + + Use prompt buffer in float window for user input. + + Scope: `application`, default: `true` + +"coc.preferences.renameFillCurrent" *coc-preferences-renameFillCurrent* + + Disable to stop Refactor-Rename float/popup window from populating + with old name in the New Name field. + + Scope: `application`, default: `true` + +"coc.preferences.rootPatterns" *coc-preferences-rootPatterns* + + Root patterns to resolve workspaceFolder from parent folders of opened + files, resolved from up to down. + + Scope: `application`, default: `[".git",".hg",".projections.json"]` + +"coc.preferences.silentAutoupdate" *coc-preferences-silentAutoupdate* + + Not open split window with update status when performing auto update. + + Scope: `application`, default: `true` + +"coc.preferences.useQuickfixForLocations" *coc-preferences-useQuickfixForLocations* + + Use vim's quickfix list for jump locations, need restart on change. + + Scope: `application`, default: `false` + +"coc.preferences.watchmanPath" *coc-preferences-watchmanPath* + + executable path for https://facebook.github.io/watchman/, detected + from $PATH by default + + Scope: `application`, default: `null` + +"coc.preferences.willSaveHandlerTimeout" *coc-preferences-willSaveHandlerTimeout* + + Will save handler timeout. + + Scope: `application`, default: `500` + +------------------------------------------------------------------------------ +Float configuration~ + *coc-config-float* + +Used by `suggest.floatConfig`, `diagnostic.floatConfig`, +`signature.floatConfig` and `hover.floatConfig`, following properties are +supported: + + - "border": Change to `true` to enable border. + - "rounded": Use rounded borders when border is `true`. + - "highlight": Background highlight group of float window, default: + `"CocFloating"`. + - "title": Title text used by float window, default: `""`. + - "borderhighlight": Border highlight group of float window, default: + `"CocFloating"`. + - "close": Set to `true` to draw close icon. + - "maxWidth": Maximum width of float window, contains border. + - "maxHeight": Maximum height of float window, contains border. + - "winblend": Set 'winblend' option of window, neovim only, default: + `0`. + - "focusable": Set to false to make window not focusable, neovim only. + - "shadow": Set to true to enable shadow, neovim only. + +------------------------------------------------------------------------------ +Languageserver~ + *coc-config-languageserver* + + Dictionary of Language Servers, key is the ID of corresponding server, + and value is configuration of languageserver. Default: `{}` + + Properties of languageserver configuration: + + - "enable": Change to `false` to disable that languageserver. + + - "filetypes": Supported filetypes, add * in array for all filetypes. + Note: it's required for start the languageserver, please make sure + your filetype is expected by `:CocCommand document.echoFiletype` command + + - "additionalSchemes": Additional URI schemes, default schemes + including file & untitled. + Note: you have to setup vim provide content for custom URI as well. + + - "cwd": Working directory used to start languageserver, vim's cwd is + used by default. + + - "env": Environment variables for child process. + + - "settings": Settings for languageserver, received on server + initialization. + + - "trace.server": Trace level of communication between server and + client that showed with output channel, open output channel by + command `:CocCommand workspace.showOutput` + + - "stdioEncoding": Encoding used for stdio of child process. + + - "initializationOptions": Initialization options passed to + languageserver (it's deprecated) + + - "rootPatterns": Root patterns used to resolve rootPath from current + file. + + - "requireRootPattern": If true, doesn't start server when root + pattern not found. + + - "ignoredRootPaths": Absolute root paths that language server should + not use as rootPath, higher priority than rootPatterns. + + - "disableDynamicRegister": Disable dynamic registerCapability feature + for this languageserver to avoid duplicated feature registration. + + - "disableSnippetCompletion": Disable snippet completion feature for + this languageserver. + + - "disabledFeatures": Disable features for this languageserver, + valid keys: +> + ["completion", "configuration", "workspaceFolders", "diagnostics", + "willSave", "willSaveUntil", "didSaveTextDocument", + "fileSystemWatcher", "hover", "signatureHelp", "definition", + "references", "documentHighlight", "documentSymbol", + "workspaceSymbol", "codeAction", "codeLens", "formatting", + "documentFormatting", "documentRangeFormatting", + "documentOnTypeFormatting", "rename", "documentLink", + "executeCommand", "pullConfiguration", "typeDefinition", + "implementation", "declaration", "color", "foldingRange", + "selectionRange", "progress", "callHierarchy", "linkedEditing", + "fileEvents", "semanticTokens"] +< + - "formatterPriority": Priority of this languageserver's formatter. + + - "revealOutputChannelOn": Configure message level to show the output + channel buffer. + + - "progressOnInitialization": Enable progress report on languageserver + initialize. + +Language server start with command:~ + + Additional fields can be used for a command languageserver: + + - "command": Executable program name in $PATH or absolute path of + executable used for start languageserver. + + - "args": Command line arguments of command. + + - "detached": Detach language server when is true. + + - "shell": Use shell for server process, default: `false` + +Language server start with module:~ + + Additional fields can be used for a languageserver started by node + module: + + - "module": Absolute filepath of Javascript file. + + - "args": Extra arguments used on fork Javascript module. + + - "runtime": Absolute path of node runtime, node runtime of coc.nvim + is used by default. + + - "execArgv": ARGV passed to node on fork, normally used for + debugging, example: `["--nolazy", "--inspect-brk=6045"]` + + - "transport": Transport kind used by server, could be 'ipc', 'stdio', + 'socket' and 'pipe'. 'ipc' is used by default (recommended). + + - "transportPort": Port number used when transport is 'socket'. + +Language server use initialized socket server:~ + + - "port": Port number of socket server. + + - "host": Host of socket server, default to `127.0.0.1`. + +============================================================================== +vim:tw=78:nosta:noet:ts=8:sts=0:ft=help:noet:fen: diff --git a/_vim/.vim/plugged/coc.nvim/doc/coc.txt b/_vim/.vim/plugged/coc.nvim/doc/coc.txt index 5f5fbc2..c1b6d62 100644 --- a/_vim/.vim/plugged/coc.nvim/doc/coc.txt +++ b/_vim/.vim/plugged/coc.nvim/doc/coc.txt @@ -1,75 +1,116 @@ -*coc-nvim.txt* LSP support for Vim & Neovim. +*coc-nvim.txt* NodeJS client for Vim & Neovim. -Version: 0.0.57 +Version: 0.0.82 Author: Qiming Zhao -License: MIT license +License: Anti 996 license CONTENTS *coc-contents* Introduction |coc-introduction| Requirements |coc-requirements| Installation |coc-installation| +Extensions |coc-extensions| Configuration |coc-configuration| -Completion |coc-completion| +Floating windows |coc-floating| +LSP features |coc-lsp| + Document |coc-document| + Hover |coc-hover| + Completion |coc-completion| + Diagnostics |coc-diagnostics| + Pull diagnostics |coc-pullDiagnostics| + Locations |coc-locations| + Rename |coc-rename| + Signature help |coc-signature| + Inlay hint |coc-inlayHint| + Format |coc-format| + Code action |coc-code-actions| + Document highlights |coc-document-highlights| + Document colors |coc-document-colors| + Document links |coc-document-links| + Snippets |coc-snippets| + Workspace |coc-workspace| + Cursors |coc-cursors| + Outline |coc-outline| + Call hierarchy |coc-callHierarchy| + Type hierarchy |coc-typeHierarchy| + Semantic highlights |coc-semantic-highlights| + Fold |coc-fold| + Selection range |coc-selection-range| + Code Lens |coc-code-lens| + Linked editing |coc-linked-editing| Interface |coc-interface| Key mappings |coc-key-mappings| - Variables |coc-variables| - Functions |coc-functions| - Commands |coc-commands| - Autocmds |coc-autocmds| + Variables |coc-variables| + Buffer variables |coc-buffer-variables| + Global variables |coc-global-variables| + Functions |coc-functions| + Commands |coc-commands| + Autocmds |coc-autocmds| Highlights |coc-highlights| +Tree |coc-tree| + Tree mappings |coc-tree-mappings| + Tree filter |coc-tree-filter| List |coc-list| List command |coc-list-command| + List command options |coc-list-options| List configuration |coc-list-configuration| List mappings |coc-list-mappings| list sources |coc-list-sources| - Location |coc-list-location| - Extensions |coc-list-extensions| - Diagnostics |coc-list-diagnostics| - Outline |coc-list-outline| - Symbols |coc-list-symbols| - Services |coc-list-services| - Commands |coc-list-commands| - Links |coc-list-links| - Output |coc-list-output| - Sources |coc-list-completion-sources| - Lists |coc-list-lists| -Statusline support |coc-status| - Manual |coc-status-manual| - Airline |coc-status-airline| - Lightline |coc-status-lightline| +Dialog |coc-dialog| + Dialog basic |coc-dialog-basic| + Dialog confirm |coc-dialog-confirm| + Dialog input |coc-dialog-input| + Dialog menu |coc-dialog-menu| + Dialog picker |coc-dialog-picker| +Notification |coc-notification| +Statusline integration |coc-status| + Manual |coc-status-manual| + Airline |coc-status-airline| + Lightline |coc-status-lightline| FAQ |coc-faq| Changelog |coc-changelog| ============================================================================== INTRODUCTION *coc-introduction* -Coc.nvim enhances your (Neo)Vim to match the user experience provided by VSCode -through rich plugin ecosystem and Language Server Protocol support. +Coc.nvim enhances your (Neo)Vim to match the user experience provided by +VSCode through a rich extension ecosystem and implemented features specified +by Language Server Protocol (3.16 for now). -Some of the features include:~ +Some features (like completion) automatically works by default, all of them +can be disabled by |coc-configuration|. -- APIs that are compatible with both Vim (>= 8.0) and Neovim. +Some of its key features include:~ + +- APIs compatible with both Vim8 and Neovim. - Loading VSCode-like extensions. -- Configuring coc.nvim and its extensions by using JSON configuration file. -- Configuring Language Servers that implement Language Server Protocol (LSP). +- Configuring coc.nvim and its extensions with JSON configuration + |coc-configuration|. +- Configuring Language Servers that using Language Server Protocol (LSP) + |coc-config-languageserver|. + +It is designed for best possible integration with other Vim plugins. + +Note: coc.nvim doesn't come with support for any specific language. You +will need to install coc.nvim extensions |coc-extensions| or set up the +language server by use |coc-config-languageserver|. -It's designed to have a good integration with other Vim plugins as much as -possible. +Note: multiple language servers for same document is allowed, but you should +avoid configure same language server that already used by coc.nvim extension. -Coc.nvim is configurable and you can control the features that you want -through the options for the best experience. +Note: automatic completion plugins can't play nicely together, you can disable +automatic completion of coc.nvim through `"suggest.autoTrigger": "none"` (or +`"suggest.autoTrigger": "trigger"`) in your configuration file. ============================================================================== REQUIREMENTS *coc-requirements* -Note: this plugin requires Neovim >= 0.3.0 or Vim >= 8.0. +Neovim >= 0.4.0 or Vim >= 8.1.1719. -* Neovim >= 0.3.0 or Vim >= 8.0 -* NodeJS (download from https://nodejs.org/en/download/ or install through your - favorite package manager) +NodeJS https://nodejs.org/ >= 14.14.0. -If those requirements are not satisfied, the plugin will not load at all. +Yarn https://yarnpkg.com/ required to build coc.nvim from typescript source +code. ============================================================================== INSTALLATION *coc-installation* @@ -78,654 +119,1259 @@ If you're using [vim-plug](https://github.com/junegunn/vim-plug), add this to your `init.vim` or `.vimrc`: > Plug 'neoclide/coc.nvim', {'branch': 'release'} - +< And run: > :PlugInstall -For other plugin managers, use code from release branch. +For other plugin managers, make sure to use code from the release branch +(unless you want to build from typescript source code). -Or use Vim's built in plugin ecosystem: > +To use Vim's native |packages| on Linux or MaxOS, use script like: > #!/bin/sh # for vim8 mkdir -p ~/.vim/pack/coc/start cd ~/.vim/pack/coc/start curl --fail -L https://github.com/neoclide/coc.nvim/archive/release.tar.gz|tar xzfv - + vim -c 'helptags ~/.vim/pack/coc/start/doc|q' + # for neovim mkdir -p ~/.local/share/nvim/site/pack/coc/start cd ~/.local/share/nvim/site/pack/coc/start curl --fail -L https://github.com/neoclide/coc.nvim/archive/release.tar.gz|tar xzfv - + nvim -c 'helptags ~/.local/share/nvim/site/pack/coc/start|q' + +when using source code of coc.nvim, you'll have to install +https://yarnpkg.com/ and run `yarn install` in project root of coc.nvim. + +============================================================================== +EXTENSIONS *coc-extensions* + +To provide LSP features of different filetypes, the user have to config +|coc-config-languageserver| or install coc extensions. + +Coc extensions are more powerful since they could contribute json schemes, +commands, and use middleware methods of languageserver to provide better +results. It's also possible to provide features that beyond LSP. + +Coc extensions are loaded from `"extensions"` folder inside +|coc#util#get_data_home()| and folders in 'runtimepath' when detected. + +Install extensions from git (not recommended):~ + +- Download the source code. +- In project root, install dependencies and compile the code by `yarn install` + (needed by most coc extensions). +- Add the project root to vim's runtimepath by `set runtimepath^=/path/to/project` + +Plugin manager like [vim-plug] can be used as well. + +Note: use coc extensions from source code requires install dependencies, which +may take huge disk usage. + + *coc-extensions-npm* +Install global extensions from npm (recommended):~ + +Use |:CocInstall| to install coc extensions from vim's command line. + +To make coc.nvim install extensions on startup, use |g:coc_global_extensions|. + +To use package manager other than npm (like `yarn` or `pnpm`), use +|coc-config-npm-binPath|. + +To customize npm registry for coc.nvim add `coc.nvim:registry` in your +`~/.npmrc`, like: +> + coc.nvim:registry=https://registry.mycompany.org/ +< +To customize extension folder, configure |g:coc_data_home|. +Uninstall global extensions:~ + +Use |:CocUninstall|. + +Update global extensions:~ + +Use |:CocUpdate| or |:CocUpdateSync|. + +To update extensions automatically, config |coc-preferences-extensionUpdateCheck|. + +Manage extensions list:~ + +Use |coc-list-extensions| by `:CocList extensions` to open extensions list. +Use |CocAction('extensionStats')| to get list of extensions. + +Single file extensions:~ + +All Javascript files that ends with `.js` inside the folder +|g:coc_config_home| + '/coc-extensions' are considered as coc extensions, for +example: +> + const {window} = require('coc.nvim') + + exports.activate = context => { + window.showInformationMessage("message from extension") + } +< ============================================================================== CONFIGURATION *coc-configuration* -Most of coc.nvim configuration is stored within `coc-settings` file that can -be opened using `:CocConfig`. This will open either the global configuration -file (located at `$HOME/.vim/coc-settings.json` or -`$HOME/.config/nvim/coc-settings.json` by default) or the local configuration -file which is located under the project root: `$ROOT/.vim/coc-settings.json` -(see `b:coc_root_patterns` for more information about project root). The -location of global configuration can be modified using `g:coc_config_home`. +The configuration of coc.nvim is stored in file `coc-settings.json`. -To enable JSON completion and validation support of the settings file, install -the `coc-json` extension: `:CocInstall coc-json`. +Configuration properties are contributed by coc.nvim itself and coc.nvim +extensions. See |coc-config| for builtin configurations. -Check out https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file -for more details. +The configuration files are all in JSON format (with comment supported), it's +recommended to enable JSON completion and validation by install the `coc-json` +extension: > -Built in configurations:~ + :CocInstall coc-json +< +Global configuration file:~ -"http.proxy":~ +Command |:CocConfig| will open (create when necessary) a user settings +file in the folder returned by |coc#util#get_config_home()|. - HTTP proxy URI, used for extensions that send request, default: `""` +The user configuration can also be changed by API |coc#config()|. -"http.proxyStrictSSL":~ +The global configuration file can be created in another directory by setting +|g:coc_config_home| in your vimrc like: > - default: `true` + let g:coc_config_home = '/path/to/folder' -"suggest.enablePreselect":~ +Folder configuration file:~ - Enable preselect feature on Neovim, default: `true` +To create a local configuration file for a specific workspace, use +|:CocLocalConfig| to create and open `.vim/coc-settings.json` in current +workspace folder. -"suggest.maxPreviewWidth":~ +Folder configuration would overwrite user configuration. - Maximum width of floating preview window, default: `80` + *coc-configuration-scope* +Configuration scope:~ -"suggest.labelMaxLength":~ +A configuration could be one of three different configuration scopes: - Maximum length of label shown in 'pum', default: `200` +- "application" the configuration could only be changed in user configuration + file. -"suggest.enablePreview":~ +- "resource" the configuration could be changed in user and workspace folder + configuration file. - Add preview option to 'completeopt', default: `false` +- "language-overridable" the configuration could be changed in user and + workspace folder configuration file, and can be use used in language scoped + configuration section like `[typescript][json]`. -"suggest.floatEnable"~ +============================================================================== +FLOATING WINDOWS *coc-floating* + +Floating windows/popups are created by |api-floatwin| on neovim or |popupwin| +on vim. + *coc-floating-scroll* +Scroll floating windows:~ - Enable floating window for documentation when possible, default: `true` +See |coc#float#has_scroll()| for example. -"suggest.detailMaxLength":~ +Note: use |coc#pum#scroll()| for scroll popup menu. - Max length of detail that will be shown in popup menu, default: `100` + *coc-floating-close* +Close floating windows:~ -"suggest.detailField":~ +To close all floating windows/popups use |coc#float#close_all()| or +|popup_clear()| on vim. Or you can use o on neovim which close all +split windows as well. - Where to add the detail in complete item when it's less than max - length, default: `"menu"` +To close single floating window/popup, use |coc#float#close()|. - Valid options: ["abbr", "menu", "preview"] + *coc-floating-focus* +Focus floating windows:~ -"suggest.autoTrigger":~ +On neovim, use w (or |(coc-float-jump)|) could focus a floating +window just created (if it's focusable). It's not allowed to focus popups on +vim, unless it's using terminal buffer. - How should completion be triggered, default: `"always"` + *coc-floating-config* +Configure floating windows:~ - Valid options: ["always", "trigger", "none"] +To set custom window options on floating window create, use autocmd +|CocOpenFloat| or |CocOpenFloatPrompt|. -"suggest.languageSourcePriority":~ +Related variables: - Priority of language sources, default: `99` +- |g:coc_last_float_win| +- |g:coc_borderchars| +- |g:coc_border_joinchars| +- |g:coc_markdown_disabled_languages| -"suggest.numberSelect":~ +Related highlight groups: - Input number to select complete item, it could be wrong when - using '' and '' to select complete item, default: `false` +- |CocFloating| For floating window background. +- |CocFloatDividingLine| For dividing lines. +- |CocMenuSel| For selected line. +- |CocUnderline| For active parts. -"suggest.disableKind":~ +To customize floating windows used by popup menu. Use configurations: - Remove kind field from Vim complete item, default: `false` +- |coc-config-suggest-floatConfig| +- |coc-config-suggest-pumFloatConfig| -"suggest.disableMenu":~ +For floating windows created around cursor, like diagnostics, hover and +signature use |coc-config-floatFactory-floatConfig| for common float +configurations. For further customization, use: - Remove menu field from Vim complete item, default: `false` +- |coc-config-diagnostic-floatConfig| +- |coc-config-signature-floatConfig| +- |coc-config-hover-floatConfig| -"suggest.snippetIndicator":~ +For customize dialog windows, use |coc-config-dialog|. +For customize notification windows, use |coc-config-notification|. - The character used in completion item abbreviation to indicate it - expands as code snippet, default: `"~"` +============================================================================== +LSP FEATURES *coc-lsp* -"suggest.maxCompleteItemCount":~ +All features (except for telemetry) of LSP 3.16 are supported, checkout +the specification at +https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/ - Maximum number of complete items shown in Vim, default: `50` +LSP features only works with attached document, see |coc-document-attached|. -"suggest.preferCompleteThanJumpPlaceholder":~ +To check exists providers of current buffer, use command +`:CocCommand document.checkBuffer` or |CocHasProvider()|. - Confirm completion instead of jump to next placeholder when completion - activates, default: `false` +For historic reason, some features just works, but some are not. -"suggest.fixInsertedWord":~ +Features automatically work by default:~ - Inserted word replaces the next one, default: `true` +- Trigger completion |coc-completion|. +- Diagnostics refresh |coc-diagnostics|. +- Pull diagnostics |coc-pullDiagnostics|. +- Trigger signature help |coc-signature|. +- Inlay hints |coc-inlayHint| -"suggest.localityBonus":~ +Most features could be disabled/enabled by |coc-configuration| and some +vim variables. - Boost suggestions that appear closer to the cursor position, - default: `true` +Features require enabled by configuration:~ -"suggest.triggerAfterInsertEnter":~ +- Semantic highlights |coc-semantic-highlights|. +- Document color highlights |coc-document-colors|. +- Code lens, |coc-code-lens| +- Linked editing, |coc-linked-editing.| +- Format on type, enabled by |coc-preferences-formatOnType| +- Format on save, enabled by |coc-preferences-formatOnSaveFiletypes|. - Trigger completion after 'InsertEnter'. Requires "suggest.autoTrigger" - to be set, default: `false` +Features requested by user:~ -"suggest.timeout":~ +- Locations related (including definitions, references etc.) |coc-locations| +- Invoke code action |coc-code-actions|. +- Show call hierarchy tree |coc-callHierarchy|. +- Show type hierarchy tree |coc-typeHierarchy| +- Format, range format and on type format |coc-format|. +- Highlight same symbol ranges |coc-document-highlights|. +- Outline of document symbols |coc-outline| and |coc-list-symbols|. +- Show hover information |coc-hover|. +- Rename symbol under cursor |coc-rename|. +- Open link under cursor |coc-document-links|. +- Selection range |coc-selection-range| +- Create folding ranges |coc-fold|. - Timeout for completion (unit: milliseconds), default: `2000` +For convenient, some actions have associated |coc-key-mappings| provided. +Prefer |CocAction()| for more options. -"suggest.minTriggerInputLength":~ +Features triggered by languageserver:~ - Number of characters in the current word after which the completion - triggers, default: `1` +- Show message notification (use |coc-notification|). +- Show message request (use |coc-dialog-menu|). +- Log message notification (use `:CocCommand workspace.showOutput` to show + output). +- Show document request (opened by vim or your browser for url). +- Work done progress (use |coc-notification|). -"suggest.triggerCompletionWait":~ +To make coc.nvim provide LSP features for your languages, checkout +https://github.com/neoclide/coc.nvim/wiki/Language-servers - Delay between typing the trigger character and completion start which - initiates server synchronization, default: `60` +To debug issues with languageserver, checkout +https://github.com/neoclide/coc.nvim/wiki/Debug-language-server -"suggest.echodocSupport":~ +------------------------------------------------------------------------------ +DOCUMENT *coc-document* - Add function signature to `user_data.signature` to support `echodoc.vim`, - default: `false` +An associated document is created on buffer create, and disposed on buffer +unload. -"suggest.acceptSuggestionOnCommitCharacter":~ +Attached document:~ + *coc-document-attached* - The server provides a set of commit characters: these characters can - trigger completion item acceptance. This also inserts commit character - after the completion item text. Requires `CompleteChanged` event to work, - default: `false` +An attached document means coc.nvim synchronize the lines of vim's buffer with +associated document automatically. -"suggest.noselect":~ +Only attached documents are synchronized with language servers and therefore +LSP features could be provided for the attached buffer. - Prevent Vim from selecting the first item on completion start, - default: `true` +The buffer may not be attached by following reasons: -"suggest.keepCompleteopt":~ +- The 'buftype' is neither nor 'acwrite', (could be bypassed by + |b:coc_force_attach|). +- Buffer variable |b:coc_enabled| is `0`. +- Byte length of buffer exceed |coc-preferences-maxFileSize|. +- Buffer is used for command line window. - When enabled, 'completeopt' is not overridden. Autocompletion will be - disabled if 'completeopt' doesn't have 'noinsert' and 'noselect', default: - `false` +Use |CocAction('ensureDocument')| or `:CocCommand document.checkBuffer` to +check attached state of current buffer. -"suggest.lowPrioritySourceLimit":~ +Filetype map:~ + *coc-document-filetype* - Max items count for source priority lower than `90`. +Some filetypes are mapped to others to match the languageId used by VSCode, +including: -"suggest.highPrioritySourceLimit":~ +- javascript.jsx -> javascriptreact +- typescript.jsx -> typescriptreact +- typescript.tsx -> typescriptreact +- tex -> latex - Max items count for source priority bigger than or equal to `90`. +Use |g:coc_filetype_map| to create additional filetype maps. -"suggest.completionItemKindLabels":~ +Use `:CocCommand document.echoFiletype` to echo mapped filetype of current +document. - Set custom labels to completion item kinds., default: `{}`. +Note make sure use mapped filetypes for configurations that expect filetypes. - Example configuration: with https://nerdfonts.com: > +------------------------------------------------------------------------------ +HOVER *coc-hover* - "suggest.completionItemKindLabels": { - "keyword": "\uf1de", - "variable": "\ue79b", - "value": "\uf89f", - "operator": "\u03a8", - "function": "\u0192", - "reference": "\ufa46", - "constant": "\uf8fe", - "method": "\uf09a", - "struct": "\ufb44", - "class": "\uf0e8", - "interface": "\uf417", - "text": "\ue612", - "enum": "\uf435", - "enumMember": "\uf02b", - "module": "\uf40d", - "color": "\ue22b", - "property": "\ue624", - "field": "\uf9be", - "unit": "\uf475", - "event": "\ufacd", - "file": "\uf723", - "folder": "\uf114", - "snippet": "\ue60b", - "typeParameter": "\uf728", - "default": "\uf29c" - } +Hover feature provide information at a given text document position, normally +include type information and documentation of current symbol. + +Hover functions:~ + +- ||CocAction('doHover')| Show hover information at cursor position. +- |CocAction('definitionHover')||| Show hover information with definition + context at cursor position. +- |CocAction('getHover')| Get hover documentations at cursor position. + + *coc-hover-example* +Hover key-mapping example:~ +> + nnoremap K :call ShowDocumentation() + " Show hover when provider exists, fallback to vim's builtin behavior. + function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('definitionHover') + else + call feedkeys('K', 'in') + endif + endfunction < +------------------------------------------------------------------------------ +COMPLETION *coc-completion* -"diagnostic.enable":~ +The builtin completion of vim is no longer used, the default completion +behavior works like VSCode: - Display diagnostics, default: `true` +- Completion is automatically triggered by default. +- Item selection is enabled by default, use |coc-config-suggest-noselect| to + disable default selection. +- When selection enabled and no preselect item exists, recent used item that + matched will be selected by default. +- Snippet and additional edits only work after confirm completion. +- 'completeopt' is not used and APIs of builtin popupmenu not work. -"diagnostic.level":~ + *coc-completion-default* +Default Key-mappings:~ - Filter diagnostics by severity, default: `"hint"` +To make the completion work like builtin completion without configuration, +following key-mappings are used when the {lhs} is not mapped: - Valid options: ["hint", "information", "warning", "error"] +Use , , and to navigate completion list: > -"diagnostic.checkCurrentLine":~ + inoremap coc#pum#visible() ? coc#pum#next(1) : "\" + inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" + inoremap coc#pum#visible() ? coc#pum#next(0) : "\" + inoremap coc#pum#visible() ? coc#pum#prev(0) : "\" +< +Use and to scroll: > - Show all diagnostics of the current line if none of them are at the current - position, default: `false` + inoremap coc#pum#visible() ? coc#pum#scroll(1) : "\" + inoremap coc#pum#visible() ? coc#pum#scroll(0) : "\" +< +Use and to cancel and confirm completion: > -"diagnostic.messageTarget":~ + inoremap coc#pum#visible() ? coc#pum#cancel() : "\" + inoremap coc#pum#visible() ? coc#pum#confirm() : "\" - Diagnostic message target, default: `"float"` +Note: and are not remapped by coc.nvim. - Valid options: ["echo", "float"] + *coc-completion-variables* +Related variables:~ -"diagnostic.joinMessageLines":~ +- Disable completion for buffer: |b:coc_suggest_disable| +- Disable specific sources for buffer: |b:coc_disabled_sources| +- Disable words for trigger completion: |b:coc_suggest_blacklist| +- Add additional keyword characters: |b:coc_additional_keywords| - Join messages to reduce the number of lines shown in the floating window, - default: `false` + *coc-completion-functions* +Related functions:~ -"diagnostic.refreshOnInsertMode":~ +- Trigger completion with options: |coc#start()|. +- Trigger completion refresh: |coc#refresh()|. +- Select and confirm completion: |coc#_select_confirm()|. +- Check if customized popupmenu is visible: |coc#pum#visible()|. +- Select next complete item: |coc#pum#next()|. +- Select previous complete item: |coc#pum#prev()|. +- Cancel completion and reset trigger text: |coc#pum#cancel()|. +- Confirm completion: |coc#pum#confirm()|. +- Close the popupmenu only: |coc#pum#stop()|. +- Get information of the popupmenu: |coc#pum#info()|. +- Select specific complete item: |coc#pum#select()|. +- Insert word of selected item and finish completion: |coc#pum#insert()|. +- Scroll popupmenu: |coc#pum#scroll()|. - Refresh diagnostics when in insert mode, default: `false` + *coc-completion-customize* +Customize completion:~ -"diagnostic.refreshAfterSave":~ +Use |coc-config-suggest| to change behavior of completion. - Refresh diagnostics after save, default: `false` +Use 'pumwidth' for configure minimal width of popupmenu and 'pumheight' +for maximum height. -"diagnostic.displayByAle":~ +Related Highlight groups: + |CocPum| for highlight groups of customized pum. + |CocSymbol| for kind icons. + |CocMenuSel| for background highlight of selected item. - Use ALE for displaying diagnostics. This will disable coc.nvim for - displaying diagnostics. Restart to make changes take the effect, default: - `false` +Note: background, border and winblend are configured by +|coc-config-suggest-floatConfig|. -"diagnostic.virtualText":~ +Example user key-mappings:~ + *coc-completion-example* - Use Neovim virtual text to display diagnostics, default: `false` +Note: use command `:verbose imap` to check current insert +key-mappings when your key-mappings not work. -"diagnostic.virtualTextPrefix":~ +Use and to navigate completion list: > - The prefix added for virtual text diagnostics, default: `" "` + function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~ '\s' + endfunction -"diagnostic.virtualTextLines":~ + " Insert when previous text is space, refresh completion if not. + inoremap + \ coc#pum#visible() ? coc#pum#next(1): + \ CheckBackspace() ? "\" : + \ coc#refresh() + inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" - The number of non-empty lines from a diagnostic to display, default: `3` +Use to trigger completion: > -"diagnostic.virtualTextLineSeparator":~ + if has('nvim') + inoremap coc#refresh() + else + inoremap coc#refresh() + endif +< +Use to confirm completion, use: > - The text that will mark a line end from the diagnostic message, - default: `" \\ "` + inoremap coc#pum#visible() ? coc#_select_confirm() : "\" +< +To make to confirm selection of selected complete item or notify coc.nvim +to format on enter, use: > -"diagnostic.enableSign":~ + inoremap coc#pum#visible() ? coc#_select_confirm() + \: "\u\\=coc#on_enter()\" - Enable signs for diagnostics, default: `true` +Map for trigger completion, completion confirm, snippet expand and jump +like VSCode: > -"diagnostic.enableMessage":~ + inoremap + \ coc#pum#visible() ? coc#_select_confirm() : + \ coc#expandableOrJumpable() ? + \ "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : + \ CheckBackspace() ? "\" : + \ coc#refresh() - When to enable echo messages of diagnostics., default: `"always"` + function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction - Valid options: ["always","jump","never"] + let g:coc_snippet_next = '' +< +Note: the `coc-snippets` extension is required for this to work. -"diagnostic.locationlist":~ +------------------------------------------------------------------------------ +DIAGNOSTICS SUPPORT *coc-diagnostics* - Create location list for error & warning, default: `true` +Diagnostics of coc.nvim are automatically refreshed to UI by default, checkout +|coc-config-diagnostic| for available configurations. -"diagnostic.highlightOffset":~ +Note most language servers only send diagnostics for opened buffers for +performance reason, some lint tools could provide diagnostics for all files in +workspace. - Offset number of buffer.addHighlight, Neovim only., default: `1000` +Note pull diagnostics feature is added in LSP 3.17, which is not available +yet. -"diagnostic.signOffset":~ + *coc-diagnostics-refresh* +Changes on diagnostics refresh~ - Offset number of sign, default: `1000` +- Add highlights for diagnostic ranges and virtual text (when enabled on + neovim or vim >= 9.0.0067), see |coc-highlights-diagnostics|. +- Add diagnostic signs to 'signcolumn', use `set signcolumn=yes` to avoid + unnecessary UI refresh. +- Update variable |b:coc_diagnostic_info|. +- Refresh related |location-list| which was opened by |:CocDiagnostics|. -"diagnostic.errorSign":~ +Diagnostics are not refreshed when buffer is hidden, and refresh on insert +mode is disabled by default. - Sign of error diagnostics shown in the 'signcolumn', default: `">>"` +Diagnostics highlights:~ -"diagnostic.warningSign":~ +See |coc-highlights-diagnostics|. - Sign of warning diagnostics shown in the 'signcolumn', default: `"⚠"` + *coc-diagnostics-toggle* +Enable and disable diagnostics~ -"diagnostic.infoSign":~ +Use |coc-config-diagnostic-enable| to toggle diagnostics feature. - Sign of info diagnostics shown in the 'signcolumn', default: `">>"` +Use |CocAction('diagnosticToggle')| for enable/disable diagnostics feature. -"diagnostic.hintSign":~ +Use |CocAction('diagnosticToggleBuffer')| for enable/disable diagnostics of +current buffer. - Sign of info diagnostics shown in the 'signcolumn', default: `">>"` +Show diagnostic messages~ -"diagnostic.maxWindowHeight":~ +Diagnostic messages would be automatically shown/hide when the diagnostics +under cursor position changed (use float window/popup when possible) by +default. - Maximum height of diagnostics floating window, default: `8` +To manually refresh diagnostics messages, use |(coc-diagnostic-info)| +and |CocAction('diagnosticPreview')|. -"signature.enable":~ + *coc-diagnostics-jump* +Jump between diagnostics~ - Enable signature help when trigger character typed. Requires service restart - on change, default: `true` +Use key-mappings: -"signature.triggerSignatureWait":~ + |(coc-diagnostic-next)| jump to next diagnostic. + |(coc-diagnostic-prev)| jump to previous diagnostic. + |(coc-diagnostic-next-error)| jump to next error. + |(coc-diagnostic-prev-error)| jump to previous error. - Delay for signature request trigger (milliseconds), default: `50`. - Change to higher value for slow Language Servers. +Check all diagnostics~ -"signature.target":~ +Use |coc-list-diagnostics| to open |coc-list| with all available diagnostics. - Target of signature help, use `"float"` when possible by default. +Use API |CocAction('diagnosticList')| to get list of all diagnostics. - Valid options: ["float", "echo"] +------------------------------------------------------------------------------ +PULL DIAGNOSTICS SUPPORT *coc-pullDiagnostics* -"signature.preferShownAbove":~ +Diagnostics are pulled for visible documents when supported by languageserver. +Pull for workspace diagnostics is also enabled by default. - Show signature help's floating window above cursor when possible. Requires - restart on change, default: `true` +Document diagnostics are pulled on change by default, and can be +configured to be pulled on save. -"signature.hideOnTextChange":~ +Checkout |coc-config-pullDiagnostic| for related configurations. - Hide signature help's floating window when text changed. Requires restart - on change, default: `false` +------------------------------------------------------------------------------ +LOCATIONS SUPPORT *coc-locations* -"signature.maxWindowHeight":~ +There're different kinds of locations, including "definitions", "declarations", +"implementations", "typeDefinitions" and "references". - Maximum height of floating window with the signature help, default: `8` +Key-mappings for invoke locations request~ -"codeLens.enable":~ +- |(coc-definition)| +- |(coc-declaration)| +- |(coc-implementation)| +- |(coc-type-definition)| +- |(coc-references)| +- |(coc-references-used)| - Enable `codeLens` feature. Requires Neovim with virtual text feature, - default: `false` +Error will be shown when the buffer not attached |coc-document-attached|. +Message will be shown when no result found. -"codeLens.separator":~ +Location jump behavior~ - Separator text for `codeLens` in virtual text, default: `"‣"` +When there's only one location returned, the location is opened by command +specified by |coc-preferences-jumpCommand| ("edit" by default), context mark +is added by |m'|, so you can jump back previous location by . -"workspace.ignoredFiletypes":~ +When multiple locations returned, |coc-list-location| is opened for preview +and other further actions. - Filetypes to ignore for workspace folder resolution, - default: `["markdown","log","txt","help"]` +To use |coc-list-location| for single location as well, use +|coc-locations-api| (instead key-mappings provided by coc.nvim). -"list.indicator":~ +To change default options of |coc-list-location| or use other plugin for +list of locations, see |g:coc_enable_locationlist|. - The character used as first character in prompt line, default: `">"` +To use vim's quickfix for locations, use configuration +|coc-preferences-useQuickfixForLocations|. -"list.maxHeight":~ +To use vim's tag list for definitions, use |CocTagFunc()|. - Maximum height of list window, default: `10` + *coc-locations-api* +Related APIs~ -"list.signOffset":~ +- |CocAction('jumpDefinition')| Jump to definition locations. +- |CocAction('jumpDeclaration')| Jump to declaration locations. +- |CocAction('jumpImplementation')| Jump to implementation locations. +- |CocAction('jumpTypeDefinition')| Jump to type definition locations. +- |CocAction('jumpReferences')|| Jump to references. +- |CocAction('jumpUsed')| Jump to references without declarations. +- |CocAction('definitions')| Get definition list. +- |CocAction('declarations')| Get declaration list. +- |CocAction('implementations')| Get implementation list. +- |CocAction('typeDefinitions')| Get type definition list. +- |CocAction('references')| Get reference list. - Sign offset of list, should be different from other plugins, default: `900` +Send custom locations request to languageserver: -"list.selectedSignText":~ +- |CocLocations()| +- |CocLocationsAsync()| - Sign text for selected lines, default: `"*"` +------------------------------------------------------------------------------ +RENAME *coc-rename* -"list.autoResize":~ +Rename provides workspace-wide rename of a symbol. Workspace edit +|coc-workspace-edit| is requested and applied to related buffers when +confirmed. - Enable auto-resize feature, default: `true` +Check if current buffer has rename provider with +`:echo CocAction('hasProvider', 'rename')` -"list.limitLines":~ +Rename key-mappings:~ - Limit lines shown in the list buffer, default: `30000` +- |(coc-rename)| -"list.maxPreviewHeight":~ +Rename functions:~ - Max height for preview window of list, default: `12` +- |CocAction('rename')| Rename the symbol under the cursor. +- |CocAction('refactor')| Open refactor buffer for all references (including + definitions), recommended for function signature refactor. -"list.previewHighlightGroup":~ +Rename local variable:~ - Highlight group used for highlighting the range in preview window, - default: `"Search"` +Use command `:CocCommand document.renameCurrentWord` which uses |coc-cursors| +to edit multiple locations at the same time and defaults to word extraction +when rename provider doesn't exist. -"list.nextKeymap":~ +Rename configuration:~ - Key for selecting next line in the insert mode, default: `""` +Use |coc-preferences-renameFillCurrent| to enable/disable populating prompt +window with current variable name. -"list.previousKeymap":~ +------------------------------------------------------------------------------ +SIGNATURE HELP *coc-signature* + +Signature help for functions is shown automatically when user +types trigger characters defined by the provider, which will use floating +window/popup to show relevant documentation. - Key for selecting previous line in the insert mode, default: `""` +Use |CocAction('showSignatureHelp')| to trigger signature help manually. -"list.extendedSearchMode": ~ +Note error will not be thrown when provider does not exist or nothing is returned +by languageserver, use `echo CocAction('hasProvider', 'signature')` to check +if a signature help provider exists. - Enable extended search mode which allows multiple search patterns delimited - by spaces. +Use |coc-config-signature| to change default signature help behavior. -"list.normalMappings":~ +|CocFloatActive| is used to highlight activated parameter part. - Custom key mappings in the normal mode, default: `{}` +------------------------------------------------------------------------------ +INLAY HINT *coc-inlayHint* -"list.insertMappings":~ +Inlay hint is enabled for all filetypes by default. Inlay hint uses virtual +text which requires neovim >= 0.5.0 or vim >= 9.0.0067. - Custom key mappings in the insert mode, default: `{}` +Note: you may need configure extension or languageserver to make inlay hint +works. -"coc.preferences.maxFileSize":~ +To temporarily toggle inlay hint of current buffer, use command +`:CocCommand document.toggleInlayHint` - Maximum file size in bytes that coc.nvim should handle, default: `'10MB'` +Change highlight group:~ -"coc.preferences.promptWorkspaceEdit":~ +|CocInlayHint| +|CocInlayHintType| +|CocInlayHintParameter| - Prompt confirm from user for workspace edit. - default: `true` +Configure inlay hint support:~ -"coc.preferences.useQuickfixForLocations":~ +|coc-config-inlayHint| - Use Vim's quickfix list for jump locations. Requires restart on change, - default: `false` +------------------------------------------------------------------------------ +FORMAT *coc-format* -"coc.preferences.extensionUpdateCheck":~ +Some tools may reload buffer from disk file during format, coc.nvim only +apply `TextEdit[]` to the document. - Interval for checking extension updates, default: `"daily"` +Don't be confused with vim's indent feature, configure/fix the 'indentexpr' of +your buffer if the indent is wrong after insert new line. - Valid options: ["daily","weekly","never"] + *coc-format-options* +Format options:~ -"coc.preferences.snippetStatusText":~ +Buffer options that affect document format: 'eol', 'shiftwidth' and +'expandtab'. - Text shown in 'statusline' to indicate snippet session is activate, - default: `"SNIP"` +- |b:coc_trim_trailing_whitespace| Trim trailing whitespace on a line. +- |b:coc_trim_final_newlines| Trim all newlines after the final newline at the + end of the file. -"coc.preferences.hoverTarget":~ +Those options are converted to `DocumentFormattingOptions` and transferred to +languageservers before format. The languageservers may only support some of +those options. - Target to show hover information, default is floating window when possible. + *coc-format-document* +Format full document:~ - Valid options: ["preview", "echo", "float"] +Use |CocAction('format')|, you can create a command like: > -"coc.preferences.colorSupport":~ + command! -nargs=0 Format :call CocActionAsync('format') +< +to format current buffer. - Enable color highlight if Language Server support it, default: `true` + *coc-format-ontype* +Format on type:~ -"coc.preferences.previewAutoClose":~ +Format on type is disabled by default, could be enabled by configurations: - Auto close preview window upon cursor move, default: `true` +- |coc-preferences-formatOnType| +- |coc-preferences-formatOnTypeFiletypes| -"coc.preferences.currentFunctionSymbolAutoUpdate":~ +Use `:CocCommand document.checkBuffer` to check if `formatOnType` provider +exists for current buffer. - Automatically update the value of `b:coc_current_function` on `CursorHold` - event, default: `false` +To format on , create key-mapping of that uses |coc#on_enter()|. -"coc.preferences.formatOnInsertLeave":~ +If you don't like the behavior on type bracket characters, configure +|coc-preferences-bracketEnterImprove||. + + *coc-format-selected* +Format selected code:~ + +Use 'formatexpr' for specific filetypes: > + + autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') + +So that |gq| could works for format range of lines. +> +Setup visual mode and operator key-mappings: > - Trigger format on type when insert leave by send \n to the server. - Default: `false` + xmap f (coc-format-selected) + nmap f (coc-format-selected) +< + *coc-format-onsave* +Format on save:~ -"coc.preferences.formatOnSaveFiletypes":~ +Use configuration |coc-preferences-formatOnSaveFiletypes|. - Filetypes for which formatting triggers after saving, default: `[]` +Or create |BufWritePre| autocmd like: > -"coc.preferences.enableFloatHighlight":~ + autocmd BufWritePre * call CocAction('format') +< +Note the operation have to synchronized, avoid use |CocActionAsync()|. +Note to skip the autocmd, use `:noa w` to save the buffer. - Enable highlight for floating window, default: `true` +The operation on save will be timeout after 0.5s by default, configured by +|coc-preferences-willSaveHandlerTimeout| -"coc.preferences.rootPatterns":~ +------------------------------------------------------------------------------ +CODE ACTION *coc-code-actions* - Root patterns to resolve `workspaceFolder` from parent folders of opened - files, resolved from up to down, default: - `[".git",".hg",".projections.json"]` +Code actions are used for ask languageserver to provide specific kind code +changes. -"coc.preferences.watchmanPath":~ +There're different kinds of code actions: - Executable path for https://facebook.github.io/watchman/, detected - from $PATH by default, default: `null` +- `quickfix` used for fix diagnostic(s). +- `refactor` used for code refactor. +- `source` code actions apply to the entire file. +- `organizeImport` organize import statements of current document. -"coc.preferences.jumpCommand":~ +Key-mappings for code actions:~ - Command used for location jump performed for goto definition, goto - references etc, default: `"edit"` +- |(coc-fix-current)| Invoke quickfix action at current line if any. +- |(coc-codeaction-cursor)| Choose code actions at cursor position. +- |(coc-codeaction-line)| Choose code actions at current line. +- |(coc-codeaction)| Choose code actions of current file. +- |(coc-codeaction-selected)| Choose code actions from selected range. - Valid options: ["edit", "split", "vsplit", "tabe", "drop", "tab drop"] +Except for |(coc-fix-current)| which invoke code action directly, +|coc-dialog-menu| would be shown for pick specific code action. -"coc.preferences.messageLevel":~ +To invoke organize import action, use command like: +> + command! -nargs=0 OR :CocCommand editor.action.organizeImport - Message level for filter echoed messages default: `"more"` +Error would be shown when organize import code action not found. - Valid options: ["more", "warning", "error"] +Related APIs~ -"coc.preferences.bracketEnterImprove":~ +- |CocAction('codeActions')| +- |CocAction('organizeImport')| +- |CocAction('fixAll')| +- |CocAction('quickfixes')| +- |CocAction('doCodeAction')| +- |CocAction('doQuickfix')| +- |CocAction('codeActionRange')| - Improve handling of pressing enter inside brackets (`<> {} [] ()`) by - adding a new empty line below and moving the cursor to it. Works with - `coc#on_enter()`, default: `true` +------------------------------------------------------------------------------ +DOCUMENT HIGHLIGHTS *coc-document-highlights* -"coc.preferences.formatOnType":~ +Document highlights is used for highlight same symbols of current document +under cursor. - Set to true to enable format on type, default: `false` +To enable highlight on CursorHold, create an autocmd like this: > -"coc.preferences.formatOnTypeFiletypes":~ + autocmd CursorHold * call CocActionAsync('highlight') +< +Checkout |coc-highlights-document| for related highlight groups. - Filetypes that should run format on typing, default: `[]` +Note error will not be thrown when provider not exists or nothing returned +from languageserver with |CocAction('highlight')| - Note: takes effect when `coc.preferences.formatOnType` set `true`. +Install `coc-highlight` extension if you want to highlight same words under +cursor without languageserver support. -"coc.preferences.snippets.enable":~ +To jump between previous/next symbol position, use +`:CocCommand document.jumpToPrevSymbol` and +`:CocCommand document.jumpToNextSymbol` - Enables snippets support, default: `true` +------------------------------------------------------------------------------ +DOCUMENT COLORS *coc-document-colors* -"list.source.outline.ctagsFilestypes":~ +Document colors added color highlights to vim buffers. To enable document +color highlights, use ||coc-config-colors-filetypes||. - Filetypes that should use `ctags` for outline instead of language server, - default: `[]` +Note: the highlights define gui colors only, make use you have 'termguicolors' +enabled (and your terminal support gui colors) if you're not using gvim. -"npm.binPath":~ +To pick a color from system color picker, use |CocAction('pickColor')| or +choose `editor.action.pickColor` from |:CocCommand|. - Command or full path of npm or yarn executable for install/update - extensions, default: `npm` +Note: may not work on your system. -"languageserver":~ +To change color presentation, use |CocAction('colorPresentation')| or choose +`editor.action.colorPresentation` from |:CocCommand|. - Dictionary of Language Servers, key is the ID corresponding server, - default: `{}` +To highlights colors without languageservers, install +https://github.com/neoclide/coc-highlight ============================================================================== -COMPLETION *coc-completion* +DOCUMENT LINKS *coc-document-links* + +Check if current buffer have documentLink provider by +`:echo CocAction('hasProvider', 'documentLink')` + +Use |coc-list-links| to manage list of links in current document. -Completion triggers automatically by default, you can change completion -behavior in the configuration file. +Document link functions:~ + +- |CocAction('openLink')| Open link under cursor. +- |CocAction('links')| Get link list of current buffer. + +------------------------------------------------------------------------------ +SNIPPETS SUPPORT *coc-snippets* -Tips:~ +Snippets engine of coc.nvim support both VSCode snippets and ultisnips +snippets format. -- 'completeopt' used by coc.nvim default to `noselect,menuone`. +The complete item with snippet format has label ends with +|coc-config-suggest-snippetIndicator| (`~` by default). -- Your 'completeopt' option would be changed and restored during completion, - so you can still use `menu,preview` for Vim's built in completion. +Select the complete item and confirm the completion by |coc#pum#confirm()| or +|coc#_select_confirm()| to expand the snippet of current selected complete +ttem. -- Snippet expand and additional edit feature of LSP requires confirm - completion to work. +Jump snippet placeholders:~ -- Floating window is available in Neovim >= 0.4.0. +|g:coc_snippet_next| and |g:coc_snippet_prev| are used to jump placeholders on +both select mode and insert mode, which defaults to and . Buffer +key-mappings are created on snippet activate, and removed on snippet +deactivate. + +Deactivate snippet session:~ + +A snippet session would be deactivated under the following conditions: + +- |InsertEnter| triggered outside snippet. +- Jump to final placeholder. +- Content change detected after snippet. +- Content changed in a snippet outside placeholder (except for deletion of + plain text). + +To load and expand custom snippets, install `coc-snippets` extension is +recommended. + +Related configurations:~ + +- |g:coc_snippet_prev| +- |g:coc_snippet_next| +- |g:coc_selectmode_mapping| +- |coc-config-suggest-snippetIndicator| +- |coc-config-suggest-preferCompleteThanJumpPlaceholder| +- |coc-config-snippet-highlight| +- |coc-config-snippet-statusText| +- |coc-config-snippet-nextPlaceholderOnDelete| + +Related functions:~ + +- |coc#snippet#next()| +- |coc#snippet#prev()| +- |coc#expandable()| +- |coc#jumpable()| +- |coc#expandableOrJumpable()| + +Related variables, highlights and autocmds:~ + +- |b:coc_snippet_active| Check if snippet session is activated. +- |CocSnippetVisual| For highlight of current placeholders. +- |CocJumpPlaceholder| AutocmdS triggered after placeholder jump. ------------------------------------------------------------------------------ +WORKSPACE SUPPORT *coc-workspace* -Example configuration:~ + *coc-workspace-folders* +Workspace folders~ -Map to trigger completion and navigate to the next item: > +Unlike VSCode which prompt you to open folders, workspace folders of coc.nvim +are resolved from filepath after document attached. - function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~ '\s' - endfunction +A list of file/folder names is used for resolve workspace folder, the patterns +could comes from: - inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() +- |b:coc_root_patterns| +- `rootPatterns` field of configured language server. +- `rootPatterns` contributions from coc extensions. +- |coc-preferences-rootPatterns| +Workspace folder is resolved from cwd of vim first and then from top directory +to the parent directory of current filepath, when workspace folder not +resolved, current working directory is used if it's parent folder of current +buffer. Configurations are provided to change the default behavior: -Map to trigger completion: > +- |coc-config-workspace-ignoredFiletypes| +- |coc-config-workspace-ignoredFolders| +- |coc-config-workspace-bottomUpFiletypes| +- |coc-config-workspace-workspaceFolderCheckCwd| +- |coc-config-workspace-workspaceFolderFallbackCwd| - inoremap coc#refresh() -< - to confirm completion, use: > +Note for performance reason, user's home directory would never considered as +workspace folder, which also means the languageserver that requires workspace +folder may not work when you start vim from home directory. - inoremap pumvisible() ? "\" : "\" +To preserve workspace folders across vim session, |g:WorkspaceFolders| is +provided. + +To manage current workspace folders, use |coc-list-folders| + +To get related root patterns of current buffer, use |coc#util#root_patterns()| + +Use `:CocCommand workspace.workspaceFolders` to echo current workspaceFolders. + + *coc-workspace-edits* +Workspace edit~ + +Workspace edit is used to apply changes for multiple buffers(and files), the +edit could includes document edits and file operations (including file create, +file/directory delete and file/directory rename). + +When the edit failed to apply, coc.nvim will revert the changes (including +document edits and file operations) that previous made. + +Files not loaded would be loaded by `tab drop` command, configured by +|coc-config-workspace-openResourceCommand|. + +To undo and redo workspace edit just applied, use command +`:CocCommand workspace.undo` and `:CocCommand workspace.redo` + +To inspect previous workspace edit, use command +`:CocCommand workspace.inspectEdit`, in opened buffer, use for jump to +change position under cursor. + +------------------------------------------------------------------------------ +CURSORS SUPPORT *coc-cursors* + +Multiple cursors supported is added to allow edit multiple locations at once. + +Cursors session could be started by following ways: + +- Use command `:CocCommand document.renameCurrentWord` to rename variable + under cursor. +- Use |(coc-refactor)| to open refactor buffer. +- Use |:CocSearch| to open searched locations. +- Use cursors related key-mappings to add text range, including + |(coc-cursors-operator)|, |(coc-cursors-word)|, + |(coc-cursors-position)| and |(coc-cursors-range)| +- Ranges added by command `editor.action.addRanges` from coc extensions. + +Default key-mappings when cursors activated: + +- cancel cursors session. +- jump to next cursors range. +- jump to previous cursors range. + +Use |coc-config-cursors| to change cursors related key-mappings. +Use highlight group |CocCursorRange| to change default range highlight. +Use |b:coc_cursors_activated| to check if cursors session is activated. + +------------------------------------------------------------------------------ +SYMBOLS OUTLINE *coc-outline* + +Outline is a split window with current document symbols rendered as +|coc-tree|. + +To show and hide outline of current window, use |CocAction('showOutline')| and +|CocAction('hideOutline')|. + +Outline view has Window variable `cocViewId` set to `OUTLINE`. + +Following outline features are supported: +- Start fuzzy filter by |coc-config-tree-key-activeFilter|. +- Automatic update after document change. +- Automatic reload when buffer in current window changed. +- Automatic follow cursor position by default. +- Different filter modes that can be changed on the fly + |coc-config-outline-switchSortKey|. +- Enable auto preview by |coc-config-outline-togglePreviewKey|. + +Note: outline would try to reload document symbols after 500ms when provider +not registered, which avoid the necessary to check provider existence. + +Checkout |coc-config-tree| and |coc-config-outline| for available +configurations. + +Checkout |CocTree| and |CocSymbol| for customize highlights. + +Use configuration `"suggest.completionItemKindLabels"` for custom icons. + +To show outline for each tab automatically, use |autocmd|: +> + autocmd VimEnter,Tabnew * + \ if empty(&buftype) | call CocActionAsync('showOutline', 1) | endif < -To make auto-select the first completion item and notify coc.nvim to -format on enter, use: > +To close outline when it's the last window automatically, use +|autocmd| like: +> + autocmd BufEnter * call CheckOutline() + function! CheckOutline() abort + if &filetype ==# 'coctree' && winnr('$') == 1 + if tabpagenr('$') != 1 + close + else + bdelete + endif + endif + endfunction +< +Create a key-mapping to toggle outline, like: +> + nnoremap o :call ToggleOutline() + function! ToggleOutline() abort + let winid = coc#window#find('cocViewId', 'OUTLINE') + if winid == -1 + call CocActionAsync('showOutline', 1) + else + call coc#window#close(winid) + endif + endfunction +< +------------------------------------------------------------------------------ +CALL HIERARCHY *coc-callHierarchy* - inoremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" +A call hierarchy is a split |coc-tree| window with locations for incoming or +outgoing calls of function under cursor position. -Map for trigger completion, completion confirm, snippet expand and jump -like VSCode. > +Call hierarchy window is opened by |CocAction('showIncomingCalls')| and +|CocAction('showOutgoingCalls')|. - inoremap - \ pumvisible() ? coc#_select_confirm() : - \ coc#expandableOrJumpable() ? "\=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\" : - \ check_back_space() ? "\" : - \ coc#refresh() +Call hierarchy is configured by |CocSymbol|, |coc-config-callHierarchy| and +|coc-config-tree|. - function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' - endfunction +Related ranges are highlighted with |CocSelectedRange| highlight group in +opened buffer. + +|coc-dialog-menu| could be invoked by |coc-config-tree-key-actions| (default +to ). Available actions: + +- Dismiss. +- Open in new tab. +- Show Incoming Calls. +- Show Outgoing Calls. + +Use in call hierarchy tree to open location in original window. + +------------------------------------------------------------------------------ +TYPE HIERARCHY *coc-typeHierarchy* + +A type hierarchy is a split |coc-tree| window with locations for super types +or sub types from types at current position. + +Type hierarchy window is opened by |CocAction('showSuperTypes')| and +|CocAction('showSubTypes')|. + +Type hierarchy is configured by |CocSymbol|, |coc-config-typeHierarchy| and +|coc-config-tree|. + +Actions are the same as |coc-callHierarchy|. - let g:coc_snippet_next = '' +------------------------------------------------------------------------------ +SEMANTIC HIGHLIGHTS *coc-semantic-highlights* + +Semantic tokens are used to add additional color information to a buffer that +depends on language specific symbol information. + +The feature requires vim >= 8.1.1719 or neovim >= 0.5.0. + +Use |coc-config-semanticTokens-enable| to enable semantic tokens highlights. + +Use `:CocCommand semanticTokens.checkCurrent` to check semantic highlight +information with current buffer. + +To create custom highlights for symbol under cursor, follow these steps: + +- Inspect semantic token by +> + :CocCommand semanticTokens.inspect < -Note: the `coc-snippets` extension is required for this to work. + to check token type and token modifiers with current symbol. -============================================================================== -INTERFACE *coc-interface* +- Create new highlight group by |highlight|, for example: +> + :hi link CocSemDeclarationVariable MoreMsg +< +- Refresh semantic highlight of current buffer by: +> + :CocCommand semanticTokens.refreshCurrent +< +See |CocSem| to customize semantic token highlight groups. + +See |coc-config-semanticTokens| for related configurations. ------------------------------------------------------------------------------ +FOLD *coc-fold* -Coc doesn't come with a default global keymap, you need to configure the -mappings yourself. +Check if current buffer have fold provider by +`:echo CocAction('hasProvider', 'foldingRange')` -Key mappings *coc-key-mappings* +Use |CocAction('fold')| to create folds by request the languageserver and +create manual folds on current window. -Note: Mappings that start with `i_` works for insert mode `n_` works for -normal mode, `v_` works for visual mode. +------------------------------------------------------------------------------ +SELECTION RANGE *coc-selection-range* -(coc-diagnostic-info) *n_coc-diagnostic-info* +Select range forward or backward at cursor position. - Show diagnostic message of current position, no - truncate. +Check if current buffer have selection range provider by +`:echo CocAction('hasProvider', 'selectionRange')` -(coc-diagnostic-next) *n_coc-diagnostic-next* +Selection range key-mappings:~ - Jump to next diagnostic position. +- |(coc-range-select)| Select range forward. +- |(coc-range-select-backward)| Select range backward. -(coc-diagnostic-prev) *n_coc-diagnostic-prev* +Selection range function:~ - Jump to previous diagnostic position. +- |CocAction('rangeSelect')| Visual select previous or next selection range -(coc-diagnostic-next-error) *n_coc-diagnostic-next-error* +------------------------------------------------------------------------------ +CODE LENS *coc-code-lens* - Jump to next diagnostic error position. +Code lens feature shows additional information above or after specific lines. +Only works on neovim by now. -(coc-diagnostic-prev-error) *n_coc-diagnostic-prev-error* +Check if current buffer have code lens provider by +`:echo CocAction('hasProvider', 'codeLens')` - Jump to previous diagnostic error position. +Code lens are not shown by default, use |coc-config-codeLens-enable| to enable, +you may also need enable code lens by configure extension or configured +languageserver. -(coc-definition) *n_coc-definition* +Code lens are automatically requested on buffer create/change, checkout +|coc-config-codeLens| for available configurations. - Jump to definition(s) of current symbol. +------------------------------------------------------------------------------ +LINKED EDITING *coc-linked-editing* -(coc-declaration) *n_coc-declaration* +Linked editing feature enables editing multiple linked ranges at the same time, +for example: html tags. The linked editing ranges would be highlighted with +|CocLinkedEditing| when activated. - Jump to declaration(s) of current symbol. +Check if current buffer have linked editing provider by +`:echo CocAction('hasProvider', 'linkedEditing')` + +Linked editing feature is disabled by default, use +|coc-preferences-enableLinkedEditing| to enable. + +============================================================================== +INTERFACE *coc-interface* + +------------------------------------------------------------------------------ -(coc-implementation) *n_coc-implementation* +Key mappings *coc-key-mappings* - Jump to implementation(s) of current symbol. +There're some cases that local key-mappings are enabled for current buffer. -(coc-type-definition) *n_coc-type-definition* + Snippet jump key-mappings when snippet is activated: + |g:coc_snippet_prev| and |g:coc_snippet_next|. - Jump to type definition(s) of current symbol. + Cursor jump and cancel key-mappings when cursors is activated + |coc-config-cursors|. -(coc-references) *n_coc-references* + Dialog key-mappings for confirm and cancel dialog window + |coc-config-dialog|. - Jump to references of current symbol. + Key-mappings for |CocList| buffer: |coc-list-mappings|. -(coc-format-selected) *n_coc-format-selected* - *v_coc-format-selected* +Note: Use |:verbose| command to check key-mappings that taking effect. - Format selected range, would work in both visual mode - and normal mode, when used in normal mode, the - selection works on the motion object. +Note: Use 'noremap' with will make the key-mapping not work at all. + +Note: key-mappings are provided for convenient, use |CocActionAsync()| or +|CocAction()| for more options. + +Normal mode key-mappings:~ + +*(coc-diagnostic-info)* Show diagnostic message of current position by +invoke |CocAction('diagnosticInfo')| + +*(coc-diagnostic-next)* Jump to next diagnostic position. + +*(coc-diagnostic-prev)* Jump to previous diagnostic position. + +*(coc-diagnostic-next-error)* Jump to next diagnostic error position. + +*(coc-diagnostic-prev-error)* Jump to previous diagnostic error position. + +*(coc-definition)* Jump to definition(s) of current symbol by invoke +|CocAction('jumpDefinition')| + +*(coc-declaration)* Jump to declaration(s) of current symbol by invoke +|CocAction('jumpDeclaration')| + +*(coc-implementation)* Jump to implementation(s) of current symbol by +invoke |CocAction('jumpImplementation')| + +*(coc-type-definition)* Jump to type definition(s) of current symbol by +invoke |CocAction('jumpTypeDefinition')| + +*(coc-references)* Jump to references of current symbol by invoke +|CocAction('jumpReferences')| + +*(coc-references-used)* Jump to references of current symbol exclude +declarations. + +*(coc-format-selected)* + + Format selected range, works on both |visual-mode| and |normal-mode|, + when used in normal mode, the selection works on the motion object. For example: > @@ -735,395 +1381,557 @@ normal mode, `v_` works for visual mode. makes `p` format the visually selected range, and you can use `pap` to format a paragraph. -(coc-format) *n_coc-format* +*(coc-format)* Format the whole buffer by invoke |CocAction('format')| +*(coc-rename)* Rename symbol under cursor to a new word by invoke +|CocAction('rename')| - Format the whole buffer, normally you would like to - use a command like: > +*(coc-refactor)* Open refactor window for refactor of current symbol by +invoke |CocAction('refactor')| - command! -nargs=0 Format :call CocAction('format') -< - to format the current buffer. +*(coc-command-repeat)* Repeat latest |CocCommand|. -(coc-rename) *n_coc-rename* +*(coc-codeaction)* Get and run code action(s) for current file, use +|coc-codeaction-cursor| for same behavior as VSCode. - Rename symbol under cursor to a new word. +*(coc-codeaction-line)* Get and run code action(s) for current line. -(coc-codeaction) *n_coc-codeaction* +*(coc-codeaction-cursor)* Get and run code action(s) using empty range +at current cursor. - Get and run code action(s) for current line. +*(coc-codeaction-selected)* Get and run code action(s) with the selected +region. Works on both |visual-mode| and |normal-mode|. -(coc-codeaction-selected) *n_coc-codeaction-selected* - *v_coc-codeaction-selected* +*(coc-openlink)* Open link under cursor by use |CocAction('openlink')|. - Get and run code action(s) with the selected region. - Works with both normal and visual mode. +*(coc-codelens-action)* Do command from codeLens of current line. +*(coc-fix-current)* Try first quickfix action for diagnostics of current +line. -(coc-openlink) *n_coc-openlink* +*(coc-float-hide)* Hide all float windows/popups created by coc.nvim. - Open link under cursor. +*(coc-float-jump)* Jump to first float window (neovim only), use +|CTRL-W_p| for jump to previous window. -(coc-codelens-action) *n_coc-codelens-action* +*(coc-range-select)* - Do command from codeLens of current line. + Select next selection range. + Works on both |visual-mode| and |normal-mode|. -(coc-fix-current) *n_coc-fix-current* + Note: requires selection ranges feature of language server. - Try to run quickfix action for diagnostics on the - current line. +*(coc-funcobj-i)* -(coc-float-hide) *n_coc-float-hide* + Select inside function. Recommend mapping: + Works on both |visual-mode| and |normal-mode|. + > + xmap if (coc-funcobj-i) + omap if (coc-funcobj-i) +< + Note: Requires 'textDocument.documentSymbol' support from the language + server. - Hide all float windows. +*(coc-funcobj-a)* -(coc-float-jump) *n_coc-float-jump* + Select around function. Works on both |visual-mode| and + |normal-mode|. Recommended mapping: +> + xmap af (coc-funcobj-a) + omap af (coc-funcobj-a) +< + Note: Requires 'textDocument.documentSymbol' support from the language + server. + +*(coc-classobj-i)* + + Select inside class/struct/interface. Works on both |visual-mode| and + |normal-mode|. Recommended mapping: +> + xmap ic (coc-classobj-i) + omap ic (coc-classobj-i) +< + Note: Requires 'textDocument.documentSymbol' support from the language + server. - Jump to first float window. +*(coc-classobj-a)* -(coc-refactor) *n_coc-refactor* + Select around class/struct/interface. Works on both |visual-mode| and + |normal-mode|. Recommended mapping: +> + xmap ac (coc-classobj-a) + omap ac (coc-classobj-a) +< + Note: Requires 'textDocument.documentSymbol' support from the language + server. - Open refactor window for refactor of current symbol. -(coc-range-select) *n_coc-range-select* -(coc-range-select) *v_coc-range-select* +*(coc-cursors-operator)* Add text to cursors session by motion object. - Select next selection range. +*(coc-cursors-word)* Add current word to cursors session. - Note: requires selection ranges feature of language - server, like: coc-tsserver, coc-python +*(coc-cursors-position)* Add current position as empty range to cursors +session. -(coc-range-select-backward) *v_coc-range-select-backward* +Visual mode key-mappings:~ - Select previous selection range. +*(coc-range-select-backward)* - Note: requires selection ranges feature of language - server, like: coc-tsserver, coc-python + Select previous selection range. -(coc-funcobj-i) *n_coc-funcobj-i* *v_coc-funcobj-i* + Note: requires selection ranges feature of language server, like: + coc-tsserver, coc-python - Select inside function, mapped to `if` by default. +*(coc-cursors-range)* Add selection to cursors session. -(coc-funcobj-a) *n_coc-funcobj-a* *v_coc-funcobj-a* +------------------------------------------------------------------------------ +VARIABLES *coc-variables* - Select current function, mapped to `af` by default. +User defined variables:~ ------------------------------------------------------------------------------ -VARIABLES *coc-variables* -b:coc_enabled *b:coc_enabled* +Buffer variables *coc-buffer-variables* + +b:coc_enabled *b:coc_enabled* + + Set to `0` on buffer create if you don't want coc.nvim receive content + from buffer. Normally used with |BufAdd| autocmd, example: +> + " Disable file with size > 1MB + autocmd BufAdd * if getfsize(expand('')) > 1024*1024 | + \ let b:coc_enabled=0 | + \ endif +< +b:coc_force_attach *b:coc_force_attach* - Set to `0` on buffer create if you don't want coc.nvim - receive content from buffer, usually used for improve - performance with large files. + When is `1`, attach the buffer without check the 'buftype' option. + Should be set on buffer create. -b:coc_root_patterns *b:coc_root_patterns* +b:coc_root_patterns *b:coc_root_patterns* - Root patterns used for resolving workspaceFolder for - the current file, will be used instead of - `"coc.preferences.rootPatterns"` setting. E.g.: > + Root patterns used for resolving workspaceFolder for + the current file, will be used instead of + `"coc.preferences.rootPatterns"` setting. Example: > - autocmd FileType python let b:coc_root_patterns = - \ ['.git', '.env'] + autocmd FileType python let b:coc_root_patterns = + \ ['.git', '.env'] < -b:coc_suggest_disable *b:coc_suggest_disable* +b:coc_suggest_disable *b:coc_suggest_disable* + + Disable completion support of current buffer. Example: > - Disable completion support of current buffer. E.g.: > + " Disable completion for python + autocmd FileType python let b:coc_suggest_disable = 1 - " Disable completion for python - autocmd FileType python let b:coc_suggest_disable = 1 +b:coc_disabled_sources *b:coc_disabled_sources* -b:coc_suggest_blacklist *b:coc_suggest_blacklist* + Disabled completion sources of current buffer. Example: +> + let b:coc_disabled_sources = ['around', 'buffer', 'file'] +< +b:coc_diagnostic_disable *b:coc_diagnostic_disable* - Words for which completion should be disabled. E.g.: > + Disable diagnostic support of current buffer. - " Disable completion for 'end' in lua files - autocmd FileType lua let b:coc_suggest_blacklist = ["end"] +b:coc_suggest_blacklist *b:coc_suggest_blacklist* -b:coc_additional_keywords *b:coc_additional_keywords* + List of input words for which completion should not be triggered. + Example: > - Addition keyword characters for generate keywords. E.g.: > + " Disable completion for 'end' in Lua files + autocmd FileType lua let b:coc_suggest_blacklist = ["end"] + +b:coc_additional_keywords *b:coc_additional_keywords* + + Addition keyword characters for generate keywords. Example: > + + " Add keyword characters for CSS + autocmd FileType css let b:coc_additional_keywords = ["-"] + +b:coc_trim_trailing_whitespace *b:coc_trim_trailing_whitespace* + + Trim trailing whitespace on a line, default `0`. + Use by "FormattingOptions" send to the server. + +b:coc_trim_final_newlines *b:coc_trim_final_newlines* + + Trim all newlines after the final newline at the end of the file. + Use by "FormattingOptions" send to the server. + + Other buffer options that affect document format: 'eol', 'shiftwidth' + and 'expandtab'. + + Note: language server may not respect format options. + +------------------------------------------------------------------------------ - " Add keyword characters for css - autocmd FileType css let b:coc_additional_keywords = ["-"] +Global variables *coc-global-variables* -b:coc_current_function *b:coc_current_function* +g:coc_disable_startup_warning *g:coc_disable_startup_warning* - Function string that current cursor in. + Disable possible warning on startup for old vim/node version. - Set `"coc.preferences.currentFunctionSymbolAutoUpdate": true` - in coc-settings.json to update it on CursorHold. + Default: 0 -g:coc_channel_timeout *g:coc_channel_timeout* +g:coc_disable_uncaught_error *g:coc_disable_uncaught_error* - Channel timeout in seconds for request to node client. + Disable uncaught error messages from node process of coc.nvim. - Default: 30 + Default: 0 -g:coc_disable_transparent_cursor *g:coc_disable_transparent_cursor* +g:coc_text_prop_offset *g:coc_text_prop_offset* - Disable transparent cursor when CocList is activated. - Set it to `1` if you have issue with transparent - cursor. + Start |textprop| id offset of highlight namespaces on vim, change to + other value to avoid conflict. - Default: 0 + Default: 1000 -g:coc_last_hover_message *g:coc_last_hover_message* +g:coc_channel_timeout *g:coc_channel_timeout* - Last message echoed from `doHover`, can be used in - statusline. + Channel timeout in seconds for request to node client. - Note: not used when floating or preview window used - for `doHover`. + Default: 30 -g:coc_start_at_startup *g:coc_start_at_startup* +g:coc_disable_transparent_cursor *g:coc_disable_transparent_cursor* - Start coc service on startup, use |CocStart| to start - server when you set it to 0. + Disable transparent cursor when CocList is activated. + Set it to `1` if you have issue with transparent + cursor. - Default: 1 + Default: 0 -g:coc_user_config *g:coc_user_config* +g:coc_start_at_startup *g:coc_start_at_startup* + Start coc service on startup, use |CocStart| to start server when you + set it to 0. - User configuration object, define this variable when - you can't use |coc#config()| + Default: 1 -g:coc_global_extensions *g:coc_global_extensions* +g:coc_global_extensions *g:coc_global_extensions* - Global extension names to install when they aren't - installed, define this variable to a list of extension - names when you can't use |coc#add_extension()| + Global extension names to install when they aren't installed. +> + let g:coc_global_extensions = ['coc-json', 'coc-git'] +< + Note: coc.nvim will try to install extensions that are not installed + in this list after initialization. -g:coc_cygqwin_path_prefixes *g:coc_cygqwin_path_prefixes* +g:coc_uri_prefix_replace_patterns *g:coc_uri_prefix_replace_patterns* - When running under cygwin, the node process will work - with win32 paths, while your Vim process will work - with POSIX paths. You can use this map to map between - paths. For example, your root folder might be - `c:/Users/myUser/workspace` mapped in cygwin as - `/home/myUser/workspace`. In this situation, your node - process might send the `c:/Users/myUser/workspace` - path to your Vim process. To solve this, you need to - define this map: + This map defines URI prefix replacements. This is useful in the case + that an LSP requires code to adhere to a particular directory + structure. For example, `/Users/myUser/workspace` can be mapped to + `/home/myUser/workspace`. +> + let g:coc_uri_prefix_replace_patterns = {'/Users': '/home'} +< +g:coc_enable_locationlist *g:coc_enable_locationlist* - `let g:coc_cygqwin_path_prefixes = ` - ` \{'c:/Users/myUser': '/home/myUser'}` + Use location list of |CocList| when jump to locations. -g:coc_enable_locationlist *g:coc_enable_locationlist* + Set it to 0 when you need customize behavior of location jump by use + |CocLocationsChange| and |g:coc_jump_locations| - Use location list of coc.nvim when jump locations. - Set it to 0 when you need customize behavior of - location jump by use |CocLocationsChange| and - |g:coc_jump_locations| + If you want use vim's quickfix list instead, add + `"coc.preferences.useQuickfixForLocations": true` in your + configuration file, this configuration would be ignored and no autocmd + triggered. - Default: 1 + Default: 1 -g:coc_snippet_next *g:coc_snippet_next* +g:coc_snippet_next *g:coc_snippet_next* - Trigger key for going to the next snippet position, - applied in insert and select mode. + Trigger key for going to the next snippet position, applied in insert + and select mode. - Only works when snippet session is activated. + Only works when snippet session is activated. - Default: + Default: -g:coc_snippet_prev *g:coc_snippet_prev* +g:coc_snippet_prev *g:coc_snippet_prev* - Trigger key for going to the previous snippet - position, applied in insert and select mode. + Trigger key for going to the previous snippet position, applied in + insert and select mode. - Only works when snippet session is activated. + Only works when snippet session is activated. - Default: + Default: -g:coc_filetype_map *g:coc_filetype_map* +g:coc_filetype_map *g:coc_filetype_map* - Map for document filetypes so the server could handle - current document as another filetype, ex: > + Map for document filetypes so the server could handle current document + as another filetype, example: > - let g:coc_filetype_map = { - \ 'html.swig': 'html', - \ 'wxss': 'css', - \ } + let g:coc_filetype_map = { + \ 'html.swig': 'html', + \ 'wxss': 'css', + \ } < - Default: {} + Default: {} - Note: coc will always map filetype `javascript.jsx` to - `javascriptreact` and `typescript.tsx` to - `typescriptreact`. + See |coc-document-filetype| for details. -g:coc_selectmode_mapping *g:coc_selectmode_mapping* +g:coc_selectmode_mapping *g:coc_selectmode_mapping* - Add key mappings for making snippet select mode - easier. > + Add key mappings for making snippet select mode easier. > - snoremap c - snoremap c - snoremap c - snoremap "_c + snoremap c + snoremap c + snoremap c + snoremap "_c < - Default: 1 + Default: 1 -g:coc_node_path *g:coc_node_path* +g:coc_node_path *g:coc_node_path* - Path to node executable to start coc service. ex: > + Path to node executable to start coc service, example: > - let g:coc_node_path = '/usr/local/opt/node@10/bin/node' + let g:coc_node_path = '/usr/local/opt/node@12/bin/node' < - Use this when coc has problems with your system node, + Use this when coc has problems with your system node, + + Note: you can use `~` as home directory. - Note: you can use `~` as home directory. +g:coc_node_args *g:coc_node_args* -g:coc_force_debug *g:coc_force_debug* + Arguments passed to node when starting coc service from source code. - Coc would use the precompiled bundle when the bundle - file exists, set this to 1 to use compiled code instead - of bundle. + Useful for starting coc in debug mode, example: > +> + let g:coc_node_args = ['--nolazy', '--inspect-brk=6045'] +< + Default: [] + +g:coc_status_error_sign *g:coc_status_error_sign* - Default: 0 + Error character used for statusline, default: `E` -g:coc_node_args *g:coc_node_args* +g:coc_status_warning_sign *g:coc_status_warning_sign* - Arguments passed to node when starting coc - service from source code. + Warning character used for statusline, default: `W` - Useful for starting coc in debug mode, ex: > +g:coc_quickfix_open_command *g:coc_quickfix_open_command* - let g:coc_node_args = ['--nolazy', '--inspect-brk=6045'] + Command used for open quickfix list. To jump fist position after + quickfix list opend, you can use: +> + let g:coc_quickfix_open_command = 'copen|cfirst' < + Default: |copen| - Default: [] +g:node_client_debug *g:node_client_debug* + Enable debug mode of node client for check rpc messages between vim + and coc.nvim. Use environment variable $NODE_CLIENT_LOG_FILE to set + the log file or get the log file after coc.nvim started. + To open the log file, use command: > -g:coc_jump_locations *g:coc_jump_locations* + :call coc#client#open_log() +< + Default: `0` - This variable would be set to jump locations when the - |CocLocationsChange| autocmd is fired. +g:coc_config_home *g:coc_config_home* - Each location item contains: + Configure the directory which will be used to look for + user's `coc-settings.json`, default: - 'filename': full file path. - 'lnum': line number (1 based). - 'col': column number(1 based). - 'text': line content of location. + Windows: `~/AppData/Local/nvim` + Other: `~/.config/nvim` -g:coc_process_pid *g:coc_process_pid* +g:coc_data_home *g:coc_data_home* - Process pid of coc service. + Configure the directory which will be used to for data + files(extensions, MRU and so on), default: -g:coc_status_error_sign *g:coc_status_error_sign* + Windows: `~/AppData/Local/coc` + Other: `~/.config/coc` - Error character used for statusline, default: `E` +g:coc_terminal_height *g:coc_terminal_height* -g:coc_status_warning_sign *g:coc_status_warning_sign* + Height of terminal window, default `8`. - Warning character used for statusline, default: `W` +g:coc_markdown_disabled_languages *g:coc_markdown_disabled_languages* -g:coc_watch_extensions *g:coc_watch_extensions* + Filetype list that should be disabled for highlight in markdown block, + Example: > - Extensions to watch for reload, used for developing - extensions only, need watchman installed. + let g:coc_markdown_disabled_languages = ['html'] -g:coc_quickfix_open_command *g:coc_quickfix_open_command* +g:coc_highlight_maximum_count *g:coc_highlight_maximum_count* - Open command used for open quickfix. - Used by quickfix action of list sources. - Default: |copen| + When highlight items exceed maximum count, highlight items will be + grouped and added by using |timer_start| for better user experience. -g:WorkspaceFolders *g:WorkspaceFolders* + Default `100` - Current workspace folders, used for restoring from a - session file, add `set sessionoptions+=globals` to - vimrc for restoring globals. +g:coc_default_semantic_highlight_groups *g:coc_default_semantic_highlight_groups* -g:node_client_debug *g:node_client_debug* + Create default semantic highlight groups for |coc-semantic-highlights| - Enable debug mode of node client for check rpc - messages between vim and coc.nvim, use command: > + Default: `1` - :call coc#client#open_log() +g:coc_max_treeview_width *g:coc_max_treeview_width* + + Maximum width of tree view when adjusted by auto width. + + Default: `40` + +g:coc_borderchars *g:coc_borderchars* + + Border characters used by border window, default to: +> + ['─', '│', '─', '│', '┌', '┐', '┘', '└'] < - to open the log file. + Note: you may need special font like Nerd font to show them. - Default: `0` +g:coc_border_joinchars *g:coc_border_joinchars* -g:coc_cursors_activated *g:coc_cursors_activated* + Border join characters used by float window/popup, default to: +> + ['┬', '┤', '┴', '├'] +< + Note: you may need special font like Nerd font to show them. + +g:coc_prompt_win_width *g:coc_prompt_win_width* + + Width of input prompt window, default `32`. - Use expression `get(g:, 'coc_cursors_activated',0)` to - check if cursors session is activated. + *g:coc_notify* +g:coc_notify_error_icon *g:coc_notify_error_icon* -g:coc_config_home *g:coc_config_home* + Error icon for notification, default to:  - Configure the directory which will be used to look - for `coc-settings.json`, default: - Windows: - `~/AppData/Local/nvim` - Other: - `~/.config/nvim` +g:coc_notify_warning_icon *g:coc_notify_warning_icon* -g:coc_data_home *g:coc_data_home* + Warning icon for notification, default to: ⚠ - Configure the directory which will be used to for coc - data files(extensions, mru and so on), default: - Windows: - `~/AppData/Local/coc` - Other: - `~/.config/coc` +g:coc_notify_info_icon *g:coc_notify_info_icon* + + Info icon for notification, default to:  ------------------------------------------------------------------------------ -Some variables are provided by coc.nvim so you can use them in your -statusline. See |coc-status| for detail. +Some variables are provided by coc.nvim. -b:coc_diagnostic_info *b:coc_diagnostic_info* - Diagnostic information of current buffer, the format - would look like: +g:WorkspaceFolders *g:WorkspaceFolders* - `{'error': 0, 'warning': 0, 'information': 0, 'hint':0}` + Current workspace folders, used for restoring from a session file, add + `set sessionoptions+=globals` to vimrc for restoring globals on + session load. - can be used to customize statusline. See |coc-status|. +g:coc_jump_locations *g:coc_jump_locations* -g:coc_status *g:coc_status* + This variable would be set to jump locations when the + |CocLocationsChange| autocmd is fired. - Status string contributed by extensions, used for - status line. + Each location item contains: ------------------------------------------------------------------------------- -FUNCTIONS *coc-functions* + 'filename': full file path. + 'lnum': line number (1 based). + 'col': column number(1 based). + 'text': line content of location. -Coc functions are normally used by user defined command/keymap or other -plugins. +g:coc_process_pid *g:coc_process_pid* -Note: some functions only work after the coc service has been initialized. + Process pid of coc.nvim service. If your vim doesn't kill coc.nvim + process on exit, use: +> + autocmd VimLeavePre * if get(g:, 'coc_process_pid', 0) + \ | call system('kill -9 '.g:coc_process_pid) | endif +< + in your vimrc. + +g:coc_service_initialized *g:coc_service_initialized* + + Is `1` when coc.nvim initialized, used with autocmd |CocNvimInit|. + +g:coc_status *g:coc_status* + + Status string contributed by coc.nvim and extensions, used for status + line. + +g:coc_last_float_win *g:coc_last_float_win* + + Window id of latest created float/popup window. + +g:coc_last_hover_message *g:coc_last_hover_message* + + Last message echoed from `doHover`, can be used in statusline. + + Note: not used when floating or preview window used for `doHover`. + +b:coc_snippet_active *b:coc_snippet_active* + + Is `1` when snippet session is activated, use |coc#jumpable| to check + if it's possible to jump placeholder. + +b:coc_diagnostic_info *b:coc_diagnostic_info* + + Diagnostic information of current buffer, the format would look like: + + `{'error': 0, 'warning': 0, 'information': 0, 'hint':0}` + + can be used to customize statusline. See |coc-status|. + +b:coc_current_function *b:coc_current_function* + + Function string that current cursor in. + + Set `"coc.preferences.currentFunctionSymbolAutoUpdate": true` + in coc-settings.json to update it on CursorHold. + +b:coc_cursors_activated *b:coc_cursors_activated* + + Use expression `get(b:, 'coc_cursors_activated',0)` to check if + cursors session is activated for current buffer. + +------------------------------------------------------------------------------ +FUNCTIONS *coc-functions* + +Some functions only work after the coc.nvim has been initialized. To run a function on startup, use an autocmd like: > autocmd User CocNvimInit call CocAction('runCommand', \ 'tsserver.watchBuild') < - - *coc#start()* -coc#start([{option}]) +coc#start([{option}]) *coc#start()* Start completion with optional {option}. Option could contains: - `source` specific completion source name. - ex: > + Example: > inoremap =coc#start({'source': 'word'}) < - Use `CocList sources` to get available sources. - *coc#config()* -coc#config({section}, {value}) + Use `:CocList sources` to get available sources. + +coc#refresh() *coc#refresh()* + + Start or refresh completion at current cursor position, bind this to + 'imap' to trigger completion, example: > + + if has('nvim') + inoremap coc#refresh() + else + inoremap coc#refresh() + endif + +coc#_select_confirm() *coc#_select_confirm()* + + Select first completion item if no completion item is selected, then + confirm the completion. + +coc#config({section}, {value}) *coc#config()* - Change user configuration by Vim script, no changes would be made to - user configuration file. ex: > + Change user configuration, overwrite configurations from + user config file and default values. Example: > call coc#config('coc.preferences', { - \ 'timeout': 1000, + \ 'willSaveHandlerTimeout': 1000, \}) call coc#config('languageserver', { \ 'ccls': { @@ -1135,24 +1943,23 @@ coc#config({section}, {value}) < Note: this function can be called multiple times. - - Note: this function can be called before the service has been - initialized. - + Note: this function can be called before coc.nvim started. Note: this function can work alongside the user configuration file, but it's not recommended to use both. -coc#add_extension({name}, ...) *coc#add_extension()* +coc#add_extension({name}, ...) *coc#add_extension()* + + Deprecated function for install extensions not exists. + Use |g:coc_global_extensions| variable instead. - Config extensions to install, a terminal buffer would be opened to - install missing extensions after service started, ex: > + Example: > call coc#add_extension('coc-json', 'coc-tsserver', 'coc-rls') < This function can be called before service initialized. This function can be called multiple times. -coc#add_command({id}, {command}, [{title}]) *coc#add_command()* +coc#add_command({id}, {command}, [{title}]) *coc#add_command()* Add custom Vim command to commands list opened by `:CocList commands` . @@ -1162,181 +1969,256 @@ coc#add_command({id}, {command}, [{title}]) *coc#add_command()* call coc#add_command('mundoToggle', 'MundoToggle', \ 'toggle mundo window') < - *coc#refresh()* -coc#refresh() - - Start or refresh completion at current cursor position, bind this to - 'imap' to trigger completion, ex: > - - inoremap coc#refresh() -< - *coc#expandable()* -coc#expandable() +coc#expandable() *coc#expandable()* Check if a snippet is expandable at the current position. Requires `coc-snippets` extension installed. - *coc#jumpable()* -coc#jumpable() +coc#jumpable() *coc#jumpable()* Check if a snippet is jumpable at the current position. - *coc#expandableOrJumpable()* -coc#expandableOrJumpable() +coc#expandableOrJumpable() *coc#expandableOrJumpable()* Check if a snippet is expandable or jumpable at the current position. Requires `coc-snippets` extension installed. - *coc#on_enter()* -coc#on_enter() +coc#on_enter() *coc#on_enter()* - Notify coc.nvim that `` has been pressed. - Currently used for the formatOnType feature, ex: > + Notify coc.nvim that has been pressed. - inoremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" + Used for the format on type and improvement of brackets, example: > + + " Confirm the completion when popupmenu is visible, insert and + " notify coc.nvim otherwise. + inoremap coc#pum#visible() ? coc#pum#confirm() + \: "\u\\=coc#on_enter()\" < - Note:to enable formatOnType, add ` "coc.preferences.formatOnType": true` + Note:to enable format on type, add ` "coc.preferences.formatOnType": true` in your settings file. - *coc#status()* -coc#status() + +coc#status() *coc#status()* Return a status string that can be used in the status line, the status includes diagnostic information from `b:coc_diagnostic_info` and extension contributed statuses from `g:coc_status`. For statusline integration, see |coc-status| +coc#util#api_version() *coc#util#api_version()* - *coc#_select_confirm()* -coc#_select_confirm() + Get coc.nvim's vim API version number, start from `1`. - Select first completion item if no completion item is selected, then - confirm the completion. +coc#util#job_command() *coc#util#job_command()* - Note: for this function to work as expected, either |CompleteChanged| - autocmd should exists or only and should be used to select - a completion item. + Get the job command used for starting the coc service. - *health#coc#check()* -health#coc#check() +coc#util#get_config_home() *coc#util#get_config_home()* - Neovim only, run health check, triggered by ':checkhealth' - command. + Get the config directory that contains the user's coc-settings.json. - *coc#util#job_command()* +coc#util#get_data_home() *coc#util#get_data_home()* -coc#util#job_command() + Get data home directory, return |g:coc_data_home| when defined, else + use $XDG_CONFIG_HOME/coc when $XDG_CONFIG_HOME exists, else fallback + to `~/AppData/Local/coc` on windows and `~/.config/coc` on other + systems. - Get the job command used for starting the coc service. +coc#util#extension_root() *coc#util#extension_root()* - *coc#util#get_config_home()* -coc#util#get_config_home() + Return extensions root of coc.nvim. - Get the config directory that contains the user's coc-settings.json. +coc#util#rebuild() *coc#util#rebuild()* - *coc#util#get_data_home()* -coc#util#get_data_home() + Run `npm rebuild` for all coc extensions. - Get `coc` data directory. +coc#util#root_patterns() *coc#util#root_patterns()* - *coc#util#install()* -coc#util#install([{config}]) + Get root patterns used for current document. - Install compiled javascript code of coc.nvim. + Result could be something like: > - {config} could contains: + {'global': ['.git', '.hg', '.projections.json'], 'buffer': [], 'server': v:null} +< +coc#util#get_config({key}) *coc#util#get_config()* - - `terminal` use terminal when specified. - - `tag` use latest tag when specified. + Get configuration (mostly defined in coc-settings.json) by {key}, + example: > - *coc#util#extension_root()* + :echo coc#util#get_config('coc.preferences') -coc#util#extension_root() +coc#snippet#next() *coc#snippet#next()* - Return extensions root of coc.nvim. + Jump to next placeholder, does nothing when |coc#jumpable| is 0. - *coc#util#rebuild()* +coc#snippet#prev() *coc#snippet#prev()* -coc#util#rebuild() + Jump to previous placeholder, does nothing when |coc#jumpable| is 0. - Rebuild coc extensions. + *coc#pum* +coc#pum#visible() *coc#pum#visible()* - *coc#util#has_float()* + Check if customized popupmenu is visible. -coc#util#has_float() +coc#pum#next({insert}) *coc#pum#next()* - Check if coc float window exists. + Select next item of customized popupmenu, insert word when {insert} is + truth value. - *coc#util#float_hide()* +coc#pum#prev({insert}) *coc#pum#prev()* -coc#util#float_hide() + Select previous item of customized popupmenu, insert word when {insert} + is truth value. - Close float windows created by coc.nvim. +coc#pum#stop() *coc#pum#stop()* - *coc#util#float_scrollable()* + Close the customized popupmenu, works like of vim. + Return -coc#util#float_scrollable() +coc#pum#cancel() *coc#pum#cancel()* - Check if coc float window is scrollable. + Cancel the customized popupmenu and revert trigger input, like + of vim. Return empty string. - *coc#util#float_scroll()* -coc#util#float_scroll({forward}) +coc#pum#confirm() *coc#pum#confirm()* - Return expr for scrolling a floating window forward or backward. ex: > + Confirm completion and close the customized pum, like of vim. + Return empty string. - nnoremap coc#util#has_float() ? coc#util#float_scroll(1) : "\" - nnoremap coc#util#has_float() ? coc#util#float_scroll(0) : "\" -< - *coc#util#root_patterns()* -coc#util#root_patterns() +coc#pum#info() *coc#pum#info()* - Get root patterns used for current document. + Return information of the customized popupmenu, should only be used + when |coc#pum#visible()| is 1. - Result could be something like: > + Result contains: + index Current select item index, 0 based. + scrollbar Non-zero if a scrollbar is displayed. + row Screen row count, 0 based. + col Screen column count, 0 based. + width Width of pum, including padding and border. + height Height of pum, including padding and border. + size Count of displayed complete items. + inserted Is |v:true| when there is item inserted. + reversed Is |v:true| when pum shown above cursor and + enable |suggest.reversePumAboveCursor| - {'global': ['.git', '.hg', '.projections.json'], 'buffer': [], 'server': v:null} -< - *coc#util#get_config()* -coc#util#get_config({key}) +coc#pum#select({index}, {insert}, {confirm}) *coc#pum#select()* - Get configuration (mostly defined in coc-settings.json) by {key}, ex: > + Selects an item in the completion popupmenu. + Return empty string. - :echo coc#util#get_config('coc.preferences') + Parameters:~ + {index} Index (zero-based) of the item to select. + {insert} Whether the selection should be inserted + in the buffer. + {confirm} Confirm the completion and dismiss the + popupmenu, implies `insert`. + +coc#pum#insert() *coc#pum#insert()* + + Insert word of current selected item and finish completion. + Timer is used to make it works as rhs of key-mappings. + +coc#pum#scroll({forward}) *coc#pum#scroll()* + + Scroll the popupmenu forward or backward by page. + Timer is used to make it works as rhs of key-mappings. + Return empty string. + + Parameters:~ + {forward} Scroll forward when none zero. + + *coc#notify* +coc#notify#close_all() *coc#notify#close_all()* + + Close all notification windows. + +coc#notify#do_action([{winid}]) *coc#notify#do_action()* + + Invoke action for all notification windows, or particular window with + winid. + +coc#notify#copy() *coc#notify#copy()* + + Copy all content from notifications to system clipboard. + +coc#notify#show_sources() *coc#notify#show_sources()* + + Show source name (extension name) in notification windows. + +coc#notify#keep() *coc#notify#keep()* + + Stop auto hide timer of notification windows. + +coc#float#has_float([{all}]) *coc#float#has_float()* + + Check if float window/popup exists, check coc.nvim's float + window/popup by default. + +coc#float#close_all([{all}]) *coc#float#close_all()* + + Close all float windows/popups created by coc.nvim, set {all} to `1` + for all float window/popups. + +coc#float#close({winid}) *coc#float#close()* + + Close float window/popup with {winid}. + +coc#float#has_scroll() *coc#float#has_scroll()* + + Return `1` when there is scrollable float window/popup created by + coc.nvim. + + Example key-mappings: +> + if has('nvim-0.4.0') || has('patch-8.2.0750') + nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" + inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" + vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" + endif < - *CocRequest()* -CocRequest({id}, {method}, [{params}]) +coc#float#scroll({forward}, [{amount}]) *coc#float#scroll()* + + Scroll all scrollable float windows/popups, scroll backward when + {forward} is not `1`. {amount} could be number or full page when + omitted. Popup menu is excluded. + + Note: this function requires nvim >= 0.4.0 or vim >= 8.2.750 to work. + + +CocRequest({id}, {method}, [{params}]) *CocRequest()* Send a request to language client of {id} with {method} and optional - {params}. ex: > + {params}. Example: > call CocRequest('tslint', 'textDocument/tslint/allFixes', \ {'textDocument': {'uri': 'file:///tmp'}}) < Vim error will be raised if the response contains an error. - *CocRequestAsync()* + *CocRequestAsync()* CocRequestAsync({id}, {method}, [{params}, [{callback}]]) Send async request to remote language server. {callback} function is called with error and response. - *CocNotify()* +CocNotify({id}, {method}, [{params}]) *CocNotify()* -CocNotify({id}, {method}, [{params}]) - - Send notification to remote language server, ex: + Send notification to remote language server, example: > call CocNotify('ccls', '$ccls/reload') < - *CocRegistNotification()* + *CocRegisterNotification()* -CocRegistNotification({id}, {method}, {callback}) +CocRegisterNotification({id}, {method}, {callback}) - Regist notification callback for specified client {id} and {method}, + Register notification callback for specified client {id} and {method}, example: > - autocmd User CocNvimInit call CocRegistNotification('ccls', + autocmd User CocNvimInit call CocRegisterNotification('ccls', \ '$ccls/publishSemanticHighlight', function('s:Handler')) < {callback} is called with single param as notification result. @@ -1344,11 +2226,12 @@ CocRegistNotification({id}, {method}, {callback}) Note: when register notification with same {id} and {method}, only the later registered would work. - *CocLocations()* + *CocLocations()* + CocLocations({id}, {method}, [{params}, {openCommand}]) Send location request to language client of {id} with - {method} and optional {params}. eg: > + {method} and optional {params}. e.g.: > call CocLocations('ccls', '$ccls/call', {'callee': v:true}) @@ -1358,77 +2241,151 @@ CocLocations({id}, {method}, [{params}, {openCommand}]) `coc.preferences.jumpCommand` , |:edit| by default. When it's `v:false` locations list would always used. - *CocLocationsAsync()* + *CocLocationsAsync()* + CocLocationsAsync({id}, {method}, [{params}, {openCommand}]) - Same as |CocLocations()|, but send notification to server instead - of request. + Same as |CocLocations()|, but send notification to server instead + of request. + + +CocAction({action}, [...{args}]) *CocAction()* + + Run {action} of coc with optional extra {args}. + + Checkout |coc-actions| for available actions. + + Note: it's recommended to use |CocActionAsync()| unless you have to + block your vim. + + *CocActionAsync()* + +CocActionAsync({action}, [...{args}, [{callback}]]) + + Call CocAction by send notification to server of coc.nvim. + + Optional callback is called with `error` as the first argument and + `response` as the second argument. + + Checkout |coc-actions| for available actions. + +CocHasProvider({feature}) *CocHasProvider()* + + Check if provider exists for specified feature of current buffer. + Supported features: + + `rename` `onTypeEdit` `documentLink` `documentColor` `foldingRange` + `format` `codeAction` `workspaceSymbols` `formatRange` `hover` + `signature` `documentSymbol` `documentHighlight` `definition` + `declaration` `typeDefinition` `reference` `implementation` `codeLens` + `selectionRange` + +CocTagFunc({pattern}, {flags}, {info}) *CocTagFunc()* + + Used for vim's 'tagfunc' option, to make tag search by |CTRL-]| use + coc.nvim as provider, tag search would be performed when no result + from coc.nvim. + + Make sure your vim support 'tagfunc' by +> + :echo exists('&tagfunc') +< +------------------------------------------------------------------------------ + *coc-actions* +Available Actions ~ + +Acceptable {action} names for |CocAction()| and |CocActionAsync()|. + +"ensureDocument" *CocAction('ensureDocument')* + + Ensure current document is attached to coc.nvim + |coc-document-attached|, should be used when you need invoke action of + current document on buffer create. + + Return |v:false| when document can't be attached. + +"diagnosticList" *CocAction('diagnosticList')* + + Get all diagnostic items of the current Neovim session. + +"diagnosticInfo" *CocAction('diagnosticInfo')* + + Show diagnostic message at the current position, do not truncate. - *CocAction()* -CocAction({action}, [...{args}]) +"diagnosticToggle" [{enable}] *CocAction('diagnosticToggle')* - Run {action} of coc with optional extra {args}. + Enable/disable diagnostics on the fly, not work when `displayByAle` is + enabled. You can toggle by specifying {enable}. {enable} can be 0 or 1 - *CocActionAsync()* +"diagnosticToggleBuffer" [{bufnr}] [{enable}] *CocAction('diagnosticToggleBuffer')* -CocActionAsync({action}, [...{args}, [{callback}]]) + Toggle diagnostics for specific buffer, current buffer is used when + {bufnr} not provided. 0 for current buffer + You can toggle by specifying {enable}. {enable} can be 0 or 1 - Call CocAction without blocking vim UI, the callback is called with - `error` as the first argument and `response` as the second argument. + Note: this will only affect diagnostics shown in the UI, list of all + diagnostics won't change. - *CocHasProvider()* -CocHasProvider({feature}) +"diagnosticPreview" *CocAction('diagnosticPreview')* - Check if provider exists for specified feature. Supported features: + Show diagnostics under current cursor in preview window. - `rename` `onTypeEdit` `documentLink` `documentColor` `foldingRange` - `format` `codeAction` `workspaceSymbols` `formatRange` `hover` - `signature` `documentSymbol` `documentHighlight` `definition` - `declaration` `typeDefinition` `reference` `implementation` `codeLens` - `selectionRange` +"diagnosticRefresh" [{bufnr}] *CocAction('diagnosticRefresh')* - *CocTagFunc()* -CocTagFunc({pattern}, {flags}, {info}) + Force refresh diagnostics for special buffer with {bufnr} or all buffers + when {bufnr} doesn't exist, returns `v:null` before diagnostics are shown. - Used for vim's 'tagfunc' option, to make tag search by |CTRL-]| use - coc.nvim as provider. + NOTE: Will refresh in any mode. ------------------------------------------------------------------------------- + Useful when `diagnostic.autoRefresh` is `false`. -Available Actions ~ +"refreshSource" [{source}] *CocAction('refreshSource')* -Acceptable {action} names for |CocAction()| and |CocActionAsync|. + refresh all sources or a source with a name of {source}. -"sourceStat" *coc-action-sourceStat* +"sourceStat" *CocAction('sourceStat')* get the list of completion source stats for the current buffer. -"refreshSource" [{source}] *coc-action-refreshSource* +"toggleSource" {source} *CocAction('toggleSource')* - refresh all sources or a source with a name of {source}. + enable/disable {source}. -"toggleSource" {source} *coc-action-toggleSource* +"definitions" *CocAction('definitions')* - enable/disable {source}. + Get definition locations of symbol under cursor. + Return LSP `Location[]` -"diagnosticList" *coc-action-diagnosticList* +"declarations" *CocAction('declarations')* - Get all diagnostic items of the current Neovim session. + Get declaration location(s) of symbol under cursor. + Return LSP `Location | Location[] | LocationLink[]` -"diagnosticInfo" *coc-action-diagnosticInfo* +"implementations" *CocAction('implementations')* - Show diagnostic message at the current position, do not truncate. + Get implementation locations of symbol under cursor. + Return LSP `Location[]` -"diagnosticPreview" *coc-action-diagnosticPreview* +"typeDefinitions" *CocAction('typeDefinitions')* - Show diagnostics under current cursor in preview window. + Get type definition locations of symbol under cursor. + Return LSP `Location[]` + +"references" [{excludeDeclaration}] *CocAction('references')* + + Get references location list of symbol under cursor. + + {excludeDeclaration}: exclude declaration locations when not zero. -"jumpDefinition" [{openCommand}] *coc-action-jumpDefinition* + Return LSP `Location[]` - jump to definition position of the current symbol. +"jumpDefinition" [{openCommand}] *CocAction('jumpDefinition')* + + jump to definition locations of the current symbol. Return `v:false` when location not found. - |coc-list-location| is used when more than one position is available. + |coc-list-location| is used when more than one position is available, + for custom location list, use variable: |g:coc_enable_locationlist|. To always use |coc-list-location|| for locations, use `v:false` for {openCommand}. @@ -1436,47 +2393,64 @@ Acceptable {action} names for |CocAction()| and |CocActionAsync|. {openCommand}: optional command to open buffer, default to `coc.preferences.jumpCommand` in `coc-settings.json` -"jumpDeclaration" [{openCommand}] *coc-action-jumpDeclaration* +"jumpDeclaration" [{openCommand}] *CocAction('jumpDeclaration')* - jump to declaration position of the current symbol. + jump to declaration locations of the current symbol. Return `v:false` when location not found. same behavior as "jumpDefinition". When {openCommand} is `v:false`, location list would be always used. -"jumpImplementation" [{openCommand}] *coc-action-jumpImplementation* +"jumpImplementation" [{openCommand}] *CocAction('jumpImplementation')* - Jump to implementation position of the current symbol. + Jump to implementation locations of the current symbol. Return `v:false` when location not found. same behavior as "jumpDefinition" -"jumpTypeDefinition" [{openCommand}] *coc-action-jumpTypeDefinition* +"jumpTypeDefinition" [{openCommand}] *CocAction('jumpTypeDefinition')* - Jump to type definition position of the current symbol. + Jump to type definition locations of the current symbol. Return `v:false` when location not found. same behavior as "jumpDefinition" -"jumpReferences" [{openCommand}] *coc-action-jumpReferences* +"jumpReferences" [{openCommand}] *CocAction('jumpReferences')* + + Jump to references locations of the current symbol, use + |CocAction('jumpUsed')| to exclude declaration locations. - Jump to references position of the current symbol. Return `v:false` when location not found. same behavior as "jumpDefinition" -"doHover" *coc-action-doHover* +"jumpUsed" [{openCommand}] *CocAction('jumpUsed')* + + Jump references locations without declarations. + + same behavior as "jumpDefinition" + +"getHover" *CocAction('getHover')* + + Get documentation text array on current position, returns array of + string. + +"doHover" [{hoverTarget}] *CocAction('doHover')* - Show documentation of the current word in a preview window. - Return `v:false` when hover not found. + Show documentation of current symbol, return `v:false` when hover not + found. - Use `coc.preferences.hoverTarget` to change hover behavior. + {hoverTarget}: optional specification for where to show hover info, + defaults to `coc.preferences.hoverTarget` in `coc-settings.json`. + Valid options: ["preview", "echo", "float"] + +"definitionHover" [{hoverTarget}] *CocAction('definitionHover')* - Note: the behavior would change in Neovim, where floating windows are - available. + Same as |CocAction('doHover')|, but includes definition contents from + definition provider when possible. -"showSignatureHelp" *coc-action-showSignatureHelp* +"showSignatureHelp" *CocAction('showSignatureHelp')* Echo signature help of current function, return `v:false` when signature not found. You may want to set up an autocmd like this: > @@ -1484,41 +2458,44 @@ Acceptable {action} names for |CocAction()| and |CocActionAsync|. autocmd User CocJumpPlaceholder call \ CocActionAsync('showSignatureHelp') < -"getCurrentFunctionSymbol" *coc-action-getCurrentFunctionSymbol* +"getCurrentFunctionSymbol" *CocAction('getCurrentFunctionSymbol')* Return the function string that current cursor in. -"documentSymbols" *coc-action-documentSymbols* - - Get a list of symbols in the current document. - -"rename" *coc-action-rename* +"documentSymbols" [{bufnr}] *CocAction('documentSymbols')* - Rename the symbol under the cursor position, user will be prompted for - a new name. + Get a list of symbols of current buffer or specific {bufnr}. -"workspaceSymbols" *coc-action-workspaceSymbols* +"rename" *CocAction('rename')* - Search for workspace symbols. + Rename the symbol under the cursor position, |coc-dialog-input| would + be shown for prompt a new name. -"selectionRanges" *coc-action-selectionRanges* + Show error message when the provider not found or prepare rename + failed. - Get selection ranges of current position from language server. + The buffers are not saved after apply workspace edits, use |:wa| to + save all buffers. It's possible to undo/redo and inspect the changes, + see |coc-workspace-edits|. -"services" *coc-action-services* + Note: coc.nvim supports rename for disk files, but your language server + may not. - Get an information list for all services. +"refactor" *CocAction('refactor')* -"toggleService" {serviceId} *coc-action-toggleService* + Open refactor windows with current symbol as activated cursor ranges. + Check |coc-config-cursors| and |coc-config-refactor| for related + configuration. - Start or stop a service. + Use to open buffer at current position in split window. + Use to show action menu which have tab open and remove actions. -"format" *coc-action-format* +"format" *CocAction('format')* Format current buffer using the language server. Return `v:false` when format failed. -"formatSelected" [{mode}] *coc-action-formatSelected* +"formatSelected" [{mode}] *CocAction('formatSelected')* Format the selected range, {mode} should be one of visual mode: `v` , `V`, `char`, `line`. @@ -1526,28 +2503,52 @@ Acceptable {action} names for |CocAction()| and |CocActionAsync|. When {mode} is omitted, it should be called using |formatexpr|. -"codeAction" [{mode}] [{only}] *coc-action-codeAction* +"selectionRanges" *CocAction('selectionRanges')* + + Get selection ranges of current position from language server. + +"services" *CocAction('services')* + + Get an information list for all services. + +"toggleService" {serviceId} *CocAction('toggleService')* + + Start or stop a service. + +"codeAction" [{mode}] [{only}] *CocAction('codeAction')* Prompt for a code action and do it. - {mode} should be result of visualmode(), when used in visualmode, - could be empty string or v:null for none visualmode. + {mode} could be `currline` or `cursor` or result of |visualmode()|, + current buffer range is used when it's empty string. {only} can be title of a codeAction or list of CodeActionKind. +"codeActionRange" {start} {end} [{kind}] *CocAction('codeActionRange')* -"codeLensAction" *coc-action-codeLensAction* + Run code action for range. + {start} Start line number of range. + {end} End line number of range. + {kind} Code action kind, see |CocAction('codeActions')| for available + action kind. + + Can be used to create commands like: > + + command! -nargs=* -range CocAction :call CocActionAsync('codeActionRange', , , ) + command! -nargs=* -range CocFix :call CocActionAsync('codeActionRange', , , 'quickfix') +< +"codeLensAction" *CocAction('codeLensAction')* Invoke the command for codeLens of current line (or the line that contains codeLens just above). Prompt would be shown when multiple actions are available. -"commands" *coc-action-commands* +"commands" *CocAction('commands')* Get a list of available service commands for the current buffer. -"runCommand" [{name}] [...{args}] *coc-action-runCommand* +"runCommand" [{name}] [...{args}] *CocAction('runCommand')* Run a global command provided by the language server. If {name} is not provided, a prompt with a list of commands is shown to be selected. @@ -1558,453 +2559,713 @@ Acceptable {action} names for |CocAction()| and |CocActionAsync|. command! -nargs=0 OrganizeImport \ :call CocActionAsync('runCommand', 'tsserver.organizeImports') +< +"fold" {{kind}} *CocAction('fold')* -"fold" {{kind}} *coc-action-fold* - - Fold the current buffer, optionally use {kind} for filtering folds, - {kind} could be either 'comment', 'imports' or 'region' + Fold the current buffer, optionally use {kind} for specific + FoldingRangeKind. + {kind} could be 'comment', 'imports' or 'region'. Return `v:false` when failed. -"highlight" *coc-action-highlight* + You can create a custom command like: > - Highlight the symbols under the cursor. - Overwrite the highlight groups `CocHighlightText`, `CocHighlightRead` - and `CocHighlightWrite` for customizing the colors. + command! -nargs=? Fold :call CocAction('fold', ) +< +"highlight" *CocAction('highlight')* - To enable highlight on CursorHold, create an autocmd like this: > + Highlight the symbols under the cursor. - autocmd CursorHold * silent call CocActionAsync('highlight') -< -"openLink" [{command}] *coc-action-openlink* +"openLink" [{command}] *CocAction('openLink')* Open a link under the cursor with {command}. {command} default to `edit`. File and URL links are supported, return `v:false` when failed. - Note: it needs language server support documentLink feature to work. + URI under cursor is searched when no link returned from documentLink + provider. + +"links" *CocAction('links')* -"extensionStats" *coc-action-extensionStats* + Return document link list of current buffer. + +"extensionStats" *CocAction('extensionStats')* Get all extension states as a list. Including `id`, `root` and `state`. State could be `disabled`, `activated` and `loaded`. -"toggleExtension" {id} *coc-action-toggleExtension* +"toggleExtension" {id} *CocAction('toggleExtension')* Enable/disable an extension. -"uninstallExtension" {id} *coc-action-uninstallExtension* +"uninstallExtension" {id} *CocAction('uninstallExtension')* Uninstall an extension. -"reloadExtension" {id} *coc-action-reloadExtension* +"reloadExtension" {id} *CocAction('reloadExtension')* Reload an activated extension. -"deactivateExtension" {id} *coc-action-deactivateExtension* +"activeExtension" {id} *CocAction('activeExtension')* + + Activate extension of {id}. - Deactivate an extension of {id}. +"deactivateExtension" {id} *CocAction('deactivateExtension')* -"pickColor" *coc-action-pickColor* + Deactivate extension of {id}. - Change the color at the current cursor position. +"pickColor" *CocAction('pickColor')* - Requires language server support for the document color request. + Change the color at the current cursor position, requires + `documentColor` provider |CocHasProvider|. Note: only works on mac or when you have python support on Vim and - have the gtk module installed. + have the GTK module installed. + +"colorPresentation" *CocAction('colorPresentation')* + + Change the color presentation at the current color position, requires + `documentColor` provider |CocHasProvider|. + +"codeActions" [{mode}] [{only}] *CocAction('codeActions')* + + Get codeActions list of current document. -"colorPresentation" *coc-action-colorPresentation* + {mode} can be result of |visualmode()| for visual selected + range. When it's falsy value, current file is used as range. - Change the color presentation at the current color position. + {only} can be array of codeActionKind, possible values including: + - 'refactor': Base kind for refactoring actions + - 'quickfix': base kind for quickfix actions + - 'refactor.extract': Base kind for refactoring extraction actions + - 'refactor.inline': Base kind for refactoring inline actions + - 'refactor.rewrite': Base kind for refactoring rewrite actions + - 'source': Base kind for source actions + - 'source.organizeImports': Base kind for an organize imports source + action + - 'source.fixAll': Base kind for auto-fix source actions - Requires a language server that supports color representation - requests. + {only} can also be string, which means filter by title of codeAction. -"codeActions" [{visualmode}] [{only}] *coc-action-codeActions* +"organizeImport" *CocAction('organizeImport')* - Get codeActions of current range. + Run organize import codeAction for current buffer. + Show warning when codeAction not found. - {visualmode} can be result of |visualmode()| for visual selected - range, When it's empty string or not exists use current line. +"fixAll" *CocAction('fixAll')* - {only} can be used to limit codeActionKind, possible values: - 'refactor', 'quickfix' and 'source'. + Run fixAll codeAction for current buffer. + Show warning when codeAction not found. -"quickfixes" [{visualmode}] *coc-action-quickfixes* + +"quickfixes" [{visualmode}] *CocAction('quickfixes')* Get quickfix codeActions of current buffer. Add {visualmode} as second argument get quickfix actions with range of latest |visualmode()| -"doCodeAction" {codeAction} *coc-action-doCodeAction* +"doCodeAction" {codeAction} *CocAction('doCodeAction')* Do a codeAction. -"doQuickfix" *coc-action-doQuickfix* +"doQuickfix" *CocAction('doQuickfix')* + + Do the first preferred quickfix action on current line. - Do the first quickfix action for the current line. - Return `v:false` when no quickfix action found. + Throw error when no quickfix action found. -"addRanges" {ranges} *coc-action-addRanges* +"addRanges" {ranges} *CocAction('addRanges')* Ranges must be provided as array of range type: https://git.io/fjiEG -"getWordEdit" *coc-action-getWordEdit* +"getWordEdit" *CocAction('getWordEdit')* Get workspaceEdit of current word, language server used when possible, extract word from current buffer as fallback. -"getWorkspaceSymbols" {input} [{bufnr}] *coc-action-getWorkspaceSymbols* - - Get workspace symbols from {input} and optional {bufnr} (use current - bufnr when empty). - ------------------------------------------------------------------------------- -COMMANDS *coc-commands* - -:CocStart *:CocStart* - - Start the coc server, do nothing if it's already started. - -:CocRestart *:CocRestart* - - Restart coc service. - - Use this command when you want coc to start all over again. - -:CocDisable *:CocDisable* - - Disable all events of coc. - -:CocEnable *:CocEnable* - - Enable events of coc. - -:CocConfig *:CocConfig* +"getWorkspaceSymbols" {input} *CocAction('getWorkspaceSymbols')* - Edit the user config file `coc-settings.json` + Get workspace symbols from {input}. -:CocLocalConfig *:CocLocalConfig* +"resolveWorkspaceSymbol" {symbol} *CocAction('resolveWorkspaceSymbol')* - Edit or create `.vim/coc-settings.json` of the current working - directory. + Resolve location for workspace {symbol}. -:CocInstall [{option}] {name} ... *:CocInstall* +"showOutline" [{keep}] *CocAction('showOutline')* - Install one or more coc extensions. + Show |coc-outline| for current buffer. Does nothing when outline + window already shown for current buffer. - {option}: could be `-sync` for use blocked process to download - instead of terminal. + {keep} override `"outline.keepWindow"` configuration when specified. + Could be 0 or 1. - Examples: > + Returns after window is shown (document symbol request is still in + progress). - " Install latest coc-omni - :CocInstall coc-omni - " Install coc-omni 1.0.0 - :CocInstall coc-omni@1.0.0 - " Install snippet extension from github - :CocInstall https://github.com/dsznajder/vscode-es7-javascript-react-snippets -> -:CocUninstall {name} *:CocUninstall* - - Uninstall an extension, use to complete the extension - name. +"hideOutline" *CocAction('hideOutline')* -:CocUpdate *:CocUpdate* + Close |coc-outline| on current tab. Throws vim error when it can't + be closed by vim. - Update all coc extensions to the latest version. +"incomingCalls" [{CallHierarchyItem}] *CocAction('incomingCalls')* -:CocUpdateSync *:CocUpdateSync* + Retrieve incoming calls from {CallHierarchyItem} or current position + when not provided. - Block version of update coc extensions. +"outgoingCalls" [{CallHierarchyItem}] *CocAction('outgoingCalls')* -:CocRebuild *:CocRebuild* + Retrieve outgoing calls from {CallHierarchyItem} or current position + when not provided. - Run `npm rebuild` for coc extensions. +"showIncomingCalls" *CocAction('showIncomingCalls')* - May be required when environment nodejs get upgraded. + Show incoming calls of current function with |coc-tree|, see + |coc-callHierarchy| -:CocCommand {name} [{args}] ... *:CocCommand* +"showOutgoingCalls" *CocAction('showOutgoingCalls')* - Run a command contributed by extensions, use `` for name - completion. + Show outgoing calls of current function with |coc-tree|. -:{range}CocAction [{only}] *:CocAction* +"showSuperTypes" *CocAction('showSuperTypes')* - Get codeActions of current document in actions list, - with optional {range}. + Show super types of types under cursor with |coc-tree|, see + |coc-typeHierarchy|. A warning is shown when no types found under + cursor. - {only} can be 'quickfix' or 'source' as CodeActionKind. +"showSubTypes" *CocAction('showSubTypes')* -:{range}CocFix *:CocFix* + Show sub types of types under cursor with |coc-tree|, see + |coc-typeHierarchy|. A warning is shown when no types found under + cursor. - Same as `:CocAction quickfix` for quickfix actions. +"semanticHighlight" *CocAction('semanticHighlight')* -:CocOpenLog *:CocOpenLog* + Request semantic tokens highlight for current buffer. - Open the log file of coc.nvim. To change the log level - (default `info`), use the environment variable - `NVIM_COC_LOG_LEVEL`. E.g.: > +"inspectSemanticToken" *CocAction('inspectSemanticToken')* - export NVIM_COC_LOG_LEVEL=debug -< - or add: > + Inspect semantic token information at cursor position. - let $NVIM_COC_LOG_LEVEL='debug' -< - to the beggining of your `.vimrc` (before the plugin is - loaded). +"rangeSelect" {visualmode} {forward} *CocAction('rangeSelect')* -:CocInfo *:CocInfo* + Visual select previous or next selection range, requires + `selectionRange` provider. - Show version and log information in a split window, useful for - submitting a bug report. + {visualmode} should be result of {visualmode} or "" for current cursor + position. + {forward} select backward when it's falsy value. ------------------------------------------------------------------------------ -AUTOCMD *coc-autocmds* - - *CocLocationsChange* - -:autocmd User CocLocationsChange {command} - - For building a custom view of locations, set - |g:coc_enable_locationlist| to 0 and use this autocmd with - with |g:coc_jump_locations| - - For example, to disable auto preview of location list, use: -> - let g:coc_enable_locationlist = 0 - autocmd User CocLocationsChange CocList --normal -A location -< - - *CocNvimInit* -:autocmd User CocNvimInit {command} - - Triggered after the coc services have started. - - If you want to trigger an action of coc after Vim has started, - this autocmd should be used because coc is always started - asynchronously. - - *CocStatusChange* +COMMANDS *coc-commands* -:autocmd User CocStatusChange {command} +:CocStart *:CocStart* - Triggered after `g:coc_status` changed, can be used for - refresh stautsline. + Start the coc.nvim server, do nothing if it's already started. - *CocDiagnosticChange* +:CocRestart *:CocRestart* -:autocmd User CocDiagnosticChange {command} + Restart coc.nvim service. - Triggered after the diagnostic status has changed. + Use this command when you want coc to start all over again. - Could be used for updating the statusline. +:CocDisable *:CocDisable* - *CocJumpPlaceholder* + Disable handling vim events. -:autocmd User CocJumpPlaceholder {command} +:CocEnable *:CocEnable* - Triggered after a jump to a placeholder. Can be used for - showing signature help like so: > + Enable handling vim events. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -< - *CocOpenFloat* +:CocConfig *:CocConfig* -:autocmd User CocOpenFloat {command} + Edit the user config file `.vim/coc-settings.json` in + |coc#util#get_config_home()| - Triggered when a floating window is opened. - *CocTerminalOpen* +:CocLocalConfig *:CocLocalConfig* -:autocmd User CocTerminalOpen {command} + Edit or create `.vim/coc-settings.json` in current workspace folder. - Triggered when the terminal is shown, can be used for - adjusting the window height. +:CocInstall [{option}] {name} ... *:CocInstall* ------------------------------------------------------------------------------- + Install one or more coc extensions. -HIGHLIGHTS *coc-highlights* + {option}: could be `-sync` for use blocked process to download instead + of terminal. -To customize a highlight, simply use |:highlight| command of Vim in your -vimrc, like: > + Examples: > - " make error texts have a red color - highlight CocErrorHighlight ctermfg=Red guifg=#ff0000 -< -Note: don't use `:hi default` for overwriting the highlights. + " Install latest coc-omni + :CocInstall coc-omni + " Install coc-omni 1.0.0 + :CocInstall coc-omni@1.0.0 + " Install snippet extension from github + :CocInstall https://github.com/dsznajder/vscode-es7-javascript-react-snippets +> +:CocUninstall {name} *:CocUninstall* -Note: highlight commands should appear after the |:colorscheme| command or use -|ColorScheme| autocmd to make sure customized highlight works after color -scheme change. + Uninstall an extension, use to complete the extension + name. -CocErrorSign *CocErrorSign* +:CocUpdate *:CocUpdate* - Default: `hi CocErrorSign ctermfg=Red guifg=#ff0000` + Update all coc extensions to the latest version. - The highlight used for error signs. +:CocUpdateSync *:CocUpdateSync* -CocWarningSign *CocWarningSign* + Block version of update coc extensions. - Default: `hi CocWarningSign ctermfg=Brown guifg=#ff922b` +:CocRebuild *:CocRebuild* - The highlight used for warning signs. + Run `npm rebuild` for coc extensions. -CocInfoSign *CocInfoSign* + May be required when environment nodejs get upgraded. - Default: `hi CocInfoSign ctermfg=Yellow guifg=#fab005` +:CocCommand {name} [{args}] ... *:CocCommand* - The highlight used for information signs. + Run a command contributed by extensions, use `` for name + completion. -CocHintSign *CocHintSign* +:CocOpenLog *:CocOpenLog* - Default: `hi CocHintSign ctermfg=Blue guifg=#15aabf` + Open log file of coc.nvim. - The highlight used for hint signs. + Use environmental variable `NVIM_COC_LOG_FILE` for fixed log file. + Note: the log would be cleared when coc.nvim started. -CocErrorVirtualText *CocErrorVirtualText* + Use environment variable `NVIM_COC_LOG_LEVEL` to change log level + (default 'info', could be 'all', 'trace', 'debug', 'info', + 'warn', 'error', 'off'). + Use shell command: > - Default: `hi default link CocErrorVirtualText CocErrorSign` + export NVIM_COC_LOG_LEVEL=debug +< + or add: > - The highlight used for error signs. + let $NVIM_COC_LOG_LEVEL='debug' +< + to the beginning of your `.vimrc` -CocWarningVirtualText *CocWarningVirtualText* +:CocInfo *:CocInfo* - Default: `hi default link CocWarningVirtualText CocWarningSign` + Show version and log information in a split window, useful for + submitting a bug report. - The highlight used for warning signs. +:CocDiagnostics [height] *:CocDiagnostics* -CocInfoVirtualText *CocInfoVirtualText* + Open vim's |location-list| with diagnostics of current buffer. - Default: `hi default link CocInfoVirtualText CocInfoSign` +:CocSearch *:CocSearch* - The highlight used for information signs. + Perform search by ripgrep https://github.com/BurntSushi/ripgrep, + refactor window would be opened. -CocHintVirtualText *CocHintVirtualText* + Note: the search is performed on your files, so normally you should + save your buffers before invoke this command. - Default: `hi default link CocHintVirtualText CocHintSign` + Common arguments for ripgrep:~ - The highlight used for hint signs. + `-e` `--regexp`: treat search pattern as regexp. + `-F` `--fixed-strings`: treat search pattern as fixed string. + `-L` `--follow`: follow symbolic links while traversing directories. + `-g` `--glob` {GLOB}: Include or exclude files and directories for + searching that match the given glob. + `--hidden`: Search hidden files and directories. + `--no-ignore-vcs`: Don't respect version control ignore files + (.gitignore, etc.). + `--no-ignore`: Don't respect ignore files (.gitignore, .ignore, etc.). + `-w` `--word-regexp`: Only show matches surrounded by word boundaries. + `-S` `--smart-case`: Searches case insensitively if the pattern is all + lowercase. Search case sensitively otherwise. + `--no-config`: Never read configuration files. + `-x` `--line-regexp`: Only show matches surrounded by line boundaries. -CocErrorHighlight *CocErrorHighlight* + Use `:man 1 rg` in your terminal for more details. - Default: `hi default link CocErrorHighlight CocUnderline` + Note: By default, hidden files and directories are skipped. - The highlight used for error text. + Note: By default, vcs ignore files including `.gitignore` and + `.ignore` are respected -CocWarningHighlight *CocWarningHighlight* + Escape arguments:~ - Default: `hi default link CocWarningHighlight CocUnderline` + || is used to convert command line arguments to arguments of + rg, which means you have to escape space for single argument. For + example, if you want to search `import { Neovim` , you have to use: +> + :CocSearch import\ \{\ Neovim +< + The escape for `{` is required because rg use regexp be default, or: +> + :CocSearch -F import\ {\ Neovim +< + for strict match. - The highlight used for warning text. + Change and save:~ -CocInfoHighlight *CocInfoHighlight* + Refactor session is started with searched patterns highlighted, just + change the text and save refactor buffer to make changes across all + related files. You can make any kind of changes, including add lines + and remove lines. - Default: `hi default link CocInfoHighlight CocUnderline` +:CocWatch [extension] *:CocWatch* - The highlight used for information text. + Watch loaded [extension] for reload on file change, use for + complete extension id. -CocHintHighlight *CocHintHighlight* +:CocOutline *:CocOutline* - Default: `hi default link CocHintHighlight CocUnderline` + Invoke |CocAction('showOutline')| by notification. - The highlight used for hint text. +------------------------------------------------------------------------------ +AUTOCMD *coc-autocmds* -CocHighlightText *CocHighlightText* + *CocLocationsChange* - Default `hi default link CursorColumn` +:autocmd User CocLocationsChange {command} - The highlight used for document highlight feature. Normally used for - highlighting same symbols in the buffer at the current cursor position. + For building a custom view of locations, set + |g:coc_enable_locationlist| to 0 and use this autocmd with with + |g:coc_jump_locations| -CocHighlightRead *CocHighlightRead* + For example, to disable auto preview of location list, use: +> + let g:coc_enable_locationlist = 0 + autocmd User CocLocationsChange CocList --normal location +< + *CocNvimInit* +:autocmd User CocNvimInit {command} - Default `hi default link CocHighlightRead CocHighlightText` + Triggered after the coc services have started. - Highlight for `Read` kind of document symbol. + If you want to trigger an action of coc after Vim has started, this + autocmd should be used because coc is always started asynchronously. -CocHighlightWrite *CocHighlightWrite* + *CocStatusChange* - Default `hi default link CocHighlightWrite CocHighlightText` +:autocmd User CocStatusChange {command} - Highlight for `Write` kind of document symbol. + Triggered after `g:coc_status` changed, can be used for refresh + statusline. -CocErrorLine *CocErrorLine* + *CocDiagnosticChange* - Default `undefined` +:autocmd User CocDiagnosticChange {command} - Line highlight of sign for a line that contains error diagnostic. + Triggered after the diagnostic status has changed. -CocWarningLine *CocWarningLine* + Could be used for updating the statusline. - Default `undefined` + *CocJumpPlaceholder* - Line highlight of sign for a line that contains warning diagnostic. +:autocmd User CocJumpPlaceholder {command} -CocInfoLine *CocInfoLine* + Triggered after a jump to a placeholder. Can be used for + showing signature help like: > - Default `undefined` + autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') +< + *CocOpenFloat* - Line highlight of sign for a line that contains info diagnostic. +:autocmd User CocOpenFloat {command} -CocHintLine *CocHintLine* + Triggered when a floating window is opened. The window is not + focused, use |g:coc_last_float_win| to get window id. - Default `undefined` + *CocOpenFloatPrompt* - Highlight for a line with diagnostic hint. +:autocmd User CocOpenFloatPrompt {command} -CocCodeLens *CocCodeLens* + Triggered when a floating prompt window is opened (triggered after + CocOpenFloat). - Default: `ctermfg=Gray guifg=#999999` + *CocTerminalOpen* +:autocmd User CocTerminalOpen {command} - Highlight group of virtual text for codeLens. + Triggered when the terminal is shown, can be used for adjusting the + window height. -CocFloating *CocFloating* +------------------------------------------------------------------------------ - Default: `Pmenu` +HIGHLIGHTS *coc-highlights* - Highlight group of a floating window. +The best place to override highlight groups is a file named +after/colors/ .vim in your 'runtimepath' (e.g., +~/.config/nvim/after/colors/solarized.vim). Example declaration: +> + " make error texts have a red color + highlight CocErrorHighlight ctermfg=Red guifg=#ff0000 +< +Use |:highlight| with group name to check current highlight. -CocErrorFloat *CocErrorFloat* +Note: don't use `:hi default` for overwriting the highlights. - Default: `hi default link CocErrorFloat CocErrorSign` +Note: user defined highlight commands should appear after the |:colorscheme| +command and use |ColorScheme| autocmd to make sure customized highlights works +after color scheme change. + +Markdown related~ + +*CocBold* for bold text. +*CocItalic* for italic text. +*CocUnderline* for underlined text. +*CocStrikeThrough* for strikethrough text, like usage of deprecated API. +*CocMarkdownCode* for inline code in markdown content. +*CocMarkdownHeader* for markdown header in floating window/popup. +*CocMarkdownLink* for markdown link text in floating window/popup. + +Diagnostics related~ + *coc-highlights-diagnostics* + +*CocFadeOut* for faded out text, such as for highlighting unnecessary code. +*CocErrorSign* for error signs. +*CocWarningSign* for warning signs. +*CocInfoSign* for information signs. +*CocHintSign* for hint signs. +*CocErrorVirtualText* for error virtual text. +*CocWarningVirtualText* for warning virtual text. +*CocInfoVirtualText* for information virtual text. +*CocHintVirtualText* for hint virtual text. +*CocErrorHighlight* for error code range. +*CocWarningHighlight* for warning code range. +*CocInfoHighlight* for information code range. +*CocHintHighlight* for hint code range. +*CocDeprecatedHighlight* for deprecated code range, links to +|CocStrikeThrough| by default. +*CocUnusedHighlight* for unnecessary code range, links to |CocFadeOut| by +default. +*CocErrorLine* line highlight of sign which contains error. +*CocWarningLine* line highlight of sign which contains warning. +*CocInfoLine* line highlight of sign which information. +*CocHintLine* line highlight of sign which contains hint. + +Highlight with higher priority would overwrite highlight with lower priority. +The priority order: + + |CocUnusedHighlight| > |CocDeprecatedHighlight| > |CocErrorHighlight| + > |CocWarningHighlight| > |CocInfoHighlight| > |CocHintHighlight| + +Document highlight related~ + *coc-highlights-document* + +Highlights used for highlighting same symbols in the buffer at the current +cursor position. + +*CocHighlightText* default symbol highlight. +*CocHighlightRead* for `Read` kind of document symbol. +*CocHighlightWrite* for `Write` kind of document symbol. + +Float window/popup related~ + +*CocFloating* default highlight group of floating windows/popups. +Default links to |NormalFloat| on neovim and |Pmenu| on vim. +*CocFloatThumb* thumb highlight of scrollbar. +*CocFloatSbar* Scrollbar highlight of floating window/popups. +*CocFloatDividingLine* for dividing lines, links to |NonText| by default. +*CocFloatActive* for activated text, links to |CocSearch| by default. +*CocErrorFloat* for error text in floating windows/popups. +*CocHintFloat* for hint text in floating windows/popups. + +Notification window/popup related~ + +CocNotification *CocNotification* + +*CocNotificationProgress* for progress line in progress notification. +*CocNotificationButton* for action buttons in notification window. +*CocNotificationError* for highlight border of error notification. +*CocNotificationWarning* for highlight border of warning notification. +*CocNotificationInfo* for highlight border of info notification. + +List related~ + *coc-highlights-list* + +*CocListLine* for current cursor line. +*CocListSearch* for matched characters. +*CocListMode* for mode text in the statusline. +*CocListPath* for cwd text in the statusline. +*CocSelectedText* for sign text of selected lines (multiple selection only). +*CocSelectedLine* for line highlight of selected lines (multiple selection only). + +Tree view related~ + +CocTree *CocTree* + +*CocTreeTitle* for title in tree view. +*CocTreeDescription* for description beside label. +*CocTreeOpenClose* for open and close icon in tree view. +*CocTreeSelected* for highlight lines contains selected node. + +Popup menu related~ + *CocPum* +*CocPumSearch* for matched input characters, linked to |CocSearch| by default. +*CocPumDetail* for highlight label details that follows label (including +possible detail and description). +*CocPumMenu* for menu of complete item. +*CocPumShortcut* for shortcut text of source. +*CocPumDeprecated* for deprecated label. +*CocPumVirtualText* for virtual text which enabled by +|coc-config-suggest-virtualText| + +Symbol icons~ + +CocSymbol *CocSymbol* + +Highlight groups for symbol icons, including `CompletionItemKind` and +`SymbolKind` of LSP. The highlight groups link to related |nvim-treesitter| +highlight groups when possible and fallback to builtin highlight groups. + +*CocSymbolDefault* linked to |hl-MoreMsg| by default. +*CocSymbolText* +*CocSymbolUnit* +*CocSymbolValue* +*CocSymbolKeyword* +*CocSymbolSnippet* +*CocSymbolColor* +*CocSymbolReference* +*CocSymbolFolder* +*CocSymbolFile* +*CocSymbolModule* +*CocSymbolNamespace* +*CocSymbolPackage* +*CocSymbolClass* +*CocSymbolMethod* +*CocSymbolProperty* +*CocSymbolField* +*CocSymbolConstructor* +*CocSymbolEnum* +*CocSymbolInterface* +*CocSymbolFunction* +*CocSymbolVariable* +*CocSymbolConstant* +*CocSymbolString* +*CocSymbolNumber* +*CocSymbolBoolean* +*CocSymbolArray* +*CocSymbolObject* +*CocSymbolKey* +*CocSymbolNull* +*CocSymbolEnumMember* +*CocSymbolStruct* +*CocSymbolEvent* +*CocSymbolOperator* +*CocSymbolTypeParameter* + +Note: Use configuration |coc-config-suggest-completionItemKindLabels| for customized icon +characters. + +Semantic token highlight groups~ + *CocSem* + +Semantic highlight groups are starts with `CocSem` which link to related +|nvim-treesitter| highlight groups when possible and fallback to builtin +highlight groups, use variable |g:coc_default_semantic_highlight_groups| to +disable creation of these highlight groups. + +Only semantic tokens types and `deprecated` modifier have default +highlight groups. + +You need create highlight groups for highlight other modifiers and/or specific +modifier with type, for example: +> + " Add highlights for defaultLibrary modifier + hi link CocSemDefaultLibrary TSOtherDefaultLibrary + hi link CocSemDefaultLibraryClass TSTypeDefaultLibrary + hi link CocSemDefaultLibraryInterface TSTypeDefaultLibrary + hi link CocSemDefaultLibraryEnum TSTypeDefaultLibrary + hi link CocSemDefaultLibraryType TSTypeDefaultLibrary + hi link CocSemDefaultLibraryNamespace TSTypeDefaultLibrary + + " Add highlights for declaration modifier + hi link CocSemDeclaration TSOtherDeclaration + hi link CocSemDeclarationClass TSTypeDeclaration + hi link CocSemDeclarationInterface TSTypeDeclaration + hi link CocSemDeclarationEnum TSTypeDeclaration + hi link CocSemDeclarationType TSTypeDeclaration + hi link CocSemDeclarationNamespace TSTypeDeclaration +< +The modifier highlight groups have higher priority. + +Others~ + +*CocSearch* highlight group for matched characters in list. +*CocDisabled* highlight for disabled items, eg: menu item. +*CocCodeLens* for virtual text of codeLens. +*CocCursorRange* for highlight of activated cursors ranges. +*CocLinkedEditing* for highlight of activated linked editing ranges. +*CocHoverRange* for range of current hovered symbol. +*CocMenuSel* for current menu item in menu dialog (should only provide +background color). +*CocSelectedRange* for highlight ranges of outgoing calls. +*CocSnippetVisual* for highlight snippet placeholders. +*CocInlayHint* for highlight inlay hint virtual text block, default uses +foreground from |CocHintSign| and background from |SignColumn| - The highlight used for a floating window with errors. +============================================================================== +TREE SUPPORT *coc-tree* -CocWarningFloat *CocWarningFloat* +Tree view is used for render outline and call hierarchy, following features +are supported: - Default: `hi default link CocWarningFloat CocWarningSign` +- Data update while keep tree node open/close state. +- Auto refresh on load error. +- Click open/close icon to toggle collapse state. +- Click node to invoke default command. +- Show tooltip in float window on |CursorHold| when possible. +- Key-mappings support |coc-tree-mappings| +- Optional multiple selection. +- Optional node reveal support. +- Optional fuzzy filter support. +- Provide API `window.createTreeView` for extensions. - The highlight used for a floating window with warnings. +Check |coc-config-tree| for related configurations. -CocInfoFloat *CocInfoFloat* +The filetype is `'coctree'`, which can be used to overwrite buffer and window +options. - Default: `hi default link CocInfoFloat CocInfoSign` +Use variable |w:cocViewId| to detect the kind of tree. - The highlight used for a floating window with information. +------------------------------------------------------------------------------ -CocHintFloat *CocHintFloat* +TREE KEY MAPPINGS *coc-tree-mappings* - Default: `hi default link CocHintFloat CocHintSign` +Default key-mappings are provided for 'coctree' buffer, which can be changed +by configuration |coc-config-tree|. - The highlight used for a floating window with hints. + - Select/unselect item, configured by `"tree.key.toggleSelection"`. + - Invoke actions of current item, configured by `"tree.key.actions"`. + - Close tree window, configured by `"tree.key.close"`. + - Invoke command of current item, configured by `"tree.key.invoke"`. + - Move cursor to original window. +f - Activate filter, configured by `"tree.key.activeFilter"`. +t - Trigger key to toggle expand state of tree node, configured by + `tree.key.toggle`. +M - Collapse all tree node, configured by `"tree.key.collapseAll"`. -CocCursorRange *CocCursorRange* +------------------------------------------------------------------------------ - Default: `hi default link CocCursorRange Search` +TREE FILTER *coc-tree-filter* - The highlight used for cursor ranges. +Filter mode is used for search for specific node by fuzzy filter, invoke the +key configured by `"tree.key.activeFilter"` to activate filter mode. -CocHoverRange *CocHoverRange* +Note: some tree views not have filter mode supported. - Default: `hi default link CocHoverRange Search` +When filter mode is activated, type normal character to insert filter input +and following special keys are supported: - The highlight used for current hover range. + - Delete last filter character when possible. + - Delete last filter character when possible. + - Clean up filter text. + - Navigate to previous filter text (stored on command invoke). + - Navigate to next filter text (stored on command invoke). + - exit filter mode. + - exit filter mode. + or `"tree.key.selectPrevious"` - Select previous node. + or `"tree.key.selectNext"` - Select next node. + or `"key.key.invoke"` - Invoke command of selected node. ============================================================================== LIST SUPPORT *coc-list* @@ -2013,20 +3274,20 @@ Built-in list support to make working with lists of items easier. The following features are supported: -* Insert & normal mode. -* Default key-mappings for insert & normal mode. -* Customize key-mappings for insert & normal mode. -* Commands for reopening & doing actions with a previous list. -* Different match modes. -* Interactive mode. -* Auto preview on cursor move. -* Number select support. -* Built-in actions for locations. -* Parse ANSI code. -* Mouse support. -* Select actions using . -* Multiple selections using in normal mode. -* Select lines by visual selection. +- Insert & normal mode. +- Default key-mappings for insert & normal mode. +- Customize key-mappings for insert & normal mode. +- Commands for reopening & doing actions with a previous list. +- Different match modes. +- Interactive mode. +- Auto preview on cursor move. +- Number select support. +- Built-in actions for locations. +- Parse ANSI code. +- Mouse support. +- Select actions using . +- Multiple selections using in normal mode. +- Select lines by visual selection. ------------------------------------------------------------------------------ @@ -2034,38 +3295,52 @@ LIST COMMAND *coc-list-command* :CocList [{...options}] [{source}] [{...args}] *:CocList* - Open coc list of {source}, Ex: > + Open coc list of {source}, example: > - :CocList --normal location + :CocList --normal location < - For current jump locations. + For current jump locations. + + See |coc-list-options| for available list options, - See |coc-list-options| for available list options, + Also check |coc-config-list| for list configuration. - {args} are sent to source during the fetching of list. - Press `?` on normal mode to get supported {args} of current - list. + {args} are sent to source during the fetching of list. + Press `?` on normal mode to get supported {args} of current + list. - When {source} is empty, lists source is used. + When {source} is empty, lists source is used. -:CocListResume *:CocListResume* +:CocListResume [{name}] *:CocListResume* - Reopen last opened list, input and cursor position will be - preserved. + Reopen last opened list, input and cursor position will be preserved. -:CocPrev *:CocPrev* +:CocListCancel *:CocListCancel* - Invoke default action for the previous item in the last list. + Close list, useful when the list is not the current window. - Doesn't open the list window if it's closed. +:CocPrev [{name}] *:CocPrev* -:CocNext *:CocNext* + Invoke default action for the previous item in the last {name} list. - Invoke the default action for the next item in the last list. + Doesn't open the list window if it's closed. - Doesn't open the list window if it's closed. +:CocNext [{name}] *:CocNext* -Command options *coc-list-options* + Invoke the default action for the next item in the last {name} list. + + Doesn't open the list window if it's closed. + +:CocFirst [{name}] *:CocFirst* + + Invoke default action for first item in the last {name} list. + +:CocLast [{name}] *:CocLast* + + Invoke default action for last item in the last {name} list. + + *coc-list-options* +Options of CocList command~ --top Show list as top window. @@ -2074,6 +3349,7 @@ Command options *coc-list-options* Open list in new tabpage. --normal + Start list in normal mode, recommended for short list. --no-sort @@ -2081,6 +3357,7 @@ Command options *coc-list-options* it's already sorted. --input={input} + Specify the input on session start. --strict @@ -2092,6 +3369,7 @@ Command options *coc-list-options* Use regex matching instead of fuzzy matching. --ignore-case + Ignore case when using strict matching or regex matching. --number-select @@ -2105,40 +3383,69 @@ Command options *coc-list-options* Use interactive mode, list items would be reloaded on input change, filter and sort would be done by list implementation. - Note: it won't work if the list doesn't support interactive mode. + Note: only works when the list support interactive mode. - Note: filtering and sorting would be done by a remote service. + Note: filtering and sorting would be done by underlying task, which + means options including `--strict`, `--no-sort`, `--regex`, + `--ignore-case` would not work at all. --auto-preview -A + Start a preview for the current item on the visible list. +--no-quit + + Not quit list session after do action. + + Note: you may need to refresh the list for current state. + +--first + + Invoke default action for first list item on list open. + Nothing happens when the list is empty. + +--reverse + + Reverse lines order of list. + ------------------------------------------------------------------------------ LIST CONFIGURATION *coc-list-configuration* Use `coc-settings.json` for configuration of lists. -The general configuration of list starts with `list.` checkout -|coc-configuration| or type `list.` in your settings file to get the list. +Configuration of list starts with 'list.'. + +See |coc-config-list| or type `list.` in your settings file to get completion +list (requires coc-json installed). For configuration of a specified list, use section that starts with: `list.source.{name}`, where `{name}` is the name of list. -Configure default options:~ +Change default action:~ + +If you want to use `tabe` as default action of symbols list, you can use: +> + // change default action of symbols + "list.source.symbols.defaultAction": "tabe" +< +in your coc-settings.json + +Change default options:~ Use `list.source.{name}.defaultOptions` setting like: > // make symbols list use normal mode and interactive by default "list.source.symbols.defaultOptions": ["--interactive", "--number-select"], < - Note: some list like symbols only work in interactive mode, you must - include `--interactive` to `defaultOptions`. +Note: some list like symbols only work in interactive mode, you must +include `--interactive` in `defaultOptions`. -Note: default options will not be used when there're options or arguments -passed with |:CocList| command. +Note: default options will not be used when there're options passed +with |:CocList| command. -Config default arguments:~ +Change default arguments:~ Use `list.source.{name}.defaultArgs` setting like: > @@ -2148,61 +3455,66 @@ Use `list.source.{name}.defaultArgs` setting like: > Note: default arguments used only when arguments from |:CocList| command is empty. -Type `?` on normal mode to get supported arguments. +Note: Type `?` on normal mode to get supported arguments of current list. ------------------------------------------------------------------------------ LIST MAPPINGS *coc-list-mappings* -Default mappings in insert mode: - - - cancel list session. - - stop loading task. - - paste text from system clipboard. - - reload list. - - change to normal mode. - - select next line. - - select previous line. - - move cursor left. - - move cursor right. - - move cursor to end of prompt. - - same as . - - move cursor to start of prompt. - - same as . - - scroll window forward. - - scroll window backward. - - remove previous character of cursor. - - remove previous character of cursor. - - remove previous word of cursor. - - remove characters before cursor. - - navigate to next input in history. - - navigate to previous input in history. - - switch matcher for filter items. - - insert content from Vim register. - - select action. - -Default mappings in normal mode: - - - cancel list session. - - stop source from fetching more items. - - reload list. - - mark all visible items selected. - - select action. - - toggle select of current item. -i,I,o,O,a,A - change to insert mode. -p - preview action. -: - cancel list session without closing window. -? - show help of current list. -t - do 'tabe' action. -d - do 'drop' action. -s - do 'split' action. +Default mappings on insert mode: + + - Cancel list session. + - Do default action with selected items or current item. + - Stop loading task. + - Paste text from system clipboard. + - Reload list. + - Change to normal mode. + - Select next line. + - Select previous line. + - Move cursor left. + - Move cursor right. + - Move cursor to end of prompt. + - Same as . + - Move cursor to start of prompt. + - Same as . + - Scroll window forward. + - Scroll window backward. + - Remove previous character of cursor. + - Remove previous character of cursor. + - Remove previous word of cursor. + - Remove characters before cursor. + - Navigate to next input in history. + - Navigate to previous input in history. + - Switch matcher for filter items. + - Insert content from vim's register. + - Select action. + +Default mappings on normal mode: + + - Cancel list session. + - Do default action with selected items or current item. + - Stop source from fetching more items. + - Reload list. + - Mark all visible items selected. + - Jump to original window on list create. + - Select action. + - Scroll preview window down. + - Scroll preview window up. + - Toggle selection of current item. +i,I,o,O,a,A - Change to insert mode. +p - Preview action. +: - Cancel list session without closing window. +? - Show help of current list. +t - Do 'tabe' action. +d - Do 'drop' action. +s - Do 'split' action. Use |coc-list-mappings-custom| to override default mappings. *coc-list-mappings-custom* Configurations `"list.normalMappings"` and `"list.insertMappings"` are used -for customizing the list key-mappings, ex: > +for customizing the list key-mappings, example: > "list.insertMappings": { "": "do:refresh", @@ -2228,59 +3540,66 @@ Note: can't be remapped for other actions. The mapping expression should be `command:arguments`, available commands: 'do' - special actions provided by coc list, including: - 'refresh' - reload list. - 'selectall' - mark all visible items selected. - 'switch' - switch matcher used for filter items. - 'exit' - exit list session. - 'stop' - stop loading task. - 'cancel' - cancel list session but leave list window open. - 'toggle' - toggle selection of current item. - 'toggleMode' - toggle between insert and normal mode. - 'previous' - move cursor to previous item. - 'next' - move cursor to next item. - 'defaultaction' - execute default action. - 'help' - show help. + 'refresh' - reload list. + 'selectall' - mark all visible items selected. + 'switch' - switch matcher used for filter items. + 'exit' - exit list session. + 'stop' - stop loading task. + 'cancel' - cancel list session but leave list window open. + 'toggle' - toggle selection of current item. + 'togglemode' - toggle between insert and normal mode. + 'previous' - move cursor to previous item. + 'next' - move cursor to next item. + 'defaultaction' - do default action for selected item(s). + 'chooseaction' - choose action for selected item(s). + 'jumpback' - stop prompt and jump back to original window. + 'previewtoggle' - toggle preview window, requires preview action exists. + 'previewup' - scroll preview window up. + 'previewdown' - scroll preview window down. + 'help' - show help. 'prompt' - do prompt action, including: 'previous' - change to previous input in history. - 'next' - change to next input in history. - 'start' - move cursor to start. - 'end' - move cursor to end. - 'left' - move cursor left. - 'right' - move cursor right. - 'deleteforward' - remove previous character. + 'next' - change to next input in history. + 'start' - move cursor to start. + 'end' - move cursor to end. + 'left' - move cursor left. + 'right' - move cursor right. + 'deleteforward' - remove previous character. 'deletebackward' - remove next character. - 'removetail' - remove characters afterwards. - 'removeahead' - remove character ahead. + 'removetail' - remove characters afterwards. + 'removeahead' - remove character ahead. + 'removeword' - remove word before cursor. 'insertregister' - insert content from Vim register. - 'paste' - append text from system clipboard to prompt. -'eval' - append text to prompt from result of VimL expression. -'action' - execute action of list, use to find available actions. -'feedkeys' - feedkeys to list window, use `\\` in JSON to escape special characters. -'normal' - execute normal command in list window. -'normal!' - execute normal command without remap. -'command' - execute command. -'call' - call Vim function with |coc-list-context| as only argument. -'expr' - same as 'call' but expect the function return action name. + 'paste' - append text from system clipboard to prompt. +'eval' - append text to prompt from result of VimL expression. +'action' - execute action of list, use to find available actions. +'feedkeys' - feedkeys to list window, use `\\` in JSON to escape special + characters. +'normal' - execute normal command in list window. +'normal!' - execute normal command without remap. +'command' - execute command. +'call' - call Vim function with |coc-list-context| as only argument. +'expr' - same as 'call' but expect the function return action name. *coc-list-context* Context argument contains the following properties: -'name' - name of the list, ex: `'location'`. -'args' - arguments of the list. -'input' - current input of prompt. -'winid' - window id on list activated. -'bufnr' - buffer number on list activated. +'name' - name of the list, example: `'location'`. +'args' - arguments of the list. +'input' - current input of prompt. +'winid' - window id on list activated. +'bufnr' - buffer number on list activated. 'targets' - list of selected targets, checkout |coc-list-target| for properties. *coc-list-target* Target contains the following properties: -'label' - mandatory property that is shown in the buffer. +'label' - mandatory property that is shown in the buffer. 'filtertext' - optional filter text used for filtering items. -'location' - optional location of item, check out https://bit.ly/2Rtb6Bo -'data' - optional additional properties. +'location' - optional location of item, check out https://bit.ly/2Rtb6Bo +'data' - optional additional properties. ------------------------------------------------------------------------------ @@ -2305,7 +3624,7 @@ location *coc-list-location* extensions *coc-list-extensions* - Manage coc extensions. + Manage coc.nvim extensions. Actions: @@ -2326,6 +3645,15 @@ diagnostics *coc-list-diagnostics* - Same as |coc-list-location| +folders *coc-list-folders* + + Manage current workspace folders of coc.nvim. + + Actions: + + - 'edit' change the directory of workspace folder. + - 'delete' remove selected workspace folder. + outline *coc-list-outline* Symbols in the current document. @@ -2367,14 +3695,6 @@ links *coc-list-links* - 'open': open the link, default action. - 'jump': jump to link definition. -output *coc-list-output* - - Current output channels - - Actions: - - - 'open': open output channel in split window, default action. - sources *coc-list-completion-sources* Available completion sources. @@ -2393,13 +3713,166 @@ lists *coc-list-lists* - 'open': open selected list, default action. -actions *coc-list-actions* +============================================================================== - Get available code actions. +DIALOG SUPPORT *coc-dialog* - Actions: +Dialog is special float window/popup that could response to user actions, +dialog have close button, border, title (optional), bottom buttons(optional). + +Note bottom buttons work different on neovim and vim, on neovim you can +click the button since neovim allows focus of window, on vim you have to type +highlighted character to trigger button callback. + +Note dialog feature requires neovim >= 0.4.0 or vim >= 8.2.0750 to work. + +See |coc-config-dialog| for available configurations. + +------------------------------------------------------------------------------ + + *coc-dialog-basic* + +A basic dialog is create by Javascript API `window.showDialog` , which is just +some texts with optional buttons. + +------------------------------------------------------------------------------ + + *coc-dialog-confirm* + +A confirm dialog is used for user to confirm an action, normally created by +`window.showPrompt()` Confirm dialog uses filter feature on vim8 and +|getchar()| on Neovim. + +The difference is you can operate vim on vim8, but not on neovim. + +Supported key-mappings: + + - force cancel, return -1 for callback. +, n, N - reject the action, return 0 for callback. +y,Y - accept the action, return 1 for callback. - - 'do': execute selected action. +------------------------------------------------------------------------------ + + *coc-dialog-input* + +An input dialog request user input with optional default value, normally +created by `window.requestInput`, when `"coc.preferences.promptInput"` is +false, vim's command line input prompt is used instead. + +On neovim, it uses float window, on vim8, it opens terminal in popup. + +Supported key-mappings: + + - move cursor to first col. + - move cursor to last col. + - cancel input, null is received by callback. + - accept current input selection of current item. + +QuickPick related (available when created by |coc-dialog-quickpick|). + + - scroll forward quickpick list. + - scroll backward quickpick list. + - move to next item in quickpick list. + - move to previous item in quickpick list. + - toggle selection of current item in quickpick list when +canSelectMany is supported. + +Note on neovim, other insert mode key-mappings could work. + +Note not possible to configure key-mappings on vim8, to customize key-mappings +on neovim, use |CocOpenFloatPrompt| with current buffer. + +------------------------------------------------------------------------------ + + *coc-dialog-quickpick* + +A quickpick is a input dialog in the middle with a float window/popup contains +filtered list items. + +A simple fuzzy filter is used by default. + +See |coc-config-dialog| for available configurations. + +See |coc-dialog-input| for available key-mappings. + +------------------------------------------------------------------------------ + + *coc-dialog-menu* + +A menu dialog is used for pick a single item from list of items, extensions +could use `window.showMenuPicker` to create menu dialog. + +Supported key-mappings: + + - cancel selection. + - confirm selection of current item, use +|dialog.confirmKey| to override. +1-9 - select item with 1 based index. +g - move to first item. +G - move to last item. +j - move to next item. +k - move to previous item. + - scroll forward. + - scroll backward. + +------------------------------------------------------------------------------ + + *coc-dialog-picker* + +A picker dialog is used for single/multiple selection. On neovim, it's +possible to toggle selection by mouse click inside the bracket. Extensions +could use `window.showPickerDialog` to create picker dialog. + +Supported key-mappings: + + - cancel selection. + - confirm selection of current item, use +|dialog.confirmKey| to override. + - toggle selection of current item. +g - move to first item. +G - move to last item. +j - move to next item. +k - move to previous item. + - scroll forward. + - scroll backward. + +Note when close button is clicked, the selection is canceled with undefined +result (same as ). + +============================================================================== + +NOTIFICATION SUPPORT *coc-notification* + +Notification windows are created at the bottom right of the screen. + +Notifications are created by Javascript APIs: `window.showErrorMessage()`, +`window.showWarningMessage()`, `window.showInformationMessage()`, +`window.showNotification()` and `window.withProgress()`. + +Possible kind of notifications: 'error', 'warning', 'info' and 'progress'. + +Message notifications (not progress) requires +|coc-preferences-enableMessageDialog| to be `true`. + +Message notifications without actions would be automatically closed after +milliseconds specified by |coc-config-notification-timeout|. + +Use |coc-config-notification-disabledProgressSources| to disable progress +notifications for specific sources. + +Customize notifications:~ + +- Customize icons: |g:coc_notify| +- Customize highlights: |CocNotification| +- Customize configurations: |coc-config-notification| + +Related functions:~ + +- |coc#notify#close_all()| +- |coc#notify#do_action()| +- |coc#notify#copy()| +- |coc#notify#show_sources()| +- |coc#notify#keep()| ============================================================================== @@ -2408,10 +3881,14 @@ STATUSLINE SUPPORT *coc-status* Diagnostics info and other status info contributed by extensions could be shown in statusline. -The easiest way is add `%{coc#status()}` to your 'statusline' option. Ex: > +The easiest way is add `%{coc#status()}` to your 'statusline' option. Example: > set statusline^=%{coc#status()} -> +< +You may need to use |CocStatusChange| for automatically refresh statusline: > + + autocmd User CocStatusChange redrawstatus +< ------------------------------------------------------------------------------ *coc-status-manual* @@ -2479,7 +3956,7 @@ Use configuration like: > \ }, \ } - " Use auocmd to force lightline update. + " Use autocmd to force lightline update. autocmd User CocStatusChange,CocDiagnosticChange call lightline#update() < ============================================================================== @@ -2493,49 +3970,13 @@ Check out https://github.com/neoclide/coc.nvim/wiki/Create-custom-source FAQ *coc-faq* ------------------------------------------------------------------------------ -Q: I need documentation for completion items. - -A: Preview window of Vim is disabled by default. You can enable it by - adding `"suggest.enablePreview":true` to your settings file. - - However, it doesn't work when the server only sends documentation on - complete item change, you will need floating window support then, - check out: https://bit.ly/2NCVh5P - ------------------------------------------------------------------------------- -Q: I want to use ale for diagnostics. - -A: Yes, you can make coc send diagnostics to ale, just add > - - "diagnostic.displayByAle": true, -< - to your coc-settings.json - ------------------------------------------------------------------------------- -Q: I want codeLens feature of LSP. - -A: CodeLens support uses the virtual text feature of Neovim, its not - enabled by default. To enable it, add: > - - "codeLens.enable": true, -< - to your coc-settings.json - ------------------------------------------------------------------------------- -Q: I want to highlight codes in markdown documentation. - -A: Use a markdown plugin which could provide fancy code highlighting, - like https://github.com/tpope/vim-markdown, and use settings like: -> - let g:markdown_fenced_languages = ['css', 'js=javascript'] -< - in your .vimrc. +Check out https://github.com/neoclide/coc.nvim/wiki/F.A.Q ============================================================================== CHANGELOG *coc-changelog* -Check out ../history.md +See history.md under project root. ============================================================================== -vim:tw=78:nosta:noet:ts=8:sts=0:ft=help:noet:fen:fdm=marker: +vim:tw=78:nosta:noet:ts=8:sts=0:ft=help:noet:fen: diff --git a/_vim/.vim/plugged/coc.nvim/history.md b/_vim/.vim/plugged/coc.nvim/history.md index 9dd706d..1adf197 100644 --- a/_vim/.vim/plugged/coc.nvim/history.md +++ b/_vim/.vim/plugged/coc.nvim/history.md @@ -1,3 +1,454 @@ +# 2022-09-28 + +- Limit popupmenu width when exceed screen to &pumwidth, instead of change + completion column. +- Make escape of `${name}` for ultisnip snippets the same behavior as + Ultisnip.vim. + +# 2022-09-27 + +- Use fuzzy.wasm for native fuzzy match. +- Add `binarySearch` and `isFalsyOrEmpty` functions for array. +- `suggest.localityBonus` works like VSCode, using selection ranges. +- Add and export `workspace.computeWordRanges`. +- Rework keywords parse for better performance (parse changed lines only and use + yield to reduce iteration). + +# 2022-09-12 + +- All configurations are now scoped #4185 +- No `onDidChangeConfiguration` event fired when workspace folder changed. +- Deprecated configuration `suggest.detailMaxLength`, use `suggest.labelMaxLength` instead. +- Deprecated configuration `inlayHint.filetypes`, use `inlayHint.enable` with scoped languages instead. +- Deprecated configuration `semanticTokens.filetypes`, use `semanticTokens.enable` with scoped languages instead. +- Use `workspaceFolderValue` instead of `workspaceValue` for `ConfigurationInspect` returned by `WorkspaceConfiguration.inspect()`. + +# 2022-09-04 + +- Add configuration "snippet.choicesMenuPicker". + +# 2022-09-03 + +- Send "WinClosed" event to node client. +- Add `onDidFilterStateChange` and `onDidCursorMoved` to `TreeView`. +- Support `autoPreview` for outline. + +# 2022-09-02 + +- Support `diagnostic.virtualTextFormat`. +- Add command `workspace.writeHeapSnapshot`. + +# 2022-09-01 + +- Add configuration "suggest.asciiMatch" +- Support `b:coc_force_attach`. + +# 2022-08-31 + +- Add configuration "suggest.reversePumAboveCursor". +- Use `DiagnosticSign*` highlight groups when possible. +- Use `DiagnosticUnderline*` highlight groups when possible. + +# 2022-08-30 + +- Export `LineBuilder` class. + +# 2022-08-29 + +- Fix semanticTokens highlights unexpected cleared +- Fix range of `doQuickfix` action. +- Check reverse of `CocFloating`, use `border` and `Normal` highlight when reversed. +- Make `CocInlayHint` use background of `SignColumn`. +- Add command `document.toggleInlayHint`. + +# 2022-08-28 + +- Make `CocMenuSel` use background of `PmenuSel`. +- Snippet related configuration changed (old configuration still works until next release) + - "coc.preferences.snippetStatusText" -> "snippet.statusText" + - "coc.preferences.snippetHighlight" -> "snippet.highlight" + - "coc.preferences.nextPlaceholderOnDelete" -> "snippet.nextPlaceholderOnDelete" +- Add configuration `"list.smartCase"` +- Add configurations for inlay hint + - "inlayHint.refreshOnInsertMode" + - "inlayHint.enableParameter" + - "inlayHint.typeSeparator" + - "inlayHint.parameterSeparator" + - "inlayHint.subSeparator" + +# 2022-08-27 + +- Avoid use `EasyMotion#is_active`, use autocmd to disable linting. +- Show message when call hierarchy provider not found or bad position. + +# 2022-08-26 + +- Remove `completeOpt` from `workspace.env`. +- Add configuration `"diagnostic.virtualTextAlign"`. +- Add warning when required features not compiled with vim. +- Not echo error for semanticTokens request (log only). +- Merge results form providers when possible. + +# 2022-08-24 + +- Virtual text of suggest on vim9. +- Virtual text of diagnostics on vim9. +- Add configuration `inlayHint.filetypes`. +- Inlay hint support on vim9. + +# 2022-08-23 + +- Retry semanticTokens request on server cancel (LSP 3.17). +- `RelativePattern` support for `workspace.createFileSystemWatcher()`. +- `relativePatternSupport` for `DidChangeWatchedFiles` (LSP 3.17). +- Not echo error on `doComplete()`. + +# 2022-08-21 + +- Added `window.createFloatFactory()`, deprecated `FloatFactory` class. +- Support `labelDetails` field of `CompleteItem`(LSP 3.17). +- Added `triggerKind` to `CodeActionContext`, export `CodeActionTriggerKind`. + +# 2022-08-20 + +- Support pull diagnostics `:h coc-pullDiagnostics`. +- Break change: avoid extension overwrite builtin configuration defaults. +- Change default value of configuration "diagnostic.format". +- 'line' changes to 'currline' for `CocAction('codeAction')`. +- Check NodeJS version on syntax error. + +# 2022-08-10 + +- Change "notification.highlightGroup" default to "Normal". + +# 2022-08-07 + +- Add configuration 'suggest.pumFloatConfig'. + +# 2022-08-04 + +- Make diagnostic float window with the same background as CocFloating. + +# 2022-08-03 + +- Add highlight group 'CocFloatingDividingLine'. + +# 2022-08-01 + +- Use custom popup menu, #3862. +- Use "first" instead of "none" for configuration `suggest.selection`. +- Make "first" default for `suggest.selection`, like VSCode. +- Add default blue color for hlgroup `CocMenuSel`. + +# 2022-06-14 + +- Add highlight groups `CocListLine` and `CocListSearch`. + +# 2022-06-11 + +- Add configuration "notification.disabledProgressSources" +- Add "rounded" property to "floatConfig" + +# 2022-06-04 + +- Add configuration `workspace.openOutputCommand`. +- Log channel message of vim when `g:node_client_debug` enabled. + +# 2022-05-30 + +- Disable `progressOnInitialization` for language client by default. + +# 2022-05-28 + +- Support `repeat#set` for commands that make changes only. + +# 2022-05-24 + +- Add transition and annotation support for `workspace.applyEdits()`. +- Add command `workspace.undo` and `workspace.redo`. +- Remove configuration `coc.preferences.promptWorkspaceEdit`. +- Remove command `CocAction` and `CocFix`. + +# 2022-05-22 + +- Check for previous position when not able to find completion match. +- Add `content` support to `window.showMenuPicker()` + +# 2022-05-17 + +- Add `QuickPick` module. +- Add API `window.showQuickPick()` and `window.createQuickPick()`. + +# 2022-05-16 + +- Add properties `title`, `loading` & `borderhighlight` to `InputBox` + +# 2022-05-14 + +- Add `InputOption` support to `window.requestInput` +- Add API `window.createInputBox()`. + +# 2022-05-13 + +- Notification support like VSCode https://github.com/neoclide/coc.nvim/discussions/3813 +- Add configuration `notification.minProgressWidth` +- Add configuration `notification.preferMenuPicker` +- Support `source` in notification windows. + +# 2022-05-07 + +- Show sort method as description in outline view. +- Add configuration `outline.switchSortKey`, default to ``. +- Add configuration `outline.detailAsDescription`, default to `true`. +- Add variable `g:coc_max_treeview_width`. +- Add `position: 'center'` support to `window.showMenuPicker()` + +# 2022-05-06 + +- Use menu for `window.showQuickpick()`. +- Add configuration `outline.autoWidth`, default to `true`. + +# 2022-05-05 + +- Add key bindings to dialog (created by `window.showDialog()`) on neovim. + +# 2022-05-04 + +- Add `languages.registerInlayHintsProvider()` for inlay hint support. + +# 2022-04-25 + +- Add `LinkedEditing` support + +# 2022-04-23 + +- Add `WinScrolled` event to events. + +# 2022-04-20 + +- Select recent item when input is empty and selection is `recentUsedByPrefix`. +- Add `coc#snippet#prev()` and `coc#snippet#next()`. +- Add command `document.checkBuffer`. +- Add `region` param to `window.diffHighlights()`. + +# 2022-04-06 + +- `workspace.onDidOpenTextDocument` fire `contentChanges` as empty array when + document changed with same lines. + +# 2022-04-04 + +- Avoid `CompleteDone` cancel next completion. +- Avoid indent change on `` and `` during completion. +- Support `joinUndo` and `move` with `document.applyEdits()`. + +# 2022-04-02 + +- Change `suggest.triggerCompletionWait` default to `0`. +- Not trigger completion on `TextChangedP`. +- Remove configuration `suggest.echodocSupport`. +- Fix complettion triggered after ``. + +# 2022-03-31 + +- Check buffer rename on write. + +# 2022-03-30 + +- Improve words parse performance. +- Remove configurations `coc.source.around.firstMatch` and `coc.source.buffer.firstMatch`. +- Fix `coc.source.buffer.ignoreGitignore` not works + +# 2022-03-30 + +- Check document reload on detach. + +# 2022-03-29 + +- Add menu actions to refactor buffer. + +# 2022-03-12 + +- Avoid use `` for cancel completion. + +# 2022-03-05 + +- Make `WinClosed` event fires on `CursorHold` to support vim8. +- Add events `TabNew` and `TabClose`. +- Make outline reuse TreeView buffer. + +# 2022-03-02 + +- Add ultisnip option to `snippetManager.insertSnippet()` and + `snippetManager.resolveSnippet()`. +- Support ultisnip regex option: `/a` (ascii option). +- Support transform replacement of ultisnip, including: + - Variable placeholders, `$0`, `$1` etc. + - Escape sequence `\u` `\l` `\U` `\L` `\E` `\n` `\t` + - Conditional replacement: `(?no:text:other text)` + +# 2022-02-28 + +- Change `workspace.ignoredFiletypes` default value to `[]` + +# 2022-02-24 + +- Add `window.activeTextEditor`, `window.visibleTextEditors`. +- Add events `window.onDidChangeActiveTextEditor` `window.onDidChangeVisibleTextEditors`. +- Add class `RelativePattern`. +- Add `workspace.findFiles()`. + +# 2022-02-23 + +- Add `workspace.openTextDocument()` +- Add `Workspace.getRelativePath()`. +- Add `window.terminals` `window.onDidOpenTerminal` `window.onDidCloseTerminal` + and `window.createTerminal`. +- Add `exitStatus` property to `Terminal`. +- Support `strictEnv` in `TerminalOptions` on neovim. +- Deprecated warning for `workspace.createTerminal()`, + `workspace.onDidOpenTerminal` and `workspace.onDidCloseTerminal` + +# 2022-02-18 + +- Clear all highlights created by coc.nvim before restart. +- Support strike through for ansiparse. +- Support `highlights` for `Documentation` in float window. + +# 2022-02-17 + +- Change workspace configuration throw error when workspace folder can't be + resolved. +- Remove configuration `diagnostic.highlightOffset`. + +# 2022-02-15 + +- Add `events.race`. +- Change default `suggest.triggerCompletionWait` to 50. +- Support trigger completion after indent fix. + +# 2022-02-14 + +- Add `pumvisible` property to events. + +# 2022-02-10 + +- Add shortcut support for `window.showMenuPicker()`. +- Add configuration `dialog.shortcutHighlight` for shortcut highlight. +- Add configuration `list.menuAction` for choose action by menu picker. + +# 2022-02-09 + +- Add error log to `nvim_error_event`. +- Add `nvim.lua()` which replace `nvim.executeLua()` to typings.d.ts. + +# 2022-02-08 + +- Support `MenuItem` with disabled property for `window.showMenuPicker` +- Support show disabled code actions in menu picker. + +# 2022-02-07 + +- Change `:CocLocalConfig` to open configuration file of current workspace + folder. + +# 2022-02-05 + +- Support `version` from `textDocument/publishDiagnostics` notification's parameter. +- Support `codeDescription` of diagnostics by add href to float window. +- Support `showDocument` request from language server. +- Support `label` from DocumentSymbolOptions in outline tree. +- Support extra url use regexp under cursor with `openLink` action. +- Support `activeParameter` from signature information. +- Add `trimTrailingWhitespace`, `insertFinalNewline` and `trimFinalNewlines` to FormattingOptions. +- Add configuration `links.tooltip`, default to `false`. + +# 2022-02-04 + +- Add `--reverse` option to list. +- Add `` key-mapping to cancel list in preview window (neovim only). + +# 2022-02-02 + +- Remove `disableWorkspaceFolders` `disableDiagnostics` and `disableCompletion` + from language client option. +- Add configuration `documentHighlight.timeout`. +- Add `tabPersist` option to `ListAction`. +- Add `refactor` to `LocationList` + +# 2022-01-30 + +- Add configuration `diagnostics.virtualTextLevel`. +- Remove configuration `suggest.numberSelect` + +# 2022-01-26 + +- Use `nvim_buf_set_text` when possible to keep extmarks. + +# 2022-01-25 + +- Not trigger completion when filtered is succeed. +- Move methods `workspace.getSelectedRange` `workspace.selectRange` to `window` + module, show deprecated warning when using old methods. + +# 2022-01-23 + +- Support semantic tokens highlights from range provider. + +# 2022-01-22 + +- Not set `gravity` with api `nvim_buf_set_extmark` because highlight bug, wait neovim fix. +- Support watch later created workspace folders for file events. + +# 2022-01-21 + +- Changed semantic token highlight prefix from `CocSem_` to `CocSem`. +- Changed semantic token highlight disabled by default, use configuration + `semanticTokens.filetypes` +- Add configuration `semanticTokens.filetypes`. +- Add configuration `semanticTokens.highlightPriority`. +- Add configuration `semanticTokens.incrementTypes`. +- Add configuration `semanticTokens.combinedModifiers`. +- Add command `semanticTokens.refreshCurrent`. +- Add command `semanticTokens.inspect`. +- Add action `inspectSemanticToken`. +- Rework command `semanticTokens.checkCurrent` to show highlight information. +- Support semantic tokens highlight group composed with type and modifier. + +# 2022-01-21 + +- Add configuration `workspace.ignoredFolders`. +- Add configuration `workspace.workspaceFolderFallbackCwd`. + +# 2022-01-20 + +- Remove deprecated method `workspace.resolveRootFolder`. + +# 2022-01-17 + +- Extend `buffer.updateHighlights` to support `priority`, `combine`, `start_incl` and `end_incl`. +- Add configuration `diagnostic.highlightPriority`. +- Add configuration `colors.filetypes` and `colors.highlightPriority`. + +# 2022-01-16 + +- Add configuration `codeLens.position`. + +# 2022-01-14 + +- Add configuration `suggest.selection`. + +# 2022-01-13 + +- `codeLens.separator` now defaults to `""` and will be placed above lines on neovim >= 0.6.0 . +- Add configurations 'diagnostic.locationlistLevel', 'diagnostic.signLevel', 'diagnostic.messageLevel'. + +# 2022-01-12 + +- Add document.lineAt(), export TextLine class. +- Upgrade node-client, support nvim.exec(). +- Add documentHighlight.priority configuration. + # 2019-08-18 0.0.74 - feat(cursors): support multiple cursors. @@ -30,7 +481,7 @@ - feat(plugin): add highligher module - feat(refactor): add `(coc-refactor)` for refactor window - feat(extension): use mv module for folder rename -- feat(extension): support install taged extension +- feat(extension): support install tagged extension - feat(extension): support custom extension root `g:coc_extension_root` - feat(handler): close signature float window on ')' - feat(list): support `g:coc_quickfix_open_command` @@ -102,7 +553,7 @@ - Add `disableDiagnostics` & `disableCompletion` to languageclient configuration. - Add `signature.triggerSignatureWait` configuration. - Add vim-repeat support for run command and quickfix. -- Add prefered `codeAction` support. +- Add preferred `codeAction` support. - Add `prompt.paste` action to list. - Add title as argument support for `codeAction` action. - Add `suggest.floatEnable` configuration. @@ -153,16 +604,16 @@ - **Break change** logic for resolve workspace folder changed. - Add `Task` module. - Add `getCurrentFunctionSymbol` action. -- Add `list.source.outline.ctagsFilestypes` setting. +- Add `list.source.outline.ctagsFiletypes` setting. - Add `suggest.disableMenu` and `suggest.disableMenu` settings. - Add `equal` support for complete items. - Add support for do action with visual select lines of list. - Add expand tilder support for language server command. - Add switch matcher support to list. -- Add select all support to lsit. +- Add select all support to list. - Add quickfix action to list. - Add `selectionRanges` of LSP. -- Add load extentions for &rtp support. +- Add load extensions for &rtp support. - Add `coc#on_enter()` for formatOnType and add new lines on enter. - Improve completion by support trigger completion when pumvisible. - Remove document check on `BufWritePre`. @@ -172,7 +623,7 @@ - **Break change** not using vim-node-rpc from npm modules any more. - **Break change** rename `_` to `CocRefresh`. - Fix wrong format options send to server. -- Fix throw eror when extention root not created. +- Fix throw error when extension root not created. - Fix MarkedString not considered as markdown. - Fix echo message on vim exit. - Fix error throw on file watch. @@ -183,11 +634,11 @@ - Add `workspace.resolveRootFolder`. - Add `diagnostic.joinMessageLines` setting. - Add `suggest.completionItemKindLabels` setting. -- Add `memento` support for extention. +- Add `memento` support for extension. - Add `workspace.getSelectedRange`. - Add `Terminal` module. - Add command `workbench.action.reloadWindow`. -- Fix extention not activated by command. +- Fix extension not activated by command. - Fix broken undo with floating window. - Fix document create possible wrong uri & filetype. - Improve highlight with floating window. @@ -218,7 +669,7 @@ - Fix critical performance issue on diff text. - Improve color of `CocHighlightText`. - Improve sort of complete items. -- Improve extention list with version and open action. +- Improve extension list with version and open action. # 2019-03-16 @@ -238,14 +689,14 @@ - **Break change** change buffers instead of disk file for `workspace.applyEdits`. - **Break change** add config errors to diagnostic list instead of jump locations. -- **Break change** hack for popup menu flicker is remvoed, use `suggest.reloadPumOnInsertChar` to enable it. +- **Break change** hack for popup menu flicker is removed, use `suggest.reloadPumOnInsertChar` to enable it. - **Break change** use `nvim_select_popupmenu_item` for number select completion. - Add floating window for completion items. - Add floating window support for diagnostics. - Add floating window support for hover documentation. - Add `coc#on_enter()` for notify enter pressed. - Add setting `coc.preferences.useQuickfixForLocations`. -- Add support of `g:coc_watch_extensions` for automatic reload extentions. +- Add support of `g:coc_watch_extensions` for automatic reload extensions. - Add command: `editor.action.doCodeAction`. - Fix service on restarted on windows after rebuild. - Fix config of airline. @@ -270,7 +721,7 @@ - **Break change** default of `suggest.detailMaxLength` changed to 100. - **Break change** option of `workspace.registerKeymap` changed. -- Add settings: `suggest.defailField`. +- Add settings: `suggest.detailField`. - Add check for autocmd in health check. - Add trigger patterns support for complete sources. - Add support of `coc-snippets-expand-jump` @@ -283,7 +734,7 @@ - **Break change** no longer automatic trigger for CursorHoldI #452. - **Break change** add preview option of `completeopt` according to `suggest.enablePreview`. - Add statusItem for CocUpdate. -- Add `-sycn` option for `:CocInstall` +- Add `-sync` option for `:CocInstall` - Add support for floating preview window. - Add more module export. - Fix check of vim-node-rpc throw error. @@ -340,15 +791,15 @@ not found. - Add support for configure sign in statusline. - Add help action for list. -- Fix parse error on extentions update. +- Fix parse error on extensions update. - Fix wrong uri on windows. - Fix cancel list without close ui. - Improve startup time by remove jobwait. # 2019-02-02 -- **Break change:** extentions now update automatically, prompt is removed. -- Add check for extention compatibility. +- **Break change:** extensions now update automatically, prompt is removed. +- Add check for extension compatibility. - Add transform support for placeholder. - Add check for node version. - Add error check for list. @@ -356,7 +807,7 @@ - Fix preview window not shown. - Fix highlight not cleared on vim. - Fix highlight commands of list block vim on start. -- Improve extention load. +- Improve extension load. - Improve list experience. # 2019-01-28 @@ -371,7 +822,7 @@ # 2019-01-24 -- **Break change:** python code for denite support moved to seperated repo. +- **Break change:** python code for denite support moved to separated repo. - **Break change:** Quickfix list no longer used. - Add list support. - Add configuration: `coc.preferences.diagnostic.virtualText`. @@ -416,10 +867,10 @@ - **Break change:** created keymaps use rpcrequest instead of rpcnotify. - **Break change:** snippets provider is removed, use `coc-snippets` for - extention snippets. + extension snippets. - Add command: `coc.action.insertSnippet` - Fix position of snippets. -- Fix modifier of registed keymaps. +- Fix modifier of registered keymaps. - Fix completion triggered on complete done. - Fix closure function possible conflict. - Fix unexpected snippet cancel. @@ -434,11 +885,11 @@ # 2018-12-27 - **Break change:** no more message on service ready. -- **Break change:** vim source now registed as extention. +- **Break change:** vim source now registered as extension. - **Break change:** complete item sort have reworked. - **Break change:** request send to coc would throw when service not ready. - Add support for check current state on diagnostic update. -- Add `env` opinion for registed command languageserver. +- Add `env` opinion for registered command languageserver. - Add outputChannel for watchman. - Add `coc#_select_confirm()` for trigger select and confirm. - Add `coc.preferences.numberSelect`. @@ -464,18 +915,18 @@ - Add command `workspace.clearWatchman`. - Add `quickfixs`, `doCodeAction` and `doQuickfix` actions. - Add `g:vim_node_rpc_args` for debug purpose. -- Add `coc#add_extension()` for specify extentions to install. +- Add `coc#add_extension()` for specify extensions to install. - Fix clients not restarted on CocRestart. - Fix `execArgv` and `runtime` not work for node language server. - Fix detail of complete item not echoed sometimes. -- Fix actions missing when registed with same clientId. +- Fix actions missing when registered with same clientId. - Fix issues with signature echo. - Fix uri is wrong with whitespace. - Improve highlight performance with `nvim_call_atomic`. # 2018-12-17 -- **Break change** `vim-node-rpc` now upgrade in bacground. +- **Break change** `vim-node-rpc` now upgrade in background. - Add `ignoredRootPaths` to `languageserver` option. - Add detect of vim running state. - Add `client.vim` for create clients. @@ -489,7 +940,7 @@ - **Break change** `fixInsertedWord` fix inserted word which ends with word after. - **Break change** `onCompleteSelect` is removed. -- Add `workspace.registerKeymap` for regist keymap. +- Add `workspace.registerKeymap` for register keymap. - Add match score for sort complete items. - Fix possible connection lost. - Fix priority of diagnostic signs. @@ -516,7 +967,7 @@ `never`. - Fix can't install on windows vim. - Fix `displayByAle` not clearing diagnostics. -- Add check for `vim-node-rpc` udpate on vim. +- Add check for `vim-node-rpc` update on vim. - Add `Resolver` module. - Improve apply `WorkspaceEdit`, support `0` as document version and merge edits for same document. @@ -528,7 +979,7 @@ - Add setting: `coc.preferences.hoverTarget`, support use echo. - Add setting `coc.preferences.diagnostic.displayByAle` for use ale to display errors. - Add setting `coc.preferences.extensionUpdateCheck` for control update check of - extentions. + extensions. - Add `coc#config` for set configuration in vim. - Fix rootPath not resolved on initialize. - Fix possible wrong `tabSize` by use `shiftwidth` option. @@ -552,7 +1003,7 @@ - Add echo message when provider not found for some actions. - Add support for `formatexpr` - Add support for locality bonus like VSCode. -- Add support of `applyAdditionaLEdits` on item selected by `` +- Add support of `applyAdditionalLEdits` on item selected by `` - Add `coc.preferences.useQuickfixForLocations` - Add `coc.preferences.messageLevel` - Add support for trigger command which not registered by server. @@ -569,13 +1020,13 @@ # 2018-11-24 -- **Break change** sources exluding `around`, `buffer` or `file` are extracted +- **Break change** sources excluding `around`, `buffer` or `file` are extracted as extensions. -- **Break change** custom source not exists any more. +- **Break change** custom source doesn't exist any more. - Add `coc.preferences.preferCompleteThanJumpPlaceholder` to make jump placeholder behavior as confirm completion when possible. - Add `CocDiagnosticChange` autocmd for force statusline update. -- Add `onDidUnloadExtension` event on extention unload. +- Add `onDidUnloadExtension` event on extension unload. - Fix `getDiagnosticsInRange`, consider all interactive ranges. - Fix completion throw when `data` on complete item is `string`. - Fix `commitCharacters` not works. @@ -839,7 +1290,7 @@ # 2018-09-07 -- **Break change**: all extension all seperated from core, checkout +- **Break change**: all extension all separated from core, checkout [Using coc extension](https://github.com/neoclide/coc.nvim/wiki/Using-coc-extensions) - Fix `textDocumentSync` option not work when received as object. - Fix wrong diagnostic info when using multiple lint servers. @@ -959,7 +1410,7 @@ - Add support filetype change of buffer. - Add basic test for completion. - Improve loading speed, use child process to initialize vim sources. -- Improve install.sh, install node when not exists. +- Improve install.sh, install node when it doesn't exist. - Improve interface of workspace. - Fix loading of configuration content. diff --git a/_vim/.vim/plugged/coc.nvim/lua/coc/highlight.lua b/_vim/.vim/plugged/coc.nvim/lua/coc/highlight.lua new file mode 100644 index 0000000..cbdd7d4 --- /dev/null +++ b/_vim/.vim/plugged/coc.nvim/lua/coc/highlight.lua @@ -0,0 +1,85 @@ +local api = vim.api + +local M = {} + +-- Get single line extmarks +function M.getHighlights(bufnr, key, s, e) + if not api.nvim_buf_is_loaded(bufnr) then + return nil + end + s = s or 0 + e = e or -1 + local max = e == -1 and api.nvim_buf_line_count(bufnr) or e + 1 + local ns = api.nvim_create_namespace('coc-' .. key) + local markers = api.nvim_buf_get_extmarks(bufnr, ns, {s, 0}, {e, -1}, {details = true}) + local res = {} + for _, mark in ipairs(markers) do + local id = mark[1] + local line = mark[2] + local startCol = mark[3] + local details = mark[4] + local endCol = details.end_col + if line < max then + local delta = details.end_row - line + if delta <= 1 and (delta == 0 or endCol == 0) then + if startCol == endCol then + api.nvim_buf_del_extmark(bufnr, ns, id) + else + if delta == 1 then + local text = api.nvim_buf_get_lines(bufnr, line, line + 1, false)[1] or '' + endCol = #text + end + table.insert(res, {details.hl_group, line, startCol, endCol, id}) + end + end + end + end + return res +end + +local function addHighlights(bufnr, ns, highlights, priority) + for _, items in ipairs(highlights) do + local hlGroup = items[1] + local line = items[2] + local startCol = items[3] + local endCol = items[4] + local hlMode = items[5] and 'combine' or 'replace' + -- Error: col value outside range + pcall(api.nvim_buf_set_extmark, bufnr, ns, line, startCol, { + end_col = endCol, + hl_group = hlGroup, + hl_mode = hlMode, + right_gravity = true, + priority = type(priority) == 'number' and math.min(priority, 4096) or 4096 + }) + end +end + +local function addHighlightTimer(bufnr, ns, highlights, priority, maxCount) + local hls = {} + local next = {} + for i, v in ipairs(highlights) do + if i < maxCount then + table.insert(hls, v) + else + table.insert(next, v) + end + end + addHighlights(bufnr, ns, hls, priority) + if #next > 0 then + vim.defer_fn(function() + addHighlightTimer(bufnr, ns, next, priority, maxCount) + end, 30) + end +end + +function M.set(bufnr, ns, highlights, priority) + local maxCount = vim.g.coc_highlight_maximum_count + if #highlights > maxCount then + addHighlightTimer(bufnr, ns, highlights, priority, maxCount) + else + addHighlights(bufnr, ns, highlights, priority) + end +end + +return M diff --git a/_vim/.vim/plugged/coc.nvim/package.json b/_vim/.vim/plugged/coc.nvim/package.json index e1cf7a6..3285f30 100644 --- a/_vim/.vim/plugged/coc.nvim/package.json +++ b/_vim/.vim/plugged/coc.nvim/package.json @@ -1,105 +1,17 @@ { - "name": "coc.nvim", - "version": "0.0.78", + "name": "coc.nvim-release", + "version": "0.0.82", "description": "LSP based intellisense engine for neovim & vim8.", - "main": "./lib/index.js", - "bin": "./bin/server.js", "engines": { - "node": ">=8.10.0" - }, - "scripts": { - "clean": "rimraf lib build", - "lint": "tslint -c tslint.json -p .", - "build": "tsc -p tsconfig.json", - "watch": "tsc -p tsconfig.json --watch true --sourceMap", - "test": "node --trace-warnings node_modules/jest/bin/jest.js --runInBand --detectOpenHandles --forceExit", - "test-build": "node --trace-warnings node_modules/jest/bin/jest.js --runInBand --coverage --forceExit", - "prepare": "npm-run-all clean build" + "node": ">=12.12.0" }, "repository": { "type": "git", "url": "git+https://github.com/neoclide/coc.nvim.git" }, - "keywords": [ - "complete", - "neovim" - ], "author": "Qiming Zhao ", - "license": "MIT", "bugs": { "url": "https://github.com/neoclide/coc.nvim/issues" }, - "homepage": "https://github.com/neoclide/coc.nvim#readme", - "jest": { - "globals": { - "__TEST__": true - }, - "watchman": false, - "clearMocks": true, - "globalSetup": "./jest.js", - "testEnvironment": "node", - "moduleFileExtensions": [ - "ts", - "tsx", - "json", - "js" - ], - "transform": { - "^.+\\.tsx?$": "ts-jest" - }, - "testRegex": "src/__tests__/.*\\.(test|spec)\\.ts$", - "coverageDirectory": "./coverage/" - }, - "devDependencies": { - "@chemzqm/tslint-config": "^1.0.18", - "@types/debounce": "^3.0.0", - "@types/fb-watchman": "^2.0.0", - "@types/glob": "^7.1.1", - "@types/jest": "^24.0.18", - "@types/minimatch": "^3.0.3", - "@types/mkdirp": "^0.5.2", - "@types/node": "^12.12.17", - "@types/semver": "^6.0.2", - "@types/tar": "^4.0.3", - "@types/tunnel": "^0.0.1", - "@types/uuid": "^3.4.5", - "@types/which": "^1.3.1", - "colors": "^1.3.3", - "jest": "24.9.0", - "npm-run-all": "^4.1.5", - "ts-jest": "^24.2.0", - "tslint": "^5.19.0", - "typescript": "^3.8.2", - "vscode-languageserver": "^6.1.1" - }, - "dependencies": { - "@chemzqm/neovim": "5.2.3", - "await-semaphore": "^0.1.3", - "bser": "^2.1.0", - "bytes": "^3.1.0", - "clipboardy": "^2.3.0", - "debounce": "^1.2.0", - "fast-diff": "^1.2.0", - "fb-watchman": "^2.0.0", - "follow-redirects": "^1.9.0", - "glob": "^7.1.4", - "isuri": "^2.0.3", - "jsonc-parser": "^2.1.1", - "log4js": "^5.1.0", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "mv": "^2.1.1", - "rc": "^1.2.8", - "rimraf": "^3.0.0", - "semver": "^6.3.0", - "tar": "^4.4.10", - "tslib": "^1.11.0", - "tunnel": "^0.0.6", - "uuid": "^3.3.3", - "vscode-languageserver-protocol": "^3.15.3", - "vscode-languageserver-textdocument": "^1.0.1", - "vscode-languageserver-types": "^3.15.1", - "vscode-uri": "^2.0.3", - "which": "^1.3.1" - } + "homepage": "https://github.com/neoclide/coc.nvim#readme" } diff --git a/_vim/.vim/plugged/coc.nvim/plugin/coc.vim b/_vim/.vim/plugged/coc.nvim/plugin/coc.vim index 9141c60..9b4d5c5 100644 --- a/_vim/.vim/plugged/coc.nvim/plugin/coc.vim +++ b/_vim/.vim/plugged/coc.nvim/plugin/coc.vim @@ -1,13 +1,57 @@ +scriptencoding utf-8 if exists('g:did_coc_loaded') || v:version < 800 finish endif -if has('nvim') && !has('nvim-0.3.0') | finish | endif + +function! s:checkVersion() abort + let l:unsupported = 0 + if get(g:, 'coc_disable_startup_warning', 0) != 1 + if has('nvim') + let l:unsupported = !has('nvim-0.4.0') + else + let l:unsupported = !has('patch-8.1.1719') + endif + + if l:unsupported == 1 + echohl Error + echom "coc.nvim requires at least Vim 8.1.1719 or Neovim 0.4.0, but you're using an older version." + echom "Please upgrade your (neo)vim." + echom "You can add this to your vimrc to avoid this message:" + echom " let g:coc_disable_startup_warning = 1" + echom "Note that some features may error out or behave incorrectly." + echom "Please do not report bugs unless you're using at least Vim 8.1.1719 or Neovim 0.4.0." + echohl None + sleep 2 + else + if !has('nvim-0.5.0') && !has('patch-8.2.0750') + echohl WarningMsg + echom "coc.nvim works best on vim >= 8.2.0750 and neovim >= 0.5.0, consider upgrade your vim." + echom "You can add this to your vimrc to avoid this message:" + echom " let g:coc_disable_startup_warning = 1" + echom "Note that some features may behave incorrectly." + echohl None + sleep 2 + elseif !has('nvim') && (!has('job') || !has('popupwin') || !has('textprop')) + echohl WarningMsg + echom "coc.nvim requires job, popupwin and textprop features of vim, consider recompile your vim." + echom "You can add this to your vimrc to avoid this message:" + echom " let g:coc_disable_startup_warning = 1" + echom "Note that some features may behave incorrectly." + echohl None + sleep 2 + endif + endif + endif +endfunction + +call s:checkVersion() + let g:did_coc_loaded = 1 let g:coc_service_initialized = 0 let s:is_win = has('win32') || has('win64') let s:root = expand(':h:h') let s:is_vim = !has('nvim') -let s:is_gvim = get(v:, 'progname', '') ==# 'gvim' +let s:is_gvim = s:is_vim && has("gui_running") if get(g:, 'coc_start_at_startup', 1) && !s:is_gvim call coc#rpc#start_server() @@ -21,16 +65,48 @@ function! CocTagFunc(pattern, flags, info) abort return coc#rpc#request('getTagList', []) endfunction -function! CocAction(...) abort - return coc#rpc#request('CocAction', a:000) +function! CocPopupCallback(bufnr, arglist) abort + if len(a:arglist) == 2 + if a:arglist[0] == 'confirm' + call coc#rpc#notify('PromptInsert', [a:arglist[1], a:bufnr]) + elseif a:arglist[0] == 'exit' + execute 'silent! bd! '.a:bufnr + "call coc#rpc#notify('PromptUpdate', [a:arglist[1]]) + elseif a:arglist[0] == 'change' + let text = a:arglist[1] + let current = getbufvar(a:bufnr, 'current', '') + if text !=# current + call setbufvar(a:bufnr, 'current', text) + let cursor = term_getcursor(a:bufnr) + let info = { + \ 'lnum': cursor[0], + \ 'col': cursor[1], + \ 'line': text, + \ 'changedtick': 0 + \ } + call coc#rpc#notify('CocAutocmd', ['TextChangedI', a:bufnr, info]) + endif + elseif a:arglist[0] == 'send' + let key = a:arglist[1] + let escaped = strcharpart(key, 1, strchars(key) - 2) + call coc#rpc#notify('PromptKeyPress', [a:bufnr, escaped]) + endif + endif +endfunction + +function! CocAction(name, ...) abort + if !get(g:, 'coc_service_initialized', 0) + throw 'coc.nvim not ready when invoke CocAction "'.a:name.'"' + endif + return coc#rpc#request(a:name, a:000) endfunction function! CocHasProvider(name) abort return coc#rpc#request('hasProvider', [a:name]) endfunction -function! CocActionAsync(...) abort - return s:AsyncRequest('CocAction', a:000) +function! CocActionAsync(name, ...) abort + return s:AsyncRequest(a:name, a:000) endfunction function! CocRequest(...) abort @@ -41,18 +117,23 @@ function! CocNotify(...) abort return coc#rpc#request('sendNotification', a:000) endfunction +function! CocRegisterNotification(id, method, cb) abort + call coc#on_notify(a:id, a:method, a:cb) +endfunction + +" Deprecated, use CocRegisterNotification instead function! CocRegistNotification(id, method, cb) abort call coc#on_notify(a:id, a:method, a:cb) endfunction function! CocLocations(id, method, ...) abort let args = [a:id, a:method] + copy(a:000) - call coc#rpc#request('findLocations', args) + return coc#rpc#request('findLocations', args) endfunction function! CocLocationsAsync(id, method, ...) abort let args = [a:id, a:method] + copy(a:000) - call coc#rpc#notify('findLocations', args) + return s:AsyncRequest('findLocations', args) endfunction function! CocRequestAsync(...) @@ -60,7 +141,7 @@ function! CocRequestAsync(...) endfunction function! s:AsyncRequest(name, args) abort - let Cb = a:args[len(a:args) - 1] + let Cb = empty(a:args)? v:null : a:args[len(a:args) - 1] if type(Cb) == 2 if !coc#rpc#ready() call Cb('service not started', v:null) @@ -74,7 +155,7 @@ function! s:AsyncRequest(name, args) abort endfunction function! s:CommandList(...) abort - let list = coc#rpc#request('CommandList', a:000) + let list = coc#rpc#request('commandList', a:000) return join(list, "\n") endfunction @@ -89,7 +170,12 @@ function! s:SearchOptions(...) abort let list = ['-e', '--regexp', '-F', '--fixed-strings', '-L', '--follow', \ '-g', '--glob', '--hidden', '--no-hidden', '--no-ignore-vcs', \ '--word-regexp', '-w', '--smart-case', '-S', '--no-config', - \ '--line-regexp', '-x'] + \ '--line-regexp', '--no-ignore', '-x'] + return join(list, "\n") +endfunction + +function! s:LoadedExtensions(...) abort + let list = CocAction('loadedExtensions') return join(list, "\n") endfunction @@ -100,13 +186,33 @@ endfunction function! s:OpenConfig() let home = coc#util#get_config_home() - if home =~# '^\~' - let home = substitute(home, '\~', $HOME,'') - endif if !isdirectory(home) - call mkdir(home, 'p') + echohl MoreMsg + echom 'Config directory "'.home.'" does not exist, create? (y/n)' + echohl None + let confirm = nr2char(getchar()) + redraw! + if !(confirm ==? "y" || confirm ==? "\r") + return + else + call mkdir(home, 'p') + end endif execute 'edit '.home.'/coc-settings.json' + call coc#rpc#notify('checkJsonExtension', []) +endfunction + +function! s:get_color(item, fallback) abort + let t = type(a:item) + if t == 1 + return a:item + endif + if t == 4 + let item = get(a:item, 'gui', {}) + let color = get(item, &background, a:fallback) + return type(color) == 1 ? color : a:fallback + endif + return a:fallback endfunction function! s:AddAnsiGroups() abort @@ -116,26 +222,35 @@ function! s:AddAnsiGroups() abort for i in range(0, len(names) - 1) let name = names[i] if exists('g:terminal_ansi_colors') - let color_map[name] = get(g:terminal_ansi_colors, i, colors[i]) + let color_map[name] = s:get_color(get(g:terminal_ansi_colors, i, colors[i]), colors[i]) else let color_map[name] = get(g:, 'terminal_color_'.i, colors[i]) endif endfor - for name in keys(color_map) - let foreground = toupper(name[0]).name[1:] - let foregroundColor = color_map[name] - for key in keys(color_map) - let background = toupper(key[0]).key[1:] - let backgroundColor = color_map[key] - exe 'hi default CocList'.foreground.background.' guifg='.foregroundColor.' guibg='.backgroundColor - endfor - try + try + for name in keys(color_map) + let foreground = toupper(name[0]).name[1:] + let foregroundColor = color_map[name] + for key in keys(color_map) + let background = toupper(key[0]).key[1:] + let backgroundColor = color_map[key] + exe 'hi default CocList'.foreground.background.' guifg='.foregroundColor.' guibg='.backgroundColor + endfor exe 'hi default CocListFg'.foreground. ' guifg='.foregroundColor. ' ctermfg='.foreground exe 'hi default CocListBg'.foreground. ' guibg='.foregroundColor. ' ctermbg='.foreground - catch /.*/ - " ignore invalid color - endtry - endfor + endfor + catch /.*/ + " ignore invalid color + endtry +endfunction + +function! s:CreateHighlight(group, fg, bg) abort + let cmd = coc#highlight#compose(a:fg, a:bg) + if !empty(trim(cmd)) + exe 'hi default '.a:group.' '.cmd + else + exe 'hi default link '.a:group.' '.a:fg + endif endfunction function! s:CursorRangeFromSelected(type, ...) abort @@ -143,6 +258,16 @@ function! s:CursorRangeFromSelected(type, ...) abort call coc#rpc#request('cursorsSelect', [bufnr('%'), 'operator', a:type]) endfunction +function! s:OpenDiagnostics(...) abort + let height = get(a:, 1, 0) + call coc#rpc#request('fillDiagnostics', [bufnr('%')]) + if height + execute ':lopen '.height + else + lopen + endif +endfunction + function! s:Disable() abort if get(g:, 'coc_enabled', 0) == 0 return @@ -150,31 +275,59 @@ function! s:Disable() abort augroup coc_nvim autocmd! augroup end + call coc#rpc#request('detach', []) echohl MoreMsg - echom '[coc.nvim] Disabled' + echom '[coc.nvim] Event disabled' echohl None let g:coc_enabled = 0 endfunction function! s:Autocmd(...) abort - if !get(g:,'coc_workspace_initialized', 0) + if !get(g:, 'coc_workspace_initialized', 0) return endif call coc#rpc#notify('CocAutocmd', a:000) endfunction +function! s:HandleCharInsert(char, bufnr) abort + if get(g:, 'coc_disable_space_report', 0) + let g:coc_disable_space_report = 0 + if a:char ==# ' ' + return + endif + endif + call s:Autocmd('InsertCharPre', a:char, a:bufnr) +endfunction + +function! s:HandleWinScrolled(winid) abort + if getwinvar(a:winid, 'float', 0) + call coc#float#nvim_scrollbar(a:winid) + endif + call s:Autocmd('WinScrolled', a:winid) +endfunction + +function! s:HandleWinClosed(winid) abort + call coc#float#on_close(a:winid) + call coc#notify#on_close(a:winid) + call s:Autocmd('WinClosed', a:winid) +endfunction + function! s:SyncAutocmd(...) - if !get(g:,'coc_workspace_initialized', 0) + if !get(g:, 'coc_workspace_initialized', 0) return endif - if get(g:, 'coc_service_initialized', 0) - call coc#rpc#request('CocAutocmd', a:000) - else - call coc#rpc#notify('CocAutocmd', a:000) + call coc#rpc#request('CocAutocmd', a:000) +endfunction + +function! s:CheckHighlight() abort + let fgId = synIDtrans(hlID('CocSelectedText')) + let guifg = synIDattr(fgId, 'fg', 'gui') + if empty(guifg) + call s:Highlight() endif endfunction -function! s:Enable() +function! s:Enable(initialize) if get(g:, 'coc_enabled', 0) == 1 return endif @@ -183,24 +336,19 @@ function! s:Enable() augroup coc_nvim autocmd! - if exists('##MenuPopupChanged') && exists('*nvim_open_win') - autocmd MenuPopupChanged * call s:Autocmd('MenuPopupChanged', get(v:, 'event', {}), win_screenpos(winnr())[0] + winline() - 2) - endif - if exists('##CompleteChanged') - autocmd CompleteChanged * call s:Autocmd('MenuPopupChanged', get(v:, 'event', {}), win_screenpos(winnr())[0] + winline() - 2) - endif - if exists('##MenuPopupChanged') || exists('##CompleteChanged') - autocmd CompleteDone * call coc#util#close_popup() - endif - if coc#rpc#started() autocmd VimEnter * call coc#rpc#notify('VimEnter', []) elseif get(g:, 'coc_start_at_startup', 1) autocmd VimEnter * call coc#rpc#start_server() endif + if v:vim_did_enter + call s:CheckHighlight() + else + autocmd VimEnter * call timer_start(0, { -> s:CheckHighlight()}) + endif if s:is_vim if exists('##DirChanged') - autocmd DirChanged * call s:Autocmd('DirChanged', expand('')) + autocmd DirChanged * call s:Autocmd('DirChanged', getcwd()) endif if exists('##TerminalOpen') autocmd TerminalOpen * call s:Autocmd('TermOpen', +expand('')) @@ -208,78 +356,263 @@ function! s:Enable() else autocmd DirChanged * call s:Autocmd('DirChanged', get(v:event, 'cwd', '')) autocmd TermOpen * call s:Autocmd('TermOpen', +expand('')) - autocmd TermClose * call s:Autocmd('TermClose', +expand('')) + autocmd WinEnter * call coc#float#nvim_win_enter(win_getid()) + endif + if exists('##CompleteChanged') + autocmd CompleteChanged * call coc#pum#stop() endif - autocmd WinLeave * call coc#util#clearmatches(get(w:, 'coc_matchids', [])) - autocmd BufWinLeave * call s:Autocmd('BufWinLeave', +expand(''), win_getid()) + autocmd CursorMoved list:///* call coc#list#select(bufnr('%'), line('.')) + autocmd CursorHold * call coc#float#check_related() + if exists('##WinClosed') + autocmd WinClosed * call s:HandleWinClosed(+expand('')) + elseif exists('##TabEnter') + autocmd TabEnter * call coc#notify#reflow() + endif + if exists('##WinScrolled') + autocmd WinScrolled * call s:HandleWinScrolled(+expand('')) + endif + autocmd TabNew * call s:Autocmd('TabNew', tabpagenr()) + autocmd TabClosed * call s:Autocmd('TabClosed', +expand('')) + autocmd WinLeave * call s:Autocmd('WinLeave', win_getid()) + autocmd WinEnter * call s:Autocmd('WinEnter', win_getid()) + autocmd BufWinLeave * call s:Autocmd('BufWinLeave', +expand(''), bufwinid(+expand(''))) autocmd BufWinEnter * call s:Autocmd('BufWinEnter', +expand(''), win_getid()) autocmd FileType * call s:Autocmd('FileType', expand(''), +expand('')) - autocmd CompleteDone * call s:Autocmd('CompleteDone', get(v:, 'completed_item', {})) - autocmd InsertCharPre * call s:Autocmd('InsertCharPre', v:char) + autocmd InsertCharPre * call s:HandleCharInsert(v:char, bufnr('%')) if exists('##TextChangedP') - autocmd TextChangedP * call s:Autocmd('TextChangedP', +expand('')) + autocmd TextChangedP * call s:Autocmd('TextChangedP', +expand(''), coc#util#change_info()) endif - autocmd TextChangedI * call s:Autocmd('TextChangedI', +expand('')) + autocmd TextChangedI * call s:Autocmd('TextChangedI', +expand(''), coc#util#change_info()) autocmd InsertLeave * call s:Autocmd('InsertLeave', +expand('')) autocmd InsertEnter * call s:Autocmd('InsertEnter', +expand('')) autocmd BufHidden * call s:Autocmd('BufHidden', +expand('')) autocmd BufEnter * call s:Autocmd('BufEnter', +expand('')) autocmd TextChanged * call s:Autocmd('TextChanged', +expand(''), getbufvar(+expand(''), 'changedtick')) - autocmd BufWritePost * call s:Autocmd('BufWritePost', +expand('')) - autocmd CursorMoved * call s:Autocmd('CursorMoved', +expand(''), [line('.'), col('.')]) - autocmd CursorMovedI * call s:Autocmd('CursorMovedI', +expand(''), [line('.'), col('.')]) - autocmd CursorHold * call s:Autocmd('CursorHold', +expand('')) - autocmd CursorHoldI * call s:Autocmd('CursorHoldI', +expand('')) + autocmd BufWritePost * call s:Autocmd('BufWritePost', +expand(''), getbufvar(+expand(''), 'changedtick')) + autocmd CursorMoved * call s:Autocmd('CursorMoved', +expand(''), [line('.'), col('.'), getline('.')]) + autocmd CursorMovedI * call s:Autocmd('CursorMovedI', +expand(''), [line('.'), col('.'), getline('.')]) + autocmd CursorHold * call s:Autocmd('CursorHold', +expand(''), [line('.'), col('.')]) + autocmd CursorHoldI * call s:Autocmd('CursorHoldI', +expand(''), [line('.'), col('.')]) autocmd BufNewFile,BufReadPost * call s:Autocmd('BufCreate', +expand('')) - autocmd BufUnload * call s:SyncAutocmd('BufUnload', +expand('')) - autocmd BufWritePre * call s:SyncAutocmd('BufWritePre', +expand('')) + autocmd BufUnload * call s:Autocmd('BufUnload', +expand('')) + autocmd BufWritePre * call s:SyncAutocmd('BufWritePre', +expand(''), bufname(+expand('')), getbufvar(+expand(''), 'changedtick')) autocmd FocusGained * if mode() !~# '^c' | call s:Autocmd('FocusGained') | endif + autocmd FocusLost * call s:Autocmd('FocusLost') autocmd VimResized * call s:Autocmd('VimResized', &columns, &lines) autocmd VimLeavePre * let g:coc_vim_leaving = 1 - autocmd VimLeave * call s:SyncAutocmd('VimLeave') + autocmd VimLeavePre * call s:Autocmd('VimLeavePre') autocmd BufReadCmd,FileReadCmd,SourceCmd list://* call coc#list#setup(expand('')) autocmd BufWriteCmd __coc_refactor__* :call coc#rpc#notify('saveRefactor', [+expand('')]) + autocmd ColorScheme * call s:Highlight() augroup end + if a:initialize == 0 + call coc#rpc#request('attach', []) + echohl MoreMsg + echom '[coc.nvim] Event enabled' + echohl None + endif endfunction -hi default CocUnderline cterm=underline gui=underline -hi default CocErrorSign ctermfg=Red guifg=#ff0000 -hi default CocWarningSign ctermfg=Brown guifg=#ff922b -hi default CocInfoSign ctermfg=Yellow guifg=#fab005 -hi default CocHintSign ctermfg=Blue guifg=#15aabf -hi default CocSelectedText ctermfg=Red guifg=#fb4934 -hi default CocCodeLens ctermfg=Gray guifg=#999999 -hi default link CocErrorFloat CocErrorSign -hi default link CocWarningFloat CocWarningSign -hi default link CocInfoFloat CocInfoSign -hi default link CocHintFloat CocHintSign -hi default link CocErrorHighlight CocUnderline -hi default link CocWarningHighlight CocUnderline -hi default link CocInfoHighlight CocUnderline -hi default link CocHintHighlight CocUnderline -hi default link CocListMode ModeMsg -hi default link CocListPath Comment -hi default link CocHighlightText CursorColumn -if has('nvim') - hi default link CocFloating NormalFloat -else - hi default link CocFloating Pmenu -endif -if has('nvim-0.5.0') - hi default CocCursorTransparent gui=strikethrough blend=100 -endif +function! s:Highlight() abort + hi default CocSelectedText ctermfg=Red guifg=#fb4934 guibg=NONE + hi default CocCodeLens ctermfg=Gray guifg=#999999 guibg=NONE + hi default CocUnderline term=underline cterm=underline gui=underline guisp=#ebdbb2 + hi default CocBold term=bold cterm=bold gui=bold + hi default CocItalic term=italic cterm=italic gui=italic + hi default CocStrikeThrough term=strikethrough cterm=strikethrough gui=strikethrough + hi default CocMarkdownLink ctermfg=Blue guifg=#15aabf guibg=NONE + hi default CocDisabled guifg=#999999 ctermfg=gray + hi default CocSearch ctermfg=Blue guifg=#15aabf guibg=NONE + if coc#highlight#get_contrast('Normal', has('nvim') ? 'NormalFloat' : 'Pmenu') > 2.0 + exe 'hi default CocFloating '.coc#highlight#create_bg_command('Normal', &background ==# 'dark' ? -0.4 : 0.1) + exe 'hi default CocMenuSel '.coc#highlight#create_bg_command('CocFloating', &background ==# 'dark' ? -0.2 : 0.05) + exe 'hi default CocFloatThumb '.coc#highlight#create_bg_command('CocFloating', &background ==# 'dark' ? -0.3 : 0.2) + exe 'hi default CocFloatSbar '.coc#highlight#create_bg_command('CocFloatThumb', &background ==# 'dark' ? -0.5 : 0.3) + else + exe 'hi default link CocFloating '.(has('nvim') ? 'NormalFloat' : 'Pmenu') + if coc#highlight#get_contrast('CocFloating', 'PmenuSel') > 2.0 + exe 'hi default CocMenuSel '.coc#highlight#create_bg_command('CocFloating', &background ==# 'dark' ? -0.2 : 0.05) + else + exe 'hi default CocMenuSel '.coc#highlight#get_hl_command(synIDtrans(hlID('PmenuSel')), 'bg', '237', '#13354A') + endif + hi default link CocFloatThumb PmenuThumb + hi default link CocFloatSbar PmenuSbar + endif + hi default link CocFloatActive CocSearch + hi default link CocFadeOut Conceal + hi default link CocMarkdownCode markdownCode + hi default link CocMarkdownHeader markdownH1 + hi default link CocDeprecatedHighlight CocStrikeThrough + hi default link CocUnusedHighlight CocFadeOut + hi default link CocListLine CursorLine + hi default link CocListSearch CocSearch + hi default link CocListMode ModeMsg + hi default link CocListPath Comment + hi default link CocHighlightText CursorColumn + hi default link CocHoverRange Search + hi default link CocCursorRange Search + hi default link CocLinkedEditing CocCursorRange + hi default link CocHighlightRead CocHighlightText + hi default link CocHighlightWrite CocHighlightText + " Notification + hi default CocNotificationProgress ctermfg=Blue guifg=#15aabf guibg=NONE + hi default link CocNotificationButton CocUnderline + hi default link CocNotificationError CocErrorFloat + hi default link CocNotificationWarning CocWarningFloat + hi default link CocNotificationInfo CocInfoFloat + " Snippet + hi default link CocSnippetVisual Visual + " Tree view highlights + hi default link CocTreeTitle Title + hi default link CocTreeDescription Comment + hi default link CocTreeOpenClose CocBold + hi default link CocTreeSelected CursorLine + hi default link CocSelectedRange CocHighlightText + " Symbol highlights + hi default link CocSymbolDefault MoreMsg + "Pum + hi default link CocPumSearch CocSearch + hi default link CocPumDetail Comment + hi default link CocPumMenu CocFloating + hi default link CocPumShortcut Comment + hi default link CocPumDeprecated CocStrikeThrough + hi default CocPumVirtualText ctermfg=12 guifg=#504945 + hi default CocFloatDividingLine ctermfg=12 guifg=#504945 + + if !exists('*sign_getdefined') || empty(sign_getdefined('CocCurrentLine')) + sign define CocCurrentLine linehl=CocMenuSel + endif + if !exists('*sign_getdefined') || empty(sign_getdefined('CocListCurrent')) + sign define CocListCurrent linehl=CocListLine + endif + if !exists('*sign_getdefined') || empty(sign_getdefined('CocTreeSelected')) + sign define CocTreeSelected linehl=CocTreeSelected + endif + if has('nvim-0.5.0') + hi default CocCursorTransparent gui=strikethrough blend=100 + endif -hi default link CocHoverRange Search -hi default link CocCursorRange Search -hi default link CocHighlightRead CocHighlightText -hi default link CocHighlightWrite CocHighlightText + let sign_colors = { + \ 'Error': ['Red', '#ff0000'], + \ 'Warn': ['Brown', '#ff922b'], + \ 'Info': ['Yellow', '#fab005'], + \ 'Hint': ['Blue', '#15aabf'] + \ } + for name in ['Error', 'Warning', 'Info', 'Hint'] + let suffix = name ==# 'Warning' ? 'Warn' : name + if hlexists('DiagnosticUnderline'.suffix) + exe 'hi default link Coc'.name.'Highlight DiagnosticUnderline'.suffix + else + exe 'hi default link Coc'.name.'Highlight CocUnderline' + endif + if hlexists('DiagnosticSign'.suffix) + exe 'hi default link Coc'.name.'Sign DiagnosticSign'.suffix + else + exe 'hi default Coc'.name.'Sign ctermfg='.sign_colors[suffix][0].' guifg='.sign_colors[suffix][1] + endif + if hlexists('DiagnosticVirtualText'.suffix) + exe 'hi default link Coc'.name.'VirtualText DiagnosticVirtualText'.suffix + else + call s:CreateHighlight('Coc'.name.'VirtualText', 'Coc'.name.'Sign', 'Normal') + endif + if hlexists('Diagnostic'.suffix) + exe 'hi default link Coc'.name.'Float Diagnostic'.suffix + else + call s:CreateHighlight('Coc'.name.'Float', 'Coc'.name.'Sign', 'CocFloating') + endif + endfor + + call s:CreateHighlight('CocInlayHint', 'CocHintSign', 'SignColumn') + for name in ['Parameter', 'Type'] + exe 'hi default link CocInlayHint'.name.' CocInlayHint' + endfor + + call s:AddAnsiGroups() + + if get(g:, 'coc_default_semantic_highlight_groups', 1) + let hlMap = { + \ 'Namespace': ['TSNamespace', 'Include'], + \ 'Type': ['TSType', 'Type'], + \ 'Class': ['TSConstructor', 'Special'], + \ 'Enum': ['TSEnum', 'Type'], + \ 'Interface': ['TSInterface', 'Type'], + \ 'Struct': ['TSStruct', 'Identifier'], + \ 'TypeParameter': ['TSParameter', 'Identifier'], + \ 'Parameter': ['TSParameter', 'Identifier'], + \ 'Variable': ['TSSymbol', 'Identifier'], + \ 'Property': ['TSProperty', 'Identifier'], + \ 'EnumMember': ['TSEnumMember', 'Constant'], + \ 'Event': ['TSEvent', 'Keyword'], + \ 'Function': ['TSFunction', 'Function'], + \ 'Method': ['TSMethod', 'Function'], + \ 'Macro': ['TSConstMacro', 'Define'], + \ 'Keyword': ['TSKeyword', 'Keyword'], + \ 'Modifier': ['TSModifier', 'StorageClass'], + \ 'Comment': ['TSComment', 'Comment'], + \ 'String': ['TSString', 'String'], + \ 'Number': ['TSNumber', 'Number'], + \ 'Boolean': ['TSBoolean', 'Boolean'], + \ 'Regexp': ['TSStringRegex', 'String'], + \ 'Operator': ['TSOperator', 'Operator'], + \ 'Decorator': ['TSSymbol', 'Identifier'], + \ 'Deprecated': ['TSStrike', 'CocDeprecatedHighlight'] + \ } + for [key, value] in items(hlMap) + let ts = get(value, 0, '') + let fallback = get(value, 1, '') + execute 'hi default link CocSem'.key.' '.(hlexists(ts) ? ts : fallback) + endfor + endif + let symbolMap = { + \ 'Keyword': ['TSKeyword', 'Keyword'], + \ 'Namespace': ['TSNamespace', 'Include'], + \ 'Class': ['TSConstructor', 'Special'], + \ 'Method': ['TSMethod', 'Function'], + \ 'Property': ['TSProperty', 'Identifier'], + \ 'Text': ['TSText', 'CocSymbolDefault'], + \ 'Unit': ['TSUnit', 'CocSymbolDefault'], + \ 'Value': ['TSValue', 'CocSymbolDefault'], + \ 'Snippet': ['TSSnippet', 'CocSymbolDefault'], + \ 'Color': ['TSColor', 'Float'], + \ 'Reference': ['TSTextReference', 'Constant'], + \ 'Folder': ['TSFolder', 'CocSymbolDefault'], + \ 'File': ['TSFile', 'Statement'], + \ 'Module': ['TSModule', 'Statement'], + \ 'Package': ['TSPackage', 'Statement'], + \ 'Field': ['TSField', 'Identifier'], + \ 'Constructor': ['TSConstructor', 'Special'], + \ 'Enum': ['TSEnum', 'CocSymbolDefault'], + \ 'Interface': ['TSInterface', 'CocSymbolDefault'], + \ 'Function': ['TSFunction', 'Function'], + \ 'Variable': ['TSVariableBuiltin', 'Special'], + \ 'Constant': ['TSConstant', 'Constant'], + \ 'String': ['TSString', 'String'], + \ 'Number': ['TSNumber', 'Number'], + \ 'Boolean': ['TSBoolean', 'Boolean'], + \ 'Array': ['TSArray', 'CocSymbolDefault'], + \ 'Object': ['TSObject', 'CocSymbolDefault'], + \ 'Key': ['TSKey', 'Identifier'], + \ 'Null': ['TSNull', 'Type'], + \ 'EnumMember': ['TSEnumMember', 'Identifier'], + \ 'Struct': ['TSStruct', 'Keyword'], + \ 'Event': ['TSEvent', 'Constant'], + \ 'Operator': ['TSOperator', 'Operator'], + \ 'TypeParameter': ['TSParameter', 'Identifier'], + \ } + for [key, value] in items(symbolMap) + let hlGroup = hlexists(value[0]) ? value[0] : get(value, 1, 'CocSymbolDefault') + if hlexists(hlGroup) + execute 'hi default CocSymbol'.key.' '.coc#highlight#get_hl_command(synIDtrans(hlID(hlGroup)), 'fg', '223', '#ebdbb2') + endif + endfor +endfunction function! s:FormatFromSelected(type) - call CocAction('formatSelected', a:type) + call CocActionAsync('formatSelected', a:type) endfunction function! s:CodeActionFromSelected(type) - call CocAction('codeAction', a:type) + call CocActionAsync('codeAction', a:type) endfunction function! s:ShowInfo() @@ -288,97 +621,132 @@ function! s:ShowInfo() else let lines = [] echomsg 'coc.nvim service not started, checking environment...' - let node = get(g:, 'coc_node_path', 'node') + let node = get(g:, 'coc_node_path', $COC_NODE_PATH == '' ? 'node' : $COC_NODE_PATH) if !executable(node) call add(lines, 'Error: '.node.' is not executable!') else let output = trim(system(node . ' --version')) let ms = matchlist(output, 'v\(\d\+\).\(\d\+\).\(\d\+\)') - if empty(ms) || str2nr(ms[1]) < 8 || (str2nr(ms[1]) == 8 && str2nr(ms[2]) < 10) - call add(lines, 'Error: Node version '.output.' < 8.10.0, please upgrade node.js') + if empty(ms) || str2nr(ms[1]) < 14 || (str2nr(ms[1]) == 14 && str2nr(ms[2]) < 14) + call add(lines, 'Error: Node version '.output.' < 14.14.0, please upgrade node.js') endif endif " check bundle - let file = s:root.'/lib/attach.js' + let file = s:root.'/build/index.js' if !filereadable(file) - let file = s:root.'/build/index.js' - if !filereadable(file) - call add(lines, 'Error: javascript bundle not found, run :call coc#util#install() to fix.') - endif + call add(lines, 'Error: javascript bundle not found, please compile code of coc.nvim by esbuild.') endif if !empty(lines) - belowright vnew + botright vnew setl filetype=nofile call setline(1, lines) else if get(g:, 'coc_start_at_startup',1) - echohl MoreMsg | echon 'Start on startup is disabled, try :CocStart' | echohl None - else echohl MoreMsg | echon 'Service stopped for some unknown reason, try :CocStart' | echohl None + else + echohl MoreMsg | echon 'Start on startup is disabled, try :CocStart' | echohl None endif endif endif endfunction +command! -nargs=0 CocOutline :call coc#rpc#notify('showOutline', []) +command! -nargs=? CocDiagnostics :call s:OpenDiagnostics() command! -nargs=0 CocInfo :call s:ShowInfo() command! -nargs=0 CocOpenLog :call coc#rpc#notify('openLog', []) -command! -nargs=0 CocListResume :call coc#rpc#notify('listResume', []) -command! -nargs=0 CocPrev :call coc#rpc#notify('listPrev', []) -command! -nargs=0 CocNext :call coc#rpc#notify('listNext', []) command! -nargs=0 CocDisable :call s:Disable() -command! -nargs=0 CocEnable :call s:Enable() +command! -nargs=0 CocEnable :call s:Enable(0) command! -nargs=0 CocConfig :call s:OpenConfig() command! -nargs=0 CocLocalConfig :call coc#rpc#notify('openLocalConfig', []) command! -nargs=0 CocRestart :call coc#rpc#restart() command! -nargs=0 CocStart :call coc#rpc#start_server() command! -nargs=0 CocRebuild :call coc#util#rebuild() +command! -nargs=1 -complete=custom,s:LoadedExtensions CocWatch :call coc#rpc#notify('watchExtension', []) command! -nargs=+ -complete=custom,s:SearchOptions CocSearch :call coc#rpc#notify('search', []) -command! -nargs=+ -complete=custom,s:ExtensionList CocUninstall :call coc#rpc#notify('CocAction', ['uninstallExtension', ]) -command! -nargs=* -complete=custom,coc#list#options CocList :call coc#rpc#notify('openList', []) +command! -nargs=+ -complete=custom,s:ExtensionList CocUninstall :call CocActionAsync('uninstallExtension', ) command! -nargs=* -complete=custom,s:CommandList -range CocCommand :call coc#rpc#notify('runCommand', []) -command! -nargs=* -range CocAction :call coc#rpc#notify('codeActionRange', [, , ]) -command! -nargs=* -range CocFix :call coc#rpc#notify('codeActionRange', [, , 'quickfix']) +command! -nargs=* -complete=custom,coc#list#options CocList :call coc#rpc#notify('openList', []) +command! -nargs=? -complete=custom,coc#list#names CocListResume :call coc#rpc#notify('listResume', []) +command! -nargs=? -complete=custom,coc#list#names CocListCancel :call coc#rpc#notify('listCancel', []) +command! -nargs=? -complete=custom,coc#list#names CocPrev :call coc#rpc#notify('listPrev', []) +command! -nargs=? -complete=custom,coc#list#names CocNext :call coc#rpc#notify('listNext', []) +command! -nargs=? -complete=custom,coc#list#names CocFirst :call coc#rpc#notify('listFirst', []) +command! -nargs=? -complete=custom,coc#list#names CocLast :call coc#rpc#notify('listLast', []) command! -nargs=0 CocUpdate :call coc#util#update_extensions(1) command! -nargs=0 -bar CocUpdateSync :call coc#util#update_extensions() command! -nargs=* -bar -complete=custom,s:InstallOptions CocInstall :call coc#util#install_extension([]) -call s:Enable() -call s:AddAnsiGroups() +call s:Highlight() +call s:Enable(1) + +" Default key-mappings for completion +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#next(1) : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#next(0) : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#prev(0) : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#cancel() : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#confirm() : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#scroll(1) : "\" +endif +if empty(mapcheck('', 'i')) + inoremap coc#pum#visible() ? coc#pum#scroll(0) : "\" +endif -vnoremap (coc-range-select) :call CocAction('rangeSelect', visualmode(), v:true) -vnoremap (coc-range-select-backward) :call CocAction('rangeSelect', visualmode(), v:false) -nnoremap (coc-range-select) :call CocAction('rangeSelect', '', v:true) +vnoremap (coc-range-select) :call CocActionAsync('rangeSelect', visualmode(), v:true) +vnoremap (coc-range-select-backward) :call CocActionAsync('rangeSelect', visualmode(), v:false) +nnoremap (coc-range-select) :call CocActionAsync('rangeSelect', '', v:true) nnoremap (coc-codelens-action) :call CocActionAsync('codeLensAction') -vnoremap (coc-format-selected) :call CocActionAsync('formatSelected', visualmode()) -vnoremap (coc-codeaction-selected) :call CocActionAsync('codeAction', visualmode()) +vnoremap (coc-format-selected) :call CocActionAsync('formatSelected', visualmode()) +vnoremap (coc-codeaction-selected) :call CocActionAsync('codeAction', visualmode()) nnoremap (coc-codeaction-selected) :set operatorfunc=CodeActionFromSelectedg@ nnoremap (coc-codeaction) :call CocActionAsync('codeAction', '') -nnoremap (coc-rename) :call CocActionAsync('rename') -nnoremap (coc-format-selected) :set operatorfunc=FormatFromSelectedg@ -nnoremap (coc-format) :call CocActionAsync('format') -nnoremap (coc-diagnostic-info) :call CocActionAsync('diagnosticInfo') -nnoremap (coc-diagnostic-next) :call CocActionAsync('diagnosticNext') -nnoremap (coc-diagnostic-prev) :call CocActionAsync('diagnosticPrevious') -nnoremap (coc-diagnostic-next-error) :call CocActionAsync('diagnosticNext', 'error') -nnoremap (coc-diagnostic-prev-error) :call CocActionAsync('diagnosticPrevious', 'error') -nnoremap (coc-definition) :call CocActionAsync('jumpDefinition') -nnoremap (coc-declaration) :call CocActionAsync('jumpDeclaration') -nnoremap (coc-implementation) :call CocActionAsync('jumpImplementation') -nnoremap (coc-type-definition) :call CocActionAsync('jumpTypeDefinition') -nnoremap (coc-references) :call CocActionAsync('jumpReferences') -nnoremap (coc-openlink) :call CocActionAsync('openLink') -nnoremap (coc-fix-current) :call CocActionAsync('doQuickfix') -nnoremap (coc-float-hide) :call coc#util#float_hide() -nnoremap (coc-float-jump) :call coc#util#float_jump() -nnoremap (coc-command-repeat) :call CocAction('repeatCommand') -nnoremap (coc-refactor) :call CocActionAsync('refactor') -inoremap CocRefresh =coc#_complete() +nnoremap (coc-codeaction-line) :call CocActionAsync('codeAction', 'currline') +nnoremap (coc-codeaction-cursor) :call CocActionAsync('codeAction', 'cursor') +nnoremap (coc-rename) :call CocActionAsync('rename') +nnoremap (coc-format-selected) :set operatorfunc=FormatFromSelectedg@ +nnoremap (coc-format) :call CocActionAsync('format') +nnoremap (coc-diagnostic-info) :call CocActionAsync('diagnosticInfo') +nnoremap (coc-diagnostic-next) :call CocActionAsync('diagnosticNext') +nnoremap (coc-diagnostic-prev) :call CocActionAsync('diagnosticPrevious') +nnoremap (coc-diagnostic-next-error) :call CocActionAsync('diagnosticNext', 'error') +nnoremap (coc-diagnostic-prev-error) :call CocActionAsync('diagnosticPrevious', 'error') +nnoremap (coc-definition) :call CocActionAsync('jumpDefinition') +nnoremap (coc-declaration) :call CocActionAsync('jumpDeclaration') +nnoremap (coc-implementation) :call CocActionAsync('jumpImplementation') +nnoremap (coc-type-definition) :call CocActionAsync('jumpTypeDefinition') +nnoremap (coc-references) :call CocActionAsync('jumpReferences') +nnoremap (coc-references-used) :call CocActionAsync('jumpUsed') +nnoremap (coc-openlink) :call CocActionAsync('openLink') +nnoremap (coc-fix-current) :call CocActionAsync('doQuickfix') +nnoremap (coc-float-hide) :call coc#float#close_all() +nnoremap (coc-float-jump) :call coc#float#jump() +nnoremap (coc-command-repeat) :call CocAction('repeatCommand') +nnoremap (coc-refactor) :call CocActionAsync('refactor') nnoremap (coc-cursors-operator) :set operatorfunc=CursorRangeFromSelectedg@ -vnoremap (coc-cursors-range) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'range', visualmode()]) -nnoremap (coc-cursors-word) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'word', 'n']) -nnoremap (coc-cursors-position) :call coc#rpc#request('cursorsSelect', [bufnr('%'), 'position', 'n']) -vnoremap (coc-funcobj-i) :call coc#rpc#request('selectFunction', [v:true, visualmode()]) -vnoremap (coc-funcobj-a) :call coc#rpc#request('selectFunction', [v:false, visualmode()]) -onoremap (coc-funcobj-i) :call coc#rpc#request('selectFunction', [v:true, '']) -onoremap (coc-funcobj-a) :call coc#rpc#request('selectFunction', [v:false, '']) +vnoremap (coc-cursors-range) :call CocAction('cursorsSelect', bufnr('%'), 'range', visualmode()) +nnoremap (coc-cursors-word) :call CocAction('cursorsSelect', bufnr('%'), 'word', 'n') +nnoremap (coc-cursors-position) :call CocAction('cursorsSelect', bufnr('%'), 'position', 'n') + +vnoremap (coc-funcobj-i) :call CocAction('selectSymbolRange', v:true, visualmode(), ['Method', 'Function']) +vnoremap (coc-funcobj-a) :call CocAction('selectSymbolRange', v:false, visualmode(), ['Method', 'Function']) +onoremap (coc-funcobj-i) :call CocAction('selectSymbolRange', v:true, '', ['Method', 'Function']) +onoremap (coc-funcobj-a) :call CocAction('selectSymbolRange', v:false, '', ['Method', 'Function']) + +vnoremap (coc-classobj-i) :call CocAction('selectSymbolRange', v:true, visualmode(), ['Interface', 'Struct', 'Class']) +vnoremap (coc-classobj-a) :call CocAction('selectSymbolRange', v:false, visualmode(), ['Interface', 'Struct', 'Class']) +onoremap (coc-classobj-i) :call CocAction('selectSymbolRange', v:true, '', ['Interface', 'Struct', 'Class']) +onoremap (coc-classobj-a) :call CocAction('selectSymbolRange', v:false, '', ['Interface', 'Struct', 'Class']) diff --git a/_vim/.vim/plugged/fzf.vim/.gitattributes b/_vim/.vim/plugged/fzf.vim/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/_vim/.vim/plugged/fzf.vim/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/_vim/.vim/plugged/fzf.vim/.github/FUNDING.yml b/_vim/.vim/plugged/fzf.vim/.github/FUNDING.yml new file mode 100644 index 0000000..f284895 --- /dev/null +++ b/_vim/.vim/plugged/fzf.vim/.github/FUNDING.yml @@ -0,0 +1 @@ +github: junegunn diff --git a/_vim/.vim/plugged/fzf.vim/.github/ISSUE_TEMPLATE.md b/_vim/.vim/plugged/fzf.vim/.github/ISSUE_TEMPLATE.md index a62ef9e..5445de0 100644 --- a/_vim/.vim/plugged/fzf.vim/.github/ISSUE_TEMPLATE.md +++ b/_vim/.vim/plugged/fzf.vim/.github/ISSUE_TEMPLATE.md @@ -2,6 +2,7 @@ +- [ ] I have fzf 0.30.0 or above - [ ] I have read through https://github.com/junegunn/fzf.vim/blob/master/README.md - [ ] I have read through https://github.com/junegunn/fzf/blob/master/README-VIM.md - [ ] I have read through the manual page of fzf (`man fzf`) diff --git a/_vim/.vim/plugged/fzf.vim/LICENSE b/_vim/.vim/plugged/fzf.vim/LICENSE new file mode 100644 index 0000000..8087dea --- /dev/null +++ b/_vim/.vim/plugged/fzf.vim/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Junegunn Choi + +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/_vim/.vim/plugged/fzf.vim/README.md b/_vim/.vim/plugged/fzf.vim/README.md index a9c9d91..dbeb900 100644 --- a/_vim/.vim/plugged/fzf.vim/README.md +++ b/_vim/.vim/plugged/fzf.vim/README.md @@ -6,8 +6,8 @@ Things you can do with [fzf][fzf] and Vim. Rationale --------- -[fzf][fzf] in itself is not a Vim plugin, and the official repository only -provides the [basic wrapper function][run] for Vim and it's up to the users to +[fzf][fzf] itself is not a Vim plugin, and the official repository only +provides the [basic wrapper function][run] for Vim. It's up to the users to write their own Vim commands with it. However, I've learned that many users of fzf are not familiar with Vimscript and are looking for the "default" implementation of the features they can find in the alternative Vim plugins. @@ -48,34 +48,44 @@ Plug 'junegunn/fzf.vim' `fzf#install()` makes sure that you have the latest binary, but it's optional, so you can omit it if you use a plugin manager that doesn't support hooks. +### Dependencies + +- [fzf][fzf-main] 0.23.0 or above +- For syntax-highlighted preview, install [bat](https://github.com/sharkdp/bat) +- If [delta](https://github.com/dandavison/delta) is available, `GF?`, + `Commits` and `BCommits` will use it to format `git diff` output. +- `Ag` requires [The Silver Searcher (ag)][ag] +- `Rg` requires [ripgrep (rg)][rg] +- `Tags` and `Helptags` require Perl + Commands -------- -| Command | List | -| --- | --- | -| `:Files [PATH]` | Files (runs `$FZF_DEFAULT_COMMAND` if defined) | -| `:GFiles [OPTS]` | Git files (`git ls-files`) | -| `:GFiles?` | Git files (`git status`) | -| `:Buffers` | Open buffers | -| `:Colors` | Color schemes | -| `:Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) | -| `:Rg [PATTERN]` | [rg][rg] search result (`ALT-A` to select all, `ALT-D` to deselect all) | -| `:Lines [QUERY]` | Lines in loaded buffers | -| `:BLines [QUERY]` | Lines in the current buffer | -| `:Tags [QUERY]` | Tags in the project (`ctags -R`) | -| `:BTags [QUERY]` | Tags in the current buffer | -| `:Marks` | Marks | -| `:Windows` | Windows | -| `:Locate PATTERN` | `locate` command output | -| `:History` | `v:oldfiles` and open buffers | -| `:History:` | Command history | -| `:History/` | Search history | -| `:Snippets` | Snippets ([UltiSnips][us]) | -| `:Commits` | Git commits (requires [fugitive.vim][f]) | -| `:BCommits` | Git commits for the current buffer | -| `:Commands` | Commands | -| `:Maps` | Normal mode mappings | -| `:Helptags` | Help tags [1](#helptags) | +| Command | List | +| --- | --- | +| `:Files [PATH]` | Files (runs `$FZF_DEFAULT_COMMAND` if defined) | +| `:GFiles [OPTS]` | Git files (`git ls-files`) | +| `:GFiles?` | Git files (`git status`) | +| `:Buffers` | Open buffers | +| `:Colors` | Color schemes | +| `:Ag [PATTERN]` | [ag][ag] search result (`ALT-A` to select all, `ALT-D` to deselect all) | +| `:Rg [PATTERN]` | [rg][rg] search result (`ALT-A` to select all, `ALT-D` to deselect all) | +| `:Lines [QUERY]` | Lines in loaded buffers | +| `:BLines [QUERY]` | Lines in the current buffer | +| `:Tags [QUERY]` | Tags in the project (`ctags -R`) | +| `:BTags [QUERY]` | Tags in the current buffer | +| `:Marks` | Marks | +| `:Windows` | Windows | +| `:Locate PATTERN` | `locate` command output | +| `:History` | `v:oldfiles` and open buffers | +| `:History:` | Command history | +| `:History/` | Search history | +| `:Snippets` | Snippets ([UltiSnips][us]) | +| `:Commits` | Git commits (requires [fugitive.vim][f]) | +| `:BCommits` | Git commits for the current buffer; visual-select lines to track changes in the range | +| `:Commands` | Commands | +| `:Maps` | Normal mode mappings | +| `:Helptags` | Help tags [1](#helptags) | | `:Filetypes` | File types - Most commands support `CTRL-T` / `CTRL-X` / `CTRL-V` key @@ -102,16 +112,24 @@ through [README-VIM][README-VIM] to learn more about them. #### Preview window -If the width of the screen is wider than 120 columns, some commands will show -the preview window on the right. You can customize the behavior with -`g:fzf_preview_window`. Here are some examples: +Some commands will show the preview window on the right. You can customize the +behavior with `g:fzf_preview_window`. Here are some examples: ```vim -" Empty value to disable preview window altogether -let g:fzf_preview_window = '' +" This is the default option: +" - Preview window on the right with 50% width +" - CTRL-/ will toggle preview window. +" - Note that this array is passed as arguments to fzf#vim#with_preview function. +" - To learn more about preview window options, see `--preview-window` section of `man fzf`. +let g:fzf_preview_window = ['right,50%', 'ctrl-/'] + +" Preview window is hidden by default. You can toggle it with ctrl-/. +" It will show on the right with 50% width, but if the width is smaller +" than 70 columns, it will show above the candidate list +let g:fzf_preview_window = ['hidden,right,50%,<70(up,40%)', 'ctrl-/'] -" Always enable preview window on the right with 60% width -let g:fzf_preview_window = 'right:60%' +" Empty value to disable preview window altogether +let g:fzf_preview_window = [] ``` ### Command-local options @@ -228,7 +246,7 @@ predefined `Ag` or `Rg` using `fzf#vim#grep`. ```vim command! -bang -nargs=* GGrep \ call fzf#vim#grep( - \ 'git grep --line-number '.shellescape(), 0, + \ 'git grep --line-number -- '.shellescape(), 0, \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) ``` @@ -242,7 +260,7 @@ the spec argument to `fzf#vim#preview`. ```vim command! -bang -nargs=* Rg \ call fzf#vim#grep( - \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, + \ 'rg --column --line-number --no-heading --color=always --smart-case -- '.shellescape(), 1, \ fzf#vim#with_preview(), 0) ``` @@ -267,7 +285,7 @@ a "fuzzy finder". ```vim function! RipgrepFzf(query, fullscreen) - let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true' + let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true' let initial_command = printf(command_fmt, shellescape(a:query)) let reload_command = printf(command_fmt, '{q}') let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} @@ -289,12 +307,9 @@ Mappings | `(fzf-complete-word)` | `cat /usr/share/dict/words` | | `(fzf-complete-path)` | Path completion using `find` (file + dir) | | `(fzf-complete-file)` | File completion using `find` | -| `(fzf-complete-file-ag)` | File completion using `ag` | | `(fzf-complete-line)` | Line completion (all open buffers) | | `(fzf-complete-buffer-line)` | Line completion (current buffer only) | -### Usage - ```vim " Mapping selecting mappings nmap (fzf-maps-n) @@ -304,14 +319,30 @@ omap (fzf-maps-o) " Insert mode completion imap (fzf-complete-word) imap (fzf-complete-path) -imap (fzf-complete-file-ag) imap (fzf-complete-line) +``` + +Completion functions +-------------------- + +| Function | Description | +| --- | --- | +| `fzf#vim#complete#path(command, [spec])` | Path completion | +| `fzf#vim#complete#word([spec])` | Word completion | +| `fzf#vim#complete#line([spec])` | Line completion (all open buffers) | +| `fzf#vim#complete#buffer_line([spec])` | Line completion (current buffer only) | + +```vim +" Path completion with custom source command +inoremap fzf#vim#complete#path('fd') +inoremap fzf#vim#complete#path('rg --files') -" Advanced customization using Vim function -inoremap fzf#vim#complete#word({'left': '15%'}) +" Word completion with custom spec with popup layout option +inoremap fzf#vim#complete#word({'window': { 'width': 0.2, 'height': 0.9, 'xoffset': 1 }}) ``` -### Completion helper +Custom completion +----------------- `fzf#vim#complete` is a helper function for creating custom fuzzy completion using fzf. If the first parameter is a command string or a Vim list, it will @@ -344,7 +375,7 @@ inoremap fzf#vim#complete(fzf#wrap({ \ 'reducer': { lines -> join(split(lines[0], ':\zs')[2:], '') }})) ``` -#### Reducer example +### Reducer example ```vim function! s:make_sentence(lines) diff --git a/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim.vim b/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim.vim index 9e2ff8e..44a17f6 100644 --- a/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim.vim +++ b/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim.vim @@ -28,9 +28,11 @@ set cpo&vim " Common " ------------------------------------------------------------------ +let s:min_version = '0.23.0' let s:is_win = has('win32') || has('win64') +let s:is_wsl_bash = s:is_win && (exepath('bash') =~? 'Windows[/\\]system32[/\\]bash.exe$') let s:layout_keys = ['window', 'up', 'down', 'left', 'right'] -let s:bin_dir = expand(':h:h:h').'/bin/' +let s:bin_dir = expand(':p:h:h:h').'/bin/' let s:bin = { \ 'preview': s:bin_dir.'preview.sh', \ 'tags': s:bin_dir.'tags.pl' } @@ -39,12 +41,30 @@ if s:is_win if has('nvim') let s:bin.preview = split(system('for %A in ("'.s:bin.preview.'") do @echo %~sA'), "\n")[0] else - let s:bin.preview = fnamemodify(s:bin.preview, ':8') + let preview_path = s:is_wsl_bash + \ ? substitute(s:bin.preview, '^\([A-Z]\):', '/mnt/\L\1', '') + \ : fnamemodify(s:bin.preview, ':8') + let s:bin.preview = substitute(preview_path, '\', '/', 'g') endif - let s:bin.preview = 'bash '.escape(s:bin.preview, '\') endif let s:wide = 120 +let s:warned = 0 +let s:checked = 0 + +function! s:check_requirements() + if s:checked + return + endif + + if !exists('*fzf#run') + throw "fzf#run function not found. You also need Vim plugin from the main fzf repository (i.e. junegunn/fzf *and* junegunn/fzf.vim)" + endif + if !exists('*fzf#exec') + throw "fzf#exec function not found. You need to upgrade Vim plugin from the main fzf repository ('junegunn/fzf')" + endif + let s:checked = !empty(fzf#exec(s:min_version)) +endfunction function! s:extend_opts(dict, eopts, prepend) if empty(a:eopts) @@ -74,26 +94,44 @@ function! s:prepend_opts(dict, eopts) return s:extend_opts(a:dict, a:eopts, 1) endfunction -" [[options to wrap], [preview window expression], [toggle-preview keys...]] +" [[spec to wrap], [preview window expression], [toggle-preview keys...]] function! fzf#vim#with_preview(...) - " Default options - let options = {} + " Default spec + let spec = {} let window = '' let args = copy(a:000) - " Options to wrap + " Spec to wrap if len(args) && type(args[0]) == s:TYPE.dict - let options = copy(args[0]) + let spec = copy(args[0]) call remove(args, 0) endif + if !executable('bash') + if !s:warned + call s:warn('Preview window not supported (bash not found in PATH)') + let s:warned = 1 + endif + return spec + endif + " Placeholder expression (TODO/TBD: undocumented) - let placeholder = get(options, 'placeholder', '{}') + let placeholder = get(spec, 'placeholder', '{}') + + " g:fzf_preview_window + if empty(args) + let preview_args = get(g:, 'fzf_preview_window', ['', 'ctrl-/']) + if empty(preview_args) + let args = ['hidden'] + else + " For backward-compatiblity + let args = type(preview_args) == type('') ? [preview_args] : copy(preview_args) + endif + endif - " Preview window if len(args) && type(args[0]) == s:TYPE.string - if args[0] !~# '^\(up\|down\|left\|right\)' + if len(args[0]) && args[0] !~# '^\(up\|down\|left\|right\|hidden\)' throw 'invalid preview window: '.args[0] endif let window = args[0] @@ -104,13 +142,31 @@ function! fzf#vim#with_preview(...) if len(window) let preview += ['--preview-window', window] endif - let preview += ['--preview', (s:is_win ? s:bin.preview : fzf#shellescape(s:bin.preview)).' '.placeholder] + if s:is_win + if empty($MSWINHOME) + let $MSWINHOME = $HOME + endif + if s:is_wsl_bash && $WSLENV !~# '[:]\?MSWINHOME\(\/[^:]*\)\?\(:\|$\)' + let $WSLENV = 'MSWINHOME/u:'.$WSLENV + endif + let preview_cmd = 'bash '.(s:is_wsl_bash + \ ? s:bin.preview + \ : escape(s:bin.preview, '\')) + else + let preview_cmd = fzf#shellescape(s:bin.preview) + endif + if len(placeholder) + let preview += ['--preview', preview_cmd.' '.placeholder] + end + if &ambiwidth ==# 'double' + let preview += ['--no-unicode'] + end if len(args) call extend(preview, ['--bind', join(map(args, 'v:val.":toggle-preview"'), ',')]) endif - call s:merge_opts(options, preview) - return options + call s:merge_opts(spec, preview) + return spec endfunction function! s:remove_layout(opts) @@ -213,6 +269,8 @@ function! s:buflisted() endfunction function! s:fzf(name, opts, extra) + call s:check_requirements() + let [extra, bang] = [{}, 0] if len(a:extra) <= 1 let first = get(a:extra, 0, 0) @@ -227,6 +285,7 @@ function! s:fzf(name, opts, extra) throw 'invalid number of arguments' endif + let extra = copy(extra) let eopts = has_key(extra, 'options') ? remove(extra, 'options') : '' let merged = extend(copy(a:opts), extra) call s:merge_opts(merged, eopts) @@ -246,6 +305,7 @@ endfunction function! s:open(cmd, target) if stridx('edit', a:cmd) == 0 && fnamemodify(a:target, ':p') ==# expand('%:p') + normal! m' return endif execute a:cmd s:escape(a:target) @@ -469,20 +529,20 @@ endfunction " ------------------------------------------------------------------ " History[:/] " ------------------------------------------------------------------ -function! s:all_files() +function! fzf#vim#_recent_files() return fzf#vim#_uniq(map( \ filter([expand('%')], 'len(v:val)') - \ + filter(map(s:buflisted_sorted(), 'bufname(v:val)'), 'len(v:val)') + \ + filter(map(fzf#vim#_buflisted_sorted(), 'bufname(v:val)'), 'len(v:val)') \ + filter(copy(v:oldfiles), "filereadable(fnamemodify(v:val, ':p'))"), \ 'fnamemodify(v:val, ":~:.")')) endfunction function! s:history_source(type) let max = histnr(a:type) - let fmt = ' %'.len(string(max)).'d ' + let fmt = s:yellow(' %'.len(string(max)).'d ', 'Number') let list = filter(map(range(1, max), 'histget(a:type, - v:val)'), '!empty(v:val)') return extend([' :: Press '.s:magenta('CTRL-E', 'Special').' to edit'], - \ map(list, 's:yellow(printf(fmt, len(list) - v:key), "Number")." ".v:val')) + \ map(list, 'printf(fmt, len(list) - v:key)." ".v:val')) endfunction nnoremap (-fzf-vim-do) :execute g:__fzf_command @@ -534,7 +594,7 @@ endfunction function! fzf#vim#history(...) return s:fzf('history-files', { - \ 'source': s:all_files(), + \ 'source': fzf#vim#_recent_files(), \ 'options': ['-m', '--header-lines', !empty(expand('%')), '--prompt', 'Hist> '] \}, a:000) endfunction @@ -543,19 +603,22 @@ endfunction " GFiles[?] " ------------------------------------------------------------------ -function! s:get_git_root() - let root = split(system('git rev-parse --show-toplevel'), '\n')[0] - return v:shell_error ? '' : root +function! s:get_git_root(dir) + let dir = len(a:dir) ? a:dir : substitute(split(expand('%:p:h'), '[/\\]\.git\([/\\]\|$\)')[0], '^fugitive://', '', '') + let root = systemlist('git -C ' . fzf#shellescape(dir) . ' rev-parse --show-toplevel')[0] + return v:shell_error ? '' : (len(a:dir) ? fnamemodify(a:dir, ':p') : root) endfunction function! fzf#vim#gitfiles(args, ...) - let root = s:get_git_root() + let dir = get(get(a:, 1, {}), 'dir', '') + let root = s:get_git_root(dir) if empty(root) return s:warn('Not in git repo') endif + let prefix = 'git -C ' . fzf#shellescape(root) . ' ' if a:args != '?' return s:fzf('gfiles', { - \ 'source': 'git ls-files '.a:args.(s:is_win ? '' : ' | uniq'), + \ 'source': prefix . 'ls-files '.a:args.(s:is_win ? '' : ' | uniq'), \ 'dir': root, \ 'options': '-m --prompt "GitFiles> "' \}, a:000) @@ -564,10 +627,17 @@ function! fzf#vim#gitfiles(args, ...) " Here be dragons! " We're trying to access the common sink function that fzf#wrap injects to " the options dictionary. + let bar = s:is_win ? '^|' : '|' + let preview = printf( + \ 'bash -c "if [[ {1} =~ M ]]; then %s; else %s {-1}; fi"', + \ executable('delta') + \ ? prefix . 'diff -- {-1} ' . bar . ' delta --width $FZF_PREVIEW_COLUMNS --file-style=omit ' . bar . ' sed 1d' + \ : prefix . 'diff --color=always -- {-1} ' . bar . ' sed 1,4d', + \ s:bin.preview) let wrapped = fzf#wrap({ - \ 'source': 'git -c color.status=always status --short --untracked-files=all', + \ 'source': prefix . '-c color.status=always status --short --untracked-files=all', \ 'dir': root, - \ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', 'sh -c "(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500"'] + \ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview] \}) call s:remove_layout(wrapped) let wrapped.common_sink = remove(wrapped, 'sink*') @@ -621,7 +691,7 @@ function! s:bufopen(lines) execute 'buffer' b endfunction -function! s:format_buffer(b) +function! fzf#vim#_format_buffer(b) let name = bufname(a:b) let line = exists('*getbufinfo') ? getbufinfo(a:b)[0]['lnum'] : 0 let name = empty(name) ? '[No Name]' : fnamemodify(name, ":p:~:.") @@ -631,7 +701,7 @@ function! s:format_buffer(b) let readonly = getbufvar(a:b, '&modifiable') ? '' : s:green(' [RO]', 'Constant') let extra = join(filter([modified, readonly], '!empty(v:val)'), '') let target = line == 0 ? name : name.':'.line - return s:strip(printf("%s\t[%s] %s\t%s\t%s", target, s:yellow(a:b, 'Number'), flag, name, extra)) + return s:strip(printf("%s\t%d\t[%s] %s\t%s\t%s", target, line, s:yellow(a:b, 'Number'), flag, name, extra)) endfunction function! s:sort_buffers(...) @@ -640,17 +710,20 @@ function! s:sort_buffers(...) return b1 < b2 ? 1 : -1 endfunction -function! s:buflisted_sorted() +function! fzf#vim#_buflisted_sorted() return sort(s:buflisted(), 's:sort_buffers') endfunction function! fzf#vim#buffers(...) let [query, args] = (a:0 && type(a:1) == type('')) ? \ [a:1, a:000[1:]] : ['', a:000] + let sorted = fzf#vim#_buflisted_sorted() + let header_lines = '--header-lines=' . (bufnr('') == get(sorted, 0, 0) ? 1 : 0) + let tabstop = len(max(sorted)) >= 4 ? 9 : 8 return s:fzf('buffers', { - \ 'source': map(s:buflisted_sorted(), 's:format_buffer(v:val)'), + \ 'source': map(sorted, 'fzf#vim#_format_buffer(v:val)'), \ 'sink*': s:function('s:bufopen'), - \ 'options': ['+m', '-x', '--tiebreak=index', '--header-lines=1', '--ansi', '-d', '\t', '--with-nth', '2..', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query] + \ 'options': ['+m', '-x', '--tiebreak=index', header_lines, '--ansi', '-d', '\t', '--with-nth', '3..', '-n', '2,1..2', '--prompt', 'Buf> ', '--query', query, '--preview-window', '+{2}-/2', '--tabstop', tabstop] \}, args) endfunction @@ -658,11 +731,10 @@ endfunction " Ag / Rg " ------------------------------------------------------------------ function! s:ag_to_qf(line, has_column) - let parts = split(a:line, '[^:]\zs:\ze[^:]') - let text = join(parts[(a:has_column ? 3 : 2):], ':') - let dict = {'filename': &acd ? fnamemodify(parts[0], ':p') : parts[0], 'lnum': parts[1], 'text': text} + let parts = matchlist(a:line, '\(.\{-}\)\s*:\s*\(\d\+\)\%(\s*:\s*\(\d\+\)\)\?\%(\s*:\(.*\)\)\?') + let dict = {'filename': &acd ? fnamemodify(parts[1], ':p') : parts[1], 'lnum': parts[2], 'text': parts[4]} if a:has_column - let dict.col = parts[2] + let dict.col = parts[3] endif return dict endfunction @@ -683,9 +755,9 @@ function! s:ag_handler(lines, has_column) call s:open(cmd, first.filename) execute first.lnum if a:has_column - execute 'normal!' first.col.'|' + call cursor(0, first.col) endif - normal! zz + normal! zvzz catch endtry @@ -700,7 +772,7 @@ function! fzf#vim#ag(query, ...) let query = empty(a:query) ? '^(?=.)' : a:query let args = copy(a:000) let ag_opts = len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : '' - let command = ag_opts . ' ' . fzf#shellescape(query) + let command = ag_opts . ' -- ' . fzf#shellescape(query) return call('fzf#vim#ag_raw', insert(args, command, 0)) endfunction @@ -728,7 +800,7 @@ function! fzf#vim#grep(grep_command, has_column, ...) \ 'column': a:has_column, \ 'options': ['--ansi', '--prompt', capname.'> ', \ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all', - \ '--color', 'hl:4,hl+:12'] + \ '--delimiter', ':', '--preview-window', '+{2}-/2'] \} function! opts.sink(lines) return s:ag_handler(a:lines, self.column) @@ -780,7 +852,7 @@ function! s:btags_sink(lines) call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')}) endfor call s:fill_quickfix(qfl, 'cfirst') - normal! zz + normal! zvzz endfunction " query, [[tag commands], options] @@ -790,7 +862,7 @@ function! fzf#vim#buffer_tags(query, ...) let null = s:is_win ? 'nul' : '/dev/null' let sort = has('unix') && !has('win32unix') && executable('sort') ? '| sort -s -k 5' : '' let tag_cmds = (len(args) > 1 && type(args[0]) != type({})) ? remove(args, 0) : [ - \ printf('ctags -f - --sort=yes --excmd=number --language-force=%s %s 2> %s %s', &filetype, escaped, null, sort), + \ printf('ctags -f - --sort=yes --excmd=number --language-force=%s %s 2> %s %s', get({ 'cpp': 'c++' }, &filetype, &filetype), escaped, null, sort), \ printf('ctags -f - --sort=yes --excmd=number %s 2> %s %s', escaped, null, sort)] if type(tag_cmds) != type([]) let tag_cmds = [tag_cmds] @@ -799,7 +871,7 @@ function! fzf#vim#buffer_tags(query, ...) return s:fzf('btags', { \ 'source': s:btags_source(tag_cmds), \ 'sink*': s:function('s:btags_sink'), - \ 'options': s:reverse_list(['-m', '-d', '\t', '--with-nth', '1,4..', '-n', '1', '--prompt', 'BTags> ', '--query', a:query])}, args) + \ 'options': s:reverse_list(['-m', '-d', '\t', '--with-nth', '1,4..', '-n', '1', '--prompt', 'BTags> ', '--query', a:query, '--preview-window', '+{3}-/2'])}, args) catch return s:warn(v:exception) endtry @@ -837,7 +909,7 @@ function! s:tags_sink(lines) let [&magic, &wrapscan, &acd] = [magic, wrapscan, acd] endtry call s:fill_quickfix(qfl, 'clast') - normal! zz + normal! zvzz endfunction function! fzf#vim#tags(query, ...) @@ -875,7 +947,7 @@ function! fzf#vim#tags(query, ...) return s:fzf('tags', { \ 'source': 'perl '.fzf#shellescape(s:bin.tags).' '.join(map(tagfiles, 'fzf#shellescape(fnamemodify(v:val, ":p"))')), \ 'sink*': s:function('s:tags_sink'), - \ 'options': extend(opts, ['--nth', '1..2', '-m', '--tiebreak=begin', '--prompt', 'Tags> ', '--query', a:query])}, a:000) + \ 'options': extend(opts, ['--nth', '1..2', '-m', '-d', '\t', '--tiebreak=begin', '--prompt', 'Tags> ', '--query', a:query])}, a:000) endfunction " ------------------------------------------------------------------ @@ -898,14 +970,14 @@ function! fzf#vim#snippets(...) let colored = map(aligned, 's:yellow(v:val[0])."\t".v:val[1]') return s:fzf('snippets', { \ 'source': colored, - \ 'options': '--ansi --tiebreak=index +m -n 1 -d "\t"', + \ 'options': '--ansi --tiebreak=index +m -n 1,.. -d "\t"', \ 'sink': s:function('s:inject_snippet')}, a:000) endfunction " ------------------------------------------------------------------ " Commands " ------------------------------------------------------------------ -let s:nbs = nr2char(0x2007) +let s:nbs = nr2char(0xa0) function! s:format_cmd(line) return substitute(a:line, '\C \([A-Z]\S*\) ', @@ -920,7 +992,7 @@ function! s:command_sink(lines) if empty(a:lines[0]) call feedkeys(':'.cmd.(a:lines[1][0] == '!' ? '' : ' '), 'n') else - execute cmd + call feedkeys(':'.cmd."\", 'n') endif endfunction @@ -1021,12 +1093,13 @@ function! fzf#vim#helptags(...) silent! call delete(s:helptags_script) endif let s:helptags_script = tempname() - call writefile(['/('.(s:is_win ? '^[A-Z]:\/.*?[^:]' : '.*?').'):(.*?)\t(.*?)\t/; printf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\n), $2, $3, $1)'], s:helptags_script) + + call writefile(['/('.(s:is_win ? '^[A-Z]:[\/\\].*?[^:]' : '.*?').'):(.*?)\t(.*?)\t(.*)/; printf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\t%s\n), $2, $3, $1, $4)'], s:helptags_script) return s:fzf('helptags', { - \ 'source': 'grep -H ".*" '.join(map(tags, 'fzf#shellescape(v:val)')). + \ 'source': 'grep --with-filename ".*" '.join(map(tags, 'fzf#shellescape(v:val)')). \ ' | perl -n '.fzf#shellescape(s:helptags_script).' | sort', \ 'sink': s:function('s:helptag_sink'), - \ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..-2']}, a:000) + \ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..3']}, a:000) endfunction " ------------------------------------------------------------------ @@ -1116,30 +1189,34 @@ function! s:commits_sink(lines) endfor endfunction -function! s:commits(buffer_local, args) - let s:git_root = s:get_git_root() +function! s:commits(range, buffer_local, args) + let s:git_root = s:get_git_root('') if empty(s:git_root) return s:warn('Not in git repository') endif - let source = 'git log '.get(g:, 'fzf_commits_log_options', '--color=always '.fzf#shellescape('--format=%C(auto)%h%d %s %C(green)%cr')) - let current = expand('%') + let prefix = 'git -C ' . fzf#shellescape(s:git_root) . ' ' + let source = prefix . 'log '.get(g:, 'fzf_commits_log_options', '--color=always '.fzf#shellescape('--format=%C(auto)%h%d %s %C(green)%cr')) + let current = expand('%:p') let managed = 0 if !empty(current) - call system('git show '.fzf#shellescape(current).' 2> '.(s:is_win ? 'nul' : '/dev/null')) + call system(prefix . 'show '.fzf#shellescape(current).' 2> '.(s:is_win ? 'nul' : '/dev/null')) let managed = !v:shell_error endif - if a:buffer_local + if len(a:range) || a:buffer_local if !managed return s:warn('The current buffer is not in the working tree') endif - let source .= ' --follow '.fzf#shellescape(current) + let source .= len(a:range) + \ ? printf(' -L %d,%d:%s --no-patch', a:range[0], a:range[1], fzf#shellescape(current)) + \ : (' --follow '.fzf#shellescape(current)) + let command = 'BCommits' else let source .= ' --graph' + let command = 'Commits' endif - let command = a:buffer_local ? 'BCommits' : 'Commits' let expect_keys = join(keys(get(g:, 'fzf_action', s:default_action)), ',') let options = { \ 'source': source, @@ -1156,19 +1233,44 @@ function! s:commits(buffer_local, args) endif if !s:is_win && &columns > s:wide + let suffix = executable('delta') ? '| delta --width $FZF_PREVIEW_COLUMNS' : '' + let orderfile = tempname() + call writefile([current[len(s:git_root)+1:]], orderfile) call extend(options.options, - \ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs git show --format=format: --color=always | head -200']) + \ ['--preview', 'echo {} | grep -o "[a-f0-9]\{7,\}" | head -1 | xargs ' . prefix . 'show -O'.fzf#shellescape(orderfile).' --format=format: --color=always ' . suffix]) endif return s:fzf(a:buffer_local ? 'bcommits' : 'commits', options, a:args) endfunction -function! fzf#vim#commits(...) - return s:commits(0, a:000) +" Heuristically determine if the user specified a range +function! s:given_range(line1, line2) + " 1. From visual mode + " :'<,'>Commits + " 2. From command-line + " :10,20Commits + if a:line1 == line("'<") && a:line2 == line("'>") || + \ (a:line1 != 1 || a:line2 != line('$')) + return [a:line1, a:line2] + endif + + return [] endfunction -function! fzf#vim#buffer_commits(...) - return s:commits(1, a:000) +function! fzf#vim#commits(...) range + if exists('b:fzf_winview') + call winrestview(b:fzf_winview) + unlet b:fzf_winview + endif + return s:commits(s:given_range(a:firstline, a:lastline), 0, a:000) +endfunction + +function! fzf#vim#buffer_commits(...) range + if exists('b:fzf_winview') + call winrestview(b:fzf_winview) + unlet b:fzf_winview + endif + return s:commits(s:given_range(a:firstline, a:lastline), 1, a:000) endfunction " ------------------------------------------------------------------ @@ -1214,10 +1316,13 @@ function! fzf#vim#maps(mode, ...) let curr = '' for line in split(cout, "\n") if line =~ "^\t" - let src = ' '.join(reverse(reverse(split(split(line)[-1], '/'))[0:2]), '/') + let src = "\t".substitute(matchstr(line, '/\zs[^/\\]*\ze$'), ' [^ ]* ', ':', '') call add(list, printf('%s %s', curr, s:green(src, 'Comment'))) let curr = '' else + if !empty(curr) + call add(list, curr) + endif let curr = line[3:] endif endfor @@ -1274,11 +1379,16 @@ function! s:complete_insert(lines) let &ve = ve if mode() =~ 't' call feedkeys('a', 'n') - else + elseif has('nvim') execute "normal! \la" + else + call feedkeys("\(-fzf-complete-finish)") endif endfunction +nnoremap (-fzf-complete-finish) a +inoremap (-fzf-complete-finish) l + function! s:eval(dict, key, arg) if has_key(a:dict, a:key) && type(a:dict[a:key]) == s:TYPE.funcref let ret = copy(a:dict) @@ -1343,4 +1453,3 @@ endfunction " ------------------------------------------------------------------ let &cpo = s:cpo_save unlet s:cpo_save - diff --git a/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim/complete.vim b/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim/complete.vim index 03c9b3b..8944b19 100644 --- a/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim/complete.vim +++ b/_vim/.vim/plugged/fzf.vim/autoload/fzf/vim/complete.vim @@ -47,8 +47,9 @@ else endif function! fzf#vim#complete#word(...) + let sources = empty(&dictionary) ? ['/usr/share/dict/words'] : split(&dictionary, ',') return fzf#vim#complete(s:extend({ - \ 'source': 'cat /usr/share/dict/words'}, + \ 'source': 'cat ' . join(map(sources, 'shellescape(v:val)'))}, \ get(a:000, 0, fzf#wrap()))) endfunction diff --git a/_vim/.vim/plugged/fzf.vim/doc/fzf-vim.txt b/_vim/.vim/plugged/fzf.vim/doc/fzf-vim.txt index c5aa390..188abd0 100644 --- a/_vim/.vim/plugged/fzf.vim/doc/fzf-vim.txt +++ b/_vim/.vim/plugged/fzf.vim/doc/fzf-vim.txt @@ -1,4 +1,4 @@ -fzf-vim.txt fzf-vim Last change: March 17 2020 +fzf-vim.txt fzf-vim Last change: May 24 2021 FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-toc* ============================================================================== @@ -7,6 +7,7 @@ FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-to Why you should use fzf on Vim Installation Using vim-plug + Dependencies Commands Customization Global options @@ -19,9 +20,9 @@ FZF-VIM - TABLE OF CONTENTS *fzf-vim* *fzf-vim-to Example: Rg command with preview window Example: Advanced ripgrep integration Mappings - Usage - Completion helper - Reducer example + Completion functions + Custom completion + Reducer example Status line of terminal buffer Hide statusline Custom statusline @@ -86,6 +87,24 @@ fzf/Vim integration, see {README-VIM}{4}. so you can omit it if you use a plugin manager that doesn't support hooks. +< Dependencies >______________________________________________________________~ + *fzf-vim-dependencies* + + - {fzf}{1} 0.23.0 or above + - For syntax-highlighted preview, install {bat}{5} + - If {delta}{6} is available, `GF?`, `Commits` and `BCommits` will use it to + format `git diff` output. + - `Ag` requires {The Silver Searcher (ag)}{7} + - `Rg` requires {ripgrep (rg)}{8} + - `Tags` and `Helptags` require Perl + + {1} https://github.com/junegunn/fzf + {5} https://github.com/sharkdp/bat + {6} https://github.com/dandavison/delta + {7} https://github.com/ggreer/the_silver_searcher + {8} https://github.com/BurntSushi/ripgrep + + COMMANDS *fzf-vim-commands* ============================================================================== @@ -101,8 +120,8 @@ COMMANDS *fzf-vim-commands* `:GFiles?` | Git files ( `git status` ) `:Buffers` | Open buffers `:Colors` | Color schemes - `:Ag [PATTERN]` | {ag}{5} search result ( `ALT-A` to select all, `ALT-D` to deselect all) - `:Rg [PATTERN]` | {rg}{6} search result ( `ALT-A` to select all, `ALT-D` to deselect all) + `:Ag [PATTERN]` | {ag}{7} search result ( `ALT-A` to select all, `ALT-D` to deselect all) + `:Rg [PATTERN]` | {rg}{8} search result ( `ALT-A` to select all, `ALT-D` to deselect all) `:Lines [QUERY]` | Lines in loaded buffers `:BLines [QUERY]` | Lines in the current buffer `:Tags [QUERY]` | Tags in the project ( `ctags -R` ) @@ -113,9 +132,9 @@ COMMANDS *fzf-vim-commands* `:History` | `v:oldfiles` and open buffers `:History:` | Command history `:History/` | Search history - `:Snippets` | Snippets ({UltiSnips}{7}) - `:Commits` | Git commits (requires {fugitive.vim}{8}) - `:BCommits` | Git commits for the current buffer + `:Snippets` | Snippets ({UltiSnips}{9}) + `:Commits` | Git commits (requires {fugitive.vim}{10}) + `:BCommits` | Git commits for the current buffer; visual-select lines to track changes in the range `:Commands` | Commands `:Maps` | Normal mode mappings `:Helptags` | Help tags [1] @@ -130,14 +149,14 @@ COMMANDS *fzf-vim-commands* - You can set `g:fzf_command_prefix` to give the same prefix to the commands - e.g. `let g:fzf_command_prefix = 'Fzf'` and you have `FzfFiles`, etc. -(1: `Helptags` will shadow the command of the same name from {pathogen}{9}. +(1: `Helptags` will shadow the command of the same name from {pathogen}{11}. But its functionality is still available via `call pathogen#helptags()`.) - {5} https://github.com/ggreer/the_silver_searcher - {6} https://github.com/BurntSushi/ripgrep - {7} https://github.com/SirVer/ultisnips - {8} https://github.com/tpope/vim-fugitive - {9} https://github.com/tpope/vim-pathogen + {7} https://github.com/ggreer/the_silver_searcher + {8} https://github.com/BurntSushi/ripgrep + {9} https://github.com/SirVer/ultisnips + {10} https://github.com/tpope/vim-fugitive + {11} https://github.com/tpope/vim-pathogen CUSTOMIZATION *fzf-vim-customization* @@ -159,15 +178,23 @@ Preview window~ *g:fzf_preview_window* -If the width of the screen is wider than 120 columns, some commands will show -the preview window on the right. You can customize the behavior with -`g:fzf_preview_window`. Here are some examples: +Some commands will show the preview window on the right. You can customize the +behavior with `g:fzf_preview_window`. Here are some examples: > - " Empty value to disable preview window altogether - let g:fzf_preview_window = '' + " This is the default option: + " - Preview window on the right with 50% width + " - CTRL-/ will toggle preview window. + " - Note that this array is passed as arguments to fzf#vim#with_preview function. + " - To learn more about preview window options, see `--preview-window` section of `man fzf`. + let g:fzf_preview_window = ['right,50%', 'ctrl-/'] + + " Preview window is hidden by default. You can toggle it with ctrl-/. + " It will show on the right with 50% width, but if the width is smaller + " than 70 columns, it will show above the candidate list + let g:fzf_preview_window = ['hidden,right,50%,<70(up,40%)', 'ctrl-/'] - " Always enable preview window on the right with 60% width - let g:fzf_preview_window = 'right:60%' + " Empty value to disable preview window altogether + let g:fzf_preview_window = [] < < Command-local options >_____________________________________________________~ @@ -245,8 +272,8 @@ Want a preview window? \ call fzf#vim#files(, {'options': ['--layout=reverse', '--info=inline', '--preview', 'cat {}']}, 0) < It kind of works, but you probably want a nicer previewer program than `cat`. -fzf.vim ships {a versatile preview script}{10} you can readily use. It -internally executes {bat}{11} for syntax highlighting, so make sure to install +fzf.vim ships {a versatile preview script}{12} you can readily use. It +internally executes {bat}{5} for syntax highlighting, so make sure to install it. > command! -bang -nargs=? -complete=dir Files @@ -266,8 +293,8 @@ You can just omit the spec argument if you only want the previewer. command! -bang -nargs=? -complete=dir Files \ call fzf#vim#files(, fzf#vim#with_preview(), 0) < - {10} bin/preview.sh - {11} https://github.com/sharkdp/bat + {12} bin/preview.sh + {5} https://github.com/sharkdp/bat Example: git grep wrapper~ @@ -280,16 +307,16 @@ predefined `Ag` or `Rg` using `fzf#vim#grep`. not print column numbers. - We set the base directory to git root by setting `dir` attribute in spec dictionary. - - {The preview script}{10} supports `grep` format (`FILE_PATH:LINE_NO:...`), so + - {The preview script}{12} supports `grep` format (`FILE_PATH:LINE_NO:...`), so we can just wrap the spec with `fzf#vim#with_preview` as before to enable previewer. > command! -bang -nargs=* GGrep \ call fzf#vim#grep( - \ 'git grep --line-number '.shellescape(), 0, + \ 'git grep --line-number -- '.shellescape(), 0, \ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), 0) < - {10} bin/preview.sh + {12} bin/preview.sh Example: Rg command with preview window~ @@ -302,7 +329,7 @@ the spec argument to `fzf#vim#preview`. > command! -bang -nargs=* Rg \ call fzf#vim#grep( - \ 'rg --column --line-number --no-heading --color=always --smart-case '.shellescape(), 1, + \ 'rg --column --line-number --no-heading --color=always --smart-case -- '.shellescape(), 1, \ fzf#vim#with_preview(), 0) < @@ -327,7 +354,7 @@ a "fuzzy finder". - Also note that we enabled previewer with `fzf#vim#with_preview`. > function! RipgrepFzf(query, fullscreen) - let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true' + let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case -- %s || true' let initial_command = printf(command_fmt, shellescape(a:query)) let reload_command = printf(command_fmt, '{q}') let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]} @@ -350,14 +377,9 @@ MAPPINGS *fzf-vim-mappings* (fzf-complete-word) | `cat /usr/share/dict/words` (fzf-complete-path) | Path completion using `find` (file + dir) (fzf-complete-file) | File completion using `find` - (fzf-complete-file-ag) | File completion using `ag` (fzf-complete-line) | Line completion (all open buffers) (fzf-complete-buffer-line) | Line completion (current buffer only) ---------------------------------+------------------------------------------ - - -< Usage >_____________________________________________________________________~ - *fzf-vim-usage* > " Mapping selecting mappings nmap (fzf-maps-n) @@ -367,15 +389,31 @@ MAPPINGS *fzf-vim-mappings* " Insert mode completion imap (fzf-complete-word) imap (fzf-complete-path) - imap (fzf-complete-file-ag) imap (fzf-complete-line) +< + +COMPLETION FUNCTIONS *fzf-vim-completion-functions* +============================================================================== - " Advanced customization using Vim function - inoremap fzf#vim#complete#word({'left': '15%'}) + -----------------------------------------+-------------------------------------- + Function | Description ~ + -----------------------------------------+-------------------------------------- + `fzf#vim#complete#path(command, [spec])` | Path completion + `fzf#vim#complete#word([spec])` | Word completion + `fzf#vim#complete#line([spec])` | Line completion (all open buffers) + `fzf#vim#complete#buffer_line([spec])` | Line completion (current buffer only) + -----------------------------------------+-------------------------------------- +> + " Path completion with custom source command + inoremap fzf#vim#complete#path('fd') + inoremap fzf#vim#complete#path('rg --files') + + " Word completion with custom spec with popup layout option + inoremap fzf#vim#complete#word({'window': { 'width': 0.2, 'height': 0.9, 'xoffset': 1 }}) < -< Completion helper >_________________________________________________________~ - *fzf-vim-completion-helper* +CUSTOM COMPLETION *fzf-vim-custom-completion* +============================================================================== `fzf#vim#complete` is a helper function for creating custom fuzzy completion using fzf. If the first parameter is a command string or a Vim list, it will @@ -405,7 +443,7 @@ following exceptions: \ 'reducer': { lines -> join(split(lines[0], ':\zs')[2:], '') }})) < -Reducer example~ +< Reducer example >___________________________________________________________~ *fzf-vim-reducer-example* > function! s:make_sentence(lines) @@ -422,10 +460,10 @@ Reducer example~ STATUS LINE OF TERMINAL BUFFER *fzf-vim-status-line-of-terminal-buffer* ============================================================================== -When fzf starts in a terminal buffer (see {fzf/README-VIM.md}{12}), you may +When fzf starts in a terminal buffer (see {fzf/README-VIM.md}{13}), you may want to customize the statusline of the containing buffer. -{12} https://github.com/junegunn/fzf/blob/master/README-VIM.md#fzf-inside-terminal-buffer +{13} https://github.com/junegunn/fzf/blob/master/README-VIM.md#fzf-inside-terminal-buffer < Hide statusline >___________________________________________________________~ diff --git a/_vim/.vim/plugged/fzf.vim/plugin/fzf.vim b/_vim/.vim/plugged/fzf.vim/plugin/fzf.vim index 0cb0f50..f7ae7d1 100644 --- a/_vim/.vim/plugged/fzf.vim/plugin/fzf.vim +++ b/_vim/.vim/plugged/fzf.vim/plugin/fzf.vim @@ -21,6 +21,11 @@ " OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION " WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +if exists('g:loaded_fzf_vim') + finish +endif +let g:loaded_fzf_vim = 1 + let s:cpo_save = &cpo set cpo&vim let s:is_win = has('win32') || has('win64') @@ -39,37 +44,29 @@ function! s:defs(commands) endfor endfunction -function! s:p(bang, ...) - let preview_window = get(g:, 'fzf_preview_window', a:bang && &columns >= 80 || &columns >= 120 ? 'right': '') - if len(preview_window) - return call('fzf#vim#with_preview', add(copy(a:000), preview_window)) - endif - return {} -endfunction - call s:defs([ -\'command! -bang -nargs=? -complete=dir Files call fzf#vim#files(, s:p(0), 0)', -\'command! -bang -nargs=? GitFiles call fzf#vim#gitfiles(, == "?" ? {} : s:p(0), 0)', -\'command! -bang -nargs=? GFiles call fzf#vim#gitfiles(, == "?" ? {} : s:p(0), 0)', -\'command! -bar -bang -nargs=? -complete=buffer Buffers call fzf#vim#buffers(, s:p(0, { "placeholder": "{1}", "options": ["-d", "\t"] }), 0)', +\'command! -bang -nargs=? -complete=dir Files call fzf#vim#files(, fzf#vim#with_preview(), 0)', +\'command! -bang -nargs=? GitFiles call fzf#vim#gitfiles(, fzf#vim#with_preview( == "?" ? { "placeholder": "" } : {}), 0)', +\'command! -bang -nargs=? GFiles call fzf#vim#gitfiles(, fzf#vim#with_preview( == "?" ? { "placeholder": "" } : {}), 0)', +\'command! -bar -bang -nargs=? -complete=buffer Buffers call fzf#vim#buffers(, fzf#vim#with_preview({ "placeholder": "{1}" }), 0)', \'command! -bang -nargs=* Lines call fzf#vim#lines(, 0)', \'command! -bang -nargs=* BLines call fzf#vim#buffer_lines(, 0)', \'command! -bar -bang Colors call fzf#vim#colors(0)', -\'command! -bang -nargs=+ -complete=dir Locate call fzf#vim#locate(, s:p(0), 0)', -\'command! -bang -nargs=* Ag call fzf#vim#ag(, s:p(0), 0)', -\'command! -bang -nargs=* Rg call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case ".shellescape(), 1, s:p(0), 0)', -\'command! -bang -nargs=* Tags call fzf#vim#tags(, 0)', -\'command! -bang -nargs=* BTags call fzf#vim#buffer_tags(, s:p(0, { "placeholder": "{2}:{3}", "options": ["-d", "\t"] }), 0)', +\'command! -bang -nargs=+ -complete=dir Locate call fzf#vim#locate(, fzf#vim#with_preview(), 0)', +\'command! -bang -nargs=* Ag call fzf#vim#ag(, fzf#vim#with_preview(), 0)', +\'command! -bang -nargs=* Rg call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case -- ".shellescape(), 1, fzf#vim#with_preview(), 0)', +\'command! -bang -nargs=* Tags call fzf#vim#tags(, fzf#vim#with_preview({ "placeholder": "--tag {2}:{-1}:{3..}" }), 0)', +\'command! -bang -nargs=* BTags call fzf#vim#buffer_tags(, fzf#vim#with_preview({ "placeholder": "{2}:{3..}" }), 0)', \'command! -bar -bang Snippets call fzf#vim#snippets(0)', \'command! -bar -bang Commands call fzf#vim#commands(0)', \'command! -bar -bang Marks call fzf#vim#marks(0)', -\'command! -bar -bang Helptags call fzf#vim#helptags(0)', +\'command! -bar -bang Helptags call fzf#vim#helptags(fzf#vim#with_preview({ "placeholder": "--tag {2}:{3}:{4}" }), 0)', \'command! -bar -bang Windows call fzf#vim#windows(0)', -\'command! -bar -bang Commits call fzf#vim#commits(0)', -\'command! -bar -bang BCommits call fzf#vim#buffer_commits(0)', +\'command! -bar -bang -range=% Commits let b:fzf_winview = winsaveview() | ,call fzf#vim#commits(fzf#vim#with_preview({ "placeholder": "" }), 0)', +\'command! -bar -bang -range=% BCommits let b:fzf_winview = winsaveview() | ,call fzf#vim#buffer_commits(fzf#vim#with_preview({ "placeholder": "" }), 0)', \'command! -bar -bang Maps call fzf#vim#maps("n", 0)', \'command! -bar -bang Filetypes call fzf#vim#filetypes(0)', -\'command! -bang -nargs=* History call s:history(, s:p(0), 0)']) +\'command! -bang -nargs=* History call s:history(, fzf#vim#with_preview(), 0)']) function! s:history(arg, extra, bang) let bang = a:bang || a:arg[len(a:arg)-1] == '!' diff --git a/_vim/.vim/plugged/gdb-dashboard/.gdbinit b/_vim/.vim/plugged/gdb-dashboard/.gdbinit index 4a838fa..6af58aa 100644 --- a/_vim/.vim/plugged/gdb-dashboard/.gdbinit +++ b/_vim/.vim/plugged/gdb-dashboard/.gdbinit @@ -6,7 +6,7 @@ python # License ---------------------------------------------------------------------- -# Copyright (c) 2015-2020 Andrea Cardaci +# Copyright (c) 2015-2022 Andrea Cardaci # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,8 @@ python # Imports ---------------------------------------------------------------------- import ast +import io +import itertools import math import os import re @@ -107,9 +109,14 @@ See the `prompt` attribute. This value is used as a Python format string where 'doc': '''Define the value of `{status}` when the target program is running. See the `prompt` attribute. This value is used as a Python format string.''', - 'default': '\[\e[1;30m\]>>>\[\e[0m\]' + 'default': '\[\e[90m\]>>>\[\e[0m\]' }, # divider + 'omit_divider': { + 'doc': 'Omit the divider in external outputs when only one module is displayed.', + 'default': False, + 'type': bool + }, 'divider_fill_char_primary': { 'doc': 'Filler around the label for primary dividers', 'default': '─' @@ -124,7 +131,7 @@ See the `prompt` attribute. This value is used as a Python format string.''', }, 'divider_fill_style_secondary': { 'doc': 'Style for `divider_fill_char_secondary`', - 'default': '1;30' + 'default': '90' }, 'divider_label_style_on_primary': { 'doc': 'Label style for non-empty primary dividers', @@ -140,7 +147,7 @@ See the `prompt` attribute. This value is used as a Python format string.''', }, 'divider_label_style_off_secondary': { 'doc': 'Label style for empty secondary dividers', - 'default': '1;30' + 'default': '90' }, 'divider_label_skip': { 'doc': 'Gap between the aligning border and the label.', @@ -167,7 +174,7 @@ See the `prompt` attribute. This value is used as a Python format string.''', 'default': '32' }, 'style_low': { - 'default': '1;30' + 'default': '90' }, 'style_high': { 'default': '1;37' @@ -185,7 +192,7 @@ See the `prompt` attribute. This value is used as a Python format string.''', class Beautifier(): def __init__(self, hint, tab_size=4): - self.tab_spaces = ' ' * tab_size + self.tab_spaces = ' ' * tab_size if tab_size else None self.active = False if not R.ansi or not R.syntax_highlighting: return @@ -211,8 +218,9 @@ class Beautifier(): pass def process(self, source): - # convert tabs anyway - source = source.replace('\t', self.tab_spaces) + # convert tabs if requested + if self.tab_spaces: + source = source.replace('\t', self.tab_spaces) if self.active: import pygments source = pygments.highlight(source, self.lexer, self.formatter) @@ -319,6 +327,7 @@ def format_value(value, compact=None): def fetch_breakpoints(watchpoints=False, pending=False): # fetch breakpoints addresses parsed_breakpoints = dict() + catch_what_regex = re.compile(r'([^,]+".*")?[^,]*') for line in run('info breakpoints').split('\n'): # just keep numbered lines if not line or not line[0].isdigit(): @@ -334,7 +343,11 @@ def fetch_breakpoints(watchpoints=False, pending=False): address = None if is_multiple or is_pending else int(fields[4], 16) is_enabled = fields[3] == 'y' address_info = address, is_enabled - parsed_breakpoints[number] = [address_info], is_pending + parsed_breakpoints[number] = [address_info], is_pending, '' + elif len(fields) >= 5 and fields[1] == 'catchpoint': + # only take before comma, but ignore commas in quotes + what = catch_what_regex.search(' '.join(fields[4:]))[0].strip() + parsed_breakpoints[number] = [], False, what elif len(fields) >= 3 and number in parsed_breakpoints: # add this address to the list of multiple locations address = int(fields[2], 16) @@ -343,7 +356,7 @@ def fetch_breakpoints(watchpoints=False, pending=False): parsed_breakpoints[number][0].append(address_info) else: # watchpoints - parsed_breakpoints[number] = [], False + parsed_breakpoints[number] = [], False, '' except ValueError: pass # fetch breakpoints from the API and complement with address and source @@ -351,7 +364,10 @@ def fetch_breakpoints(watchpoints=False, pending=False): breakpoints = [] # XXX in older versions gdb.breakpoints() returns None for gdb_breakpoint in gdb.breakpoints() or []: - addresses, is_pending = parsed_breakpoints[gdb_breakpoint.number] + # skip internal breakpoints + if gdb_breakpoint.number < 0: + continue + addresses, is_pending, what = parsed_breakpoints[gdb_breakpoint.number] is_pending = getattr(gdb_breakpoint, 'pending', is_pending) if not pending and is_pending: continue @@ -368,6 +384,7 @@ def fetch_breakpoints(watchpoints=False, pending=False): breakpoint['temporary'] = gdb_breakpoint.temporary breakpoint['hit_count'] = gdb_breakpoint.hit_count breakpoint['pending'] = is_pending + breakpoint['what'] = what # add addresses and source information breakpoint['addresses'] = [] for address, is_enabled in addresses: @@ -407,7 +424,9 @@ class Dashboard(gdb.Command): def on_continue(self, _): # try to contain the GDB messages in a specified area unless the # dashboard is printed to a separate file (dashboard -output ...) - if self.is_running() and not self.output: + # or there are no modules to display in the main terminal + enabled_modules = list(filter(lambda m: not m.output and m.enabled, self.modules)) + if self.is_running() and not self.output and len(enabled_modules) > 0: width, _ = Dashboard.get_term_size() gdb.write(Dashboard.clear_screen()) gdb.write(divider(width, 'Output/messages', True)) @@ -509,6 +528,9 @@ class Dashboard(gdb.Command): buf += Dashboard.clear_screen() # show message if all the modules in this output are disabled if not any(instances): + # skip the main terminal + if fs is gdb: + continue # write the error message buf += divider(width, 'Warning', True) buf += '\n' @@ -516,11 +538,7 @@ class Dashboard(gdb.Command): buf += 'No module to display (see `dashboard -layout`)' else: buf += 'No module loaded' - # write the terminator only in the main terminal buf += '\n' - if fs is gdb: - buf += divider(width, primary=True) - buf += '\n' fs.write(buf) continue # process all the modules for that output @@ -535,10 +553,12 @@ class Dashboard(gdb.Command): # allow to continue on exceptions in modules stacktrace = traceback.format_exc().strip() lines = [ansi(stacktrace, R.style_error)] - # create the divider accordingly - div = divider(width, instance.label(), True, lines) + # create the divider if needed + div = [] + if not R.omit_divider or len(instances) > 1 or fs is gdb: + div = [divider(width, instance.label(), True, lines)] # write the data - buf += '\n'.join([div] + lines) + buf += '\n'.join(div + lines) # write the newline for all but last unless main terminal if n != len(instances) or fs is gdb: buf += '\n' @@ -561,6 +581,8 @@ class Dashboard(gdb.Command): @staticmethod def start(): + # save the instance for customization convenience + global dashboard # initialize the dashboard dashboard = Dashboard() Dashboard.set_custom_prompt(dashboard) @@ -616,7 +638,17 @@ class Dashboard(gdb.Command): @staticmethod def parse_inits(python): - for root, dirs, files in os.walk(os.path.expanduser('~/.gdbinit.d/')): + # paths where the .gdbinit.d directory might be + search_paths = [ + '/etc/gdb-dashboard', + '{}/gdb-dashboard'.format(os.getenv('XDG_CONFIG_HOME', '~/.config')), + '~/Library/Preferences/gdb-dashboard', + '~/.gdbinit.d' + ] + # expand the tilde and walk the paths + inits_dirs = (os.walk(os.path.expanduser(path)) for path in search_paths) + # process all the init files in order + for root, dirs, files in itertools.chain.from_iterable(inits_dirs): dirs.sort() for init in sorted(files): path = os.path.join(root, init) @@ -1134,7 +1166,10 @@ class Source(Dashboard.Module): self.offset = 0 def label(self): - return 'Source' + label = 'Source' + if self.show_path and self.file_name: + label += ': {}'.format(self.file_name) + return label def lines(self, term_width, term_height, style_changed): # skip if the current thread is not stopped @@ -1144,6 +1179,7 @@ class Source(Dashboard.Module): sal = gdb.selected_frame().find_sal() current_line = sal.line if current_line == 0: + self.file_name = None return [] # try to lookup the source file candidates = [ @@ -1165,7 +1201,7 @@ class Source(Dashboard.Module): if style_changed or file_name != self.file_name or ts and ts > self.ts: try: # reload the source file if changed - with open(file_name) as source_file: + with io.open(file_name, errors='replace') as source_file: highlighter = Beautifier(file_name, self.tab_size) self.highlighted = highlighter.active source = highlighter.process(source_file.read()) @@ -1203,7 +1239,7 @@ class Source(Dashboard.Module): if int(number) == current_line: # the current line has a different style without ANSI if R.ansi: - if self.highlighted: + if self.highlighted and not self.highlight_line: line_format = '{}' + ansi(number_format, R.style_selected_1) + ' {}' else: line_format = '{}' + ansi(number_format + ' {}', R.style_selected_1) @@ -1259,6 +1295,18 @@ A value of 0 uses the whole height.''', 'name': 'tab_size', 'type': int, 'check': check_gt_zero + }, + 'path': { + 'doc': 'Path visibility flag in the module label.', + 'default': False, + 'name': 'show_path', + 'type': bool + }, + 'highlight-line': { + 'doc': 'Decide whether the whole current line should be highlighted.', + 'default': False, + 'name': 'highlight_line', + 'type': bool } } @@ -1293,22 +1341,14 @@ The instructions constituting the current statement are marked, if available.''' flavor = gdb.parameter('disassembly-flavor') except: flavor = 'att' # not always defined (see #36) - highlighter = Beautifier(flavor) + highlighter = Beautifier(flavor, tab_size=None) # fetch the assembly code line_info = None frame = gdb.selected_frame() # PC is here height = self.height or (term_height - 1) try: - # disassemble the current block (if function information is - # available then try to obtain the boundaries by looking at the - # superblocks) - block = frame.block() - if frame.function(): - while block and (not block.function or block.function.name != frame.function().name): - block = block.superblock - block = block or frame.block() - asm_start = block.start - asm_end = block.end - 1 + # disassemble the current block + asm_start, asm_end = self.fetch_function_boundaries() asm = self.fetch_asm(asm_start, asm_end, False, highlighter) # find the location of the PC pc_index = next(index for index, instr in enumerate(asm) @@ -1392,7 +1432,7 @@ The instructions constituting the current statement are marked, if available.''' indicator = ansi(indicator, R.style_selected_1) opcodes = ansi(opcodes, R.style_selected_1) func_info = ansi(func_info, R.style_selected_1) - if not highlighter.active: + if not highlighter.active or self.highlight_line: text = ansi(text, R.style_selected_1) elif line_info and line_info.pc <= addr < line_info.last: if not R.ansi: @@ -1401,7 +1441,7 @@ The instructions constituting the current statement are marked, if available.''' indicator = ansi(indicator, R.style_selected_2) opcodes = ansi(opcodes, R.style_selected_2) func_info = ansi(func_info, R.style_selected_2) - if not highlighter.active: + if not highlighter.active or self.highlight_line: text = ansi(text, R.style_selected_2) else: addr_str = ansi(addr_str, R.style_low) @@ -1455,6 +1495,12 @@ A value of 0 uses the whole height.''', 'default': True, 'name': 'show_function', 'type': bool + }, + 'highlight-line': { + 'doc': 'Decide whether the whole current line should be highlighted.', + 'default': False, + 'name': 'highlight_line', + 'type': bool } } @@ -1464,6 +1510,26 @@ A value of 0 uses the whole height.''', else: self.offset = 0 + def fetch_function_boundaries(self): + frame = gdb.selected_frame() + # parse the output of the disassemble GDB command to find the function + # boundaries, this should handle cases in which a function spans + # multiple discontinuous blocks + disassemble = run('disassemble') + for block_start, block_end in re.findall(r'Address range 0x([0-9a-f]+) to 0x([0-9a-f]+):', disassemble): + block_start = int(block_start, 16) + block_end = int(block_end, 16) + if block_start <= frame.pc() < block_end: + return block_start, block_end - 1 # need to be inclusive + # if function information is available then try to obtain the + # boundaries by looking at the superblocks + block = frame.block() + if frame.function(): + while block and (not block.function or block.function.name != frame.function().name): + block = block.superblock + block = block or frame.block() + return block.start, block.end - 1 + def fetch_asm(self, start, end_or_count, relative, highlighter): # fetch asm from cache or disassemble if self.cache_key == (start, end_or_count): @@ -1908,11 +1974,14 @@ class Registers(Dashboard.Module): # fetch registers status registers = [] for name in register_list: - # Exclude registers with a dot '.' or parse_and_eval() will fail + # exclude registers with a dot '.' or parse_and_eval() will fail if '.' in name: continue value = gdb.parse_and_eval('${}'.format(name)) string_value = Registers.format_value(value) + # exclude unavailable registers (see #255) + if string_value == '': + continue changed = self.table and (self.table.get(name, '') != string_value) self.table[name] = string_value registers.append((name, string_value, changed)) @@ -2152,6 +2221,9 @@ class Expressions(Dashboard.Module): match = re.match('^Default output radix for printing of values is (\d+)\.$', message) return match.groups()[0] if match else 10 # fallback +# XXX workaround to support BP_BREAKPOINT in older GDB versions +setattr(gdb, 'BP_CATCHPOINT', getattr(gdb, 'BP_CATCHPOINT', 26)) + class Breakpoints(Dashboard.Module): '''Display the breakpoints list.''' @@ -2160,7 +2232,8 @@ class Breakpoints(Dashboard.Module): gdb.BP_WATCHPOINT: 'watch', gdb.BP_HARDWARE_WATCHPOINT: 'write watch', gdb.BP_READ_WATCHPOINT: 'read watch', - gdb.BP_ACCESS_WATCHPOINT: 'access watch' + gdb.BP_ACCESS_WATCHPOINT: 'access watch', + gdb.BP_CATCHPOINT: 'catch' } def label(self): @@ -2210,6 +2283,9 @@ class Breakpoints(Dashboard.Module): # format user location location = breakpoint['location'] line += ' for {}'.format(ansi(location, style)) + elif breakpoint['type'] == gdb.BP_CATCHPOINT: + what = breakpoint['what'] + line += ' {}'.format(ansi(what, style)) else: # format user expression expression = breakpoint['expression'] diff --git a/_vim/.vim/plugged/gdb-dashboard/LICENSE b/_vim/.vim/plugged/gdb-dashboard/LICENSE index b543381..3c4681d 100644 --- a/_vim/.vim/plugged/gdb-dashboard/LICENSE +++ b/_vim/.vim/plugged/gdb-dashboard/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2020 Andrea Cardaci +Copyright (c) 2015-2021 Andrea Cardaci Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/bug.md b/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/bug.md index dd35135..e2ce07b 100644 --- a/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/bug.md +++ b/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/bug.md @@ -5,41 +5,42 @@ labels: bug --- +Keep in mind that others may have the same question in the future. The better your information, +the more likely they'll be able to help themselves. +--> #### Self-Diagnosis - -- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question. -- [ ] I have reviewed the NERDTree documentation. `:h NERDTree` -- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki). -- [ ] I have searched the web for an answer to my question. - -#### Environment (for bug reports) -- [ ] Operating System: -- [ ] Vim/Neovim version `:echo v:version`: -- [ ] NERDTree version, found on 1st line in NERDTree quickhelp `?`: -- [ ] vimrc settings - - [ ] NERDTree variables - ```vim - ``` - - Other NERDTree-dependent Plugins - - [ ] jistr/vim-nerdtree-tabs - - [ ] ryanoasis/vim-devicons - - [ ] tiagofumo/vim-nerdtree-syntax-highlight - - [ ] Xuyuanp/nerdtree-git-plugin - - [ ] Others (specify): - - [ ] I've verified the issue occurs with only NERDTree installed. +Before creating an issue, take some time to search these resources for an answer. It's possible that someone else has already seen and solved your issue. +- [old NERDTree issues](https://github.com/preservim/nerdtree/issues?q=is%3Aissue) +- NERDTree documentation - `:h NERDTree` +- [NERDTree Wiki](https://github.com/preservim/nerdtree/wiki) +- Other resources: , , etc. + +#### Environment +- Operating System: +- Vim/Neovim version `:version`: +- NERDTree version, found on first line of quickhelp `?`: +- Are you using any of these NERDTree-dependent plugins? + - [ ] [Xuyuanp/nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) + - [ ] [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons) + - [ ] [tiagofumo/vim-nerdtree-syntax-highlight](https://github.com/tiagofumo/vim-nerdtree-syntax-highlight) + - [ ] [scrooloose/nerdtree-project-plugin](https://github.com/scrooloose/nerdtree-project-plugin) + - [ ] [PhilRunninger/nerdtree-buffer-ops](https://github.com/PhilRunninger/nerdtree-buffer-ops) + - [ ] [PhilRunninger/nerdtree-visual-selection](https://github.com/PhilRunninger/nerdtree-visual-selection) + - [ ] [jistr/vim-nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs) + - [ ] Others (specify): +- Provide a minimal **.vimrc** file that will reproduce the issue. +```vim +``` #### Steps to Reproduce the Issue 1. -#### Current Result (Include screenshots where appropriate.) +#### Current Behavior (Include screenshots where appropriate.) #### Expected Result diff --git a/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/question.md b/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/question.md index 25f15b0..7e13b7a 100644 --- a/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/question.md +++ b/_vim/.vim/plugged/nerdtree/.github/ISSUE_TEMPLATE/question.md @@ -3,22 +3,11 @@ name: "General Question" about: "Having trouble setting up NERDTree? Need clarification on a setting? Ask your question here." labels: "general question" --- - - -#### Self-Diagnosis - -- [ ] I have searched the [issues](https://github.com/scrooloose/nerdtree/issues) for an answer to my question. -- [ ] I have reviewed the NERDTree documentation. `:h NERDTree` -- [ ] I have reviewed the [Wiki](https://github.com/scrooloose/nerdtree/wiki). -- [ ] I have searched the web for an answer to my question. +Before creating an issue, take some time to search these resources. It's possible that someone else has already asked your question and gotten an answer. +- [old NERDTree issues](https://github.com/preservim/nerdtree/issues?q=is%3Aissue) +- NERDTree documentation - `:h NERDTree` +- [NERDTree Wiki](https://github.com/preservim/nerdtree/wiki) +- Other resource: , , etc. #### State Your Question diff --git a/_vim/.vim/plugged/nerdtree/.github/PULL_REQUEST_TEMPLATE.md b/_vim/.vim/plugged/nerdtree/.github/PULL_REQUEST_TEMPLATE.md index 24dba3f..d2e3b7d 100644 --- a/_vim/.vim/plugged/nerdtree/.github/PULL_REQUEST_TEMPLATE.md +++ b/_vim/.vim/plugged/nerdtree/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,5 @@ ### Description of Changes -Closes # +Closes # --- @@ -13,4 +13,10 @@ Closes # - [ ] Update [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), following the established pattern. #### Collaborator's Instructions - [ ] Review [CHANGELOG.md](https://github.com/scrooloose/nerdtree/blob/master/CHANGELOG.md), suggesting a different version number if necessary. -- [ ] After merge, tag the merge commit, e.g. `git tag -a 3.1.4 -m "v3.1.4" && git push origin --tags` +- [ ] After merging, tag the commit using these (Mac-compatible) bash commands: + ```bash + git checkout master + git pull + sed -n "$(grep -n -m2 '####' CHANGELOG.md | cut -f1 -d: | sed 'N;s/\n/,/')p" CHANGELOG.md | sed '$d' + git tag -a $(read -p "Tag Name: " tag;echo $tag) -m"$(git show --quiet --pretty=%s)";git push origin --tags + ``` diff --git a/_vim/.vim/plugged/nerdtree/CHANGELOG.md b/_vim/.vim/plugged/nerdtree/CHANGELOG.md index d0de2be..6e6893a 100644 --- a/_vim/.vim/plugged/nerdtree/CHANGELOG.md +++ b/_vim/.vim/plugged/nerdtree/CHANGELOG.md @@ -4,8 +4,50 @@ version in an unordered list. The format is: - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) --> +#### 6.10 +- **.16**: Fix documentation errors. (lifecrisis) [#1269](https://github.com/preservim/nerdtree/pull/1269) +- **.15**: Ensure backward compatible testing of types. (lifecrisis) [#1266](https://github.com/preservim/nerdtree/pull/1266) +- **.14**: Replace trim() with a version-compatible alternative. (PhilRunninger) [#1265](https://github.com/preservim/nerdtree/pull/1265) +- **.13**: Change highlighting of bookmarks in the tree. (PhilRunninger) [#1261](https://github.com/preservim/nerdtree/pull/1261) +- **.12**: Answer the question about accessing files over scp or ftp. (PhilRunninger) [#1259](https://github.com/preservim/nerdtree/pull/1259) +- **.11**: Trim filenames created via the fs_menu (elanorigby) [#1243](https://github.com/preservim/nerdtree/pull/1243) +- **.10**: Improve F.A.Q. Answers and Issue Templates (PhilRunninger) [#1249](https://github.com/preservim/nerdtree/pull/1249) +- **.9**: `go` on a bookmark directory will NERDTreeFind it. (PhilRunninger) [#1236](https://github.com/preservim/nerdtree/pull/1236) +- **.8**: Put `Callback` function variables in local scope. (PhilRunninger) [#1230](https://github.com/preservim/nerdtree/pull/1230) +- **.7**: Fix mouse-clicking a file to open it. (PhilRunninger) [#1225](https://github.com/preservim/nerdtree/pull/1225) +- **.6**: Restore the default behavior of the `` key. (PhilRunninger) [#1221](https://github.com/preservim/nerdtree/pull/1221) +- **.5**: Fix `{'keepopen':0}` in NERDTreeCustomOpenArgs (PhilRunninger) [#1217](https://github.com/preservim/nerdtree/pull/1217) +- **.4**: Removed directory separator from sort key (Daniel E) [#1219](https://github.com/preservim/nerdtree/pull/1219) +- **.3**: Add new FAQ and answer: How to prevent buffers replacing NERDTree. (PhilRunninger) [#1215](https://github.com/preservim/nerdtree/pull/1215) +- **.2**: New menu command: Run a system command in this directory. (PhilRunninger) [#1214](https://github.com/preservim/nerdtree/pull/1214) +- **.1**: Escape quotation marks so they can be used in key mappings. (PhilRunninger) [#1213](https://github.com/preservim/nerdtree/pull/1213) +- **.0**: Enable full path specifications for NERDTreeIgnore (PhilRunninger) [#1207](https://github.com/preservim/nerdtree/pull/1207) +#### 6.9 +- **.12**: Respect NERDTreeCustomOpenArgs when opening bookmark (przepompownia) [#1200](https://github.com/preservim/nerdtree/pull/1200) +- **.11**: Revamp the README. (buncis, PhilRunninger) [#1192](https://github.com/preservim/nerdtree/pull/1192), [#1193](https://github.com/preservim/nerdtree/pull/1193) +- **.10**: Open a mirrored NERDTree with correct width (PhilRunninger) [#1177](https://github.com/preservim/nerdtree/pull/1177) +- **.9**: Updated Readme, removed typo (H3RSKO) [#1167](https://github.com/preservim/nerdtree/pull/1167) +- **.8**: Refactor sort comparison functions, removing redundancy (PhilRunninger) [#1166](https://github.com/preservim/nerdtree/pull/1166) +- **.7**: Fix argument of `exists()` function calls checking for autocommands. (PhilRunninger) [#1165](https://github.com/preservim/nerdtree/pull/1165) +- **.6**: Don't use silent when raising User events (PhilRunninger) [#1164](https://github.com/preservim/nerdtree/pull/1164) +- **.5**: Fix highlight for file node. (pirey) [#1157](https://github.com/preservim/nerdtree/pull/1157) +- **.4**: Make sure symbolic links' flags are highlighted correctly. (PhilRunninger) [#1156](https://github.com/preservim/nerdtree/pull/1156) +- **.3**: Fix new NERDTrees' width when previous one was in the only window. (PhilRunninger) [#1153](https://github.com/preservim/nerdtree/pull/1153) +- **.2**: Fix the scope of several key mappings (lifecrisis, PhilRunninger) [#1151](https://github.com/preservim/nerdtree/pull/1151) +- **.1**: Respect user's `&shellslash` setting in CopyNode and RemoveNode functions (PhilRunninger) [#1150](https://github.com/preservim/nerdtree/pull/1150) +- **.0**: Enable opening bookmarks in split windows. (PhilRunninger) [#1144](https://github.com/preservim/nerdtree/pull/1144) +#### 6.8 +- **.0**: Allow concealed characters to show another character. (PhilRunninger) [#1138](https://github.com/preservim/nerdtree/pull/1138) #### 6.7 -- **.7**: Put '%' argument in bufname() for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105) +- **.15**: Add curly braces to the list of characters to be escaped. (PhilRunninger) [#1128](https://github.com/preservim/nerdtree/pull/1128) +- **.14**: Use backward-compatible `nerdtree#and()` in one place that was missed. (PhilRunninger) [#1134](https://github.com/preservim/nerdtree/pull/1134) +- **.13**: `cmd.exe /c start "" ` for windows default viewer support. (J. Altayó) [#1130](https://github.com/preservim/nerdtree/pull/1130) +- **.12**: Fixed a bug that caused the file-tree construction to slow down significantly. (Eugenij-W) [#1126](https://github.com/preservim/nerdtree/pull/1126) +- **.11**: Fix exception in NERDTreeFind (on windows OS and If the file is located in the root directory of the disk) (Eugenij-W) [#1122](https://github.com/preservim/nerdtree/pull/1122) +- **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120) +- **.9**: Force `:NERDTreeFocus` to allow events to be fired when switching windows. (PhilRunninger) [#1118](https://github.com/preservim/nerdtree/pull/1118) +- **.8**: Fix example code for the `NERDTreeAddKeyMap()` function. (PhilRunninger) [#1116](https://github.com/preservim/nerdtree/pull/1116) +- **.7**: Put `'%'` argument in `bufname()` for backwards compatibility. (PhilRunninger) [#1105](https://github.com/preservim/nerdtree/pull/1105) - **.6**: If a file's already open in the window, don't edit it again. (PhilRunninger) [#1103](https://github.com/preservim/nerdtree/pull/1103) - **.5**: Prevent unneeded tree creation in `:NERDTreeToggle[VCS] ` (PhilRunninger) [#1101](https://github.com/preservim/nerdtree/pull/1101) - **.4**: Add missing calls to the `shellescape()` function (lifecrisis) [#1099](https://github.com/preservim/nerdtree/pull/1099) diff --git a/_vim/.vim/plugged/nerdtree/README.markdown b/_vim/.vim/plugged/nerdtree/README.markdown index 09173a6..27aa314 100644 --- a/_vim/.vim/plugged/nerdtree/README.markdown +++ b/_vim/.vim/plugged/nerdtree/README.markdown @@ -1,157 +1,227 @@ -The NERDTree [![Vint](https://github.com/preservim/nerdtree/workflows/Vint/badge.svg)](https://github.com/preservim/nerdtree/actions?workflow=Vint) -============= +![Help Wanted](http://blog.ncce.org/wp-content/uploads/2013/12/help-wanted.jpg) -Introduction ------------- +**NERDTree** is on the lookout for a new maintainer. See [issue #1280](https://github.com/preservim/nerdtree/issues/1280) to submit your name for consideration. -The NERDTree is a file system explorer for the Vim editor. Using this plugin, -users can visually browse complex directory hierarchies, quickly open files for -reading or editing, and perform basic file system operations. +--- -This plugin can also be extended with custom mappings using a special API. The -details of this API and of other NERDTree features are described in the -included documentation. +# The NERDTree [![Vint](https://github.com/preservim/nerdtree/workflows/Vint/badge.svg)](https://github.com/preservim/nerdtree/actions?workflow=Vint) -![NERDTree Screenshot](https://github.com/preservim/nerdtree/raw/master/screenshot.png) +## Introduction -Installation ------------- +The NERDTree is a file system explorer for the Vim editor. Using this plugin, users can visually browse complex directory hierarchies, quickly open files for reading or editing, and perform basic file system operations. -Below are just some of the methods for installing NERDTree. Do not follow all of these instructions; just pick your favorite one. Other plugin managers exist, and NERDTree should install just fine with any of them. +![NERDTree Screenshot](https://github.com/preservim/nerdtree/raw/master/screenshot.png) -#### Vim 8+ packages +## Installation -If you are using VIM version 8 or higher you can use its built-in package management; see `:help packages` for more information. Just run these commands in your terminal: +Use your favorite plugin manager to install this plugin. [tpope/vim-pathogen](https://github.com/tpope/vim-pathogen), [VundleVim/Vundle.vim](https://github.com/VundleVim/Vundle.vim), [junegunn/vim-plug](https://github.com/junegunn/vim-plug), and [Shougo/dein.vim](https://github.com/Shougo/dein.vim) are some of the more popular ones. A lengthy discussion of these and other managers can be found on [vi.stackexchange.com](https://vi.stackexchange.com/questions/388/what-is-the-difference-between-the-vim-plugin-managers). Basic instructions are provided below, but please **be sure to read, understand, and follow all the safety rules that come with your ~~power tools~~ plugin manager.** -```bash -git clone https://github.com/preservim/nerdtree.git ~/.vim/pack/vendor/start/nerdtree -vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c q -``` +If you have no favorite, or want to manage your plugins without 3rd-party dependencies, consider using Vim 8+ packages, as described in Greg Hurrell's excellent Youtube video: [Vim screencast #75: Plugin managers](https://www.youtube.com/watch?v=X2_R3uxDN6g). -Otherwise, these are some of the several 3rd-party plugin managers you can choose from. Be sure you read the instructions for your chosen plugin, as there typically are additional steps you nee d to take. +
+Pathogen +Pathogen is more of a runtime path manager than a plugin manager. You must clone the plugins' repositories yourself to a specific location, and Pathogen makes sure they are available in Vim. -#### [pathogen.vim](https://github.com/tpope/vim-pathogen) -In the terminal, -```bash -git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree -``` -In your vimrc, -```vim -call pathogen#infect() -syntax on -filetype plugin indent on -``` +1. In the terminal, + ```bash + git clone https://github.com/preservim/nerdtree.git ~/.vim/bundle/nerdtree + ``` +1. In your `vimrc`, + ```vim + call pathogen#infect() + syntax on + filetype plugin indent on + ``` +1. Restart Vim, and run `:helptags ~/.vim/bundle/nerdtree/doc/` or `:Helptags`. +
-Then reload vim, run `:helptags ~/.vim/bundle/nerdtree/doc/` or `:Helptags`. +
+ Vundle -#### [Vundle.vim](https://github.com/VundleVim/Vundle.vim) -```vim -call vundle#begin() -Plugin 'preservim/nerdtree' -call vundle#end() -``` +1. Install Vundle, according to its instructions. +1. Add the following text to your `vimrc`. + ```vim + call vundle#begin() + Plugin 'preservim/nerdtree' + call vundle#end() + ``` +1. Restart Vim, and run the `:PluginInstall` statement to install your plugins. +
+ +
+ Vim-Plug -#### [vim-plug](https://github.com/junegunn/vim-plug) +1. Install Vim-Plug, according to its instructions. +1. Add the following text to your `vimrc`. ```vim call plug#begin() -Plug 'preservim/nerdtree' + Plug 'preservim/nerdtree' call plug#end() ``` +1. Restart Vim, and run the `:PlugInstall` statement to install your plugins. +
-#### [dein.vim](https://github.com/Shougo/dein.vim) -```vim -call dein#begin() -call dein#add('preservim/nerdtree') -call dein#end() -``` +
+ Dein + +1. Install Dein, according to its instructions. +1. Add the following text to your `vimrc`. + ```vim + call dein#begin() + call dein#add('preservim/nerdtree') + call dein#end() + ``` +1. Restart Vim, and run the `:call dein#install()` statement to install your plugins. +
+ +
+Vim 8+ packages + +If you are using Vim version 8 or higher you can use its built-in package management; see `:help packages` for more information. Just run these commands in your terminal: -#### [apt-vim](https://github.com/egalpin/apt-vim) ```bash -apt-vim install -y https://github.com/preservim/nerdtree.git +git clone https://github.com/preservim/nerdtree.git ~/.vim/pack/vendor/start/nerdtree +vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c q ``` +
-F.A.Q. (here, and in the [Wiki](https://github.com/preservim/nerdtree/wiki)) ------- - -#### Is there any support for `git` flags? +## Getting Started +After installing NERDTree, the best way to learn it is to turn on the Quick Help. Open NERDTree with the `:NERDTree` command, and press `?` to turn on the Quick Help, which will show you all the mappings and commands available in the NERDTree. Of course, your most complete source of information is the documentation: `:help NERDTree`. -Yes, install [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin). +## NERDTree Plugins +NERDTree can be extended with custom mappings and functions using its built-in API. The details of this API are described in the included documentation. Several plugins have been written, and are available on Github for installation like any other plugin. The plugins in this list are maintained (or not) by their respective owners, and certain combinations may be incompatible. ---- -#### Can I have the nerdtree on every tab automatically? +* [Xuyuanp/nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin): Shows Git status flags for files and folders in NERDTree. +* [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons): Adds filetype-specific icons to NERDTree files and folders, +* [tiagofumo/vim-nerdtree-syntax-highlight](https://github.com/tiagofumo/vim-nerdtree-syntax-highlight): Adds syntax highlighting to NERDTree based on filetype. +* [scrooloose/nerdtree-project-plugin](https://github.com/scrooloose/nerdtree-project-plugin): Saves and restores the state of the NERDTree between sessions. +* [PhilRunninger/nerdtree-buffer-ops](https://github.com/PhilRunninger/nerdtree-buffer-ops): 1) Highlights open files in a different color. 2) Closes a buffer directly from NERDTree. +* [PhilRunninger/nerdtree-visual-selection](https://github.com/PhilRunninger/nerdtree-visual-selection): Enables NERDTree to open, delete, move, or copy multiple Visually-selected files at once. -Nope. If this is something you want then chances are you aren't using tabs and -buffers as they were intended to be used. Read this -http://stackoverflow.com/questions/102384/using-vims-tabs-like-buffers +If any others should be listed, mention them in an issue or pull request. -If you are interested in this behaviour then consider [vim-nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs) ---- -#### How can I open a NERDTree automatically when vim starts up? +## Frequently Asked Questions -Stick this in your vimrc: `autocmd vimenter * NERDTree` +In the answers to these questions, you will see code blocks that you can put in your `vimrc` file. ---- -#### How can I open a NERDTree automatically when vim starts up if no files were specified? +### How can I map a specific key or shortcut to open NERDTree? -Stick this in your vimrc: +NERDTree doesn't create any shortcuts outside of the NERDTree window, so as not to overwrite any of your other shortcuts. Use the `nnoremap` command in your `vimrc`. You, of course, have many keys and NERDTree commands to choose from. Here are but a few examples. ```vim -autocmd StdinReadPre * let s:std_in=1 -autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +nnoremap n :NERDTreeFocus +nnoremap :NERDTree +nnoremap :NERDTreeToggle +nnoremap :NERDTreeFind ``` -Note: Now start vim with plain `vim`, not `vim .` +### How do I open NERDTree automatically when Vim starts? +Each code block below is slightly different, as described in the `" Comment lines`. +```vim +" Start NERDTree and leave the cursor in it. +autocmd VimEnter * NERDTree +``` --- -#### What if I'm also opening a saved session, for example `vim -S session_file.vim`? I don't want NERDTree to open in that scenario. ```vim +" Start NERDTree and put the cursor back in the other window. +autocmd VimEnter * NERDTree | wincmd p +``` +--- +```vim +" Start NERDTree when Vim is started without file arguments. autocmd StdinReadPre * let s:std_in=1 -autocmd VimEnter * if argc() == 0 && !exists("s:std_in") && v:this_session == "" | NERDTree | endif +autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif ``` - --- -#### How can I open NERDTree automatically when vim starts up on opening a directory? ```vim +" Start NERDTree. If a file is specified, move the cursor to its window. autocmd StdinReadPre * let s:std_in=1 -autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif +autocmd VimEnter * NERDTree | if argc() > 0 || exists("s:std_in") | wincmd p | endif +``` +--- +```vim +" Start NERDTree, unless a file or session is specified, eg. vim -S session_file.vim. +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 0 && !exists('s:std_in') && v:this_session == '' | NERDTree | endif +``` +--- +```vim +" Start NERDTree when Vim starts with a directory argument. +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in') | + \ execute 'NERDTree' argv()[0] | wincmd p | enew | execute 'cd '.argv()[0] | endif ``` -This window is tab-specific, meaning it's used by all windows in the tab. This trick also prevents NERDTree from hiding when first selecting a file. - -Note: Executing `vim ~/some-directory` will open NERDTree and a new edit window. `exe 'cd '.argv()[0]` sets the `pwd` of the new edit window to `~/some-directory` +### How can I close Vim or a tab automatically when NERDTree is the last window? +```vim +" Exit Vim if NERDTree is the only window remaining in the only tab. +autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif +``` --- -#### How can I map a specific key or shortcut to open NERDTree? - -Stick this in your vimrc to open NERDTree with `Ctrl+n` (you can set whatever key you want): ```vim -map :NERDTreeToggle +" Close the tab if NERDTree is the only window remaining in it. +autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif ``` ---- -#### How can I close vim if the only window left open is a NERDTree? +### How can I prevent other buffers replacing NERDTree in its window? -Stick this in your vimrc: ```vim -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree. +autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | + \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif ``` ---- -#### Can I have different highlighting for different file extensions? +### Can I have the same NERDTree on every tab automatically? -See here: https://github.com/preservim/nerdtree/issues/433#issuecomment-92590696 +```vim +" Open the existing NERDTree on each new tab. +autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif +``` +or change your NERDTree-launching shortcut key like so: +```vim +" Mirror the NERDTree before showing it. This makes it the same on all tabs. +nnoremap :NERDTreeMirror:NERDTreeFocus +``` ---- -#### How can I change default arrows? +### How can I change the default arrows? -Use these variables in your vimrc. Note that below are default arrow symbols ```vim -let g:NERDTreeDirArrowExpandable = '▸' -let g:NERDTreeDirArrowCollapsible = '▾' +let g:NERDTreeDirArrowExpandable = '?' +let g:NERDTreeDirArrowCollapsible = '?' ``` -You can remove the arrows altogether by setting these variables to empty strings, as shown below. This will remove not only the arrows, but a single space following them, shifting the whole tree two character positions to the left. +The preceding values are the non-Windows default arrow symbols. Setting these variables to empty strings will remove the arrows completely and shift the entire tree two character positions to the left. See `:h NERDTreeDirArrowExpandable` for more details. + +### Can NERDTree access remote files via scp or ftp? + +Short answer: No, and there are no plans to add that functionality. However, Vim ships with a plugin that does just that. It's called netrw, and by adding the following lines to your `.vimrc`, you can use it to open files over the `scp:`, `ftp:`, or other protocols, while still using NERDTree for all local files. The function seamlessly makes the decision to open NERDTree or netrw, and other supported protocols can be added to the regular expression. + ```vim -let g:NERDTreeDirArrowExpandable = '' -let g:NERDTreeDirArrowCollapsible = '' +" Function to open the file or NERDTree or netrw. +" Returns: 1 if either file explorer was opened; otherwise, 0. +function! s:OpenFileOrExplorer(...) + if a:0 == 0 || a:1 == '' + NERDTree + elseif filereadable(a:1) + execute 'edit '.a:1 + return 0 + elseif a:1 =~? '^\(scp\|ftp\)://' " Add other protocols as needed. + execute 'Vexplore '.a:1 + elseif isdirectory(a:1) + execute 'NERDTree '.a:1 + endif + return 1 +endfunction + +" Auto commands to handle OS commandline arguments +autocmd StdinReadPre * let s:std_in=1 +autocmd VimEnter * if argc()==1 && !exists('s:std_in') | if OpenFileOrExplorer(argv()[0]) | wincmd p | enew | wincmd p | endif | endif + +" Command to call the OpenFileOrExplorer function. +command! -n=? -complete=file -bar Edit :call OpenFileOrExplorer('') + +" Command-mode abbreviation to replace the :edit Vim command. +cnoreabbrev e Edit ``` diff --git a/_vim/.vim/plugged/nerdtree/autoload/nerdtree.vim b/_vim/.vim/plugged/nerdtree/autoload/nerdtree.vim index 156b260..ba70871 100644 --- a/_vim/.vim/plugged/nerdtree/autoload/nerdtree.vim +++ b/_vim/.vim/plugged/nerdtree/autoload/nerdtree.vim @@ -30,9 +30,21 @@ endfunction " SECTION: General Functions {{{1 "============================================================ -"FUNCTION: nerdtree#slash() {{{2 -function! nerdtree#slash() abort +" FUNCTION: nerdtree#closeTreeOnOpen() {{{2 +function! nerdtree#closeTreeOnOpen() abort + return g:NERDTreeQuitOnOpen == 1 || g:NERDTreeQuitOnOpen == 3 +endfunction + +" FUNCTION: nerdtree#closeBookmarksOnOpen() {{{2 +function! nerdtree#closeBookmarksOnOpen() abort + return g:NERDTreeQuitOnOpen == 2 || g:NERDTreeQuitOnOpen == 3 +endfunction +" FUNCTION: nerdtree#slash() {{{2 +" Return the path separator used by the underlying file system. Special +" consideration is taken for the use of the 'shellslash' option on Windows +" systems. +function! nerdtree#slash() abort if nerdtree#runningWindows() if exists('+shellslash') && &shellslash return '/' @@ -44,28 +56,6 @@ function! nerdtree#slash() abort return '/' endfunction -"FUNCTION: nerdtree#and(x,y) {{{2 -" Implements and() function for Vim <= 7.2 -function! nerdtree#and(x,y) abort - if exists('*and') - return and(a:x, a:y) - else - let l:x = a:x - let l:y = a:y - let l:n = 0 - let l:result = 0 - while l:x > 0 && l:y > 0 - if (l:x % 2) && (l:y % 2) - let l:result += float2nr(pow(2, l:n)) - endif - let l:x = float2nr(l:x / 2) - let l:y = float2nr(l:y / 2) - let l:n += 1 - endwhile - return l:result - endif -endfunction - "FUNCTION: nerdtree#checkForBrowse(dir) {{{2 "inits a window tree in the current buffer if appropriate function! nerdtree#checkForBrowse(dir) abort @@ -108,32 +98,32 @@ function! nerdtree#completeBookmarks(A,L,P) abort return filter(g:NERDTreeBookmark.BookmarkNames(), 'v:val =~# "^' . a:A . '"') endfunction -"FUNCTION: nerdtree#compareNodes(dir) {{{2 +"FUNCTION: nerdtree#compareNodes(n1, n2) {{{2 function! nerdtree#compareNodes(n1, n2) abort - return a:n1.path.compareTo(a:n2.path) + return nerdtree#compareNodePaths(a:n1.path, a:n2.path) endfunction -"FUNCTION: nerdtree#compareNodesBySortKey(n1, n2) {{{2 -function! nerdtree#compareNodesBySortKey(n1, n2) abort - let sortKey1 = a:n1.path.getSortKey() - let sortKey2 = a:n2.path.getSortKey() +"FUNCTION: nerdtree#compareNodePaths(p1, p2) {{{2 +function! nerdtree#compareNodePaths(p1, p2) abort + let sortKey1 = a:p1.getSortKey() + let sortKey2 = a:p2.getSortKey() let i = 0 while i < min([len(sortKey1), len(sortKey2)]) " Compare chunks upto common length. " If chunks have different type, the one which has " integer type is the lesser. - if type(sortKey1[i]) ==# type(sortKey2[i]) + if type(sortKey1[i]) == type(sortKey2[i]) if sortKey1[i] <# sortKey2[i] return - 1 elseif sortKey1[i] ># sortKey2[i] return 1 endif - elseif type(sortKey1[i]) ==# v:t_number + elseif type(sortKey1[i]) == type(0) return -1 - elseif type(sortKey2[i]) ==# v:t_number + elseif type(sortKey2[i]) == type(0) return 1 endif - let i = i + 1 + let i += 1 endwhile " Keys are identical upto common length. diff --git a/_vim/.vim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim b/_vim/.vim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim index aef1b04..fc22f21 100644 --- a/_vim/.vim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim +++ b/_vim/.vim/plugged/nerdtree/autoload/nerdtree/ui_glue.vim @@ -25,12 +25,16 @@ function! nerdtree#ui_glue#createDefaultBindings() abort call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreview, 'scope': 'Bookmark', 'callback': s.'previewBookmark' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapActivateNode, 'scope': 'all', 'callback': s.'activateAll' }) - call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': 'Node', 'callback': s.'openHSplit' }) - call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': 'Node', 'callback': s.'openVSplit' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': 'FileNode', 'callback': s.'openHSplit' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenSplit, 'scope': 'Bookmark', 'callback': s.'openHSplitBookmark' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': 'FileNode', 'callback': s.'openVSplit' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenVSplit, 'scope': 'Bookmark', 'callback': s.'openVSplitBookmark' }) - call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreview, 'scope': 'Node', 'callback': s.'previewNodeCurrent' }) - call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewVSplit, 'scope': 'Node', 'callback': s.'previewNodeVSplit' }) - call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewSplit, 'scope': 'Node', 'callback': s.'previewNodeHSplit' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreview, 'scope': 'FileNode', 'callback': s.'previewNodeCurrent' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewSplit, 'scope': 'FileNode', 'callback': s.'previewNodeHSplit' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewSplit, 'scope': 'Bookmark', 'callback': s.'previewNodeHSplitBookmark' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewVSplit, 'scope': 'FileNode', 'callback': s.'previewNodeVSplit' }) + call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapPreviewVSplit, 'scope': 'Bookmark', 'callback': s.'previewNodeVSplitBookmark' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenRecursively, 'scope': 'DirNode', 'callback': s.'openNodeRecursively' }) @@ -104,10 +108,17 @@ function! s:customOpenBookmark(node) abort endfunction "FUNCTION: s:initCustomOpenArgs() {{{1 -" Make sure NERDTreeCustomOpenArgs has needed keys function! s:initCustomOpenArgs() abort - let g:NERDTreeCustomOpenArgs = get(g:, 'NERDTreeCustomOpenArgs', {}) - return extend(g:NERDTreeCustomOpenArgs, {'file':{'reuse': 'all', 'where': 'p'}, 'dir':{}}, 'keep') + let l:defaultOpenArgs = {'file': {'reuse': 'all', 'where': 'p', 'keepopen':!nerdtree#closeTreeOnOpen()}, 'dir': {}} + try + let g:NERDTreeCustomOpenArgs = get(g:, 'NERDTreeCustomOpenArgs', {}) + call extend(g:NERDTreeCustomOpenArgs, l:defaultOpenArgs, 'keep') + catch /^Vim(\a\+):E712:/ + call nerdtree#echoWarning('g:NERDTreeCustomOpenArgs is not set properly. Using default value.') + let g:NERDTreeCustomOpenArgs = l:defaultOpenArgs + finally + return g:NERDTreeCustomOpenArgs + endtry endfunction "FUNCTION: s:activateAll() {{{1 @@ -133,13 +144,13 @@ endfunction "FUNCTION: s:activateFileNode() {{{1 "handle the user activating a tree node function! s:activateFileNode(node) abort - call a:node.activate({'reuse': 'all', 'where': 'p'}) + call a:node.activate({'reuse': 'all', 'where': 'p', 'keepopen': !nerdtree#closeTreeOnOpen()}) endfunction "FUNCTION: s:activateBookmark(bookmark) {{{1 "handle the user activating a bookmark function! s:activateBookmark(bm) abort - call a:bm.activate(b:NERDTree, !a:bm.path.isDirectory ? {'where': 'p'} : {}) + call a:bm.activate(b:NERDTree, !a:bm.path.isDirectory ? {'where': 'p', 'keepopen': !nerdtree#closeTreeOnOpen()} : {}) endfunction " FUNCTION: nerdtree#ui_glue#bookmarkNode(name) {{{1 @@ -362,7 +373,7 @@ function! s:handleLeftClick() abort if currentNode.path.isDirectory call currentNode.activate() else - call currentNode.activate({'reuse': 'all', 'where': 'p'}) + call currentNode.activate({'reuse': 'all', 'where': 'p', 'keepopen':!nerdtree#closeTreeOnOpen()}) endif return endif @@ -496,19 +507,42 @@ function! nerdtree#ui_glue#openBookmark(name) abort endtry if l:bookmark.path.isDirectory call l:bookmark.open(b:NERDTree) - else - call l:bookmark.open(b:NERDTree, {'where': 'p'}) + return endif + + call l:bookmark.open(b:NERDTree, s:initCustomOpenArgs().file) endfunction " FUNCTION: s:openHSplit(target) {{{1 function! s:openHSplit(target) abort - call a:target.activate({'where': 'h'}) + call a:target.activate({'where': 'h', 'keepopen': !nerdtree#closeTreeOnOpen()}) endfunction " FUNCTION: s:openVSplit(target) {{{1 function! s:openVSplit(target) abort - call a:target.activate({'where': 'v'}) + call a:target.activate({'where': 'v', 'keepopen': !nerdtree#closeTreeOnOpen()}) +endfunction + +"FUNCTION: s:openHSplitBookmark(bookmark) {{{1 +"handle the user activating a bookmark +function! s:openHSplitBookmark(bm) abort + call a:bm.activate(b:NERDTree, !a:bm.path.isDirectory ? {'where': 'h', 'keepopen': !nerdtree#closeTreeOnOpen()} : {}) +endfunction + +"FUNCTION: s:openVSplitBookmark(bookmark) {{{1 +"handle the user activating a bookmark +function! s:openVSplitBookmark(bm) abort + call a:bm.activate(b:NERDTree, !a:bm.path.isDirectory ? {'where': 'v', 'keepopen': !nerdtree#closeTreeOnOpen()} : {}) +endfunction + +" FUNCTION: s:previewHSplitBookmark(bookmark) {{{1 +function! s:previewNodeHSplitBookmark(bookmark) abort + call a:bookmark.activate(b:NERDTree, !a:bookmark.path.isDirectory ? {'stay': 1, 'where': 'h', 'keepopen': 1} : {}) +endfunction + +" FUNCTION: s:previewVSplitBookmark(bookmark) {{{1 +function! s:previewNodeVSplitBookmark(bookmark) abort + call a:bookmark.activate(b:NERDTree, !a:bookmark.path.isDirectory ? {'stay': 1, 'where': 'v', 'keepopen': 1} : {}) endfunction " FUNCTION: s:openExplorer(node) {{{1 @@ -518,13 +552,13 @@ endfunction " FUNCTION: s:openInNewTab(target) {{{1 function! s:openInNewTab(target) abort - let l:opener = g:NERDTreeOpener.New(a:target.path, {'where': 't'}) + let l:opener = g:NERDTreeOpener.New(a:target.path, {'where': 't', 'keepopen': !nerdtree#closeTreeOnOpen()}) call l:opener.open(a:target) endfunction " FUNCTION: s:openInNewTabSilent(target) {{{1 function! s:openInNewTabSilent(target) abort - let l:opener = g:NERDTreeOpener.New(a:target.path, {'where': 't', 'stay': 1}) + let l:opener = g:NERDTreeOpener.New(a:target.path, {'where': 't', 'keepopen': !nerdtree#closeTreeOnOpen(), 'stay': 1}) call l:opener.open(a:target) endfunction @@ -567,7 +601,7 @@ function! nerdtree#ui_glue#revealBookmark(name) abort let targetNode = g:NERDTreeBookmark.GetNodeForName(a:name, 0, b:NERDTree) call targetNode.putCursorHere(0, 1) catch /^NERDTree.BookmarkNotFoundError/ - call nerdtree#echo('Bookmark isnt cached under the current root') + call nerdtree#echo('Bookmark isn''t cached under the current root') endtry endfunction diff --git a/_vim/.vim/plugged/nerdtree/doc/NERDTree.txt b/_vim/.vim/plugged/nerdtree/doc/NERDTree.txt index 47d65cc..55c25cd 100644 --- a/_vim/.vim/plugged/nerdtree/doc/NERDTree.txt +++ b/_vim/.vim/plugged/nerdtree/doc/NERDTree.txt @@ -116,7 +116,7 @@ The following features and functionality are provided by the NERDTree: :NERDTreeVCS (opens root of repository containing CWD) < :NERDTreeFromBookmark *:NERDTreeFromBookmark* - Opens a fresh NERDTree with the root initialized to the dir for + Opens a fresh NERDTree with the root initialized to the directory for . The only reason to use this command over :NERDTree is for the completion (which is for bookmarks rather than directories). @@ -126,7 +126,7 @@ The following features and functionality are provided by the NERDTree: is set to that path. If no NERDTree exists for this tab then this command acts the same as the |:NERDTree| command. -:NERDTreeToggleVCS [ | ] *:NERDTreeToggleVCS* +:NERDTreeToggleVCS [ | ] *:NERDTreeToggleVCS* Like |:NERDTreeToggle|, but searches up the directory tree to find the top of the version control system repository, and roots the NERDTree there. It works with Git, Subversion, Mercurial, Bazaar, and Darcs repositories. A @@ -249,7 +249,7 @@ Key Description help-tag~ o........Open files, directories and bookmarks......................|NERDTree-o| go.......Open selected file, but leave cursor in the NERDTree......|NERDTree-go| - Open selected bookmark dir in current NERDTree + Find selected bookmark directory in current NERDTree t........Open selected node/bookmark in a new tab...................|NERDTree-t| T........Same as 't' but keep the focus on the current tab..........|NERDTree-T| i........Open selected file in a split window.......................|NERDTree-i| @@ -260,10 +260,10 @@ gs.......Same as s, but leave the cursor on the NERDTree...........|NERDTree-gs| O........Recursively open the selected directory....................|NERDTree-O| x........Close the current nodes parent.............................|NERDTree-x| X........Recursively close all children of the current node.........|NERDTree-X| -e........Edit the current dir.......................................|NERDTree-e| +e........Edit the current directory.................................|NERDTree-e| double-click....same as |NERDTree-o|. -middle-click....same as |NERDTree-i| for files, and |NERDTree-e| for dirs. +middle-click....same as |NERDTree-i| for files, and |NERDTree-e| for directories. D........Delete the current bookmark ...............................|NERDTree-D| @@ -274,13 +274,13 @@ J........Jump down inside directories at the current tree depth.....|NERDTree-J| ....Jump down to next sibling of the current directory.......|NERDTree-C-J| ....Jump up to previous sibling of the current directory.....|NERDTree-C-K| -C........Change the tree root to the selected dir...................|NERDTree-C| +C........Change the tree root to the selected directory.............|NERDTree-C| u........Move the tree root up one directory........................|NERDTree-u| U........Same as 'u' except the old root node is left open..........|NERDTree-U| r........Recursively refresh the current directory..................|NERDTree-r| R........Recursively refresh the current root.......................|NERDTree-R| m........Display the NERDTree menu..................................|NERDTree-m| -cd.......Change the CWD to the dir of the selected node............|NERDTree-cd| +cd.......Change the CWD to the directory of the selected node......|NERDTree-cd| CD.......Change tree root to the CWD...............................|NERDTree-CD| I........Toggle whether hidden files displayed......................|NERDTree-I| @@ -318,9 +318,8 @@ Applies to: files. If a file node or a bookmark that links to a file is selected, it is opened in the previous window, but the cursor does not move. -If a bookmark that links to a directory is selected, that directory is found -in the current NERDTree. If the directory couldn't be found, a new NERDTree is -created. +If a bookmark that links to a directory is selected then that directory +becomes the new root. The default key combo for this mapping is "g" + NERDTreeMapActivateNode (see |NERDTree-o|). @@ -350,7 +349,7 @@ The same as |NERDTree-t| except that the focus is kept in the current tab. *NERDTree-i* Default key: i Map setting: *NERDTreeMapOpenSplit* -Applies to: files. +Applies to: files, and bookmarks pointing to files. Opens the selected file in a new split window and puts the cursor in the new window. @@ -359,7 +358,7 @@ window. *NERDTree-gi* Default key: gi Map setting: *NERDTreeMapPreviewSplit* -Applies to: files. +Applies to: files, and bookmarks pointing to files. The same as |NERDTree-i| except that the cursor is not moved. @@ -370,7 +369,7 @@ The default key combo for this mapping is "g" + NERDTreeMapOpenSplit (see *NERDTree-s* Default key: s Map setting: *NERDTreeMapOpenVSplit* -Applies to: files. +Applies to: files, and bookmarks pointing to files. Opens the selected file in a new vertically split window and puts the cursor in the new window. @@ -379,7 +378,7 @@ in the new window. *NERDTree-gs* Default key: gs Map setting: *NERDTreeMapPreviewVSplit* -Applies to: files. +Applies to: files, and bookmarks pointing to files. The same as |NERDTree-s| except that the cursor is not moved. @@ -470,7 +469,7 @@ Jump to the first child of the current nodes parent. If the cursor is already on the first node then do the following: * loop back thru the siblings of the current nodes parent until we find an - open dir with children + open directory with children * go to the first child of that node ------------------------------------------------------------------------------ @@ -483,7 +482,7 @@ Jump to the last child of the current nodes parent. If the cursor is already on the last node then do the following: * loop forward thru the siblings of the current nodes parent until we find - an open dir with children + an open directory with children * go to the last child of that node ------------------------------------------------------------------------------ @@ -517,7 +516,7 @@ Default key: u Map setting: *NERDTreeMapUpdir* Applies to: no restrictions. -Move the tree root up a dir (like doing a "cd .."). +Move the tree root up a directory (like doing a "cd .."). ------------------------------------------------------------------------------ *NERDTree-U* @@ -533,8 +532,8 @@ Default key: r Map setting: *NERDTreeMapRefresh* Applies to: files and directories. -If a dir is selected, recursively refresh that dir, i.e. scan the filesystem -for changes and represent them in the tree. +If a directory is selected, recursively refresh that directory, i.e. scan the +filesystem for changes and represent them in the tree. If a file node is selected then the above is done on it's parent. @@ -635,8 +634,8 @@ file explorers have. The script comes with two default menu plugins: exec_menuitem.vim and fs_menu.vim. fs_menu.vim adds some basic filesystem operations to the menu for -creating/deleting/moving/copying files and dirs. exec_menuitem.vim provides a -menu item to execute executable files. +creating/deleting/moving/copying files and directories. exec_menuitem.vim +provides a menu item to execute executable files. Related tags: |NERDTree-m| |NERDTreeApi| @@ -922,7 +921,7 @@ Default: ['\~$']. This setting is used to specify which files the NERDTree should ignore. It must be a list of regular expressions. When the NERDTree is rendered, any -files/dirs that match any of the regex's in NERDTreeIgnore won't be +files/directories that match any of the regex's in NERDTreeIgnore won't be displayed. For example if you put the following line in your vimrc: > @@ -930,13 +929,18 @@ For example if you put the following line in your vimrc: > < then all files ending in .vim or ~ will be ignored. -There are 2 magic flags that can be appended to the end of each regular -expression to specify that the regex should match only files or only dirs. -These flags are "[[dir]]" and "[[file]]". Example: > - let NERDTreeIgnore=['\.d$[[dir]]', '\.o$[[file]]'] +There are 3 magic flags that can be appended to the end of each regular +expression to specify that the regex should match only filenames, only lowest +level directories, or a full path. These flags are "[[dir]]", "[[file]]", and +"[[path]]". Example: > + let NERDTreeIgnore=['\.d$[[dir]]', '\.o$[[file]]', 'tmp/cache$[[path]]'] < -This will cause all dirs ending in ".d" to be ignored and all files ending in -".o" to be ignored. +This will cause all directories ending in ".d" to be ignored, all files ending +in ".o" to be ignored, and the "cache" subdirectory of any "tmp" directory to +be ignored. All other "cache" directories will be displayed. + +When using the "[[path]]" tag on Windows, make sure you use escaped +backslashes for the separators in the regex, eg. 'Temp\\cache$[[path]]' Note: to tell the NERDTree not to ignore any files you must use the following line: > @@ -1100,8 +1104,8 @@ Examples: > < 1. Directories will appear last, everything else will appear above. 2. Everything will simply appear in alphabetical order. -3. Dirs will appear first, then ruby and php. Swap files, bak files and vim - backup files will appear last with everything else preceding them. +3. Directories will appear first, then ruby and php. Swap files, bak files + and vim backup files will appear last with everything else preceding them. 4. Everything is sorted by size, largest to smallest, with directories considered to have size 0 bytes. 5. Directories will appear first alphabetically, followed by files, sorted by @@ -1175,8 +1179,9 @@ Use one of the following lines for this setting: > Values: 0 or 1 Default: 1. -When displaying dir nodes, this setting tells NERDTree to collapse dirs that -have only one child. Use one of the following lines for this setting: > +When displaying directory nodes, this setting tells NERDTree to collapse +directories that have only one child. Use one of the following lines for this +setting: > let NERDTreeCascadeSingleChildDir=0 let NERDTreeCascadeSingleChildDir=1 < @@ -1185,11 +1190,12 @@ have only one child. Use one of the following lines for this setting: > Values: 0 or 1 Default: 1. -When opening dir nodes, this setting tells NERDTree to recursively open dirs -that have only one child which is also a dir. NERDTree will stop when it finds -a dir that contains anything but another single dir. This setting also causes -the |NERDTree-x| mapping to close dirs in the same manner. This setting may be -useful for Java projects. Use one of the following lines for this setting: > +When opening directory nodes, this setting tells NERDTree to recursively open +directories that have only one child which is also a directory. NERDTree will +stop when it finds a directory that contains anything but another single +directory. This setting also causes the |NERDTree-x| mapping to close +directories in the same manner. This setting may be useful for Java projects. +Use one of the following lines for this setting: > let NERDTreeCascadeOpenSingleChildDir=0 let NERDTreeCascadeOpenSingleChildDir=1 < @@ -1250,10 +1256,10 @@ responsible pull request: https://github.com/preservim/nerdtree/pull/868. The default value of this variable depends on the features compiled into your vim and the values of |NERDTreeDirArrowCollapsible| and |NERDTreeDirArrowExpandable|. - * If your vim is compiled with the +conceal feature, it is the "\x07" (BELL) - character, and it is hidden by setting 'conceallevel' to 3. If you use - autocommands, make sure none of them change that setting in the NERDTree_* - buffers. + * If your vim is compiled with the +conceal feature, it is the "\x07" + (BEL) character, and it is hidden by setting 'conceallevel' to 2. If you + use autocommands, make sure none of them change that setting in the + NERD_Tree_* buffers. * If your vim does NOT have the +conceal feature and you're using "\u00a0" (non-breaking space) to hide the directory arrows, "\u00b7" (middle dot) is used as the default delimiter. @@ -1353,18 +1359,18 @@ NERDTreeAddKeyMap({options}) *NERDTreeAddKeyMap()* Example: > call NERDTreeAddKeyMap({ \ 'key': 'foo', - \ 'callback': 'NERDTreeCDHandler', + \ 'callback': 'NERDTreeEchoPathHandler', \ 'quickhelpText': 'echo full path of current node', \ 'scope': 'DirNode' }) - function! NERDTreeCDHandler(dirnode) - call a:dirnode.changeToDir() + function! NERDTreeEchoPathHandler(dirnode) + echo a:dirnode.path.str() endfunction < This code should sit in a file like ~/.vim/nerdtree_plugin/mymapping.vim. It adds a (redundant) mapping on 'foo' which changes vim's CWD to that of - the current dir node. Note this mapping will only fire when the cursor is - on a directory node. + the current directory node. Note this mapping will only fire when the + cursor is on a directory node. ------------------------------------------------------------------------------ 4.2. Menu API *NERDTreeMenuAPI* diff --git a/_vim/.vim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim b/_vim/.vim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim index 9750976..05bee60 100644 --- a/_vim/.vim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim +++ b/_vim/.vim/plugged/nerdtree/nerdtree_plugin/fs_menu.vim @@ -34,6 +34,10 @@ if executable('xdg-open') call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'}) endif +if nerdtree#runningWindows() + call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileWindows'}) +endif + if g:NERDTreePath.CopyingSupported() call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'}) endif @@ -45,6 +49,10 @@ else call NERDTreeAddMenuItem({'text': '(l)ist the current node', 'shortcut': 'l', 'callback': 'NERDTreeListNodeWin32'}) endif +if exists('*system') + call NERDTreeAddMenuItem({'text': 'Run (s)ystem command in this directory', 'shortcut':'s', 'callback': 'NERDTreeSystemCommand'}) +endif + "FUNCTION: s:inputPrompt(action){{{1 "returns the string that should be prompted to the user for the given action " @@ -161,7 +169,7 @@ endfunction function! NERDTreeAddNode() let curDirNode = g:NERDTreeDirNode.GetSelected() let prompt = s:inputPrompt('add') - let newNodeName = input(prompt, curDirNode.path.str() . g:NERDTreePath.Slash(), 'file') + let newNodeName = substitute(input(prompt, curDirNode.path.str() . nerdtree#slash(), 'file'), '\(^\s*\|\s*$\)', '', 'g') if newNodeName ==# '' call nerdtree#echo('Node Creation Aborted.') @@ -198,7 +206,7 @@ function! NERDTreeMoveNode() let newNodePath = input(prompt, curNode.path.str(), 'file') while filereadable(newNodePath) call nerdtree#echoWarning('This destination already exists. Try again.') - let newNodePath = input(prompt, curNode.path.str(), 'file') + let newNodePath = substitute(input(prompt, curNode.path.str(), 'file'), '\(^\s*\|\s*$\)', '', 'g') endwhile @@ -248,8 +256,6 @@ endfunction " FUNCTION: NERDTreeDeleteNode() {{{1 function! NERDTreeDeleteNode() - let l:shellslash = &shellslash - let &shellslash = 0 let currentNode = g:NERDTreeFileNode.GetSelected() let confirmed = 0 @@ -285,7 +291,6 @@ function! NERDTreeDeleteNode() else call nerdtree#echo('delete aborted') endif - let &shellslash = l:shellslash endfunction " FUNCTION: NERDTreeListNode() {{{1 @@ -330,11 +335,9 @@ endfunction " FUNCTION: NERDTreeCopyNode() {{{1 function! NERDTreeCopyNode() - let l:shellslash = &shellslash - let &shellslash = 0 let currentNode = g:NERDTreeFileNode.GetSelected() let prompt = s:inputPrompt('copy') - let newNodePath = input(prompt, currentNode.path.str(), 'file') + let newNodePath = substitute(input(prompt, currentNode.path.str(), 'file'), '\(^\s*\|\s*$\)', '', 'g') if newNodePath !=# '' "strip trailing slash @@ -367,7 +370,6 @@ function! NERDTreeCopyNode() else call nerdtree#echo('Copy aborted.') endif - let &shellslash = l:shellslash redraw! endfunction @@ -451,4 +453,32 @@ function! NERDTreeExecuteFileLinux() call system('xdg-open ' . shellescape(l:node.path.str())) endfunction +" FUNCTION: NERDTreeExecuteFileWindows() {{{1 +function! NERDTreeExecuteFileWindows() + let l:node = g:NERDTreeFileNode.GetSelected() + + if empty(l:node) + return + endif + + call system('cmd.exe /c start "" ' . shellescape(l:node.path.str())) +endfunction + +" FUNCTION: NERDTreeSystemCommand() {{{1 +function! NERDTreeSystemCommand() + let l:node = g:NERDTreeFileNode.GetSelected() + + if empty(l:node) + return + endif + + let l:cwd = getcwd() + let l:directory = l:node.path.isDirectory ? l:node.path.str() : l:node.parent.path.str() + execute 'cd '.l:directory + + let l:nl = nr2char(10) + echo l:nl . system(input(l:directory . (nerdtree#runningWindows() ? '> ' : ' $ '))) + execute 'cd '.l:cwd +endfunction + " vim: set sw=4 sts=4 et fdm=marker: diff --git a/_vim/.vim/plugged/nerdtree/plugin/NERD_tree.vim b/_vim/.vim/plugged/nerdtree/plugin/NERD_tree.vim index 639f87b..ef60cca 100644 --- a/_vim/.vim/plugged/nerdtree/plugin/NERD_tree.vim +++ b/_vim/.vim/plugged/nerdtree/plugin/NERD_tree.vim @@ -26,141 +26,114 @@ let loaded_nerd_tree = 1 let s:old_cpo = &cpoptions set cpoptions&vim -"Function: s:initVariable() function {{{2 -"This function is used to initialise a given variable to a given value. The -"variable is only initialised if it does not exist prior -" -"Args: -"var: the name of the var to be initialised -"value: the value to initialise var to -" -"Returns: -"1 if the var is set, 0 otherwise -function! s:initVariable(var, value) - if !exists(a:var) - exec 'let ' . a:var . ' = ' . "'" . substitute(a:value, "'", "''", 'g') . "'" - return 1 - endif - return 0 -endfunction - -"SECTION: Init variable calls and other random constants {{{2 -call s:initVariable('g:NERDTreeAutoCenter', 1) -call s:initVariable('g:NERDTreeAutoCenterThreshold', 3) -call s:initVariable('g:NERDTreeCaseSensitiveSort', 0) -call s:initVariable('g:NERDTreeNaturalSort', 0) -call s:initVariable('g:NERDTreeSortHiddenFirst', 1) -call s:initVariable('g:NERDTreeUseTCD', 0) -call s:initVariable('g:NERDTreeChDirMode', 0) -call s:initVariable('g:NERDTreeCreatePrefix', 'silent') -call s:initVariable('g:NERDTreeMinimalUI', 0) -call s:initVariable('g:NERDTreeMinimalMenu', 0) -if !exists('g:NERDTreeIgnore') - let g:NERDTreeIgnore = ['\~$'] -endif -call s:initVariable('g:NERDTreeBookmarksFile', expand('$HOME') . '/.NERDTreeBookmarks') -call s:initVariable('g:NERDTreeBookmarksSort', 1) -call s:initVariable('g:NERDTreeHighlightCursorline', 1) -call s:initVariable('g:NERDTreeHijackNetrw', 1) -call s:initVariable('g:NERDTreeMarkBookmarks', 1) -call s:initVariable('g:NERDTreeMouseMode', 1) -call s:initVariable('g:NERDTreeNotificationThreshold', 100) -call s:initVariable('g:NERDTreeQuitOnOpen', 0) -call s:initVariable('g:NERDTreeRespectWildIgnore', 0) -call s:initVariable('g:NERDTreeShowBookmarks', 0) -call s:initVariable('g:NERDTreeShowFiles', 1) -call s:initVariable('g:NERDTreeShowHidden', 0) -call s:initVariable('g:NERDTreeShowLineNumbers', 0) -call s:initVariable('g:NERDTreeSortDirs', 1) +"SECTION: Initialize variable calls and other random constants {{{2 +let g:NERDTreeAutoCenter = get(g:, 'NERDTreeAutoCenter', 1) +let g:NERDTreeAutoCenterThreshold = get(g:, 'NERDTreeAutoCenterThreshold', 3) +let g:NERDTreeCaseSensitiveSort = get(g:, 'NERDTreeCaseSensitiveSort', 0) +let g:NERDTreeNaturalSort = get(g:, 'NERDTreeNaturalSort', 0) +let g:NERDTreeSortHiddenFirst = get(g:, 'NERDTreeSortHiddenFirst', 1) +let g:NERDTreeUseTCD = get(g:, 'NERDTreeUseTCD', 0) +let g:NERDTreeChDirMode = get(g:, 'NERDTreeChDirMode', 0) +let g:NERDTreeCreatePrefix = get(g:, 'NERDTreeCreatePrefix', 'silent') +let g:NERDTreeMinimalUI = get(g:, 'NERDTreeMinimalUI', 0) +let g:NERDTreeMinimalMenu = get(g:, 'NERDTreeMinimalMenu', 0) +let g:NERDTreeIgnore = get(g:, 'NERDTreeIgnore', ['\~$']) +let g:NERDTreeBookmarksFile = get(g:, 'NERDTreeBookmarksFile', expand('$HOME') . '/.NERDTreeBookmarks') +let g:NERDTreeBookmarksSort = get(g:, 'NERDTreeBookmarksSort', 1) +let g:NERDTreeHighlightCursorline = get(g:, 'NERDTreeHighlightCursorline', 1) +let g:NERDTreeHijackNetrw = get(g:, 'NERDTreeHijackNetrw', 1) +let g:NERDTreeMarkBookmarks = get(g:, 'NERDTreeMarkBookmarks', 1) +let g:NERDTreeMouseMode = get(g:, 'NERDTreeMouseMode', 1) +let g:NERDTreeNotificationThreshold = get(g:, 'NERDTreeNotificationThreshold', 100) +let g:NERDTreeQuitOnOpen = get(g:, 'NERDTreeQuitOnOpen', 0) +let g:NERDTreeRespectWildIgnore = get(g:, 'NERDTreeRespectWildIgnore', 0) +let g:NERDTreeShowBookmarks = get(g:, 'NERDTreeShowBookmarks', 0) +let g:NERDTreeShowFiles = get(g:, 'NERDTreeShowFiles', 1) +let g:NERDTreeShowHidden = get(g:, 'NERDTreeShowHidden', 0) +let g:NERDTreeShowLineNumbers = get(g:, 'NERDTreeShowLineNumbers', 0) +let g:NERDTreeSortDirs = get(g:, 'NERDTreeSortDirs', 1) if !nerdtree#runningWindows() && !nerdtree#runningCygwin() - call s:initVariable('g:NERDTreeDirArrowExpandable', '▸') - call s:initVariable('g:NERDTreeDirArrowCollapsible', '▾') + let g:NERDTreeDirArrowExpandable = get(g:, 'NERDTreeDirArrowExpandable', '▸') + let g:NERDTreeDirArrowCollapsible = get(g:, 'NERDTreeDirArrowCollapsible', '▾') else - call s:initVariable('g:NERDTreeDirArrowExpandable', '+') - call s:initVariable('g:NERDTreeDirArrowCollapsible', '~') + let g:NERDTreeDirArrowExpandable = get(g:, 'NERDTreeDirArrowExpandable', '+') + let g:NERDTreeDirArrowCollapsible = get(g:, 'NERDTreeDirArrowCollapsible', '~') endif -call s:initVariable('g:NERDTreeCascadeOpenSingleChildDir', 1) -call s:initVariable('g:NERDTreeCascadeSingleChildDir', 1) +let g:NERDTreeCascadeOpenSingleChildDir = get(g:, 'NERDTreeCascadeOpenSingleChildDir', 1) +let g:NERDTreeCascadeSingleChildDir = get(g:, 'NERDTreeCascadeSingleChildDir', 1) -if !exists('g:NERDTreeSortOrder') - let g:NERDTreeSortOrder = ['\/$', '*', '\.swp$', '\.bak$', '\~$'] -endif +let g:NERDTreeSortOrder = get(g:, 'NERDTreeSortOrder', ['\/$', '*', '\.swp$', '\.bak$', '\~$']) let g:NERDTreeOldSortOrder = [] -call s:initVariable('g:NERDTreeGlyphReadOnly', 'RO') +let g:NERDTreeGlyphReadOnly = get(g:, 'NERDTreeGlyphReadOnly', 'RO') if has('conceal') - call s:initVariable('g:NERDTreeNodeDelimiter', "\x07") + let g:NERDTreeNodeDelimiter = get(g:, 'NERDTreeNodeDelimiter', "\x07") elseif (g:NERDTreeDirArrowExpandable ==# "\u00a0" || g:NERDTreeDirArrowCollapsible ==# "\u00a0") - call s:initVariable('g:NERDTreeNodeDelimiter', "\u00b7") + let g:NERDTreeNodeDelimiter = get(g:, 'NERDTreeNodeDelimiter', "\u00b7") else - call s:initVariable('g:NERDTreeNodeDelimiter', "\u00a0") + let g:NERDTreeNodeDelimiter = get(g:, 'NERDTreeNodeDelimiter', "\u00a0") endif -if !exists('g:NERDTreeStatusline') - - "the exists() crap here is a hack to stop vim spazzing out when - "loading a session that was created with an open nerd tree. It spazzes - "because it doesnt store b:NERDTree(its a b: var, and its a hash) - let g:NERDTreeStatusline = "%{exists('b:NERDTree')?b:NERDTree.root.path.str():''}" +"the exists() crap here is a hack to stop vim spazzing out when +"loading a session that was created with an open nerd tree. It spazzes +"because it doesnt store b:NERDTree(its a b: var, and its a hash) +let g:NERDTreeStatusline = get(g:, 'NERDTreeStatusline', "%{exists('b:NERDTree')?b:NERDTree.root.path.str():''}") -endif -call s:initVariable('g:NERDTreeWinPos', 'left') -call s:initVariable('g:NERDTreeWinSize', 31) +let g:NERDTreeWinPos = get(g:, 'NERDTreeWinPos', 'left') +let g:NERDTreeWinSize = get(g:, 'NERDTreeWinSize', 31) "init the shell commands that will be used to copy nodes, and remove dir trees -" "Note: the space after the command is important if nerdtree#runningWindows() - call s:initVariable('g:NERDTreeRemoveDirCmd', 'rmdir /s /q ') - call s:initVariable('g:NERDTreeCopyDirCmd', 'xcopy /s /e /i /y /q ') - call s:initVariable('g:NERDTreeCopyFileCmd', 'copy /y ') + let g:NERDTreeRemoveDirCmd = get(g:, 'NERDTreeRemoveDirCmd', 'rmdir /s /q ') + let g:NERDTreeCopyDirCmd = get(g:, 'NERDTreeCopyDirCmd', 'xcopy /s /e /i /y /q ') + let g:NERDTreeCopyFileCmd = get(g:, 'NERDTreeCopyFileCmd', 'copy /y ') else - call s:initVariable('g:NERDTreeRemoveDirCmd', 'rm -rf ') - call s:initVariable('g:NERDTreeCopyCmd', 'cp -r ') + let g:NERDTreeRemoveDirCmd = get(g:, 'NERDTreeRemoveDirCmd', 'rm -rf ') + let g:NERDTreeCopyCmd = get(g:, 'NERDTreeCopyCmd', 'cp -r ') endif - "SECTION: Init variable calls for key mappings {{{2 -call s:initVariable('g:NERDTreeMapCustomOpen', '') -call s:initVariable('g:NERDTreeMapActivateNode', 'o') -call s:initVariable('g:NERDTreeMapChangeRoot', 'C') -call s:initVariable('g:NERDTreeMapChdir', 'cd') -call s:initVariable('g:NERDTreeMapCloseChildren', 'X') -call s:initVariable('g:NERDTreeMapCloseDir', 'x') -call s:initVariable('g:NERDTreeMapDeleteBookmark', 'D') -call s:initVariable('g:NERDTreeMapMenu', 'm') -call s:initVariable('g:NERDTreeMapHelp', '?') -call s:initVariable('g:NERDTreeMapJumpFirstChild', 'K') -call s:initVariable('g:NERDTreeMapJumpLastChild', 'J') -call s:initVariable('g:NERDTreeMapJumpNextSibling', '') -call s:initVariable('g:NERDTreeMapJumpParent', 'p') -call s:initVariable('g:NERDTreeMapJumpPrevSibling', '') -call s:initVariable('g:NERDTreeMapJumpRoot', 'P') -call s:initVariable('g:NERDTreeMapOpenExpl', 'e') -call s:initVariable('g:NERDTreeMapOpenInTab', 't') -call s:initVariable('g:NERDTreeMapOpenInTabSilent', 'T') -call s:initVariable('g:NERDTreeMapOpenRecursively', 'O') -call s:initVariable('g:NERDTreeMapOpenSplit', 'i') -call s:initVariable('g:NERDTreeMapOpenVSplit', 's') -call s:initVariable('g:NERDTreeMapPreview', 'g' . NERDTreeMapActivateNode) -call s:initVariable('g:NERDTreeMapPreviewSplit', 'g' . NERDTreeMapOpenSplit) -call s:initVariable('g:NERDTreeMapPreviewVSplit', 'g' . NERDTreeMapOpenVSplit) -call s:initVariable('g:NERDTreeMapQuit', 'q') -call s:initVariable('g:NERDTreeMapRefresh', 'r') -call s:initVariable('g:NERDTreeMapRefreshRoot', 'R') -call s:initVariable('g:NERDTreeMapToggleBookmarks', 'B') -call s:initVariable('g:NERDTreeMapToggleFiles', 'F') -call s:initVariable('g:NERDTreeMapToggleFilters', 'f') -call s:initVariable('g:NERDTreeMapToggleHidden', 'I') -call s:initVariable('g:NERDTreeMapToggleZoom', 'A') -call s:initVariable('g:NERDTreeMapUpdir', 'u') -call s:initVariable('g:NERDTreeMapUpdirKeepOpen', 'U') -call s:initVariable('g:NERDTreeMapCWD', 'CD') -call s:initVariable('g:NERDTreeMenuDown', 'j') -call s:initVariable('g:NERDTreeMenuUp', 'k') +let g:NERDTreeMapCustomOpen = get(g:, 'NERDTreeMapCustomOpen', '') +let g:NERDTreeMapActivateNode = get(g:, 'NERDTreeMapActivateNode', 'o') +let g:NERDTreeMapChangeRoot = get(g:, 'NERDTreeMapChangeRoot', 'C') +let g:NERDTreeMapChdir = get(g:, 'NERDTreeMapChdir', 'cd') +let g:NERDTreeMapCloseChildren = get(g:, 'NERDTreeMapCloseChildren', 'X') +let g:NERDTreeMapCloseDir = get(g:, 'NERDTreeMapCloseDir', 'x') +let g:NERDTreeMapDeleteBookmark = get(g:, 'NERDTreeMapDeleteBookmark', 'D') +let g:NERDTreeMapMenu = get(g:, 'NERDTreeMapMenu', 'm') +let g:NERDTreeMapHelp = get(g:, 'NERDTreeMapHelp', '?') +let g:NERDTreeMapJumpFirstChild = get(g:, 'NERDTreeMapJumpFirstChild', 'K') +let g:NERDTreeMapJumpLastChild = get(g:, 'NERDTreeMapJumpLastChild', 'J') +let g:NERDTreeMapJumpNextSibling = get(g:, 'NERDTreeMapJumpNextSibling', '') +let g:NERDTreeMapJumpParent = get(g:, 'NERDTreeMapJumpParent', 'p') +let g:NERDTreeMapJumpPrevSibling = get(g:, 'NERDTreeMapJumpPrevSibling', '') +let g:NERDTreeMapJumpRoot = get(g:, 'NERDTreeMapJumpRoot', 'P') +let g:NERDTreeMapOpenExpl = get(g:, 'NERDTreeMapOpenExpl', 'e') +let g:NERDTreeMapOpenInTab = get(g:, 'NERDTreeMapOpenInTab', 't') +let g:NERDTreeMapOpenInTabSilent = get(g:, 'NERDTreeMapOpenInTabSilent', 'T') +let g:NERDTreeMapOpenRecursively = get(g:, 'NERDTreeMapOpenRecursively', 'O') +let g:NERDTreeMapOpenSplit = get(g:, 'NERDTreeMapOpenSplit', 'i') +let g:NERDTreeMapOpenVSplit = get(g:, 'NERDTreeMapOpenVSplit', 's') +let g:NERDTreeMapPreview = get(g:, 'NERDTreeMapPreview', 'g'.NERDTreeMapActivateNode) +let g:NERDTreeMapPreviewSplit = get(g:, 'NERDTreeMapPreviewSplit', 'g'.NERDTreeMapOpenSplit) +let g:NERDTreeMapPreviewVSplit = get(g:, 'NERDTreeMapPreviewVSplit', 'g'.NERDTreeMapOpenVSplit) +let g:NERDTreeMapQuit = get(g:, 'NERDTreeMapQuit', 'q') +let g:NERDTreeMapRefresh = get(g:, 'NERDTreeMapRefresh', 'r') +let g:NERDTreeMapRefreshRoot = get(g:, 'NERDTreeMapRefreshRoot', 'R') +let g:NERDTreeMapToggleBookmarks = get(g:, 'NERDTreeMapToggleBookmarks', 'B') +let g:NERDTreeMapToggleFiles = get(g:, 'NERDTreeMapToggleFiles', 'F') +let g:NERDTreeMapToggleFilters = get(g:, 'NERDTreeMapToggleFilters', 'f') +let g:NERDTreeMapToggleHidden = get(g:, 'NERDTreeMapToggleHidden', 'I') +let g:NERDTreeMapToggleZoom = get(g:, 'NERDTreeMapToggleZoom', 'A') +let g:NERDTreeMapUpdir = get(g:, 'NERDTreeMapUpdir', 'u') +let g:NERDTreeMapUpdirKeepOpen = get(g:, 'NERDTreeMapUpdirKeepOpen', 'U') +let g:NERDTreeMapCWD = get(g:, 'NERDTreeMapCWD', 'CD') +let g:NERDTreeMenuDown = get(g:, 'NERDTreeMenuDown', 'j') +let g:NERDTreeMenuUp = get(g:, 'NERDTreeMenuUp', 'k') "SECTION: Load class files{{{2 call nerdtree#loadClassFiles() @@ -217,7 +190,7 @@ endfunction function! NERDTreeFocus() if g:NERDTree.IsOpen() - call g:NERDTree.CursorToTreeWin() + call g:NERDTree.CursorToTreeWin(0) else call g:NERDTreeCreator.ToggleTabTree('') endif diff --git a/_vim/.vim/plugged/nerdtree/syntax/nerdtree.vim b/_vim/.vim/plugged/nerdtree/syntax/nerdtree.vim index df0c804..c4197ee 100644 --- a/_vim/.vim/plugged/nerdtree/syntax/nerdtree.vim +++ b/_vim/.vim/plugged/nerdtree/syntax/nerdtree.vim @@ -22,7 +22,7 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir "highlighting to conceal the delimiter around the file/dir name if has('conceal') exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL' - setlocal conceallevel=3 concealcursor=nvic + setlocal conceallevel=2 concealcursor=nvic else exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL' hi! link NERDTreeNodeDelimiters Ignore @@ -36,23 +36,23 @@ if g:NERDTreeDirArrowExpandable !=# '' exec 'syn match NERDTreeOpenable #' . escape(g:NERDTreeDirArrowExpandable, '~') . '\ze .*/# containedin=NERDTreeDir,NERDTreeFile' let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-') exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#' - exec 'syn match NERDTreeExecFile #^.*'.g:NERDTreeNodeDelimiter.'\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark' - exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile' + exec 'syn match NERDTreeExecFile #^.*'.g:NERDTreeNodeDelimiter.'\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmarkName' + exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmarkName,NERDTreeExecFile' else exec 'syn match NERDTreeDir #[^'.g:NERDTreeNodeDelimiter.']\{-}/\ze\($\|'.g:NERDTreeNodeDelimiter.'\)#' - exec 'syn match NERDTreeExecFile #[^'.g:NERDTreeNodeDelimiter.']\{-}'.g:NERDTreeNodeDelimiter.'\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark' - exec 'syn match NERDTreeFile #^.*'.g:NERDTreeNodeDelimiter.'.*[^\/]\($\|'.g:NERDTreeNodeDelimiter.'.*\)# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile' + exec 'syn match NERDTreeExecFile #[^'.g:NERDTreeNodeDelimiter.']\{-}'.g:NERDTreeNodeDelimiter.'\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmarkName' + exec 'syn match NERDTreeFile #^.*'.g:NERDTreeNodeDelimiter.'.*[^\/]\($\|'.g:NERDTreeNodeDelimiter.'.*\)# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmarkName,NERDTreeExecFile' endif "highlighting for readonly files -exec 'syn match NERDTreeRO #.*'.g:NERDTreeNodeDelimiter.'\zs.*\ze'.g:NERDTreeNodeDelimiter.'.*\['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile' +exec 'syn match NERDTreeRO #.*'.g:NERDTreeNodeDelimiter.'\zs.*\ze'.g:NERDTreeNodeDelimiter.'.*\['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmarkName,NERDTreeFile' -exec 'syn match NERDTreeFlags #\[[^\]]*\]\ze'.g:NERDTreeNodeDelimiter.'# containedin=NERDTreeFile,NERDTreeExecFile,NERDTreeDir' +exec 'syn match NERDTreeFlags #\[[^\]]*\]\ze'.g:NERDTreeNodeDelimiter.'# containedin=NERDTreeFile,NERDTreeExecFile,NERDTreeLinkFile,NERDTreeRO,NERDTreeDir' syn match NERDTreeCWD #^[# @@ -93,3 +93,5 @@ hi def link NERDTreeBookmark Statement hi def link NERDTreeFlags Number hi def link NERDTreeCurrentNode Search + +hi NERDTreeFile ctermbg=NONE guibg=NONE diff --git a/_vim/.vim/plugged/vim-airline-themes/.github/workflows/ci.yml b/_vim/.vim/plugged/vim-airline-themes/.github/workflows/ci.yml new file mode 100644 index 0000000..ea54c54 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +on: + push: + branches: + - master + pull_request: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + vim: + - v8.2.2000 + - v8.2.1000 + - v8.2.0000 + - v8.1.0000 + - v8.0.0000 + + steps: + - name: Checkout code + uses: actions/checkout@main + + - name: Setup Vim + uses: rhysd/action-setup-vim@v1 + with: + version: ${{ matrix.vim }} + + - name: Install Dependencies + run: | + git clone https://github.com/junegunn/vader.vim.git + git clone https://github.com/vim-airline/vim-airline + find $PWD/autoload/airline/themes -name "*.vim" > themes.txt + - name: Run Test + run: | + vim --not-a-term -Nu <(cat << VIMRC + filetype off + set rtp+=vader.vim + set rtp+=vim-airline + set rtp+=. + set rtp+=after + filetype plugin indent on + syntax enable + VIMRC) -c 'Vader! test/*' > /dev/null diff --git a/_vim/.vim/plugged/vim-airline-themes/LICENSE b/_vim/.vim/plugged/vim-airline-themes/LICENSE index e9e858c..7802547 100644 --- a/_vim/.vim/plugged/vim-airline-themes/LICENSE +++ b/_vim/.vim/plugged/vim-airline-themes/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (C) 2013-2020 Bailey Ling & Contributors. +Copyright (C) 2013-2021 Bailey Ling & Contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/_vim/.vim/plugged/vim-airline-themes/README.md b/_vim/.vim/plugged/vim-airline-themes/README.md index a92c084..4a37cb0 100644 --- a/_vim/.vim/plugged/vim-airline-themes/README.md +++ b/_vim/.vim/plugged/vim-airline-themes/README.md @@ -46,7 +46,7 @@ If you are interested in becoming the official maintainer of this project, pleas # License -MIT License. Copyright (c) 2013-2020 Bailey Ling & Contributors. +MIT License. Copyright (c) 2013-2021 Bailey Ling & Contributors. [1]: https://github.com/bling diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/apprentice.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/apprentice.vim new file mode 100644 index 0000000..5eca56d --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/apprentice.vim @@ -0,0 +1,84 @@ +" vim-airline theme for Apprentice +" +" Author: pt307 (based on work by romainl) +" License: MIT License + +let s:almost_black = [ '#1c1c1c', 234 ] +let s:darker_grey = [ '#262626', 235 ] +let s:medium_grey = [ '#585858', 240 ] +let s:lighter_grey = [ '#bcbcbc', 250 ] +let s:light_purple = [ '#8787af', 103 ] +let s:light_green = [ '#87af87', 108 ] +let s:green = [ '#5f875f', 65 ] +let s:light_blue = [ '#87afd7', 110 ] +let s:red = [ '#af5f5f', 131 ] +let s:orange = [ '#ff8700', 208 ] +let s:ocre = [ '#87875f', 101 ] +let s:yellow = [ '#ffffaf', 229 ] + +function! s:color_list(fg, bg) abort + return [a:fg[0], a:bg[0], a:fg[1], a:bg[1]] +endfunction + +let g:airline#themes#apprentice#palette = {} + +let s:modified = { + \ 'airline_c': s:color_list(s:orange, '') + \ } +let s:warning = s:color_list(s:darker_grey, s:orange) +let s:error = s:color_list(s:darker_grey, s:red) + +let s:airline_a_normal = s:color_list(s:darker_grey, s:ocre) +let s:airline_b_normal = s:color_list(s:darker_grey, s:medium_grey) +let s:airline_c_normal = s:color_list(s:lighter_grey, s:darker_grey) +let g:airline#themes#apprentice#palette.normal = airline#themes#generate_color_map(s:airline_a_normal, s:airline_b_normal, s:airline_c_normal) +let g:airline#themes#apprentice#palette.normal_modified = s:modified +let g:airline#themes#apprentice#palette.normal.airline_warning = s:warning +let g:airline#themes#apprentice#palette.normal_modified.airline_warning = s:warning +let g:airline#themes#apprentice#palette.normal.airline_error = s:error +let g:airline#themes#apprentice#palette.normal_modified.airline_error = s:error + +let s:airline_a_insert = s:color_list(s:darker_grey, s:green) +let s:airline_b_insert = s:airline_b_normal +let s:airline_c_insert = s:airline_c_normal +let g:airline#themes#apprentice#palette.insert = airline#themes#generate_color_map(s:airline_a_insert, s:airline_b_insert, s:airline_c_insert) +let g:airline#themes#apprentice#palette.insert_modified = s:modified +let g:airline#themes#apprentice#palette.insert.airline_warning = s:warning +let g:airline#themes#apprentice#palette.insert_modified.airline_warning = s:warning +let g:airline#themes#apprentice#palette.insert.airline_error = s:error +let g:airline#themes#apprentice#palette.insert_modified.airline_error = s:error + +let s:airline_a_replace = s:color_list(s:darker_grey, s:red) +let s:airline_b_replace = s:airline_b_normal +let s:airline_c_replace = s:airline_c_normal +let g:airline#themes#apprentice#palette.replace = airline#themes#generate_color_map(s:airline_a_replace, s:airline_b_replace, s:airline_c_replace) +let g:airline#themes#apprentice#palette.replace_modified = s:modified +let g:airline#themes#apprentice#palette.replace.airline_warning = s:warning +let g:airline#themes#apprentice#palette.replace_modified.airline_warning = s:warning +let g:airline#themes#apprentice#palette.replace.airline_error = s:error +let g:airline#themes#apprentice#palette.replace_modified.airline_error = s:error + +let s:airline_a_visual = s:color_list(s:darker_grey, s:yellow) +let s:airline_b_visual = s:airline_b_normal +let s:airline_c_visual = s:airline_c_normal +let g:airline#themes#apprentice#palette.visual = airline#themes#generate_color_map(s:airline_a_visual, s:airline_b_visual, s:airline_c_visual) +let g:airline#themes#apprentice#palette.visual_modified = s:modified +let g:airline#themes#apprentice#palette.visual.airline_warning = s:warning +let g:airline#themes#apprentice#palette.visual_modified.airline_warning = s:warning +let g:airline#themes#apprentice#palette.visual.airline_error = s:error +let g:airline#themes#apprentice#palette.visual_modified.airline_error = s:error + +let s:airline_a_inactive = s:color_list(s:darker_grey, s:medium_grey) +let s:airline_b_inactive = s:color_list(s:medium_grey, s:darker_grey) +let s:airline_c_inactive = s:airline_b_inactive +let g:airline#themes#apprentice#palette.inactive = airline#themes#generate_color_map(s:airline_a_inactive, s:airline_b_inactive, s:airline_c_inactive) +let g:airline#themes#apprentice#palette.inactive_modified = s:modified + +let g:airline#themes#apprentice#palette.accents = { + \ 'orange': s:color_list(s:orange, ''), + \ 'blue': s:color_list(s:light_blue, ''), + \ 'green': s:color_list(s:light_green, ''), + \ 'purple': s:color_list(s:light_purple, ''), + \ 'yellow': s:color_list(s:yellow, ''), + \ 'red': s:color_list(s:red, '') + \ } diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/atomic.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/atomic.vim index 7e2bc6e..58c3ee7 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/atomic.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/atomic.vim @@ -7,7 +7,7 @@ " "---------------------------------------------------------------- " Theme : Atomic -" Version : 2.0.0 +" Version : 2.1.0 " License : MIT " Author : Gerard Bajona " URL : https://github.com/gerardbm/atomic @@ -71,8 +71,6 @@ function! airline#themes#atomic#refresh() " Settings let g:airline_symbols.paste = 'Ξ' let g:airline_symbols.spell = 'S' - let g:airline_section_z = airline#section#create(['--%1p%%-- ', - \ '%#__accent_bold#%l%#__restore__#', ':%c']) endfunction diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/badwolf.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/badwolf.vim index e2b9006..7f954f4 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/badwolf.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/badwolf.vim @@ -50,3 +50,7 @@ let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_ma let g:airline#themes#badwolf#palette.inactive_modified = { \ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] } +let g:airline#themes#badwolf#palette.terminal = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#badwolf#palette.normal_modified.airline_term = s:N3 +let g:airline#themes#badwolf#palette.terminal.airline_term = s:I3 +let g:airline#themes#badwolf#palette.visual_modified.airline_term = s:V2 diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16.vim index 0a7b442..e967ed1 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16.vim @@ -92,7 +92,7 @@ else \ } let s:I1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffAdded', 'fg'], 'bold') - let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg']) + let s:I2 = s:N2 let s:I3 = s:N3 let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified @@ -104,7 +104,7 @@ else let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified let s:V1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['Constant', 'fg'], 'bold') - let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg']) + let s:V2 = s:N2 let s:V3 = s:N3 let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_cave.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_cave.vim new file mode 100644 index 0000000..2da3d60 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_cave.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Cave vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-cave", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#19171c' +let s:gui01 = '#26232a' +let s:gui02 = '#585260' +let s:gui03 = '#655f6d' +let s:gui04 = '#7e7887' +let s:gui05 = '#8b8792' +let s:gui06 = '#e2dfe7' +let s:gui07 = '#efecf4' +let s:gui08 = '#be4678' +let s:gui09 = '#aa573c' +let s:gui0A = '#a06e3b' +let s:gui0B = '#2a9292' +let s:gui0C = '#398bc6' +let s:gui0D = '#576ddb' +let s:gui0E = '#955ae7' +let s:gui0F = '#bf40bf' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_cave_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_cave_light.vim new file mode 100644 index 0000000..3066f5e --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_cave_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Cave Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-cave-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#efecf4' +let s:gui01 = '#e2dfe7' +let s:gui02 = '#8b8792' +let s:gui03 = '#7e7887' +let s:gui04 = '#655f6d' +let s:gui05 = '#585260' +let s:gui06 = '#26232a' +let s:gui07 = '#19171c' +let s:gui08 = '#be4678' +let s:gui09 = '#aa573c' +let s:gui0A = '#a06e3b' +let s:gui0B = '#2a9292' +let s:gui0C = '#398bc6' +let s:gui0D = '#576ddb' +let s:gui0E = '#955ae7' +let s:gui0F = '#bf40bf' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_dune.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_dune.vim new file mode 100644 index 0000000..54941f9 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_dune.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Dune vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-dune", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#20201d' +let s:gui01 = '#292824' +let s:gui02 = '#6e6b5e' +let s:gui03 = '#7d7a68' +let s:gui04 = '#999580' +let s:gui05 = '#a6a28c' +let s:gui06 = '#e8e4cf' +let s:gui07 = '#fefbec' +let s:gui08 = '#d73737' +let s:gui09 = '#b65611' +let s:gui0A = '#ae9513' +let s:gui0B = '#60ac39' +let s:gui0C = '#1fad83' +let s:gui0D = '#6684e1' +let s:gui0E = '#b854d4' +let s:gui0F = '#d43552' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_dune_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_dune_light.vim new file mode 100644 index 0000000..4f724fc --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_dune_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Dune Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-dune-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#fefbec' +let s:gui01 = '#e8e4cf' +let s:gui02 = '#a6a28c' +let s:gui03 = '#999580' +let s:gui04 = '#7d7a68' +let s:gui05 = '#6e6b5e' +let s:gui06 = '#292824' +let s:gui07 = '#20201d' +let s:gui08 = '#d73737' +let s:gui09 = '#b65611' +let s:gui0A = '#ae9513' +let s:gui0B = '#60ac39' +let s:gui0C = '#1fad83' +let s:gui0D = '#6684e1' +let s:gui0E = '#b854d4' +let s:gui0F = '#d43552' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_estuary.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_estuary.vim new file mode 100644 index 0000000..9ab570c --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_estuary.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Estuary vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-estuary", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#22221b' +let s:gui01 = '#302f27' +let s:gui02 = '#5f5e4e' +let s:gui03 = '#6c6b5a' +let s:gui04 = '#878573' +let s:gui05 = '#929181' +let s:gui06 = '#e7e6df' +let s:gui07 = '#f4f3ec' +let s:gui08 = '#ba6236' +let s:gui09 = '#ae7313' +let s:gui0A = '#a5980d' +let s:gui0B = '#7d9726' +let s:gui0C = '#5b9d48' +let s:gui0D = '#36a166' +let s:gui0E = '#5f9182' +let s:gui0F = '#9d6c7c' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_estuary_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_estuary_light.vim new file mode 100644 index 0000000..2b85f4d --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_estuary_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Estuary Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-estuary-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f4f3ec' +let s:gui01 = '#e7e6df' +let s:gui02 = '#929181' +let s:gui03 = '#878573' +let s:gui04 = '#6c6b5a' +let s:gui05 = '#5f5e4e' +let s:gui06 = '#302f27' +let s:gui07 = '#22221b' +let s:gui08 = '#ba6236' +let s:gui09 = '#ae7313' +let s:gui0A = '#a5980d' +let s:gui0B = '#7d9726' +let s:gui0C = '#5b9d48' +let s:gui0D = '#36a166' +let s:gui0E = '#5f9182' +let s:gui0F = '#9d6c7c' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_forest.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_forest.vim new file mode 100644 index 0000000..d8bbe26 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_forest.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Forest vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-forest", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1b1918' +let s:gui01 = '#2c2421' +let s:gui02 = '#68615e' +let s:gui03 = '#766e6b' +let s:gui04 = '#9c9491' +let s:gui05 = '#a8a19f' +let s:gui06 = '#e6e2e0' +let s:gui07 = '#f1efee' +let s:gui08 = '#f22c40' +let s:gui09 = '#df5320' +let s:gui0A = '#c38418' +let s:gui0B = '#7b9726' +let s:gui0C = '#3d97b8' +let s:gui0D = '#407ee7' +let s:gui0E = '#6666ea' +let s:gui0F = '#c33ff3' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_forest_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_forest_light.vim new file mode 100644 index 0000000..d86af1c --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_forest_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Forest Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-forest-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f1efee' +let s:gui01 = '#e6e2e0' +let s:gui02 = '#a8a19f' +let s:gui03 = '#9c9491' +let s:gui04 = '#766e6b' +let s:gui05 = '#68615e' +let s:gui06 = '#2c2421' +let s:gui07 = '#1b1918' +let s:gui08 = '#f22c40' +let s:gui09 = '#df5320' +let s:gui0A = '#c38418' +let s:gui0B = '#7b9726' +let s:gui0C = '#3d97b8' +let s:gui0D = '#407ee7' +let s:gui0E = '#6666ea' +let s:gui0F = '#c33ff3' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_heath.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_heath.vim new file mode 100644 index 0000000..ca21708 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_heath.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Heath vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-heath", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1b181b' +let s:gui01 = '#292329' +let s:gui02 = '#695d69' +let s:gui03 = '#776977' +let s:gui04 = '#9e8f9e' +let s:gui05 = '#ab9bab' +let s:gui06 = '#d8cad8' +let s:gui07 = '#f7f3f7' +let s:gui08 = '#ca402b' +let s:gui09 = '#a65926' +let s:gui0A = '#bb8a35' +let s:gui0B = '#918b3b' +let s:gui0C = '#159393' +let s:gui0D = '#516aec' +let s:gui0E = '#7b59c0' +let s:gui0F = '#cc33cc' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_heath_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_heath_light.vim new file mode 100644 index 0000000..d616a79 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_heath_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Heath Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-heath-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f7f3f7' +let s:gui01 = '#d8cad8' +let s:gui02 = '#ab9bab' +let s:gui03 = '#9e8f9e' +let s:gui04 = '#776977' +let s:gui05 = '#695d69' +let s:gui06 = '#292329' +let s:gui07 = '#1b181b' +let s:gui08 = '#ca402b' +let s:gui09 = '#a65926' +let s:gui0A = '#bb8a35' +let s:gui0B = '#918b3b' +let s:gui0C = '#159393' +let s:gui0D = '#516aec' +let s:gui0E = '#7b59c0' +let s:gui0F = '#cc33cc' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_lakeside.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_lakeside.vim new file mode 100644 index 0000000..76e196c --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_lakeside.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Lakeside vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-lakeside", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#161b1d' +let s:gui01 = '#1f292e' +let s:gui02 = '#516d7b' +let s:gui03 = '#5a7b8c' +let s:gui04 = '#7195a8' +let s:gui05 = '#7ea2b4' +let s:gui06 = '#c1e4f6' +let s:gui07 = '#ebf8ff' +let s:gui08 = '#d22d72' +let s:gui09 = '#935c25' +let s:gui0A = '#8a8a0f' +let s:gui0B = '#568c3b' +let s:gui0C = '#2d8f6f' +let s:gui0D = '#257fad' +let s:gui0E = '#6b6bb8' +let s:gui0F = '#b72dd2' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_lakeside_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_lakeside_light.vim new file mode 100644 index 0000000..ed58b0b --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_lakeside_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Lakeside Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-lakeside-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#ebf8ff' +let s:gui01 = '#c1e4f6' +let s:gui02 = '#7ea2b4' +let s:gui03 = '#7195a8' +let s:gui04 = '#5a7b8c' +let s:gui05 = '#516d7b' +let s:gui06 = '#1f292e' +let s:gui07 = '#161b1d' +let s:gui08 = '#d22d72' +let s:gui09 = '#935c25' +let s:gui0A = '#8a8a0f' +let s:gui0B = '#568c3b' +let s:gui0C = '#2d8f6f' +let s:gui0D = '#257fad' +let s:gui0E = '#6b6bb8' +let s:gui0F = '#b72dd2' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_plateau.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_plateau.vim new file mode 100644 index 0000000..1ce85ff --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_plateau.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Plateau vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-plateau", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1b1818' +let s:gui01 = '#292424' +let s:gui02 = '#585050' +let s:gui03 = '#655d5d' +let s:gui04 = '#7e7777' +let s:gui05 = '#8a8585' +let s:gui06 = '#e7dfdf' +let s:gui07 = '#f4ecec' +let s:gui08 = '#ca4949' +let s:gui09 = '#b45a3c' +let s:gui0A = '#a06e3b' +let s:gui0B = '#4b8b8b' +let s:gui0C = '#5485b6' +let s:gui0D = '#7272ca' +let s:gui0E = '#8464c4' +let s:gui0F = '#bd5187' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_plateau_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_plateau_light.vim new file mode 100644 index 0000000..a6f8350 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_plateau_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Plateau Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-plateau-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f4ecec' +let s:gui01 = '#e7dfdf' +let s:gui02 = '#8a8585' +let s:gui03 = '#7e7777' +let s:gui04 = '#655d5d' +let s:gui05 = '#585050' +let s:gui06 = '#292424' +let s:gui07 = '#1b1818' +let s:gui08 = '#ca4949' +let s:gui09 = '#b45a3c' +let s:gui0A = '#a06e3b' +let s:gui0B = '#4b8b8b' +let s:gui0C = '#5485b6' +let s:gui0D = '#7272ca' +let s:gui0E = '#8464c4' +let s:gui0F = '#bd5187' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_savanna.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_savanna.vim new file mode 100644 index 0000000..c6a6597 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_savanna.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Savanna vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-savanna", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#171c19' +let s:gui01 = '#232a25' +let s:gui02 = '#526057' +let s:gui03 = '#5f6d64' +let s:gui04 = '#78877d' +let s:gui05 = '#87928a' +let s:gui06 = '#dfe7e2' +let s:gui07 = '#ecf4ee' +let s:gui08 = '#b16139' +let s:gui09 = '#9f713c' +let s:gui0A = '#a07e3b' +let s:gui0B = '#489963' +let s:gui0C = '#1c9aa0' +let s:gui0D = '#478c90' +let s:gui0E = '#55859b' +let s:gui0F = '#867469' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_savanna_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_savanna_light.vim new file mode 100644 index 0000000..f98bbc8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_savanna_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Savanna Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-savanna-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#ecf4ee' +let s:gui01 = '#dfe7e2' +let s:gui02 = '#87928a' +let s:gui03 = '#78877d' +let s:gui04 = '#5f6d64' +let s:gui05 = '#526057' +let s:gui06 = '#232a25' +let s:gui07 = '#171c19' +let s:gui08 = '#b16139' +let s:gui09 = '#9f713c' +let s:gui0A = '#a07e3b' +let s:gui0B = '#489963' +let s:gui0C = '#1c9aa0' +let s:gui0D = '#478c90' +let s:gui0E = '#55859b' +let s:gui0F = '#867469' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_seaside.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_seaside.vim new file mode 100644 index 0000000..61b19e0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_seaside.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Seaside vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-seaside", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#131513' +let s:gui01 = '#242924' +let s:gui02 = '#5e6e5e' +let s:gui03 = '#687d68' +let s:gui04 = '#809980' +let s:gui05 = '#8ca68c' +let s:gui06 = '#cfe8cf' +let s:gui07 = '#f4fbf4' +let s:gui08 = '#e6193c' +let s:gui09 = '#87711d' +let s:gui0A = '#98981b' +let s:gui0B = '#29a329' +let s:gui0C = '#1999b3' +let s:gui0D = '#3d62f5' +let s:gui0E = '#ad2bee' +let s:gui0F = '#e619c3' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_seaside_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_seaside_light.vim new file mode 100644 index 0000000..fc8a933 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_seaside_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Seaside Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-seaside-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f4fbf4' +let s:gui01 = '#cfe8cf' +let s:gui02 = '#8ca68c' +let s:gui03 = '#809980' +let s:gui04 = '#687d68' +let s:gui05 = '#5e6e5e' +let s:gui06 = '#242924' +let s:gui07 = '#131513' +let s:gui08 = '#e6193c' +let s:gui09 = '#87711d' +let s:gui0A = '#98981b' +let s:gui0B = '#29a329' +let s:gui0C = '#1999b3' +let s:gui0D = '#3d62f5' +let s:gui0E = '#ad2bee' +let s:gui0F = '#e619c3' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_sulphurpool.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_sulphurpool.vim new file mode 100644 index 0000000..90aff17 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_sulphurpool.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Sulphurpool vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-sulphurpool", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#202746' +let s:gui01 = '#293256' +let s:gui02 = '#5e6687' +let s:gui03 = '#6b7394' +let s:gui04 = '#898ea4' +let s:gui05 = '#979db4' +let s:gui06 = '#dfe2f1' +let s:gui07 = '#f5f7ff' +let s:gui08 = '#c94922' +let s:gui09 = '#c76b29' +let s:gui0A = '#c08b30' +let s:gui0B = '#ac9739' +let s:gui0C = '#22a2c9' +let s:gui0D = '#3d8fd1' +let s:gui0E = '#6679cc' +let s:gui0F = '#9c637a' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_sulphurpool_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_sulphurpool_light.vim new file mode 100644 index 0000000..8169547 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atelier_sulphurpool_light.vim @@ -0,0 +1,85 @@ +" Base16 Atelier Sulphurpool Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Bram de Haan (http://atelierbramdehaan.nl) + +let s:scheme_slug = substitute("atelier-sulphurpool-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f5f7ff' +let s:gui01 = '#dfe2f1' +let s:gui02 = '#979db4' +let s:gui03 = '#898ea4' +let s:gui04 = '#6b7394' +let s:gui05 = '#5e6687' +let s:gui06 = '#293256' +let s:gui07 = '#202746' +let s:gui08 = '#c94922' +let s:gui09 = '#c76b29' +let s:gui0A = '#c08b30' +let s:gui0B = '#ac9739' +let s:gui0C = '#22a2c9' +let s:gui0D = '#3d8fd1' +let s:gui0E = '#6679cc' +let s:gui0F = '#9c637a' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atlas.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atlas.vim new file mode 100644 index 0000000..cb4f9f0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_atlas.vim @@ -0,0 +1,85 @@ +" Base16 Atlas vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Alex Lende (https://ajlende.com) + +let s:scheme_slug = substitute("atlas", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#002635' +let s:gui01 = '#00384d' +let s:gui02 = '#517F8D' +let s:gui03 = '#6C8B91' +let s:gui04 = '#869696' +let s:gui05 = '#a1a19a' +let s:gui06 = '#e6e6dc' +let s:gui07 = '#fafaf8' +let s:gui08 = '#ff5a67' +let s:gui09 = '#f08e48' +let s:gui0A = '#ffcc1b' +let s:gui0B = '#7fc06e' +let s:gui0C = '#14747e' +let s:gui0D = '#5dd7b9' +let s:gui0E = '#9a70a4' +let s:gui0F = '#c43060' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal.vim new file mode 100644 index 0000000..dccb2bc --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#a06666' +let s:gui0B = '#dd9999' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_bathory.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_bathory.vim new file mode 100644 index 0000000..c8c403f --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_bathory.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Bathory) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-bathory", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#e78a53' +let s:gui0B = '#fbcb97' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_burzum.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_burzum.vim new file mode 100644 index 0000000..1d292d9 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_burzum.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Burzum) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-burzum", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#99bbaa' +let s:gui0B = '#ddeecc' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_dark_funeral.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_dark_funeral.vim new file mode 100644 index 0000000..9d39565 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_dark_funeral.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Dark Funeral) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-dark-funeral", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#5f81a5' +let s:gui0B = '#d0dfee' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_gorgoroth.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_gorgoroth.vim new file mode 100644 index 0000000..ab9bda4 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_gorgoroth.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Gorgoroth) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-gorgoroth", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#8c7f70' +let s:gui0B = '#9b8d7f' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_immortal.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_immortal.vim new file mode 100644 index 0000000..97779d6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_immortal.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Immortal) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-immortal", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#556677' +let s:gui0B = '#7799bb' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_khold.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_khold.vim new file mode 100644 index 0000000..65e909f --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_khold.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Khold) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-khold", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#974b46' +let s:gui0B = '#eceee3' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_marduk.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_marduk.vim new file mode 100644 index 0000000..25773e8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_marduk.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Marduk) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-marduk", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#626b67' +let s:gui0B = '#a5aaa7' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_mayhem.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_mayhem.vim new file mode 100644 index 0000000..28ffa24 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_mayhem.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Mayhem) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-mayhem", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#eecc6c' +let s:gui0B = '#f3ecd4' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_nile.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_nile.vim new file mode 100644 index 0000000..fc013de --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_nile.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Nile) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-nile", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#777755' +let s:gui0B = '#aa9988' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_venom.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_venom.vim new file mode 100644 index 0000000..f18117a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_black_metal_venom.vim @@ -0,0 +1,85 @@ +" Base16 Black Metal (Venom) vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By metalelf0 (https://github.com/metalelf0) + +let s:scheme_slug = substitute("black-metal-venom", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#121212' +let s:gui02 = '#222222' +let s:gui03 = '#333333' +let s:gui04 = '#999999' +let s:gui05 = '#c1c1c1' +let s:gui06 = '#999999' +let s:gui07 = '#c1c1c1' +let s:gui08 = '#5f8787' +let s:gui09 = '#aaaaaa' +let s:gui0A = '#79241f' +let s:gui0B = '#f8f7f2' +let s:gui0C = '#aaaaaa' +let s:gui0D = '#888888' +let s:gui0E = '#999999' +let s:gui0F = '#444444' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brogrammer.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brogrammer.vim new file mode 100644 index 0000000..2acba36 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brogrammer.vim @@ -0,0 +1,85 @@ +" Base16 Brogrammer vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Vik Ramanujam (http://github.com/piggyslasher) + +let s:scheme_slug = substitute("brogrammer", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1f1f1f' +let s:gui01 = '#f81118' +let s:gui02 = '#2dc55e' +let s:gui03 = '#ecba0f' +let s:gui04 = '#2a84d2' +let s:gui05 = '#4e5ab7' +let s:gui06 = '#1081d6' +let s:gui07 = '#d6dbe5' +let s:gui08 = '#d6dbe5' +let s:gui09 = '#de352e' +let s:gui0A = '#1dd361' +let s:gui0B = '#f3bd09' +let s:gui0C = '#1081d6' +let s:gui0D = '#5350b9' +let s:gui0E = '#0f7ddb' +let s:gui0F = '#ffffff' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brushtrees.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brushtrees.vim new file mode 100644 index 0000000..3c21950 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brushtrees.vim @@ -0,0 +1,85 @@ +" Base16 Brush Trees vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Abraham White <abelincoln.white@gmail.com> + +let s:scheme_slug = substitute("brushtrees", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#E3EFEF' +let s:gui01 = '#C9DBDC' +let s:gui02 = '#B0C5C8' +let s:gui03 = '#98AFB5' +let s:gui04 = '#8299A1' +let s:gui05 = '#6D828E' +let s:gui06 = '#5A6D7A' +let s:gui07 = '#485867' +let s:gui08 = '#b38686' +let s:gui09 = '#d8bba2' +let s:gui0A = '#aab386' +let s:gui0B = '#87b386' +let s:gui0C = '#86b3b3' +let s:gui0D = '#868cb3' +let s:gui0E = '#b386b2' +let s:gui0F = '#b39f9f' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brushtrees_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brushtrees_dark.vim new file mode 100644 index 0000000..1c3127a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_brushtrees_dark.vim @@ -0,0 +1,85 @@ +" Base16 Brush Trees Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Abraham White <abelincoln.white@gmail.com> + +let s:scheme_slug = substitute("brushtrees-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#485867' +let s:gui01 = '#5A6D7A' +let s:gui02 = '#6D828E' +let s:gui03 = '#8299A1' +let s:gui04 = '#98AFB5' +let s:gui05 = '#B0C5C8' +let s:gui06 = '#C9DBDC' +let s:gui07 = '#E3EFEF' +let s:gui08 = '#b38686' +let s:gui09 = '#d8bba2' +let s:gui0A = '#aab386' +let s:gui0B = '#87b386' +let s:gui0C = '#86b3b3' +let s:gui0D = '#868cb3' +let s:gui0E = '#b386b2' +let s:gui0F = '#b39f9f' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_circus.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_circus.vim new file mode 100644 index 0000000..82d58d0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_circus.vim @@ -0,0 +1,85 @@ +" Base16 Circus vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Stephan Boyer (https://github.com/stepchowfun) and Esther Wang (https://github.com/ewang12) + +let s:scheme_slug = substitute("circus", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#191919' +let s:gui01 = '#202020' +let s:gui02 = '#303030' +let s:gui03 = '#5f5a60' +let s:gui04 = '#505050' +let s:gui05 = '#a7a7a7' +let s:gui06 = '#808080' +let s:gui07 = '#ffffff' +let s:gui08 = '#dc657d' +let s:gui09 = '#4bb1a7' +let s:gui0A = '#c3ba63' +let s:gui0B = '#84b97c' +let s:gui0C = '#4bb1a7' +let s:gui0D = '#639ee4' +let s:gui0E = '#b888e2' +let s:gui0F = '#b888e2' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_classic_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_classic_dark.vim new file mode 100644 index 0000000..5a8dc5e --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_classic_dark.vim @@ -0,0 +1,85 @@ +" Base16 Classic Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jason Heeris (http://heeris.id.au) + +let s:scheme_slug = substitute("classic-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#151515' +let s:gui01 = '#202020' +let s:gui02 = '#303030' +let s:gui03 = '#505050' +let s:gui04 = '#B0B0B0' +let s:gui05 = '#D0D0D0' +let s:gui06 = '#E0E0E0' +let s:gui07 = '#F5F5F5' +let s:gui08 = '#AC4142' +let s:gui09 = '#D28445' +let s:gui0A = '#F4BF75' +let s:gui0B = '#90A959' +let s:gui0C = '#75B5AA' +let s:gui0D = '#6A9FB5' +let s:gui0E = '#AA759F' +let s:gui0F = '#8F5536' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_classic_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_classic_light.vim new file mode 100644 index 0000000..62102b8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_classic_light.vim @@ -0,0 +1,85 @@ +" Base16 Classic Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jason Heeris (http://heeris.id.au) + +let s:scheme_slug = substitute("classic-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#F5F5F5' +let s:gui01 = '#E0E0E0' +let s:gui02 = '#D0D0D0' +let s:gui03 = '#B0B0B0' +let s:gui04 = '#505050' +let s:gui05 = '#303030' +let s:gui06 = '#202020' +let s:gui07 = '#151515' +let s:gui08 = '#AC4142' +let s:gui09 = '#D28445' +let s:gui0A = '#F4BF75' +let s:gui0B = '#90A959' +let s:gui0C = '#75B5AA' +let s:gui0D = '#6A9FB5' +let s:gui0E = '#AA759F' +let s:gui0F = '#8F5536' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_cupcake.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_cupcake.vim new file mode 100644 index 0000000..5c7167a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_cupcake.vim @@ -0,0 +1,85 @@ +" Base16 Cupcake vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Chris Kempson (http://chriskempson.com) + +let s:scheme_slug = substitute("cupcake", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#fbf1f2' +let s:gui01 = '#f2f1f4' +let s:gui02 = '#d8d5dd' +let s:gui03 = '#bfb9c6' +let s:gui04 = '#a59daf' +let s:gui05 = '#8b8198' +let s:gui06 = '#72677E' +let s:gui07 = '#585062' +let s:gui08 = '#D57E85' +let s:gui09 = '#EBB790' +let s:gui0A = '#DCB16C' +let s:gui0B = '#A3B367' +let s:gui0C = '#69A9A7' +let s:gui0D = '#7297B9' +let s:gui0E = '#BB99B4' +let s:gui0F = '#BAA58C' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_cupertino.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_cupertino.vim new file mode 100644 index 0000000..1b4622b --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_cupertino.vim @@ -0,0 +1,85 @@ +" Base16 Cupertino vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Defman21 + +let s:scheme_slug = substitute("cupertino", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#ffffff' +let s:gui01 = '#c0c0c0' +let s:gui02 = '#c0c0c0' +let s:gui03 = '#808080' +let s:gui04 = '#808080' +let s:gui05 = '#404040' +let s:gui06 = '#404040' +let s:gui07 = '#5e5e5e' +let s:gui08 = '#c41a15' +let s:gui09 = '#eb8500' +let s:gui0A = '#826b28' +let s:gui0B = '#007400' +let s:gui0C = '#318495' +let s:gui0D = '#0000ff' +let s:gui0E = '#a90d91' +let s:gui0F = '#826b28' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_darktooth.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_darktooth.vim new file mode 100644 index 0000000..862b98f --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_darktooth.vim @@ -0,0 +1,85 @@ +" Base16 Darktooth vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jason Milkins (https://github.com/jasonm23) + +let s:scheme_slug = substitute("darktooth", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1D2021' +let s:gui01 = '#32302F' +let s:gui02 = '#504945' +let s:gui03 = '#665C54' +let s:gui04 = '#928374' +let s:gui05 = '#A89984' +let s:gui06 = '#D5C4A1' +let s:gui07 = '#FDF4C1' +let s:gui08 = '#FB543F' +let s:gui09 = '#FE8625' +let s:gui0A = '#FAC03B' +let s:gui0B = '#95C085' +let s:gui0C = '#8BA59B' +let s:gui0D = '#0D6678' +let s:gui0E = '#8F4673' +let s:gui0F = '#A87322' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_decaf.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_decaf.vim new file mode 100644 index 0000000..748b70b --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_decaf.vim @@ -0,0 +1,85 @@ +" Base16 Decaf vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Alex Mirrington (https://github.com/alexmirrington) + +let s:scheme_slug = substitute("decaf", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#2d2d2d' +let s:gui01 = '#393939' +let s:gui02 = '#515151' +let s:gui03 = '#777777' +let s:gui04 = '#b4b7b4' +let s:gui05 = '#cccccc' +let s:gui06 = '#e0e0e0' +let s:gui07 = '#ffffff' +let s:gui08 = '#ff7f7b' +let s:gui09 = '#ffbf70' +let s:gui0A = '#ffd67c' +let s:gui0B = '#beda78' +let s:gui0C = '#bed6ff' +let s:gui0D = '#90bee1' +let s:gui0E = '#efb3f7' +let s:gui0F = '#ff93b3' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_default_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_default_dark.vim new file mode 100644 index 0000000..96ccbe3 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_default_dark.vim @@ -0,0 +1,85 @@ +" Base16 Default Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Chris Kempson (http://chriskempson.com) + +let s:scheme_slug = substitute("default-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#181818' +let s:gui01 = '#282828' +let s:gui02 = '#383838' +let s:gui03 = '#585858' +let s:gui04 = '#b8b8b8' +let s:gui05 = '#d8d8d8' +let s:gui06 = '#e8e8e8' +let s:gui07 = '#f8f8f8' +let s:gui08 = '#ab4642' +let s:gui09 = '#dc9656' +let s:gui0A = '#f7ca88' +let s:gui0B = '#a1b56c' +let s:gui0C = '#86c1b9' +let s:gui0D = '#7cafc2' +let s:gui0E = '#ba8baf' +let s:gui0F = '#a16946' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_default_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_default_light.vim new file mode 100644 index 0000000..dfeb2e4 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_default_light.vim @@ -0,0 +1,85 @@ +" Base16 Default Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Chris Kempson (http://chriskempson.com) + +let s:scheme_slug = substitute("default-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f8f8f8' +let s:gui01 = '#e8e8e8' +let s:gui02 = '#d8d8d8' +let s:gui03 = '#b8b8b8' +let s:gui04 = '#585858' +let s:gui05 = '#383838' +let s:gui06 = '#282828' +let s:gui07 = '#181818' +let s:gui08 = '#ab4642' +let s:gui09 = '#dc9656' +let s:gui0A = '#f7ca88' +let s:gui0B = '#a1b56c' +let s:gui0C = '#86c1b9' +let s:gui0D = '#7cafc2' +let s:gui0E = '#ba8baf' +let s:gui0F = '#a16946' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_dracula.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_dracula.vim new file mode 100644 index 0000000..1cfdbca --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_dracula.vim @@ -0,0 +1,85 @@ +" Base16 Dracula vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula) + +let s:scheme_slug = substitute("dracula", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#282936' +let s:gui01 = '#3a3c4e' +let s:gui02 = '#4d4f68' +let s:gui03 = '#626483' +let s:gui04 = '#62d6e8' +let s:gui05 = '#e9e9f4' +let s:gui06 = '#f1f2f8' +let s:gui07 = '#f7f7fb' +let s:gui08 = '#ea51b2' +let s:gui09 = '#b45bcf' +let s:gui0A = '#00f769' +let s:gui0B = '#ebff87' +let s:gui0C = '#a1efe4' +let s:gui0D = '#62d6e8' +let s:gui0E = '#b45bcf' +let s:gui0F = '#00f769' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_edge_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_edge_dark.vim new file mode 100644 index 0000000..11e1c8b --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_edge_dark.vim @@ -0,0 +1,85 @@ +" Base16 Edge Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Sainnhepark (https://github.com/sainnhe) + +let s:scheme_slug = substitute("edge-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#262729' +let s:gui01 = '#88909f' +let s:gui02 = '#b7bec9' +let s:gui03 = '#3e4249' +let s:gui04 = '#73b3e7' +let s:gui05 = '#b7bec9' +let s:gui06 = '#d390e7' +let s:gui07 = '#3e4249' +let s:gui08 = '#e77171' +let s:gui09 = '#e77171' +let s:gui0A = '#dbb774' +let s:gui0B = '#a1bf78' +let s:gui0C = '#5ebaa5' +let s:gui0D = '#73b3e7' +let s:gui0E = '#d390e7' +let s:gui0F = '#5ebaa5' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_edge_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_edge_light.vim new file mode 100644 index 0000000..fc664ba --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_edge_light.vim @@ -0,0 +1,85 @@ +" Base16 Edge Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Sainnhepark (https://github.com/sainnhe) + +let s:scheme_slug = substitute("edge-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#fafafa' +let s:gui01 = '#7c9f4b' +let s:gui02 = '#d69822' +let s:gui03 = '#5e646f' +let s:gui04 = '#6587bf' +let s:gui05 = '#5e646f' +let s:gui06 = '#b870ce' +let s:gui07 = '#5e646f' +let s:gui08 = '#db7070' +let s:gui09 = '#db7070' +let s:gui0A = '#d69822' +let s:gui0B = '#7c9f4b' +let s:gui0C = '#509c93' +let s:gui0D = '#6587bf' +let s:gui0E = '#b870ce' +let s:gui0F = '#509c93' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_espresso.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_espresso.vim new file mode 100644 index 0000000..55843a7 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_espresso.vim @@ -0,0 +1,85 @@ +" Base16 Espresso vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Alex Mirrington (https://github.com/alexmirrington) + +let s:scheme_slug = substitute("espresso", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#2d2d2d' +let s:gui01 = '#393939' +let s:gui02 = '#515151' +let s:gui03 = '#777777' +let s:gui04 = '#b4b7b4' +let s:gui05 = '#cccccc' +let s:gui06 = '#e0e0e0' +let s:gui07 = '#ffffff' +let s:gui08 = '#d25252' +let s:gui09 = '#f9a959' +let s:gui0A = '#ffc66d' +let s:gui0B = '#a5c261' +let s:gui0C = '#bed6ff' +let s:gui0D = '#6c99bb' +let s:gui0E = '#d197d9' +let s:gui0F = '#f97394' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_framer.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_framer.vim new file mode 100644 index 0000000..338c624 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_framer.vim @@ -0,0 +1,85 @@ +" Base16 Framer vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Framer (Maintained by Jesse Hoyos) + +let s:scheme_slug = substitute("framer", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#181818' +let s:gui01 = '#151515' +let s:gui02 = '#464646' +let s:gui03 = '#747474' +let s:gui04 = '#B9B9B9' +let s:gui05 = '#D0D0D0' +let s:gui06 = '#E8E8E8' +let s:gui07 = '#EEEEEE' +let s:gui08 = '#FD886B' +let s:gui09 = '#FC4769' +let s:gui0A = '#FECB6E' +let s:gui0B = '#32CCDC' +let s:gui0C = '#ACDDFD' +let s:gui0D = '#20BCFC' +let s:gui0E = '#BA8CFC' +let s:gui0F = '#B15F4A' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_fruit_soda.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_fruit_soda.vim new file mode 100644 index 0000000..6074b49 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_fruit_soda.vim @@ -0,0 +1,85 @@ +" Base16 Fruit Soda vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By jozip + +let s:scheme_slug = substitute("fruit-soda", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f1ecf1' +let s:gui01 = '#e0dee0' +let s:gui02 = '#d8d5d5' +let s:gui03 = '#b5b4b6' +let s:gui04 = '#979598' +let s:gui05 = '#515151' +let s:gui06 = '#474545' +let s:gui07 = '#2d2c2c' +let s:gui08 = '#fe3e31' +let s:gui09 = '#fe6d08' +let s:gui0A = '#f7e203' +let s:gui0B = '#47f74c' +let s:gui0C = '#0f9cfd' +let s:gui0D = '#2931df' +let s:gui0E = '#611fce' +let s:gui0F = '#b16f40' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gigavolt.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gigavolt.vim new file mode 100644 index 0000000..6ee8651 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gigavolt.vim @@ -0,0 +1,85 @@ +" Base16 Gigavolt vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Aidan Swope (http://github.com/Whillikers) + +let s:scheme_slug = substitute("gigavolt", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#202126' +let s:gui01 = '#2d303d' +let s:gui02 = '#5a576e' +let s:gui03 = '#a1d2e6' +let s:gui04 = '#cad3ff' +let s:gui05 = '#e9e7e1' +let s:gui06 = '#eff0f9' +let s:gui07 = '#f2fbff' +let s:gui08 = '#ff661a' +let s:gui09 = '#19f988' +let s:gui0A = '#ffdc2d' +let s:gui0B = '#f2e6a9' +let s:gui0C = '#fb6acb' +let s:gui0D = '#40bfff' +let s:gui0E = '#ae94f9' +let s:gui0F = '#6187ff' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_github.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_github.vim new file mode 100644 index 0000000..03e9ce0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_github.vim @@ -0,0 +1,85 @@ +" Base16 Github vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Defman21 + +let s:scheme_slug = substitute("github", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#ffffff' +let s:gui01 = '#f5f5f5' +let s:gui02 = '#c8c8fa' +let s:gui03 = '#969896' +let s:gui04 = '#e8e8e8' +let s:gui05 = '#333333' +let s:gui06 = '#ffffff' +let s:gui07 = '#ffffff' +let s:gui08 = '#ed6a43' +let s:gui09 = '#0086b3' +let s:gui0A = '#795da3' +let s:gui0B = '#183691' +let s:gui0C = '#183691' +let s:gui0D = '#795da3' +let s:gui0E = '#a71d5d' +let s:gui0F = '#333333' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_google_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_google_dark.vim new file mode 100644 index 0000000..e710b8a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_google_dark.vim @@ -0,0 +1,85 @@ +" Base16 Google Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Seth Wright (http://sethawright.com) + +let s:scheme_slug = substitute("google-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1d1f21' +let s:gui01 = '#282a2e' +let s:gui02 = '#373b41' +let s:gui03 = '#969896' +let s:gui04 = '#b4b7b4' +let s:gui05 = '#c5c8c6' +let s:gui06 = '#e0e0e0' +let s:gui07 = '#ffffff' +let s:gui08 = '#CC342B' +let s:gui09 = '#F96A38' +let s:gui0A = '#FBA922' +let s:gui0B = '#198844' +let s:gui0C = '#3971ED' +let s:gui0D = '#3971ED' +let s:gui0E = '#A36AC7' +let s:gui0F = '#3971ED' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_google_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_google_light.vim new file mode 100644 index 0000000..08080c8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_google_light.vim @@ -0,0 +1,85 @@ +" Base16 Google Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Seth Wright (http://sethawright.com) + +let s:scheme_slug = substitute("google-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#ffffff' +let s:gui01 = '#e0e0e0' +let s:gui02 = '#c5c8c6' +let s:gui03 = '#b4b7b4' +let s:gui04 = '#969896' +let s:gui05 = '#373b41' +let s:gui06 = '#282a2e' +let s:gui07 = '#1d1f21' +let s:gui08 = '#CC342B' +let s:gui09 = '#F96A38' +let s:gui0A = '#FBA922' +let s:gui0B = '#198844' +let s:gui0C = '#3971ED' +let s:gui0D = '#3971ED' +let s:gui0E = '#A36AC7' +let s:gui0F = '#3971ED' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_grayscale_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_grayscale_dark.vim new file mode 100644 index 0000000..ac9fd37 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_grayscale_dark.vim @@ -0,0 +1,85 @@ +" Base16 Grayscale Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Alexandre Gavioli (https://github.com/Alexx2/) + +let s:scheme_slug = substitute("grayscale-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#101010' +let s:gui01 = '#252525' +let s:gui02 = '#464646' +let s:gui03 = '#525252' +let s:gui04 = '#ababab' +let s:gui05 = '#b9b9b9' +let s:gui06 = '#e3e3e3' +let s:gui07 = '#f7f7f7' +let s:gui08 = '#7c7c7c' +let s:gui09 = '#999999' +let s:gui0A = '#a0a0a0' +let s:gui0B = '#8e8e8e' +let s:gui0C = '#868686' +let s:gui0D = '#686868' +let s:gui0E = '#747474' +let s:gui0F = '#5e5e5e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_grayscale_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_grayscale_light.vim new file mode 100644 index 0000000..bac4eab --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_grayscale_light.vim @@ -0,0 +1,85 @@ +" Base16 Grayscale Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Alexandre Gavioli (https://github.com/Alexx2/) + +let s:scheme_slug = substitute("grayscale-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f7f7f7' +let s:gui01 = '#e3e3e3' +let s:gui02 = '#b9b9b9' +let s:gui03 = '#ababab' +let s:gui04 = '#525252' +let s:gui05 = '#464646' +let s:gui06 = '#252525' +let s:gui07 = '#101010' +let s:gui08 = '#7c7c7c' +let s:gui09 = '#999999' +let s:gui0A = '#a0a0a0' +let s:gui0B = '#8e8e8e' +let s:gui0C = '#868686' +let s:gui0D = '#686868' +let s:gui0E = '#747474' +let s:gui0F = '#5e5e5e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_hard.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_hard.vim index a3a5269..1880f10 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_hard.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_hard.vim @@ -60,6 +60,11 @@ let s:IA2 = [ s:gui05, s:gui01, s:cterm05, s:cterm01 ] let s:IA3 = [ s:gui05, s:gui01, s:cterm05, s:cterm01 ] let g:airline#themes#base16_gruvbox_dark_hard#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) +let g:airline#themes#base16_gruvbox_dark_hard#palette.terminal = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#base16_gruvbox_dark_hard#palette.normal.airline_term = s:N3 +let g:airline#themes#base16_gruvbox_dark_hard#palette.terminal.airline_term = s:N3 +let g:airline#themes#base16_gruvbox_dark_hard#palette.visual.airline_term = s:N3 + " Here we define the color map for ctrlp. We check for the g:loaded_ctrlp " variable so that related functionality is loaded iff the user is using " ctrlp. Note that this is optional, and if you do not define ctrlp colors diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_medium.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_medium.vim new file mode 100644 index 0000000..6be0083 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_medium.vim @@ -0,0 +1,85 @@ +" Base16 Gruvbox dark, medium vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +let s:scheme_slug = substitute("gruvbox-dark-medium", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#282828' +let s:gui01 = '#3c3836' +let s:gui02 = '#504945' +let s:gui03 = '#665c54' +let s:gui04 = '#bdae93' +let s:gui05 = '#d5c4a1' +let s:gui06 = '#ebdbb2' +let s:gui07 = '#fbf1c7' +let s:gui08 = '#fb4934' +let s:gui09 = '#fe8019' +let s:gui0A = '#fabd2f' +let s:gui0B = '#b8bb26' +let s:gui0C = '#8ec07c' +let s:gui0D = '#83a598' +let s:gui0E = '#d3869b' +let s:gui0F = '#d65d0e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_pale.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_pale.vim new file mode 100644 index 0000000..12b9eaa --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_pale.vim @@ -0,0 +1,85 @@ +" Base16 Gruvbox dark, pale vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +let s:scheme_slug = substitute("gruvbox-dark-pale", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#262626' +let s:gui01 = '#3a3a3a' +let s:gui02 = '#4e4e4e' +let s:gui03 = '#8a8a8a' +let s:gui04 = '#949494' +let s:gui05 = '#dab997' +let s:gui06 = '#d5c4a1' +let s:gui07 = '#ebdbb2' +let s:gui08 = '#d75f5f' +let s:gui09 = '#ff8700' +let s:gui0A = '#ffaf00' +let s:gui0B = '#afaf00' +let s:gui0C = '#85ad85' +let s:gui0D = '#83adad' +let s:gui0E = '#d485ad' +let s:gui0F = '#d65d0e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_soft.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_soft.vim new file mode 100644 index 0000000..c118190 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_dark_soft.vim @@ -0,0 +1,85 @@ +" Base16 Gruvbox dark, soft vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +let s:scheme_slug = substitute("gruvbox-dark-soft", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#32302f' +let s:gui01 = '#3c3836' +let s:gui02 = '#504945' +let s:gui03 = '#665c54' +let s:gui04 = '#bdae93' +let s:gui05 = '#d5c4a1' +let s:gui06 = '#ebdbb2' +let s:gui07 = '#fbf1c7' +let s:gui08 = '#fb4934' +let s:gui09 = '#fe8019' +let s:gui0A = '#fabd2f' +let s:gui0B = '#b8bb26' +let s:gui0C = '#8ec07c' +let s:gui0D = '#83a598' +let s:gui0E = '#d3869b' +let s:gui0F = '#d65d0e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_hard.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_hard.vim new file mode 100644 index 0000000..82c65af --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_hard.vim @@ -0,0 +1,85 @@ +" Base16 Gruvbox light, hard vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +let s:scheme_slug = substitute("gruvbox-light-hard", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f9f5d7' +let s:gui01 = '#ebdbb2' +let s:gui02 = '#d5c4a1' +let s:gui03 = '#bdae93' +let s:gui04 = '#665c54' +let s:gui05 = '#504945' +let s:gui06 = '#3c3836' +let s:gui07 = '#282828' +let s:gui08 = '#9d0006' +let s:gui09 = '#af3a03' +let s:gui0A = '#b57614' +let s:gui0B = '#79740e' +let s:gui0C = '#427b58' +let s:gui0D = '#076678' +let s:gui0E = '#8f3f71' +let s:gui0F = '#d65d0e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_medium.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_medium.vim new file mode 100644 index 0000000..f63ab3a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_medium.vim @@ -0,0 +1,85 @@ +" Base16 Gruvbox light, medium vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +let s:scheme_slug = substitute("gruvbox-light-medium", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#fbf1c7' +let s:gui01 = '#ebdbb2' +let s:gui02 = '#d5c4a1' +let s:gui03 = '#bdae93' +let s:gui04 = '#665c54' +let s:gui05 = '#504945' +let s:gui06 = '#3c3836' +let s:gui07 = '#282828' +let s:gui08 = '#9d0006' +let s:gui09 = '#af3a03' +let s:gui0A = '#b57614' +let s:gui0B = '#79740e' +let s:gui0C = '#427b58' +let s:gui0D = '#076678' +let s:gui0E = '#8f3f71' +let s:gui0F = '#d65d0e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_soft.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_soft.vim new file mode 100644 index 0000000..f50e6c5 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_gruvbox_light_soft.vim @@ -0,0 +1,85 @@ +" Base16 Gruvbox light, soft vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) + +let s:scheme_slug = substitute("gruvbox-light-soft", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f2e5bc' +let s:gui01 = '#ebdbb2' +let s:gui02 = '#d5c4a1' +let s:gui03 = '#bdae93' +let s:gui04 = '#665c54' +let s:gui05 = '#504945' +let s:gui06 = '#3c3836' +let s:gui07 = '#282828' +let s:gui08 = '#9d0006' +let s:gui09 = '#af3a03' +let s:gui0A = '#b57614' +let s:gui0B = '#79740e' +let s:gui0C = '#427b58' +let s:gui0D = '#076678' +let s:gui0E = '#8f3f71' +let s:gui0F = '#d65d0e' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_harmonic_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_harmonic_dark.vim new file mode 100644 index 0000000..c5799e7 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_harmonic_dark.vim @@ -0,0 +1,85 @@ +" Base16 Harmonic16 Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jannik Siebert (https://github.com/janniks) + +let s:scheme_slug = substitute("harmonic-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#0b1c2c' +let s:gui01 = '#223b54' +let s:gui02 = '#405c79' +let s:gui03 = '#627e99' +let s:gui04 = '#aabcce' +let s:gui05 = '#cbd6e2' +let s:gui06 = '#e5ebf1' +let s:gui07 = '#f7f9fb' +let s:gui08 = '#bf8b56' +let s:gui09 = '#bfbf56' +let s:gui0A = '#8bbf56' +let s:gui0B = '#56bf8b' +let s:gui0C = '#568bbf' +let s:gui0D = '#8b56bf' +let s:gui0E = '#bf568b' +let s:gui0F = '#bf5656' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_harmonic_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_harmonic_light.vim new file mode 100644 index 0000000..1cb5c6f --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_harmonic_light.vim @@ -0,0 +1,85 @@ +" Base16 Harmonic16 Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jannik Siebert (https://github.com/janniks) + +let s:scheme_slug = substitute("harmonic-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f7f9fb' +let s:gui01 = '#e5ebf1' +let s:gui02 = '#cbd6e2' +let s:gui03 = '#aabcce' +let s:gui04 = '#627e99' +let s:gui05 = '#405c79' +let s:gui06 = '#223b54' +let s:gui07 = '#0b1c2c' +let s:gui08 = '#bf8b56' +let s:gui09 = '#bfbf56' +let s:gui0A = '#8bbf56' +let s:gui0B = '#56bf8b' +let s:gui0C = '#568bbf' +let s:gui0D = '#8b56bf' +let s:gui0E = '#bf568b' +let s:gui0F = '#bf5656' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_heetch.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_heetch.vim new file mode 100644 index 0000000..954bb17 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_heetch.vim @@ -0,0 +1,85 @@ +" Base16 Heetch Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Geoffrey Teale (tealeg@gmail.com) + +let s:scheme_slug = substitute("heetch", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#190134' +let s:gui01 = '#392551' +let s:gui02 = '#5A496E' +let s:gui03 = '#7B6D8B' +let s:gui04 = '#9C92A8' +let s:gui05 = '#BDB6C5' +let s:gui06 = '#DEDAE2' +let s:gui07 = '#FEFFFF' +let s:gui08 = '#27D9D5' +let s:gui09 = '#5BA2B6' +let s:gui0A = '#8F6C97' +let s:gui0B = '#C33678' +let s:gui0C = '#F80059' +let s:gui0D = '#BD0152' +let s:gui0E = '#82034C' +let s:gui0F = '#470546' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_heetch_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_heetch_light.vim new file mode 100644 index 0000000..bf18ad6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_heetch_light.vim @@ -0,0 +1,85 @@ +" Base16 Heetch Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Geoffrey Teale (tealeg@gmail.com) + +let s:scheme_slug = substitute("heetch-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#feffff' +let s:gui01 = '#392551' +let s:gui02 = '#7b6d8b' +let s:gui03 = '#9c92a8' +let s:gui04 = '#ddd6e5' +let s:gui05 = '#5a496e' +let s:gui06 = '#470546' +let s:gui07 = '#190134' +let s:gui08 = '#27d9d5' +let s:gui09 = '#bdb6c5' +let s:gui0A = '#5ba2b6' +let s:gui0B = '#f80059' +let s:gui0C = '#c33678' +let s:gui0D = '#47f9f5' +let s:gui0E = '#bd0152' +let s:gui0F = '#dedae2' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_helios.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_helios.vim new file mode 100644 index 0000000..7aae995 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_helios.vim @@ -0,0 +1,85 @@ +" Base16 Helios vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Alex Meyer (https://github.com/reyemxela) + +let s:scheme_slug = substitute("helios", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1d2021' +let s:gui01 = '#383c3e' +let s:gui02 = '#53585b' +let s:gui03 = '#6f7579' +let s:gui04 = '#cdcdcd' +let s:gui05 = '#d5d5d5' +let s:gui06 = '#dddddd' +let s:gui07 = '#e5e5e5' +let s:gui08 = '#d72638' +let s:gui09 = '#eb8413' +let s:gui0A = '#f19d1a' +let s:gui0B = '#88b92d' +let s:gui0C = '#1ba595' +let s:gui0D = '#1e8bac' +let s:gui0E = '#be4264' +let s:gui0F = '#c85e0d' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_dark.vim new file mode 100644 index 0000000..a96f222 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_dark.vim @@ -0,0 +1,85 @@ +" Base16 Horizon Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Michaël Ball (http://github.com/michael-ball/) + +let s:scheme_slug = substitute("horizon-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1C1E26' +let s:gui01 = '#232530' +let s:gui02 = '#2E303E' +let s:gui03 = '#6F6F70' +let s:gui04 = '#9DA0A2' +let s:gui05 = '#CBCED0' +let s:gui06 = '#DCDFE4' +let s:gui07 = '#E3E6EE' +let s:gui08 = '#E93C58' +let s:gui09 = '#E58D7D' +let s:gui0A = '#EFB993' +let s:gui0B = '#EFAF8E' +let s:gui0C = '#24A8B4' +let s:gui0D = '#DF5273' +let s:gui0E = '#B072D1' +let s:gui0F = '#E4A382' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_light.vim new file mode 100644 index 0000000..a0a7311 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_light.vim @@ -0,0 +1,85 @@ +" Base16 Horizon Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Michaël Ball (http://github.com/michael-ball/) + +let s:scheme_slug = substitute("horizon-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#FDF0ED' +let s:gui01 = '#FADAD1' +let s:gui02 = '#F9CBBE' +let s:gui03 = '#BDB3B1' +let s:gui04 = '#948C8A' +let s:gui05 = '#403C3D' +let s:gui06 = '#302C2D' +let s:gui07 = '#201C1D' +let s:gui08 = '#F7939B' +let s:gui09 = '#F6661E' +let s:gui0A = '#FBE0D9' +let s:gui0B = '#94E1B0' +let s:gui0C = '#DC3318' +let s:gui0D = '#DA103F' +let s:gui0E = '#1D8991' +let s:gui0F = '#E58C92' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_terminal_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_terminal_dark.vim new file mode 100644 index 0000000..8de0c41 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_terminal_dark.vim @@ -0,0 +1,85 @@ +" Base16 Horizon Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Michaël Ball (http://github.com/michael-ball/) + +let s:scheme_slug = substitute("horizon-terminal-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1C1E26' +let s:gui01 = '#232530' +let s:gui02 = '#2E303E' +let s:gui03 = '#6F6F70' +let s:gui04 = '#9DA0A2' +let s:gui05 = '#CBCED0' +let s:gui06 = '#DCDFE4' +let s:gui07 = '#E3E6EE' +let s:gui08 = '#E95678' +let s:gui09 = '#FAB795' +let s:gui0A = '#FAC29A' +let s:gui0B = '#29D398' +let s:gui0C = '#59E1E3' +let s:gui0D = '#26BBD9' +let s:gui0E = '#EE64AC' +let s:gui0F = '#F09383' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_terminal_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_terminal_light.vim new file mode 100644 index 0000000..164571a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_horizon_terminal_light.vim @@ -0,0 +1,85 @@ +" Base16 Horizon Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Michaël Ball (http://github.com/michael-ball/) + +let s:scheme_slug = substitute("horizon-terminal-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#FDF0ED' +let s:gui01 = '#FADAD1' +let s:gui02 = '#F9CBBE' +let s:gui03 = '#BDB3B1' +let s:gui04 = '#948C8A' +let s:gui05 = '#403C3D' +let s:gui06 = '#302C2D' +let s:gui07 = '#201C1D' +let s:gui08 = '#E95678' +let s:gui09 = '#F9CEC3' +let s:gui0A = '#FADAD1' +let s:gui0B = '#29D398' +let s:gui0C = '#59E1E3' +let s:gui0D = '#26BBD9' +let s:gui0E = '#EE64AC' +let s:gui0F = '#F9CBBE' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_ia_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_ia_dark.vim new file mode 100644 index 0000000..b334ed0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_ia_dark.vim @@ -0,0 +1,85 @@ +" Base16 iA Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By iA Inc. (modified by aramisgithub) + +let s:scheme_slug = substitute("ia-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1a1a1a' +let s:gui01 = '#222222' +let s:gui02 = '#1d414d' +let s:gui03 = '#767676' +let s:gui04 = '#b8b8b8' +let s:gui05 = '#cccccc' +let s:gui06 = '#e8e8e8' +let s:gui07 = '#f8f8f8' +let s:gui08 = '#d88568' +let s:gui09 = '#d86868' +let s:gui0A = '#b99353' +let s:gui0B = '#83a471' +let s:gui0C = '#7c9cae' +let s:gui0D = '#8eccdd' +let s:gui0E = '#b98eb2' +let s:gui0F = '#8b6c37' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_ia_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_ia_light.vim new file mode 100644 index 0000000..f029181 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_ia_light.vim @@ -0,0 +1,85 @@ +" Base16 iA Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By iA Inc. (modified by aramisgithub) + +let s:scheme_slug = substitute("ia-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f6f6f6' +let s:gui01 = '#dedede' +let s:gui02 = '#bde5f2' +let s:gui03 = '#898989' +let s:gui04 = '#767676' +let s:gui05 = '#181818' +let s:gui06 = '#e8e8e8' +let s:gui07 = '#f8f8f8' +let s:gui08 = '#9c5a02' +let s:gui09 = '#c43e18' +let s:gui0A = '#c48218' +let s:gui0B = '#38781c' +let s:gui0C = '#2d6bb1' +let s:gui0D = '#48bac2' +let s:gui0E = '#a94598' +let s:gui0F = '#8b6c37' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_icy.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_icy.vim new file mode 100644 index 0000000..825f405 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_icy.vim @@ -0,0 +1,85 @@ +" Base16 Icy Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By icyphox (https://icyphox.ga) + +let s:scheme_slug = substitute("icy", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#021012' +let s:gui01 = '#031619' +let s:gui02 = '#041f23' +let s:gui03 = '#052e34' +let s:gui04 = '#064048' +let s:gui05 = '#095b67' +let s:gui06 = '#0c7c8c' +let s:gui07 = '#109cb0' +let s:gui08 = '#16c1d9' +let s:gui09 = '#b3ebf2' +let s:gui0A = '#80deea' +let s:gui0B = '#4dd0e1' +let s:gui0C = '#26c6da' +let s:gui0D = '#00bcd4' +let s:gui0E = '#00acc1' +let s:gui0F = '#0097a7' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_irblack.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_irblack.vim new file mode 100644 index 0000000..4500850 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_irblack.vim @@ -0,0 +1,85 @@ +" Base16 IR Black vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Timothée Poisot (http://timotheepoisot.fr) + +let s:scheme_slug = substitute("irblack", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#242422' +let s:gui02 = '#484844' +let s:gui03 = '#6c6c66' +let s:gui04 = '#918f88' +let s:gui05 = '#b5b3aa' +let s:gui06 = '#d9d7cc' +let s:gui07 = '#fdfbee' +let s:gui08 = '#ff6c60' +let s:gui09 = '#e9c062' +let s:gui0A = '#ffffb6' +let s:gui0B = '#a8ff60' +let s:gui0C = '#c6c5fe' +let s:gui0D = '#96cbfe' +let s:gui0E = '#ff73fd' +let s:gui0F = '#b18a3d' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_macintosh.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_macintosh.vim new file mode 100644 index 0000000..4801995 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_macintosh.vim @@ -0,0 +1,85 @@ +" Base16 Macintosh vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Rebecca Bettencourt (http://www.kreativekorp.com) + +let s:scheme_slug = substitute("macintosh", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#404040' +let s:gui02 = '#404040' +let s:gui03 = '#808080' +let s:gui04 = '#808080' +let s:gui05 = '#c0c0c0' +let s:gui06 = '#c0c0c0' +let s:gui07 = '#ffffff' +let s:gui08 = '#dd0907' +let s:gui09 = '#ff6403' +let s:gui0A = '#fbf305' +let s:gui0B = '#1fb714' +let s:gui0C = '#02abea' +let s:gui0D = '#0000d3' +let s:gui0E = '#4700a5' +let s:gui0F = '#90713a' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_materia.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_materia.vim new file mode 100644 index 0000000..259e63c --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_materia.vim @@ -0,0 +1,85 @@ +" Base16 Materia vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Defman21 + +let s:scheme_slug = substitute("materia", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#263238' +let s:gui01 = '#2C393F' +let s:gui02 = '#37474F' +let s:gui03 = '#707880' +let s:gui04 = '#C9CCD3' +let s:gui05 = '#CDD3DE' +let s:gui06 = '#D5DBE5' +let s:gui07 = '#FFFFFF' +let s:gui08 = '#EC5F67' +let s:gui09 = '#EA9560' +let s:gui0A = '#FFCC00' +let s:gui0B = '#8BD649' +let s:gui0C = '#80CBC4' +let s:gui0D = '#89DDFF' +let s:gui0E = '#82AAFF' +let s:gui0F = '#EC5F67' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material.vim new file mode 100644 index 0000000..8fe1aea --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material.vim @@ -0,0 +1,85 @@ +" Base16 Material vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Nate Peterson + +let s:scheme_slug = substitute("material", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#263238' +let s:gui01 = '#2E3C43' +let s:gui02 = '#314549' +let s:gui03 = '#546E7A' +let s:gui04 = '#B2CCD6' +let s:gui05 = '#EEFFFF' +let s:gui06 = '#EEFFFF' +let s:gui07 = '#FFFFFF' +let s:gui08 = '#F07178' +let s:gui09 = '#F78C6C' +let s:gui0A = '#FFCB6B' +let s:gui0B = '#C3E88D' +let s:gui0C = '#89DDFF' +let s:gui0D = '#82AAFF' +let s:gui0E = '#C792EA' +let s:gui0F = '#FF5370' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_darker.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_darker.vim new file mode 100644 index 0000000..3693a84 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_darker.vim @@ -0,0 +1,85 @@ +" Base16 Material Darker vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Nate Peterson + +let s:scheme_slug = substitute("material-darker", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#212121' +let s:gui01 = '#303030' +let s:gui02 = '#353535' +let s:gui03 = '#4A4A4A' +let s:gui04 = '#B2CCD6' +let s:gui05 = '#EEFFFF' +let s:gui06 = '#EEFFFF' +let s:gui07 = '#FFFFFF' +let s:gui08 = '#F07178' +let s:gui09 = '#F78C6C' +let s:gui0A = '#FFCB6B' +let s:gui0B = '#C3E88D' +let s:gui0C = '#89DDFF' +let s:gui0D = '#82AAFF' +let s:gui0E = '#C792EA' +let s:gui0F = '#FF5370' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_lighter.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_lighter.vim new file mode 100644 index 0000000..0b6f374 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_lighter.vim @@ -0,0 +1,85 @@ +" Base16 Material Lighter vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Nate Peterson + +let s:scheme_slug = substitute("material-lighter", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#FAFAFA' +let s:gui01 = '#E7EAEC' +let s:gui02 = '#CCEAE7' +let s:gui03 = '#CCD7DA' +let s:gui04 = '#8796B0' +let s:gui05 = '#80CBC4' +let s:gui06 = '#80CBC4' +let s:gui07 = '#FFFFFF' +let s:gui08 = '#FF5370' +let s:gui09 = '#F76D47' +let s:gui0A = '#FFB62C' +let s:gui0B = '#91B859' +let s:gui0C = '#39ADB5' +let s:gui0D = '#6182B8' +let s:gui0E = '#7C4DFF' +let s:gui0F = '#E53935' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_palenight.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_palenight.vim new file mode 100644 index 0000000..c581651 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_palenight.vim @@ -0,0 +1,85 @@ +" Base16 Material Palenight vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Nate Peterson + +let s:scheme_slug = substitute("material-palenight", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#292D3E' +let s:gui01 = '#444267' +let s:gui02 = '#32374D' +let s:gui03 = '#676E95' +let s:gui04 = '#8796B0' +let s:gui05 = '#959DCB' +let s:gui06 = '#959DCB' +let s:gui07 = '#FFFFFF' +let s:gui08 = '#F07178' +let s:gui09 = '#F78C6C' +let s:gui0A = '#FFCB6B' +let s:gui0B = '#C3E88D' +let s:gui0C = '#89DDFF' +let s:gui0D = '#82AAFF' +let s:gui0E = '#C792EA' +let s:gui0F = '#FF5370' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_vivid.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_vivid.vim new file mode 100644 index 0000000..5bc3c15 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_material_vivid.vim @@ -0,0 +1,85 @@ +" Base16 Material Vivid vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By joshyrobot + +let s:scheme_slug = substitute("material-vivid", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#202124' +let s:gui01 = '#27292c' +let s:gui02 = '#323639' +let s:gui03 = '#44464d' +let s:gui04 = '#676c71' +let s:gui05 = '#80868b' +let s:gui06 = '#9e9e9e' +let s:gui07 = '#ffffff' +let s:gui08 = '#f44336' +let s:gui09 = '#ff9800' +let s:gui0A = '#ffeb3b' +let s:gui0B = '#00e676' +let s:gui0C = '#00bcd4' +let s:gui0D = '#2196f3' +let s:gui0E = '#673ab7' +let s:gui0F = '#8d6e63' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_mellow_purple.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_mellow_purple.vim new file mode 100644 index 0000000..d0c7a3b --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_mellow_purple.vim @@ -0,0 +1,85 @@ +" Base16 Mellow Purple vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By gidsi + +let s:scheme_slug = substitute("mellow-purple", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1e0528' +let s:gui01 = '#1A092D' +let s:gui02 = '#331354' +let s:gui03 = '#320f55' +let s:gui04 = '#873582' +let s:gui05 = '#ffeeff' +let s:gui06 = '#ffeeff' +let s:gui07 = '#f8c0ff' +let s:gui08 = '#00d9e9' +let s:gui09 = '#aa00a3' +let s:gui0A = '#955ae7' +let s:gui0B = '#05cb0d' +let s:gui0C = '#b900b1' +let s:gui0D = '#550068' +let s:gui0E = '#8991bb' +let s:gui0F = '#4d6fff' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_mexico_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_mexico_light.vim new file mode 100644 index 0000000..78354fb --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_mexico_light.vim @@ -0,0 +1,85 @@ +" Base16 Mexico Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Sheldon Johnson + +let s:scheme_slug = substitute("mexico-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#f8f8f8' +let s:gui01 = '#e8e8e8' +let s:gui02 = '#d8d8d8' +let s:gui03 = '#b8b8b8' +let s:gui04 = '#585858' +let s:gui05 = '#383838' +let s:gui06 = '#282828' +let s:gui07 = '#181818' +let s:gui08 = '#ab4642' +let s:gui09 = '#dc9656' +let s:gui0A = '#f79a0e' +let s:gui0B = '#538947' +let s:gui0C = '#4b8093' +let s:gui0D = '#7cafc2' +let s:gui0E = '#96609e' +let s:gui0F = '#a16946' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_nova.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_nova.vim new file mode 100644 index 0000000..c1e5f86 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_nova.vim @@ -0,0 +1,85 @@ +" Base16 Nova vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By George Essig (https://github.com/gessig), Trevor D. Miller (https://trevordmiller.com) + +let s:scheme_slug = substitute("nova", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#3C4C55' +let s:gui01 = '#556873' +let s:gui02 = '#6A7D89' +let s:gui03 = '#899BA6' +let s:gui04 = '#899BA6' +let s:gui05 = '#C5D4DD' +let s:gui06 = '#899BA6' +let s:gui07 = '#556873' +let s:gui08 = '#83AFE5' +let s:gui09 = '#7FC1CA' +let s:gui0A = '#A8CE93' +let s:gui0B = '#7FC1CA' +let s:gui0C = '#F2C38F' +let s:gui0D = '#83AFE5' +let s:gui0E = '#9A93E1' +let s:gui0F = '#F2C38F' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_one_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_one_light.vim new file mode 100644 index 0000000..dfe46c6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_one_light.vim @@ -0,0 +1,85 @@ +" Base16 One Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Daniel Pfeifer (http://github.com/purpleKarrot) + +let s:scheme_slug = substitute("one-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#fafafa' +let s:gui01 = '#f0f0f1' +let s:gui02 = '#e5e5e6' +let s:gui03 = '#a0a1a7' +let s:gui04 = '#696c77' +let s:gui05 = '#383a42' +let s:gui06 = '#202227' +let s:gui07 = '#090a0b' +let s:gui08 = '#ca1243' +let s:gui09 = '#d75f00' +let s:gui0A = '#c18401' +let s:gui0B = '#50a14f' +let s:gui0C = '#0184bc' +let s:gui0D = '#4078f2' +let s:gui0E = '#a626a4' +let s:gui0F = '#986801' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_onedark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_onedark.vim new file mode 100644 index 0000000..8543031 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_onedark.vim @@ -0,0 +1,85 @@ +" Base16 OneDark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Lalit Magant (http://github.com/tilal6991) + +let s:scheme_slug = substitute("onedark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#282c34' +let s:gui01 = '#353b45' +let s:gui02 = '#3e4451' +let s:gui03 = '#545862' +let s:gui04 = '#565c64' +let s:gui05 = '#abb2bf' +let s:gui06 = '#b6bdca' +let s:gui07 = '#c8ccd4' +let s:gui08 = '#e06c75' +let s:gui09 = '#d19a66' +let s:gui0A = '#e5c07b' +let s:gui0B = '#98c379' +let s:gui0C = '#56b6c2' +let s:gui0D = '#61afef' +let s:gui0E = '#c678dd' +let s:gui0F = '#be5046' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_outrun_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_outrun_dark.vim new file mode 100644 index 0000000..405b5d8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_outrun_dark.vim @@ -0,0 +1,85 @@ +" Base16 Outrun Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Hugo Delahousse (http://github.com/hugodelahousse/) + +let s:scheme_slug = substitute("outrun-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#00002A' +let s:gui01 = '#20204A' +let s:gui02 = '#30305A' +let s:gui03 = '#50507A' +let s:gui04 = '#B0B0DA' +let s:gui05 = '#D0D0FA' +let s:gui06 = '#E0E0FF' +let s:gui07 = '#F5F5FF' +let s:gui08 = '#FF4242' +let s:gui09 = '#FC8D28' +let s:gui0A = '#F3E877' +let s:gui0B = '#59F176' +let s:gui0C = '#0EF0F0' +let s:gui0D = '#66B0FF' +let s:gui0E = '#F10596' +let s:gui0F = '#F003EF' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_papercolor_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_papercolor_dark.vim new file mode 100644 index 0000000..9230677 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_papercolor_dark.vim @@ -0,0 +1,85 @@ +" Base16 PaperColor Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) + +let s:scheme_slug = substitute("papercolor-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1c1c1c' +let s:gui01 = '#af005f' +let s:gui02 = '#5faf00' +let s:gui03 = '#d7af5f' +let s:gui04 = '#5fafd7' +let s:gui05 = '#808080' +let s:gui06 = '#d7875f' +let s:gui07 = '#d0d0d0' +let s:gui08 = '#585858' +let s:gui09 = '#5faf5f' +let s:gui0A = '#afd700' +let s:gui0B = '#af87d7' +let s:gui0C = '#ffaf00' +let s:gui0D = '#ff5faf' +let s:gui0E = '#00afaf' +let s:gui0F = '#5f8787' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_papercolor_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_papercolor_light.vim new file mode 100644 index 0000000..3d7f3ac --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_papercolor_light.vim @@ -0,0 +1,85 @@ +" Base16 PaperColor Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jon Leopard (http://github.com/jonleopard) based on PaperColor Theme (https://github.com/NLKNguyen/papercolor-theme) + +let s:scheme_slug = substitute("papercolor-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#eeeeee' +let s:gui01 = '#af0000' +let s:gui02 = '#008700' +let s:gui03 = '#5f8700' +let s:gui04 = '#0087af' +let s:gui05 = '#878787' +let s:gui06 = '#005f87' +let s:gui07 = '#444444' +let s:gui08 = '#bcbcbc' +let s:gui09 = '#d70000' +let s:gui0A = '#d70087' +let s:gui0B = '#8700af' +let s:gui0C = '#d75f00' +let s:gui0D = '#d75f00' +let s:gui0E = '#005faf' +let s:gui0F = '#005f87' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_phd.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_phd.vim new file mode 100644 index 0000000..f72b5c7 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_phd.vim @@ -0,0 +1,85 @@ +" Base16 PhD vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Hennig Hasemann (http://leetless.de/vim.html) + +let s:scheme_slug = substitute("phd", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#061229' +let s:gui01 = '#2a3448' +let s:gui02 = '#4d5666' +let s:gui03 = '#717885' +let s:gui04 = '#9a99a3' +let s:gui05 = '#b8bbc2' +let s:gui06 = '#dbdde0' +let s:gui07 = '#ffffff' +let s:gui08 = '#d07346' +let s:gui09 = '#f0a000' +let s:gui0A = '#fbd461' +let s:gui0B = '#99bf52' +let s:gui0C = '#72b9bf' +let s:gui0D = '#5299bf' +let s:gui0E = '#9989cc' +let s:gui0F = '#b08060' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_pico.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_pico.vim new file mode 100644 index 0000000..2ad8dde --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_pico.vim @@ -0,0 +1,85 @@ +" Base16 Pico vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By PICO-8 (http://www.lexaloffle.com/pico-8.php) + +let s:scheme_slug = substitute("pico", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#000000' +let s:gui01 = '#1d2b53' +let s:gui02 = '#7e2553' +let s:gui03 = '#008751' +let s:gui04 = '#ab5236' +let s:gui05 = '#5f574f' +let s:gui06 = '#c2c3c7' +let s:gui07 = '#fff1e8' +let s:gui08 = '#ff004d' +let s:gui09 = '#ffa300' +let s:gui0A = '#fff024' +let s:gui0B = '#00e756' +let s:gui0C = '#29adff' +let s:gui0D = '#83769c' +let s:gui0E = '#ff77a8' +let s:gui0F = '#ffccaa' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_porple.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_porple.vim new file mode 100644 index 0000000..7e05abc --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_porple.vim @@ -0,0 +1,85 @@ +" Base16 Porple vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Niek den Breeje (https://github.com/AuditeMarlow) + +let s:scheme_slug = substitute("porple", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#292c36' +let s:gui01 = '#333344' +let s:gui02 = '#474160' +let s:gui03 = '#65568a' +let s:gui04 = '#b8b8b8' +let s:gui05 = '#d8d8d8' +let s:gui06 = '#e8e8e8' +let s:gui07 = '#f8f8f8' +let s:gui08 = '#f84547' +let s:gui09 = '#d28e5d' +let s:gui0A = '#efa16b' +let s:gui0B = '#95c76f' +let s:gui0C = '#64878f' +let s:gui0D = '#8485ce' +let s:gui0E = '#b74989' +let s:gui0F = '#986841' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_rebecca.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_rebecca.vim new file mode 100644 index 0000000..6872851 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_rebecca.vim @@ -0,0 +1,85 @@ +" Base16 Rebecca vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Victor Borja (http://github.com/vic) based on Rebecca Theme (http://github.com/vic/rebecca-theme) + +let s:scheme_slug = substitute("rebecca", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#292a44' +let s:gui01 = '#663399' +let s:gui02 = '#383a62' +let s:gui03 = '#666699' +let s:gui04 = '#a0a0c5' +let s:gui05 = '#f1eff8' +let s:gui06 = '#ccccff' +let s:gui07 = '#53495d' +let s:gui08 = '#a0a0c5' +let s:gui09 = '#efe4a1' +let s:gui0A = '#ae81ff' +let s:gui0B = '#6dfedf' +let s:gui0C = '#8eaee0' +let s:gui0D = '#2de0a7' +let s:gui0E = '#7aa5ff' +let s:gui0F = '#ff79c6' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_sandcastle.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_sandcastle.vim new file mode 100644 index 0000000..daaf7f6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_sandcastle.vim @@ -0,0 +1,85 @@ +" Base16 Sandcastle vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By George Essig (https://github.com/gessig) + +let s:scheme_slug = substitute("sandcastle", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#282c34' +let s:gui01 = '#2c323b' +let s:gui02 = '#3e4451' +let s:gui03 = '#665c54' +let s:gui04 = '#928374' +let s:gui05 = '#a89984' +let s:gui06 = '#d5c4a1' +let s:gui07 = '#fdf4c1' +let s:gui08 = '#83a598' +let s:gui09 = '#a07e3b' +let s:gui0A = '#a07e3b' +let s:gui0B = '#528b8b' +let s:gui0C = '#83a598' +let s:gui0D = '#83a598' +let s:gui0E = '#d75f5f' +let s:gui0F = '#a87322' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarflare.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarflare.vim new file mode 100644 index 0000000..47e20ef --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarflare.vim @@ -0,0 +1,85 @@ +" Base16 Solar Flare vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Chuck Harmston (https://chuck.harmston.ch) + +let s:scheme_slug = substitute("solarflare", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#18262F' +let s:gui01 = '#222E38' +let s:gui02 = '#586875' +let s:gui03 = '#667581' +let s:gui04 = '#85939E' +let s:gui05 = '#A6AFB8' +let s:gui06 = '#E8E9ED' +let s:gui07 = '#F5F7FA' +let s:gui08 = '#EF5253' +let s:gui09 = '#E66B2B' +let s:gui0A = '#E4B51C' +let s:gui0B = '#7CC844' +let s:gui0C = '#52CBB0' +let s:gui0D = '#33B5E1' +let s:gui0E = '#A363D5' +let s:gui0F = '#D73C9A' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarized_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarized_dark.vim new file mode 100644 index 0000000..bbf1560 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarized_dark.vim @@ -0,0 +1,85 @@ +" Base16 Solarized Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Ethan Schoonover (modified by aramisgithub) + +let s:scheme_slug = substitute("solarized-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#002b36' +let s:gui01 = '#073642' +let s:gui02 = '#586e75' +let s:gui03 = '#657b83' +let s:gui04 = '#839496' +let s:gui05 = '#93a1a1' +let s:gui06 = '#eee8d5' +let s:gui07 = '#fdf6e3' +let s:gui08 = '#dc322f' +let s:gui09 = '#cb4b16' +let s:gui0A = '#b58900' +let s:gui0B = '#859900' +let s:gui0C = '#2aa198' +let s:gui0D = '#268bd2' +let s:gui0E = '#6c71c4' +let s:gui0F = '#d33682' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarized_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarized_light.vim new file mode 100644 index 0000000..9d28664 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_solarized_light.vim @@ -0,0 +1,85 @@ +" Base16 Solarized Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Ethan Schoonover (modified by aramisgithub) + +let s:scheme_slug = substitute("solarized-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#fdf6e3' +let s:gui01 = '#eee8d5' +let s:gui02 = '#93a1a1' +let s:gui03 = '#839496' +let s:gui04 = '#657b83' +let s:gui05 = '#586e75' +let s:gui06 = '#073642' +let s:gui07 = '#002b36' +let s:gui08 = '#dc322f' +let s:gui09 = '#cb4b16' +let s:gui0A = '#b58900' +let s:gui0B = '#859900' +let s:gui0C = '#2aa198' +let s:gui0D = '#268bd2' +let s:gui0E = '#6c71c4' +let s:gui0F = '#d33682' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_summerfruit_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_summerfruit_dark.vim new file mode 100644 index 0000000..9a4a8d3 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_summerfruit_dark.vim @@ -0,0 +1,85 @@ +" Base16 Summerfruit Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Christopher Corley (http://christop.club/) + +let s:scheme_slug = substitute("summerfruit-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#151515' +let s:gui01 = '#202020' +let s:gui02 = '#303030' +let s:gui03 = '#505050' +let s:gui04 = '#B0B0B0' +let s:gui05 = '#D0D0D0' +let s:gui06 = '#E0E0E0' +let s:gui07 = '#FFFFFF' +let s:gui08 = '#FF0086' +let s:gui09 = '#FD8900' +let s:gui0A = '#ABA800' +let s:gui0B = '#00C918' +let s:gui0C = '#1FAAAA' +let s:gui0D = '#3777E6' +let s:gui0E = '#AD00A1' +let s:gui0F = '#CC6633' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_summerfruit_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_summerfruit_light.vim new file mode 100644 index 0000000..c7b3ba0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_summerfruit_light.vim @@ -0,0 +1,85 @@ +" Base16 Summerfruit Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Christopher Corley (http://christop.club/) + +let s:scheme_slug = substitute("summerfruit-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#FFFFFF' +let s:gui01 = '#E0E0E0' +let s:gui02 = '#D0D0D0' +let s:gui03 = '#B0B0B0' +let s:gui04 = '#000000' +let s:gui05 = '#101010' +let s:gui06 = '#151515' +let s:gui07 = '#202020' +let s:gui08 = '#FF0086' +let s:gui09 = '#FD8900' +let s:gui0A = '#ABA800' +let s:gui0B = '#00C918' +let s:gui0C = '#1FAAAA' +let s:gui0D = '#3777E6' +let s:gui0E = '#AD00A1' +let s:gui0F = '#CC6633' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_synth_midnight_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_synth_midnight_dark.vim new file mode 100644 index 0000000..5d6a269 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_synth_midnight_dark.vim @@ -0,0 +1,85 @@ +" Base16 Synth Midnight Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Michaël Ball (http://github.com/michael-ball/) + +let s:scheme_slug = substitute("synth-midnight-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#040404' +let s:gui01 = '#141414' +let s:gui02 = '#242424' +let s:gui03 = '#61507A' +let s:gui04 = '#BFBBBF' +let s:gui05 = '#DFDBDF' +let s:gui06 = '#EFEBEF' +let s:gui07 = '#FFFBFF' +let s:gui08 = '#B53B50' +let s:gui09 = '#E4600E' +let s:gui0A = '#DAE84D' +let s:gui0B = '#06EA61' +let s:gui0C = '#7CEDE9' +let s:gui0D = '#03AEFF' +let s:gui0E = '#EA5CE2' +let s:gui0F = '#9D4D0E' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tomorrow_night.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tomorrow_night.vim new file mode 100644 index 0000000..9831db7 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tomorrow_night.vim @@ -0,0 +1,85 @@ +" Base16 Tomorrow Night vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Chris Kempson (http://chriskempson.com) + +let s:scheme_slug = substitute("tomorrow-night", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#1d1f21' +let s:gui01 = '#282a2e' +let s:gui02 = '#373b41' +let s:gui03 = '#969896' +let s:gui04 = '#b4b7b4' +let s:gui05 = '#c5c8c6' +let s:gui06 = '#e0e0e0' +let s:gui07 = '#ffffff' +let s:gui08 = '#cc6666' +let s:gui09 = '#de935f' +let s:gui0A = '#f0c674' +let s:gui0B = '#b5bd68' +let s:gui0C = '#8abeb7' +let s:gui0D = '#81a2be' +let s:gui0E = '#b294bb' +let s:gui0F = '#a3685a' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tomorrow_night_eighties.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tomorrow_night_eighties.vim new file mode 100644 index 0000000..d93aaf7 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tomorrow_night_eighties.vim @@ -0,0 +1,85 @@ +" Base16 Tomorrow Night vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Chris Kempson (http://chriskempson.com) + +let s:scheme_slug = substitute("tomorrow-night-eighties", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#2d2d2d' +let s:gui01 = '#393939' +let s:gui02 = '#515151' +let s:gui03 = '#999999' +let s:gui04 = '#b4b7b4' +let s:gui05 = '#cccccc' +let s:gui06 = '#e0e0e0' +let s:gui07 = '#ffffff' +let s:gui08 = '#f2777a' +let s:gui09 = '#f99157' +let s:gui0A = '#ffcc66' +let s:gui0B = '#99cc99' +let s:gui0C = '#66cccc' +let s:gui0D = '#6699cc' +let s:gui0E = '#cc99cc' +let s:gui0F = '#a3685a' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tube.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tube.vim new file mode 100644 index 0000000..44cc328 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_tube.vim @@ -0,0 +1,85 @@ +" Base16 London Tube vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jan T. Sott + +let s:scheme_slug = substitute("tube", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#231f20' +let s:gui01 = '#1c3f95' +let s:gui02 = '#5a5758' +let s:gui03 = '#737171' +let s:gui04 = '#959ca1' +let s:gui05 = '#d9d8d8' +let s:gui06 = '#e7e7e8' +let s:gui07 = '#ffffff' +let s:gui08 = '#ee2e24' +let s:gui09 = '#f386a1' +let s:gui0A = '#ffd204' +let s:gui0B = '#00853e' +let s:gui0C = '#85cebc' +let s:gui0D = '#009ddc' +let s:gui0E = '#98005d' +let s:gui0F = '#b06110' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_unikitty_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_unikitty_dark.vim new file mode 100644 index 0000000..a0fd198 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_unikitty_dark.vim @@ -0,0 +1,85 @@ +" Base16 Unikitty Dark vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Josh W Lewis (@joshwlewis) + +let s:scheme_slug = substitute("unikitty-dark", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#2e2a31' +let s:gui01 = '#4a464d' +let s:gui02 = '#666369' +let s:gui03 = '#838085' +let s:gui04 = '#9f9da2' +let s:gui05 = '#bcbabe' +let s:gui06 = '#d8d7da' +let s:gui07 = '#f5f4f7' +let s:gui08 = '#d8137f' +let s:gui09 = '#d65407' +let s:gui0A = '#dc8a0e' +let s:gui0B = '#17ad98' +let s:gui0C = '#149bda' +let s:gui0D = '#796af5' +let s:gui0E = '#bb60ea' +let s:gui0F = '#c720ca' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_unikitty_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_unikitty_light.vim new file mode 100644 index 0000000..c65ea76 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_unikitty_light.vim @@ -0,0 +1,85 @@ +" Base16 Unikitty Light vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Josh W Lewis (@joshwlewis) + +let s:scheme_slug = substitute("unikitty-light", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#ffffff' +let s:gui01 = '#e1e1e2' +let s:gui02 = '#c4c3c5' +let s:gui03 = '#a7a5a8' +let s:gui04 = '#89878b' +let s:gui05 = '#6c696e' +let s:gui06 = '#4f4b51' +let s:gui07 = '#322d34' +let s:gui08 = '#d8137f' +let s:gui09 = '#d65407' +let s:gui0A = '#dc8a0e' +let s:gui0B = '#17ad98' +let s:gui0C = '#149bda' +let s:gui0D = '#775dff' +let s:gui0E = '#aa17e6' +let s:gui0F = '#e013d0' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_woodland.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_woodland.vim new file mode 100644 index 0000000..e493f78 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_woodland.vim @@ -0,0 +1,85 @@ +" Base16 Woodland vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Jay Cornwall (https://jcornwall.com) + +let s:scheme_slug = substitute("woodland", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#231e18' +let s:gui01 = '#302b25' +let s:gui02 = '#48413a' +let s:gui03 = '#9d8b70' +let s:gui04 = '#b4a490' +let s:gui05 = '#cabcb1' +let s:gui06 = '#d7c8bc' +let s:gui07 = '#e4d4c8' +let s:gui08 = '#d35c5c' +let s:gui09 = '#ca7f32' +let s:gui0A = '#e0ac16' +let s:gui0B = '#b7ba53' +let s:gui0C = '#6eb958' +let s:gui0D = '#88a4d3' +let s:gui0E = '#bb90e2' +let s:gui0F = '#b49368' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_xcode_dusk.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_xcode_dusk.vim new file mode 100644 index 0000000..666f25a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_xcode_dusk.vim @@ -0,0 +1,85 @@ +" Base16 XCode Dusk vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By Elsa Gonsiorowski (https://github.com/gonsie) + +let s:scheme_slug = substitute("xcode-dusk", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#282B35' +let s:gui01 = '#3D4048' +let s:gui02 = '#53555D' +let s:gui03 = '#686A71' +let s:gui04 = '#7E8086' +let s:gui05 = '#939599' +let s:gui06 = '#A9AAAE' +let s:gui07 = '#BEBFC2' +let s:gui08 = '#B21889' +let s:gui09 = '#786DC5' +let s:gui0A = '#438288' +let s:gui0B = '#DF0002' +let s:gui0C = '#00A0BE' +let s:gui0D = '#790EAD' +let s:gui0E = '#B21889' +let s:gui0F = '#C77C48' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_zenburn.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_zenburn.vim new file mode 100644 index 0000000..2e716d8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/base16_zenburn.vim @@ -0,0 +1,85 @@ +" Base16 Zenburn vim-airline-theme (https://github.com/dawikur/base16-vim-airline-themes) +" For vim-airline (https://github.com/vim-airline/vim-airline) +" By elnawe + +let s:scheme_slug = substitute("zenburn", "-", "_", "g") + +let g:airline#themes#base16_{s:scheme_slug}#palette = {} + +" GUI color definitions +let s:gui00 = '#383838' +let s:gui01 = '#404040' +let s:gui02 = '#606060' +let s:gui03 = '#6f6f6f' +let s:gui04 = '#808080' +let s:gui05 = '#dcdccc' +let s:gui06 = '#c0c0c0' +let s:gui07 = '#ffffff' +let s:gui08 = '#dca3a3' +let s:gui09 = '#dfaf8f' +let s:gui0A = '#e0cf9f' +let s:gui0B = '#5f7f5f' +let s:gui0C = '#93e0e3' +let s:gui0D = '#7cb8bb' +let s:gui0E = '#dc8cc3' +let s:gui0F = '#000000' + +" Terminal color definitions +let s:cterm00 = "00" +let s:cterm03 = "08" +let s:cterm05 = "07" +let s:cterm07 = "15" +let s:cterm08 = "01" +let s:cterm0A = "03" +let s:cterm0B = "02" +let s:cterm0C = "06" +let s:cterm0D = "04" +let s:cterm0E = "05" +if exists("base16colorspace") && base16colorspace == "256" + let s:cterm01 = "18" + let s:cterm02 = "19" + let s:cterm04 = "20" + let s:cterm06 = "21" + let s:cterm09 = "16" + let s:cterm0F = "17" +else + let s:cterm01 = "10" + let s:cterm02 = "11" + let s:cterm04 = "12" + let s:cterm06 = "13" + let s:cterm09 = "09" + let s:cterm0F = "14" +endif + +let g:airline#themes#base16_{s:scheme_slug}#palette.normal = airline#themes#generate_color_map( + \ [ s:gui01, s:gui04, s:cterm01, s:cterm04 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.normal_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.insert = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0B, s:cterm01, s:cterm0B ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.insert_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.replace = airline#themes#generate_color_map( + \ [ s:gui01, s:gui0E, s:cterm01, s:cterm0E ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.replace_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.visual = airline#themes#generate_color_map( + \ [ s:gui01, s:gui09, s:cterm01, s:cterm09 ], + \ [ s:gui04, s:gui02, s:cterm04, s:cterm02 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ]) +let g:airline#themes#base16_{s:scheme_slug}#palette.visual_modified = { + \ 'airline_c' : [ s:gui07, s:gui01, s:cterm07, s:cterm01 ]} + +let g:airline#themes#base16_{s:scheme_slug}#palette.inactive = airline#themes#generate_color_map( + \ [ s:gui01, s:gui01, s:cterm01, s:cterm01 ], + \ [ s:gui04, s:gui01, s:cterm04, s:cterm01 ], + \ [ s:gui05, s:gui01, s:cterm05, s:cterm01 ]) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/cool.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/cool.vim index 83abdb1..148122b 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/cool.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/cool.vim @@ -47,6 +47,11 @@ let g:airline#themes#cool#palette.inactive = airline#themes#generate_color_map(s "\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] , "\ } +" TERMINAL +let g:airline#themes#cool#palette.terminal = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#cool#palette.normal.airline_term = s:N3 +let g:airline#themes#cool#palette.terminal.airline_term = s:I3 +let g:airline#themes#cool#palette.visual.airline_term = s:V3 let g:airline#themes#cool#palette.accents = { \ 'red': [ '#ff0000' , '' , 196 , '' ] diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/google_dark.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/google_dark.vim new file mode 100644 index 0000000..08e7bcf --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/google_dark.vim @@ -0,0 +1,64 @@ +" vim-airline template by danrneal (http://github.com/danrneal) +" Google Scheme by Lisie Michel (https://github.com/google/vim-colorscheme-primary/) + +let g:airline#themes#google_dark#palette = {} + +let s:RED = '#EA4335' +let s:GREEN = '#34A853' +let s:YELLOW = '#FBBC04' +let s:BLUE = '#4285F4' +let s:BLACK = '#202124' +let s:DGREY = '#5F6368' +let s:LGREY = '#E8EAED' +let s:WHITE = '#FFFFFF' + +let s:TERM_RED = 167 +let s:TERM_GREEN = 71 +let s:TERM_YELLOW = 214 +let s:TERM_BLUE = 69 +let s:TERM_BLACK = 16 +let s:TERM_DGREY = 59 +let s:TERM_LGREY = 189 +let s:TERM_WHITE = 231 + +let s:GREY0 = s:WHITE +let s:GREY1 = s:LGREY +let s:GREY2 = s:DGREY +let s:BG = s:BLACK + +let s:TERM_GREY0 = s:TERM_WHITE +let s:TERM_GREY1 = s:TERM_LGREY +let s:TERM_GREY2 = s:TERM_DGREY +let s:TERM_BG = s:TERM_BLACK + +let s:N1 = [ s:BG, s:GREEN, s:TERM_BG, s:TERM_GREEN ] +let s:N2 = [ s:GREY1, s:GREY2, s:TERM_GREY1, s:TERM_GREY2 ] +let s:N3 = [ s:GREEN, s:BG, s:TERM_GREEN, s:TERM_BG ] +let g:airline#themes#google_dark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#google_dark#palette.normal_modified = { + \ 'airline_c': [ s:GREY0, s:BG, s:TERM_GREY0, s:TERM_BG, '' ], + \ } + +let s:I1 = [ s:BG, s:BLUE, s:TERM_BG, s:TERM_BLUE ] +let s:I2 = s:N2 +let s:I3 = [ s:BLUE, s:BG, s:TERM_BLUE, s:TERM_BG ] +let g:airline#themes#google_dark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#google_dark#palette.insert_modified = g:airline#themes#google_dark#palette.normal_modified + +let s:R1 = [ s:BG, s:RED, s:TERM_BG, s:TERM_RED ] +let s:R2 = s:N2 +let s:R3 = [ s:RED, s:BG, s:TERM_RED, s:TERM_BG ] +let g:airline#themes#google_dark#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) +let g:airline#themes#google_dark#palette.replace_modified = g:airline#themes#google_dark#palette.normal_modified + +let s:V1 = [ s:BG, s:YELLOW, s:TERM_BG, s:TERM_YELLOW ] +let s:V2 = s:N2 +let s:V3 = [ s:YELLOW, s:BG, s:TERM_YELLOW, s:TERM_BG ] +let g:airline#themes#google_dark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) +let g:airline#themes#google_dark#palette.visual_modified = g:airline#themes#google_dark#palette.normal_modified + +let s:IA1 = [ s:BG, s:GREY2, s:TERM_BG, s:TERM_GREY2 ] +let s:IA2 = s:N2 +let s:IA3 = [ s:GREY2, s:BG, s:TERM_GREY2, s:TERM_BG ] +let g:airline#themes#google_dark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) +let g:airline#themes#google_dark#palette.inactive_modified = g:airline#themes#google_dark#palette.normal_modified diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/google_light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/google_light.vim new file mode 100644 index 0000000..a01f695 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/google_light.vim @@ -0,0 +1,64 @@ +" vim-airline template by danrneal (http://github.com/danrneal) +" Google Scheme by Lisie Michel (https://github.com/google/vim-colorscheme-primary/) + +let g:airline#themes#google_light#palette = {} + +let s:RED = '#EA4335' +let s:GREEN = '#34A853' +let s:YELLOW = '#FBBC04' +let s:BLUE = '#4285F4' +let s:BLACK = '#202124' +let s:DGREY = '#5F6368' +let s:LGREY = '#E8EAED' +let s:WHITE = '#FFFFFF' + +let s:TERM_RED = 167 +let s:TERM_GREEN = 71 +let s:TERM_YELLOW = 214 +let s:TERM_BLUE = 69 +let s:TERM_BLACK = 16 +let s:TERM_DGREY = 59 +let s:TERM_LGREY = 189 +let s:TERM_WHITE = 231 + +let s:GREY0 = s:BLACK +let s:GREY1 = s:DGREY +let s:GREY2 = s:LGREY +let s:BG = s:WHITE + +let s:TERM_GREY0 = s:TERM_BLACK +let s:TERM_GREY1 = s:TERM_DGREY +let s:TERM_GREY2 = s:TERM_LGREY +let s:TERM_BG = s:TERM_WHITE + +let s:N1 = [ s:BG, s:GREEN, s:TERM_BG, s:TERM_GREEN ] +let s:N2 = [ s:GREY1, s:GREY2, s:TERM_GREY1, s:TERM_GREY2 ] +let s:N3 = [ s:GREEN, s:BG, s:TERM_GREEN, s:TERM_BG ] +let g:airline#themes#google_light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#google_light#palette.normal_modified = { + \ 'airline_c': [ s:GREY0, s:BG, s:TERM_GREY0, s:TERM_BG, '' ], + \ } + +let s:I1 = [ s:BG, s:BLUE, s:TERM_BG, s:TERM_BLUE ] +let s:I2 = s:N2 +let s:I3 = [ s:BLUE, s:BG, s:TERM_BLUE, s:TERM_BG ] +let g:airline#themes#google_light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#google_light#palette.insert_modified = g:airline#themes#google_light#palette.normal_modified + +let s:R1 = [ s:BG, s:RED, s:TERM_BG, s:TERM_RED ] +let s:R2 = s:N2 +let s:R3 = [ s:RED, s:BG, s:TERM_RED, s:TERM_BG ] +let g:airline#themes#google_light#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) +let g:airline#themes#google_light#palette.replace_modified = g:airline#themes#google_light#palette.normal_modified + +let s:V1 = [ s:BG, s:YELLOW, s:TERM_BG, s:TERM_YELLOW ] +let s:V2 = s:N2 +let s:V3 = [ s:YELLOW, s:BG, s:TERM_YELLOW, s:TERM_BG ] +let g:airline#themes#google_light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) +let g:airline#themes#google_light#palette.visual_modified = g:airline#themes#google_light#palette.normal_modified + +let s:IA1 = [ s:BG, s:GREY2, s:TERM_BG, s:TERM_GREY2 ] +let s:IA2 = s:N2 +let s:IA3 = [ s:GREY2, s:BG, s:TERM_GREY2, s:TERM_BG ] +let g:airline#themes#google_light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) +let g:airline#themes#google_light#palette.inactive_modified = g:airline#themes#google_light#palette.normal_modified diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/lessnoise.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/lessnoise.vim new file mode 100644 index 0000000..1a3913f --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/lessnoise.vim @@ -0,0 +1,182 @@ +" vim: et:ts=2:sts:sw=2 +" Author: @bekcpear +" https://gist.github.com/bekcpear/41fb86e0817dfb6620b757daf1e2aab0 + +scriptencoding utf-8 + +let g:airline#themes#lessnoise#palette = {} +"" +" Statusline sections: |a|b|c -- x|y|z|others +" COLOR DEFINE +let s:rac = ['#D75F5F', 167] " red accent fg +let s:nfg = ['#121212', 233] " normal fg; for a section +let s:ifg = s:nfg " insert fg; for a section +let s:rfg = s:nfg " replace fg; for a section +let s:vfg = s:nfg " visual fg; for a&z sections +let s:cfg = s:nfg " commandline fg; for all sections +let s:nbg = ['#AFFFFF', 159] " normal bg; for a section +let s:ibg = ['#FFAFD7', 218] " insert bg; for a section +let s:rbg = ['#FF5F5F', 203] " replace bg; for a section +let s:vbg = ['#FFFFAF', 229] " visual bg; for a&z sections +let s:cbg = ['#AFFFFF', 159] " commandline bg; for all sections + +let s:fg = ['#6C6C6C', 242] " other fg +let s:bg = ['#303030', 236] " other bg + +" tabline colors defined below + +let s:palt = { + \ 'airline_a': [ s:nfg[0], s:nbg[0], s:nfg[1], s:nbg[1], 'bold' ], + \ 'airline_b': [ '#EEEEEE', s:bg[0], 255, s:bg[1], 'NONE' ], + \ 'airline_c': [ '#9E9E9E', s:bg[0], 247, s:bg[1], 'italic' ], + \ 'airline_x': [ s:fg[0], s:bg[0], s:fg[1], s:bg[1], 'NONE' ], + \ 'airline_y': [ s:fg[0], s:bg[0], s:fg[1], s:bg[1], 'NONE' ], + \ 'airline_z': [ s:fg[0], s:bg[0], s:fg[1], s:bg[1], 'NONE' ] + \ } +let s:palt_m = { + \ 'airline_c': [ '#B2B2B2', s:bg[0], 249, s:bg[1], 'italic' ], + \ } +" get around vim-airline issue#2298 +" https://github.com/vim-airline/vim-airline/issues/2298 + if has('gui_running') + let s:palt.airline_y[2] = s:bg[1] + else + let s:palt.airline_y[0] = s:bg[0] + endif + +"" +" NORMAL +let g:airline#themes#lessnoise#palette.normal = s:palt +let g:airline#themes#lessnoise#palette.normal_modified = s:palt_m + +"" +" INSERT +let s:palt_i = deepcopy(s:palt) +let s:palt_i_m = deepcopy(s:palt_m) + +let s:palt_i.airline_a[0] = s:ifg[0] +let s:palt_i.airline_a[2] = s:ifg[1] +let s:palt_i.airline_a[1] = s:ibg[0] +let s:palt_i.airline_a[3] = s:ibg[1] + +let g:airline#themes#lessnoise#palette.insert = s:palt_i +let g:airline#themes#lessnoise#palette.insert_modified = s:palt_i_m + "let g:airline#themes#lessnoise#palette.insert_paste = {} + +"" +" TERMINAL +let g:airline#themes#lessnoise#palette.terminal = s:palt + +"" +" REPLACE +let s:palt_r = deepcopy(s:palt) +let s:palt_r_m = deepcopy(s:palt_m) + +let s:palt_r.airline_a[0] = s:rfg[0] +let s:palt_r.airline_a[2] = s:rfg[1] +let s:palt_r.airline_a[1] = s:rbg[0] +let s:palt_r.airline_a[3] = s:rbg[1] + +let g:airline#themes#lessnoise#palette.replace = s:palt_r +let g:airline#themes#lessnoise#palette.replace_modified = s:palt_r_m + +" +" VISUAL +let s:palt_v = deepcopy(s:palt) +let s:palt_v_m = deepcopy(s:palt_m) + +let s:palt_v.airline_a[0] = s:vfg[0] +let s:palt_v.airline_a[2] = s:vfg[1] +let s:palt_v.airline_a[1] = s:vbg[0] +let s:palt_v.airline_a[3] = s:vbg[1] +let s:palt_v.airline_z[0] = s:vfg[0] +let s:palt_v.airline_z[2] = s:vfg[1] +let s:palt_v.airline_z[1] = s:vbg[0] +let s:palt_v.airline_z[3] = s:vbg[1] + +let g:airline#themes#lessnoise#palette.visual = s:palt_v +let g:airline#themes#lessnoise#palette.visual_modified = s:palt_v_m + +" +" INACTIVE +let s:palt_d = deepcopy(s:palt) +let s:palt_d_m = deepcopy(s:palt_m) + +let s:palt_d.airline_a[0] = s:fg[0] +let s:palt_d.airline_a[1] = s:bg[0] +let s:palt_d.airline_a[2] = s:fg[1] +let s:palt_d.airline_a[3] = s:bg[1] +let s:palt_d.airline_b[0] = s:fg[0] +let s:palt_d.airline_b[2] = s:fg[1] +let s:palt_d.airline_c[0] = s:fg[0] +let s:palt_d.airline_c[2] = s:fg[1] +let s:palt_d.airline_c[4] = 'NONE' + +let g:airline#themes#lessnoise#palette.inactive = s:palt_d +let g:airline#themes#lessnoise#palette.inactive_modified = s:palt_d_m + +" +" COMMANDLINE +let s:palt_c = deepcopy(s:palt) + +for pk in keys(s:palt_c) + let s:palt_c[pk][0] = s:cfg[0] + let s:palt_c[pk][2] = s:cfg[1] + let s:palt_c[pk][1] = s:cbg[0] + let s:palt_c[pk][3] = s:cbg[1] +endfor +" get around vim-airline issue#2298 +" https://github.com/vim-airline/vim-airline/issues/2298 + if has('gui_running') + let s:palt_c.airline_b[2] = s:cbg[1] + let s:palt_c.airline_y[2] = s:cbg[1] + else + let s:palt_c.airline_b[0] = s:cbg[0] + let s:palt_c.airline_y[0] = s:cbg[0] + endif + +let g:airline#themes#lessnoise#palette.commandline = s:palt_c + +" +" READONLY Accent, red +let g:airline#themes#lessnoise#palette.accents = { + \ 'red': [s:rac[0], '', s:rac[1], ''] + \ } + +" +" TABLINE +let s:atbg = ['#080808', 232] +let s:atl = ['#444444', s:atbg[0], 238, s:atbg[1], 'NONE'] +let s:ats = ['#D0D0D0', '#1C1C1C', 252, 234, 'NONE'] +let s:atf = s:atl +let s:at = deepcopy(s:atl) +let s:at[0] = '#6C6C6C' +let s:at[2] = 242 +let s:atm = deepcopy(s:ats) +let s:atu = deepcopy(s:at) +let s:atm[4] = 'italic,bold' +let s:atu[4] = 'italic,bold' " according to issue#2298, this attribute may be invalid +let g:airline#themes#lessnoise#palette.tabline = { + \ 'airline_tablabel' : s:atl, + \ 'airline_tab' : s:at, + \ 'airline_tabsel' : s:ats, + \ 'airline_tabfill' : s:atf, + \ 'airline_tabmod' : s:atm, + \ 'airline_tabhid' : s:at, + \ 'airline_tabmod_unsel' : s:atu, + \ 'airline_tab_right' : s:at, + \ 'airline_tabsel_right' : s:ats, + \ 'airline_tabfill_right' : s:atf, + \ 'airline_tabmod_right' : s:atm, + \ 'airline_tabhid_right' : s:at, + \ 'airline_tabmod_unsel_right': s:atu + \ } + +" +" CtrlP +if get(g:, 'loaded_ctrlp', 0) + let g:airline#themes#lessnoise#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( + \ [ '#AFD7FF', '#5F87FF', 153, 69, 'NONE'], + \ [ '#FFFFFF', '#87AFFF', 231, 111, 'NONE'], + \ [ '#5F87FF', '#FFFFFF', 69, 231, 'bold']) +endif diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/light.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/light.vim index d9fe844..70e3eec 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/light.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/light.vim @@ -4,8 +4,10 @@ let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ] let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ] let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ] let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#light#palette.normal['airline_term'] = g:airline#themes#light#palette.normal['airline_c'] let g:airline#themes#light#palette.normal_modified = { - \ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , + \ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , + \ 'airline_term': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , \ } diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/lighthaus.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/lighthaus.vim new file mode 100644 index 0000000..f3cbf79 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/lighthaus.vim @@ -0,0 +1,132 @@ +" Lighthaus Color theme for Vim Airline +" GIT: https://github.com/lighthaus-theme/vim +" Author: Adhiraj Sirohi (https://github.com/brutuski) +" Vasundhara Sharma (https://github.com/vasundhasauras) + +" Copyright © 2020-Present Lighthaus Theme +" Copyright © 2020-Present Adhiraj Sirohi +" Copyright © 2020-Present Vasundhara Sharma + + +let s:lighthaus_vim_v='1.0.2' + + +" COLOR PALETTE + +let s:lh_gui1='#21252D' +let s:lh_gui2='#00BFA4' +let s:lh_gui3='#FFFADE' +let s:lh_gui4='#090B26' +let s:lh_gui5='#50C16E' +let s:lh_gui6='#ED722E' +let s:lh_gui7='#FF5050' +let s:lh_gui8='#CCCCCC' +let s:lh_gui9='#FC2929' +let s:lh_gui10='#D68EB2' +let s:lh_gui11='#E25600' +let s:lh_gui12='#FF4D00' +let s:lh_gui13='#FFFF00' + + +let s:lh_cterm1='234' +let s:lh_cterm2='43' +let s:lh_cterm3='230' +let s:lh_cterm4='233' +let s:lh_cterm5='71' +let s:lh_cterm6='208' +let s:lh_cterm7='203' +let s:lh_cterm8='188' +let s:lh_cterm9='196' +let s:lh_cterm10='175' +let s:lh_cterm11='166' +let s:lh_cterm12='202' +let s:lh_cterm13='226' + +let g:airline#themes#lighthaus#palette = {} + + +" NORMAL MODE +let s:N1 = [ s:lh_gui1 , s:lh_gui2 , s:lh_cterm1, s:lh_cterm2 ] +let s:N2 = [ s:lh_gui3 , s:lh_gui4 , s:lh_cterm3, s:lh_cterm4 ] +let s:N3 = [ s:lh_gui2 , s:lh_gui1 , s:lh_cterm2, s:lh_cterm1 ] +let g:airline#themes#lighthaus#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + + +" INSERT MODE +let s:I1 = [ s:lh_gui1 , s:lh_gui5 , s:lh_cterm1, s:lh_cterm5 ] +let s:I2 = [ s:lh_gui3 , s:lh_gui4 , s:lh_cterm3, s:lh_cterm4 ] +let s:I3 = [ s:lh_gui5 , s:lh_gui1 , s:lh_cterm5, s:lh_cterm1 ] +let g:airline#themes#lighthaus#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) + + +" VISUAL MODE +let s:V1 = [ s:lh_gui1 , s:lh_gui6 , s:lh_cterm1, s:lh_cterm6 ] +let s:V2 = [ s:lh_gui3 , s:lh_gui4 , s:lh_cterm3, s:lh_cterm4 ] +let s:V3 = [ s:lh_gui6 , s:lh_gui1 , s:lh_cterm6, s:lh_cterm1 ] +let g:airline#themes#lighthaus#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) + + +" REPLACE MODE +let s:R1 = [ s:lh_gui1 , s:lh_gui7 , s:lh_cterm1, s:lh_cterm7 ] +let s:R2 = [ s:lh_gui3 , s:lh_gui4 , s:lh_cterm3, s:lh_cterm4 ] +let s:R3 = [ s:lh_gui7 , s:lh_gui1 , s:lh_cterm7, s:lh_cterm1 ] +let g:airline#themes#lighthaus#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) + + +" INACTIVE MODE +let s:IN1 = [ s:lh_gui8 , s:lh_gui1 , s:lh_cterm8, s:lh_cterm1 ] +let s:IN2 = [ s:lh_gui8 , s:lh_gui1 , s:lh_cterm8, s:lh_cterm1 ] +let s:IN3 = [ s:lh_gui8 , s:lh_gui1 , s:lh_cterm8, s:lh_cterm1 ] +let g:airline#themes#lighthaus#palette.inactive = airline#themes#generate_color_map(s:IN1, s:IN2, s:IN3) + + +" ACCENTS +let g:airline#themes#lighthaus#palette.accents = { + \ 'red': [ s:lh_gui9 , '' , s:lh_cterm9 , '' ] + \ } + + +" WARNING +let g:airline#themes#lighthaus#palette.normal_modified = { + \ 'airline_c': [ s:lh_gui10 , s:lh_gui1 , s:lh_cterm10 , s:lh_cterm1 , '' ] , + \ } + +let g:airline#themes#lighthaus#palette.insert_modified = { + \ 'airline_c': [ s:lh_gui11 , s:lh_gui1 , s:lh_cterm11 , s:lh_cterm1 , '' ] , + \ } + +let g:airline#themes#lighthaus#palette.visual_modified = { + \ 'airline_c': [ s:lh_gui12 , s:lh_gui1 , s:lh_cterm12 , s:lh_cterm1 , '' ] , + \ } + +let g:airline#themes#lighthaus#palette.replace_modified = { + \ 'airline_c': [ s:lh_gui13 , s:lh_gui1 , s:lh_cterm13 , s:lh_cterm1 , '' ] , + \ } + + +" ERROR +let g:airline#themes#lighthaus#palette.normal_error = { + \ 'airline_c': [ s:lh_gui9 , s:lh_gui1 , s:lh_cterm9 , s:lh_cterm1 , '' ] , + \ } + +let g:airline#themes#lighthaus#palette.insert_error = { + \ 'airline_c': [ s:lh_gui9 , s:lh_gui1 , s:lh_cterm9 , s:lh_cterm1 , '' ] , + \ } + + +" SETTINGS +let g:airline_symbols.paste = 'P' +let g:airline_symbols.spell = 'S' +let g:airline_section_z = airline#section#create(['%1p%% — ', + \ '%l%#__restore__#', ':%c']) + + +" CtrlP +if !get(g:, 'loaded_ctrlp', 0) + finish +endif + +let s:CP1 = [ s:lh_gui1 , s:lh_gui7 , s:lh_cterm1, s:lh_cterm7 ] +let s:CP2 = [ s:lh_gui1 , s:lh_gui2 , s:lh_cterm1, s:lh_cterm2 ] +let s:CP3 = [ s:lh_gui1 , s:lh_gui5 , s:lh_cterm1, s:lh_cterm5 ] +let g:airline#themes#lighthaus#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(s:CP1, s:CP2, s:CP3) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/nord_minimal.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/nord_minimal.vim new file mode 100644 index 0000000..4b60b92 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/nord_minimal.vim @@ -0,0 +1,60 @@ +let g:airline#themes#nord_minimal#palette = {} +let s:gui00 = '#2e3440' +let s:gui01 = '#3b4252' +let s:gui02 = '#434c5e' +let s:gui03 = '#4c566a' +let s:gui04 = '#d8dee9' +let s:gui05 = '#e5e9f0' +let s:gui06 = '#eceff4' +let s:gui07 = '#8fbcbb' +let s:gui08 = '#88c0d0' +let s:gui09 = '#81a1c1' +let s:gui0A = '#5e81ac' +let s:gui0B = '#bf616a' +let s:gui0C = '#d08770' +let s:gui0D = '#ebcb8b' +let s:gui0E = '#a3be8c' +let s:gui0F = '#b48ead' + +let s:cterm00 = 0 +let s:cterm01 = 0 +let s:cterm02 = 59 +let s:cterm03 = 102 +let s:cterm04 = 145 +let s:cterm05 = 188 +let s:cterm06 = 253 +let s:cterm07 = 15 +let s:cterm08 = 166 +let s:cterm09 = 203 +let s:cterm0A = 214 +let s:cterm0B = 29 +let s:cterm0C = 12 +let s:cterm0D = 12 +let s:cterm0E = 134 +let s:cterm0F = 12 + +let s:N1 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:N2 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:N3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let g:airline#themes#nord_minimal#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + +let s:I1 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:I2 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:I3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let g:airline#themes#nord_minimal#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) + +let s:R1 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:R2 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:R3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let g:airline#themes#nord_minimal#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) + +let s:V1 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:V2 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:V3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let g:airline#themes#nord_minimal#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) + +let s:IA1 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:IA2 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let s:IA3 = [ s:gui09, s:gui02, s:cterm09, s:cterm02 ] +let g:airline#themes#nord_minimal#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3) + diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/papercolor.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/papercolor.vim index fb8022b..a5d73ac 100644 --- a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/papercolor.vim +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/papercolor.vim @@ -49,6 +49,7 @@ let g:airline#themes#papercolor#palette.visual_modified = { " Inactive: let s:IA = [ '#585858' , '#e4e4e4' , 240 , 254 , '' ] let g:airline#themes#papercolor#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) +let g:airline#themes#papercolor#palette.inactive.airline_c = s:N2 let g:airline#themes#papercolor#palette.inactive_modified = { \ 'airline_c': [ '#585858' , '#e4e4e4' , 240 , 254 , '' ] , \ } diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/selenized.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/selenized.vim new file mode 100644 index 0000000..6a60ad4 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/selenized.vim @@ -0,0 +1,136 @@ +" MIT License. Copyright (c) 2021 novenary +" vim: et ts=2 sts=2 sw=2 tw=80 + +scriptencoding utf-8 + +let s:term_bg_0 = 'NONE' +let s:term_bg_1 = 0 +let s:term_bg_2 = 8 +let s:term_dim_0 = 7 +let s:term_fg_0 = 'NONE' +let s:term_fg_1 = 15 + +let s:term_red = 1 +let s:term_green = 2 +let s:term_yellow = 3 +let s:term_blue = 4 +let s:term_magenta = 5 +let s:term_cyan = 6 +let s:term_orange = s:term_yellow +let s:term_violet = s:term_magenta + +let s:term_br_red = 9 +let s:term_br_green = 10 +let s:term_br_yellow = 11 +let s:term_br_blue = 12 +let s:term_br_magenta = 13 +let s:term_br_cyan = 14 +let s:term_br_orange = s:term_br_yellow +let s:term_br_violet = s:term_br_magenta + +if &background ==# 'dark' + let s:bg_0 = '#112e38' + let s:bg_1 = '#163945' + let s:bg_2 = '#254a57' + let s:dim_0 = '#61777c' + let s:fg_0 = '#9faeae' + let s:fg_1 = '#bfd0d0' + + let s:red = '#f13c3e' + let s:green = '#69ad21' + let s:yellow = '#d1a416' + let s:blue = '#3a82f8' + let s:magenta = '#e75bb3' + let s:cyan = '#42bdaa' + let s:orange = '#e26f35' + let s:violet = '#9b72e9' + + let s:br_red = '#ff4b49' + let s:br_green = '#78be2e' + let s:br_yellow = '#e4b424' + let s:br_blue = '#4a91ff' + let s:br_magenta = '#fb69c4' + let s:br_cyan = '#50cfba' + let s:br_orange = '#f67e41' + let s:br_violet = '#ab80fc' +else + let s:bg_0 = '#faf0d2' + let s:bg_1 = '#e7ddc0' + let s:bg_2 = '#cbc2a6' + let s:dim_0 = '#7e8783' + let s:fg_0 = '#43545a' + let s:fg_1 = '#2d3c42' + + let s:red = '#c00221' + let s:green = '#3f8100' + let s:yellow = '#9b7600' + let s:blue = '#005dcc' + let s:magenta = '#b73088' + let s:cyan = '#038d7c' + let s:orange = '#b04713' + let s:violet = '#714cbc' + + let s:br_red = '#b9001e' + let s:br_green = '#3a7b00' + let s:br_yellow = '#957000' + let s:br_blue = '#0059c6' + let s:br_magenta = '#b12b82' + let s:br_cyan = '#008777' + let s:br_orange = '#a9430f' + let s:br_violet = '#6b47b6' +endif + +let g:airline#themes#selenized#palette = {} + +let s:NA = [ s:bg_1, s:green, s:term_bg_1, s:term_green ] +let s:NB = [ s:fg_0, s:bg_2, s:term_fg_0, s:term_bg_2 ] +let s:NC = [ s:dim_0, s:bg_1, s:term_dim_0, s:term_bg_1 ] +let s:NC_modified = [ s:yellow, s:NC[1], s:term_yellow, s:NC[3] ] +let g:airline#themes#selenized#palette.normal = airline#themes#generate_color_map(s:NA, s:NB, s:NC) +let g:airline#themes#selenized#palette.normal_modified = { + \ 'airline_c': s:NC_modified, + \ } + +let s:IA = [ s:bg_1, s:blue, s:term_bg_1, s:term_blue ] +let g:airline#themes#selenized#palette.insert = airline#themes#generate_color_map(s:IA, s:NB, s:NC) +let g:airline#themes#selenized#palette.terminal = airline#themes#generate_color_map(s:IA, s:NB, s:NC) +let g:airline#themes#selenized#palette.insert_modified = copy(g:airline#themes#selenized#palette.normal_modified) + +let s:RA = [ s:bg_1, s:red, s:term_bg_1, s:term_red ] +let g:airline#themes#selenized#palette.replace = airline#themes#generate_color_map(s:RA, s:NB, s:NC) +let g:airline#themes#selenized#palette.replace_modified = copy(g:airline#themes#selenized#palette.normal_modified) + +let s:VA = [ s:bg_1, s:violet, s:term_bg_1, s:term_violet ] +let g:airline#themes#selenized#palette.visual = airline#themes#generate_color_map(s:VA, s:NB, s:NC) +let g:airline#themes#selenized#palette.visual_modified = copy(g:airline#themes#selenized#palette.normal_modified) + +let s:INACTIVE = [ s:dim_0, s:bg_2, s:term_dim_0, s:term_bg_2 ] +let s:INACTIVE_modified = [ s:yellow, s:INACTIVE[1], s:term_yellow, s:INACTIVE[3] ] +let g:airline#themes#selenized#palette.inactive = airline#themes#generate_color_map(s:INACTIVE, s:INACTIVE, s:INACTIVE) +let g:airline#themes#selenized#palette.inactive_modified = { + \ 'airline_c': s:INACTIVE_modified, + \ } + +let s:WARNING = [ s:bg_1, s:br_yellow, s:term_bg_1, s:term_br_yellow ] +let g:airline#themes#selenized#palette.normal.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.normal_modified.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.insert.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.insert_modified.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.replace.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.replace_modified.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.visual.airline_warning = s:WARNING +let g:airline#themes#selenized#palette.visual_modified.airline_warning = s:WARNING + +let s:ERROR = [ s:bg_1, s:br_red, s:term_bg_1, s:term_br_red ] +let g:airline#themes#selenized#palette.normal.airline_error = s:ERROR +let g:airline#themes#selenized#palette.normal_modified.airline_error = s:ERROR +let g:airline#themes#selenized#palette.insert.airline_error = s:ERROR +let g:airline#themes#selenized#palette.insert_modified.airline_error = s:ERROR +let g:airline#themes#selenized#palette.replace.airline_error = s:ERROR +let g:airline#themes#selenized#palette.replace_modified.airline_error = s:ERROR +let g:airline#themes#selenized#palette.visual.airline_error = s:ERROR +let g:airline#themes#selenized#palette.visual_modified.airline_error = s:ERROR + +let g:airline#themes#selenized#palette.accents = { + \ 'red': [ s:red, '', s:term_red, '' ] + \ } diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/selenized_bw.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/selenized_bw.vim new file mode 100644 index 0000000..b34f3af --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/selenized_bw.vim @@ -0,0 +1,136 @@ +" MIT License. Copyright (c) 2021 novenary +" vim: et ts=2 sts=2 sw=2 tw=80 + +scriptencoding utf-8 + +let s:term_bg_0 = 'NONE' +let s:term_bg_1 = 0 +let s:term_bg_2 = 8 +let s:term_dim_0 = 7 +let s:term_fg_0 = 'NONE' +let s:term_fg_1 = 15 + +let s:term_red = 1 +let s:term_green = 2 +let s:term_yellow = 3 +let s:term_blue = 4 +let s:term_magenta = 5 +let s:term_cyan = 6 +let s:term_orange = s:term_yellow +let s:term_violet = s:term_magenta + +let s:term_br_red = 9 +let s:term_br_green = 10 +let s:term_br_yellow = 11 +let s:term_br_blue = 12 +let s:term_br_magenta = 13 +let s:term_br_cyan = 14 +let s:term_br_orange = s:term_br_yellow +let s:term_br_violet = s:term_br_magenta + +if &background ==# 'dark' + let s:bg_0 = '#181818' + let s:bg_1 = '#252525' + let s:bg_2 = '#3b3b3b' + let s:dim_0 = '#777777' + let s:fg_0 = '#b9b9b9' + let s:fg_1 = '#dedede' + + let s:red = '#ed4a46' + let s:green = '#70b433' + let s:yellow = '#dbb32d' + let s:blue = '#368aeb' + let s:magenta = '#eb6eb7' + let s:cyan = '#3fc5b7' + let s:orange = '#e67f43' + let s:violet = '#a580e2' + + let s:br_red = '#ff5e56' + let s:br_green = '#83c746' + let s:br_yellow = '#efc541' + let s:br_blue = '#4f9cfe' + let s:br_magenta = '#ff81ca' + let s:br_cyan = '#56d8c9' + let s:br_orange = '#fa9153' + let s:br_violet = '#b891f5' +else + let s:bg_0 = '#ffffff' + let s:bg_1 = '#ebebeb' + let s:bg_2 = '#cdcdcd' + let s:dim_0 = '#878787' + let s:fg_0 = '#474747' + let s:fg_1 = '#282828' + + let s:red = '#d6000c' + let s:green = '#1d9700' + let s:yellow = '#c49700' + let s:blue = '#0064e4' + let s:magenta = '#dd0f9d' + let s:cyan = '#00ad9c' + let s:orange = '#d04a00' + let s:violet = '#7f51d6' + + let s:br_red = '#bf0000' + let s:br_green = '#008400' + let s:br_yellow = '#af8500' + let s:br_blue = '#0054cf' + let s:br_magenta = '#c7008b' + let s:br_cyan = '#009a8a' + let s:br_orange = '#ba3700' + let s:br_violet = '#6b40c3' +endif + +let g:airline#themes#selenized_bw#palette = {} + +let s:NA = [ s:bg_1, s:green, s:term_bg_1, s:term_green ] +let s:NB = [ s:fg_0, s:bg_2, s:term_fg_0, s:term_bg_2 ] +let s:NC = [ s:dim_0, s:bg_1, s:term_dim_0, s:term_bg_1 ] +let s:NC_modified = [ s:yellow, s:NC[1], s:term_yellow, s:NC[3] ] +let g:airline#themes#selenized_bw#palette.normal = airline#themes#generate_color_map(s:NA, s:NB, s:NC) +let g:airline#themes#selenized_bw#palette.normal_modified = { + \ 'airline_c': s:NC_modified, + \ } + +let s:IA = [ s:bg_1, s:blue, s:term_bg_1, s:term_blue ] +let g:airline#themes#selenized_bw#palette.insert = airline#themes#generate_color_map(s:IA, s:NB, s:NC) +let g:airline#themes#selenized_bw#palette.terminal = airline#themes#generate_color_map(s:IA, s:NB, s:NC) +let g:airline#themes#selenized_bw#palette.insert_modified = copy(g:airline#themes#selenized_bw#palette.normal_modified) + +let s:RA = [ s:bg_1, s:red, s:term_bg_1, s:term_red ] +let g:airline#themes#selenized_bw#palette.replace = airline#themes#generate_color_map(s:RA, s:NB, s:NC) +let g:airline#themes#selenized_bw#palette.replace_modified = copy(g:airline#themes#selenized_bw#palette.normal_modified) + +let s:VA = [ s:bg_1, s:violet, s:term_bg_1, s:term_violet ] +let g:airline#themes#selenized_bw#palette.visual = airline#themes#generate_color_map(s:VA, s:NB, s:NC) +let g:airline#themes#selenized_bw#palette.visual_modified = copy(g:airline#themes#selenized_bw#palette.normal_modified) + +let s:INACTIVE = [ s:dim_0, s:bg_2, s:term_dim_0, s:term_bg_2 ] +let s:INACTIVE_modified = [ s:yellow, s:INACTIVE[1], s:term_yellow, s:INACTIVE[3] ] +let g:airline#themes#selenized_bw#palette.inactive = airline#themes#generate_color_map(s:INACTIVE, s:INACTIVE, s:INACTIVE) +let g:airline#themes#selenized_bw#palette.inactive_modified = { + \ 'airline_c': s:INACTIVE_modified, + \ } + +let s:WARNING = [ s:bg_1, s:br_yellow, s:term_bg_1, s:term_br_yellow ] +let g:airline#themes#selenized_bw#palette.normal.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.normal_modified.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.insert.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.insert_modified.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.replace.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.replace_modified.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.visual.airline_warning = s:WARNING +let g:airline#themes#selenized_bw#palette.visual_modified.airline_warning = s:WARNING + +let s:ERROR = [ s:bg_1, s:br_red, s:term_bg_1, s:term_br_red ] +let g:airline#themes#selenized_bw#palette.normal.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.normal_modified.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.insert.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.insert_modified.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.replace.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.replace_modified.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.visual.airline_error = s:ERROR +let g:airline#themes#selenized_bw#palette.visual_modified.airline_error = s:ERROR + +let g:airline#themes#selenized_bw#palette.accents = { + \ 'red': [ s:red, '', s:term_red, '' ] + \ } diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/seoul256.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/seoul256.vim new file mode 100644 index 0000000..fe5888d --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/seoul256.vim @@ -0,0 +1,63 @@ +" Created by JB Kopecky (https://github.com/jbkopecky), based on seoul256 themed +" by Junegunn Choi (https://github.com/junegunn/seoul256.vim) + +let g:airline#themes#seoul256#palette = {} + +function! airline#themes#seoul256#refresh() abort + let M0 = airline#themes#get_highlight('Special') + let accents_group = airline#themes#get_highlight('Special') + let modified_group = [M0[0], '', M0[2], '', ''] + let warning_group = airline#themes#get_highlight2(['airline_warning', 'bg'], ['airline_warning', 'fg']) + + let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['StatusLine', 'fg']) + let s:N2 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['StatusLineNC', 'fg']) + let s:N3 = airline#themes#get_highlight2(['StatusLineNC', 'bg'], ['CursorLine', 'bg']) + let g:airline#themes#seoul256#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) + let g:airline#themes#seoul256#palette.normal_modified = { 'airline_c': modified_group } + let g:airline#themes#seoul256#palette.normal.airline_warning = warning_group + let g:airline#themes#seoul256#palette.normal_modified.airline_warning = warning_group + + let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLineSel', 'bg']) + let s:I2 = s:N2 + let s:I3 = airline#themes#get_highlight2(['Normal', 'fg'], ['StatusLineNC', 'fg']) + let g:airline#themes#seoul256#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) + let g:airline#themes#seoul256#palette.insert_modified = g:airline#themes#seoul256#palette.normal_modified + let g:airline#themes#seoul256#palette.insert.airline_warning = g:airline#themes#seoul256#palette.normal.airline_warning + let g:airline#themes#seoul256#palette.insert_modified.airline_warning = g:airline#themes#seoul256#palette.normal_modified.airline_warning + + let s:R1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Structure', 'fg']) + let s:R2 = s:I2 + let s:R3 = s:I3 + let g:airline#themes#seoul256#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) + let g:airline#themes#seoul256#palette.replace_modified = g:airline#themes#seoul256#palette.normal_modified + let g:airline#themes#seoul256#palette.replace.airline_warning = g:airline#themes#seoul256#palette.normal.airline_warning + let g:airline#themes#seoul256#palette.replace_modified.airline_warning = g:airline#themes#seoul256#palette.normal_modified.airline_warning + + let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['ErrorMsg', 'bg']) + let s:V2 = s:N2 + let s:V3 = airline#themes#get_highlight2(['Normal', 'bg'], ['TabLine', 'fg']) + let g:airline#themes#seoul256#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) + let g:airline#themes#seoul256#palette.visual_modified = { 'airline_c': [ s:V3[0], '', s:V3[2], '', '' ] } + let g:airline#themes#seoul256#palette.visual.airline_warning = g:airline#themes#seoul256#palette.normal.airline_warning + let g:airline#themes#seoul256#palette.visual_modified.airline_warning = g:airline#themes#seoul256#palette.normal_modified.airline_warning + + let s:IA = airline#themes#get_highlight2(['TabLine', 'fg'], ['CursorLine', 'bg']) + let g:airline#themes#seoul256#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) + let g:airline#themes#seoul256#palette.inactive_modified = { 'airline_c': modified_group } + + let g:airline#themes#seoul256#palette.accents = { 'red': accents_group } + + let s:TF = airline#themes#get_highlight2(['Normal', 'bg'], ['Normal', 'bg']) + let g:airline#themes#seoul256#palette.tabline = { + \ 'airline_tab': s:N2, + \ 'airline_tabsel': s:N1, + \ 'airline_tabtype': s:V1, + \ 'airline_tabfill': s:TF, + \ 'airline_tabhid': s:IA, + \ 'airline_tabmod': s:I1 + \ } +endfunction + +call airline#themes#seoul256#refresh() + + diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/supernova.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/supernova.vim new file mode 100644 index 0000000..9376d73 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/supernova.vim @@ -0,0 +1,62 @@ +let g:airline#themes#supernova#palette = {} +let g:airline#themes#supernova#palette.accents = { + \ 'red': [ '#d40059' , '' , 81 , '' , '' ], + \ } + +" Normal Mode: +let s:N1 = [ '#585858' , '#e4e4e4' , 235 , 73 ] " Mode +let s:N2 = [ '#e4e4e4' , '#242e33' , 252 , 240 ] " Info +let s:N3 = [ '#eeeeee' , '#1D2529' , 248 , 235 ] " StatusLine + +let g:airline#themes#supernova#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) +let g:airline#themes#supernova#palette.normal_modified = { + \ 'airline_c': [ '#eeeeee' , '#1D2529' , 255 , 235 , '' ] , + \ } + +" Insert Mode: +let s:I1 = [ '#585858' , '#e4e4e4' , 254 , 54 ] " Mode +let s:I2 = [ '#e4e4e4' , '#242e33' , 252 , 240 ] " Info +let s:I3 = [ '#eeeeee' , '#1D2529' , 248 , 235 ] " StatusLine + +let g:airline#themes#supernova#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) +let g:airline#themes#supernova#palette.insert_modified = { + \ 'airline_c': [ '#eeeeee' , '#1D2529' , 255 , 235 , '' ] , + \ } + +" Replace Mode: +let s:R1 = [ '#585858' , '#e4e4e4' , 254 , 89 ] " Mode +let s:R2 = [ '#e4e4e4' , '#242e33' , 252 , 240 ] " Info +let s:R3 = [ '#eeeeee' , '#1D2529' , 248 , 235 ] " StatusLine + +let g:airline#themes#supernova#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) +let g:airline#themes#supernova#palette.replace.airline_a = [ '#d7005f' , '#e4e4e4' , 254 , 89, '' ] +let g:airline#themes#supernova#palette.replace_modified = { + \ 'airline_c': [ '#eeeeee' , '#1D2529' , 255 , 235 , '' ] , + \ } + +" Visual Mode: +let s:V1 = [ '#1D2529', '#e4e4e4', 235, 32 ] +let s:V2 = [ '', '#242e33', '', 240 ] +let s:V3 = [ '#e4e4e4', '#1D2529', 248, 235 ] + +let g:airline#themes#supernova#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) +let g:airline#themes#supernova#palette.visual_modified = { + \ 'airline_c': [ '#e4e4e4', '#1D2529', 255, 235 ] , + \ } + +" Inactive: +let s:IA = [ '#585858' , '#e4e4e4' , 252 , 238 , '' ] +let g:airline#themes#supernova#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) +let g:airline#themes#supernova#palette.inactive.airline_c = s:N2 +let g:airline#themes#supernova#palette.inactive_modified = { + \ 'airline_c': [ '#585864' , '#e4e4e4' , 255 , 238 , '' ] , + \ } + +" CtrlP: +if !get(g:, 'loaded_ctrlp', 0) + finish +endif +let g:airline#themes#supernova#palette.ctrlp = airline#extensions#ctrlp#generate_color_map( + \ [ '#e4e4e4' , '#1D2529' , 235 , 60 , '' ] , + \ [ '#e4e4e4' , '#242e33' , 254 , 240 , '' ] , + \ [ '#585858' , '#e4e4e4' , 248 , 235 , 'bold' ] ) diff --git a/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/transparent.vim b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/transparent.vim new file mode 100644 index 0000000..f48f21a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline-themes/autoload/airline/themes/transparent.vim @@ -0,0 +1,155 @@ +"FROM https://github.com/khatiba + +" Colors +let s:gray = [245, '#3f4b59'] +let s:darkgray = [245, '#1d1f21'] +let s:golden = [143, '#BBE67E'] +let s:pink = [131, '#F07178'] +let s:blue = [ 67, '#D4BFFF'] +let s:orange = [166, '#ffae57'] +let s:outerfg = [ 16, '#8d96a1'] +let s:outerfgi = [ 16, '#2f3d4d'] + +" Backgrounds +let s:outerbg = [ 16, 'NONE'] +let s:innerbg = [234, 'NONE'] + +" Normal mode +let s:N1 = [s:outerfg[1], s:outerbg[1], s:outerfg[0], s:gray[0]] +let s:N3 = [s:gray[1] , s:innerbg[1], s:gray[0] , s:innerbg[0]] + +" Normal mode - modified +let s:NM1 = [s:darkgray[1], s:orange[1], s:darkgray[0], s:orange[0]] +let s:NM3 = [s:orange[1] , s:outerbg[1], s:orange[0], s:darkgray[0]] + +" Insert mode +let s:I1 = [s:darkgray[1], s:golden[1], s:outerfg[0], s:golden[0]] +let s:I3 = [s:golden[1] , s:innerbg[1], s:golden[0], s:innerbg[0]] + +" Visual mode +let s:V1 = [s:darkgray[1], s:pink[1], s:outerfg[0], s:pink[0]] +let s:V3 = [s:pink[1] , s:innerbg[1], s:pink[0], s:innerbg[0]] + +" Replace mode +let s:R1 = [s:darkgray[1], s:blue[1], s:outerfg[0], s:blue[0]] +let s:R3 = [s:blue[1], s:innerbg[1], s:blue[0], s:innerbg[0]] + +" Inactive pane +let s:IA = [s:darkgray[1], s:outerbg[1], s:innerbg[0], s:innerbg[0]] +let s:IAc = [s:gray[1], s:outerbg[1], s:outerbg[0], s:outerbg[0]] + +let g:airline#themes#transparent#palette = {} +let g:airline#themes#transparent#palette.accents = { + \ 'red': ['#d70000', '', 160, '', '']} + +let g:airline#themes#transparent#palette.inactive = { + \ 'airline_a': s:IA, + \ 'airline_b': s:IA, + \ 'airline_c': s:IAc, + \ 'airline_x': s:IA, + \ 'airline_y': s:IA, + \ 'airline_z': s:IA} + +let g:airline#themes#transparent#palette.inactive_modified = { + \ 'airline_a': s:IA, + \ 'airline_b': s:IA, + \ 'airline_c': s:NM3, + \ 'airline_x': s:IA, + \ 'airline_y': s:IA, + \ 'airline_z': s:IA} + +let g:airline#themes#transparent#palette.normal = { + \ 'airline_a': s:N1, + \ 'airline_b': s:N3, + \ 'airline_c': s:N3, + \ 'airline_x': s:N3, + \ 'airline_y': s:N3, + \ 'airline_z': s:N3} + +let g:airline#themes#transparent#palette.normal_modified = { + \ 'airline_a': s:NM1, + \ 'airline_b': s:N3, + \ 'airline_c': s:N3, + \ 'airline_x': s:N3, + \ 'airline_y': s:N3, + \ 'airline_z': s:NM3} + +let g:airline#themes#transparent#palette.insert = { + \ 'airline_a': s:I1, + \ 'airline_b': s:N3, + \ 'airline_c': s:N3, + \ 'airline_x': s:N3, + \ 'airline_y': s:N3, + \ 'airline_z': s:I3} +let g:airline#themes#transparent#palette.insert_modified = {} + +let g:airline#themes#transparent#palette.replace = { + \ 'airline_a': s:R1, + \ 'airline_b': s:N3, + \ 'airline_c': s:N3, + \ 'airline_x': s:N3, + \ 'airline_y': s:N3, + \ 'airline_z': s:R3} +let g:airline#themes#transparent#palette.replace_modified = {} + +let g:airline#themes#transparent#palette.visual = { + \ 'airline_a': s:V1, + \ 'airline_b': s:N3, + \ 'airline_c': s:N3, + \ 'airline_x': s:N3, + \ 'airline_y': s:N3, + \ 'airline_z': s:V3} +let g:airline#themes#transparent#palette.visual_modified = {} + + +" Warnings +let g:airline#themes#transparent#palette.normal.airline_warning = s:NM1 + +let g:airline#themes#transparent#palette.normal_modified.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + +let g:airline#themes#transparent#palette.insert.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + +let g:airline#themes#transparent#palette.insert_modified.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + +let g:airline#themes#transparent#palette.visual.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + +let g:airline#themes#transparent#palette.visual_modified.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + +let g:airline#themes#transparent#palette.replace.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + +let g:airline#themes#transparent#palette.replace_modified.airline_warning = + \ g:airline#themes#transparent#palette.normal.airline_warning + + +" Errors +let g:airline#themes#transparent#palette.normal.airline_error = s:V1 + +let g:airline#themes#transparent#palette.normal_modified.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.insert.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.insert_modified.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.insert_modified.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.visual.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.visual_modified.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.replace.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error + +let g:airline#themes#transparent#palette.replace_modified.airline_error = + \ g:airline#themes#transparent#palette.normal.airline_error diff --git a/_vim/.vim/plugged/vim-airline-themes/doc/airline-themes.txt b/_vim/.vim/plugged/vim-airline-themes/doc/airline-themes.txt index 98b5256..4eaf04a 100644 --- a/_vim/.vim/plugged/vim-airline-themes/doc/airline-themes.txt +++ b/_vim/.vim/plugged/vim-airline-themes/doc/airline-themes.txt @@ -25,8 +25,10 @@ FEATURES *airline-themes-list* Currently this repository contains the following themes: + * alduin * angr + * apprentice * atomic * ayu_light * ayu_mirage @@ -39,47 +41,157 @@ Currently this repository contains the following themes: * base16_adwaita * base16_apathy * base16_ashes + * base16_atelier_cave + * base16_atelier_cave_light + * base16_atelier_dune + * base16_atelier_dune_light + * base16_atelier_estuary + * base16_atelier_estuary_light + * base16_atelier_forest + * base16_atelier_forest_light + * base16_atelier_heath + * base16_atelier_heath_light + * base16_atelier_lakeside + * base16_atelier_lakeside_light + * base16_atelier_plateau + * base16_atelier_plateau_light + * base16_atelier_savanna + * base16_atelier_savanna_light + * base16_atelier_seaside + * base16_atelier_seaside_light + * base16_atelier_sulphurpool + * base16_atelier_sulphurpool_light * base16_atelierdune * base16_atelierforest * base16_atelierheath * base16_atelierlakeside * base16_atelierseaside + * base16_atlas * base16_bespin + * base16_black_metal + * base16_black_metal_bathory + * base16_black_metal_burzum + * base16_black_metal_dark_funeral + * base16_black_metal_gorgoroth + * base16_black_metal_immortal + * base16_black_metal_khold + * base16_black_metal_marduk + * base16_black_metal_mayhem + * base16_black_metal_nile + * base16_black_metal_venom * base16_brewer * base16_bright + * base16_brogrammer + * base16_brushtrees + * base16_brushtrees_dark * base16_chalk + * base16_circus * base16_classic + * base16_classic_dark + * base16_classic_light * base16_codeschool * base16_colors + * base16_cupcake + * base16_cupertino + * base16_darktooth + * base16_decaf * base16_default + * base16_default_dark + * base16_default_light + * base16_dracula + * base16_edge_dark + * base16_edge_light * base16_eighties * base16_embers + * base16_espresso * base16_flat + * base16_framer + * base16_fruit_soda + * base16_gigavolt + * base16_github * base16_google + * base16_google_dark + * base16_google_light * base16_grayscale + * base16_grayscale_dark + * base16_grayscale_light * base16_greenscreen * base16_gruvbox_dark_hard + * base16_gruvbox_dark_medium + * base16_gruvbox_dark_pale + * base16_gruvbox_dark_soft + * base16_gruvbox_light_hard + * base16_gruvbox_light_medium + * base16_gruvbox_light_soft * base16_harmonic16 + * base16_harmonic_dark + * base16_harmonic_light + * base16_heetch + * base16_heetch_light + * base16_helios * base16_hopscotch + * base16_horizon_dark + * base16_horizon_light + * base16_horizon_terminal_dark + * base16_horizon_terminal_light + * base16_ia_dark + * base16_ia_light + * base16_icy + * base16_irblack * base16_isotope * base16_londontube + * base16_macintosh * base16_marrakesh + * base16_materia + * base16_material + * base16_material_darker + * base16_material_lighter + * base16_material_palenight + * base16_material_vivid + * base16_mellow_purple + * base16_mexico_light * base16_mocha * base16_monokai * base16_nord + * base16_nova * base16_ocean * base16_oceanicnext + * base16_one_light + * base16_onedark + * base16_outrun_dark + * base16_papercolor_dark + * base16_papercolor_light * base16_paraiso + * base16_phd + * base16_pico * base16_pop + * base16_porple * base16_railscasts + * base16_rebecca + * base16_sandcastle * base16_seti * base16_shapeshifter + * base16_snazzy + * base16_solarflare * base16_solarized + * base16_solarized_dark + * base16_solarized_light * base16_spacemacs * base16_summerfruit + * base16_summerfruit_dark + * base16_summerfruit_light + * base16_synth_midnight_dark * base16_tomorrow + * base16_tomorrow_night + * base16_tomorrow_night_eighties + * base16_tube * base16_twilight * base16_vim + * base16_unikitty_dark + * base16_unikitty_light + * base16_woodland + * base16_xcode_dusk + * base16_zenburn * base16color * behelit * biogoo @@ -94,6 +206,8 @@ Currently this repository contains the following themes: * durant * faryfloss * fruit_punch + * google_dark + * google_light * hybrid * hybridline * jay @@ -102,7 +216,9 @@ Currently this repository contains the following themes: * kalisi * kolor * laederon + * lessnoise * light + * lighthaus * lucius * luna * minimalist (|airline-theme-minimalist|) @@ -110,6 +226,7 @@ Currently this repository contains the following themes: * monochrome * murmur * night_owl + * nord-minimal * onedark (|airline-theme-onedark|) * ouo * owo @@ -120,6 +237,9 @@ Currently this repository contains the following themes: * raven * ravenpower * seagull + * selenized + * selenized_bw + * seoul256 * serene * sierra * silver @@ -128,6 +248,7 @@ Currently this repository contains the following themes: * sol * solarized (|airline-theme-solarized|) * solarized_flood + * supernova * term * term_light * tomorrow @@ -137,6 +258,7 @@ Currently this repository contains the following themes: * wombat * xtermlight * zenburn + * transparent ============================================================================== NAME *airline-themes-configuration* @@ -213,7 +335,7 @@ Has no effect if using true/24-bit color. To enable 16-color mode: > ------------------------------------------------------------------------------ *g:airline_minimalist_showmod* -Highlight when the buffer is modified. +Highlight when the buffer is modified. > let g:airline_minimalist_showmod = 1 < *airline-theme-onedark* @@ -288,6 +410,23 @@ colorscheme > The zenburn colorscheme also supports a couple of other configuration variables, that possibly also influence the colors in the zenburn airline theme. Please check the zenburn color scheme on how to configure it. +============================================================================== +Base16 Themes Generation *airline-themes-base16-generation* + +Base16 is a curated list of themes you can find here: +https://github.com/chriskempson/base16. + +Each theme defines 16 colors, and each editor creates a template .mustache +file to create the themes for their application. + +You can find the .mustache files for vim-airline themes here: +https://github.com/dawikur/base16-vim-airline-themes. +If the .mustache file is given to a Base16 builder, +it will generate every included base16 theme. + +These themes were generated using the Python builder which is available here: +https://github.com/InspectorMustache/base16-builder-python + ============================================================================== CONTRIBUTIONS *airline-themes-contributions* diff --git a/_vim/.vim/plugged/vim-airline-themes/plugin/airline-themes.vim b/_vim/.vim/plugged/vim-airline-themes/plugin/airline-themes.vim index d3ea8a5..1e4a4f2 100644 --- a/_vim/.vim/plugged/vim-airline-themes/plugin/airline-themes.vim +++ b/_vim/.vim/plugged/vim-airline-themes/plugin/airline-themes.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling & Contributors. +" MIT License. Copyright (c) 2013-2021 Bailey Ling & Contributors. " vim: et ts=2 sts=2 sw=2 let s:save_cpo = &cpo diff --git a/_vim/.vim/plugged/vim-airline-themes/test/airline-themes.vader b/_vim/.vim/plugged/vim-airline-themes/test/airline-themes.vader index ba46da4..253ef36 100644 --- a/_vim/.vim/plugged/vim-airline-themes/test/airline-themes.vader +++ b/_vim/.vim/plugged/vim-airline-themes/test/airline-themes.vader @@ -15,15 +15,15 @@ Execute (validate themes): Log theme execute('AirlineTheme ' . theme) execute('source ' . themePath) - normal i - normal : - normal R - normal v + normal! i + normal! : + normal! R + normal! v setlocal mod - normal i - normal : - normal R - normal v + normal! i + normal! : + normal! R + normal! v setlocal nomod endfor diff --git a/_vim/.vim/plugged/vim-airline/.github/ISSUE_TEMPLATE.md b/_vim/.vim/plugged/vim-airline/.github/ISSUE_TEMPLATE.md index eeba3c3..1cf5021 100644 --- a/_vim/.vim/plugged/vim-airline/.github/ISSUE_TEMPLATE.md +++ b/_vim/.vim/plugged/vim-airline/.github/ISSUE_TEMPLATE.md @@ -8,7 +8,10 @@ if you are using terminal: - terminal: ???? - $TERM variable: ??? +- terminal columns size: ??? +- terminal line size: ??? - color configuration (:set t_Co?): + if you are using Neovim: - does it happen in Vim: ??? diff --git a/_vim/.vim/plugged/vim-airline/.github/workflows/ci.yml b/_vim/.vim/plugged/vim-airline/.github/workflows/ci.yml new file mode 100644 index 0000000..302c0a0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + vim: + - v9.0.0000 + - v8.2.1000 + - v8.2.0000 + - v8.1.0000 + - v8.0.0000 + - v7.4 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Checkout vim-themis + uses: actions/checkout@v3 + with: + repository: thinca/vim-themis + path: vim-themis + + - name: Setup Vim + uses: rhysd/action-setup-vim@v1 + id: vim + with: + version: ${{ matrix.vim }} + + - name: Test + env: + THEMIS_VIM: ${{ steps.vim.outputs.executable }} + run: ./vim-themis/bin/themis --reporter spec diff --git a/_vim/.vim/plugged/vim-airline/.gitignore b/_vim/.vim/plugged/vim-airline/.gitignore index 59bacbb..14a0d7d 100644 --- a/_vim/.vim/plugged/vim-airline/.gitignore +++ b/_vim/.vim/plugged/vim-airline/.gitignore @@ -3,3 +3,6 @@ doc/tags *.lock .vim-flavor *.swp +.bundle +vendor +test/.deps diff --git a/_vim/.vim/plugged/vim-airline/CHANGELOG.md b/_vim/.vim/plugged/vim-airline/CHANGELOG.md index 8d19f93..e2fc5c3 100644 --- a/_vim/.vim/plugged/vim-airline/CHANGELOG.md +++ b/_vim/.vim/plugged/vim-airline/CHANGELOG.md @@ -8,13 +8,27 @@ This is the Changelog for the vim-airline project. - [poetv](https://github.com/petobens/poet-v) support - [vim-lsp](https://github.com/prabirshrestha/vim-lsp) support - [zoomwintab](https://github.com/troydm/zoomwintab.vim) support + - [Vaffle](https://github.com/cocopon/vaffle.vim) support + - [vim-dirvish](https://github.com/justinmk/vim-dirvish) support + - [fzf.vim](https://github.com/junegunn/fzf.vim) support + - [OmniSharp](https://github.com/OmniSharp/omnisharp-vim) support + - [searchcount](https://vim-jp.org/vimdoc-en/eval.html#searchcount()) support + - [fern.vim](https://github.com/lambdalisue/fern.vim) support + - [Vim-CMake](https://github.com/cdelledonne/vim-cmake) support + - [battery.vim](https://github.com/lambdalisue/battery.vim) support + - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) support + - [gen_tags.vim](https://github.com/jsfaint/gen_tags.vim) support + - Ascii Scrollbar support - Improvements - git branch can also be displayed using [gina.vim](https://github.com/lambdalisue/gina.vim) - - coc extensions can also show additional status messages + - coc extensions can also show additional status messages as well as the current function - [coc-git](https://github.com/neoclide/coc-git) extension integrated into hunks extension + - rewrote parts using Vim9 Script for performance improvements - Other + - Changed CI from travis-ci.org to GitHub Actions - Introduce Vim script static analysis using [reviewdog](https://github.com/reviewdog/action-vint) - Added multiple Vim versions to unit tests using Travis CI + - Added option to show short paths in the status line ## [0.11] - 2019-11-10 - New features @@ -35,9 +49,9 @@ This is the Changelog for the vim-airline project. - The branch extensions now also displays whether the repository is in a clean state (will append a ! or ⚡if the repository is considered dirty). - The whitespace extensions will also check for conflict markers - - `:AirlineRefresh` command now takes an additional `!` attribute, that **skips** + - `:AirlineRefresh` command now takes an additional `!` attribute, that **skips** recreating the highlighting groups (which might have a serious performance - impact if done very often, as might be the case when the configuration variable + impact if done very often, as might be the case when the configuration variable `airline_skip_empty_sections` is active). - airline can now also detect multiple cursor mode (issue [#1933](https://github.com/vim-airline/vim-airline/issues/1933)) - expose hunks output using the function `airline#extensions#hunks#get_raw_hunks()` to the outside [#1877](https://github.com/vim-airline/vim-airline/pull/1877) @@ -135,7 +149,7 @@ This is the Changelog for the vim-airline project. - [taboo](https://github.com/gcmt/taboo.vim) - [vim-ctrlspace](https://github.com/szw/vim-ctrlspace) - [quickfixsigns](https://github.com/tomtom/quickfixsigns_vim) - - [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) + - [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe) - [po.vim](http://www.vim.org/scripts/script.php?script_id=695) - [unicode.vim](https://github.com/chrisbra/unicode.vim) - wordcount diff --git a/_vim/.vim/plugged/vim-airline/CONTRIBUTING.md b/_vim/.vim/plugged/vim-airline/CONTRIBUTING.md index f97699e..b591d48 100644 --- a/_vim/.vim/plugged/vim-airline/CONTRIBUTING.md +++ b/_vim/.vim/plugged/vim-airline/CONTRIBUTING.md @@ -4,17 +4,32 @@ Contributions and pull requests are welcome. Please take note of the following * Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords. * Keep the history clean! Squash your branches before you submit a pull request. `pull --rebase` is your friend. -* Any changes to the core should be tested against Vim 7.2. +* Any changes to the core should be tested against Vim 7.4. + +# Testing + +Contributers should install [thinca/vim-themis](https://github.com/thinca/vim-themis) to run tests before sending a PR if they applied some modification to the code. PRs which does not pass tests won't be accepted. + +## 1. Installation + +``` +$ cd /path/to/vim-airline +$ git submodule add https://github.com/thinca/vim-themis ./.themis-bin +``` + +## 2. running test + +``` +$ ./path/to/themis-bin/bin/themis path/to/vim-airline/test --reporter spec +``` # Bugs Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following: -* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts. Even better, create a `gist` of your vimrc that is compatible with [pathogen][11]. -* And to make it easier to reproduce, please supply the following: - * the `:version` of vim - * the commit of vim-airline you're using - * the OS that you're using, including terminal emulator, GUI vs non-GUI +* the `:version` of vim +* the commit of vim-airline you're using +* the OS that you're using, including terminal emulator, GUI vs non-GUI # Themes @@ -26,7 +41,5 @@ Tracking down bugs can take a very long time due to different configurations, ve If you would like to take a more active role in improving vim-airline, please consider [becoming a maintainer][43]. -[7]: https://github.com/bling/minivimrc -[11]: https://github.com/tpope/vim-pathogen [14]: https://github.com/vim-airline/vim-airline/wiki/Screenshots [43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer diff --git a/_vim/.vim/plugged/vim-airline/LICENSE b/_vim/.vim/plugged/vim-airline/LICENSE index 89af08e..25c5db7 100644 --- a/_vim/.vim/plugged/vim-airline/LICENSE +++ b/_vim/.vim/plugged/vim-airline/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (C) 2013-2020 Bailey Ling, Christian Brabandt, et al. +Copyright (C) 2013-2021 Bailey Ling, Christian Brabandt, et al. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/_vim/.vim/plugged/vim-airline/README.md b/_vim/.vim/plugged/vim-airline/README.md index f105162..d45d86c 100644 --- a/_vim/.vim/plugged/vim-airline/README.md +++ b/_vim/.vim/plugged/vim-airline/README.md @@ -1,11 +1,15 @@ -# vim-airline [![Build Status](https://travis-ci.org/vim-airline/vim-airline.svg?branch=master)](https://travis-ci.org/vim-airline/vim-airline) [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/cb%40256bit.org) [![reviewdog](https://github.com/vim-airline/vim-airline/workflows/reviewdog/badge.svg?branch=master&event=push)](https://github.com/vim-airline/vim-airline/actions?query=workflow%3Areviewdog+event%3Apush+branch%3Amaster) +# vim-airline -Lean & mean status/tabline for vim that's light as air. +[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/cb%40256bit.org) +[![reviewdog](https://github.com/vim-airline/vim-airline/workflows/reviewdog/badge.svg?branch=master&event=push)](https://github.com/vim-airline/vim-airline/actions?query=workflow%3Areviewdog+event%3Apush+branch%3Amaster) +[![CI](https://github.com/vim-airline/vim-airline/workflows/CI/badge.svg)](https://github.com/vim-airline/vim-airline/actions?query=workflow%3ACI) + +Lean & mean status/tabline for vim that's light as air. ![img](https://github.com/vim-airline/vim-airline/wiki/screenshots/demo.gif) -When the plugin is correctly loaded, Vim will draw a nice statusline at the -bottom of each window. +When the plugin is correctly loaded, there will be a nice statusline at the +bottom of each vim window. That line consists of several sections, each one displaying some piece of information. By default (without configuration) this line will look like this: @@ -36,7 +40,7 @@ The statusline is the colored line at the bottom, which contains the sections section|meaning (example) -------|------------------ A | displays the mode + additional flags like crypt/spell/paste (INSERT) - B | VCS information (branch, hunk summary) (master) + B | Environment status (VCS information - branch, hunk summary (master), [battery][61] level) C | filename + read-only flag (~/.vim/vimrc RO) X | filetype (vim) Y | file encoding[fileformat] (utf-8[unix]) @@ -62,15 +66,16 @@ For a better look, those sections can be colored differently, depending on vario * Tiny core written with extensibility in mind ([open/closed principle][8]). * Integrates with a variety of plugins, including: [vim-bufferline][6], - [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], + [fugitive][4], [flog][62], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [quickfixsigns][39], [syntastic][5], [eclim][34], [lawrencium][21], [virtualenv][31], [tmuxline][35], [taboo.vim][37], - [ctrlspace][38], [vim-bufmru][47], [vimagit][50], [denite][51] and more. + [ctrlspace][38], [vim-bufmru][47], [vimagit][50], [denite][51], + [vim.battery][61] and more. * Looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols. -* Optimized for speed; it loads in under a millisecond. +* Optimized for speed - loads in under a millisecond. * Extensive suite of themes for popular color schemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others. - Note these are now external to this plugin. See [below][46] for detail. + Note these are now external to this plugin. More details can be found in the [themes repository][46]. * Supports 7.2 as the minimum Vim version. * The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33]. * Unit testing suite. @@ -93,7 +98,7 @@ Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' ``` -See https://github.com/vim-airline/vim-airline-themes for more. +See [vim-airline-themes][46] for more. ## Automatic truncation @@ -164,6 +169,9 @@ vim-airline integrates with a variety of plugins out of the box. These extensio #### [vimagit][50] ![vim-airline-vimagit-demo](https://cloud.githubusercontent.com/assets/533068/22107273/2ea85ba0-de4d-11e6-9fa8-331103b88df4.gif) +#### [flog][62] +![vim-flog-airline-demo](https://user-images.githubusercontent.com/5008897/120819897-4e820280-c554-11eb-963e-6c08a1bbae09.png) + #### [virtualenv][31] ![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png) @@ -188,6 +196,12 @@ vim-airline integrates with a variety of plugins out of the box. These extensio #### [LanguageClient][57] ![image](https://user-images.githubusercontent.com/9622/45275524-52f45c00-b48b-11e8-8b83-a66240b10747.gif) +#### [Vim-CMake][60] +![image](https://user-images.githubusercontent.com/24732205/87788512-c876a380-c83d-11ea-9ee3-5f639f986a8f.png) + +#### [vim.battery][61] +![image](https://user-images.githubusercontent.com/1969470/94561399-368b0e00-0264-11eb-94a0-f6b67c73d422.png) + ## Extras vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also: @@ -196,7 +210,7 @@ vim-airline also supplies some supplementary stand-alone extensions. In additio ![image](https://f.cloud.github.com/assets/306502/962401/2a75385e-04ef-11e3-935c-e3b9f0e954cc.png) ### statusline on top -The statusline can alternatively by drawn on top, making room for other plugins to use the statusline: +The statusline can alternatively be drawn on top, making room for other plugins to use the statusline: The example shows a custom statusline setting, that imitates Vims default statusline, while allowing to call custom functions. Use `:let g:airline_statusline_ontop=1` to enable it. @@ -266,7 +280,7 @@ Solutions to common problems can be found in the [Wiki][27]. # Performance -Whoa! Everything got slow all of a sudden... +Whoa! Everything got slow all of a sudden... vim-airline strives to make it easy to use out of the box, which means that by default it will look for all compatible plugins that you have installed and enable the relevant extension. @@ -286,16 +300,16 @@ A full list of screenshots for various themes can be found in the [Wiki][14]. # Maintainers -The project is currently being maintained by [Bailey Ling][41], [Christian Brabandt][42], and [Mike Hartington][44]. +The project is currently being maintained by [Christian Brabandt][42] and [Bailey Ling][41]. If you are interested in becoming a maintainer (we always welcome more maintainers), please [go here][43]. # License -[MIT License][58]. Copyright (c) 2013-2020 Bailey Ling & Contributors. +[MIT License][58]. Copyright (c) 2013-2021 Bailey Ling & Contributors. [1]: https://github.com/Lokaltog/vim-powerline -[2]: https://github.com/Lokaltog/powerline +[2]: https://github.com/powerline/powerline [3]: https://github.com/Lokaltog/powerline-fonts [4]: https://github.com/tpope/vim-fugitive [5]: https://github.com/scrooloose/syntastic @@ -314,7 +328,7 @@ If you are interested in becoming a maintainer (we always welcome more maintaine [18]: https://github.com/preservim/nerdtree [19]: https://github.com/majutsushi/tagbar [20]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts -[21]: https://bitbucket.org/ludovicchabant/vim-lawrencium +[21]: https://github.com/ludovicchabant/vim-lawrencium [22]: https://github.com/MarcWeber/vim-addon-manager [23]: https://github.com/altercation/solarized [24]: https://github.com/chriskempson/tomorrow-theme @@ -337,9 +351,8 @@ If you are interested in becoming a maintainer (we always welcome more maintaine [41]: https://github.com/bling [42]: https://github.com/chrisbra [43]: https://github.com/vim-airline/vim-airline/wiki/Becoming-a-Maintainer -[44]: https://github.com/mhartington [45]: https://github.com/vim-airline/vim-airline/commit/d7fd8ca649e441b3865551a325b10504cdf0711b -[46]: https://github.com/vim-airline/vim-airline#themes +[46]: https://github.com/vim-airline/vim-airline-themes#vim-airline-themes-- [47]: https://github.com/mildred/vim-bufmru [48]: https://github.com/ierton/xkb-switch [49]: https://github.com/vovkasm/input-source-switcher @@ -353,3 +366,6 @@ If you are interested in becoming a maintainer (we always welcome more maintaine [57]: https://github.com/autozimu/LanguageClient-neovim [58]: https://github.com/vim-airline/vim-airline/blob/master/LICENSE [59]: https://github.com/neoclide/coc-git +[60]: https://github.com/cdelledonne/vim-cmake +[61]: http://github.com/lambdalisue/battery.vim/ +[62]: http://github.com/rbong/vim-flog/ diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline.vim index f2e2016..a544d37 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline.vim @@ -1,25 +1,35 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', []) +let g:airline_inactive_funcrefs = get(g:, 'airline_inactive_statusline_funcrefs', []) let s:sections = ['a','b','c','gutter','x','y','z', 'error', 'warning'] -let s:inactive_funcrefs = [] let s:contexts = {} let s:core_funcrefs = [ \ function('airline#extensions#apply'), \ function('airline#extensions#default#apply') ] -function! airline#add_statusline_func(name) - call airline#add_statusline_funcref(function(a:name)) +function! airline#add_statusline_func(name, ...) + let warn = get(a:, 1, 1) + call airline#add_statusline_funcref(function(a:name), warn) endfunction -function! airline#add_statusline_funcref(function) +function! airline#add_inactive_statusline_func(name, ...) + let warn = get(a:, 1, 1) + call airline#add_inactive_statusline_funcref(function(a:name), warn) +endfunction + + +function! airline#add_statusline_funcref(function, ...) if index(g:airline_statusline_funcrefs, a:function) >= 0 - call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function))) + let warn = get(a:, 1, 1) + if warn > 0 + call airline#util#warning(printf('The airline statusline funcref "%s" has already been added.', string(a:function))) + endif return endif call add(g:airline_statusline_funcrefs, a:function) @@ -32,8 +42,15 @@ function! airline#remove_statusline_func(name) endif endfunction -function! airline#add_inactive_statusline_func(name) - call add(s:inactive_funcrefs, function(a:name)) +function! airline#add_inactive_statusline_funcref(function, ...) + if index(g:airline_inactive_funcrefs, a:function) >= 0 + let warn = get(a:, 1, 1) + if warn > 0 + call airline#util#warning(printf('The airline inactive statusline funcref "%s" has already been added.', string(a:function))) + endif + return + endif + call add(g:airline_inactive_funcrefs, a:function) endfunction function! airline#load_theme() @@ -53,6 +70,8 @@ function! airline#load_theme() call airline#highlighter#load_theme() call airline#extensions#load_theme() call airline#update_statusline() + + call airline#util#doautocmd('AirlineAfterTheme') endfunction " Load an airline theme @@ -93,8 +112,6 @@ function! airline#switch_theme(name, ...) unlet! w:airline_lastmode call airline#load_theme() - call airline#util#doautocmd('AirlineAfterTheme') - " this is required to prevent clobbering the startup info message, i don't know why... call airline#check_mode(winnr()) endfunction @@ -125,9 +142,10 @@ endfunction " Update the statusline function! airline#update_statusline() - if airline#util#stl_disabled(winnr()) + if airline#util#stl_disabled(winnr()) || airline#util#is_popup_window(winnr()) return endif + " TODO: need to ignore popup windows here as well? let range = filter(range(1, winnr('$')), 'v:val != winnr()') " create inactive statusline call airline#update_statusline_inactive(range) @@ -138,7 +156,12 @@ function! airline#update_statusline() " Now create the active statusline let w:airline_active = 1 let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) } - call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) + try + call s:invoke_funcrefs(context, g:airline_statusline_funcrefs) + catch /^Vim\%((\a\+)\)\=:E48:/ + " Catch: Sandbox mode + " no-op + endtry endfunction " Function to be called to make all statuslines inactive @@ -168,7 +191,12 @@ function! airline#update_statusline_inactive(range) \ 'left_sep': g:airline_left_alt_sep, \ 'right_sep': g:airline_right_alt_sep }, 'keep') endif - call s:invoke_funcrefs(context, s:inactive_funcrefs) + try + call s:invoke_funcrefs(context, g:airline_inactive_funcrefs) + catch /^Vim\%((\a\+)\)\=:E48:/ + " Catch: Sandbox mode + " no-op + endtry endfor endfunction @@ -203,66 +231,66 @@ function! airline#check_mode(winnr) let context = s:contexts[a:winnr] if get(w:, 'airline_active', 1) - let l:m = mode(1) - if l:m ==# "i" - let l:mode = ['insert'] - elseif l:m[0] ==# "i" - let l:mode = ['insert'] - elseif l:m ==# "Rv" - let l:mode =['replace'] - elseif l:m[0] ==# "R" - let l:mode = ['replace'] - elseif l:m[0] =~# '\v(v|V||s|S|)' - let l:mode = ['visual'] - elseif l:m ==# "t" - let l:mode = ['terminal'] - elseif l:m[0] ==# "c" - let l:mode = ['commandline'] - elseif l:m ==# "no" " does not work, most likely, Vim does not refresh the statusline in OP mode - let l:mode = ['normal'] - elseif l:m[0:1] ==# 'ni' - let l:mode = ['normal'] - let l:m = 'ni' + let m = mode(1) + " Refer :help mode() to see the list of modes + " NB: 'let mode' here refers to the display colour _groups_, + " not the literal mode's code (i.e., m). E.g., Select modes + " v, S and ^V use 'visual' since they are of similar ilk. + " Some modes do not get recognised for status line purposes: + " no, nov, noV, no^V, !, cv, and ce. + " Mode name displayed is handled in init.vim (g:airline_mode_map). + " + if m[0] ==# "i" + let mode = ['insert'] " Insert modes + submodes (i, ic, ix) + elseif m[0] == "R" + let mode = ['replace'] " Replace modes + submodes (R, Rc, Rv, Rx) (NB: case sensitive as 'r' is a mode) + elseif m[0] =~ '\v(v|V||s|S|)' + let mode = ['visual'] " Visual and Select modes (v, V, ^V, s, S, ^S)) + elseif m ==# "t" + let mode = ['terminal'] " Terminal mode (only has one mode (t)) + elseif m[0] =~ '\v(c|r|!)' + let mode = ['commandline'] " c, cv, ce, r, rm, r? (NB: cv and ce stay showing as mode entered from) else - let l:mode = ['normal'] + let mode = ['normal'] " Normal mode + submodes (n, niI, niR, niV; plus operator pendings no, nov, noV, no^V) endif if exists("*VMInfos") && !empty(VMInfos()) " Vim plugin Multiple Cursors https://github.com/mg979/vim-visual-multi - let l:m = 'multi' + let m = 'multi' endif - if index(['Rv', 'no', 'ni', 'ix', 'ic', 'multi'], l:m) == -1 - let l:m = l:m[0] + " Adjust to handle additional modes, which don't display correctly otherwise + if index(['niI', 'niR', 'niV', 'ic', 'ix', 'Rc', 'Rv', 'Rx', 'multi'], m) == -1 + let m = m[0] endif - let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m) + let w:airline_current_mode = get(g:airline_mode_map, m, m) else - let l:mode = ['inactive'] + let mode = ['inactive'] let w:airline_current_mode = get(g:airline_mode_map, '__') endif if g:airline_detect_modified && &modified - call add(l:mode, 'modified') + call add(mode, 'modified') endif if g:airline_detect_paste && &paste - call add(l:mode, 'paste') + call add(mode, 'paste') endif if g:airline_detect_crypt && exists("+key") && !empty(&key) - call add(l:mode, 'crypt') + call add(mode, 'crypt') endif if g:airline_detect_spell && &spell - call add(l:mode, 'spell') + call add(mode, 'spell') endif if &readonly || ! &modifiable - call add(l:mode, 'readonly') + call add(mode, 'readonly') endif - let mode_string = join(l:mode) + let mode_string = join(mode) if get(w:, 'airline_lastmode', '') != mode_string call airline#highlighter#highlight_modified_inactive(context.bufnr) - call airline#highlighter#highlight(l:mode, context.bufnr) + call airline#highlighter#highlight(mode, string(context.bufnr)) call airline#util#doautocmd('AirlineModeChanged') let w:airline_lastmode = mode_string endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/async.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/async.vim index 8b1678d..459a725 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/async.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/async.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Christian Brabandt et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -153,9 +153,12 @@ if v:version >= 800 && has("job") endfunction function! airline#async#get_msgfmt_stat(cmd, file) - if g:airline#init#is_windows || !executable('msgfmt') - " no msgfmt on windows? + if !executable('msgfmt') + " no msgfmt return + endif + if g:airline#init#is_windows + let cmd = 'cmd /C ' . a:cmd. shellescape(a:file) else let cmd = ['sh', '-c', a:cmd. shellescape(a:file)] endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/builder.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/builder.vim index 345297b..426b3e2 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/builder.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/builder.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -133,11 +133,8 @@ function! airline#builder#should_change_group(group1, group2) endif let color1 = airline#highlighter#get_highlight(a:group1) let color2 = airline#highlighter#get_highlight(a:group2) - if g:airline_gui_mode ==# 'gui' - return color1[1] != color2[1] || color1[0] != color2[0] - else - return color1[3] != color2[3] || color1[2] != color2[2] - endif + return color1[1] != color2[1] || color1[0] != color2[0] + \ || color1[2] != color2[2] || color1[3] != color2[3] endfunction function! s:get_transitioned_seperator(self, prev_group, group, side) @@ -201,20 +198,27 @@ function! s:section_is_empty(self, content) if get(w:, 'airline_skip_empty_sections', -1) == 0 return 0 endif - " assume accents sections to be never empty - " (avoides, that on startup the mode message becomes empty) - if match(a:content, '%#__accent_[^#]*#.*__restore__#') > -1 - return 0 - endif - if empty(a:content) + + " special case: When the content is %=, that is the + " separation marker, which switches between left- and + " right-aligned content. + " Consider that to be empty, so that the previous previous + " group is correctly remembered in the builder() function + if empty(a:content) || a:content is# '%=' return 1 endif - let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) - if empty(list) - return 0 " no function in statusline text + + let stripped = substitute(a:content, + \ '\(%{.*}\|%#__accent_[^#]*#\|%#__restore__#\|%( \| %)\)', '', 'g') + + if !empty(stripped) + return 0 " There is content in the statusline endif - while len(list) > 0 - let expr = list[0] + + let exprlist = [] + call substitute(a:content, '%{\([^}]*\)}', '\=add(exprlist, submatch(1))', 'g') + + for expr in exprlist try " catch all exceptions, just in case if !empty(eval(expr)) @@ -223,9 +227,7 @@ function! s:section_is_empty(self, content) catch return 0 endtry - let start += 1 - let list=matchlist(a:content, '%{\zs.\{-}\ze}', 1, start) - endw + endfor return 1 endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/debug.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/debug.vim index 7cf6108..f04b296 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/debug.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/debug.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions.vim index 99b701f..4f4240c 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -23,8 +23,10 @@ endfunction let s:script_path = tolower(resolve(expand(':p:h'))) let s:filetype_overrides = { + \ 'coc-explorer': [ 'CoC Explorer', '' ], \ 'defx': ['defx', '%{b:defx.paths[0]}'], \ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'], + \ 'floggraph': [ 'Flog', '%{get(b:, "flog_status_summary", "")}' ], \ 'gundo': [ 'Gundo', '' ], \ 'help': [ 'Help', '%f' ], \ 'minibufexpl': [ 'MiniBufExplorer', '' ], @@ -32,7 +34,7 @@ let s:filetype_overrides = { \ 'vim-plug': [ 'Plugins', '' ], \ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ], \ 'vimshell': ['vimshell','%{vimshell#get_status_string()}'], - \ 'vaffle' : [ 'Vaffle', '' ], + \ 'vaffle' : [ 'Vaffle', '%{b:vaffle.dir}' ], \ } if get(g:, 'airline#extensions#nerdtree_statusline', 1) @@ -150,12 +152,12 @@ function! airline#extensions#load() call airline#extensions#quickfix#init(s:ext) call add(s:loaded_ext, 'quickfix') - if get(g:, 'loaded_unite', 0) + if get(g:, 'loaded_unite', 0) && get(g:, 'airline#extensions#unite#enabled', 1) call airline#extensions#unite#init(s:ext) call add(s:loaded_ext, 'unite') endif - if get(g:, 'loaded_denite', 0) + if get(g:, 'loaded_denite', 0) && get(g:, 'airline#extensions#denite#enabled', 1) call airline#extensions#denite#init(s:ext) call add(s:loaded_ext, 'denite') endif @@ -165,11 +167,28 @@ function! airline#extensions#load() call add(s:loaded_ext, 'gina') endif + if get(g:, 'loaded_fern', 0) && get(g:, 'airline#extensions#fern#enabled', 1) + call airline#extensions#fern#init(s:ext) + call add(s:loaded_ext, 'fern') + endif + if exists(':NetrwSettings') call airline#extensions#netrw#init(s:ext) call add(s:loaded_ext, 'netrw') endif + " fzf buffers are also terminal buffers, so this must be above term. + if exists(':FZF') && get(g:, 'airline#extensions#fzf#enabled', 1) + call airline#extensions#fzf#init(s:ext) + call add(s:loaded_ext, 'fzf') + endif + + " Vim-CMake buffers are also terminal buffers, so this must be above term. + if get(g:, 'loaded_cmake', 0) && get(g:, 'airline#extensions#vimcmake#enabled', 1) + call airline#extensions#vimcmake#init(s:ext) + call add(s:loaded_ext, 'vimcmake') + endif + if (has("terminal") || has('nvim')) && \ get(g:, 'airline#extensions#term#enabled', 1) call airline#extensions#term#init(s:ext) @@ -231,6 +250,10 @@ function! airline#extensions#load() call airline#extensions#tagbar#init(s:ext) call add(s:loaded_ext, 'tagbar') endif + if get(g:, 'airline#extensions#taglist#enabled', 1) && exists(':TlistShowTag') + call airline#extensions#taglist#init(s:ext) + call add(s:loaded_ext, 'taglist') + endif if get(g:, 'airline#extensions#vista#enabled', 1) \ && exists(':Vista') @@ -244,6 +267,11 @@ function! airline#extensions#load() call add(s:loaded_ext, 'bookmark') endif + if get(g:, 'airline#extensions#scrollbar#enabled', 0) + call airline#extensions#scrollbar#init(s:ext) + call add(s:loaded_ext, 'scrollbar') + endif + if get(g:, 'airline#extensions#csv#enabled', 1) \ && (get(g:, 'loaded_csv', 0) || exists(':Table')) call airline#extensions#csv#init(s:ext) @@ -287,13 +315,13 @@ function! airline#extensions#load() " extension won't be initialized. Since both extensions currently just " add a virtualenv identifier section to the airline, this seems " acceptable. - if (get(g:, 'airline#extensions#poetv#enabled', 1) && (exists(':PoetvActivate'))) + if (get(g:, 'airline#extensions#poetv#enabled', 0) && (exists(':PoetvActivate'))) call airline#extensions#poetv#init(s:ext) call add(s:loaded_ext, 'poetv') - elseif (get(g:, 'airline#extensions#virtualenv#enabled', 1) && (exists(':VirtualEnvList'))) + elseif (get(g:, 'airline#extensions#virtualenv#enabled', 0) && (exists(':VirtualEnvList'))) call airline#extensions#virtualenv#init(s:ext) call add(s:loaded_ext, 'virtualenv') - elseif (get(g:, 'airline#extensions#poetv#enabled', 1) && (isdirectory($VIRTUAL_ENV))) + elseif (get(g:, 'airline#extensions#poetv#enabled', 0) && (isdirectory($VIRTUAL_ENV))) call airline#extensions#poetv#init(s:ext) call add(s:loaded_ext, 'poetv') endif @@ -319,6 +347,13 @@ function! airline#extensions#load() call add(s:loaded_ext, 'lsp') endif + if (get(g:, 'airline#extensions#nvimlsp#enabled', 1) + \ && has('nvim') + \ && luaeval('vim.lsp ~= nil')) + call airline#extensions#nvimlsp#init(s:ext) + call add(s:loaded_ext, 'nvimlsp') + endif + if (get(g:, 'airline#extensions#coc#enabled', 1) && exists(':CocCommand')) call airline#extensions#coc#init(s:ext) call add(s:loaded_ext, 'coc') @@ -364,7 +399,7 @@ function! airline#extensions#load() call add(s:loaded_ext, 'promptline') endif - if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2 + if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && get(g:, 'loaded_nrrw_rgn', 0) call airline#extensions#nrrwrgn#init(s:ext) call add(s:loaded_ext, 'nrrwrgn') endif @@ -384,6 +419,11 @@ function! airline#extensions#load() call add(s:loaded_ext, 'gutentags') endif + if get(g:, 'airline#extensions#gen_tags#enabled', 1) && (get(g:, 'loaded_gentags#gtags', 0) || get(g:, 'loaded_gentags#ctags', 0)) + call airline#extensions#gen_tags#init(s:ext) + call add(s:loaded_ext, 'gen_tags') + endif + if (get(g:, 'airline#extensions#grepper#enabled', 1) && get(g:, 'loaded_grepper', 0)) call airline#extensions#grepper#init(s:ext) call add(s:loaded_ext, 'grepper') @@ -422,10 +462,25 @@ function! airline#extensions#load() call add(s:loaded_ext, 'cursormode') endif + if get(g:, 'airline#extensions#searchcount#enabled', 1) && exists('*searchcount') + call airline#extensions#searchcount#init(s:ext) + call add(s:loaded_ext, 'searchcount') + endif + + if get(g:, 'loaded_battery', 0) && get(g:, 'airline#extensions#battery#enabled', 0) + call airline#extensions#battery#init(s:ext) + call add(s:loaded_ext, 'battery') + endif + + if (get(g:, 'airline#extensions#vim9lsp#enabled', 1) && exists('*lsp#errorCount')) + call airline#extensions#vim9lsp#init(s:ext) + call add(s:loaded_ext, 'vim9lsp') + endif + if !get(g:, 'airline#extensions#disable_rtp_load', 0) " load all other extensions, which are not part of the default distribution. " (autoload/airline/extensions/*.vim outside of our s:script_path). - for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") + for file in split(globpath(&rtp, 'autoload/airline/extensions/*.vim', 1), "\n") " we have to check both resolved and unresolved paths, since it's possible " that they might not get resolved properly (see #187) if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 @@ -444,6 +499,22 @@ function! airline#extensions#load() endif endfor endif + + if exists(':Dirvish') && get(g:, 'airline#extensions#dirvish#enabled', 1) + call airline#extensions#dirvish#init(s:ext) + call add(s:loaded_ext, 'dirvish') + endif + + if (get(g:, 'airline#extensions#omnisharp#enabled', 1) && get(g:, 'OmniSharp_loaded', 0)) + call airline#extensions#omnisharp#init(s:ext) + call add(s:loaded_ext, 'omnisharp') + endif + + if (get(g:, 'airline#extensions#rufo#enabled', 0) && get(g:, 'rufo_loaded', 0)) + call airline#extensions#rufo#init(s:ext) + call add(s:loaded_ext, 'rufo') + endif + endfunction function! airline#extensions#get_loaded_extensions() diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ale.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ale.vim index 4b19bca..0948ae6 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ale.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ale.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bjorn Neergaard, w0rp et al. +" MIT License. Copyright (c) 2013-2021 Bjorn Neergaard, w0rp et al. " Plugin: https://github.com/dense-analysis/ale " vim: et ts=2 sts=2 sw=2 @@ -128,6 +128,10 @@ function! airline#extensions#ale#init(ext) endfunction function! s:ale_refresh() + if !exists('#airline') + " airline disabled + return + endif if get(g:, 'airline_skip_empty_sections', 0) exe ':AirlineRefresh!' endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/battery.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/battery.vim new file mode 100644 index 0000000..baeb764 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/battery.vim @@ -0,0 +1,23 @@ +" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al. +" Plugin: https://github.com/lambdalisue/battery.vim +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !exists('g:loaded_battery') + finish +endif + +function! airline#extensions#battery#status(...) abort + if !exists('g:battery#update_statusline') + let g:battery#update_statusline = 1 + call battery#update() + endif + + let bat = battery#component() + return bat +endfunction + +function! airline#extensions#battery#init(ext) abort + call airline#parts#define_function('battery', 'airline#extensions#battery#status') +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bookmark.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bookmark.vim index da0a55b..dde28f9 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bookmark.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bookmark.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2019 Bjoern Petri +" MIT License. Copyright (c) 2021 Bjoern Petri " Plugin: https://github.com/MattesGroeger/vim-bookmarks " vim: et ts=2 sts=2 sw=2 @@ -8,23 +8,23 @@ if !exists(':BookmarkToggle') finish endif -function! airline#extensions#bookmark#currentbookmark() +function! airline#extensions#bookmark#currentbookmark() abort if get(w:, 'airline_active', 0) - let file = expand("%:p") - if file ==# "" - return - endif + let file = expand('%:p') + if file ==# '' + return + endif - let current_line = line('.') - let has_bm = bm#has_bookmark_at_line(file, current_line) - let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0 - let annotation = has_bm ? bm['annotation'] : "" + let current_line = line('.') + let has_bm = bm#has_bookmark_at_line(file, current_line) + let bm = has_bm ? bm#get_bookmark_by_line(file, current_line) : 0 + let annotation = has_bm ? bm['annotation'] : '' - return annotation - endif + return annotation + endif return '' endfunction -function! airline#extensions#bookmark#init(ext) +function! airline#extensions#bookmark#init(ext) abort call airline#parts#define_function('bookmark', 'airline#extensions#bookmark#currentbookmark') endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim index 9d9f263..49c1ffd 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/branch.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: fugitive, gina, lawrencium and vcscommand " vim: et ts=2 sts=2 sw=2 @@ -86,36 +86,39 @@ let s:sha1size = get(g:, 'airline#extensions#branch#sha1_len', 7) function! s:update_git_branch() call airline#util#ignore_next_focusgain() - if !airline#util#has_fugitive() && !airline#util#has_gina() + if airline#util#has_fugitive() + call s:config_fugitive_branch() + elseif airline#util#has_gina() + call s:config_gina_branch() + else let s:vcs_config['git'].branch = '' return endif - if airline#util#has_fugitive() - let s:vcs_config['git'].branch = exists("*FugitiveHead") ? - \ FugitiveHead(s:sha1size) : fugitive#head(s:sha1size) - if s:vcs_config['git'].branch is# 'master' && - \ airline#util#winwidth() < 81 - " Shorten default a bit - let s:vcs_config['git'].branch='mas' - endif - else - try - let g:gina#component#repo#commit_length = s:sha1size - let s:vcs_config['git'].branch = gina#component#repo#branch() - catch - endtry - if s:vcs_config['git'].branch is# 'master' && - \ airline#util#winwidth() < 81 - " Shorten default a bit - let s:vcs_config['git'].branch='mas' - endif +endfunction + +function! s:config_fugitive_branch() abort + let s:vcs_config['git'].branch = FugitiveHead(s:sha1size) + if s:vcs_config['git'].branch is# 'master' && + \ airline#util#winwidth() < 81 + " Shorten default a bit + let s:vcs_config['git'].branch='mas' + endif +endfunction + +function! s:config_gina_branch() abort + try + let g:gina#component#repo#commit_length = s:sha1size + let s:vcs_config['git'].branch = gina#component#repo#branch() + catch + endtry + if s:vcs_config['git'].branch is# 'master' && + \ airline#util#winwidth() < 81 + " Shorten default a bit + let s:vcs_config['git'].branch='mas' endif endfunction function! s:display_git_branch() - " disable FocusGained autocommand, might cause loops because system() causes - " a refresh, which causes a system() command again #2029 - call airline#util#ignore_next_focusgain() let name = b:buffer_vcs_config['git'].branch try let commit = matchstr(FugitiveParse()[0], '^\x\+') @@ -123,8 +126,15 @@ function! s:display_git_branch() if has_key(s:names, commit) let name = get(s:names, commit)."(".name.")" elseif !empty(commit) - let ref = fugitive#repo().git_chomp('describe', '--all', '--exact-match', commit) - if ref !~ "^fatal: no tag exactly matches" + if exists('*FugitiveExecute') + let ref = FugitiveExecute(['describe', '--all', '--exact-match', commit], bufnr('')).stdout[0] + else + noautocmd let ref = fugitive#repo().git_chomp('describe', '--all', '--exact-match', commit) + if ref =~# ':' + let ref = '' + endif + endif + if !empty(ref) let name = s:format_name(substitute(ref, '\v\C^%(heads/|remotes/|tags/)=','',''))."(".name.")" else let name = matchstr(commit, '.\{'.s:sha1size.'}')."(".name.")" @@ -318,6 +328,10 @@ endfunction function! s:reset_untracked_cache(shellcmdpost) " shellcmdpost - whether function was called as a result of ShellCmdPost hook + if !exists('#airline') + " airline disabled + return + endif if !g:airline#init#vim_async && !has('nvim') if a:shellcmdpost " Clear cache only if there was no error or the script uses an @@ -339,11 +353,17 @@ function! s:reset_untracked_cache(shellcmdpost) endfor endfunction +function! s:sh_autocmd_handler() + if exists('#airline') + unlet! b:airline_head b:airline_do_mq_check + endif +endfunction + function! airline#extensions#branch#init(ext) call airline#parts#define_function('branch', 'airline#extensions#branch#get_head') - autocmd ShellCmdPost,CmdwinLeave * unlet! b:airline_head b:airline_do_mq_check - autocmd User AirlineBeforeRefresh unlet! b:airline_head b:airline_do_mq_check + autocmd ShellCmdPost,CmdwinLeave * call s:sh_autocmd_handler() + autocmd User AirlineBeforeRefresh call s:sh_autocmd_handler() autocmd BufWritePost * call s:reset_untracked_cache(0) autocmd ShellCmdPost * call s:reset_untracked_cache(1) endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bufferline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bufferline.vim index 033adba..0840c90 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bufferline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/bufferline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/bling/vim-bufferline " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/capslock.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/capslock.vim index 81d6df0..4d6e453 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/capslock.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/capslock.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2014-2019 Mathias Andersson et al. +" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al. " Plugin: https://github.com/tpope/vim-capslock " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/coc.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/coc.vim index c6bfa05..3841711 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/coc.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/coc.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2019 Peng Guanwen et al. +" MIT License. Copyright (c) 2019-2021 Peng Guanwen et al. " vim: et ts=2 sts=2 sw=2 " Plugin: https://github.com/neoclide/coc @@ -6,6 +6,7 @@ scriptencoding utf-8 let s:error_symbol = get(g:, 'airline#extensions#coc#error_symbol', 'E:') let s:warning_symbol = get(g:, 'airline#extensions#coc#warning_symbol', 'W:') +let s:show_coc_status = get(g:, 'airline#extensions#coc#show_coc_status', 1) function! airline#extensions#coc#get_warning() abort return airline#extensions#coc#get('warning') @@ -21,34 +22,33 @@ function! airline#extensions#coc#get(type) abort endif let _backup = get(g:, 'coc_stl_format', '') let is_err = (a:type is# 'error') - if is_err - let g:coc_stl_format = get(g:, 'airline#extensions#coc#stl_format_err', '%E{[%e(#%fe)]}') - else - let g:coc_stl_format = get(g:, 'airline#extensions#coc#stl_format_warn', '%W{[%w(#%fw)]}') - endif let info = get(b:, 'coc_diagnostic_info', {}) if empty(info) | return '' | endif let cnt = get(info, a:type, 0) - if !empty(_backup) - let g:coc_stl_format = _backup - endif if empty(cnt) return '' else - return (is_err ? s:error_symbol : s:warning_symbol).cnt + let lnum = printf('(L%d)', (info.lnums)[is_err ? 0 : 1]) + return (is_err ? s:error_symbol : s:warning_symbol).cnt.lnum endif endfunction function! airline#extensions#coc#get_status() abort " Shorten text for windows < 91 characters - return airline#util#shorten(get(g:, 'coc_status', ''), 91, 9) + let status = airline#util#shorten(get(g:, 'coc_status', ''), 91, 9) + return (s:show_coc_status ? status : '') +endfunction + +function! airline#extensions#coc#get_current_function() abort + return get(b:, 'coc_current_function', '') endfunction function! airline#extensions#coc#init(ext) abort call airline#parts#define_function('coc_error_count', 'airline#extensions#coc#get_error') call airline#parts#define_function('coc_warning_count', 'airline#extensions#coc#get_warning') call airline#parts#define_function('coc_status', 'airline#extensions#coc#get_status') + call airline#parts#define_function('coc_current_function', 'airline#extensions#coc#get_current_function') endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/commandt.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/commandt.vim index fd81506..1183bcf 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/commandt.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/commandt.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/wincent/command-t " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/csv.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/csv.vim index e94dd9d..694bc8b 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/csv.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/csv.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al. " Plugin: https://github.com/chrisbra/csv.vim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlp.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlp.vim index 8f9591e..136c348 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlp.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlp.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/ctrlpvim/ctrlp.vim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlspace.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlspace.vim index 1e1a99b..54800e1 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlspace.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ctrlspace.vim @@ -1,21 +1,21 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/szw/vim-ctrlspace " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 -function! airline#extensions#ctrlspace#statusline(...) +function! airline#extensions#ctrlspace#statusline(...) abort let spc = g:airline_symbols.space - let padding = spc . spc . spc + let l:padding = spc . spc . spc let cs = ctrlspace#context#Configuration().Symbols.CS let b = airline#builder#new({ 'active': 1 }) - call b.add_section('airline_b', cs . padding . ctrlspace#api#StatuslineModeSegment(s:padding)) + call b.add_section('airline_b', cs . l:padding . ctrlspace#api#StatuslineModeSegment(l:padding)) call b.split() call b.add_section('airline_x', spc . ctrlspace#api#StatuslineTabSegment() . spc) return b.build() endfunction -function! airline#extensions#ctrlspace#init(ext) +function! airline#extensions#ctrlspace#init(ext) abort let g:CtrlSpaceStatuslineFunction = "airline#extensions#ctrlspace#statusline()" endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/cursormode.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/cursormode.vim index 57d6cf5..7b25799 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/cursormode.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/cursormode.vim @@ -5,10 +5,12 @@ scriptencoding utf-8 -if !exists('g:loaded_cursormode') +if exists('g:loaded_cursormode') finish endif +let g:loaded_cursormode = 1 + let s:is_win = has('win32') || has('win64') let s:is_iTerm = exists('$TERM_PROGRAM') && $TERM_PROGRAM =~# 'iTerm.app' let s:is_AppleTerminal = exists('$TERM_PROGRAM') && $TERM_PROGRAM =~# 'Apple_Terminal' @@ -105,6 +107,10 @@ augroup airline#extensions#cursormode augroup END function! airline#extensions#cursormode#activate() + if !exists('#airline') + " airline disabled + return + endif let s:color_map = s:get_color_map() call airline#extensions#cursormode#set() endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/default.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/default.vim index 5cff300..7bfaf21 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/default.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/default.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -7,7 +7,7 @@ let s:section_use_groups = get(g:, 'airline#extensions#default#section_use_g let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', { \ 'b': 79, \ 'x': 60, - \ 'y': 88, + \ 'y': 80, \ 'z': 45, \ 'warning': 80, \ 'error': 80, @@ -76,17 +76,14 @@ else endfunction endif -function! airline#extensions#default#apply(builder, context) +function! airline#extensions#default#apply(builder, context) abort let winnr = a:context.winnr let active = a:context.active if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse)) call s:build_sections(a:builder, a:context, s:layout[0]) else - let text = s:get_section(winnr, 'c') - if empty(text) - let text = ' %f%m ' - endif + let text = !empty(s:get_section(winnr, 'c')) ? s:get_section(winnr, 'c') : ' %f%m ' call a:builder.add_section('airline_c'.(a:context.bufnr), text) endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/denite.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/denite.vim index dc3c529..014709d 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/denite.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/denite.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2017-2019 Thomas Dy et al. +" MIT License. Copyright (c) 2017-2021 Thomas Dy et al. " Plugin: https://github.com/Shougo/denite.nvim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/dirvish.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/dirvish.vim index 4e03fed..e1ef0c0 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/dirvish.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/dirvish.vim @@ -15,7 +15,7 @@ function! airline#extensions#dirvish#init(ext) abort endfunction function! airline#extensions#dirvish#apply(...) abort - if &filetype ==# 'dirvish' + if &filetype ==# 'dirvish' && exists('b:dirvish') let w:airline_section_a = 'Dirvish' let w:airline_section_b = exists('*airline#extensions#branch#get_head') diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/eclim.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/eclim.vim index d5c6f12..b1e0cde 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/eclim.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/eclim.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " PLugin: https://eclim.org " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/example.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/example.vim index c9194e6..80da7f8 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/example.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/example.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fern.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fern.vim new file mode 100644 index 0000000..8b5562a --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fern.vim @@ -0,0 +1,36 @@ +" MIT License. Copyright (c) 2013-2021 +" Plugin: https://github.com/lambdalisue/fern.vim +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 +if !get(g:, 'loaded_fern', 0) + finish +endif + +function! airline#extensions#fern#apply(...) abort + if (&ft =~# 'fern') + let spc = g:airline_symbols.space + let fri = fern#fri#parse(expand('%f')) + + call a:1.add_section('airline_a', spc.'fern'.spc) + if exists('*airline#extensions#branch#get_head') + call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc) + else + call a:1.add_section('airline_b', '') + endif + if !(fri.authority =~# '^drawer') + let abspath = substitute(fri.path, 'file://', '', '') + call a:1.add_section('airline_c', spc.fnamemodify(abspath, ':~')) + call a:1.split() + if len(get(g:, 'fern#comparators', {})) + call a:1.add_section('airline_y', spc.'%{fern#comparator}'.spc) + endif + endif + return 1 + endif +endfunction + +function! airline#extensions#fern#init(ext) abort + let g:fern_force_overwrite_statusline = 0 + call a:ext.add_statusline_func('airline#extensions#fern#apply') +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim index 2d0217d..8f1c4cb 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fugitiveline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2017-2019 Cimbali et al +" MIT License. Copyright (c) 2017-2021 Cimbali et al " Plugin: https://github.com/tpope/vim-fugitive " vim: et ts=2 sts=2 sw=2 @@ -8,45 +8,54 @@ if !airline#util#has_fugitive() finish endif -function! s:ModifierFlags() - return (exists("+autochdir") && &autochdir) ? ':p' : ':.' -endfunction +let s:has_percent_eval = v:version > 802 || (v:version == 802 && has("patch2854")) -function! airline#extensions#fugitiveline#bufname() +function! airline#extensions#fugitiveline#bufname() abort if !exists('b:fugitive_name') let b:fugitive_name = '' try if bufname('%') =~? '^fugitive:' && exists('*FugitiveReal') let b:fugitive_name = FugitiveReal(bufname('%')) - elseif exists('b:git_dir') && exists('*fugitive#repo') - if get(b:, 'fugitive_type', '') is# 'blob' - let b:fugitive_name = fugitive#repo().translate(FugitivePath(@%, '')) - endif - elseif exists('b:git_dir') && !exists('*fugitive#repo') - let buffer = fugitive#buffer() - if buffer.type('blob') - let b:fugitive_name = buffer.repo().translate(buffer.path('/')) - endif endif catch endtry endif - let fmod = s:ModifierFlags() + let fmod = (exists("+autochdir") && &autochdir) ? ':p' : ':.' + let result='' if empty(b:fugitive_name) - return fnamemodify(bufname('%'), fmod) + if empty(bufname('%')) + return &buftype ==# 'nofile' ? '[Scratch]' : '[No Name]' + endif + return s:has_percent_eval ? '%f' : fnamemodify(bufname('%'), fmod) else - return fnamemodify(b:fugitive_name, fmod). " [git]" + return s:has_percent_eval ? '%f [git]' : (fnamemodify(b:fugitive_name, fmod). " [git]") endif endfunction -function! airline#extensions#fugitiveline#init(ext) +function! s:sh_autocmd_handler() + if exists('#airline') + unlet! b:fugitive_name + endif +endfunction + +function! airline#extensions#fugitiveline#init(ext) abort + let prct = s:has_percent_eval ? '%' : '' + if exists("+autochdir") && &autochdir " if 'acd' is set, vim-airline uses the path section, so we need to redefine this here as well - call airline#parts#define_raw('path', '%<%{airline#extensions#fugitiveline#bufname()}%m') + if get(g:, 'airline_stl_path_style', 'default') ==# 'short' + call airline#parts#define_raw('path', '%<%{'. prct. 'pathshorten(airline#extensions#fugitiveline#bufname())' . prct . '}%m') + else + call airline#parts#define_raw('path', '%<%{' . prct . 'airline#extensions#fugitiveline#bufname()' . prct . '}%m') + endif else - call airline#parts#define_raw('file', '%<%{airline#extensions#fugitiveline#bufname()}%m') + if get(g:, 'airline_stl_path_style', 'default') ==# 'short' + call airline#parts#define_raw('file', '%<%{' . prct . 'pathshorten(airline#extensions#fugitiveline#bufname())' . prct . '}%m') + else + call airline#parts#define_raw('file', '%<%{' . prct . 'airline#extensions#fugitiveline#bufname()' . prct . '}%m') + endif endif - autocmd ShellCmdPost,CmdwinLeave * unlet! b:fugitive_name - autocmd User AirlineBeforeRefresh unlet! b:fugitive_name + autocmd ShellCmdPost,CmdwinLeave * call s:sh_autocmd_handler() + autocmd User AirlineBeforeRefresh call s:sh_autocmd_handler() endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fzf.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fzf.vim new file mode 100644 index 0000000..760a1cc --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/fzf.vim @@ -0,0 +1,44 @@ +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" Plugin: https://github.com/junegunn/fzf, https://github.com/junegunn/fzf.vim +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +function! airline#extensions#fzf#init(ext) abort + " Remove the custom statusline that fzf.vim sets by removing its `FileType + " fzf` autocmd. Ideally we'd use `let g:fzf_statusline = 0`, but this + " variable is checked *before* airline#extensions#init() is called. + augroup _fzf_statusline + autocmd! + augroup END + + call a:ext.add_statusline_func('airline#extensions#fzf#apply') + call a:ext.add_inactive_statusline_func('airline#extensions#fzf#inactive_apply') +endfunction + +function! airline#extensions#fzf#statusline(...) abort + let spc = g:airline_symbols.space + + let builder = airline#builder#new({ 'active': 1 }) + call builder.add_section('airline_a', spc.'FZF'.spc) + call builder.add_section('airline_c', '') + return builder.build() +endfunction + +function! airline#extensions#fzf#apply(...) abort + if &filetype ==# 'fzf' + let spc = g:airline_symbols.space + call a:1.add_section('airline_a', spc.'FZF'.spc) + call a:1.add_section('airline_c', '') + return 1 + endif +endfunction + +function! airline#extensions#fzf#inactive_apply(...) abort + if getbufvar(a:2.bufnr, '&filetype') ==# 'fzf' + let spc = g:airline_symbols.space + call a:1.add_section('airline_a', spc.'FZF'.spc) + call a:1.add_section('airline_c', '') + return 1 + endif +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gen_tags.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gen_tags.vim new file mode 100644 index 0000000..ff788bc --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gen_tags.vim @@ -0,0 +1,19 @@ +" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al. +" Written by Kamil Cukrowski 2020 +" Plugin: https://github.com/jsfaint/gen_tags.vim +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !(get(g:, 'loaded_gentags#gtags', 0) || get(g:, 'loaded_gentags#ctags', 0)) + finish +endif + +function! airline#extensions#gen_tags#status(...) abort + return gen_tags#job#is_running() != 0 ? 'Gen. gen_tags' : '' +endfunction + +function! airline#extensions#gen_tags#init(ext) abort + call airline#parts#define_function('gen_tags', 'airline#extensions#gen_tags#status') +endfunction + diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gina.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gina.vim index 7c699a1..58a636a 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gina.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gina.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 +" MIT License. Copyright (c) 2013-2021 " Plugin: https://github.com/lambdalisue/gina.vim " vim: et ts=2 sts=2 sw=2 @@ -8,7 +8,11 @@ if !get(g:, 'loaded_gina', 0) endif function! airline#extensions#gina#apply(...) abort - if (&ft =~# 'gina' && &ft !~# 'blame') || &ft ==# 'diff' + " gina.vim seems to set b:gina_initialized = 1 in diff buffers it open, + " where get(b:, 'gina_initialized', 0) returns 1. + " In diff buffers not opened by gina.vim b:gina_initialized is not set, + " so get(b:, 'gina_initialized', 0) returns 0. + if (&ft =~# 'gina' && &ft !~# 'blame') || (&ft ==# 'diff' && get(b:, 'gina_initialized', 0)) call a:1.add_section('airline_a', ' gina ') call a:1.add_section('airline_b', ' %{gina#component#repo#branch()} ') call a:1.split() diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/grepper.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/grepper.vim index 3b3f099..2f1d4b3 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/grepper.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/grepper.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2014-2019 Mathias Andersson et al. +" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al. " Plugin: https://github.com/mhinz/vim-grepper " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gutentags.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gutentags.vim index 857a929..a2a78c7 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gutentags.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/gutentags.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2014-2019 Mathias Andersson et al. +" MIT License. Copyright (c) 2014-2021 Mathias Andersson et al. " Plugin: https://github.com/ludovicchabant/vim-gutentags " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/hunks.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/hunks.vim index 815efa5..4439da4 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/hunks.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/hunks.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: vim-gitgutter, vim-signify, changesPlugin, quickfixsigns, coc-git " vim: et ts=2 sts=2 sw=2 @@ -16,24 +16,14 @@ let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0) let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-']) function! s:coc_git_enabled() abort - if !exists("*CocAction") + if !exists("*CocAction") || + \ !get(g:, 'airline#extensions#hunks#coc_git', 0) + " coc-git extension is disabled by default + " unless specifically being enabled by the user + " (as requested from coc maintainer) return 0 endif - if exists("s:airline_coc_git_enabled") - return s:airline_coc_git_enabled - endif - let extensions=CocAction('extensionStats') - if type(extensions) != type([]) - " not yet initialized? Assume it is available... - return 1 - endif - let coc_git=filter(extensions, 'v:val.id is# "coc-git" && v:val.state is# "activated"') - if !empty(coc_git) - let s:airline_coc_git_enabled = 1 - else - let s:airline_coc_git_enabled = 0 - endif - return s:airline_coc_git_enabled + return 1 endfunction function! s:get_hunks_signify() abort @@ -62,16 +52,9 @@ function! s:get_hunks_coc() abort return result endfunction -function! s:is_branch_empty() abort - return exists('*airline#extensions#branch#head') && - \ empty(get(b:, 'airline_head', '')) -endfunction - function! s:get_hunks_gitgutter() abort - if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty() - return '' - endif - return GitGutterGetHunkSummary() + let hunks = GitGutterGetHunkSummary() + return hunks == [0, 0, 0] ? [] : hunks endfunction function! s:get_hunks_changes() abort @@ -128,6 +111,11 @@ function! airline#extensions#hunks#get_hunks() abort endif endfor endif + if index(airline#extensions#get_loaded_extensions(), 'branch') == -1 && string[-1:] == ' ' + " branch extension not loaded, skip trailing whitespace + let string = string[0:-2] + endif + let b:airline_hunks = string let b:airline_changenr = b:changedtick let s:airline_winwidth = airline#util#winwidth() diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim index 177a9f7..c37584a 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/keymap.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Doron Behar, C.Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Doron Behar, C.Brabandt et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -9,7 +9,18 @@ endif function! airline#extensions#keymap#status() if (get(g:, 'airline#extensions#keymap#enabled', 1) && has('keymap')) - return printf('%s', (!empty(&keymap) ? (g:airline_symbols.keymap . ' '. &keymap) : '')) + let short_codes = get(g:, 'airline#extensions#keymap#short_codes', {}) + let label = get(g:, 'airline#extensions#keymap#label', g:airline_symbols.keymap) + let default = get(g:, 'airline#extensions#keymap#default', '') + if (label !=# '') + let label .= ' ' + endif + let keymap = &keymap + if has_key(short_codes, keymap) + let keymap = short_codes[keymap] + endif + return printf('%s', (!empty(keymap) && &iminsert ? (label . keymap) : + \ (!empty(default) ? label . default : default))) else return '' endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/languageclient.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/languageclient.vim index 737e90e..c6c13f3 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/languageclient.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/languageclient.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bjorn Neergaard, hallettj et al. +" MIT License. Copyright (c) 2013-2021 Bjorn Neergaard, hallettj et al. " Plugin: https://github.com/autozimu/LanguageClient-neovim " vim: et ts=2 sts=2 sw=2 @@ -35,6 +35,10 @@ function! s:record_diagnostics(state) endfunction function! s:get_diagnostics() + if !exists('#airline') + " airline disabled + return + endif call LanguageClient#getState(function("s:record_diagnostics")) endfunction @@ -66,6 +70,10 @@ function! s:airline_languageclient_get_line_number(type) abort endfunction function! airline#extensions#languageclient#get(type) + if get(b:, 'LanguageClient_isServerRunning', 0) ==# 0 + return '' + endif + let is_err = a:type == s:severity_error let symbol = is_err ? s:error_symbol : s:warning_symbol diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/localsearch.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/localsearch.vim index 7d41e1e..d20b7da 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/localsearch.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/localsearch.vim @@ -1,5 +1,5 @@ -" MIT License. Copyright (c) 2018-2019 mox et al. -" Plugin: https://github.com/mox-mox/localsearch +" MIT License. Copyright (c) 2018-2021 mox et al. +" Plugin: https://github.com/mox-mox/vim-localsearch " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -12,25 +12,30 @@ let g:airline#extensions#localsearch#loaded = 001 let s:spc = g:airline_symbols.space -function! airline#extensions#localsearch#load_theme(palette) +let g:airline#extensions#localsearch#inverted = get(g:, 'airline#extensions#localsearch#inverted', 0) + +function! airline#extensions#localsearch#load_theme(palette) abort call airline#highlighter#exec('localsearch_dark', [ '#ffffff' , '#000000' , 15 , 1 , '']) endfunction -function! airline#extensions#localsearch#init(ext) - call a:ext.add_theme_func('airline#extensions#localsearch#load_theme') - call a:ext.add_statusline_func('airline#extensions#localsearch#apply') +function! airline#extensions#localsearch#init(ext) abort + call a:ext.add_theme_func('airline#extensions#localsearch#load_theme') + call a:ext.add_statusline_func('airline#extensions#localsearch#apply') endfunction -function! airline#extensions#localsearch#apply(...) +function! airline#extensions#localsearch#apply(...) abort " first variable is the statusline builder let builder = a:1 """"" WARNING: the API for the builder is not finalized and may change - if exists('#localsearch#WinEnter') " If localsearch mode is enabled + if exists('#localsearch#WinEnter') && !g:airline#extensions#localsearch#inverted " If localsearch mode is enabled and 'invert' option is false call builder.add_section('localsearch_dark', s:spc.airline#section#create('LS').s:spc) endif + if !exists('#localsearch#WinEnter') && g:airline#extensions#localsearch#inverted " If localsearch mode is disabled and 'invert' option is true + call builder.add_section('localsearch_dark', s:spc.airline#section#create('GS').s:spc) + endif return 0 endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/lsp.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/lsp.vim index 8d577b6..f275ddb 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/lsp.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/lsp.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 François-Xavier Carton et al. +" MIT License. Copyright (c) 2013-2021 François-Xavier Carton et al. " Plugin: https://github.com/prabirshrestha/vim-lsp " vim: et ts=2 sts=2 sw=2 @@ -61,7 +61,51 @@ function! airline#extensions#lsp#get_error() abort return airline#extensions#lsp#get('error') endfunction +let s:lsp_progress = [] +function! airline#extensions#lsp#progress() abort + if get(w:, 'airline_active', 0) + if exists('*lsp#get_progress') + let s:lsp_progress = lsp#get_progress() + + if len(s:lsp_progress) == 0 | return '' | endif + + " show only most new progress + let s:lsp_progress = s:lsp_progress[0] + if s:lsp_progress['message'] !=# '' + let percent = '' + if has_key(s:lsp_progress, 'percentage') && s:lsp_progress['percentage'] >= 0 + let percent = ' ' . string(s:lsp_progress['percentage']) . '%' + endif + let s:title = s:lsp_progress['title'] + let message = airline#util#shorten(s:lsp_progress['message'] . percent, 91, 9) + return s:lsp_progress['server'] . ': ' . s:title . ' ' . message + endif + endif + endif + return '' +endfunction + +let s:timer = 0 +let s:ignore_time = 0 +function! airline#extensions#lsp#update() abort + if !exists('#airline') + " airline disabled + return + endif + if reltimefloat(reltime()) - s:ignore_time >= + \ get(g:, 'airline#extensions#lsp#progress_skip_time', 0.3) + \ || len(s:lsp_progress) == 0 + call airline#update_statusline() + let s:ignore_time = reltimefloat(reltime()) + endif +endfunction + function! airline#extensions#lsp#init(ext) abort call airline#parts#define_function('lsp_error_count', 'airline#extensions#lsp#get_error') call airline#parts#define_function('lsp_warning_count', 'airline#extensions#lsp#get_warning') + call airline#parts#define_function('lsp_progress', 'airline#extensions#lsp#progress') + augroup airline_lsp_progress + autocmd! + autocmd User lsp_progress_updated call airline#extensions#lsp#update() + augroup END endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/neomake.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/neomake.vim index 16e534a..cf9125f 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/neomake.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/neomake.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/neomake/neomake " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/netrw.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/netrw.vim index c6776f4..830cb88 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/netrw.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/netrw.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: http://www.drchip.org/astronaut/vim/#NETRW " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nrrwrgn.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nrrwrgn.vim index 141c14c..45d1a6e 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nrrwrgn.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nrrwrgn.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al. " Plugin: https://github.com/chrisbra/NrrwRgn " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nvimlsp.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nvimlsp.vim new file mode 100644 index 0000000..0a63e6f --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/nvimlsp.vim @@ -0,0 +1,69 @@ +" Apache 2.0 license. Copyright (c) 2019-2021 Copyright Neovim contributors. +" Plugin: https://github.com/neovim/nvim-lsp +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !(get(g:, 'airline#extensions#nvimlsp#enabled', 1) + \ && has('nvim') + \ && luaeval('vim.lsp ~= nil')) + finish +endif + +function! s:airline_nvimlsp_count(cnt, symbol) abort + return a:cnt ? a:symbol. a:cnt : '' +endfunction + +function! airline#extensions#nvimlsp#get(type) abort + if luaeval('vim.tbl_isempty(vim.lsp.buf_get_clients(0))') + return '' + endif + + let error_symbol = get(g:, 'airline#extensions#nvimlsp#error_symbol', 'E:') + let warning_symbol = get(g:, 'airline#extensions#nvimlsp#warning_symbol', 'W:') + let show_line_numbers = get(g:, 'airline#extensions#nvimlsp#show_line_numbers', 1) + + let is_err = a:type ==# 'Error' + + let symbol = is_err ? error_symbol : warning_symbol + + if luaeval("pcall(require, 'vim.diagnostic')") + let severity = a:type == 'Warning' ? 'Warn' : a:type + let num = len(v:lua.vim.diagnostic.get(0, { 'severity': severity })) + elseif luaeval("pcall(require, 'vim.lsp.diagnostic')") + let num = v:lua.vim.lsp.diagnostic.get_count(0, a:type) + else + let num = v:lua.vim.lsp.util.buf_diagnostics_count(a:type) + endif + + if show_line_numbers == 1 && luaeval("pcall(require, 'vim.diagnostic')") && num > 0 + return s:airline_nvimlsp_count(num, symbol) . airline_nvimlsp_get_line_number(num, a:type) + else + return s:airline_nvimlsp_count(num, symbol) + endif +endfunction + +function! s:airline_nvimlsp_get_line_number(cnt, type) abort + let severity = a:type == 'Warning' ? 'Warn' : a:type + let num = v:lua.vim.diagnostic.get(0, { 'severity': severity })[0].lnum + + let l:open_lnum_symbol = + \ get(g:, 'airline#extensions#nvimlsp#open_lnum_symbol', '(L') + let l:close_lnum_symbol = + \ get(g:, 'airline#extensions#nvimlsp#close_lnum_symbol', ')') + + return open_lnum_symbol . num . close_lnum_symbol +endfunction + +function! airline#extensions#nvimlsp#get_warning() abort + return airline#extensions#nvimlsp#get('Warning') +endfunction + +function! airline#extensions#nvimlsp#get_error() abort + return airline#extensions#nvimlsp#get('Error') +endfunction + +function! airline#extensions#nvimlsp#init(ext) abort + call airline#parts#define_function('nvimlsp_error_count', 'airline#extensions#nvimlsp#get_error') + call airline#parts#define_function('nvimlsp_warning_count', 'airline#extensions#nvimlsp#get_warning') +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/obsession.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/obsession.vim index 1f6bd8d..9b22952 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/obsession.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/obsession.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/tpope/vim-obsession " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/omnisharp.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/omnisharp.vim new file mode 100644 index 0000000..92a4acb --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/omnisharp.vim @@ -0,0 +1,45 @@ +" MIT License +" Plugin: https://github.com/OmniSharp/omnisharp-vim +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !get(g:, 'OmniSharp_loaded', 0) + finish +endif + +function! airline#extensions#omnisharp#server_status(...) abort + if !exists(':OmniSharpGotoDefinition') || !get(g:, 'OmniSharp_server_stdio', 0) + return '' + endif + + let host = OmniSharp#GetHost(bufnr('%')) + if type(host.job) != v:t_dict || get(host.job, 'stopped') + return '' + endif + + let sln = fnamemodify(host.sln_or_dir, ':t') + + if get(host.job, 'loaded', 0) + return sln + endif + + try + let projectsloaded = OmniSharp#project#CountLoaded() + let projectstotal = OmniSharp#project#CountTotal() + catch + " The CountLoaded and CountTotal functions are very new - catch the error + " when they don't exist + let projectsloaded = 0 + let projectstotal = 0 + endtry + return printf('%s(%d/%d)', sln, projectsloaded, projectstotal) +endfunction + +function! airline#extensions#omnisharp#init(ext) abort + call airline#parts#define_function('omnisharp', 'airline#extensions#omnisharp#server_status') + augroup airline_omnisharp + autocmd! + autocmd User OmniSharpStarted,OmniSharpReady,OmniSharpStopped AirlineRefresh! + augroup END +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/po.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/po.vim index 8ec3b5c..4fc18d8 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/po.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/po.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -10,7 +10,7 @@ function! airline#extensions#po#shorten() if exists("g:airline#extensions#po#displayed_limit") let w:displayed_po_limit = g:airline#extensions#po#displayed_limit if len(b:airline_po_stats) > w:displayed_po_limit - 1 - let b:airline_po_stats = b:airline_po_stats[0:(w:displayed_po_limit - 2)].(&encoding==?'utf-8' ? '…' : '.'). ']' + let b:airline_po_stats = b:airline_po_stats[0:(w:displayed_po_limit - 2)].(&encoding==?'utf-8' ? '…' : '.') endif endif if strlen(get(b:, 'airline_po_stats', '')) >= 30 && airline#util#winwidth() < 150 @@ -19,27 +19,34 @@ function! airline#extensions#po#shorten() let messages = '' " Shorten [120 translated, 50 fuzzy, 4 untranslated] to [120T/50F/4U] if b:airline_po_stats =~ 'fuzzy' - let fuzzy = substitute(b:airline_po_stats, '.*\(\d\+\) fuzzy.*', '\1F', '') + let fuzzy = substitute(b:airline_po_stats, '.\{-}\(\d\+\) fuzzy.*', '\1F', '') if fuzzy == '0F' let fuzzy = '' endif endif if b:airline_po_stats =~ 'untranslated' - let untranslated = substitute(b:airline_po_stats, '.*\(\d\+\) untranslated.*', '\1U', '') + let untranslated = substitute(b:airline_po_stats, '.\{-}\(\d\+\) untranslated.*', '\1U', '') if untranslated == '0U' let untranslated = '' endif endif let messages = substitute(b:airline_po_stats, '\(\d\+\) translated.*', '\1T', '') + if messages ==# '0T' + let messages = '' + endif let b:airline_po_stats = printf('%s%s%s', fuzzy, (empty(fuzzy) || empty(untranslated) ? '' : '/'), untranslated) - if strlen(b:airline_po_stats) < 8 - let b:airline_po_stats = messages. (!empty(b:airline_po_stats) ? '/':''). b:airline_po_stats + if strlen(b:airline_po_stats) < 10 + let b:airline_po_stats = messages. (!empty(b:airline_po_stats) && !empty(messages) ? '/':''). b:airline_po_stats endif endif - let b:airline_po_stats = '['.b:airline_po_stats. ']' + let b:airline_po_stats = '['.b:airline_po_stats. '] ' endfunction function! airline#extensions#po#on_winenter() + if !exists('#airline') + " airline disabled + return + endif " only reset cache, if the window size changed if get(b:, 'airline_winwidth', 0) != airline#util#winwidth() let b:airline_winwidth = airline#util#winwidth() @@ -48,11 +55,17 @@ function! airline#extensions#po#on_winenter() endif endfunction +function! s:autocmd_handler() + if exists('#airline') + unlet! b:airline_po_stats + endif +endfunction + function! airline#extensions#po#apply(...) if &ft ==# 'po' call airline#extensions#prepend_to_section('z', '%{airline#extensions#po#stats()}') " Also reset the cache variable, if a window has been split, e.g. the winwidth changed - autocmd airline BufWritePost * unlet! b:airline_po_stats + autocmd airline BufWritePost * call s:autocmd_handler() autocmd airline WinEnter * call airline#extensions#po#on_winenter() endif endfunction @@ -62,7 +75,12 @@ function! airline#extensions#po#stats() return b:airline_po_stats endif - let cmd = 'msgfmt --statistics -o /dev/null -- ' + " Write stdout to null because we only want to see warnings. + if g:airline#init#is_windows + let cmd = 'msgfmt --statistics -o /NUL ' + else + let cmd = 'msgfmt --statistics -o /dev/null -- ' + endif if g:airline#init#vim_async call airline#async#get_msgfmt_stat(cmd, expand('%:p')) elseif has("nvim") diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/poetv.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/poetv.vim index 56a5f1a..3e7c77f 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/poetv.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/poetv.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/petobens/poet_v " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/promptline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/promptline.vim index 1845151..547bdd1 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/promptline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/promptline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/edkolev/promptline.vim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim index b3d69c2..5f62042 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/rufo.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/rufo.vim new file mode 100644 index 0000000..b8558f3 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/rufo.vim @@ -0,0 +1,38 @@ +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !exists('g:rufo_loaded') + finish +endif + +let s:spc = g:airline_symbols.space + +if !exists('g:airline#extensions#rufo#symbol') + let g:airline#extensions#rufo#symbol = 'RuFo' +endif + +function! airline#extensions#rufo#init(ext) + call airline#parts#define_raw('rufo', '%{airline#extensions#rufo#get_status}') + call a:ext.add_statusline_func('airline#extensions#rufo#apply') +endfunction + +function! airline#extensions#rufo#get_status() + let out = '' + if &ft == "ruby" && g:rufo_auto_formatting == 1 + let out .= s:spc.g:airline_left_alt_sep.s:spc.g:airline#extensions#rufo#symbol + endif + return out +endfunction + +" This function will be invoked just prior to the statusline getting modified. +function! airline#extensions#rufo#apply(...) + " First we check for the filetype. + if &filetype == "ruby" + " section_z. + let w:airline_section_z = get(w:, 'airline_section_z', g:airline_section_z) + + " Then we just append this extenion to it, optionally using separators. + let w:airline_section_z .= '%{airline#extensions#rufo#get_status()}' + endif +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/scrollbar.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/scrollbar.vim new file mode 100644 index 0000000..3d25a0c --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/scrollbar.vim @@ -0,0 +1,37 @@ +" MIT License. Copyright (c) 2013-2021 +" vim: et ts=2 sts=2 sw=2 et + +scriptencoding utf-8 + +function! airline#extensions#scrollbar#calculate() abort + if winwidth(0) > get(g:, 'airline#extensions#scrollbar#minwidth', 200) + \ && get(w:, 'airline_active', 0) + let overwrite = 0 + if &encoding ==? 'utf-8' && !get(g:, 'airline_symbols_ascii', 0) + let [left, right, middle] = [ '|', '|', '█'] + let overwrite = 1 + else + let [left, right, middle] = [ '[', ']', '-'] + endif + let spc = get(g:, 'airline_symbols.space', ' ') + let width = 20 " max width, plus one border and indicator + let perc = (line('.') + 0.0) / (line('$') + 0.0) + let before = float2nr(round(perc * width)) + if before >= 0 && line('.') == 1 + let before = 0 + let left = (overwrite ? '' : left) + endif + let after = width - before + if (after <= 1 && line('.') == line('$')) + let after = 0 + let right = (overwrite ? '' : right) + endif + return left . repeat(spc, before) . middle . repeat(spc, after) . right + else + return '' + endif +endfunction + +function! airline#extensions#scrollbar#init(ext) abort + call airline#parts#define_function('scrollbar', 'airline#extensions#scrollbar#calculate') +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/searchcount.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/searchcount.vim new file mode 100644 index 0000000..c28a319 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/searchcount.vim @@ -0,0 +1,50 @@ +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" This extension is inspired by vim-anzu . +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !exists('*searchcount') + finish +endif + +function! airline#extensions#searchcount#init(ext) abort + call a:ext.add_statusline_func('airline#extensions#searchcount#apply') +endfunction + +function! airline#extensions#searchcount#apply(...) abort + call airline#extensions#append_to_section('y', + \ '%{v:hlsearch ? airline#extensions#searchcount#status() : ""}') +endfunction + +function! s:search_term() + " shorten for all width smaller than 300 (this is just a guess) + " this uses a non-breaking space, because it looks like + " a leading space is stripped :/ + return "\ua0" . '/' . airline#util#shorten(getreg('/'), 300, 8) +endfunction + +function! airline#extensions#searchcount#status() abort + try + let result = searchcount(#{recompute: 1, maxcount: -1}) + if empty(result) || result.total ==# 0 + return '' + endif + if result.incomplete ==# 1 " timed out + return printf('%s [?/??]', s:search_term()) + elseif result.incomplete ==# 2 " max count exceeded + if result.total > result.maxcount && + \ result.current > result.maxcount + return printf('%s[>%d/>%d]', s:search_term(), + \ result.current, result.total) + elseif result.total > result.maxcount + return printf('%s[%d/>%d]', s:search_term(), + \ result.current, result.total) + endif + endif + return printf('%s[%d/%d]', s:search_term(), + \ result.current, result.total) + catch + return '' + endtry +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/syntastic.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/syntastic.vim index 48fe505..831e07e 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/syntastic.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/syntastic.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/vim-syntastic/syntastic " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline.vim index ea76267..6da0994 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline.vim @@ -1,5 +1,5 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. -" vim: et ts=2 sts=2 sw=2 +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" vim: et ts=2 sts=2 sw=2 et scriptencoding utf-8 @@ -10,9 +10,13 @@ endif let s:ctrlspace = get(g:, 'CtrlSpaceLoaded', 0) let s:tabws = get(g:, 'tabws_loaded', 0) +let s:current_tabcnt = -1 + +" Dictionary functions are not possible in Vim9 Script, +" so use the legacy Vim Script implementation function! airline#extensions#tabline#init(ext) - if has('gui_running') + if has('gui_running') && match(&guioptions, 'e') > -1 set guioptions-=e endif @@ -23,238 +27,454 @@ function! airline#extensions#tabline#init(ext) call a:ext.add_theme_func('airline#extensions#tabline#load_theme') endfunction -function! s:toggle_off() - call airline#extensions#tabline#autoshow#off() - call airline#extensions#tabline#tabs#off() - call airline#extensions#tabline#buffers#off() - if s:ctrlspace - call airline#extensions#tabline#ctrlspace#off() - endif - if s:tabws - call airline#extensions#tabline#tabws#off() +function! airline#extensions#tabline#add_label(dict, type, right) + if get(g:, 'airline#extensions#tabline#show_tab_type', 1) + call a:dict.add_section_spaced('airline_tablabel'. (a:right ? '_right' : ''), + \ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type)) endif endfunction -function! s:toggle_on() - if get(g:, 'airline_statusline_ontop', 0) - call airline#extensions#tabline#enable() - let &tabline='%!airline#statusline('.winnr().')' - return - endif - call airline#extensions#tabline#autoshow#on() - call airline#extensions#tabline#tabs#on() - call airline#extensions#tabline#buffers#on() - if s:ctrlspace - call airline#extensions#tabline#ctrlspace#on() - endif - if s:tabws - call airline#extensions#tabline#tabws#on() +function! airline#extensions#tabline#add_tab_label(dict) + let show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1) + if show_tab_count == 2 + call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) + elseif show_tab_count == 1 && tabpagenr('$') > 1 + call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) endif - - set tabline=%!airline#extensions#tabline#get() endfunction -function! s:update_tabline(forceit) - if get(g:, 'airline#extensions#tabline#disable_refresh', 0) - return - endif - " loading a session file - " On SessionLoadPost, g:SessionLoad variable is still set :/ - if !a:forceit && get(g:, 'SessionLoad', 0) - return - endif - let match = expand('') - if pumvisible() - return - elseif !get(g:, 'airline#extensions#tabline#enabled', 0) - return - " return, if buffer matches ignore pattern or is directory (netrw) - elseif empty(match) || airline#util#ignore_buf(match) || isdirectory(match) - return - endif - call airline#util#doautocmd('BufMRUChange') - call airline#extensions#tabline#redraw() -endfunction -function! airline#extensions#tabline#redraw() - " sometimes, the tabline is not correctly updated see #1580 - " so force redraw here - if exists(":redrawtabline") == 2 - redrawtabline - else - " Have to set a property equal to itself to get airline to re-eval. - " Setting `let &tabline=&tabline` destroys the cursor position so we - " need something less invasive. - let &ro = &ro - endif -endfunction +if !exists(":def") || !airline#util#has_vim9_script() -function! airline#extensions#tabline#enable() - if &lines > 3 - set showtabline=2 - endif -endfunction + " Legacy Vim Script Implementation -function! airline#extensions#tabline#load_theme(palette) - if pumvisible() - return - endif - let colors = get(a:palette, 'tabline', {}) - let tablabel = get(colors, 'airline_tablabel', a:palette.normal.airline_b) - " Theme for tabs on the left - let tab = get(colors, 'airline_tab', a:palette.normal.airline_b) - let tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a) - let tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a) - let tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c) - let tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a) - let tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c) - if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c') - let tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c) - else - "Fall back to normal airline_c if modified airline_c isn't present - let tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c) - endif - call airline#highlighter#exec('airline_tablabel', tablabel) - call airline#highlighter#exec('airline_tab', tab) - call airline#highlighter#exec('airline_tabsel', tabsel) - call airline#highlighter#exec('airline_tabtype', tabtype) - call airline#highlighter#exec('airline_tabfill', tabfill) - call airline#highlighter#exec('airline_tabmod', tabmod) - call airline#highlighter#exec('airline_tabmod_unsel', tabmodu) - call airline#highlighter#exec('airline_tabhid', tabhid) - - " Theme for tabs on the right - " label on the right - let tablabel_r = get(colors, 'airline_tablabel', a:palette.normal.airline_b) - let tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a) - let tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c) - let tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a) - let tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c) - if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c') - let tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c) - else - "Fall back to normal airline_c if modified airline_c isn't present - let tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c) - endif - call airline#highlighter#exec('airline_tablabel_right', tablabel_r) - call airline#highlighter#exec('airline_tab_right', tab_right) - call airline#highlighter#exec('airline_tabsel_right', tabsel_right) - call airline#highlighter#exec('airline_tabmod_right', tabmod_right) - call airline#highlighter#exec('airline_tabhid_right', tabhid_right) - call airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right) -endfunction + function! s:toggle_off() + call airline#extensions#tabline#autoshow#off() + call airline#extensions#tabline#tabs#off() + call airline#extensions#tabline#buffers#off() + if s:ctrlspace + call airline#extensions#tabline#ctrlspace#off() + endif + if s:tabws + call airline#extensions#tabline#tabws#off() + endif + endfunction -let s:current_tabcnt = -1 + function! s:toggle_on() + if get(g:, 'airline_statusline_ontop', 0) + call airline#extensions#tabline#enable() + let &tabline='%!airline#statusline('.winnr().')' + return + endif + call airline#extensions#tabline#autoshow#on() + call airline#extensions#tabline#tabs#on() + call airline#extensions#tabline#buffers#on() + if s:ctrlspace + call airline#extensions#tabline#ctrlspace#on() + endif + if s:tabws + call airline#extensions#tabline#tabws#on() + endif -function! airline#extensions#tabline#get() - let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) - let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) - - let curtabcnt = tabpagenr('$') - if curtabcnt != s:current_tabcnt - let s:current_tabcnt = curtabcnt - call airline#extensions#tabline#tabs#invalidate() - call airline#extensions#tabline#buffers#invalidate() - call airline#extensions#tabline#ctrlspace#invalidate() - call airline#extensions#tabline#tabws#invalidate() - endif + set tabline=%!airline#extensions#tabline#get() + endfunction - if !exists('#airline#BufAdd#*') - autocmd airline BufAdd * call update_tabline(0) - endif - if !exists('#airline#SessionLoadPost') - autocmd airline SessionLoadPost * call update_tabline(1) - endif - if s:ctrlspace - return airline#extensions#tabline#ctrlspace#get() - elseif s:tabws - return airline#extensions#tabline#tabws#get() - elseif show_buffers && curtabcnt == 1 || !show_tabs - return airline#extensions#tabline#buffers#get() - else - return airline#extensions#tabline#tabs#get() - endif -endfunction + function! airline#extensions#tabline#load_theme(palette) + if pumvisible() + return + endif + let colors = get(a:palette, 'tabline', {}) + let tablabel = get(colors, 'airline_tablabel', a:palette.normal.airline_b) + " Theme for tabs on the left + let tab = get(colors, 'airline_tab', a:palette.inactive.airline_c) + let tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a) + let tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a) + let tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c) + let tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a) + let tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c) + if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c') + let tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c) + let tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal_modified.airline_c) + else + "Fall back to normal airline_c if modified airline_c isn't present + let tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c) + let tabmodu_right = get(colors, 'airline_tabmod_unsel_right', a:palette.normal.airline_c) + endif + call airline#highlighter#exec('airline_tablabel', tablabel) + call airline#highlighter#exec('airline_tab', tab) + call airline#highlighter#exec('airline_tabsel', tabsel) + call airline#highlighter#exec('airline_tabtype', tabtype) + call airline#highlighter#exec('airline_tabfill', tabfill) + call airline#highlighter#exec('airline_tabmod', tabmod) + call airline#highlighter#exec('airline_tabmod_unsel', tabmodu) + call airline#highlighter#exec('airline_tabhid', tabhid) -function! airline#extensions#tabline#title(n) - let title = '' - if s:taboo - let title = TabooTabTitle(a:n) - endif + " Theme for tabs on the right + " label on the right + let tablabel_r = get(colors, 'airline_tablabel', a:palette.normal.airline_b) + let tabsel_right = get(colors, 'airline_tabsel_right', a:palette.normal.airline_a) + let tab_right = get(colors, 'airline_tab_right', a:palette.inactive.airline_c) + let tabmod_right = get(colors, 'airline_tabmod_right', a:palette.insert.airline_a) + let tabhid_right = get(colors, 'airline_tabhid_right', a:palette.normal.airline_c) + call airline#highlighter#exec('airline_tablabel_right', tablabel_r) + call airline#highlighter#exec('airline_tab_right', tab_right) + call airline#highlighter#exec('airline_tabsel_right', tabsel_right) + call airline#highlighter#exec('airline_tabmod_right', tabmod_right) + call airline#highlighter#exec('airline_tabhid_right', tabhid_right) + call airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right) + endfunction - if empty(title) && exists('*gettabvar') - let title = gettabvar(a:n, 'title') - endif + function! s:update_tabline(forceit) + if get(g:, 'airline#extensions#tabline#disable_refresh', 0) + return + endif + " loading a session file + " On SessionLoadPost, g:SessionLoad variable is still set :/ + if !a:forceit && get(g:, 'SessionLoad', 0) + return + endif + let match = expand('') + if pumvisible() + return + elseif !get(g:, 'airline#extensions#tabline#enabled', 0) + return + " return, if buffer matches ignore pattern or is directory (netrw) + elseif empty(match) || airline#util#ignore_buf(match) || isdirectory(match) + return + endif + call airline#util#doautocmd('BufMRUChange') + call airline#extensions#tabline#redraw() + endfunction - if empty(title) - let buflist = tabpagebuflist(a:n) - let winnr = tabpagewinnr(a:n) - let all_buffers = airline#extensions#tabline#buflist#list() - return airline#extensions#tabline#get_buffer_name( - \ buflist[winnr - 1], - \ filter(buflist, 'index(all_buffers, v:val) != -1')) - endif + function! airline#extensions#tabline#redraw() + " sometimes, the tabline is not correctly updated see #1580 + " so force redraw here + if exists(":redrawtabline") == 2 + redrawtabline + else + " Have to set a property equal to itself to get airline to re-eval. + " Setting `let &tabline=&tabline` destroys the cursor position so we + " need something less invasive. + let &ro = &ro + endif + endfunction - return title -endfunction + function! airline#extensions#tabline#enable() + if &lines > 3 + set showtabline=2 + endif + endfunction -function! airline#extensions#tabline#get_buffer_name(nr, ...) - let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list() - let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') - return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers) -endfunction -function! airline#extensions#tabline#new_builder() - let builder_context = { - \ 'active' : 1, - \ 'tabline' : 1, - \ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep), - \ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep), - \ } - if get(g:, 'airline_powerline_fonts', 0) - let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep) - let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep) - else - let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ') - let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|') - endif + function! airline#extensions#tabline#get() + let show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) + let show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) - return airline#extensions#tabline#builder#new(builder_context) -endfunction + let curtabcnt = tabpagenr('$') + if curtabcnt != s:current_tabcnt + let s:current_tabcnt = curtabcnt + call airline#extensions#tabline#tabs#invalidate() + call airline#extensions#tabline#buffers#invalidate() + call airline#extensions#tabline#ctrlspace#invalidate() + call airline#extensions#tabline#tabws#invalidate() + endif + + if !exists('#airline#BufAdd#*') + autocmd airline BufAdd * call update_tabline(0) + endif + if !exists('#airline#SessionLoadPost') + autocmd airline SessionLoadPost * call update_tabline(1) + endif + if s:ctrlspace + return airline#extensions#tabline#ctrlspace#get() + elseif s:tabws + return airline#extensions#tabline#tabws#get() + elseif show_buffers && curtabcnt == 1 || !show_tabs + return airline#extensions#tabline#buffers#get() + else + return airline#extensions#tabline#tabs#get() + endif + endfunction + + function! airline#extensions#tabline#title(n) + let title = '' + if s:taboo + let title = TabooTabTitle(a:n) + endif -function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr) - let cur = bufnr('%') - if cur == a:bufnr - if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') - let group = 'airline_tabmod' + if empty(title) && exists('*gettabvar') + let title = gettabvar(a:n, 'title') + endif + + let formatter = get(g:, 'airline#extensions#tabline#tabtitle_formatter') + if empty(title) && formatter !=# '' && exists("*".formatter) + let title = call(formatter, [a:n]) + endif + + if empty(title) + let buflist = tabpagebuflist(a:n) + let winnr = tabpagewinnr(a:n) + let all_buffers = airline#extensions#tabline#buflist#list() + let curbuf = filter(buflist, 'index(all_buffers, v:val) != -1') + if len(curbuf) == 0 + call add(curbuf, tabpagebuflist(a:n)[0]) + endif + return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf) + endif + + return title + endfunction + + function! airline#extensions#tabline#get_buffer_name(nr, ...) + let buffers = a:0 ? a:1 : airline#extensions#tabline#buflist#list() + let formatter = get(g:, 'airline#extensions#tabline#formatter', 'default') + return airline#extensions#tabline#formatters#{formatter}#format(a:nr, buffers) + endfunction + + function! airline#extensions#tabline#new_builder() + let builder_context = { + \ 'active' : 1, + \ 'tabline' : 1, + \ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep), + \ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep), + \ } + if get(g:, 'airline_powerline_fonts', 0) + let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep) + let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep) else - let group = 'airline_tabsel' + let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ') + let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|') endif - else - if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') - let group = 'airline_tabmod_unsel' - elseif index(a:tab_bufs, a:bufnr) > -1 - let group = 'airline_tab' + + return airline#extensions#tabline#builder#new(builder_context) + endfunction + + function! airline#extensions#tabline#group_of_bufnr(tab_bufs, bufnr) + let cur = bufnr('%') + if cur == a:bufnr + if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') + let group = 'airline_tabmod' + else + let group = 'airline_tabsel' + endif else - let group = 'airline_tabhid' + if g:airline_detect_modified && getbufvar(a:bufnr, '&modified') + let group = 'airline_tabmod_unsel' + elseif index(a:tab_bufs, a:bufnr) > -1 + let group = 'airline_tab' + else + let group = 'airline_tabhid' + endif endif - endif - return group -endfunction + return group + endfunction + finish +else + def s:toggle_off(): void + airline#extensions#tabline#autoshow#off() + airline#extensions#tabline#tabs#off() + airline#extensions#tabline#buffers#off() + if s:ctrlspace + airline#extensions#tabline#ctrlspace#off() + endif + if s:tabws + airline#extensions#tabline#tabws#off() + endif + enddef -function! airline#extensions#tabline#add_label(dict, type, right) - if get(g:, 'airline#extensions#tabline#show_tab_type', 1) - call a:dict.add_section_spaced('airline_tablabel'. - \ (a:right ? '_right' : ''), - \ get(g:, 'airline#extensions#tabline#'.a:type.'_label', a:type)) - endif -endfunction + def s:toggle_on(): void + if get(g:, 'airline_statusline_ontop', 0) + airline#extensions#tabline#enable() + &tabline = '%!airline#statusline(' .. winnr() .. ')' + return + endif + airline#extensions#tabline#autoshow#on() + airline#extensions#tabline#tabs#on() + airline#extensions#tabline#buffers#on() + if s:ctrlspace + airline#extensions#tabline#ctrlspace#on() + endif + if s:tabws + airline#extensions#tabline#tabws#on() + endif + &tabline = '%!airline#extensions#tabline#get()' + enddef -function! airline#extensions#tabline#add_tab_label(dict) - let show_tab_count = get(g:, 'airline#extensions#tabline#show_tab_count', 1) - if show_tab_count == 2 - call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) - elseif show_tab_count == 1 && tabpagenr('$') > 1 - call a:dict.add_section_spaced('airline_tabmod', printf('%s %d/%d', "tab", tabpagenr(), tabpagenr('$'))) - endif -endfunction + def airline#extensions#tabline#load_theme(palette: dict): number + # Needs to return a number, because it is implicitly used as extern_funcref + # And funcrefs should return a value (see airline#util#exec_funcrefs()) + if pumvisible() + return 0 + endif + var colors = get(palette, 'tabline', {}) + var tablabel = get(colors, 'airline_tablabel', palette.normal.airline_b) + # Theme for tabs on the left + var tab = get(colors, 'airline_tab', palette.inactive.airline_c) + var tabsel = get(colors, 'airline_tabsel', palette.normal.airline_a) + var tabtype = get(colors, 'airline_tabtype', palette.visual.airline_a) + var tabfill = get(colors, 'airline_tabfill', palette.normal.airline_c) + var tabmod = get(colors, 'airline_tabmod', palette.insert.airline_a) + var tabhid = get(colors, 'airline_tabhid', palette.normal.airline_c) + var tabmodu = tabhid + var tabmodu_right = tabhid + if has_key(palette, 'normal_modified') && has_key(palette.normal_modified, 'airline_c') + tabmodu = get(colors, 'airline_tabmod_unsel', palette.normal_modified.airline_c) + tabmodu_right = get(colors, 'airline_tabmod_unsel_right', palette.normal_modified.airline_c) + else + # Fall back to normal airline_c if modified airline_c isn't present + tabmodu = get(colors, 'airline_tabmod_unsel', palette.normal.airline_c) + tabmodu_right = get(colors, 'airline_tabmod_unsel_right', palette.normal.airline_c) + endif + airline#highlighter#exec('airline_tablabel', tablabel) + airline#highlighter#exec('airline_tab', tab) + airline#highlighter#exec('airline_tabsel', tabsel) + airline#highlighter#exec('airline_tabtype', tabtype) + airline#highlighter#exec('airline_tabfill', tabfill) + airline#highlighter#exec('airline_tabmod', tabmod) + airline#highlighter#exec('airline_tabmod_unsel', tabmodu) + airline#highlighter#exec('airline_tabmod_unsel_right', tabmodu_right) + airline#highlighter#exec('airline_tabhid', tabhid) + # Theme for tabs on the right + var tablabel_r = get(colors, 'airline_tablabel', palette.normal.airline_b) + var tabsel_right = get(colors, 'airline_tabsel_right', palette.normal.airline_a) + var tab_right = get(colors, 'airline_tab_right', palette.inactive.airline_c) + var tabmod_right = get(colors, 'airline_tabmod_right', palette.insert.airline_a) + var tabhid_right = get(colors, 'airline_tabhid_right', palette.normal.airline_c) + airline#highlighter#exec('airline_tablabel_right', tablabel_r) + airline#highlighter#exec('airline_tab_right', tab_right) + airline#highlighter#exec('airline_tabsel_right', tabsel_right) + airline#highlighter#exec('airline_tabmod_right', tabmod_right) + airline#highlighter#exec('airline_tabhid_right', tabhid_right) + return 0 + enddef + + def s:update_tabline(forceit: number): void + if get(g:, 'airline#extensions#tabline#disable_refresh', 0) + return + endif + # loading a session file + # On SessionLoadPost, g:SessionLoad variable is still set :/ + if !forceit && get(g:, 'SessionLoad', 0) + return + endif + var match = expand('') + if pumvisible() + return + elseif !get(g:, 'airline#extensions#tabline#enabled', 0) + return + # return, if buffer matches ignore pattern or is directory (netrw) + elseif empty(match) || airline#util#ignore_buf(match) || isdirectory(match) + return + endif + airline#util#doautocmd('BufMRUChange') + airline#extensions#tabline#redraw() + enddef + + def airline#extensions#tabline#redraw(): void + # redrawtabline should always be available + :redrawtabline + enddef + + def airline#extensions#tabline#enable(): void + if &lines > 3 + &showtabline = 2 + endif + enddef + + def airline#extensions#tabline#get(): string + var show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1) + var show_tabs = get(g:, 'airline#extensions#tabline#show_tabs', 1) + + var curtabcnt = tabpagenr('$') + if curtabcnt != s:current_tabcnt + s:current_tabcnt = curtabcnt + airline#extensions#tabline#tabs#invalidate() + airline#extensions#tabline#buffers#invalidate() + airline#extensions#tabline#ctrlspace#invalidate() + airline#extensions#tabline#tabws#invalidate() + endif + + if !exists('#airline#BufAdd#*') + autocmd airline BufAdd * call update_tabline(0) + endif + if !exists('#airline#SessionLoadPost') + autocmd airline SessionLoadPost * call update_tabline(1) + endif + if s:ctrlspace + return airline#extensions#tabline#ctrlspace#get() + elseif s:tabws + return airline#extensions#tabline#tabws#get() + elseif show_buffers && curtabcnt == 1 || !show_tabs + return airline#extensions#tabline#buffers#get() + else + return airline#extensions#tabline#tabs#get() + endif + enddef + + def airline#extensions#tabline#title(n: number): string + var title = '' + if get(g:, 'airline#extensions#taboo#enabled', 1) && + get(g:, 'loaded_taboo', 0) && exists("*TabooTabTitle") + title = call("TabooTabTitle", [n]) + endif + + if empty(title) + title = gettabvar(n, 'title') + endif + + var formatter = get(g:, 'airline#extensions#tabline#tabtitle_formatter', '') + if empty(title) && !empty(formatter) && exists("*" .. formatter) + title = call(formatter, [n]) + endif + + if empty(title) + var buflist = tabpagebuflist(n) + var winnr = tabpagewinnr(n) + var all_buffers = airline#extensions#tabline#buflist#list() + var curbuf = filter(buflist, (_, v) => index(all_buffers, v) != -1) + if len(curbuf) == 0 + add(curbuf, tabpagebuflist(n)[0]) + endif + return airline#extensions#tabline#get_buffer_name(curbuf[0], curbuf) + endif + return title + enddef + + def airline#extensions#tabline#get_buffer_name(nr: number, buffers = airline#extensions#tabline#buflist#list()): string + var Formatter = 'airline#extensions#tabline#formatters#' .. get(g:, 'airline#extensions#tabline#formatter', 'default') .. '#format' + return call(Formatter, [ nr, buffers] ) + enddef + + def airline#extensions#tabline#new_builder(): dict + var builder_context = { + 'active': 1, + 'tabline': 1, + 'right_sep': get(g:, 'airline#extensions#tabline#right_sep', g:airline_right_sep), + 'right_alt_sep': get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep), + 'left_sep': get(g:, 'airline#extensions#tabline#left_sep', g:airline_left_sep), + 'left_alt_sep': get(g:, 'airline#extensions#tabline#left_alt_sep', g:airline_left_alt_sep), + } + return airline#extensions#tabline#builder#new(builder_context) + enddef + + def airline#extensions#tabline#group_of_bufnr(tab_bufs: list, bufnr: number): string + var cur = bufnr('%') + var group = '' + if cur == bufnr + if g:airline_detect_modified && getbufvar(bufnr, '&modified') + group = 'airline_tabmod' + else + group = 'airline_tabsel' + endif + else + if g:airline_detect_modified && getbufvar(bufnr, '&modified') + group = 'airline_tabmod_unsel' + elseif index(tab_bufs, bufnr) > -1 + group = 'airline_tab' + else + group = 'airline_tabhid' + endif + endif + return group + enddef +endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/autoshow.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/autoshow.vim index 849f9a0..8df8306 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/autoshow.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/autoshow.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -30,7 +30,7 @@ function! airline#extensions#tabline#autoshow#on() autocmd BufEnter * call show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list())) autocmd BufUnload * call show_tabline(s:buf_min_count, len(airline#extensions#tabline#buflist#list()) - 1) else - autocmd TabEnter * call show_tabline(s:tab_min_count, tabpagenr('$')) + autocmd TabNew,TabClosed * call show_tabline(s:tab_min_count, tabpagenr('$')) endif endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim index f6675ee..1eb79f7 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buffers.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -161,13 +161,10 @@ function! s:get_number(index) return a:index endif let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0) - if bidx_mode > 1 - let l:count = bidx_mode == 2 ? a:index+11 : a:index+1 - return join(map(split(printf('%02d', l:count), '\zs'), - \ 'get(s:number_map, v:val, "")'), '') - else - return get(s:number_map, a:index+1, '') - endif + let number_format = bidx_mode > 1 ? '%02d' : '%d' + let l:count = bidx_mode == 2 ? a:index+11 : a:index+1 + return join(map(split(printf(number_format, l:count), '\zs'), + \ 'get(s:number_map, v:val, "")'), '') endfunction function! s:select_tab(buf_index) @@ -199,8 +196,8 @@ function! s:map_keys() let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1) if bidx_mode > 0 if bidx_mode == 1 - for i in range(1, 9) - exe printf('noremap AirlineSelectTab%d :call select_tab(%d)', i, i-1) + for i in range(1, 10) + exe printf('noremap AirlineSelectTab%d :call select_tab(%d)', i%10, i-1) endfor else let start_idx = bidx_mode == 2 ? 11 : 1 @@ -223,7 +220,11 @@ function! airline#extensions#tabline#buffers#clickbuf(minwid, clicks, button, mo if a:clicks == 1 && a:modifiers !~# '[^ ]' if a:button is# 'l' " left button - switch to buffer - silent execute 'buffer' a:minwid + try + silent execute 'buffer' a:minwid + catch + call airline#util#warning("Cannot switch buffer, current buffer is modified! See :h 'hidden'") + endtry elseif a:button is# 'm' " middle button - delete buffer diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim index f914e2a..f772201 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/buflist.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -8,6 +8,10 @@ function! airline#extensions#tabline#buflist#invalidate() endfunction function! airline#extensions#tabline#buflist#clean() + if !exists('#airline') + " airline disabled + return + endif call airline#extensions#tabline#buflist#invalidate() call airline#extensions#tabline#buffers#invalidate() endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim index 1a01dca..f2567fc 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/builder.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim index 1ed00d9..feab460 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/ctrlspace.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2016-2019 Kevin Sapper et al. +" MIT License. Copyright (c) 2016-2021 Kevin Sapper et al. " Plugin: https://github.com/szw/vim-ctrlspace " vim: et ts=2 sts=2 sw=2 @@ -24,13 +24,24 @@ function! airline#extensions#tabline#ctrlspace#on() endfunction function! airline#extensions#tabline#ctrlspace#invalidate() + if !exists('#airline') + return + endif let s:current_bufnr = -1 let s:current_tabnr = -1 endfunction function! airline#extensions#tabline#ctrlspace#add_buffer_section(builder, cur_tab, cur_buf, pull_right) let pos_extension = (a:pull_right ? '_right' : '') - let buffer_list = ctrlspace#api#BufferList(a:cur_tab) + + let buffer_list = [] + for bufferindex in sort(keys(ctrlspace#api#Buffers(a:cur_tab)), 'N') + for buffer in ctrlspace#api#BufferList(a:cur_tab) + if buffer['index'] == bufferindex + call add(buffer_list, buffer) + endif + endfor + endfor " add by tenfy(tenfyzhong@qq.com) " if the current buffer no in the buffer list diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim index a7737b4..7cdb7c4 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/default.vim @@ -1,46 +1,85 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. -" vim: et ts=2 sts=2 sw=2 +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" vim: et ts=2 sts=2 sw=2 et scriptencoding utf-8 -let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1) -let s:fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) -let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') -let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) -let s:buf_modified_symbol = g:airline_symbols.modified - -function! airline#extensions#tabline#formatters#default#format(bufnr, buffers) - let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') - let _ = '' - - let name = bufname(a:bufnr) - if empty(name) - let _ .= '[No Name]' - elseif name =~ 'term://' - " Neovim Terminal - let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') - else - if s:fnamecollapse - " Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c' - "let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g') - let _ .= pathshorten(fnamemodify(name, fmod)) +if !exists(":def") || !airline#util#has_vim9_script() + function! airline#extensions#tabline#formatters#default#format(bufnr, buffers) + let fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) + let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') + let _ = '' + + let name = bufname(a:bufnr) + if empty(name) + let _ = '[No Name]' + elseif name =~ 'term://' + " Neovim Terminal + let _ = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') else - let _ .= fnamemodify(name, fmod) + if get(g:, 'airline#extensions#tabline#fnamecollapse', 1) + " Does not handle non-ascii characters like Cyrillic: 'D/Учёба/t.c' + "let _ .= substitute(fnamemodify(name, fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g') + let _ = pathshorten(fnamemodify(name, fmod)) + else + let _ = fnamemodify(name, fmod) + endif + if a:bufnr != bufnr('%') && fnametruncate && strlen(_) > fnametruncate + let _ = airline#util#strcharpart(_, 0, fnametruncate) + endif endif - if a:bufnr != bufnr('%') && s:fnametruncate && strlen(_) > s:fnametruncate - let _ = strpart(_, 0, s:fnametruncate) + + return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _) + endfunction + + function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name) + let buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') + let buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) + + let _ = buf_nr_show ? printf(buf_nr_format, a:bufnr) : '' + let _ .= substitute(a:buffer_name, '\\', '/', 'g') + + if getbufvar(a:bufnr, '&modified') == 1 + let _ .= g:airline_symbols.modified endif - endif + return _ + endfunction + finish +else + " Vim9 Script implementation + def airline#extensions#tabline#formatters#default#format(bufnr: number, buffers: list): string + var fnametruncate = get(g:, 'airline#extensions#tabline#fnametruncate', 0) + var fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.') + var result = '' - return airline#extensions#tabline#formatters#default#wrap_name(a:bufnr, _) -endfunction + var name = bufname(bufnr) + if empty(name) + result = '[No Name]' + elseif name =~ 'term://' + # Neovim Terminal + result = substitute(name, '\(term:\)//.*:\(.*\)', '\1 \2', '') + else + if get(g:, 'airline#extensions#tabline#fnamecollapse', 1) + result = pathshorten(fnamemodify(name, fmod)) + else + result = fnamemodify(name, fmod) + endif + if bufnr != bufnr('%') && fnametruncate && strlen(result) > fnametruncate + result = airline#util#strcharpart(result, 0, fnametruncate) + endif + endif + return airline#extensions#tabline#formatters#default#wrap_name(bufnr, result) + enddef -function! airline#extensions#tabline#formatters#default#wrap_name(bufnr, buffer_name) - let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : '' - let _ .= substitute(a:buffer_name, '\\', '/', 'g') + def airline#extensions#tabline#formatters#default#wrap_name(bufnr: number, buffer_name: string): string + var buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ') + var buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0) - if getbufvar(a:bufnr, '&modified') == 1 - let _ .= s:buf_modified_symbol - endif - return _ -endfunction + var result = buf_nr_show ? printf(buf_nr_format, bufnr) : '' + result ..= substitute(buffer_name, '\\', '/', 'g') + + if getbufvar(bufnr, '&modified') + result ..= g:airline_symbols.modified + endif + return result + enddef +endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/jsformatter.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/jsformatter.vim index 0617bb8..6f364ec 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/jsformatter.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/jsformatter.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -7,7 +7,7 @@ function! airline#extensions#tabline#formatters#jsformatter#format(bufnr, buffer let buf = bufname(a:bufnr) let filename = fnamemodify(buf, ':t') - if filename == 'index.js' || filename == 'index.jsx' || filename == 'index.ts' || filename == 'index.tsx' + if filename ==# 'index.js' || filename ==# 'index.jsx' || filename ==# 'index.ts' || filename ==# 'index.tsx' || filename ==# 'index.vue' return fnamemodify(buf, ':p:h:t') . '/i' else return airline#extensions#tabline#formatters#unique_tail_improved#format(a:bufnr, a:buffers) diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/short_path.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/short_path.vim index b703384..576394f 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/short_path.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/short_path.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/tabnr.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/tabnr.vim index 8b2f452..f083652 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/tabnr.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/tabnr.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2017-2019 Christian Brabandt et al. +" MIT License. Copyright (c) 2017-2021 Christian Brabandt et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail.vim index ecda323..4d065f3 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail_improved.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail_improved.vim index 5db7aab..e44ac2d 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail_improved.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/formatters/unique_tail_improved.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabs.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabs.vim index a3b191f..38c57d0 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabs.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabs.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -22,7 +22,9 @@ function! airline#extensions#tabline#tabs#on() endfunction function! airline#extensions#tabline#tabs#invalidate() - let s:current_bufnr = -1 + if exists('#airline') + let s:current_bufnr = -1 + endif endfunction function! airline#extensions#tabline#tabs#get() @@ -39,6 +41,8 @@ function! airline#extensions#tabline#tabs#get() endif endif + let s:filtered_buflist = airline#extensions#tabline#buflist#list() + let b = airline#extensions#tabline#new_builder() call airline#extensions#tabline#add_label(b, 'tabs', 0) @@ -50,8 +54,10 @@ function! airline#extensions#tabline#tabs#get() let group = 'airline_tabsel' if g:airline_detect_modified for bi in tabpagebuflist(curtab) - if getbufvar(bi, '&modified') - let group = 'airline_tabmod' + if index(s:filtered_buflist,bi) != -1 + if getbufvar(bi, '&modified') + let group = 'airline_tabmod' + endif endif endfor endif @@ -79,14 +85,16 @@ function! airline#extensions#tabline#tabs#get() if get(g:, 'airline#extensions#tabline#show_close_button', 1) call b.add_section('airline_tab_right', ' %999X'. - \ get(g:, 'airline#extensions#tabline#close_symbol', 'X').' ') + \ get(g:, 'airline#extensions#tabline#close_symbol', 'X').'%X ') endif if get(g:, 'airline#extensions#tabline#show_splits', 1) == 1 let buffers = tabpagebuflist(curtab) for nr in buffers - let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right" - call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)') + if index(s:filtered_buflist,nr) != -1 + let group = airline#extensions#tabline#group_of_bufnr(buffers, nr) . "_right" + call b.add_section_spaced(group, '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)') + endif endfor if get(g:, 'airline#extensions#tabline#show_buffers', 1) call airline#extensions#tabline#add_label(b, 'buffers', 1) @@ -107,8 +115,8 @@ function! airline#extensions#tabline#tabs#map_keys() endif let bidx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 1) if bidx_mode == 1 - for i in range(1, 9) - exe printf('noremap AirlineSelectTab%d :%dtabn', i, i) + for i in range(1, 10) + exe printf('noremap AirlineSelectTab%d :%dtabn', i%10, i) endfor else for i in range(11, 99) diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabws.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabws.vim index db06a72..130fc32 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabws.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/tabws.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2016-2019 Kevin Sapper et al. +" MIT License. Copyright (c) 2016-2021 Kevin Sapper et al. " PLugin: https://github.com/s1341/vim-tabws " vim: et ts=2 sts=2 sw=2 @@ -24,8 +24,10 @@ function! airline#extensions#tabline#tabws#on() endfunction function! airline#extensions#tabline#tabws#invalidate() - let s:current_bufnr = -1 - let s:current_tabnr = -1 + if exists('#airline') + let s:current_bufnr = -1 + let s:current_tabnr = -1 + endif endfunction function! airline#extensions#tabline#tabws#add_buffer_section(builder, cur_tab, cur_buf, pull_right) diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/xtabline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/xtabline.vim index 9ea5692..d7efa38 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/xtabline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tabline/xtabline.vim @@ -1,11 +1,11 @@ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " xTabline - Reduced version for vim-airline " Plugin: https://github.com/mg979/vim-xtabline -" MIT License Copyright (C) 2018-2019 Gianmaria Bajo +" MIT License Copyright (C) 2018-2021 Gianmaria Bajo " tabpagecd: " expanded version by mg979 " MIT License Copyright (C) 2012-2013 Kana Natsuno -" MIT License Copyright (C) 2018-2019 Gianmaria Bajo +" MIT License Copyright (C) 2018-2021 Gianmaria Bajo """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -44,7 +44,7 @@ function! airline#extensions#tabline#xtabline#init() autocmd TabLeave * call s:Do('leave') autocmd TabClosed * call s:Do('close') - autocmd BufEnter * let g:xtabline_changing_buffer = 0 + autocmd BufEnter * if exists('#airline') | let g:xtabline_changing_buffer = 0 | endif autocmd BufAdd,BufDelete,BufWrite * call airline#extensions#tabline#xtabline#filter_buffers() augroup END @@ -180,6 +180,10 @@ function! airline#extensions#tabline#xtabline#filter_buffers() " 'accepted' is a list of buffer numbers, for quick access. " 'excluded' is a list of buffer numbers, it will be used by Airline to hide buffers. + if !exists('#airline') + " airline disabled + return + endif if !s:xtabline_filtering | return | endif let g:airline#extensions#tabline#exclude_buffers = [] @@ -351,6 +355,10 @@ endfunction """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" function! s:Do(action) + if !exists('#airline') + " airline disabled + return + endif let arg = a:action if !s:state | call s:InitCwds() | return | endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tagbar.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tagbar.vim index 99ca071..f4b0e86 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tagbar.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tagbar.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/majutsushi/tagbar " vim: et ts=2 sts=2 sw=2 @@ -43,7 +43,7 @@ function! airline#extensions#tagbar#currenttag() endif " function tagbar#currenttag does not exist, if filetype is not enabled if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag") - let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags) + let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags, get(g:, 'airline#extensions#tagbar#searchmethod', 'nearest-stl')) let s:airline_tagbar_last_lookup_time = localtime() endif return s:airline_tagbar_last_lookup_val diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/taglist.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/taglist.vim new file mode 100644 index 0000000..c3c3d24 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/taglist.vim @@ -0,0 +1,37 @@ +" MIT License. Copyright (c) 2021 DEMAREST Maxime (maxime@indelog.fr) +" Plugin: https://github.com/yegappan/taglist/ +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !exists(':TlistShowTag') + finish +endif + +function! airline#extensions#taglist#currenttag() + " Update tag list if taglist is not loaded (else we get an empty tag name) + " Load yegappan/taglist and vim-scripts/taglist.vim only once. + let tlist_updated = 0 + if !exists('*taglist#Tlist_Get_Tagname_By_Line()') && !exists('*Tlist_Get_Tagname_By_Line()') + TlistUpdate + let tlist_updated = 1 + endif + if !tlist_updated && exists('*Tlist_Get_Filenames()') + let tlist_filenames = Tlist_Get_Filenames() + if stridx(type(tlist_filenames) == type([]) ? join(tlist_filenames, '\n') : tlist_filenames, expand('%:p')) < 0 + TlistUpdate + endif + endif + " Is this function is not present it'means you use the old vertsion of + " tag list : https://github.com/vim-scripts/taglist.vim. + " Please use the new version : https://github.com/yegappan/taglist. + if exists('*taglist#Tlist_Get_Tagname_By_Line()') + return taglist#Tlist_Get_Tagname_By_Line() + else + return '' + endif +endfunction + +function! airline#extensions#taglist#init(ext) + call airline#parts#define_function('taglist', 'airline#extensions#taglist#currenttag') +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/term.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/term.vim index 0edf11b..3bc25bb 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/term.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/term.vim @@ -1,55 +1,64 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 call airline#parts#define_function('tmode', 'airline#extensions#term#termmode') call airline#parts#define('terminal', {'text': get(g:airline_mode_map, 't', 't'), 'accent': 'bold'}) -let s:section_a = airline#section#create_left(['terminal', 'tmode']) -function! airline#extensions#term#apply(...) - if &buftype == 'terminal' || bufname('%')[0] == '!' - let spc = g:airline_symbols.space +let s:spc = g:airline_symbols.space + +let s:section_a = airline#section#create_left(['terminal', 'tmode']) +let s:section_z = airline#section#create(['linenr', 'maxlinenr']) - call a:1.add_section('airline_a', spc.s:section_a.spc) - call a:1.add_section('airline_b', '') - call a:1.add_section('airline_term', spc.s:termname()) +function! airline#extensions#term#apply(...) abort + if &buftype ==? 'terminal' || bufname(a:2.bufnr)[0] ==? '!' + call a:1.add_section_spaced('airline_a', s:section_a) + call a:1.add_section_spaced('airline_b', s:neoterm_id(a:2.bufnr)) + call a:1.add_section('airline_term', s:spc.s:termname(a:2.bufnr)) call a:1.split() call a:1.add_section('airline_y', '') - call a:1.add_section('airline_z', spc.airline#section#create_right(['linenr', 'maxlinenr'])) + call a:1.add_section_spaced('airline_z', s:section_z) return 1 endif endfunction -function! airline#extensions#term#inactive_apply(...) - if getbufvar(a:2.bufnr, '&buftype') == 'terminal' - let spc = g:airline_symbols.space - call a:1.add_section('airline_a', spc.'TERMINAL'.spc) - call a:1.add_section('airline_b', spc.'%f') - let neoterm_id = getbufvar(a:2.bufnr, 'neoterm_id') - if neoterm_id != '' - call a:1.add_section('airline_c', spc.'neoterm_'.neoterm_id.spc) - endif +function! airline#extensions#term#inactive_apply(...) abort + if getbufvar(a:2.bufnr, '&buftype') ==? 'terminal' + call a:1.add_section_spaced('airline_a', s:section_a) + call a:1.add_section_spaced('airline_b', s:neoterm_id(a:2.bufnr)) + call a:1.add_section('airline_term', s:spc.s:termname(a:2.bufnr)) + call a:1.split() + call a:1.add_section('airline_y', '') + call a:1.add_section_spaced('airline_z', s:section_z) return 1 endif endfunction -function! airline#extensions#term#termmode() +function! airline#extensions#term#termmode() abort let mode = airline#parts#mode()[0] - if mode ==? 'T' - " don't need to output T, statusline already says "TERMINAL" - let mode='' + if mode ==? 'T' || mode ==? '-' + " We don't need to output T, the statusline already says "TERMINAL". + " Also we don't want to output "-" on an inactive statusline. + let mode = '' endif return mode endfunction -function! s:termname() - let bufname = bufname('%') +function! s:termname(bufnr) abort + let bufname = bufname(a:bufnr) if has('nvim') - return matchstr(bufname, 'term.*:\zs.*') + " Get rid of the leading "term", working dir and process ID. + " Afterwards, remove the possibly added neoterm ID. + return substitute(matchstr(bufname, 'term.*:\zs.*'), + \ ';#neoterm-\d\+', '', '') else - " get rid of leading '!' - if bufname[0] is# '!' + if bufname =~? 'neoterm-\d\+' + " Do not return a redundant buffer name, when this is a neoterm terminal. + return '' + endif + " Get rid of the leading "!". + if bufname[0] ==? '!' return bufname[1:] else return bufname @@ -57,7 +66,15 @@ function! s:termname() endif endfunction -function! airline#extensions#term#init(ext) +function! s:neoterm_id(bufnr) abort + let id = getbufvar(a:bufnr, 'neoterm_id') + if id !=? '' + let id = 'neoterm-'.id + endif + return id +endfunction + +function! airline#extensions#term#init(ext) abort call a:ext.add_statusline_func('airline#extensions#term#apply') call a:ext.add_inactive_statusline_func('airline#extensions#term#inactive_apply') endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tmuxline.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tmuxline.vim index bc4261d..0a4fcc1 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tmuxline.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/tmuxline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/edkolev/tmuxline.vim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/undotree.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/undotree.vim index d69cdba..386e090 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/undotree.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/undotree.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/mbbill/undotree " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unicode.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unicode.vim index 4dd3d5b..3cf742d 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unicode.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unicode.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling, Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al. " Plugin: https://github.com/chrisbra/unicode.vim " vim: et ts=2 sts=2 sw=2 @@ -9,7 +9,7 @@ if !get(g:, 'loaded_unicodePlugin', 0) endif function! airline#extensions#unicode#apply(...) - if exists(":UnicodeTable") == 2 && bufname('') ==# 'UnicodeTable' + if exists(':UnicodeTable') == 2 && bufname('') =~# '/UnicodeTable.txt' call airline#parts#define('unicode', { \ 'text': '[UnicodeTable]', \ 'accent': 'bold' }) diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unite.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unite.vim index d0b533a..d081556 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unite.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/unite.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/Shougo/unite.vim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vim9lsp.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vim9lsp.vim new file mode 100644 index 0000000..e974c66 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vim9lsp.vim @@ -0,0 +1,27 @@ +" MIT License. Copyright (c) 2021 DEMAREST Maxime (maxime@indelog.fr) +" Plugin: https://github.com/yegappan/lsp +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +if !exists('*lsp#errorCount') + finish +endif + +let s:error_symbol = get(g:, 'airline#extensions#vim9lsp#error_symbol', 'E:') +let s:warning_symbol = get(g:, 'airline#extensions#vim9lsp#warning_symbol', 'W:') + +function! airline#extensions#vim9lsp#get_warnings() abort + let res = get(lsp#errorCount(), 'Warn', 0) + return res > 0 ? s:warning_symbol . res : '' +endfunction + +function! airline#extensions#vim9lsp#get_errors() abort + let res = get(lsp#errorCount(), 'Error', 0) + return res > 0 ? s:error_symbol . res : '' +endfunction + +function! airline#extensions#vim9lsp#init(ext) abort + call airline#parts#define_function('vim9lsp_warning_count', 'airline#extensions#vim9lsp#get_warnings') + call airline#parts#define_function('vim9lsp_error_count', 'airline#extensions#vim9lsp#get_errors') +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimagit.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimagit.vim index fa653fa..8f8c5ae 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimagit.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimagit.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2016-2019 Jerome Reybert et al. +" MIT License. Copyright (c) 2016-2021 Jerome Reybert et al. " Plugin: https://github.com/jreybert/vimagit " vim: et ts=2 sts=2 sw=2 @@ -9,26 +9,21 @@ if !get(g:, 'loaded_magit', 0) finish endif -function! airline#extensions#vimagit#init(ext) +let s:commit_mode = {'ST': 'STAGING', 'CC': 'COMMIT', 'CA': 'AMEND'} + +function! airline#extensions#vimagit#init(ext) abort call a:ext.add_statusline_func('airline#extensions#vimagit#apply') endfunction -function! airline#extensions#vimagit#get_mode() +function! airline#extensions#vimagit#get_mode() abort if ( exists("*magit#get_current_mode") ) return magit#get_current_mode() else - if ( b:magit_current_commit_mode == '' ) - return "STAGING" - elseif ( b:magit_current_commit_mode == 'CC' ) - return "COMMIT" - elseif ( b:magit_current_commit_mode == 'CA' ) - return "AMEND" - else - return "???" - endif + return get(s:commit_mode, b:magit_current_commit_mode, '???') + endif endfunction -function! airline#extensions#vimagit#apply(...) +function! airline#extensions#vimagit#apply(...) abort if ( &filetype == 'magit' ) let w:airline_section_a = '%{airline#extensions#vimagit#get_mode()}' endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimcmake.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimcmake.vim new file mode 100644 index 0000000..37cf143 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimcmake.vim @@ -0,0 +1,30 @@ +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" Plugin: https://github.com/cdelledonne/vim-cmake +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +function! airline#extensions#vimcmake#init(ext) abort + call a:ext.add_statusline_func('airline#extensions#vimcmake#apply') + call a:ext.add_inactive_statusline_func('airline#extensions#vimcmake#inactive_apply') +endfunction + +function! airline#extensions#vimcmake#apply(...) abort + if &filetype ==# 'vimcmake' + let spc = g:airline_symbols.space + call a:1.add_section('airline_a', spc.'CMake'.spc) + call a:1.add_section('airline_b', spc.'%{cmake#statusline#GetBuildInfo(1)}'.spc) + call a:1.add_section('airline_c', spc.'%{cmake#statusline#GetCmdInfo()}'.spc) + return 1 + endif +endfunction + +function! airline#extensions#vimcmake#inactive_apply(...) abort + if getbufvar(a:2.bufnr, '&filetype') ==# 'vimcmake' + let spc = g:airline_symbols.space + call a:1.add_section('airline_a', spc.'[CMake]') + call a:1.add_section('airline_b', spc.'%{cmake#statusline#GetBuildInfo(0)}') + call a:1.add_section('airline_c', spc.'%{cmake#statusline#GetCmdInfo()}') + return 1 + endif +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimtex.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimtex.vim index bed09e3..8caaccd 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimtex.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vimtex.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/lervag/vimtex " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/virtualenv.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/virtualenv.vim index 3e996e0..9a84dc9 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/virtualenv.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/virtualenv.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/jmcantrell/vim-virtualenv " vim: et ts=2 sts=2 sw=2 @@ -11,7 +11,7 @@ function! airline#extensions#virtualenv#init(ext) endfunction function! airline#extensions#virtualenv#apply(...) - if &filetype =~# "python" + if match(get(g:, 'airline#extensions#virtualenv#ft', ['python']), &filetype) > -1 if get(g:, 'virtualenv_loaded', 0) let statusline = virtualenv#statusline() else @@ -25,7 +25,7 @@ function! airline#extensions#virtualenv#apply(...) endfunction function! airline#extensions#virtualenv#update() - if &filetype =~# "python" + if match(get(g:, 'airline#extensions#virtualenv#ft', ['python']), &filetype) > -1 call airline#extensions#virtualenv#apply() call airline#update_statusline() endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vista.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vista.vim index 185edaf..ddb9060 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vista.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/vista.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2019 s1341 (github@shmarya.net) +" MIT License. Copyright (c) 2021 s1341 (github@shmarya.net) " Plugin: https://github.com/liuchengxu/vista.vim " vim: et ts=2 sts=2 sw=2 @@ -7,12 +7,12 @@ if !get(g:, 'loaded_vista', 0) finish endif -function! airline#extensions#vista#currenttag() +function! airline#extensions#vista#currenttag() abort if get(w:, 'airline_active', 0) - return get(b:, 'vista_nearest_method_or_function', '') + return airline#util#shorten(get(b:, 'vista_nearest_method_or_function', ''), 91, 9) endif endfunction -function! airline#extensions#vista#init(ext) +function! airline#extensions#vista#init(ext) abort call airline#parts#define_function('vista', 'airline#extensions#vista#currenttag') endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim index cb91778..67707b1 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 " http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html @@ -10,7 +10,9 @@ let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols let s:default_checks = ['indent', 'trailing', 'mixed-indent-file', 'conflicts'] let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1) -let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file']} +let s:skip_check_ft = {'make': ['indent', 'mixed-indent-file'], + \ 'csv': ['indent', 'mixed-indent-file'], + \ 'mail': ['trailing']} function! s:check_mixed_indent() let indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0) @@ -23,9 +25,9 @@ function! s:check_mixed_indent() let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)' return search('\v' . t_s_t . '|' . t_l_s, 'nw') elseif indent_algo == 2 - return search('\v(^\t* +\t\s*\S)', 'nw') + return search('\v(^\t* +\t\s*\S)', 'nw', 0, 500) else - return search('\v(^\t+ +)|(^ +\t+)', 'nw') + return search('\v(^\t+ +)|(^ +\t+)', 'nw', 0, 500) endif endfunction @@ -50,7 +52,7 @@ endfunction function! s:conflict_marker() " Checks for git conflict markers let annotation = '\%([0-9A-Za-z_.:]\+\)\?' - if &ft is# 'rst' + if match(['rst', 'markdown', 'rmd'], &ft) >= 0 " rst filetypes use '=======' as header let pattern = '^\%(\%(<\{7} '.annotation. '\)\|\%(>\{7\} '.annotation.'\)\)$' else @@ -76,7 +78,8 @@ function! airline#extensions#whitespace#check() let check = 'trailing' if index(checks, check) > -1 && index(get(skip_check_ft, &ft, []), check) < 0 try - let regexp = get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$') + let regexp = get(b:, 'airline_whitespace_trailing_regexp', + \ get(g:, 'airline#extensions#whitespace#trailing_regexp', '\s$')) let trailing = search(regexp, 'nw') catch call airline#util#warning(printf('Whitespace: error occurred evaluating "%s"', regexp)) @@ -181,6 +184,10 @@ function! airline#extensions#whitespace#init(...) endfunction function! s:ws_refresh() + if !exists('#airline') + " airline disabled + return + endif if get(b:, 'airline_ws_changedtick', 0) == b:changedtick return endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/windowswap.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/windowswap.vim index 1692e50..8437697 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/windowswap.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/windowswap.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " Plugin: https://github.com/wesQ3/vim-windowswap " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim index 044416e..5a800f4 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 fdm=marker scriptencoding utf-8 @@ -9,8 +9,13 @@ if exists('*wordcount') if get(g:, 'actual_curbuf', '') != bufnr('') return endif - let query = a:visual_mode_active ? 'visual_words' : 'words' - return get(wordcount(), query, 0) + if &filetype ==# 'tex' && exists('b:vimtex') && get(g:, 'airline#extensions#vimtex#wordcount', 0) + " We're in a TeX file and vimtex is a plugin, so use vimtex's wordcount... + return vimtex#misc#wordcount() + else + let query = a:visual_mode_active ? 'visual_words' : 'words' + return get(wordcount(), query, 0) + endif endfunction else " Pull wordcount from the g_ctrl-g stats function! s:get_wordcount(visual_mode_active) @@ -86,8 +91,8 @@ endfunction " airline functions {{{1 " default filetypes: function! airline#extensions#wordcount#apply(...) - let filetypes = get(g:, 'airline#extensions#wordcount#filetypes', - \ ['asciidoc', 'help', 'mail', 'markdown', 'org', 'rst', 'plaintex', 'tex', 'text']) + let filetypes = get(g:, 'airline#extensions#wordcount#filetypes', + \ ['asciidoc', 'help', 'mail', 'markdown', 'rmd', 'nroff', 'org', 'rst', 'plaintex', 'tex', 'text']) " export current filetypes settings to global namespace let g:airline#extensions#wordcount#filetypes = filetypes diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/default.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/default.vim index fce27eb..012837b 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/default.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/default.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2019 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -10,6 +10,7 @@ endfunction " Reload format when statusline is rebuilt call airline#extensions#wordcount#formatters#default#update_fmt() + if index(g:airline_statusline_funcrefs, function('airline#extensions#wordcount#formatters#default#update_fmt')) == -1 " only add it, if not already done call airline#add_statusline_funcref(function('airline#extensions#wordcount#formatters#default#update_fmt')) @@ -35,5 +36,12 @@ function! airline#extensions#wordcount#formatters#default#to_string(wordcount) else let str = printf(s:fmt_short, a:wordcount) endif - return str . g:airline_symbols.space . g:airline_right_alt_sep . g:airline_symbols.space + + let str .= g:airline_symbols.space + + if !empty(g:airline_right_alt_sep) + let str .= g:airline_right_alt_sep . g:airline_symbols.space + endif + + return str endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/readingtime.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/readingtime.vim new file mode 100644 index 0000000..ae8f3d8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/readingtime.vim @@ -0,0 +1,47 @@ +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" vim: et ts=2 sts=2 sw=2 + +scriptencoding utf-8 + +function! airline#extensions#wordcount#formatters#readingtime#update_fmt(...) abort + let s:fmt = get(g:, 'airline#extensions#wordcount#formatter#readingtime#fmt', 'About %s minutes') + let s:fmt_short = get(g:, 'airline#extensions#wordcount#formatter#readingtime#fmt_short', s:fmt ==# 'About %s minutes' ? '%sW' : s:fmt) +endfunction + +" Reload format when statusline is rebuilt +call airline#extensions#wordcount#formatters#readingtime#update_fmt() + +if index(g:airline_statusline_funcrefs, function('airline#extensions#wordcount#formatters#readingtime#update_fmt')) == -1 + " only add it, if not already done + call airline#add_statusline_funcref(function('airline#extensions#wordcount#formatters#readingtime#update_fmt')) +endif + +if match(get(v:, 'lang', ''), '\v\cC|en') > -1 + let s:decimal_group = ',' +elseif match(get(v:, 'lang', ''), '\v\cde|dk|fr|pt') > -1 + let s:decimal_group = '.' +else + let s:decimal_group = '' +endif + +function! airline#extensions#wordcount#formatters#readingtime#to_string(wordcount) abort + if airline#util#winwidth() > 85 + if a:wordcount > 999 + " Format number according to locale, e.g. German: 1.245 or English: 1,245 + let wordcount = substitute(a:wordcount, '\d\@<=\(\(\d\{3\}\)\+\)$', s:decimal_group.'&', 'g') + else + let wordcount = a:wordcount + endif + let str = printf(s:fmt, ceil(wordcount / 200.0)) + else + let str = printf(s:fmt_short, ceil(a:wordcount / 200.0)) + endif + + let str .= g:airline_symbols.space + + if !empty(g:airline_right_alt_sep) + let str .= g:airline_right_alt_sep . g:airline_symbols.space + endif + + return str +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/xkblayout.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/xkblayout.vim index 7e00db3..5f5e326 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/xkblayout.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/xkblayout.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2017-2019 YoungHoon Rhiu et al. +" MIT License. Copyright (c) 2017-2021 YoungHoon Rhiu et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -9,7 +9,7 @@ endif function! airline#extensions#xkblayout#status() let keyboard_layout = libcall(g:XkbSwitchLib, 'Xkb_Switch_getXkbLayout', '') - let keyboard_layout = split(keyboard_layout, '\.')[-1] + let keyboard_layout = get(split(keyboard_layout, '\.'), -1, '') let short_codes = get(g:, 'airline#extensions#xkblayout#short_codes', {'2SetKorean': 'KR', 'Chinese': 'CN', 'Japanese': 'JP'}) if has_key(short_codes, keyboard_layout) diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ycm.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ycm.vim index f7ba4d7..286efe2 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ycm.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/ycm.vim @@ -1,10 +1,10 @@ -" MIT License. Copyright (c) 2015-2019 Evgeny Firsov et al. +" MIT License. Copyright (c) 2015-2021 Evgeny Firsov et al. " Plugin: https://github.com/ycm-core/YouCompleteMe " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 -if !exists('g:loaded_youcompleteme') +if !get(g:, 'loaded_youcompleteme', 0) finish endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/zoomwintab.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/zoomwintab.vim index 7e1b0c7..5489374 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/zoomwintab.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/extensions/zoomwintab.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2020 Dmitry Geurkov (d.geurkov@gmail.com) +" MIT License. Copyright (c) 2021 Dmitry Geurkov (d.geurkov@gmail.com) " Plugin: https://github.com/troydm/zoomwintab.vim " vim: et ts=2 sts=2 sw=2 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/formatter/short_path.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/formatter/short_path.vim new file mode 100644 index 0000000..9fae201 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/formatter/short_path.vim @@ -0,0 +1,8 @@ +scriptencoding utf-8 + +function! airline#formatter#short_path#format(val) abort + if get(g:, 'airline_stl_path_style', 'default') ==# 'short' + return '%{pathshorten(expand("'.a:val.'"))}' + endif + return a:val +endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/highlighter.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/highlighter.vim index 4e121c2..a261579 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/highlighter.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/highlighter.vim @@ -1,325 +1,686 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling Christian Brabandt et al. -" vim: et ts=2 sts=2 sw=2 +" MIT License. Copyright (c) 2013-2021 Bailey Ling Christian Brabandt et al. +" vim: et ts=2 sts=2 sw=2 et scriptencoding utf-8 let s:is_win32term = (has('win32') || has('win64')) && \ !has('gui_running') && \ (empty($CONEMUBUILD) || &term !=? 'xterm') && + \ empty($WT_SESSION) && \ !(exists("+termguicolors") && &termguicolors) let s:separators = {} let s:accents = {} let s:hl_groups = {} -function! s:gui2cui(rgb, fallback) - if a:rgb == '' - return a:fallback - elseif match(a:rgb, '^\%(NONE\|[fb]g\)$') > -1 - return a:rgb - endif - let rgb = map(split(a:rgb[1:], '..\zs'), '0 + ("0x".v:val)') - return airline#msdos#round_msdos_colors(rgb) -endfunction - -function! s:group_not_done(list, name) - if index(a:list, a:name) == -1 - call add(a:list, a:name) - return 1 - else - if &vbs - echomsg printf("airline: group: %s already done, skipping", a:name) - endif - return 0 - endif -endfu - -function! s:get_syn(group, what) - if !exists("g:airline_gui_mode") - let g:airline_gui_mode = airline#init#gui_mode() - endif - let color = '' - if hlexists(a:group) - let color = synIDattr(synIDtrans(hlID(a:group)), a:what, g:airline_gui_mode) - endif - if empty(color) || color == -1 - " should always exists - let color = synIDattr(synIDtrans(hlID('Normal')), a:what, g:airline_gui_mode) - " however, just in case +if !exists(":def") || !airline#util#has_vim9_script() + + " Legacy Vimscript implementation + function! s:gui2cui(rgb, fallback) abort + if a:rgb == '' + return a:fallback + elseif match(a:rgb, '^\%(NONE\|[fb]g\)$') > -1 + return a:rgb + elseif a:rgb[0] !~ '#' + " a:rgb contains colorname + return a:rgb + endif + let rgb = map(split(a:rgb[1:], '..\zs'), '0 + ("0x".v:val)') + return airline#msdos#round_msdos_colors(rgb) + endfunction + + function! s:group_not_done(list, name) abort + if index(a:list, a:name) == -1 + call add(a:list, a:name) + return 1 + else + if &vbs + echomsg printf("airline: group: %s already done, skipping", a:name) + endif + return 0 + endif + endfu + + function! s:get_syn(group, what, mode) abort + let color = '' + if hlexists(a:group) + let color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode) + endif if empty(color) || color == -1 - let color = 'NONE' - endif - endif - return color -endfunction - -function! s:get_array(fg, bg, opts) - let opts=empty(a:opts) ? '' : join(a:opts, ',') - return g:airline_gui_mode ==# 'gui' - \ ? [ a:fg, a:bg, '', '', opts ] - \ : [ '', '', a:fg, a:bg, opts ] -endfunction - -function! airline#highlighter#reset_hlcache() - let s:hl_groups = {} -endfunction - -function! airline#highlighter#get_highlight(group, ...) - let reverse = get(g:, 'airline_gui_mode', '') ==# 'gui' - \ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui') - \ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm') - \|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term') - if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group) - let res = s:hl_groups[a:group] - return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res - else - let fg = s:get_syn(a:group, 'fg') - let bg = s:get_syn(a:group, 'bg') - let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold') - if reverse - let res = s:get_array(bg, fg, bold ? ['bold'] : a:000) + " should always exist + let color = synIDattr(synIDtrans(hlID('Normal')), a:what, a:mode) + " however, just in case + if empty(color) || color == -1 + let color = 'NONE' + endif + endif + return color + endfunction + + function! s:get_array(guifg, guibg, ctermfg, ctermbg, opts) abort + return [ a:guifg, a:guibg, a:ctermfg, a:ctermbg, empty(a:opts) ? '' : join(a:opts, ',') ] + endfunction + + function! airline#highlighter#reset_hlcache() abort + let s:hl_groups = {} + endfunction + + function! airline#highlighter#get_highlight(group, ...) abort + " only check for the cterm reverse attribute + " TODO: do we need to check all modes (gui, term, as well)? + let reverse = synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm') + if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, a:group) + let res = s:hl_groups[a:group] + return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res else - let res = s:get_array(fg, bg, bold ? ['bold'] : a:000) - endif - endif - let s:hl_groups[a:group] = res - return res -endfunction - -function! airline#highlighter#get_highlight2(fg, bg, ...) - let fg = s:get_syn(a:fg[0], a:fg[1]) - let bg = s:get_syn(a:bg[0], a:bg[1]) - return s:get_array(fg, bg, a:000) -endfunction - -function! s:hl_group_exists(group) - if !hlexists(a:group) - return 0 - elseif empty(synIDattr(hlID(a:group), 'fg')) - return 0 - endif - return 1 -endfunction - -function! airline#highlighter#exec(group, colors) - if pumvisible() - return - endif - let colors = a:colors - if s:is_win32term - let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, '')) - let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, '')) - endif - let old_hi = airline#highlighter#get_highlight(a:group) - if len(colors) == 4 - call add(colors, '') - endif - if g:airline_gui_mode ==# 'gui' - let new_hi = [colors[0], colors[1], '', '', colors[4]] - else - let new_hi = ['', '', printf("%s", colors[2]), printf("%s", colors[3]), colors[4]] - endif - let colors = s:CheckDefined(colors) - if old_hi != new_hi || !s:hl_group_exists(a:group) - let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors)) - exe cmd - if has_key(s:hl_groups, a:group) - let s:hl_groups[a:group] = colors - endif - endif -endfunction - -function! s:CheckDefined(colors) - " Checks, whether the definition of the colors is valid and is not empty or NONE - " e.g. if the colors would expand to this: - " hi airline_c ctermfg=NONE ctermbg=NONE - " that means to clear that highlighting group, therefore, fallback to Normal - " highlighting group for the cterm values - - " This only works, if the Normal highlighting group is actually defined, so - " return early, if it has been cleared - if !exists("g:airline#highlighter#normal_fg_hi") - let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm') - endif - if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0 - return a:colors - endif - - for val in a:colors - if !empty(val) && val !=# 'NONE' + let ctermfg = s:get_syn(a:group, 'fg', 'cterm') + let ctermbg = s:get_syn(a:group, 'bg', 'cterm') + let guifg = s:get_syn(a:group, 'fg', 'gui') + let guibg = s:get_syn(a:group, 'bg', 'gui') + let bold = synIDattr(synIDtrans(hlID(a:group)), 'bold') + if reverse + let res = s:get_array(guibg, guifg, ctermbg, ctermfg, bold ? ['bold'] : a:000) + else + let res = s:get_array(guifg, guibg, ctermfg, ctermbg, bold ? ['bold'] : a:000) + endif + endif + let s:hl_groups[a:group] = res + return res + endfunction + + function! airline#highlighter#get_highlight2(fg, bg, ...) abort + let guifg = s:get_syn(a:fg[0], a:fg[1], 'gui') + let guibg = s:get_syn(a:bg[0], a:bg[1], 'gui') + let ctermfg = s:get_syn(a:fg[0], a:fg[1], 'cterm') + let ctermbg = s:get_syn(a:bg[0], a:bg[1], 'cterm') + return s:get_array(guifg, guibg, ctermfg, ctermbg, a:000) + endfunction + + function! s:hl_group_exists(group) abort + if !hlexists(a:group) + return 0 + elseif empty(synIDattr(synIDtrans(hlID(a:group)), 'fg')) + return 0 + endif + return 1 + endfunction + + function! s:CheckDefined(colors) abort + " Checks, whether the definition of the colors is valid and is not empty or NONE + " e.g. if the colors would expand to this: + " hi airline_c ctermfg=NONE ctermbg=NONE + " that means to clear that highlighting group, therefore, fallback to Normal + " highlighting group for the cterm values + + " This only works, if the Normal highlighting group is actually defined, so + " return early, if it has been cleared + if !exists("g:airline#highlighter#normal_fg_hi") + let g:airline#highlighter#normal_fg_hi = synIDattr(synIDtrans(hlID('Normal')), 'fg', 'cterm') + endif + if empty(g:airline#highlighter#normal_fg_hi) || g:airline#highlighter#normal_fg_hi < 0 return a:colors endif - endfor - " this adds the bold attribute to the term argument of the :hi command, - " but at least this makes sure, the group will be defined - let fg = g:airline#highlighter#normal_fg_hi - let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm') - if bg < 0 - " in case there is no background color defined for Normal - let bg = a:colors[3] - endif - return a:colors[0:1] + [fg, bg] + [a:colors[4]] -endfunction - -function! s:GetHiCmd(list) - " a:list needs to have 5 items! - let res = '' - let i = -1 - while i < 4 - let i += 1 - let item = get(a:list, i, '') - if item is '' - continue - endif - if i == 0 - let res .= ' guifg='.item - elseif i == 1 - let res .= ' guibg='.item - elseif i == 2 - let res .= ' ctermfg='.item - elseif i == 3 - let res .= ' ctermbg='.item - elseif i == 4 - let res .= printf(' gui=%s cterm=%s term=%s', item, item, item) - endif - endwhile - return res -endfunction - -function! s:exec_separator(dict, from, to, inverse, suffix) - if pumvisible() - return - endif - let group = a:from.'_to_'.a:to.a:suffix - let l:from = airline#themes#get_highlight(a:from.a:suffix) - let l:to = airline#themes#get_highlight(a:to.a:suffix) - if a:inverse - let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] - else - let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ] - endif - let a:dict[group] = colors - call airline#highlighter#exec(group, colors) -endfunction - -function! airline#highlighter#load_theme() - if pumvisible() - return - endif - for winnr in filter(range(1, winnr('$')), 'v:val != winnr()') - call airline#highlighter#highlight_modified_inactive(winbufnr(winnr)) - endfor - call airline#highlighter#highlight(['inactive']) - if getbufvar( bufnr('%'), '&modified' ) - call airline#highlighter#highlight(['normal', 'modified']) - else - call airline#highlighter#highlight(['normal']) - endif -endfunction - -function! airline#highlighter#add_separator(from, to, inverse) - let s:separators[a:from.a:to] = [a:from, a:to, a:inverse] - call exec_separator({}, a:from, a:to, a:inverse, '') -endfunction - -function! airline#highlighter#add_accent(accent) - let s:accents[a:accent] = 1 -endfunction - -function! airline#highlighter#highlight_modified_inactive(bufnr) - if getbufvar(a:bufnr, '&modified') - let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c') - \ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : [] - else - let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') - \ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : [] - endif - - if !empty(colors) - call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors) - endif -endfunction - -function! airline#highlighter#highlight(modes, ...) - let bufnr = a:0 ? a:1 : '' - let p = g:airline#themes#{g:airline_theme}#palette - - " draw the base mode, followed by any overrides - let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') - let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' - let airline_grouplist = [] - let buffers_in_tabpage = sort(tabpagebuflist()) - if exists("*uniq") - let buffers_in_tabpage = uniq(buffers_in_tabpage) - endif - " mapped might be something like ['normal', 'normal_modified'] - " if a group is in both modes available, only define the second - " that is how this was done previously overwrite the previous definition - for mode in reverse(mapped) - if exists('g:airline#themes#{g:airline_theme}#palette[mode]') - let dict = g:airline#themes#{g:airline_theme}#palette[mode] - for kvp in items(dict) - let mode_colors = kvp[1] - let name = kvp[0] - if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive' - let name = 'airline_c'.bufnr - endif - " do not re-create highlighting for buffers that are no longer visible - " in the current tabpage - if name =~# 'airline_c\d\+' - let bnr = matchstr(name, 'airline_c\zs\d\+') + 0 - if bnr > 0 && index(buffers_in_tabpage, bnr) == -1 + + for val in a:colors + if !empty(val) && val !=# 'NONE' + return a:colors + endif + endfor + " this adds the bold attribute to the term argument of the :hi command, + " but at least this makes sure, the group will be defined + let fg = g:airline#highlighter#normal_fg_hi + let bg = synIDattr(synIDtrans(hlID('Normal')), 'bg', 'cterm') + if empty(bg) || bg < 0 + " in case there is no background color defined for Normal + let bg = a:colors[3] + endif + return a:colors[0:1] + [fg, bg] + [a:colors[4]] + endfunction + + function! s:GetHiCmd(list) abort + " a:list needs to have 5 items! + let res = '' + let i = -1 + while i < 4 + let i += 1 + let item = get(a:list, i, '') + if item is '' + continue + endif + if i == 0 + let res .= ' guifg='.item + elseif i == 1 + let res .= ' guibg='.item + elseif i == 2 + let res .= ' ctermfg='.item + elseif i == 3 + let res .= ' ctermbg='.item + elseif i == 4 + let res .= printf(' gui=%s cterm=%s term=%s', item, item, item) + endif + endwhile + return res + endfunction + + function! airline#highlighter#load_theme() abort + if pumvisible() + return + endif + for winnr in filter(range(1, winnr('$')), 'v:val != winnr()') + call airline#highlighter#highlight_modified_inactive(winbufnr(winnr)) + endfor + call airline#highlighter#highlight(['inactive']) + if getbufvar( bufnr('%'), '&modified' ) && &buftype != 'terminal' + call airline#highlighter#highlight(['normal', 'modified']) + else + call airline#highlighter#highlight(['normal']) + endif + endfunction + + function! airline#highlighter#add_accent(accent) abort + let s:accents[a:accent] = 1 + endfunction + + function! airline#highlighter#add_separator(from, to, inverse) abort + let s:separators[a:from.a:to] = [a:from, a:to, a:inverse] + call exec_separator({}, a:from, a:to, a:inverse, '') + endfunction + + function! s:exec_separator(dict, from, to, inverse, suffix) abort + if pumvisible() + return + endif + let group = a:from.'_to_'.a:to.a:suffix + let l:from = airline#themes#get_highlight(a:from.a:suffix) + let l:to = airline#themes#get_highlight(a:to.a:suffix) + if a:inverse + let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ] + else + let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ] + endif + let a:dict[group] = colors + call airline#highlighter#exec(group, colors) + endfunction + + function! airline#highlighter#highlight_modified_inactive(bufnr) abort + if getbufvar(a:bufnr, '&modified') + let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c') + \ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : [] + else + let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c') + \ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : [] + endif + + if !empty(colors) + call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors) + endif + endfunction + + function! airline#highlighter#exec(group, colors) abort + if pumvisible() + return + endif + let colors = a:colors + if len(colors) == 4 + call add(colors, '') + endif + " colors should always be string values + let colors = map(copy(colors), 'type(v:val) != type("") ? string(v:val) : v:val') + if s:is_win32term + let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, '')) + let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, '')) + endif + let old_hi = airline#highlighter#get_highlight(a:group) + let new_hi = [colors[0], colors[1], printf('%s', colors[2]), printf('%s', colors[3]), colors[4]] + let colors = s:CheckDefined(colors) + if old_hi != new_hi || !s:hl_group_exists(a:group) + let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors)) + try + exe cmd + catch /^Vim\%((\a\+)\)\=:E421:/ " color definition not found + let group=matchstr(v:exception, '\w\+\ze=') + let color=matchstr(v:exception, '=\zs\w\+') + let cmd=substitute(cmd, color, 'grey', 'g') + exe cmd + call airline#util#warning('color definition for group ' . a:group . ' not found, using grey as fallback') + catch + call airline#util#warning('Error when running command: '. cmd) + endtry + if has_key(s:hl_groups, a:group) + let s:hl_groups[a:group] = colors + endif + endif + endfunction + + function! airline#highlighter#highlight(modes, ...) abort + let bufnr = a:0 ? a:1 : '' + let p = g:airline#themes#{g:airline_theme}#palette + + " draw the base mode, followed by any overrides + let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val') + let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' + let airline_grouplist = [] + let buffers_in_tabpage = sort(tabpagebuflist()) + if exists("*uniq") + let buffers_in_tabpage = uniq(buffers_in_tabpage) + endif + " mapped might be something like ['normal', 'normal_modified'] + " if a group is in both modes available, only define the second + " that is how this was done previously overwrite the previous definition + for mode in reverse(mapped) + if exists('g:airline#themes#{g:airline_theme}#palette[mode]') + let dict = g:airline#themes#{g:airline_theme}#palette[mode] + for kvp in items(dict) + let mode_colors = kvp[1] + let name = kvp[0] + if name is# 'airline_c' && !empty(bufnr) && suffix is# '_inactive' + let name = 'airline_c'.bufnr + endif + " do not re-create highlighting for buffers that are no longer visible + " in the current tabpage + if name =~# 'airline_c\d\+' + let bnr = matchstr(name, 'airline_c\zs\d\+') + 0 + if bnr > 0 && index(buffers_in_tabpage, bnr) == -1 + continue + endif + elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix)) + " group will be redefined below at exec_separator + " or is not needed for tabline with '_inactive' suffix + " since active flag is 1 for builder) continue endif - elseif (name =~# '_to_') || (name[0:10] is# 'airline_tab' && !empty(suffix)) - " group will be redefined below at exec_separator - " or is not needed for tabline with '_inactive' suffix - " since active flag is 1 for builder) - continue - endif - if s:group_not_done(airline_grouplist, name.suffix) - call airline#highlighter#exec(name.suffix, mode_colors) - endif + if s:group_not_done(airline_grouplist, name.suffix) + call airline#highlighter#exec(name.suffix, mode_colors) + endif - if !has_key(p, 'accents') - " work around a broken installation - " shouldn't actually happen, p should always contain accents + if !has_key(p, 'accents') + " work around a broken installation + " shouldn't actually happen, p should always contain accents + continue + endif + + for accent in keys(s:accents) + if !has_key(p.accents, accent) + continue + endif + let colors = copy(mode_colors) + if p.accents[accent][0] != '' + let colors[0] = p.accents[accent][0] + endif + if p.accents[accent][2] != '' + let colors[2] = p.accents[accent][2] + endif + if len(colors) >= 5 + let colors[4] = get(p.accents[accent], 4, '') + else + call add(colors, get(p.accents[accent], 4, '')) + endif + if s:group_not_done(airline_grouplist, name.suffix.'_'.accent) + call airline#highlighter#exec(name.suffix.'_'.accent, colors) + endif + endfor + endfor + + if empty(s:separators) + " nothing to be done continue endif + " TODO: optimize this + for sep in items(s:separators) + " we cannot check, that the group already exists, else the separators + " might not be correctly defined. But perhaps we can skip above groups + " that match the '_to_' name, because they would be redefined here... + call exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) + endfor + endif + endfor + endfunction - for accent in keys(s:accents) - if !has_key(p.accents, accent) - continue - endif - let colors = copy(mode_colors) - if p.accents[accent][0] != '' - let colors[0] = p.accents[accent][0] + " End legacy VimScript + finish + +else + + " This is using Vim9 script + + def s:gui2cui(rgb: string, fallback: string): string + if empty(rgb) + return fallback + elseif match(rgb, '^\%(NONE\|[fb]g\)$') > -1 + return rgb + elseif rgb !~ '#' + # rgb contains colorname + return rgb + endif + var _rgb = [] + _rgb = mapnew(split(rgb[1 : ], '..\zs'), (_, v) => ('0x' .. v)->str2nr(16)) + return airline#msdos#round_msdos_colors(_rgb) + enddef + + def s:group_not_done(list: list, name: string): bool + if index(list, name) == -1 + add(list, name) + return true + else + if &vbs + echomsg printf("airline: group: %s already done, skipping", name) + endif + return false + endif + enddef + + def s:get_syn(group: string, what: string, mode: string): string + var color = '' + if hlexists(group) + color = hlID(group)->synIDtrans()->synIDattr(what, mode) + endif + if empty(color) || str2nr(color) == -1 + # Normal highlighting group should always exist + color = hlID('Normal')->synIDtrans()->synIDattr(what, mode) + # however, just in case + if empty(color) || str2nr(color) == -1 + color = 'NONE' + endif + endif + return color + enddef + + def s:get_array(guifg: string, guibg: string, ctermfg: string, ctermbg: string, opts: list): list + return [ guifg, guibg, ctermfg, ctermbg, empty(opts) ? '' : join(opts, ',') ] + enddef + + def airline#highlighter#reset_hlcache(): void + s:hl_groups = {} + enddef + + def airline#highlighter#get_highlight(group: string, rest: list = ['']): list + # only check for the cterm reverse attribute + # TODO: do we need to check all modes (gui, term, as well)? + var reverse = false + var bold = false + var property: string + var res = [] + var ctermfg: string + var ctermbg: string + var guifg: string + var guibg: string + property = hlID(group)->synIDtrans()->synIDattr('reverse', 'cterm') + if !empty(property) && property->str2nr() + reverse = true + endif + if get(g:, 'airline_highlighting_cache', 0) && has_key(s:hl_groups, group) + res = s:hl_groups[group] + return reverse ? [ res[1], res[0], res[3], res[2], res[4] ] : res + else + ctermfg = s:get_syn(group, 'fg', 'cterm') + ctermbg = s:get_syn(group, 'bg', 'cterm') + guifg = s:get_syn(group, 'fg', 'gui') + guibg = s:get_syn(group, 'bg', 'gui') + property = hlID(group)->synIDtrans()->synIDattr('bold') + if !empty(property) && property->str2nr() + bold = true + endif + if reverse + res = s:get_array(guibg, guifg, ctermbg, ctermfg, bold ? ['bold'] : rest) + else + res = s:get_array(guifg, guibg, ctermfg, ctermbg, bold ? ['bold'] : rest) + endif + endif + s:hl_groups[group] = res + return res + enddef + + def airline#highlighter#get_highlight2(fg: list, bg: list, rest1: string = '', rest2: string = '', rest3: string = ''): list + var guifg = s:get_syn(fg[0], fg[1], 'gui') + var guibg = s:get_syn(bg[0], bg[1], 'gui') + var ctermfg = s:get_syn(fg[0], fg[1], 'cterm') + var ctermbg = s:get_syn(bg[0], bg[1], 'cterm') + var rest = [ rest1, rest2, rest3 ] + return s:get_array(guifg, guibg, ctermfg, ctermbg, filter(rest, (_, v) => !empty(v))) + enddef + + def s:hl_group_exists(group: string): bool + if !hlexists(group) + return false + elseif hlID(group)->synIDtrans()->synIDattr('fg')->empty() + return false + endif + return true + enddef + + def s:CheckDefined(colors: list): list + # Checks, whether the definition of the colors is valid and is not empty or NONE + # e.g. if the colors would expand to this: + # hi airline_c ctermfg=NONE ctermbg=NONE + # that means to clear that highlighting group, therefore, fallback to Normal + # highlighting group for the cterm values + + # This only works, if the Normal highlighting group is actually defined, + # so return early, if it has been cleared + if !exists("g:airline#highlighter#normal_fg_hi") + g:airline#highlighter#normal_fg_hi = hlID('Normal')->synIDtrans()->synIDattr('fg', 'cterm') + endif + if empty(g:airline#highlighter#normal_fg_hi) || str2nr(g:airline#highlighter#normal_fg_hi) < 0 + return colors + endif + + for val in colors + if !empty(val) && val !=# 'NONE' + return colors + endif + endfor + # this adds the bold attribute to the term argument of the :hi command, + # but at least this makes sure, the group will be defined + var fg = g:airline#highlighter#normal_fg_hi + var bg = hlID('Normal')->synIDtrans()->synIDattr('bg', 'cterm') + if empty(bg) || str2nr(bg) < 0 + # in case there is no background color defined for Normal + bg = colors[3] + endif + return colors[ 0 : 1 ] + [fg, bg] + [colors[4]] + enddef + + def s:GetHiCmd(list: list): string + # list needs to have 5 items! + var res: string + var i = -1 + var item: string + while i < 4 + i += 1 + item = get(list, i, '') + if item is '' + continue + endif + if i == 0 + res ..= ' guifg=' .. item + elseif i == 1 + res ..= ' guibg=' .. item + elseif i == 2 + res ..= ' ctermfg=' .. item + elseif i == 3 + res ..= ' ctermbg=' .. item + elseif i == 4 + res ..= printf(' gui=%s cterm=%s term=%s', item, item, item) + endif + endwhile + return res + enddef + + def airline#highlighter#load_theme(): void + if pumvisible() + return + endif + for winnr in filter(range(1, winnr('$')), (_, v) => v != winnr()) + airline#highlighter#highlight_modified_inactive(winbufnr(winnr)) + endfor + airline#highlighter#highlight(['inactive']) + if getbufvar( bufnr('%'), '&modified' ) && &buftype != 'terminal' + airline#highlighter#highlight(['normal', 'modified']) + else + airline#highlighter#highlight(['normal']) + endif + enddef + + def airline#highlighter#add_accent(accent: string): void + s:accents[accent] = 1 + enddef + + def airline#highlighter#add_separator(from: string, to: string, inverse: bool): void + s:separators[from .. to] = [from, to, inverse] + s:exec_separator({}, from, to, inverse, '') + enddef + + def s:exec_separator(dict: dict, from_arg: string, to_arg: string, inverse: bool, suffix: string): void + if pumvisible() + return + endif + var group = from_arg .. '_to_' .. to_arg .. suffix + var from = mapnew(airline#themes#get_highlight(from_arg .. suffix), (_, v) => type(v) != type('') ? string(v) : v) + var colors = [] + var to = mapnew(airline#themes#get_highlight(to_arg .. suffix), (_, v) => type(v) != type('') ? string(v) : v) + if inverse + colors = [ from[1], to[1], from[3], to[3] ] + else + colors = [ to[1], from[1], to[3], from[3] ] + endif + dict[group] = colors + airline#highlighter#exec(group, colors) + enddef + + def airline#highlighter#highlight_modified_inactive(bufnr: number): void + var colors: list + var dict1 = eval('g:airline#themes#' .. g:airline_theme .. '#palette')->get('inactive_modified', {}) + var dict2 = eval('g:airline#themes#' .. g:airline_theme .. '#palette')->get('inactive', {}) + + if empty(dict2) + return + endif + + if getbufvar(bufnr, '&modified') + colors = get(dict1, 'airline_c', []) + else + colors = get(dict2, 'airline_c', []) + endif + if !empty(colors) + airline#highlighter#exec('airline_c' .. bufnr .. '_inactive', colors) + endif + enddef + + def airline#highlighter#exec(group: string, clrs: list): void + if pumvisible() + return + endif + var colors: list = mapnew(copy(clrs), (_, v) => type(v) != type('') ? string(v) : v) + if len(colors) == 4 + add(colors, '') + endif + if s:is_win32term + colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, '')) + colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, '')) + endif + var old_hi: list = airline#highlighter#get_highlight(group) + var new_hi: list = colors + if old_hi != new_hi || !s:hl_group_exists(group) + var cmd = printf('hi %s%s', group, s:GetHiCmd(colors)) + try + :exe cmd + catch /^Vim\%((\a\+)\)\=:E421:/ + var grp = matchstr(v:exception, '\w\+\ze=') + var clr = matchstr(v:exception, '=\zs\w\+') + cmd = substitute(cmd, clr, 'grey', 'g') + :exe cmd + airline#util#warning('color ' .. clr .. ' definition for group ' .. grp .. ' not found, using grey as fallback') + catch + airline#util#warning('Error when running command: ' .. cmd) + endtry + if has_key(s:hl_groups, group) + s:hl_groups[group] = colors + endif + endif + enddef + + def airline#highlighter#highlight(modes: list, bufnr: string = ''): void + var p: dict = eval('g:airline#themes#' .. g:airline_theme .. '#palette') + + # draw the base mode, followed by any overrides + var mapped = map(modes, (_, v) => v == modes[0] ? v : modes[0] .. "_" .. v) + var suffix = '' + if modes[0] == 'inactive' + suffix = '_inactive' + endif + var airline_grouplist = [] + var dict: dict + var bnr: number = 0 + + var buffers_in_tabpage: list = uniq(sort(tabpagebuflist())) + # mapped might be something like ['normal', 'normal_modified'] + # if a group is in both modes available, only define the second + # that is how this was done previously overwrite the previous definition + for mode in reverse(mapped) + if exists('g:airline#themes#' .. g:airline_theme .. '#palette.' .. mode) + dict = eval('g:airline#themes#' .. g:airline_theme .. '#palette.' .. mode) + for kvp in items(dict) + var mode_colors = kvp[1] + var name = kvp[0] + if name == 'airline_c' && !empty(bufnr) && suffix == '_inactive' + name = 'airline_c' .. bufnr endif - if p.accents[accent][2] != '' - let colors[2] = p.accents[accent][2] + # do not re-create highlighting for buffers that are no longer visible + # in the current tabpage + if name =~# 'airline_c\d\+' + bnr = matchstr(name, 'airline_c\zs\d\+')->str2nr() + if bnr > 0 && index(buffers_in_tabpage, bnr) == -1 + continue + endif + elseif (name =~ '_to_') || (name[ 0 : 10 ] == 'airline_tab' && !empty(suffix)) + # group will be redefined below at exec_separator + # or is not needed for tabline with '_inactive' suffix + # since active flag is 1 for builder) + continue endif - if len(colors) >= 5 - let colors[4] = get(p.accents[accent], 4, '') - else - call add(colors, get(p.accents[accent], 4, '')) + if s:group_not_done(airline_grouplist, name .. suffix) + airline#highlighter#exec(name .. suffix, mode_colors) endif - if s:group_not_done(airline_grouplist, name.suffix.'_'.accent) - call airline#highlighter#exec(name.suffix.'_'.accent, colors) + + if !has_key(p, 'accents') + # shouldn't actually happen, p should always contain accents + continue endif + + for accent in keys(s:accents) + if !has_key(p.accents, accent) + continue + endif + var colors = copy(mode_colors) + if p.accents[accent][0] != '' + colors[0] = p.accents[accent][0] + endif + if type(get(p.accents[accent], 2, '')) == type('') + colors[2] = get(p.accents[accent], 2, '') + else + colors[2] = string(p.accents[accent][2]) + endif + if len(colors) >= 5 + colors[4] = get(p.accents[accent], 4, '') + else + add(colors, get(p.accents[accent], 4, '')) + endif + if s:group_not_done(airline_grouplist, name .. suffix .. '_' .. accent) + airline#highlighter#exec(name .. suffix .. '_' .. accent, colors) + endif + endfor endfor - endfor - if empty(s:separators) - " nothing to be done - continue + if empty(s:separators) + continue + endif + for sep in items(s:separators) + # we cannot check, that the group already exists, else the separators + # might not be correctly defined. But perhaps we can skip above groups + # that match the '_to_' name, because they would be redefined here... + s:exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) + endfor endif - " TODO: optimize this - for sep in items(s:separators) - " we cannot check, that the group already exists, else the separators - " might not be correctly defined. But perhaps we can skip above groups - " that match the '_to_' name, because they would be redefined here... - call exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) - endfor - endif - endfor -endfunction + endfor + enddef +endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/init.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/init.vim index 16460cb..f13b68c 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/init.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/init.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -31,29 +31,64 @@ function! airline#init#bootstrap() call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus']) call s:check_defined('g:airline_exclude_filetypes', []) call s:check_defined('g:airline_exclude_preview', 0) - call s:check_defined('g:airline_gui_mode', airline#init#gui_mode()) + " If g:airline_mode_map_codes is set to 1 in your .vimrc it will display + " only the modes' codes in the status line. Refer :help mode() for codes. + " That may be a preferred presentation because it is minimalistic. + call s:check_defined('g:airline_mode_map_codes', 0) call s:check_defined('g:airline_mode_map', {}) - call extend(g:airline_mode_map, { + + if g:airline_mode_map_codes != 1 + " If you prefer different mode names than those below they can be + " customised by inclusion in your .vimrc - for example, including just: + " let g:airline_mode_map = { + " \ 'Rv' : 'VIRTUAL REPLACE', + " \ 'niV' : 'VIRTUAL REPLACE (NORMAL)', + " \ } + " ...would override 'Rv' and 'niV' below respectively. + call extend(g:airline_mode_map, { \ '__' : '------', - \ 'c' : 'COMMAND', - \ 'i' : 'INSERT', - \ 'ic' : 'INSERT COMPL', - \ 'ix' : 'INSERT COMPL', - \ 'multi' : 'MULTI', - \ 'n' : 'NORMAL', - \ 'ni' : '(INSERT)', + \ 'n' : 'NORMAL', \ 'no' : 'OP PENDING', - \ 'R' : 'REPLACE', - \ 'Rv' : 'V REPLACE', - \ 's' : 'SELECT', - \ 'S' : 'S-LINE', + \ 'nov' : 'OP PENDING CHAR', + \ 'noV' : 'OP PENDING LINE', + \ 'no' : 'OP PENDING BLOCK', + \ 'niI' : 'INSERT (NORMAL)', + \ 'niR' : 'REPLACE (NORMAL)', + \ 'niV' : 'V REPLACE (NORMAL)', + \ 'v' : 'VISUAL', + \ 'V' : 'V-LINE', + \ '' : 'V-BLOCK', + \ 's' : 'SELECT', + \ 'S' : 'S-LINE', \ '' : 'S-BLOCK', + \ 'i' : 'INSERT', + \ 'ic' : 'INSERT COMPL GENERIC', + \ 'ix' : 'INSERT COMPL', + \ 'R' : 'REPLACE', + \ 'Rc' : 'REPLACE COMP GENERIC', + \ 'Rv' : 'V REPLACE', + \ 'Rx' : 'REPLACE COMP', + \ 'c' : 'COMMAND', + \ 'cv' : 'VIM EX', + \ 'ce' : 'EX', + \ 'r' : 'PROMPT', + \ 'rm' : 'MORE PROMPT', + \ 'r?' : 'CONFIRM', + \ '!' : 'SHELL', \ 't' : 'TERMINAL', - \ 'v' : 'VISUAL', - \ 'V' : 'V-LINE', - \ '' : 'V-BLOCK', + \ 'multi' : 'MULTI', \ }, 'keep') + " NB: no*, cv, ce, r? and ! do not actually display + else + " Exception: The control character in ^S and ^V modes' codes + " break the status line if allowed to render 'naturally' so + " they are overridden with ^ (when g:airline_mode_map_codes = 1) + call extend(g:airline_mode_map, { + \ '' : '^V', + \ '' : '^S', + \ }, 'keep') + endif call s:check_defined('g:airline_theme_map', {}) call extend(g:airline_theme_map, { @@ -87,12 +122,16 @@ function! airline#init#bootstrap() call s:check_defined('g:airline_left_alt_sep', "\ue0b1") "  call s:check_defined('g:airline_right_sep', "\ue0b2") "  call s:check_defined('g:airline_right_alt_sep', "\ue0b3") "  - " ro=, ws=☲, lnr=☰, mlnr=, br=, nx=Ɇ, crypt=🔒, dirty=⚡ + " ro=, ws=☲, lnr=, mlnr=☰, colnr=℅, br=, nx=Ɇ, crypt=🔒, dirty=⚡ + " Note: For powerline, we add an extra space after maxlinenr symbol, + " because it is usually setup as a ligature in most powerline patched + " fonts. It can be over-ridden by configuring a custom maxlinenr call extend(g:airline_symbols, { \ 'readonly': "\ue0a2", \ 'whitespace': "\u2632", - \ 'linenr': "\u2630 ", - \ 'maxlinenr': " \ue0a1", + \ 'maxlinenr': "\u2630 ", + \ 'linenr': " \ue0a1:", + \ 'colnr': " \u2105:", \ 'branch': "\ue0a0", \ 'notexists': "\u0246", \ 'dirty': "\u26a1", @@ -104,12 +143,13 @@ function! airline#init#bootstrap() call s:check_defined('g:airline_left_alt_sep', "") call s:check_defined('g:airline_right_sep', "") call s:check_defined('g:airline_right_alt_sep', "") - " ro=⊝, ws=☲, lnr=☰, mlnr=㏑, br=ᚠ, nx=Ɇ, crypt=🔒 + " ro=⊝, ws=☲, lnr=㏑, mlnr=☰, colnr=℅, br=ᚠ, nx=Ɇ, crypt=🔒 call extend(g:airline_symbols, { \ 'readonly': "\u229D", \ 'whitespace': "\u2632", - \ 'linenr': "\u2630 ", - \ 'maxlinenr': " \u33D1", + \ 'maxlinenr': "\u2630", + \ 'linenr': " \u33d1:", + \ 'colnr': " \u2105:", \ 'branch': "\u16A0", \ 'notexists': "\u0246", \ 'crypt': nr2char(0x1F512), @@ -124,8 +164,9 @@ function! airline#init#bootstrap() call extend(g:airline_symbols, { \ 'readonly': 'RO', \ 'whitespace': '!', - \ 'linenr': 'ln ', - \ 'maxlinenr': ' :', + \ 'linenr': ' ln:', + \ 'maxlinenr': '', + \ 'colnr': ' cn:', \ 'branch': '', \ 'notexists': '?', \ 'crypt': 'cr', @@ -146,14 +187,21 @@ function! airline#init#bootstrap() \ 'function': 'airline#parts#readonly', \ 'accent': 'red', \ }) - call airline#parts#define_raw('file', '%f%m') + if get(g:, 'airline_section_c_only_filename',0) + call airline#parts#define_raw('file', '%t%m') + else + call airline#parts#define_raw('file', airline#formatter#short_path#format('%f%m')) + endif call airline#parts#define_raw('path', '%F%m') call airline#parts#define('linenr', { - \ 'raw': '%{g:airline_symbols.linenr}%4l', + \ 'raw': '%{g:airline_symbols.linenr}%l', \ 'accent': 'bold'}) call airline#parts#define('maxlinenr', { \ 'raw': '/%L%{g:airline_symbols.maxlinenr}', \ 'accent': 'bold'}) + call airline#parts#define('colnr', { + \ 'raw': '%{g:airline_symbols.colnr}%v', + \ 'accent': 'bold'}) call airline#parts#define_function('ffenc', 'airline#parts#ffenc') call airline#parts#define('hunks', { \ 'raw': '', @@ -165,62 +213,75 @@ function! airline#init#bootstrap() \ 'raw': '', \ 'accent': 'bold' \ }) + call airline#parts#define('coc_current_function', { + \ 'raw': '', + \ 'accent': 'bold' + \ }) + call airline#parts#define('lsp_progress', { + \ 'raw': '', + \ 'accent': 'bold' + \ }) call airline#parts#define_empty(['obsession', 'tagbar', 'syntastic-warn', - \ 'syntastic-err', 'eclim', 'whitespace','windowswap', + \ 'syntastic-err', 'eclim', 'whitespace','windowswap', 'taglist', \ 'ycm_error_count', 'ycm_warning_count', 'neomake_error_count', \ 'neomake_warning_count', 'ale_error_count', 'ale_warning_count', - \ 'lsp_error_count', 'lsp_warning_count', + \ 'lsp_error_count', 'lsp_warning_count', 'scrollbar', + \ 'nvimlsp_error_count', 'nvimlsp_warning_count', + \ 'vim9lsp_warning_count', 'vim9lsp_error_count', \ 'languageclient_error_count', 'languageclient_warning_count', - \ 'coc_warning_count', 'coc_error_count', 'vista']) + \ 'coc_warning_count', 'coc_error_count', 'vista', 'battery']) + call airline#parts#define_text('bookmark', '') call airline#parts#define_text('capslock', '') call airline#parts#define_text('gutentags', '') + call airline#parts#define_text('gen_tags', '') call airline#parts#define_text('grepper', '') call airline#parts#define_text('xkblayout', '') call airline#parts#define_text('keymap', '') + call airline#parts#define_text('omnisharp', '') unlet g:airline#init#bootstrapping endfunction -function! airline#init#gui_mode() - return has('gui_running') || (has("termguicolors") && &termguicolors == 1) ? 'gui' : 'cterm' -endfunction - function! airline#init#sections() let spc = g:airline_symbols.space if !exists('g:airline_section_a') let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'keymap', 'spell', 'capslock', 'xkblayout', 'iminsert']) endif if !exists('g:airline_section_b') - let g:airline_section_b = airline#section#create(['hunks', 'branch']) + if airline#util#winwidth() > 99 + let g:airline_section_b = airline#section#create(['hunks', 'branch', 'battery']) + else + let g:airline_section_b = airline#section#create(['hunks', 'branch']) + endif endif if !exists('g:airline_section_c') if exists("+autochdir") && &autochdir == 1 - let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly']) + let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly', 'coc_status', 'lsp_progress']) else - let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly', 'coc_status']) + let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly', 'coc_status', 'lsp_progress']) endif endif if !exists('g:airline_section_gutter') let g:airline_section_gutter = airline#section#create(['%=']) endif if !exists('g:airline_section_x') - let g:airline_section_x = airline#section#create_right(['bookmark', 'tagbar', 'vista', 'gutentags', 'grepper', 'filetype']) + let g:airline_section_x = airline#section#create_right(['coc_current_function', 'bookmark', 'scrollbar', 'tagbar', 'taglist', 'vista', 'gutentags', 'gen_tags', 'omnisharp', 'grepper', 'filetype']) endif if !exists('g:airline_section_y') let g:airline_section_y = airline#section#create_right(['ffenc']) endif if !exists('g:airline_section_z') if airline#util#winwidth() > 79 - let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%3p%%'.spc, 'linenr', 'maxlinenr', spc.':%3v']) + let g:airline_section_z = airline#section#create(['windowswap', 'obsession', '%p%%', 'linenr', 'maxlinenr', 'colnr']) else - let g:airline_section_z = airline#section#create(['%3p%%'.spc, 'linenr', ':%3v']) + let g:airline_section_z = airline#section#create(['%p%%', 'linenr', 'colnr']) endif endif if !exists('g:airline_section_error') - let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic-err', 'eclim', 'neomake_error_count', 'ale_error_count', 'lsp_error_count', 'languageclient_error_count', 'coc_error_count']) + let g:airline_section_error = airline#section#create(['ycm_error_count', 'syntastic-err', 'eclim', 'neomake_error_count', 'ale_error_count', 'lsp_error_count', 'nvimlsp_error_count', 'languageclient_error_count', 'coc_error_count', 'vim9lsp_error_count']) endif if !exists('g:airline_section_warning') - let g:airline_section_warning = airline#section#create(['ycm_warning_count', 'syntastic-warn', 'neomake_warning_count', 'ale_warning_count', 'lsp_warning_count', 'languageclient_warning_count', 'whitespace', 'coc_warning_count']) + let g:airline_section_warning = airline#section#create(['ycm_warning_count', 'syntastic-warn', 'neomake_warning_count', 'ale_warning_count', 'lsp_warning_count', 'nvimlsp_warning_count', 'languageclient_warning_count', 'whitespace', 'coc_warning_count', 'vim9lsp_warning_count']) endif endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/msdos.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/msdos.vim index 1dac22b..594c191 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/msdos.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/msdos.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling Christian Brabandt et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -41,19 +41,43 @@ let s:basic16 = [ \ [ 0xFF, 0xFF, 0xFF ] \ ] -function! airline#msdos#round_msdos_colors(rgblist) - " Check for values from MSDOS 16 color terminal - let best = [] - let min = 100000 - let list = s:basic16 - for value in list - let t = abs(value[0] - a:rgblist[0]) + - \ abs(value[1] - a:rgblist[1]) + - \ abs(value[2] - a:rgblist[2]) - if min > t - let min = t - let best = value - endif - endfor - return index(s:basic16, best) -endfunction +if !exists(":def") || !airline#util#has_vim9_script() + + function! airline#msdos#round_msdos_colors(rgblist) + " Check for values from MSDOS 16 color terminal + let best = [] + let min = 100000 + let list = s:basic16 + for value in list + let t = abs(value[0] - a:rgblist[0]) + + \ abs(value[1] - a:rgblist[1]) + + \ abs(value[2] - a:rgblist[2]) + if min > t + let min = t + let best = value + endif + endfor + return index(s:basic16, best) + endfunction + + finish + +else + + def airline#msdos#round_msdos_colors(rgblist: list): string + # Check for values from MSDOS 16 color terminal + var best = [] + var min = 100000 + var t = 0 + for value in s:basic16 + t = abs(value[0] - rgblist[0]) + + abs(value[1] - rgblist[1]) + + abs(value[2] - rgblist[2]) + if min > t + min = t + best = value + endif + endfor + return string(index(s:basic16, best)) + enddef +endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/parts.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/parts.vim index 4c5b102..8564482 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/parts.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/parts.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -64,15 +64,103 @@ function! airline#parts#paste() return g:airline_detect_paste && &paste ? g:airline_symbols.paste : '' endfunction +" Sources: +" https://ftp.nluug.nl/pub/vim/runtime/spell/ +" https://en.wikipedia.org/wiki/Regional_indicator_symbol +let s:flags = { + \ 'af_za': '🇿🇦[af]', + \ 'am_et': '🇭🇺[am]', + \ 'bg_bg': '🇧🇬', + \ 'br_fr': '🇫🇷[br]', + \ 'ca_es': '🇪🇸[ca]', + \ 'cs_cz': '🇨🇿', + \ 'cy_gb': '🇬🇧[cy]', + \ 'da_dk': '🇩🇰', + \ 'de' : '🇩🇪', + \ 'de_19': '🇩🇪[19]', + \ 'de_20': '🇩🇪[20]', + \ 'de_at': '🇩🇪[at]', + \ 'de_ch': '🇩🇪[ch]', + \ 'de_de': '🇩🇪', + \ 'el_gr': '🇬🇷', + \ 'en': '🇬🇧', + \ 'en_au': '🇦🇺', + \ 'en_ca': '🇨🇦', + \ 'en_gb': '🇬🇧', + \ 'en_nz': '🇳🇿', + \ 'en_us': '🇺🇸', + \ 'es': '🇪🇸', + \ 'es_es': '🇪🇸', + \ 'es_mx': '🇲🇽', + \ 'fo_fo': '🇫🇴', + \ 'fr_fr': '🇫🇷', + \ 'ga_ie': '🇮🇪', + \ 'gd_gb': '🇬🇧[gd]', + \ 'gl_es': '🇪🇸[gl]', + \ 'he_il': '🇮🇱', + \ 'hr_hr': '🇭🇷', + \ 'hu_hu': '🇭🇺', + \ 'id_id': '🇮🇩', + \ 'it_it': '🇮🇹', + \ 'ku_tr': '🇹🇷[ku]', + \ 'la' : '🇮🇹[la]', + \ 'lt_lt': '🇱🇹', + \ 'lv_lv': '🇱🇻', + \ 'mg_mg': '🇲🇬', + \ 'mi_nz': '🇳🇿[mi]', + \ 'ms_my': '🇲🇾', + \ 'nb_no': '🇳🇴', + \ 'nl_nl': '🇳🇱', + \ 'nn_no': '🇳🇴[ny]', + \ 'ny_mw': '🇲🇼', + \ 'pl_pl': '🇵🇱', + \ 'pt': '🇵🇹', + \ 'pt_br': '🇧🇷', + \ 'pt_pt': '🇵🇹', + \ 'ro_ro': '🇷🇴', + \ 'ru' : '🇷🇺', + \ 'ru_ru': '🇷🇺', + \ 'ru_yo': '🇷🇺[yo]', + \ 'rw_rw': '🇷🇼', + \ 'sk_sk': '🇸🇰', + \ 'sl_si': '🇸🇮', + \ 'sr_rs': '🇷🇸', + \ 'sv_se': '🇸🇪', + \ 'sw_ke': '🇰🇪', + \ 'tet_id': '🇮🇩[tet]', + \ 'th' : '🇹🇭', + \ 'tl_ph': '🇵🇭', + \ 'tn_za': '🇿🇦[tn]', + \ 'uk_ua': '🇺🇦', + \ 'yi' : '🇻🇮', + \ 'yi_tr': '🇹🇷', + \ 'zu_za': '🇿🇦[zu]', + \ } +" Also support spelllang without region codes +let s:flags_noregion = {} +for s:key in keys(s:flags) + let s:flags_noregion[split(s:key, '_')[0]] = s:flags[s:key] +endfor + function! airline#parts#spell() let spelllang = g:airline_detect_spelllang ? printf(" [%s]", toupper(substitute(&spelllang, ',', '/', 'g'))) : '' - if g:airline_detect_spell && &spell + if g:airline_detect_spell && (&spell || (exists('g:airline_spell_check_command') && eval(g:airline_spell_check_command))) + + if g:airline_detect_spelllang !=? '0' && g:airline_detect_spelllang ==? 'flag' + let spelllang = tolower(&spelllang) + if has_key(s:flags, spelllang) + return s:flags[spelllang] + elseif has_key(s:flags_noregion, spelllang) + return s:flags_noregion[spelllang] + endif + endif + let winwidth = airline#util#winwidth() if winwidth >= 90 return g:airline_symbols.spell . spelllang elseif winwidth >= 70 return g:airline_symbols.spell - else + elseif !empty(g:airline_symbols.spell) return split(g:airline_symbols.spell, '\zs')[0] endif endif @@ -107,11 +195,12 @@ endfunction function! airline#parts#ffenc() let expected = get(g:, 'airline#parts#ffenc#skip_expected_string', '') - let bomb = &l:bomb ? '[BOM]' : '' + let bomb = &bomb ? '[BOM]' : '' + let noeolf = &eol ? '' : '[!EOL]' let ff = strlen(&ff) ? '['.&ff.']' : '' - if expected is# &fenc.bomb.ff + if expected is# &fenc.bomb.noeolf.ff return '' else - return &fenc.bomb.ff + return &fenc.bomb.noeolf.ff endif endfunction diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/section.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/section.vim index bed4b81..d9e0aa0 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/section.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/section.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/themes.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/themes.vim index e85c985..e12f154 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/themes.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/themes.vim @@ -1,78 +1,155 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. -" vim: et ts=2 sts=2 sw=2 +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. +" vim: et ts=2 sts=2 sw=2 et scriptencoding utf-8 -" generates a dictionary which defines the colors for each highlight group -function! airline#themes#generate_color_map(sect1, sect2, sect3, ...) - let palette = { - \ 'airline_a': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , get(a:sect1 , 4 , '') ] , - \ 'airline_b': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , get(a:sect2 , 4 , '') ] , - \ 'airline_c': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , get(a:sect3 , 4 , '') ] , - \ } - - if a:0 > 0 - call extend(palette, { - \ 'airline_x': [ a:1[0] , a:1[1] , a:1[2] , a:1[3] , get(a:1 , 4 , '' ) ] , - \ 'airline_y': [ a:2[0] , a:2[1] , a:2[2] , a:2[3] , get(a:2 , 4 , '' ) ] , - \ 'airline_z': [ a:3[0] , a:3[1] , a:3[2] , a:3[3] , get(a:3 , 4 , '' ) ] , - \ }) - else - call extend(palette, { - \ 'airline_x': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , '' ] , - \ 'airline_y': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , '' ] , - \ 'airline_z': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , '' ] , - \ }) - endif - - return palette -endfunction - -function! airline#themes#get_highlight(group, ...) - return call('airline#highlighter#get_highlight', [a:group] + a:000) -endfunction - -function! airline#themes#get_highlight2(fg, bg, ...) - return call('airline#highlighter#get_highlight2', [a:fg, a:bg] + a:000) -endfunction - -function! airline#themes#patch(palette) - for mode in keys(a:palette) - if mode == 'accents' - continue +if !exists(":def") || !airline#util#has_vim9_script() + + " Legacy Vim Script Implementation + + " generates a dictionary which defines the colors for each highlight group + function! airline#themes#generate_color_map(sect1, sect2, sect3, ...) + let palette = { + \ 'airline_a': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , get(a:sect1 , 4 , '') ] , + \ 'airline_b': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , get(a:sect2 , 4 , '') ] , + \ 'airline_c': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , get(a:sect3 , 4 , '') ] , + \ } + + if a:0 > 0 + call extend(palette, { + \ 'airline_x': [ a:1[0] , a:1[1] , a:1[2] , a:1[3] , get(a:1 , 4 , '' ) ] , + \ 'airline_y': [ a:2[0] , a:2[1] , a:2[2] , a:2[3] , get(a:2 , 4 , '' ) ] , + \ 'airline_z': [ a:3[0] , a:3[1] , a:3[2] , a:3[3] , get(a:3 , 4 , '' ) ] , + \ }) + else + call extend(palette, { + \ 'airline_x': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , '' ] , + \ 'airline_y': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , '' ] , + \ 'airline_z': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , '' ] , + \ }) + endif + + return palette + endfunction + + function! airline#themes#get_highlight(group, ...) + return call('airline#highlighter#get_highlight', [a:group] + a:000) + endfunction + + function! airline#themes#get_highlight2(fg, bg, ...) + return call('airline#highlighter#get_highlight2', [a:fg, a:bg] + a:000) + endfunction + + function! airline#themes#patch(palette) + for mode in keys(a:palette) + if mode == 'accents' + continue + endif + if !has_key(a:palette[mode], 'airline_warning') + let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ] + endif + if !has_key(a:palette[mode], 'airline_error') + let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ] + endif + if !has_key(a:palette[mode], 'airline_term') + let a:palette[mode]['airline_term'] = [ '#9cffd3', '#202020', 85, 232] + endif + endfor + + let a:palette.accents = get(a:palette, 'accents', {}) + let a:palette.accents.none = [ '', '', '', '', '' ] + let a:palette.accents.bold = [ '', '', '', '', 'bold' ] + let a:palette.accents.italic = [ '', '', '', '', 'italic' ] + + if !has_key(a:palette.accents, 'red') + let a:palette.accents.red = [ '#ff0000' , '' , 160 , '' ] + endif + if !has_key(a:palette.accents, 'green') + let a:palette.accents.green = [ '#008700' , '' , 22 , '' ] + endif + if !has_key(a:palette.accents, 'blue') + let a:palette.accents.blue = [ '#005fff' , '' , 27 , '' ] + endif + if !has_key(a:palette.accents, 'yellow') + let a:palette.accents.yellow = [ '#dfff00' , '' , 190 , '' ] + endif + if !has_key(a:palette.accents, 'orange') + let a:palette.accents.orange = [ '#df5f00' , '' , 166 , '' ] + endif + if !has_key(a:palette.accents, 'purple') + let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ] + endif + endfunction + finish +else + " New Vim9 Script Implementation + def airline#themes#generate_color_map(sect1: list, sect2: list, sect3: list): dict + # Only allows for 3 arguments currently, because Vim9 Script does not allow for a:000 + + # all sections should be string + map(sect2, (_, v) => type(v) != type('') ? string(v) : v) + + var palette = { + 'airline_a': [ sect1[0], sect1[1], sect1[2], sect1[3], get(sect1, 4, '') ], + 'airline_b': [ sect2[0], sect2[1], sect2[2], sect2[3], get(sect2, 4, '') ], + 'airline_c': [ sect3[0], sect3[1], sect3[2], sect3[3], get(sect3, 4, '') ], + } + + extend(palette, { + 'airline_x': [ sect3[0], sect3[1], sect3[2], sect3[3], '' ], + 'airline_y': [ sect2[0], sect2[1], sect2[2], sect2[3], '' ], + 'airline_z': [ sect1[0], sect1[1], sect1[2], sect1[3], '' ], + }) + + return palette + enddef + + def airline#themes#get_highlight(group: string): list + return call('airline#highlighter#get_highlight', [group]) + enddef + + def airline#themes#get_highlight2(fg: list, bg: list): list + return call('airline#highlighter#get_highlight2', [fg, bg]) + enddef + + def airline#themes#patch(palette: dict): void + for mode in keys(palette) + if mode == 'accents' + continue + endif + if !has_key(palette[mode], 'airline_warning') + extend(palette[mode], {airline_warning: [ '#000000', '#df5f00', '232', '166' ]}) + endif + if !has_key(palette[mode], 'airline_error') + extend(palette[mode], {airline_error: [ '#000000', '#990000', '232', '160' ]}) + endif + if !has_key(palette[mode], 'airline_term') + extend(palette[mode], {airline_term: [ '#9cffd3', '#202020', '85', '232' ]}) + endif + endfor + + palette.accents = get(palette, 'accents', {}) + extend(palette.accents, {none: [ '', '', '', '', '' ]}) + extend(palette.accents, {bold: [ '', '', '', '', 'bold' ]}) + extend(palette.accents, {italic: [ '', '', '', '', 'italic' ]}) + + if !has_key(palette.accents, 'red') + extend(palette.accents, {red: [ '#ff0000', '', '160', '' ]}) + endif + if !has_key(palette.accents, 'green') + extend(palette.accents, {green: [ '#008700', '', '22', '' ]}) + endif + if !has_key(palette.accents, 'blue') + extend(palette.accents, {blue: [ '#005fff', '', '27', '' ]}) endif - if !has_key(a:palette[mode], 'airline_warning') - let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ] + if !has_key(palette.accents, 'yellow') + extend(palette.accents, {yellow: [ '#dfff00', '', '190', '' ]}) endif - if !has_key(a:palette[mode], 'airline_error') - let a:palette[mode]['airline_error'] = [ '#000000', '#990000', 232, 160 ] + if !has_key(palette.accents, 'orange') + extend(palette.accents, {orange: [ '#df5f00', '', '166', '' ]}) endif - if !has_key(a:palette[mode], 'airline_term') - let a:palette[mode]['airline_term'] = [ '#9cffd3', '#202020', 85, 232] + if !has_key(palette.accents, 'purple') + extend(palette.accents, {purple: [ '#af00df', '', '128', '' ]}) endif - endfor - - let a:palette.accents = get(a:palette, 'accents', {}) - let a:palette.accents.none = [ '', '', '', '', '' ] - let a:palette.accents.bold = [ '', '', '', '', 'bold' ] - let a:palette.accents.italic = [ '', '', '', '', 'italic' ] - - if !has_key(a:palette.accents, 'red') - let a:palette.accents.red = [ '#ff0000' , '' , 160 , '' ] - endif - if !has_key(a:palette.accents, 'green') - let a:palette.accents.green = [ '#008700' , '' , 22 , '' ] - endif - if !has_key(a:palette.accents, 'blue') - let a:palette.accents.blue = [ '#005fff' , '' , 27 , '' ] - endif - if !has_key(a:palette.accents, 'yellow') - let a:palette.accents.yellow = [ '#dfff00' , '' , 190 , '' ] - endif - if !has_key(a:palette.accents, 'orange') - let a:palette.accents.orange = [ '#df5f00' , '' , 166 , '' ] - endif - if !has_key(a:palette.accents, 'purple') - let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ] - endif -endfunction + enddef +endif diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/themes/dark.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/themes/dark.vim index 20aed48..927cef6 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/themes/dark.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/themes/dark.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling et al. " vim: et ts=2 sts=2 sw=2 tw=80 scriptencoding utf-8 @@ -11,17 +11,18 @@ scriptencoding utf-8 " * airline_x (first section of the right most sections) " * airline_y (section just to the right of airline_x) " * airline_z (right most section) -" * The mode of the buffer, as reported by the :mode() function. Airline +" * The mode of the buffer, as reported by the :mode() function. Airline " converts the values reported by mode() to the following: " * normal " * insert " * replace " * visual " * inactive +" * terminal " The last one is actually no real mode as returned by mode(), but used by " airline to style inactive statuslines (e.g. windows, where the cursor " currently does not reside in). -" * In addition to each section and mode specified above, airline themes +" * In addition to each section and mode specified above, airline themes " can also specify overrides. Overrides can be provided for the following " scenarios: " * 'modified' @@ -33,7 +34,7 @@ scriptencoding utf-8 " * g:airline#themes##palette " where is substituted for the name of the theme.vim file where the " theme definition resides. Airline themes should reside somewhere on the -" 'runtimepath' where it will be loaded at vim startup, for example: +" 'runtimepath' where it will be loaded at vim startup, for example: " * autoload/airline/themes/theme_name.vim " " For this, the dark.vim, theme, this is defined as @@ -41,12 +42,12 @@ let g:airline#themes#dark#palette = {} " Keys in the dictionary are composed of the mode, and if specified the " override. For example: -" * g:airline#themes#dark#palette.normal +" * g:airline#themes#dark#palette.normal " * the colors for a statusline while in normal mode -" * g:airline#themes#dark#palette.normal_modified +" * g:airline#themes#dark#palette.normal_modified " * the colors for a statusline while in normal mode when the buffer has " been modified -" * g:airline#themes#dark#palette.visual +" * g:airline#themes#dark#palette.visual " * the colors for a statusline while in visual mode " " Values for each dictionary key is an array of color values that should be @@ -55,7 +56,7 @@ let g:airline#themes#dark#palette = {} " See "help attr-list" for valid values for the "opt" value. " " Each theme must provide an array of such values for each airline section of -" the statusline (airline_a through airline_z). A convenience function, +" the statusline (airline_a through airline_z). A convenience function, " airline#themes#generate_color_map() exists to mirror airline_a/b/c to " airline_x/y/z, respectively. @@ -107,6 +108,7 @@ let g:airline#themes#dark#palette.insert_paste = { \ 'airline_a': [ s:airline_a_insert[0] , '#d78700' , s:airline_a_insert[2] , 172 , '' ] , \ } +let g:airline#themes#dark#palette.terminal = airline#themes#generate_color_map(s:airline_a_insert, s:airline_b_insert, s:airline_c_insert) let g:airline#themes#dark#palette.replace = copy(g:airline#themes#dark#palette.insert) let g:airline#themes#dark#palette.replace.airline_a = [ s:airline_b_insert[0] , '#af0000' , s:airline_b_insert[2] , 124 , '' ] @@ -132,7 +134,7 @@ let g:airline#themes#dark#palette.inactive_modified = { " For commandline mode, we use the colors from normal mode, except the mode " indicator should be colored differently, e.g. light green -let s:airline_a_commandline = [ '#0000ff' , '#0cff00' , 17 , 40 ] +let s:airline_a_commandline = [ '#00005f' , '#00d700' , 17 , 40 ] let s:airline_b_commandline = [ '#ffffff' , '#444444' , 255 , 238 ] let s:airline_c_commandline = [ '#9cffd3' , '#202020' , 85 , 234 ] let g:airline#themes#dark#palette.commandline = airline#themes#generate_color_map(s:airline_a_commandline, s:airline_b_commandline, s:airline_c_commandline) @@ -150,7 +152,7 @@ let g:airline#themes#dark#palette.accents = { " Here we define the color map for ctrlp. We check for the g:loaded_ctrlp -" variable so that related functionality is loaded iff the user is using +" variable so that related functionality is loaded if the user is using " ctrlp. Note that this is optional, and if you do not define ctrlp colors " they will be chosen automatically from the existing palette. if get(g:, 'loaded_ctrlp', 0) diff --git a/_vim/.vim/plugged/vim-airline/autoload/airline/util.vim b/_vim/.vim/plugged/vim-airline/autoload/airline/util.vim index 5453941..b62b652 100644 --- a/_vim/.vim/plugged/vim-airline/autoload/airline/util.vim +++ b/_vim/.vim/plugged/vim-airline/autoload/airline/util.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling Christian Brabandt et al. " vim: et ts=2 sts=2 sw=2 scriptencoding utf-8 @@ -16,9 +16,11 @@ let s:focusgained_ignore_time = 0 " TODO: Try to cache winwidth(0) function " e.g. store winwidth per window and access that, only update it, if the size " actually changed. -function! airline#util#winwidth(...) +function! airline#util#winwidth(...) abort let nr = get(a:000, 0, 0) - if get(g:, 'airline_statusline_ontop', 0) + " When statusline is on top, or using global statusline for Neovim + " always return the number of columns + if get(g:, 'airline_statusline_ontop', 0) || &laststatus > 2 return &columns else return winwidth(nr) @@ -135,14 +137,14 @@ endfunction function! airline#util#ignore_buf(name) let pat = '\c\v'. get(g:, 'airline#ignore_bufadd_pat', ''). - \ get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', + \ get(g:, 'airline#extensions#tabline#ignore_bufadd_pat', \ '!|defx|gundo|nerd_tree|startify|tagbar|term://|undotree|vimfiler') return match(a:name, pat) > -1 endfunction function! airline#util#has_fugitive() if !exists("s:has_fugitive") - let s:has_fugitive = exists('*fugitive#head') || exists('*FugitiveHead') + let s:has_fugitive = exists('*FugitiveHead') endif return s:has_fugitive endfunction @@ -174,11 +176,20 @@ function! airline#util#has_custom_scm() endfunction function! airline#util#doautocmd(event) - exe printf("silent doautocmd %s User %s", s:nomodeline, a:event) + if !exists('#airline') && a:event !=? 'AirlineToggledOff' + " airline disabled + return + endif + try + exe printf("silent doautocmd %s User %s", s:nomodeline, a:event) + catch /^Vim\%((\a\+)\)\=:E48:/ + " Catch: Sandbox mode + " no-op + endtry endfunction function! airline#util#themes(match) - let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*.vim'), "\n") + let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*.vim', 1), "\n") return sort(map(files, 'fnamemodify(v:val, ":t:r")') + ('random' =~ a:match ? ['random'] : [])) endfunction @@ -200,6 +211,15 @@ function! airline#util#ignore_next_focusgain() endif endfunction +function! airline#util#is_popup_window(winnr) + " Keep the statusline active if it's a popup window + if exists('*win_gettype') + return win_gettype(a:winnr) ==# 'popup' || win_gettype(a:winnr) ==# 'autocmd' + else + return airline#util#getwinvar(a:winnr, '&buftype', '') ==# 'popup' + endif +endfunction + function! airline#util#try_focusgained() " Ignore lasts for at most one second and is cleared on the first " focusgained. We use ignore to prevent system() calls from triggering @@ -210,3 +230,10 @@ function! airline#util#try_focusgained() return dt >= 1 endfunction +function! airline#util#has_vim9_script() + " Returns true, if Vim is new enough to understand vim9 script + return (exists(":def") && + \ v:versionlong >= 8022844 && + \ get(g:, "airline_experimental", 0)) +endfunction + diff --git a/_vim/.vim/plugged/vim-airline/doc/airline.txt b/_vim/.vim/plugged/vim-airline/doc/airline.txt index de7b924..e03092a 100644 --- a/_vim/.vim/plugged/vim-airline/doc/airline.txt +++ b/_vim/.vim/plugged/vim-airline/doc/airline.txt @@ -68,13 +68,17 @@ section meaning (example)~ C filename + read-only flag (`~/.vim/vimrc RO`) X filetype (`vim`) Y file encoding[fileformat] (`utf-8[unix]`) + optionally may contain Byte Order Mark `[BOM]` and missing end of last + line `[!EOL]` Z current position in the file - percentage % ☰ current line/number of lines ln : column - So this: 10% ☰ 10/100 ln : 20 means: > + percentage % ln: current line/number of lines ☰ cn: column + So this: 10% ln:10/100☰ cn:20 + means: > 10% - 10 percent - ☰ 10 - current line 10 - /100 ln - of 100 lines - : 20 - current column 20 + ln: - line number is + 10/100☰ - 10 of 100 total lines + cn: - column number is + 20 - 20 < [...] additional sections (warning/errors/statistics) from external plugins (e.g. YCM/syntastic/...) @@ -116,6 +120,10 @@ CONFIGURATION *airline-configuration* There are a couple configuration values available (shown with their default values): +* enable experimental features > + " Currently: Enable Vim9 Script implementation + let g:airline_experimental = 1 + * the separator used on the left side > let g:airline_left_sep='>' < @@ -138,6 +146,9 @@ values): (if enough space is available) > let g:airline_detect_spelllang=1 < + Set to 'flag' to get a unicode icon of the relavant country flag instead of + the 'spelllang' itself + * enable iminsert detection > let g:airline_detect_iminsert=0 < @@ -145,7 +156,7 @@ values): to only the filename of that buffer. > let g:airline_inactive_collapse=1 < -* Use alternative seperators for the statusline of inactive windows > +* Use alternative separators for the statusline of inactive windows > let g:airline_inactive_alt_sep=1 < * themes are automatically selected based on the matching colorscheme. this @@ -167,6 +178,14 @@ values): endif endfunction < +* if you want to update your highlights without affecting the airline theme, + you can do so using the AirlineAfterTheme autocmd. > + function! s:update_highlights() + hi CursorLine ctermbg=none guibg=NONE + hi VertSplit ctermbg=none guibg=NONE + endfunction + autocmd User AirlineAfterTheme call s:update_highlights() +< * By default, airline will use unicode symbols if your encoding matches utf-8. If you want the powerline symbols set this variable: > let g:airline_powerline_fonts = 1 @@ -212,7 +231,10 @@ values): (for section a and b): > let g:airline_filetype_overrides = { + \ 'coc-explorer': [ 'CoC Explorer', '' ], \ 'defx': ['defx', '%{b:defx.paths[0]}'], + \ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'], + \ 'floggraph': [ 'Flog', '%{get(b:, "flog_status_summary", "")}' ], \ 'gundo': [ 'Gundo', '' ], \ 'help': [ 'Help', '%f' ], \ 'minibufexpl': [ 'MiniBufExplorer', '' ], @@ -221,9 +243,10 @@ values): \ 'vim-plug': [ 'Plugins', '' ], \ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ], \ 'vimshell': ['vimshell','%{vimshell#get_status_string()}'], + \ 'vaffle' : [ 'Vaffle', '%{b:vaffle.dir}' ], \ } < -* defines whether the preview window should be excluded from have its window +* defines whether the preview window should be excluded from having its window statusline modified (may help with plugins which use the preview window heavily) > let g:airline_exclude_preview = 0 @@ -249,7 +272,7 @@ values): * Do not draw separators for empty sections (only for the active window) > let g:airline_skip_empty_sections = 1 < - This variable can be overriden by setting a window-local variable with + This variable can be overridden by setting a window-local variable with the same name (in the correct window): > let w:airline_skip_empty_sections = 0 < @@ -258,7 +281,7 @@ values): let g:airline_highlighting_cache = 0 < * disable airline on FocusLost autocommand (e.g. when Vim loses focus): > - let g:airline_focuslost_inactive = 1 + let g:airline_focuslost_inactive = 0 < * configure the fileformat output By default, it will display something like 'utf-8[unix]', however, you can @@ -279,6 +302,13 @@ values): To force updating the tabline on mode changes, call `airline#check_mode()` in your custom statusline setting: `:set stl=%!airline#check_mode(winnr())` will correctly update the tabline on mode changes. + +* Display a short path in statusline: > + let g:airline_stl_path_style = 'short' +> +* Display a only file name in statusline: > + let g:airline_section_c_only_filename = 1 +> ============================================================================= COMMANDS *airline-commands* @@ -319,6 +349,16 @@ CUSTOMIZATION *airline-customization* The following are some unicode symbols for customizing the left/right separators, as well as the powerline font glyphs. +Note: Some additional characters like spaces and colons may be included in the +default. Including them within the symbol definitions rather than outside of +them allows you to eliminate or otherwise alter them. + +Note: Be aware that some of these glyphs are defined as ligatures, so they may +show up different (usually bigger) if followed by a space. This only happens +if both the font and terminal implementation used support ligatures. If you +want to follow a glyph with a space _without_ the alternate ligature being +rendered, follow it with a non-breaking-space character. + Note: You must define the dictionary first before setting values. Also, it's a good idea to check whether it exists as to avoid accidentally overwriting its contents. > @@ -331,10 +371,12 @@ its contents. > let g:airline_left_sep = '▶' let g:airline_right_sep = '«' let g:airline_right_sep = '◀' + let g:airline_symbols.colnr = ' ㏇:' + let g:airline_symbols.colnr = ' ℅:' let g:airline_symbols.crypt = '🔒' let g:airline_symbols.linenr = '☰' - let g:airline_symbols.linenr = '␊' - let g:airline_symbols.linenr = '␤' + let g:airline_symbols.linenr = ' ␊:' + let g:airline_symbols.linenr = ' ␤:' let g:airline_symbols.linenr = '¶' let g:airline_symbols.maxlinenr = '' let g:airline_symbols.maxlinenr = '㏑' @@ -352,9 +394,10 @@ its contents. > let g:airline_right_sep = '' let g:airline_right_alt_sep = '' let g:airline_symbols.branch = '' + let g:airline_symbols.colnr = ' ℅:' let g:airline_symbols.readonly = '' - let g:airline_symbols.linenr = '☰' - let g:airline_symbols.maxlinenr = '' + let g:airline_symbols.linenr = ' :' + let g:airline_symbols.maxlinenr = '☰ ' let g:airline_symbols.dirty='⚡' " old vim-powerline symbols @@ -388,7 +431,7 @@ window. let g:airline_section_c (bufferline or filename, readonly) let g:airline_section_gutter (csv) let g:airline_section_x (tagbar, filetype, virtualenv) - let g:airline_section_y (fileencoding, fileformat) + let g:airline_section_y (fileencoding, fileformat, 'bom', 'eol') let g:airline_section_z (percentage, line number, column number) let g:airline_section_error (ycm_error_count, syntastic-err, eclim, languageclient_error_count) @@ -468,6 +511,13 @@ ale * ale close_lnum_symbol > let airline#extensions#ale#close_lnum_symbol = ')' +------------------------------------- *airline-battery* +vim-battery + +* enable/disable battery integration > + let g:airline#extensions#battery#enabled = 1 +< default: 0 + ------------------------------------- *airline-bookmark* vim-bookmark @@ -487,6 +537,13 @@ If a file is edited, that is not yet in the repository, the notexists symbol will be displayed after the branch name. If the repository is not clean, the dirty symbol will be displayed after the branch name. +* notexists symbol means you are editing a file, that has not been + committed yet + default: '?' + +* the dirty symbol basically means your working directory is dirty + default: '!' + Note: the branch extension will be disabled for windows smaller than 80 characters. @@ -553,6 +610,13 @@ characters. let g:airline#extensions#branch#vcs_checks = ['untracked', 'dirty'] < +------------------------------------- *airline-flog* +vim-flog + +If vim-flog is installed, vim-airline will display the branch name +together with a status summary in the git log graph buffer; +either 'no changes' or the number of added/removed/modified files. + ------------------------------------- *airline-bufferline* vim-bufferline @@ -583,12 +647,9 @@ coc * change warning symbol: > let airline#extensions#coc#warning_symbol = 'W:' < -* change error format: > - let airline#extensions#coc#stl_format_err = '%E{[%e(#%fe)]}' +* enable/disable coc status display > + g:airline#extensions#coc#show_coc_status = 1 < -* change warning format: > - let airline#extensions#coc#stl_format_warn = '%W{[%w(#%fw)]}' - ------------------------------------- *airline-commandt* command-t @@ -668,7 +729,7 @@ you can use. let g:airline#extensions#default#section_truncate_width = { \ 'b': 79, \ 'x': 60, - \ 'y': 88, + \ 'y': 80, \ 'z': 45, \ 'warning': 80, \ 'error': 80, @@ -691,7 +752,15 @@ you can use. ------------------------------------- *airline-denite* Denite -No configuration available. +* enable/disable denite integration > + let g:airline#extensions#denite#enabled = 1 + +------------------------------------- *airline-dirvish* +vim-dirvish + +* enable/disable vim-dirvish integration > + let g:airline#extensions#dirvish#enabled = 1 +< default: 1 ------------------------------------- *airline-eclim* eclim @@ -700,6 +769,16 @@ eclim |airline-syntastic| extension. > let g:airline#extensions#eclim#enabled = 1 +------------------------------------- *airline-fern* +fern.vim + +Airline displays the fern.vim specific statusline. +(for details, see the help of fern.vim) + +* enable/disable bufferline integration > + let g:airline#extensions#fern#enabled = 1 +< default: 1 + ------------------------------------- *airline-fugitiveline* This extension hides the fugitive://**// part of the buffer names, to only show the file name as if it were in the current working tree. @@ -709,7 +788,14 @@ It is deactivated by default if |airline-bufferline| is activated. let g:airline#extensions#fugitiveline#enabled = 1 < If enabled, the buffer that comes from fugitive, will have added a trailing -"[git]" to be able do distinguish between fugitive and non-fugitive buffers. +"[git]" to be able to distinguish between fugitive and non-fugitive buffers. + +------------------------------------- *airline-fzf* +fzf +fzf.vim + +* enable/disable fzf integration > + let g:airline#extensions#fzf#enabled = 1 ------------------------------------- *airline-gina* gina.vim @@ -733,6 +819,12 @@ vim-gutentags * enable/disable vim-gutentags integration > let g:airline#extensions#gutentags#enabled = 1 +------------------------------------- *gen_tags.vim* +gen_tags.vim + +* enable/disable gen_tags.vim integration > + let g:airline#extensions#gen_tags#enabled = 1 + ------------------------------------- *airline-hunks* vim-gitgutter vim-signify @@ -752,6 +844,11 @@ querying how many changes you got. It will return something like '+4 ~2 -1'. < * set hunk count symbols. > let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-'] + +* enable coc-git extension. + If not set to 1, vim-airline will not consider to use coc-git for the hunks + extension. Make sure to have the coc-git extension enabled. > + let g:airline#extensions#hunks#coc_git = 1 < ------------------------------------- *airline-keymap* vim-keymap @@ -761,6 +858,15 @@ This extension displays the current 'keymap' in use. * enable/disable vim-keymap extension > let g:airline#extensions#keymap#enabled = 1 +* set label for a keymap (default is from g:airline_symbols.keymap) > + let g:airline#extensions#keymap#label = 'Layout:' + +* set name for default layout (empty to disable it completely) > + let g:airline#extensions#keymap#default = '' + +* set short codes for layout names > + let g:airline#extensions#keymap#short_codes = {'russian-jcukenwin': 'ru'} + ------------------------------------- *airline-languageclient* LanguageClient (despite its name, it can be used for Vim and Neovim). @@ -784,11 +890,16 @@ LanguageClient let airline#extensions#languageclient#close_lnum_symbol = ')' ------------------------------------- *airline-localsearch* -localsearch +localsearch * enable/disable localsearch indicator integration > let g:airline#extensions#localsearch#enabled = 1 +* invert the localsearch indicator + if set to 1, the indicator shall only be shown when localsearch is disabled + the text will also change from 'LS' to 'GS' (Global Search) > + let g:airline#extensions#localsearch#inverted = 0 + ------------------------------------- *airline-lsp* lsp @@ -809,6 +920,13 @@ lsp < * lsp close_lnum_symbol > let airline#extensions#lsp#close_lnum_symbol = ')' +< +* lsp progress skip time + Suppresses the frequency of status line updates. + Prevents heavy operation when using a language server that sends frequent progress notifications. + Set 0 to disable. > + g:airline#extensions#lsp#progress_skip_time = 0.3 (default) +< ------------------------------------- *airline-neomake* neomake @@ -830,7 +948,7 @@ using the |'NerdTreeStatusline'| variable (for details, see the help of NerdTree) * enable/disable nerdtree's statusline integration > - let g:airline#extensions#nerdtree_status = 1 + let g:airline#extensions#nerdtree_statusline = 1 < default: 1 ------------------------------------- *airline-nrrwrgn* @@ -839,6 +957,27 @@ NrrwRgn * enable/disable NrrwRgn integration > let g:airline#extensions#nrrwrgn#enabled = 1 +------------------------------------- *airline-nvimlsp* +nvimlsp + +* enable/disable nvimlsp integration > + let g:airline#extensions#nvimlsp#enabled = 1 + +* nvimlsp error_symbol > + let airline#extensions#nvimlsp#error_symbol = 'E:' +< +* nvimlsp warning - needs v:lua.vim.diagnostic.get + let airline#extensions#nvimlsp#warning_symbol = 'W:' + +* nvimlsp show_line_numbers - needs v:lua.vim.diagnostic.get + let airline#extensions#nvimlsp#show_line_numbers = 1 + +* nvimlsp open_lnum_symbol - needs v:lua.vim.diagnostic.get + let airline#extensions#nvimlsp#open_lnum_symbol = '(L' + +* nvimlsp close_lnum_symbol - needs v:lua.vim.diagnostic.get + let airline#extensions#nvimlsp#close_lnum_symbol = ')' + ------------------------------------- *airline-obsession* vim-obsession @@ -848,6 +987,12 @@ vim-obsession * set marked window indicator string > let g:airline#extensions#obsession#indicator_text = '$' < +------------------------------------- *airline-omnisharp* +OmniSharp + +* enable/disable OmniSharp integration > + let g:airline#extensions#omnisharp#enabled = 1 + ------------------------------------- *airline-po* This extension will display the currently translated, untranslated and fuzzy messages when editing translations (po files). Related plugin (not necessary @@ -900,6 +1045,27 @@ title accordingly. * configure the title text for location list buffers > let g:airline#extensions#quickfix#location_text = 'Location' < +------------------------------------- *airline-rufo* +rufo + +The rufo (Ruby Formatter) extension merely displays whether vim-rufo is +currently enabled, in the z sction of the statusline. + +* enable/disable vim-rufo integration > + let g:airline#extensions#rufo#enabled = 1 +< +* configure the symbol, or text, to display when vim-rufo auto formatting + is on > + let g:airline#extensions#rufo#symbol = 'R' +< +------------------------------------- *airline-searchcount* +The searchcount extension supports the searchcount() function in Vim script. +Note: This is only enabled when 'hls' is on. When you turn off search +highlighting (e.g. using |:nohls|), it this will be disabled. + +* enable/disable searchcount integration > + let g:airline#extensions#searchcount#enabled = 1 +< ------------------------------------- *airline-syntastic* syntastic @@ -1014,8 +1180,11 @@ Note: Not displayed if the number of tabs is less than 1 `buffer_idx_mode` allows 3 different modes to access buffers from the tabline. When enabled, numbers will be displayed in the tabline and mappings will be exposed to allow you to select a buffer directly. - In default mode, when the variable is 1 Up to 11 mappings will be - exposed: > + In default mode, when the variable is 1 Up to 10 mappings will be + exposed. Note: As 10 and 1 have same prefix, we use 0 to replace 10. So, + 0 will jump to tenth buffer. Those mappings are not automatically + created, vim-airline just exposes those `AirlineSeelctTab` keys + for you to map to a convenient key > let g:airline#extensions#tabline#buffer_idx_mode = 1 nmap 1 AirlineSelectTab1 @@ -1027,6 +1196,7 @@ Note: Not displayed if the number of tabs is less than 1 nmap 7 AirlineSelectTab7 nmap 8 AirlineSelectTab8 nmap 9 AirlineSelectTab9 + nmap 0 AirlineSelectTab0 nmap - AirlineSelectPrevTab nmap + AirlineSelectNextTab < @@ -1132,8 +1302,8 @@ Note: Not displayed if the number of tabs is less than 1 let g:airline#extensions#tabline#fnamecollapse = 1 " The `unique_tail_improved` - another algorithm, that will smartly - " uniquify buffers names with similar filename, suppressing common - " parts of paths. + " uniquify buffers names with similar filename, suppressing common + " parts of paths. let g:airline#extensions#tabline#formatter = 'unique_tail_improved' " The `short_path` - is a simple formatter, that will show the @@ -1144,6 +1314,30 @@ Note: Not displayed if the number of tabs is less than 1 let g:airline#extensions#tabline#formatter = 'short_path' +* defines the customized format() function to display tab title in tab mode. > + let g:airline#extensions#tabline#tabtitle_formatter = 'MyTabTitleFormatter' +< + Then define the MyTabTitleFormatter() function in your vimrc. > + function MyTabTitleFormatter(n) + let buflist = tabpagebuflist(a:n) + let winnr = tabpagewinnr(a:n) + let bufnr = buflist[winnr - 1] + let winid = win_getid(winnr, a:n) + let title = bufname(bufnr) + + if empty(title) + if getqflist({'qfbufnr' : 0}).qfbufnr == bufnr + let title = '[Quickfix List]' + elseif winid && getloclist(winid, {'qfbufnr' : 0}).qfbufnr == bufnr + let title = '[Location List]' + else + let title = '[No Name]' + endif + endif + + return title + endfunction + * configure the minimum number of buffers needed to show the tabline. > let g:airline#extensions#tabline#buffer_min_count = 0 < @@ -1183,6 +1377,36 @@ Note: Enabling this extension will modify 'showtabline' and 'guioptions'. (neovim specific, only works with buffers and not real tabs, default: 0) > let airline#extensions#tabline#middle_click_preserves_windows = 1 < + *airline-tabline-hlgroups* +When the tabline is enabled, vim-airline exposes the following highlighting +groups: + + airline_tab: default highlighting group for the tabline + airline_tab_right: idem, but for the right side of the tabline + + airline_tabsel: highlighting group of the selected item + airline_tabsel_right: idem, but for the right side of the tabline + airline_tabmod: highlighting group for a 'modified' buffer + airline_tabmod_right: idem, but on the right side + airline_tabmod_unsel: unselected tab with modified buffer + airline_tabmod_unsel_right: (unused) + airline_tabtype: label group used by ctrlspace and tabws + airline_tabfill: highlighting group for the filler space + airline_tablabel: highlighting group for the label + airline_tablabel_right: highlighting group for the label on the right side + airline_tabhid: hidden buffer + airline_tabhid_right: idem, but on the right + +------------------------------------- *airline-scrollbar* + +Displays an Ascii Scrollbar for active windows with a width > 200. + +* enable/disable scrollbar integration > + let g:airline#extensions#scrollbar#enabled = 1 (default: 0) +* set minimum window width, below which the scollbar + will be disabled > + let g:airline#extensions#scrollbar#minwidth = 100 (default: 200) + ------------------------------------- *airline-taboo* taboo.vim @@ -1215,6 +1439,17 @@ tagbar let g:airline#extensions#tagbar#flags = 's' let g:airline#extensions#tagbar#flags = 'p' < +* configure how to search for the nearest tag (:help tagbar-statusline) > + let g:airline#extensions#tagbar#searchmethod = 'nearest-stl' (default) + let g:airline#extensions#tagbar#searchmethod = 'nearest' + let g:airline#extensions#tagbar#searchmethod = 'scoped-stl' +< +------------------------------------- *airline-taglist* +taglist + +* enable/disable taglist integration > + let g:airline#extensions#taglist#enabled = 1 +< ------------------------------------- *airline-tmuxline* tmuxline @@ -1246,14 +1481,33 @@ No configuration available. ------------------------------------- *airline-unite* Unite -No configuration available. +* enable/disable unite integration > + let g:airline#extensions#unite#enabled = 1 + +------------------------------------- *airline-vim9lsp* +vim9lsp +* enable/disable vim9lsp integration > + let airline#extensions#vim9lsp#enabled = 1 +< +* vim9lsp error_symbol > + let airline#extensions#vim9lsp#error_symbol = 'E:' +< +* vim9lsp warning > + let airline#extensions#vim9lsp#warning_symbol = 'W:' +< ------------------------------------- *airline-vimagit* vimagit * enable/disable vimagit integration > let g:airline#extensions#vimagit#enabled = 1 < +------------------------------------- *airline-vimcmake* +Vim-CMake + +* enable/disable Vim-CMake integration > + let g:airline#extensions#vimcmake#enabled = 1 +< ------------------------------------- *airline-vimtex* vimtex @@ -1289,12 +1543,21 @@ State indicators: * viewer is opened > let g:airline#extensions#vimtex#viewer = "v" +* use vimtex specific wordcount function + for TeX buffers Note: this more accurate + but may slow down Vim) > + let g:airline#extensions#vimtex#wordcount = 1 + ------------------------------------- *airline-virtualenv* virtualenv * enable/disable virtualenv integration > let g:airline#extensions#virtualenv#enabled = 1 < +* enable virtualenv for additional filetypes: + (default: python): > + let g:airline#extensions#virtualenv#ft = ['python', 'markdown', 'rmd'] +< ------------------------------------- *airline-vista* vista.vim @@ -1356,6 +1619,9 @@ vista.vim * configure custom trailing whitespace regexp rule > let g:airline#extensions#whitespace#trailing_regexp = '\s$' + " this can also be configured for an individual buffer + let b:airline_whitespace_trailing_regexp = '\s$' + * configure, which filetypes have special treatment of /* */ comments, matters for mix-indent-file algorithm: > let airline#extensions#c_like_langs = @@ -1396,7 +1662,7 @@ vim-windowswap " The default value matches filetypes typically used for documentation " such as markdown and help files. Default is: let g:airline#extensions#wordcount#filetypes = - \ ['asciidoc', 'help', 'mail', 'markdown', 'org', 'plaintex', 'rst', 'tex', 'text']) + \ ['asciidoc', 'help', 'mail', 'markdown', 'rmd', 'nroff', 'org', 'plaintex', 'rst', 'tex', 'text']) " Use ['all'] to enable for all filetypes. * defines the name of a formatter for word count will be displayed: > @@ -1404,6 +1670,9 @@ vim-windowswap " e.g. 1,042 in English and 1.042 in German locale let g:airline#extensions#wordcount#formatter = 'default' + " enable reading time formatter + let g:airline#extensions#wordcount#formatter = 'readingtime' + " here is how you can define a 'foo' formatter: " create a file in autoload/airline/extensions/wordcount/formatters/ " called foo.vim, which defines the following function signature: @@ -1458,7 +1727,7 @@ features that you may not need. They both require |vim-airline| anyway. Main features and default mappings of this extension are: -* tab cwd persistance, also across sessions if vim-obsession is being used. +* tab cwd persistence, also across sessions if vim-obsession is being used. * buffer filtering in the tabline: only buffers whose path is within the tab cwd will be shown in the tabline. @@ -1486,7 +1755,7 @@ Main features and default mappings of this extension are: let g:xtabline_alt_action = "buffer #" Note: Make sure to also enable > - :let g:airline_extensions#tabline#show_buffers = 1 + :let g:airline#extensions#tabline#show_buffers = 1 otherwise the tabline might not actually be displayed correctly (see |airline-tabline|) @@ -1543,7 +1812,7 @@ zoomwintab default: '> Zoomed' * zoomwintab's zoomout symbol > - let g:airline#extensions#zoomwintab#status_zoomed_out ='Currently Zoomed Out' + let g:airline#extensions#zoomwintab#status_zoomed_out = 'Currently Zoomed Out' default: '' @@ -1571,7 +1840,7 @@ greater than a minimum width. > Parts can be configured to be visible conditionally. > call airline#parts#define_condition('foo', 'getcwd() =~ "work_dir"') < -Now add part "foo" to section section airline_section_y: > +Now add part "foo" to section airline_section_y: > let g:airline_section_y = airline#section#create_right(['ffenc','foo']) < Note: Part definitions are combinative; e.g. the two examples above modify @@ -1599,7 +1868,8 @@ And the following are defined for their respective extensions: `ale_error_count` `ale_warning_count` `branch` `eclim` `hunks` `languageclient_error_count` `languageclient_warning_count` `lsp_error_count` -`lsp_warning_count` `neomake_error_count` `neomake_warning_count` `obsession` +`lsp_warning_count``neomake_error_count` `neomake_warning_count` +`nvimlsp_error_count` `nvimlsp_warning_count` `obsession` `syntastic-warn` `syntastic-err` `tagbar` `whitespace` `windowswap` `ycm_error_count` `ycm_warning_count` @@ -1620,10 +1890,10 @@ The defaults configure the mode and line number parts to be bold, and the readonly part to be red. "none" is special. This can be used, to remove a bold accent from an existing -theme. For example, usually the mode part of the statusline is usually -defined to be bold. However, it can be hard to remove an existing bold -accent from the default configuration. Therefore, you can use the none -accent to remove existing accents, so if you put > +theme. For example, the mode part of the statusline is usually defined to be +bold. However, it can be hard to remove an existing bold accent from the +default configuration. Therefore, you can use the none accent to remove +existing accents, so if you put > call airline#parts#define_accent('mode', 'none') the mode section will be set to non-bold font style. @@ -1819,6 +2089,11 @@ Q. Performance is bad A. Check the question at the wiki: https://github.com/vim-airline/vim-airline/wiki/FAQ#i-have-a-performance-problem +Q. Something strange happens on certain autocommands +A. Try to disable the autocommand by setting the 'eventignore' option like + this: > + set eventignore+=FocusGained + Solutions to other common problems can be found in the Wiki: @@ -1830,7 +2105,7 @@ Contributions and pull requests are welcome. ============================================================================= LICENSE *airline-license* -MIT License. Copyright © 2013-2020 Bailey Ling, Christian Brabandt, Mike +MIT License. Copyright © 2013-2021 Bailey Ling, Christian Brabandt, Mike Hartington et al. vim:tw=78:ts=8:ft=help:norl: diff --git a/_vim/.vim/plugged/vim-airline/plugin/airline.vim b/_vim/.vim/plugged/vim-airline/plugin/airline.vim index d8c95d8..e2d0d28 100644 --- a/_vim/.vim/plugged/vim-airline/plugin/airline.vim +++ b/_vim/.vim/plugged/vim-airline/plugin/airline.vim @@ -1,4 +1,4 @@ -" MIT License. Copyright (c) 2013-2020 Bailey Ling, Christian Brabandt et al. +" MIT License. Copyright (c) 2013-2021 Bailey Ling, Christian Brabandt et al. " vim: et ts=2 sts=2 sw=2 let s:save_cpo = &cpo @@ -47,14 +47,6 @@ function! s:init() call airline#util#doautocmd('AirlineAfterInit') endfunction -function! s:do_vim_enter() - " Needed for the Vista extension #2009 - if get(g:, 'airline#extensions#vista#enabled', 1) && exists(':Vista') - call vista#RunForNearestMethodOrFunction() - endif - call on_window_changed('VimEnter') -endfunction - let s:active_winnr = -1 function! s:on_window_changed(event) " don't trigger for Vim popup windows @@ -83,6 +75,10 @@ function! s:on_window_changed(event) endfunction function! s:on_focus_gained() + if &eventignore =~? 'focusgained' + return + endif + if airline#util#try_focusgained() unlet! w:airline_lastmode | :call airline_refresh(1) endif @@ -99,7 +95,6 @@ function! s:on_colorscheme_changed() call s:init() unlet! g:airline#highlighter#normal_fg_hi call airline#highlighter#reset_hlcache() - let g:airline_gui_mode = airline#init#gui_mode() if !s:theme_in_vimrc call airline#switch_matching_theme() endif @@ -139,17 +134,13 @@ function! s:airline_toggle() \ | call on_window_changed('CmdwinEnter') autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter') - autocmd GUIEnter,ColorScheme * call on_colorscheme_changed() - if exists("##OptionSet") - " Make sure that g_airline_gui_mode is refreshed - autocmd OptionSet termguicolors call on_colorscheme_changed() - endif + autocmd ColorScheme * call on_colorscheme_changed() " Set all statuslines to inactive autocmd FocusLost * call airline#update_statusline_focuslost() " Refresh airline for :syntax off autocmd SourcePre */syntax/syntax.vim \ call airline#extensions#tabline#buffers#invalidate() - autocmd VimEnter * call do_vim_enter() + autocmd VimEnter * call on_window_changed('VimEnter') autocmd WinEnter * call on_window_changed('WinEnter') autocmd FileType * call on_window_changed('FileType') autocmd BufWinEnter * call on_window_changed('BufWinEnter') @@ -161,7 +152,7 @@ function! s:airline_toggle() autocmd CursorMoved * call on_cursor_moved() autocmd VimResized * call on_focus_gained() - if exists('*timer_start') && exists('*funcref') + if exists('*timer_start') && exists('*funcref') && &eventignore !~? 'focusgained' " do not trigger FocusGained on startup, it might erase the intro screen (see #1817) " needs funcref() (needs 7.4.2137) and timers (7.4.1578) let Handler=funcref('FocusGainedHandler') @@ -185,11 +176,19 @@ function! s:airline_toggle() " Force update of tabline more often autocmd InsertEnter,InsertLeave,CursorMovedI * :call airline#update_tabline() endif + + if exists("##ModeChanged") + autocmd ModeChanged * :call airline#update_tabline() + endif augroup END if !airline#util#stl_disabled(winnr()) if &laststatus < 2 + let _scroll=&scroll set laststatus=2 + if &scroll != _scroll + let &scroll = _scroll + endif endif endif if s:airline_initialized @@ -239,7 +238,7 @@ function! s:airline_refresh(...) endfunction function! s:FocusGainedHandler(timer) - if exists("s:timer") && a:timer == s:timer + if exists("s:timer") && a:timer == s:timer && exists('#airline') && &eventignore !~? 'focusgained' augroup airline au FocusGained * call s:on_focus_gained() augroup END @@ -248,7 +247,7 @@ endfu function! s:airline_extensions() let loaded = airline#extensions#get_loaded_extensions() - let files = split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") + let files = split(globpath(&rtp, 'autoload/airline/extensions/*.vim', 1), "\n") call map(files, 'fnamemodify(v:val, ":t:r")') if empty(files) echo "No extensions loaded" @@ -301,6 +300,9 @@ command! AirlineExtensions call s:airline_extensions() call airline#init#bootstrap() call s:airline_toggle() +if exists("v:vim_did_enter") && v:vim_did_enter + call on_window_changed('VimEnter') +endif let &cpo = s:save_cpo unlet s:save_cpo diff --git a/_vim/.vim/plugged/vim-airline/test/.themisrc b/_vim/.vim/plugged/vim-airline/test/.themisrc new file mode 100644 index 0000000..3edae02 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/.themisrc @@ -0,0 +1,28 @@ +let s:helper = themis#helper('assert') +let s:deps = themis#helper('deps') + +call themis#helper('command').with(s:helper) +call s:deps.git('vim-airline/vim-airline-themes') +call s:deps.git('tomasr/molokai') + +function! MyFuncref(...) + call a:1.add_raw('hello world') + return 1 +endfunction + +function! MyIgnoreFuncref(...) + return -1 +endfunction + +function! MyAppend1(...) + call a:1.add_raw('hello') +endfunction + +function! MyAppend2(...) + call a:1.add_raw('world') +endfunction + +let g:airline#extensions#default#layout = [ + \ [ 'c', 'a', 'b', 'warning' ], + \ [ 'x', 'z', 'y' ] + \ ] diff --git a/_vim/.vim/plugged/vim-airline/test/airline.vimspec b/_vim/.vim/plugged/vim-airline/test/airline.vimspec new file mode 100644 index 0000000..951fcd0 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/airline.vimspec @@ -0,0 +1,64 @@ +Describe airline.vim + Before + let g:airline_statusline_funcrefs = [] + End + + It should run user funcrefs first + call airline#add_statusline_func('MyFuncref') + let &statusline = '' + call airline#update_statusline() + Assert Match(airline#statusline(1), 'hello world') + End + + It should not change the statusline with -1 + call airline#add_statusline_funcref(function('MyIgnoreFuncref')) + let &statusline = 'foo' + call airline#update_statusline() + Assert Equals(&statusline, 'foo') + End + + It should support multiple chained funcrefs + call airline#add_statusline_func('MyAppend1') + call airline#add_statusline_func('MyAppend2') + call airline#update_statusline() + Assert Match(airline#statusline(1), 'helloworld') + End + + It should allow users to redefine sections + let g:airline_section_a = airline#section#create(['mode', 'mode']) + call airline#update_statusline() + Assert Match(airline#statusline(1), '%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#%#airline_a_bold#%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#') + End + + It should remove funcrefs properly + let c = len(g:airline_statusline_funcrefs) + call airline#add_statusline_func('MyIgnoreFuncref') + call airline#remove_statusline_func('MyIgnoreFuncref') + Assert Equals(len(g:airline_statusline_funcrefs), c) + End + + It should overwrite the statusline with active and inactive splits + wincmd s + Assert NotMatch(airline#statusline(1), 'inactive') + Assert Match(airline#statusline(2), 'inactive') + wincmd c + End + + It should collapse the inactive split if the variable is set true + let g:airline_inactive_collapse = 1 + wincmd s + Assert NotMatch(getwinvar(2, '&statusline'), 'airline#parts#mode') + wincmd c + end + + It should collapse the inactive split if the variable is set false + let g:airline_inactive_collapse = 0 + wincmd s + Assert NotEquals(getwinvar(2, '&statusline'), 'airline#parts#mode') + wincmd c + End + + It should include check_mode + Assert Match(airline#statusline(1), 'airline#check_mode') + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/builder.vimspec b/_vim/.vim/plugged/vim-airline/test/builder.vimspec new file mode 100644 index 0000000..8872fa6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/builder.vimspec @@ -0,0 +1,107 @@ +Describe builder.vim + Describe active builder + Before each + let s:builder = airline#builder#new({'active': 1}) + End + + It should start with an empty statusline + let stl = s:builder.build() + Assert Equals(stl, '') + End + + It should transition colors from one to the next + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('Search', 'world') + let stl = s:builder.build() + Assert Match(stl,'%#Normal#hello%#Normal_to_Search#%#Search#world') + End + + + It should reuse highlight group if background colors match + highlight Foo1 ctermfg=1 ctermbg=2 + highlight Foo2 ctermfg=1 ctermbg=2 + call s:builder.add_section('Foo1', 'hello') + call s:builder.add_section('Foo2', 'world') + let stl = s:builder.build() + Assert Match(stl, '%#Foo1#helloworld') + End + + + It should switch highlight groups if foreground colors differ + highlight Foo1 ctermfg=1 ctermbg=2 + highlight Foo2 ctermfg=2 ctermbg=2 + call s:builder.add_section('Foo1', 'hello') + call s:builder.add_section('Foo2', 'world') + let stl = s:builder.build() + Assert Match(stl, '%#Foo1#hello%#Foo1_to_Foo2#%#Foo2#world') + End + + It should split left/right sections + call s:builder.split() + let stl = s:builder.build() + Assert Match(stl, '%=') + End + + It after split, sections use the right separator + call s:builder.split() + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('Search', 'world') + let stl = s:builder.build() + Assert Match(stl, 'hello%#Normal_to_Search#%#Search#world') + End + + It should not repeat the same highlight group + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('Normal', 'hello') + let stl = s:builder.build() + Assert Match(stl, '%#Normal#hellohello') + End + + It should replace accent groups with the specified group + call s:builder.add_section('Normal', '%#__accent_foo#hello') + let stl = s:builder.build() + Assert Match(stl, '%#Normal#%#Normal_foo#hello') + End + + It should replace two accent groups with correct groups + call s:builder.add_section('Normal', '%#__accent_foo#hello%#__accent_bar#world') + let stl = s:builder.build() + Assert Match(stl, '%#Normal_foo#hello%#Normal_bar#world') + End + + It should special restore group should go back to previous group + call s:builder.add_section('Normal', '%#__restore__#') + let stl = s:builder.build() + Assert NotMatch(stl, '%#__restore__#') + Assert Match(stl, '%#Normal#') + End + + It should blend colors from the left through the split to the right + call s:builder.add_section('Normal', 'hello') + call s:builder.split() + call s:builder.add_section('Search', 'world') + let stl = s:builder.build() + Assert Match(stl, 'Normal_to_Search') + End + End + + Describe inactive builder + Before each + let s:builder = airline#builder#new({'active': 0}) + End + + It should transition colors from one to the next + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('Search', 'world') + let stl = s:builder.build() + Assert Match(stl, '%#Normal_inactive#hello%#Normal_to_Search_inactive#%#Search_inactive#world') + End + + It should not render accents + call s:builder.add_section('Normal', '%#__accent_foo#hello%#foo#foo%#__accent_bar#world') + let stl = s:builder.build() + Assert Equals(stl, '%#Normal_inactive#hello%#foo_inactive#fooworld') + End + End + +End diff --git a/_vim/.vim/plugged/vim-airline/test/commands.vimspec b/_vim/.vim/plugged/vim-airline/test/commands.vimspec new file mode 100644 index 0000000..dfc41ef --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/commands.vimspec @@ -0,0 +1,50 @@ +Describe commands.vim + + It should toggle off and on + execute 'AirlineToggle' + Assert False(exists('#airline')) + execute 'AirlineToggle' + Assert True(exists('#airline')) + End + + It should toggle whitespace off + call airline#extensions#load() + execute 'AirlineToggleWhitespace' + Assert False(exists('#airline_whitespace')) + End + + It should toggle whitespace on + call airline#extensions#load() + execute 'AirlineToggleWhitespace' + Assert True(exists('#airline_whitespace')) + End + + It should display theme name "simple" + execute 'AirlineTheme simple' + Assert Equals(g:airline_theme, 'simple') + End + + It should display theme name "dark"' + execute 'AirlineTheme dark' + Assert Equals(g:airline_theme, 'dark') + End + + It should display theme name "dark" because specifying a name that does not exist + execute 'AirlineTheme doesnotexist' + Assert Equals(g:airline_theme, 'dark') + End + + It should display theme name molokai + colors molokai + Assert Equals(g:airline_theme, 'molokai') + End + + It should have a refresh command + Assert Equals(exists(':AirlineRefresh'), 2) + End + + It should have a extensions command + Assert Equals(exists(':AirlineExtensions'), 2) + End + +End diff --git a/_vim/.vim/plugged/vim-airline/test/extensions_default.vimspec b/_vim/.vim/plugged/vim-airline/test/extensions_default.vimspec new file mode 100644 index 0000000..6fc5aeb --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/extensions_default.vimspec @@ -0,0 +1,47 @@ +Describe extensions_default.vim + Before + let g:airline#extensions#default#layout = [ + \ [ 'c', 'a', 'b', 'warning' ], + \ [ 'x', 'z', 'y' ] + \ ] + + let s:builder = airline#builder#new({'active': 1}) + End + + It should use the layout airline_a_to_airline_b + call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) + let stl = s:builder.build() + Assert Match(stl, 'airline_c_to_airline_a') + end + + It should use the layout airline_a_to_airline_b + call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) + let stl = s:builder.build() + Assert Match(stl, 'airline_a_to_airline_b') + End + + It should use the layout airline_b_to_airline_warning + call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) + let stl = s:builder.build() + Assert Match(stl, 'airline_b_to_airline_warning') + end + + it should use the layout airline_x_to_airline_z + call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) + let stl = s:builder.build() + Assert Match(stl, 'airline_x_to_airline_z') + end + + it should use the layout airline_z_to_airline_y + call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) + let stl = s:builder.build() + Assert Match(stl, 'airline_z_to_airline_y') + end + + it should only render warning section in active splits + wincmd s + Assert Match(airline#statusline(1), 'warning') + Assert NotMatch(airline#statusline(2), 'warning') + wincmd c + end +end diff --git a/_vim/.vim/plugged/vim-airline/test/extensions_tabline.vimspec b/_vim/.vim/plugged/vim-airline/test/extensions_tabline.vimspec new file mode 100644 index 0000000..36a6bc4 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/extensions_tabline.vimspec @@ -0,0 +1,14 @@ +Describe extensions_tabline.vim + + It should use a tabline + e! file1 + Assert Match(airline#extensions#tabline#get(), '%#airline_tabsel# %(%{airline#extensions#tabline#get_buffer_name(\d)}%) |%=%#airline_tabfill_to_airline_tabfill#%#airline_tabfill# buffers' ) + End + + It Trigger on BufDelete autocommands + e! file1 + sp file2 + bd + Assert Match(airline#extensions#tabline#get(), '%#airline_tabsel# %(%{airline#extensions#tabline#get_buffer_name(\d)}%) |%=%#airline_tabfill_to_airline_tabfill#%#airline_tabfill# buffers' ) + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/highlighter.vimspec b/_vim/.vim/plugged/vim-airline/test/highlighter.vimspec new file mode 100644 index 0000000..83773a8 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/highlighter.vimspec @@ -0,0 +1,28 @@ +Describe highlighter.vim + It should create separator highlight groups + hi highlighter1 ctermfg=1 ctermbg=2 + hi highlighter2 ctermfg=3 ctermbg=4 + call airline#highlighter#add_separator('highlighter1', 'highlighter2', 0) + let hl = airline#highlighter#get_highlight('highlighter1_to_highlighter2') + Assert Equal([ 'NONE', 'NONE', '4', '2', '' ], hl) + End + + if exists("+termguicolors") + It should create separator highlight groups with termguicolors + set termguicolors + hi highlighter1 guifg=#cd0000 guibg=#00cd00 ctermfg=1 ctermbg=2 + hi highlighter2 guifg=#cdcd00 guibg=#0000ee ctermfg=3 ctermbg=4 + call airline#highlighter#add_separator('highlighter1', 'highlighter2', 0) + let hl = airline#highlighter#get_highlight('highlighter1_to_highlighter2') + Assert Equal(['#0000ee', '#00cd00', '4', '2', '' ], hl) + End + endif + + It should populate accent colors + Assert False(exists('g:airline#themes#dark#palette.normal.airline_c_red')) + call airline#themes#patch(g:airline#themes#dark#palette) + call airline#highlighter#add_accent('red') + call airline#highlighter#highlight(['normal']) + Assert NotEqual(0, hlID('airline_c_red')) + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/init.vimspec b/_vim/.vim/plugged/vim-airline/test/init.vimspec new file mode 100644 index 0000000..4b111d6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/init.vimspec @@ -0,0 +1,109 @@ +Describe init.vim + function! s:clear() + for key in s:sections + unlet! g:airline_section_{key} + endfor + endfunction + + let s:sections = ['a', 'b', 'c', 'gutter', 'x', 'y', 'z', 'warning'] + call airline#init#bootstrap() + + Before each + call s:clear() + call airline#init#sections() + End + + It section a should have mode, paste, spell, iminsert + Assert Match(g:airline_section_a, 'mode') + Assert Match(g:airline_section_a, 'paste') + Assert Match(g:airline_section_a, 'spell') + Assert Match(g:airline_section_a, 'iminsert') + End + + It section b should be blank because no extensions are installed + Assert Equals(g:airline_section_b, '') + End + + It section c should be file and coc_status + set noautochdir + call airline#init#sections() + Assert Equals(g:airline_section_c, '%<%f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#%#__accent_bold#%#__restore__#%#__accent_bold#%#__restore__#') + End + + It section c should be path and coc_status + set autochdir + call s:clear() + call airline#init#sections() + Assert Equals(g:airline_section_c, '%<%F%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#%#__accent_bold#%#__restore__#%#__accent_bold#%#__restore__#') + End + + It section x should be filetype + Assert Equals(g:airline_section_x, '%#__accent_bold#%#__restore__#%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#prepend("",0)}%{airline#util#wrap(airline#parts#filetype(),0)}') + End + + It section y should be fenc and ff + Assert Equals(g:airline_section_y, '%{airline#util#wrap(airline#parts#ffenc(),0)}') + End + + It section z should be line numbers + Assert Match(g:airline_section_z, '%p%%') + Assert Match(g:airline_section_z, '%l') + Assert Match(g:airline_section_z, '%v') + End + + It section gutter should be blank unless csv extension is installed + " Note: the csv extension uses only the window local variable + Assert Equals(g:airline_section_gutter, '%=') + End + + It section warning should be blank + Assert Match(g:airline_section_warning, '') + End + + It should not redefine sections already defined + for s in s:sections + let g:airline_section_{s} = s + endfor + call airline#init#bootstrap() + for s in s:sections + Assert Equals(g:airline_section_{s}, s) + endfor + End + + It all default statusline extensions should be blank + Assert Equals(airline#parts#get('ale_error_count').raw, '') + Assert Equals(airline#parts#get('ale_warning_count').raw, '') + Assert Equals(airline#parts#get('lsp_error_count').raw, '') + Assert Equals(airline#parts#get('lsp_warning_count').raw, '') + Assert Equals(airline#parts#get('nvimlsp_error_count').raw, '') + Assert Equals(airline#parts#get('nvimlsp_warning_count').raw, '') + Assert Equals(airline#parts#get('hunks').raw, '') + Assert Equals(airline#parts#get('branch').raw, '') + Assert Equals(airline#parts#get('eclim').raw, '') + Assert Equals(airline#parts#get('neomake_error_count').raw, '') + Assert Equals(airline#parts#get('neomake_warning_count').raw, '') + Assert Equals(airline#parts#get('obsession').raw, '') + Assert Equals(airline#parts#get('syntastic-err').raw, '') + Assert Equals(airline#parts#get('syntastic-warn').raw, '') + Assert Equals(airline#parts#get('tagbar').raw , '') + Assert Equals(airline#parts#get('whitespace').raw, '') + Assert Equals(airline#parts#get('windowswap').raw , '') + Assert Equals(airline#parts#get('ycm_error_count').raw, '') + Assert Equals(airline#parts#get('ycm_warning_count').raw, '') + Assert Equals(airline#parts#get('languageclient_error_count').raw, '') + Assert Equals(airline#parts#get('languageclient_warning_count').raw, '') + Assert Equals(airline#parts#get('coc_status').raw, '') + Assert Equals(airline#parts#get('coc_current_function').raw, '') + Assert Equals(airline#parts#get('vista').raw, '') + Assert Equals(airline#parts#get('coc_warning_count').raw, '') + Assert Equals(airline#parts#get('coc_error_count').raw, '') + Assert Equals(airline#parts#get('battery').raw, '') + End + + it should not redefine parts already defined + call airline#parts#define_raw('linenr', 'bar') + call s:clear() + call airline#init#sections() + Assert Match(g:airline_section_z, 'bar') + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/parts.vimspec b/_vim/.vim/plugged/vim-airline/test/parts.vimspec new file mode 100644 index 0000000..75a4dc6 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/parts.vimspec @@ -0,0 +1,58 @@ +Describe parts.vim + + It overwrItes existing values + call airline#parts#define('foo', { 'test': '123' }) + Assert Equals(airline#parts#get('foo').test, '123') + call airline#parts#define('foo', { 'test': '321' }) + Assert Equals(airline#parts#get('foo').test, '321') + End + + It can define a function part + call airline#parts#define_function('func', 'bar') + Assert Equals(airline#parts#get('func').function, 'bar') + End + + It can define a text part + call airline#parts#define_text('text', 'bar') + Assert Equals(airline#parts#get('text').text, 'bar') + End + + It can define a raw part + call airline#parts#define_raw('raw', 'bar') + Assert Equals(airline#parts#get('raw').raw, 'bar') + End + + It can define a minwidth + call airline#parts#define_minwidth('mw', 123) + Assert Equals(airline#parts#get('mw').minwidth, 123) + End + + It can define a condition + call airline#parts#define_condition('part', '1') + Assert Equals(airline#parts#get('part').condition, '1') + End + + It can define a accent + call airline#parts#define_accent('part', 'red') + Assert Equals(airline#parts#get('part').accent, 'red') + End + + It value should be blank + Assert Equals(airline#parts#filetype(), '') + End + + It can overwrIte a filetype + set ft=aaa + Assert Equals(airline#parts#filetype(), 'aaa') + End + + It can overwrite a filetype + "GItHub actions's vim's column is smaller than 90 + set ft=aaaa + if &columns >= 90 + Assert Equals(airline#parts#filetype(), 'aaaa') + else + Assert Equals(airline#parts#filetype(), 'aaa…') + endif + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/section.vimspec b/_vim/.vim/plugged/vim-airline/test/section.vimspec new file mode 100644 index 0000000..0a9fd6e --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/section.vimspec @@ -0,0 +1,77 @@ +Describe section + Before + call airline#parts#define_text('text', 'text') + call airline#parts#define_raw('raw', 'raw') + call airline#parts#define_function('func', 'SectionSpec') + End + + It should be able to reference default parts + let s = airline#section#create(['paste']) + Assert Equals(s, '%{airline#util#wrap(airline#parts#paste(),0)}') + End + + It should create sections wIth no separators + let s = airline#section#create(['text', 'raw', 'func']) + Assert Equals(s, '%{airline#util#wrap("text",0)}raw%{airline#util#wrap(SectionSpec(),0)}') + End + + It should create left sections with separators + let s = airline#section#create_left(['text', 'text']) + Assert Equals(s, '%{airline#util#wrap("text",0)}%{airline#util#append("text",0)}') + End + + It should create right sections wIth separators + let s = airline#section#create_right(['text', 'text']) + Assert Equals(s, '%{airline#util#prepend("text",0)}%{airline#util#wrap("text",0)}') + End + + It should prefix with accent group if provided and restore afterwards + call airline#parts#define('hi', { + \ 'raw': 'hello', + \ 'accent': 'red', + \ }) + let s = airline#section#create(['hi']) + Assert Equals(s, '%#__accent_red#hello%#__restore__#') + End + + It should accent functions + call airline#parts#define_function('hi', 'Hello') + call airline#parts#define_accent('hi', 'bold') + let s = airline#section#create(['hi']) + Assert Equals(s, '%#__accent_bold#%{airline#util#wrap(Hello(),0)}%#__restore__#') + End + + It should parse out a section from the distro + call airline#extensions#load() + let s = airline#section#create(['whitespace']) + Assert Match(s, 'airline#extensions#whitespace#check') + End + + It should use parts as is if they are not found + let s = airline#section#create(['asdf', 'func']) + Assert Equals(s, 'asdf%{airline#util#wrap(SectionSpec(),0)}') + End + + It should force add separators for raw and missing keys + let s = airline#section#create_left(['asdf', 'raw']) + Assert Equals(s, 'asdf raw') + let s = airline#section#create_left(['asdf', 'aaaa', 'raw']) + Assert Equals(s, 'asdf aaaa raw') + let s = airline#section#create_right(['raw', '%f']) + Assert Equals(s, 'raw %f') + let s = airline#section#create_right(['%t', 'asdf', '%{getcwd()}']) + Assert Equals(s, '%t asdf %{getcwd()}') + End + + It should empty out parts that do not pass their condition + call airline#parts#define_text('conditional', 'conditional') + call airline#parts#define_condition('conditional', '0') + let s = airline#section#create(['conditional']) + Assert Equals(s, '%{0 ? airline#util#wrap("conditional",0) : ""}') + End + + It should not draw two separators after another + let s = airline#section#create_right(['ffenc','%{strftime("%H:%M")}']) + Assert Equals(s, '%{airline#util#prepend(airline#parts#ffenc(),0)}%{strftime("%H:%M")}') + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/themes.vimspec b/_vim/.vim/plugged/vim-airline/test/themes.vimspec new file mode 100644 index 0000000..2a3cfab --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/themes.vimspec @@ -0,0 +1,91 @@ +Describe themes.vim + After each + highlight clear Foo + highlight clear Normal + End + + It should extract correct colors + call airline#highlighter#reset_hlcache() + highlight Foo ctermfg=1 ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Assert Equals(colors[0], 'NONE') + Assert Equals(colors[1], 'NONE') + Assert Equals(colors[2], '1') + Assert Equals(colors[3], '2') + End + + if exists("+termguicolors") + It should extract correct colors with termguicolors + call airline#highlighter#reset_hlcache() + set termguicolors + highlight Foo guifg=#cd0000 guibg=#00cd00 ctermfg=1 ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Assert Equals(colors[0], '#cd0000') + Assert Equals(colors[1], '#00cd00') + Assert Equals(colors[2], '1') + Assert Equals(colors[3], '2') + End + endif + + It should extract from normal if colors unavailable + call airline#highlighter#reset_hlcache() + highlight Normal ctermfg=100 ctermbg=200 + highlight Foo ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Assert Equals(colors[0], 'NONE') + Assert Equals(colors[1], 'NONE') + Assert Equals(colors[2], '100') + Assert Equals(colors[3], '2') + End + + It should flip target group if It is reversed + call airline#highlighter#reset_hlcache() + highlight Foo ctermbg=222 ctermfg=103 cterm=reverse + let colors = airline#themes#get_highlight('Foo') + Assert Equals(colors[0], 'NONE') + Assert Equals(colors[1], 'NONE') + Assert Equals(colors[2], '222') + Assert Equals(colors[3], '103') + End + + It should pass args through correctly + call airline#highlighter#reset_hlcache() + hi clear Normal + let hl = airline#themes#get_highlight('Foo', 'bold', 'italic') + Assert Equals(hl, ['NONE', 'NONE', 'NONE', 'NONE', 'bold,italic']) + + let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold') + Assert Equals(hl, ['NONE', 'NONE', 'NONE', 'NONE', 'italic,bold']) + End + + It should generate color map with mirroring + let map = airline#themes#generate_color_map( + \ [ 1, 1, 1, 1, '1' ], + \ [ 2, 2, 2, 2, '2' ], + \ [ 3, 3, 3, 3, '3' ], + \ ) + Assert Equals(map.airline_a[0], 1) + Assert Equals(map.airline_b[0], 2) + Assert Equals(map.airline_c[0], 3) + Assert Equals(map.airline_x[0], 3) + Assert Equals(map.airline_y[0], 2) + Assert Equals(map.airline_z[0], 1) + End + + It should generate color map with full set of colors + let map = airline#themes#generate_color_map( + \ [ 1, 1, 1, 1, '1' ], + \ [ 2, 2, 2, 2, '2' ], + \ [ 3, 3, 3, 3, '3' ], + \ [ 4, 4, 4, 4, '4' ], + \ [ 5, 5, 5, 5, '5' ], + \ [ 6, 6, 6, 6, '6' ], + \ ) + Assert Equals(map.airline_a[0], 1) + Assert Equals(map.airline_b[0], 2) + Assert Equals(map.airline_c[0], 3) + Assert Equals(map.airline_x[0], 4) + Assert Equals(map.airline_y[0], 5) + Assert Equals(map.airline_z[0], 6) + End +End diff --git a/_vim/.vim/plugged/vim-airline/test/util.vimspec b/_vim/.vim/plugged/vim-airline/test/util.vimspec new file mode 100644 index 0000000..56679c3 --- /dev/null +++ b/_vim/.vim/plugged/vim-airline/test/util.vimspec @@ -0,0 +1,69 @@ +call airline#init#bootstrap() + +function! Util1() + let g:count += 1 +endfunction + +function! Util2() + let g:count += 2 +endfunction + +function! Util3(...) + let g:count = a:0 +endfunction + +Describe util + Before each + let g:count = 0 + End + + It has append wrapper function + Assert Equals(airline#util#append('', 0), '') + Assert Equals(airline#util#append('1', 0), ' 1') + End + + It should be same &columns + let g:airline_statusline_ontop = 1 + Assert Equals(airline#util#winwidth(), &columns) + End + + It should be same winwidth(0) + let g:airline_statusline_ontop = 0 + Assert Equals(airline#util#winwidth(), winwidth(0)) + End + + It should be same winwidth(30) + Assert Equals(airline#util#winwidth(30, 0), winwidth(30)) + End + + It has prepend wrapper function + Assert Equals(airline#util#prepend('', 0), '') + Assert Equals(airline#util#prepend('1', 0), '1 ') + End + + It has getwinvar function + Assert Equals(airline#util#getwinvar(1, 'asdf', '123'), '123') + call setwinvar(1, 'vspec', 'is cool') + Assert Equals(airline#util#getwinvar(1, 'vspec', ''), 'is cool') + End + + It has exec funcrefs helper functions + call airline#util#exec_funcrefs([function('Util1'), function('Util2')]) + Assert Equals(g:count, 3) + + call airline#util#exec_funcrefs([function('Util3')], 1, 2, 3, 4) + Assert Equals(g:count, 4) + End + + It should ignore minwidth if less than 0 + Assert Equals(airline#util#append('foo', -1), ' foo') + Assert Equals(airline#util#prepend('foo', -1), 'foo ') + Assert Equals(airline#util#wrap('foo', -1), 'foo') + End + + It should return empty if winwidth() > minwidth + Assert Equals(airline#util#append('foo', 99999), '') + Assert Equals(airline#util#prepend('foo', 99999), '') + Assert Equals(airline#util#wrap('foo', 99999), '') + End +End diff --git a/_vim/.vim/plugged/vim-commentary/plugin/commentary.vim b/_vim/.vim/plugged/vim-commentary/plugin/commentary.vim index 17c285b..da850a3 100644 --- a/_vim/.vim/plugged/vim-commentary/plugin/commentary.vim +++ b/_vim/.vim/plugged/vim-commentary/plugin/commentary.vim @@ -3,7 +3,7 @@ " Version: 1.3 " GetLatestVimScripts: 3695 1 :AutoInstall: commentary.vim -if exists("g:loaded_commentary") || v:version < 700 +if exists("g:loaded_commentary") || v:version < 703 finish endif let g:loaded_commentary = 1 @@ -36,6 +36,7 @@ function! s:go(...) abort let [l, r] = s:surroundings() let uncomment = 2 + let force_uncomment = a:0 > 2 && a:3 for lnum in range(lnum1,lnum2) let line = matchstr(getline(lnum),'\S.*\s\@ 2 && l.r !~# '\\' @@ -57,13 +59,18 @@ function! s:go(...) abort \'\M' . substitute(l, '\ze\S\s*$', '\\zs\\d\\*\\ze', '') . '\|' . substitute(r, '\S\zs', '\\zs\\d\\*\\ze', ''), \'\=substitute(submatch(0)+1-uncomment,"^0$\\|^-\\d*$","","")','g') endif - if uncomment + if force_uncomment + if line =~ '^\s*' . l + let line = substitute(line,'\S.*\s\@,) +command! -range -bar -bang Commentary call s:go(,,0) xnoremap Commentary go() nnoremap Commentary go() nnoremap CommentaryLine go() . '_' @@ -108,9 +115,6 @@ if !hasmapto('Commentary') || maparg('gc','n') ==# '' nmap gc Commentary omap gc Commentary nmap gcc CommentaryLine - if maparg('c','n') ==# '' && !exists('v:operator') - nmap cgc ChangeCommentary - endif nmap gcu CommentaryCommentary endif diff --git a/_vim/.vim/plugged/vim-fugitive/README.markdown b/_vim/.vim/plugged/vim-fugitive/README.markdown index dd3bcc9..3dc4e6c 100644 --- a/_vim/.vim/plugged/vim-fugitive/README.markdown +++ b/_vim/.vim/plugged/vim-fugitive/README.markdown @@ -36,11 +36,11 @@ Additional commands are provided for higher level operations: * View any blob, tree, commit, or tag in the repository with `:Gedit` (and `:Gsplit`, etc.). For example, `:Gedit HEAD~3:%` loads the current file as it existed 3 commits ago. -* `:Gdiffsplit` brings up the staged version of the file side by side with the - working tree version. Use Vim's diff handling capabilities to apply changes - to the staged version, and write that buffer to stage the changes. You can - also give an arbitrary `:Gedit` argument to diff against older versions of - the file. +* `:Gdiffsplit` (or `:Gvdiffsplit`) brings up the staged version of the file + side by side with the working tree version. Use Vim's diff handling + capabilities to apply changes to the staged version, and write that buffer + to stage the changes. You can also give an arbitrary `:Gedit` argument to + diff against older versions of the file. * `:Gread` is a variant of `git checkout -- filename` that operates on the buffer rather than the file itself. This means you can use `u` to undo it and you never get any warnings about the file changing outside Vim. @@ -58,8 +58,9 @@ Additional commands are provided for higher level operations: hosting provider, with optional line range (try it in visual mode). Plugins are available for popular providers such as [GitHub][rhubarb.vim], [GitLab][fugitive-gitlab.vim], [Bitbucket][fubitive.vim], - [Gitee][fugitive-gitee.vim], [Pagure][pagure], and - [Phabricator][vim-phabricator]. + [Gitee][fugitive-gitee.vim], [Pagure][pagure], + [Phabricator][vim-phabricator], [Azure DevOps][fugitive-azure-devops.vim], + and [sourcehut][srht.vim]. [rhubarb.vim]: https://github.com/tpope/vim-rhubarb [fugitive-gitlab.vim]: https://github.com/shumphrey/fugitive-gitlab.vim @@ -67,6 +68,8 @@ Additional commands are provided for higher level operations: [fugitive-gitee.vim]: https://github.com/linuxsuren/fugitive-gitee.vim [pagure]: https://github.com/FrostyX/vim-fugitive-pagure [vim-phabricator]: https://github.com/jparise/vim-phabricator +[fugitive-azure-devops.vim]: https://github.com/cedarbaum/fugitive-azure-devops.vim +[srht.vim]: https://git.sr.ht/~willdurand/srht.vim Add `%{FugitiveStatusline()}` to `'statusline'` to get an indicator with the current branch in your statusline. @@ -83,7 +86,8 @@ For more information, see `:help fugitive`. ## Installation -Install using your favorite package manager, or use Vim's built-in package support: +Install using your favorite package manager, or use Vim's built-in package +support: mkdir -p ~/.vim/pack/tpope/start cd ~/.vim/pack/tpope/start @@ -92,19 +96,31 @@ Install using your favorite package manager, or use Vim's built-in package suppo ## FAQ -> Why can't I enter my password when I `:Git push`? +> What happened to the dispatch.vim backed asynchronous `:Gpush` and +> `:Gfetch`? -It is highly recommended to use SSH keys or [credentials caching][] to avoid -entering your password on every upstream interaction. If this isn't an -option, the official solution is to use the `core.askPass` Git option to -request the password via a GUI. Fugitive will configure this for you -automatically if you have `ssh-askpass` or `git-gui` installed; otherwise it's -your responsibility to set this up. +This behavior was divisive, confusing, and complicated inputting passwords, so +it was removed. Use `:Git! push` to use Fugitive's own asynchronous +execution, or retroactively make `:Git push` asynchronous by pressing +`CTRL-D`. -If you absolutely must type in your password by hand, sidestep Fugitive and -use `:terminal git push`. +> Why am I getting `core.worktree is required when using an external Git dir`? -[credentials caching]: https://help.github.com/en/articles/caching-your-github-password-in-git +Git generally sets `core.worktree` for you automatically when necessary, but +if you're doing something weird, or using a third-party tool that does +something weird, you may need to set it manually: + + git config core.worktree "$PWD" + +This may be necessary even when simple `git` commands seem to work fine +without it. + +> So I have a symlink and... + +Stop. Just stop. If Git won't deal with your symlink, then Fugitive won't +either. Consider using a [plugin that resolves +symlinks](https://github.com/aymericbeaumet/symlink.vim), or even better, +using fewer symlinks. ## Self-Promotion diff --git a/_vim/.vim/plugged/vim-fugitive/autoload/fugitive.vim b/_vim/.vim/plugged/vim-fugitive/autoload/fugitive.vim index 98dc8f3..f3746f6 100644 --- a/_vim/.vim/plugged/vim-fugitive/autoload/fugitive.vim +++ b/_vim/.vim/plugged/vim-fugitive/autoload/fugitive.vim @@ -1,17 +1,14 @@ " Location: autoload/fugitive.vim " Maintainer: Tim Pope +" The functions contained within this file are for internal use only. For the +" official API, see the commented functions in plugin/fugitive.vim. + if exists('g:autoloaded_fugitive') finish endif let g:autoloaded_fugitive = 1 -if !exists('g:fugitive_git_executable') - let g:fugitive_git_executable = 'git' -elseif g:fugitive_git_executable =~# '^\w\+=' - let g:fugitive_git_executable = 'env ' . g:fugitive_git_executable -endif - " Section: Utility function! s:function(name) abort @@ -41,13 +38,21 @@ function! s:Uniq(list) abort return a:list endfunction +function! s:JoinChomp(list) abort + if empty(a:list[-1]) + return join(a:list[0:-2], "\n") + else + return join(a:list, "\n") + endif +endfunction + function! s:winshell() abort return has('win32') && &shellcmdflag !~# '^-' endfunction function! s:WinShellEsc(arg) abort if type(a:arg) == type([]) - return join(map(copy(a:arg), 's:shellesc(v:val)')) + return join(map(copy(a:arg), 's:WinShellEsc(v:val)')) elseif a:arg =~# '^[A-Za-z0-9_/:.-]\+$' return a:arg else @@ -67,14 +72,31 @@ function! s:shellesc(arg) abort endif endfunction -let s:fnameescape = " \t\n*?[{`$\\%#'\"|!<" function! s:fnameescape(file) abort if type(a:file) == type([]) return join(map(copy(a:file), 's:fnameescape(v:val)')) - elseif exists('*fnameescape') + else return fnameescape(a:file) + endif +endfunction + +function! fugitive#UrlDecode(str) abort + return substitute(a:str, '%\(\x\x\)', '\=iconv(nr2char("0x".submatch(1)), "utf-8", "latin1")', 'g') +endfunction + +function! s:UrlEncode(str) abort + return substitute(a:str, '[%#?&;+=\<> [:cntrl:]]', '\=printf("%%%02X", char2nr(submatch(0)))', 'g') +endfunction + +function! s:PathUrlEncode(str) abort + return substitute(a:str, '[%#?[:cntrl:]]', '\=printf("%%%02X", char2nr(submatch(0)))', 'g') +endfunction + +function! s:PathJoin(prefix, str) abort + if a:prefix =~# '://' + return a:prefix . s:PathUrlEncode(a:str) else - return escape(a:file, s:fnameescape) + return a:prefix . a:str endif endfunction @@ -82,8 +104,32 @@ function! s:throw(string) abort throw 'fugitive: '.a:string endfunction +function! s:VersionCheck() abort + if v:version < 704 + return 'return ' . string('echoerr "fugitive: Vim 7.4 or newer required"') + elseif empty(fugitive#GitVersion()) + let exe = get(s:GitCmd(), 0, '') + if len(exe) && !executable(exe) + return 'return ' . string('echoerr "fugitive: cannot find ' . string(exe) . ' in PATH"') + endif + return 'return ' . string('echoerr "fugitive: cannot execute Git"') + elseif !fugitive#GitVersion(1, 8, 5) + return 'return ' . string('echoerr "fugitive: Git 1.8.5 or newer required"') + else + return '' + endif +endfunction + +let s:worktree_error = "core.worktree is required when using an external Git dir" function! s:DirCheck(...) abort - if !empty(a:0 ? s:Dir(a:1) : s:Dir()) + let vcheck = s:VersionCheck() + if !empty(vcheck) + return vcheck + endif + let dir = call('FugitiveGitDir', a:000) + if !empty(dir) && FugitiveWorkTree(dir, 1) is# 0 + return 'return ' . string('echoerr "fugitive: ' . s:worktree_error . '"') + elseif !empty(dir) return '' elseif empty(bufname('')) return 'return ' . string('echoerr "fugitive: working directory does not belong to a Git repository"') @@ -96,23 +142,65 @@ function! s:Mods(mods, ...) abort let mods = substitute(a:mods, '\C', '', '') let mods = mods =~# '\S$' ? mods . ' ' : mods if a:0 && mods !~# '\<\%(aboveleft\|belowright\|leftabove\|rightbelow\|topleft\|botright\|tab\)\>' - let mods = a:1 . ' ' . mods + if a:1 ==# 'Edge' + if mods =~# '\' ? &splitright : &splitbelow + let mods = 'botright ' . mods + else + let mods = 'topleft ' . mods + endif + else + let mods = a:1 . ' ' . mods + endif endif return substitute(mods, '\s\+', ' ', 'g') endfunction -function! s:Slash(path) abort - if exists('+shellslash') +if exists('+shellslash') + + let s:dir_commit_file = '\c^fugitive://\%(/[^/]\@=\)\=\(.\{-1,\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$' + + function! s:Slash(path) abort return tr(a:path, '\', '/') - else + endfunction + + function! s:VimSlash(path) abort + return tr(a:path, '\/', &shellslash ? '//' : '\\') + endfunction + +else + + let s:dir_commit_file = '\c^fugitive://\(.\{-\}\)//\%(\(\x\{40,\}\|[0-3]\)\(/.*\)\=\)\=$' + + function! s:Slash(path) abort + return a:path + endfunction + + function! s:VimSlash(path) abort return a:path + endfunction + +endif + +function! s:AbsoluteVimPath(...) abort + if a:0 && type(a:1) == type('') + let path = a:1 + else + let path = bufname(a:0 && a:1 > 0 ? a:1 : '') + if getbufvar(a:0 && a:1 > 0 ? a:1 : '', '&buftype') !~# '^\%(nowrite\|acwrite\)\=$' + return path + endif + endif + if s:Slash(path) =~# '^/\|^\a\+:' + return path + else + return getcwd() . matchstr(getcwd(), '[\\/]') . path endif endfunction function! s:Resolve(path) abort let path = resolve(a:path) if has('win32') - let path = FugitiveVimPath(fnamemodify(fnamemodify(path, ':h'), ':p') . fnamemodify(path, ':t')) + let path = s:VimSlash(fnamemodify(fnamemodify(path, ':h'), ':p') . fnamemodify(path, ':t')) endif return path endfunction @@ -124,13 +212,39 @@ endfunction function! s:cpath(path, ...) abort if s:FileIgnoreCase(0) - let path = FugitiveVimPath(tolower(a:path)) + let path = s:VimSlash(tolower(a:path)) else - let path = FugitiveVimPath(a:path) + let path = s:VimSlash(a:path) endif return a:0 ? path ==# s:cpath(a:1) : path endfunction +let s:quote_chars = { + \ "\007": 'a', "\010": 'b', "\011": 't', "\012": 'n', "\013": 'v', "\014": 'f', "\015": 'r', + \ '"': '"', '\': '\'} + +let s:unquote_chars = { + \ 'a': "\007", 'b': "\010", 't': "\011", 'n': "\012", 'v': "\013", 'f': "\014", 'r': "\015", + \ '"': '"', '\': '\'} + +function! s:Quote(string) abort + let string = substitute(a:string, "[\001-\037\"\\\177]", '\="\\" . get(s:quote_chars, submatch(0), printf("%03o", char2nr(submatch(0))))', 'g') + if string !=# a:string + return '"' . string . '"' + else + return string + endif +endfunction + +function! fugitive#Unquote(string) abort + let string = substitute(a:string, "\t*$", '', '') + if string =~# '^".*"$' + return substitute(string[1:-2], '\\\(\o\o\o\|.\)', '\=get(s:unquote_chars, submatch(1), iconv(nr2char("0" . submatch(1)), "utf-8", "latin1"))', 'g') + else + return string + endif +endfunction + let s:executables = {} function! s:executable(binary) abort @@ -146,66 +260,257 @@ endif function! s:TempScript(...) abort let body = join(a:000, "\n") if !has_key(s:temp_scripts, body) - let temp = tempname() . '.sh' + let s:temp_scripts[body] = tempname() . '.sh' + endif + let temp = s:temp_scripts[body] + if !filereadable(temp) call writefile(['#!/bin/sh'] + a:000, temp) - let s:temp_scripts[body] = temp endif - return FugitiveGitPath(s:temp_scripts[body]) + return FugitiveGitPath(temp) endfunction -function! s:DoAutocmd(cmd) abort - if v:version >= 704 || (v:version == 703 && has('patch442')) - return 'doautocmd ' . a:cmd - elseif &modelines > 0 - return 'try|set modelines=0|doautocmd ' . a:cmd . '|finally|set modelines=' . &modelines . '|endtry' - else - return 'doautocmd ' . a:cmd - endif +function! s:DoAutocmd(...) abort + return join(map(copy(a:000), "'doautocmd ' . v:val"), '|') endfunction -let s:nowait = v:version >= 704 ? '' : '' - function! s:Map(mode, lhs, rhs, ...) abort + let maps = [] + let defer = a:0 && a:1 =~# '' || get(g:, 'fugitive_defer_to_existing_maps') + let flags = substitute(a:0 ? a:1 : '', '', '', '') . (a:rhs =~# '' ? '' : '