diff --git a/.ctags b/.ctags new file mode 100644 index 00000000..a8dda83e --- /dev/null +++ b/.ctags @@ -0,0 +1,43 @@ +--exclude=node_modules +--exclude=gulp + +--languages=-JavaScript +--langdef=js +--langmap=js:.js + +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\{/\5/,object/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*function[ \t]*\(/\5/,function/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*\[/\5/,array/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[^"]'[^']*/\5/,string/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*(true|false)/\5/,boolean/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*[0-9]+/\5/,number/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*=[ \t]*.+([,;=]|$)/\5/,variable/ +--regex-js=/(,|(;|^)[ \t]*(var|let|([A-Za-z_$][A-Za-z0-9_$.]+\.)*))[ \t]*([A-Za-z0-9_$]+)[ \t]*[ \t]*([,;]|$)/\5/,variable/ +--regex-js=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*\([^)]*\)/\1/,function/ + +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*\{/\2/,object/ +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*function[ \t]*\(/\2/,function/ +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*\[/\2/,array/ +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*[^"]'[^']*/\2/,string/ +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*(true|false)/\2/,boolean/ +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*[0-9]+/\2/,number/ +--regex-js=/(,|^)[ \t]*([A-Za-z_$][A-Za-z0-9_$]+)[ \t]*:[ \t]*[^=]+([,;]|$)/\2/,variable/ + + +--langdef=coffee +--langmap=coffee:.coffee.cjsx +--regex-coffee=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]*\.)*([A-Za-z_][A-Za-z0-9_]*)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/ +--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?(([A-Za-z_][A-Za-z0-9_.]*)+):.*[-=]>.*$/\3/m,method/ +--regex-coffee=/^[ \t]*([A-Za-z_][A-Za-z0-9_]*\.)*([A-Za-z_][A-Za-z0-9_]*)[ \t]*=.*[-=]>.*$/\2/f,function/ +--regex-coffee=/^[ \t]*([A-Za-z_][A-Za-z0-9_]*\.)*([A-Za-z_][A-Za-z0-9_]*)[ \t]*=[^->]*$/\2/v,variable/ +--regex-coffee=/^[ \t]*@(([A-Za-z_][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/a,attribute/ +--regex-coffee=/^[ \t]*@(([A-Za-z_][A-Za-z0-9_.]*)+):[^->\n]*$/\1/A,static attribute/ +--regex-coffee=/^[ \t]*(([A-Za-z_][A-Za-z0-9_.]*)+):[^->\n]*$/\1/a,attribute/ +--regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/a,attribute/ + + + +--langdef=scss +--langmap=scss:.scss +--regex-scss=/^[ \t]*@mixin[ \t]+([A-Za-z0-9_]+)/\1/m,mixin/ +--regex-scss=/^[ \t]*@function[ \t]+([A-Za-z0-9_]+)/\1/f,function/ diff --git a/.gitignore b/.gitignore index 0448f793..a170cac3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ sources_forked/yankring/doc/tags sources_non_forked/tlib/doc/tags sources_non_forked/ctrlp.vim/doc/tags* tags +node_modules diff --git a/.tern-config b/.tern-config new file mode 100644 index 00000000..2b524521 --- /dev/null +++ b/.tern-config @@ -0,0 +1,5 @@ +{ + "plugins": { + "closure": {} + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..2229db08 --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "name": "vimrc", + "version": "1.0.0", + "description": "![VIM](https://dnp4pehkvoo6n.cloudfront.net/43c5af597bd5c1a64eb1829f011c208f/as/Ultimate%20Vimrc.svg)", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ChrisOHu/vimrc.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/ChrisOHu/vimrc/issues" + }, + "homepage": "https://github.com/ChrisOHu/vimrc#readme", + "dependencies": { + "tern": "^0.21.0", + "tern-closure": "^0.1.3" + } +} diff --git a/sources_non_forked/tagbar/.gitattributes b/sources_non_forked/tagbar/.gitattributes new file mode 100644 index 00000000..3b1db11a --- /dev/null +++ b/sources_non_forked/tagbar/.gitattributes @@ -0,0 +1,4 @@ +.gitignore export-ignore +.gitattributes export-ignore +README export-ignore +.info export-ignore diff --git a/sources_non_forked/tagbar/.gitignore b/sources_non_forked/tagbar/.gitignore new file mode 100644 index 00000000..0a56e3fc --- /dev/null +++ b/sources_non_forked/tagbar/.gitignore @@ -0,0 +1 @@ +/doc/tags diff --git a/sources_non_forked/tagbar/.info b/sources_non_forked/tagbar/.info new file mode 100644 index 00000000..f4d91373 --- /dev/null +++ b/sources_non_forked/tagbar/.info @@ -0,0 +1,2 @@ +tagbar +3465 diff --git a/sources_non_forked/tagbar/LICENSE b/sources_non_forked/tagbar/LICENSE new file mode 100644 index 00000000..5ae1a752 --- /dev/null +++ b/sources_non_forked/tagbar/LICENSE @@ -0,0 +1,82 @@ +TAGBAR LICENSE + +This is the normal Vim license (see ':h license' in Vim) with the necessary +replacements for the project and maintainer information. + +I) There are no restrictions on distributing unmodified copies of Tagbar + except that they must include this license text. You can also distribute + unmodified parts of Tagbar, likewise unrestricted except that they must + include this license text. You are also allowed to include executables + that you made from the unmodified Tagbar sources, plus your own usage + examples and scripts. + +II) It is allowed to distribute a modified (or extended) version of Tagbar, + including executables and/or source code, when the following four + conditions are met: + 1) This license text must be included unmodified. + 2) The modified Tagbar must be distributed in one of the following five ways: + a) If you make changes to Tagbar yourself, you must clearly describe in + the distribution how to contact you. When the maintainer asks you + (in any way) for a copy of the modified Tagbar you distributed, you + must make your changes, including source code, available to the + maintainer without fee. The maintainer reserves the right to + include your changes in the official version of Tagbar. What the + maintainer will do with your changes and under what license they + will be distributed is negotiable. If there has been no negotiation + then this license, or a later version, also applies to your changes. + The current maintainer is Jan Larres . If this + changes it will be announced in appropriate places (most likely + majutsushi.github.io/tagbar and/or github.com/majutsushi/tagbar). + When it is completely impossible to contact the maintainer, the + obligation to send him your changes ceases. Once the maintainer has + confirmed that he has received your changes they will not have to be + sent again. + b) If you have received a modified Tagbar that was distributed as + mentioned under a) you are allowed to further distribute it + unmodified, as mentioned at I). If you make additional changes the + text under a) applies to those changes. + c) Provide all the changes, including source code, with every copy of + the modified Tagbar you distribute. This may be done in the form of + a context diff. You can choose what license to use for new code you + add. The changes and their license must not restrict others from + making their own changes to the official version of Tagbar. + d) When you have a modified Tagbar which includes changes as mentioned + under c), you can distribute it without the source code for the + changes if the following three conditions are met: + - The license that applies to the changes permits you to distribute + the changes to the Tagbar maintainer without fee or restriction, and + permits the Tagbar maintainer to include the changes in the official + version of Tagbar without fee or restriction. + - You keep the changes for at least three years after last + distributing the corresponding modified Tagbar. When the + maintainer or someone who you distributed the modified Tagbar to + asks you (in any way) for the changes within this period, you must + make them available to him. + - You clearly describe in the distribution how to contact you. This + contact information must remain valid for at least three years + after last distributing the corresponding modified Tagbar, or as + long as possible. + e) When the GNU General Public License (GPL) applies to the changes, + you can distribute the modified Tagbar under the GNU GPL version 2 + or any later version. + 3) A message must be added, at least in the documentation, such that the + user of the modified Tagbar is able to see that it was modified. When + distributing as mentioned under 2)e) adding the message is only + required for as far as this does not conflict with the license used for + the changes. + 4) The contact information as required under 2)a) and 2)d) must not be + removed or changed, except that the person himself can make + corrections. + +III) If you distribute a modified version of Tagbar, you are encouraged to use + the Tagbar license for your changes and make them available to the + maintainer, including the source code. The preferred way to do this is + by e-mail or by uploading the files to a server and e-mailing the URL. If + the number of changes is small (e.g., a modified Makefile) e-mailing a + context diff will do. The e-mail address to be used is + + +IV) It is not allowed to remove this license from the distribution of the + Tagbar sources, parts of it or from a modified version. You may use this + license for previous Tagbar releases instead of the license that they + came with, at your option. diff --git a/sources_non_forked/tagbar/README.md b/sources_non_forked/tagbar/README.md new file mode 100644 index 00000000..ba17c63f --- /dev/null +++ b/sources_non_forked/tagbar/README.md @@ -0,0 +1,85 @@ +# Tagbar: a class outline viewer for Vim + +## What Tagbar is + +Tagbar is a Vim plugin that provides an easy way to browse the tags of the +current file and get an overview of its structure. It does this by creating a +sidebar that displays the ctags-generated tags of the current file, ordered by +their scope. This means that for example methods in C++ are displayed under +the class they are defined in. + +## What Tagbar is not + +Tagbar is not a general-purpose tool for managing `tags` files. It only +creates the tags it needs on-the-fly in-memory without creating any files. +`tags` file management is provided by other plugins, like for example +[easytags](https://github.com/xolox/vim-easytags). + +## Dependencies + +[Vim 7.3.1058](http://www.vim.org/) +[Exuberant Ctags 5.5](http://ctags.sourceforge.net/) or +[Universal Ctags](https://ctags.io) (recommended), a maintained fork of +Exuberant Ctags. + +## Installation + +Extract the archive or clone the repository into a directory in your +`'runtimepath'`, or use a plugin manager of your choice like +[pathogen](https://github.com/tpope/vim-pathogen). Don't forget to run +`:helptags` if your plugin manager doesn't do it for you so you can access the +documentation with `:help tagbar`. + +If the ctags executable is not installed in one of the directories in your +`$PATH` environment variable you have to set the `g:tagbar_ctags_bin` +variable, see the documentation for more info. + +## Quickstart + +Put something like the following into your ~/.vimrc: + +```vim +nmap :TagbarToggle +``` + +If you do this the F8 key will toggle the Tagbar window. You can of course use +any shortcut you want. For more flexible ways to open and close the window +(and the rest of the functionality) see the documentation. + +## Support for additional filetypes + +For filetypes that are not supported by Exuberant Ctags check out [the +wiki](https://github.com/majutsushi/tagbar/wiki) to see whether other projects +offer support for them and how to use them. Please add any other +projects/configurations that you find or create yourself so that others can +benefit from them, too. + +## Note: If the file structure display is wrong + +If you notice that there are some errors in the way your file's structure is +displayed in Tagbar, please make sure that the bug is actually in Tagbar +before you report an issue. Since Tagbar uses +[exuberant-ctags](http://ctags.sourceforge.net/) and compatible programs to do +the actual file parsing, it is likely that the bug is actually in the program +responsible for that filetype instead. + +There is an example in `:h tagbar-issues` about how to run ctags manually so +you can determine where the bug actually is. If the bug is actually in ctags, +please report it on their website instead, as there is nothing I can do about +it in Tagbar. Thank you! + +You can also have a look at [ctags bugs that have previously been filed +against Tagbar](https://github.com/majutsushi/tagbar/issues?labels=ctags-bug&page=1&state=closed). + +## Screenshots + +![screenshot1](https://i.imgur.com/Sf9Ls2r.png) +![screenshot2](https://i.imgur.com/n4bpPv3.png) + +## License + +Vim license, see LICENSE + +## Maintainer + +Jan Larres <[jan@majutsushi.net](mailto:jan@majutsushi.net)> diff --git a/sources_non_forked/tagbar/autoload/tagbar.vim b/sources_non_forked/tagbar/autoload/tagbar.vim new file mode 100644 index 00000000..ea8febf0 --- /dev/null +++ b/sources_non_forked/tagbar/autoload/tagbar.vim @@ -0,0 +1,3388 @@ +" ============================================================================ +" File: tagbar.vim +" Description: List the current file's tags in a sidebar, ordered by class etc +" Author: Jan Larres +" Licence: Vim licence +" Website: http://majutsushi.github.com/tagbar/ +" Version: 2.7 +" Note: This plugin was heavily inspired by the 'Taglist' plugin by +" Yegappan Lakshmanan and uses a small amount of code from it. +" +" Original taglist copyright notice: +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" taglist.vim is provided *as is* and comes with no warranty of +" any kind, either expressed or implied. In no event will the +" copyright holder be liable for any damamges resulting from the +" use of this software. +" ============================================================================ + +scriptencoding utf-8 + +" Initialization {{{1 + +" If another plugin calls an autoloaded Tagbar function on startup before the +" plugin/tagbar.vim file got loaded, load it explicitly +if exists(':Tagbar') == 0 + runtime plugin/tagbar.vim +endif + +if exists(':Tagbar') == 0 + echomsg 'Tagbar: Could not load plugin code, check your runtimepath!' + finish +endif + +" Basic init {{{2 + +redir => s:ftype_out +silent filetype +redir END +if s:ftype_out !~# 'detection:ON' + echomsg 'Tagbar: Filetype detection is turned off, skipping plugin' + unlet s:ftype_out + finish +endif +unlet s:ftype_out + +let g:tagbar#icon_closed = g:tagbar_iconchars[0] +let g:tagbar#icon_open = g:tagbar_iconchars[1] + +let s:type_init_done = 0 +let s:autocommands_done = 0 +let s:statusline_in_use = 0 +let s:init_done = 0 + +" 0: not checked yet; 1: checked and found; 2: checked and not found +let s:checked_ctags = 0 +let s:checked_ctags_types = 0 +let s:ctags_is_uctags = 0 + +let s:new_window = 1 +let s:is_maximized = 0 +let s:winrestcmd = '' +let s:short_help = 1 +let s:nearby_disabled = 0 +let s:paused = 0 +let s:pwin_by_tagbar = 0 +let s:buffer_seqno = 0 +let s:vim_quitting = 0 +let s:last_alt_bufnr = -1 + +let s:window_expanded = 0 +let s:expand_bufnr = -1 +let s:window_pos = { + \ 'pre' : { 'x' : 0, 'y' : 0 }, + \ 'post' : { 'x' : 0, 'y' : 0 } +\} + +let s:delayed_update_files = [] + +let g:loaded_tagbar = 1 + +let s:last_highlight_tline = 0 + +let s:warnings = { + \ 'type': [], + \ 'encoding': 0 +\ } + +" s:Init() {{{2 +function! s:Init(silent) abort + if s:checked_ctags == 2 && a:silent + return 0 + elseif s:checked_ctags != 1 + if !s:CheckForExCtags(a:silent) + return 0 + endif + endif + + if !s:type_init_done + call s:InitTypes() + endif + + if !s:autocommands_done + call s:CreateAutocommands() + call s:AutoUpdate(fnamemodify(expand('%'), ':p'), 0) + endif + + let s:init_done = 1 + return 1 +endfunction + +" s:InitTypes() {{{2 +function! s:InitTypes() abort + call tagbar#debug#log('Initializing types') + + let supported_types = s:GetSupportedFiletypes() + + if s:ctags_is_uctags + let s:known_types = tagbar#types#uctags#init(supported_types) + else + let s:known_types = tagbar#types#ctags#init(supported_types) + endif + + " Use jsctags/doctorjs if available + let jsctags = s:CheckFTCtags('jsctags', 'javascript') + if jsctags != '' + call tagbar#debug#log('Detected jsctags, overriding typedef') + let type_javascript = tagbar#prototypes#typeinfo#new() + let type_javascript.ctagstype = 'javascript' + let type_javascript.kinds = [ + \ {'short' : 'v', 'long' : 'variables', 'fold' : 0, 'stl' : 0}, + \ {'short' : 'f', 'long' : 'functions', 'fold' : 0, 'stl' : 1} + \ ] + let type_javascript.sro = '.' + let type_javascript.kind2scope = { + \ 'v' : 'namespace', + \ 'f' : 'namespace' + \ } + let type_javascript.scope2kind = { + \ 'namespace' : 'f' + \ } + let type_javascript.ctagsbin = jsctags + let type_javascript.ctagsargs = '-f -' + let type_javascript.ftype = 'javascript' + call type_javascript.createKinddict() + let s:known_types.javascript = type_javascript + endif + + call s:LoadUserTypeDefs() + + " Add an 'unknown' kind to the types for pseudotags that we can't + " determine the correct kind for since they don't have any children that + " are not pseudotags and that therefore don't provide scope information + for typeinfo in values(s:known_types) + if has_key(typeinfo, 'kind2scope') + let unknown_kind = + \ {'short' : '?', 'long' : 'unknown', 'fold' : 0, 'stl' : 1} + " Check for existence first since some types exist under more than + " one name + if index(typeinfo.kinds, unknown_kind) == -1 + call add(typeinfo.kinds, unknown_kind) + endif + let typeinfo.kind2scope['?'] = 'unknown' + endif + endfor + + let s:type_init_done = 1 +endfunction + +" s:LoadUserTypeDefs() {{{2 +function! s:LoadUserTypeDefs(...) abort + if a:0 > 0 + let type = a:1 + + let defdict = {} + let defdict[type] = g:tagbar_type_{type} + else + let defdict = tagbar#getusertypes() + endif + + let transformed = {} + for [type, def] in items(defdict) + let transformed[type] = s:TransformUserTypeDef(def) + let transformed[type].ftype = type + endfor + + for [key, value] in items(transformed) + call tagbar#debug#log("Initializing user type '" . key . "'") + if !has_key(s:known_types, key) || get(value, 'replace', 0) + let s:known_types[key] = tagbar#prototypes#typeinfo#new(value) + else + call extend(s:known_types[key], value) + endif + call s:known_types[key].createKinddict() + endfor +endfunction + +" s:TransformUserTypeDef() {{{2 +" Transform the user definitions into the internal format +function! s:TransformUserTypeDef(def) abort + let newdef = copy(a:def) + + if has_key(a:def, 'kinds') + let newdef.kinds = [] + let kinds = a:def.kinds + for kind in kinds + let kindlist = split(kind, ':') + let kinddict = {'short' : kindlist[0], 'long' : kindlist[1]} + let kinddict.fold = get(kindlist, 2, 0) + let kinddict.stl = get(kindlist, 3, 1) + call add(newdef.kinds, kinddict) + endfor + endif + + " If the user only specified one of kind2scope and scope2kind then use it + " to generate the respective other + if has_key(a:def, 'kind2scope') && !has_key(a:def, 'scope2kind') + let newdef.scope2kind = {} + for [key, value] in items(a:def.kind2scope) + let newdef.scope2kind[value] = key + endfor + elseif has_key(a:def, 'scope2kind') && !has_key(a:def, 'kind2scope') + let newdef.kind2scope = {} + for [key, value] in items(a:def.scope2kind) + let newdef.kind2scope[value] = key + endfor + endif + + return newdef +endfunction + +" s:RestoreSession() {{{2 +" Properly restore Tagbar after a session got loaded +function! s:RestoreSession() abort + if s:init_done + call tagbar#debug#log('Tagbar already initialized; not restoring session') + return + endif + + call tagbar#debug#log('Restoring session') + + let curfile = fnamemodify(bufname('%'), ':p') + + let tagbarwinnr = bufwinnr(s:TagbarBufName()) + if tagbarwinnr == -1 + " Tagbar wasn't open in the saved session, nothing to do + return + endif + + let in_tagbar = 1 + if winnr() != tagbarwinnr + call s:goto_win(tagbarwinnr, 1) + let in_tagbar = 0 + endif + + let s:last_autofocus = 0 + + call s:Init(0) + + call s:InitWindow(g:tagbar_autoclose) + + call s:AutoUpdate(curfile, 0) + + if !in_tagbar + call s:goto_win('p') + endif +endfunction + +" s:MapKeys() {{{2 +function! s:MapKeys() abort + call tagbar#debug#log('Mapping keys') + + nnoremap