=== modified file 'vim/bundle/CamelCaseMotion/.git/index' Binary files vim/bundle/CamelCaseMotion/.git/index 2015-08-25 11:57:14 +0000 and vim/bundle/CamelCaseMotion/.git/index 2015-02-13 09:51:26 +0000 differ === modified file 'vim/bundle/CamelCaseMotion/.git/logs/HEAD' --- vim/bundle/CamelCaseMotion/.git/logs/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/.git/logs/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 f3bdefba787d3748d09d4db520403b627abac0c6 Jan Pobrislo 1440501704 +0200 clone: from https://github.com/bkad/CamelCaseMotion.git +0000000000000000000000000000000000000000 89940cc381fb3df1ab0b8f0305309e758da148d2 Jan Pobrislo 1423821003 +0100 clone: from https://github.com/bkad/CamelCaseMotion.git === modified file 'vim/bundle/CamelCaseMotion/.git/logs/refs/heads/master' --- vim/bundle/CamelCaseMotion/.git/logs/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/.git/logs/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 f3bdefba787d3748d09d4db520403b627abac0c6 Jan Pobrislo 1440501704 +0200 clone: from https://github.com/bkad/CamelCaseMotion.git +0000000000000000000000000000000000000000 89940cc381fb3df1ab0b8f0305309e758da148d2 Jan Pobrislo 1423821003 +0100 clone: from https://github.com/bkad/CamelCaseMotion.git === modified file 'vim/bundle/CamelCaseMotion/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/CamelCaseMotion/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/.git/logs/refs/remotes/origin/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 f3bdefba787d3748d09d4db520403b627abac0c6 Jan Pobrislo 1440501704 +0200 clone: from https://github.com/bkad/CamelCaseMotion.git +0000000000000000000000000000000000000000 89940cc381fb3df1ab0b8f0305309e758da148d2 Jan Pobrislo 1423821003 +0100 clone: from https://github.com/bkad/CamelCaseMotion.git === added file 'vim/bundle/CamelCaseMotion/.git/objects/38/5db8ae1b6661c8671c48b4abe888bdabe81a25' Binary files vim/bundle/CamelCaseMotion/.git/objects/38/5db8ae1b6661c8671c48b4abe888bdabe81a25 1970-01-01 00:00:00 +0000 and vim/bundle/CamelCaseMotion/.git/objects/38/5db8ae1b6661c8671c48b4abe888bdabe81a25 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/CamelCaseMotion/.git/objects/42' === removed file 'vim/bundle/CamelCaseMotion/.git/objects/42/c88e4279799bbb2d00a8201b81e33c9580330d' Binary files vim/bundle/CamelCaseMotion/.git/objects/42/c88e4279799bbb2d00a8201b81e33c9580330d 2015-08-25 11:57:14 +0000 and vim/bundle/CamelCaseMotion/.git/objects/42/c88e4279799bbb2d00a8201b81e33c9580330d 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/CamelCaseMotion/.git/objects/6f' === added file 'vim/bundle/CamelCaseMotion/.git/objects/6f/fb3a31b14fa02e350c1e05cb161b6e9865b98d' Binary files vim/bundle/CamelCaseMotion/.git/objects/6f/fb3a31b14fa02e350c1e05cb161b6e9865b98d 1970-01-01 00:00:00 +0000 and vim/bundle/CamelCaseMotion/.git/objects/6f/fb3a31b14fa02e350c1e05cb161b6e9865b98d 2015-02-13 09:51:26 +0000 differ === added directory 'vim/bundle/CamelCaseMotion/.git/objects/78' === added file 'vim/bundle/CamelCaseMotion/.git/objects/78/16ef799f72f7910d5cc97059baddaa58e2dbf6' Binary files vim/bundle/CamelCaseMotion/.git/objects/78/16ef799f72f7910d5cc97059baddaa58e2dbf6 1970-01-01 00:00:00 +0000 and vim/bundle/CamelCaseMotion/.git/objects/78/16ef799f72f7910d5cc97059baddaa58e2dbf6 2015-02-13 09:51:26 +0000 differ === added directory 'vim/bundle/CamelCaseMotion/.git/objects/89' === added file 'vim/bundle/CamelCaseMotion/.git/objects/89/940cc381fb3df1ab0b8f0305309e758da148d2' --- vim/bundle/CamelCaseMotion/.git/objects/89/940cc381fb3df1ab0b8f0305309e758da148d2 1970-01-01 00:00:00 +0000 +++ vim/bundle/CamelCaseMotion/.git/objects/89/940cc381fb3df1ab0b8f0305309e758da148d2 2015-02-13 09:51:26 +0000 @@ -0,0 +1,1 @@ +xJ1@]++%IT.Dm27sdZ? 8pb9Uԉ ڞ0"眊Z&#"TA[&+4e<S7i;؊cigr^WtK^jQp+QJq׽Ő~ pITF V~wvo[x^ϗJR \ No newline at end of file === removed directory 'vim/bundle/CamelCaseMotion/.git/objects/ef' === removed file 'vim/bundle/CamelCaseMotion/.git/objects/ef/4929c20acc7e71bfae78431a9995739776ad30' Binary files vim/bundle/CamelCaseMotion/.git/objects/ef/4929c20acc7e71bfae78431a9995739776ad30 2015-08-25 11:57:14 +0000 and vim/bundle/CamelCaseMotion/.git/objects/ef/4929c20acc7e71bfae78431a9995739776ad30 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/CamelCaseMotion/.git/objects/f3' === removed file 'vim/bundle/CamelCaseMotion/.git/objects/f3/bdefba787d3748d09d4db520403b627abac0c6' Binary files vim/bundle/CamelCaseMotion/.git/objects/f3/bdefba787d3748d09d4db520403b627abac0c6 2015-08-25 11:57:14 +0000 and vim/bundle/CamelCaseMotion/.git/objects/f3/bdefba787d3748d09d4db520403b627abac0c6 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/CamelCaseMotion/.git/objects/fc' === removed file 'vim/bundle/CamelCaseMotion/.git/objects/fc/6e0b119ada985b5646011bec7a472ff67e5f9e' Binary files vim/bundle/CamelCaseMotion/.git/objects/fc/6e0b119ada985b5646011bec7a472ff67e5f9e 2015-08-25 11:57:14 +0000 and vim/bundle/CamelCaseMotion/.git/objects/fc/6e0b119ada985b5646011bec7a472ff67e5f9e 1970-01-01 00:00:00 +0000 differ === modified file 'vim/bundle/CamelCaseMotion/.git/packed-refs' --- vim/bundle/CamelCaseMotion/.git/packed-refs 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/.git/packed-refs 2015-02-13 09:51:26 +0000 @@ -1,2 +1,2 @@ # pack-refs with: peeled fully-peeled -f3bdefba787d3748d09d4db520403b627abac0c6 refs/remotes/origin/master +89940cc381fb3df1ab0b8f0305309e758da148d2 refs/remotes/origin/master === modified file 'vim/bundle/CamelCaseMotion/.git/refs/heads/master' --- vim/bundle/CamelCaseMotion/.git/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/.git/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -f3bdefba787d3748d09d4db520403b627abac0c6 +89940cc381fb3df1ab0b8f0305309e758da148d2 === modified file 'vim/bundle/CamelCaseMotion/.git/shallow' --- vim/bundle/CamelCaseMotion/.git/shallow 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/.git/shallow 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -f3bdefba787d3748d09d4db520403b627abac0c6 +89940cc381fb3df1ab0b8f0305309e758da148d2 === modified file 'vim/bundle/CamelCaseMotion/autoload/camelcasemotion.vim' --- vim/bundle/CamelCaseMotion/autoload/camelcasemotion.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/CamelCaseMotion/autoload/camelcasemotion.vim 2015-02-13 09:51:26 +0000 @@ -32,7 +32,7 @@ "call search( '\>\|\(\a\|\d\)\+\ze_', 'We' ) " end of ... " number | ACRONYM followed by CamelCase or number | CamelCase | underscore_notation | non-keyword | word - call search( '\m\d\+\|\u\+\ze\%(\u\l\|\d\)\|\l\+\ze\%(\u\|\d\)\|\u\l\+\|\%(\a\|\d\)\+\ze[-_]\|\%(\k\@!\S\)\+\|\%([-_]\@!\k\)\+\>', 'We' ) + call search( '\d\+\|\u\+\ze\%(\u\l\|\d\)\|\l\+\ze\%(\u\|\d\)\|\u\l\+\|\%(\a\|\d\)\+\ze[-_]\|\%(\k\@!\S\)\+\|\%([-_]\@!\k\)\+\>', 'We' ) " Note: word must be defined as '\k\>'; '\>' on its own somehow " dominates over the previous branch. Plus, \k must exclude the " underscore, or a trailing one will be incorrectly moved over: @@ -73,8 +73,8 @@ "call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+', 'W' . l:direction ) "call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+\|_\zs\(\a\|\d\)\+', 'W' . l:direction ) " beginning of ... - " word | empty line | non-keyword after whitespaces | non-whitespace after word | number | lowercase folowed by capital letter or number | ACRONYM followed by CamelCase or number | CamelCase | ACRONYM | underscore followed by ACRONYM, Camel, lowercase or number - call search( '\m\<\D\|^$\|\%(^\|\s\)\+\zs\k\@!\S\|\>\<\|\d\+\|\l\+\zs\%(\u\|\d\)\|\u\+\zs\%(\u\l\|\d\)\|\u\l\+\|\u\@\<\|\d\+\|\u\+\zs\%(\u\l\|\d\)\|\u\l\+\|\u\@ 1440501699 +0200 clone: from https://github.com/mileszs/ack.vim.git +0000000000000000000000000000000000000000 bc3667f7a5af9d006cae98ee23c4e756774a679f Jan Pobrislo 1423821002 +0100 clone: from https://github.com/mileszs/ack.vim.git === modified file 'vim/bundle/ack.vim/.git/logs/refs/heads/master' --- vim/bundle/ack.vim/.git/logs/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/.git/logs/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 923507cadc0b8b73b238db67a28a7ed00194f319 Jan Pobrislo 1440501699 +0200 clone: from https://github.com/mileszs/ack.vim.git +0000000000000000000000000000000000000000 bc3667f7a5af9d006cae98ee23c4e756774a679f Jan Pobrislo 1423821002 +0100 clone: from https://github.com/mileszs/ack.vim.git === modified file 'vim/bundle/ack.vim/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/ack.vim/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/.git/logs/refs/remotes/origin/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 923507cadc0b8b73b238db67a28a7ed00194f319 Jan Pobrislo 1440501699 +0200 clone: from https://github.com/mileszs/ack.vim.git +0000000000000000000000000000000000000000 bc3667f7a5af9d006cae98ee23c4e756774a679f Jan Pobrislo 1423821002 +0100 clone: from https://github.com/mileszs/ack.vim.git === removed directory 'vim/bundle/ack.vim/.git/objects/12' === removed file 'vim/bundle/ack.vim/.git/objects/12/237e4edd5736ba562795a216976cd825f1329d' Binary files vim/bundle/ack.vim/.git/objects/12/237e4edd5736ba562795a216976cd825f1329d 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/12/237e4edd5736ba562795a216976cd825f1329d 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/22' === added file 'vim/bundle/ack.vim/.git/objects/22/70fa7552bb116fef2432187a5d1b0936ca2311' Binary files vim/bundle/ack.vim/.git/objects/22/70fa7552bb116fef2432187a5d1b0936ca2311 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/22/70fa7552bb116fef2432187a5d1b0936ca2311 2015-02-13 09:51:26 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/35' === added file 'vim/bundle/ack.vim/.git/objects/35/a642ed00ee94367a0d73e771483fb5002da0bf' Binary files vim/bundle/ack.vim/.git/objects/35/a642ed00ee94367a0d73e771483fb5002da0bf 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/35/a642ed00ee94367a0d73e771483fb5002da0bf 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/3e' === removed file 'vim/bundle/ack.vim/.git/objects/3e/7353156a6352d7f64dea33f6e4e89997cda1da' Binary files vim/bundle/ack.vim/.git/objects/3e/7353156a6352d7f64dea33f6e4e89997cda1da 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/3e/7353156a6352d7f64dea33f6e4e89997cda1da 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/42' === added file 'vim/bundle/ack.vim/.git/objects/42/140fd4dcfb672d412cea161408ca85bc8b5f0f' Binary files vim/bundle/ack.vim/.git/objects/42/140fd4dcfb672d412cea161408ca85bc8b5f0f 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/42/140fd4dcfb672d412cea161408ca85bc8b5f0f 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/43' === removed file 'vim/bundle/ack.vim/.git/objects/43/f6729c46d511bb694b3221a8fa78540e189592' Binary files vim/bundle/ack.vim/.git/objects/43/f6729c46d511bb694b3221a8fa78540e189592 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/43/f6729c46d511bb694b3221a8fa78540e189592 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/53' === added file 'vim/bundle/ack.vim/.git/objects/53/82a4699ae29c44ccaf243970d7a54ee79c2e8a' Binary files vim/bundle/ack.vim/.git/objects/53/82a4699ae29c44ccaf243970d7a54ee79c2e8a 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/53/82a4699ae29c44ccaf243970d7a54ee79c2e8a 2015-02-13 09:51:26 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/71' === added file 'vim/bundle/ack.vim/.git/objects/71/d7454871cce0ee7467cd3f76de74f844a9f1a8' Binary files vim/bundle/ack.vim/.git/objects/71/d7454871cce0ee7467cd3f76de74f844a9f1a8 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/71/d7454871cce0ee7467cd3f76de74f844a9f1a8 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/92' === removed file 'vim/bundle/ack.vim/.git/objects/92/3507cadc0b8b73b238db67a28a7ed00194f319' Binary files vim/bundle/ack.vim/.git/objects/92/3507cadc0b8b73b238db67a28a7ed00194f319 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/92/3507cadc0b8b73b238db67a28a7ed00194f319 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/98' === added file 'vim/bundle/ack.vim/.git/objects/98/82b2ca28711bb659af7ecf2021ebc7a56a1137' Binary files vim/bundle/ack.vim/.git/objects/98/82b2ca28711bb659af7ecf2021ebc7a56a1137 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/98/82b2ca28711bb659af7ecf2021ebc7a56a1137 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/a1' === removed file 'vim/bundle/ack.vim/.git/objects/a1/17936205177cb0031f41f046c4cbcbc5fd607a' Binary files vim/bundle/ack.vim/.git/objects/a1/17936205177cb0031f41f046c4cbcbc5fd607a 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/a1/17936205177cb0031f41f046c4cbcbc5fd607a 1970-01-01 00:00:00 +0000 differ === added file 'vim/bundle/ack.vim/.git/objects/bc/3667f7a5af9d006cae98ee23c4e756774a679f' Binary files vim/bundle/ack.vim/.git/objects/bc/3667f7a5af9d006cae98ee23c4e756774a679f 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/bc/3667f7a5af9d006cae98ee23c4e756774a679f 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/bd' === removed file 'vim/bundle/ack.vim/.git/objects/bd/ef32278f95613006e2d898ba546cd35ca2364b' Binary files vim/bundle/ack.vim/.git/objects/bd/ef32278f95613006e2d898ba546cd35ca2364b 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/bd/ef32278f95613006e2d898ba546cd35ca2364b 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/c2' === removed file 'vim/bundle/ack.vim/.git/objects/c2/e870671179d22c1c1836ecdaa7f1b5c3321112' Binary files vim/bundle/ack.vim/.git/objects/c2/e870671179d22c1c1836ecdaa7f1b5c3321112 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/c2/e870671179d22c1c1836ecdaa7f1b5c3321112 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/ca' === added file 'vim/bundle/ack.vim/.git/objects/ca/d259f440050e40568a8c1acb6ba26cdd5b3b68' Binary files vim/bundle/ack.vim/.git/objects/ca/d259f440050e40568a8c1acb6ba26cdd5b3b68 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/ca/d259f440050e40568a8c1acb6ba26cdd5b3b68 2015-02-13 09:51:26 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/d2' === removed file 'vim/bundle/ack.vim/.git/objects/d2/9718a9d1152956416d8c2b909c0934e10c1e21' Binary files vim/bundle/ack.vim/.git/objects/d2/9718a9d1152956416d8c2b909c0934e10c1e21 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/d2/9718a9d1152956416d8c2b909c0934e10c1e21 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/ack.vim/.git/objects/da' === removed file 'vim/bundle/ack.vim/.git/objects/da/3ea9ab2bb6d292dbafa6ab3aab8ee49d00eabf' Binary files vim/bundle/ack.vim/.git/objects/da/3ea9ab2bb6d292dbafa6ab3aab8ee49d00eabf 2015-08-25 11:57:14 +0000 and vim/bundle/ack.vim/.git/objects/da/3ea9ab2bb6d292dbafa6ab3aab8ee49d00eabf 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/ack.vim/.git/objects/e6' === added file 'vim/bundle/ack.vim/.git/objects/e6/7e719ca8a06fdd5ae1032f44d0ce80f01e39df' Binary files vim/bundle/ack.vim/.git/objects/e6/7e719ca8a06fdd5ae1032f44d0ce80f01e39df 1970-01-01 00:00:00 +0000 and vim/bundle/ack.vim/.git/objects/e6/7e719ca8a06fdd5ae1032f44d0ce80f01e39df 2015-02-13 09:51:26 +0000 differ === modified file 'vim/bundle/ack.vim/.git/packed-refs' --- vim/bundle/ack.vim/.git/packed-refs 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/.git/packed-refs 2015-02-13 09:51:26 +0000 @@ -1,2 +1,2 @@ # pack-refs with: peeled fully-peeled -923507cadc0b8b73b238db67a28a7ed00194f319 refs/remotes/origin/master +bc3667f7a5af9d006cae98ee23c4e756774a679f refs/remotes/origin/master === modified file 'vim/bundle/ack.vim/.git/refs/heads/master' --- vim/bundle/ack.vim/.git/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/.git/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -923507cadc0b8b73b238db67a28a7ed00194f319 +bc3667f7a5af9d006cae98ee23c4e756774a679f === modified file 'vim/bundle/ack.vim/.git/shallow' --- vim/bundle/ack.vim/.git/shallow 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/.git/shallow 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -923507cadc0b8b73b238db67a28a7ed00194f319 +bc3667f7a5af9d006cae98ee23c4e756774a679f === modified file 'vim/bundle/ack.vim/README.md' --- vim/bundle/ack.vim/README.md 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/README.md 2015-02-13 09:51:26 +0000 @@ -4,7 +4,7 @@ This plugin was designed as a Vim frontend for the Perl module [App::Ack]. Ack can be used as a replacement for 99% of the uses of _grep_. The plugin allows -you to run ack from Vim, and shows the results in a split window. +you to run ack from vim, and shows the results in a split window. But here's a little secret for the Vim-seasoned: it's just a light wrapper for Vim's [grepprg] and the [quickfix] window for match results. This makes it easy @@ -28,21 +28,13 @@ many and you probably already have a preferred one, but a few examples for your copy-and-paste convenience: -#### Pathogen - - $ git clone https://github.com/mileszs/ack.vim.git ~/.vim/bundle/ack.vim - #### Vundle -```vim -Plugin 'mileszs/ack.vim' -``` + Plugin 'mileszs/ack.vim' #### NeoBundle -```vim -NeoBundle 'mileszs/ack.vim' -``` + NeoBundle 'mileszs/ack.vim' #### Manual (not recommended) @@ -127,16 +119,63 @@ ## Changelog -Please see [the Github releases page][releases]. +Please see [the Github releases page][releases]. (Soon, need privs to edit old +release notes :grin:) + +### 1.0 + +* Remove support to ack 1.x +* Start to use a Changelog +* Use `autoload` directory to define functions, instead of `plugin`. +* Add option to auto fold the results(`g:ack_autofold_results`) +* Improve documentation, list all options and shortcuts +* Improve highlight option to work when passes directories or use quotes. +* Add g:ack_mapping +* Add g:ack_default_options +* Add a help toggle `?`(like NERDTree) + +### 1.0.1 + +* Fixes #124. Bug with `g:ack_autofold_results` + +### 1.0.2 + +* Add compatibility with [vim-dispatch]. + +### 1.0.3 + +* Fixes #127. Use `&l:hlsearch` instead of `v:hlsearch` to keep compatibility +with versions that does not have this variable. + +### 1.0.4 + +* Fixes #128. Always apply mappings, even when using vim-dispatch. + +### 1.0.5 + +* Fixes #128. Fixes the `errorformat` for ack when using vim-dispatch. +* Do not use vim-dispatch by default. To use vim-dispatch must set +`g:ack_use_dispatch`. + +### 1.0.6 + +* Fixes highlight function to work when user passes options. Ex.: Ack -i test + Thank's @mannih. (#131, #134) + +### 1.0.7 + +* Fixes highlight function to work when passes more than one option, or options +with double dashes(--option) Thank's to @MiguelLatorre and @mannih + +### 1.0.8 + +* Fixes (again) highlight, now using negative look behind. +* Change mappings `o` and `O` to behave as documented ### 1.0.9 (unreleased) * Fix location list and layout of quickfix when using Dispatch (#154) * Fix the quick help overlay clobbering the list mappings -* Fix `:AckFile` when using Dispatch -* Restore original `'makeprg'` and `'errorformat'` when using Dispatch -* Arrow keys also work for auto-preview (#158) -* Internal refactoring and clean-up ## Credits === modified file 'vim/bundle/ack.vim/autoload/ack.vim' --- vim/bundle/ack.vim/autoload/ack.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/autoload/ack.vim 2015-02-13 09:51:26 +0000 @@ -7,221 +7,174 @@ let g:ack_use_dispatch = 0 end -"----------------------------------------------------------------------------- -" Public API -"----------------------------------------------------------------------------- - -function! ack#Ack(cmd, args) "{{{ - call s:Init(a:cmd) +function! ack#Ack(cmd, args) redraw - - " Local values that we'll temporarily set as options when searching - let l:grepprg = g:ackprg - let l:grepformat = '%f:%l:%c:%m,%f:%l:%m' " Include column number - - " Strip some options that are meaningless for path search and set match - " format accordingly. - if s:SearchingFilepaths() - let l:grepprg = substitute(l:grepprg, '-H\|--column', '', 'g') - let l:grepformat = '%f' + let l:ackprg_run = g:ackprg + + if a:cmd =~# '^l' + let l:using_loclist = 1 + else + let l:using_loclist = 0 + endif + + if g:ack_use_dispatch && l:using_loclist + call s:Warn('Dispatch does not support location lists! Proceeding with quickfix...') + let l:using_loclist = 0 + endif + + if l:using_loclist + let s:handler = g:ack_lhandler + let s:apply_mappings = g:ack_apply_lmappings + let l:wintype = 'l' + else + let s:handler = g:ack_qhandler + let s:apply_mappings = g:ack_apply_qmappings + let l:wintype = 'c' endif " If no pattern is provided, search for the word under the cursor - let l:grepargs = empty(a:args) ? expand("") : a:args . join(a:000, ' ') - - " NOTE: we escape special chars, but not everything using shellescape to - " allow for passing arguments etc - let l:escaped_args = escape(l:grepargs, '|#%') + if empty(a:args) + let l:grepargs = expand("") + else + let l:grepargs = a:args . join(a:000, ' ') + end + + " Format, used to manage column jump + if a:cmd =~# '-g$' + let g:ackformat="%f" + let l:ackprg_run = substitute(l:ackprg_run, '-H\|--column', '', 'g') + else + let g:ackformat="%f:%l:%c:%m,%f:%l:%m" + endif + + let grepprg_bak = &grepprg + let grepformat_bak = &grepformat + let &grepprg=l:ackprg_run + let &grepformat=g:ackformat echo "Searching ..." - if g:ack_use_dispatch - call s:SearchWithDispatch(l:grepprg, l:escaped_args, l:grepformat) - else - call s:SearchWithGrep(a:cmd, l:grepprg, l:escaped_args, l:grepformat) - endif + try + " NOTE: we escape special chars, but not everything using shellescape to + " allow for passing arguments etc + if g:ack_use_dispatch + let &l:errorformat = g:ackformat + let &l:makeprg=g:ackprg." " . escape(l:grepargs, '|#%') + Make + else + silent execute a:cmd . " " . escape(l:grepargs, '|#%') + endif + finally + let &grepprg=grepprg_bak + let &grepformat=grepformat_bak + endtry " Dispatch has no callback mechanism currently, we just have to display the " list window early and wait for it to populate :-/ - call ack#ShowResults() - call s:Highlight(l:grepargs) -endfunction "}}} - -function! ack#AckFromSearch(cmd, args) "{{{ + call ack#show_results(l:wintype) + call s:highlight(l:grepargs) +endfunction + +function! ack#show_results(wintype) + execute s:handler + call s:apply_maps(a:wintype) + redraw! +endfunction + +" wintype param is either 'l' for location list, or 'c' for quickfix +function! s:apply_maps(wintype) + let l:closemap = ':' . a:wintype . 'close' + + let g:ack_mappings.q = l:closemap + + execute 'nnoremap ? :call ack#quick_help(' . string(a:wintype) . ')' + + if s:apply_mappings && &ft == "qf" + if g:ack_autoclose + " We just map the 'go' and 'gv' mappings to close on autoclose, wtf? + for key_map in items(g:ack_mappings) + execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1) . l:closemap) + endfor + + execute "nnoremap " . l:closemap + else + for key_map in items(g:ack_mappings) + execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1)) + endfor + endif + + if exists("g:ackpreview") " if auto preview in on, remap j and k keys + execute "nnoremap j j" + execute "nnoremap k k" + endif + endif +endfunction + +function! ack#quick_help(wintype) + execute "edit " . globpath(&rtp, "doc/ack_quick_help.txt") + + silent normal gg + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal noswapfile + setlocal nobuflisted + setlocal nomodifiable + setlocal filetype=help + setlocal nonumber + setlocal norelativenumber + setlocal nowrap + setlocal foldlevel=20 + setlocal foldmethod=diff + + exec 'nnoremap ? :q!:call ack#show_results(' . string(a:wintype) . ')' +endfunction + +function! s:highlight(args) + if !g:ackhighlight + return + endif + + let @/ = matchstr(a:args, "\\v(-)\@", "n") +endfunction + +function! ack#AckFromSearch(cmd, args) let search = getreg('/') " translate vim regular expression to perl regular expression. let search = substitute(search, '\(\\<\|\\>\)', '\\b', 'g') call ack#Ack(a:cmd, '"' . search . '" ' . a:args) -endfunction "}}} - -function! ack#AckHelp(cmd, args) "{{{ +endfunction + +function! s:GetDocLocations() + let dp = '' + for p in split(&rtp, ',') + let p = p . '/doc/' + if isdirectory(p) + let dp = p . '*.txt ' . dp + endif + endfor + + return dp +endfunction + +function! ack#AckHelp(cmd, args) let args = a:args . ' ' . s:GetDocLocations() call ack#Ack(a:cmd, args) -endfunction "}}} +endfunction -function! ack#AckWindow(cmd, args) "{{{ +function! ack#AckWindow(cmd, args) let files = tabpagebuflist() - " remove duplicated filenames (files appearing in more than one window) let files = filter(copy(sort(files)), 'index(files,v:val,v:key+1)==-1') call map(files, "bufname(v:val)") - " remove unnamed buffers as quickfix (empty strings before shellescape) call filter(files, 'v:val != ""') - " expand to full path (avoid problems with cd/lcd in au QuickFixCmdPre) let files = map(files, "shellescape(fnamemodify(v:val, ':p'))") let args = a:args . ' ' . join(files) - call ack#Ack(a:cmd, args) -endfunction "}}} - -function! ack#ShowResults() "{{{ - let l:handler = s:UsingLocList() ? g:ack_lhandler : g:ack_qhandler - execute l:handler - call s:ApplyMappings() - redraw! -endfunction "}}} - -"----------------------------------------------------------------------------- -" Private API -"----------------------------------------------------------------------------- - -function! s:ApplyMappings() "{{{ - if !s:UsingListMappings() || &filetype != 'qf' - return - endif - - let l:wintype = s:UsingLocList() ? 'l' : 'c' - let l:closemap = ':' . l:wintype . 'close' - let g:ack_mappings.q = l:closemap - - nnoremap ? :call QuickHelp() - - if g:ack_autoclose - " We just map the 'go' and 'gv' mappings to close on autoclose, wtf? - for key_map in items(g:ack_mappings) - execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1) . l:closemap) - endfor - - execute "nnoremap " . l:closemap - else - for key_map in items(g:ack_mappings) - execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1)) - endfor - endif - - if exists("g:ackpreview") " if auto preview in on, remap j and k keys - nnoremap j j - nnoremap k k - nmap j - nmap k - endif -endfunction "}}} - -function! s:GetDocLocations() "{{{ - let dp = '' - for p in split(&rtp, ',') - let p = p . '/doc/' - if isdirectory(p) - let dp = p . '*.txt ' . dp - endif - endfor - - return dp -endfunction "}}} - -function! s:Highlight(args) "{{{ - if !g:ackhighlight - return - endif - - let @/ = matchstr(a:args, "\\v(-)\@", "n") -endfunction "}}} - -" Initialize state for an :Ack* or :LAck* search -function! s:Init(cmd) "{{{ - let s:searching_filepaths = (a:cmd =~# '-g$') ? 1 : 0 - let s:using_loclist = (a:cmd =~# '^l') ? 1 : 0 - - if g:ack_use_dispatch && s:using_loclist - call s:Warn('Dispatch does not support location lists! Proceeding with quickfix...') - let s:using_loclist = 0 - endif -endfunction "}}} - -function! s:QuickHelp() "{{{ - execute 'edit' globpath(&rtp, 'doc/ack_quick_help.txt') - - silent normal gg - setlocal buftype=nofile bufhidden=hide nobuflisted - setlocal nomodifiable noswapfile - setlocal filetype=help - setlocal nonumber norelativenumber nowrap - setlocal foldmethod=diff foldlevel=20 - - nnoremap ? :q!:call ack#ShowResults() -endfunction "}}} - -function! s:SearchWithDispatch(grepprg, grepargs, grepformat) "{{{ - let l:makeprg_bak = &l:makeprg - let l:errorformat_bak = &l:errorformat - - " We don't execute a :grep command for Dispatch, so add -g here instead - if s:SearchingFilepaths() - let l:grepprg = a:grepprg . ' -g' - else - let l:grepprg = a:grepprg - endif - - try - let &l:makeprg = l:grepprg . ' ' . a:grepargs - let &l:errorformat = a:grepformat - - Make - finally - let &l:makeprg = l:makeprg_bak - let &l:errorformat = l:errorformat_bak - endtry -endfunction "}}} - -function! s:SearchWithGrep(grepcmd, grepprg, grepargs, grepformat) "{{{ - let l:grepprg_bak = &l:grepprg - let l:grepformat_bak = &grepformat - - try - let &l:grepprg = a:grepprg - let &grepformat = a:grepformat - - silent execute a:grepcmd a:grepargs - finally - let &l:grepprg = l:grepprg_bak - let &grepformat = l:grepformat_bak - endtry -endfunction "}}} - -" Are we finding matching files, not lines? (the -g option -- :AckFile) -function! s:SearchingFilepaths() "{{{ - return get(s:, 'searching_filepaths', 0) -endfunction "}}} - -" Predicate for whether mappings are enabled for list type of current search. -function! s:UsingListMappings() "{{{ - if s:UsingLocList() - return g:ack_apply_lmappings - else - return g:ack_apply_qmappings - endif -endfunction "}}} - -" Were we invoked with a :LAck command? -function! s:UsingLocList() "{{{ - return get(s:, 'using_loclist', 0) -endfunction "}}} - -function! s:Warn(msg) "{{{ +endfunction + +function! s:Warn(msg) echohl WarningMsg | echomsg 'Ack: ' . a:msg | echohl None -endf "}}} - -" vim:set et sw=2 ts=2 tw=78 fdm=marker +endf === modified file 'vim/bundle/ack.vim/doc/ack.txt' --- vim/bundle/ack.vim/doc/ack.txt 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/doc/ack.txt 2015-02-13 09:51:26 +0000 @@ -84,23 +84,18 @@ Default for ubuntu: "ack-grep" Default for other systems: "ack" -Use this option to specify the search command and its default arguments. +Use this option to specify the ack command and its options Example: > - let g:ackprg = "ag --vimgrep" + let g:ackprg = "other-bin-ack" < *g:ack_default_options* g:ack_default_options Default: " -s -H --nocolor --nogroup --column" -Use this option to specify the default arguments given to `ack`. This is only -used if |g:ackprg| has not been customized from the default--if you are using -a custom search program instead of Ack, set your preferred options in -|g:ackprg|. - -NOTE: This option may be deprecated in the future. ~ +Use this option to specify the options used by ack Example: > === modified file 'vim/bundle/ack.vim/plugin/ack.vim' --- vim/bundle/ack.vim/plugin/ack.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/ack.vim/plugin/ack.vim 2015-02-13 09:51:26 +0000 @@ -1,7 +1,3 @@ -if exists('g:loaded_ack') - finish -endif - if !exists("g:ack_default_options") let g:ack_default_options = " -s -H --nocolor --nogroup --column" endif @@ -71,9 +67,5 @@ command! -bang -nargs=* -complete=file AckFile call ack#Ack('grep -g', ) command! -bang -nargs=* -complete=help AckHelp call ack#AckHelp('grep', ) command! -bang -nargs=* -complete=help LAckHelp call ack#AckHelp('lgrep', ) -command! -bang -nargs=* AckWindow call ack#AckWindow('grep', ) -command! -bang -nargs=* LAckWindow call ack#AckWindow('lgrep', ) - -let g:loaded_ack = 1 - -" vim:set et sw=2 ts=2 tw=78 fdm=marker +command! -bang -nargs=* -complete=help AckWindow call ack#AckWindow('grep', ) +command! -bang -nargs=* -complete=help LAckWindow call ack#AckWindow('lgrep', ) === modified file 'vim/bundle/edc-support/.git/index' Binary files vim/bundle/edc-support/.git/index 2015-08-25 11:57:14 +0000 and vim/bundle/edc-support/.git/index 2015-02-13 09:51:26 +0000 differ === modified file 'vim/bundle/edc-support/.git/logs/HEAD' --- vim/bundle/edc-support/.git/logs/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/edc-support/.git/logs/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 d076bf6a932657afc84c1bb1cae9fe395d560993 Jan Pobrislo 1440501708 +0200 clone: from https://github.com/vim-scripts/edc-support +0000000000000000000000000000000000000000 d076bf6a932657afc84c1bb1cae9fe395d560993 Jan Pobrislo 1423821004 +0100 clone: from https://github.com/vim-scripts/edc-support === modified file 'vim/bundle/edc-support/.git/logs/refs/heads/master' --- vim/bundle/edc-support/.git/logs/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/edc-support/.git/logs/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 d076bf6a932657afc84c1bb1cae9fe395d560993 Jan Pobrislo 1440501708 +0200 clone: from https://github.com/vim-scripts/edc-support +0000000000000000000000000000000000000000 d076bf6a932657afc84c1bb1cae9fe395d560993 Jan Pobrislo 1423821004 +0100 clone: from https://github.com/vim-scripts/edc-support === modified file 'vim/bundle/edc-support/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/edc-support/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/edc-support/.git/logs/refs/remotes/origin/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 d076bf6a932657afc84c1bb1cae9fe395d560993 Jan Pobrislo 1440501708 +0200 clone: from https://github.com/vim-scripts/edc-support +0000000000000000000000000000000000000000 d076bf6a932657afc84c1bb1cae9fe395d560993 Jan Pobrislo 1423821004 +0100 clone: from https://github.com/vim-scripts/edc-support === modified file 'vim/bundle/py-coverage/.git/index' Binary files vim/bundle/py-coverage/.git/index 2015-08-25 11:57:14 +0000 and vim/bundle/py-coverage/.git/index 2015-02-13 09:51:26 +0000 differ === modified file 'vim/bundle/py-coverage/.git/logs/HEAD' --- vim/bundle/py-coverage/.git/logs/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/py-coverage/.git/logs/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 47f8739bc27e65f1063fd39a841805e523e3e5e6 Jan Pobrislo 1440501714 +0200 clone: from https://github.com/vim-scripts/py-coverage +0000000000000000000000000000000000000000 47f8739bc27e65f1063fd39a841805e523e3e5e6 Jan Pobrislo 1423821006 +0100 clone: from https://github.com/vim-scripts/py-coverage === modified file 'vim/bundle/py-coverage/.git/logs/refs/heads/master' --- vim/bundle/py-coverage/.git/logs/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/py-coverage/.git/logs/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 47f8739bc27e65f1063fd39a841805e523e3e5e6 Jan Pobrislo 1440501714 +0200 clone: from https://github.com/vim-scripts/py-coverage +0000000000000000000000000000000000000000 47f8739bc27e65f1063fd39a841805e523e3e5e6 Jan Pobrislo 1423821006 +0100 clone: from https://github.com/vim-scripts/py-coverage === modified file 'vim/bundle/py-coverage/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/py-coverage/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/py-coverage/.git/logs/refs/remotes/origin/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 47f8739bc27e65f1063fd39a841805e523e3e5e6 Jan Pobrislo 1440501714 +0200 clone: from https://github.com/vim-scripts/py-coverage +0000000000000000000000000000000000000000 47f8739bc27e65f1063fd39a841805e523e3e5e6 Jan Pobrislo 1423821006 +0100 clone: from https://github.com/vim-scripts/py-coverage === modified file 'vim/bundle/splice/.git/index' Binary files vim/bundle/splice/.git/index 2015-08-25 11:57:14 +0000 and vim/bundle/splice/.git/index 2015-02-13 09:51:26 +0000 differ === modified file 'vim/bundle/splice/.git/logs/HEAD' --- vim/bundle/splice/.git/logs/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/splice/.git/logs/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 4d322d823563f6fd2d72c129b1e99f5a98060fa8 Jan Pobrislo 1440501719 +0200 clone: from https://github.com/sjl/splice.vim.git +0000000000000000000000000000000000000000 4d322d823563f6fd2d72c129b1e99f5a98060fa8 Jan Pobrislo 1423821007 +0100 clone: from https://github.com/sjl/splice.vim.git === modified file 'vim/bundle/splice/.git/logs/refs/heads/master' --- vim/bundle/splice/.git/logs/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/splice/.git/logs/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 4d322d823563f6fd2d72c129b1e99f5a98060fa8 Jan Pobrislo 1440501719 +0200 clone: from https://github.com/sjl/splice.vim.git +0000000000000000000000000000000000000000 4d322d823563f6fd2d72c129b1e99f5a98060fa8 Jan Pobrislo 1423821007 +0100 clone: from https://github.com/sjl/splice.vim.git === modified file 'vim/bundle/splice/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/splice/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/splice/.git/logs/refs/remotes/origin/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 4d322d823563f6fd2d72c129b1e99f5a98060fa8 Jan Pobrislo 1440501719 +0200 clone: from https://github.com/sjl/splice.vim.git +0000000000000000000000000000000000000000 4d322d823563f6fd2d72c129b1e99f5a98060fa8 Jan Pobrislo 1423821007 +0100 clone: from https://github.com/sjl/splice.vim.git === modified file 'vim/bundle/syntastic/.git/index' Binary files vim/bundle/syntastic/.git/index 2015-08-25 11:57:14 +0000 and vim/bundle/syntastic/.git/index 2015-02-13 09:51:26 +0000 differ === modified file 'vim/bundle/syntastic/.git/logs/HEAD' --- vim/bundle/syntastic/.git/logs/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/.git/logs/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 47c70b3e1e388d8f9cc7c6d9687efc047df843ac Jan Pobrislo 1440501786 +0200 clone: from https://github.com/scrooloose/syntastic.git +0000000000000000000000000000000000000000 dde4a9be9cf2461ee97c71de4a7a7998da0235dd Jan Pobrislo 1423821010 +0100 clone: from https://github.com/scrooloose/syntastic.git === modified file 'vim/bundle/syntastic/.git/logs/refs/heads/master' --- vim/bundle/syntastic/.git/logs/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/.git/logs/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 47c70b3e1e388d8f9cc7c6d9687efc047df843ac Jan Pobrislo 1440501786 +0200 clone: from https://github.com/scrooloose/syntastic.git +0000000000000000000000000000000000000000 dde4a9be9cf2461ee97c71de4a7a7998da0235dd Jan Pobrislo 1423821010 +0100 clone: from https://github.com/scrooloose/syntastic.git === modified file 'vim/bundle/syntastic/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/syntastic/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/.git/logs/refs/remotes/origin/HEAD 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 47c70b3e1e388d8f9cc7c6d9687efc047df843ac Jan Pobrislo 1440501786 +0200 clone: from https://github.com/scrooloose/syntastic.git +0000000000000000000000000000000000000000 dde4a9be9cf2461ee97c71de4a7a7998da0235dd Jan Pobrislo 1423821010 +0100 clone: from https://github.com/scrooloose/syntastic.git === added file 'vim/bundle/syntastic/.git/objects/pack/pack-087122381871f05d215633922fa48c36d57998d9.idx' Binary files vim/bundle/syntastic/.git/objects/pack/pack-087122381871f05d215633922fa48c36d57998d9.idx 1970-01-01 00:00:00 +0000 and vim/bundle/syntastic/.git/objects/pack/pack-087122381871f05d215633922fa48c36d57998d9.idx 2015-02-13 09:51:26 +0000 differ === added file 'vim/bundle/syntastic/.git/objects/pack/pack-087122381871f05d215633922fa48c36d57998d9.pack' Binary files vim/bundle/syntastic/.git/objects/pack/pack-087122381871f05d215633922fa48c36d57998d9.pack 1970-01-01 00:00:00 +0000 and vim/bundle/syntastic/.git/objects/pack/pack-087122381871f05d215633922fa48c36d57998d9.pack 2015-02-13 09:51:26 +0000 differ === removed file 'vim/bundle/syntastic/.git/objects/pack/pack-c3e1d36016ad2a06e1ccc1a719fae0b6c5c62b29.idx' Binary files vim/bundle/syntastic/.git/objects/pack/pack-c3e1d36016ad2a06e1ccc1a719fae0b6c5c62b29.idx 2015-08-25 11:57:14 +0000 and vim/bundle/syntastic/.git/objects/pack/pack-c3e1d36016ad2a06e1ccc1a719fae0b6c5c62b29.idx 1970-01-01 00:00:00 +0000 differ === removed file 'vim/bundle/syntastic/.git/objects/pack/pack-c3e1d36016ad2a06e1ccc1a719fae0b6c5c62b29.pack' Binary files vim/bundle/syntastic/.git/objects/pack/pack-c3e1d36016ad2a06e1ccc1a719fae0b6c5c62b29.pack 2015-08-25 11:57:14 +0000 and vim/bundle/syntastic/.git/objects/pack/pack-c3e1d36016ad2a06e1ccc1a719fae0b6c5c62b29.pack 1970-01-01 00:00:00 +0000 differ === modified file 'vim/bundle/syntastic/.git/packed-refs' --- vim/bundle/syntastic/.git/packed-refs 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/.git/packed-refs 2015-02-13 09:51:26 +0000 @@ -1,2 +1,2 @@ # pack-refs with: peeled fully-peeled -47c70b3e1e388d8f9cc7c6d9687efc047df843ac refs/remotes/origin/master +dde4a9be9cf2461ee97c71de4a7a7998da0235dd refs/remotes/origin/master === modified file 'vim/bundle/syntastic/.git/refs/heads/master' --- vim/bundle/syntastic/.git/refs/heads/master 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/.git/refs/heads/master 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -47c70b3e1e388d8f9cc7c6d9687efc047df843ac +dde4a9be9cf2461ee97c71de4a7a7998da0235dd === modified file 'vim/bundle/syntastic/.git/shallow' --- vim/bundle/syntastic/.git/shallow 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/.git/shallow 2015-02-13 09:51:26 +0000 @@ -1,1 +1,1 @@ -47c70b3e1e388d8f9cc7c6d9687efc047df843ac +dde4a9be9cf2461ee97c71de4a7a7998da0235dd === modified file 'vim/bundle/syntastic/CONTRIBUTING.md' --- vim/bundle/syntastic/CONTRIBUTING.md 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/CONTRIBUTING.md 2015-02-13 09:51:26 +0000 @@ -40,8 +40,8 @@ Before you consider adding features to syntastic, _please_ spend a few minutes (re-)reading the latest version of the [manual][1]. Syntastic -is changing rapidly at times, and it's quite possible that some features -you want to add exist already. +is changing rapidly at times, and it's quite possible that some of the +features you want to add exist already. To submit a patch: @@ -54,7 +54,7 @@ Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say. -Also, make sure to update the manual whenever applicable. Nobody can use +Also make sure to update the manual whenever applicable. Nobody can use features that aren't documented. === modified file 'vim/bundle/syntastic/README.markdown' --- vim/bundle/syntastic/README.markdown 2015-08-25 11:57:14 +0000 +++ vim/bundle/syntastic/README.markdown 2015-02-13 09:51:26 +0000 @@ -29,15 +29,14 @@ 4.3. [Are there any local checkers for HTML5 that I can use with syntastic?](#faqhtml5) 4.4. [The `perl` checker has stopped working...](#faqperl) 4.5. [What happened to the `rustc` checker?](#faqrust) -4.6. [What happened to the `xcrun` checker?](#faqxcrun) -4.7. [I run a checker and the location list is not updated...](#faqloclist) -4.7. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) -4.8. [How can I pass additional arguments to a checker?](#faqargs) -4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) -4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle) -4.11. [I have enabled multiple checkers for the current filetype. How can I display all errors from all checkers together?](#faqaggregate) -4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) -4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) +4.6. [I run a checker and the location list is not updated...](#faqloclist) +4.6. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) +4.7. [How can I pass additional arguments to a checker?](#faqargs) +4.8. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) +4.9. [What is the difference between syntax checkers and style checkers?](#faqstyle) +4.10. [I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?](#faqaggregate) +4.11. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) +4.12. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) 5. [Resources](#otherresources) - - - @@ -52,23 +51,18 @@ are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them. -At the time of this writing, syntastic has checking plugins for ActionScript, -Ada, API Blueprint, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, -C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, -DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, -Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, -Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, -Nix, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable -Object, OS X and iOS property lists, Puppet, Python, QML, R, Racket, Relax NG, -reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, -Stylus, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, -XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3] -for details about the corresponding supported checkers. - -A number of third-party Vim plugins also provide checkers for syntastic, -for example: [omnisharp-vim][25], [rust.vim][12], [syntastic-extras][26], -[syntastic-more][27], [vim-crystal][29], [vim-eastwood][28], and -[vim-swift][24]. +At the time of this writing, syntax checking plugins exist for ActionScript, +Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, +Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, +Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, +Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, +LISP, LLVM intermediate language, Lua, Markdown, MATLAB, NASM, Objective-C, +Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and +iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM +spec, Ruby, SASS/SCSS, Scala, Slim, Swift, Tcl, TeX, Texinfo, Twig, TypeScript, +Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope page +templates, and zsh. See the [wiki][3] for details about the corresponding +supported checkers. Below is a screenshot showing the methods that Syntastic uses to display syntax errors. Note that, in practise, you will only have a subset of these methods @@ -159,10 +153,10 @@ ## 3\. Recommended settings -Syntastic has numerous options that can be configured, and the defaults -are not particularly well suitable for new users. It is recommended -that you start by adding the following lines to your `vimrc` file, and -return to them after reading the manual (see `:help syntastic` in Vim): +Syntastic has a large number of options that can be configured, and the +defaults are not particularly well suitable for new users. It is recommended +that you start by adding the following lines to your `vimrc` file, and return +to them after reading the manual (see `:help syntastic` in Vim): ```vim set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} @@ -189,32 +183,10 @@ executables must be available in your `$PATH`. Symbolic links are okay though. You can see syntastic's idea of available checkers by running `:SyntasticInfo`. -A second probable reason is that none of the available checkers are -enabled. Syntastic comes preconfigured with a default list of enabled checkers -per filetype, but this list is kept short in order to prevent slowing down Vim -or trying to run conflicting checks. The command `:SyntasticInfo` will show you -which checkers are enabled. You can tell syntastic which checkers (among the -available ones) you want to run by setting `g:syntastic__checkers` in -your `vimrc` (see [below](#faqcheckers)). - -A third possible reason is that the `$PATH` seen by syntastic might not be same -as the `$PATH` in your login shell. Syntastic runs checkers using the shell -pointed to by Vim's `shell` (or by `g:syntastic_shell`, if set), and that's the -shell you need to configure to set the proper `$PATH` and environment variables -for your checkers. You can see syntastic's idea of `$PATH` by running -```vim -:echo syntastic#util#system('echo "$PATH"') -``` -on UNIX and Mac OS-X systems, or -```vim -:echo syntastic#util#system('echo %PATH%') -``` -on Windows. - -Finally, another reason it could fail is that either the command line options -or the error output for a syntax checker may have changed. In this case, make -sure you have the latest version of the syntax checker installed. If it still -fails then post an [issue][4] - or better yet, create a pull request. +Another reason it could fail is that either the command line options or the +error output for a syntax checker may have changed. In this case, make sure you +have the latest version of the syntax checker installed. If it still fails then +create an issue - or better yet, create a pull request. @@ -232,10 +204,8 @@ [HTML Tidy][18] has a fork named [HTML Tidy for HTML5][19]. It's a drop in replacement, and syntastic can use it without changes. Just install it -somewhere and point `g:syntastic_html_tidy_exec` to its executable: -```vim -let g:syntastic_html_tidy_exec = 'tidy5' -``` +somewhere and point `g:syntastic_html_tidy_exec` to its executable. + Alternatively, you can install [vnu.jar][21] from the [validator.nu][20] project and run it as a [HTTP server][23]: ```sh @@ -266,21 +236,14 @@ __4.5. Q. What happened to the `rustc` checker?__ -A. It is now part of the [rust.vim][12] plugin. If you install this plugin the -checker should be picked up automatically by syntastic. - - - -__4.6. Q. What happened to the `xcrun` checker?__ - -A. The `xcrun` checker used to have a security problem and it has been removed. -A better checker for __Swift__ is part of the [vim-swift][24] plugin. If you -install this plugin the checker should be picked up automatically by syntastic. +A. It has been included in the [Rust compiler package][12]. If you have +a recent version of the Rust compiler, the checker should be picked up +automatically by syntastic. -__4.7. Q. I run a checker and the location list is not updated...__ -__4.7. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ +__4.6. Q. I run a checker and the location list is not updated...__ +__4.6. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ A. By default the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the @@ -292,7 +255,7 @@ -__4.8. Q. How can I pass additional arguments to a checker?__ +__4.7. Q. How can I pass additional arguments to a checker?__ A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers that do can be configured using global variables. The general form of the @@ -308,7 +271,7 @@ -__4.9. Q. Syntastic supports several checkers for my filetype - how do I tell it +__4.8. Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ A. Stick a line like this in your `vimrc`: @@ -349,7 +312,7 @@ -__4.10. Q. What is the difference between syntax checkers and style checkers?__ +__4.9. Q. What is the difference between syntax checkers and style checkers?__ A. The errors and warnings they produce are highlighted differently and can be filtered by different rules, but otherwise the distinction is pretty much @@ -379,8 +342,8 @@ -__4.11. Q. I have enabled multiple checkers for the current filetype. How can I -display all errors from all checkers together?__ +__4.10. Q. I have enabled multiple checkers for the current filetype. How can I +display all of the errors from all of the checkers together?__ A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`: ```vim @@ -391,7 +354,7 @@ -__4.12. Q. How can I jump between the different errors without using the location +__4.11. Q. How can I jump between the different errors without using the location list at the bottom of the window?__ A. Vim provides several built-in commands for this. See `:help :lnext` and @@ -403,7 +366,7 @@ -__4.13. Q. The error window is closed automatically when I :quit the current buffer +__4.12. Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ A. There is no safe way to handle that situation automatically, but you can @@ -411,7 +374,7 @@ ```vim nnoremap :lclose:bdelete -cabbrev bd =(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdelete' : 'bd') +cabbrev bd lclose\|bdelete ``` @@ -441,24 +404,18 @@ [9]: http://valloric.github.io/YouCompleteMe/ [10]: http://perldoc.perl.org/perlrun.html#*-c* [11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide -[12]: https://github.com/rust-lang/rust.vim +[12]: https://github.com/rust-lang/rust/ [13]: http://www.vim.org/ [14]: https://github.com/Shougo/neobundle.vim [15]: https://github.com/MarcWeber/vim-addon-manager [16]: https://github.com/junegunn/vim-plug/ [17]: https://github.com/gmarik/Vundle.vim [18]: http://tidy.sourceforge.net/ -[19]: http://www.htacg.org/tidy-html5/ +[19]: http://w3c.github.io/tidy-html5/ [20]: http://about.validator.nu/ [21]: https://github.com/validator/validator/releases/latest [22]: https://github.com/scrooloose/syntastic/wiki/HTML%3A---validator [23]: http://validator.github.io/validator/#standalone -[24]: https://github.com/kballard/vim-swift -[25]: https://github.com/OmniSharp/omnisharp-vim -[26]: https://github.com/myint/syntastic-extras -[27]: https://github.com/roktas/syntastic-more -[28]: https://github.com/venantius/vim-eastwood -[29]: https://github.com/rhysd/vim-crystal " . string(lst[i]) - endfor - endfor - call filter(lst, 'v:val != ""') - for m in a:maps - " echo "\n" . m - call map(lst, m) - " echo "-->" . string(lst) - endfor - return lst -endfunction - -function! vimple#join(data, pattern) - let x = -1 - let lines = repeat([''], len(a:data)) - for line in a:data - if line =~ a:pattern - let lines[x] .= line - else - let x += 1 - let lines[x] = line - endif - endfor - return filter(lines, 'v:val !~ "^$"') -endfunction - -function! vimple#echoc(data) - for sets in a:data - exe "echohl " . sets[0] - exe "echon " . string(sets[1]) - endfor - echohl Normal -endfunction - -function! s:vimple_highlight(name, attrs) - if !hlexists(a:name) - silent exe "hi ".a:name." ".a:attrs - endif -endfunction - -" Solarized inspired default colours... -" Doesn't override existing user-defined colours for these highlight terms. -" Shown with case here, but actually case-insensitive within Vim. -" -" TODO: Only vaguely considered at this stage. Based on the 16 colour -" solarized pallette -" the order of applying these to echoc is important -" -function! vimple#default_colorscheme() - " Buffer List - call s:vimple_highlight('vimple_BL_Number' , 'ctermfg=4 ctermbg=8 guifg=#0087ff guibg=#1c1c1c') - call s:vimple_highlight('vimple_BL_Line' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') - call s:vimple_highlight('vimple_BL_Name' , 'ctermfg=12 ctermbg=8 guifg=#808080 guibg=#1c1c1c') - call s:vimple_highlight('vimple_BL_Unlisted' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') - call s:vimple_highlight('vimple_BL_CurrentBuffer' , 'ctermfg=14 ctermbg=0 guifg=#8a8a8a guibg=#262626') - call s:vimple_highlight('vimple_BL_AlternateBuffer' , 'ctermfg=14 ctermbg=0 guifg=#8a8a8a guibg=#262626') - " buffer active - call s:vimple_highlight('vimple_BL_Active' , 'ctermfg=12 ctermbg=0 guifg=#808080 guibg=#262626') - call s:vimple_highlight('vimple_BL_Hidden' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') - " flags - call s:vimple_highlight('vimple_BL_Current' , 'ctermfg=5 guifg=#af005f') - call s:vimple_highlight('vimple_BL_Alternate' , 'ctermfg=13 guifg=#5f5faf') - call s:vimple_highlight('vimple_BL_Modifiable' , 'ctermfg=2 guifg=#5f8700') - call s:vimple_highlight('vimple_BL_Readonly' , 'ctermfg=6 guifg=#00afaf') - call s:vimple_highlight('vimple_BL_Modified' , 'ctermfg=9 guifg=#d75f00') - call s:vimple_highlight('vimple_BL_ReadError' , 'ctermfg=1 guifg=#af0000') - - " Scriptnames - call s:vimple_highlight('vimple_SN_Number' , 'ctermfg=4 ctermbg=8 guifg=#0087ff guibg=#1c1c1c') - call s:vimple_highlight('vimple_SN_Term' , 'ctermfg=12 ctermbg=8 guifg=#808080 guibg=#1c1c1c') - - " Options - call s:vimple_highlight('vimple_OP_BoolEnabled' , 'ctermfg=12 ctermbg=8 guifg=#808080 guibg=#262626') - call s:vimple_highlight('vimple_OP_BoolDisabled' , 'ctermfg=10 ctermbg=8 guifg=#4e4e4e guibg=#1c1c1c') -endfunction - -function! vimple#tracer() - let d = {} - func d.t() - return expand('') - endfunc - echom d.t() -endfunction - -" Buffer Line Filter {{{1 -function! vimple#filter(lines, options) - let obj = {} - let obj.lines = a:lines - let obj.options = a:options - - func obj.initialize() dict - if has_key(self.options, 'new') - enew - endif - if has_key(self.options, 'msg') - let self.msg = self.options.msg - else - let self.msg = 'Filter: ' - endif - return self - endfunc - - func obj.filter() dict - let old_hls = &hlsearch - set hlsearch - call self.incremental() - let &hlsearch = old_hls - return self - endfunc - - func obj.incremental() dict - let c = '' - let self.partial = '' - while 1 - call self.update() - let c = nr2char(getchar()) - if c == "\" - break - elseif c == "\" - let self.partial = '' - call self.update() - break - elseif c == '' - let self.partial = self.partial[:-2] - else - let self.partial .= c - endif - endwhile - endfunc - - func obj.update() dict - %delete - let partial = substitute(substitute(self.partial, ' ', '.*', 'g'), '\.\*$', '', '') - if partial =~ '\.\*\$$' - let partial = substitute(partial, '\.\*\$$', '$', '') - endif - call append(0, filter(copy(self.lines), 'v:val =~ partial')) - $delete - if self.partial == '' - nohlsearch - else - exe "silent! norm! /" . partial . "\" - endif - 1 - redraw - echo self.msg . self.partial - endfunc - - return obj.initialize() -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/comparators.vim' --- vim/bundle/vimple/autoload/vimple/comparators.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/comparators.vim 1970-01-01 00:00:00 +0000 @@ -1,60 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple Sort Comparators -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple sort comparators -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/comparators.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#comparators.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#comparators -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -function! vimple#comparators#numerically(i1, i2) - let i1 = str2nr(a:i1) - let i2 = str2nr(a:i2) - return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 -endfunction - -function! vimple#comparators#termly(i1, i2) - let i1 = a:i1['term'] - let i2 = a:i2['term'] - return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 -endfunction - -function! vimple#comparators#rhsly(i1, i2) - let i1 = matchstr(a:i1['rhs'], '\c^.*\zs.*') - let i2 = matchstr(a:i2['rhs'], '\c^.*\zs.*') - return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 -endfunction - -function! vimple#comparators#lhsly(i1, i2) - let i1 = a:i1['lhs'] - let i2 = a:i2['lhs'] - return i1 == i2 ? 0 : i1 > i2 ? 1 : -1 -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/highlight.vim' --- vim/bundle/vimple/autoload/vimple/highlight.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/highlight.vim 1970-01-01 00:00:00 +0000 @@ -1,103 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :highlight builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :highlight command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/highlight.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#highlight.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#highlight -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -" TODO: Use the Numerically sort comparator for print() -" Highlight object - -function! vimple#highlight#new() - let hl = {} - let hl.__data = {} - let hl.__filter = '' - - func hl.update() dict abort - let self.__data = vimple#associate(vimple#join(vimple#redir('highlight'), '^\s\+'), - \ [['^\(\S\+\)\s*\S\+\s*\(.*\)$', '\1\t\2', '']], - \ ['split(v:val, "\t", 2)', - \ '{"term": v:val[0],' - \. '"attrs": substitute(v:val[1], "\\s\\+", " ", "g")}']) - return self - endfunc - - " takes two optional arguments: - " 1 : format - " 2 : data - func hl.to_s(...) dict - let default = "%t %a\n" - let format = a:0 && a:1 != '' ? a:1 : default - let data = a:0 > 1 ? a:2.__data : self.__data - let str = '' - let data = sort(data, 'vimple#comparators#termly') - for i in range(0, len(data) - 1) - let str .= vimple#format( - \ format, - \ { 't': ['s', data[i]['term']], - \ 'a': ['s', data[i]['attrs']]}, - \ default - \ ) - endfor - return str - endfunc - - func hl.to_l(...) dict - return self.__data - endfunc - - " only able to colour print the default to_s() output at this stage - func hl.print() dict - let str = self.to_s() - let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') - call vimple#echoc(dta) - endfunc - - func hl.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__data, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - func hl.filter_by_term(term) dict abort - return self.filter('v:val["term"] =~ "' . escape(a:term, '"') . '"') - endfunc - - func hl.sort() - return sort(self.__data, vimple#comparators#termly) - endfunc - - call hl.update() - return hl -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/history.vim' --- vim/bundle/vimple/autoload/vimple/history.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/history.vim 1970-01-01 00:00:00 +0000 @@ -1,90 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :history builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :history command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/history.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#history.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#history -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -" TODO: Use the Numerically sort comparator for print() - -function! vimple#history#new() - let hist = {} - let hist.__commands = {} - let hist.__filter = '' - - func hist.update() dict abort - let self.__commands = vimple#associate(vimple#redir('history'), - \ [['^\s*#.*', '', ''], - \ ['[^0-9]*\(\%(\d\+\)\|#\)\s*\(.*\)$', '\1-=-=\2', '']], - \ ['split(v:val, "-=-=")', '{"number": v:val[0], "command": v:val[1]}']) - return self - endfunc - - func hist.to_s(...) dict - let default = "%3n %s\n" - "let format = default - let format = a:0 && a:1 != '' ? a:1 : default - let commands = a:0 > 1 ? a:2.__commands : self.__commands - let str = '' - for i in range(0, len(commands) - 1) - let str .= vimple#format( - \ format, - \ { 'n': ['d', commands[i]['number']], - \ 's': ['s', commands[i]['command']]}, - \ default - \ ) - endfor - return str - endfunc - - " only able to colour print the default to_s() output at this stage - " Note: This is a LOT of dancing just to get coloured numbers ;) - func hist.print() dict - call self.update() - call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') - endfunc - - func hist.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__commands, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - func hist.filter_by_name(name) dict abort - return self.filter('v:val["command"] =~ "' . escape(a:name, '"') . '"') - endfunc - - call hist.update() - return hist -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/ls.vim' --- vim/bundle/vimple/autoload/vimple/ls.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/ls.vim 1970-01-01 00:00:00 +0000 @@ -1,386 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :ls builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :ls command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/ls.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#ls.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#ls -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -" TODO: Use the Numerically sort comparator for print() -" TODO: Use one s:dict instead of recreating the whole thing. Easier to debug. -" TODO: Improve alignment of line numbers of print(). - -function! vimple#ls#new() - let bl = {} - let bl.__buffers = {} - let bl.current = 0 - let bl.alternate = 0 - let bl.__filter = '' - - " public interface {{{1 - - func bl._filename(bufnum, fallback) - let bname = bufname(a:bufnum) - if bname =~ '^\s*$' - let bname = a:fallback - endif - echo '####' . bname . '#### - return bname - endfunc - - " update {{{2 - func bl.update() dict abort - let bufferlist = vimple#associate(vimple#redir('ls!'), - \ [[ '^\s*\(\d\+\)\(\s*[-u%#ah=+x ]*\)\s\+\"\(.*\)\"\s\+\(\S\+\%(\s\+\S\+\)*\)\s\+\(\d\+\)\%(\s\+.*\)\?$', - \ '\1,\2,\4,\5,\3', - \ '' ]], - \ [ 'split(v:val, ",")', - \ 'add(v:val[0:3], join(v:val[4:-1], ","))', - \ '{"number": v:val[0],' - \.'"line_text": v:val[2],' - \.'"line": v:val[3],' - \.'"name": (v:val[4] =~ ''\[.\{-}\]'' ? (bufname(v:val[0] + 0) ? bufname(v:val[0] + 0) : v:val[4]) : v:val[4]),' - \.'"listed": v:val[1] !~ "u",' - \.'"current": v:val[1] =~ "%",' - \.'"alternate": v:val[1] =~ "#",' - \.'"active": v:val[1] =~ "a",' - \.'"hidden": v:val[1] =~ "h",' - \.'"modifiable": v:val[1] !~ "-",' - \.'"readonly": v:val[1] =~ "=",' - \.'"modified": v:val[1] =~ "+",' - \.'"read_error": v:val[1] =~ "x"}' ]) - - let self.__buffers = {} - for bfr in map(copy(bufferlist), '{v:val["number"]: v:val}') - call extend(self.__buffers, bfr) - endfor - if self.__filter != '' - call filter(self.__buffers, self.__filter) - endif - - let current_l = filter(copy(bufferlist), 'v:val["current"] == 1') - let alternate_l = filter(copy(bufferlist), 'v:val["alternate"] == 1') - let self.current = len(current_l) > 0 ?current_l[0].number : 0 - let self.alternate = len(alternate_l) > 0 ? alternate_l[0].number : 0 - return self - endfun - - " to_s([format]) {{{2 - " format: When absent or empty the default value ("%3b%f\"%n\" line %l\n") - " will be used. - " Use %b, %n, %f and %l to insert the buffer number, name, flags and cursor - " line respectively . The last character will be replaced by d or s as - " required by printf(), so you can include extra flags (e.g.: %3b). - func bl.to_s(...) dict - " An empty format argument uses the default. - let default = "%3b%f\"%n\" %t %l\n" - let format = a:0 && a:1 != '' ? a:1 : default - " Apply filter. - let buffers = self.data() - - let str = '' - for key in sort(keys(buffers), 'vimple#comparators#numerically') - let str .= vimple#format( - \ format, - \ { 'b': ['d', buffers[key]['number']], - \ 'f': ['s', self.buffer_flags(buffers[key])], - \ 't': ['s', buffers[key]['line_text']], - \ 'n': ['s', buffers[key]['name']], - \ 'l': ['s', buffers[key]['line']]}, - \ default - \ ) - endfor - return str - endfunc - - " to_l {{{2 - func bl.to_l(...) dict - return values(call(self.buffers, a:000, self).__buffers) - endfunc - - " to_d {{{2 - func bl.to_d(...) dict - return call(self.buffers, a:000, self).__buffers - endfunc - - " print {{{2 - " only able to colour print the default to_s() output at this stage - func bl.print(...) dict - let bang = a:0 ? a:1 : 0 - call self.update() - "let str = self.to_s() - " following code is from hl.print() and would not work as is here - "let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') - "call vimple#echoc(dta) - let pairs = [] - let data = self.data() - let max_length = max(map(deepcopy(values(self.data())), 'len(v:val.name)')) - for buffer in sort(values(data), self.compare, self) - if !bang && !buffer.listed - continue - endif - call add(pairs, ['vimple_BL_Nnumber', printf('%3d',buffer.number)]) - if buffer.listed - call add(pairs, ['Normal', ' ']) - else - call add(pairs, ['vimple_BL_Unlisted', 'u']) - endif - if buffer.current - call add(pairs, ['vimple_BL_Current', '%']) - elseif buffer.alternate - call add(pairs, ['vimple_BL_Alternate', '#']) - else - call add(pairs, ['Normal', ' ']) - endif - if buffer.active - call add(pairs, ['vimple_BL_Active', 'a']) - elseif buffer.hidden - call add(pairs, ['vimple_BL_Hidden', 'h']) - else - call add(pairs, ['Normal', ' ']) - endif - if !buffer.modifiable - call add(pairs, ['vimple_BL_Modifiable', '-']) - elseif buffer.readonly - call add(pairs, ['vimple_BL_Readonly', '=']) - else - call add(pairs, ['Normal', ' ']) - endif - if buffer.read_error - call add(pairs, ['vimple_BL_RearError', 'x']) - elseif buffer.modified - call add(pairs, ['vimple_BL_Modified', '+']) - else - call add(pairs, ['Normal', ' ']) - endif - call add(pairs, ['Normal', ' ']) - call add(pairs, [ - \ buffer.current ? - \ 'vimple_BL_CurrentBuffer' : - \ buffer.alternate ? - \ 'vimple_BL_AlternateBuffer' : - \ 'Normal', - \ '"' . buffer.name . '"']) - let spaces = len(buffer.name) >= 29 ? 1 : 29 - len(buffer.name) - call add(pairs, ['Normal', - \ repeat(' ', spaces)]) - call add(pairs, ['vimple_BL_Line', - \ buffer.line_text . ' ']) - call add(pairs, ['vimple_BL_Line', - \ buffer.line . "\" - \ ]) - endfor - call vimple#echoc(pairs) - " Remove the last . Why? - let pairs[-1][1] = pairs[-1][-1][:-2] - return pairs - endfunc - - " compare {{{3 - func bl.compare(k1, k2) dict - let k1 = a:k1.number * 1 - let k2 = a:k2.number * 1 - return k1 == k2 ? 0 : k1 > k2 ? 1 : -1 - endfunc - - " filter {{{2 - func bl.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__buffers, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - " get_filter {{{3 - func bl.get_filter() dict - return string(self.__filter) - endfunc - - " filter_add_or {{{3 - func bl.filter_add_or(filter) dict - let self.__filter .= ' || ' . a:filter - endfunc - - " filter_add_and {{{3 - func bl.filter_add_and(filter) dict - let self.__filter .= ' && ' . a:filter - endfunc - - " merge {{{3 - func bl.merge(bl) dict - let bl = deepcopy(self) - call extend(bl.__buffers, a:bl.__buffers, 'keep') - call bl.filter_add_or(a:bl.__filter) - return bl - endfunc - - " and {{{3 - func bl.and(filter) dict - return call(self.buffers, [a:filter], self) - endfunc - - " hidden {{{3 - func bl.hidden(...) dict - let filters = { - \ 1: 'v:val.hidden', - \ 2: '!v:val.active && v:val.listed', - \ 3: '!v:val.listed', - \ 4: '!v:val.active && v:val.listed && !v:val.hidden', - \ 5: '!v:val.active || !v:val.listed' - \ } - let choice = a:0 ? a:1 : 1 - return self.filter_with_choice(choice, filters) - endfunc - - " active {{{3 - func bl.active() dict - return self.filter('v:val.active') - endfunc - - " modifiable {{{3 - func bl.modifiable(...) dict - let filters = { - \ 1: '!v:val.modifiable', - \ 2: '!v:val.modifiable || v:val.readonly' - \ } - let choice = a:0 ? a:1 : 1 - return self.filter_with_choice(choice, filters) - endfunc - - " readonly {{{3 - func bl.readonly(...) dict - let filters = { - \ 1: '!v:val.readonly', - \ 2: '!v:val.modifiable || v:val.readonly' - \ } - let choice = a:0 ? a:1 : 1 - return self.filter_with_choice(choice, filters) - endfunc - - " modified {{{3 - func bl.modified() dict - return self.filter('v:val.modified') - endfunc - - " read_error {{{3 - func bl.read_error() dict - return self.filter('v:val.read_error') - endfunc - - " unloaded {{{3 - func bl.unloaded() dict - return self.filter('!v:val.active && !v:val.hidden && v:val.listed') - endfunc - - " buffers - alias for data {{{2 - func bl.buffers(...) dict - if !a:0 - " Return listed buffers. - return self.filter('v:val.listed') - endif - if a:1 =~ '^\%(non\?\|un\)' - let arg = matchstr(a:1, '^\%(un\|non\)\zs.*') - let bang = '!' - else - let arg = a:1 - let bang = '' - endif - if arg == 'hidden' - let filter = 'v:val.hidden' - elseif arg == 'active' - let filter = 'v:val.active' - elseif arg == 'modifiable' - let filter = 'v:val.modifiable' - elseif arg == 'readonly' - let filter = 'v:val.readonly' - elseif arg == 'modified' - let filter = 'v:val.modified' - elseif arg == 'read_error' - let filter = 'v:val.read_error' - elseif arg == 'unloaded' - let filter = '!v:val.active && !v:val.hidden && v:val.listed' - elseif arg == 'listed' - let filter = 'v:val.listed' - elseif arg == 'all' - let filter = '1' - else - let filter = arg - endif - let bl = self.filter(bang . '(' . filter . ')') - return bl - endfunc - - " data - alias for buffers {{{3 - func bl.data() dict - return self.__buffers - endfunc - - " Private functions - don't need 'dict' modifier {{{2 - - " filter_with_choice {{{3 - func bl.filter_with_choice(choice, filters, ...) - if a:0 - return filter(deepcopy(a:1), a:filters[a:choice]) - else - return self.filter(a:filters[a:choice]) - endif - endfunc - - " buffer_status {{{3 - func bl.buffer_status(b) - return a:b['active'] == 1 ? 'a' : a:b['hidden'] == 1 ? 'h' : '!' - endfunc - - " buffer_type {{{3 - func bl.buffer_type(b) - return a:b['current'] == 1 ? '%' : a:b['alternate'] == 1 ? '#' : ' ' - endfunc - - " buffer_flags {{{3 - func bl.buffer_flags(b) - return (a:b['listed'] == 0 ? 'u' : ' ') - \. (a:b['current'] == 1 ? '%' : - \ (a:b['alternate'] == 1 ? '#' : ' ')) - \. (a:b['active'] == 1 ? 'a' : - \ (a:b['hidden'] == 1 ? 'h' : ' ')) - \. (a:b['modifiable'] == 0 ? '-' : - \ (a:b['readonly'] == 1 ? '=' : ' ')) - \. (a:b['modified'] == 1 ? '+' : ' ') - \. (a:b['read_error'] == 1 ? 'x' : ' ') - endfunc - " }}}2 - - " constructor - - call bl.update() - return bl -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/map.vim' --- vim/bundle/vimple/autoload/vimple/map.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/map.vim 1970-01-01 00:00:00 +0000 @@ -1,176 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :map builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :map command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/scriptnames.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#map.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#map -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -" TODO: Use the Numerically sort comparator for print() - -function! vimple#map#new() - let m = {} - let m.__data = {} - let m.__filter = '' - - func m.update() dict abort - let self.__data = vimple#associate(vimple#redir('map') + vimple#redir('map!'), - \ [['', - \ '', '']], - \ ['[matchstr(v:val, ''^.''), - \ matchstr(v:val, ''^.\s\+\zs\S\+''), - \ matchstr(v:val, ''^.\s\+\S\+\s\+\zs[*& ]\ze[@ ]\S''), - \ matchstr(v:val, ''^.\s\+\S\+\s\+[*& ]\zs[@ ]\ze\S''), - \ matchstr(v:val, ''^.\s\+\S\+\s\+[*& ][@ ]\zs\S.*'') - \ ]', - \ '{"normal" : v:val[0] =~ "[n ]", - \ "visual" : v:val[0] =~ "[vx ]", - \ "select" : v:val[0] =~ "[vs ]", - \ "operator" : v:val[0] =~ "[o ]", - \ "insert" : v:val[0] =~ "[i!]", - \ "lang" : v:val[0] =~ "l", - \ "command" : v:val[0] =~ "[c!]", - \ "lhs" : v:val[1], - \ "remappable" : v:val[2] != "*", - \ "script_remappable" : v:val[2] == "&", - \ "buffer" : v:val[3] == "@", - \ "rhs" : v:val[4] - \ }']) - return self - endfunc - - func m.map_type(map) - let tt = ['normal', 'insert', 'select', 'visual', 'operator', 'command', 'lang'] - let type = '' - for i in range(0, (len(tt) - 1)) - if a:map[tt[i]] - if i == 3 - if type == 's' - let type = 'v' - else - let type = 'x' - endif - else - let type = tt[i][0] - endif - endif - endfor - return type - endfunc - - func m.map_extra(map) - let et = ['remappable', 'script_remappable', 'buffer'] - let rt = [' ', '&', '@'] - let extra = '*' - for i in range(0, (len(et) - 1)) - if a:map[et[i]] - let extra = rt[i] - endif - endfor - return extra - endfunc - - func m.to_s(...) dict - let default = "%3n %s\n" - let default = "%t %L %e %R\n" - "let format = default - let format = a:0 && a:1 != '' ? a:1 : default - let maps = a:0 > 1 ? a:2.__data : self.__data - let str = '' - " for i in range(0, len(maps) - 1) - let lhs_plugs = self.filter('v:val["lhs"] =~ "\\c"').to_l() - let rhs_plugs = self.filter('v:val["rhs"] =~ "\\c"').to_l() - let non_plugs = self.filter('v:val["lhs"] !~ "\\c" && v:val["rhs"] !~ "\\c"').to_l() - let all_maps = sort(lhs_plugs, 'vimple#comparators#lhsly') - \+ sort(rhs_plugs, 'vimple#comparators#rhsly') - \+ sort(non_plugs, 'vimple#comparators#lhsly') - for map in all_maps - let type = self.map_type(map) - let extra = self.map_extra(map) - let str .= vimple#format( - \ format, - \ { 't': ['s', type], - \ 'L': ['s', map['lhs']], - \ 'e': ['s', extra], - \ 'R': ['s', map['rhs']]}, - \ default - \ ) - endfor - return str - endfunc - - " to_l {{{2 - func m.to_l(...) dict - return self.__data - endfunc - - " only able to colour print the default to_s() output at this stage - " Note: This is a LOT of dancing just to get coloured numbers ;) - func m.print() dict - call self.update() - call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') - endfunc - - func m.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__data, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - func m.lhs_is(lhs) dict abort - return self.filter('v:val["lhs"] ==# "' . escape(a:lhs, '\"') . '"') - endfunc - - call m.update() - return m -endfunction - -function! MyMaps() - let maps = split(g:vimple#mp.update().filter('v:val["lhs"] !~ "\\c"').to_s("%t %e %L %R\n"), "\n") - let max_l = 0 - for s in maps - let l = stridx(s, ' ', 5) - let max_l = l > max_l ? l : max_l - endfor - let max_l += 1 - let ms = [] - let pat = '^.\s.\s\S\+\zs\s\+\ze' - for s in maps - let ns = match(s, pat) - call add(ms, substitute(s, pat, repeat(' ', max_l - ns), '')) - endfor - return ms -endfunction - -command! -nargs=0 -bar MyMaps call ShowInNewBuf(MyMaps()) - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: - === removed file 'vim/bundle/vimple/autoload/vimple/marks.vim' --- vim/bundle/vimple/autoload/vimple/marks.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/marks.vim 1970-01-01 00:00:00 +0000 @@ -1,110 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :marks builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :marks command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/scriptnames.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#marks.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#marks -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -" TODO: Use the Numerically sort comparator for print() - -function! vimple#marks#new() - let m = {} - let m.__data = {} - let m.__filter = '' - - func m.update() dict abort - let self.__data = vimple#associate(vimple#redir('marks')[1:-1], - \ [['^\s*', '', '']], - \ ['split(v:val)', - \ '{"mark" : v:val[0], - \ "line" : v:val[1], - \ "col" : v:val[2], - \ "text" : substitute(join(v:val[3:-1], " "), "\n", "", ""), - \ }']) - - return self - endfunc - - func m.to_s(...) dict - let default = "%2m %5l %4o %t\n" - let format = a:0 && a:1 != '' ? a:1 : default - let marks = a:0 > 1 ? a:2.__data : self.__data - let str = '' - for i in range(0, len(marks) - 1) - let str .= vimple#format( - \ format, - \ { 'm': ['s', marks[i]['mark']], - \ 'l': ['d', marks[i]['line']], - \ 'o': ['d', marks[i]['col']], - \ 't': ['s', marks[i]['text']]}, - \ default - \ ) - endfor - return str - endfunc - - func m.to_l() dict - return self.__data - endfunc - - " " only able to colour print the default to_s() output at this stage - " " Note: This is a LOT of dancing just to get coloured numbers ;) - " func m.print() dict - " call self.update() - " call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') - " endfunc - - "TODO: This looks like a candidate for moving into the parent class... no? - func m.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__data, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - func m.lhs_is(lhs) dict abort - return self.filter('v:val["lhs"] ==# "' . escape(a:lhs, '\"') . '"') - endfunc - - func m.local_marks() dict abort - return self.filter('v:val["mark"] =~# "[a-z]"') - endfunc - - func m.global_marks() dict abort - return self.filter('v:val["mark"] =~# "[A-Z]"') - endfunc - - call m.update() - return m -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: - === removed file 'vim/bundle/vimple/autoload/vimple/options.vim' --- vim/bundle/vimple/autoload/vimple/options.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/options.vim 1970-01-01 00:00:00 +0000 @@ -1,209 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for options -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's options -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/options.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#options.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#options -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -function! vimple#options#new() - if exists('g:vimple#op') - return deepcopy(g:vimple#op).update() - endif - let op = {} - let op.__options = {} - let op.__filter = '' - let op.__update_with_map = 0 - - " update {{{2 - func op.update() dict abort - if self.__update_with_map - call map(self.__options, 'extend(v:val, {"value": eval("&".v:key)}, "force")') - " Preserve filter. - if !empty(self.__filter) - call filter(self.__options, self.__filter) - endif - return self - endif - - silent! options - let content = getline(1, '$') - close - bwipe option-window - - let long = '' - for l in content - if l =~ '^\s*\%(".*\)\?$' - continue - elseif l =~ '^\s*\d' - continue - elseif l =~ '^\w' - let [long, desc] = split(l, '\t') - let self.__options[long] = {} - let self.__options[long] = {'long' : long, 'desc' : desc} - elseif l =~ '^\t' - let self.__options[long].desc .= ' ' . matchstr(l, '^\t\zs.*') - else - if l =~ 'set \w\+=' - let l = substitute(l, '^ \tset \(\w\+\)=', ' string \1 ', '') - else - let l = substitute(l, '^ \tset \(\w\+\)\t\(\w\+\)', '\=" bool " . (submatch(1) !~? "^no" ? submatch(1) : submatch(2)) . " " . (submatch(1) !~? "^no")', '') - endif - let [type, short] = matchlist(l, '^ \(\w\+\) \(\w\+\)')[1:2] - call extend(self.__options[long], {'type' : type, 'short' : short, 'value': eval('&'.long)}) - endif - endfor - - for o in items(self.__options) - call extend(o[1], {'scope' : (o[1].desc =~ '(.\{-}local.\{-})' ? matchstr(o[1].desc, '(\zs.\{-}\ze)') : 'global')}) - call extend(self.__options, {o[1].short : o[1]}) - endfor - - " Preserve filter. - if !empty(self.__filter) - call filter(self.__options, self.__filter) - endif - let self.__update_with_map = 1 - return self - endfunc - - " to_d {{{2 - func op.to_d(...) dict - return self.__options - endfunc - - " to_l {{{2 - func op.to_l(...) dict - return map(items(self.__options), '[v:val[0], v:val[1].value]') - endfunc - - " to_s {{{2 - func op.to_s(...) dict - let default = "%-15l %-2p %1t %v\n" - let format = a:0 && a:1 != '' ? a:1 : default - let opts = a:0 > 1 ? a:2.__options : self.__options - let str = '' - for o in sort(items(opts)) - let str .= vimple#format( - \ format, - \ { 'l': ['s', o[1]['long']], - \ 's': ['s', o[1]['short']], - \ 'd': ['s', o[1]['desc']], - \ 'p': ['s', join(map(filter(split(o[1]['scope']), 'index(["or", "local", "to"], v:val) == -1'), 'strpart(v:val, 0, 1)'), '')], - \ 't': ['s', strpart(o[1]['type'], 0, 1)], - \ 'v': ['s', o[1]['value']]}, - \ default - \ ) - endfor - return str - endfunc - - " changed {{{2 - func op.changed() dict - return self.filter('v:val.value !=# eval("&".v:key)') - endfunc - - " short {{{2 - func op.short() dict - return self.filter('v:val.short ==# v:key') - endfunc - - " long {{{2 - func op.long() dict - return self.filter('v:val.long ==# v:key') - endfunc - - " print {{{2 - " only able to colour print the default to_s() output at this stage - func op.print() dict - "let str = self.to_s() - " following code is from hl.print() and would not work as is here - "let dta = map(split(str, "\n"), '[split(v:val, " ")[0], v:val . "\n"]') - "call vimple#echoc(dta) - let pairs = [] - let changed = self.changed() - let max_name = max(map(values(map(copy(self.__options), 'v:val.long." ".v:val.short.""')), 'len(v:val)')) - for key in sort(keys(self.long().__options)) - let option = self.__options[key] - call add(pairs, ['vimple_BL_Number', option.long]) - call add(pairs, ['Normal', ' (']) - call add(pairs, ['vimple_BL_Hidden', option.short]) - call add(pairs, ['Normal', ')' . repeat(' ', max_name - len(option.short) - len(option.long))]) - let len = len(option.value) - if len < &columns - call add(pairs, ['Normal', option.value . "\"]) - else - let screen_len = &columns - max_name - 6 - let i = 0 - while i <= len - let j = i + screen_len - call add(pairs, ['Normal', repeat(' ', i == 0 ? 0 : max_name + 3) . option.value[i : j] . "\"]) - let i = j + 1 - endwhile - endif - if has_key(changed.__options, key) - let len = len(eval('&'.key)) - if len < &columns - call add(pairs, ['vimple_BL_Alternate', repeat(' ', max_name + 3) . eval('&'.key) . "\"]) - else - let screen_len = &columns - max_name - 6 - let i = 0 - while i <= len - let j = i + screen_len - call add(pairs, ['vimple_BL_Alternate', repeat(' ', max_name + 3) . eval('&'.key)[i : j] . "\"]) - let i = j + 1 - endwhile - endif - endif - endfor - call vimple#echoc(pairs) - " Remove the last . Why? - let pairs[-1][1] = pairs[-1][-1][:-2] - return pairs - endfunc - - " filter {{{2 - func op.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__options, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - " filter_by_name {{{2 - func op.filter_by_name(name) dict abort - return self.filter('v:val["long"] =~ "' . escape(a:name, '"') . '"') - endfunc - - call op.update() - return op -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/scriptnames.vim' --- vim/bundle/vimple/autoload/vimple/scriptnames.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/scriptnames.vim 1970-01-01 00:00:00 +0000 @@ -1,100 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :scriptnames builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :scriptnames command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/scriptnames.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#scriptnames.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#scriptnames -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -" TODO: Use the Numerically sort comparator for print() - -function! vimple#scriptnames#new() - let sn = {} - let sn.__scripts = {} - let sn.__filter = '' - - " update {{{2 - func sn.update() dict abort - let self.__scripts = vimple#associate(vimple#redir('scriptnames'), - \ [['^\s*\(\d\+\):\s*\(.*\)$', - \ '\1,\2', '']], - \ ['split(v:val, ",")', '{"number": v:val[0], "script": v:val[1]}']) - return self - endfunc - - " to_l {{{2 - func sn.to_l(...) dict - return self.__scripts - endfunc - - " to_s {{{2 - func sn.to_s(...) dict - let default = "%3n %s\n" - "let format = default - let format = a:0 && a:1 != '' ? a:1 : default - let scripts = a:0 > 1 ? a:2.__scripts : self.__scripts - let str = '' - for i in range(0, len(scripts) - 1) - let str .= vimple#format( - \ format, - \ { 'n': ['d', scripts[i]['number']], - \ 's': ['s', scripts[i]['script']]}, - \ default - \ ) - endfor - return str - endfunc - - " print {{{2 - " only able to colour print the default to_s() output at this stage - " Note: This is a LOT of dancing just to get coloured numbers ;) - func sn.print() dict - call self.update() - call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') - endfunc - - " filter {{{2 - func sn.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__scripts, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - " filter_by_name {{{2 - func sn.filter_by_name(name) dict abort - return self.filter('v:val["script"] =~ "' . escape(a:name, '"') . '"') - endfunc - - call sn.update() - return sn -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/undolist.vim' --- vim/bundle/vimple/autoload/vimple/undolist.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/undolist.vim 1970-01-01 00:00:00 +0000 @@ -1,176 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :undolist builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :undolist command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/scriptnames.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#undolist.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#undolist -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -function! vimple#undolist#get_undolist() - let bnum = bufnr('%') - let bname = bufname('%') - let ulist = vimple#undolist#new() - if len(ulist.to_l()) != 0 - return [ulist.sort_by_age().to_l()[-1]['age'], bnum, bname] - else - return [99999999999, bnum, bname] - endif -endfunction - -function! vimple#undolist#most_recently_used() - let orig_pos = getpos('.') - let orig_pos[0] = bufnr('%') - - let uls = [] - bufdo call add(uls, vimple#undolist#get_undolist()) - call sort(uls) - - exe 'buffer ' . orig_pos[0] - let orig_pos[0] = 0 - call setpos('.', orig_pos) - return reverse(uls) -endfunction - -function! vimple#undolist#print_mru() - let mru = vimple#undolist#most_recently_used() - let str = '' - for buf in mru - let str .= printf("%3d %s\n", buf[1], buf[2]) - endfor - return str -endfunction - -nnoremap VimpleMRU :echo vimple#undolist#print_mru() . "\n":buffer -if !hasmapto('VimpleMRU') - nmap gu VimpleMRU -endif - -function! vimple#undolist#normalise_time(t, now) - let t = a:t - let now = a:now - if t =~? '^\d\+ ' - let now -= matchstr(t, '^\d*') - let time = strftime('%Y/%m/%d %H:%M:%S', now) - elseif t !~ '\/' - let time = strftime('%Y/%m/%d ', now) . t - elseif t !~ '\/.*\/' - let time = strftime('%Y/', now) . t - else - let time = t - endif - return time -endfunction - -function! vimple#undolist#julian_date(t) - let [year, mon, day] = matchlist(a:t, '^\(\d\{4}\)/\(\d\d\)/\(\d\d\)')[1:3] - let y = year + 4800 - (mon <= 2) - let m = mon + (mon <= 2 ? 9 : -3) - let jul = day + (153 * m + 2) / 5 + (1461 * y / 4) - 32083 - return jul - (y / 100) + (y / 400) + 38 -endfunction - -" in UTC -function! vimple#undolist#time_to_seconds(t, now) - let t = vimple#undolist#normalise_time(a:t, a:now) - let jd = vimple#undolist#julian_date(t) - let jd_linux = vimple#undolist#julian_date('1970/01/01 00:00:00') - let [hour, min, sec] = matchlist(t, ' \(\d\d\):\(\d\d\):\(\d\d\)')[1:3] - return (jd - jd_linux) * 86400 + hour * 3600 + min * 60 + sec -endfunction -. -function! vimple#undolist#new() - let m = {} - let m.__data = {} - let m.__filter = '' - - func m.update() dict abort - let now = localtime() - let self.__data = vimple#associate(vimple#redir('undolist')[1:-1], - \ [ - \ ['^\s*', '', ''], - \ ['\s\s\+', '__', 'g'] - \ ], - \ ['split(v:val, "__")', - \ '{"number" : v:val[0], - \ "changes" : v:val[1], - \ "when" : vimple#undolist#normalise_time(v:val[2], ' .now. '), - \ "age" : vimple#undolist#time_to_seconds(v:val[2], ' .now. '), - \ "saved" : len(v:val) == 4 ? v:val[3] : 0 - \ }']) - - return self - endfunc - - func m.to_s(...) dict - let default = "%4n %4h %4s %w\n" - let format = a:0 && a:1 != '' ? a:1 : default - let data = a:0 > 1 ? a:2.__data : self.__data - let str = '' - for i in range(0, len(data) - 1) - let str .= vimple#format( - \ format, - \ { 'n': ['d', data[i]['number']], - \ 'h': ['d', data[i]['changes']], - \ 'w': ['s', data[i]['when']], - \ 'a': ['d', data[i]['age']], - \ 's': ['d', data[i]['saved']]}, - \ default - \ ) - endfor - return str - endfunc - - func m.agely(a, b) dict - return a:a['age'] - a:b['age'] - endfunc - - func m.sort_by_age() dict - let Fn_age = self.agely - call sort(self.__data, Fn_age, self) - return self - endfunc - - func m.to_l() dict - return self.__data - endfunc - - "TODO: This looks like a candidate for moving into the parent class... no? - func m.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__data, a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - call m.update() - return m -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed file 'vim/bundle/vimple/autoload/vimple/version.vim' --- vim/bundle/vimple/autoload/vimple/version.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/autoload/vimple/version.vim 1970-01-01 00:00:00 +0000 @@ -1,115 +0,0 @@ -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -" Vimple wrapper for :version builtin -" Maintainers: Barry Arthur -" Israel Chauca F. -" Description: Vimple object for Vim's builtin :version command. -" Last Change: 2012-04-08 -" License: Vim License (see :help license) -" Location: autoload/vimple/version.vim -" Website: https://github.com/dahu/vimple -" -" See vimple#version.txt for help. This can be accessed by doing: -" -" :helptags ~/.vim/doc -" :help vimple#version -"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -" Vimscript Setup: {{{1 -" Allow use of line continuation. -let s:save_cpo = &cpo -set cpo&vim - -" load guard -" uncomment after plugin development -"if exists("g:loaded_lib_vimple") -" \ || v:version < 700 -" \ || v:version == 703 && !has('patch338') -" \ || &compatible -" let &cpo = s:save_cpo -" finish -"endif -"let g:loaded_lib_vimple = 1 - -function! vimple#version#new() - let vn = {} - let vn.__info = {} - let vn.__filter = '' - - " update {{{2 - func vn.update() dict abort - let i = self.__info - let info = vimple#associate(vimple#redir('version'), [], []) - - let [i['version'], i['major'], i['minor'], i['build_name'], i['compiled']] = - \ split( - \ substitute(info[0] - \ , '^N\?VIM.\{-}\(\(\d\+\)\.\(\d\+\)\).\{-}' - \ . '(\(.\{-}\)\%(,\s\+\S\+\s\+\(.\{-}\)\)\?)' - \ , '\1\n\2\n\3\n\4\n\5', '') - \ , "\n", 1) - let i['patches'] = substitute(info[1], '^.*:\s\+\(.*\)', '\1', '') - let i['compiled_by'] = info[2] - let i['build_version'] = substitute(info[3], '^\(.\{-}\)\..*', '\1', '') - let i['features'] = {} - for line in range(4, len(info)) - if (info[line] =~ '^\s*$') || (info[line] =~ '^\s\+.*:\s') - break - endif - call map(split(info[line], '\s\+'), - \ 'extend(i["features"], {strpart(v:val, 1) : (v:val =~ "^+" ? 1 : 0)})') - endfor - return self - endfunc - - " to_l {{{2 - func vn.to_l(...) dict - return self.__info - endfunc - - " " to_s {{{2 - " func vn.to_s(...) dict - " let default = "%3n %s\n" - " "let format = default - " let format = a:0 && a:1 != '' ? a:1 : default - " let scripts = a:0 > 1 ? a:2.__info : self.__info - " let str = '' - " for i in range(0, len(scripts) - 1) - " let str .= vimple#format( - " \ format, - " \ { 'n': ['d', scripts[i]['number']], - " \ 's': ['s', scripts[i]['script']]}, - " \ default - " \ ) - " endfor - " return str - " endfunc - - " " print {{{2 - " " only able to colour print the default to_s() output at this stage - " " Note: This is a LOT of dancing just to get coloured numbers ;) - " func vn.print() dict - " call self.update() - " call map(map(map(split(self.to_s(), '\n'), 'split(v:val, "\\d\\@<= ")'), '[["vimple_SN_Number", v:val[0]] , ["vimple_SN_Term", " : " . v:val[1] . "\n"]]'), 'vimple#echoc(v:val)') - " endfunc - - " filter {{{2 - func vn.filter(filter) dict abort - let dict = deepcopy(self) - call filter(dict.__info["features"], a:filter) - let dict.__filter .= (dict.__filter == '' ? '' : ' && ').a:filter - return dict - endfunc - - " filter_by_name {{{2 - func vn.filter_by_name(name) dict abort - return self.filter('v:key =~ "' . escape(a:name, '"') . '"') - endfunc - - call vn.update() - return vn -endfunction - -" Teardown:{{{1 -"reset &cpo back to users setting -let &cpo = s:save_cpo -" vim: set sw=2 sts=2 et fdm=marker: === removed directory 'vim/bundle/vimple/demo' === removed file 'vim/bundle/vimple/demo/bufgrep.vim' --- vim/bundle/vimple/demo/bufgrep.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/bufgrep.vim 1970-01-01 00:00:00 +0000 @@ -1,47 +0,0 @@ -" Wanna grep your buffer and be able to jump to one of the matches quickly? -" -" Use bg or the :G command - -" In the overlay window: -" You're prompted with a filter pattern. Use to cancel. -" jumps to the current-line match -" q closes the overlay without action - -function! BufGrep(pattern) - let pattern = a:pattern - let fc = pattern[0] - let lc = pattern[-1] - if fc !~ '[[:punct:]]' - let fc = '/' - let lc = '/' - elseif fc != lc - let lc = fc - let pattern = pattern[1:] - else - let pattern = pattern[1:-2] - endif - let pattern = escape(pattern, fc) - - let data = vimple#redir('global ' . fc . pattern . lc . '#') - if data[0] =~ 'Pattern not found:' - echohl Warning - echo data[0] - echohl None - return - endif - call overlay#show( - \ data - \, { - \ '' : ':call BufGrepAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! BufGrepAccept() - let num = matchstr(overlay#select_line(), '\d\+') - exe 'silent! norm! ' . num . "G" -endfunction - -nnoremap bg :call BufGrep(input('', '/')) -command! -nargs=* G call BufGrep() === removed file 'vim/bundle/vimple/demo/calendar.vim' --- vim/bundle/vimple/demo/calendar.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/calendar.vim 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -" Interactive Calendar overlay demo -" NOTE: Depends on system 'cal' tool. -" In the overlay window: -" inserts the date as YYYY-MM-DD from the day under the cursor. -" moves back one month -" moves forward one month -" moves back one year -" moves forward one year -" q closes the overlay without action - -" functions {{{1 - -function! GetCalendar(month, year) "{{{2 - let calendar = split(substitute(substitute(substitute(system('cal ' . a:month . ' ' . a:year), '\n', '\n ', 'g'), '_ _', '*', ''), '\s\+\_$', '', 'g'), "\n") - return calendar -endfunction - -function! Calendar(month, year) "{{{2 - call overlay#show( - \ GetCalendar(a:month, a:year) - \, { - \ '' : ':call CalendarAccept()' - \ , '' : ':call CalendarUpdate("m", 1)' - \ , '' : ':call CalendarUpdate("m", -1)' - \ , '' : ':call CalendarUpdate("y", 1)' - \ , '' : ':call CalendarUpdate("y", -1)' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1, 'month' : a:month, 'year' : a:year}) - syntax match Today '\*\d\+' - highlight def link Today TODO -endfunction - -function! CalendarUpdate(time, amount) "{{{2 - if a:time == 'm' - let b:options.month += a:amount - else - let b:options.year += a:amount - endif - call overlay#update(GetCalendar(b:options.month, b:options.year)) -endfunction - -function! CalendarAccept() "{{{2 - let day = expand('') - let date = b:options.year . '-' . printf('%02d', b:options.month) . '-' . printf('%02d', day) - call overlay#close() - if exists('g:insertlessly_cleanup_trailing_ws') - let insertlessly_cleanup_trailing_ws = g:insertlessly_cleanup_trailing_ws - let insertlessly_cleanup_all_ws = g:insertlessly_cleanup_all_ws - let g:insertlessly_cleanup_trailing_ws = 0 - let g:insertlessly_cleanup_all_ws = 0 - endif - if exists('b:cal_mode') - let cal_mode = b:cal_mode - unlet b:cal_mode - else - let cal_mode = 'i' - endif - if cal_mode ==# 'I' - exe 'norm! a' . date . ' ' - startinsert - call feedkeys("\l") - elseif cal_mode ==# 'i' - exe 'norm! i' . date - elseif cal_mode ==# 'a' - exe 'norm! a' . date - elseif cal_mode ==# 'c' - exe 'norm! ciW' . date - endif - if exists('g:insertlessly_cleanup_trailing_ws') - let g:insertlessly_cleanup_trailing_ws = insertlessly_cleanup_trailing_ws - let g:insertlessly_cleanup_all_ws = insertlessly_cleanup_all_ws - endif - let b:date = date - return date -endfunction - -function! CalendarToday() "{{{2 - return Calendar(strftime('%m'), strftime('%Y')) -endfunction - -" maps {{{1 - -inoremap :let b:cal_mode='I':call CalendarToday() -nnoremap dda :let b:cal_mode='a':call CalendarToday() -nnoremap ddi :let b:cal_mode='i':call CalendarToday() -nnoremap ddc :let b:cal_mode='c':call CalendarToday() - -" vim: fen fdm=marker === removed file 'vim/bundle/vimple/demo/changelist.vim' --- vim/bundle/vimple/demo/changelist.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/changelist.vim 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -" Think :changes could be a bit sexier? -" -" Use g; or :Changes to enter the changelist overlay - -" In the overlay window: -" You're prompted with a filter pattern. Use to cancel. -" jumps to the current entry -" q closes the overlay without action - -function! ChangeListData() - let data = reverse(vimple#redir('changes')[1:]) - let files = {} - let lines = [] - for d in data - if d == '>' - call add(lines, "x 0\t<-- At changelist head") - continue - endif - let [n, l, c; t] = split(matchstr(d, '^>\?\zs.*'), '\s\+') - let tt = join(t, ' ') - let type = 'l' - if (tt != '') && (filereadable(tt) || (bufnr(tt) != -1)) - let type = 'f' - if has_key(files, tt) - continue - endif - let files[tt] = 1 - endif - call add(lines, join([type, n, l], ' ') . "\t" . tt) - endfor - return lines -endfunction - -function! ChangeList() - call overlay#show( - \ ChangeListData() - \, { - \ '' : ':call ChangeListAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1}) - call search('^.\s*0', 'w') - set syntax=vimple_jumplist - setlocal conceallevel=2 concealcursor=nv tabstop=12 -endfunction - -function! ChangeListAccept() - let l = line('.') - let cur = search('^.\s*0', 'wn') - if l == cur - call overlay#close() - return - else - let lst = overlay#select_buffer() - let num = matchstr(lst[l-1], '\d\+') - let dir = (l > cur) ? "g;" : "g," - exe 'silent! norm! ' . num . dir - endif -endfunction - -nnoremap g; :call ChangeList() -nnoremap g, :call ChangeList() -command! -nargs=0 Changes call ChangeList() === removed file 'vim/bundle/vimple/demo/global_marks.vim' --- vim/bundle/vimple/demo/global_marks.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/global_marks.vim 1970-01-01 00:00:00 +0000 @@ -1,26 +0,0 @@ -" Wish you could jump to a global mark that's already open in another tabpage? - -" Ensure that: -" set swb+=useopen,usetab - -" In the overlay window: -" does a sbuffer to the current-line global-mark's filename -" q closes the overlay without action - -function! GlobalMarks() - let data = split(g:vimple#ma.update().global_marks().to_s(), "\n") - call overlay#show( - \ data - \, { - \ '' : ':call GlobalMarksAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1}) -endfunction - -function! GlobalMarksAccept() - let file = matchstr(overlay#select_line(), '\s\zs\S\+$') - silent! exe 'sbuffer ' . file -endfunction - -nnoremap gg' :call GlobalMarks() === removed file 'vim/bundle/vimple/demo/helptoc.vim' --- vim/bundle/vimple/demo/helptoc.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/helptoc.vim 1970-01-01 00:00:00 +0000 @@ -1,32 +0,0 @@ -" Jump to a help-tag entry in the current help file - -" In the overlay window: -" You're prompted with a filter pattern. Use to cancel. -" jumps to the tag beneath the cursor -" q closes the overlay without action - -" functions {{{1 - -function! HelpTOC() "{{{2 - call overlay#show( - \ list#lspread(map(filter(string#scanner(getline(1, '$')).collect('\*\S\+\*'), 'v:val =~ "[a-z]"'), 'strpart(v:val, 1, len(v:val)-2)'), 3) - \, { - \ '' : ':exe "tag " . HelpTOCAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1, 'setlocal tabstop=50' :-0}) -endfunction - -function! HelpTOCAccept() - let line = getline('.') - let idx = strlen(substitute(line[:col('.')], '[^\t]', '', 'g')) - let word_list = split(line, '\t') - call overlay#close() - return word_list[idx] -endfunction - -" maps {{{1 - -nnoremap t :call HelpTOC() - -" vim: fen fdm=marker === removed file 'vim/bundle/vimple/demo/identsearch.vim' --- vim/bundle/vimple/demo/identsearch.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/identsearch.vim 1970-01-01 00:00:00 +0000 @@ -1,34 +0,0 @@ -" Are you bored with vanilla [I ? -" Did the improvement above :help [i excite you only briefly? -" Want a better experience? -" Overlay is here for you. - -" In the overlay window: -" You're prompted with a filter pattern. Use to cancel. -" jumps to the current-line ident-search match -" q closes the overlay without action - -function! IdentSearch() - try - let data = vimple#redir('norm! [I') - catch '^Vim\%((\a\+)\)\=:E389:' - echohl Warning - echom 'Could not find pattern' - echohl None - return - endtry - call overlay#show( - \ data - \, { - \ '' : ':call IdentSearchAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! IdentSearchAccept() - let num = matchstr(overlay#select_line(), '\d\+') - exe 'silent! norm! ' . num . "[\t" -endfunction - -nnoremap [I :call IdentSearch() === removed file 'vim/bundle/vimple/demo/jumplist.vim' --- vim/bundle/vimple/demo/jumplist.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/jumplist.vim 1970-01-01 00:00:00 +0000 @@ -1,63 +0,0 @@ -" Think :jumps could be a bit sexier? -" -" Use or :Jumps to enter the jumplist overlay - -" In the overlay window: -" You're prompted with a filter pattern. Use to cancel. -" jumps to the current entry -" q closes the overlay without action - -function! JumpListData() - let data = reverse(vimple#redir('jumps')[1:]) - let files = {} - let lines = [] - for d in data - if d == '>' - call add(lines, "x 0\t<-- At jumplist head") - continue - endif - let [n, l, c; t] = split(matchstr(d, '^>\?\zs.*'), '\s\+') - let tt = join(t, ' ') - let type = 'l' - if (tt != '') && (filereadable(tt) || (bufnr(tt) != -1)) - let type = 'f' - if has_key(files, tt) - continue - endif - let files[tt] = 1 - endif - call add(lines, join([type, n, l], ' ') . "\t" . tt) - endfor - return lines -endfunction - -function! JumpList() - call overlay#show( - \ JumpListData() - \, { - \ '' : ':call JumpListAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1}) - call search('^.\s*0', 'w') - set syntax=vimple_jumplist - setlocal conceallevel=2 concealcursor=nv tabstop=12 -endfunction - -function! JumpListAccept() - let l = line('.') - let cur = search('^.\s*0', 'wn') - if l == cur - call overlay#close() - return - else - let lst = overlay#select_buffer() - let num = matchstr(lst[l-1], '\d\+') - let dir = (l > cur) ? "\" : "\" - exe 'silent! norm! ' . num . dir - endif -endfunction - -nnoremap :call JumpList() -nnoremap :call JumpList() -command! -nargs=0 Jumps call JumpList() === removed file 'vim/bundle/vimple/demo/oldfiles.vim' --- vim/bundle/vimple/demo/oldfiles.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/oldfiles.vim 1970-01-01 00:00:00 +0000 @@ -1,35 +0,0 @@ -" Better navigation of :oldfiles - -" In the overlay window: -" loads the file under the cursor -" q closes the overlay without action - -function! GetSuggestions(ident) - let spell = &spell - if ! spell - set spell - endif - let suggestions = list#lspread(spellsuggest(a:ident), 5) - if ! spell - set nospell - endif - return suggestions -endfunction - -function! Oldfiles() - call overlay#show( - \ vimple#redir('oldfiles') - \, { - \ '' : ':call OldfilesAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! OldfilesAccept() - let line = matchstr(getline('.'), '^\d\+') - call overlay#close() - exe 'edit ' . expand('#<' . line) -endfunction - -command! -nargs=0 Oldfiles call Oldfiles() === removed file 'vim/bundle/vimple/demo/spellsuggest.vim' --- vim/bundle/vimple/demo/spellsuggest.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/spellsuggest.vim 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -" Are you bored with vanilla z= ? - -" In the overlay window: -" replaces current word with word under cursor -" q closes the overlay without action - -" functions {{{1 - -function! GetSuggestions(ident) "{{{2 - let spell = &spell - if ! spell - set spell - endif - let suggestions = list#lspread(spellsuggest(a:ident), 5) - if ! spell - set nospell - endif - return suggestions -endfunction - -function! SpellSuggest(ident) "{{{2 - call overlay#show( - \ GetSuggestions(a:ident) - \, { - \ '' : ':call SpellSuggestAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1}) -endfunction - -function! SpellSuggestAccept() "{{{2 - let line = getline('.') - let idx = strlen(substitute(line[:col('.')], '[^\t]', '', 'g')) - let word_list = split(line, '\t') - call overlay#close() - let [r1, r2] = [@@, @-] - exe 'norm! ciw' . word_list[idx] - let [@@, @-] = [r1, r2] -endfunction - -" maps {{{1 - -nnoremap z= :call SpellSuggest(expand('')) - -" vim: fen fdm=marker === removed file 'vim/bundle/vimple/demo/tagkinds.vim' --- vim/bundle/vimple/demo/tagkinds.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/tagkinds.vim 1970-01-01 00:00:00 +0000 @@ -1,24 +0,0 @@ -" TagKind shows an overlay containing the kind of tag requested - -" In the overlay window: -" jumps to the current-line tag name -" q closes the overlay without action - -function! TagKind(kind) - let tags = sort(map(filter(taglist('.'), 'v:val.kind == "' . a:kind . '"'), 'v:val.name')) - call overlay#show( - \ tags - \, { - \ '' : ':call TagKindAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1}) -endfunction - -function! TagKindAccept() - let tag = overlay#select_line() - exe 'tjump ' . tag -endfunction - -nnoremap tc :call TagKind('c') -nnoremap tf :call TagKind('f') === removed file 'vim/bundle/vimple/demo/tagsearch.vim' --- vim/bundle/vimple/demo/tagsearch.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/demo/tagsearch.vim 1970-01-01 00:00:00 +0000 @@ -1,41 +0,0 @@ -" Are you bored with vanilla g] ? -" Did the improvement above :help g] excite you only briefly? -" Want a better experience? -" Overlay is here for you. - -" In the overlay window: -" You're prompted with a filter pattern. Use to cancel. -" jumps to the current-line tag-search match -" q closes the overlay without action - -function! TagSearch() - let ident = expand('') - let s:tags = taglist(ident) - if empty(s:tags) - echohl Warning - echom 'Tag not found: ' . ident - echohl None - return - endif - let data = map(copy(s:tags), 'v:key . " " . v:val.name . "\t" . v:val.filename') - call overlay#show( - \ data - \, { - \ '' : ':call TagSearchAccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! TagSearchAccept() - let ident = matchstr(overlay#select_line(), '^\d\+') - let fname = s:tags[ident].filename - if bufnr(fname) == -1 - exec 'edit ' . fname - else - exec 'buffer ' . fname - endif - silent! exe s:tags[ident].cmd -endfunction - -nnoremap g] :call TagSearch() === removed directory 'vim/bundle/vimple/doc' === removed file 'vim/bundle/vimple/doc/vimple.txt' --- vim/bundle/vimple/doc/vimple.txt 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/doc/vimple.txt 1970-01-01 00:00:00 +0000 @@ -1,316 +0,0 @@ -*vimple.txt* Programmatic access to Vim's read-only command output. - - - VIM REFERENCE MANUAL by Barry Arthur - - -Help on using vimple *vimple* - -1. Introduction |vimple-intro| -2. View |vimple-view-command| -3. Collect |vimple-collect-command| -4. GCollect |vimple-gcollect-function| -5. GCCollect |vimple-gccollect-function| -6. MyMaps |vimple-mymaps-command| -7. ReadIntoBuffer |vimple-readintobuffer-command| -8. Filter |vimple-filter-command| -9. QFdo |vimple-quickfix-commands| -10. BufDo |vimple-bufdo-commands| -11. Overlay Tools |vimple-overlay-tools| -12. Scope |vimple-scope| -13. Custom Insert-mode Completers |vimple-completers| - - -============================================================================== - 1. INTRODUCTION *vimple-intro* - -Vimple provides VimLOO (Object-oriented VimL) objects for several -built-in commands, such as: - -* ls / buffers -> vimple#bl -* scriptnames -> vimple#sn -* highlight -> vimple#hl -* version -> vimple#vn -* marks -> vimple#ma -* maps -> vimple#mp -* undolist -> vimple#ul - -These objects all support at least the following three methods: - -* update() -> refresh the object's data -* to_s() -> return a string representation fit for :echo -* to_l() -> return a list representation - -Vimple also provides the following two utility commands to make it -easier to work with Vim's command output: - -============================================================================== - 2. VIEW *:View* *vimple-view-command* -> - :View -< -View will show the output of the given command in a split window. -Having the output in a buffer makes it easily searchable and -modifiable. This command is great if all you want to do is quickly -check for the existance of somthing within the messy formatted output -of a command, or if you need to elaborately massage the output for -some reason. Being in a Vim buffer, you have all of Vim's editing -tools at your disposal. - -By default, :View will prompt you for a pattern to filter the results by. If -you want to disable this default behaviour, add a line like this to your -|$MYVIMRC|: -> - let vimple_auto_filter = [] -< or > - let vimple_auto_filter = ['vfm'] -< (if you want auto-filter in VFM but not :View) - -============================================================================== - 3. COLLECT *:Collect* *vimple-collect-command* -> - :Collect -< -Collect is useful for grabbing the command's output into a named -register or variable. This is useful for doing further programmatic -manipulations on the data. If the first argument is a single letter -[a-z] then it is treated as the corresponding register to save the -command output into. If you want to save the command output into a -variable, use a fully scoped variable, like: -> - :Collect g:regs registers -< -============================================================================== - 4. GCollect() *GCollect()* *vimple-gcollect-function* -> - GCollect( pattern ) -< -Uses "pattern" in a :global /pattern/ command and returns the results as a -list of lines. -> - :echo GCollect('^\s*===\s*') -< -============================================================================== - 5. GCCollect() *CGCollect()* *vimple-gccollect-function* -> - GCCollect( pattern ) -< -Uses "pattern" in a :global /pattern/ command and returns the results as a -list of lines with the "pattern" stripped. -> - :echo GCCollect('^\s*===\s*') - -============================================================================== - 6. MYMAPS *:MyMaps* *vimple-mymaps-command* -> - :MyMaps -< -Will show in a new buffer your curently active maps (:map and :map!). The maps -are displayed slightly differently to the builtin commands in that the map -special indicators (*, & and @) are shown immediately after the mode indicator -at the start of the map. maps (where appears in the -lefthand-side) are removed for clarity, and the maps are sorted in an attempt -to group related maps together. - -============================================================================== - 7. READINTOBUFFER *:ReadIntoBuffer* *vimple-readintobuffer-command* -> - :ReadIntoBuffer -< -For those times when you'd like to read in a subset of lines from a file. -> - :ReadIntoBuffer foo 5 10 -< -Will grab six lines (5 through 10, both inclusive) from file 'foo' into the -current file beneath the current line (as |:read| does). - - -It defaults to the current line, but you can specify another: -> - :7 ReadIntoBuffer foo 5 10 -< -Will grab six lines (5 through 10, both inclusive) from file 'foo' into the -current file beneath line seven (which means it starts on line 8 - the start -range in this command is exclusive; the end range (shown next) is inclusive.) - - -And you can limit the insertion range too: -> - :7,9 ReadIntoBuffer foo 5 10 -< -Will grab two lines (5 and 6) from file 'foo' into the current file beneath -line seven (therefore occupying lines 8 and 9 in the current buffer). - -The usefulness of being able to limit the range at both ends is debatable, but -if I didn't I'd get requests to do so, surely. - -============================================================================== - 8. FILTER *:Filter* *vimple-filter-command* -> - :Filter -< -The :Filter command behaves like an interactive :g/re/p on the current buffer. -Only matching lines are shown, with non-matching ones being filtered out. - -WARNING: This command alters your buffer contents. Using it from within a - buffer you don't intend to filter is ill advised. - - -NEW!: :Filter is now even fuzzier! That's right! Put _down_ your hair-drier, - because :Filter now automatically inserts `.*` whenever you press ! - Awesomes, right? Searching for /some/long/path/to/file.boring?! - Make it fun with s l p t f \o/ - -The :Filter command is heavily used by the |VimFindsMe| plugin from within its -browse window. - -============================================================================== - 9. QUICKFIX COMMANDS *vimple-quickfix-commands* - *QFdo* -NOTE: The location-list analogue for the QuickFix commands start with LL - -> - :QFdo - :LLdo -< -The :QFdo command performs the series of bar-separated ex-commands over the -buffers in the QuickFix list. - -Example: -> - :vimgrep /prince/j **/*.txt - :QFdo %s/Vim/frog/g -< -Will change all princes into frogs recursively throughout your txt files. - -NOTE: If you have the (https://github.com/dahu/grope) Grope plugin (which uses - the |location-list|, this is even easier: -> - :Grope /prince/ @@txt - :LLdo %s/Vim/frog/g -< - -> - :QFbufs - :LLbufs -< -Returns the unique list of buffer names within the QuickFix / Location list. - -> - :QFargs - :QFargslocal - :LLargs - :LLargslocal -< -Sets the |:args| or |:arglocal| from the relevant list. - -Example: -> - :vimgrep /prince/j **/*.txt - :tabnew | QFargslocal -< -Will open a new tab-page and set the local argument list to the unique set of -buffers contained within the QuickFix list. - - -============================================================================== - 10. BUFDO COMMANDS *vimple-bufdo-commands* - *BufDo* *BufTypeDo* *BufMatchDo* - -Example: -> - :BufTypeDo vim %s/func\\>\\ze/&tion/e -< - -Will replace 'func' with 'function' in all VIM files. - -Note the use of the 'e' |s_flags| to ignore errors where the search term -doesn't exist in a file. - -Example: -> - :Nexus 1 1 - :BufMatchDo test g/Test/s/\\d\\+/\\=Nexus() -< - -Will re-number the test cases in all files containing 'test' in their filename. - -NOTE: This example depends on https://github.com/dahu/Nexus - - -============================================================================== - 11. OVERLAY TOOLS *vimple-overlay-tools* - *vimple-z=* *vimple-[I* *vimple-g]* - -|z=| - -Shows |spell| suggestions in an overlay window. Pressing `` -will replace the word under the cursor in the original window with the -current word under the cursor in the overlay. - -Use `vimple_spell_suggest` if you want to map this behaviour -to a differnt key. - -|[I| - -Shows |ident-search| results in an overlay window. Pressing `` -will jump to the associated line of the identifier under the cursor. - -Use `vimple_ident_search` if you want to map this behaviour -to a differnt key. - -|g]| - -Shows |tag| search results in an overlay window. Pressing `` -will jump to the associated line of the tag under the cursor. - -Use `vimple_tag_search` if you want to map this behaviour -to a differnt key. - - - -============================================================================== - 12. SCOPE *vimple-scope* - -The Scope() function attempts to show the current function or class/method -scope. Some people like to display this information in their `statusline`, -like: -> - set statusline=%f%m%r%h%w\ [%n:%{&ff}/%Y]\%{Scope()}%=[0x\%04.4B][%03v][%p%%\ line\ %l\ of\ %L] -< - -Currently only Vim & Python (and Python only for testing purposes, created by -a NON Pythonista -- patches welcome) have been implemented, but it is very -easy for you to write scope functions for your own filetypes. Take Ruby for -example: Create `~/.vim/ftplugin/ruby_scope.vim` like this: - ----- -function! Scope_ruby() - let class_scope = scope#inspect('^\s*class\s\+\([a-zA-Z0-9_.]\+\)', '^\s*end') - let method_scope = scope#inspect('^\s*def\s\+\([a-zA-Z0-9_.]\+\)', '^\s*end') - return ' ' . join(map(class_scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' :: ') - \. ' >> ' . join(map(method_scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' > ') -endfunction ----- - -NOTE: The above example for Ruby is woefully inadequate. A better effect might -be achievable with more context in the regex patterns. The patterns in -`syntax/ruby.vim` might be useful. Parsing with regex is futile. - - -============================================================================== - 13. COMPOSABLE COMPLETIONS *vimple-completers* - *vimple-jj* - - -By default, `jj` in insert mode activates a user-extendible meta-completion -list. The default list includes abbreviations (if you have -https://github.com/dahu/Aboriginal), some date-time patterns and the built-in -dictionary completion (``). - -The default `jj` can be overridden like this: -> - imap vimple_completers_trigger -< - - vim:tw=78:ts=8:ft=help:norl: === removed file 'vim/bundle/vimple/doc/vimple_ls.txt' --- vim/bundle/vimple/doc/vimple_ls.txt 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/doc/vimple_ls.txt 1970-01-01 00:00:00 +0000 @@ -1,344 +0,0 @@ -*vimple#ls.txt* Plugin for accessing the :ls info programatically - - - VIM REFERENCE MANUAL by Barry Arthur - - -Help on using vimple#ls *vimple#ls* - -1. The Vimple Architecture |vimple#ls-architecture| -2. The Buffer List Object |vimple#ls-object| -3. Public Methods |vimple#ls-public_methods| -4. Plugins Using Vimple Buffer List |vimple#ls-plugins| - -============================================================================== - 1. THE VIMPLE ARCHITECTURE *vimple#ls-architecture* - -|Vimple| uses VimLOO (Object Oriented VimL) and so returns Objects which -contain methods to update and manipulate them. See OBJECT ORIENTED PROGRAMMING -in section |41.8| to learn more about VimLOO. - -============================================================================== - 2. THE BUFFER LIST OBJECT *vimple#ls-object* - -The Vimple Buffer List provides a scriptable interface to Vim's |:buffers| (or -|:ls|) command. - - *vimple#ls-constructor* -Constructor~ - -To instantiate a new vimple#ls object: -> - :let bl = vimple#ls#new() -< - -This will create a globally accessible object called: -> - bl -< - - 3. BUFFER LIST PUBLIC METHODS *vimple#ls-public-methods* - *vimple#ls-update()* ------------------------------------------------------------------------------- -Args: NONE~ - -Overview:~ - - Refreshes the object's internal buffer list data structure. - -Synopsis:~ -> - :call vimple#bl.update() -< -Description:~ - -Use this method to update the vimple#bl object's knowledge of Vim's -current buffer state. If you open new files or use |:bdelete| or |:bwipeout| -to remove buffers, you will need to manually update your vimple#ls -objects to reflect those changes. The need to call this manually for certain -vimple#ls calls might be removed in future versions. - -Return:~ - -The bl object which allows chaining of vimple#ls methods, like: -> - :echo vimple#bl.update().to_s() -< - - *vimple#ls-to_s()* ------------------------------------------------------------------------------- -Args: [format]~ - -Overview:~ - - Returns a string representation of the buffer list. - -Synopsis:~ -> - :echo vimple#bl.to_s( ... ) -< -Description:~ - -This method returns a simple textual representation of the buffer list. The -default (without arguments) tries to emulate the layout of the builtin |:ls| -output. This method should be used with Vim's :echo or :let statements, like: -> - :echo vimple#bl.to_s() - :echo vimple#bl.to_s("%n\n") - :let my_buffers = split(vimple#bl.to_s("%n\n"), "\n") -< - -Arguments:~ - -format~ - -Using a printf-like format specifier, you can alter the appearance of the -output. The available format specifiers are: - -- %b buffer number -- %n name -- %f flags -- %l cursor line - -Return:~ - -A string of newline terminated buffer list entries similar to the |:ls| -builtin. - -NOTE: Currently you have to manually call vimple#bl.update() before calling -vimple#bl.to_s() if you want the latest information. This may change in a -future version. - - *vimple#ls-to_l()* ------------------------------------------------------------------------------- -Args: [buffer_property]~ - -Overview:~ - - Returns a list representation of the buffer list. - -Synopsis:~ -> - :echo vimple#bl.to_l( ... ) -< -Description:~ - -This method returns a list representation of the buffer list. - -Arguments:~ - -The to_l() method is actually just a wrapper for the |vimple#ls-buffers()| -method. See that method for details about the buffer_property argument. - -Return:~ - -The to_l() method returns a list of dictionaries, each with the following -fields (with example values): -> - {'active': 0, - 'number': '1', - 'alternate': 0, - 'name': 'doc/buffer_list.txt', - 'readonly': 0, - 'current': 1, - 'line': '1', - 'modified': 0, - 'modifiable': 1, - 'hidden': 0, - 'read_error': 0, - 'listed': 1 - } -< - -NOTE: Currently you have to manually call vimple#bl.update() before calling -vimple#bl.to_l() if you want the latest information. This may change in a -future version. - - *vimple#ls-to_d()* ------------------------------------------------------------------------------- -Args: [buffer_property]~ - -Overview:~ - - Returns a dictionary representation of the buffer list. - -Synopsis:~ -> - :echo vimple#bl.to_d( ... ) -< -Description:~ - -This method returns a dictionary representation of the buffer list. The key -for each entry in the dictionary is the buffer number as shown by |:ls| - -Arguments:~ - -The to_d() method is actually just a wrapper for the |vimple#ls-buffers()| -method. See that method for details about the buffer_property argument. - -Return:~ - -The to_d() method returns a dictionary of dictionaries with the following -fields (with example values): -> - {'1': - {'active': 0, - 'number': '1', - 'alternate': 0, - 'name': 'doc/buffer_list.txt', - 'readonly': 0, - 'current': 1, - 'line': '1', - 'modified': 0, - 'modifiable': 1, - 'hidden': 0, - 'read_error': 0, - 'listed': 1 - } - } -< - -NOTE: Currently you have to manually call vimple#bl.update() before calling -vimple#bl.to_d() if you want the latest information. This may change in a -future version. - - *vimple#ls-print()* ------------------------------------------------------------------------------- -Args: [show_unlisted]~ - -Overview:~ - - Prints (colourfully) the buffer list. - -Synopsis:~ -> - :call vimple#bl.print( BOOL ) -< -Description:~ - -Use this method to print to the screen a coloured representation of the buffer -list. The layout resembles the builtin |:ls| command but is by default -coloured to show important information more obviously. See the -autoload/vimple/vimple.vim file to see how to customise the colours used by -vimple#ls.print(). - -Arguments:~ - -show_unlisted~ - -If this boolean argument is not false then all buffers (including the unlisted -ones) are printed (as with the |:ls!| command. With no argument or one that -evaluates to false, only the listed buffers are shown (as with the |:ls| -command). - -Return:~ - -The bl object (for chaining), although it's not immediately clear how this -could be useful (for the print() method), but a design decision was made to -return the bl object for all methods that didn't have to explicitly return a -different type (as the to_x() methods do). - -NOTE: Unlike most of the other methods, the print() method -does- update the -buffer list (with an internal call to update()) prior to printing. - - *vimple#ls-filter()* ------------------------------------------------------------------------------- -Args: [filter]~ - -Overview:~ - - Auxilliary method used to filter out desired buffers only. - -Synopsis:~ -> - :call vimple#bl.filter( ... ) -< -Description:~ - -The filter() method selects buffers from the internal list based on the -criteria provided in the argument. This method is used heavily internally by -other public methods, like the to_l() and to_d() and buffers() methods. This -method returns a new vimple#ls object containing only the selected buffers. - -Arguments:~ - -filter~ - -The vimple#ls#filter() method uses the built-in |filter()| function which -uses the |v:val| variable to aaccess the elements of the internal buffer -properties. Call filter() like this: -> - :call vimple#bl.filter('v:val.modified').print() - :call vimple#bl.filter('v:val.name =~ "\.txt$"').print() - :echo vimple#bl.filter('v:val.name =~ "\.txt$"').to_s() -< -The available v:val properties are: - -- active -- alternate -- current -- hidden -- line -- listed -- modifiable -- modified -- name -- number -- read_error -- readonly - -Return:~ - -The bl object (for chaining). - - *vimple#ls-buffers()* ------------------------------------------------------------------------------- -Args: [buffer_property]~ - -Overview:~ - - Simplified filter wrapper. - -Synopsis:~ -> - :echo vimple#bl.buffers( ... ) -< -Description:~ - -This utility method provides a simpler way to filter based on the flags -commonly used to select buffers. - -Arguments:~ - -buffer_property~ - -Call buffers() like this: -> - :echo vimple#bl.buffers('modified') - :echo vimple#bl.buffers('hidden') -< -The available buffer properties are: - -- active -- hidden -- listed -- modifiable -- modified -- read_error -- readonly - -Return:~ - -The bl object (for chaining). - - -============================================================================== - 4. PLUGINS USING VIMPLE BUFFER LIST *vimple#ls-plugins* - -Vimple was designed to be a library for Vim developers and plugin writers. The -currently known plugins using Vimple: - -- the buffalo (https://github.com/Raimondi/vim-buffalo) - A lightning fast - buffer switching tool using fuzzy matching. - - vim:tw=78:ts=8:ft=help:norl: === removed directory 'vim/bundle/vimple/ftplugin' === removed file 'vim/bundle/vimple/ftplugin/python_scope.vim' --- vim/bundle/vimple/ftplugin/python_scope.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/ftplugin/python_scope.vim 1970-01-01 00:00:00 +0000 @@ -1,6 +0,0 @@ -function! Scope_python() - let class_scope = scope#inspect('^\s*class\s\+\([a-zA-Z0-9_.]\+\)', '\ze\n\(\s*class\|\S\)') - let method_scope = scope#inspect('^\s*def\s\+\([a-zA-Z0-9_.]\+\)', '.\(\n\(\n\|\S\)\)\@=') - return ' ' . join(map(class_scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' :: ') - \. ' >> ' . join(map(method_scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' > ') -endfunction === removed file 'vim/bundle/vimple/ftplugin/vim_scope.vim' --- vim/bundle/vimple/ftplugin/vim_scope.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/ftplugin/vim_scope.vim 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -function! Scope_vim() - let scope = scope#inspect('^\s*fu\%[nction]!\?\s*\([a-zA-Z0-9_#.]\+\)', '^\s*endf\%[unction]') - return ' ' . join(map(scope.stack, 'v:val.head_line_number . "," . v:val.tail_line_number . " " . v:val.head_string'), ' > ') -endfunction === removed directory 'vim/bundle/vimple/plugin' === removed file 'vim/bundle/vimple/plugin/vimple.vim' --- vim/bundle/vimple/plugin/vimple.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/plugin/vimple.vim 1970-01-01 00:00:00 +0000 @@ -1,438 +0,0 @@ -function! s:SID() - return "" . matchstr(expand(''), '\zs\d\+_\zeSID$') -endfun - -if !exists('g:vim_home') - let vim_home = fnamemodify($MYVIMRC, ':p:h') -endif -if !exists('g:vim_bundle_home') - let vim_bundle_home = g:vim_home . '/bundle/' -endif - -" example call: -" call PathogenAddPlugin(g:vim_bundle_home . '/unused/csapprox{}') -function! PathogenAddPlugin(plugin) - call pathogen#surround(a:plugin) - silent! runtime! plugin/*.vim -endfunction - -function! CurrentPartialWord() - let p = searchpos('\W\zs\w\+\%#', 'bnW') - let b:partial_word = strpart(getline('.'), p[1]-1, col('.')-p[1]) -endfunction - -augroup Vimple - au! - autocmd CursorMovedI * call CurrentPartialWord() -augroup END - -function! Scope() - let ft = tolower(&ft) - if exists('*Scope_' . ft) - return call('Scope_' . ft, []) - endif -endfunction - -if ! exists('g:vimple_override_file_complete') - let g:vimple_override_file_complete = 0 -endif -if ! exists('g:vimple_file_complete_short') - let g:vimple_file_complete_short = 0 -endif -if ! exists('g:vimple_override_line_complete') - let g:vimple_override_line_complete = 0 -endif - -if g:vimple_override_file_complete - if g:vimple_file_complete_short - inoremap complete#trigger('complete#short_files_in_path') - else - inoremap complete#trigger('complete#files_in_path') - endif -endif -if g:vimple_override_line_complete - inoremap complete#trigger('complete#foist') -endif - -function! ExtendedRegexObject(...) - return call('regex#ExtendedRegex', a:000) -endfunction - -" ERex is a global object with access to Vim's vars: -let ERex = ExtendedRegexObject() - - -function! TagSearch() - let ident = expand('') - if exists('s:tags') - unlet s:tags - endif - let s:tags = taglist(ident) - if empty(s:tags) - echohl Warning - echom 'Tag not found: ' . ident - echohl None - return - endif - let data = map(copy(s:tags), 'v:key . " " . v:val.name . "\t" . v:val.filename') - call overlay#show( - \ data - \, { - \ '' : ':call ' . s:SID() . 'tagsearchaccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! s:tagsearchaccept() - let ident = matchstr(overlay#select_line(), '^\d\+') - let fname = s:tags[ident].filename - if bufnr(fname) == -1 - exec 'edit ' . fname - else - exec 'buffer ' . fname - endif - silent! exe s:tags[ident].cmd -endfunction - -nnoremap vimple_tag_search :call TagSearch() - -if !hasmapto('vimple_tag_search') - nmap g] vimple_tag_search -endif - - -function! IdentSearch(type) - let type = a:type ? ']I' : '[I' - try - let data = vimple#redir('norm! ' . type) - catch '^Vim\%((\a\+)\)\=:E389:' - echohl Warning - echom 'Could not find pattern' - echohl None - return - endtry - call overlay#show( - \ data - \, { - \ '' : ':call ' . s:SID() . 'identsearchaccept(' . a:type . ')' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! s:identsearchaccept(type) - let type = a:type ? ']' : '[' - let num = matchstr(overlay#select_line(), '\d\+') - exe 'silent! norm! ' . num . type . "\t" -endfunction - -nnoremap vimple_ident_search :call IdentSearch(0) -nnoremap vimple_ident_search_forward :call IdentSearch(1) - -if !hasmapto('vimple_ident_search') - nmap [I vimple_ident_search -endif - -if !hasmapto('vimple_ident_search_forward') - nmap ]I vimple_ident_search_forward -endif - - - -function! SpellSuggest(ident) - call overlay#show( - \ s:getsuggestions(a:ident) - \, { - \ '' : ':call ' . s:SID() . 'spellsuggestaccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 0, 'use_split' : 1}) -endfunction - -function! s:getsuggestions(ident) - let spell = &spell - if ! spell - set spell - endif - let suggestions = list#lspread(spellsuggest(a:ident), 5) - if ! spell - set nospell - endif - return suggestions -endfunction - -function! s:spellsuggestaccept() - let line = getline('.') - let idx = strlen(substitute(line[:col('.')], '[^\t]', '', 'g')) - let word_list = split(line, '\t') - call overlay#close() - let [r1, r2] = [@@, @-] - exe 'norm! ciw' . word_list[idx] - let [@@, @-] = [r1, r2] -endfunction - -nnoremap vimple_spell_suggest :call SpellSuggest(expand('')) - -if !hasmapto('vimple_spell_suggest') - nmap z= vimple_spell_suggest -endif - - -function! BufGrep(pattern) - let pattern = a:pattern - let fc = pattern[0] - let lc = pattern[-1] - if fc !~ '[[:punct:]]' - let fc = '/' - let lc = '/' - elseif fc != lc - let lc = fc - let pattern = pattern[1:] - else - let pattern = pattern[1:-2] - endif - let pattern = escape(pattern, fc) - - let data = vimple#redir('global ' . fc . pattern . lc . '#') - if data[0] =~ 'Pattern not found:' - echohl Warning - echo data[0] - echohl None - return - endif - call overlay#show( - \ data - \, { - \ '' : ':call ' . s:SID() . 'bufgrepaccept()' - \ , 'q' : ':call overlay#close()' - \ } - \, {'filter' : 1, 'use_split' : 1}) -endfunction - -function! s:bufgrepaccept() - let num = matchstr(overlay#select_line(), '\d\+') - exe 'silent! norm! ' . num . "G" -endfunction - -command! -nargs=* G call BufGrep() - -function! StringScanner(first, last, command, ...) - let args = [] - if a:0 - let args = a:000 - endif - let ss = string#scanner(getline(a:first, a:last)) - let g:vimple#ss = call(eval('ss.' . a:command), args, ss) - return g:vimple#ss -endfunction - -command! -bar -range=% -nargs=+ StringScanner echo StringScanner(, , ) - -function! Mkvimrc() - let rtp = uniq(map(filter(map(getline(1, '$'), - \ 'matchstr(v:val, "^\\s*\\d\\+:\\s\\+\\zs.*")'), 'v:val != ""'), - \ 'fnameescape(substitute(v:val, "/\\(autoload\\|colors\\|compiler\\|doc\\|ftdetect\\|ftplugin\\|indent\\|keymap\\|lang\\|plugin\\|syntax\\).*", "", ""))')) - - if empty(rtp) - echohl Error - echom 'Mkvimrc: Buffer does not contain :scriptnames output' - echohl None - return - endif - let vimrc_lines = [ - \ "set nocompatible" - \ , "let &rtp = join(" . string(map(rtp, 'fnameescape(v:val)')) . ", ',') . ',' . &rtp" - \ , "filetype plugin indent on" - \ , "syntax enable" - \ ] - let datetime = localtime() - let vimrc_file = './vimrc-' . datetime - call writefile(vimrc_lines, vimrc_file) - return vimrc_file -endfunction - -command! -nargs=0 -bar Mkvimrc echom Mkvimrc() - -function! BufDo(cmds) - let old_hidden = &hidden - set hidden - tabnew - echom 'bufdo ' . a:cmds - exe 'bufdo ' . a:cmds - tabclose - let &hidden = old_hidden -endfunction - -function! BufTypeDo(args) - let [type; commands] = split(a:args, ' ') - let cmds = join(commands) - call BufDo('if &ft ==? "' . escape(type, '"') . '" | exe "' . escape(cmds, '"') . '" | endif') -endfunction - -function! BufMatchDo(args) - let [pattern; commands] = split(a:args, ' ') - let cmds = join(commands) - call BufDo('if expand("%") =~? "' . escape(pattern, '"') . '" | exe "' . escape(cmds, '"') . '" | endif') -endfunction - -command! -nargs=+ BufTypeDo call BufTypeDo() -command! -nargs=+ BufMatchDo call BufMatchDo() - -function! QFbufs() - return quickfix#bufnames() -endfunction - -command! -bar QFargs call quickfix#to_args(1) -command! -bar QFargslocal call quickfix#to_args(0) -command! -bar LLargs call loclist#to_args(1) -command! -bar LLargslocal call loclist#to_args(0) - -command! -bar QFbufs echo quickfix#bufnames() -command! -bar LLbufs echo loclist#bufnames() - -command! -nargs=+ QFdo call quickfix#do() -command! -nargs=+ LLdo call loclist#do() - -command! -range -nargs=0 Filter call vimple#filter(getline(1,'$'), {}).filter() -nnoremap vimple_filter :Filter - -if !hasmapto('vimple_filter') - nmap cf vimple_filter -endif - -" Takes a range as well as optional start and end lines to extract from the -" file. If both ends of the range are given, the shorter of first:last vs -" start:end will be used to fill the range. -function! ReadIntoBuffer(file, ...) range - let first = a:firstline - let last = a:lastline - let lines = readfile(a:file) - let start = 0 - let end = len(lines) - if a:0 - let start = a:1 - 1 - if a:0 > 1 - let end = a:2 - 1 - endif - endif - if start > len(lines) - return - endif - let lines = lines[start : end] - if len(lines) > (last-first) - let lines = lines[0:(last-first-1)] - endif - call append(first, lines) -endfunction - -command! -range -nargs=+ -complete=file ReadIntoBuffer ,call ReadIntoBuffer() - -function! View(cmd) - call ShowInNewBuf(vimple#redir(a:cmd)) -endfunction - -if ! exists('g:vimple_auto_filter') - let g:vimple_auto_filter = ['view', 'vfm'] -endif - -function! ShowInNewBuf(data) - call overlay#show(a:data, {'q' : ':call overlay#close()'}, {'use_split' : 1, 'filter' : index(g:vimple_auto_filter, 'view') != -1}) -endfunction - -command! -nargs=+ -complete=command View call View() -command! -nargs=+ -complete=command ViewExpr call ShowInNewBuf(eval()) -command! -nargs=+ -complete=command ViewSys call ShowInNewBuf(split(system(), "\n")) - -function! Collect(args) - let [regvar; command] = split(a:args) - let cmd = join(command, " ") - let list = &list - set nolist - let buf = join(vimple#redir(cmd), "\n") - if list - set list - endif - if len(regvar) > 1 - exe 'let ' . regvar . '="' . escape(buf, '"') . '"' - else - call setreg(regvar, buf) - endif - return split(buf, '\n') -endfunction - -function! GCollect(pattern) - return map(Collect('_ g/' . a:pattern), 'substitute(v:val, "^\\s*\\d\\+\\s*", "", "")') -endfunction - -function! GCCollect(pattern) - return map(map(Collect('_ g/' . a:pattern), 'join(split(v:val, "^\\s*\\d\\+\\s*"))'), - \ 'substitute(v:val, a:pattern, "", "")') -endfunction - -function! VCollect(pattern) - return map(Collect('_ v/' . a:pattern), 'substitute(v:val, "^\\s*\\d\\+\\s*", "", "")') -endfunction - -function! VCCollect(pattern) - return map(map(Collect('_ v/' . a:pattern), 'join(split(v:val, "^\\s*\\d\\+\\s*"))'), - \ 'substitute(v:val, a:pattern, "", "")') -endfunction - -command! -nargs=+ Collect call Collect() -command! -nargs=+ GCollect let GC = GCollect() - -function! SCall(script, function, args) - let scripts = g:vimple#sn.update().filter_by_name(a:script).to_l() - if len(scripts) == 0 - echo "SCall: no script matches " . a:script - return - elseif len(scripts) > 1 - echo "SCall: more than one script matches " . a:script - endif - let func = '' . scripts[0]['number'] . '_' . a:function - if exists('*' . func) - return call(func, a:args) - else - echo "SCall: no function " . func . " in script " . a:script - return - endif -endfunction - -command! -nargs=+ Silently exe join(map(split(, '|'), '"silent! ".v:val'), '|') - - -" " Pre-initialise library objects -if get(g:, 'vimple_init_vars', 1) - if get(g:, 'vimple_init_bl', 1) - let vimple#bl = vimple#ls#new() - endif - if get(g:, 'vimple_init_hl', 1) - let vimple#hl = vimple#highlight#new() - endif - if get(g:, 'vimple_init_sn', 1) - let vimple#sn = vimple#scriptnames#new() - endif - if get(g:, 'vimple_init_vn', 1) - let vimple#vn = vimple#version#new() - endif - if get(g:, 'vimple_init_ma', 1) - let vimple#ma = vimple#marks#new() - endif - if get(g:, 'vimple_init_ul', 1) - let vimple#ul = vimple#undolist#new() - endif - if get(g:, 'vimple_init_mp', 1) - let vimple#mp = vimple#map#new() - endif - if get(g:, 'vimple_init_op', 0) - let vimple#op = vimple#options#new() - endif -endif - -call vimple#default_colorscheme() - -call completers#init() - -" disabled by default -" let vimple#au = vimple#autocmd#new() === removed directory 'vim/bundle/vimple/syntax' === removed file 'vim/bundle/vimple/syntax/vimple_jumplist.vim' --- vim/bundle/vimple/syntax/vimple_jumplist.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/syntax/vimple_jumplist.vim 1970-01-01 00:00:00 +0000 @@ -1,11 +0,0 @@ -syn match VJL_X /^.\s*0\s\+/ conceal contained -syn match VJL_L /^l \d\+\s\+/ conceal contained -syn match VJL_F /^f \d\+\s\+/ conceal contained - -syn match VJL_TextLine /^l.*/ contains=VJL_L -syn match VJL_FileLine /^f.*/ contains=VJL_F -syn match VJL_CurrLine /^.\s*0.*/ contains=VJL_X - -hi link VJL_CurrLine Constant -hi link VJL_TextLine String -hi link VJL_FileLine Comment === removed directory 'vim/bundle/vimple/test' === removed file 'vim/bundle/vimple/test/Makefile' --- vim/bundle/vimple/test/Makefile 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/Makefile 1970-01-01 00:00:00 +0000 @@ -1,11 +0,0 @@ -# Run tests -# Barry Arthur, 2014-05-10 12:12 - -all: - runVimTests.sh -1 *.vim - -clean: - rm *.tap *.msgout - -# vim:ft=make -# === removed file 'vim/bundle/vimple/test/README' --- vim/bundle/vimple/test/README 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/README 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -The plugins runVimTests (http://www.vim.org/scripts/script.php?script_id=2565) -and VimTAP (http://www.vim.org/scripts/script.php?script_id=2213) are needed to -run these tests. - -Besides the _setup.vim configuration file present in this repo you need to -create a global one and place it in the same dir where the runVimTests -executable is located. Assuming the executable is at '~/bin/runVimTests' this -global configuration file should be '~/bin/runVimTestsSetup.vim' and should -have something like the following lines inside of it: - -" Prepend tests repos to &rtp -let &runtimepath = '/path/to/runVimTests_dir,' . &rtp -let &runtimepath = '/path/to/vimTAP_dir,' . &rtp === removed file 'vim/bundle/vimple/test/_setup.vim' --- vim/bundle/vimple/test/_setup.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/_setup.vim 1970-01-01 00:00:00 +0000 @@ -1,16 +0,0 @@ -let &rtp = expand(':p:h:h') . ',' . &rtp . ',' . expand(':p:h:h') . '/after' - -runtime plugin/vimple.vim -runtime plugin/string.vim - -function! Ok(test, desc) - return vimtap#Ok(a:test, '"' . escape(a:test, '"') . '"', a:desc) -endfunction - -function! Is(got, expected, desc) - return vimtap#Is(a:got, a:expected, '"' . escape(a:got, '"') . '"', a:desc) -endfunction - -function! Isnt(got, unexpected, desc) - return vimtap#Isnt(a:got, a:unexpected, '"' . escape(a:got, '"') . '"', a:desc) -endfunction === removed file 'vim/bundle/vimple/test/buffer_list.vim' --- vim/bundle/vimple/test/buffer_list.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/buffer_list.vim 1970-01-01 00:00:00 +0000 @@ -1,19 +0,0 @@ -call vimtest#StartTap() -call vimtap#Plan(6) " <== XXX Keep plan number updated. XXX - -" silent! call vimple#redir('set') -call Is(type(vimple#bl.buffers()), type({}), 'buffers() returns a dict') -call vimtap#Diag(vimple#bl.to_s()) -call Ok(vimple#bl.to_s() =~ '^ 1 %a\?\s\+".\{-}" line 1', 'Check to_s() output') - -let blist = vimple#bl.to_l() -call Ok(len(blist) == 1, 'Check to_l() output.:'.string(blist).':') -call Ok(has_key(blist[0], 'number') == 1, 'Check to_l() content.:'.string(blist).':') -call Ok(blist[0]['number'] == 1, 'Check to_l() buffer number.:'.string(blist).':') - -new -call vimple#bl.update() -call Ok(len(vimple#bl.to_l()) == 2, 'update() works') - -call vimtest#Quit() - === removed file 'vim/bundle/vimple/test/ini_001.ini' --- vim/bundle/vimple/test/ini_001.ini 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/ini_001.ini 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -; ignore this -; and this - -this_var = bare -another var = with whitespace - -[section1] -name = some 'string' here -age = 10 - -[section 2] -name = some "other" string -age = 20 === removed file 'vim/bundle/vimple/test/ini_001_out.ini' --- vim/bundle/vimple/test/ini_001_out.ini 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/ini_001_out.ini 1970-01-01 00:00:00 +0000 @@ -1,8 +0,0 @@ -another var = with whitespace -this_var = bare -[section1] -age = 10 -name = some 'string' here -[section 2] -age = 20 -name = some "other" string === removed file 'vim/bundle/vimple/test/ini_002.ini' --- vim/bundle/vimple/test/ini_002.ini 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/ini_002.ini 1970-01-01 00:00:00 +0000 @@ -1,5 +0,0 @@ -; lists -[s1] -lines = [1, 2, 5, 9, 10] -peeps = {'bob': {'age': 20, 'sex': 'male'}, 'alice': {'age': 20, 'sex': 'female'}} -sep = \t === removed file 'vim/bundle/vimple/test/ini_002_out.ini' --- vim/bundle/vimple/test/ini_002_out.ini 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/ini_002_out.ini 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -[s1] -peeps = {'alice': {'age': 20, 'sex': 'female'}, 'bob': {'age': 20, 'sex': 'male'}} -sep = \t -lines = [1, 2, 5, 9, 10] === removed file 'vim/bundle/vimple/test/parse_ini_001.vim' --- vim/bundle/vimple/test/parse_ini_001.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/parse_ini_001.vim 1970-01-01 00:00:00 +0000 @@ -1,9 +0,0 @@ -call vimtest#StartTap() -call vimtap#Plan(1) " <== XXX Keep plan number updated. XXX - -let ini_hash = parse#ini#from_file('ini_001.ini') -call parse#ini#to_file(ini_hash, 'ini_001_out.ini') - -call Is(parse#ini#from_file('ini_001_out.ini'), ini_hash , 'round-trip') - -call vimtest#Quit() === removed file 'vim/bundle/vimple/test/parse_ini_002.vim' --- vim/bundle/vimple/test/parse_ini_002.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/parse_ini_002.vim 1970-01-01 00:00:00 +0000 @@ -1,9 +0,0 @@ -call vimtest#StartTap() -call vimtap#Plan(1) " <== XXX Keep plan number updated. XXX - -let ini_hash = parse#ini#from_file('ini_002.ini') -call parse#ini#to_file(ini_hash, 'ini_002_out.ini') - -call Is(parse#ini#from_file('ini_002_out.ini'), ini_hash , 'round-trip') - -call vimtest#Quit() === removed file 'vim/bundle/vimple/test/string001.vim' --- vim/bundle/vimple/test/string001.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/string001.vim 1970-01-01 00:00:00 +0000 @@ -1,48 +0,0 @@ -call vimtest#StartTap() -call vimtap#Plan(19) " <== XXX Keep plan number updated. XXX - -let s = 'this is a string' -let S = string#scanner(s) - -call Is(S.skip('\w\+') , 4 , 'skips a word') -call Is(S.skip('\s\+') , 6 , 'skips a space') -call Is(S.skip('\s\+') , -1 , '"fail" if pattern to skip not found') -call Is(S.skip('\w\+') , 8 , 'skips another word') -call Is(S.scan('\w\+') , '' , 'no word to scan here') -call Is(S.index , 8 , 'index unchanged from unsuccessful scan') -call Is(S.skip('\d\+') , -1 , 'no digits to skip') -call Isnt(S.skip('\s\+') , -1 , 'skip over whitespace') -call Is(S.scan('\w\+') , 'a' , 'get next word') - -let s = 'this is a string' -let S = string#scanner(s) - -call Is(S.skip('\_s\+') , -1 , 'no leading whitespace to skip') -call Is(S.scan('\w\+') , 'this' , 'scan "this"') -call Isnt(S.skip('\s\+') , -1 , 'skip whitespace') -call Is(S.scan('\w\+') , 'is' , 'scan "is"') -call Isnt(S.skip('\s\+') , -1 , 'skip whitespace') - -let s = 'this is a string' -let S = string#scanner(s) - -call Is(S.skip_until('string') , 10 , 'skips until a target') -call Is(S.scan('\w\+') , 'string' , 'scan collects the pattern match') - -let s = "one foo\ntwo foo" -let S = string#scanner(s) - -call Is(S.inject("\n").string , "\none foo\ntwo foo" , 'inject at start') -call S.skip('\_s*\w\+') -call Is(S.inject("\n").string , "\none\n foo\ntwo foo" , 'inject inside string') - - - -let s = "one foo\ntwo foo\nthree foo\nfour foo\n" -let S = string#scanner(s) - -call Is(S.collect('\n\zs\w\+') , ['one', 'two', 'three', 'four'] , 'collect by pattern') - - - -call vimtest#Quit() === removed file 'vim/bundle/vimple/test/vimple001.vim' --- vim/bundle/vimple/test/vimple001.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/vimple001.vim 1970-01-01 00:00:00 +0000 @@ -1,18 +0,0 @@ -call vimtest#StartTap() -call vimtap#Plan(2) " <== XXX Keep plan number updated. XXX - -redir => test -set filetype? -redir END -let result = vimple#redir('set filetype?') -call Is(result, split(test, '\n'), '#redir()') -unlet test -unlet result - -let test = ' 12.35' -let result = vimple#format('%8.2l', {'l': ['f', '12.3456']}, '') -call Is(result, test, '#format()') -unlet test -unlet result - -call vimtest#Quit() === removed file 'vim/bundle/vimple/test/vimple002.vim' --- vim/bundle/vimple/test/vimple002.vim 2015-08-25 11:57:14 +0000 +++ vim/bundle/vimple/test/vimple002.vim 1970-01-01 00:00:00 +0000 @@ -1,15 +0,0 @@ -call vimtest#StartTap() -call vimtap#Plan(2) " <== XXX Keep plan number updated. XXX - -hi VimpleTestHi term=bold,reverse cterm=bold ctermbg=239 gui=bold guibg=#4e4e4e - -call vimple#hl.update() -let result = vimple#hl.filter_by_term('VimpleTestHi').to_l() - -call Is(len(result), 1, 'handle commas in highlights') -call Is(result[0]['attrs'] - \, 'term=bold,reverse cterm=bold ctermbg=239 gui=bold guibg=#4e4e4e' - \, 'handle commas in highlights') - -call vimtest#Quit() -