From 3adcf542289a0883924ae9b9be8b898c36702c95 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 11 Jun 2023 07:54:59 -0400 Subject: Add some Vim plugins --- .../extensions/tabline/formatters/webdevicons.vim | 14 ++++ .../autoload/devicons/plugins/ctrlp.vim | 30 ++++++++ .../autoload/devicons/plugins/denite.vim | 10 +++ .../autoload/devicons/plugins/flagship.vim | 15 ++++ .../autoload/devicons/plugins/startify.vim | 6 ++ .../autoload/devicons/plugins/unite.vim | 37 ++++++++++ .../autoload/devicons/plugins/vimfiler.vim | 8 +++ .../autoload/vimfiler/columns/devicons.vim | 80 ++++++++++++++++++++++ 8 files changed, 200 insertions(+) create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/airline/extensions/tabline/formatters/webdevicons.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/ctrlp.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/denite.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/flagship.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/startify.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/unite.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/vimfiler.vim create mode 100644 .vim/pack/vendor/start/vim-devicons/autoload/vimfiler/columns/devicons.vim (limited to '.vim/pack/vendor/start/vim-devicons/autoload') diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/airline/extensions/tabline/formatters/webdevicons.vim b/.vim/pack/vendor/start/vim-devicons/autoload/airline/extensions/tabline/formatters/webdevicons.vim new file mode 100644 index 0000000..c298025 --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/airline/extensions/tabline/formatters/webdevicons.vim @@ -0,0 +1,14 @@ +" Version: 0.11.0 +" Webpage: https://github.com/ryanoasis/vim-devicons +" Maintainer: Ryan McIntyre +" License: see LICENSE + +function! airline#extensions#tabline#formatters#webdevicons#format(bufnr, buffers) abort + " Call original formatter. + let originalFormatter = airline#extensions#tabline#formatters#{g:_webdevicons_airline_orig_formatter}#format(a:bufnr, a:buffers) + return originalFormatter . g:WebDevIconsTabAirLineBeforeGlyphPadding . + \ WebDevIconsGetFileTypeSymbol(bufname(a:bufnr)) . g:WebDevIconsTabAirLineAfterGlyphPadding +endfunction + +" modeline syntax: +" vim: fdm=marker tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/ctrlp.vim b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/ctrlp.vim new file mode 100644 index 0000000..1ea4898 --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/ctrlp.vim @@ -0,0 +1,30 @@ +" Initialize for up to date ctrlp fork: ctrlpvim/ctrlp.vim +" Support for kien/ctrlp.vim deprecated since v0.7.0 +" @TODO implementation for CtrlP buffer and find file mode + +function! devicons#plugins#ctrlp#init() abort + let l:ctrlp_warning_message = 'vim-devicons: https://github.com/kien/ctrlp.vim is deprecated since v0.7.0, please use https://github.com/ctrlpvim/ctrlp.vim' + let l:ctrlp_warned_file = webdevicons#pluginHome() . '/status_warned_ctrlp' + + if exists('g:loaded_ctrlp') && g:webdevicons_enable_ctrlp + let l:forkedCtrlp = exists('g:ctrlp_mruf_map_string') + + if l:forkedCtrlp + if !exists('g:ctrlp_formatline_func') + " logic for ctrlpvim/ctrlp.vim: + let g:ctrlp_formatline_func = 's:formatline(s:curtype() == "buf" ? v:val : WebDevIconsGetFileTypeSymbol(v:val) . " " . v:val) ' + endif + elseif empty(glob(l:ctrlp_warned_file)) + " logic for kien/ctrlp.vim: + echohl WarningMsg | + \ echomsg l:ctrlp_warning_message + " only warn first time, do not warn again: + try + execute writefile(['File automatically generated after warning about CtrlP once', l:ctrlp_warning_message], l:ctrlp_warned_file) + catch + endtry + endif + endif +endfunction + +" vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/denite.vim b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/denite.vim new file mode 100644 index 0000000..5884644 --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/denite.vim @@ -0,0 +1,10 @@ +function! devicons#plugins#denite#init() abort + let s:denite_ver = (exists('*denite#get_status_mode') ? 2 : 3) + if s:denite_ver == 3 + call denite#custom#source('file,file/rec,file_mru,file/old,buffer,directory/rec,directory_mru', 'converters', ['devicons_denite_converter']) + else + call denite#custom#source('file,file_rec,file_mru,file_old,buffer,directory_rec,directory_mru', 'converters', ['devicons_denite_converter']) + endif +endfunction + +" vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/flagship.vim b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/flagship.vim new file mode 100644 index 0000000..f67103c --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/flagship.vim @@ -0,0 +1,15 @@ +function! devicons#plugins#flagship#init() abort + if g:webdevicons_enable_flagship_statusline + augroup webdevicons_flagship_filetype + autocmd User Flags call Hoist('buffer', 'WebDevIconsGetFileTypeSymbol') + augroup END + endif + + if g:webdevicons_enable_flagship_statusline_fileformat_symbols + augroup webdevicons_flagship_filesymbol + autocmd User Flags call Hoist('buffer', 'WebDevIconsGetFileFormatSymbol') + augroup END + endif +endfunction + +" vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/startify.vim b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/startify.vim new file mode 100644 index 0000000..f3c2d12 --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/startify.vim @@ -0,0 +1,6 @@ + +function! devicons#plugins#startify#init() abort + exec ":function! StartifyEntryFormat() abort \n return 'WebDevIconsGetFileTypeSymbol(absolute_path) .\" \". entry_path' \n endfunction" +endfunction + +" vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/unite.vim b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/unite.vim new file mode 100644 index 0000000..c40924a --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/unite.vim @@ -0,0 +1,37 @@ +function! devicons#plugins#unite#init() abort + let s:filters = { + \ 'name': 'devicons_unite_converter' + \ } + + function! s:filters.filter(candidates, context) abort + for candidate in a:candidates + + if has_key(candidate, 'action__buffer_nr') + let bufname = bufname(candidate.action__buffer_nr) + let filename = fnamemodify(bufname, ':p:t') + let path = fnamemodify(bufname, ':p:h') + elseif has_key(candidate, 'word') && has_key(candidate, 'action__path') + let path = candidate.action__path + let filename = candidate.word + endif + + let icon = WebDevIconsGetFileTypeSymbol(filename, isdirectory(filename)) + + " prevent filenames of buffers getting 'lost' + if filename != path + let path = printf('%s', filename) + endif + + " Customize output format. + let candidate.abbr = printf('%s %s', icon, path) + endfor + return a:candidates + endfunction + + call unite#define_filter(s:filters) + unlet s:filters + + call unite#custom#source('file,file_rec,buffer,file_rec/async,file_rec/neovim,file_rec/neovim2,file_rec/git', 'converters', 'devicons_unite_converter') +endfunction + +" vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/vimfiler.vim b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/vimfiler.vim new file mode 100644 index 0000000..62e6c3d --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/devicons/plugins/vimfiler.vim @@ -0,0 +1,8 @@ +function! devicons#plugins#vimfiler#init() abort + call vimfiler#custom#profile('default', 'context', { + \ 'columns': 'devicons:size:time', + \ 'explorer_columns': 'devicons' + \ }) +endfunction + +" vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab: diff --git a/.vim/pack/vendor/start/vim-devicons/autoload/vimfiler/columns/devicons.vim b/.vim/pack/vendor/start/vim-devicons/autoload/vimfiler/columns/devicons.vim new file mode 100644 index 0000000..d11ee22 --- /dev/null +++ b/.vim/pack/vendor/start/vim-devicons/autoload/vimfiler/columns/devicons.vim @@ -0,0 +1,80 @@ +"============================================================================= +" FILE: devicons.vim +" Version: 0.11.0 +" Webpage: https://github.com/ryanoasis/vim-devicons +" Maintainer: Ryan McIntyre +" License: 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. +" }}} +"============================================================================= + +let s:save_cpo = &cpo +set cpo&vim + +function! vimfiler#columns#devicons#define() abort + return s:column +endfunction + +let s:column = { + \ 'name' : 'devicons', + \ 'description' : 'get devicon glyph', + \ 'syntax' : 'vimfilerColumn__devicons', + \ } + +function! s:column.length(files, context) abort + return 3 +endfunction + +function! s:column.define_syntax(context) abort "{{{ + syntax match vimfilerColumn__TypeText '\[T\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeImage '\[I\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeArchive '\[A\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeExecute '\[X\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeMultimedia '\[M\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeDirectory '\[do\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeSystem '\[S\]' + \ contained containedin=vimfilerColumn__Type + syntax match vimfilerColumn__TypeLink '\[L\]' + \ contained containedin=vimfilerColumn__Type + + highlight def link vimfilerColumn__TypeText Constant + highlight def link vimfilerColumn__TypeImage Type + highlight def link vimfilerColumn__TypeArchive Special + highlight def link vimfilerColumn__TypeExecute Statement + highlight def link vimfilerColumn__TypeMultimedia Identifier + highlight def link vimfilerColumn__TypeDirectory Preproc + highlight def link vimfilerColumn__TypeSystem Comment + highlight def link vimfilerColumn__TypeLink Comment +endfunction"}}} + +function! s:column.get(file, context) abort + return WebDevIconsGetFileTypeSymbol(strpart(a:file.action__path, strridx(a:file.action__path, '/')), a:file.vimfiler__is_directory) +endfunction + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: foldmethod=marker -- cgit v1.2.3