diff --git a/my_configs.vim b/my_configs.vim index 67f8706a9d..ed1b176ade 100644 --- a/my_configs.vim +++ b/my_configs.vim @@ -7,3 +7,27 @@ nnoremap :let _s=@/:%s/\s\+$//e:let @/=_s " 1 tab == 2 spaces set shiftwidth=2 set tabstop=2 + +" Personal workflow tuning (keep upstream core untouched) +" ======================================================= + +" ALE: prioritize languages used most in maintenance/dev workflow +let g:ale_linters = { +\ 'bash': ['shellcheck'], +\ 'sh': ['shellcheck'], +\ 'c': ['clangd'], +\ 'cpp': ['clangd'], +\ 'python': ['flake8'] +\} + +" tmux-aware movement if vim-tmux-navigator is installed +if exists(':TmuxNavigateLeft') + nnoremap :TmuxNavigateLeft + nnoremap :TmuxNavigateDown + nnoremap :TmuxNavigateUp + nnoremap :TmuxNavigateRight +endif + +" Note: to stay merge-friendly with upstream vimrc, keep custom behavior in +" this file instead of modifying vimrcs/* core files. + diff --git a/sources_non_forked/bufexplorer/.gitignore b/sources_non_forked/bufexplorer/.gitignore deleted file mode 100644 index 0d0e68768d..0000000000 --- a/sources_non_forked/bufexplorer/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -# Ignore generated tags -/doc/tags -dist.bat -*.zip -tags -*.sw[a-p] - -# Github token. -github_token - diff --git a/sources_non_forked/bufexplorer/.goreleaser.yaml b/sources_non_forked/bufexplorer/.goreleaser.yaml deleted file mode 100644 index 4a1fa1cc64..0000000000 --- a/sources_non_forked/bufexplorer/.goreleaser.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com - -# The lines below are called `modelines`. See `:help modeline` -# Feel free to remove those if you don't want/need to use them. -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj - -#version: 1 - -env_files: - # GoReleaser requires an API token with the 'repo' scope selected to deploy - # the artifacts to GitHub. You can create one here - # https://github.com/settings/tokens/new. - github_token: ./github_token - -#before: -# hooks: -# # You may remove this if you don't use go modules. -# - go mod tidy -# # you may remove this if you don't need go generate -# - go generate ./... - -builds: - - skip: true - -archives: - - format: tar.gz - # this name template makes the OS and Arch compatible with the results of `uname`. - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} - # use zip for windows archives - format_overrides: - - goos: windows - format: zip - -checksum: - name_template: 'checksums.txt' - -snapshot: - name_template: '{{ .Tag }}-next' - -changelog: - use: github-native - sort: asc - -release: - draft: false - replace_existing_draft: true diff --git a/sources_non_forked/bufexplorer/LICENSE b/sources_non_forked/bufexplorer/LICENSE deleted file mode 100644 index 28d7bc4bd5..0000000000 --- a/sources_non_forked/bufexplorer/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2001-2013, Jeff Lanzarotta -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -* Neither the name of the {organization} nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sources_non_forked/bufexplorer/README.md b/sources_non_forked/bufexplorer/README.md deleted file mode 100644 index aa1fa658c3..0000000000 --- a/sources_non_forked/bufexplorer/README.md +++ /dev/null @@ -1,99 +0,0 @@ -bufexplorer -=========== - -BufExplorer Plugin for Vim - -With bufexplorer, you can quickly and easily switch between buffers by using the one of the default public interfaces: - -`\be` normal open - -`\bt` toggle open / close - -`\bs` force horizontal split open - -`\bv` force vertical split open - - -Once the bufexplorer window is open you can use the normal movement keys (hjkl) to move around and then use `` or `` to select the buffer you would like to open. If you would like to have the selected buffer opened in a new tab, simply press either `` or `t`. Please note that when opening a buffer in a tab, that if the buffer is already in another tab, bufexplorer can switch to that tab automatically for you if you would like. More about that in the supplied VIM help. - -Bufexplorer also offers various options including: -- Display the list of buffers in various sort orders including: - - Most Recently Used (MRU) which is the default - - Buffer number - - File name - - File extension - - Full file path name -- Delete buffer from list - -For more about options, sort orders, configuration options, etc. please see the supplied VIM help. - -## vim.org -This plugin can also be found at http://www.vim.org/scripts/script.php?script_id=42. - -## Installation -### Manually -1. If you do not want to use one of the the bundle handlers, you can take the - zip file from vim.org and unzip it and copy the plugin to your vimfiles\plugin - directory and the txt file to your vimfiles\doc directory. If you do that, - make sure you generate the help by executing - - `:helptag /doc` - - Once help tags have been generated, you can view the manual with - `:help bufexplorer`. - -### Vundle (https://github.com/gmarik/Vundle.vim) -1. Add the following configuration to your `.vimrc`. - - Plugin 'jlanzarotta/bufexplorer' - -2. Install with `:BundleInstall`. - -### NeoBundle (https://github.com/Shougo/neobundle.vim) -1. Add the following configuration to your `.vimrc`. - - NeoBundle 'jlanzarotta/bufexplorer' - -2. Install with `:NeoBundleInstall`. - -### Plug (https://github.com/junegunn/vim-plug) -1. Add the following configuration to your `.vimrc`. - - Plug 'jlanzarotta/bufexplorer' - -2. Install with `:PlugInstall`. - -### Pathogen -1. Install with the following command. - - git clone https://github.com/jlanzarotta/bufexplorer.git ~/.vim/bundle/bufexplorer.vim - -## License -Copyright (c) 2001-2023, Jeff Lanzarotta - -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -* Neither the name of the {organization} nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sources_non_forked/bufexplorer/doc/bufexplorer.txt b/sources_non_forked/bufexplorer/doc/bufexplorer.txt deleted file mode 100644 index 6f82611ea6..0000000000 --- a/sources_non_forked/bufexplorer/doc/bufexplorer.txt +++ /dev/null @@ -1,841 +0,0 @@ -*bufexplorer.txt* Buffer Explorer Last Change: 13 Aug 2024 - -Buffer Explorer *buffer-explorer* *bufexplorer* - Version 7.4.27 - -Plugin for easily exploring (or browsing) Vim|:buffers|. - -|bufexplorer-installation| Installation -|bufexplorer-usage| Usage -|bufexplorer-windowlayout| Window Layout -|bufexplorer-customization| Customization -|bufexplorer-changelog| Change Log -|bufexplorer-todo| Todo -|bufexplorer-credits| Credits -|bufexplorer-copyright| Copyright - -For Vim version 7.0 and above. -This plugin is only available if 'compatible' is not set. - -{Vi does not have any of this} - -============================================================================== -INSTALLATION *bufexplorer-installation* - -To install: - - Download the bufexplorer.zip from one of the following places: - https://github.com/jlanzarotta/bufexplorer - http://www.vim.org/scripts/script.php?script_id=42 - or use a package manager like Vundle. - - Extract the zip archive into your runtime directory. - The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt. - - Start Vim or goto an existing instance of Vim. - - Execute the following command: -> - :helptag /doc -< - This will generate all the help tags for any file located in the doc - directory. - -============================================================================== -USAGE *bufexplorer-usage* - -To start exploring in the current window, use: > - be or :BufExplorer or Your custom key mapping -To toggle bufexplorer on or off in the current window, use: > - bt or :ToggleBufExplorer or Your custom key mapping -To start exploring in a newly split horizontal window, use: > - bs or :BufExplorerHorizontalSplit or Your custom key mapping -To start exploring in a newly split vertical window, use: > - bv or :BufExplorerVerticalSplit or Your custom key mapping - -If you would like to use something other than the default leader key - '\' - -you may simply change the leader (see |mapleader|). - -When bs or bv is issued, bufexplorer opens in either a -horizontally or vertically split window. By issuing either of these commands, -the user is telling bufexplorer that they want to split the window and have -bufexplorer show the buffer they are about to select (from the bufexplorer -windows) in the newly split window. When be is issued, bufexplorer -opens the bufexplorer contents in the current window and the buffer the user -selects is opened in the current window. - -Note: If the current buffer is modified when bufexplorer started, the current - window is always split and the new bufexplorer is displayed in that new - window. - -Commands to use once exploring: - - Toggle help information. - Opens the buffer that is under the cursor into the current - window. - Opens the buffer that is under the cursor into the current - window. - Opens the buffer that is under the cursor in another tab. - a Toggles whether you are taken to the active window when - selecting a buffer or not. - b Fast buffer switching with b. - B Works in association with the |ShowTabBuffer| option. If - |ShowTabBuffer| is set to 1, this toggles if BufExplorer is to - only store the most recent tab for this buffer or not. - d |:delete| the buffer under the cursor from the list. The - buffer's 'buflisted' is cleared. This allows for the buffer to - be displayed again using the 'show unlisted' command. - D |:wipeout| the buffer under the cursor from the list. When a - buffer is wiped, it will not be shown when unlisted buffers are - displayed. - F Open selected buffer in another window above the current. - f Open selected buffer in another window below the current. - o Opens the buffer that is under the cursor into the current - window. - p Toggles the showing of a split filename/pathname. - q Exit/Close bufexplorer. - r Reverses the order the buffers are listed in. - R Toggles relative path/absolute path. - s Cycle thru how the buffers are listed. Either by buffer - number, file name, file extension, most recently used (MRU), or - full path. - S Cycle thru how the buffers are listed, in reverse order. - Either by buffer number, file name, file extension, most - recently used (MRU), or full path. - t Opens the buffer that is under the cursor in another tab. - T Toggles to show only buffers for this tab or not. - u Toggles the showing of "unlisted" buffers. - V Open the selected buffer in another window on the left of the current. - v Open the selected buffer in another window on the right of the current. - -Once invoked, Buffer Explorer displays a sorted list (MRU is the default -sort method) of all the buffers that are currently opened. You are then -able to move the cursor to the line containing the buffer's name you are -wanting to act upon. Once you have selected the buffer you would like, -you can then either open it, close it (delete), resort the list, reverse -the sort, quit exploring and so on... - -=============================================================================== -WINDOW LAYOUT *bufexplorer-windowlayout* - -------------------------------------------------------------------------------- -" Press for Help -" Sorted by mru | Locate buffer | Absolute Split path -"= - 1 %a bufexplorer.txt C:\Vim\vimfiles\doc line 87 - 2 # bufexplorer.vim c:\Vim\vimfiles\plugin line 1 -------------------------------------------------------------------------------- - | | | | | - | | | | +-- Current Line #. - | | | +-- Relative/Full Path - | | +-- Buffer Name. - | +-- Buffer Attributes. See |:buffers| for more information. - +-- Buffer Number. See |:buffers| for more information. - -=============================================================================== -CUSTOMIZATION *bufexplorer-customization* - -If you do not like the default key mappings of be, bs, and -bv, you can override bufexplorer's default mappings by setting up -something like the following in your vimrc file: - - nnoremap :BufExplorer - nnoremap :ToggleBufExplorer - nnoremap :BufExplorerHorizontalSplit - nnoremap :BufExplorerVerticalSplit - - *g:bufExplorerChgWin* -If set, bufexplorer will bring up the selected buffer in the window specified -by g:bufExplorerChgWin. - - *g:bufExplorerDefaultHelp* -To control whether the default help is displayed or not, use: > - let g:bufExplorerDefaultHelp=0 " Do not show default help. - let g:bufExplorerDefaultHelp=1 " Show default help. -The default is to show the default help. - - *g:bufExplorerDisableDefaultKeyMapping* -To control whether the default key mappings are enabled or not, use: > - let g:bufExplorerDisableDefaultKeyMapping=0 " Do not disable mapping. - let g:bufExplorerDisableDefaultKeyMapping=1 " Disable mapping. -The default is NOT to disable the default key mapping. - - *g:bufExplorerDetailedHelp* -To control whether detailed help is display by, use: > - let g:bufExplorerDetailedHelp=0 " Do not show detailed help. - let g:bufExplorerDetailedHelp=1 " Show detailed help. -The default is NOT to show detailed help. - - *g:bufExplorerFindActive* -To control whether you are taken to the active window when selecting a buffer, -use: > - let g:bufExplorerFindActive=0 " Do not go to active window. - let g:bufExplorerFindActive=1 " Go to active window. -The default is to be taken to the active window. - - *g:bufExplorerFuncRef* -When a buffer is selected, the functions specified either singly or as a list -will be called. - - *g:bufExplorerReverseSort* -To control whether to sort the buffer in reverse order or not, use: > - let g:bufExplorerReverseSort=0 " Do not sort in reverse order. - let g:bufExplorerReverseSort=1 " Sort in reverse order. -The default is NOT to sort in reverse order. - - *g:bufExplorerShowDirectories* -Directories usually show up in the list from using a command like ":e .". -To control whether to show directories in the buffer list or not, use: > - let g:bufExplorerShowDirectories=0 " Do not show directories. - let g:bufExplorerShowDirectories=1 " Show directories. -The default is to show directories. - - *g:bufExplorerShowNoName* -To control whether to show "No Name" buffers or not, use: > - let g:bufExplorerShowNoName=0 " Do not "No Name" buffers. - let g:bufExplorerShowNoName=1 " Show "No Name" buffers. -The default is to NOT show "No Name buffers. - - *g:bufExplorerShowRelativePath* -To control whether to show absolute paths or relative to the current -directory, use: > - let g:bufExplorerShowRelativePath=0 " Show absolute paths. - let g:bufExplorerShowRelativePath=1 " Show relative paths. -The default is to show absolute paths. - - *g:bufExplorerShowTabBuffer* -To control whether or not to show buffers on for the specific tab or not, use: > - let g:bufExplorerShowTabBuffer=0 " No. - let g:bufExplorerShowTabBuffer=1 " Yes. -The default is not to show. - - *g:bufExplorerShowUnlisted* -To control whether to show unlisted buffers or not, use: > - let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. - let g:bufExplorerShowUnlisted=1 " Show unlisted buffers. -The default is to NOT show unlisted buffers. - - *g:bufExplorerSortBy* -To control what field the buffers are sorted by, use: > - let g:bufExplorerSortBy='extension' " Sort by file extension. - let g:bufExplorerSortBy='fullpath' " Sort by full file path name. - let g:bufExplorerSortBy='mru' " Sort by most recently used. - let g:bufExplorerSortBy='name' " Sort by the buffer's name. - let g:bufExplorerSortBy='number' " Sort by the buffer's number. -The default is to sort by mru. - - *g:bufExplorerSplitBelow* -To control where the new split window will be placed above or below the -current window, use: > - let g:bufExplorerSplitBelow=1 " Split new window below current. - let g:bufExplorerSplitBelow=0 " Split new window above current. -The default is to use whatever is set by the global &splitbelow -variable. - - *g:bufExplorerSplitHorzSize* -To control the size of the new horizontal split window. use: > - let g:bufExplorerSplitHorzSize=n " New split window is n rows high. - let g:bufExplorerSplitHorzSize=0 " New split window size set by Vim. -The default is 0, so that the size is set by Vim. - - *g:bufExplorerSplitOutPathName* -To control whether to split out the path and file name or not, use: > - let g:bufExplorerSplitOutPathName=1 " Split the path and file name. - let g:bufExplorerSplitOutPathName=0 " Don't split the path and file - " name. -The default is to split the path and file name. - - *g:bufExplorerSplitRight* -To control where the new vsplit window will be placed to the left or right of -current window, use: > - let g:bufExplorerSplitRight=0 " Split left. - let g:bufExplorerSplitRight=1 " Split right. -The default is to use the global &splitright. - - *g:bufExplorerSplitVertSize* -To control the size of the new vertical split window, use: > - let g:bufExplorerSplitVertSize=n " New split window is n columns wide. - let g:bufExplorerSplitVertSize=0 " New split windows size set by Vim. -The default is 0, so that the size is set by Vim. - - *g:bufExplorerVersionWarn* -To control whether to warning about Vim version or not, use: > - let g:bufExplorerVersionWarn=1 " Warn if version conflict. - let g:bufExplorerVersionWarn=0 " Do not warn if version conflict. -The default is 1. - -=============================================================================== -CHANGE LOG *bufexplorer-changelog* - -7.4.27 May 30, 2024 - - Thanks to GitHub user NotNormallyAGitUser, for the recommendation to - change the display of the relative path to replace $HOME with "~". - This save valuable screen real estate. -7.4.26 May 01, 2023 - What's Changed - - wipe explorer buffer on hide by @basharh in - https://github.com/jlanzarotta/bufexplorer/pull/111 - New Contributors - - @basharh made their first contribution in - https://github.com/jlanzarotta/bufexplorer/pull/111 - Full Changelog - https://github.com/jlanzarotta/bufexplorer/compare/v.7.4.25...v7.4.26 -7.4.25 September 20, 2022 - What's Changed - - Fix MRU sort order after loading vim session by @mmrwoods in - https://github.com/jlanzarotta/bufexplorer/pull/107 - New Contributors - - @mmrwoods made their first contribution in - https://github.com/jlanzarotta/bufexplorer/pull/107 - Full Changelog - https://github.com/jlanzarotta/bufexplorer/compare/v7.4.24...v.7.4.25 -7.4.24 May 03, 2022 - Updated copyright notice. -7.4.23 January 23, 2022 - Merged in changes from benoit-pierre that fixes an error thrown when vim - is in read-only mode. - Merged in changes from tartansandal that implements the use of an - independent variable to track window splitting since s:splitMode != '' - no longer implies that a split was triggered. -7.4.22 January 5,2022 - - Merged in change from nadean that fixed an issue that if you use either - split mode, you could no longer use the regular non-split mode. This was - because the split mode set s:splitMode and that variable was never reset - to "" to allow you run without split mode. -7.4.21 December 8, 2018 - - Merged in changes from adelarsq that introduced ryanoasis/vim-devicons - support. If the global g:loaded_webdevicons has been set, bufexplorer - will now load the associated dev icons for each buffer. -7.4.20 January 18, 2017 - - Thanks to jpflouret for supplying code that can remove the warning - messages if you using this plugin on an older version of Vim. The - global variable is g:bufExplorerVersionWarn. -7.4.19 September 18, 2017 - - Merged all changes from github back into this version and tried to sync - to the correct version number. -7.4.18 - Github. -7.4.17 - Github. -7.4.16 August 14, 2017 - - Thanks to Yubo Su for the patch that adds 'f, F, V, and v' commands. - With this change, the original 'f' command was remapped to 'a'. - - The set of commands that can be used during exploring are: - F - Open selected buffer in another window above the current. - f - Open selected buffer in another window below the current. - V - Open the selected buffer in another window on the left of the - current. - v - Open the selected buffer in another window on the right of the - current. -7.4.15 May 01, 2017 - - Finally applied the patch submitted by justfalter. This patch is a - backward-compatible fix for the "invalid tab range" bug. -7.4.14 April 10, 2017 - - As suggested by adelarsq way back on January 5th, 2016, a filetype has - been added. There is now 'filetype=bufexplorer'. -7.4.13 March 08, 2017 - - Thanks to devakivamsi for pointing out that even though bufexplorer - turns off line numbers by default within its own window, this did not - work correctly when using WinManager. This has now been corrected. -7.4.12 September 30, 2016 - - Thanks again to Martin Vuille for several more fixes related to making - bufexplorer more tab-friendly. -7.4.11 September, 20, 2016 - - Thanks to Martin Vuille for reworking the per-tab buffer listing code. - Fix for g:bufExplorerShowTabBuffer is not working correctly and other - "gliches" when the ShotTabBuffer option is enabled. For example old - code would not correctly handle adding/deleting a tab that wasn't the - highest-numbered tab. -7.4.10 August 26, 2016 - - Thanks to buddylindsey for fixing a misspelling in the docs. -7.4.9 April 01, 2016 - - Thanks to ivegotasthma for supplying a patch to fix a major issue with - plugin performance when lots of buffers are open. - - Thanks to ershov for the patch to fix grouping of files in ambiguous - sort modes. - - Thanks to PhilRunninger for changing documentation to use , in - place of '\'. -7.4.8 January 27, 2015 - - Thanks to Marius Gedminas for fixing up the documentation and correcting - various typos. -7.4.7 January 20, 2015 - - Thanks goes out to Phil Runninger for added the ability to toggle the - bufexplorer list on and off using the :ToggleBufExplorer command, the - map bt, and the function ToggleBufExplorer(). -7.4.6 November 03, 2014 - - Not sure how, but the file format was converted to Dos instead of Unix. - I converted the file back to Unix. -7.4.5 October 24, 2014 - - Dr Michael Henry suggested to change all noremap commands to nnoremap. - Using noremap is unnecessarily broad and can cause problems, especially - for select mode. -7.4.4 August 19, 2014 - - Revert change where bufexplorer windows was closed even if the target - buffer has not been loaded yet. -7.4.3 August 13, 2014 - - Ivan Ukhov fixed issue with deleting the last window. This update also - fixes as well as another. If you have say, NERDtree open on the left - side and bufexplorer on the right, that bufexplorer would close NERDtree - erroneously thinking that it is closing itself. - - Radoslaw Burny fixed a few bugs that surfaced when bufexplorer is used - within winmanager. -7.4.2 October 22, 2013 - - Added global option g:bufExplorerDisableDefaultKeyMapping. This option - controls weather the default key mappings (\be, \bs, and \bv) are - enabled or not. See documentation for more information. -7.4.1 October 11, 2013 - - First update related to Vim 7.4. - - Changed license text. - - Fixed issue with 'hidden'. If 'hidden' is set, make sure that - g:bufExplorerFindActive is set to 0. Otherwise, when using \bs or \bv, - and selecting a buffer, the original buffer will be switched to instead - of being opened in the newly created windows. - - Added new 'b' mapping when the bufExplorer window is opened. When 'b' - is pressed, the user is prompted for the buffer number to switch to, and - is is then switched to when is pressed. This allows for somewhat - faster buffer switching instead of using the j and k keys or the mouse - to select the buffer to switch to. - - Removed 'set nolist' from the Initialize() function as well as the - restore of the 'list' setting in the CleanUp() function. These were - causing issues when multiple new files were opened from the command - line. Furthermore, there was really no reason, that I can remember, to - why the 'list' setting was saved, modified, and restored anyways. - - Fixed issue with WinManager integration code not working correctly - anymore. - - Brought back the xnoremap setup for the 'd' and 'D' keys. These were - removed for some reason after version 7.2.8. - - Thanks to all the contributors and testers. -7.3.6 May 06, 2013 - - Removed the 'drop' window command that was causing issue with the - argument-list being modified after the BufExplorer windows was - displayed. -7.3.5 February 08, 2013 - - Michael Henry added the ability to view "No Name" buffers. This - functionality was lost since version 7.3.0. He also did some removal of - "dead" code and cleaned up the code to handle filenames with embedded - '"'. -7.3.4 January 28, 2013 - - Thanks go out to John Szakmeister for finding and fixing a bug in the - RebuildBufferList method. The keepjumps line that clears the list could - potentially reference a backwards range. -7.3.3 January 14, 2013 - - Major cleanup and reorganization of the change log. - - We welcome the return of g:bufExplorerSplitHorzSize and - g:bufExplorerSplitVertSize. When setting these values, anything less - than or equal to 0 causes the split windows size to be determined by - Vim. If for example you want your new horizontal split window 10 rows - high, set g:bufExplorerSplitHorzSize = 10 in your .vimrc. Similar would - be done if wanting a vertical split except you would use the - g:bufExplorerSplitVertSize variable instead. -7.3.2 December 24, 2012 - - Thanks go out to Michael Henry for pointing out that I completely - missed yet another function, ReverseSortSelect(), during the - refactoring. This function has now returned. -7.3.1 December 06, 2012 - - Thanks go out to Brett Rasmussen for pointing out that the feature - added way back in version 7.2.3 by Yuriy Ershov to automatically - reposition the cursor to the line containing the active buffer, was - no longer in the plugin. That bit of code has been re-added and - all is well. -7.3.0 October 09, 2012 - - It has been quite a while since I published a new version and this - is the first version since Vim 7.3 was released. I have put some - time into reworking and cleaning up the code as well as various bug - fixes. Overall, I am hopeful that I not forgotten or lost a feature. - - Thanks to Tim Johnson for testing out this new version. - - I have hopefully allowed for better mapping of the main public - methods as is explained in the |bufexplorer-customization| section - of the documentation. - - Add new 'B', 'o', and 'S' key mappings. -7.2.8 November 08, 2010 - - Thanks to Charles Campbell for integrating bufexplorer with GDBMGR. - http://mysite.verizon.net/astronaut/vim/index.html#GDBMGR -7.2.7 April 26, 2010 - - My 1st attempt to fix the "cache" issue where buffers information - has changed but the cache/display does not reflect those changes. - More work still needs to be done. -7.2.6 February 12, 2010 - - Thanks to Michael Henry for pointing out that I totally forgot to - update the inline help to reflect the previous change to the 'd' - and 'D' keys. Opps! -7.2.5 February 10, 2010 - - Philip Morant suggested switching the command (bwipe) associated - with the 'd' key with the command (bdelete) associated with the 'D' - key. This made sense since the 'd' key is more likely to be used - compared to the 'D' key. -7.2.4 January 14, 2010 - - I did not implement the patch provided by Godefroid Chapelle - correctly. I missed one line which happened to be the most important - one :) -7.2.3 December 15, 2009 - - Hopefully I have not left anyone or anything out :) - - Thanks to David Fishburn for helping me out with a much needed - code overhaul as well as some awesome performance enhancements. - - David also reworked the handling of tabs. - - Thanks to Vladimir Dobriakov for making the suggestions on - enhancing the documentation to include a better explaination of - what is contained in the main bufexplorer window. - - Thanks to Yuriy Ershov for added code that when the bufexplorer - window is opened, the cursor is now positioned at the line with the - active buffer (useful in non-MRU sort modes). - - Yuriy also added the abiltiy to cycle through the sort fields in - reverse order. - - Thanks to Michael Henry for supplying a patch that allows - bufexplorer to be opened even when there is one buffer or less. - - Thanks to Godefroid Chapelle for supplying a patch that fixed - MRU sort order after loading a session. -7.2.2 November 19, 2008 - - Thanks to David L. Dight for spotting and fixing an issue when using - ctrl^. bufexplorer would incorrectly handle the previous buffer so - that when ctrl^ was pressed the incorrect file was opened. -7.2.1 September 03, 2008 - - Thanks to Dimitar for spotting and fixing a feature that was - inadvertently left out of the previous version. The feature was when - bufexplorer was used together with WinManager, you could use the tab - key to open a buffer in a split window. -7.2.0 August 15, 2008 - - For all those missing the \bs and \bv commands, these have now - returned. Thanks to Phil O'Connell for asking for the return of - these missing features and helping test out this version. - - Fixed problem with the bufExplorerFindActive code not working - correctly. - - Fixed an incompatibility between bufexplorer and netrw that caused - buffers to be incorrectly removed from the MRU list. -7.1.7 December 21, 2007 - - TaCahiroy fixed several issues related to opening a buffer in a tab. -7.1.6 December 01, 2007 - - Removed ff=unix from modeline in bufexplorer.txt. Found by Bill - McCarthy. -7.1.5 November 30, 2007 - - Could not open unnamed buffers. Fixed by TaCahiroy. -7.1.4 November 16, 2007 - - Sometimes when a file's path has 'white space' in it, extra buffers - would be created containing each piece of the path. i.e: - opening c:\document and settings\test.txt would create a buffer - named "and" and a buffer named "Documents". This was reported and - fixed by TaCa Yoss. -7.1.3 November 15, 2007 - - Added code to allow only one instance of the plugin to run at a time. - Thanks Dennis Hostetler. -7.1.2 November 07, 2007 - - Dave Larson added handling of tabs. - - Dave Larson removed \bs and \bv commands because these are easier for - the used to create horizontal and vertical windows. - - Fixed a jumplist issue spotted by JiangJun. I overlooked the - 'jumplist' and with a couple calls to 'keepjumps', everything is fine - again. - - Went back to using just a plugin file, instead of both an autoload - and plugin file. The splitting of the file caused issues with other - plugins. So if you have a prior version of bufexplorer that has an - autoload file, please remove autoload\bufexplorer and - plugin\bufexplorer before installing this new version. - - Fixed E493 error spotted by Thomas Arendsen Hein. - - Minor cosmetic changes. - - Minor help file changes. -7.1.1 August 02, 2007 - - A problem spotted by Thomas Arendsen Hein. When running Vim - (7.1.94), error E493 was being thrown. - * Added 'D' for 'delete' buffer as the 'd' command was a 'wipe' buffer. -7.1.0 August 01, 2007 - - Another 'major' update, some by Dave Larson, some by me. - - Making use of 'autoload' now to make the plugin load quicker. - - Removed '\bs' and '\bv'. These are now controlled by the user. The - user can issue a ':sp' or ':vs' to create a horizontal or vertical - split window and then issue a '\be' - - Added handling of tabs. -7.0.17 July 24, 2007 - - Fixed issue with 'drop' command. - - Various enhancements and improvements. -7.0.16 May 15, 2007 - - Fixed issue reported by Liu Jiaping on non Windows systems, which was - ... - Open file1, open file2, modify file1, open bufexplorer, you get the - following error: - - --------8<-------- - Error detected while processing function - 14_StartBufExplorer..14_SplitOpen: - line 4: - E37: No write since last change (add ! to override) - - But the worse thing is, when I want to save the current buffer and - type ':w', I get another error message: - E382: Cannot write, 'buftype' option is set - --------8<-------- - -7.0.15 April 27, 2007 - - Thanks to Mark Smithfield for suggesting bufexplorer needed to handle - the ':args' command. -7.0.14 March 23, 2007 - - Thanks to Randall Hansen for removing the requirement of terminal - versions to be recompiled with 'gui' support so the 'drop' command - would work. The 'drop' command is really not needed in terminal - versions. -7.0.13 February 23, 2007 - - Fixed integration with WinManager. - - Thanks to Dave Eggum for another update. - * Fix: The detailed help didn't display the mapping for toggling - the split type, even though the split type is displayed. - * Fixed incorrect description in the detailed help for toggling - relative or full paths. - * Deprecated s:ExtractBufferNbr(). Vim's str2nr() does the same - thing. - * Created a s:Set() function that sets a variable only if it hasn't - already been defined. It's useful for initializing all those - default settings. - * Removed checks for repetitive command definitions. They were - unnecessary. - * Made the help highlighting a little more fancy. - * Minor reverse compatibility issue: Changed ambiguous setting - names to be more descriptive of what they do (also makes the code - easier to follow): - Changed bufExplorerSortDirection to bufExplorerReverseSort - Changed bufExplorerSplitType to bufExplorerSplitVertical - Changed bufExplorerOpenMode to bufExplorerUseCurrentWindow - * When the BufExplorer window closes, all the file-local marks are - now deleted. This may have the benefit of cleaning up some of the - jumplist. - * Changed the name of the parameter for StartBufExplorer from - "split" to "open". The parameter is a string which specifies how - the buffer will be open, not if it is split or not. - * Deprecated DoAnyMoreBuffersExist() - it is a one line function - only used in one spot. - * Created four functions (SplitOpen(), RebuildBufferList(), - UpdateHelpStatus() and ReSortListing()) all with one purpose - to - reduce repeated code. - * Changed the name of AddHeader() to CreateHelp() to be more - descriptive of what it does. It now returns an array instead of - updating the window directly. This has the benefit of making the - code more efficient since the text the function returns is used a - little differently in the two places the function is called. - * Other minor simplifications. -7.0.12 November 30, 2006 - - MAJOR Update. This version will ONLY run with Vim version 7.0 or - greater. - - Dave Eggum has made some 'significant' updates to this latest - version: - * Added BufExplorerGetAltBuf() global function to be used in the - user's rulerformat. - * Added g:bufExplorerSplitRight option. - * Added g:bufExplorerShowRelativePath option with mapping. - * Added current line highlighting. - * The split type can now be changed whether bufexplorer is opened - in split mode or not. - * Various major and minor bug fixes and speed improvements. - * Sort by extension. - - Other improvements/changes: - * Changed the help key from '?' to to be more 'standard'. - * Fixed splitting of vertical bufexplorer window. - - Hopefully I have not forgot something :) -7.0.11 March 10, 2006 - - Fixed a couple of highlighting bugs, reported by David Eggum. - - Dave Eggum also changed passive voice to active on a couple of - warning messages. -7.0.10 March 02, 2006 - - Fixed bug report by Xiangjiang Ma. If the 'ssl' option is set, - the slash character used when displaying the path was incorrect. -7.0.9 February 28, 2006 - - Martin Grenfell found and eliminated an annoying bug in the - bufexplorer/winmanager integration. The bug was were an - annoying message would be displayed when a window was split or - a new file was opened in a new window. Thanks Martin! -7.0.8 January 18, 2006 - - Thanks to Mike Li for catching a bug in the WinManager integration. - The bug was related to the incorrect displaying of the buffer - explorer's window title. -7.0.7 December 19, 2005 - - Thanks to Jeremy Cowgar for adding a new enhancement. This - enhancement allows the user to press 'S', that is capital S, which - will open the buffer under the cursor in a newly created split - window. -7.0.6 November 18, 2005 - - Thanks to Larry Zhang for finding a bug in the "split" buffer code. - If you force set g:bufExplorerSplitType='v' in your vimrc, and if you - tried to do a \bs to split the bufexplorer window, it would always - split horizontal, not vertical. - - Larry Zhang also found that I had a typeo in that the variable - g:bufExplorerSplitVertSize was all lower case in the documentation - which was incorrect. -7.0.5 October 18, 2005 - - Thanks to Mun Johl for pointing out a bug that if a buffer was - modified, the '+' was not showing up correctly. -7.0.4 October 03, 2005 - - Fixed a problem discovered first by Xiangjiang Ma. Well since I've - been using vim 7.0 and not 6.3, I started using a function (getftype) - that is not in 6.3. So for backward compatibility, I conditionaly use - this function now. Thus, the g:bufExplorerShowDirectories feature is - only available when using vim 7.0 and above. -7.0.3 September 30, 2005 - - Thanks to Erwin Waterlander for finding a problem when the last - buffer was deleted. This issue got me to rewrite the buffer display - logic (which I've wanted to do for sometime now). - - Also great thanks to Dave Eggum for coming up with idea for - g:bufExplorerShowDirectories. Read the above information about this - feature. -7.0.2 March 25, 2005 - - Thanks to Thomas Arendsen Hein for finding a problem when a user - has the default help turned off and then brought up the explorer. An - E493 would be displayed. -7.0.1 March 10, 2005 - - Thanks to Erwin Waterlander for finding a couple problems. - The first problem allowed a modified buffer to be deleted. Opps! The - second problem occurred when several files were opened, BufExplorer - was started, the current buffer was deleted using the 'd' option, and - then BufExplorer was exited. The deleted buffer was still visible - while it is not in the buffers list. Opps again! -7.0.0 March 10, 205 - - Thanks to Shankar R. for suggesting to add the ability to set - the fixed width (g:bufExplorerSplitVertSize) of a new window - when opening bufexplorer vertically and fixed height - (g:bufExplorerSplitHorzSize) of a new window when opening - bufexplorer horizontally. By default, the windows are normally - split to use half the existing width or height. -6.3.0 July 23, 2004 - - Added keepjumps so that the jumps list would not get cluttered with - bufexplorer related stuff. -6.2.3 April 15, 2004 - - Thanks to Jay Logan for finding a bug in the vertical split position - of the code. When selecting that the window was to be split - vertically by doing a '\bv', from then on, all splits, i.e. '\bs', - were split vertically, even though g:bufExplorerSplitType was not set - to 'v'. -6.2.2 January 09, 2004 - - Thanks to Patrik Modesto for adding a small improvement. For some - reason his bufexplorer window was always showing up folded. He added - 'setlocal nofoldenable' and it was fixed. -6.2.1 October 09, 2003 - - Thanks goes out to Takashi Matsuo for added the 'fullPath' sorting - logic and option. -6.2.0 June 13, 2003 - - Thanks goes out to Simon Johann-Ganter for spotting and fixing a - problem in that the last search pattern is overridden by the search - pattern for blank lines. -6.1.6 May 05, 2003 - - Thanks to Artem Chuprina for finding a pesky bug that has been around - for sometime now. The key mapping was causing the buffer - explored to close prematurely when vim was run in an xterm. The - key mapping is now removed. -6.1.5 April 28, 2003 - - Thanks to Khorev Sergey. Added option to show default help or not. -6.1.4 March 18, 2003 - - Thanks goes out to Valery Kondakoff for suggesting the addition of - setlocal nonumber and foldcolumn=0. This allows for line numbering - and folding to be turned off temporarily while in the explorer. -6.1.3 March 11, 2003 - - Added folding. - - Did some code cleanup. - - Added the ability to force the newly split window to be temporarily - vertical, which was suggested by Thomas Glanzmann. -6.1.2 November 05, 2002 - - Now pressing the key will quit, just like 'q'. - - Added folds to hide winmanager configuration. - - If anyone had the 'C' option in their cpoptions they would receive - a E10 error on startup of BufExplorer. cpo is now saved, updated and - restored. Thanks to Charles E Campbell, Jr. - - Attempted to make sure there can only be one BufExplorer window open - at a time. -6.1.1 March 28, 2002 - - Thanks to Brian D. Goodwin for adding toupper to FileNameCmp. This - way buffers sorted by name will be in the correct order regardless of - case. -6.0.16 March 14, 2002 - - Thanks to Andre Pang for the original patch/idea to get bufexplorer - to work in insertmode/modeless mode (evim). - - Added Initialize and Cleanup autocommands to handle commands that - need to be performed when starting or leaving bufexplorer. -6.0.15 February 20, 2002 - - Srinath Avadhanulax added a patch for winmanager.vim. -6.0.14 February 19, 2002 - - Fix a few more bug that I thought I already had fixed. - - Thanks to Eric Bloodworth for adding 'Open Mode/Edit in Place'. - - Added vertical splitting. -6.0.13 February 05, 2002 - - Thanks to Charles E Campbell, Jr. for pointing out some embarrassing - typos that I had in the documentation. I guess I need to run the - spell checker more :o) -6.0.12 February 04, 2002 - - Thanks to Madoka Machitani, for the tip on adding the augroup command - around the MRUList autocommands. -6.0.11 January 26, 2002 - - Fixed bug report by Xiangjiang Ma. '"=' was being added to the search - history which messed up hlsearch. -6.0.10 January 14, 2002 - - Added the necessary hooks so that the Srinath Avadhanula's - winmanager.vim script could more easily integrate with this script. - - Tried to improve performance. -6.0.9 December 17, 2001 - - Added MRU (Most Recently Used) sort ordering. -6.0.8 December 03, 2001 - - Was not resetting the showcmd command correctly. - - Added nifty help file. -6.0.7 November 19, 2001 - - Thanks to Brett Carlane for some great enhancements. Some are added, - some are not, yet. Added highlighting of current and alternate - filenames. Added splitting of path/filename toggle. Reworked - ShowBuffers(). - - Changed my email address. -6.0.6 September 05, 2001 - - Copyright notice added. Needed this so that it could be distributed - with Debian Linux. - - Fixed problem with the SortListing() function failing when there was - only one buffer to display. -6.0.5 August 10, 2001 - - Fixed problems reported by David Pascoe, in that you where unable to - hit 'd' on a buffer that belonged to a files that no longer existed - and that the 'yank' buffer was being overridden by the help text when - the bufexplorer was opened. -6.0.4 July, 31, 2001 - - Thanks to Charles Campbell, Jr. for making this plugin more plugin - *compliant*, adding default keymappings of be and bs - as well as fixing the 'w:sortDirLabel not being defined' bug. -6.0.3 July 30, 2001 - - Added sorting capabilities. Sort taken from explorer.vim. -6.0.2 July 25, 2001 - - Can't remember. -6.0.1 Sometime before July 25, 2001 - - Initial release. - -=============================================================================== -TODO *bufexplorer-todo* - -- Add ability to open a buffer in a horizontal or vertical split after the - initial bufexplorer window is opened. - -=============================================================================== -CREDITS *bufexplorer-credits* - -Author: Jeff Lanzarotta - -Credit must go out to Bram Moolenaar (RIP) and all the Vim developers for -making the world's best editor (IMHO). I also want to thank everyone who -helped and gave me suggestions. I wouldn't want to leave anyone out so I -won't list names. - -=============================================================================== -COPYRIGHT *bufexplorer-copyright* - -Copyright (c) 2001-2024, Jeff Lanzarotta -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the {organization} nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -=============================================================================== -vim:tw=78:noet:wrap:ts=4:ft=help:norl: diff --git a/sources_non_forked/bufexplorer/how_to_release.txt b/sources_non_forked/bufexplorer/how_to_release.txt deleted file mode 100644 index f3f565d812..0000000000 --- a/sources_non_forked/bufexplorer/how_to_release.txt +++ /dev/null @@ -1,16 +0,0 @@ -https://goreleaser.com/quick-start/ - -To make a release... - -1. Make changes. -2. Commit and push changes. -3. git tag -a v7.4.27 -m "Release v7.4.27." -4. git push origin v7.4.27 -5. goreleaser release --clean -6. Go to github and make the release. - -If something happens and the tag is messed up, you will need to delete the -local and remote tag and release again. To delete the tag: - -1. git tag -d v7.4.27 -2. git push --delete origin v7.4.27 diff --git a/sources_non_forked/bufexplorer/plugin/bufexplorer.vim b/sources_non_forked/bufexplorer/plugin/bufexplorer.vim deleted file mode 100644 index f5a746131e..0000000000 --- a/sources_non_forked/bufexplorer/plugin/bufexplorer.vim +++ /dev/null @@ -1,1377 +0,0 @@ -"============================================================================ -" Copyright: Copyright (c) 2001-2024, Jeff Lanzarotta -" All rights reserved. -" -" Redistribution and use in source and binary forms, with or -" without modification, are permitted provided that the -" following conditions are met: -" -" * Redistributions of source code must retain the above -" copyright notice, this list of conditions and the following -" disclaimer. -" -" * Redistributions in binary form must reproduce the above -" copyright notice, this list of conditions and the following -" disclaimer in the documentation and/or other materials -" provided with the distribution. -" -" * Neither the name of the {organization} nor the names of its -" contributors may be used to endorse or promote products -" derived from this software without specific prior written -" permission. -" -" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -" CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -" CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -" Name Of File: bufexplorer.vim -" Description: Buffer Explorer Vim Plugin -" Maintainer: Jeff Lanzarotta (my name at gmail dot com) -" Last Changed: Tuesday, 13 August 2024 -" Version: See g:bufexplorer_version for version number. -" Usage: This file should reside in the plugin directory and be -" automatically sourced. -" -" You may use the default keymappings of -" -" be - Opens BufExplorer -" bt - Toggles BufExplorer open or closed -" bs - Opens horizontally split window BufExplorer -" bv - Opens vertically split window BufExplorer -" -" Or you can override the defaults and define your own mapping -" in your vimrc file, for example: -" -" nnoremap :BufExplorer -" nnoremap :ToggleBufExplorer -" nnoremap :BufExplorerHorizontalSplit -" nnoremap :BufExplorerVerticalSplit -" -" Or you can use -" -" ":BufExplorer" - Opens BufExplorer -" ":ToggleBufExplorer" - Opens/Closes BufExplorer -" ":BufExplorerHorizontalSplit" - Opens horizontally window BufExplorer -" ":BufExplorerVerticalSplit" - Opens vertically split window BufExplorer -" -" For more help see supplied documentation. -" History: See supplied documentation. -"============================================================================= - -" Exit quickly if already running or when 'compatible' is set. {{{1 -if exists("g:bufexplorer_version") || &cp - finish -endif -"1}}} - -" Version number -let g:bufexplorer_version = "7.4.27" - -" Plugin Code {{{1 -" Check for Vim version {{{2 -if !exists("g:bufExplorerVersionWarn") - let g:bufExplorerVersionWarn = 1 -endif - -if v:version < 700 - if g:bufExplorerVersionWarn - echohl WarningMsg - echo "Sorry, bufexplorer ".g:bufexplorer_version." required Vim 7.0 or greater." - echohl None - endif - finish -endif -" Check to see if the version of Vim has the correct patch applied, if not, do -" not used . -if v:version > 703 || v:version == 703 && has('patch1261') && has('patch1264') - " We are good to go. -else - if g:bufExplorerVersionWarn - echohl WarningMsg - echo "Sorry, bufexplorer ".g:bufexplorer_version." required Vim 7.3 or greater with patch1261 and patch1264." - echohl None - endif - finish -endif - -" Create commands {{{2 -command! BufExplorer :call BufExplorer() -command! ToggleBufExplorer :call ToggleBufExplorer() -command! BufExplorerHorizontalSplit :call BufExplorerHorizontalSplit() -command! BufExplorerVerticalSplit :call BufExplorerVerticalSplit() - -" Set {{{2 -function! s:Set(var, default) - if !exists(a:var) - if type(a:default) - execute "let" a:var "=" string(a:default) - else - execute "let" a:var "=" a:default - endif - - return 1 - endif - - return 0 -endfunction - -" Script variables {{{2 -let s:MRU_Exclude_List = ["[BufExplorer]","__MRU_Files__","[Buf\ List]"] -let s:MRUList = [] -let s:name = '[BufExplorer]' -let s:originBuffer = 0 -let s:running = 0 -let s:sort_by = ["number", "name", "fullpath", "mru", "extension"] -let s:splitMode = "" -let s:didSplit = 0 -let s:types = {"fullname": ':p', "path": ':p:h', "relativename": ':~:.', "relativepath": ':~:.:h', "shortname": ':t'} - -" Setup the autocommands that handle the MRUList and other stuff. {{{2 -autocmd VimEnter * call s:Setup() - -" Reset MRUList and buffer->tab associations after loading a session. {{{2 -autocmd SessionLoadPost * call s:Reset() - -" Setup {{{2 -function! s:Setup() - call s:Reset() - - " Now that the MRUList is created, add the other autocmds. - augroup BufExplorer - autocmd! - autocmd BufEnter,BufNew * call s:ActivateBuffer() - autocmd BufWipeOut * call s:DeactivateBuffer(1) - autocmd BufDelete * call s:DeactivateBuffer(0) - autocmd BufWinEnter \[BufExplorer\] call s:Initialize() - autocmd BufWinLeave \[BufExplorer\] call s:Cleanup() - augroup END -endfunction - -" Reset {{{2 -function! s:Reset() - " Build initial MRUList. This makes sure all the files specified on the - " command line are picked up correctly. Check buffers exist so this also - " works after wiping buffers and loading a session (e.g. sessionman.vim) - let s:MRUList = filter(range(1, bufnr('$')), 'bufexists(v:val)') - - " Initialize the association of buffers to tabs for any buffers - " that have been created prior to now, e.g., files specified as - " vim command line arguments - call s:CatalogBuffers() -endfunction - -" CatalogBuffers {{{2 -" Create tab associations for any existing buffers -function! s:CatalogBuffers() - let ct = tabpagenr() - - for tab in range(1, tabpagenr('$')) - silent execute 'normal! ' . tab . 'gt' - for buf in tabpagebuflist() - call s:UpdateTabBufData(buf) - endfor - endfor - - silent execute 'normal! ' . ct . 'gt' -endfunction - -" AssociatedTab {{{2 -" Return the number of the tab associated with the specified buffer. -" If the buffer is associated with more than one tab, the first one -" found is returned. If the buffer is not associated with any tabs, -" -1 is returned. -function! s:AssociatedTab(bufnr) - for tab in range(1, tabpagenr('$')) - let list = gettabvar(tab, 'bufexp_buf_list', []) - let idx = index(list, a:bufnr) - if idx != -1 - return tab - endif - endfor - - return -1 -endfunction - -" RemoveBufFromOtherTabs {{{2 -" Remove the specified buffer from the buffer lists of all tabs -" except the current tab. -function! s:RemoveBufFromOtherTabs(bufnr) - for tab in range(1, tabpagenr('$')) - if tab == tabpagenr() - continue - endif - - let list = gettabvar(tab, 'bufexp_buf_list', []) - let idx = index(list, a:bufnr) - if idx == -1 - continue - endif - - call remove(list, idx) - call settabvar(tab, 'bufexp_buf_list', list) - endfor -endfunction - -" AddBufToCurrentTab {{{2 -" Add the specified buffer to the list of buffers associated -" with the current tab -function! s:AddBufToCurrentTab(bufnr) - if index(t:bufexp_buf_list, a:bufnr) == -1 - call add(t:bufexp_buf_list, a:bufnr) - endif -endfunction - -" IsInCurrentTab {{{2 -" Returns whether the specified buffer is associated -" with the current tab -function! s:IsInCurrentTab(bufnr) - " It shouldn't happen that the list of buffers is - " not defined but if it does, play it safe and - " include the buffer - if !exists('t:bufexp_buf_list') - return 1 - endif - - return (index(t:bufexp_buf_list, a:bufnr) != -1) -endfunction - -" UpdateTabBufData {{{2 -" Update the tab buffer data for the specified buffer -" -" The current tab's list is updated. If a buffer is only -" allowed to be associated with one tab, it is removed -" from the lists of any other tabs with which it may have -" been associated. -" -" The associations between tabs and buffers are maintained -" in separate lists for each tab, which are stored in tab- -" specific variables 't:bufexp_buf_list'. -function! s:UpdateTabBufData(bufnr) - " The first time we add a tab, Vim uses the current buffer - " as its starting page even though we are about to edit a - " new page, and another BufEnter for the new page is triggered - " later. Use this first BufEnter to initialize the list of - " buffers, but don't add the buffer number to the list if - " it is already associated with another tab - " - " Unfortunately, this doesn't work right when the first - " buffer opened in the tab should be associated with it, - " such as when 'tab split +buffer N' is used - if !exists("t:bufexp_buf_list") - let t:bufexp_buf_list = [] - - if s:AssociatedTab(a:bufnr) != -1 - return - endif - endif - - call s:AddBufToCurrentTab(a:bufnr) - - if g:bufExplorerOnlyOneTab - call s:RemoveBufFromOtherTabs(a:bufnr) - endif -endfunction - -" ActivateBuffer {{{2 -function! s:ActivateBuffer() - let _bufnr = bufnr("%") - call s:UpdateTabBufData(_bufnr) - call s:MRUPush(_bufnr) -endfunction - -" DeactivateBuffer {{{2 -function! s:DeactivateBuffer(remove) - let _bufnr = str2nr(expand("")) - call s:MRUPop(_bufnr) -endfunction - -" MRUPop {{{2 -function! s:MRUPop(bufnr) - call filter(s:MRUList, 'v:val != '.a:bufnr) -endfunction - -" MRUPush {{{2 -function! s:MRUPush(buf) - " Skip temporary buffer with buftype set. Don't add the BufExplorer window - " to the list. - if s:ShouldIgnore(a:buf) == 1 - return - endif - - " Remove the buffer number from the list if it already exists. - call s:MRUPop(a:buf) - - " Add the buffer number to the head of the list. - call insert(s:MRUList, a:buf) -endfunction - -" ShouldIgnore {{{2 -function! s:ShouldIgnore(buf) - " Ignore temporary buffers with buftype set. - if empty(getbufvar(a:buf, "&buftype")) == 0 - return 1 - endif - - " Ignore buffers with no name. - if empty(bufname(a:buf)) == 1 - return 1 - endif - - " Ignore the BufExplorer buffer. - if fnamemodify(bufname(a:buf), ":t") == s:name - return 1 - endif - - " Ignore any buffers in the exclude list. - if index(s:MRU_Exclude_List, bufname(a:buf)) >= 0 - return 1 - endif - - " Else return 0 to indicate that the buffer was not ignored. - return 0 -endfunction - -" Initialize {{{2 -function! s:Initialize() - call s:SetLocalSettings() - let s:running = 1 -endfunction - -" Cleanup {{{2 -function! s:Cleanup() - if exists("s:_insertmode") - let &insertmode = s:_insertmode - endif - - if exists("s:_showcmd") - let &showcmd = s:_showcmd - endif - - if exists("s:_cpo") - let &cpo = s:_cpo - endif - - if exists("s:_report") - let &report = s:_report - endif - - let s:running = 0 - let s:splitMode = "" - let s:didSplit = 0 - - delmarks! -endfunction - -" SetLocalSettings {{{2 -function! s:SetLocalSettings() - let s:_insertmode = &insertmode - set noinsertmode - - let s:_showcmd = &showcmd - set noshowcmd - - let s:_cpo = &cpo - set cpo&vim - - let s:_report = &report - let &report = 10000 - - setlocal nonumber - setlocal foldcolumn=0 - setlocal nofoldenable - setlocal cursorline - setlocal nospell - setlocal nobuflisted - setlocal filetype=bufexplorer -endfunction - -" BufExplorerHorizontalSplit {{{2 -function! BufExplorerHorizontalSplit() - let s:splitMode = "sp" - execute "BufExplorer" - let s:splitMode = "" -endfunction - -" BufExplorerVerticalSplit {{{2 -function! BufExplorerVerticalSplit() - let s:splitMode = "vsp" - execute "BufExplorer" - let s:splitMode = "" -endfunction - -" ToggleBufExplorer {{{2 -function! ToggleBufExplorer() - if exists("s:running") && s:running == 1 && bufname(winbufnr(0)) == s:name - call s:Close() - else - call BufExplorer() - endif -endfunction - -" BufExplorer {{{2 -function! BufExplorer() - let name = s:name - - if !has("win32") - " On non-Windows boxes, escape the name so that is shows up correctly. - let name = escape(name, "[]") - endif - - " Make sure there is only one explorer open at a time. - if s:running == 1 - " Go to the open buffer. - if has("gui") - execute "drop" name - endif - - return - endif - - " Add zero to ensure the variable is treated as a number. - let s:originBuffer = bufnr("%") + 0 - - silent let s:raw_buffer_listing = s:GetBufferInfo(0) - - " We may have to split the current window. - if s:splitMode != "" - " Save off the original settings. - let [_splitbelow, _splitright] = [&splitbelow, &splitright] - - " Set the setting to ours. - let [&splitbelow, &splitright] = [g:bufExplorerSplitBelow, g:bufExplorerSplitRight] - let _size = (s:splitMode == "sp") ? g:bufExplorerSplitHorzSize : g:bufExplorerSplitVertSize - - " Split the window either horizontally or vertically. - if _size <= 0 - execute 'keepalt ' . s:splitMode - else - execute 'keepalt ' . _size . s:splitMode - endif - - " Restore the original settings. - let [&splitbelow, &splitright] = [_splitbelow, _splitright] - - " Remember that a split was triggered - let s:didSplit = 1 - endif - - if !exists("b:displayMode") || b:displayMode != "winmanager" - " Do not use keepalt when opening bufexplorer to allow the buffer that - " we are leaving to become the new alternate buffer - execute "silent keepjumps hide edit".name - endif - - call s:DisplayBufferList() - - " Position the cursor in the newly displayed list on the line representing - " the active buffer. The active buffer is the line with the '%' character - " in it. - execute search("%") -endfunction - -" DisplayBufferList {{{2 -function! s:DisplayBufferList() - setlocal buftype=nofile - setlocal modifiable - setlocal noreadonly - setlocal noswapfile - setlocal nowrap - setlocal bufhidden=wipe - - call s:SetupSyntax() - call s:MapKeys() - - " Wipe out any existing lines in case BufExplorer buffer exists and the - " user had changed any global settings that might reduce the number of - " lines needed in the buffer. - silent keepjumps 1,$d _ - - call setline(1, s:CreateHelp()) - call s:BuildBufferList() - call cursor(s:firstBufferLine, 1) - - if !g:bufExplorerResize - normal! zz - endif - - setlocal nomodifiable -endfunction - -" MapKeys {{{2 -function! s:MapKeys() - if exists("b:displayMode") && b:displayMode == "winmanager" - nnoremap :call SelectBuffer() - endif - - nnoremap -``` - -blocks in html files. - -## CoffeeScript in Haml - -CoffeeScript is highlighted within the `:coffeescript` filter in haml files: - -```haml -:coffeescript - console.log "hullo" -``` - -At this time, coffee indenting doesn't work in these blocks. - -## Custom Autocmds - -You can [define commands][autocmd-explain] to be ran automatically on these -custom events. - -In all cases, the name of the command running the event (`CoffeeCompile`, -`CoffeeWatch`, or `CoffeeRun`) is matched by the [`{pat}`][autocmd] argument. -You can match all commands with a `*` or only specific commands by separating -them with a comma: `CoffeeCompile,CoffeeWatch`. - -[autocmd-explain]: http://vimdoc.sourceforge.net/htmldoc/usr_40.html#40.3 -[autocmd]: http://vimdoc.sourceforge.net/htmldoc/autocmd.html#:autocmd - -#### CoffeeBufNew - -CoffeeBufNew is ran when a new scratch buffer is created. It's called from the -new buffer, so it can be used to do additional set up. - -```vim -augroup CoffeeBufNew - autocmd User * set wrap -augroup END -``` - -*Used By*: CoffeeCompile, CoffeeWatch, CoffeeRun - -#### CoffeeBufUpdate - -CoffeeBufUpdate is ran when a scratch buffer is updated with output from -`coffee`. It's called from the scratch buffer, so it can be used to alter the -compiled output. - -```vim -" Switch back to the source buffer after updating. -augroup CoffeeBufUpdate - autocmd User CoffeeCompile,CoffeeRun exec bufwinnr(b:coffee_src_buf) 'wincmd w' -augroup END -``` - -For example, to strip off the "Generated by" comment on the first line, put this -in your vimrc: - -```vim -function! s:RemoveGeneratedBy() - " If there was an error compiling, there's no comment to remove. - if v:shell_error - return - endif - - " Save cursor position. - let pos = getpos('.') - - " Remove first line. - set modifiable - 1 delete _ - set nomodifiable - - " Restore cursor position. - call setpos('.', pos) -endfunction - -augroup CoffeeBufUpdate - autocmd User CoffeeCompile,CoffeeWatch call s:RemoveGeneratedBy() -augroup END -``` - -*Used By*: CoffeeCompile, CoffeeWatch, CoffeeRun - -## Configuration Variables - -This is the full list of configuration variables available, with example -settings and default values. Use these in your vimrc to control the default -behavior. - -#### coffee\_indent\_keep\_current - -By default, the indent function matches the indent of the previous line if it -doesn't find a reason to indent or outdent. To change this behavior so it -instead keeps the [current indent of the cursor][98], use - - let coffee_indent_keep_current = 1 - -[98]: https://github.com/kchmck/vim-coffee-script/pull/98 - -*Default*: `unlet coffee_indent_keep_current` - -Note that if you change this after a coffee file has been loaded, you'll have to -reload the indent script for the change to take effect: - - unlet b:did_indent | runtime indent/coffee.vim - -#### coffee\_compiler - -Path to the `coffee` executable used by the `Coffee` commands: - - let coffee_compiler = '/usr/bin/coffee' - -*Default*: `'coffee'` (search `$PATH` for executable) - -#### coffee\_make\_options - -Options to pass to `coffee` with `:make`: - - let coffee_make_options = '--bare' - -*Default*: `''` (nothing) - -Note that `coffee_make_options` is embedded into `'makeprg'`, so `:compiler -coffee` must be ran after changing `coffee_make_options` for the changes to take -effect. - -#### coffee\_cake - -Path to the `cake` executable: - - let coffee_cake = '/opt/bin/cake' - -*Default*: `'cake'` (search `$PATH` for executable) - -#### coffee\_cake\_options - -Options to pass to `cake` with `:make`: - - let coffee_cake_options = 'build' - -*Default*: `''` (nothing) - -#### coffee\_linter - -Path to the `coffeelint` executable: - - let coffee_linter = '/opt/bin/coffeelint' - -*Default*: `'coffeelint'` (search `$PATH` for executable) - -#### coffee\_lint\_options - -Options to pass to `coffeelint`: - - let coffee_lint_options = '-f lint.json' - -*Default*: `''` (nothing) - -#### coffee\_compile\_vert - -Open the CoffeeCompile buffer with a vertical split instead of a horizontal -one: - - let coffee_compile_vert = 1 - -*Default*: `unlet coffee_compile_vert` - -#### coffee\_watch\_vert - -Open the CoffeeWatch buffer with a vertical split instead of a horizontal -one: - - let coffee_watch_vert = 1 - -*Default*: `unlet coffee_watch_vert` - -#### coffee\_run\_vert - -Open the CoffeeRun buffer with a vertical split instead of a horizontal -one: - - let coffee_run_vert = 1 - -*Default*: `unlet coffee_run_vert` - -## Configure Syntax Highlighting - -Add these lines to your vimrc to disable the relevant syntax group. - -#### Disable trailing whitespace error - -Trailing whitespace is highlighted as an error by default. This can be disabled -with: - - hi link coffeeSpaceError NONE - -#### Disable trailing semicolon error - -Trailing semicolons are considered an error (for help transitioning from -JavaScript.) This can be disabled with: - - hi link coffeeSemicolonError NONE - -#### Disable reserved words error - -Reserved words like `function` and `var` are highlighted as an error where -they're not allowed in CoffeeScript. This can be disabled with: - - hi link coffeeReservedError NONE - -## Tune Vim for CoffeeScript - -Changing these core settings can make vim more CoffeeScript friendly. - -#### Fold by indentation - -Folding by indentation works well for CoffeeScript functions and classes: - - ![Folding](http://i.imgur.com/gDgUBdO.png) - -To fold by indentation in CoffeeScript files, add this line to your vimrc: - - autocmd BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenable - -With this, folding is disabled by default but can be quickly toggled per-file -by hitting `zi`. To enable folding by default, remove `nofoldenable`: - - autocmd BufNewFile,BufReadPost *.coffee setl foldmethod=indent - -#### Two-space indentation - -To get standard two-space indentation in CoffeeScript files, add this line to -your vimrc: - - autocmd BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab diff --git a/sources_non_forked/vim-coffee-script/Thanks.md b/sources_non_forked/vim-coffee-script/Thanks.md deleted file mode 100644 index 8ddcf23fcc..0000000000 --- a/sources_non_forked/vim-coffee-script/Thanks.md +++ /dev/null @@ -1,44 +0,0 @@ -Thanks to all bug reporters, and special thanks to those who have contributed -code: - - Brian Egan (brianegan): - Initial compiling support - - Ches Martin (ches): - Initial vim docs - - Chris Hoffman (cehoffman): - Add new keywoards from, to, and do - Highlight the - in negative integers - Add here regex highlighting, increase fold level for here docs - - David Wilhelm (bigfish): - CoffeeRun command - - Jay Adkisson (jayferd): - Support for eco templates - - Karl Guertin (grayrest) - Cakefiles are coffeescript - - Maciej Konieczny (narfdotpl): - Fix funny typo - - Matt Sacks (mattsa): - Javascript omni-completion - coffee_compile_vert option - - Nick Stenning (nickstenning): - Fold by indentation for coffeescript - - Simon Lipp (sloonz): - Trailing spaces are not error on lines containing only spaces - - Stéphan Kochen (stephank): - Initial HTML CoffeeScript highlighting - - Sven Felix Oberquelle (Svelix): - Haml CoffeeScript highlighting - - Wei Dai (clvv): - Fix the use of Vim built-in make command. diff --git a/sources_non_forked/vim-coffee-script/Todo.md b/sources_non_forked/vim-coffee-script/Todo.md deleted file mode 100644 index 3d4ffaa8d1..0000000000 --- a/sources_non_forked/vim-coffee-script/Todo.md +++ /dev/null @@ -1 +0,0 @@ -- Don't highlight bad operator combinations diff --git a/sources_non_forked/vim-coffee-script/after/indent/html.vim b/sources_non_forked/vim-coffee-script/after/indent/html.vim deleted file mode 100644 index 0823e68957..0000000000 --- a/sources_non_forked/vim-coffee-script/after/indent/html.vim +++ /dev/null @@ -1,33 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Load the coffee and html indent functions. -silent! unlet b:did_indent -runtime indent/coffee.vim -let s:coffeeIndentExpr = &l:indentexpr - -" Load html last so it can overwrite coffee settings. -silent! unlet b:did_indent -runtime indent/html.vim -let s:htmlIndentExpr = &l:indentexpr - -" Inject our wrapper indent function. -setlocal indentexpr=GetCoffeeHtmlIndent(v:lnum) - -function! GetCoffeeHtmlIndent(curlinenum) - " See if we're inside a coffeescript block. - let scriptlnum = searchpair('', 'bWn') - let prevlnum = prevnonblank(a:curlinenum) - - " If we're in the script block and the previous line isn't the script tag - " itself, use coffee indenting. - if scriptlnum && scriptlnum != prevlnum - exec 'return ' s:coffeeIndentExpr - endif - - " Otherwise use html indenting. - exec 'return ' s:htmlIndentExpr -endfunction diff --git a/sources_non_forked/vim-coffee-script/after/syntax/haml.vim b/sources_non_forked/vim-coffee-script/after/syntax/haml.vim deleted file mode 100644 index 3e186cdc7d..0000000000 --- a/sources_non_forked/vim-coffee-script/after/syntax/haml.vim +++ /dev/null @@ -1,23 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Sven Felix Oberquelle -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - - -if exists('b:current_syntax') - let s:current_syntax_save = b:current_syntax -endif - -" Inherit coffee from html so coffeeComment isn't redefined and given higher -" priority than hamlInterpolation. -syn cluster hamlCoffeescript contains=@htmlCoffeeScript -syn region hamlCoffeescriptFilter matchgroup=hamlFilter -\ start="^\z(\s*\):coffee\z(script\)\?\s*$" -\ end="^\%(\z1 \| *$\)\@!" -\ contains=@hamlCoffeeScript,hamlInterpolation -\ keepend - -if exists('s:current_syntax_save') - let b:current_syntax = s:current_syntax_save - unlet s:current_syntax_save -endif diff --git a/sources_non_forked/vim-coffee-script/after/syntax/html.vim b/sources_non_forked/vim-coffee-script/after/syntax/html.vim deleted file mode 100644 index a78ba88d6d..0000000000 --- a/sources_non_forked/vim-coffee-script/after/syntax/html.vim +++ /dev/null @@ -1,20 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('b:current_syntax') - let s:current_syntax_save = b:current_syntax -endif - -" Syntax highlighting for text/coffeescript script tags -syn include @htmlCoffeeScript syntax/coffee.vim -syn region coffeeScript start=##me=s-1 keepend -\ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc -\ containedin=htmlHead - -if exists('s:current_syntax_save') - let b:current_syntax = s:current_syntax_save - unlet s:current_syntax_save -endif diff --git a/sources_non_forked/vim-coffee-script/autoload/coffee.vim b/sources_non_forked/vim-coffee-script/autoload/coffee.vim deleted file mode 100644 index 8d72795135..0000000000 --- a/sources_non_forked/vim-coffee-script/autoload/coffee.vim +++ /dev/null @@ -1,54 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Set up some common global/buffer variables. -function! coffee#CoffeeSetUpVariables() - " Path to coffee executable - if !exists('g:coffee_compiler') - let g:coffee_compiler = 'coffee' - endif - - " Options passed to coffee with make - if !exists('g:coffee_make_options') - let g:coffee_make_options = '' - endif - - " Path to cake executable - if !exists('g:coffee_cake') - let g:coffee_cake = 'cake' - endif - - " Extra options passed to cake - if !exists('g:coffee_cake_options') - let g:coffee_cake_options = '' - endif - - " Path to coffeelint executable - if !exists('g:coffee_linter') - let g:coffee_linter = 'coffeelint' - endif - - " Options passed to CoffeeLint - if !exists('g:coffee_lint_options') - let g:coffee_lint_options = '' - endif - - " Pass the litcoffee flag to tools in this buffer if a litcoffee file is open. - " Let the variable be overwritten so it can be updated if a different filetype - " is set. - if &filetype == 'litcoffee' - let b:coffee_litcoffee = '--literate' - else - let b:coffee_litcoffee = '' - endif -endfunction - -function! coffee#CoffeeSetUpErrorFormat() - CompilerSet errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l, - \Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m, - \SyntaxError:\ In\ %f\\,\ %m, - \%f:%l:%c:\ error:\ %m, - \%-G%.%# -endfunction diff --git a/sources_non_forked/vim-coffee-script/compiler/cake.vim b/sources_non_forked/vim-coffee-script/compiler/cake.vim deleted file mode 100644 index b49638e7ab..0000000000 --- a/sources_non_forked/vim-coffee-script/compiler/cake.vim +++ /dev/null @@ -1,15 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('current_compiler') - finish -endif - -let current_compiler = 'cake' -call coffee#CoffeeSetUpVariables() - -exec 'CompilerSet makeprg=' . escape(g:coffee_cake . ' ' . -\ g:coffee_cake_options . ' $*', ' ') -call coffee#CoffeeSetUpErrorFormat() diff --git a/sources_non_forked/vim-coffee-script/compiler/coffee.vim b/sources_non_forked/vim-coffee-script/compiler/coffee.vim deleted file mode 100644 index 5a914578df..0000000000 --- a/sources_non_forked/vim-coffee-script/compiler/coffee.vim +++ /dev/null @@ -1,82 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" All this is needed to support compiling filenames with spaces, quotes, and -" such. The filename is escaped and embedded into the `makeprg` setting. -" -" Because of this, `makeprg` must be updated on every file rename. And because -" of that, `CompilerSet` can't be used because it doesn't exist when the -" rename autocmd is ran. So, we have to do some checks to see whether `compiler` -" was called locally or globally, and respect that in the rest of the script. - -if exists('current_compiler') - finish -endif - -let current_compiler = 'coffee' -call coffee#CoffeeSetUpVariables() - -" Pattern to check if coffee is the compiler -let s:pat = '^' . current_compiler - -" Get a `makeprg` for the current filename. -function! s:GetMakePrg() - return g:coffee_compiler . - \ ' -c' . - \ ' ' . b:coffee_litcoffee . - \ ' ' . g:coffee_make_options . - \ ' $*' . - \ ' ' . fnameescape(expand('%')) -endfunction - -" Set `makeprg` and return 1 if coffee is still the compiler, else return 0. -function! s:SetMakePrg() - if &l:makeprg =~ s:pat - let &l:makeprg = s:GetMakePrg() - elseif &g:makeprg =~ s:pat - let &g:makeprg = s:GetMakePrg() - else - return 0 - endif - - return 1 -endfunction - -" Set a dummy compiler so we can check whether to set locally or globally. -exec 'CompilerSet makeprg=' . current_compiler -" Then actually set the compiler. -call s:SetMakePrg() -call coffee#CoffeeSetUpErrorFormat() - -function! s:CoffeeMakeDeprecated(bang, args) - echoerr 'CoffeeMake is deprecated! Please use :make instead, its behavior ' . - \ 'is identical.' - sleep 5 - exec 'make' . a:bang a:args -endfunction - -" Compile the current file. -command! -bang -bar -nargs=* CoffeeMake -\ call s:CoffeeMakeDeprecated(, ) - -" Set `makeprg` on rename since we embed the filename in the setting. -augroup CoffeeUpdateMakePrg - autocmd! - - " Update `makeprg` if coffee is still the compiler, else stop running this - " function. - function! s:UpdateMakePrg() - if !s:SetMakePrg() - autocmd! CoffeeUpdateMakePrg - endif - endfunction - - " Set autocmd locally if compiler was set locally. - if &l:makeprg =~ s:pat - autocmd BufWritePre,BufFilePost call s:UpdateMakePrg() - else - autocmd BufWritePre,BufFilePost call s:UpdateMakePrg() - endif -augroup END diff --git a/sources_non_forked/vim-coffee-script/doc/coffee-script.txt b/sources_non_forked/vim-coffee-script/doc/coffee-script.txt deleted file mode 100644 index 1b43cf3ace..0000000000 --- a/sources_non_forked/vim-coffee-script/doc/coffee-script.txt +++ /dev/null @@ -1,4 +0,0 @@ -Please see the project readme for up-to-date docs: -https://github.com/kchmck/vim-coffee-script - - vim:tw=78:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-coffee-script/ftdetect/coffee.vim b/sources_non_forked/vim-coffee-script/ftdetect/coffee.vim deleted file mode 100644 index 4e5285d1cf..0000000000 --- a/sources_non_forked/vim-coffee-script/ftdetect/coffee.vim +++ /dev/null @@ -1,18 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -autocmd BufNewFile,BufRead *.coffee set filetype=coffee -autocmd BufNewFile,BufRead *Cakefile set filetype=coffee -autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee -autocmd BufNewFile,BufRead *._coffee set filetype=coffee -autocmd BufNewFile,BufRead *.cson set filetype=coffee - -function! s:DetectCoffee() - if getline(1) =~ '^#!.*\' - set filetype=coffee - endif -endfunction - -autocmd BufNewFile,BufRead * call s:DetectCoffee() diff --git a/sources_non_forked/vim-coffee-script/ftdetect/vim-literate-coffeescript.vim b/sources_non_forked/vim-coffee-script/ftdetect/vim-literate-coffeescript.vim deleted file mode 100644 index 7f66624657..0000000000 --- a/sources_non_forked/vim-coffee-script/ftdetect/vim-literate-coffeescript.vim +++ /dev/null @@ -1,8 +0,0 @@ -" Language: Literate CoffeeScript -" Maintainer: Michael Smith -" URL: https://github.com/mintplant/vim-literate-coffeescript -" License: MIT - -autocmd BufNewFile,BufRead *.litcoffee set filetype=litcoffee -autocmd BufNewFile,BufRead *.coffee.md set filetype=litcoffee - diff --git a/sources_non_forked/vim-coffee-script/ftplugin/coffee.vim b/sources_non_forked/vim-coffee-script/ftplugin/coffee.vim deleted file mode 100644 index 3f9cd7718f..0000000000 --- a/sources_non_forked/vim-coffee-script/ftplugin/coffee.vim +++ /dev/null @@ -1,405 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('b:did_ftplugin') - finish -endif - -let b:did_ftplugin = 1 -call coffee#CoffeeSetUpVariables() - -setlocal formatoptions-=t formatoptions+=croql -setlocal comments=:# commentstring=#\ %s -setlocal omnifunc=javascriptcomplete#CompleteJS -setlocal suffixesadd+=.coffee - -" Create custom augroups. -augroup CoffeeBufUpdate | augroup END -augroup CoffeeBufNew | augroup END - -" Enable coffee compiler if a compiler isn't set already. -if !len(&l:makeprg) - compiler coffee -endif - -" Switch to the window for buf. -function! s:SwitchWindow(buf) - exec bufwinnr(a:buf) 'wincmd w' -endfunction - -" Create a new scratch buffer and return the bufnr of it. After the function -" returns, vim remains in the scratch buffer so more set up can be done. -function! s:ScratchBufBuild(src, vert, size) - if a:size <= 0 - if a:vert - let size = winwidth(bufwinnr(a:src)) / 2 - else - let size = winheight(bufwinnr(a:src)) / 2 - endif - endif - - if a:vert - vertical belowright new - exec 'vertical resize' size - else - belowright new - exec 'resize' size - endif - - setlocal bufhidden=wipe buftype=nofile nobuflisted noswapfile nomodifiable - nnoremap q :hide - - return bufnr('%') -endfunction - -" Replace buffer contents with text and delete the last empty line. -function! s:ScratchBufUpdate(buf, text) - " Move to the scratch buffer. - call s:SwitchWindow(a:buf) - - " Double check we're in the scratch buffer before overwriting. - if bufnr('%') != a:buf - throw 'unable to change to scratch buffer' - endif - - setlocal modifiable - silent exec '% delete _' - silent put! =a:text - silent exec '$ delete _' - setlocal nomodifiable -endfunction - -" Parse the output of coffee into a qflist entry for src buffer. -function! s:ParseCoffeeError(output, src, startline) - " Coffee error is always on first line? - let match = matchlist(a:output, - \ '^\(\f\+\|\[stdin\]\):\(\d\):\(\d\): error: \(.\{-}\)' . "\n") - - if !len(match) - return - endif - - " Consider the line number from coffee as relative and add it to the beginning - " line number of the range the command was called on, then subtract one for - " zero-based relativity. - call setqflist([{'bufnr': a:src, 'lnum': a:startline + str2nr(match[2]) - 1, - \ 'type': 'E', 'col': str2nr(match[3]), 'text': match[4]}], 'r') -endfunction - -" Reset source buffer variables. -function! s:CoffeeCompileResetVars() - " Variables defined in source buffer: - " b:coffee_compile_buf: bufnr of output buffer - " Variables defined in output buffer: - " b:coffee_src_buf: bufnr of source buffer - " b:coffee_compile_pos: previous cursor position in output buffer - - let b:coffee_compile_buf = -1 -endfunction - -function! s:CoffeeWatchResetVars() - " Variables defined in source buffer: - " b:coffee_watch_buf: bufnr of output buffer - " Variables defined in output buffer: - " b:coffee_src_buf: bufnr of source buffer - " b:coffee_watch_pos: previous cursor position in output buffer - - let b:coffee_watch_buf = -1 -endfunction - -function! s:CoffeeRunResetVars() - " Variables defined in CoffeeRun source buffer: - " b:coffee_run_buf: bufnr of output buffer - " Variables defined in CoffeeRun output buffer: - " b:coffee_src_buf: bufnr of source buffer - " b:coffee_run_pos: previous cursor position in output buffer - - let b:coffee_run_buf = -1 -endfunction - -" Clean things up in the source buffers. -function! s:CoffeeCompileClose() - " Switch to the source buffer if not already in it. - silent! call s:SwitchWindow(b:coffee_src_buf) - call s:CoffeeCompileResetVars() -endfunction - -function! s:CoffeeWatchClose() - silent! call s:SwitchWindow(b:coffee_src_buf) - silent! autocmd! CoffeeAuWatch * - call s:CoffeeWatchResetVars() -endfunction - -function! s:CoffeeRunClose() - silent! call s:SwitchWindow(b:coffee_src_buf) - call s:CoffeeRunResetVars() -endfunction - -" Compile the lines between startline and endline and put the result into buf. -function! s:CoffeeCompileToBuf(buf, startline, endline) - let src = bufnr('%') - let input = join(getline(a:startline, a:endline), "\n") - - " Coffee doesn't like empty input. - if !len(input) - " Function should still return within output buffer. - call s:SwitchWindow(a:buf) - return - endif - - " Pipe lines into coffee. - let output = system(g:coffee_compiler . - \ ' -scb' . - \ ' ' . b:coffee_litcoffee . - \ ' 2>&1', input) - - " Paste output into output buffer. - call s:ScratchBufUpdate(a:buf, output) - - " Highlight as JavaScript if there were no compile errors. - if v:shell_error - call s:ParseCoffeeError(output, src, a:startline) - setlocal filetype= - else - " Clear the quickfix list. - call setqflist([], 'r') - setlocal filetype=javascript - endif -endfunction - -" Peek at compiled CoffeeScript in a scratch buffer. We handle ranges like this -" to prevent the cursor from being moved (and its position saved) before the -" function is called. -function! s:CoffeeCompile(startline, endline, args) - if a:args =~ '\' - echoerr 'CoffeeCompile watch is deprecated! Please use CoffeeWatch instead' - sleep 5 - call s:CoffeeWatch(a:args) - return - endif - - " Switch to the source buffer if not already in it. - silent! call s:SwitchWindow(b:coffee_src_buf) - - " Bail if not in source buffer. - if !exists('b:coffee_compile_buf') - return - endif - - " Build the output buffer if it doesn't exist. - if bufwinnr(b:coffee_compile_buf) == -1 - let src = bufnr('%') - - let vert = exists('g:coffee_compile_vert') || a:args =~ '\' - let size = str2nr(matchstr(a:args, '\<\d\+\>')) - - " Build the output buffer and save the source bufnr. - let buf = s:ScratchBufBuild(src, vert, size) - let b:coffee_src_buf = src - - " Set the buffer name. - exec 'silent! file [CoffeeCompile ' . src . ']' - - " Clean up the source buffer when the output buffer is closed. - autocmd BufWipeout call s:CoffeeCompileClose() - " Save the cursor when leaving the output buffer. - autocmd BufLeave let b:coffee_compile_pos = getpos('.') - - " Run user-defined commands on new buffer. - silent doautocmd CoffeeBufNew User CoffeeCompile - - " Switch back to the source buffer and save the output bufnr. This also - " triggers BufLeave above. - call s:SwitchWindow(src) - let b:coffee_compile_buf = buf - endif - - " Fill the scratch buffer. - call s:CoffeeCompileToBuf(b:coffee_compile_buf, a:startline, a:endline) - " Reset cursor to previous position. - call setpos('.', b:coffee_compile_pos) - - " Run any user-defined commands on the scratch buffer. - silent doautocmd CoffeeBufUpdate User CoffeeCompile -endfunction - -" Update the scratch buffer and switch back to the source buffer. -function! s:CoffeeWatchUpdate() - call s:CoffeeCompileToBuf(b:coffee_watch_buf, 1, '$') - call setpos('.', b:coffee_watch_pos) - silent doautocmd CoffeeBufUpdate User CoffeeWatch - call s:SwitchWindow(b:coffee_src_buf) -endfunction - -" Continually compile a source buffer. -function! s:CoffeeWatch(args) - silent! call s:SwitchWindow(b:coffee_src_buf) - - if !exists('b:coffee_watch_buf') - return - endif - - if bufwinnr(b:coffee_watch_buf) == -1 - let src = bufnr('%') - - let vert = exists('g:coffee_watch_vert') || a:args =~ '\' - let size = str2nr(matchstr(a:args, '\<\d\+\>')) - - let buf = s:ScratchBufBuild(src, vert, size) - let b:coffee_src_buf = src - - exec 'silent! file [CoffeeWatch ' . src . ']' - - autocmd BufWipeout call s:CoffeeWatchClose() - autocmd BufLeave let b:coffee_watch_pos = getpos('.') - - silent doautocmd CoffeeBufNew User CoffeeWatch - - call s:SwitchWindow(src) - let b:coffee_watch_buf = buf - endif - - " Make sure only one watch autocmd is defined on this buffer. - silent! autocmd! CoffeeAuWatch * - - augroup CoffeeAuWatch - autocmd InsertLeave call s:CoffeeWatchUpdate() - autocmd BufWritePost call s:CoffeeWatchUpdate() - augroup END - - call s:CoffeeWatchUpdate() -endfunction - -" Run a snippet of CoffeeScript between startline and endline. -function! s:CoffeeRun(startline, endline, args) - silent! call s:SwitchWindow(b:coffee_src_buf) - - if !exists('b:coffee_run_buf') - return - endif - - if bufwinnr(b:coffee_run_buf) == -1 - let src = bufnr('%') - - let buf = s:ScratchBufBuild(src, exists('g:coffee_run_vert'), 0) - let b:coffee_src_buf = src - - exec 'silent! file [CoffeeRun ' . src . ']' - - autocmd BufWipeout call s:CoffeeRunClose() - autocmd BufLeave let b:coffee_run_pos = getpos('.') - - silent doautocmd CoffeeBufNew User CoffeeRun - - call s:SwitchWindow(src) - let b:coffee_run_buf = buf - endif - - if a:startline == 1 && a:endline == line('$') - let output = system(g:coffee_compiler . - \ ' ' . b:coffee_litcoffee . - \ ' ' . fnameescape(expand('%')) . - \ ' ' . a:args) - else - let input = join(getline(a:startline, a:endline), "\n") - - if !len(input) - return - endif - - let output = system(g:coffee_compiler . - \ ' -s' . - \ ' ' . b:coffee_litcoffee . - \ ' ' . a:args, input) - endif - - call s:ScratchBufUpdate(b:coffee_run_buf, output) - call setpos('.', b:coffee_run_pos) - - silent doautocmd CoffeeBufUpdate User CoffeeRun -endfunction - -" Run coffeelint on a file, and add any errors between startline and endline -" to the quickfix list. -function! s:CoffeeLint(startline, endline, bang, args) - let input = join(getline(a:startline, a:endline), "\n") - - if !len(input) - return - endif - - let output = system(g:coffee_linter . - \ ' -s --reporter csv' . - \ ' ' . b:coffee_litcoffee . - \ ' ' . g:coffee_lint_options . - \ ' ' . a:args . - \ ' 2>&1', input) - - " Convert output into an array and strip off the csv header. - let lines = split(output, "\n")[1:] - let buf = bufnr('%') - let qflist = [] - - for line in lines - let match = matchlist(line, '^stdin,\(\d\+\),\d*,\(error\|warn\),\(.\+\)$') - - " Ignore unmatched lines. - if !len(match) - continue - endif - - " The 'type' will result in either 'E' or 'W'. - call add(qflist, {'bufnr': buf, 'lnum': a:startline + str2nr(match[1]) - 1, - \ 'type': toupper(match[2][0]), 'text': match[3]}) - endfor - - " Replace the quicklist with our items. - call setqflist(qflist, 'r') - - " If not given a bang, jump to first error. - if !len(a:bang) - silent! cc 1 - endif -endfunction - -" Complete arguments for Coffee* commands. -function! s:CoffeeComplete(cmd, cmdline, cursor) - let args = ['vertical'] - - " If no partial command, return all possibilities. - if !len(a:cmd) - return args - endif - - let pat = '^' . a:cmd - - for arg in args - if arg =~ pat - return [arg] - endif - endfor -endfunction - -" Set initial state variables if they don't exist -if !exists('b:coffee_compile_buf') - call s:CoffeeCompileResetVars() -endif - -if !exists('b:coffee_watch_buf') - call s:CoffeeWatchResetVars() -endif - -if !exists('b:coffee_run_buf') - call s:CoffeeRunResetVars() -endif - -command! -buffer -range=% -bar -nargs=* -complete=customlist,s:CoffeeComplete -\ CoffeeCompile call s:CoffeeCompile(, , ) -command! -buffer -bar -nargs=* -complete=customlist,s:CoffeeComplete -\ CoffeeWatch call s:CoffeeWatch() -command! -buffer -range=% -bar -nargs=* CoffeeRun -\ call s:CoffeeRun(, , ) -command! -buffer -range=% -bang -bar -nargs=* CoffeeLint -\ call s:CoffeeLint(, , , ) diff --git a/sources_non_forked/vim-coffee-script/ftplugin/litcoffee.vim b/sources_non_forked/vim-coffee-script/ftplugin/litcoffee.vim deleted file mode 100644 index febc730c6a..0000000000 --- a/sources_non_forked/vim-coffee-script/ftplugin/litcoffee.vim +++ /dev/null @@ -1 +0,0 @@ -runtime ftplugin/coffee.vim diff --git a/sources_non_forked/vim-coffee-script/indent/coffee.vim b/sources_non_forked/vim-coffee-script/indent/coffee.vim deleted file mode 100644 index 4f4570a87d..0000000000 --- a/sources_non_forked/vim-coffee-script/indent/coffee.vim +++ /dev/null @@ -1,428 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -if exists('b:did_indent') - finish -endif - -let b:did_indent = 1 - -setlocal autoindent -setlocal indentexpr=GetCoffeeIndent(v:lnum) -" Make sure GetCoffeeIndent is run when these are typed so they can be -" indented or outdented. -setlocal indentkeys+=0],0),0.,=else,=when,=catch,=finally - -" If no indenting or outdenting is needed, either keep the indent of the cursor -" (use autoindent) or match the indent of the previous line. -if exists('g:coffee_indent_keep_current') - let s:DEFAULT_LEVEL = '-1' -else - let s:DEFAULT_LEVEL = 'indent(prevnlnum)' -endif - -" Only define the function once. -if exists('*GetCoffeeIndent') - finish -endif - -" Keywords that begin a block -let s:BEGIN_BLOCK_KEYWORD = '\C^\%(if\|unless\|else\|for\|while\|until\|' -\ . 'loop\|switch\|when\|try\|catch\|finally\|' -\ . 'class\)\>\%(\s*:\)\@!' - -" An expression that uses the result of a statement -let s:COMPOUND_EXPRESSION = '\C\%([^-]-\|[^+]+\|[^/]/\|[:=*%&|^<>]\)\s*' -\ . '\%(if\|unless\|for\|while\|until\|loop\|switch\|' -\ . 'try\|class\)\>' - -" Combine the two above -let s:BEGIN_BLOCK = s:BEGIN_BLOCK_KEYWORD . '\|' . s:COMPOUND_EXPRESSION - -" Operators that begin a block but also count as a continuation -let s:BEGIN_BLOCK_OP = '[([{:=]$' - -" Begins a function block -let s:FUNCTION = '[-=]>$' - -" Operators that continue a line onto the next line -let s:CONTINUATION_OP = '\C\%(\<\%(is\|isnt\|and\|or\)\>\|' -\ . '[^-]-\|[^+]+\|[^-=]>\|[^.]\.\|[<*/%&|^,]\)$' - -" Ancestor operators that prevent continuation indenting -let s:CONTINUATION = s:CONTINUATION_OP . '\|' . s:BEGIN_BLOCK_OP - -" A closing bracket by itself on a line followed by a continuation -let s:BRACKET_CONTINUATION = '^\s*[}\])]\s*' . s:CONTINUATION_OP - -" A continuation dot access -let s:DOT_ACCESS = '^\.' - -" Keywords that break out of a block -let s:BREAK_BLOCK_OP = '\C^\%(return\|break\|continue\|throw\)\>' - -" A condition attached to the end of a statement -let s:POSTFIX_CONDITION = '\C\S\s\+\zs\<\%(if\|unless\|when\|while\|until\)\>' - -" A then contained in brackets -let s:CONTAINED_THEN = '\C[(\[].\{-}\.\{-\}[)\]]' - -" An else with a condition attached -let s:ELSE_COND = '\C^\s*else\s\+\<\%(if\|unless\)\>' - -" A single-line else statement (without a condition attached) -let s:SINGLE_LINE_ELSE = '\C^else\s\+\%(\<\%(if\|unless\)\>\)\@!' - -" Pairs of starting and ending keywords, with an initial pattern to match -let s:KEYWORD_PAIRS = [ -\ ['\C^else\>', '\C\<\%(if\|unless\|when\|else\s\+\%(if\|unless\)\)\>', -\ '\C\'], -\ ['\C^catch\>', '\C\', '\C\'], -\ ['\C^finally\>', '\C\', '\C\'] -\] - -" Pairs of starting and ending brackets -let s:BRACKET_PAIRS = {']': '\[', '}': '{', ')': '('} - -" Max lines to look back for a match -let s:MAX_LOOKBACK = 50 - -" Syntax names for strings -let s:SYNTAX_STRING = 'coffee\%(String\|AssignString\|Embed\|Regex\|Heregex\|' -\ . 'Heredoc\)' - -" Syntax names for comments -let s:SYNTAX_COMMENT = 'coffee\%(Comment\|BlockComment\|HeregexComment\)' - -" Syntax names for strings and comments -let s:SYNTAX_STRING_COMMENT = s:SYNTAX_STRING . '\|' . s:SYNTAX_COMMENT - -" Compatibility code for shiftwidth() as recommended by the docs, but modified -" so there isn't as much of a penalty if shiftwidth() exists. -if exists('*shiftwidth') - let s:ShiftWidth = function('shiftwidth') -else - function! s:ShiftWidth() - return &shiftwidth - endfunction -endif - -" Get the linked syntax name of a character. -function! s:SyntaxName(lnum, col) - return synIDattr(synID(a:lnum, a:col, 1), 'name') -endfunction - -" Check if a character is in a comment. -function! s:IsComment(lnum, col) - return s:SyntaxName(a:lnum, a:col) =~ s:SYNTAX_COMMENT -endfunction - -" Check if a character is in a string. -function! s:IsString(lnum, col) - return s:SyntaxName(a:lnum, a:col) =~ s:SYNTAX_STRING -endfunction - -" Check if a character is in a comment or string. -function! s:IsCommentOrString(lnum, col) - return s:SyntaxName(a:lnum, a:col) =~ s:SYNTAX_STRING_COMMENT -endfunction - -" Search a line for a regex until one is found outside a string or comment. -function! s:SearchCode(lnum, regex) - " Start at the first column and look for an initial match (including at the - " cursor.) - call cursor(a:lnum, 1) - let pos = search(a:regex, 'c', a:lnum) - - while pos - if !s:IsCommentOrString(a:lnum, col('.')) - return 1 - endif - - " Move to the match and continue searching (don't accept matches at the - " cursor.) - let pos = search(a:regex, '', a:lnum) - endwhile - - return 0 -endfunction - -" Search for the nearest previous line that isn't a comment. -function! s:GetPrevNormalLine(startlnum) - let curlnum = a:startlnum - - while curlnum - let curlnum = prevnonblank(curlnum - 1) - - " Return the line if the first non-whitespace character isn't a comment. - if !s:IsComment(curlnum, indent(curlnum) + 1) - return curlnum - endif - endwhile - - return 0 -endfunction - -function! s:SearchPair(startlnum, lookback, skip, open, close) - " Go to the first column so a:close will be matched even if it's at the - " beginning of the line. - call cursor(a:startlnum, 1) - return searchpair(a:open, '', a:close, 'bnW', a:skip, max([1, a:lookback])) -endfunction - -" Skip if a match -" - is in a string or comment -" - is a single-line statement that isn't immediately -" adjacent -" - has a postfix condition and isn't an else statement or compound -" expression -function! s:ShouldSkip(startlnum, lnum, col) - return s:IsCommentOrString(a:lnum, a:col) || - \ s:SearchCode(a:lnum, '\C\') && a:startlnum - a:lnum > 1 || - \ s:SearchCode(a:lnum, s:POSTFIX_CONDITION) && - \ getline(a:lnum) !~ s:ELSE_COND && - \ !s:SearchCode(a:lnum, s:COMPOUND_EXPRESSION) -endfunction - -" Search for the nearest and farthest match for a keyword pair. -function! s:SearchMatchingKeyword(startlnum, open, close) - let skip = 's:ShouldSkip(' . a:startlnum . ", line('.'), line('.'))" - - " Search for the nearest match. - let nearestlnum = s:SearchPair(a:startlnum, a:startlnum - s:MAX_LOOKBACK, - \ skip, a:open, a:close) - - if !nearestlnum - return [] - endif - - " Find the nearest previous line with indent less than or equal to startlnum. - let ind = indent(a:startlnum) - let lookback = s:GetPrevNormalLine(a:startlnum) - - while lookback && indent(lookback) > ind - let lookback = s:GetPrevNormalLine(lookback) - endwhile - - " Search for the farthest match. If there are no other matches, then the - " nearest match is also the farthest one. - let matchlnum = nearestlnum - - while matchlnum - let lnum = matchlnum - let matchlnum = s:SearchPair(matchlnum, lookback, skip, a:open, a:close) - endwhile - - return [nearestlnum, lnum] -endfunction - -" Strip a line of a trailing comment and surrounding whitespace. -function! s:GetTrimmedLine(lnum) - " Try to find a comment starting at the first column. - call cursor(a:lnum, 1) - let pos = search('#', 'c', a:lnum) - - " Keep searching until a comment is found or search returns 0. - while pos - if s:IsComment(a:lnum, col('.')) - break - endif - - let pos = search('#', '', a:lnum) - endwhile - - if !pos - " No comment was found so use the whole line. - let line = getline(a:lnum) - else - " Subtract 1 to get to the column before the comment and another 1 for - " column indexing -> zero-based indexing. - let line = getline(a:lnum)[:col('.') - 2] - endif - - return substitute(substitute(line, '^\s\+', '', ''), - \ '\s\+$', '', '') -endfunction - -" Get the indent policy when no special rules are used. -function! s:GetDefaultPolicy(curlnum) - " Check whether equalprg is being ran on existing lines. - if strlen(getline(a:curlnum)) == indent(a:curlnum) - " If not indenting an existing line, use the default policy. - return s:DEFAULT_LEVEL - else - " Otherwise let autoindent determine what to do with an existing line. - return '-1' - endif -endfunction - -function! GetCoffeeIndent(curlnum) - " Get the previous non-blank line (may be a comment.) - let prevlnum = prevnonblank(a:curlnum - 1) - - " Bail if there's no code before. - if !prevlnum - return -1 - endif - - " Bail if inside a multiline string. - if s:IsString(a:curlnum, 1) - let prevnlnum = prevlnum - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " Get the code part of the current line. - let curline = s:GetTrimmedLine(a:curlnum) - " Get the previous non-comment line. - let prevnlnum = s:GetPrevNormalLine(a:curlnum) - - " Check if the current line is the closing bracket in a bracket pair. - if has_key(s:BRACKET_PAIRS, curline[0]) - " Search for a matching opening bracket. - let matchlnum = s:SearchPair(a:curlnum, a:curlnum - s:MAX_LOOKBACK, - \ "s:IsCommentOrString(line('.'), col('.'))", - \ s:BRACKET_PAIRS[curline[0]], curline[0]) - - if matchlnum - " Match the indent of the opening bracket. - return indent(matchlnum) - else - " No opening bracket found (bad syntax), so bail. - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Check if the current line is the closing keyword in a keyword pair. - for pair in s:KEYWORD_PAIRS - if curline =~ pair[0] - " Find the nearest and farthest matches within the same indent level. - let matches = s:SearchMatchingKeyword(a:curlnum, pair[1], pair[2]) - - if len(matches) - " Don't force indenting/outdenting as long as line is already lined up - " with a valid match - return max([min([indent(a:curlnum), indent(matches[0])]), - \ indent(matches[1])]) - else - " No starting keyword found (bad syntax), so bail. - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - endfor - - " Check if the current line is a `when` and not the first in a switch block. - if curline =~ '\C^when\>' && !s:SearchCode(prevnlnum, '\C\') - " Look back for a `when`. - while prevnlnum - if getline(prevnlnum) =~ '\C^\s*when\>' - " Indent to match the found `when`, but don't force indenting (for when - " indenting nested switch blocks.) - return min([indent(a:curlnum), indent(prevnlnum)]) - endif - - let prevnlnum = s:GetPrevNormalLine(prevnlnum) - endwhile - - " No matching `when` found (bad syntax), so bail. - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " If the previous line is a comment, use its indentation, but don't force - " indenting. - if prevlnum != prevnlnum - return min([indent(a:curlnum), indent(prevlnum)]) - endif - - let prevline = s:GetTrimmedLine(prevnlnum) - - " Always indent after these operators. - if prevline =~ s:BEGIN_BLOCK_OP - return indent(prevnlnum) + s:ShiftWidth() - endif - - " Indent if the previous line starts a function block, but don't force - " indenting if the line is non-blank (for empty function bodies.) - if prevline =~ s:FUNCTION - if strlen(getline(a:curlnum)) > indent(a:curlnum) - return min([indent(prevnlnum) + s:ShiftWidth(), indent(a:curlnum)]) - else - return indent(prevnlnum) + s:ShiftWidth() - endif - endif - - " Check if continuation indenting is needed. If the line ends in a slash, make - " sure it isn't a regex. - if prevline =~ s:CONTINUATION_OP && - \ !(prevline =~ '/$' && s:IsString(prevnlnum, col([prevnlnum, '$']) - 1)) - " Don't indent if the continuation follows a closing bracket. - if prevline =~ s:BRACKET_CONTINUATION - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - let prevprevnlnum = s:GetPrevNormalLine(prevnlnum) - - " Don't indent if not the first continuation. - if prevprevnlnum && s:GetTrimmedLine(prevprevnlnum) =~ s:CONTINUATION - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " Continuation indenting seems to vary between programmers, so if the line - " is non-blank, don't override the indentation - if strlen(getline(a:curlnum)) > indent(a:curlnum) - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - - " Otherwise indent a level. - return indent(prevnlnum) + s:ShiftWidth() - endif - - " Check if the previous line starts with a keyword that begins a block. - if prevline =~ s:BEGIN_BLOCK - " Indent if the current line doesn't start with `then` and the previous line - " isn't a single-line statement. - if curline !~ '\C^\' && !s:SearchCode(prevnlnum, '\C\') && - \ prevline !~ s:SINGLE_LINE_ELSE - return indent(prevnlnum) + s:ShiftWidth() - else - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Indent a dot access if it's the first. - if curline =~ s:DOT_ACCESS - if prevline !~ s:DOT_ACCESS - return indent(prevnlnum) + s:ShiftWidth() - else - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Outdent if a keyword breaks out of a block as long as it doesn't have a - " postfix condition (and the postfix condition isn't a single-line statement.) - if prevline =~ s:BREAK_BLOCK_OP - if !s:SearchCode(prevnlnum, s:POSTFIX_CONDITION) || - \ s:SearchCode(prevnlnum, '\C\') && - \ !s:SearchCode(prevnlnum, s:CONTAINED_THEN) - " Don't force indenting. - return min([indent(a:curlnum), indent(prevnlnum) - s:ShiftWidth()]) - else - exec 'return' s:GetDefaultPolicy(a:curlnum) - endif - endif - - " Check if inside brackets. - let matchlnum = s:SearchPair(a:curlnum, a:curlnum - s:MAX_LOOKBACK, - \ "s:IsCommentOrString(line('.'), col('.'))", - \ '\[\|(\|{', '\]\|)\|}') - - " If inside brackets, indent relative to the brackets, but don't outdent an - " already indented line. - if matchlnum - return max([indent(a:curlnum), indent(matchlnum) + s:ShiftWidth()]) - endif - - " No special rules applied, so use the default policy. - exec 'return' s:GetDefaultPolicy(a:curlnum) -endfunction diff --git a/sources_non_forked/vim-coffee-script/indent/litcoffee.vim b/sources_non_forked/vim-coffee-script/indent/litcoffee.vim deleted file mode 100644 index 599cbea8b9..0000000000 --- a/sources_non_forked/vim-coffee-script/indent/litcoffee.vim +++ /dev/null @@ -1,22 +0,0 @@ -if exists('b:did_indent') - finish -endif - -runtime! indent/coffee.vim - -let b:did_indent = 1 - -setlocal indentexpr=GetLitCoffeeIndent() - -if exists('*GetLitCoffeeIndent') - finish -endif - -function GetLitCoffeeIndent() - if searchpair('^ \|\t', '', '$', 'bWnm') > 0 - return GetCoffeeIndent(v:lnum) - else - return -1 - endif -endfunc - diff --git a/sources_non_forked/vim-coffee-script/syntax/coffee.vim b/sources_non_forked/vim-coffee-script/syntax/coffee.vim deleted file mode 100644 index bd8de587d6..0000000000 --- a/sources_non_forked/vim-coffee-script/syntax/coffee.vim +++ /dev/null @@ -1,221 +0,0 @@ -" Language: CoffeeScript -" Maintainer: Mick Koch -" URL: http://github.com/kchmck/vim-coffee-script -" License: WTFPL - -" Bail if our syntax is already loaded. -if exists('b:current_syntax') && b:current_syntax == 'coffee' - finish -endif - -" Include JavaScript for coffeeEmbed. -syn include @coffeeJS syntax/javascript.vim -silent! unlet b:current_syntax - -" Highlight long strings. -syntax sync fromstart - -" These are `matches` instead of `keywords` because vim's highlighting -" priority for keywords is higher than matches. This causes keywords to be -" highlighted inside matches, even if a match says it shouldn't contain them -- -" like with coffeeAssign and coffeeDot. -syn match coffeeStatement /\<\%(return\|break\|continue\|throw\)\>/ display -hi def link coffeeStatement Statement - -syn match coffeeRepeat /\<\%(for\|while\|until\|loop\)\>/ display -hi def link coffeeRepeat Repeat - -syn match coffeeConditional /\<\%(if\|else\|unless\|switch\|when\|then\)\>/ -\ display -hi def link coffeeConditional Conditional - -syn match coffeeException /\<\%(try\|catch\|finally\)\>/ display -hi def link coffeeException Exception - -syn match coffeeKeyword /\<\%(new\|in\|of\|from\|by\|and\|or\|not\|is\|isnt\|class\|extends\|super\|do\|yield\|debugger\|import\|export\|default\|await\)\>/ -\ display -" The `own` keyword is only a keyword after `for`. -syn match coffeeKeyword /\/ contained containedin=coffeeRepeat -\ display -hi def link coffeeKeyword Keyword - -syn match coffeeOperator /\<\%(instanceof\|typeof\|delete\)\>/ display -hi def link coffeeOperator Operator - -" The first case matches symbol operators only if they have an operand before. -syn match coffeeExtendedOp /\%(\S\s*\)\@<=[+\-*/%&|\^=!<>?.]\{-1,}\|[-=]>\|--\|++\|:/ -\ display -syn match coffeeExtendedOp /\<\%(and\|or\)=/ display -hi def link coffeeExtendedOp coffeeOperator - -" This is separate from `coffeeExtendedOp` to help differentiate commas from -" dots. -syn match coffeeSpecialOp /[,;]/ display -hi def link coffeeSpecialOp SpecialChar - -syn match coffeeBoolean /\<\%(true\|on\|yes\|false\|off\|no\)\>/ display -hi def link coffeeBoolean Boolean - -syn match coffeeGlobal /\<\%(null\|undefined\)\>/ display -hi def link coffeeGlobal Type - -" A special variable -syn match coffeeSpecialVar /\<\%(this\|prototype\|arguments\)\>/ display -hi def link coffeeSpecialVar Special - -" An @-variable -syn match coffeeSpecialIdent /@\%(\%(\I\|\$\)\%(\i\|\$\)*\)\?/ display -hi def link coffeeSpecialIdent Identifier - -" A class-like name that starts with a capital letter -syn match coffeeObject /\<\u\w*\>/ display -hi def link coffeeObject Structure - -" A constant-like name in SCREAMING_CAPS -syn match coffeeConstant /\<\u[A-Z0-9_]\+\>/ display -hi def link coffeeConstant Constant - -" A variable name -syn cluster coffeeIdentifier contains=coffeeSpecialVar,coffeeSpecialIdent, -\ coffeeObject,coffeeConstant - -" A non-interpolated string -syn cluster coffeeBasicString contains=@Spell,coffeeEscape -" An interpolated string -syn cluster coffeeInterpString contains=@coffeeBasicString,coffeeInterp - -" Regular strings -syn region coffeeString start=/"/ skip=/\\\\\|\\"/ end=/"/ -\ contains=@coffeeInterpString -syn region coffeeString start=/'/ skip=/\\\\\|\\'/ end=/'/ -\ contains=@coffeeBasicString -hi def link coffeeString String - -" A integer, including a leading plus or minus -syn match coffeeNumber /\%(\i\|\$\)\@/ display -syn match coffeeNumber /\<0[bB][01]\+\>/ display -syn match coffeeNumber /\<0[oO][0-7]\+\>/ display -syn match coffeeNumber /\<\%(Infinity\|NaN\)\>/ display -hi def link coffeeNumber Number - -" A floating-point number, including a leading plus or minus -syn match coffeeFloat /\%(\i\|\$\)\@/ -\ display -hi def link coffeeReservedError Error - -" A normal object assignment -syn match coffeeObjAssign /@\?\%(\I\|\$\)\%(\i\|\$\)*\s*\ze::\@!/ contains=@coffeeIdentifier display -hi def link coffeeObjAssign Identifier - -syn keyword coffeeTodo TODO FIXME XXX contained -hi def link coffeeTodo Todo - -syn match coffeeComment /#.*/ contains=@Spell,coffeeTodo -hi def link coffeeComment Comment - -syn region coffeeBlockComment start=/####\@!/ end=/###/ -\ contains=@Spell,coffeeTodo -hi def link coffeeBlockComment coffeeComment - -" A comment in a heregex -syn region coffeeHeregexComment start=/#/ end=/\ze\/\/\/\|$/ contained -\ contains=@Spell,coffeeTodo -hi def link coffeeHeregexComment coffeeComment - -" Embedded JavaScript -syn region coffeeEmbed matchgroup=coffeeEmbedDelim -\ start=/`/ skip=/\\\\\|\\`/ end=/`/ keepend -\ contains=@coffeeJS -hi def link coffeeEmbedDelim Delimiter - -syn region coffeeInterp matchgroup=coffeeInterpDelim start=/#{/ end=/}/ contained -\ contains=@coffeeAll -hi def link coffeeInterpDelim PreProc - -" A string escape sequence -syn match coffeeEscape /\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\./ contained display -hi def link coffeeEscape SpecialChar - -" A regex -- must not follow a parenthesis, number, or identifier, and must not -" be followed by a number -syn region coffeeRegex start=#\%(\%()\|\%(\i\|\$\)\@ -" URL: https://github.com/mintplant/vim-literate-coffeescript -" License: MIT - -if exists('b:current_syntax') && b:current_syntax == 'litcoffee' - finish -endif - -syn include @markdown syntax/markdown.vim -syn include @coffee syntax/coffee.vim - -" Partition the file into notCoffee and inlineCoffee. Each line will match -" exactly one of these regions. notCoffee matches with a zero-width -" look-behind. -syn region notCoffee start='^\%( \|\t\)\@> #{ == { { { } } } == } << " -" >> #{ == { abc: { def: 42 } } == } << " diff --git a/sources_non_forked/vim-coffee-script/test/test-ops.coffee b/sources_non_forked/vim-coffee-script/test/test-ops.coffee deleted file mode 100644 index 54be8dba3f..0000000000 --- a/sources_non_forked/vim-coffee-script/test/test-ops.coffee +++ /dev/null @@ -1,90 +0,0 @@ -# Various operators -abc instanceof def -typeof abc -delete abc -abc::def - -abc + def -abc - def -abc * def -abc / def -abc % def -abc & def -abc | def -abc ^ def -abc >> def -abc << def -abc >>> def -abc ? def -abc && def -abc and def -abc || def -abc or def - -abc += def -abc -= def -abc *= def -abc /= def -abc %= def -abc &= def -abc |= def -abc ^= def -abc >>= def -abc <<= def -abc >>>= def -abc ?= def -abc &&= def -abc ||= def - -abc and= def -abc or= def - -abc.def.ghi -abc?.def?.ghi - -abc < def -abc > def -abc = def -abc == def -abc != def -abc <= def -abc >= def - -abc++ -abc-- -++abc ---abc - -# Nested operators -abc[def] = ghi -abc[def[ghi: jkl]] = 42 -@abc[def] = ghi - -abc["#{def = 42}"] = 42 -abc["#{def.ghi = 42}"] = 42 -abc["#{def[ghi] = 42}"] = 42 -abc["#{def['ghi']}"] = 42 - -# Object assignments -abc = - def: 123 - DEF: 123 - @def: 123 - Def: 123 - 'def': 123 - 42: 123 - -# Operators shouldn't be highlighted -vector= -wand= - -abc+++ -abc--- -abc ** def -abc &&& def -abc ^^ def -abc ===== def -abc <==== def -abc >==== def -abc +== def -abc =^= def diff --git a/sources_non_forked/vim-coffee-script/test/test-reserved.coffee b/sources_non_forked/vim-coffee-script/test/test-reserved.coffee deleted file mode 100644 index b841760c87..0000000000 --- a/sources_non_forked/vim-coffee-script/test/test-reserved.coffee +++ /dev/null @@ -1,27 +0,0 @@ -# Should be an error -function = 42 -var = 42 - -# Shouldn't be an error -abc.with = 42 -function: 42 -var: 42 - -# Keywords shouldn't be highlighted -abc.function -abc.do -abc.break -abc.true - -abc::function -abc::do -abc::break -abc::true - -abc:: function -abc. function - -# Numbers should be highlighted -def.42 -def .42 -def::42 diff --git a/sources_non_forked/vim-coffee-script/test/test.coffee.md b/sources_non_forked/vim-coffee-script/test/test.coffee.md deleted file mode 100644 index 62b99b7d82..0000000000 --- a/sources_non_forked/vim-coffee-script/test/test.coffee.md +++ /dev/null @@ -1,117 +0,0 @@ -The **Scope** class regulates lexical scoping within CoffeeScript. As you -generate code, you create a tree of scopes in the same shape as the nested -function bodies. Each scope knows about the variables declared within it, -and has a reference to its parent enclosing scope. In this way, we know which -variables are new and need to be declared with `var`, and which are shared -with external scopes. - -Import the helpers we plan to use. - - {extend, last} = require './helpers' - - exports.Scope = class Scope - -The `root` is the top-level **Scope** object for a given file. - - @root: null - -Initialize a scope with its parent, for lookups up the chain, -as well as a reference to the **Block** node it belongs to, which is -where it should declare its variables, and a reference to the function that -it belongs to. - - constructor: (@parent, @expressions, @method) -> - @variables = [{name: 'arguments', type: 'arguments'}] - @positions = {} - Scope.root = this unless @parent - -Adds a new variable or overrides an existing one. - - add: (name, type, immediate) -> - return @parent.add name, type, immediate if @shared and not immediate - if Object::hasOwnProperty.call @positions, name - @variables[@positions[name]].type = type - else - @positions[name] = @variables.push({name, type}) - 1 - -When `super` is called, we need to find the name of the current method we're -in, so that we know how to invoke the same method of the parent class. This -can get complicated if super is being called from an inner function. -`namedMethod` will walk up the scope tree until it either finds the first -function object that has a name filled in, or bottoms out. - - namedMethod: -> - return @method if @method.name or !@parent - @parent.namedMethod() - -Look up a variable name in lexical scope, and declare it if it does not -already exist. - - find: (name) -> - return yes if @check name - @add name, 'var' - no - -Reserve a variable name as originating from a function parameter for this -scope. No `var` required for internal references. - - parameter: (name) -> - return if @shared and @parent.check name, yes - @add name, 'param' - -Just check to see if a variable has already been declared, without reserving, -walks up to the root scope. - - check: (name) -> - !!(@type(name) or @parent?.check(name)) - -Generate a temporary variable name at the given index. - - temporary: (name, index) -> - if name.length > 1 - '_' + name + if index > 1 then index - 1 else '' - else - '_' + (index + parseInt name, 36).toString(36).replace /\d/g, 'a' - -Gets the type of a variable. - - type: (name) -> - return v.type for v in @variables when v.name is name - null - -If we need to store an intermediate result, find an available name for a -compiler-generated variable. `_var`, `_var2`, and so on... - - freeVariable: (name, reserve=true) -> - index = 0 - index++ while @check((temp = @temporary name, index)) - @add temp, 'var', yes if reserve - temp - -Ensure that an assignment is made at the top of this scope -(or at the top-level scope, if requested). - - assign: (name, value) -> - @add name, {value, assigned: yes}, yes - @hasAssignments = yes - -Does this scope have any declared variables? - - hasDeclarations: -> - !!@declaredVariables().length - -Return the list of variables first declared in this scope. - - declaredVariables: -> - realVars = [] - tempVars = [] - for v in @variables when v.type is 'var' - (if v.name.charAt(0) is '_' then tempVars else realVars).push v.name - realVars.sort().concat tempVars.sort() - -Return the list of assignments that are supposed to be made at the top -of this scope. - - assignedVariables: -> - "#{v.name} = #{v.type.value}" for v in @variables when v.type.assigned - diff --git a/sources_non_forked/vim-coffee-script/test/test.haml b/sources_non_forked/vim-coffee-script/test/test.haml deleted file mode 100644 index ae19fba5ec..0000000000 --- a/sources_non_forked/vim-coffee-script/test/test.haml +++ /dev/null @@ -1,3 +0,0 @@ -:coffeescript - class Hello - # test diff --git a/sources_non_forked/vim-coffee-script/test/test.html b/sources_non_forked/vim-coffee-script/test/test.html deleted file mode 100644 index 0da7b62dab..0000000000 --- a/sources_non_forked/vim-coffee-script/test/test.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - diff --git a/sources_non_forked/vim-coffee-script/test/test.litcoffee b/sources_non_forked/vim-coffee-script/test/test.litcoffee deleted file mode 100644 index 62b99b7d82..0000000000 --- a/sources_non_forked/vim-coffee-script/test/test.litcoffee +++ /dev/null @@ -1,117 +0,0 @@ -The **Scope** class regulates lexical scoping within CoffeeScript. As you -generate code, you create a tree of scopes in the same shape as the nested -function bodies. Each scope knows about the variables declared within it, -and has a reference to its parent enclosing scope. In this way, we know which -variables are new and need to be declared with `var`, and which are shared -with external scopes. - -Import the helpers we plan to use. - - {extend, last} = require './helpers' - - exports.Scope = class Scope - -The `root` is the top-level **Scope** object for a given file. - - @root: null - -Initialize a scope with its parent, for lookups up the chain, -as well as a reference to the **Block** node it belongs to, which is -where it should declare its variables, and a reference to the function that -it belongs to. - - constructor: (@parent, @expressions, @method) -> - @variables = [{name: 'arguments', type: 'arguments'}] - @positions = {} - Scope.root = this unless @parent - -Adds a new variable or overrides an existing one. - - add: (name, type, immediate) -> - return @parent.add name, type, immediate if @shared and not immediate - if Object::hasOwnProperty.call @positions, name - @variables[@positions[name]].type = type - else - @positions[name] = @variables.push({name, type}) - 1 - -When `super` is called, we need to find the name of the current method we're -in, so that we know how to invoke the same method of the parent class. This -can get complicated if super is being called from an inner function. -`namedMethod` will walk up the scope tree until it either finds the first -function object that has a name filled in, or bottoms out. - - namedMethod: -> - return @method if @method.name or !@parent - @parent.namedMethod() - -Look up a variable name in lexical scope, and declare it if it does not -already exist. - - find: (name) -> - return yes if @check name - @add name, 'var' - no - -Reserve a variable name as originating from a function parameter for this -scope. No `var` required for internal references. - - parameter: (name) -> - return if @shared and @parent.check name, yes - @add name, 'param' - -Just check to see if a variable has already been declared, without reserving, -walks up to the root scope. - - check: (name) -> - !!(@type(name) or @parent?.check(name)) - -Generate a temporary variable name at the given index. - - temporary: (name, index) -> - if name.length > 1 - '_' + name + if index > 1 then index - 1 else '' - else - '_' + (index + parseInt name, 36).toString(36).replace /\d/g, 'a' - -Gets the type of a variable. - - type: (name) -> - return v.type for v in @variables when v.name is name - null - -If we need to store an intermediate result, find an available name for a -compiler-generated variable. `_var`, `_var2`, and so on... - - freeVariable: (name, reserve=true) -> - index = 0 - index++ while @check((temp = @temporary name, index)) - @add temp, 'var', yes if reserve - temp - -Ensure that an assignment is made at the top of this scope -(or at the top-level scope, if requested). - - assign: (name, value) -> - @add name, {value, assigned: yes}, yes - @hasAssignments = yes - -Does this scope have any declared variables? - - hasDeclarations: -> - !!@declaredVariables().length - -Return the list of variables first declared in this scope. - - declaredVariables: -> - realVars = [] - tempVars = [] - for v in @variables when v.type is 'var' - (if v.name.charAt(0) is '_' then tempVars else realVars).push v.name - realVars.sort().concat tempVars.sort() - -Return the list of assignments that are supposed to be made at the top -of this scope. - - assignedVariables: -> - "#{v.name} = #{v.type.value}" for v in @variables when v.type.assigned - diff --git a/sources_non_forked/vim-gist/.github/FUNDING.yml b/sources_non_forked/vim-gist/.github/FUNDING.yml deleted file mode 100644 index 351ae11a87..0000000000 --- a/sources_non_forked/vim-gist/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: mattn # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/sources_non_forked/vim-gist/README.md b/sources_non_forked/vim-gist/README.md deleted file mode 100644 index 06f049fc10..0000000000 --- a/sources_non_forked/vim-gist/README.md +++ /dev/null @@ -1,289 +0,0 @@ -# Gist.vim - -This is a vimscript for creating gists (http://gist.github.com). - -For the latest version please see https://github.com/mattn/vim-gist. - -## Usage: - -- Post current buffer to gist, using default privacy option. - - :Gist - -- Post selected text to gist, using default privacy option. - This applies to all permutations listed below (except multi). - - :'<,'>Gist - -- Create a private gist. - - :Gist -p - -- Create a public gist. - (Only relevant if you've set gists to be private by default.) - - :Gist -P - -> This is only relevant if you've set gists to be private by default; -> if you get an empty gist list, try ":Gist --abandon". - -- Create a gist anonymously. - - :Gist -a - -- Create a gist with all open buffers. - - :Gist -m - -- Edit the gist (you need to have opened the gist buffer first). - You can update the gist with the ":w" command within the gist buffer. - - :Gist -e - -- Edit the gist with name 'foo.js' (you need to have opened the gist buffer - first). - - :Gist -e foo.js - -- Post/Edit with the description " (you need to have opened the gist buffer - first). > - - :Gist -s something - :Gist -e -s something - -- Delete the gist (you need to have opened the gist buffer first). - Password authentication is needed. - - :Gist -d - -- Fork the gist (you need to have opened the gist buffer first). - Password authentication is needed. - - :Gist -f - -- Star the gist (you need to have opened the gist buffer first). - Password authentication is needed. - - :Gist +1 - -- Unstar the gist (you need to have opened the gist buffer first). - Password authentication is needed. - - :Gist -1 - -- Get gist XXXXX. - - :Gist XXXXX - -- Get gist XXXXX and add to clipboard. - - :Gist -c XXXXX - -- List your public gists. - - :Gist -l - -- List gists from user "mattn". - - :Gist -l mattn - -- Specify the number of gists listed: - - :Gist -l -n 100 - -- List everyone's gists. - - :Gist -la - -- List gists from your starred gists. - - :Gist -ls - -- Open the gist on browser after you post or update it. - - :Gist -b - -## List Feature - -- Useful mappings on the gist-listing buffer: - - Both `o` or `Enter` open the gist file in a new buffer, and close the - vim-gist listing one. - - `b` opens the gist file in a browser; this is necessary because - `Shift-Enter` (as was originally) only works for GUI vim. - - `y` copies the contents of the selected gist to the clipboard, and - closes the vim-gist buffer. - - `p` pastes the contents of the selected gist to the buffer from where - vim-gist was called, and closes the vim-gist buffer. - - Hitting `Escape` or `Tab` at the vim-gist buffer closes it. - -- Gist listing has fixed-length columns now, more amenable to eye inspection. - Every line on the gist-listing buffer contains the gist id, name and - description, in that order. Columns are now padded and truncated to offer a - faster browsing, in the following way: - - The gist id string is fixed at 32 characters. - - The length (in characters) of the name of the gist is fixed and - can be set by the user using, for example: - - `let g:gistvim_namelength = 20` - - The default value for `gistvim_namelength` is 30. If the gist (file)name - exceeds that length, it is truncated to the specified length. - - Finally, the gist description is truncated in length to fit the remaining - of the line, avoiding wrapped lines that mess up the table layout. - - Note that the gist listing buffer now does not show the field 'code' - (not sure what that did in the first place). - -## Tips: - -If you set g:gist_clip_command, gist.vim will copy the gist code with option -'-c'. - -- Mac: - - let g:gist_clip_command = 'pbcopy' - -- Linux: - - let g:gist_clip_command = 'xclip -selection clipboard' - -- Others (cygwin?): - - let g:gist_clip_command = 'putclip' - -If you want to detect filetype from the filename: - - let g:gist_detect_filetype = 1 - -If you want to open browser after the post: - - let g:gist_open_browser_after_post = 1 - -If you want to change the browser: - - let g:gist_browser_command = 'w3m %URL%' - -or: - - let g:gist_browser_command = 'opera %URL% &' - -On windows, this should work with your user settings. - -If you want to show your private gists with ":Gist -l": - - let g:gist_show_privates = 1 - -If you want your gist to be private by default: - - let g:gist_post_private = 1 - -If you want your gist to be anonymous by default: - - let g:gist_post_anonymous = 1 - -If you want to manipulate multiple files in a gist: - - let g:gist_get_multiplefile = 1 - -If you want to use on GitHub Enterprise: - - let g:gist_api_url = 'http://your-github-enterprise-domain/api/v3' - -You need to either set global git config: - - $ git config --global github.user Username - -If you want to list more than 30 gists per page (maximum is 100): - - let g:gist_per_page_limit = 100 - -## License: - - Copyright 2010 by Yasuhiro Matsumoto - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - - -## Install: - -Copy it to your plugin directory. -gist.vim will create a curl cookie-jar file in your runtimepath. - -- rtp: - - autoload/gist.vim - - plugin/gist.vim - -If you want to uninstall gist.vim, remember to also remove `~/.gist-vim`. - -You need to install webapi-vim also: - - http://www.vim.org/scripts/script.php?script_id=4019 - -If you want to use latest one: - - https://github.com/mattn/webapi-vim - -### Install with [Vundle](https://github.com/gmarik/vundle) - -Add the following lines to your `.vimrc`. - - Bundle 'mattn/webapi-vim' - Bundle 'mattn/vim-gist' - -Now restart Vim and run `:BundleInstall`. - -### Install with [NeoBundle](https://github.com/Shougo/neobundle.vim) - -Add the following line to your `.vimrc`. - - NeoBundle 'mattn/vim-gist', {'depends': 'mattn/webapi-vim'} - -## Requirements: - -- curl command (http://curl.haxx.se/) -- webapi-vim (https://github.com/mattn/webapi-vim) -- and if you want to use your git profile, the git command-line client. - -## Setup: - -This plugin supports both basic and two-factor authentication using GitHub -API v3. The plugin stores its credentials in `~/.gist-vim`. - -First, you need to set your GitHub username in git's global configuration: - - $ git config --global github.user - -Then vim-gist will ask for your password in order to create an access -token. If you have two-factor authentication enabled, vim-gist will also -prompt you to enter the two-factor key you receive. - -NOTE: -If you want you can set it directly to `g:github_user` and `g:gist_token`. - -Whichever type of authentication you use, your GitHub password will not be -stored, only a OAuth access token produced specifically for vim-gist. The -token is stored in `~/.gist-vim`. If you stop using the plugin, you can -easily remove this file. To revoke the associated GitHub token, go to the -list of ["Authorized applications" on GitHub's "Account Settings" -page][uas]. - -[uas]: https://github.com/settings/applications - -**Note:** the username is optional if you only send anonymous gists. diff --git a/sources_non_forked/vim-gist/autoload/gist.vim b/sources_non_forked/vim-gist/autoload/gist.vim deleted file mode 100644 index 1b9f04adfd..0000000000 --- a/sources_non_forked/vim-gist/autoload/gist.vim +++ /dev/null @@ -1,1185 +0,0 @@ -"============================================================================= -" File: gist.vim -" Author: Yasuhiro Matsumoto -" Last Change: 10-Oct-2016. -" Version: 7.3 -" WebPage: http://github.com/mattn/vim-gist -" License: BSD - -let s:save_cpo = &cpoptions -set cpoptions&vim - -if exists('g:gist_disabled') && g:gist_disabled == 1 - function! gist#Gist(...) abort - endfunction - finish -endif - -if !exists('g:github_user') && !executable('git') - echohl ErrorMsg | echomsg 'Gist: require ''git'' command' | echohl None - finish -endif - -if !executable('curl') - echohl ErrorMsg | echomsg 'Gist: require ''curl'' command' | echohl None - finish -endif - -if globpath(&rtp, 'autoload/webapi/http.vim') ==# '' - echohl ErrorMsg | echomsg 'Gist: require ''webapi'', install https://github.com/mattn/webapi-vim' | echohl None - finish -else - call webapi#json#true() -endif - -let s:gist_token_file = expand(get(g:, 'gist_token_file', '~/.gist-vim')) -let s:system = function(get(g:, 'webapi#system_function', 'system')) - -if !exists('g:github_user') - let g:github_user = substitute(s:system('git config --get github.user'), "\n", '', '') - if strlen(g:github_user) == 0 - let g:github_user = $GITHUB_USER - end -endif - -if !exists('g:gist_api_url') - let g:gist_api_url = substitute(s:system('git config --get github.apiurl'), "\n", '', '') - if strlen(g:gist_api_url) == 0 - let g:gist_api_url = 'https://api.github.com/' - end - if exists('g:github_api_url') && !exists('g:gist_shutup_issue154') - if matchstr(g:gist_api_url, 'https\?://\zs[^/]\+\ze') != matchstr(g:github_api_url, 'https\?://\zs[^/]\+\ze') - echohl WarningMsg - echo '--- Warning ---' - echo 'It seems that you set different URIs for github_api_url/gist_api_url.' - echo 'If you want to remove this message: let g:gist_shutup_issue154 = 1' - echohl None - if confirm('Continue?', '&Yes\n&No') != 1 - let g:gist_disabled = 1 - finish - endif - redraw! - endif - endif -endif -if g:gist_api_url !~# '/$' - let g:gist_api_url .= '/' -endif - -if !exists('g:gist_update_on_write') - let g:gist_update_on_write = 1 -endif - -function! s:get_browser_command() abort - let gist_browser_command = get(g:, 'gist_browser_command', '') - if gist_browser_command ==# '' - if has('win32') || has('win64') - let gist_browser_command = '!start rundll32 url.dll,FileProtocolHandler %URL%' - elseif has('mac') || has('macunix') || has('gui_macvim') || system('uname') =~? '^darwin' - let gist_browser_command = 'open %URL%' - elseif executable('xdg-open') - let gist_browser_command = 'xdg-open %URL%' - elseif executable('firefox') - let gist_browser_command = 'firefox %URL% &' - else - let gist_browser_command = '' - endif - endif - return gist_browser_command -endfunction - -function! s:open_browser(url) abort - let cmd = s:get_browser_command() - if len(cmd) == 0 - redraw - echohl WarningMsg - echo 'It seems that you don''t have general web browser. Open URL below.' - echohl None - echo a:url - return - endif - let quote = &shellxquote == '"' ? "'" : '"' - if cmd =~# '^!' - let cmd = substitute(cmd, '%URL%', '\=quote.a:url.quote', 'g') - silent! exec cmd - elseif cmd =~# '^:[A-Z]' - let cmd = substitute(cmd, '%URL%', '\=a:url', 'g') - exec cmd - else - let cmd = substitute(cmd, '%URL%', '\=quote.a:url.quote', 'g') - call system(cmd) - endif -endfunction - -function! s:shellwords(str) abort - let words = split(a:str, '\%(\([^ \t\''"]\+\)\|''\([^\'']*\)''\|"\(\%([^\"\\]\|\\.\)*\)"\)\zs\s*\ze') - let words = map(words, 'substitute(v:val, ''\\\([\\ ]\)'', ''\1'', "g")') - let words = map(words, 'matchstr(v:val, ''^\%\("\zs\(.*\)\ze"\|''''\zs\(.*\)\ze''''\|.*\)$'')') - return words -endfunction - -function! s:truncate(str, num) - let mx_first = '^\(.\)\(.*\)$' - let str = a:str - let ret = '' - let width = 0 - while 1 - let char = substitute(str, mx_first, '\1', '') - let cells = strdisplaywidth(char) - if cells == 0 || width + cells > a:num - break - endif - let width = width + cells - let ret .= char - let str = substitute(str, mx_first, '\2', '') - endwhile - while width + 1 <= a:num - let ret .= ' ' - let width = width + 1 - endwhile - return ret -endfunction - -function! s:format_gist(gist) abort - let files = sort(keys(a:gist.files)) - if empty(files) - return '' - endif - let file = a:gist.files[files[0]] - let name = file.filename - if has_key(file, 'content') - let code = file.content - let code = "\n".join(map(split(code, "\n"), '" ".v:val'), "\n") - else - let code = '' - endif - let desc = type(a:gist.description)==0 || a:gist.description ==# '' ? '' : a:gist.description - let name = substitute(name, '[\r\n\t]', ' ', 'g') - let name = substitute(name, ' ', ' ', 'g') - let desc = substitute(desc, '[\r\n\t]', ' ', 'g') - let desc = substitute(desc, ' ', ' ', 'g') - " Display a nice formatted (and truncated if needed) table of gists on screen - " Calculate field lengths for gist-listing formatting on screen - redir =>a |exe 'sil sign place buffer='.bufnr('')|redir end - let signlist = split(a, '\n') - let width = winwidth(0) - ((&number||&relativenumber) ? &numberwidth : 0) - &foldcolumn - (len(signlist) > 2 ? 2 : 0) - let idlen = 33 - let namelen = get(g:, 'gist_namelength', 30) - let desclen = width - (idlen + namelen + 10) - return printf('gist: %s %s %s', s:truncate(a:gist.id, idlen), s:truncate(name, namelen), s:truncate(desc, desclen)) -endfunction - -" Note: A colon in the file name has side effects on Windows due to NTFS Alternate Data Streams; avoid it. -let s:bufprefix = 'gist' . (has('unix') ? ':' : '_') -function! s:GistList(gistls, page, pagelimit) abort - if a:gistls ==# '-all' - let url = g:gist_api_url.'gists/public' - elseif get(g:, 'gist_show_privates', 0) && a:gistls ==# 'starred' - let url = g:gist_api_url.'gists/starred' - elseif get(g:, 'gist_show_privates') && a:gistls ==# 'mine' - let url = g:gist_api_url.'gists' - else - let url = g:gist_api_url.'users/'.a:gistls.'/gists' - endif - let winnum = bufwinnr(bufnr(s:bufprefix.a:gistls)) - if winnum != -1 - if winnum != bufwinnr('%') - exe winnum 'wincmd w' - endif - setlocal modifiable - else - if get(g:, 'gist_list_vsplit', 0) - exec 'silent noautocmd vsplit +set\ winfixwidth ' s:bufprefix.a:gistls - elseif get(g:, 'gist_list_rightbelow', 0) - exec 'silent noautocmd rightbelow 5 split +set\ winfixheight ' s:bufprefix.a:gistls - else - exec 'silent noautocmd split' s:bufprefix.a:gistls - endif - endif - - let url = url . '?per_page=' . a:pagelimit - if a:page > 1 - let oldlines = getline(0, line('$')) - let url = url . '&page=' . a:page - endif - - setlocal modifiable - let old_undolevels = &undolevels - let oldlines = [] - silent %d _ - - redraw | echon 'Listing gists... ' - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - bw! - redraw - echohl ErrorMsg | echomsg v:errmsg | echohl None - return - endif - let res = webapi#http#get(url, '', { 'Authorization': auth }) - if v:shell_error != 0 - bw! - redraw - echohl ErrorMsg | echomsg 'Gists not found' | echohl None - return - endif - let content = webapi#json#decode(res.content) - if type(content) == 4 && has_key(content, 'message') && len(content.message) - bw! - redraw - echohl ErrorMsg | echomsg content.message | echohl None - if content.message ==# 'Bad credentials' - call delete(s:gist_token_file) - endif - return - endif - - let lines = map(filter(content, '!empty(v:val.files)'), 's:format_gist(v:val)') - call setline(1, split(join(lines, "\n"), "\n")) - - $put='more...' - - let b:gistls = a:gistls - let b:page = a:page - setlocal buftype=nofile bufhidden=hide noswapfile - setlocal cursorline - setlocal nomodified - setlocal nomodifiable - syntax match SpecialKey /^gist:/he=e-1 - syntax match Title /^gist: \S\+/hs=s+5 contains=ALL - nnoremap :call GistListAction(0) - nnoremap o :call GistListAction(0) - nnoremap b :call GistListAction(1) - nnoremap y :call GistListAction(2) - nnoremap p :call GistListAction(3) - nnoremap :bw - nnoremap :call GistListAction(1) - - cal cursor(1+len(oldlines),1) - nohlsearch - redraw | echo '' -endfunction - -function! gist#list_recursively(user, ...) abort - let use_cache = get(a:000, 0, 1) - let limit = get(a:000, 1, -1) - let verbose = get(a:000, 2, 1) - if a:user ==# 'mine' - let url = g:gist_api_url . 'gists' - elseif a:user ==# 'starred' - let url = g:gist_api_url . 'gists/starred' - else - let url = g:gist_api_url.'users/'.a:user.'/gists' - endif - - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - " anonymous user cannot get gists to prevent infinite recursive loading - return [] - endif - - if use_cache && exists('g:gist_list_recursively_cache') - if has_key(g:gist_list_recursively_cache, a:user) - return webapi#json#decode(g:gist_list_recursively_cache[a:user]) - endif - endif - - let page = 1 - let gists = [] - let lastpage = -1 - - function! s:get_lastpage(res) abort - let links = split(a:res.header[match(a:res.header, 'Link')], ',') - let link = links[match(links, 'rel=[''"]last[''"]')] - let page = str2nr(matchlist(link, '\%(page=\)\(\d\+\)')[1]) - return page - endfunction - - if verbose > 0 - redraw | echon 'Loading gists...' - endif - - while limit == -1 || page <= limit - let res = webapi#http#get(url.'?page='.page, '', {'Authorization': auth}) - if limit == -1 - " update limit to the last page - let limit = s:get_lastpage(res) - endif - if verbose > 0 - redraw | echon 'Loading gists... ' . page . '/' . limit . ' pages has loaded.' - endif - let gists = gists + webapi#json#decode(res.content) - let page = page + 1 - endwhile - let g:gist_list_recursively_cache = get(g:, 'gist_list_recursively_cache', {}) - let g:gist_list_recursively_cache[a:user] = webapi#json#encode(gists) - return gists -endfunction - -function! gist#list(user, ...) abort - let page = get(a:000, 0, 0) - if a:user ==# '-all' - let url = g:gist_api_url.'gists/public' - elseif get(g:, 'gist_show_privates', 0) && a:user ==# 'starred' - let url = g:gist_api_url.'gists/starred' - elseif get(g:, 'gist_show_privates') && a:user ==# 'mine' - let url = g:gist_api_url.'gists' - else - let url = g:gist_api_url.'users/'.a:user.'/gists' - endif - - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - return [] - endif - let res = webapi#http#get(url, '', { 'Authorization': auth }) - return webapi#json#decode(res.content) -endfunction - -function! s:GistGetFileName(gistid) abort - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - return '' - endif - let res = webapi#http#get(g:gist_api_url.'gists/'.a:gistid, '', { 'Authorization': auth }) - let gist = webapi#json#decode(res.content) - if has_key(gist, 'files') - return sort(keys(gist.files))[0] - endif - return '' -endfunction - -function! s:GistDetectFiletype(gistid) abort - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - return '' - endif - let res = webapi#http#get(g:gist_api_url.'gists/'.a:gistid, '', { 'Authorization': auth }) - let gist = webapi#json#decode(res.content) - let filename = sort(keys(gist.files))[0] - let ext = fnamemodify(filename, ':e') - if has_key(s:extmap, ext) - let type = s:extmap[ext] - else - let type = get(gist.files[filename], 'type', 'text') - endif - silent! exec 'setlocal ft='.tolower(type) -endfunction - -function! s:GistWrite(fname) abort - if substitute(a:fname, '\\', '/', 'g') == expand("%:p:gs@\\@/@") - if g:gist_update_on_write != 2 || v:cmdbang - Gist -e - else - echohl ErrorMsg | echomsg 'Please type ":w!" to update a gist.' | echohl None - endif - else - exe 'w'.(v:cmdbang ? '!' : '') fnameescape(v:cmdarg) fnameescape(a:fname) - silent! exe 'file' fnameescape(a:fname) - silent! au! BufWriteCmd - endif -endfunction - -function! s:GistGet(gistid, clipboard) abort - redraw | echon 'Getting gist... ' - let res = webapi#http#get(g:gist_api_url.'gists/'.a:gistid, '', { 'Authorization': s:GistGetAuthHeader() }) - if res.status =~# '^2' - try - let gist = webapi#json#decode(res.content) - catch - redraw - echohl ErrorMsg | echomsg 'Gist seems to be broken' | echohl None - return - endtry - if get(g:, 'gist_get_multiplefile', 0) != 0 - let num_file = len(keys(gist.files)) - else - let num_file = 1 - endif - redraw - if num_file > len(keys(gist.files)) - echohl ErrorMsg | echomsg 'Gist not found' | echohl None - return - endif - augroup GistWrite - au! - augroup END - for n in range(num_file) - try - let old_undolevels = &undolevels - let filename = sort(keys(gist.files))[n] - - let winnum = bufwinnr(bufnr(s:bufprefix.a:gistid.'/'.filename)) - if winnum != -1 - if winnum != bufwinnr('%') - exe winnum 'wincmd w' - endif - setlocal modifiable - else - if num_file == 1 - if get(g:, 'gist_edit_with_buffers', 0) - let found = -1 - for wnr in range(1, winnr('$')) - let bnr = winbufnr(wnr) - if bnr != -1 && !empty(getbufvar(bnr, 'gist')) - let found = wnr - break - endif - endfor - if found != -1 - exe found 'wincmd w' - setlocal modifiable - else - if get(g:, 'gist_list_vsplit', 0) - exec 'silent noautocmd rightbelow vnew' - else - exec 'silent noautocmd rightbelow new' - endif - endif - else - silent only! - if get(g:, 'gist_list_vsplit', 0) - exec 'silent noautocmd rightbelow vnew' - else - exec 'silent noautocmd rightbelow new' - endif - endif - else - if get(g:, 'gist_list_vsplit', 0) - exec 'silent noautocmd rightbelow vnew' - else - exec 'silent noautocmd rightbelow new' - endif - endif - setlocal noswapfile - silent exec 'noautocmd file' s:bufprefix.a:gistid.'/'.fnameescape(filename) - endif - set undolevels=-1 - filetype detect - silent %d _ - - let content = gist.files[filename].content - call setline(1, split(content, "\n")) - let b:gist = { - \ 'filename': filename, - \ 'id': gist.id, - \ 'description': gist.description, - \ 'private': gist.public =~# 'true', - \} - catch - let &undolevels = old_undolevels - bw! - redraw - echohl ErrorMsg | echomsg 'Gist contains binary' | echohl None - return - endtry - let &undolevels = old_undolevels - setlocal buftype=acwrite bufhidden=hide noswapfile - setlocal nomodified - doau StdinReadPost,BufRead,BufReadPost - let gist_detect_filetype = get(g:, 'gist_detect_filetype', 0) - if (&ft ==# '' && gist_detect_filetype == 1) || gist_detect_filetype == 2 - call s:GistDetectFiletype(a:gistid) - endif - if a:clipboard - if exists('g:gist_clip_command') - exec 'silent w !'.g:gist_clip_command - elseif has('clipboard') - silent! %yank + - else - %yank - endif - endif - 1 - augroup GistWrite - au! BufWriteCmd call s:GistWrite(expand("")) - augroup END - endfor - else - bw! - redraw - echohl ErrorMsg | echomsg 'Gist not found' | echohl None - return - endif -endfunction - -function! s:GistListAction(mode) abort - let line = getline('.') - let mx = '^gist:\s*\zs\(\w\+\)\ze.*' - if line =~# mx - let gistid = matchstr(line, mx) - if a:mode == 1 - call s:open_browser('https://gist.github.com/' . gistid) - elseif a:mode == 0 - call s:GistGet(gistid, 0) - wincmd w - bw - elseif a:mode == 2 - call s:GistGet(gistid, 1) - " TODO close with buffe rname - bdelete - bdelete - elseif a:mode == 3 - call s:GistGet(gistid, 1) - " TODO close with buffe rname - bdelete - bdelete - normal! "+p - endif - return - endif - if line =~# '^more\.\.\.$' - call s:GistList(b:gistls, b:page+1, g:gist_per_page_limit) - return - endif -endfunction - -function! s:GistUpdate(content, gistid, gistnm, desc) abort - let gist = { 'id': a:gistid, 'files' : {}, 'description': '','public': function('webapi#json#true') } - if exists('b:gist') - if has_key(b:gist, 'filename') && len(a:gistnm) > 0 - let gist.files[b:gist.filename] = { 'content': '', 'filename': b:gist.filename } - let b:gist.filename = a:gistnm - endif - if has_key(b:gist, 'private') && b:gist.private | let gist['public'] = function('webapi#json#false') | endif - if has_key(b:gist, 'description') | let gist['description'] = b:gist.description | endif - if has_key(b:gist, 'filename') | let filename = b:gist.filename | endif - else - let filename = a:gistnm - if len(filename) == 0 | let filename = s:GistGetFileName(a:gistid) | endif - if len(filename) == 0 | let filename = s:get_current_filename(1) | endif - endif - - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - redraw - echohl ErrorMsg | echomsg v:errmsg | echohl None - return - endif - - " Update description - " If no new description specified, keep the old description - if a:desc !=# ' ' - let gist['description'] = a:desc - else - let res = webapi#http#get(g:gist_api_url.'gists/'.a:gistid, '', { 'Authorization': auth }) - if res.status =~# '^2' - let old_gist = webapi#json#decode(res.content) - let gist['description'] = old_gist.description - endif - endif - - let gist.files[filename] = { 'content': a:content, 'filename': filename } - - redraw | echon 'Updating gist... ' - let res = webapi#http#post(g:gist_api_url.'gists/' . a:gistid, - \ webapi#json#encode(gist), { - \ 'Authorization': auth, - \ 'Content-Type': 'application/json', - \}) - if res.status =~# '^2' - let obj = webapi#json#decode(res.content) - let loc = obj['html_url'] - let b:gist = {'id': a:gistid, 'filename': filename} - setlocal nomodified - redraw | echomsg 'Done: '.loc - else - let loc = '' - echohl ErrorMsg | echomsg 'Post failed: ' . res.message | echohl None - endif - return loc -endfunction - -function! s:GistDelete(gistid) abort - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - redraw - echohl ErrorMsg | echomsg v:errmsg | echohl None - return - endif - - redraw | echon 'Deleting gist... ' - let res = webapi#http#post(g:gist_api_url.'gists/'.a:gistid, '', { - \ 'Authorization': auth, - \ 'Content-Type': 'application/json', - \}, 'DELETE') - if res.status =~# '^2' - if exists('b:gist') - unlet b:gist - endif - redraw | echomsg 'Done: ' - else - echohl ErrorMsg | echomsg 'Delete failed: ' . res.message | echohl None - endif -endfunction - -function! s:get_current_filename(no) abort - let filename = expand('%:t') - if len(filename) == 0 && &ft !=# '' - let pair = filter(items(s:extmap), 'v:val[1] == &ft') - if len(pair) > 0 - let filename = printf('gistfile%d%s', a:no, pair[0][0]) - endif - endif - if filename ==# '' - let filename = printf('gistfile%d.txt', a:no) - endif - return filename -endfunction - -function! s:update_GistID(id) abort - let view = winsaveview() - normal! gg - let ret = 0 - if search('\:\s*$') - let line = getline('.') - let line = substitute(line, '\s\+$', '', 'g') - call setline('.', line . ' ' . a:id) - let ret = 1 - endif - call winrestview(view) - return ret -endfunction - -" GistPost function: -" Post new gist to github -" -" if there is an embedded gist url or gist id in your file, -" it will just update it. -" -- by c9s -" -" embedded gist id format: -" -" GistID: 123123 -" -function! s:GistPost(content, private, desc, anonymous) abort - let gist = { 'files' : {}, 'description': '','public': function('webapi#json#true') } - if a:desc !=# ' ' | let gist['description'] = a:desc | endif - if a:private | let gist['public'] = function('webapi#json#false') | endif - let filename = s:get_current_filename(1) - let gist.files[filename] = { 'content': a:content, 'filename': filename } - - let header = {'Content-Type': 'application/json'} - if !a:anonymous - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - redraw - echohl ErrorMsg | echomsg v:errmsg | echohl None - return - endif - let header['Authorization'] = auth - endif - - redraw | echon 'Posting it to gist... ' - let res = webapi#http#post(g:gist_api_url.'gists', webapi#json#encode(gist), header) - if res.status =~# '^2' - let obj = webapi#json#decode(res.content) - let loc = obj['html_url'] - let b:gist = { - \ 'filename': filename, - \ 'id': matchstr(loc, '[^/]\+$'), - \ 'description': gist['description'], - \ 'private': a:private, - \} - if s:update_GistID(b:gist['id']) - Gist -e - endif - redraw | echomsg 'Done: '.loc - else - let loc = '' - echohl ErrorMsg | echomsg 'Post failed: '. res.message | echohl None - endif - return loc -endfunction - -function! s:GistPostBuffers(private, desc, anonymous) abort - let bufnrs = range(1, bufnr('$')) - let bn = bufnr('%') - let query = [] - - let gist = { 'files' : {}, 'description': '','public': function('webapi#json#true') } - if a:desc !=# ' ' | let gist['description'] = a:desc | endif - if a:private | let gist['public'] = function('webapi#json#false') | endif - - let index = 1 - for bufnr in bufnrs - if !bufexists(bufnr) || buflisted(bufnr) == 0 - continue - endif - echo 'Creating gist content'.index.'... ' - silent! exec 'buffer!' bufnr - let content = join(getline(1, line('$')), "\n") - let filename = s:get_current_filename(index) - let gist.files[filename] = { 'content': content, 'filename': filename } - let index = index + 1 - endfor - silent! exec 'buffer!' bn - - let header = {'Content-Type': 'application/json'} - if !a:anonymous - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - redraw - echohl ErrorMsg | echomsg v:errmsg | echohl None - return - endif - let header['Authorization'] = auth - endif - - redraw | echon 'Posting it to gist... ' - let res = webapi#http#post(g:gist_api_url.'gists', webapi#json#encode(gist), header) - if res.status =~# '^2' - let obj = webapi#json#decode(res.content) - let loc = obj['html_url'] - let b:gist = { - \ 'filename': filename, - \ 'id': matchstr(loc, '[^/]\+$'), - \ 'description': gist['description'], - \ 'private': a:private, - \} - if s:update_GistID(b:gist['id']) - Gist -e - endif - redraw | echomsg 'Done: '.loc - else - let loc = '' - echohl ErrorMsg | echomsg 'Post failed: ' . res.message | echohl None - endif - return loc -endfunction - -function! gist#Gist(count, bang, line1, line2, ...) abort - redraw - let bufname = bufname('%') - " find GistID: in content , then we should just update - let gistid = '' - let gistls = '' - let gistnm = '' - let gistdesc = ' ' - let private = get(g:, 'gist_post_private', 0) - let multibuffer = 0 - let clipboard = 0 - let deletepost = 0 - let editpost = 0 - let anonymous = get(g:, 'gist_post_anonymous', 0) - let openbrowser = 0 - let setpagelimit = 0 - let pagelimit = g:gist_per_page_limit - let listmx = '^\%(-l\|--list\)\s*\([^\s]\+\)\?$' - let bufnamemx = '^' . s:bufprefix .'\(\zs[0-9a-f]\+\ze\|\zs[0-9a-f]\+\ze[/\\].*\)$' - if strlen(g:github_user) == 0 && anonymous == 0 - echohl ErrorMsg | echomsg 'You have not configured a Github account. Read '':help gist-setup''.' | echohl None - return - endif - if a:bang == '!' - let gistidbuf = '' - elseif bufname =~# bufnamemx - let gistidbuf = matchstr(bufname, bufnamemx) - elseif exists('b:gist') && has_key(b:gist, 'id') - let gistidbuf = b:gist['id'] - else - let gistidbuf = matchstr(join(getline(a:line1, a:line2), "\n"), 'GistID:\s*\zs\w\+') - endif - - let args = (a:0 > 0) ? s:shellwords(a:1) : [] - for arg in args - if arg =~# '^\(-h\|--help\)$\C' - help :Gist - return - elseif arg =~# '^\(-g\|--git\)$\C' && gistidbuf !=# '' && g:gist_api_url ==# 'https://api.github.com/' && has_key(b:, 'gist') && has_key(b:gist, 'id') - echo printf('git clone git@github.com:%s', b:gist['id']) - return - elseif arg =~# '^\(-G\|--gitclone\)$\C' && gistidbuf !=# '' && g:gist_api_url ==# 'https://api.github.com/' && has_key(b:, 'gist') && has_key(b:gist, 'id') - exe '!' printf('git clone git@github.com:%s', b:gist['id']) - return - elseif setpagelimit == 1 - let setpagelimit = 0 - let pagelimit = str2nr(arg) - if pagelimit < 1 || pagelimit > 100 - echohl ErrorMsg | echomsg 'Page limit should be between 1 and 100: '.arg | echohl None - unlet args - return 0 - endif - elseif arg =~# '^\(-la\|--listall\)$\C' - let gistls = '-all' - elseif arg =~# '^\(-ls\|--liststar\)$\C' - let gistls = 'starred' - elseif arg =~# '^\(-l\|--list\)$\C' - if get(g:, 'gist_show_privates') - let gistls = 'mine' - else - let gistls = g:github_user - endif - elseif arg =~# '^\(-m\|--multibuffer\)$\C' - let multibuffer = 1 - elseif arg =~# '^\(-p\|--private\)$\C' - let private = 1 - elseif arg =~# '^\(-P\|--public\)$\C' - let private = 0 - elseif arg =~# '^\(-a\|--anonymous\)$\C' - let anonymous = 1 - elseif arg =~# '^\(-s\|--description\)$\C' - let gistdesc = '' - elseif arg =~# '^\(-c\|--clipboard\)$\C' - let clipboard = 1 - elseif arg =~# '^--rawurl$\C' && gistidbuf !=# '' && g:gist_api_url ==# 'https://api.github.com/' - let gistid = gistidbuf - echo 'https://gist.github.com/raw/'.gistid - return - elseif arg =~# '^\(-d\|--delete\)$\C' && gistidbuf !=# '' - let gistid = gistidbuf - let deletepost = 1 - elseif arg =~# '^\(-e\|--edit\)$\C' - if gistidbuf !=# '' - let gistid = gistidbuf - endif - let editpost = 1 - elseif arg =~# '^\(+1\|--star\)$\C' && gistidbuf !=# '' - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - echohl ErrorMsg | echomsg v:errmsg | echohl None - else - let gistid = gistidbuf - let res = webapi#http#post(g:gist_api_url.'gists/'.gistid.'/star', '', { 'Authorization': auth }, 'PUT') - if res.status =~# '^2' - echomsg 'Starred' gistid - else - echohl ErrorMsg | echomsg 'Star failed' | echohl None - endif - endif - return - elseif arg =~# '^\(-1\|--unstar\)$\C' && gistidbuf !=# '' - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - echohl ErrorMsg | echomsg v:errmsg | echohl None - else - let gistid = gistidbuf - let res = webapi#http#post(g:gist_api_url.'gists/'.gistid.'/star', '', { 'Authorization': auth }, 'DELETE') - if res.status =~# '^2' - echomsg 'Unstarred' gistid - else - echohl ErrorMsg | echomsg 'Unstar failed' | echohl None - endif - endif - return - elseif arg =~# '^\(-f\|--fork\)$\C' && gistidbuf !=# '' - let auth = s:GistGetAuthHeader() - if len(auth) == 0 - echohl ErrorMsg | echomsg v:errmsg | echohl None - return - else - let gistid = gistidbuf - let res = webapi#http#post(g:gist_api_url.'gists/'.gistid.'/fork', '', { 'Authorization': auth }) - if res.status =~# '^2' - let obj = webapi#json#decode(res.content) - let gistid = obj['id'] - else - echohl ErrorMsg | echomsg 'Fork failed' | echohl None - return - endif - endif - elseif arg =~# '^\(-b\|--browser\)$\C' - let openbrowser = 1 - elseif arg =~# '^\(-n\|--per-page\)$\C' - if len(gistls) > 0 - let setpagelimit = 1 - else - echohl ErrorMsg | echomsg 'Page limit can be set only for list commands'.arg | echohl None - unlet args - return 0 - endif - elseif arg !~# '^-' && len(gistnm) == 0 - if gistdesc !=# ' ' - let gistdesc = matchstr(arg, '^\s*\zs.*\ze\s*$') - elseif editpost == 1 || deletepost == 1 - let gistnm = arg - elseif len(gistls) > 0 && arg !=# '^\w\+$\C' - let gistls = arg - elseif arg =~# '^[0-9a-z]\+$\C' - let gistid = arg - else - echohl ErrorMsg | echomsg 'Invalid arguments: '.arg | echohl None - unlet args - return 0 - endif - elseif len(arg) > 0 - echohl ErrorMsg | echomsg 'Invalid arguments: '.arg | echohl None - unlet args - return 0 - endif - endfor - unlet args - "echom "gistid=".gistid - "echom "gistls=".gistls - "echom "gistnm=".gistnm - "echom "gistdesc=".gistdesc - "echom "private=".private - "echom "clipboard=".clipboard - "echom "editpost=".editpost - "echom "deletepost=".deletepost - - if gistidbuf !=# '' && gistid ==# '' && editpost == 0 && deletepost == 0 && anonymous == 0 - let editpost = 1 - let gistid = gistidbuf - endif - - if len(gistls) > 0 - call s:GistList(gistls, 1, pagelimit) - elseif len(gistid) > 0 && editpost == 0 && deletepost == 0 - call s:GistGet(gistid, clipboard) - else - let url = '' - if multibuffer == 1 - let url = s:GistPostBuffers(private, gistdesc, anonymous) - else - if a:count < 1 - let content = join(getline(a:line1, a:line2), "\n") - else - let save_regcont = @" - let save_regtype = getregtype('"') - silent! normal! gvy - let content = @" - call setreg('"', save_regcont, save_regtype) - endif - if editpost == 1 - let url = s:GistUpdate(content, gistid, gistnm, gistdesc) - elseif deletepost == 1 - call s:GistDelete(gistid) - else - let url = s:GistPost(content, private, gistdesc, anonymous) - endif - if a:count >= 1 && get(g:, 'gist_keep_selection', 0) == 1 - silent! normal! gv - endif - endif - if type(url) == 1 && len(url) > 0 - if get(g:, 'gist_open_browser_after_post', 0) == 1 || openbrowser - call s:open_browser(url) - endif - let gist_put_url_to_clipboard_after_post = get(g:, 'gist_put_url_to_clipboard_after_post', 1) - if gist_put_url_to_clipboard_after_post > 0 || clipboard - if gist_put_url_to_clipboard_after_post == 2 - let url = url . "\n" - endif - if exists('g:gist_clip_command') - call system(g:gist_clip_command, url) - elseif has('clipboard') - let @+ = url - else - let @" = url - endif - endif - endif - endif - return 1 -endfunction - -function! s:GistGetAuthHeader() abort - if get(g:, 'gist_use_password_in_gitconfig', 0) != 0 - let password = substitute(system('git config --get github.password'), "\n", '', '') - if password =~# '^!' | let password = system(password[1:]) | endif - return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password)) - endif - let auth = '' - if !empty(get(g:, 'gist_token', $GITHUB_TOKEN)) - let auth = 'token ' . get(g:, 'gist_token', $GITHUB_TOKEN) - elseif filereadable(s:gist_token_file) - let str = join(readfile(s:gist_token_file), '') - if type(str) == 1 - let auth = str - endif - endif - if len(auth) > 0 - return auth - endif - - redraw - echohl WarningMsg - echo 'Gist.vim requires authorization to use the GitHub API. These settings are stored in "~/.gist-vim". If you want to revoke, do "rm ~/.gist-vim".' - echohl None - let password = inputsecret('GitHub Password for '.g:github_user.':') - if len(password) == 0 - let v:errmsg = 'Canceled' - return '' - endif - let note = 'Gist.vim on '.hostname().' '.strftime('%Y/%m/%d-%H:%M:%S') - let note_url = 'http://www.vim.org/scripts/script.php?script_id=2423' - let insecureSecret = printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password)) - let res = webapi#http#post(g:gist_api_url.'authorizations', webapi#json#encode({ - \ 'scopes' : ['gist'], - \ 'note' : note, - \ 'note_url' : note_url, - \}), { - \ 'Content-Type' : 'application/json', - \ 'Authorization' : insecureSecret, - \}) - let h = filter(res.header, 'stridx(v:val, "X-GitHub-OTP:") == 0') - if len(h) - let otp = inputsecret('OTP:') - if len(otp) == 0 - let v:errmsg = 'Canceled' - return '' - endif - let res = webapi#http#post(g:gist_api_url.'authorizations', webapi#json#encode({ - \ 'scopes' : ['gist'], - \ 'note' : note, - \ 'note_url' : note_url, - \}), { - \ 'Content-Type' : 'application/json', - \ 'Authorization' : insecureSecret, - \ 'X-GitHub-OTP' : otp, - \}) - endif - let authorization = webapi#json#decode(res.content) - if has_key(authorization, 'token') - let secret = printf('token %s', authorization.token) - call writefile([secret], s:gist_token_file) - if !(has('win32') || has('win64')) - call system('chmod go= '.s:gist_token_file) - endif - elseif has_key(authorization, 'message') - let secret = '' - let v:errmsg = authorization.message - endif - return secret -endfunction - -let s:extmap = extend({ -\'.adb': 'ada', -\'.ahk': 'ahk', -\'.arc': 'arc', -\'.as': 'actionscript', -\'.asm': 'asm', -\'.asp': 'asp', -\'.aw': 'php', -\'.b': 'b', -\'.bat': 'bat', -\'.befunge': 'befunge', -\'.bmx': 'bmx', -\'.boo': 'boo', -\'.c-objdump': 'c-objdump', -\'.c': 'c', -\'.cfg': 'cfg', -\'.cfm': 'cfm', -\'.ck': 'ck', -\'.cl': 'cl', -\'.clj': 'clj', -\'.cmake': 'cmake', -\'.coffee': 'coffee', -\'.cpp': 'cpp', -\'.cppobjdump': 'cppobjdump', -\'.cs': 'csharp', -\'.css': 'css', -\'.cw': 'cw', -\'.d-objdump': 'd-objdump', -\'.d': 'd', -\'.darcspatch': 'darcspatch', -\'.diff': 'diff', -\'.duby': 'duby', -\'.dylan': 'dylan', -\'.e': 'e', -\'.ebuild': 'ebuild', -\'.eclass': 'eclass', -\'.el': 'lisp', -\'.erb': 'erb', -\'.erl': 'erlang', -\'.f90': 'f90', -\'.factor': 'factor', -\'.feature': 'feature', -\'.fs': 'fs', -\'.fy': 'fy', -\'.go': 'go', -\'.groovy': 'groovy', -\'.gs': 'gs', -\'.gsp': 'gsp', -\'.haml': 'haml', -\'.hs': 'haskell', -\'.html': 'html', -\'.hx': 'hx', -\'.ik': 'ik', -\'.ino': 'ino', -\'.io': 'io', -\'.j': 'j', -\'.java': 'java', -\'.js': 'javascript', -\'.json': 'json', -\'.jsp': 'jsp', -\'.kid': 'kid', -\'.lhs': 'lhs', -\'.lisp': 'lisp', -\'.ll': 'll', -\'.lua': 'lua', -\'.ly': 'ly', -\'.m': 'objc', -\'.mak': 'mak', -\'.man': 'man', -\'.mao': 'mao', -\'.matlab': 'matlab', -\'.md': 'markdown', -\'.minid': 'minid', -\'.ml': 'ml', -\'.moo': 'moo', -\'.mu': 'mu', -\'.mustache': 'mustache', -\'.mxt': 'mxt', -\'.myt': 'myt', -\'.n': 'n', -\'.nim': 'nim', -\'.nu': 'nu', -\'.numpy': 'numpy', -\'.objdump': 'objdump', -\'.ooc': 'ooc', -\'.parrot': 'parrot', -\'.pas': 'pas', -\'.pasm': 'pasm', -\'.pd': 'pd', -\'.phtml': 'phtml', -\'.pir': 'pir', -\'.pl': 'perl', -\'.po': 'po', -\'.py': 'python', -\'.pytb': 'pytb', -\'.pyx': 'pyx', -\'.r': 'r', -\'.raw': 'raw', -\'.rb': 'ruby', -\'.rhtml': 'rhtml', -\'.rkt': 'rkt', -\'.rs': 'rs', -\'.rst': 'rst', -\'.s': 's', -\'.sass': 'sass', -\'.sc': 'sc', -\'.scala': 'scala', -\'.scm': 'scheme', -\'.scpt': 'scpt', -\'.scss': 'scss', -\'.self': 'self', -\'.sh': 'sh', -\'.sml': 'sml', -\'.sql': 'sql', -\'.st': 'smalltalk', -\'.swift': 'swift', -\'.tcl': 'tcl', -\'.tcsh': 'tcsh', -\'.tex': 'tex', -\'.textile': 'textile', -\'.tpl': 'smarty', -\'.twig': 'twig', -\'.txt' : 'text', -\'.v': 'verilog', -\'.vala': 'vala', -\'.vb': 'vbnet', -\'.vhd': 'vhdl', -\'.vim': 'vim', -\'.weechatlog': 'weechatlog', -\'.xml': 'xml', -\'.xq': 'xquery', -\'.xs': 'xs', -\'.yml': 'yaml', -\}, get(g:, 'gist_extmap', {})) - -let &cpo = s:save_cpo -unlet s:save_cpo - -" vim:set et: diff --git a/sources_non_forked/vim-gist/doc/gist-vim.txt b/sources_non_forked/vim-gist/doc/gist-vim.txt deleted file mode 100644 index 6074aba68f..0000000000 --- a/sources_non_forked/vim-gist/doc/gist-vim.txt +++ /dev/null @@ -1,364 +0,0 @@ -*Gist.vim* Vimscript for creating gists (http://gist.github.com) - -Usage |vim-gist-usage| -Tips |vim-gist-tips| -License |vim-gist-license| -Install |vim-gist-install| -Requirements |vim-gist-requirements| -Setup |vim-gist-setup| -FAQ |vim-gist-faq| - -This is a vimscript for creating gists (http://gist.github.com) - -For the latest version please see https://github.com/mattn/vim-gist. - -============================================================================== -USAGE *:Gist* *vim-gist-usage* - -- Post current buffer to gist, using default privacy option. > - - :Gist -< -- Post selected text to gist, using default privacy option. - This applies to all permutations listed below (except multi). > - - :'<,'>Gist -< -- Create a private gist. > - - :Gist -p - :Gist --private -< -- Create a public gist. - (Only relevant if you've set gists to be private by default.) > - - :Gist -P - :Gist --public -< -- Post whole text to gist as public. - This is only relevant if you've set gists to be private by default. -> - :Gist -P -< -- Create a gist anonymously. > - - :Gist -a - :Gist --anonymous -< -- Create a gist with all open buffers. > - - :Gist -m - :Gist --multibuffer -< -- Edit the gist (you need to have opened the gist buffer first). - You can update the gist with the {:w} command within the gist buffer. > - - :Gist -e - :Gist --edit -< -- Edit the gist with name "foo.js" (you need to have opened the gist buffer - first). > - - :Gist -e foo.js -< -- Post/Edit with the description " (you need to have opened the gist buffer - first). > - - :Gist -s something - :Gist --description something - :Gist -e -s something -< -- Delete the gist (you need to have opened the gist buffer first). - Password authentication is needed. > - - :Gist -d - :Gist --delete -< -- Fork the gist (you need to have opened the gist buffer first). - Password authentication is needed. > - - :Gist -f - :Gist --fork -< -- Star the gist (you need to have opened the gist buffer first). - Password authentication is needed. -> - :Gist +1 -< -- Unstar the gist (you need to have opened the gist buffer first). - Password authentication is needed. -> - :Gist -1 -< -- Get gist XXXXX. > - - :Gist XXXXX -< -- Get gist XXXXX and add to clipboard. > - - :Gist -c XXXXX -< -- List your public gists. > - - :Gist -l - :Gist --list - :Gist -l -n 100 - :Gist --list --per-page 100 -< -- List gists from user "mattn". > - - :Gist -l mattn -< -- List everyone's gists. > - - :Gist -la - :Gist --listall -< -- List gists from your starred gists. -> - :Gist -ls - :Gist --liststar - -- While the gist list is visible, the following mappings apply: - - - 'o' or 'Enter' will open the selected gist file in a new buffer - and close the vim-gist listing split. - - 'b' will open the selected gist file in a browser. If you are in - GUI vim you can also achieve this by pressing 'Shift-Enter'. - - 'y' will copy the contents of the selected gist to the clipboard, - and close the vim-gist listing split. - - 'p' will (copy and) paste the contents of the selected gist to the - buffer from which vim-gist was called, and close the vim-gist - listing split. - - 'Esc' will close the vim-gist listing split without performing any - further action. - -- Open the gist on browser after you post or update it. -> - :Gist -b - :Gist --browser -< -- Post as new gist after editing on the buffer. -> - :Gist! -< -============================================================================== -TIPS *vim-gist-tips* - -If you set "g:gist_clip_command", gist.vim will copy the gist code with option -"-c". - - - Mac: > - let g:gist_clip_command = 'pbcopy' -< - - Linux: > - let g:gist_clip_command = 'xclip -selection clipboard' -< - - Others (cygwin?): > - let g:gist_clip_command = 'putclip' -< -If you want to detect filetype from the filename: > - - let g:gist_detect_filetype = 1 -< -If you want to open the browser after the post: > - - let g:gist_open_browser_after_post = 1 -< -If you want to change the browser: > - - let g:gist_browser_command = 'w3m %URL%' -< -or: > - - let g:gist_browser_command = 'opera %URL% &' -< -On windows, this should work with your user settings. - -If you want to show your private gists with ":Gist -l": > - - let g:gist_show_privates = 1 -< -If you want your gist to be private by default: > - - let g:gist_post_private = 1 -< -If you want your gist to be anonymous by default: > - - let g:gist_post_anonymous = 1 -< -If you want to edit all files for gists containing more than one: > - - let g:gist_get_multiplefile = 1 -< -If you want to use on GitHub Enterprise: > - - let g:gist_api_url = 'http://your-github-enterprise-domain/api/v3' -< -If you want to open gist with current editing buffers: > - - let g:gist_edit_with_buffers = 1 - -If you want to open gist list/buffer as vertical split: > - - let g:gist_list_vsplit = 1 - -If you want to list more than 30 gists per page (maximum is 100): - - let g:gist_per_page_limit = 100 - -If you want to modify filetype for the file on github, or add mapping of -filetype/file-extension: > - - let g:gist_extmap = { ".swift": "swift" } -< - key is file-extension, value is filetype. - -If you want to update a gist, embed > - - GistID: xxxxx -> -in your local file, then call > - - :Gist - -The vim-gist listing split lists gists ids, names (filenames) as well as -their description. This is done following a table layout, with fixed space -for each column. For offering quick browsing, vim-gist will truncate all -output exceeding the available horizontal space, assuring that every gist -listed only takes one line on the table. Although the gist id field width is -fixed internally, the user can define the length of the (file)name field on -the vim-gist listing. This can be done by the following declaration: - - let g:gist_namelength = 20 - -Note that the default value for gist_namelength is 30. Again, if the gist -(file)name exceeds the specified number of characters, it will be truncated. - -If you want to update a gist when only |:w!|: > - - " :w and :w! update a gist. - let g:gist_update_on_write = 1 - - " Only :w! updates a gist. - let g:gist_update_on_write = 2 -> -All other values are treated as 1. -This variable's value is 1 by default. - -============================================================================== -LICENSE *vim-gist-license* - - - Copyright 2010 by Yasuhiro Matsumoto - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - -============================================================================== -INSTALL *vim-gist-install* - -Copy following files into your plugin directory. - -rtp: - - autoload/gist.vim - - plugin/gist.vim - -If you want to uninstall gist.vim, remember to also remove `~/.gist-vim`. - -You need to install webapi-vim also: - - http://www.vim.org/scripts/script.php?script_id=4019 - -If you want to use latest one: - - https://github.com/mattn/webapi-vim - -============================================================================== -REQUIREMENTS *vim-gist-requirements* - - - curl command (http://curl.haxx.se/) - - webapi-vim (https://github.com/mattn/webapi-vim) - - and, if you want to use your git profile, the git command-line client. - -============================================================================== -SETUP *vim-gist-setup* - -This plugin uses GitHub API v3. The authentication value is stored in `~/.gist-vim`. -vim-gist provides two ways to authenticate against the GitHub APIs. - -First, you need to set your GitHub username in global git config: -> - $ git config --global github.user Username -< -Then, gist.vim will ask for your password to create an authorization when you -first use it. The password is not stored and only the OAuth access token will -be kept for later use. You can revoke the token at any time from the list of -"Authorized applications" on GitHub's "Account Settings" page. -(https://github.com/settings/applications) - -If you have two-factor authentication enabled on GitHub, you'll see the message -"Must specify two-factor authentication OTP code." In this case, you need to -create a "Personal Access Token" on GitHub's "Developer settings" page -(https://github.com/settings/tokens) with the gist scope and place it in a file -named ~/.gist-vim like this: -> - token xxxxx -< -If you happen to have your password already written in ~/.gitconfig like -below: -> - [github] - password = xxxxx -< -Then, add following into your ~/.vimrc -> - let g:gist_use_password_in_gitconfig = 1 -< -This is not secure at all, so strongly discouraged. - -NOTE: the username is optional if you only send anonymous gists. - -============================================================================== -FAQ *vim-gist-faq* - -Q. :Gist returns a Forbidden error -A. Try deleting ~/.gist-vim and authenticating again. - -============================================================================== -THANKS *vim-gist-thanks* - - AD7six - Bruno Bigras - c9s - Daniel Bretoi - Jeremy Michael Cantrell - Kien N - kongo2002 - MATSUU Takuto - Matthew Weier O'Phinney - ornicar - Roland Schilter - steve - tyru - Will Gray - netj - - vim:tw=78:ts=8:ft=help:norl: diff --git a/sources_non_forked/vim-gist/plugin/gist.vim b/sources_non_forked/vim-gist/plugin/gist.vim deleted file mode 100644 index 46956a1c0e..0000000000 --- a/sources_non_forked/vim-gist/plugin/gist.vim +++ /dev/null @@ -1,24 +0,0 @@ -"============================================================================= -" File: gist.vim -" Author: Yasuhiro Matsumoto -" WebPage: http://github.com/mattn/vim-gist -" License: BSD -" GetLatestVimScripts: 2423 1 :AutoInstall: gist.vim -" script type: plugin - -if &compatible || (exists('g:loaded_gist_vim') && g:loaded_gist_vim) - finish -endif -let g:loaded_gist_vim = 1 - -function! s:CompleteArgs(arg_lead,cmdline,cursor_pos) - return filter(copy(["-p", "-P", "-a", "-m", "-e", "-s", "-d", "+1", "-1", "-f", "-c", "-l", "-la", "-ls", "-b", "-n", - \ "--listall", "--liststar", "--list", "--multibuffer", "--private", "--public", "--anonymous", "--description", "--clipboard", - \ "--rawurl", "--delete", "--edit", "--star", "--unstar", "--fork", "--browser", "--per-page" - \ ]), 'stridx(v:val, a:arg_lead)==0') -endfunction - -let g:gist_per_page_limit = get(g:, 'gist_per_page_limit', 30) -command! -nargs=? -range=% -bang -complete=customlist,s:CompleteArgs Gist :call gist#Gist(, "", , , ) - -" vim:set et: diff --git a/sources_non_forked/vim-indent-guides/.github/workflows/vint.yml b/sources_non_forked/vim-indent-guides/.github/workflows/vint.yml deleted file mode 100644 index 909de43ace..0000000000 --- a/sources_non_forked/vim-indent-guides/.github/workflows/vint.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Vint -on: [push] -jobs: - vint: - name: vint - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - - name: Setup dependencies - run: pip install vim-vint - - name: Lint Vimscript - run: vint . diff --git a/sources_non_forked/vim-indent-guides/.gitignore b/sources_non_forked/vim-indent-guides/.gitignore deleted file mode 100644 index 926ccaaf93..0000000000 --- a/sources_non_forked/vim-indent-guides/.gitignore +++ /dev/null @@ -1 +0,0 @@ -doc/tags diff --git a/sources_non_forked/vim-indent-guides/LICENSE b/sources_non_forked/vim-indent-guides/LICENSE deleted file mode 100644 index 54da359df4..0000000000 --- a/sources_non_forked/vim-indent-guides/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Nathanael Kane - -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/sources_non_forked/vim-indent-guides/README.markdown b/sources_non_forked/vim-indent-guides/README.markdown deleted file mode 100644 index 367ca46bb5..0000000000 --- a/sources_non_forked/vim-indent-guides/README.markdown +++ /dev/null @@ -1,114 +0,0 @@ -# Indent Guides - -[![Vint](https://github.com/preservim/vim-indent-guides/workflows/Vint/badge.svg)](https://github.com/preservim/vim-indent-guides/actions?workflow=Vint) - -Indent Guides is a plugin for visually displaying indent levels in Vim. - - - -## Features: -* Can detect both tab and space indent styles. -* Automatically inspects your colorscheme and picks appropriate colors (gVim only). -* Will highlight indent levels with alternating colors. -* Full support for gVim and basic support for Terminal Vim. -* Seems to work on Windows gVim 7.3 (haven't done any extensive tests though). -* Customizable size for indent guides, eg. skinny guides (soft-tabs only). -* Customizable start indent level. -* Highlight support for files with a mixture of tab and space indent styles. - -## Requirements -* Vim 7.2+ - -## Installation -To install the plugin copy `autoload`, `plugin`, `doc` directories into your `.vim` directory. - -### Pathogen -If you have [Pathogen](http://www.vim.org/scripts/script.php?script_id=2332) installed, clone this repo into a subdirectory of your `.vim/bundle` directory like so: - -```bash -cd ~/.vim/bundle -git clone git://github.com/preservim/vim-indent-guides.git -``` - -### Vundle -If you have [Vundle](https://github.com/VundleVim/Vundle.vim) installed, add the following line to your `~/.vimrc` in the appropriate spot (see the Vundle.vim README for help): - -```vim -Plugin 'nathanaelkane/vim-indent-guides' -``` - -and then run the following command from inside Vim: - -```vim -:PluginInstall -``` - -## Usage -The default mapping to toggle the plugin is `ig`. - -You can also use the following commands inside Vim: - -```vim -:IndentGuidesEnable -:IndentGuidesDisable -:IndentGuidesToggle -``` - -If you would like to have indent guides enabled by default, you can add the following to your `~/.vimrc`: - -```vim -let g:indent_guides_enable_on_vim_startup = 1 -``` - -### gVim -**This plugin should work with gVim out of the box, no configuration needed.** It will automatically inspect your colorscheme and pick appropriate colors. - -### Setting custom indent colors -Here's an example of how to define custom colors instead of using the ones the plugin automatically generates for you. Add this to your `.vimrc` file: - -```vim -let g:indent_guides_auto_colors = 0 -autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3 -autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4 -``` - -Alternatively you can add the following lines to your colorscheme file. - -```vim -hi IndentGuidesOdd guibg=red ctermbg=3 -hi IndentGuidesEven guibg=green ctermbg=4 -``` - -### Terminal Vim -At the moment Terminal Vim only has basic support. This means is that colors won't be automatically calculated based on your colorscheme. Instead, some preset colors are used depending on whether `background` is set to `dark` or `light`. - -When `set background=dark` is used, the following highlight colors will be defined: - -```vim -hi IndentGuidesOdd ctermbg=black -hi IndentGuidesEven ctermbg=darkgrey -``` - -Alternatively, when `set background=light` is used, the following highlight colors will be defined: - -```vim -hi IndentGuidesOdd ctermbg=white -hi IndentGuidesEven ctermbg=lightgrey -``` - -If for some reason it's incorrectly defining light highlight colors instead of dark ones or vice versa, the first thing you should check is that the `background` value is being set correctly for your colorscheme. Sometimes it's best to manually set the `background` value in your `.vimrc`, for example: - -```vim -colorscheme desert256 -set background=dark -``` - -Alternatively you can manually setup the highlight colors yourself, see `:help indent_guides_auto_colors` for an example. - -## Help -`:help indent-guides` - -## Screenshots - - - diff --git a/sources_non_forked/vim-indent-guides/autoload/color_helper.vim b/sources_non_forked/vim-indent-guides/autoload/color_helper.vim deleted file mode 100644 index 61f1b7969a..0000000000 --- a/sources_non_forked/vim-indent-guides/autoload/color_helper.vim +++ /dev/null @@ -1,879 +0,0 @@ -" Author: Nate Kane -" Homepage: http://github.com/preservim/vim-indent-guides - -" -" Return hex string equivalent to given decimal string or number. -" -" Example: color_helper#dec_to_hex(255, 2) -" Returns: 'FF' -" -" Example: color_helper#dec_to_hex(255, 5) -" Returns: '000FF' -" -function! color_helper#dec_to_hex(arg, padding) abort - return toupper(printf('%0' . a:padding . 'x', a:arg + 0)) -endfunction - -" -" Return number equivalent to given hex string ('0x' is optional). -" -" Example: color_helper#hex_to_dec('FF') -" Returns: 255 -" -" Example: color_helper#hex_to_dec('88') -" Returns: 136 -" -" Example: color_helper#hex_to_dec('00') -" Returns: 0 -" -function! color_helper#hex_to_dec(arg) abort - return (a:arg =~? '^0x') ? a:arg + 0 : ('0x'.a:arg) + 0 -endfunction - -" -" Converts a given hex color string into an rgb list (eg. [red, green, blue]). -" -" Example: color_helper#hex_color_to_rgb('#0088FF') -" Returns: [0, 136, 255] -" -function! color_helper#hex_color_to_rgb(hex_color) abort - let l:rgb = [] - - if a:hex_color =~ g:indent_guides_color_hex_pattern - let l:red = color_helper#hex_to_dec(strpart(a:hex_color, 1, 2)) - let l:green = color_helper#hex_to_dec(strpart(a:hex_color, 3, 2)) - let l:blue = color_helper#hex_to_dec(strpart(a:hex_color, 5, 2)) - let l:rgb = [l:red, l:green, l:blue] - end - - return l:rgb -endfunction - -" -" Converts a given rgb list (eg. [red, green, blue]) into a hex color string. -" -" Example: color_helper#rgb_color_to_hex([0, 136, 255]) -" Returns: '#0088FF' -" -function! color_helper#rgb_color_to_hex(rgb_color) abort - let l:hex_color = '#' - let l:hex_color .= color_helper#dec_to_hex(a:rgb_color[0], 2) " red - let l:hex_color .= color_helper#dec_to_hex(a:rgb_color[1], 2) " green - let l:hex_color .= color_helper#dec_to_hex(a:rgb_color[2], 2) " blue - - return l:hex_color -endfunction - -" -" Returns a ligtened color using the given color and the percent to lighten it -" by. -" -" Example: color_helper#hex_color_lighten('#000000', 0.10) -" Returns: '#191919' -" -function! color_helper#hex_color_lighten(color, percent) abort - let l:rgb = color_helper#hex_color_to_rgb(a:color) - let l:rgb_lightened = [] - - for i in l:rgb - call add(l:rgb_lightened, float2nr(i + ((255 - i) * a:percent))) - endfor - - return color_helper#rgb_color_to_hex(l:rgb_lightened) -endfunction - -" -" Returns a darkened color using the given color and the percent to darken it -" by. -" -" Example: color_helper#hex_color_darken('#FFFFFF', 0.10) -" Returns: '#E5E5E5' -" -function! color_helper#hex_color_darken(color, percent) abort - let l:rgb = color_helper#hex_color_to_rgb(a:color) - let l:rgb_darkened = [] - - for i in l:rgb - call add(l:rgb_darkened, float2nr(i * (1 - a:percent))) - endfor - - return color_helper#rgb_color_to_hex(l:rgb_darkened) -endfunction - -" -" Returns a hex color code for the given color name. -" -" Example: color_helper#color_name_to_hex('darkslategray') -" Returns: '#2F4F4F' -" -function! color_helper#color_name_to_hex(color_name) abort - let l:hex_code = '' - let l:color_name = tolower(a:color_name) - - let l:color_list = { - \ 'alice blue' : '#F0F8FF', - \ 'aliceblue' : '#F0F8FF', - \ 'antique white' : '#FAEBD7', - \ 'antiquewhite' : '#FAEBD7', - \ 'antiquewhite1' : '#FFEFDB', - \ 'antiquewhite2' : '#EEDFCC', - \ 'antiquewhite3' : '#CDC0B0', - \ 'antiquewhite4' : '#8B8378', - \ 'aquamarine' : '#7FFFD4', - \ 'aquamarine1' : '#7FFFD4', - \ 'aquamarine2' : '#76EEC6', - \ 'aquamarine3' : '#66CDAA', - \ 'aquamarine4' : '#458B74', - \ 'azure' : '#F0FFFF', - \ 'azure1' : '#F0FFFF', - \ 'azure2' : '#E0EEEE', - \ 'azure3' : '#C1CDCD', - \ 'azure4' : '#838B8B', - \ 'beige' : '#F5F5DC', - \ 'bisque' : '#FFE4C4', - \ 'bisque1' : '#FFE4C4', - \ 'bisque2' : '#EED5B7', - \ 'bisque3' : '#CDB79E', - \ 'bisque4' : '#8B7D6B', - \ 'black' : '#000000', - \ 'blanched almond' : '#FFEBCD', - \ 'blanchedalmond' : '#FFEBCD', - \ 'blue violet' : '#8A2BE2', - \ 'blue' : '#0000FF', - \ 'blue1' : '#0000FF', - \ 'blue2' : '#0000EE', - \ 'blue3' : '#0000CD', - \ 'blue4' : '#00008B', - \ 'blueviolet' : '#8A2BE2', - \ 'brown' : '#A52A2A', - \ 'brown1' : '#FF4040', - \ 'brown2' : '#EE3B3B', - \ 'brown3' : '#CD3333', - \ 'brown4' : '#8B2323', - \ 'burlywood' : '#DEB887', - \ 'burlywood1' : '#FFD39B', - \ 'burlywood2' : '#EEC591', - \ 'burlywood3' : '#CDAA7D', - \ 'burlywood4' : '#8B7355', - \ 'cadet blue' : '#5F9EA0', - \ 'cadetblue' : '#5F9EA0', - \ 'cadetblue1' : '#98F5FF', - \ 'cadetblue2' : '#8EE5EE', - \ 'cadetblue3' : '#7AC5CD', - \ 'cadetblue4' : '#53868B', - \ 'chartreuse' : '#7FFF00', - \ 'chartreuse1' : '#7FFF00', - \ 'chartreuse2' : '#76EE00', - \ 'chartreuse3' : '#66CD00', - \ 'chartreuse4' : '#458B00', - \ 'chocolate' : '#D2691E', - \ 'chocolate1' : '#FF7F24', - \ 'chocolate2' : '#EE7621', - \ 'chocolate3' : '#CD661D', - \ 'chocolate4' : '#8B4513', - \ 'coral' : '#FF7F50', - \ 'coral1' : '#FF7256', - \ 'coral2' : '#EE6A50', - \ 'coral3' : '#CD5B45', - \ 'coral4' : '#8B3E2F', - \ 'cornflower blue' : '#6495ED', - \ 'cornflowerblue' : '#6495ED', - \ 'cornsilk' : '#FFF8DC', - \ 'cornsilk1' : '#FFF8DC', - \ 'cornsilk2' : '#EEE8CD', - \ 'cornsilk3' : '#CDC8B1', - \ 'cornsilk4' : '#8B8878', - \ 'cyan' : '#00FFFF', - \ 'cyan1' : '#00FFFF', - \ 'cyan2' : '#00EEEE', - \ 'cyan3' : '#00CDCD', - \ 'cyan4' : '#008B8B', - \ 'dark blue' : '#00008B', - \ 'dark cyan' : '#008B8B', - \ 'dark goldenrod' : '#B8860B', - \ 'dark gray' : '#A9A9A9', - \ 'dark green' : '#006400', - \ 'dark grey' : '#A9A9A9', - \ 'dark khaki' : '#BDB76B', - \ 'dark magenta' : '#8B008B', - \ 'dark olive green' : '#556B2F', - \ 'dark orange' : '#FF8C00', - \ 'dark orchid' : '#9932CC', - \ 'dark red' : '#8B0000', - \ 'dark salmon' : '#E9967A', - \ 'dark sea green' : '#8FBC8F', - \ 'dark slate blue' : '#483D8B', - \ 'dark slate gray' : '#2F4F4F', - \ 'dark slate grey' : '#2F4F4F', - \ 'dark turquoise' : '#00CED1', - \ 'dark violet' : '#9400D3', - \ 'dark yellow' : '#BBBB00', - \ 'darkblue' : '#00008B', - \ 'darkcyan' : '#008B8B', - \ 'darkgoldenrod' : '#B8860B', - \ 'darkgoldenrod1' : '#FFB90F', - \ 'darkgoldenrod2' : '#EEAD0E', - \ 'darkgoldenrod3' : '#CD950C', - \ 'darkgoldenrod4' : '#8B6508', - \ 'darkgray' : '#A9A9A9', - \ 'darkgreen' : '#006400', - \ 'darkgrey' : '#A9A9A9', - \ 'darkkhaki' : '#BDB76B', - \ 'darkmagenta' : '#8B008B', - \ 'darkolivegreen' : '#556B2F', - \ 'darkolivegreen1' : '#CAFF70', - \ 'darkolivegreen2' : '#BCEE68', - \ 'darkolivegreen3' : '#A2CD5A', - \ 'darkolivegreen4' : '#6E8B3D', - \ 'darkorange' : '#FF8C00', - \ 'darkorange1' : '#FF7F00', - \ 'darkorange2' : '#EE7600', - \ 'darkorange3' : '#CD6600', - \ 'darkorange4' : '#8B4500', - \ 'darkorchid' : '#9932CC', - \ 'darkorchid1' : '#BF3EFF', - \ 'darkorchid2' : '#B23AEE', - \ 'darkorchid3' : '#9A32CD', - \ 'darkorchid4' : '#68228B', - \ 'darkred' : '#8B0000', - \ 'darksalmon' : '#E9967A', - \ 'darkseagreen' : '#8FBC8F', - \ 'darkseagreen1' : '#C1FFC1', - \ 'darkseagreen2' : '#B4EEB4', - \ 'darkseagreen3' : '#9BCD9B', - \ 'darkseagreen4' : '#698B69', - \ 'darkslateblue' : '#483D8B', - \ 'darkslategray' : '#2F4F4F', - \ 'darkslategray1' : '#97FFFF', - \ 'darkslategray2' : '#8DEEEE', - \ 'darkslategray3' : '#79CDCD', - \ 'darkslategray4' : '#528B8B', - \ 'darkslategrey' : '#2F4F4F', - \ 'darkturquoise' : '#00CED1', - \ 'darkviolet' : '#9400D3', - \ 'darkyellow' : '#BBBB00', - \ 'deep pink' : '#FF1493', - \ 'deep sky blue' : '#00BFFF', - \ 'deeppink' : '#FF1493', - \ 'deeppink1' : '#FF1493', - \ 'deeppink2' : '#EE1289', - \ 'deeppink3' : '#CD1076', - \ 'deeppink4' : '#8B0A50', - \ 'deepskyblue' : '#00BFFF', - \ 'deepskyblue1' : '#00BFFF', - \ 'deepskyblue2' : '#00B2EE', - \ 'deepskyblue3' : '#009ACD', - \ 'deepskyblue4' : '#00688B', - \ 'dim gray' : '#696969', - \ 'dim grey' : '#696969', - \ 'dimgray' : '#696969', - \ 'dimgrey' : '#696969', - \ 'dodger blue' : '#1E90FF', - \ 'dodgerblue' : '#1E90FF', - \ 'dodgerblue1' : '#1E90FF', - \ 'dodgerblue2' : '#1C86EE', - \ 'dodgerblue3' : '#1874CD', - \ 'dodgerblue4' : '#104E8B', - \ 'firebrick' : '#B22222', - \ 'firebrick1' : '#FF3030', - \ 'firebrick2' : '#EE2C2C', - \ 'firebrick3' : '#CD2626', - \ 'firebrick4' : '#8B1A1A', - \ 'floral white' : '#FFFAF0', - \ 'floralwhite' : '#FFFAF0', - \ 'forest green' : '#228B22', - \ 'forestgreen' : '#228B22', - \ 'gainsboro' : '#DCDCDC', - \ 'ghost white' : '#F8F8FF', - \ 'ghostwhite' : '#F8F8FF', - \ 'gold' : '#FFD700', - \ 'gold1' : '#FFD700', - \ 'gold2' : '#EEC900', - \ 'gold3' : '#CDAD00', - \ 'gold4' : '#8B7500', - \ 'goldenrod' : '#DAA520', - \ 'goldenrod1' : '#FFC125', - \ 'goldenrod2' : '#EEB422', - \ 'goldenrod3' : '#CD9B1D', - \ 'goldenrod4' : '#8B6914', - \ 'gray' : '#BEBEBE', - \ 'gray0' : '#000000', - \ 'gray1' : '#030303', - \ 'gray10' : '#1A1A1A', - \ 'gray100' : '#FFFFFF', - \ 'gray11' : '#1C1C1C', - \ 'gray12' : '#1F1F1F', - \ 'gray13' : '#212121', - \ 'gray14' : '#242424', - \ 'gray15' : '#262626', - \ 'gray16' : '#292929', - \ 'gray17' : '#2B2B2B', - \ 'gray18' : '#2E2E2E', - \ 'gray19' : '#303030', - \ 'gray2' : '#050505', - \ 'gray20' : '#333333', - \ 'gray21' : '#363636', - \ 'gray22' : '#383838', - \ 'gray23' : '#3B3B3B', - \ 'gray24' : '#3D3D3D', - \ 'gray25' : '#404040', - \ 'gray26' : '#424242', - \ 'gray27' : '#454545', - \ 'gray28' : '#474747', - \ 'gray29' : '#4A4A4A', - \ 'gray3' : '#080808', - \ 'gray30' : '#4D4D4D', - \ 'gray31' : '#4F4F4F', - \ 'gray32' : '#525252', - \ 'gray33' : '#545454', - \ 'gray34' : '#575757', - \ 'gray35' : '#595959', - \ 'gray36' : '#5C5C5C', - \ 'gray37' : '#5E5E5E', - \ 'gray38' : '#616161', - \ 'gray39' : '#636363', - \ 'gray4' : '#0A0A0A', - \ 'gray40' : '#666666', - \ 'gray41' : '#696969', - \ 'gray42' : '#6B6B6B', - \ 'gray43' : '#6E6E6E', - \ 'gray44' : '#707070', - \ 'gray45' : '#737373', - \ 'gray46' : '#757575', - \ 'gray47' : '#787878', - \ 'gray48' : '#7A7A7A', - \ 'gray49' : '#7D7D7D', - \ 'gray5' : '#0D0D0D', - \ 'gray50' : '#7F7F7F', - \ 'gray51' : '#828282', - \ 'gray52' : '#858585', - \ 'gray53' : '#878787', - \ 'gray54' : '#8A8A8A', - \ 'gray55' : '#8C8C8C', - \ 'gray56' : '#8F8F8F', - \ 'gray57' : '#919191', - \ 'gray58' : '#949494', - \ 'gray59' : '#969696', - \ 'gray6' : '#0F0F0F', - \ 'gray60' : '#999999', - \ 'gray61' : '#9C9C9C', - \ 'gray62' : '#9E9E9E', - \ 'gray63' : '#A1A1A1', - \ 'gray64' : '#A3A3A3', - \ 'gray65' : '#A6A6A6', - \ 'gray66' : '#A8A8A8', - \ 'gray67' : '#ABABAB', - \ 'gray68' : '#ADADAD', - \ 'gray69' : '#B0B0B0', - \ 'gray7' : '#121212', - \ 'gray70' : '#B3B3B3', - \ 'gray71' : '#B5B5B5', - \ 'gray72' : '#B8B8B8', - \ 'gray73' : '#BABABA', - \ 'gray74' : '#BDBDBD', - \ 'gray75' : '#BFBFBF', - \ 'gray76' : '#C2C2C2', - \ 'gray77' : '#C4C4C4', - \ 'gray78' : '#C7C7C7', - \ 'gray79' : '#C9C9C9', - \ 'gray8' : '#141414', - \ 'gray80' : '#CCCCCC', - \ 'gray81' : '#CFCFCF', - \ 'gray82' : '#D1D1D1', - \ 'gray83' : '#D4D4D4', - \ 'gray84' : '#D6D6D6', - \ 'gray85' : '#D9D9D9', - \ 'gray86' : '#DBDBDB', - \ 'gray87' : '#DEDEDE', - \ 'gray88' : '#E0E0E0', - \ 'gray89' : '#E3E3E3', - \ 'gray9' : '#171717', - \ 'gray90' : '#E5E5E5', - \ 'gray91' : '#E8E8E8', - \ 'gray92' : '#EBEBEB', - \ 'gray93' : '#EDEDED', - \ 'gray94' : '#F0F0F0', - \ 'gray95' : '#F2F2F2', - \ 'gray96' : '#F5F5F5', - \ 'gray97' : '#F7F7F7', - \ 'gray98' : '#FAFAFA', - \ 'gray99' : '#FCFCFC', - \ 'green yellow' : '#ADFF2F', - \ 'green' : '#00FF00', - \ 'green1' : '#00FF00', - \ 'green2' : '#00EE00', - \ 'green3' : '#00CD00', - \ 'green4' : '#008B00', - \ 'greenyellow' : '#ADFF2F', - \ 'grey' : '#BEBEBE', - \ 'grey0' : '#000000', - \ 'grey1' : '#030303', - \ 'grey10' : '#1A1A1A', - \ 'grey100' : '#FFFFFF', - \ 'grey11' : '#1C1C1C', - \ 'grey12' : '#1F1F1F', - \ 'grey13' : '#212121', - \ 'grey14' : '#242424', - \ 'grey15' : '#262626', - \ 'grey16' : '#292929', - \ 'grey17' : '#2B2B2B', - \ 'grey18' : '#2E2E2E', - \ 'grey19' : '#303030', - \ 'grey2' : '#050505', - \ 'grey20' : '#333333', - \ 'grey21' : '#363636', - \ 'grey22' : '#383838', - \ 'grey23' : '#3B3B3B', - \ 'grey24' : '#3D3D3D', - \ 'grey25' : '#404040', - \ 'grey26' : '#424242', - \ 'grey27' : '#454545', - \ 'grey28' : '#474747', - \ 'grey29' : '#4A4A4A', - \ 'grey3' : '#080808', - \ 'grey30' : '#4D4D4D', - \ 'grey31' : '#4F4F4F', - \ 'grey32' : '#525252', - \ 'grey33' : '#545454', - \ 'grey34' : '#575757', - \ 'grey35' : '#595959', - \ 'grey36' : '#5C5C5C', - \ 'grey37' : '#5E5E5E', - \ 'grey38' : '#616161', - \ 'grey39' : '#636363', - \ 'grey4' : '#0A0A0A', - \ 'grey40' : '#666666', - \ 'grey41' : '#696969', - \ 'grey42' : '#6B6B6B', - \ 'grey43' : '#6E6E6E', - \ 'grey44' : '#707070', - \ 'grey45' : '#737373', - \ 'grey46' : '#757575', - \ 'grey47' : '#787878', - \ 'grey48' : '#7A7A7A', - \ 'grey49' : '#7D7D7D', - \ 'grey5' : '#0D0D0D', - \ 'grey50' : '#7F7F7F', - \ 'grey51' : '#828282', - \ 'grey52' : '#858585', - \ 'grey53' : '#878787', - \ 'grey54' : '#8A8A8A', - \ 'grey55' : '#8C8C8C', - \ 'grey56' : '#8F8F8F', - \ 'grey57' : '#919191', - \ 'grey58' : '#949494', - \ 'grey59' : '#969696', - \ 'grey6' : '#0F0F0F', - \ 'grey60' : '#999999', - \ 'grey61' : '#9C9C9C', - \ 'grey62' : '#9E9E9E', - \ 'grey63' : '#A1A1A1', - \ 'grey64' : '#A3A3A3', - \ 'grey65' : '#A6A6A6', - \ 'grey66' : '#A8A8A8', - \ 'grey67' : '#ABABAB', - \ 'grey68' : '#ADADAD', - \ 'grey69' : '#B0B0B0', - \ 'grey7' : '#121212', - \ 'grey70' : '#B3B3B3', - \ 'grey71' : '#B5B5B5', - \ 'grey72' : '#B8B8B8', - \ 'grey73' : '#BABABA', - \ 'grey74' : '#BDBDBD', - \ 'grey75' : '#BFBFBF', - \ 'grey76' : '#C2C2C2', - \ 'grey77' : '#C4C4C4', - \ 'grey78' : '#C7C7C7', - \ 'grey79' : '#C9C9C9', - \ 'grey8' : '#141414', - \ 'grey80' : '#CCCCCC', - \ 'grey81' : '#CFCFCF', - \ 'grey82' : '#D1D1D1', - \ 'grey83' : '#D4D4D4', - \ 'grey84' : '#D6D6D6', - \ 'grey85' : '#D9D9D9', - \ 'grey86' : '#DBDBDB', - \ 'grey87' : '#DEDEDE', - \ 'grey88' : '#E0E0E0', - \ 'grey89' : '#E3E3E3', - \ 'grey9' : '#171717', - \ 'grey90' : '#E5E5E5', - \ 'grey91' : '#E8E8E8', - \ 'grey92' : '#EBEBEB', - \ 'grey93' : '#EDEDED', - \ 'grey94' : '#F0F0F0', - \ 'grey95' : '#F2F2F2', - \ 'grey96' : '#F5F5F5', - \ 'grey97' : '#F7F7F7', - \ 'grey98' : '#FAFAFA', - \ 'grey99' : '#FCFCFC', - \ 'honeydew' : '#F0FFF0', - \ 'honeydew1' : '#F0FFF0', - \ 'honeydew2' : '#E0EEE0', - \ 'honeydew3' : '#C1CDC1', - \ 'honeydew4' : '#838B83', - \ 'hot pink' : '#FF69B4', - \ 'hotpink' : '#FF69B4', - \ 'hotpink1' : '#FF6EB4', - \ 'hotpink2' : '#EE6AA7', - \ 'hotpink3' : '#CD6090', - \ 'hotpink4' : '#8B3A62', - \ 'indian red' : '#CD5C5C', - \ 'indianred' : '#CD5C5C', - \ 'indianred1' : '#FF6A6A', - \ 'indianred2' : '#EE6363', - \ 'indianred3' : '#CD5555', - \ 'indianred4' : '#8B3A3A', - \ 'ivory' : '#FFFFF0', - \ 'ivory1' : '#FFFFF0', - \ 'ivory2' : '#EEEEE0', - \ 'ivory3' : '#CDCDC1', - \ 'ivory4' : '#8B8B83', - \ 'khaki' : '#F0E68C', - \ 'khaki1' : '#FFF68F', - \ 'khaki2' : '#EEE685', - \ 'khaki3' : '#CDC673', - \ 'khaki4' : '#8B864E', - \ 'lavender blush' : '#FFF0F5', - \ 'lavender' : '#E6E6FA', - \ 'lavenderblush' : '#FFF0F5', - \ 'lavenderblush1' : '#FFF0F5', - \ 'lavenderblush2' : '#EEE0E5', - \ 'lavenderblush3' : '#CDC1C5', - \ 'lavenderblush4' : '#8B8386', - \ 'lawn green' : '#7CFC00', - \ 'lawngreen' : '#7CFC00', - \ 'lemon chiffon' : '#FFFACD', - \ 'lemonchiffon' : '#FFFACD', - \ 'lemonchiffon1' : '#FFFACD', - \ 'lemonchiffon2' : '#EEE9BF', - \ 'lemonchiffon3' : '#CDC9A5', - \ 'lemonchiffon4' : '#8B8970', - \ 'light blue' : '#ADD8E6', - \ 'light coral' : '#F08080', - \ 'light cyan' : '#E0FFFF', - \ 'light goldenrod yellow' : '#FAFAD2', - \ 'light goldenrod' : '#EEDD82', - \ 'light gray' : '#D3D3D3', - \ 'light green' : '#90EE90', - \ 'light grey' : '#D3D3D3', - \ 'light magenta' : '#FFBBFF', - \ 'light pink' : '#FFB6C1', - \ 'light red' : '#FFBBBB', - \ 'light salmon' : '#FFA07A', - \ 'light sea green' : '#20B2AA', - \ 'light sky blue' : '#87CEFA', - \ 'light slate blue' : '#8470FF', - \ 'light slate gray' : '#778899', - \ 'light slate grey' : '#778899', - \ 'light steel blue' : '#B0C4DE', - \ 'light yellow' : '#FFFFE0', - \ 'lightblue' : '#ADD8E6', - \ 'lightblue1' : '#BFEFFF', - \ 'lightblue2' : '#B2DFEE', - \ 'lightblue3' : '#9AC0CD', - \ 'lightblue4' : '#68838B', - \ 'lightcoral' : '#F08080', - \ 'lightcyan' : '#E0FFFF', - \ 'lightcyan1' : '#E0FFFF', - \ 'lightcyan2' : '#D1EEEE', - \ 'lightcyan3' : '#B4CDCD', - \ 'lightcyan4' : '#7A8B8B', - \ 'lightgoldenrod' : '#EEDD82', - \ 'lightgoldenrod1' : '#FFEC8B', - \ 'lightgoldenrod2' : '#EEDC82', - \ 'lightgoldenrod3' : '#CDBE70', - \ 'lightgoldenrod4' : '#8B814C', - \ 'lightgoldenrodyellow' : '#FAFAD2', - \ 'lightgray' : '#D3D3D3', - \ 'lightgreen' : '#90EE90', - \ 'lightgrey' : '#D3D3D3', - \ 'lightmagenta' : '#FFBBFF', - \ 'lightpink' : '#FFB6C1', - \ 'lightpink1' : '#FFAEB9', - \ 'lightpink2' : '#EEA2AD', - \ 'lightpink3' : '#CD8C95', - \ 'lightpink4' : '#8B5F65', - \ 'lightred' : '#FFBBBB', - \ 'lightsalmon' : '#FFA07A', - \ 'lightsalmon1' : '#FFA07A', - \ 'lightsalmon2' : '#EE9572', - \ 'lightsalmon3' : '#CD8162', - \ 'lightsalmon4' : '#8B5742', - \ 'lightseagreen' : '#20B2AA', - \ 'lightskyblue' : '#87CEFA', - \ 'lightskyblue1' : '#B0E2FF', - \ 'lightskyblue2' : '#A4D3EE', - \ 'lightskyblue3' : '#8DB6CD', - \ 'lightskyblue4' : '#607B8B', - \ 'lightslateblue' : '#8470FF', - \ 'lightslategray' : '#778899', - \ 'lightslategrey' : '#778899', - \ 'lightsteelblue' : '#B0C4DE', - \ 'lightsteelblue1' : '#CAE1FF', - \ 'lightsteelblue2' : '#BCD2EE', - \ 'lightsteelblue3' : '#A2B5CD', - \ 'lightsteelblue4' : '#6E7B8B', - \ 'lightyellow' : '#FFFFE0', - \ 'lightyellow1' : '#FFFFE0', - \ 'lightyellow2' : '#EEEED1', - \ 'lightyellow3' : '#CDCDB4', - \ 'lightyellow4' : '#8B8B7A', - \ 'lime green' : '#32CD32', - \ 'limegreen' : '#32CD32', - \ 'linen' : '#FAF0E6', - \ 'magenta' : '#FF00FF', - \ 'magenta1' : '#FF00FF', - \ 'magenta2' : '#EE00EE', - \ 'magenta3' : '#CD00CD', - \ 'magenta4' : '#8B008B', - \ 'maroon' : '#B03060', - \ 'maroon1' : '#FF34B3', - \ 'maroon2' : '#EE30A7', - \ 'maroon3' : '#CD2990', - \ 'maroon4' : '#8B1C62', - \ 'medium aquamarine' : '#66CDAA', - \ 'medium blue' : '#0000CD', - \ 'medium orchid' : '#BA55D3', - \ 'medium purple' : '#9370DB', - \ 'medium sea green' : '#3CB371', - \ 'medium slate blue' : '#7B68EE', - \ 'medium spring green' : '#00FA9A', - \ 'medium turquoise' : '#48D1CC', - \ 'medium violet red' : '#C71585', - \ 'mediumaquamarine' : '#66CDAA', - \ 'mediumblue' : '#0000CD', - \ 'mediumorchid' : '#BA55D3', - \ 'mediumorchid1' : '#E066FF', - \ 'mediumorchid2' : '#D15FEE', - \ 'mediumorchid3' : '#B452CD', - \ 'mediumorchid4' : '#7A378B', - \ 'mediumpurple' : '#9370DB', - \ 'mediumpurple1' : '#AB82FF', - \ 'mediumpurple2' : '#9F79EE', - \ 'mediumpurple3' : '#8968CD', - \ 'mediumpurple4' : '#5D478B', - \ 'mediumseagreen' : '#3CB371', - \ 'mediumslateblue' : '#7B68EE', - \ 'mediumspringgreen' : '#00FA9A', - \ 'mediumturquoise' : '#48D1CC', - \ 'mediumvioletred' : '#C71585', - \ 'midnight blue' : '#191970', - \ 'midnightblue' : '#191970', - \ 'mint cream' : '#F5FFFA', - \ 'mintcream' : '#F5FFFA', - \ 'misty rose' : '#FFE4E1', - \ 'mistyrose' : '#FFE4E1', - \ 'mistyrose1' : '#FFE4E1', - \ 'mistyrose2' : '#EED5D2', - \ 'mistyrose3' : '#CDB7B5', - \ 'mistyrose4' : '#8B7D7B', - \ 'moccasin' : '#FFE4B5', - \ 'navajo white' : '#FFDEAD', - \ 'navajowhite' : '#FFDEAD', - \ 'navajowhite1' : '#FFDEAD', - \ 'navajowhite2' : '#EECFA1', - \ 'navajowhite3' : '#CDB38B', - \ 'navajowhite4' : '#8B795E', - \ 'navy blue' : '#000080', - \ 'navy' : '#000080', - \ 'navyblue' : '#000080', - \ 'old lace' : '#FDF5E6', - \ 'oldlace' : '#FDF5E6', - \ 'olive drab' : '#6B8E23', - \ 'olivedrab' : '#6B8E23', - \ 'olivedrab1' : '#C0FF3E', - \ 'olivedrab2' : '#B3EE3A', - \ 'olivedrab3' : '#9ACD32', - \ 'olivedrab4' : '#698B22', - \ 'orange red' : '#FF4500', - \ 'orange' : '#FFA500', - \ 'orange1' : '#FFA500', - \ 'orange2' : '#EE9A00', - \ 'orange3' : '#CD8500', - \ 'orange4' : '#8B5A00', - \ 'orangered' : '#FF4500', - \ 'orangered1' : '#FF4500', - \ 'orangered2' : '#EE4000', - \ 'orangered3' : '#CD3700', - \ 'orangered4' : '#8B2500', - \ 'orchid' : '#DA70D6', - \ 'orchid1' : '#FF83FA', - \ 'orchid2' : '#EE7AE9', - \ 'orchid3' : '#CD69C9', - \ 'orchid4' : '#8B4789', - \ 'pale goldenrod' : '#EEE8AA', - \ 'pale green' : '#98FB98', - \ 'pale turquoise' : '#AFEEEE', - \ 'pale violet red' : '#DB7093', - \ 'palegoldenrod' : '#EEE8AA', - \ 'palegreen' : '#98FB98', - \ 'palegreen1' : '#9AFF9A', - \ 'palegreen2' : '#90EE90', - \ 'palegreen3' : '#7CCD7C', - \ 'palegreen4' : '#548B54', - \ 'paleturquoise' : '#AFEEEE', - \ 'paleturquoise1' : '#BBFFFF', - \ 'paleturquoise2' : '#AEEEEE', - \ 'paleturquoise3' : '#96CDCD', - \ 'paleturquoise4' : '#668B8B', - \ 'palevioletred' : '#DB7093', - \ 'palevioletred1' : '#FF82AB', - \ 'palevioletred2' : '#EE799F', - \ 'palevioletred3' : '#CD6889', - \ 'palevioletred4' : '#8B475D', - \ 'papaya whip' : '#FFEFD5', - \ 'papayawhip' : '#FFEFD5', - \ 'peach puff' : '#FFDAB9', - \ 'peachpuff' : '#FFDAB9', - \ 'peachpuff1' : '#FFDAB9', - \ 'peachpuff2' : '#EECBAD', - \ 'peachpuff3' : '#CDAF95', - \ 'peachpuff4' : '#8B7765', - \ 'peru' : '#CD853F', - \ 'pink' : '#FFC0CB', - \ 'pink1' : '#FFB5C5', - \ 'pink2' : '#EEA9B8', - \ 'pink3' : '#CD919E', - \ 'pink4' : '#8B636C', - \ 'plum' : '#DDA0DD', - \ 'plum1' : '#FFBBFF', - \ 'plum2' : '#EEAEEE', - \ 'plum3' : '#CD96CD', - \ 'plum4' : '#8B668B', - \ 'powder blue' : '#B0E0E6', - \ 'powderblue' : '#B0E0E6', - \ 'purple' : '#A020F0', - \ 'purple1' : '#9B30FF', - \ 'purple2' : '#912CEE', - \ 'purple3' : '#7D26CD', - \ 'purple4' : '#551A8B', - \ 'red' : '#FF0000', - \ 'red1' : '#FF0000', - \ 'red2' : '#EE0000', - \ 'red3' : '#CD0000', - \ 'red4' : '#8B0000', - \ 'rosy brown' : '#BC8F8F', - \ 'rosybrown' : '#BC8F8F', - \ 'rosybrown1' : '#FFC1C1', - \ 'rosybrown2' : '#EEB4B4', - \ 'rosybrown3' : '#CD9B9B', - \ 'rosybrown4' : '#8B6969', - \ 'royal blue' : '#4169E1', - \ 'royalblue' : '#4169E1', - \ 'royalblue1' : '#4876FF', - \ 'royalblue2' : '#436EEE', - \ 'royalblue3' : '#3A5FCD', - \ 'royalblue4' : '#27408B', - \ 'saddle brown' : '#8B4513', - \ 'saddlebrown' : '#8B4513', - \ 'salmon' : '#FA8072', - \ 'salmon1' : '#FF8C69', - \ 'salmon2' : '#EE8262', - \ 'salmon3' : '#CD7054', - \ 'salmon4' : '#8B4C39', - \ 'sandy brown' : '#F4A460', - \ 'sandybrown' : '#F4A460', - \ 'sea green' : '#2E8B57', - \ 'seagreen' : '#2E8B57', - \ 'seagreen1' : '#54FF9F', - \ 'seagreen2' : '#4EEE94', - \ 'seagreen3' : '#43CD80', - \ 'seagreen4' : '#2E8B57', - \ 'seashell' : '#FFF5EE', - \ 'seashell1' : '#FFF5EE', - \ 'seashell2' : '#EEE5DE', - \ 'seashell3' : '#CDC5BF', - \ 'seashell4' : '#8B8682', - \ 'sienna' : '#A0522D', - \ 'sienna1' : '#FF8247', - \ 'sienna2' : '#EE7942', - \ 'sienna3' : '#CD6839', - \ 'sienna4' : '#8B4726', - \ 'sky blue' : '#87CEEB', - \ 'skyblue' : '#87CEEB', - \ 'skyblue1' : '#87CEFF', - \ 'skyblue2' : '#7EC0EE', - \ 'skyblue3' : '#6CA6CD', - \ 'skyblue4' : '#4A708B', - \ 'slate blue' : '#6A5ACD', - \ 'slate gray' : '#708090', - \ 'slate grey' : '#708090', - \ 'slateblue' : '#6A5ACD', - \ 'slateblue1' : '#836FFF', - \ 'slateblue2' : '#7A67EE', - \ 'slateblue3' : '#6959CD', - \ 'slateblue4' : '#473C8B', - \ 'slategray' : '#708090', - \ 'slategray1' : '#C6E2FF', - \ 'slategray2' : '#B9D3EE', - \ 'slategray3' : '#9FB6CD', - \ 'slategray4' : '#6C7B8B', - \ 'slategrey' : '#708090', - \ 'snow' : '#FFFAFA', - \ 'snow1' : '#FFFAFA', - \ 'snow2' : '#EEE9E9', - \ 'snow3' : '#CDC9C9', - \ 'snow4' : '#8B8989', - \ 'spring green' : '#00FF7F', - \ 'springgreen' : '#00FF7F', - \ 'springgreen1' : '#00FF7F', - \ 'springgreen2' : '#00EE76', - \ 'springgreen3' : '#00CD66', - \ 'springgreen4' : '#008B45', - \ 'steel blue' : '#4682B4', - \ 'steelblue' : '#4682B4', - \ 'steelblue1' : '#63B8FF', - \ 'steelblue2' : '#5CACEE', - \ 'steelblue3' : '#4F94CD', - \ 'steelblue4' : '#36648B', - \ 'tan' : '#D2B48C', - \ 'tan1' : '#FFA54F', - \ 'tan2' : '#EE9A49', - \ 'tan3' : '#CD853F', - \ 'tan4' : '#8B5A2B', - \ 'thistle' : '#D8BFD8', - \ 'thistle1' : '#FFE1FF', - \ 'thistle2' : '#EED2EE', - \ 'thistle3' : '#CDB5CD', - \ 'thistle4' : '#8B7B8B', - \ 'tomato' : '#FF6347', - \ 'tomato1' : '#FF6347', - \ 'tomato2' : '#EE5C42', - \ 'tomato3' : '#CD4F39', - \ 'tomato4' : '#8B3626', - \ 'turquoise' : '#40E0D0', - \ 'turquoise1' : '#00F5FF', - \ 'turquoise2' : '#00E5EE', - \ 'turquoise3' : '#00C5CD', - \ 'turquoise4' : '#00868B', - \ 'violet red' : '#D02090', - \ 'violet' : '#EE82EE', - \ 'violetred' : '#D02090', - \ 'violetred1' : '#FF3E96', - \ 'violetred2' : '#EE3A8C', - \ 'violetred3' : '#CD3278', - \ 'violetred4' : '#8B2252', - \ 'wheat' : '#F5DEB3', - \ 'wheat1' : '#FFE7BA', - \ 'wheat2' : '#EED8AE', - \ 'wheat3' : '#CDBA96', - \ 'wheat4' : '#8B7E66', - \ 'white smoke' : '#F5F5F5', - \ 'white' : '#FFFFFF', - \ 'whitesmoke' : '#F5F5F5', - \ 'yellow green' : '#9ACD32', - \ 'yellow' : '#FFFF00', - \ 'yellow1' : '#FFFF00', - \ 'yellow2' : '#EEEE00', - \ 'yellow3' : '#CDCD00', - \ 'yellow4' : '#8B8B00', - \ 'yellowgreen' : '#9ACD32', - \} - - if has_key(l:color_list, l:color_name) - let l:hex_code = l:color_list[l:color_name] - endif - - return l:hex_code -endfunction diff --git a/sources_non_forked/vim-indent-guides/autoload/indent_guides.vim b/sources_non_forked/vim-indent-guides/autoload/indent_guides.vim deleted file mode 100644 index a1aa0325f1..0000000000 --- a/sources_non_forked/vim-indent-guides/autoload/indent_guides.vim +++ /dev/null @@ -1,295 +0,0 @@ -" Author: Nate Kane -" Homepage: http://github.com/preservim/vim-indent-guides - -" -" Toggles the indent guides on and off. -" -function! indent_guides#toggle() abort - call indent_guides#init_matches() - - if empty(w:indent_guides_matches) - call indent_guides#enable() - else - call indent_guides#disable() - endif -endfunction - -" -" Called from autocmds, keeps indent guides enabled or disabled when entering -" other buffers and windows. -" -function! indent_guides#process_autocmds() abort - if g:indent_guides_autocmds_enabled - call indent_guides#enable() - else - call indent_guides#disable() - end -endfunction - -" -" Enables the indent guides for the current buffer and any other buffer upon -" entering it. -" -function! indent_guides#enable() abort - let g:indent_guides_autocmds_enabled = 1 - - if &diff || indent_guides#exclude_filetype() - call indent_guides#clear_matches() - return - end - - call indent_guides#init_script_vars() - call indent_guides#highlight_colors() - call indent_guides#clear_matches() - - " loop through each indent level and define a highlight pattern - " will automagically figure out whether to use tabs or spaces - for l:level in range(s:start_level, s:indent_levels) - let l:group = 'IndentGuides' . ((l:level % 2 == 0) ? 'Even' : 'Odd') - let l:column_start = (l:level - 1) * s:indent_size + 1 - - " define the higlight patterns and add to matches list - if g:indent_guides_space_guides - let l:soft_pattern = indent_guides#indent_highlight_pattern(g:indent_guides_soft_pattern, l:column_start, s:guide_size) - call add(w:indent_guides_matches, matchadd(l:group, l:soft_pattern)) - end - if g:indent_guides_tab_guides - let l:hard_pattern = indent_guides#indent_highlight_pattern('\t', l:column_start, s:indent_size) - call add(w:indent_guides_matches, matchadd(l:group, l:hard_pattern)) - end - endfor -endfunction - -" -" Disables the indent guides for the current buffer and any other buffer upon -" entering it. -" -function! indent_guides#disable() abort - let g:indent_guides_autocmds_enabled = 0 - call indent_guides#clear_matches() -endfunction - -" -" Clear all highlight matches for the current window. -" -function! indent_guides#clear_matches() abort - call indent_guides#init_matches() - if !empty(w:indent_guides_matches) - let l:index = 0 - for l:match_id in w:indent_guides_matches - try - call matchdelete(l:match_id) - catch /E803:/ - " Do nothing - endtry - call remove(w:indent_guides_matches, l:index) - let l:index += l:index - endfor - endif - - " Make sure to clear indent guide if remembered match id has gone somehow. - for l:match in getmatches() - if l:match.group =~# '^IndentGuides\v(Even|Odd)$' - call matchdelete(l:match.id) - endif - endfor -endfunction - -" -" Automagically calculates and defines the indent highlight colors. -" -function! indent_guides#highlight_colors() abort - if s:auto_colors - if has('gui_running') || has('nvim') || (has('termguicolors') && &termguicolors) - call indent_guides#gui_highlight_colors() - else - call indent_guides#basic_highlight_colors() - endif - endif -endfunction - -" -" Defines some basic indent highlight colors that work for Terminal Vim and -" gVim when colors can't be automatically calculated. -" -function! indent_guides#basic_highlight_colors() abort - let l:cterm_colors = (&g:background ==# 'dark') ? ['darkgrey', 'black'] : ['lightgrey', 'white'] - let l:gui_colors = (&g:background ==# 'dark') ? ['grey15', 'grey30'] : ['grey70', 'grey85'] - - exe 'hi IndentGuidesEven guibg=' . l:gui_colors[0] . ' guifg=' . l:gui_colors[1] . ' ctermbg=' . l:cterm_colors[0] . ' ctermfg=' . l:cterm_colors[1] - exe 'hi IndentGuidesOdd guibg=' . l:gui_colors[1] . ' guifg=' . l:gui_colors[0] . ' ctermbg=' . l:cterm_colors[1] . ' ctermfg=' . l:cterm_colors[0] -endfunction - -" -" Automagically calculates and defines the indent highlight colors for gui -" vim. -" -function! indent_guides#gui_highlight_colors() abort - let l:hi_normal_guibg = '' - - " capture the backgroud color from the normal highlight - if s:hi_normal =~ s:color_hex_bg_pat - " hex color code is being used, eg. '#FFFFFF' - let l:hi_normal_guibg = matchstr(s:hi_normal, s:color_hex_bg_pat) - - elseif s:hi_normal =~ s:color_name_bg_pat - " color name is being used, eg. 'white' - let l:color_name = matchstr(s:hi_normal, s:color_name_bg_pat) - let l:hi_normal_guibg = color_helper#color_name_to_hex(l:color_name) - - else - " background color could not be detected, default to basic colors - call indent_guides#basic_highlight_colors() - endif - - if l:hi_normal_guibg =~ s:color_hex_pat - " calculate the highlight background colors - let l:hi_odd_bg = indent_guides#lighten_or_darken_color(l:hi_normal_guibg) - let l:hi_even_bg = indent_guides#lighten_or_darken_color(l:hi_odd_bg) - - " define the new highlights - exe 'hi IndentGuidesOdd guibg=' . l:hi_odd_bg . ' guifg=' . l:hi_even_bg - exe 'hi IndentGuidesEven guibg=' . l:hi_even_bg . ' guifg=' . l:hi_odd_bg - end -endfunction - -" -" Takes a color and darkens or lightens it depending on whether a dark or light -" colorscheme is being used. -" -function! indent_guides#lighten_or_darken_color(color) abort - let l:new_color = '' - - if (&g:background ==# 'dark') - let l:new_color = color_helper#hex_color_lighten(a:color, s:change_percent) - else - let l:new_color = color_helper#hex_color_darken (a:color, s:change_percent) - endif - - return l:new_color -endfunction - -" -" Define default highlights. -" -function! indent_guides#define_default_highlights() abort - hi default clear IndentGuidesOdd - hi default clear IndentGuidesEven -endfunction - -" -" Init the w:indent_guides_matches variable. -" -function! indent_guides#init_matches() abort - let w:indent_guides_matches = exists('w:indent_guides_matches') ? w:indent_guides_matches : [] -endfunction - -" -" We need to initialize these vars every time a buffer is entered while the -" plugin is enabled. -" -function! indent_guides#init_script_vars() abort - if &l:shiftwidth > 0 && &l:expandtab - let s:indent_size = &l:shiftwidth - else - let s:indent_size = &l:tabstop - endif - let s:guide_size = indent_guides#calculate_guide_size() - let s:hi_normal = indent_guides#capture_highlight('Normal') - - " remove 'font=' from the s:hi_normal string (only seems to happen on Vim startup in Windows) - let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+', '', '') - - " shortcuts to the global variables - this makes the code easier to read - let s:debug = g:indent_guides_debug - let s:indent_levels = g:indent_guides_indent_levels - let s:auto_colors = g:indent_guides_auto_colors - let s:color_hex_pat = g:indent_guides_color_hex_pattern - let s:color_hex_bg_pat = g:indent_guides_color_hex_guibg_pattern - let s:color_name_bg_pat = g:indent_guides_color_name_guibg_pattern - let s:start_level = g:indent_guides_start_level - - " str2float not available in vim versions <= 7.1 - if has('float') - let s:change_percent = g:indent_guides_color_change_percent / str2float('100.0') - else - let s:change_percent = g:indent_guides_color_change_percent / 100.0 - endif - - if s:debug - echo 's:indent_size = ' . s:indent_size - echo 's:guide_size = ' . s:guide_size - echo 's:hi_normal = ' . s:hi_normal - echo 's:indent_levels = ' . s:indent_levels - echo 's:auto_colors = ' . s:auto_colors - echo 's:change_percent = ' . string(s:change_percent) - echo 's:color_hex_pat = ' . s:color_hex_pat - echo 's:color_hex_bg_pat = ' . s:color_hex_bg_pat - echo 's:color_name_bg_pat = ' . s:color_name_bg_pat - echo 's:start_level = ' . s:start_level - endif -endfunction - -" -" Calculate the indent guide size. Ensures the guide size is less than or -" equal to the actual indent size, otherwise some weird things can occur. -" -" NOTE: Currently, this only works when soft-tabs are being used. -" -function! indent_guides#calculate_guide_size() abort - let l:guide_size = g:indent_guides_guide_size - - if l:guide_size == 0 || l:guide_size > s:indent_size - let l:guide_size = s:indent_size - endif - - return l:guide_size -endfunction - -" -" Captures and returns the output of highlight group definitions. -" -" Example: indent_guides#capture_highlight('normal') -" Returns: 'Normal xxx guifg=#323232 guibg=#ffffff' -" -function! indent_guides#capture_highlight(group_name) abort - let l:output = execute('hi ' . a:group_name, 'silent') - let l:output = substitute(l:output, '\n', '', '') - return l:output -endfunction - -" -" Returns a regex pattern for highlighting an indent level. -" -" Example: indent_guides#indent_highlight_pattern(' ', 1, 4) -" Returns: /^ *\%1v\zs *\%5v\ze/ -" -" Example: indent_guides#indent_highlight_pattern('\s', 5, 2) -" Returns: /^\s*\%5v\zs\s*\%7v\ze/ -" -" Example: indent_guides#indent_highlight_pattern('\t', 9, 2) -" Returns: /^\t*\%9v\zs\t*\%11v\ze/ -" -function! indent_guides#indent_highlight_pattern(indent_pattern, column_start, indent_size) abort - let l:pattern = '^' . a:indent_pattern . '*\%' . a:column_start . 'v\zs' - let l:pattern .= a:indent_pattern . '*\%' . (a:column_start + a:indent_size) . 'v' - let l:pattern .= '\ze' - return l:pattern -endfunction - -" -" Detect if any of the buffer filetypes should be excluded. -" -function! indent_guides#exclude_filetype() abort - if exists('g:indent_guides_exclude_buftype') - if g:indent_guides_exclude_buftype && &buftype !=# '' - return 1 - endif - endif - for ft in split(&ft, '\.', 1) - if index(g:indent_guides_exclude_filetypes, ft) > -1 - return 1 - end - endfor - return 0 -endfunction diff --git a/sources_non_forked/vim-indent-guides/doc/indent_guides.txt b/sources_non_forked/vim-indent-guides/doc/indent_guides.txt deleted file mode 100644 index 9e88276cf4..0000000000 --- a/sources_non_forked/vim-indent-guides/doc/indent_guides.txt +++ /dev/null @@ -1,361 +0,0 @@ -*indent_guides.txt* A plugin for visually displaying indent levels in Vim. - - *indent-guides* - ____ __ __ ______ _ __ - / _/____ ____/ /___ ____ / /_ / ____/__ __(_)____/ /___ _____ - / / / __ \/ __ // _ \/ __ \/ __/ / / __ / / / / // __ // _ \/ ___/ - _/ / / / / / /_/ // __/ / / / /_ / /_/ // /_/ / // /_/ // __(__ ) - /___//_/ /_/\__,_/ \___/_/ /_/\__/ \____/ \__,_/_/ \__,_/ \___/____/ - - -Author: Nate Kane -Version: 1.7 -Last Change: 07 Mar 2013 - -============================================================================== -CONTENTS *indent-guides-contents* - - 1. Introduction.......................... |indent-guides-introduction| - 2. Commands.............................. |indent-guides-commands| - 3. Options............................... |indent-guides-options| - 4. Mappings.............................. |indent-guides-mappings| - 5. Terminal Vim.......................... |indent-guides-terminal-vim| - 6. About................................. |indent-guides-about| - 7. Changelog............................. |indent-guides-changelog| - 8. License............................... |indent-guides-license| - -============================================================================== -1. INTRODUCTION *indent-guides-introduction* - -Indent Guides is a plugin for visually displaying indent levels in Vim. - -This plugin should work with gVim out of the box, no configuration needed. - -Features:~ - * Can detect both tab and space indent styles. - * Automatically inspects your colorscheme and picks appropriate colors (gVim - only). - * Will highlight indent levels with alternating colors. - * Full support for gVim and basic support for Terminal Vim. - * Seems to work on Windows gVim 7.3 (haven't done any extensive tests - though). - * Customizable size for indent guides, eg. skinny guides (soft-tabs only). - * Customizable start indent level. - * Highlight support for files with a mixture of tab and space indent styles. - -============================================================================== -2. COMMANDS *indent-guides-commands* - ------------------------------------------------------------------------------- -:IndentGuidesToggle *:IndentGuidesToggle* - Toggles the indent guides on and off. - ------------------------------------------------------------------------------- -:IndentGuidesEnable *:IndentGuidesEnable* - Enables the indent guides for the current buffer and any other buffer upon - entering it. - ------------------------------------------------------------------------------- -:IndentGuidesDisable *:IndentGuidesDisable* - Disables the indent guides for the current buffer and any other buffer upon - entering it. - -============================================================================== -3. OPTIONS *indent-guides-options* - ------------------------------------------------------------------------------- - *'indent_guides_indent_levels'* -Use this option to control how many indent levels to display guides for. - -Default: 30. Values: integer. -> - let g:indent_guides_indent_levels = 30 -< - ------------------------------------------------------------------------------- - *'indent_guides_auto_colors'* -Use this option to control whether or not the plugin automatically calculates -the highlight colors. Will use the current colorscheme's background color as a -base color. - -Default: 1. Values: 0 or 1. -> - let g:indent_guides_auto_colors = 1 -< - -If you set this option to 0, be sure to manually define some highlight colors -in an autocmd. -> - let g:indent_guides_auto_colors = 0 - autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3 - autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4 -< - -Alternatively you can add the following lines to your colorscheme file. -> - hi IndentGuidesOdd guibg=red ctermbg=3 - hi IndentGuidesEven guibg=green ctermbg=4 -< - ------------------------------------------------------------------------------- - *'indent_guides_color_change_percent'* -Use this option to control the percent at which the highlight colors will be -lightened or darkened. - -Default: 10 (10%). Values: between 0 and 100. -> - let g:indent_guides_color_change_percent = 10 -< - ------------------------------------------------------------------------------- - *'indent_guides_guide_size'* -Use this option to customize the size of the indent guide. By default the -value is set to 0, which will set the guide size to be the same as the -|shiftwidth|. Setting this value to be larger than the |shiftwidth| is essentially -the same as setting it to 0. - -A common use of this setting is to create skinny indent guides, which look -great with a |shiftwidth| of 4 or more. - -NOTE: This option only works for soft-tabs (spaces) and not hard-tabs. - -Default: 0. Values: between 0 and |shiftwidth|. -> - let g:indent_guides_guide_size = 1 -< - ------------------------------------------------------------------------------- - *'indent_guides_start_level'* -Use this option to control which indent level to start showing guides from. - -Default: 1. Values: between 1 and g:|indent_guides_indent_levels|. -> - let g:indent_guides_start_level = 2 -< - ------------------------------------------------------------------------------- - *'indent_guides_space_guides'* -Use this option to control whether the plugin considers spaces as indention. - -Default: 1. Values: 0 or 1. -> - let g:indent_guides_space_guides = 0 -< - ------------------------------------------------------------------------------- - *'indent_guides_tab_guides'* -Use this option to control whether the plugin considers tabs as indention. - -Default: 1. Values: 0 or 1. -> - let g:indent_guides_tab_guides = 0 -< - ------------------------------------------------------------------------------- - *'indent_guides_soft_pattern'* -Use this option to explicitly specify a pattern for soft indentation. For -example to match spaces only in the beginning of line use ' ' pattern. - -Default: '\s'. Values: Vim regexp. -> - let g:indent_guides_soft_pattern = ' ' -< - ------------------------------------------------------------------------------- - *'indent_guides_enable_on_vim_startup'* -Use this option to control whether the plugin is enabled on Vim startup. - -Default: 0. Values: 0 or 1. -> - let g:indent_guides_enable_on_vim_startup = 0 -< - ------------------------------------------------------------------------------- - *'indent_guides_exclude_buftype'* -Use this option to try and disable the plugin on non-file buffers - -Default: 0. Values: 0 or 1 -> - let g:indent_guides_exclude_buftype = 0 -< ------------------------------------------------------------------------------- - *'indent_guides_exclude_filetypes'* -Use this option to specify a list of filetypes to disable the plugin for. Use -'' for files with no filetypes set. - -Default: ['help']. Values: list of strings. -> - let g:indent_guides_exclude_filetypes = ['help', 'nerdtree'] -< - ------------------------------------------------------------------------------- - *'indent_guides_default_mapping'* -Use this option to control whether the default mapping (ig) gets set. - -Default: 1. Values: 0 or 1. -> - let g:indent_guides_default_mapping = 0 -< - -============================================================================== -4. MAPPINGS *indent-guides-mappings* - -The default mapping for toggling indent guides is ig. You can easily -map it to other keys. For example: -> - :nmap ig IndentGuidesToggle -< - -You can also map some other commands that are not mapped by default. For -example: -> - :nmap ie IndentGuidesEnable - :nmap id IndentGuidesDisable -< - -============================================================================== -5. TERMINAL VIM *indent-guides-terminal-vim* - -At the moment Terminal Vim only has basic support. This means is that colors -won't be automatically calculated based on your colorscheme. Instead, some -preset colors are used depending on whether `background` is set to `dark` or -`light`. - -When `set background=dark` is used, the following highlight colors will be -defined: -> - hi IndentGuidesOdd ctermbg=black - hi IndentGuidesEven ctermbg=darkgrey -< - -Alternatively, when `set background=light` is used, the following highlight -colors will be defined: -> - hi IndentGuidesOdd ctermbg=white - hi IndentGuidesEven ctermbg=lightgrey -< - -If for some reason it's incorrectly defining light highlight colors instead of -dark ones or vice versa, the first thing you should check is that the -`background` value is being set correctly for your colorscheme. Sometimes it's -best to manually set the `background` value in your `.vimrc`, for example: -> - colorscheme desert256 - set background=dark -< - -Alternatively you can manually setup the highlight colors yourself, see -|indent_guides_auto_colors| for an example. - -============================================================================== -6. ABOUT *indent-guides-about* - -Why did I build this plugin?~ - * I believe indent guides make nested code easier to read and understand. - * Other editors have them and it's high time Vim did. - * None of the existing indent guide plugins on the market suited my needs. - * I wanted to learn me some VimL. - -Links:~ - * Github: https://github.com/preservim/vim-indent-guides - * Bugs & Issues: https://github.com/preservim/vim-indent-guides/issues - -Credits:~ - * Matt Wozniski (godlygeek) for letting me use the list of color names and - hex codes from his CSApprox plugin. - -Contact:~ - * Twitter: @nathanaelkane - * Email: - -Bug reports, feedback, suggestions etc are welcomed. - -============================================================================== -7. CHANGELOG *indent-guides-changelog* - -1.8 (pending release)~ - * Allow exclude files with no 'filetype' set (thanks @noscript). - * Added option g:|indent_guides_soft_pattern| to control the pattern for - soft indentation (thanks @noscript). - * Added option g:|indent_guides_default_mapping| to control whether the - default mapping (ig) gets set (thanks @suy). - * Set size of indent guide to `tabstop` value when `shiftwidth=0` or - `noexpandtab` is used (thanks @darkfeline and @wilywampa). - * Don't load plugin in unsupported versions of Vim (thanks @dersaidin). - * Added option g:|indent_guides_tab_guides| to control whether tabs are - considered as indention (thanks @amerlyq). - -1.7~ - * Added way to override the default mapping (thanks @xuhdev). - * Added option g:|indent_guides_exclude_filetypes| to specify a list of - filetypes to disable the plugin for. - * Disable the plugin when in a diff. - * Various bug fixes. - -1.6~ - * Added option g:|indent_guides_space_guides| to control whether spaces are - considered as indention (thanks @scoz). - * Added 'doc/tags' to gitignore (thanks @lenniboy). - * Fixed E803 ID not found spam (thanks @mutewinter). - * Fixed str2float issue with Vim 7.1 (thanks @acx0). - -1.5~ - * Added highlight support for files with a mixture of tab and space indent - styles (thanks @graywh). - * Added -bar to all the :commands so they can chain with other :commands - (thanks @graywh). - * No longer overriding pre-defined custom highlight colors (thanks @graywh). - * Using str2float to work around a float bug in some versions of Vim 7.2 - (thanks @voidus). - -1.4~ - * Added the new plugin option g:|indent_guides_enable_on_vim_startup|. - * Improved Windows support. - -1.3~ - * Changed the default value of g:|indent_guides_color_change_percent| to 10. - * Added support for gVim themes that don't specify a `hi Normal guibg` - color. - -1.2~ - * Customizable size for indent guides, eg. skinny guides (soft-tabs only). - * Customizable start indent level. - * Refactored some internal logic. - -1.1~ - * Added basic support for Terminal Vim. See |indent-guides-terminal-vim| for - more information. - * Cut down on rgb to hex color conversions by adding a big dictionary of - color names and hex codes. - * Various bug fixes. - -1.0~ - * First public version. - -============================================================================== -8. LICENSE *indent-guides-license* - -The MIT Licence -http://www.opensource.org/licenses/mit-license.php - -Copyright (c) 2010-2013 Nate Kane - -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. - -vim:tw=78:ts=2:ft=help:norl: diff --git a/sources_non_forked/vim-indent-guides/plugin/indent_guides.vim b/sources_non_forked/vim-indent-guides/plugin/indent_guides.vim deleted file mode 100644 index d2394083bd..0000000000 --- a/sources_non_forked/vim-indent-guides/plugin/indent_guides.vim +++ /dev/null @@ -1,95 +0,0 @@ -" Author: Nate Kane -" Homepage: http://github.com/preservim/vim-indent-guides - -" Do not load if vim is too old -if (v:version == 701 && !exists('*matchadd')) || (v:version < 701) - finish -endif - -if exists('g:loaded_indent_guides') || &cp - finish -endif -let g:loaded_indent_guides = 1 -call indent_guides#define_default_highlights() - -function! s:IndentGuidesToggle() - call indent_guides#toggle() -endfunction - -function! s:IndentGuidesEnable() - call indent_guides#enable() -endfunction - -function! s:IndentGuidesDisable() - call indent_guides#disable() -endfunction - -" Commands -command! -bar IndentGuidesToggle call s:IndentGuidesToggle() -command! -bar IndentGuidesEnable call s:IndentGuidesEnable() -command! -bar IndentGuidesDisable call s:IndentGuidesDisable() - -" -" Initializes a given variable to a given value. The variable is only -" initialized if it does not exist prior. -" -function s:InitVariable(var, value) - if !exists(a:var) - if type(a:value) == type('') - exec 'let ' . a:var . ' = ' . "'" . a:value . "'" - else - exec 'let ' . a:var . ' = ' . a:value - endif - endif -endfunction - -" Fixed global variables -let g:indent_guides_autocmds_enabled = 0 -let g:indent_guides_color_hex_pattern = '#[0-9A-Fa-f]\{6\}' -let g:indent_guides_color_hex_guibg_pattern = 'guibg=\zs' . g:indent_guides_color_hex_pattern . '\ze' -let g:indent_guides_color_name_guibg_pattern = "guibg='\\?\\zs[0-9A-Za-z ]\\+\\ze'\\?" - -" Configurable global variables -call s:InitVariable('g:indent_guides_indent_levels', 30) -call s:InitVariable('g:indent_guides_auto_colors', 1) -call s:InitVariable('g:indent_guides_color_change_percent', 10) " ie. 10% -call s:InitVariable('g:indent_guides_guide_size', 0) -call s:InitVariable('g:indent_guides_start_level', 1) -call s:InitVariable('g:indent_guides_enable_on_vim_startup', 0) -call s:InitVariable('g:indent_guides_debug', 0) -call s:InitVariable('g:indent_guides_space_guides', 1) -call s:InitVariable('g:indent_guides_tab_guides', 1) -call s:InitVariable('g:indent_guides_soft_pattern', '\s') -call s:InitVariable('g:indent_guides_default_mapping', 1) - -if !exists('g:indent_guides_exclude_filetypes') - let g:indent_guides_exclude_filetypes = ['help'] -endif - -" Default mapping -if !hasmapto('IndentGuidesToggle', 'n') && maparg('ig', 'n') ==# '' - \ && g:indent_guides_default_mapping != 0 - nmap ig IndentGuidesToggle -endif - -" Plug mappings -nnoremap -endsnippet - -snippet scriptsrc "HTML -endsnippet - -snippet select "Select Box" w - -endsnippet - -snippet small "" w -$1 -endsnippet - -snippet span "" w -${0:${VISUAL}} -endsnippet - -snippet span# " with ID & class" w -${0:${VISUAL}} -endsnippet - -snippet span. " with class" w -${0:${VISUAL}} -endsnippet - -snippet strong "" w -$1 -endsnippet - -snippet style "HTML -endsnippet - -snippet sub "" w -$1 -endsnippet - -snippet sup "" w -$1 -endsnippet - -snippet table "HTML " w -
- ${0:${VISUAL}} -
-endsnippet - -snippet tbody "" -$1 -endsnippet - -snippet td "table cell" w -${0:${VISUAL}} -endsnippet - -snippet template "