├── .gitignore ├── .gitmodules ├── README.md ├── autoload ├── netrw.vim ├── netrwFileHandlers.vim ├── netrwSettings.vim └── netrw_gitignore.vim ├── bundle └── neobundle.vim │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE-MIT.txt │ ├── Makefile │ ├── README.md │ ├── autoload │ ├── neobundle.vim │ ├── neobundle │ │ ├── TOML.vim │ │ ├── autoload.vim │ │ ├── cache.vim │ │ ├── commands.vim │ │ ├── config.vim │ │ ├── init.vim │ │ ├── installer.vim │ │ ├── parser.vim │ │ ├── sources │ │ │ ├── github.vim │ │ │ ├── neobundle_vim_recipes.vim │ │ │ └── vim_scripts_org.vim │ │ ├── types │ │ │ ├── git.vim │ │ │ ├── hg.vim │ │ │ ├── nosync.vim │ │ │ ├── raw.vim │ │ │ └── svn.vim │ │ ├── util.vim │ │ └── vamkr.vim │ └── unite │ │ ├── kinds │ │ └── neobundle.vim │ │ └── sources │ │ ├── neobundle.vim │ │ ├── neobundle_install.vim │ │ ├── neobundle_lazy.vim │ │ ├── neobundle_log.vim │ │ └── neobundle_search.vim │ ├── bin │ ├── install.sh │ ├── neoinstall │ ├── neoinstall.bat │ └── neoinstall_novimproc.bat │ ├── doc │ └── neobundle.txt │ ├── ftdetect │ └── vimrecipe.vim │ ├── plugin │ └── neobundle.vim │ ├── syntax │ └── vimrecipe.vim │ └── test │ ├── commands.vim │ ├── lock.vim │ ├── parse.vim │ ├── recipe.vim │ ├── sample.vim │ ├── source.vim │ ├── toml.vim │ └── tsort.vim ├── colors └── jellybeans.vim ├── doc ├── pi_netrw.txt └── tags ├── plugin └── netrwPlugin.vim ├── snippets └── javascript │ ├── ivey.snippet │ ├── javascript_angular.controller.snippets │ ├── javascript_angular.directive.snippets │ ├── javascript_angular.factory.snippets │ ├── javascript_angular.filter.snippets │ ├── javascript_angular.module.snippets │ └── javascript_angular.service.snippets ├── syntax └── netrw.vim └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | tags 2 | .token 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vundle"] 2 | path = vundle 3 | url = https://github.com/gmarik/Vundle.vim.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## My vimfiles 2 | 3 | Here's my collection of my vimfiles, along with a few other dotfiles and misc tools. 4 | 5 | They center around: 6 | 7 | * Node.js 8 | * HTML5/CSS3/JS 9 | * git 10 | * Functionality 11 | 12 | and the "living in the editor" lifestyle. 13 | 14 | It's here primarily to make it easy to sync up my systems, but if you want learn from them, suggest changes, etc., be my guest! 15 | 16 | ### Instructions 17 | 18 | ``` 19 | git clone git@github.com:jaxbot/vimfiles.git ~/.vim/ 20 | git submodule init 21 | git submodule update 22 | 23 | ./link 24 | 25 | :PluginInstall 26 | ``` 27 | 28 | Tada. 29 | 30 | ### My vim version 31 | 32 | On OSX: 33 | 34 | ``` 35 | brew update 36 | brew install python 37 | 38 | # vim 39 | brew install macvim --override-system-vim --custom-icons --with-lua 40 | 41 | # neovim 42 | brew install neovim/neovim/neovim 43 | pip3 install neovim 44 | ``` 45 | 46 | -------------------------------------------------------------------------------- /autoload/netrwFileHandlers.vim: -------------------------------------------------------------------------------- 1 | " netrwFileHandlers: contains various extension-based file handlers for 2 | " netrw's browsers' x command ("eXecute launcher") 3 | " Author: Charles E. Campbell 4 | " Date: May 03, 2013 5 | " Version: 11b ASTRO-ONLY 6 | " Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1 7 | " Permission is hereby granted to use and distribute this code, 8 | " with or without modifications, provided that this copyright 9 | " notice is copied with it. Like anything else that's free, 10 | " netrwFileHandlers.vim is provided *as is* and comes with no 11 | " warranty of any kind, either expressed or implied. In no 12 | " event will the copyright holder be liable for any damages 13 | " resulting from the use of this software. 14 | " 15 | " Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1 16 | " is eternal life in Christ Jesus our Lord. 17 | 18 | " --------------------------------------------------------------------- 19 | " Load Once: {{{1 20 | if exists("g:loaded_netrwFileHandlers") || &cp 21 | finish 22 | endif 23 | let g:loaded_netrwFileHandlers= "v11b" 24 | if v:version < 702 25 | echohl WarningMsg 26 | echo "***warning*** this version of netrwFileHandlers needs vim 7.2" 27 | echohl Normal 28 | finish 29 | endif 30 | let s:keepcpo= &cpo 31 | set cpo&vim 32 | 33 | " --------------------------------------------------------------------- 34 | " netrwFileHandlers#Invoke: {{{1 35 | fun! netrwFileHandlers#Invoke(exten,fname) 36 | " call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)") 37 | let exten= a:exten 38 | " list of supported special characters. Consider rcs,v --- that can be 39 | " supported with a NFH_rcsCOMMAv() handler 40 | if exten =~ '[@:,$!=\-+%?;~]' 41 | let specials= { 42 | \ '@' : 'AT', 43 | \ ':' : 'COLON', 44 | \ ',' : 'COMMA', 45 | \ '$' : 'DOLLAR', 46 | \ '!' : 'EXCLAMATION', 47 | \ '=' : 'EQUAL', 48 | \ '-' : 'MINUS', 49 | \ '+' : 'PLUS', 50 | \ '%' : 'PERCENT', 51 | \ '?' : 'QUESTION', 52 | \ ';' : 'SEMICOLON', 53 | \ '~' : 'TILDE'} 54 | let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') 55 | " call Decho('fname<'.fname.'> done with dictionary') 56 | endif 57 | 58 | if a:exten != "" && exists("*NFH_".exten) 59 | " support user NFH_*() functions 60 | " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') 61 | exe "let ret= NFH_".exten.'("'.a:fname.'")' 62 | elseif a:exten != "" && exists("*s:NFH_".exten) 63 | " use builtin-NFH_*() functions 64 | " call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') 65 | exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")' 66 | endif 67 | 68 | " call Dret("netrwFileHandlers#Invoke 0 : ret=".ret) 69 | return 0 70 | endfun 71 | 72 | " --------------------------------------------------------------------- 73 | " s:NFH_html: handles html when the user hits "x" when the {{{1 74 | " cursor is atop a *.html file 75 | fun! s:NFH_html(pagefile) 76 | " call Dfunc("s:NFH_html(".a:pagefile.")") 77 | 78 | let page= substitute(a:pagefile,'^','file://','') 79 | 80 | if executable("mozilla") 81 | " call Decho("executing !mozilla ".page) 82 | exe "!mozilla ".shellescape(page,1) 83 | elseif executable("netscape") 84 | " call Decho("executing !netscape ".page) 85 | exe "!netscape ".shellescape(page,1) 86 | else 87 | " call Dret("s:NFH_html 0") 88 | return 0 89 | endif 90 | 91 | " call Dret("s:NFH_html 1") 92 | return 1 93 | endfun 94 | 95 | " --------------------------------------------------------------------- 96 | " s:NFH_htm: handles html when the user hits "x" when the {{{1 97 | " cursor is atop a *.htm file 98 | fun! s:NFH_htm(pagefile) 99 | " call Dfunc("s:NFH_htm(".a:pagefile.")") 100 | 101 | let page= substitute(a:pagefile,'^','file://','') 102 | 103 | if executable("mozilla") 104 | " call Decho("executing !mozilla ".page) 105 | exe "!mozilla ".shellescape(page,1) 106 | elseif executable("netscape") 107 | " call Decho("executing !netscape ".page) 108 | exe "!netscape ".shellescape(page,1) 109 | else 110 | " call Dret("s:NFH_htm 0") 111 | return 0 112 | endif 113 | 114 | " call Dret("s:NFH_htm 1") 115 | return 1 116 | endfun 117 | 118 | " --------------------------------------------------------------------- 119 | " s:NFH_jpg: {{{1 120 | fun! s:NFH_jpg(jpgfile) 121 | " call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)") 122 | 123 | if executable("gimp") 124 | exe "silent! !gimp -s ".shellescape(a:jpgfile,1) 125 | elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") 126 | " call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'")) 127 | exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1) 128 | else 129 | " call Dret("s:NFH_jpg 0") 130 | return 0 131 | endif 132 | 133 | " call Dret("s:NFH_jpg 1") 134 | return 1 135 | endfun 136 | 137 | " --------------------------------------------------------------------- 138 | " s:NFH_gif: {{{1 139 | fun! s:NFH_gif(giffile) 140 | " call Dfunc("s:NFH_gif(giffile<".a:giffile.">)") 141 | 142 | if executable("gimp") 143 | exe "silent! !gimp -s ".shellescape(a:giffile,1) 144 | elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") 145 | exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1) 146 | else 147 | " call Dret("s:NFH_gif 0") 148 | return 0 149 | endif 150 | 151 | " call Dret("s:NFH_gif 1") 152 | return 1 153 | endfun 154 | 155 | " --------------------------------------------------------------------- 156 | " s:NFH_png: {{{1 157 | fun! s:NFH_png(pngfile) 158 | " call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)") 159 | 160 | if executable("gimp") 161 | exe "silent! !gimp -s ".shellescape(a:pngfile,1) 162 | elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") 163 | exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1) 164 | else 165 | " call Dret("s:NFH_png 0") 166 | return 0 167 | endif 168 | 169 | " call Dret("s:NFH_png 1") 170 | return 1 171 | endfun 172 | 173 | " --------------------------------------------------------------------- 174 | " s:NFH_pnm: {{{1 175 | fun! s:NFH_pnm(pnmfile) 176 | " call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)") 177 | 178 | if executable("gimp") 179 | exe "silent! !gimp -s ".shellescape(a:pnmfile,1) 180 | elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") 181 | exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1) 182 | else 183 | " call Dret("s:NFH_pnm 0") 184 | return 0 185 | endif 186 | 187 | " call Dret("s:NFH_pnm 1") 188 | return 1 189 | endfun 190 | 191 | " --------------------------------------------------------------------- 192 | " s:NFH_bmp: visualize bmp files {{{1 193 | fun! s:NFH_bmp(bmpfile) 194 | " call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)") 195 | 196 | if executable("gimp") 197 | exe "silent! !gimp -s ".a:bmpfile 198 | elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") 199 | exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1) 200 | else 201 | " call Dret("s:NFH_bmp 0") 202 | return 0 203 | endif 204 | 205 | " call Dret("s:NFH_bmp 1") 206 | return 1 207 | endfun 208 | 209 | " --------------------------------------------------------------------- 210 | " s:NFH_pdf: visualize pdf files {{{1 211 | fun! s:NFH_pdf(pdf) 212 | " call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)") 213 | if executable("gs") 214 | exe 'silent! !gs '.shellescape(a:pdf,1) 215 | elseif executable("pdftotext") 216 | exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1) 217 | else 218 | " call Dret("s:NFH_pdf 0") 219 | return 0 220 | endif 221 | 222 | " call Dret("s:NFH_pdf 1") 223 | return 1 224 | endfun 225 | 226 | " --------------------------------------------------------------------- 227 | " s:NFH_doc: visualize doc files {{{1 228 | fun! s:NFH_doc(doc) 229 | " call Dfunc("s:NFH_doc(doc<".a:doc.">)") 230 | 231 | if executable("oowriter") 232 | exe 'silent! !oowriter '.shellescape(a:doc,1) 233 | redraw! 234 | else 235 | " call Dret("s:NFH_doc 0") 236 | return 0 237 | endif 238 | 239 | " call Dret("s:NFH_doc 1") 240 | return 1 241 | endfun 242 | 243 | " --------------------------------------------------------------------- 244 | " s:NFH_sxw: visualize sxw files {{{1 245 | fun! s:NFH_sxw(sxw) 246 | " call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)") 247 | 248 | if executable("oowriter") 249 | exe 'silent! !oowriter '.shellescape(a:sxw,1) 250 | redraw! 251 | else 252 | " call Dret("s:NFH_sxw 0") 253 | return 0 254 | endif 255 | 256 | " call Dret("s:NFH_sxw 1") 257 | return 1 258 | endfun 259 | 260 | " --------------------------------------------------------------------- 261 | " s:NFH_xls: visualize xls files {{{1 262 | fun! s:NFH_xls(xls) 263 | " call Dfunc("s:NFH_xls(xls<".a:xls.">)") 264 | 265 | if executable("oocalc") 266 | exe 'silent! !oocalc '.shellescape(a:xls,1) 267 | redraw! 268 | else 269 | " call Dret("s:NFH_xls 0") 270 | return 0 271 | endif 272 | 273 | " call Dret("s:NFH_xls 1") 274 | return 1 275 | endfun 276 | 277 | " --------------------------------------------------------------------- 278 | " s:NFH_ps: handles PostScript files {{{1 279 | fun! s:NFH_ps(ps) 280 | " call Dfunc("s:NFH_ps(ps<".a:ps.">)") 281 | if executable("gs") 282 | " call Decho("exe silent! !gs ".a:ps) 283 | exe "silent! !gs ".shellescape(a:ps,1) 284 | redraw! 285 | elseif executable("ghostscript") 286 | " call Decho("exe silent! !ghostscript ".a:ps) 287 | exe "silent! !ghostscript ".shellescape(a:ps,1) 288 | redraw! 289 | elseif executable("gswin32") 290 | " call Decho("exe silent! !gswin32 ".shellescape(a:ps,1)) 291 | exe "silent! !gswin32 ".shellescape(a:ps,1) 292 | redraw! 293 | else 294 | " call Dret("s:NFH_ps 0") 295 | return 0 296 | endif 297 | 298 | " call Dret("s:NFH_ps 1") 299 | return 1 300 | endfun 301 | 302 | " --------------------------------------------------------------------- 303 | " s:NFH_eps: handles encapsulated PostScript files {{{1 304 | fun! s:NFH_eps(eps) 305 | " call Dfunc("s:NFH_eps()") 306 | if executable("gs") 307 | exe "silent! !gs ".shellescape(a:eps,1) 308 | redraw! 309 | elseif executable("ghostscript") 310 | exe "silent! !ghostscript ".shellescape(a:eps,1) 311 | redraw! 312 | elseif executable("ghostscript") 313 | exe "silent! !ghostscript ".shellescape(a:eps,1) 314 | redraw! 315 | elseif executable("gswin32") 316 | exe "silent! !gswin32 ".shellescape(a:eps,1) 317 | redraw! 318 | else 319 | " call Dret("s:NFH_eps 0") 320 | return 0 321 | endif 322 | " call Dret("s:NFH_eps 0") 323 | return 1 324 | endfun 325 | 326 | " --------------------------------------------------------------------- 327 | " s:NFH_fig: handles xfig files {{{1 328 | fun! s:NFH_fig(fig) 329 | " call Dfunc("s:NFH_fig()") 330 | if executable("xfig") 331 | exe "silent! !xfig ".a:fig 332 | redraw! 333 | else 334 | " call Dret("s:NFH_fig 0") 335 | return 0 336 | endif 337 | 338 | " call Dret("s:NFH_fig 1") 339 | return 1 340 | endfun 341 | 342 | " --------------------------------------------------------------------- 343 | " s:NFH_obj: handles tgif's obj files {{{1 344 | fun! s:NFH_obj(obj) 345 | " call Dfunc("s:NFH_obj()") 346 | if has("unix") && executable("tgif") 347 | exe "silent! !tgif ".a:obj 348 | redraw! 349 | else 350 | " call Dret("s:NFH_obj 0") 351 | return 0 352 | endif 353 | 354 | " call Dret("s:NFH_obj 1") 355 | return 1 356 | endfun 357 | 358 | let &cpo= s:keepcpo 359 | unlet s:keepcpo 360 | " --------------------------------------------------------------------- 361 | " Modelines: {{{1 362 | " vim: fdm=marker 363 | -------------------------------------------------------------------------------- /autoload/netrwSettings.vim: -------------------------------------------------------------------------------- 1 | " netrwSettings.vim: makes netrw settings simpler 2 | " Date: Aug 27, 2013 3 | " Maintainer: Charles E Campbell 4 | " Version: 14 5 | " Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1 6 | " Permission is hereby granted to use and distribute this code, 7 | " with or without modifications, provided that this copyright 8 | " notice is copied with it. Like anything else that's free, 9 | " netrwSettings.vim is provided *as is* and comes with no 10 | " warranty of any kind, either expressed or implied. By using 11 | " this plugin, you agree that in no event will the copyright 12 | " holder be liable for any damages resulting from the use 13 | " of this software. 14 | " 15 | " Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1 16 | " synagogues, preaching the gospel of the kingdom, and healing 17 | " every disease and every sickness among the people. 18 | " Load Once: {{{1 19 | if exists("g:loaded_netrwSettings") || &cp 20 | finish 21 | endif 22 | let g:loaded_netrwSettings = "v14" 23 | if v:version < 700 24 | echohl WarningMsg 25 | echo "***warning*** this version of netrwSettings needs vim 7.0" 26 | echohl Normal 27 | finish 28 | endif 29 | 30 | " --------------------------------------------------------------------- 31 | " NetrwSettings: {{{1 32 | fun! netrwSettings#NetrwSettings() 33 | " this call is here largely just to insure that netrw has been loaded 34 | call netrw#NetrwSavePosn() 35 | if !exists("g:loaded_netrw") 36 | echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None 37 | return 38 | endif 39 | 40 | above wincmd s 41 | enew 42 | setlocal noswapfile bh=wipe 43 | set ft=vim 44 | file Netrw\ Settings 45 | 46 | " these variables have the following default effects when they don't 47 | " exist (ie. have not been set by the user in his/her .vimrc) 48 | if !exists("g:netrw_liststyle") 49 | let g:netrw_liststyle= 0 50 | let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa" 51 | endif 52 | if !exists("g:netrw_silent") 53 | let g:netrw_silent= 0 54 | endif 55 | if !exists("g:netrw_use_nt_rcp") 56 | let g:netrw_use_nt_rcp= 0 57 | endif 58 | if !exists("g:netrw_ftp") 59 | let g:netrw_ftp= 0 60 | endif 61 | if !exists("g:netrw_ignorenetrc") 62 | let g:netrw_ignorenetrc= 0 63 | endif 64 | 65 | put ='+ ---------------------------------------------' 66 | put ='+ NetrwSettings: by Charles E. Campbell' 67 | put ='+ Press with cursor atop any line for help' 68 | put ='+ ---------------------------------------------' 69 | let s:netrw_settings_stop= line(".") 70 | 71 | put ='' 72 | put ='+ Netrw Protocol Commands' 73 | put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd 74 | put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd 75 | put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd 76 | put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd 77 | put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd 78 | put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd 79 | put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd 80 | put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd 81 | put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd 82 | let s:netrw_protocol_stop= line(".") 83 | put = '' 84 | 85 | put ='+Netrw Transfer Control' 86 | put = 'let g:netrw_cygwin = '.g:netrw_cygwin 87 | put = 'let g:netrw_ftp = '.g:netrw_ftp 88 | put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode 89 | put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc 90 | put = 'let g:netrw_sshport = '.g:netrw_sshport 91 | put = 'let g:netrw_silent = '.g:netrw_silent 92 | put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp 93 | put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp 94 | let s:netrw_xfer_stop= line(".") 95 | put ='' 96 | put ='+ Netrw Messages' 97 | put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow 98 | 99 | put = '' 100 | put ='+ Netrw Browser Control' 101 | if exists("g:netrw_altfile") 102 | put = 'let g:netrw_altfile = '.g:netrw_altfile 103 | else 104 | put = 'let g:netrw_altfile = 0' 105 | endif 106 | put = 'let g:netrw_alto = '.g:netrw_alto 107 | put = 'let g:netrw_altv = '.g:netrw_altv 108 | put = 'let g:netrw_banner = '.g:netrw_banner 109 | if exists("g:netrw_bannerbackslash") 110 | put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash 111 | else 112 | put = '\" let g:netrw_bannerbackslash = (not defined)' 113 | endif 114 | put = 'let g:netrw_browse_split = '.g:netrw_browse_split 115 | if exists("g:netrw_browsex_viewer") 116 | put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer 117 | else 118 | put = '\" let g:netrw_browsex_viewer = (not defined)' 119 | endif 120 | put = 'let g:netrw_compress = '.g:netrw_compress 121 | if exists("g:Netrw_corehandler") 122 | put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler 123 | else 124 | put = '\" let g:Netrw_corehandler = (not defined)' 125 | endif 126 | put = 'let g:netrw_ctags = '.g:netrw_ctags 127 | put = 'let g:netrw_cursor = '.g:netrw_cursor 128 | let decompressline= line("$") 129 | put = 'let g:netrw_decompress = '.string(g:netrw_decompress) 130 | if exists("g:netrw_dynamic_maxfilenamelen") 131 | put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen 132 | else 133 | put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)' 134 | endif 135 | put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax 136 | put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl 137 | put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse 138 | let fnameescline= line("$") 139 | put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape) 140 | put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject 141 | put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd 142 | put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd 143 | put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd 144 | let globescline= line("$") 145 | put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape) 146 | put = 'let g:netrw_hide = '.g:netrw_hide 147 | if exists("g:netrw_home") 148 | put = 'let g:netrw_home = '.g:netrw_home 149 | else 150 | put = '\" let g:netrw_home = (not defined)' 151 | endif 152 | put = 'let g:netrw_keepdir = '.g:netrw_keepdir 153 | put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd 154 | put = 'let g:netrw_list_hide = '.g:netrw_list_hide 155 | put = 'let g:netrw_liststyle = '.g:netrw_liststyle 156 | put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd 157 | put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir 158 | put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd 159 | put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir 160 | put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen 161 | put = 'let g:netrw_menu = '.g:netrw_menu 162 | put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps 163 | put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd 164 | if exists("g:netrw_nobeval") 165 | put = 'let g:netrw_nobeval = '.g:netrw_nobeval 166 | else 167 | put = '\" let g:netrw_nobeval = (not defined)' 168 | endif 169 | put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir 170 | put = 'let g:netrw_preview = '.g:netrw_preview 171 | put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd 172 | put = 'let g:netrw_retmap = '.g:netrw_retmap 173 | put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd 174 | put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd 175 | put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd 176 | put = 'let g:netrw_sort_by = '.g:netrw_sort_by 177 | put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction 178 | put = 'let g:netrw_sort_options = '.g:netrw_sort_options 179 | put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence 180 | put = 'let g:netrw_servername = '.g:netrw_servername 181 | put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax 182 | put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject 183 | put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd 184 | put = 'let g:netrw_scpport = '.g:netrw_scpport 185 | put = 'let g:netrw_sepchr = '.g:netrw_sepchr 186 | put = 'let g:netrw_sshport = '.g:netrw_sshport 187 | put = 'let g:netrw_timefmt = '.g:netrw_timefmt 188 | let tmpfileescline= line("$") 189 | put ='let g:netrw_tmpfile_escape...' 190 | put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf 191 | put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen 192 | put = 'let g:netrw_winsize = '.g:netrw_winsize 193 | 194 | put ='' 195 | put ='+ For help, place cursor on line and press ' 196 | 197 | 1d 198 | silent %s/^+/"/e 199 | res 99 200 | silent %s/= \([^0-9].*\)$/= '\1'/e 201 | silent %s/= $/= ''/e 202 | 1 203 | 204 | call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1','')) 205 | call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'") 206 | call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'") 207 | call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'") 208 | 209 | set nomod 210 | 211 | nmap :call NetrwSettingHelp() 212 | nnoremap :call NetrwSettingHelp() 213 | let tmpfile= tempname() 214 | exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod' 215 | endfun 216 | 217 | " --------------------------------------------------------------------- 218 | " NetrwSettingHelp: {{{2 219 | fun! NetrwSettingHelp() 220 | " call Dfunc("NetrwSettingHelp()") 221 | let curline = getline(".") 222 | if curline =~ '=' 223 | let varhelp = substitute(curline,'^\s*let ','','e') 224 | let varhelp = substitute(varhelp,'\s*=.*$','','e') 225 | " call Decho("trying help ".varhelp) 226 | try 227 | exe "he ".varhelp 228 | catch /^Vim\%((\a\+)\)\=:E149/ 229 | echo "***sorry*** no help available for <".varhelp.">" 230 | endtry 231 | elseif line(".") < s:netrw_settings_stop 232 | he netrw-settings 233 | elseif line(".") < s:netrw_protocol_stop 234 | he netrw-externapp 235 | elseif line(".") < s:netrw_xfer_stop 236 | he netrw-variables 237 | else 238 | he netrw-browse-var 239 | endif 240 | " call Dret("NetrwSettingHelp") 241 | endfun 242 | 243 | " --------------------------------------------------------------------- 244 | " Modelines: {{{1 245 | " vim:ts=8 fdm=marker 246 | -------------------------------------------------------------------------------- /autoload/netrw_gitignore.vim: -------------------------------------------------------------------------------- 1 | " netrw_gitignore#Hide: gitignore-based hiding 2 | " Function returns a string of comma separated patterns convenient for 3 | " assignment to `g:netrw_list_hide` option. 4 | " Function can take additional filenames as arguments, example: 5 | " netrw_gitignore#Hide('custom_gitignore1', 'custom_gitignore2') 6 | " 7 | " Usage examples: 8 | " let g:netrw_list_hide = netrw_gitignore#Hide() 9 | " let g:netrw_list_hide = netrw_gitignore#Hide() . 'more,hide,patterns' 10 | " 11 | " Copyright: Copyright (C) 2013 Bruno Sutic {{{1 12 | " Permission is hereby granted to use and distribute this code, 13 | " with or without modifications, provided that this copyright 14 | " notice is copied with it. Like anything else that's free, 15 | " netrw_gitignore.vim is provided *as is* and comes with no 16 | " warranty of any kind, either expressed or implied. By using 17 | " this plugin, you agree that in no event will the copyright 18 | " holder be liable for any damages resulting from the use 19 | " of this software. 20 | function! netrw_gitignore#Hide(...) 21 | let additional_files = a:000 22 | 23 | let default_files = ['.gitignore', '.git/info/exclude'] 24 | 25 | " get existing global/system gitignore files 26 | let global_gitignore = expand(substitute(system("git config --global core.excludesfile"), '\n', '', 'g')) 27 | if global_gitignore !=# '' 28 | let default_files = add(default_files, global_gitignore) 29 | endif 30 | let system_gitignore = expand(substitute(system("git config --system core.excludesfile"), '\n', '', 'g')) 31 | if system_gitignore !=# '' 32 | let default_files = add(default_files, system_gitignore) 33 | endif 34 | 35 | " append additional files if given as function arguments 36 | if additional_files !=# [] 37 | let files = extend(default_files, additional_files) 38 | else 39 | let files = default_files 40 | endif 41 | 42 | " keep only existing/readable files 43 | let gitignore_files = [] 44 | for file in files 45 | if filereadable(file) 46 | let gitignore_files = add(gitignore_files, file) 47 | endif 48 | endfor 49 | 50 | " get contents of gitignore patterns from those files 51 | let gitignore_lines = [] 52 | for file in gitignore_files 53 | for line in readfile(file) 54 | " filter empty lines and comments 55 | if line !~# '^#' && line !~# '^$' 56 | let gitignore_lines = add(gitignore_lines, line) 57 | endif 58 | endfor 59 | endfor 60 | 61 | " convert gitignore patterns to Netrw/Vim regex patterns 62 | let escaped_lines = [] 63 | for line in gitignore_lines 64 | let escaped = line 65 | let escaped = substitute(escaped, '\.', '\\.', 'g') 66 | let escaped = substitute(escaped, '*', '.*', 'g') 67 | let escaped_lines = add(escaped_lines, escaped) 68 | endfor 69 | 70 | return join(escaped_lines, ',') 71 | endfunction 72 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/.gitignore: -------------------------------------------------------------------------------- 1 | doc/tags 2 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/.travis.yml: -------------------------------------------------------------------------------- 1 | language: viml 2 | before_script: 3 | - vim --version 4 | - git clone https://github.com/syngan/vim-vimlint /tmp/vim-vimlint 5 | - git clone https://github.com/ynkdir/vim-vimlparser /tmp/vim-vimlparser 6 | - git clone https://github.com/thinca/vim-themis 7 | 8 | script: 9 | - sh /tmp/vim-vimlint/bin/vimlint.sh -l /tmp/vim-vimlint -p /tmp/vim-vimlparser -e EVL103=1 -e EVL102.l:_=1 autoload 10 | - make test 11 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/LICENSE-MIT.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2010 http://github.com/gmarik 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/Makefile: -------------------------------------------------------------------------------- 1 | test: vim-themis 2 | vim-themis/bin/themis --reporter spec test/commands.vim test/parse.vim test/recipe.vim test/sample.vim test/tsort.vim test/toml.vim 3 | vim-themis/bin/themis --reporter spec test/source.vim 4 | vim-themis/bin/themis --reporter spec test/lock.vim 5 | 6 | # Use existing vim-themis install from ~/.vim, or clone it. 7 | vim-themis: 8 | existing=$(firstword $(wildcard ~/.vim/*bundle*/*themis*/plugin/themis.vim)); \ 9 | if [ -n "$$existing" ]; then \ 10 | ( cd test && ln -s $$(dirname $$(dirname $$existing)) vim-themis ); \ 11 | else \ 12 | git clone https://github.com/thinca/vim-themis vim-themis; \ 13 | fi 14 | 15 | .PHONY: test 16 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/README.md: -------------------------------------------------------------------------------- 1 | [![Stories in Ready](https://badge.waffle.io/Shougo/neobundle.vim.png)](https://waffle.io/Shougo/neobundle.vim) 2 | 3 | ## About 4 | 5 | NeoBundle is a next generation Vim plugin manager. This plugin is based on 6 | [Vundle](https://github.com/gmarik/vundle), but I renamed and added tons of 7 | features, while Vundle tends to stay simple. 8 | 9 | Requirements: 10 | * Vim 7.2.051 or above. 11 | * "git" command in $PATH (if you want to install github or vim.org plugins) 12 | 13 | Recommends: 14 | * [vimproc](https://github.com/Shougo/vimproc.vim) if you want to 15 | install/update asynchronously in Unite interface. 16 | 17 | Note: In :NeoBundleUpdate/:NeoBundleInstall commands, you can parallel update by 18 | vimproc, but you cannot do other work unlike Unite interface. 19 | 20 | Note: Neobundle is not a stable plugin manager. If you want a stable plugin 21 | manager, you should use Vundle plugin. It well works widely and it is more 22 | tested. If you want to use extended features, you can use neobundle. 23 | 24 | Vundle features: Stable, simple, good for beginners 25 | 26 | Neobundle features: Early development (may break compatibility), very complex, 27 | good for plugin power users (for example, 50+ plugins and over 1000 lines 28 | .vimrc, ...) 29 | 30 | ## How it works 31 | 32 | Plugins are defined in NeoBundle by calling `NeoBundle ''`. NeoBundle assumes Github as the default location for plugins, so 34 | for most plugins you can simply use `NeoBundle 'username/plugin'` rather than 35 | using the absolute URL of the plugin. These calls should be made in your 36 | .vimrc file. Once you have defined these, you must call `NeoBundleInstall`, 37 | and NeoBundle will clone all of the repos into the desired folder (generally 38 | `~/.vim/bundle`) and load them into Vim. If you want to update these 39 | repositories, simply call `NeoBundleUpdate`. 40 | 41 | A few other useful commands: 42 | - `:NeoBundleList` - list configured bundles 43 | - `:NeoBundleInstall(!)` - install (update) bundles 44 | - `:NeoBundleClean(!)` - confirm (or auto-approve) removal of unused bundles 45 | 46 | Refer to `:help neobundle` for more examples and for a full list of commands. 47 | 48 | ## Quick start 49 | 50 | ### 1. Install NeoBundle 51 | 52 | #### If you are using Unix/Linux or Mac OS X. 53 | 54 | 1. Run below script. 55 | 56 | ``` 57 | $ curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh > install.sh 58 | $ sh ./install.sh 59 | ``` 60 | Complete. 61 | 62 | #### If you want to install manually or you are using Windows. 63 | 64 | 1. Setup NeoBundle: 65 | 66 | ``` 67 | $ mkdir -p ~/.vim/bundle 68 | $ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim 69 | ``` 70 | 71 | 2. Configure bundles: 72 | 73 | Sample `.vimrc`: 74 | 75 | ```vim 76 | " Note: Skip initialization for vim-tiny or vim-small. 77 | if 0 | endif 78 | 79 | if has('vim_starting') 80 | if &compatible 81 | set nocompatible " Be iMproved 82 | endif 83 | 84 | " Required: 85 | set runtimepath+=~/.vim/bundle/neobundle.vim/ 86 | endif 87 | 88 | " Required: 89 | call neobundle#begin(expand('~/.vim/bundle/')) 90 | 91 | " Let NeoBundle manage NeoBundle 92 | " Required: 93 | NeoBundleFetch 'Shougo/neobundle.vim' 94 | 95 | " My Bundles here: 96 | " Refer to |:NeoBundle-examples|. 97 | " Note: You don't set neobundle setting in .gvimrc! 98 | 99 | call neobundle#end() 100 | 101 | " Required: 102 | filetype plugin indent on 103 | 104 | " If there are uninstalled bundles found on startup, 105 | " this will conveniently prompt you to install them. 106 | NeoBundleCheck 107 | ``` 108 | 109 | ### 2. Install configured bundles 110 | 111 | Launch `vim`, run `:NeoBundleInstall` or `:Unite neobundle/install` (required 112 | unite.vim) Or Command run `bin/neoinstall` or `vim +NeoBundleInstall +qall` 113 | 114 | 115 | ## How to test 116 | 117 | Run `make test` command in command line(required vim-themis). 118 | 119 | https://github.com/thinca/vim-themis 120 | 121 | 122 | ## Advantages over Vundle 123 | 124 | 1. Plugin prefixed command name (:Bundle vs :NeoBundle). 125 | 2. Support for vimproc (asynchronous update/install). 126 | 3. Support for unite.vim interface (update/install/search). 127 | 4. Support for revision locking. 128 | 5. Support for multiple version control systems (Subversion/Git). 129 | 6. Support for lazy initialization for optimizing startup time. 130 | 7. and so on... 131 | 132 | ## Tips 133 | 134 | If you use a single .vimrc across systems where build programs are 135 | named differently (e.g. GNU Make is often `gmake` on non-GNU 136 | systems), the following pattern is useful: 137 | 138 | ```vim 139 | let g:make = 'gmake' 140 | if system('uname -o') =~ '^GNU/' 141 | let g:make = 'make' 142 | endif 143 | NeoBundle 'Shougo/vimproc.vim', {'build': {'unix': g:make}} 144 | ``` 145 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/TOML.vim: -------------------------------------------------------------------------------- 1 | let s:save_cpo = &cpo 2 | set cpo&vim 3 | 4 | " 5 | " public api 6 | " 7 | function! neobundle#TOML#parse(text) 8 | let input = { 9 | \ 'text': a:text, 10 | \ 'p': 0, 11 | \ 'length': strlen(a:text), 12 | \} 13 | return s:_parse(input) 14 | endfunction 15 | 16 | function! neobundle#TOML#parse_file(filename) 17 | if !filereadable(a:filename) 18 | throw printf("vital: Text.TOML: No such file `%s'.", a:filename) 19 | endif 20 | 21 | let text = join(readfile(a:filename), "\n") 22 | " fileencoding is always utf8 23 | return neobundle#TOML#parse(iconv(text, 'utf8', &encoding)) 24 | endfunction 25 | 26 | " 27 | " private api 28 | " 29 | " work around: '[^\r\n]*' doesn't work well in old-vim, but "[^\r\n]*" works well 30 | let s:skip_pattern = '\C^\%(\_s\+\|' . "#[^\r\n]*" . '\)' 31 | let s:table_name_pattern = '\%([^ [:tab:]#.[\]=]\+\)' 32 | let s:table_key_pattern = s:table_name_pattern 33 | 34 | function! s:_skip(input) 35 | while s:_match(a:input, '\%(\_s\|#\)') 36 | let a:input.p = matchend(a:input.text, s:skip_pattern, a:input.p) 37 | endwhile 38 | endfunction 39 | 40 | function! s:_consume(input, pattern) 41 | call s:_skip(a:input) 42 | let end = matchend(a:input.text, '\C^' . a:pattern, a:input.p) 43 | 44 | if end == -1 45 | call s:_error(a:input) 46 | elseif end == a:input.p 47 | return '' 48 | endif 49 | 50 | let matched = strpart(a:input.text, a:input.p, end - a:input.p) 51 | let a:input.p = end 52 | return matched 53 | endfunction 54 | 55 | function! s:_match(input, pattern) 56 | return match(a:input.text, '\C^' . a:pattern, a:input.p) != -1 57 | endfunction 58 | 59 | function! s:_eof(input) 60 | return a:input.p >= a:input.length 61 | endfunction 62 | 63 | function! s:_error(input) 64 | let buf = [] 65 | let offset = 0 66 | while (a:input.p + offset) < a:input.length && a:input.text[a:input.p + offset] !~# "[\r\n]" 67 | let buf += [a:input.text[a:input.p + offset]] 68 | let offset += 1 69 | endwhile 70 | 71 | throw printf("vital: Text.TOML: Illegal toml format at `%s'.", join(buf, '')) 72 | endfunction 73 | 74 | function! s:_parse(input) 75 | let data = {} 76 | 77 | call s:_skip(a:input) 78 | while !s:_eof(a:input) 79 | if s:_match(a:input, '[^ [:tab:]#.[\]]') 80 | let key = s:_key(a:input) 81 | call s:_equals(a:input) 82 | let value = s:_value(a:input) 83 | 84 | call s:_put_dict(data, key, value) 85 | 86 | unlet value 87 | elseif s:_match(a:input, '\[\[') 88 | let [key, value] = s:_array_of_tables(a:input) 89 | 90 | call s:_put_array(data, key, value) 91 | 92 | unlet value 93 | elseif s:_match(a:input, '\[') 94 | let [key, value] = s:_table(a:input) 95 | 96 | call s:_put_dict(data, key, value) 97 | 98 | unlet value 99 | else 100 | call s:_error(a:input) 101 | endif 102 | call s:_skip(a:input) 103 | endwhile 104 | 105 | return data 106 | endfunction 107 | 108 | function! s:_key(input) 109 | let s = s:_consume(a:input, s:table_key_pattern) 110 | return s 111 | endfunction 112 | 113 | function! s:_equals(input) 114 | call s:_consume(a:input, '=') 115 | return '=' 116 | endfunction 117 | 118 | function! s:_value(input) 119 | call s:_skip(a:input) 120 | 121 | if s:_match(a:input, '"\{3}') 122 | return s:_multiline_basic_string(a:input) 123 | elseif s:_match(a:input, '"\{1}') 124 | return s:_basic_string(a:input) 125 | elseif s:_match(a:input, "'\\{3}") 126 | return s:_multiline_literal(a:input) 127 | elseif s:_match(a:input, "'\\{1}") 128 | return s:_literal(a:input) 129 | elseif s:_match(a:input, '\[') 130 | return s:_array(a:input) 131 | elseif s:_match(a:input, '\%(true\|false\)') 132 | return s:_boolean(a:input) 133 | elseif s:_match(a:input, '\d\{4}-') 134 | return s:_datetime(a:input) 135 | elseif s:_match(a:input, '[+-]\?\%(\d\+\.\d\|\d\+\%(\.\d\+\)\?[eE]\)') 136 | return s:_float(a:input) 137 | else 138 | return s:_integer(a:input) 139 | endif 140 | endfunction 141 | 142 | " 143 | " String 144 | " 145 | function! s:_basic_string(input) 146 | let s = s:_consume(a:input, '"\%(\\"\|[^"]\)*"') 147 | let s = s[1 : -2] 148 | return s:_unescape(s) 149 | endfunction 150 | 151 | function! s:_multiline_basic_string(input) 152 | let s = s:_consume(a:input, '"\{3}\_.\{-}"\{3}') 153 | let s = s[3 : -4] 154 | let s = substitute(s, "^\n", '', '') 155 | let s = substitute(s, '\\' . "\n" . '\_s*', '', 'g') 156 | return s:_unescape(s) 157 | endfunction 158 | 159 | function! s:_literal(input) 160 | let s = s:_consume(a:input, "'[^']*'") 161 | return s[1 : -2] 162 | endfunction 163 | 164 | function! s:_multiline_literal(input) 165 | let s = s:_consume(a:input, "'\\{3}.\\{-}'\\{3}") 166 | let s = s[3 : -4] 167 | let s = substitute(s, "^\n", '', '') 168 | return s 169 | endfunction 170 | 171 | " 172 | " Integer 173 | " 174 | function! s:_integer(input) 175 | let s = s:_consume(a:input, '[+-]\?\d\+') 176 | return str2nr(s) 177 | endfunction 178 | 179 | " 180 | " Float 181 | " 182 | function! s:_float(input) 183 | if s:_match(a:input, '[+-]\?[0-9.]\+[eE][+-]\?\d\+') 184 | return s:_exponent(a:input) 185 | else 186 | return s:_fractional(a:input) 187 | endif 188 | endfunction 189 | 190 | function! s:_fractional(input) 191 | let s = s:_consume(a:input, '[+-]\?[0-9.]\+') 192 | return str2float(s) 193 | endfunction 194 | 195 | function! s:_exponent(input) 196 | let s = s:_consume(a:input, '[+-]\?[0-9.]\+[eE][+-]\?\d\+') 197 | return str2float(s) 198 | endfunction 199 | 200 | " 201 | " Boolean 202 | " 203 | function! s:_boolean(input) 204 | let s = s:_consume(a:input, '\%(true\|false\)') 205 | return (s ==# 'true') ? 1 : 0 206 | endfunction 207 | 208 | " 209 | " Datetime 210 | " 211 | function! s:_datetime(input) 212 | let s = s:_consume(a:input, '\d\{4}-\d\{2}-\d\{2}T\d\{2}:\d\{2}:\d\{2}\%(Z\|-\?\d\{2}:\d\{2}\|\.\d\+-\d\{2}:\d\{2}\)') 213 | return s 214 | endfunction 215 | 216 | " 217 | " Array 218 | " 219 | function! s:_array(input) 220 | let ary = [] 221 | let _ = s:_consume(a:input, '\[') 222 | call s:_skip(a:input) 223 | while !s:_eof(a:input) && !s:_match(a:input, '\]') 224 | let ary += [s:_value(a:input)] 225 | call s:_consume(a:input, ',\?') 226 | call s:_skip(a:input) 227 | endwhile 228 | let _ = s:_consume(a:input, '\]') 229 | return ary 230 | endfunction 231 | 232 | " 233 | " Table 234 | " 235 | function! s:_table(input) 236 | let tbl = {} 237 | let name = s:_consume(a:input, '\[\s*' . s:table_name_pattern . '\%(\s*\.\s*' . s:table_name_pattern . '\)*\s*\]') 238 | let name = name[1 : -2] 239 | call s:_skip(a:input) 240 | " while !s:_eof(a:input) && !s:_match(a:input, '\[\{1,2}[a-zA-Z0-9.]\+\]\{1,2}') 241 | while !s:_eof(a:input) && !s:_match(a:input, '\[') 242 | let key = s:_key(a:input) 243 | call s:_equals(a:input) 244 | let value = s:_value(a:input) 245 | 246 | let tbl[key] = value 247 | 248 | unlet value 249 | call s:_skip(a:input) 250 | endwhile 251 | return [name, tbl] 252 | endfunction 253 | 254 | " 255 | " Array of tables 256 | " 257 | function! s:_array_of_tables(input) 258 | let tbl = {} 259 | let name = s:_consume(a:input, '\[\[\s*' . s:table_name_pattern . '\%(\s*\.\s*' . s:table_name_pattern . '\)*\s*\]\]') 260 | let name = name[2 : -3] 261 | call s:_skip(a:input) 262 | " while !s:_eof(a:input) && !s:_match(a:input, '\[\{1,2}[a-zA-Z0-9.]\+\]\{1,2}') 263 | while !s:_eof(a:input) && !s:_match(a:input, '\[') 264 | let key = s:_key(a:input) 265 | call s:_equals(a:input) 266 | let value = s:_value(a:input) 267 | 268 | let tbl[key] = value 269 | 270 | unlet value 271 | call s:_skip(a:input) 272 | endwhile 273 | return [name, [tbl]] 274 | endfunction 275 | 276 | function! s:_unescape(text) 277 | let text = a:text 278 | let text = substitute(text, '\\"', '"', 'g') 279 | let text = substitute(text, '\\b', "\b", 'g') 280 | let text = substitute(text, '\\t', "\t", 'g') 281 | let text = substitute(text, '\\n', "\n", 'g') 282 | let text = substitute(text, '\\f', "\f", 'g') 283 | let text = substitute(text, '\\r', "\r", 'g') 284 | let text = substitute(text, '\\/', "/", 'g') 285 | let text = substitute(text, '\\\\', '\', 'g') 286 | let text = substitute(text, '\C\\u\(\x\{4}\)', '\=s:_nr2char("0x" . submatch(1))', 'g') 287 | let text = substitute(text, '\C\\U\(\x\{8}\)', '\=s:_nr2char("0x" . submatch(1))', 'g') 288 | return text 289 | endfunction 290 | 291 | function! s:_nr2char(nr) 292 | return iconv(nr2char(a:nr), &encoding, 'utf8') 293 | endfunction 294 | 295 | function! s:_put_dict(dict, key, value) 296 | let keys = split(a:key, '\.') 297 | 298 | let ref = a:dict 299 | for key in keys[ : -2] 300 | if has_key(ref, key) && type(ref[key]) == type({}) 301 | let ref = ref[key] 302 | elseif has_key(ref, key) && type(ref[key]) == type([]) 303 | let ref = ref[key][-1] 304 | else 305 | let ref[key] = {} 306 | let ref = ref[key] 307 | endif 308 | endfor 309 | 310 | let ref[keys[-1]] = a:value 311 | endfunction 312 | 313 | function! s:_put_array(dict, key, value) 314 | let keys = split(a:key, '\.') 315 | 316 | let ref = a:dict 317 | for key in keys[ : -2] 318 | let ref[key] = get(ref, key, {}) 319 | 320 | if type(ref[key]) == type([]) 321 | let ref = ref[key][-1] 322 | else 323 | let ref = ref[key] 324 | endif 325 | endfor 326 | 327 | let ref[keys[-1]] = get(ref, keys[-1], []) + a:value 328 | endfunction 329 | 330 | let &cpo = s:save_cpo 331 | unlet s:save_cpo 332 | " vim:set et ts=2 sts=2 sw=2 tw=0: 333 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/autoload.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: autoload.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! neobundle#autoload#init() 30 | let s:active_auto_source = 0 31 | 32 | augroup neobundle 33 | autocmd FileType * 34 | \ call neobundle#autoload#filetype() 35 | autocmd FuncUndefined * 36 | \ call neobundle#autoload#function() 37 | autocmd BufNewFile,BufRead * 38 | \ call neobundle#autoload#filename(expand('')) 39 | autocmd InsertEnter * 40 | \ call neobundle#autoload#insert() 41 | augroup END 42 | 43 | if has('patch-7.4.414') 44 | autocmd neobundle CmdUndefined * 45 | \ call neobundle#autoload#command_prefix() 46 | endif 47 | 48 | augroup neobundle-explorer 49 | autocmd! 50 | augroup END 51 | for event in ['BufRead', 'BufCreate', 'BufEnter', 'BufWinEnter', 'BufNew', 'VimEnter'] 52 | execute 'autocmd neobundle-explorer' event "* call neobundle#autoload#explorer( 53 | \ expand(''), ".string(event) . ")" 54 | endfor 55 | 56 | augroup neobundle-focus 57 | autocmd! 58 | autocmd CursorHold * if s:active_auto_source 59 | \ | call s:source_focus() 60 | \ | endif 61 | autocmd FocusLost * let s:active_auto_source = 1 62 | autocmd FocusGained * let s:active_auto_source = 0 63 | augroup END 64 | 65 | call neobundle#autoload#filename(bufname('%')) 66 | endfunction 67 | 68 | function! neobundle#autoload#filetype() 69 | let bundles = filter(neobundle#config#get_autoload_bundles(), 70 | \ "has_key(v:val.autoload, 'filetypes')") 71 | for filetype in add(neobundle#util#get_filetypes(), 'all') 72 | call neobundle#config#source_bundles(filter(copy(bundles)," 73 | \ index(v:val.autoload.filetypes, filetype) >= 0")) 74 | endfor 75 | endfunction 76 | 77 | function! neobundle#autoload#filename(filename) 78 | let bundles = filter(neobundle#config#get_autoload_bundles(), 79 | \ "has_key(v:val.autoload, 'filename_patterns')") 80 | if !empty(bundles) 81 | call neobundle#config#source_bundles(filter(copy(bundles)," 82 | \ len(filter(copy(v:val.autoload.filename_patterns), 83 | \ 'a:filename =~? v:val')) > 0")) 84 | endif 85 | endfunction 86 | 87 | function! neobundle#autoload#insert() 88 | let bundles = filter(neobundle#config#get_autoload_bundles(), 89 | \ "get(v:val.autoload, 'insert', 0)") 90 | if !empty(bundles) 91 | call neobundle#config#source_bundles(bundles) 92 | doautocmd InsertEnter 93 | endif 94 | endfunction 95 | 96 | function! neobundle#autoload#function() 97 | let function = expand('') 98 | let function_prefix = get(split(function, '#'), 0, '') . '#' 99 | 100 | let bundles = filter(neobundle#config#get_autoload_bundles(), 101 | \ "get(v:val.autoload, 'function_prefix', '').'#' ==# function_prefix || 102 | \ (has_key(v:val.autoload, 'functions') && 103 | \ index(v:val.autoload.functions, function) >= 0)") 104 | call neobundle#config#source_bundles(bundles) 105 | endfunction 106 | 107 | function! neobundle#autoload#command(command, name, args, bang, line1, line2) 108 | " Delete dummy commands. 109 | silent! execute 'delcommand' a:command 110 | 111 | call neobundle#config#source(a:name) 112 | 113 | let range = (a:line1 == a:line2) ? '' : 114 | \ (a:line1==line("'<") && a:line2==line("'>")) ? 115 | \ "'<,'>" : a:line1.",".a:line2 116 | 117 | try 118 | execute range.a:command.a:bang a:args 119 | catch /^Vim\%((\a\+)\)\=:E481/ 120 | " E481: No range allowed 121 | execute a:command.a:bang a:args 122 | endtry 123 | endfunction 124 | 125 | function! neobundle#autoload#command_prefix() 126 | let command = expand('') 127 | 128 | let bundles = filter(neobundle#config#get_autoload_bundles(), 129 | \ "get(v:val.autoload, 'command_prefix', '') != '' && 130 | \ stridx(tolower(command), 131 | \ tolower(get(v:val.autoload, 'command_prefix', ''))) == 0") 132 | call neobundle#config#source_bundles(bundles) 133 | endfunction 134 | 135 | function! neobundle#autoload#mapping(mapping, name, mode) 136 | let cnt = v:count > 0 ? v:count : '' 137 | 138 | let input = s:get_input() 139 | 140 | call neobundle#config#source(a:name) 141 | 142 | if a:mode ==# 'v' || a:mode ==# 'x' 143 | call feedkeys('gv', 'n') 144 | elseif a:mode ==# 'o' 145 | " TODO: omap 146 | " v:prevcount? 147 | " Cancel waiting operator mode. 148 | " call feedkeys("\\", 'n') 149 | call feedkeys("\", 'n') 150 | call feedkeys(v:operator, 'm') 151 | endif 152 | 153 | call feedkeys(cnt, 'n') 154 | 155 | let mapping = a:mapping 156 | while mapping =~ '<[[:alnum:]-]\+>' 157 | let mapping = substitute(mapping, '\c', 158 | \ get(g:, 'mapleader', '\'), 'g') 159 | let mapping = substitute(mapping, '\c', 160 | \ get(g:, 'maplocalleader', '\'), 'g') 161 | let ctrl = matchstr(mapping, '<\zs[[:alnum:]-]\+\ze>') 162 | execute 'let mapping = substitute( 163 | \ mapping, "<' . ctrl . '>", "\<' . ctrl . '>", "")' 164 | endwhile 165 | call feedkeys(mapping . input, 'm') 166 | 167 | return '' 168 | endfunction 169 | 170 | function! neobundle#autoload#explorer(path, event) 171 | if a:path == '' 172 | return 173 | endif 174 | 175 | let path = a:path 176 | " For ":edit ~". 177 | if fnamemodify(path, ':t') ==# '~' 178 | let path = '~' 179 | endif 180 | 181 | let path = neobundle#util#expand(path) 182 | if !(isdirectory(path) || (!filereadable(path) && path =~ '^\h\w\+://')) 183 | return 184 | endif 185 | 186 | let bundles = filter(neobundle#config#get_autoload_bundles(), 187 | \ "get(v:val.autoload, 'explorer', 0)") 188 | if empty(bundles) 189 | augroup neobundle-explorer 190 | autocmd! 191 | augroup END 192 | else 193 | call neobundle#config#source_bundles(bundles) 194 | execute 'doautocmd' a:event 195 | endif 196 | endfunction 197 | 198 | function! neobundle#autoload#unite_sources(sources) 199 | let bundles = [] 200 | let sources_bundles = filter(neobundle#config#get_autoload_bundles(), 201 | \ "has_key(v:val.autoload, 'unite_sources')") 202 | for source_name in a:sources 203 | if source_name ==# 'source' 204 | " In source source, load all sources. 205 | let bundles += copy(sources_bundles) 206 | else 207 | let bundles += filter(copy(sources_bundles), 208 | \ "!empty(filter(copy(v:val.autoload.unite_sources), 209 | \ 'stridx(source_name, v:val) >= 0'))") 210 | endif 211 | endfor 212 | 213 | call neobundle#config#source_bundles(neobundle#util#uniq(bundles)) 214 | endfunction 215 | 216 | function! neobundle#autoload#get_unite_sources() 217 | let _ = [] 218 | let sources_bundles = filter(neobundle#config#get_autoload_bundles(), 219 | \ "has_key(v:val.autoload, 'unite_sources')") 220 | for bundle in sources_bundles 221 | let _ += bundle.autoload.unite_sources 222 | endfor 223 | 224 | return _ 225 | endfunction 226 | 227 | function! s:source_focus() 228 | let bundles = neobundle#util#sort_by(filter( 229 | \ neobundle#config#get_autoload_bundles(), 230 | \ "v:val.focus > 0"), 'v:val.focus') 231 | if empty(bundles) 232 | augroup neobundle-focus 233 | autocmd! 234 | augroup END 235 | return 236 | endif 237 | 238 | call neobundle#config#source_bundles([bundles[0]]) 239 | call feedkeys("g\", 'n') 240 | endfunction 241 | 242 | function! neobundle#autoload#source(bundle_name) 243 | let bundles = filter(neobundle#config#get_neobundles(), 244 | \ "has_key(v:val.autoload, 'on_source') && 245 | \ index(v:val.autoload.on_source, a:bundle_name) >= 0 && 246 | \ !v:val.sourced && v:val.lazy") 247 | if !empty(bundles) 248 | call neobundle#config#source_bundles(bundles) 249 | endif 250 | endfunction 251 | 252 | function! s:get_input() 253 | let input = '' 254 | let termstr = "" 255 | 256 | call feedkeys(termstr, 'n') 257 | 258 | let type_num = type(0) 259 | while 1 260 | let char = getchar() 261 | let input .= type(char) == type_num ? nr2char(char) : char 262 | 263 | let idx = stridx(input, termstr) 264 | if idx >= 1 265 | let input = input[: idx - 1] 266 | break 267 | elseif idx == 0 268 | let input = '' 269 | break 270 | endif 271 | endwhile 272 | 273 | return input 274 | endfunction 275 | 276 | function! s:get_lazy_bundles() 277 | return filter(neobundle#config#get_neobundles(), 278 | \ "!neobundle#config#is_sourced(v:val.name) 279 | \ && v:val.rtp != '' && v:val.lazy") 280 | endfunction 281 | 282 | let &cpo = s:save_cpo 283 | unlet s:save_cpo 284 | 285 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/cache.vim: -------------------------------------------------------------------------------- 1 | " Utilities for output cache. 2 | 3 | let s:save_cpo = &cpo 4 | set cpo&vim 5 | 6 | function! neobundle#cache#getfilename(cache_dir, filename) 7 | return s:_encode_name(a:cache_dir, a:filename) 8 | endfunction 9 | 10 | function! neobundle#cache#filereadable(cache_dir, filename) 11 | let cache_name = s:_encode_name(a:cache_dir, a:filename) 12 | return filereadable(cache_name) 13 | endfunction 14 | 15 | function! neobundle#cache#readfile(cache_dir, filename) 16 | let cache_name = s:_encode_name(a:cache_dir, a:filename) 17 | return filereadable(cache_name) ? readfile(cache_name) : [] 18 | endfunction 19 | 20 | function! neobundle#cache#writefile(cache_dir, filename, list) 21 | let cache_name = s:_encode_name(a:cache_dir, a:filename) 22 | 23 | call writefile(a:list, cache_name) 24 | endfunction 25 | 26 | function! neobundle#cache#deletefile(cache_dir, filename) 27 | let cache_name = s:_encode_name(a:cache_dir, a:filename) 28 | return delete(cache_name) 29 | endfunction 30 | 31 | function! s:_encode_name(cache_dir, filename) 32 | " Check cache directory. 33 | if !isdirectory(a:cache_dir) 34 | call mkdir(a:cache_dir, 'p') 35 | endif 36 | let cache_dir = a:cache_dir 37 | if cache_dir !~ '/$' 38 | let cache_dir .= '/' 39 | endif 40 | 41 | return cache_dir . s:_create_hash(cache_dir, a:filename) 42 | endfunction 43 | 44 | function! neobundle#cache#check_old_cache(cache_dir, filename) 45 | " Check old cache file. 46 | let cache_name = s:_encode_name(a:cache_dir, a:filename) 47 | let ret = getftime(cache_name) == -1 48 | \ || getftime(cache_name) <= getftime(a:filename) 49 | if ret && filereadable(cache_name) 50 | " Delete old cache. 51 | call delete(cache_name) 52 | endif 53 | 54 | return ret 55 | endfunction 56 | 57 | function! s:_create_hash(dir, str) 58 | if len(a:dir) + len(a:str) < 150 59 | let hash = substitute(substitute( 60 | \ a:str, ':', '=-', 'g'), '[/\\]', '=+', 'g') 61 | elseif exists('*sha256') 62 | let hash = sha256(a:str) 63 | else 64 | " Use simple hash. 65 | let sum = 0 66 | for i in range(len(a:str)) 67 | let sum += char2nr(a:str[i]) * (i + 1) 68 | endfor 69 | 70 | let hash = printf('%x', sum) 71 | endif 72 | 73 | return hash 74 | endfunction 75 | 76 | let &cpo = s:save_cpo 77 | unlet s:save_cpo 78 | 79 | " vim:set et ts=2 sts=2 sw=2 tw=0: 80 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/init.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: init.vim 3 | " AUTHOR: Shougo Matsushita 4 | " Copyright (C) 2010 http://github.com/gmarik 5 | " License: MIT license {{{ 6 | " Permission is hereby granted, free of charge, to any person obtaining 7 | " a copy of this software and associated documentation files (the 8 | " "Software"), to deal in the Software without restriction, including 9 | " without limitation the rights to use, copy, modify, merge, publish, 10 | " distribute, sublicense, and/or sell copies of the Software, and to 11 | " permit persons to whom the Software is furnished to do so, subject to 12 | " the following conditions: 13 | " 14 | " The above copyright notice and this permission notice shall be included 15 | " in all copies or substantial portions of the Software. 16 | " 17 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | " }}} 25 | "============================================================================= 26 | 27 | let s:save_cpo = &cpo 28 | set cpo&vim 29 | 30 | function! neobundle#init#_rc(path) "{{{ 31 | let path = 32 | \ neobundle#util#substitute_path_separator( 33 | \ neobundle#util#expand(a:path)) 34 | if path =~ '/$' 35 | let path = path[: -2] 36 | endif 37 | call neobundle#set_neobundle_dir(path) 38 | 39 | " Join to the tail in runtimepath. 40 | let rtp = neobundle#get_rtp_dir() 41 | execute 'set rtp-='.fnameescape(rtp) 42 | let rtps = neobundle#util#split_rtp(&runtimepath) 43 | let n = index(rtps, $VIMRUNTIME) 44 | let &runtimepath = neobundle#util#join_rtp( 45 | \ insert(rtps, rtp, n-1), &runtimepath, rtp) 46 | 47 | augroup neobundle 48 | autocmd! 49 | augroup END 50 | 51 | call neobundle#config#init() 52 | call neobundle#autoload#init() 53 | endfunction"}}} 54 | 55 | function! neobundle#init#_bundle(bundle) "{{{ 56 | if !has_key(a:bundle, 'type') && get(a:bundle, 'local', 0) 57 | " Default type. 58 | let a:bundle.type = 'nosync' 59 | endif 60 | if !has_key(a:bundle, 'type') 61 | call neobundle#installer#error( 62 | \ printf('Failed parse name "%s" and args %s', 63 | \ a:bundle.orig_name, string(a:bundle.orig_opts))) 64 | return {} 65 | endif 66 | 67 | let bundle = { 68 | \ 'uri' : '', 69 | \ 'script_type' : '', 70 | \ 'rev' : '', 71 | \ 'rtp' : '', 72 | \ 'depends' : [], 73 | \ 'lazy' : 0, 74 | \ 'force' : 0, 75 | \ 'gui' : 0, 76 | \ 'terminal' : 0, 77 | \ 'overwrite' : 1, 78 | \ 'stay_same' : 0, 79 | \ 'autoload' : {}, 80 | \ 'hooks' : {}, 81 | \ 'called_hooks' : {}, 82 | \ 'external_commands' : {}, 83 | \ 'build_commands': {}, 84 | \ 'description' : '', 85 | \ 'dummy_commands' : [], 86 | \ 'dummy_mappings' : [], 87 | \ 'sourced' : 0, 88 | \ 'disabled' : 0, 89 | \ 'local' : 0, 90 | \ 'focus' : 0, 91 | \ 'verbose' : 0, 92 | \ 'orig_name' : '', 93 | \ 'vim_version' : '', 94 | \ 'orig_opts' : {}, 95 | \ 'recipe' : '', 96 | \ 'base' : neobundle#get_neobundle_dir(), 97 | \ 'install_rev' : '', 98 | \ 'install_process_timeout' 99 | \ : g:neobundle#install_process_timeout, 100 | \ } 101 | call extend(bundle, a:bundle) 102 | 103 | if !has_key(bundle, 'name') 104 | let bundle.name = neobundle#util#name_conversion(bundle.orig_name) 105 | endif 106 | 107 | if !has_key(bundle, 'normalized_name') 108 | let bundle.normalized_name = substitute( 109 | \ fnamemodify(bundle.name, ':r'), 110 | \ '\c^vim[_-]\|[_-]vim$', '', 'g') 111 | endif 112 | if !has_key(bundle.orig_opts, 'name') && 113 | \ g:neobundle#enable_name_conversion 114 | " Use normalized name. 115 | let bundle.name = bundle.normalized_name 116 | endif 117 | 118 | if !has_key(bundle, 'directory') 119 | let bundle.directory = bundle.name 120 | 121 | if bundle.rev != '' 122 | let bundle.directory .= '_' . substitute(bundle.rev, 123 | \ '[^[:alnum:]_-]', '_', 'g') 124 | endif 125 | endif 126 | 127 | if bundle.base[0] == '~' 128 | let bundle.base = neobundle#util#expand(bundle.base) 129 | endif 130 | if bundle.base[-1] == '/' || bundle.base[-1] == '\' 131 | " Chomp. 132 | let bundle.base = bundle.base[: -2] 133 | endif 134 | 135 | let bundle.path = isdirectory(bundle.uri) ? 136 | \ bundle.uri : bundle.base.'/'.bundle.directory 137 | 138 | " Check relative path. 139 | if bundle.rtp !~ '^\%([~/]\|\a\+:\)' 140 | let bundle.rtp = bundle.path.'/'.bundle.rtp 141 | endif 142 | if bundle.rtp[0] == '~' 143 | let bundle.rtp = neobundle#util#expand(bundle.rtp) 144 | endif 145 | if bundle.rtp[-1] == '/' || bundle.rtp[-1] == '\' 146 | " Chomp. 147 | let bundle.rtp = bundle.rtp[: -2] 148 | endif 149 | if bundle.normalized_name ==# 'neobundle' 150 | " Do not add runtimepath. 151 | let bundle.rtp = '' 152 | endif 153 | 154 | if bundle.script_type != '' 155 | " Add script_type. 156 | " Note: To check by neobundle#config#is_installed(). 157 | let bundle.path .= '/' . bundle.script_type 158 | endif 159 | 160 | if !has_key(bundle, 'resettable') 161 | let bundle.resettable = !bundle.lazy 162 | endif 163 | 164 | if !has_key(bundle, 'augroup') 165 | let bundle.augroup = bundle.name 166 | endif 167 | 168 | " Parse depends. 169 | if !empty(bundle.depends) 170 | call s:init_depends(bundle) 171 | endif 172 | 173 | if get(neobundle#config#get(bundle.name), 'sourced', 0) 174 | let bundle.sourced = 1 175 | endif 176 | 177 | if type(bundle.disabled) == type('') 178 | sandbox let bundle.disabled = eval(bundle.disabled) 179 | endif 180 | 181 | let bundle.disabled = bundle.disabled 182 | \ || (bundle.gui && !has('gui_running')) 183 | \ || (bundle.terminal && has('gui_running')) 184 | \ || (bundle.vim_version != '' 185 | \ && s:check_version(bundle.vim_version)) 186 | \ || (!empty(bundle.external_commands) 187 | \ && neobundle#config#check_commands(bundle.external_commands)) 188 | 189 | return bundle 190 | endfunction"}}} 191 | 192 | function! s:init_depends(bundle) "{{{ 193 | let bundle = a:bundle 194 | let _ = [] 195 | 196 | for depend in neobundle#util#convert2list(bundle.depends) 197 | if type(depend) == type('') 198 | let depend = string(depend) 199 | endif 200 | 201 | let depend_bundle = type(depend) == type({}) ? 202 | \ depend : neobundle#parser#bundle(depend, 1) 203 | let depend_bundle.lazy = bundle.lazy 204 | let depend_bundle.resettable = bundle.resettable 205 | let depend_bundle.overwrite = 0 206 | call add(_, depend_bundle) 207 | 208 | unlet depend 209 | endfor 210 | 211 | let bundle.depends = _ 212 | endfunction"}}} 213 | 214 | function! s:check_version(min_version) "{{{ 215 | let versions = split(a:min_version, '\.') 216 | let major = get(versions, 0, 0) 217 | let minor = get(versions, 1, 0) 218 | let patch = get(versions, 2, 0) 219 | let min_version = major * 100 + minor 220 | return v:version < min_version || 221 | \ (patch != 0 && v:version == min_version && !has('patch'.patch)) 222 | endfunction"}}} 223 | 224 | let &cpo = s:save_cpo 225 | unlet s:save_cpo 226 | 227 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/sources/github.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: github.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! neobundle#sources#github#define() "{{{ 30 | return s:source 31 | endfunction"}}} 32 | 33 | let s:source = { 34 | \ 'name' : 'github', 35 | \ 'short_name' : 'github', 36 | \ } 37 | 38 | function! s:source.gather_candidates(args, context) "{{{ 39 | if !executable('wget') 40 | call unite#print_error( 41 | \ '[neobundle/search:github] '. 42 | \ 'wget command is not available!') 43 | return [] 44 | endif 45 | 46 | let plugins = s:get_github_searches(a:context.source__input) 47 | 48 | return map(copy(plugins), "{ 49 | \ 'word' : v:val.username.'/'.v:val.name . ' ' . v:val.description, 50 | \ 'source__name' : (v:val.fork ? '| ' : '') . 51 | \ v:val.username.'/'.v:val.name, 52 | \ 'source__path' : v:val.username.'/'.v:val.name, 53 | \ 'source__description' : v:val.description, 54 | \ 'source__options' : [], 55 | \ 'action__uri' : 'https://github.com/' . 56 | \ v:val.username.'/'.v:val.name, 57 | \ }") 58 | endfunction"}}} 59 | 60 | " Misc. 61 | " @vimlint(EVL102, 1, l:true) 62 | " @vimlint(EVL102, 1, l:false) 63 | " @vimlint(EVL102, 1, l:null) 64 | function! s:get_github_searches(string) "{{{ 65 | let path = 'https://api.github.com/legacy/repos/search/' 66 | \ . a:string . '*?language=VimL' 67 | let temp = neobundle#util#substitute_path_separator(tempname()) 68 | 69 | let cmd = printf('%s "%s" "%s"', 'wget -q -O ', temp, path) 70 | 71 | call unite#print_message( 72 | \ '[neobundle/search:github] Searching plugins from github...') 73 | redraw 74 | 75 | let result = unite#util#system(cmd) 76 | 77 | if unite#util#get_last_status() 78 | call unite#print_message('[neobundle/search:github] ' . cmd) 79 | call unite#print_error('[neobundle/search:github] Error occurred!') 80 | call unite#print_error(result) 81 | return [] 82 | elseif !filereadable(temp) 83 | call unite#print_error('[neobundle/search:github] '. 84 | \ 'Temporary file was not created!') 85 | return [] 86 | else 87 | call unite#print_message('[neobundle/search:github] Done!') 88 | endif 89 | 90 | let [true, false, null] = [1,0,"''"] 91 | sandbox let data = eval(join(readfile(temp))) 92 | call filter(data.repositories, 93 | \ "stridx(v:val.username.'/'.v:val.name, a:string) >= 0") 94 | 95 | call delete(temp) 96 | 97 | return data.repositories 98 | endfunction"}}} 99 | " @vimlint(EVL102, 0, l:true) 100 | " @vimlint(EVL102, 0, l:false) 101 | " @vimlint(EVL102, 0, l:null) 102 | 103 | let &cpo = s:save_cpo 104 | unlet s:save_cpo 105 | 106 | " vim: foldmethod=marker 107 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/sources/neobundle_vim_recipes.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle_vim_recipes.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | let s:repository_cache = [] 30 | 31 | function! neobundle#sources#neobundle_vim_recipes#define() "{{{ 32 | return s:source 33 | endfunction"}}} 34 | 35 | let s:source = { 36 | \ 'name' : 'neobundle-vim-recipes', 37 | \ 'short_name' : 'neobundle', 38 | \ } 39 | 40 | function! s:source.gather_candidates(args, context) "{{{ 41 | let plugins = s:get_repository_plugins(a:context) 42 | 43 | return map(copy(plugins), "{ 44 | \ 'word' : v:val.name . ' ' . v:val.description, 45 | \ 'source__name' : v:val.name, 46 | \ 'source__description' : v:val.description, 47 | \ 'source__script_type' : v:val.script_type, 48 | \ 'source__options' : v:val.options, 49 | \ 'source__path' : v:val.path, 50 | \ 'action__path' : v:val.receipe_path, 51 | \ 'action__uri' : v:val.website, 52 | \ }") 53 | endfunction"}}} 54 | 55 | " Misc. 56 | function! s:get_repository_plugins(context) "{{{ 57 | if a:context.is_redraw || empty(s:repository_cache) 58 | " Reload cache. 59 | let s:repository_cache = [] 60 | 61 | for path in split(globpath(&runtimepath, 62 | \ 'recipes/**/*.vimrecipe', 1), '\n') 63 | sandbox let data = eval(join(filter(readfile(path), 64 | \ "v:val !~ '^\\s*\\%(#.*\\)\\?$'"), '')) 65 | 66 | if !has_key(data, 'name') || !has_key(data, 'path') 67 | call unite#print_error( 68 | \ '[neobundle/search:neobundle-vim-recipes] ' . path) 69 | call unite#print_error( 70 | \ '[neobundle/search:neobundle-vim-recipes] ' . 71 | \ 'The recipe file format is wrong.') 72 | continue 73 | endif 74 | 75 | let data.receipe_path = path 76 | 77 | " Initialize. 78 | let default = { 79 | \ 'options' : {}, 80 | \ 'description' : '', 81 | \ 'website' : '', 82 | \ 'script_type' : '', 83 | \ } 84 | 85 | let data = extend(data, default, 'keep') 86 | 87 | " Set options. 88 | for key in ['depends', 'rev', 'type', 'script_type', 89 | \ 'rtp', 'base', 'build', 'external_commands'] 90 | if has_key(data, key) 91 | let data.options[key] = data[key] 92 | endif 93 | endfor 94 | 95 | call add(s:repository_cache, data) 96 | endfor 97 | endif 98 | 99 | return s:repository_cache 100 | endfunction"}}} 101 | 102 | let &cpo = s:save_cpo 103 | unlet s:save_cpo 104 | 105 | " vim: foldmethod=marker 106 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/sources/vim_scripts_org.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: vim_scripts_org.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | let s:Cache = vital#of('unite').import('System.Cache') 30 | 31 | let s:repository_cache = [] 32 | 33 | function! neobundle#sources#vim_scripts_org#define() "{{{ 34 | return s:source 35 | endfunction"}}} 36 | 37 | let s:source = { 38 | \ 'name' : 'vim-scripts.org', 39 | \ 'short_name' : 'vim.org', 40 | \ } 41 | 42 | function! s:source.gather_candidates(args, context) "{{{ 43 | let repository = 'http://vim-scripts.org/api/scripts_recent.json' 44 | 45 | call unite#print_message( 46 | \ '[neobundle/search:vim-scripts.org] repository: ' . repository) 47 | 48 | let plugins = s:get_repository_plugins(a:context, repository) 49 | 50 | try 51 | return map(copy(plugins), "{ 52 | \ 'word' : v:val.name . ' ' . v:val.description, 53 | \ 'source__name' : v:val.name, 54 | \ 'source__path' : v:val.name, 55 | \ 'source__script_type' : s:convert2script_type(v:val.raw_type), 56 | \ 'source__description' : v:val.description, 57 | \ 'source__options' : [], 58 | \ 'action__uri' : v:val.uri, 59 | \ }") 60 | catch 61 | call unite#print_error( 62 | \ '[neobundle/search:vim-scripts.org] ' 63 | \ .'Error occurred in loading cache.') 64 | call unite#print_error( 65 | \ '[neobundle/search:vim-scripts.org] ' 66 | \ .'Please re-make cache by (unite_redraw) mapping.') 67 | call neobundle#installer#error(v:exception . ' ' . v:throwpoint) 68 | 69 | return [] 70 | endtry 71 | endfunction"}}} 72 | 73 | " Misc. 74 | function! s:get_repository_plugins(context, path) "{{{ 75 | let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle' 76 | 77 | if a:context.is_redraw || !s:Cache.filereadable(cache_dir, a:path) 78 | " Reload cache. 79 | let cache_path = s:Cache.getfilename(cache_dir, a:path) 80 | 81 | call unite#print_message( 82 | \ '[neobundle/search:vim-scripts.org] Reloading cache from ' . a:path) 83 | redraw 84 | 85 | if s:Cache.filereadable(cache_dir, a:path) 86 | call delete(cache_path) 87 | endif 88 | 89 | let temp = unite#util#substitute_path_separator(tempname()) 90 | 91 | if executable('curl') 92 | let cmd = 'curl --fail -s -o "' . temp . '" '. a:path 93 | elseif executable('wget') 94 | let cmd = 'wget -q -O "' . temp . '" ' . a:path 95 | else 96 | call unite#print_error( 97 | \ '[neobundle/search:vim-scripts.org] '. 98 | \ 'curl or wget command is not available!') 99 | return [] 100 | endif 101 | 102 | let result = unite#util#system(cmd) 103 | 104 | if unite#util#get_last_status() 105 | call unite#print_message('[neobundle/search:vim-scripts.org] ' . cmd) 106 | call unite#print_error('[neobundle/search:vim-scripts.org] Error occurred!') 107 | call unite#print_error(result) 108 | return [] 109 | elseif !filereadable(temp) 110 | call unite#print_error('[neobundle/search:vim-scripts.org] '. 111 | \ 'Temporary file was not created!') 112 | return [] 113 | else 114 | call unite#print_message('[neobundle/search:vim-scripts.org] Done!') 115 | endif 116 | 117 | sandbox let data = eval(get(readfile(temp), 0, '[]')) 118 | 119 | " Convert cache data. 120 | call s:Cache.writefile(cache_dir, a:path, 121 | \ [string(s:convert_vim_scripts_data(data))]) 122 | 123 | call delete(temp) 124 | endif 125 | 126 | if empty(s:repository_cache) 127 | sandbox let s:repository_cache = 128 | \ eval(get(s:Cache.readfile(cache_dir, a:path), 0, '[]')) 129 | endif 130 | 131 | return s:repository_cache 132 | endfunction"}}} 133 | 134 | function! s:convert_vim_scripts_data(data) "{{{ 135 | return map(copy(a:data), "{ 136 | \ 'name' : v:val.n, 137 | \ 'raw_type' : v:val.t, 138 | \ 'repository' : v:val.rv, 139 | \ 'description' : printf('%-5s %s', v:val.rv, v:val.s), 140 | \ 'uri' : 'https://github.com/vim-scripts/' . v:val.n, 141 | \ }") 142 | endfunction"}}} 143 | 144 | function! s:convert2script_type(type) "{{{ 145 | if a:type ==# 'utility' 146 | return 'plugin' 147 | elseif a:type ==# 'color scheme' 148 | return 'colors' 149 | else 150 | return a:type 151 | endif 152 | endfunction"}}} 153 | 154 | let &cpo = s:save_cpo 155 | unlet s:save_cpo 156 | 157 | " vim: foldmethod=marker 158 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/types/git.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: git.vim 3 | " AUTHOR: Shougo Matsushita 4 | " Robert Nelson 5 | " Copyright (C) 2010 http://github.com/gmarik 6 | " License: MIT license {{{ 7 | " Permission is hereby granted, free of charge, to any person obtaining 8 | " a copy of this software and associated documentation files (the 9 | " "Software"), to deal in the Software without restriction, including 10 | " without limitation the rights to use, copy, modify, merge, publish, 11 | " distribute, sublicense, and/or sell copies of the Software, and to 12 | " permit persons to whom the Software is furnished to do so, subject to 13 | " the following conditions: 14 | " 15 | " The above copyright notice and this permission notice shall be included 16 | " in all copies or substantial portions of the Software. 17 | " 18 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | " }}} 26 | "============================================================================= 27 | 28 | let s:save_cpo = &cpo 29 | set cpo&vim 30 | 31 | " Global options definition. "{{{ 32 | call neobundle#util#set_default( 33 | \ 'g:neobundle#types#git#command_path', 'git') 34 | call neobundle#util#set_default( 35 | \ 'g:neobundle#types#git#default_protocol', 'https', 36 | \ 'g:neobundle_default_git_protocol') 37 | call neobundle#util#set_default( 38 | \ 'g:neobundle#types#git#enable_submodule', 1) 39 | call neobundle#util#set_default( 40 | \ 'g:neobundle#types#git#clone_depth', 0, 41 | \ 'g:neobundle_git_clone_depth') 42 | call neobundle#util#set_default( 43 | \ 'g:neobundle#types#git#pull_command', 'pull --ff --ff-only') 44 | "}}} 45 | 46 | function! neobundle#types#git#define() "{{{ 47 | return s:type 48 | endfunction"}}} 49 | 50 | let s:type = { 51 | \ 'name' : 'git', 52 | \ } 53 | 54 | function! s:type.detect(path, opts) "{{{ 55 | if a:path =~ '^/\|^\a:/' && s:is_git_dir(a:path.'/.git') 56 | " Local repository. 57 | return { 'uri' : a:path, 'type' : 'git' } 58 | elseif isdirectory(a:path) 59 | return {} 60 | endif 61 | 62 | let protocol = matchstr(a:path, '^.\{-}\ze://') 63 | if protocol == '' || a:path =~# 64 | \'\<\%(gh\|github\|bb\|bitbucket\):\S\+' 65 | \ || has_key(a:opts, 'type__protocol') 66 | let protocol = get(a:opts, 'type__protocol', 67 | \ g:neobundle#types#git#default_protocol) 68 | endif 69 | 70 | if a:path !~ '/' 71 | " www.vim.org Vim scripts. 72 | let name = split(a:path, ':')[-1] 73 | let uri = (protocol ==# 'ssh') ? 74 | \ 'git@github.com:vim-scripts/' : 75 | \ protocol . '://github.com/vim-scripts/' 76 | let uri .= name 77 | else 78 | let name = substitute(split(a:path, ':')[-1], 79 | \ '^//github.com/', '', '') 80 | let uri = (protocol ==# 'ssh') ? 81 | \ 'git@github.com:' . name : 82 | \ protocol . '://github.com/'. name 83 | endif 84 | 85 | if a:path !~# '\<\%(gh\|github\):\S\+\|://github.com/' 86 | let uri = s:parse_other_pattern(protocol, a:path, a:opts) 87 | if uri == '' 88 | " Parse failure. 89 | return {} 90 | endif 91 | endif 92 | 93 | if uri !~ '\.git\s*$' 94 | " Add .git suffix. 95 | let uri .= '.git' 96 | endif 97 | 98 | return { 'uri': uri, 'type' : 'git' } 99 | endfunction"}}} 100 | function! s:type.get_sync_command(bundle) "{{{ 101 | if !executable(g:neobundle#types#git#command_path) 102 | return 'E: "git" command is not installed.' 103 | endif 104 | 105 | if !isdirectory(a:bundle.path) 106 | let cmd = 'clone' 107 | if g:neobundle#types#git#enable_submodule 108 | let cmd .= ' --recursive' 109 | endif 110 | 111 | let depth = get(a:bundle, 'type__depth', 112 | \ g:neobundle#types#git#clone_depth) 113 | if depth > 0 && a:bundle.rev == '' && a:bundle.uri !~ '^git@' 114 | let cmd .= ' --depth=' . depth 115 | endif 116 | 117 | let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path) 118 | else 119 | let cmd = g:neobundle#types#git#pull_command 120 | if g:neobundle#types#git#enable_submodule 121 | let shell = fnamemodify(split(&shell)[0], ':t') 122 | let and = (!neobundle#util#has_vimproc() && shell ==# 'fish') ? 123 | \ '; and ' : ' && ' 124 | 125 | let cmd .= and . g:neobundle#types#git#command_path 126 | \ . ' submodule update --init --recursive' 127 | endif 128 | endif 129 | 130 | return g:neobundle#types#git#command_path . ' ' . cmd 131 | endfunction"}}} 132 | function! s:type.get_revision_number_command(bundle) "{{{ 133 | if !executable(g:neobundle#types#git#command_path) 134 | return '' 135 | endif 136 | 137 | let rev = a:bundle.rev 138 | if rev == '' 139 | let rev = 'HEAD' 140 | endif 141 | 142 | return g:neobundle#types#git#command_path .' rev-parse ' . rev 143 | endfunction"}}} 144 | function! s:type.get_revision_pretty_command(bundle) "{{{ 145 | if !executable(g:neobundle#types#git#command_path) 146 | return '' 147 | endif 148 | 149 | return g:neobundle#types#git#command_path . 150 | \ ' log -1 --pretty=format:"%h [%cr] %s"' 151 | endfunction"}}} 152 | function! s:type.get_commit_date_command(bundle) "{{{ 153 | if !executable(g:neobundle#types#git#command_path) 154 | return '' 155 | endif 156 | 157 | return g:neobundle#types#git#command_path . 158 | \ ' log -1 --pretty=format:"%ct"' 159 | endfunction"}}} 160 | function! s:type.get_log_command(bundle, new_rev, old_rev) "{{{ 161 | if !executable(g:neobundle#types#git#command_path) 162 | \ || a:new_rev == '' || a:old_rev == '' 163 | return '' 164 | endif 165 | 166 | " Note: If the a:old_rev is not the ancestor of two branchs. Then do not use 167 | " %s^. use %s^ will show one commit message which already shown last time. 168 | let is_not_ancestor = neobundle#util#system( 169 | \ g:neobundle#types#git#command_path . ' merge-base ' 170 | \ . a:old_rev . ' ' . a:new_rev) ==# a:old_rev 171 | return printf(g:neobundle#types#git#command_path . 172 | \ ' log %s%s..%s --graph --pretty=format:"%%h [%%cr] %%s"', 173 | \ a:old_rev, (is_not_ancestor ? '' : '^'), a:new_rev) 174 | 175 | " Test. 176 | " return g:neobundle#types#git#command_path . 177 | " \ ' log HEAD^^^^..HEAD --graph --pretty=format:"%h [%cr] %s"' 178 | endfunction"}}} 179 | function! s:type.get_revision_lock_command(bundle) "{{{ 180 | if !executable(g:neobundle#types#git#command_path) 181 | return '' 182 | endif 183 | 184 | let rev = a:bundle.rev 185 | if rev == '' 186 | " Fix detach HEAD. 187 | let rev = 'HEAD' 188 | endif 189 | 190 | return g:neobundle#types#git#command_path . ' checkout ' . rev 191 | endfunction"}}} 192 | function! s:type.get_gc_command(bundle) "{{{ 193 | if !executable(g:neobundle#types#git#command_path) 194 | return '' 195 | endif 196 | 197 | return g:neobundle#types#git#command_path .' gc' 198 | endfunction"}}} 199 | function! s:type.get_revision_remote_command(bundle) "{{{ 200 | if !executable(g:neobundle#types#git#command_path) 201 | return '' 202 | endif 203 | 204 | let rev = a:bundle.rev 205 | if rev == '' 206 | let rev = 'HEAD' 207 | endif 208 | 209 | return g:neobundle#types#git#command_path 210 | \ .' ls-remote origin ' . rev 211 | endfunction"}}} 212 | 213 | function! s:parse_other_pattern(protocol, path, opts) "{{{ 214 | let uri = '' 215 | 216 | if a:path =~# '\ 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | " Global options definition. "{{{ 30 | call neobundle#util#set_default( 31 | \ 'g:neobundle#types#hg#command_path', 'hg') 32 | call neobundle#util#set_default( 33 | \ 'g:neobundle#types#hg#default_protocol', 'https', 34 | \ 'g:neobundle_default_hg_protocol') 35 | "}}} 36 | 37 | function! neobundle#types#hg#define() "{{{ 38 | return s:type 39 | endfunction"}}} 40 | 41 | let s:type = { 42 | \ 'name' : 'hg', 43 | \ } 44 | 45 | function! s:type.detect(path, opts) "{{{ 46 | if isdirectory(a:path.'/.hg') 47 | " Local repository. 48 | return { 'uri' : a:path, 'type' : 'hg' } 49 | elseif isdirectory(a:path) 50 | return {} 51 | endif 52 | 53 | let protocol = matchstr(a:path, '^.\{-}\ze://') 54 | if protocol == '' || a:path =~# 55 | \'\<\%(bb\|bitbucket\):\S\+' 56 | \ || has_key(a:opts, 'type__protocol') 57 | let protocol = get(a:opts, 'type__protocol', 58 | \ g:neobundle#types#hg#default_protocol) 59 | endif 60 | 61 | if a:path =~# '\<\%(bb\|bitbucket\):' 62 | let name = substitute(split(a:path, ':')[-1], 63 | \ '^//bitbucket.org/', '', '') 64 | let uri = (protocol ==# 'ssh') ? 65 | \ 'ssh://hg@bitbucket.org/' . name : 66 | \ protocol . '://bitbucket.org/' . name 67 | elseif a:path =~? '[/.]hg[/.@]' 68 | \ || (a:path =~# '\ 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! neobundle#types#nosync#define() "{{{ 30 | return s:type 31 | endfunction"}}} 32 | 33 | let s:type = { 34 | \ 'name' : 'nosync', 35 | \ } 36 | 37 | function! s:type.detect(path, opts) "{{{ 38 | " No Auto detect. 39 | return {} 40 | endfunction"}}} 41 | function! s:type.get_sync_command(bundle) "{{{ 42 | if isdirectory(a:bundle.path) 43 | return '' 44 | endif 45 | 46 | " Try auto install. 47 | let path = a:bundle.orig_path 48 | let site = get(a:bundle, 'site', g:neobundle#default_site) 49 | if path !~ '^/\|^\a:' && path !~ ':' 50 | " Add default site. 51 | let path = site . ':' . path 52 | endif 53 | 54 | for type in neobundle#config#get_types() 55 | let detect = type.detect(path, a:bundle.orig_opts) 56 | 57 | if !empty(detect) 58 | return type.get_sync_command( 59 | \ extend(copy(a:bundle), detect)) 60 | endif 61 | endfor 62 | 63 | return 'E: Failed to auto installation.' 64 | endfunction"}}} 65 | function! s:type.get_revision_number_command(bundle) "{{{ 66 | return '' 67 | endfunction"}}} 68 | function! s:type.get_revision_lock_command(bundle) "{{{ 69 | return '' 70 | endfunction"}}} 71 | 72 | let &cpo = s:save_cpo 73 | unlet s:save_cpo 74 | 75 | " vim: foldmethod=marker 76 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/types/raw.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: raw.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | " Global options definition. "{{{ 30 | call neobundle#util#set_default( 31 | \ 'g:neobundle#types#raw#calc_hash_command', 32 | \ executable('sha1sum') ? 'sha1sum' : 33 | \ executable('md5sum') ? 'md5sum' : '') 34 | "}}} 35 | 36 | function! neobundle#types#raw#define() "{{{ 37 | return s:type 38 | endfunction"}}} 39 | 40 | let s:type = { 41 | \ 'name' : 'raw', 42 | \ } 43 | 44 | function! s:type.detect(path, opts) "{{{ 45 | " No auto detect. 46 | let type = '' 47 | let name = '' 48 | 49 | if a:path =~# '^https\?:.*\.vim$' 50 | " HTTP/HTTPS 51 | 52 | let name = neobundle#util#name_conversion(a:path) 53 | 54 | let type = 'raw' 55 | elseif a:path =~# 56 | \ '^https\?://www\.vim\.org/scripts/download_script.php?src_id=\d\+$' 57 | " For www.vim.org 58 | let name = 'vim-scripts-' . matchstr(a:path, '\d\+$') 59 | let type = 'raw' 60 | endif 61 | 62 | return type == '' ? {} : 63 | \ { 'name': name, 'uri' : a:path, 'type' : type } 64 | endfunction"}}} 65 | function! s:type.get_sync_command(bundle) "{{{ 66 | if a:bundle.script_type == '' 67 | return 'E: script_type is not found.' 68 | endif 69 | 70 | let path = a:bundle.path 71 | 72 | if !isdirectory(path) 73 | " Create script type directory. 74 | call mkdir(path, 'p') 75 | endif 76 | 77 | let filename = path . '/' . get(a:bundle, 78 | \ 'type__filename', fnamemodify(a:bundle.uri, ':t')) 79 | let a:bundle.type__filepath = filename 80 | 81 | if executable('curl') 82 | let cmd = printf('curl --fail -s -o "%s" "%s"', filename, a:bundle.uri) 83 | elseif executable('wget') 84 | let cmd = printf('wget -q -O "%s" "%s", ', filename, a:bundle.uri) 85 | else 86 | return 'E: curl or wget command is not available!' 87 | endif 88 | 89 | return cmd 90 | endfunction"}}} 91 | function! s:type.get_revision_number_command(bundle) "{{{ 92 | if g:neobundle#types#raw#calc_hash_command == '' 93 | return '' 94 | endif 95 | 96 | if !filereadable(a:bundle.type__filepath) 97 | " Not Installed. 98 | return '' 99 | endif 100 | 101 | " Calc hash. 102 | return printf('%s %s', 103 | \ g:neobundle#types#raw#calc_hash_command, 104 | \ a:bundle.type__filepath) 105 | endfunction"}}} 106 | function! s:type.get_revision_lock_command(bundle) "{{{ 107 | let new_rev = matchstr(a:bundle.new_rev, '^\S\+') 108 | if a:bundle.rev != '' && new_rev != '' && 109 | \ new_rev !=# a:bundle.rev 110 | " Revision check. 111 | return printf('E: revision digest is not matched : "%s"(got) and "%s"(rev).', 112 | \ new_rev, a:bundle.rev) 113 | endif 114 | 115 | " Not supported. 116 | return '' 117 | endfunction"}}} 118 | 119 | let &cpo = s:save_cpo 120 | unlet s:save_cpo 121 | 122 | " vim: foldmethod=marker 123 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/types/svn.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: svn.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | " Global options definition. "{{{ 30 | call neobundle#util#set_default( 31 | \ 'g:neobundle#types#svn#command_path', 'svn') 32 | "}}} 33 | 34 | function! neobundle#types#svn#define() "{{{ 35 | return s:type 36 | endfunction"}}} 37 | 38 | let s:type = { 39 | \ 'name' : 'svn', 40 | \ } 41 | 42 | function! s:type.detect(path, opts) "{{{ 43 | if isdirectory(a:path) 44 | return {} 45 | endif 46 | 47 | let type = '' 48 | let name = '' 49 | let uri = '' 50 | 51 | if a:path =~# '\<\%(file\|https\?\|svn\)://' 52 | \ && a:path =~? '[/.]svn[/.]' 53 | let uri = a:path 54 | let type = 'svn' 55 | elseif a:path =~# '\<\%(gh\|github\):\S\+\|://github.com/' 56 | let name = substitute(split(a:path, ':')[-1], 57 | \ '^//github.com/', '', '') 58 | let uri = 'https://github.com/'. name 59 | let uri .= '/trunk' 60 | 61 | let type = 'svn' 62 | endif 63 | 64 | return type == '' ? {} : { 'uri': uri, 'type' : type } 65 | endfunction"}}} 66 | function! s:type.get_sync_command(bundle) "{{{ 67 | if !executable(g:neobundle#types#svn#command_path) 68 | return 'E: svn command is not installed.' 69 | endif 70 | 71 | if !isdirectory(a:bundle.path) 72 | let cmd = 'checkout' 73 | let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path) 74 | else 75 | let cmd = 'up' 76 | endif 77 | 78 | return g:neobundle#types#svn#command_path . ' ' . cmd 79 | endfunction"}}} 80 | function! s:type.get_revision_number_command(bundle) "{{{ 81 | if !executable(g:neobundle#types#svn#command_path) 82 | return '' 83 | endif 84 | 85 | return g:neobundle#types#svn#command_path . ' info' 86 | endfunction"}}} 87 | function! s:type.get_revision_lock_command(bundle) "{{{ 88 | if !executable(g:neobundle#types#svn#command_path) 89 | \ || a:bundle.rev == '' 90 | return '' 91 | endif 92 | 93 | return g:neobundle#types#svn#command_path 94 | \ . ' up -r ' . a:bundle.rev 95 | endfunction"}}} 96 | 97 | let &cpo = s:save_cpo 98 | unlet s:save_cpo 99 | 100 | " vim: foldmethod=marker 101 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/util.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: util.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | let s:is_windows = has('win32') 30 | let s:is_cygwin = has('win32unix') 31 | let s:is_mac = !s:is_windows 32 | \ && (has('mac') || has('macunix') || has('gui_macvim') || 33 | \ (!isdirectory('/proc') && executable('sw_vers'))) 34 | 35 | function! neobundle#util#substitute_path_separator(path) "{{{ 36 | return (s:is_windows && a:path =~ '\\') ? 37 | \ tr(a:path, '\', '/') : a:path 38 | endfunction"}}} 39 | function! neobundle#util#expand(path) "{{{ 40 | let path = (a:path =~ '^\~') ? fnamemodify(a:path, ':p') : 41 | \ (a:path =~ '^\$\h\w*') ? substitute(a:path, 42 | \ '^\$\h\w*', '\=eval(submatch(0))', '') : 43 | \ a:path 44 | return (s:is_windows && path =~ '\\') ? 45 | \ neobundle#util#substitute_path_separator(path) : path 46 | endfunction"}}} 47 | function! neobundle#util#join_paths(path1, path2) "{{{ 48 | " Joins two paths together, handling the case where the second path 49 | " is an absolute path. 50 | if s:is_absolute(a:path2) 51 | return a:path2 52 | endif 53 | if a:path1 =~ (s:is_windows ? '[\\/]$' : '/$') || 54 | \ a:path2 =~ (s:is_windows ? '^[\\/]' : '^/') 55 | " the appropriate separator already exists 56 | return a:path1 . a:path2 57 | else 58 | " note: I'm assuming here that '/' is always valid as a directory 59 | " separator on Windows. I know Windows has paths that start with \\?\ that 60 | " diasble behavior like that, but I don't know how Vim deals with that. 61 | return a:path1 . '/' . a:path2 62 | endif 63 | endfunction "}}} 64 | if s:is_windows 65 | function! s:is_absolute(path) "{{{ 66 | return a:path =~ '^[\\/]\|^\a:' 67 | endfunction "}}} 68 | else 69 | function! s:is_absolute(path) "{{{ 70 | return a:path =~ "^/" 71 | endfunction "}}} 72 | endif 73 | 74 | function! neobundle#util#is_windows() "{{{ 75 | return s:is_windows 76 | endfunction"}}} 77 | function! neobundle#util#is_mac() "{{{ 78 | return s:is_mac 79 | endfunction"}}} 80 | function! neobundle#util#is_cygwin() "{{{ 81 | return s:is_cygwin 82 | endfunction"}}} 83 | 84 | " Sudo check. 85 | function! neobundle#util#is_sudo() "{{{ 86 | return $SUDO_USER != '' && $USER !=# $SUDO_USER 87 | \ && $HOME !=# expand('~'.$USER) 88 | \ && $HOME ==# expand('~'.$SUDO_USER) 89 | endfunction"}}} 90 | 91 | " Check vimproc. "{{{ 92 | function! neobundle#util#has_vimproc() "{{{ 93 | if !exists('*vimproc#version') 94 | try 95 | call vimproc#version() 96 | catch 97 | endtry 98 | endif 99 | 100 | return exists('*vimproc#version') 101 | endfunction"}}} 102 | "}}} 103 | " iconv() wrapper for safety. 104 | function! s:iconv(expr, from, to) "{{{ 105 | if a:from == '' || a:to == '' || a:from ==? a:to 106 | return a:expr 107 | endif 108 | let result = iconv(a:expr, a:from, a:to) 109 | return result != '' ? result : a:expr 110 | endfunction"}}} 111 | function! neobundle#util#system(str, ...) "{{{ 112 | let command = a:str 113 | let input = a:0 >= 1 ? a:1 : '' 114 | let command = s:iconv(command, &encoding, 'char') 115 | let input = s:iconv(input, &encoding, 'char') 116 | 117 | if a:0 == 0 118 | let output = neobundle#util#has_vimproc() ? 119 | \ vimproc#system(command) : system(command, "\") 120 | elseif a:0 == 1 121 | let output = neobundle#util#has_vimproc() ? 122 | \ vimproc#system(command, input) : system(command, input) 123 | else 124 | " ignores 3rd argument unless you have vimproc. 125 | let output = neobundle#util#has_vimproc() ? 126 | \ vimproc#system(command, input, a:2) : system(command, input) 127 | endif 128 | 129 | let output = s:iconv(output, 'char', &encoding) 130 | 131 | return substitute(output, '\n$', '', '') 132 | endfunction"}}} 133 | function! neobundle#util#get_last_status() "{{{ 134 | return neobundle#util#has_vimproc() ? 135 | \ vimproc#get_last_status() : v:shell_error 136 | endfunction"}}} 137 | 138 | " Split a comma separated string to a list. 139 | function! neobundle#util#split_rtp(runtimepath) "{{{ 140 | if stridx(a:runtimepath, '\,') < 0 141 | return split(a:runtimepath, ',') 142 | endif 143 | 144 | let split = split(a:runtimepath, '\\\@# a:b[1] ? 1 : -1'), 'v:val[0]') 329 | endfunction"}}} 330 | 331 | " Sorts a list with expression to compare each two values. 332 | " a:a and a:b can be used in {expr}. 333 | function! s:sort(list, expr) "{{{ 334 | if type(a:expr) == type(function('function')) 335 | return sort(a:list, a:expr) 336 | endif 337 | let s:expr = a:expr 338 | return sort(a:list, 's:_compare') 339 | endfunction"}}} 340 | 341 | function! s:_compare(a, b) 342 | return eval(s:expr) 343 | endfunction 344 | 345 | let &cpo = s:save_cpo 346 | unlet s:save_cpo 347 | 348 | " vim: foldmethod=marker 349 | 350 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/neobundle/vamkr.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: vamkr.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:vamkr = {} 27 | 28 | if !exists('*vamkr#AddCopyHook') 29 | " Dummy function. 30 | function! vamkr#AddCopyHook(repository, files) 31 | for [filename, type] in items(a:files) 32 | " Todo: Support multiple files? 33 | let a:repository.url .= '/' . type . '/' . filename 34 | endfor 35 | 36 | " echomsg string(a:repository) 37 | return a:repository 38 | endfunction 39 | endif 40 | 41 | function! neobundle#vamkr#init() "{{{ 42 | let head = 'https://raw.github.com/MarcWeber/' 43 | \.'vim-addon-manager-known-repositories/master/db/' 44 | 45 | let s:vamkr.id2name = neobundle#vamkr#parse(head . 46 | \ 'script-id-to-name-log.json') 47 | 48 | let s:vamkr.vimorgsources = neobundle#vamkr#parse(head . 49 | \ 'vimorgsources.json') 50 | let snr_to_name = {} 51 | call map(copy(s:vamkr.vimorgsources), 52 | \ 'extend(snr_to_name, {v:val.vim_script_nr : v:key})') 53 | let s:vamkr.patchinfo = neobundle#vamkr#parse(head . 54 | \ 'patchinfo.vim') 55 | 56 | " Parse scheme 57 | let [scm, scmnr]= neobundle#vamkr#parse(head . 58 | \ 'scmsources.vim') 59 | let scm_generated = neobundle#vamkr#parse(head . 60 | \ 'scm_generated.json') 61 | call extend(scm, scm_generated, 'keep') 62 | 63 | call map(scmnr, "extend(scm, {snr_to_name[v:key] : 64 | \ extend(v:val, {'vim_script_nr': v:key})})") 65 | " Change dependencies. 66 | for depdict in map(filter(values(scm), 67 | \ "has_key(get(v:val, 'addon-info', {}), 'dependencies')"), 68 | \ "v:val['addon-info'].dependencies") 69 | for depname in filter(keys(depdict), 'v:val[0] is# "%"') 70 | call remove(depdict, depname) 71 | let depdict[snr_to_name[depname[1:]]] = {} 72 | endfor 73 | endfor 74 | 75 | let s:vamkr.scm = scm 76 | endfunction"}}} 77 | 78 | function! neobundle#vamkr#get(name) "{{{ 79 | if empty(s:vamkr) 80 | call neobundle#vamkr#init() 81 | endif 82 | 83 | " Search from number. 84 | return has_key(s:vamkr.scm, a:name) ? s:vamkr.scm[a:name] 85 | \ : get(s:vamkr.vimorgsources, a:name, {}) 86 | endfunction"}}} 87 | 88 | function! neobundle#vamkr#parse(path) "{{{ 89 | let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle' 90 | let cache_path = neobundle#cache#getfilename(cache_dir, a:path) 91 | 92 | if !neobundle#cache#filereadable(cache_dir, a:path) 93 | " Reload cache. 94 | 95 | call neobundle#installer#log( 96 | \ '[neobundle/search:vim-scripts.org] Reloading cache from ' . a:path) 97 | redraw 98 | 99 | if neobundle#cache#filereadable(cache_dir, a:path) 100 | call delete(cache_path) 101 | endif 102 | 103 | if executable('curl') 104 | let cmd = 'curl --fail -s -o "' . cache_path . '" '. a:path 105 | elseif executable('wget') 106 | let cmd = 'wget -q -O "' . cache_path . '" ' . a:path 107 | else 108 | call neobundle#util#print_error( 109 | \ 'curl or wget command is not available!') 110 | return [] 111 | endif 112 | 113 | call neobundle#util#system(cmd) 114 | 115 | if !filereadable(cache_path) 116 | call unite#print_error('Cache file was not created!') 117 | return [] 118 | else 119 | call neobundle#installer#log('Done!') 120 | endif 121 | endif 122 | 123 | if fnamemodify(a:path, ':e') == 'vim' 124 | try 125 | execute "function! s:Vim()\n".join( 126 | \ readfile(cache_path, 'b'), "\n")."\nreturn r\nendfunction" 127 | 128 | sandbox let data = s:Vim() 129 | catch 130 | throw 'Execute error: '.v:exception 131 | \ .' error location ('.a:path.'): '.v:throwpoint 132 | finally 133 | silent! delfunction s:Vim 134 | endtry 135 | elseif fnamemodify(a:path, ':e') == 'json' 136 | " JSON. 137 | try 138 | sandbox let data = eval(join(readfile(cache_path, 'b'), '')) 139 | catch 140 | throw 'Failed to read json file: '.a:path 141 | \ .': '.v:exception.' '.v:throwpoint 142 | endtry 143 | else 144 | throw 'Unknown path: ' . a:path 145 | endif 146 | 147 | return data 148 | endfunction"}}} 149 | 150 | " __END__ 151 | " vim: foldmethod=marker 152 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/unite/kinds/neobundle.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! unite#kinds#neobundle#define() "{{{ 30 | return s:kind 31 | endfunction"}}} 32 | 33 | let s:kind = { 34 | \ 'name' : 'neobundle', 35 | \ 'action_table': {}, 36 | \ 'parents' : ['uri', 'directory'], 37 | \ 'default_action' : 'update', 38 | \} 39 | 40 | " Actions "{{{ 41 | let s:kind.action_table.update = { 42 | \ 'description' : 'update bundles', 43 | \ 'is_selectable' : 1, 44 | \ 'is_start' : 1, 45 | \ } 46 | function! s:kind.action_table.update.func(candidates) "{{{ 47 | call unite#start_script([['neobundle/update', '!'] 48 | \ + map(copy(a:candidates), 'v:val.action__bundle_name')], 49 | \ { 'log' : 1 }) 50 | endfunction"}}} 51 | let s:kind.action_table.delete = { 52 | \ 'description' : 'delete bundles', 53 | \ 'is_invalidate_cache' : 1, 54 | \ 'is_quit' : 0, 55 | \ 'is_selectable' : 1, 56 | \ } 57 | function! s:kind.action_table.delete.func(candidates) "{{{ 58 | call call('neobundle#commands#clean', insert(map(copy(a:candidates), 59 | \ 'v:val.action__bundle_name'), 0)) 60 | endfunction"}}} 61 | let s:kind.action_table.reinstall = { 62 | \ 'description' : 'reinstall bundles', 63 | \ 'is_selectable' : 1, 64 | \ } 65 | function! s:kind.action_table.reinstall.func(candidates) "{{{ 66 | call neobundle#installer#reinstall( 67 | \ map(copy(a:candidates), 'v:val.action__bundle')) 68 | endfunction"}}} 69 | let s:kind.action_table.preview = { 70 | \ 'description' : 'view the plugin documentation', 71 | \ 'is_quit' : 0, 72 | \ } 73 | function! s:kind.action_table.preview.func(candidate) "{{{ 74 | " Search help files. 75 | let readme = get(split(globpath( 76 | \ a:candidate.action__path, 'doc/*.?*', 1), '\n'), 0, '') 77 | 78 | if readme == '' 79 | " Search README files. 80 | let readme = get(split(globpath( 81 | \ a:candidate.action__path, 'README*', 1), '\n'), 0, '') 82 | if readme == '' 83 | return 84 | endif 85 | endif 86 | 87 | let buflisted = buflisted( 88 | \ unite#util#escape_file_searching(readme)) 89 | 90 | execute 'pedit' fnameescape(readme) 91 | 92 | " Open folds. 93 | normal! zv 94 | normal! zt 95 | 96 | if !buflisted 97 | call unite#add_previewed_buffer_list( 98 | \ bufnr(unite#util#escape_file_searching(readme))) 99 | endif 100 | endfunction"}}} 101 | "}}} 102 | 103 | let &cpo = s:save_cpo 104 | unlet s:save_cpo 105 | 106 | " vim: foldmethod=marker 107 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/unite/sources/neobundle.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! unite#sources#neobundle#define() "{{{ 30 | return s:source 31 | endfunction"}}} 32 | 33 | let s:source = { 34 | \ 'name' : 'neobundle', 35 | \ 'description' : 'candidates from bundles', 36 | \ 'hooks' : {}, 37 | \ } 38 | 39 | function! s:source.hooks.on_init(args, context) "{{{ 40 | let bundle_names = filter(copy(a:args), 'v:val != "!"') 41 | let a:context.source__bang = 42 | \ index(a:args, '!') >= 0 43 | let a:context.source__bundles = empty(bundle_names) ? 44 | \ neobundle#config#get_neobundles() : 45 | \ neobundle#config#search(bundle_names) 46 | endfunction"}}} 47 | 48 | " Filters "{{{ 49 | function! s:source.source__converter(candidates, context) "{{{ 50 | for candidate in a:candidates 51 | if candidate.source__uri =~ 52 | \ '^\%(https\?\|git\)://github.com/' 53 | let candidate.action__uri = candidate.source__uri 54 | let candidate.action__uri = 55 | \ substitute(candidate.action__uri, '^git://', 'https://', '') 56 | let candidate.action__uri = 57 | \ substitute(candidate.action__uri, '.git$', '', '') 58 | endif 59 | endfor 60 | 61 | return a:candidates 62 | endfunction"}}} 63 | 64 | let s:source.converters = s:source.source__converter 65 | "}}} 66 | 67 | function! s:source.gather_candidates(args, context) "{{{ 68 | let _ = map(copy(a:context.source__bundles), "{ 69 | \ 'word' : substitute(v:val.orig_name, 70 | \ '^\%(https\?\|git\)://\%(github.com/\)\?', '', ''), 71 | \ 'kind' : 'neobundle', 72 | \ 'action__path' : v:val.path, 73 | \ 'action__directory' : v:val.path, 74 | \ 'action__bundle' : v:val, 75 | \ 'action__bundle_name' : v:val.name, 76 | \ 'source__uri' : v:val.uri, 77 | \ 'source__description' : v:val.description, 78 | \ 'is_multiline' : 1, 79 | \ } 80 | \") 81 | 82 | let max = max(map(copy(_), 'len(v:val.word)')) 83 | 84 | call unite#print_source_message( 85 | \ '#: not sourced, X: not installed', self.name) 86 | 87 | for candidate in _ 88 | let candidate.abbr = 89 | \ neobundle#is_sourced(candidate.action__bundle_name) ? ' ' : 90 | \ neobundle#is_installed(candidate.action__bundle_name) ? '#' : 'X' 91 | let candidate.abbr .= ' ' . unite#util#truncate(candidate.word, max) 92 | if candidate.source__description != '' 93 | let candidate.abbr .= ' : ' . candidate.source__description 94 | endif 95 | 96 | if a:context.source__bang 97 | let status = s:get_commit_status(candidate.action__bundle) 98 | if status != '' 99 | let candidate.abbr .= "\n " . status 100 | endif 101 | endif 102 | 103 | let candidate.word .= candidate.source__description 104 | endfor 105 | 106 | return _ 107 | endfunction"}}} 108 | 109 | function! s:get_commit_status(bundle) "{{{ 110 | if !isdirectory(a:bundle.path) 111 | return 'Not installed' 112 | endif 113 | 114 | let type = neobundle#config#get_types(a:bundle.type) 115 | let cmd = has_key(type, 'get_revision_pretty_command') ? 116 | \ type.get_revision_pretty_command(a:bundle) : 117 | \ type.get_revision_number_command(a:bundle) 118 | if cmd == '' 119 | return '' 120 | endif 121 | 122 | let cwd = getcwd() 123 | try 124 | call neobundle#util#cd(a:bundle.path) 125 | let output = neobundle#util#system(cmd) 126 | finally 127 | call neobundle#util#cd(cwd) 128 | endtry 129 | 130 | if neobundle#util#get_last_status() 131 | return printf('Error(%d) occurred when executing "%s"', 132 | \ neobundle#util#get_last_status(), cmd) 133 | endif 134 | 135 | return output 136 | endfunction"}}} 137 | 138 | let &cpo = s:save_cpo 139 | unlet s:save_cpo 140 | 141 | " vim: foldmethod=marker 142 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/unite/sources/neobundle_install.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle/install.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! unite#sources#neobundle_install#define() "{{{ 30 | return [s:source_install, s:source_update] 31 | endfunction"}}} 32 | 33 | let s:source_install = { 34 | \ 'name' : 'neobundle/install', 35 | \ 'description' : 'install bundles', 36 | \ 'hooks' : {}, 37 | \ 'default_kind' : 'word', 38 | \ 'syntax' : 'uniteSource__NeoBundleInstall', 39 | \ } 40 | 41 | function! s:source_install.hooks.on_init(args, context) "{{{ 42 | let bundle_names = filter(copy(a:args), "v:val != '!'") 43 | let a:context.source__bang = 44 | \ index(a:args, '!') >= 0 || !empty(bundle_names) 45 | let a:context.source__not_fuzzy = 0 46 | call s:init(a:context, bundle_names) 47 | endfunction"}}} 48 | 49 | function! s:source_install.hooks.on_syntax(args, context) "{{{ 50 | syntax match uniteSource__NeoBundleInstall_Progress /(.\{-}):\s*.*/ 51 | \ contained containedin=uniteSource__NeoBundleInstall 52 | highlight default link uniteSource__NeoBundleInstall_Progress String 53 | syntax match uniteSource__NeoBundleInstall_Source /|.\{-}|/ 54 | \ contained containedin=uniteSource__NeoBundleInstall_Progress 55 | highlight default link uniteSource__NeoBundleInstall_Source Type 56 | endfunction"}}} 57 | 58 | function! s:source_install.hooks.on_close(args, context) "{{{ 59 | if !empty(a:context.source__processes) 60 | for process in a:context.source__processes 61 | call process.proc.waitpid() 62 | endfor 63 | endif 64 | endfunction"}}} 65 | 66 | function! s:source_install.async_gather_candidates(args, context) "{{{ 67 | let old_msgs = copy(neobundle#installer#get_updates_log()) 68 | 69 | if a:context.source__number < a:context.source__max_bundles 70 | while a:context.source__number < a:context.source__max_bundles 71 | \ && len(a:context.source__processes) < 72 | \ g:neobundle#install_max_processes 73 | let bundle = a:context.source__bundles[a:context.source__number] 74 | call neobundle#installer#sync(bundle, a:context, 1) 75 | 76 | call neobundle#util#redraw_echo( 77 | \ neobundle#installer#get_progress_message(bundle, 78 | \ a:context.source__number, 79 | \ a:context.source__max_bundles)) 80 | endwhile 81 | endif 82 | 83 | if !empty(a:context.source__processes) 84 | for process in a:context.source__processes 85 | call neobundle#installer#check_output(a:context, process, 1) 86 | endfor 87 | 88 | " Filter eof processes. 89 | call filter(a:context.source__processes, '!v:val.eof') 90 | else 91 | let messages = [] 92 | 93 | if empty(a:context.source__synced_bundles) 94 | let messages += ['[neobundle/install] No new bundles installed.'] 95 | else 96 | let messages += ['[neobundle/install] Installed/Updated bundles:'] 97 | \ + map(copy(a:context.source__synced_bundles), 98 | \ 'v:val.name') 99 | endif 100 | 101 | if !empty(a:context.source__errored_bundles) 102 | let messages += ['[neobundle/install] Errored bundles:'] 103 | \ + map(copy(a:context.source__errored_bundles), 104 | \ 'v:val.name') 105 | call neobundle#installer#error( 106 | \ 'Please read error message log by :message command.') 107 | endif 108 | 109 | call neobundle#installer#update_log(messages, 1) 110 | call neobundle#installer#update( 111 | \ a:context.source__synced_bundles) 112 | 113 | " Finish. 114 | call neobundle#installer#update_log('[neobundle/install] Completed.', 1) 115 | 116 | let a:context.is_async = 0 117 | endif 118 | 119 | return map(neobundle#installer#get_updates_log()[len(old_msgs) :], "{ 120 | \ 'word' : substitute(v:val, '^\\[.\\{-}\\]\\s*', '', ''), 121 | \ 'is_multiline' : 1, 122 | \}") 123 | endfunction"}}} 124 | 125 | function! s:source_install.complete(args, context, arglead, cmdline, cursorpos) "{{{ 126 | return ['!'] + 127 | \ neobundle#commands#complete_bundles(a:arglead, a:cmdline, a:cursorpos) 128 | endfunction"}}} 129 | 130 | let s:source_update = deepcopy(s:source_install) 131 | let s:source_update.name = 'neobundle/update' 132 | let s:source_update.description = 'update bundles' 133 | 134 | function! s:source_update.hooks.on_init(args, context) "{{{ 135 | let a:context.source__bang = 136 | \ index(a:args, 'all') >= 0 ? 2 : 1 137 | let a:context.source__not_fuzzy = index(a:args, '!') >= 0 138 | let bundle_names = filter(copy(a:args), 139 | \ "v:val !=# 'all' && v:val !=# '!'") 140 | call s:init(a:context, bundle_names) 141 | endfunction"}}} 142 | 143 | function! s:init(context, bundle_names) 144 | let a:context.source__synced_bundles = [] 145 | let a:context.source__errored_bundles = [] 146 | 147 | let a:context.source__processes = [] 148 | 149 | let a:context.source__number = 0 150 | 151 | let a:context.source__bundles = !a:context.source__bang ? 152 | \ neobundle#get_not_installed_bundles(a:bundle_names) : 153 | \ empty(a:bundle_names) ? 154 | \ neobundle#config#get_neobundles() : 155 | \ a:context.source__not_fuzzy ? 156 | \ neobundle#config#search(a:bundle_names) : 157 | \ neobundle#config#fuzzy_search(a:bundle_names) 158 | 159 | call neobundle#installer#_load_install_info( 160 | \ a:context.source__bundles) 161 | 162 | let reinstall_bundles = 163 | \ neobundle#installer#get_reinstall_bundles(a:context.source__bundles) 164 | if !empty(reinstall_bundles) 165 | call neobundle#installer#reinstall(reinstall_bundles) 166 | endif 167 | 168 | let a:context.source__max_bundles = 169 | \ len(a:context.source__bundles) 170 | 171 | call neobundle#installer#clear_log() 172 | 173 | if empty(a:context.source__bundles) 174 | let a:context.is_async = 0 175 | call neobundle#installer#error( 176 | \ '[neobundle/install] Target bundles not found.' . 177 | \ ' You may use wrong bundle name.', 1) 178 | else 179 | call neobundle#installer#update_log( 180 | \ '[neobundle/install] Update started: ' . 181 | \ strftime('(%Y/%m/%d %H:%M:%S)')) 182 | endif 183 | endfunction 184 | 185 | let &cpo = s:save_cpo 186 | unlet s:save_cpo 187 | 188 | " vim: foldmethod=marker 189 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/unite/sources/neobundle_lazy.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle_lazy.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! unite#sources#neobundle_lazy#define() "{{{ 30 | return s:source 31 | endfunction"}}} 32 | 33 | let s:source = { 34 | \ 'name' : 'neobundle/lazy', 35 | \ 'description' : 'candidates from lazy bundles', 36 | \ 'action_table' : {}, 37 | \ 'default_action' : 'source', 38 | \ } 39 | 40 | function! s:source.gather_candidates(args, context) "{{{ 41 | let _ = [] 42 | for bundle in filter(copy(neobundle#config#get_neobundles()), 43 | \ '!neobundle#config#is_sourced(v:val.name)') 44 | let name = substitute(bundle.orig_name, 45 | \ '^\%(https\?\|git\)://\%(github.com/\)\?', '', '') 46 | let dict = { 47 | \ 'word' : name, 48 | \ 'kind' : 'neobundle', 49 | \ 'action__path' : bundle.path, 50 | \ 'action__directory' : bundle.path, 51 | \ 'action__bundle' : bundle, 52 | \ 'action__bundle_name' : bundle.name, 53 | \ 'source__uri' : bundle.uri, 54 | \ } 55 | call add(_, dict) 56 | endfor 57 | 58 | return _ 59 | endfunction"}}} 60 | 61 | " Actions "{{{ 62 | let s:source.action_table.source = { 63 | \ 'description' : 'source bundles', 64 | \ 'is_selectable' : 1, 65 | \ 'is_invalidate_cache' : 1, 66 | \ } 67 | function! s:source.action_table.source.func(candidates) "{{{ 68 | call call('neobundle#config#source', 69 | \ map(copy(a:candidates), 'v:val.action__bundle_name')) 70 | endfunction"}}} 71 | "}}} 72 | 73 | let &cpo = s:save_cpo 74 | unlet s:save_cpo 75 | 76 | " vim: foldmethod=marker 77 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/unite/sources/neobundle_log.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle/log.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | function! unite#sources#neobundle_log#define() "{{{ 30 | return s:source 31 | endfunction"}}} 32 | 33 | let s:source = { 34 | \ 'name' : 'neobundle/log', 35 | \ 'description' : 'print previous neobundle install logs', 36 | \ 'syntax' : 'uniteSource__NeoBundleLog', 37 | \ 'hooks' : {}, 38 | \ } 39 | 40 | function! s:source.hooks.on_syntax(args, context) "{{{ 41 | syntax match uniteSource__NeoBundleLog_Message /.*/ 42 | \ contained containedin=uniteSource__NeoBundleLog 43 | highlight default link uniteSource__NeoBundleLog_Message Comment 44 | syntax match uniteSource__NeoBundleLog_Progress /(.\{-}):\s*.*/ 45 | \ contained containedin=uniteSource__NeoBundleLog 46 | highlight default link uniteSource__NeoBundleLog_Progress String 47 | syntax match uniteSource__NeoBundleLog_Source /|.\{-}|/ 48 | \ contained containedin=uniteSource__NeoBundleLog_Progress 49 | highlight default link uniteSource__NeoBundleLog_Source Type 50 | endfunction"}}} 51 | 52 | function! s:source.gather_candidates(args, context) "{{{ 53 | return map(copy(neobundle#installer#get_log()), "{ 54 | \ 'word' : substitute(v:val, '^\\[.\\{-}\\]\\s*', '', ''), 55 | \ }") 56 | endfunction"}}} 57 | 58 | let &cpo = s:save_cpo 59 | unlet s:save_cpo 60 | 61 | " vim: foldmethod=marker 62 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/autoload/unite/sources/neobundle_search.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle_search.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | let s:Cache = vital#of('unite').import('System.Cache') 30 | 31 | function! unite#sources#neobundle_search#define() "{{{ 32 | " Init sources. 33 | if !exists('s:neobundle_sources') 34 | let s:neobundle_sources = {} 35 | for define in map(split(globpath(&runtimepath, 36 | \ 'autoload/neobundle/sources/*.vim', 1), '\n'), 37 | \ "neobundle#sources#{fnamemodify(v:val, ':t:r')}#define()") 38 | for dict in (type(define) == type([]) ? define : [define]) 39 | if !empty(dict) && !has_key(s:neobundle_sources, dict.name) 40 | let s:neobundle_sources[dict.name] = dict 41 | endif 42 | endfor 43 | unlet define 44 | endfor 45 | endif 46 | 47 | return s:source 48 | endfunction"}}} 49 | 50 | let s:plugin_names = [] 51 | 52 | " Source rec. 53 | let s:source = { 54 | \ 'name' : 'neobundle/search', 55 | \ 'description' : 'search plugins for neobundle', 56 | \ 'hooks' : {}, 57 | \ 'action_table' : {}, 58 | \ 'default_action' : 'yank', 59 | \ 'max_candidates' : 200, 60 | \ 'syntax' : 'uniteSource__NeoBundleSearch', 61 | \ 'parents' : ['uri'], 62 | \ } 63 | 64 | function! s:source.hooks.on_init(args, context) "{{{ 65 | let a:context.source__sources = copy(s:neobundle_sources) 66 | if !empty(a:args) 67 | let a:context.source__sources = filter( 68 | \ a:context.source__sources, 69 | \ 'index(a:args, v:key) >= 0') 70 | endif 71 | 72 | let a:context.source__input = a:context.input 73 | if a:context.source__input == '' 74 | let a:context.source__input = 75 | \ unite#util#input('Please input search word: ', '', 76 | \ 'customlist,unite#sources#neobundle_search#complete_plugin_names') 77 | endif 78 | endfunction"}}} 79 | function! s:source.gather_candidates(args, context) "{{{ 80 | if neobundle#util#is_sudo() 81 | call neobundle#util#print_error( 82 | \ '"sudo vim" is detected. This feature is disabled.') 83 | return [] 84 | endif 85 | 86 | call unite#print_source_message('Search word: ' 87 | \ . a:context.source__input, s:source.name) 88 | 89 | let candidates = [] 90 | let a:context.source__source_names = [] 91 | 92 | let s:plugin_names = [] 93 | 94 | for source in values(a:context.source__sources) 95 | let source_candidates = source.gather_candidates(a:args, a:context) 96 | let source_name = get(source, 'short_name', source.name) 97 | for candidate in source_candidates 98 | let candidate.source__source = source_name 99 | if !has_key(candidate, 'source__script_type') 100 | let candidate.source__script_type = '' 101 | endif 102 | if !has_key(candidate, 'source__description') 103 | let candidate.source__description = '' 104 | endif 105 | endfor 106 | 107 | let candidates += source_candidates 108 | call add(a:context.source__source_names, source_name) 109 | 110 | let s:plugin_names += map(copy(source_candidates), 'v:val.source__name') 111 | endfor 112 | 113 | call s:initialize_plugin_names(a:context) 114 | 115 | return filter(candidates, 116 | \ 'stridx(v:val.word, a:context.source__input) >= 0') 117 | endfunction"}}} 118 | 119 | function! s:source.complete(args, context, arglead, cmdline, cursorpos) "{{{ 120 | let arglead = get(a:args, -1, '') 121 | return filter(keys(s:neobundle_sources), 122 | \ "stridx(v:val, arglead) == 0") 123 | endfunction"}}} 124 | 125 | function! s:source.hooks.on_syntax(args, context) "{{{ 126 | syntax match uniteSource__NeoBundleSearch_DescriptionLine 127 | \ / -- .*$/ 128 | \ contained containedin=uniteSource__NeoBundleSearch 129 | syntax match uniteSource__NeoBundleSearch_Description 130 | \ /.*$/ 131 | \ contained containedin=uniteSource__NeoBundleSearch_DescriptionLine 132 | syntax match uniteSource__NeoBundleSearch_Marker 133 | \ / -- / 134 | \ contained containedin=uniteSource__NeoBundleSearch_DescriptionLine 135 | syntax match uniteSource__NeoBundleSearch_Install 136 | \ / Installed / 137 | \ contained containedin=uniteSource__NeoBundleSearch 138 | highlight default link uniteSource__NeoBundleSearch_Install Statement 139 | highlight default link uniteSource__NeoBundleSearch_Marker Special 140 | highlight default link uniteSource__NeoBundleSearch_Description Comment 141 | endfunction"}}} 142 | 143 | " Actions "{{{ 144 | let s:source.action_table.yank = { 145 | \ 'description' : 'yank plugin settings', 146 | \ 'is_selectable' : 1, 147 | \ } 148 | function! s:source.action_table.yank.func(candidates) "{{{ 149 | let @" = join(map(a:candidates, 150 | \ "'NeoBundle ' . s:get_neobundle_args(v:val)"), "\n") 151 | if has('clipboard') 152 | let @* = @" 153 | endif 154 | 155 | echo 'Yanked plugin settings!' 156 | endfunction"}}} 157 | 158 | let s:source.action_table.install = { 159 | \ 'description' : 'direct install plugins', 160 | \ 'is_selectable' : 1, 161 | \ 'is_quit' : 0, 162 | \ } 163 | function! s:source.action_table.install.func(candidates) "{{{ 164 | for candidate in a:candidates 165 | execute 'NeoBundleDirectInstall' s:get_neobundle_args(candidate) 166 | endfor 167 | endfunction"}}} 168 | "}}} 169 | 170 | " Filters "{{{ 171 | function! s:source.source__sorter(candidates, context) "{{{ 172 | return s:sort_by(a:candidates, 'v:val.source__name') 173 | endfunction"}}} 174 | function! s:source.source__converter(candidates, context) "{{{ 175 | let max_plugin_name = max(map(copy(a:candidates), 176 | \ 'len(v:val.source__name)')) 177 | let max_script_type = max(map(copy(a:candidates), 178 | \ 'len(v:val.source__script_type)')) 179 | let max_source_name = max(map(copy(a:context.source__source_names), 180 | \ 'len(v:val)')) 181 | let format = '%-'. max_plugin_name .'s %-'. 182 | \ max_source_name .'s %-'. max_script_type .'s -- %s' 183 | 184 | for candidate in a:candidates 185 | let candidate.abbr = printf(format, 186 | \ candidate.source__name, candidate.source__source, 187 | \ candidate.source__script_type, 188 | \ (neobundle#is_installed(candidate.source__name) ? 189 | \ 'Installed' : candidate.source__description)) 190 | let candidate.is_multiline = 1 191 | let candidate.kind = 192 | \ get(candidate, 'action__path', '') != '' ? 193 | \ 'file' : 'common' 194 | endfor 195 | 196 | return a:candidates 197 | endfunction"}}} 198 | 199 | let s:source.sorters = s:source.source__sorter 200 | let s:source.converters = s:source.source__converter 201 | "}}} 202 | 203 | " Misc. "{{{ 204 | function! s:sort_by(list, expr) 205 | let pairs = map(a:list, printf('[v:val, %s]', a:expr)) 206 | return map(s:sort(pairs, 207 | \ 'a:a[1] == a:b[1] ? 0 : a:a[1] > a:b[1] ? 1 : -1'), 'v:val[0]') 208 | endfunction 209 | 210 | " Sorts a list with expression to compare each two values. 211 | " a:a and a:b can be used in {expr}. 212 | function! s:sort(list, expr) 213 | if type(a:expr) == type(function('function')) 214 | return sort(a:list, a:expr) 215 | endif 216 | let s:expr = a:expr 217 | return sort(a:list, 's:_compare') 218 | endfunction 219 | 220 | function! s:_compare(a, b) 221 | return eval(s:expr) 222 | endfunction 223 | 224 | function! s:get_neobundle_args(candidate) 225 | return string(a:candidate.source__path) 226 | \ . (empty(a:candidate.source__options) ? 227 | \ '' : ', ' . string(a:candidate.source__options)) 228 | \ . (a:candidate.source__description == '' ? '' : 229 | \ ' " ' . a:candidate.source__description) 230 | endfunction 231 | 232 | function! unite#sources#neobundle_search#complete_plugin_names(arglead, cmdline, cursorpos) "{{{ 233 | return filter(s:get_plugin_names(), "stridx(v:val, a:arglead) == 0") 234 | endfunction"}}} 235 | 236 | function! s:initialize_plugin_names(context) "{{{ 237 | let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle' 238 | let path = 'plugin_names' 239 | 240 | if a:context.is_redraw || !s:Cache.filereadable(cache_dir, path) 241 | " Convert cache data. 242 | call s:Cache.writefile(cache_dir, path, [string(s:plugin_names)]) 243 | endif 244 | 245 | return s:get_plugin_names() 246 | endfunction"}}} 247 | 248 | function! s:get_plugin_names() "{{{ 249 | let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle' 250 | let path = 'plugin_names' 251 | 252 | if empty(s:plugin_names) && s:Cache.filereadable(cache_dir, path) 253 | sandbox let s:plugin_names = 254 | \ eval(get(s:Cache.readfile(cache_dir, path), 0, '[]')) 255 | endif 256 | 257 | return neobundle#util#uniq(s:plugin_names) 258 | endfunction"}}} 259 | "}}} 260 | 261 | let &cpo = s:save_cpo 262 | unlet s:save_cpo 263 | 264 | " vim: foldmethod=marker 265 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/bin/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Standalone installer for Unixs 3 | # Original version is created by shoma2da 4 | # https://github.com/shoma2da/neobundle_installer 5 | 6 | # Installation directory 7 | BUNDLE_DIR=~/.vim/bundle 8 | INSTALL_DIR=$BUNDLE_DIR/neobundle.vim 9 | 10 | if [ -e $INSTALL_DIR ]; then 11 | echo "$INSTALL_DIR already exists!" 12 | exit 1 13 | fi 14 | 15 | # check git command 16 | if type git; then 17 | : # You have git command. No Problem. 18 | else 19 | echo 'Please install git or update your path to include the git executable!' 20 | exit 1; 21 | fi 22 | 23 | # make bundle dir and fetch neobundle 24 | echo "Begin fetching NeoBundle..." 25 | mkdir -p $BUNDLE_DIR 26 | git clone https://github.com/Shougo/neobundle.vim $INSTALL_DIR 27 | echo "Done." 28 | 29 | # write initial setting for .vimrc 30 | echo "Please add the following settings for NeoBundle to the top of your .vimrc file:" 31 | { 32 | echo "" 33 | echo "" 34 | echo "\"NeoBundle Scripts-----------------------------" 35 | echo "if has('vim_starting')" 36 | echo " if &compatible" 37 | echo " set nocompatible \" Be iMproved" 38 | echo " endif" 39 | echo "" 40 | echo " \" Required:" 41 | echo " set runtimepath+=$BUNDLE_DIR/neobundle.vim/" 42 | echo "endif" 43 | echo "" 44 | echo "\" Required:" 45 | echo "call neobundle#begin(expand('$BUNDLE_DIR'))" 46 | echo "" 47 | echo "\" Let NeoBundle manage NeoBundle" 48 | echo "\" Required:" 49 | echo "NeoBundleFetch 'Shougo/neobundle.vim'" 50 | echo "" 51 | echo "\" Add or remove your Bundles here:" 52 | echo "NeoBundle 'Shougo/neosnippet.vim'" 53 | echo "NeoBundle 'Shougo/neosnippet-snippets'" 54 | echo "NeoBundle 'tpope/vim-fugitive'" 55 | echo "NeoBundle 'ctrlpvim/ctrlp.vim'" 56 | echo "NeoBundle 'flazz/vim-colorschemes'" 57 | echo "" 58 | echo "\" You can specify revision/branch/tag." 59 | echo "NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }" 60 | echo "" 61 | echo "\" Required:" 62 | echo "call neobundle#end()" 63 | echo "" 64 | echo "\" Required:" 65 | echo "filetype plugin indent on" 66 | echo "" 67 | echo "\" If there are uninstalled bundles found on startup," 68 | echo "\" this will conveniently prompt you to install them." 69 | echo "NeoBundleCheck" 70 | echo "\"End NeoBundle Scripts-------------------------" 71 | echo "" 72 | echo "" 73 | } 74 | echo "Done." 75 | 76 | echo "Complete setup NeoBundle!" 77 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/bin/neoinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Detect .vimrc path. 4 | VIMRC=$HOME/.vimrc 5 | 6 | if [ ! -e $VIMRC ]; then 7 | VIMRC=$HOME/.vim/vimrc 8 | fi 9 | 10 | vim -N -u $VIMRC -c "try | NeoBundleUpdate! $* | finally | qall! | endtry" \ 11 | -U NONE -i NONE -V1 -e -s 12 | echo '' 13 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/bin/neoinstall.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | for /F "usebackq" %%t in (`where vim`) do SET _VIM=%%t 3 | set VIM=%_VIM:\vim.exe=% 4 | if "%HOME%"=="" set HOME=%USERPROFILE% 5 | set _VIMRC=%HOME%\_vimrc 6 | if exist %_VIMRC% goto EXEC_NEOBUNDLE_INSTALL 7 | if not exist %_VIMRC% goto DOTVIMRC 8 | 9 | :DOTVIMRC 10 | set VIMRC=%HOME%\.vimrc 11 | if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL 12 | if not exist %VIMRC% goto VIMFILES 13 | 14 | :VIMFILES 15 | set VIMRC=%HOME%\vimfiles\vimrc 16 | if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL 17 | if not exist %VIMRC% goto ORIGIN_VIM 18 | 19 | :ORIGIN_VIM 20 | set VIMRC=%VIM%\_vimrc 21 | if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL 22 | if not exist %VIMRC% goto NO_EXEC_NEOBUNDLE_INSTALL 23 | 24 | @echo on 25 | :EXEC_NEOBUNDLE_INSTALL 26 | vim -N -u %VIMRC% -c "try | NeoBundleUpdate! %* | finally | qall! | endtry" -U NONE -i NONE -V1 -e -s 27 | 28 | 29 | :NO_EXEC_NEOBUNDLE_INSTALL 30 | echo 'vimrc is NotFound.' 31 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/bin/neoinstall_novimproc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | for /F "usebackq" %%t in (`where vim`) do SET _VIM=%%t 3 | set VIM=%_VIM:\vim.exe=% 4 | if "%HOME%"=="" set HOME=%USERPROFILE% 5 | set _VIMRC=%HOME%\_vimrc 6 | if exist %_VIMRC% goto EXEC_NEOBUNDLE_INSTALL 7 | if not exist %_VIMRC% goto DOTVIMRC 8 | 9 | :DOTVIMRC 10 | set VIMRC=%HOME%\.vimrc 11 | if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL 12 | if not exist %VIMRC% goto VIMFILES 13 | 14 | :VIMFILES 15 | set VIMRC=%HOME%\vimfiles\vimrc 16 | if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL 17 | if not exist %VIMRC% goto ORIGIN_VIM 18 | 19 | :ORIGIN_VIM 20 | set VIMRC=%VIM%\_vimrc 21 | if exist %VIMRC% goto EXEC_NEOBUNDLE_INSTALL 22 | if not exist %VIMRC% goto NO_EXEC_NEOBUNDLE_INSTALL 23 | 24 | @echo on 25 | :EXEC_NEOBUNDLE_INSTALL 26 | vim -N -u %VIMRC% --cmd "let g:vimproc#disable = 1" -c "try | NeoBundleUpdate! %* | finally | qall! | endtry" -U NONE -i NONE -V1 -e -s 27 | 28 | 29 | :NO_EXEC_NEOBUNDLE_INSTALL 30 | echo 'vimrc is NotFound.' 31 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/ftdetect/vimrecipe.vim: -------------------------------------------------------------------------------- 1 | " Detect syntax file. 2 | autocmd BufNewFile,BufRead *.vimrecipe set filetype=vimrecipe 3 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/plugin/neobundle.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: neobundle.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | if exists('g:loaded_neobundle') 30 | let &cpo = s:save_cpo 31 | unlet s:save_cpo 32 | 33 | finish 34 | elseif v:version < 702 || (v:version == 702 && !has('patch51')) 35 | " Neobundle uses glob()/globpath() another parameter. 36 | " It is implemented in Vim 7.2.051. 37 | echoerr 'neobundle does not work this version of Vim "' . v:version . '".' 38 | \ .' You must use Vim 7.2.051 or later.' 39 | 40 | let &cpo = s:save_cpo 41 | unlet s:save_cpo 42 | 43 | finish 44 | elseif fnamemodify(&shell, ':t') ==# 'fish' && !has('patch-7.4.276') 45 | echoerr 'Vim does not support "' . &shell . '".' 46 | \ .' You must use Vim 7.4.276 or later.' 47 | 48 | let &cpo = s:save_cpo 49 | unlet s:save_cpo 50 | 51 | finish 52 | endif 53 | 54 | let g:loaded_neobundle = 1 55 | 56 | let &cpo = s:save_cpo 57 | unlet s:save_cpo 58 | 59 | " __END__ 60 | " vim: foldmethod=marker 61 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/syntax/vimrecipe.vim: -------------------------------------------------------------------------------- 1 | "============================================================================= 2 | " FILE: syntax/recipe.vim 3 | " AUTHOR: Shougo Matsushita 4 | " License: MIT license {{{ 5 | " Permission is hereby granted, free of charge, to any person obtaining 6 | " a copy of this software and associated documentation files (the 7 | " "Software"), to deal in the Software without restriction, including 8 | " without limitation the rights to use, copy, modify, merge, publish, 9 | " distribute, sublicense, and/or sell copies of the Software, and to 10 | " permit persons to whom the Software is furnished to do so, subject to 11 | " the following conditions: 12 | " 13 | " The above copyright notice and this permission notice shall be included 14 | " in all copies or substantial portions of the Software. 15 | " 16 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | " }}} 24 | "============================================================================= 25 | 26 | let s:save_cpo = &cpo 27 | set cpo&vim 28 | 29 | if version < 700 30 | syntax clear 31 | elseif exists('b:current_syntax') 32 | finish 33 | endif 34 | 35 | syntax region recipeString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=recipeEscape 36 | syntax region recipeString start=+'+ skip=+\\\\\|\\"+ end=+'+ 37 | 38 | syntax match recipeEscape '\\["\\/bfnrt]' contained 39 | syntax match recipeEscape '\\u\x\{4}' contained 40 | 41 | syntax match recipeNumber '-\?\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\?\>' 42 | 43 | syntax match recipeBraces '[{}\[\]]' 44 | syntax match recipeComment '^\s*#.*$' 45 | 46 | 47 | highlight def link recipeString String 48 | highlight def link recipeEscape Special 49 | highlight def link recipeNumber Number 50 | highlight def link recipeBraces Operator 51 | highlight def link recipeComment Comment 52 | 53 | let b:current_syntax = 'recipe' 54 | 55 | let &cpo = s:save_cpo 56 | unlet s:save_cpo 57 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/commands.vim: -------------------------------------------------------------------------------- 1 | " Basic commands test. 2 | set verbose=1 3 | 4 | let path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | if isdirectory(path) 7 | let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf' 8 | call system(printf('%s "%s"', rm_command, path)) 9 | endif 10 | 11 | call mkdir(path, 'p') 12 | 13 | call neobundle#begin(path) 14 | 15 | let g:neobundle#types#git#default_protocol = 'https' 16 | 17 | " My Bundles here: 18 | " 19 | 20 | " Original repositories in github. 21 | NeoBundle 'Shougo/neocomplcache-clang.git' 22 | 23 | " Vim-script repositories. 24 | NeoBundle 'rails.vim' 25 | 26 | " Username with dashes. 27 | NeoBundle 'vim-scripts/ragtag.vim' 28 | 29 | " Original repo. 30 | NeoBundle 'altercation/vim-colors-solarized' 31 | 32 | " With extension. 33 | " Comment is allowed. 34 | NeoBundle 'nelstrom/vim-mac-classic-theme.git' " Foo, Bar 35 | 36 | " Invalid uri. 37 | NeoBundle 'nonexistinguser/hogehoge.git' 38 | 39 | " Full uri. 40 | NeoBundle 'https://github.com/vim-scripts/vim-game-of-life' 41 | NeoBundle 'git@github.com:gmarik/ingretu.git' 42 | 43 | " Short uri. 44 | NeoBundle 'gh:gmarik/snipmate.vim.git' 45 | NeoBundle 'github:mattn/gist-vim.git' 46 | 47 | " Camel case. 48 | NeoBundle 'vim-scripts/RubySinatra' 49 | 50 | " Non-git repos. 51 | NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/' 52 | 53 | " With options. 54 | NeoBundle 'git://github.com/Shougo/unite.vim.git', {'directory' : 'unite'} 55 | NeoBundle 'Shougo/vimshell', '3787e5' 56 | 57 | " Nosync repos. 58 | NeoBundle 'muttator', {'type' : 'nosync', 'base' : '~/.vim/bundle'} 59 | 60 | " Raw repos. 61 | NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim', 62 | \ {'script_type' : 'plugin'} 63 | 64 | " NeoBundleLocal test. 65 | NeoBundleLocal ~/.vim/bundle/ 66 | 67 | " Depends repos. 68 | NeoBundle 'Shougo/neocomplcache', 69 | \ {'depends' : [ 70 | \ 'Shougo/neocomplcache-snippets-complete.git', 71 | \ ['rstacruz/sparkup', {'rtp': 'vim'}], 72 | \ ]} 73 | NeoBundle 'Shougo/vimfiler', 74 | \ { 'depends' : 'Shougo/unite.vim' } 75 | 76 | " Build repos. 77 | NeoBundle 'Shougo/vimproc', { 78 | \ 'build' : { 79 | \ 'windows' : 'echo "Sorry, cannot update vimproc binary file in Windows."', 80 | \ 'cygwin' : 'make -f make_cygwin.mak', 81 | \ 'mac' : 'make -f make_mac.mak', 82 | \ 'unix' : 'make -f make_unix.mak', 83 | \ }, 84 | \ } 85 | 86 | " Lazy load. 87 | NeoBundleLazy 'c9s/perlomni.vim.git' 88 | NeoBundleSource perlomni.vim 89 | call neobundle#source(['CSApprox']) 90 | 91 | NeoBundleLazy 'The-NERD-tree', {'augroup' : 'NERDTree'} 92 | call neobundle#source(['The-NERD-tree']) 93 | 94 | NeoBundleLazy 'masudaK/vim-python' 95 | NeoBundleLazy 'klen/python-mode' 96 | 97 | NeoBundleLazy 'Rip-Rip/clang_complete', { 98 | \ 'autoload' : { 99 | \ 'filetypes' : ['c', 'cpp'], 100 | \ }, 101 | \ } 102 | 103 | " script_type support. 104 | NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim', 105 | \ {'script_type' : 'plugin'} 106 | 107 | " Fetch only. 108 | NeoBundleFetch 'Shougo/neobundle.vim' 109 | 110 | call neobundle#end() 111 | 112 | filetype plugin indent on " required! 113 | 114 | " Should not break helptags. 115 | set wildignore+=doc 116 | 117 | " Should not break clone. 118 | set wildignore+=.git 119 | set wildignore+=.git/* 120 | set wildignore+=*/.git/* 121 | 122 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/lock.vim: -------------------------------------------------------------------------------- 1 | " Lock file test. 2 | set verbose=1 3 | 4 | let path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | if isdirectory(path) 7 | let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf' 8 | call system(printf('%s "%s"', rm_command, path)) 9 | endif 10 | 11 | call mkdir(path, 'p') 12 | 13 | call neobundle#begin(path) 14 | 15 | NeoBundleFetch 'Shougo/neocomplete.vim' 16 | 17 | call neobundle#end() 18 | 19 | filetype plugin indent on " Required! 20 | 21 | " Create lock file 22 | call writefile([ 23 | \ 'NeoBundleLock neocomplete.vim 8200dfd83ba829f77f028ea26e81eebbe95e6a89', 24 | \ ], path . '/NeoBundle.lock') 25 | 26 | NeoBundleInstall 27 | 28 | let s:suite = themis#suite('lock') 29 | let s:assert = themis#helper('assert') 30 | 31 | function! s:suite.revision_check() 32 | let bundle = neobundle#get('neocomplete.vim') 33 | call s:assert.equals(neobundle#installer#get_revision_number(bundle), 34 | \ '8200dfd83ba829f77f028ea26e81eebbe95e6a89') 35 | endfunction 36 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/parse.vim: -------------------------------------------------------------------------------- 1 | let s:suite = themis#suite('parser') 2 | let s:assert = themis#helper('assert') 3 | 4 | let g:neobundle#types#git#default_protocol = 'git' 5 | let g:neobundle#types#hg#default_protocol = 'https' 6 | let g:neobundle#enable_name_conversion = 0 7 | 8 | function! s:suite.github_git_repos() 9 | call s:assert.equals(neobundle#parser#path( 10 | \ 'Shougo/neocomplcache-clang.git'), 11 | \ {'type' : 'git', 'uri' : 12 | \ g:neobundle#types#git#default_protocol . 13 | \ '://github.com/Shougo/neocomplcache-clang.git', 14 | \ 'name' : 'neocomplcache-clang'}) 15 | call s:assert.equals(neobundle#parser#path('Shougo/vimshell'), 16 | \ {'type' : 'git', 'uri' : 17 | \ g:neobundle#types#git#default_protocol . 18 | \ '://github.com/Shougo/vimshell.git', 19 | \ 'name' : 'vimshell'}) 20 | call s:assert.equals(neobundle#parser#path('rails.vim'), 21 | \ {'type' : 'git', 'uri' : 22 | \ g:neobundle#types#git#default_protocol . 23 | \ '://github.com/vim-scripts/rails.vim.git', 24 | \ 'name' : 'rails.vim'}) 25 | call s:assert.equals(neobundle#parser#path( 26 | \ 'git://git.wincent.com/command-t.git'), 27 | \ {'type' : 'git', 'uri' : 28 | \ 'git://git.wincent.com/command-t.git', 29 | \ 'name' : 'command-t'}) 30 | call s:assert.equals(neobundle#parser#path('vim-scripts/ragtag.vim'), 31 | \ {'type' : 'git', 'uri' : 32 | \ g:neobundle#types#git#default_protocol . 33 | \ '://github.com/vim-scripts/ragtag.vim.git', 34 | \ 'name' : 'ragtag.vim'}) 35 | call s:assert.equals(neobundle#parser#path( 36 | \ 'https://github.com/vim-scripts/vim-game-of-life'), 37 | \ {'type' : 'git', 'uri' : 38 | \ 'https://github.com/vim-scripts/vim-game-of-life.git', 39 | \ 'name' : 'vim-game-of-life'}) 40 | call s:assert.equals(neobundle#parser#path( 41 | \ 'git@github.com:gmarik/ingretu.git'), 42 | \ {'type' : 'git', 'uri' : 43 | \ 'git@github.com:gmarik/ingretu.git', 44 | \ 'name' : 'ingretu'}) 45 | call s:assert.equals(neobundle#parser#path( 46 | \ 'gh:gmarik/snipmate.vim.git'), 47 | \ {'type' : 'git', 'uri' : 48 | \ g:neobundle#types#git#default_protocol . 49 | \ '://github.com/gmarik/snipmate.vim.git', 50 | \ 'name' : 'snipmate.vim'}) 51 | call s:assert.equals(neobundle#parser#path( 52 | \ 'github:mattn/gist-vim.git'), 53 | \ {'type' : 'git', 'uri' : 54 | \ g:neobundle#types#git#default_protocol . 55 | \ '://github.com/mattn/gist-vim.git', 56 | \ 'name' : 'gist-vim'}) 57 | call s:assert.equals(neobundle#parser#path( 58 | \ 'git@github.com:Shougo/neocomplcache.git'), 59 | \ {'type' : 'git', 'uri' : 60 | \ 'git@github.com:Shougo/neocomplcache.git', 61 | \ 'name' : 'neocomplcache'}) 62 | call s:assert.equals(neobundle#parser#path( 63 | \ 'git://git.wincent.com/command-t.git'), 64 | \ {'type' : 'git', 'uri' : 65 | \ 'git://git.wincent.com/command-t.git', 66 | \ 'name' : 'command-t'}) 67 | call s:assert.equals(neobundle#parser#path( 68 | \ 'https://github.com/Shougo/neocomplcache/'), 69 | \ {'type' : 'git', 'uri' : 70 | \ 'https://github.com/Shougo/neocomplcache.git', 71 | \ 'name' : 'neocomplcache'}) 72 | endfunction 73 | 74 | function! s:suite.svn_repos() 75 | call s:assert.equals(neobundle#parser#path( 76 | \ 'http://svn.macports.org/repository/macports/contrib/mpvim/'), 77 | \ {'type' : 'svn', 'uri' : 78 | \ 'http://svn.macports.org/repository/macports/contrib/mpvim', 79 | \ 'name' : 'mpvim'}) 80 | call s:assert.equals(neobundle#parser#path( 81 | \ 'thinca/vim-localrc', {'type' : 'svn'}), 82 | \ {'type' : 'svn', 'uri' : 83 | \ 'https://github.com/thinca/vim-localrc/trunk', 84 | \ 'name' : 'vim-localrc'}) 85 | endfunction 86 | 87 | function! s:suite.hg_repos() 88 | call s:assert.equals(neobundle#parser#path( 89 | \ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'), 90 | \ {'type' : 'hg', 'uri' : 91 | \ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder', 92 | \ 'name' : 'vim-fuzzyfinder'}) 93 | call s:assert.equals(neobundle#parser#path( 94 | \ 'bitbucket://bitbucket.org/ns9tks/vim-fuzzyfinder'), 95 | \ {'type' : 'hg', 'uri' : 96 | \ g:neobundle#types#hg#default_protocol. 97 | \ '://bitbucket.org/ns9tks/vim-fuzzyfinder', 98 | \ 'name' : 'vim-fuzzyfinder'}) 99 | call s:assert.equals(neobundle#parser#path( 100 | \ 'bitbucket:ns9tks/vim-fuzzyfinder'), 101 | \ {'type' : 'hg', 'uri' : 102 | \ g:neobundle#types#hg#default_protocol. 103 | \ '://bitbucket.org/ns9tks/vim-fuzzyfinder', 104 | \ 'name' : 'vim-fuzzyfinder'}) 105 | call s:assert.equals(neobundle#parser#path( 106 | \ 'ns9tks/vim-fuzzyfinder', {'site': 'bitbucket'}), 107 | \ {'type' : 'hg', 'uri' : 108 | \ g:neobundle#types#hg#default_protocol. 109 | \ '://bitbucket.org/ns9tks/vim-fuzzyfinder', 110 | \ 'name' : 'vim-fuzzyfinder'}) 111 | 112 | let bundle = neobundle#parser#_init_bundle( 113 | \ 'git://github.com/Shougo/neobundle.vim.git', 114 | \ [{ 'type' : 'hg'}]) 115 | call s:assert.equals(bundle.name, 'neobundle.vim') 116 | call s:assert.equals(bundle.type, 'hg') 117 | call s:assert.equals(bundle.uri, 'git://github.com/Shougo/neobundle.vim.git') 118 | endfunction 119 | 120 | function! s:suite.gitbucket_git_repos() 121 | call s:assert.equals(neobundle#parser#path( 122 | \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git'), 123 | \ {'type' : 'git', 'uri' : 124 | \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git', 125 | \ 'name' : 'vim-qt-syntax'}) 126 | call s:assert.equals(neobundle#parser#path( 127 | \ 'git://bitbucket.org/kh3phr3n/vim-qt-syntax.git'), 128 | \ {'type' : 'git', 'uri' : 129 | \ 'git://bitbucket.org/kh3phr3n/vim-qt-syntax.git', 130 | \ 'name' : 'vim-qt-syntax'}) 131 | call s:assert.equals(neobundle#parser#path( 132 | \ 'bitbucket:kh3phr3n/vim-qt-syntax.git'), 133 | \ {'type' : 'git', 'uri' : 134 | \ g:neobundle#types#git#default_protocol. 135 | \ '://bitbucket.org/kh3phr3n/vim-qt-syntax.git', 136 | \ 'name' : 'vim-qt-syntax'}) 137 | endfunction 138 | 139 | function! s:suite.raw_repos() 140 | let bundle = neobundle#parser#_init_bundle( 141 | \ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim', 142 | \ [{ 'script_type' : 'plugin'}]) 143 | call s:assert.equals(bundle.name, 'rsense.vim') 144 | call s:assert.equals(bundle.type, 'raw') 145 | call s:assert.equals(bundle.uri, 146 | \ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim') 147 | endfunction 148 | 149 | function! s:suite.default_options() 150 | let g:default_options_save = g:neobundle#default_options 151 | let g:neobundle#default_options = 152 | \ { 'rev' : {'type__update_style' : 'current'}, 153 | \ '_' : {'type' : 'hg'} } 154 | 155 | let bundle = neobundle#parser#_init_bundle( 156 | \ 'Shougo/neocomplcache', ['', 'rev', {}]) 157 | call s:assert.equals(bundle.type__update_style, 'current') 158 | 159 | let bundle2 = neobundle#parser#_init_bundle( 160 | \ 'Shougo/neocomplcache', []) 161 | call s:assert.equals(bundle2.type, 'hg') 162 | 163 | let g:neobundle#default_options = g:default_options_save 164 | endfunction 165 | 166 | function! s:suite.ssh_protocol() 167 | let bundle = neobundle#parser#_init_bundle( 168 | \ 'accountname/reponame', [{ 169 | \ 'site' : 'github', 'type' : 'git', 'type__protocol' : 'ssh' }]) 170 | call s:assert.equals(bundle.uri, 171 | \ 'git@github.com:accountname/reponame.git') 172 | 173 | let bundle = neobundle#parser#_init_bundle( 174 | \ 'accountname/reponame', [{ 175 | \ 'site' : 'bitbucket', 'type' : 'hg', 'type__protocol' : 'ssh' }]) 176 | call s:assert.equals(bundle.uri, 177 | \ 'ssh://hg@bitbucket.org/accountname/reponame') 178 | 179 | let bundle = neobundle#parser#_init_bundle( 180 | \ 'accountname/reponame.git', [{ 181 | \ 'site' : 'bitbucket', 'type' : 'git', 'type__protocol' : 'ssh' }]) 182 | call s:assert.equals(bundle.uri, 183 | \ 'git@bitbucket.org:accountname/reponame.git') 184 | endfunction 185 | 186 | function! s:suite.fetch_plugins() 187 | let bundle = neobundle#parser#fetch( 188 | \ string('accountname/reponame.git')) 189 | call s:assert.equals(bundle.rtp, '') 190 | endfunction 191 | 192 | function! s:suite.parse_directory() 193 | let bundle = neobundle#parser#_init_bundle( 194 | \ 'Shougo/neocomplcache', []) 195 | call s:assert.equals(bundle.directory, 'neocomplcache') 196 | 197 | let bundle = neobundle#parser#_init_bundle( 198 | \ 'Shougo/neocomplcache', ['ver.3']) 199 | call s:assert.equals(bundle.directory, 'neocomplcache_ver_3') 200 | endfunction 201 | 202 | function! s:suite.parse_function_prefix() 203 | call s:assert.equals(neobundle#parser#_function_prefix( 204 | \ 'neobundle.vim'), 'neobundle') 205 | 206 | call s:assert.equals(neobundle#parser#_function_prefix( 207 | \ 'unite-tag'), 'unite#sources#tag') 208 | 209 | call s:assert.equals(neobundle#parser#_function_prefix( 210 | \ 'TweetVim'), 'tweetvim') 211 | 212 | call s:assert.equals(neobundle#parser#_function_prefix( 213 | \ 'vim-vcs'), 'vcs') 214 | 215 | call s:assert.equals(neobundle#parser#_function_prefix( 216 | \ 'gist-vim'), 'gist') 217 | endfunction 218 | 219 | function! s:suite.name_conversion() 220 | let g:neobundle#enable_name_conversion = 1 221 | 222 | let bundle = neobundle#parser#_init_bundle( 223 | \ 'git://github.com/Shougo/neobundle.vim.git', 224 | \ [{ 'type' : 'hg'}]) 225 | call s:assert.equals(bundle.name, 'neobundle') 226 | 227 | let bundle = neobundle#parser#_init_bundle( 228 | \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git', 229 | \ [{ 'type' : 'hg'}]) 230 | call s:assert.equals(bundle.name, 'qt-syntax') 231 | 232 | let bundle = neobundle#parser#_init_bundle( 233 | \ 'https://bitbucket.org/kh3phr3n/qt-syntax-vim.git', 234 | \ [{ 'type' : 'hg'}]) 235 | call s:assert.equals(bundle.name, 'qt-syntax') 236 | 237 | let bundle = neobundle#parser#_init_bundle( 238 | \ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git', 239 | \ [{ 'name' : 'vim-qt-syntax'}]) 240 | call s:assert.equals(bundle.name, 'vim-qt-syntax') 241 | 242 | let g:neobundle#enable_name_conversion = 0 243 | endfunction 244 | 245 | " vim:foldmethod=marker:fen: 246 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/recipe.vim: -------------------------------------------------------------------------------- 1 | " Recipe installation test. 2 | set verbose=1 3 | 4 | let path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | if isdirectory(path) 7 | let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf' 8 | call system(printf('%s "%s"', rm_command, path)) 9 | endif 10 | 11 | call neobundle#begin(path) 12 | 13 | " Let NeoBundle manage NeoBundle 14 | NeoBundleFetch 'Shougo/neobundle.vim' 15 | 16 | " Use recipe. 17 | NeoBundle 'Shougo/neobundle-vim-recipes' 18 | NeoBundleRecipe 'vinarise' 19 | NeoBundle 'Shougo/neocomplcache-snippets-complete', 20 | \ { 'recipe' : 'neocomplcache-snippets-complete'} 21 | 22 | call neobundle#end() 23 | 24 | filetype plugin indent on " Required! 25 | 26 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/sample.vim: -------------------------------------------------------------------------------- 1 | " Sample configurations test. 2 | set verbose=1 3 | 4 | let path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | if isdirectory(path) 7 | let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf' 8 | call system(printf('%s "%s"', rm_command, path)) 9 | endif 10 | 11 | let neobundle#types#git#default_protocol = 12 | \ exists('$http_proxy') ? 'https' : 'git' 13 | 14 | call neobundle#begin(path) 15 | 16 | " Let NeoBundle manage NeoBundle 17 | NeoBundleFetch 'Shougo/neobundle.vim' 18 | 19 | " Recommended to install 20 | " After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile 21 | NeoBundle 'Shougo/vimproc' 22 | 23 | " My Bundles here: 24 | " 25 | " Note: You don't set neobundle setting in .gvimrc! 26 | " Original repos on github 27 | NeoBundle 'tpope/vim-fugitive' 28 | NeoBundle 'Lokaltog/vim-easymotion' 29 | NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'} 30 | " vim-scripts repos 31 | NeoBundle 'L9' 32 | NeoBundle 'FuzzyFinder' 33 | NeoBundle 'rails.vim' 34 | " Non git repos 35 | NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/' 36 | NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder' 37 | 38 | call neobundle#end() 39 | 40 | filetype plugin indent on " Required! 41 | 42 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/source.vim: -------------------------------------------------------------------------------- 1 | " Source test. 2 | set verbose=1 3 | 4 | let path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | if isdirectory(path) 7 | let rm_command = neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf' 8 | call system(printf('%s "%s"', rm_command, path)) 9 | endif 10 | 11 | let neobundle#types#git#default_protocol = 12 | \ exists('$http_proxy') ? 'https' : 'git' 13 | 14 | call neobundle#begin(path) 15 | 16 | " Test dependencies. 17 | 18 | let s:suite = themis#suite('source') 19 | let s:assert = themis#helper('assert') 20 | 21 | NeoBundleLazy 'Shougo/echodoc' 22 | NeoBundle 'Shougo/unite-build', { 'depends' : 'Shougo/echodoc' } 23 | 24 | NeoBundle 'Shougo/unite-ssh', { 'depends' : 'Shougo/unite-sudo' } 25 | NeoBundleLazy 'Shougo/unite-sudo' 26 | 27 | NeoBundleLazy 'Shougo/neomru.vim', { 'depends': 'Shougo/neocomplcache' } 28 | NeoBundle 'Shougo/neocomplcache.vim', 'ver.8' 29 | 30 | NeoBundleLazy 'Shougo/vimshell', { 'depends': 'Shougo/vinarise' } 31 | NeoBundleLazy 'Shougo/vinarise' 32 | 33 | NeoBundle 'Shougo/vimfiler', { 'depends' : 'foo/var' } 34 | 35 | NeoBundleLazy 'Shougo/unite.vim', { 36 | \ 'depends' : ['Shougo/unite-outline', 'basyura/TweetVim'], 37 | \ 'autoload' : { 'commands' : 'Unite' } } 38 | NeoBundleLazy 'Shougo/unite-outline', { 39 | \ 'depends' : 'Shougo/unite.vim' } 40 | 41 | " Dependencies test. 42 | NeoBundleLazy 'basyura/twibill.vim' 43 | NeoBundleLazy 'yomi322/neco-tweetvim' 44 | NeoBundleLazy 'rhysd/tweetvim-advanced-filter' 45 | NeoBundleLazy 'rhysd/TweetVim', { 46 | \ 'depends' : 47 | \ ['basyura/twibill.vim', 48 | \ 'tyru/open-browser.vim', 49 | \ 'yomi322/neco-tweetvim', 50 | \ 'rhysd/tweetvim-advanced-filter'], 51 | \ 'autoload' : { 52 | \ 'commands' : 53 | \ ['TweetVimHomeTimeline', 54 | \ 'TweetVimMentions', 55 | \ 'TweetVimSay', 56 | \ 'TweetVimUserTimeline'] 57 | \ } 58 | \ } 59 | 60 | " Law. 61 | NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim', 62 | \ {'script_type' : 'plugin', 'rev' : '0'} 63 | " NeoBundleReinstall rsense.vim 64 | 65 | NeoBundle 'http://www.vim.org/scripts/download_script.php?src_id=19619', 66 | \ { 'type__filename' : 'python.vim', 'script_type' : 'syntax' } 67 | 68 | call neobundle#end() 69 | 70 | filetype plugin indent on " required! 71 | 72 | " Should not break helptags. 73 | set wildignore+=doc 74 | 75 | " Should not break clone. 76 | set wildignore+=.git 77 | set wildignore+=.git/* 78 | set wildignore+=*/.git/* 79 | 80 | function! s:suite.pattern_a() 81 | call s:assert.equals(neobundle#is_sourced('echodoc'), 1) 82 | call s:assert.equals(neobundle#is_sourced('unite-build'), 1) 83 | endfunction 84 | 85 | function! s:suite.pattern_b() 86 | call s:assert.equals(neobundle#is_sourced('unite-ssh'), 1) 87 | call s:assert.equals(neobundle#is_sourced('unite-sudo'), 1) 88 | endfunction 89 | 90 | function! s:suite.pattern_c() 91 | call s:assert.equals(neobundle#is_sourced('neomru.vim'), 0) 92 | call s:assert.equals(neobundle#is_sourced('neocomplcache.vim'), 1) 93 | endfunction 94 | 95 | function! s:suite.pattern_d() 96 | call s:assert.equals(neobundle#is_sourced('vimshell'), 0) 97 | call s:assert.equals(neobundle#is_sourced('vinarise'), 0) 98 | endfunction 99 | 100 | function! s:suite.autoload() 101 | call s:assert.equals(neobundle#get('unite.vim').autoload.commands, ['Unite']) 102 | endfunction 103 | 104 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/toml.vim: -------------------------------------------------------------------------------- 1 | let s:suite = themis#suite('toml') 2 | let s:assert = themis#helper('assert') 3 | 4 | let g:path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | function! s:suite.before_each() 7 | let g:temp = tempname() 8 | call neobundle#begin(g:path) 9 | endfunction 10 | 11 | function! s:suite.after_each() 12 | call neobundle#end() 13 | call delete(g:temp) 14 | endfunction 15 | 16 | function! s:suite.no_toml() 17 | call writefile([ 18 | \ 'foobar' 19 | \ ], g:temp) 20 | call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 1) 21 | endfunction 22 | 23 | function! s:suite.no_plugins() 24 | call writefile([], g:temp) 25 | call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 1) 26 | endfunction 27 | 28 | function! s:suite.no_repository() 29 | call writefile([ 30 | \ "[[plugins]]", 31 | \ "filetypes = 'all'", 32 | \ "[[plugins]]", 33 | \ "filetypes = 'all'" 34 | \ ], g:temp) 35 | call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 1) 36 | endfunction 37 | 38 | function! s:suite.normal() 39 | call writefile([ 40 | \ "[[plugins]]", 41 | \ "repository = 'Shougo/tabpagebuffer.vim'", 42 | \ "filetypes = 'all'", 43 | \ "[[plugins]]", 44 | \ "repository = 'Shougo/tabpagebuffer.vim'", 45 | \ "filetypes = 'all'" 46 | \ ], g:temp) 47 | call s:assert.equals(neobundle#parser#load_toml(g:temp, {}), 0) 48 | endfunction 49 | 50 | -------------------------------------------------------------------------------- /bundle/neobundle.vim/test/tsort.vim: -------------------------------------------------------------------------------- 1 | let s:suite = themis#suite('tsort') 2 | let s:assert = themis#helper('assert') 3 | 4 | let g:path = expand('~/test-bundle/'.fnamemodify(expand(''), ':t:r')) 5 | 6 | function! s:comp_bundle(bundle1, bundle2) 7 | return a:bundle1.name > a:bundle2.name 8 | endfunction 9 | 10 | function! s:rotate_bundle(bundles) 11 | return a:bundles[1:-1]+a:bundles[0:0] 12 | endfunction 13 | 14 | function! s:suite.before_each() 15 | call neobundle#begin(g:path) 16 | endfunction 17 | 18 | function! s:suite.after_each() 19 | call neobundle#end() 20 | endfunction 21 | 22 | function! s:suite.no_depends() 23 | " [a, b, c] => [a, b, c] 24 | let neobundle_test_data = [{'name' : 'a'}, {'name' : 'b'}, {'name' : 'c'},] 25 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 26 | \ neobundle_test_data) 27 | endfunction 28 | 29 | function! s:suite.normal() 30 | " a -> b -> c 31 | " b -> d 32 | " c 33 | " [a, b, c] => [c, b, a] 34 | let neobundle_test_data = [ 35 | \ {'name' : 'a', 'depends' : [ 36 | \ {'name' : 'b', 'depends' : [ 37 | \ {'name' : 'c'}, 38 | \ ]}, 39 | \ ]}, 40 | \ {'name' : 'b', 'skip' : 1, 'depends' : [ 41 | \ {'name' : 'd', 'skipped' : 1, }, 42 | \ ]}, 43 | \ {'name' : 'c', 'skip' : 1}, 44 | \ ] 45 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), [ 46 | \ neobundle_test_data[0].depends[0].depends[0], 47 | \ neobundle_test_data[0].depends[0], 48 | \ neobundle_test_data[0], 49 | \ ]) 50 | 51 | " a -> c -> b 52 | " a -> d 53 | " b 54 | " c 55 | " [a, b, c] => [b, c, d, a] 56 | let neobundle_test_data = [ 57 | \ {'name' : 'a', 'depends' : [ 58 | \ {'name' : 'c', 'depends' : [ 59 | \ {'name' : 'b'}, 60 | \ ]}, 61 | \ {'name' : 'd'}, 62 | \ ]}, 63 | \ {'name' : 'b', 'skip' : 1}, 64 | \ {'name' : 'c', 'skip' : 1}, 65 | \ ] 66 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 67 | \ [ 68 | \ neobundle_test_data[0].depends[0].depends[0], 69 | \ neobundle_test_data[0].depends[0], 70 | \ neobundle_test_data[0].depends[1], 71 | \ neobundle_test_data[0], 72 | \ ]) 73 | endfunction 74 | 75 | function! s:suite.tsort_circular_reference() 76 | " a -> b -> c -> a 77 | " b 78 | " c 79 | " [a, b, c] => [c, b, a] 80 | let neobundle_test_data = [ 81 | \ {'name' : 'a', 'depends' : [ 82 | \ {'name' : 'b', 'depends' : [ 83 | \ {'name' : 'c', 'depends' : [ 84 | \ {'name' : 'a', 'skip' : 1}, 85 | \ ]}, 86 | \ ]}, 87 | \ ]}, 88 | \ {'name' : 'b', 'skip' : 1}, 89 | \ {'name' : 'c', 'skip' : 1}, 90 | \ ] 91 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 92 | \ [ 93 | \ neobundle_test_data[0].depends[0].depends[0], 94 | \ neobundle_test_data[0].depends[0], 95 | \ neobundle_test_data[0], 96 | \ ]) 97 | endfunction 98 | 99 | function! s:suite.bundled_no_depends() 100 | NeoBundleLazy 'a/a' 101 | NeoBundleLazy 'b/b' 102 | NeoBundleLazy 'c/c' 103 | let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), 104 | \ "v:val.name =~# '^[abc]$'"), "s:comp_bundle") 105 | 106 | " [a, b, c] => [a, b, c] 107 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 108 | \ neobundle_test_data) 109 | 110 | " [c, b, a] => [c, b, a] 111 | call reverse(neobundle_test_data) 112 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 113 | \ neobundle_test_data) 114 | endfunction 115 | 116 | function! s:suite.bundled_normal() 117 | NeoBundleLazy 'a/a' 118 | NeoBundleLazy 'b/b', {'depends' : 'a/a'} 119 | NeoBundleLazy 'c/c', {'depends' : 'b/b'} 120 | let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), 121 | \ "v:val.name =~# '^[abc]$'"), "s:comp_bundle") 122 | 123 | " [a, b, c] => [a, b, c] 124 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 125 | \ neobundle_test_data) 126 | 127 | " [c, b, a] => [a, b, c] 128 | call s:assert.equals(neobundle#config#tsort( 129 | \ reverse(copy(neobundle_test_data))), neobundle_test_data) 130 | endfunction 131 | 132 | function! s:suite.bundled_normal2() 133 | NeoBundleLazy 'a/a', {'depends' : ['c/c', 'b/b']} 134 | NeoBundleLazy 'b/b' 135 | NeoBundleLazy 'c/c', {'depends' : 'b/b'} 136 | let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), 137 | \ "v:val.name =~# '^[abc]$'"), "s:comp_bundle") 138 | let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data) 139 | 140 | " [a, b, c] => [b, c, a] 141 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 142 | \ neobundle_test_rotated) 143 | 144 | " [c, b, a] => [b, c, a] 145 | call s:assert.equals(neobundle#config#tsort( 146 | \ reverse(copy(neobundle_test_data))), neobundle_test_rotated) 147 | endfunction 148 | 149 | function! s:suite.bundled_circular_reference() 150 | NeoBundleLazy 'a/a', {'depends' : 'b/b'} 151 | NeoBundleLazy 'b/b', {'depends' : 'c/c'} 152 | NeoBundleLazy 'c/c', {'depends' : 'a/a'} 153 | let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), 154 | \ "v:val.name =~# '^[abc]$'"), "s:comp_bundle") 155 | 156 | " [a, b, c] => [c, b, a] 157 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 158 | \ reverse(copy(neobundle_test_data))) 159 | 160 | " [c, b, a] => [b, a, c] 161 | call reverse(neobundle_test_data) 162 | let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data) 163 | call s:assert.equals(neobundle#config#tsort(neobundle_test_data), 164 | \ neobundle_test_rotated) 165 | endfunction 166 | 167 | -------------------------------------------------------------------------------- /plugin/netrwPlugin.vim: -------------------------------------------------------------------------------- 1 | " netrwPlugin.vim: Handles file transfer and remote directory listing across a network 2 | " PLUGIN SECTION 3 | " Date: May 26, 2014 4 | " Maintainer: Charles E Campbell 5 | " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim 6 | " Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{1 7 | " Permission is hereby granted to use and distribute this code, 8 | " with or without modifications, provided that this copyright 9 | " notice is copied with it. Like anything else that's free, 10 | " netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided 11 | " *as is* and comes with no warranty of any kind, either 12 | " expressed or implied. By using this plugin, you agree that 13 | " in no event will the copyright holder be liable for any damages 14 | " resulting from the use of this software. 15 | " 16 | " But be doers of the Word, and not only hearers, deluding your own selves {{{1 17 | " (James 1:22 RSV) 18 | " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 19 | " Load Once: {{{1 20 | if &cp || exists("g:loaded_netrwPlugin") 21 | finish 22 | endif 23 | let g:loaded_netrwPlugin = "v153g" 24 | if v:version < 702 25 | echohl WarningMsg 26 | echo "***warning*** you need vim version 7.2 for this version of netrw" 27 | echohl None 28 | finish 29 | endif 30 | if v:version < 703 || (v:version == 703 && !has("patch465")) 31 | echohl WarningMsg 32 | echo "***warning*** this version of netrw needs vim 7.3.465 or later" 33 | echohl Normal 34 | finish 35 | endif 36 | let s:keepcpo = &cpo 37 | set cpo&vim 38 | "DechoRemOn 39 | 40 | " --------------------------------------------------------------------- 41 | " Public Interface: {{{1 42 | 43 | " Local Browsing Autocmds: {{{2 44 | augroup FileExplorer 45 | au! 46 | au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif 47 | au BufEnter * sil call s:LocalBrowse(expand("")) 48 | au VimEnter * sil call s:VimEnter(expand("")) 49 | if has("win32") || has("win95") || has("win64") || has("win16") 50 | au BufEnter .* sil call s:LocalBrowse(expand("")) 51 | endif 52 | augroup END 53 | 54 | " Network Browsing Reading Writing: {{{2 55 | augroup Network 56 | au! 57 | au BufReadCmd file://* call netrw#FileUrlRead(expand("")) 58 | au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand(""))|call netrw#Nread(2,expand(""))|exe "sil doau BufReadPost ".fnameescape(expand("")) 59 | au FileReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand(""))|call netrw#Nread(1,expand(""))|exe "sil doau FileReadPost ".fnameescape(expand("")) 60 | au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand(""))|exe 'Nwrite '.fnameescape(expand(""))|exe "sil doau BufWritePost ".fnameescape(expand("")) 61 | au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand(""))|exe "'[,']".'Nwrite '.fnameescape(expand(""))|exe "sil doau FileWritePost ".fnameescape(expand("")) 62 | try 63 | au SourceCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) 64 | catch /^Vim\%((\a\+)\)\=:E216/ 65 | au SourcePre ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("")) 66 | endtry 67 | augroup END 68 | 69 | " Commands: :Nread, :Nwrite, :NetUserPass {{{2 70 | com! -count=1 -nargs=* Nread call netrw#SavePosn()call netrw#NetRead(,)call netrw#RestorePosn() 71 | com! -range=% -nargs=* Nwrite call netrw#SavePosn(),call netrw#NetWrite()call netrw#RestorePosn() 72 | com! -nargs=* NetUserPass call NetUserPass() 73 | com! -nargs=* Nsource call netrw#SavePosn()call netrw#NetSource()call netrw#RestorePosn() 74 | com! -nargs=? Ntree call netrw#SetTreetop() 75 | 76 | " Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2 77 | com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(,0,0+0,) 78 | com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(,1,0+0,) 79 | com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(,1,2+0,) 80 | com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(,1,4+0,) 81 | com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(,0,6 ,) 82 | com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,) 83 | com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,) 84 | com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(,0,) 85 | 86 | " Commands: NetrwSettings {{{2 87 | com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings() 88 | com! -bang NetrwClean call netrw#Clean(0) 89 | 90 | " Maps: 91 | if !exists("g:netrw_nogx") && maparg('gx','n') == "" 92 | if !hasmapto('NetrwBrowseX') 93 | nmap gx NetrwBrowseX 94 | endif 95 | nno NetrwBrowseX :call netrw#NetrwBrowseX(expand(""),0) 96 | endif 97 | 98 | " --------------------------------------------------------------------- 99 | " LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2 100 | fun! s:LocalBrowse(dirname) 101 | " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here. 102 | " Otherwise, the BufEnter event gets triggered when attempts to write to 103 | " the DBG buffer are made. 104 | 105 | if !exists("s:vimentered") 106 | " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will, 107 | " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined. 108 | " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)") 109 | " call Dret("s:LocalBrowse") 110 | return 111 | endif 112 | 113 | " call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")") 114 | 115 | if has("amiga") 116 | " The check against '' is made for the Amiga, where the empty 117 | " string is the current directory and not checking would break 118 | " things such as the help command. 119 | " call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)") 120 | if a:dirname != '' && isdirectory(a:dirname) 121 | sil! call netrw#LocalBrowseCheck(a:dirname) 122 | if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt 123 | exe w:netrw_bannercnt 124 | endif 125 | endif 126 | 127 | elseif isdirectory(a:dirname) 128 | " call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)") 129 | " call Dredir("LocalBrowse ft last set: ","verbose set ft") 130 | sil! call netrw#LocalBrowseCheck(a:dirname) 131 | if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt 132 | exe w:netrw_bannercnt 133 | endif 134 | 135 | else 136 | " not a directory, ignore it 137 | " call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...") 138 | endif 139 | 140 | " call Dret("s:LocalBrowse") 141 | endfun 142 | 143 | " --------------------------------------------------------------------- 144 | " s:VimEnter: after all vim startup stuff is done, this function is called. {{{2 145 | " Its purpose: to look over all windows and run s:LocalBrowse() on 146 | " them, which checks if they're directories and will create a directory 147 | " listing when appropriate. 148 | " It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter() 149 | " has already been called. 150 | fun! s:VimEnter(dirname) 151 | " call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">") 152 | let curwin = winnr() 153 | let s:vimentered = 1 154 | windo call s:LocalBrowse(expand("%:p")) 155 | exe curwin."wincmd w" 156 | " call Dret("s:VimEnter") 157 | endfun 158 | 159 | " --------------------------------------------------------------------- 160 | " NetrwStatusLine: {{{1 161 | fun! NetrwStatusLine() 162 | " let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".") 163 | if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list") 164 | let &stl= s:netrw_explore_stl 165 | if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif 166 | if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif 167 | return "" 168 | else 169 | return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen 170 | endif 171 | endfun 172 | 173 | " ------------------------------------------------------------------------ 174 | " NetUserPass: set username and password for subsequent ftp transfer {{{1 175 | " Usage: :call NetUserPass() -- will prompt for userid and password 176 | " :call NetUserPass("uid") -- will prompt for password 177 | " :call NetUserPass("uid","password") -- sets global userid and password 178 | fun! NetUserPass(...) 179 | 180 | " get/set userid 181 | if a:0 == 0 182 | " call Dfunc("NetUserPass(a:0<".a:0.">)") 183 | if !exists("g:netrw_uid") || g:netrw_uid == "" 184 | " via prompt 185 | let g:netrw_uid= input('Enter username: ') 186 | endif 187 | else " from command line 188 | " call Dfunc("NetUserPass(a:1<".a:1.">) {") 189 | let g:netrw_uid= a:1 190 | endif 191 | 192 | " get password 193 | if a:0 <= 1 " via prompt 194 | " call Decho("a:0=".a:0." case <=1:") 195 | let g:netrw_passwd= inputsecret("Enter Password: ") 196 | else " from command line 197 | " call Decho("a:0=".a:0." case >1: a:2<".a:2.">") 198 | let g:netrw_passwd=a:2 199 | endif 200 | " call Dret("NetUserPass") 201 | endfun 202 | 203 | " ------------------------------------------------------------------------ 204 | " Modelines And Restoration: {{{1 205 | let &cpo= s:keepcpo 206 | unlet s:keepcpo 207 | " vim:ts=8 fdm=marker 208 | -------------------------------------------------------------------------------- /snippets/javascript/ivey.snippet: -------------------------------------------------------------------------------- 1 | snippet ivey 2 | var ${1:varname} = ${2:value}; 3 | 4 | console.log($1 + " is " + $2); 5 | endsnippet 6 | -------------------------------------------------------------------------------- /snippets/javascript/javascript_angular.controller.snippets: -------------------------------------------------------------------------------- 1 | snippet ngcontroller 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('${1:module}') 7 | .controller('${2:Controller}Controller', $2Controller); 8 | 9 | /* @ngInject */ 10 | function $2Controller(${3:dependencies}) { 11 | var vm = this; 12 | vm.title = '$2Controller'; 13 | 14 | activate(); 15 | 16 | //////////////// 17 | 18 | function activate() { 19 | } 20 | } 21 | })(); 22 | endsnippet 23 | -------------------------------------------------------------------------------- /snippets/javascript/javascript_angular.directive.snippets: -------------------------------------------------------------------------------- 1 | snippet ngdirective 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('${1:module}') 7 | .directive('${2:directive}', $2); 8 | 9 | /* @ngInject */ 10 | function $2(${3:dependencies}) { 11 | // Usage: 12 | // 13 | // Creates: 14 | // 15 | var directive = { 16 | bindToController: true, 17 | controller: ${4:Controller}, 18 | controllerAs: '${5:vm}', 19 | link: link, 20 | restrict: 'A', 21 | scope: { 22 | } 23 | }; 24 | return directive; 25 | 26 | function link(scope, element, attrs) { 27 | } 28 | } 29 | 30 | /* @ngInject */ 31 | function $4() { 32 | 33 | } 34 | })(); 35 | endsnippet 36 | -------------------------------------------------------------------------------- /snippets/javascript/javascript_angular.factory.snippets: -------------------------------------------------------------------------------- 1 | snippet ngfactory 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('${1:module}') 7 | .factory('${2:factory}', $2); 8 | 9 | /* @ngInject */ 10 | function $2(${3:dependencies}) { 11 | var service = { 12 | ${4:func}: $4 13 | }; 14 | return service; 15 | 16 | //////////////// 17 | 18 | function $4() { 19 | } 20 | } 21 | })(); 22 | endsnippet 23 | -------------------------------------------------------------------------------- /snippets/javascript/javascript_angular.filter.snippets: -------------------------------------------------------------------------------- 1 | snippet ngfilter 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('${1:module}') 7 | .filter('${2:filter}', $2); 8 | 9 | function $2() { 10 | return $2Filter; 11 | 12 | //////////////// 13 | function $2Filter(${3:params}) { 14 | return $3; 15 | }; 16 | } 17 | 18 | })(); 19 | endsnippet 20 | -------------------------------------------------------------------------------- /snippets/javascript/javascript_angular.module.snippets: -------------------------------------------------------------------------------- 1 | snippet ngmodule 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('${1:module}', [ 7 | '${2:dependencies}' 8 | ]); 9 | })(); 10 | endsnippet 11 | -------------------------------------------------------------------------------- /snippets/javascript/javascript_angular.service.snippets: -------------------------------------------------------------------------------- 1 | snippet ngservice 2 | (function() { 3 | 'use strict'; 4 | 5 | angular 6 | .module('${1:module}') 7 | .service('${2:Service}', $2); 8 | 9 | /* @ngInject */ 10 | function $2(${3:dependencies}) { 11 | this.${4:func} = $4; 12 | 13 | //////////////// 14 | 15 | function $4() { 16 | } 17 | } 18 | })(); 19 | endsnippet 20 | -------------------------------------------------------------------------------- /syntax/netrw.vim: -------------------------------------------------------------------------------- 1 | " Language : Netrw Remote-Directory Listing Syntax 2 | " Maintainer : Charles E. Campbell, Jr. 3 | " Last change: Mar 07, 2014 4 | " Version : 18 5 | " --------------------------------------------------------------------- 6 | 7 | " Syntax Clearing: {{{1 8 | if version < 600 9 | syntax clear 10 | elseif exists("b:current_syntax") 11 | finish 12 | endif 13 | 14 | " --------------------------------------------------------------------- 15 | " Directory List Syntax Highlighting: {{{1 16 | syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt 17 | syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe 18 | 19 | syn match netrwPlain "\(\S\+ \)*\S\+" contains=@NoSpell 20 | syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell 21 | syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell 22 | "syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify,@NoSpell 23 | syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell 24 | syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime 25 | syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell 26 | syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell 27 | syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup 28 | syn match netrwTreeBarSpace " " contained 29 | 30 | syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained 31 | syn match netrwDateSep "/" contained 32 | syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep 33 | syn match netrwTimeSep ":" 34 | 35 | syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell 36 | syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat 37 | syn match netrwSlash "/" contained 38 | syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep 39 | syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat 40 | syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList 41 | syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList 42 | syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList 43 | syn match netrwList ".*$" contained contains=netrwComma,@NoSpell 44 | syn match netrwComma "," contained 45 | syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained 46 | syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep 47 | syn match netrwQHTopic "-\a\+-" contained skipwhite 48 | syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote 49 | syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell 50 | syn match netrwVersion "(netrw.*)" contained contains=@NoSpell 51 | 52 | " ----------------------------- 53 | " Special filetype highlighting {{{1 54 | " ----------------------------- 55 | if exists("g:netrw_special_syntax") && netrw_special_syntax 56 | syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell 57 | syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell 58 | if has("unix") 59 | syn match netrwCoreDump "\" contains=netrwTreeBar,@NoSpell 60 | endif 61 | syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell 62 | syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell 63 | syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell 64 | syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\)" contains=netrwTreeBar,@NoSpell 65 | syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell 66 | syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell 67 | syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell 68 | syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell 69 | syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell 70 | syn match netrwTags "\" contains=netrwTreeBar,@NoSpell 71 | syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell 72 | syn match netrwTmp "\\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell 73 | endif 74 | 75 | " --------------------------------------------------------------------- 76 | " Highlighting Links: {{{1 77 | if !exists("did_drchip_netrwlist_syntax") 78 | let did_drchip_netrwlist_syntax= 1 79 | hi default link netrwClassify Function 80 | hi default link netrwCmdSep Delimiter 81 | hi default link netrwComment Comment 82 | hi default link netrwDir Directory 83 | hi default link netrwHelpCmd Function 84 | hi default link netrwQHTopic Number 85 | hi default link netrwHidePat Statement 86 | hi default link netrwHideSep netrwComment 87 | hi default link netrwList Statement 88 | hi default link netrwVersion Identifier 89 | hi default link netrwSymLink Question 90 | hi default link netrwExe PreProc 91 | hi default link netrwDateSep Delimiter 92 | 93 | hi default link netrwTreeBar Special 94 | hi default link netrwTimeSep netrwDateSep 95 | hi default link netrwComma netrwComment 96 | hi default link netrwHide netrwComment 97 | hi default link netrwMarkFile TabLineSel 98 | 99 | " special syntax highlighting (see :he g:netrw_special_syntax) 100 | hi default link netrwBak NonText 101 | hi default link netrwCompress Folded 102 | hi default link netrwCoreDump WarningMsg 103 | hi default link netrwData DiffChange 104 | hi default link netrwHdr netrwPlain 105 | hi default link netrwLex netrwPlain 106 | hi default link netrwLib DiffChange 107 | hi default link netrwMakefile DiffChange 108 | hi default link netrwObj Folded 109 | hi default link netrwTilde Folded 110 | hi default link netrwTmp Folded 111 | hi default link netrwTags Folded 112 | hi default link netrwYacc netrwPlain 113 | endif 114 | 115 | " Current Syntax: {{{1 116 | let b:current_syntax = "netrwlist" 117 | " --------------------------------------------------------------------- 118 | " vim: ts=8 fdm=marker 119 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | set encoding=utf-8 2 | 3 | " Look 4 | set background=dark 5 | set guifont=Meslo\ LG\ S\ DZ\ for\ Powerline:h10 6 | 7 | " Show line numbers 8 | set number 9 | " Relative line numbers 10 | set rnu 11 | " No menus, scrollbars, or other junk 12 | set guioptions= 13 | 14 | " Make backspace delete characters 15 | set backspace=2 16 | 17 | " I like my leader being ','. It's easier to reach 18 | let mapleader = "," 19 | 20 | " Disable chimes when pressing something invalid, etc. 21 | set visualbell 22 | set t_vb = 23 | set visualbell t_vb= 24 | au GuiEnter * set visualbell t_vb= 25 | 26 | " Disable backup and swap files 27 | set nobackup 28 | set noswapfile 29 | 30 | " Automatically load changed files 31 | set autoread 32 | " Use the OS clipboard 33 | set clipboard=unnamed 34 | 35 | " Improve Unix/Windows compatibility 36 | set viewoptions=folds,options,cursor,unix 37 | " allow the cursor to pass the last character 38 | set virtualedit=onemore 39 | " store more command history 40 | set history=100 41 | " store a bunch of undo history 42 | set undolevels=400 43 | " allow buffer switching without saving 44 | set hidden 45 | 46 | " Show status line 47 | set laststatus=2 48 | 49 | " Show matching brackets/parenthesis 50 | set showmatch 51 | " Don't blink when matching 52 | set matchtime=0 53 | " Find as you type search 54 | set incsearch 55 | " Highlight search terms 56 | set hlsearch 57 | " Windows can be 0 line high 58 | set winminheight=0 59 | " Case insensitive search 60 | set ignorecase 61 | " Case sensitive if we type an uppercase 62 | set smartcase 63 | 64 | " Indentation options 65 | set autoindent 66 | set noexpandtab 67 | set tabstop=4 68 | set softtabstop=4 69 | set shiftwidth=4 70 | 71 | " Folding 72 | set foldmethod=syntax 73 | set foldnestmax=10 74 | set nofoldenable 75 | set foldlevel=1 76 | 77 | " Make macros render faster (lazy draw) 78 | set lazyredraw 79 | 80 | " No scratch (little box that shows a definition) 81 | set completeopt-=preview 82 | 83 | " Mappings I like 84 | " CTRL-S 85 | nnoremap :Update 86 | noremap :update 87 | vnoremap :update 88 | inoremap :update 89 | 90 | " Window navigation 91 | nnoremap j 92 | nnoremap k 93 | nnoremap l 94 | nnoremap h 95 | if has('nvim') 96 | tnoremap j 97 | tnoremap k 98 | tnoremap l 99 | tnoremap h 100 | tnoremap 101 | endif 102 | 103 | " Wrapped lines goes down/up to next row, rather than next line in file. 104 | nnoremap j gj 105 | nnoremap k gk 106 | 107 | " Yank from the cursor to the end of the line, to be consistent with C and D. 108 | nnoremap Y y$ 109 | 110 | " Hide hightlights on Esc 111 | nnoremap ; :nohl 112 | 113 | " Plugins 114 | if has('vim_starting') 115 | set runtimepath+=~/.vim/bundle/neobundle.vim/ 116 | endif 117 | call neobundle#begin(expand('~/.vim/bundle/')) 118 | 119 | NeoBundleFetch 'Shougo/neobundle.vim' 120 | 121 | 122 | " Git/github integration 123 | NeoBundle 'tpope/vim-fugitive' " The mother of all Git plugins, most build off of this 124 | 125 | 126 | "NeoBundle 'airblade/vim-gitgutter' " Show git hunk changes on the gutter (near line numbers) 127 | "NeoBundle 'jaxbot/github-issues.vim' 128 | 129 | " Allows quickly posting to Gist 130 | NeoBundle 'mattn/gist-vim', { 131 | \ 'lazy' : 1, 132 | \ 'autoload' : { 133 | \ 'commands' : ['Gist'] 134 | \ } 135 | \} 136 | " Support library for above 137 | NeoBundle 'mattn/webapi-vim', { 138 | \ 'lazy' : 1, 139 | \ 'autoload' : { 140 | \ 'function_prefix': 'webapi', 141 | \ 'on_source' : ['gist-vim'] 142 | \ } 143 | \} 144 | 145 | " Tools 146 | " Allows highlighting variables by name rather than type 147 | NeoBundle 'jaxbot/semantic-highlight.vim', { 148 | \ 'lazy' : 1, 149 | \ 'autoload' : { 150 | \ 'commands' : ['SemanticHighlight'] 151 | \ } 152 | \} 153 | " Dummy text generator 154 | NeoBundle 'vim-scripts/loremipsum', { 155 | \ 'lazy' : 1, 156 | \ 'autoload' : { 157 | \ 'commands' : ['Loremipsum'] 158 | \ } 159 | \} 160 | 161 | " Better status bar 162 | NeoBundle 'bling/vim-airline' 163 | " File picker bar 164 | NeoBundle 'scrooloose/nerdtree' 165 | " Easy searching with Ag (like Ack) 166 | NeoBundle 'rking/ag.vim', { 167 | \ 'lazy': 1, 168 | \ 'autoload' : { 169 | \ 'commands' : ['Ag'] 170 | \ } 171 | \} 172 | NeoBundle 'Shougo/neocomplete.vim' " Autocomplete/omnicomplete 173 | " I use this for file/buffer searching/switching 174 | NeoBundle 'Shougo/unite.vim', { 175 | \ 'lazy': 1, 176 | \ 'autoload' : { 177 | \ 'mappings': ['s', 'f', 'e'] 178 | \ } 179 | \} 180 | " Component of above 181 | NeoBundle 'Shougo/neomru.vim', { 182 | \ 'lazy': 1, 183 | \ 'depends': 'Shougo/unite.vim' 184 | \} 185 | NeoBundle 'Shougo/neosnippet' 186 | NeoBundle 'Shougo/neosnippet-snippets' 187 | 188 | " Integrate Vim with tmux so I can seamlessly move between splits 189 | NeoBundle 'christoomey/vim-tmux-navigator' 190 | " Syntaxes 191 | " HAML, Sass, Scss 192 | NeoBundle 'tpope/vim-haml', { 193 | \ 'lazy': 1, 194 | \ 'autoload': { 195 | \ 'filetypes': ['scss', 'sass', 'haml'] 196 | \ } 197 | \} 198 | NeoBundle 'evanmiller/nginx-vim-syntax' " Nginx configuration file coloring 199 | " Go 200 | NeoBundle 'jnwhiteh/vim-golang', { 201 | \ 'lazy': 1, 202 | \ 'autoload': { 203 | \ 'filetypes': ['go'] 204 | \ } 205 | \} 206 | 207 | " I use JavaScript a lot 208 | let g:javascript_lazy = { 209 | \ 'lazy': 1, 210 | \ 'autoload': { 211 | \ 'filetypes': ['javascript'] 212 | \ } 213 | \} 214 | 215 | " Autocomplete for Node.js 216 | NeoBundle 'myhere/vim-nodejs-complete', g:javascript_lazy 217 | " Easy node module opening 218 | NeoBundle 'moll/vim-node', g:javascript_lazy 219 | " Better JavaScript syntax handling 220 | NeoBundle 'jelera/vim-javascript-syntax', g:javascript_lazy 221 | " CoffeeScript support 222 | NeoBundle 'kchmck/vim-coffee-script' 223 | " Better JSON handling 224 | NeoBundle 'elzr/vim-json', { 225 | \ 'lazy': 1, 226 | \ 'autoload': { 227 | \ 'filetypes': ['json'] 228 | \ } 229 | \} 230 | " Support library for above 231 | NeoBundle 'pangloss/vim-javascript' 232 | NeoBundle 'mxw/vim-jsx', g:javascript_lazy 233 | " Misc tpope goodies 234 | " Automatically determine indent settings for file 235 | NeoBundle 'tpope/vim-sleuth' 236 | " Unix helpful commands (i.e. Unlink) 237 | NeoBundle 'tpope/vim-eunuch', { 238 | \ 'lazy': 1, 239 | \ 'autoload': { 240 | \ 'commands': ['Unlink', 'Rename'] 241 | \ } 242 | \} 243 | " Comment things out 244 | NeoBundle 'tpope/vim-commentary', { 245 | \ 'lazy': 1, 246 | \ 'autoload': { 247 | \ 'commands': ['Commentary'] 248 | \ } 249 | \} 250 | " Highlight navigation for F/f 251 | NeoBundle 'unblevable/quick-scope' 252 | 253 | "NeoBundle 'jaxbot/browserlink.vim' 254 | 255 | NeoBundle 'Shougo/deoplete.nvim' 256 | call neobundle#end() 257 | 258 | " Now that all syntax plugins are in the runtime path, turn on the syntax engine 259 | syntax on 260 | filetype plugin indent on 261 | 262 | colorscheme jellybeans 263 | 264 | " Plugin configuration 265 | 266 | if !has('nvim') 267 | " Neocomplete 268 | let g:neocomplete#enable_at_startup = 1 269 | else 270 | let g:deoplete#enable_at_startup = 1 271 | endif 272 | " test matches Test and test, but Test only matches Test 273 | let g:neocomplete#enable_smart_case = 1 274 | " Show starting at 2 characters 275 | let g:neocomplete#sources#syntax#min_keyword_length = 2 276 | " Nodejs dictionary, used by neocomplete through omnicomplete 277 | au FileType javascript set dictionary+=$HOME/vimfiles/bundle/vim-node/dict/node.dict 278 | " : close popup and save indent. 279 | inoremap =my_cr_function() 280 | function! s:my_cr_function() 281 | return neocomplete#smart_close_popup() . "\" 282 | endfunction 283 | " : completion. 284 | inoremap pumvisible() ? "\" : "\" 285 | 286 | " Netrw remote transfers 287 | let g:netrw_altv = 1 288 | let g:netrw_fastbrowse = 2 289 | let g:netrw_keepdir = 0 290 | let g:netrw_liststyle = 2 291 | let g:netrw_retmap = 1 292 | let g:netrw_silent = 1 293 | let g:netrw_special_syntax= 1 294 | 295 | " Airline 296 | " Use powerline fonts on airline 297 | let g:airline_powerline_fonts = 1 298 | 299 | " Unite mappings 300 | call unite#filters#matcher_default#use(['matcher_fuzzy']) 301 | call unite#filters#sorter_default#use(['sorter_rank']) 302 | call unite#custom#profile('files', 'context.smartcase', 1) 303 | call unite#custom#profile('files', 'filters', ['sorter_rank']) 304 | call unite#custom#source('line,outline','matchers','matcher_fuzzy') 305 | call unite#custom#source('file_rec/async', 'ignore_pattern', 'node_modules/\|bower_components/') 306 | call unite#custom#source('file_rec', 'ignore_pattern', 'node_modules/\|bower_components/') 307 | let g:unite_source_history_yank_enable = 1 308 | nnoremap e :Unite -start-insert file_mru 309 | nnoremap f :Unite -start-insert file_rec 310 | nnoremap s :Unite -start-insert buffer 311 | nnoremap y :Unite history/yank 312 | 313 | " Ag, the silver searcher mapping 314 | map :execute "Ag " . expand("") 315 | 316 | " Browserlink.vim 317 | let g:bl_autostart = 1 318 | au BufWritePost */static/templates/*.html :BLReloadTemplate 319 | 320 | " Github-issues.vim 321 | " Search upstream issues as well (useful for forks) 322 | let g:github_upstream_issues = 1 323 | 324 | " GitGutter 325 | let g:gitgutter_realtime = 0 326 | let g:gitgutter_eager = 0 327 | 328 | " Gist 329 | let g:gist_clip_command = 'pbcopy' 330 | let g:gist_detect_filetype = 1 331 | 332 | " Other mappings and configuration 333 | 334 | " Convenient mappings for compiling and running quick, used mostly for school 335 | " gcc compile C files 336 | autocmd filetype c nnoremap c :w :!gcc % -o %:r && ./%:r 337 | " java compile files 338 | autocmd filetype java nnoremap c :w :!javac % && java %:r 339 | " node run files 340 | autocmd filetype javascript nnoremap c :w :!node % 341 | 342 | " Fugitive/Git Shortcuts 343 | nnoremap g :Gstatus4j 344 | 345 | " Make Markdown actually detected as Markdown instead of the default 346 | autocmd BufNewFile,BufReadPost *.md set filetype=markdown 347 | 348 | " Show trailing whitespace as red 349 | highlight ExtraWhitespace ctermbg=darkred guibg=#382424 350 | autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red 351 | autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ 352 | 353 | " Change dir to file path on ,d 354 | nnoremap ,d :lcd %:p:h 355 | 356 | " Prettify JSON command 357 | command! JSONPretty %!python -m json.tool 358 | 359 | " Blog custom settings (rebuild on save) 360 | autocmd BufWritePost */jme/* silent :!node moderate/generate.js devel 361 | autocmd BufWritePost */jme/* silent :BLReloadPage 362 | 363 | " JSX (React) config 364 | let g:jsx_ext_required = 0 " Allow JSX in normal JS files 365 | 366 | " via https://gist.github.com/cszentkiralyi/dc61ee28ab81d23a67aa 367 | function! Quick_scope_selective(movement) 368 | let needs_disabling = 0 369 | if !g:qs_enable 370 | QuickScopeToggle 371 | redraw 372 | let needs_disabling = 1 373 | endif 374 | 375 | let letter = nr2char(getchar()) 376 | 377 | if needs_disabling 378 | QuickScopeToggle 379 | endif 380 | 381 | return a:movement . letter 382 | endfunction 383 | 384 | let g:qs_enable = 0 385 | 386 | 387 | imap (neosnippet_expand_or_jump) 388 | smap (neosnippet_expand_or_jump) 389 | xmap (neosnippet_expand_target) 390 | imap pumvisible() ? "\" : 391 | \ neosnippet#expandable_or_jumpable() ? "\(neosnippet_expand_or_jump)" : "\" 392 | 393 | " Enable snipMate compatibility feature. 394 | let g:neosnippet#enable_snipmate_compatibility = 1 395 | " Tell Neosnippet about the other snippets 396 | let g:neosnippet#snippets_directory='~/.vim/snippets' 397 | 398 | " Yosemite shell bug workaround 399 | " https://github.com/gmarik/Vundle.vim/issues/510 400 | if has("gui_macvim") 401 | set shell=/bin/bash\ -l 402 | endif 403 | 404 | " Local stuff (access_token, etc) 405 | if filereadable(glob("~/.local.vim")) 406 | so ~/.local.vim 407 | endif 408 | --------------------------------------------------------------------------------