=== modified file 'vim/bundle/SearchParty/.git/index' Binary files vim/bundle/SearchParty/.git/index 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/index 2015-02-13 10:04:41 +0000 differ === modified file 'vim/bundle/SearchParty/.git/logs/HEAD' --- vim/bundle/SearchParty/.git/logs/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/logs/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 61aa4f431a29b065238554b37206187febb31967 Jan Pobrislo 1440501775 +0200 clone: from https://github.com/dahu/SearchParty.git +0000000000000000000000000000000000000000 cf496298833c3ce5df74fd23c814596d0d3acfd5 Jan Pobrislo 1423821864 +0100 clone: from https://github.com/dahu/SearchParty.git === modified file 'vim/bundle/SearchParty/.git/logs/refs/heads/master' --- vim/bundle/SearchParty/.git/logs/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/logs/refs/heads/master 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 61aa4f431a29b065238554b37206187febb31967 Jan Pobrislo 1440501775 +0200 clone: from https://github.com/dahu/SearchParty.git +0000000000000000000000000000000000000000 cf496298833c3ce5df74fd23c814596d0d3acfd5 Jan Pobrislo 1423821864 +0100 clone: from https://github.com/dahu/SearchParty.git === modified file 'vim/bundle/SearchParty/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/SearchParty/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/logs/refs/remotes/origin/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 61aa4f431a29b065238554b37206187febb31967 Jan Pobrislo 1440501775 +0200 clone: from https://github.com/dahu/SearchParty.git +0000000000000000000000000000000000000000 cf496298833c3ce5df74fd23c814596d0d3acfd5 Jan Pobrislo 1423821864 +0100 clone: from https://github.com/dahu/SearchParty.git === removed directory 'vim/bundle/SearchParty/.git/objects/04' === removed file 'vim/bundle/SearchParty/.git/objects/04/69dd58c1d5e5d3ad646caa3705e187e6b235d8' Binary files vim/bundle/SearchParty/.git/objects/04/69dd58c1d5e5d3ad646caa3705e187e6b235d8 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/04/69dd58c1d5e5d3ad646caa3705e187e6b235d8 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/SearchParty/.git/objects/0e' === added file 'vim/bundle/SearchParty/.git/objects/0e/f7aa387282b88129583a6c7ce753b61a95cad0' Binary files vim/bundle/SearchParty/.git/objects/0e/f7aa387282b88129583a6c7ce753b61a95cad0 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/0e/f7aa387282b88129583a6c7ce753b61a95cad0 2015-02-13 09:59:55 +0000 differ === added directory 'vim/bundle/SearchParty/.git/objects/10' === added file 'vim/bundle/SearchParty/.git/objects/10/dddc1028cffc77e470cc9c2fcf07abf6bac39d' Binary files vim/bundle/SearchParty/.git/objects/10/dddc1028cffc77e470cc9c2fcf07abf6bac39d 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/10/dddc1028cffc77e470cc9c2fcf07abf6bac39d 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/SearchParty/.git/objects/2a' === removed file 'vim/bundle/SearchParty/.git/objects/2a/c86beb7c65c049354cec894ae2d5dc9e27004c' Binary files vim/bundle/SearchParty/.git/objects/2a/c86beb7c65c049354cec894ae2d5dc9e27004c 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/2a/c86beb7c65c049354cec894ae2d5dc9e27004c 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/SearchParty/.git/objects/31' === added file 'vim/bundle/SearchParty/.git/objects/31/b0582f7c437f125ee3e52df03ac64065ccd43a' Binary files vim/bundle/SearchParty/.git/objects/31/b0582f7c437f125ee3e52df03ac64065ccd43a 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/31/b0582f7c437f125ee3e52df03ac64065ccd43a 2015-02-13 09:59:55 +0000 differ === added directory 'vim/bundle/SearchParty/.git/objects/54' === added file 'vim/bundle/SearchParty/.git/objects/54/5781fc55e57c09f56c46dbcf6afea4645ae903' Binary files vim/bundle/SearchParty/.git/objects/54/5781fc55e57c09f56c46dbcf6afea4645ae903 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/54/5781fc55e57c09f56c46dbcf6afea4645ae903 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/SearchParty/.git/objects/61' === removed file 'vim/bundle/SearchParty/.git/objects/61/aa4f431a29b065238554b37206187febb31967' --- vim/bundle/SearchParty/.git/objects/61/aa4f431a29b065238554b37206187febb31967 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/objects/61/aa4f431a29b065238554b37206187febb31967 1970-01-01 00:00:00 +0000 @@ -1,1 +0,0 @@ -xMJ1]%;D x2?c:x{ W_U:ceMD#S"JViU蓊3[]1Rtpש FXwAw"Tzx5>Xst`DF*;Uý k\=cuϗǩ B+!RwZ}P\iL;m΀HK{~=L֦} e\Co.[ QnY \ No newline at end of file === added file 'vim/bundle/SearchParty/.git/objects/82/88250cca4479d4045d15c59a4d59948517af5a' Binary files vim/bundle/SearchParty/.git/objects/82/88250cca4479d4045d15c59a4d59948517af5a 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/82/88250cca4479d4045d15c59a4d59948517af5a 2015-02-13 09:59:55 +0000 differ === removed file 'vim/bundle/SearchParty/.git/objects/82/faec3c27750e6d6c8714af186959d466623565' Binary files vim/bundle/SearchParty/.git/objects/82/faec3c27750e6d6c8714af186959d466623565 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/82/faec3c27750e6d6c8714af186959d466623565 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/SearchParty/.git/objects/9c' === added file 'vim/bundle/SearchParty/.git/objects/9c/8678d7300a89ef69099835a8c1b7c13534c33a' Binary files vim/bundle/SearchParty/.git/objects/9c/8678d7300a89ef69099835a8c1b7c13534c33a 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/9c/8678d7300a89ef69099835a8c1b7c13534c33a 2015-02-13 09:59:55 +0000 differ === removed file 'vim/bundle/SearchParty/.git/objects/a0/62e92d3cd3e14ae061198f5db4cc3092f82210' Binary files vim/bundle/SearchParty/.git/objects/a0/62e92d3cd3e14ae061198f5db4cc3092f82210 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/a0/62e92d3cd3e14ae061198f5db4cc3092f82210 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/SearchParty/.git/objects/a9' === removed file 'vim/bundle/SearchParty/.git/objects/a9/2484251c55bf8c3dc84e5ab11488b18625a1d7' Binary files vim/bundle/SearchParty/.git/objects/a9/2484251c55bf8c3dc84e5ab11488b18625a1d7 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/a9/2484251c55bf8c3dc84e5ab11488b18625a1d7 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/SearchParty/.git/objects/c9' === removed file 'vim/bundle/SearchParty/.git/objects/c9/8e49ffe5a328e473cbf3d26580723981e4519c' Binary files vim/bundle/SearchParty/.git/objects/c9/8e49ffe5a328e473cbf3d26580723981e4519c 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/c9/8e49ffe5a328e473cbf3d26580723981e4519c 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/SearchParty/.git/objects/cf' === added file 'vim/bundle/SearchParty/.git/objects/cf/496298833c3ce5df74fd23c814596d0d3acfd5' --- vim/bundle/SearchParty/.git/objects/cf/496298833c3ce5df74fd23c814596d0d3acfd5 1970-01-01 00:00:00 +0000 +++ vim/bundle/SearchParty/.git/objects/cf/496298833c3ce5df74fd23c814596d0d3acfd5 2015-02-13 09:59:55 +0000 @@ -0,0 +1,2 @@ +xOj!ٯ{`iQ!m `\B>N>!\K:??&i|^:Q Y[N6N 1GuP{Gpx6&Dy0)z6x~hOv?v+lqgjcf7I@-nQ +\ھPj}?MqcQPw]] \ No newline at end of file === added directory 'vim/bundle/SearchParty/.git/objects/d7' === added file 'vim/bundle/SearchParty/.git/objects/d7/e19890352a181a651dafe9ef15cd5901dd00fb' Binary files vim/bundle/SearchParty/.git/objects/d7/e19890352a181a651dafe9ef15cd5901dd00fb 1970-01-01 00:00:00 +0000 and vim/bundle/SearchParty/.git/objects/d7/e19890352a181a651dafe9ef15cd5901dd00fb 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/SearchParty/.git/objects/e8' === removed file 'vim/bundle/SearchParty/.git/objects/e8/b39b99c36a95d89dd2fa7fdeb1a9117623464a' Binary files vim/bundle/SearchParty/.git/objects/e8/b39b99c36a95d89dd2fa7fdeb1a9117623464a 2015-08-25 11:56:54 +0000 and vim/bundle/SearchParty/.git/objects/e8/b39b99c36a95d89dd2fa7fdeb1a9117623464a 1970-01-01 00:00:00 +0000 differ === modified file 'vim/bundle/SearchParty/.git/packed-refs' --- vim/bundle/SearchParty/.git/packed-refs 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/packed-refs 2015-02-13 09:59:55 +0000 @@ -1,2 +1,2 @@ # pack-refs with: peeled fully-peeled -61aa4f431a29b065238554b37206187febb31967 refs/remotes/origin/master +cf496298833c3ce5df74fd23c814596d0d3acfd5 refs/remotes/origin/master === modified file 'vim/bundle/SearchParty/.git/refs/heads/master' --- vim/bundle/SearchParty/.git/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/refs/heads/master 2015-02-13 09:59:55 +0000 @@ -1,1 +1,1 @@ -61aa4f431a29b065238554b37206187febb31967 +cf496298833c3ce5df74fd23c814596d0d3acfd5 === modified file 'vim/bundle/SearchParty/.git/shallow' --- vim/bundle/SearchParty/.git/shallow 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/.git/shallow 2015-02-13 09:59:55 +0000 @@ -1,1 +1,1 @@ -61aa4f431a29b065238554b37206187febb31967 +cf496298833c3ce5df74fd23c814596d0d3acfd5 === modified file 'vim/bundle/SearchParty/README.asciidoc' --- vim/bundle/SearchParty/README.asciidoc 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/README.asciidoc 2015-02-13 09:59:55 +0000 @@ -7,13 +7,6 @@ https://www.gittip.com/bairuidahu/[tips] or http://of-vim-and-vigor.blogspot.com/[beverages]. -AfterSearch Event -~~~~~~~~~~~~~~~~~ - -Functions matching the pattern `/AfterSearch_[0-9]/` will be called in -numeric order after a search operation: `/` `?` `n` `N` `*` `#` `g*` -`g#`. - Visual Searches ~~~~~~~~~~~~~~~ === modified file 'vim/bundle/SearchParty/autoload/searchparty/mash.vim' --- vim/bundle/SearchParty/autoload/searchparty/mash.vim 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/autoload/searchparty/mash.vim 2015-02-13 09:59:55 +0000 @@ -14,7 +14,6 @@ function! searchparty#mash#mash() call searchparty#mash#init() call searchparty#mash#unmash() - let b:searching = 1 if exists('b:mash_use_fow') && b:mash_use_fow let b:mash_fow_item = matchadd('MashFOW', '.*', 1) call matchadd('IncSearch', (&ignorecase ? '\c' : '') . @/, 2, b:mash_search_item) === modified file 'vim/bundle/SearchParty/plugin/SearchParty.vim' --- vim/bundle/SearchParty/plugin/SearchParty.vim 2015-08-25 11:56:54 +0000 +++ vim/bundle/SearchParty/plugin/SearchParty.vim 2015-02-13 09:59:55 +0000 @@ -92,35 +92,8 @@ endif endfor -function! SPAfterSearch() - if exists('b:searching') && b:searching - for x in range(10) - if exists('*AfterSearch_' . x) - call call('AfterSearch_' . x, []) - endif - endfor - endif - let b:searching = 0 -endfunction - -augroup SearchPartySearching - au! - au VimEnter * call SPInitialiseSearchMaps() - au BufEnter * let b:searching = 0 - au CursorHold * call SPAfterSearch() -augroup END - -function! SPInitialiseSearchMaps() - if exists(':ShowSearchIndex') - nnoremap / :call searchparty#mash#unmash()let b:searching=1ShowSearchIndex/ - nnoremap ? :call searchparty#mash#unmash()let b:searching=1ShowSearchIndex? - else - nnoremap / :call searchparty#mash#unmash()let b:searching=1/ - nnoremap ? :call searchparty#mash#unmash()let b:searching=1? - endif -endfunction - - +nnoremap / :call searchparty#mash#unmash()/ +nnoremap ? :call searchparty#mash#unmash()? nnoremap SearchPartyMashFOWToggle \ :let b:mash_use_fow = b:mash_use_fow ? 0 : 1 === modified file 'vim/bundle/csv.vim/.git/index' Binary files vim/bundle/csv.vim/.git/index 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/index 2015-02-13 10:04:41 +0000 differ === modified file 'vim/bundle/csv.vim/.git/logs/HEAD' --- vim/bundle/csv.vim/.git/logs/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/.git/logs/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 ae623607a28383ddb92568d2448081982ef4eeb5 Jan Pobrislo 1440501757 +0200 clone: from https://github.com/chrisbra/csv.vim +0000000000000000000000000000000000000000 f0f368bc50138c09f2d215d46aa26a4f3774e24f Jan Pobrislo 1423821861 +0100 clone: from https://github.com/chrisbra/csv.vim === modified file 'vim/bundle/csv.vim/.git/logs/refs/heads/master' --- vim/bundle/csv.vim/.git/logs/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/.git/logs/refs/heads/master 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 ae623607a28383ddb92568d2448081982ef4eeb5 Jan Pobrislo 1440501757 +0200 clone: from https://github.com/chrisbra/csv.vim +0000000000000000000000000000000000000000 f0f368bc50138c09f2d215d46aa26a4f3774e24f Jan Pobrislo 1423821861 +0100 clone: from https://github.com/chrisbra/csv.vim === modified file 'vim/bundle/csv.vim/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/csv.vim/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/.git/logs/refs/remotes/origin/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 ae623607a28383ddb92568d2448081982ef4eeb5 Jan Pobrislo 1440501757 +0200 clone: from https://github.com/chrisbra/csv.vim +0000000000000000000000000000000000000000 f0f368bc50138c09f2d215d46aa26a4f3774e24f Jan Pobrislo 1423821861 +0100 clone: from https://github.com/chrisbra/csv.vim === added directory 'vim/bundle/csv.vim/.git/objects/0a' === added file 'vim/bundle/csv.vim/.git/objects/0a/cd692c7c18723f8d506a56282fbb2fc6cdc57a' Binary files vim/bundle/csv.vim/.git/objects/0a/cd692c7c18723f8d506a56282fbb2fc6cdc57a 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/0a/cd692c7c18723f8d506a56282fbb2fc6cdc57a 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/1d' === removed file 'vim/bundle/csv.vim/.git/objects/1d/4ba9c9a73350b45d767e44f9f4382cb80b4e63' Binary files vim/bundle/csv.vim/.git/objects/1d/4ba9c9a73350b45d767e44f9f4382cb80b4e63 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/objects/1d/4ba9c9a73350b45d767e44f9f4382cb80b4e63 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/23' === removed file 'vim/bundle/csv.vim/.git/objects/23/a4134ac224c8be07dccdcfcc477c8d457ab54f' --- vim/bundle/csv.vim/.git/objects/23/a4134ac224c8be07dccdcfcc477c8d457ab54f 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/.git/objects/23/a4134ac224c8be07dccdcfcc477c8d457ab54f 1970-01-01 00:00:00 +0000 @@ -1,4 +0,0 @@ -xXmoWݯ-lݱ)i0 H2+VB) ֧>3wGJlm3e^]_/R9[,sCl -|ƖvK:oL]PZU4Ɣ\W"[l(ޕϟ?rӐ鵡 amE.1eZeJfcdg6UI臣l47L qkpᯡfK)3;`ՙɗ٪LHvj^9KXn>oߋEU7TJE׆tm`umaT8UAЬY櫹- UËۗ&]Ty -[HF1V8 Eg(֥ZCJSiVuIxd\&cOHe(' ^Ҝ#al$!L~"cQPuŸGݳ` ܘ| H[֮S%עYtXy47 r(p"Zs]W+ 0^ 4yks61wz▹mj|G2ISϞA )~bO -[g=qUՌlgz7H}0*<'H8QiBf"nLF6k@l63|3ZF&9;{L+a]Fr57ŲMde@o88ULi̕$xD^e˶Fֽg'+Lh< -!Y!E撸enQpinJ7Ʉ^ni8!-M??$]*XLQ%ZrF $^rW:toMd!<^I72A@I]?w**o_*Mpel?C7=H)HhQM&aa&hb(";A  B\Gr ~gn ) mi˸t{\-fL)9@'Sh^4?~Wp|6SOXן[C.b\dyv/ն Nk%CCU7W@[(]8Z_J89&̤(V2BEiW~'na]኿1;c!{!y1ŀIytyYlg_ 6+5a=3㭜:z榙j9A_ው.(]fv+g\?vU4}*Q27 j .7 9̥$(λf~{;A!`1)ƅc~{ANRg |Is8SuP9O !+;OЏАw#>8 'Q0Ƨx,Ő{r1ٟQR\Itڜy M"6|zn?|stjC8 94 ->k0&5*Fsځ|=9b?GrZa<3´Ń]')yKKҫq7y #x Xo%<4=S;e_B3OY`I/h[& ʷј0u!psO-{a݂#?{> \ No newline at end of file === added directory 'vim/bundle/csv.vim/.git/objects/58' === added file 'vim/bundle/csv.vim/.git/objects/58/bf1226e944436ed1660dd7d6bf57495d1606f9' Binary files vim/bundle/csv.vim/.git/objects/58/bf1226e944436ed1660dd7d6bf57495d1606f9 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/58/bf1226e944436ed1660dd7d6bf57495d1606f9 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/60' === removed file 'vim/bundle/csv.vim/.git/objects/60/5feb0a54f211f906c27f6631fe6a5c73996222' Binary files vim/bundle/csv.vim/.git/objects/60/5feb0a54f211f906c27f6631fe6a5c73996222 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/objects/60/5feb0a54f211f906c27f6631fe6a5c73996222 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/csv.vim/.git/objects/72' === added file 'vim/bundle/csv.vim/.git/objects/72/4a226c564d91c11bd39eaa348912a807d6ed62' Binary files vim/bundle/csv.vim/.git/objects/72/4a226c564d91c11bd39eaa348912a807d6ed62 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/72/4a226c564d91c11bd39eaa348912a807d6ed62 2015-02-13 09:59:55 +0000 differ === added directory 'vim/bundle/csv.vim/.git/objects/73' === added file 'vim/bundle/csv.vim/.git/objects/73/19b2e9cda0999cf38570e064c2066e18914409' Binary files vim/bundle/csv.vim/.git/objects/73/19b2e9cda0999cf38570e064c2066e18914409 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/73/19b2e9cda0999cf38570e064c2066e18914409 2015-02-13 09:59:55 +0000 differ === added directory 'vim/bundle/csv.vim/.git/objects/76' === added file 'vim/bundle/csv.vim/.git/objects/76/6de915e4bdb799d6018a51b45005a25473f321' Binary files vim/bundle/csv.vim/.git/objects/76/6de915e4bdb799d6018a51b45005a25473f321 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/76/6de915e4bdb799d6018a51b45005a25473f321 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/8f' === removed file 'vim/bundle/csv.vim/.git/objects/8f/b39a81597ff225cd17fd7a60ee1e7908e38fae' Binary files vim/bundle/csv.vim/.git/objects/8f/b39a81597ff225cd17fd7a60ee1e7908e38fae 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/objects/8f/b39a81597ff225cd17fd7a60ee1e7908e38fae 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/csv.vim/.git/objects/93' === added file 'vim/bundle/csv.vim/.git/objects/93/b586e29916ebff665cf8522284d51424f947ff' Binary files vim/bundle/csv.vim/.git/objects/93/b586e29916ebff665cf8522284d51424f947ff 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/93/b586e29916ebff665cf8522284d51424f947ff 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/96' === removed file 'vim/bundle/csv.vim/.git/objects/96/939738263bce749309a3a263addabe32590b4c' Binary files vim/bundle/csv.vim/.git/objects/96/939738263bce749309a3a263addabe32590b4c 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/objects/96/939738263bce749309a3a263addabe32590b4c 1970-01-01 00:00:00 +0000 differ === added directory 'vim/bundle/csv.vim/.git/objects/9a' === added file 'vim/bundle/csv.vim/.git/objects/9a/07e26b3ec4283a45dbdd2d40129474945f1c8b' Binary files vim/bundle/csv.vim/.git/objects/9a/07e26b3ec4283a45dbdd2d40129474945f1c8b 1970-01-01 00:00:00 +0000 and vim/bundle/csv.vim/.git/objects/9a/07e26b3ec4283a45dbdd2d40129474945f1c8b 2015-02-13 09:59:55 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/a0' === removed file 'vim/bundle/csv.vim/.git/objects/a0/b9bfedadc834a820069ae1da40ad6b634e1d1d' Binary files vim/bundle/csv.vim/.git/objects/a0/b9bfedadc834a820069ae1da40ad6b634e1d1d 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/objects/a0/b9bfedadc834a820069ae1da40ad6b634e1d1d 1970-01-01 00:00:00 +0000 differ === removed file 'vim/bundle/csv.vim/.git/objects/a0/e4b60fb6111a3590e1f0c7d208d145aba70725' Binary files vim/bundle/csv.vim/.git/objects/a0/e4b60fb6111a3590e1f0c7d208d145aba70725 2015-08-25 11:56:54 +0000 and vim/bundle/csv.vim/.git/objects/a0/e4b60fb6111a3590e1f0c7d208d145aba70725 1970-01-01 00:00:00 +0000 differ === removed directory 'vim/bundle/csv.vim/.git/objects/ae' === removed file 'vim/bundle/csv.vim/.git/objects/ae/623607a28383ddb92568d2448081982ef4eeb5' --- vim/bundle/csv.vim/.git/objects/ae/623607a28383ddb92568d2448081982ef4eeb5 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/.git/objects/ae/623607a28383ddb92568d2448081982ef4eeb5 1970-01-01 00:00:00 +0000 @@ -1,2 +0,0 @@ -xAO =+g(ɋ)l5{kdy|W%(n":ĭVA -Fn1hv}7FJNb&@,wFTD+ͥqQ^lnzL~ " Version: 0.31 @@ -21,12 +21,6 @@ endfu call s:DetermineSID() delf s:DetermineSID -let s:numeric_sort = v:version > 704 || v:version == 704 && has("patch341") -if !s:numeric_sort - fu! CSVSortValues(i1, i2) "{{{3 - return (a:i1+0) == (a:i2+0) ? 0 : (a:i1+0) > (a:i2+0) ? 1 : -1 - endfu -endif fu! CSVArrangeCol(first, last, bang, limit) range "{{{2 if &ft =~? 'csv' @@ -171,6 +165,33 @@ " disabled currently, because otherwise when switching ft " I think, all functions need to be read in again and this " costs time. + " + " let b:undo_ftplugin .= "| delf Warn | delf Init | + " \ delf GetPat | delf SearchColumn | delf DelColumn | + " \ delf HiCol | delf GetDelimiter | delf WColumn | + " \ delf MaxColumns | delf ColWidth | delf ArCol | + " \ delf PrepUnArCol | delf UnArCol | + " \ delf CalculateColumnWidth | delf Columnize | + " \ delf GetColPat | delf SplitHeaderLine | + " \ delf SplitHeaderToggle | delf MoveCol | + " \ delf SortComplete | delf SortList | delf Sort | + " \ delf CSV_WCol | delf CopyCol | delf MoveColumn | + " \ delf SumColumn csv#EvalColumn | delf DoForEachColumn | + " \ delf PrepareDoForEachColumn | delf CSVMappings | + " \ delf Map | delf EscapeValue | delf FoldValue | + " \ delf PrepareFolding | delf OutputFilters | + " \ delf SortFilter | delf GetColumn | + " \ delf RemoveLastItem | delf DisableFolding | + " \ delf CheckHeaderLine | + " \ delf AnalyzeColumn | delf Vertfold | + " \ delf InitCSVFixedWidth | delf LocalCmd | + " \ delf CommandDefinitions | delf NumberFormat | + " \ delf NewRecord | delf MoveOver | delf Menu | + " \ delf NewDelimiter | delf DuplicateRows | delf IN | + " \ delf SaveOptions | delf CheckDuplicates | + " \ delf CompleteColumnNr | delf CSVPat | delf Transpose | + " \ delf LocalSettings() | delf AddColumn | delf SubstituteInColumn + " \ delf SetupAutoCmd() | delf CSV_CloseBuffer endfu fu! LocalSettings(type) "{{{3 @@ -248,14 +269,14 @@ endif endfu -fu! GetPat(colnr, maxcolnr, pat, allowmore) "{{{3 - " if a:allowmmore, allows more to match after the pattern +fu! GetPat(colnr, maxcolnr, pat) "{{{3 if a:colnr > 1 && a:colnr < a:maxcolnr if !exists("b:csv_fixed_width_cols") return '^' . GetColPat(a:colnr-1,0) . '\%([^' . \ b:delimiter . ']\{-}\)\?\zs' . a:pat . '\ze' . - \ (a:allowmore ? ('\%([^' . b:delimiter .']\{-}\)\?' . - \ b:delimiter . GetColPat(a:maxcolnr - a:colnr, 0). '$') : '') + \ '\%([^' . b:delimiter .']\{-}\)\?' . + \ b:delimiter . GetColPat(a:maxcolnr - a:colnr, 0) . + \ '$' else return '\%' . b:csv_fixed_width_cols[(a:colnr - 1)] . 'c\zs' \ . a:pat . '.\{-}\ze\%' @@ -264,16 +285,17 @@ elseif a:colnr == a:maxcolnr if !exists("b:csv_fixed_width_cols") return '^' . GetColPat(a:colnr - 1,0) . - \ '\zs' . a:pat . '\ze$' + \ '\%([^' . b:delimiter . + \ ']\{-}\)\?\zs' . a:pat . '\ze' else return '\%' . b:csv_fixed_width_cols[-1] . - \ 'c\zs' . a:pat . '\ze$' + \ 'c\zs' . a:pat . '\ze' endif else " colnr = 1 if !exists("b:csv_fixed_width_cols") return '^' . '\%([^' . b:delimiter . ']\{-}\)\?\zs' . a:pat . - \ (a:allowmore ? ('\ze\%([^' . b:delimiter . ']*\)\?' . b:delimiter . - \ GetColPat(a:maxcolnr -1 , 0) . '$') : '') + \ '\ze\%([^' . b:delimiter . ']*\)\?' . b:delimiter . + \ GetColPat(a:maxcolnr -1 , 0) . '$' else return a:pat . '\ze.\{-}\%' . b:csv_fixed_width_cols[1] . 'c' endif @@ -323,7 +345,7 @@ call Warn("There exists no column " . colnr) return 1 endif - let @/ = GetPat(colnr, maxcolnr, '\%('.pat. '\)', 1) + let @/ = GetPat(colnr, maxcolnr, '\%('.pat. '\)') try " force redraw, so that the search pattern isn't shown exe "norm! n\" @@ -429,9 +451,6 @@ " Additionally, filter all matches, that could have been used earlier let matchlist=getmatches() call filter(matchlist, 'v:val["group"] !~ s:hiGroup') - " remove matches, that come from matchaddpos() - " setmatches() can't handle them. - call filter(matchlist, 'has_key(v:val, "pattern")') call setmatches(matchlist) if a:bang return @@ -509,7 +528,7 @@ let temp=getpos('.')[2] let j=1 let ret = 1 - for i in sort(b:csv_fixed_width_cols, s:numeric_sort ? 'n' : 's:CSVSortValues') + for i in sort(b:csv_fixed_width_cols, "SortList") if temp >= i let ret = j endif @@ -561,9 +580,7 @@ endif endfu -fu! ColWidth(colnr, ...) "{{{3 - " if a:1 is given, specifies the row, for which to calculate the width - " +fu! ColWidth(colnr) "{{{3 " Return the width of a column " Internal function let width=20 "Fallback (wild guess) @@ -573,9 +590,6 @@ if !exists("b:csv_list") " only check first 10000 lines, to be faster let last = line('$') - if exists("a:1") - let last = a:1 - endif if !get(b:, 'csv_arrange_use_all_rows', 0) if last > 10000 let last = 10000 @@ -597,8 +611,6 @@ " and then return the maximum strlen " That could be done in 1 line, but that would look ugly "call map(list, 'split(v:val, b:col."\\zs")[a:colnr-1]') - " do not strip leading whitespace - " call map(tlist, 'substitute(v:val, ''^\s*'', "", "g")') call map(tlist, 'substitute(v:val, ".", "x", "g")') call map(tlist, 'strlen(v:val)') return max(tlist) @@ -621,9 +633,7 @@ endif endfu -fu! ArrangeCol(first, last, bang, limit, ...) range "{{{3 - " a:1, optional width parameter of line from which to take the width - " +fu! ArrangeCol(first, last, bang, limit) range "{{{3 " explicitly give the range as argument to the function if exists("b:csv_fixed_width_cols") " Nothing to do @@ -631,17 +641,18 @@ return endif let cur=winsaveview() - if a:bang || (exists("a:1") && !empty(a:1)) - " Force recalculating the Column width - unlet! b:csv_list b:col_width + if a:bang + if a:bang + " Force recalculating the Column width + unlet! b:csv_list b:col_width + endif elseif a:limit > -1 && a:limit < getfsize(fnamemodify(bufname(''), ':p')) return endif if !exists("b:col_width") " Force recalculation of Column width - let row = exists("a:1") ? a:1 : '' - call CalculateColumnWidth(row) + call CalculateColumnWidth() endif if &ro @@ -712,28 +723,23 @@ fu! UnArrangeCol(match) "{{{3 " Strip leading white space, also trims empty records: - "if get(b:, 'csv_arrange_leftalign',0) - " return substitute(a:match, '\s\+\ze'. b:delimiter. '\?$', '', '') - "else - " return substitute(a:match, '^\s\+', '', '') - "endif - return substitute(a:match, '\%(^\s\+\)\|\%(\s\+\ze'.b:delimiter. '\?$\)', '', 'g') + if get(b:, 'csv_arrange_leftalign',0) + return substitute(a:match, '\s\+\ze'. b:delimiter. '\?$', '', '') + else + return substitute(a:match, '^\s\+', '', '') + endif " only strip leading white space, if a non-white space follows: "return substitute(a:match, '^\s\+\ze\S', '', '') endfu -fu! CalculateColumnWidth(row) "{{{3 +fu! CalculateColumnWidth() "{{{3 " Internal function, not called from external, " does not work with fixed width columns let b:col_width=[] try let s:max_cols=MaxColumns(line('.')) for i in range(1,s:max_cols) - if empty(a:row) - call add(b:col_width, ColWidth(i)) - else - call add(b:col_width, ColWidth(i,a:row)) - endif + call add(b:col_width, ColWidth(i)) endfor catch /csv:no_col/ call Warn("Error: getting Column numbers, aborting!") @@ -1032,7 +1038,7 @@ let line=line('$') endif if foldclosed(line) != -1 - let line = line > line('.') ? foldclosedend(line) + 1 : foldclosed(line) + let line = line > line('.') ? foldclosedend(line) : foldclosed(line) endif " Generate search pattern @@ -1123,11 +1129,18 @@ return join(range(1,MaxColumns()),"\n") endfun +fu! SortList(a1, a2) "{{{3 + return a:a1+0 == a:a2+0 ? 0 : a:a1+0 > a:a2+0 ? 1 : -1 +endfu + fu! Sort(bang, line1, line2, colnr) range "{{{3 -" :Sort command - let wsv = winsaveview() - let flag = matchstr(a:colnr, '[nixo]') - let col = (empty(a:colnr) || a:colnr !~? '\d\+[nixo]\?') ? WColumn() : a:colnr+0 + let wsv=winsaveview() + if a:colnr =~? 'n' + let numeric = 1 + else + let numeric = 0 + endif + let col = (empty(a:colnr) || a:colnr !~? '\d\+') ? WColumn() : a:colnr+0 if col != 1 if !exists("b:csv_fixed_width_cols") let pat= '^' . GetColPat(col-1,1) . b:col @@ -1138,7 +1151,7 @@ let pat= '^' . GetColPat(col,0) endif exe a:line1. ','. a:line2. "sort". (a:bang ? '!' : '') . - \' r'. flag. ' /' . pat . '/' + \' r ' . (numeric ? 'n' : '') . ' /' . pat . '/' call winrestview(wsv) endfun @@ -1355,55 +1368,6 @@ return sum endif endfu -fu! MaxColumn(list) "{{{3 - " Sum a list of values, but only consider the digits within each value - " parses the digits according to the given format (if none has been - " specified, assume POSIX format (without thousand separator) If Vim has - " does not support floats, simply sum up only the integer part - if empty(a:list) - return 0 - else - let result = [] - for item in a:list - if empty(item) - continue - endif - let nr = matchstr(item, '-\?\d\(.*\d\)\?$') - let format1 = '^-\?\d\+\zs\V' . s:nr_format[0] . '\m\ze\d' - let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' - try - let nr = substitute(nr, format1, '', '') - if has("float") && s:nr_format[1] != '.' - let nr = substitute(nr, format2, '.', '') - endif - catch - let nr = 0 - endtry - call add(result, has("float") ? str2float(nr) : nr+0) - endfor - let result = sort(result, s:numeric_sort ? 'n' : 's:CSVSortValues') - let ind = len(result) > 9 ? 9 : len(result) - return s:additional.ismax ? reverse(result)[:ind] : result[:ind] - endif -endfu - -fu! CountColumn(list) "{{{3 - if empty(a:list) - return 0 - elseif has_key(get(s:, 'additional', {}), 'distinct') && s:additional['distinct'] - if exists("*uniq") - return len(uniq(sort(a:list))) - else - let l = {} - for item in a:list - let l[item] = get(l, 'item', 0) + 1 - endfor - return len(keys(l)) - endif - else - return len(a:list) - endif -endfu fu! DoForEachColumn(start, stop, bang) range "{{{3 " Do something for each column, @@ -1427,10 +1391,6 @@ endif for item in range(a:start, a:stop, 1) - if foldlevel(line) - " Filter out folded lines (from dynamic filter) - continue - endif let t = g:csv_convert let line = getline(item) if line =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') @@ -1548,14 +1508,41 @@ let col = WColumn() let max = MaxColumns() let a = GetColumn(line('.'), col) - let a = ProcessFieldValue(a) - let pat = '\%(^\|'.b:delimiter. '\)\@<='.EscapeValue(a). - \ '\m\ze\%('.b:delimiter.'\|$\)' + + if !exists("b:csv_fixed_width") + try + " strip leading whitespace + if (a =~ '\s\+'. b:delimiter . '$') + let b = split(a, '^\s\+\ze[^' . b:delimiter. ']\+')[0] + else + let b = a + endif + catch /^Vim\%((\a\+)\)\=:E684/ + " empty pattern - should match only empty columns + let b = a + endtry + + " strip trailing delimiter + try + let a = split(b, b:delimiter . '$')[0] + catch /^Vim\%((\a\+)\)\=:E684/ + let a = b + endtry + + if a == b:delimiter + try + let a=repeat(' ', ColWidth(col)) + catch + " no-op + endtry + endif + endif " Make a column pattern let b= '\%(' . \ (exists("b:csv_fixed_width") ? '.*' : '') . - \ GetPat(col, max, pat, 0) . '\)' + \ GetPat(col, max, EscapeValue(a) . '\m') . + \ '\)' let s:filter_count += 1 let b:csv_filter[s:filter_count] = { 'pat': b, 'id': s:filter_count, @@ -1584,38 +1571,6 @@ call winrestview(cpos) endfu -fu! ProcessFieldValue(field) "{{{3 - let a = a:field - if !exists("b:csv_fixed_width") - try - " strip leading whitespace - if (a =~ '\s\+'. b:delimiter . '$') - let b = split(a, '^\s\+\ze[^' . b:delimiter. ']\+')[0] - else - let b = a - endif - catch /^Vim\%((\a\+)\)\=:E684/ - " empty pattern - should match only empty columns - let b = a - endtry - - " strip trailing delimiter - try - let a = split(b, b:delimiter . '$')[0] - catch /^Vim\%((\a\+)\)\=:E684/ - let a = b - endtry - - if a == b:delimiter - try - let a=repeat(' ', ColWidth(col)) - catch - " no-op - endtry - endif - endif - return a -endfu fu! OutputFilters(bang) "{{{3 if !a:bang call CheckHeaderLine() @@ -1744,12 +1699,10 @@ let res[item]+=1 endfor - let max_items = reverse(sort(values(res), s:numeric_sort ? 'n' : 's:CSVSortValues')) - " What about the minimum 5 items? + let max_items = reverse(sort(values(res))) let count_items = keys(res) if len(max_items) > 5 call remove(max_items, 5, -1) - call map(max_items, 'printf(''\V%s\m'', escape(v:val, ''\\''))') call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''') endif @@ -1766,7 +1719,7 @@ let i=1 for val in max_items for key in keys(res) - if res[key] =~ val && i <= len(max_items) + if res[key] == val && i <= len(max_items) if !empty(b:delimiter) let k = substitute(key, b:delimiter . '\?$', '', '') else @@ -1808,7 +1761,7 @@ else let colnr=a:col endif - let pat=GetPat(colnr, MaxColumns(), '.*', 1) + let pat=GetPat(colnr, MaxColumns(), '.*') if exists("b:csv_fixed_width_cols") && \ pat !~ '^\^\.\*' " Make the pattern implicitly start at line start, @@ -1872,8 +1825,8 @@ endw let b:csv_fixed_width_cols=[] let tcc=0 - let b:csv_fixed_width_cols = sort(keys(Dict), s:numeric_sort ? 'n' : 's:CSVSortValues') - let b:csv_fixed_width = join(sort(keys(Dict), s:numeric_sort ? 'n' : 's:CSVSortValues'), ',') + let b:csv_fixed_width_cols = sort(keys(Dict), "SortList") + let b:csv_fixed_width = join(sort(keys(Dict), "SortList"), ',') call Init(1, line('$')) let &l:cc=_cc @@ -1959,25 +1912,23 @@ call Map('noremap', '', ':call MoveCol(-1, line("."))') call Map('noremap', 'H', ':call MoveCol(-1, line("."), 1)') call Map('noremap', 'K', ':call MoveCol(0, line(".")-v:count1)') - call Map('nnoremap', '', ':call MoveCol(0, line(".")-v:count1)') + call Map('noremap', '', ':call MoveCol(0, line(".")-v:count1)') call Map('noremap', 'J', ':call MoveCol(0, line(".")+v:count1)') - call Map('nnoremap', '', ':call MoveCol(0, line(".")+v:count1)') + call Map('noremap', '', ':call MoveCol(0, line(".")+v:count1)') call Map('nnoremap', '', ':call PrepareFolding(1, 1)') call Map('nnoremap', '', ':call PrepareFolding(1, 0)') call Map('nnoremap', '', ':call PrepareFolding(0, 1)') call Map('imap', '', 'ColumnMode()', 'expr') " Text object: Field - call Map('xnoremap', 'if', ':call MoveOver(0)') - call Map('xnoremap', 'af', ':call MoveOver(1)') + call Map('vnoremap', 'if', ':call MoveOver(0)') + call Map('vnoremap', 'af', ':call MoveOver(1)') call Map('omap', 'af', ':norm vaf') call Map('omap', 'if', ':norm vif') - call Map('xnoremap', 'iL', ':call SameFieldRegion()') - call Map('omap', 'iL', ':call SameFieldRegion()') " Remap original values to a sane backup call Map('noremap', 'J', 'J') call Map('noremap', 'K', 'K') - call Map('xnoremap', 'W', 'W') - call Map('xnoremap', 'E', 'E') + call Map('vnoremap', 'W', 'W') + call Map('vnoremap', 'E', 'E') call Map('noremap', 'H', 'H') call Map('noremap', 'L', 'L') call Map('nnoremap', '', '') @@ -1996,8 +1947,8 @@ call LocalCmd("DeleteColumn", ':call DeleteColumn()', \ '-nargs=? -complete=custom,SortComplete') call LocalCmd("ArrangeColumn", - \ ':call ArrangeCol(, , 0, -1, )', - \ '-range -bang -nargs=?') + \ ':call ArrangeCol(, , 0, -1)', + \ '-range -bang') call LocalCmd("UnArrangeColumn", \':call PrepUnArrangeCol(, )', \ '-range') @@ -2025,15 +1976,6 @@ call LocalCmd("SumCol", \ ':echo csv#EvalColumn(, "SumColumn", ,)', \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("MaxCol", - \ ':echo csv#EvalColumn(, "MaxColumn", ,, 1)', - \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("MinCol", - \ ':echo csv#EvalColumn(, "MaxColumn", ,, 0)', - \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("CountCol", - \ ':echo csv#EvalColumn(, "CountColumn", ,)', - \ '-nargs=? -range=% -complete=custom,SortComplete') call LocalCmd("ConvertData", \ ':call PrepareDoForEachColumn(,,0)', \ '-bang -nargs=? -range=%') @@ -2078,8 +2020,6 @@ let unmap = 'ounmap' elseif a:map == 'imap' let unmap = 'iunmap' - elseif a:map == 'xnoremap' - let unmap = 'xunmap' endif let b:undo_ftplugin .= "| " . unmap . " " . a:name endif @@ -2372,14 +2312,8 @@ let b:csv_arrange_leftalign = 1 endif let newlines=[] - let content=[] while line <= a:last - if foldclosed(line) != -1 - let line = foldclosedend(line) + 1 - continue - endif let curline = getline(line) - call add(content, curline) if empty(split(curline, b:delimiter)) " only empty delimiters, add one empty delimiter " (:NewDelimiter strips trailing delimiter @@ -2390,11 +2324,6 @@ let line+=1 endw unlet! line - let delim=b:delimiter - new - call setline(1,content) - let b:delimiter=delim - call Init(1,line('$'), 1) if exists("b:csv_fixed_width_cols") let cols=copy(b:csv_fixed_width_cols) let pat = join(map(cols, ' ''\(\%''. v:val. ''c\)'' '), '\|') @@ -2410,7 +2339,7 @@ else " don't clear column width variable, might have been set in the " plugin! - sil call ArrangeCol(1, line('$'), 0, -1) + sil call ArrangeCol(a:first, a:last, 0, -1) if !get(b:, 'csv_arrange_leftalign',0) for line in newlines let cline = getline(line) @@ -2430,24 +2359,24 @@ endif let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol - call NewDelimiter(s:td.vbar, 1, line('$')) + call NewDelimiter(s:td.vbar, a:first, a:last+adjust_last) "exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last), " \ (exists("b:csv_fixed_width_cols") ? pat : b:delimiter ), s:td.vbar) " Add vertical bar in first column, if there isn't already one - exe printf('sil %d,%ds/%s/%s/e', 1, line('$'), + exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last, \ '^[^'. s:td.vbar. s:td.scol. ']', s:td.vbar.'&') " And add a final vertical bar, if there isn't one already - exe printf('sil %d,%ds/%s/%s/e', 1, line('$'), + exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last, \ '[^'. s:td.vbar. s:td.ecol. ']$', '&'. s:td.vbar) " Make nice intersection graphs - let line = split(getline(1), s:td.vbar) + let line = split(getline(a:first), s:td.vbar) call map(line, 'substitute(v:val, ''[^''.s:td.vbar. '']'', s:td.hbar, ''g'')') " Set top and bottom margins - call append(0, s:td.ltop. join(line, s:td.dhor). s:td.rtop) - call append(line('$'), s:td.lbot. join(line, s:td.uhor). s:td.rbot) + call append(a:first-1, s:td.ltop. join(line, s:td.dhor). s:td.rtop) + call append(a:last+adjust_last+1, s:td.lbot. join(line, s:td.uhor). s:td.rbot) if s:csv_fold_headerline > 0 - call append(1 + s:csv_fold_headerline, marginline) + call append(a:first + s:csv_fold_headerline, marginline) let adjust_last += 1 endif " Syntax will be turned off, so disable this part @@ -2460,7 +2389,7 @@ "ru syntax/csv.vim if a:bang - exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', 1 + s:csv_fold_headerline, line('$') + adjust_last, + exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', a:first + s:csv_fold_headerline, a:last + adjust_last, \ '[^'.s:td.scol. '][^'.s:td.hbar.'].*', marginline) endif @@ -2528,7 +2457,7 @@ endw else for colnr in columns - let @/ = GetPat(colnr, maxcolnr, cmd[1], 1) + let @/ = GetPat(colnr, maxcolnr, cmd[1]) while search(@/) exe printf("%d,%ds//%s%s", a:line1, a:line2, cmd[2], (has_flags ? '/'. cmd[3] : '')) if !has_flags || (has_flags && cmd[3] !~# 'g') @@ -2573,68 +2502,8 @@ return localtime()-a:start < 2 endfu -fu! SameFieldRegion() "{{{3 - " visually select the region, that has the same value in the cursor field - let col = WColumn() - let max = MaxColumns() - let field = GetColumn(line('.'), col) - let line = line('.') - - let limit = [line, line] - " Search upwards and downwards from the current position and find the - " limit of the current selection - while line > 1 - let line -= 1 - if GetColumn(line, col) ==# field - let limit[0] = line - else - break - endif - endw - let line = line('.') - while line > 1 && line < line('$') - let line += 1 - if GetColumn(line, col) ==# field - let limit[1] = line - else - break - endif - endw - exe printf(':norm! %dGV%dG',limit[0],limit[1]) -endfu -fu! CSV_CloseBuffer(buffer) "{{{3 - " Setup by SetupAutoCmd autocommand - try - if bufnr((a:buffer)+0) > -1 - exe a:buffer. "bw" - endif - catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped - " no-op - finally - augroup CSV_QuitPre - au! - augroup END - augroup! CSV_QuitPre - endtry -endfu - -fu! CSV_SetSplitOptions(window) "{{{3 - if exists("s:local_stl") - " local horizontal statusline - for opt in items({'&nu': &l:nu, '&rnu': &l:rnu, '&fdc': &fdc}) - if opt[1] != getwinvar(a:window, opt[0]) - call setwinvar(a:window, opt[0], opt[1]) - endif - endfor - " Check statusline (airline might change it) - if getwinvar(a:window, '&l:stl') != s:local_stl - call setwinvar(a:window, '&stl', s:local_stl) - endif - endif -endfun - " Global functions "{{{2 -fu! csv#EvalColumn(nr, func, first, last, ...) range "{{{3 +fu! csv#EvalColumn(nr, func, first, last) range "{{{3 " Make sure, the function is called for the correct filetype. if match(split(&ft, '\.'), 'csv') == -1 call Warn("File is no CSV file!") @@ -2665,7 +2534,6 @@ " parse the optional number format let format = matchstr(a:nr, '/[^/]*/') - let s:additional={} call NumberFormat() if !empty(format) try @@ -2686,13 +2554,6 @@ endif endtry endif - let distinct = matchstr(a:nr, '\') - if !empty(distinct) - let s:additional.distinct=1 - endif - if function(a:func) is# function("\".s:SID."_MaxColumn") - let s:additional.ismax = a:1 - endif try let result=call(function(a:func), [column]) return result @@ -2738,7 +2599,7 @@ endif " encapsulates GetPat(), that returns the search pattern for a " given column and tries to set the cursor at the specific position - let pat = GetPat(a:colnr, MaxColumns(), a:0 ? a:1 : '.*', 1) + let pat = GetPat(a:colnr, MaxColumns(), a:0 ? a:1 : '.*') "let pos = match(pat, '.*\\ze') + 1 " Try to set the cursor at the beginning of the pattern " does not work @@ -2746,61 +2607,7 @@ return pat endfu -fu! CSVSum(col, fmt, first, last) "{{{3 - let first = a:first - let last = a:last - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - return csv#EvalColumn(a:col, 'SumColumn', first, last) -endfu -fu! CSVMax(col, fmt, first, last) "{{{3 - let first = a:first - let last = a:last - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - return csv#EvalColumn(a:col, 'MaxColumn', first, last, 1) -endfu -fu! CSVMin(col, fmt, first, last) "{{{3 - let first = a:first - let last = a:last - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - return csv#EvalColumn(a:col, 'MaxColumn', first, last, 0) -endfu -fu! CSVCount(col, fmt, first, last, ...) "{{{3 - let first = a:first - let last = a:last - let distinct = 0 - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - if !exists('s:additional') - let s:additional = {} - endif - if exists("a:1") && !empty(a:1) - let s:additional['distinct'] = 1 - endif - let result=csv#EvalColumn(a:col, 'CountColumn', first, last, distinct) - unlet! s:additional['distinct'] - return (empty(result) ? 0 : result) -endfu fu! CSV_WCol(...) "{{{3 - " Needed for airline try if exists("a:1") && (a:1 == 'Name' || a:1 == 1) return printf("%s", WColumn(1)) @@ -2812,6 +2619,48 @@ endtry endfun +fu! CSV_SetSplitOptions(window) "{{{3 + if exists("s:local_stl") + " local horizontal statusline + for opt in items({'&nu': &l:nu, '&rnu': &l:rnu, '&fdc': &fdc}) + if opt[1] != getwinvar(a:window, opt[0]) + call setwinvar(a:window, opt[0], opt[1]) + endif + endfor + " Check statusline (airline might change it) + if getwinvar(a:window, '&l:stl') != s:local_stl + call setwinvar(a:window, '&stl', s:local_stl) + endif + endif +endfun + +fu! CSV_CloseBuffer(buffer) "{{{3 + " Setup by SetupAutoCmd autocommand + try + if bufnr((a:buffer)+0) > -1 + exe a:buffer. "bw" + endif + catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped + " no-op + finally + augroup CSV_QuitPre + au! + augroup END + augroup! CSV_QuitPre + endtry +endfu + +fu! CSVSum(col, fmt, first, last) "{{{3 + let first = a:first + let last = a:last + if empty(first) + let first = 1 + endif + if empty(last) + let last = line('$') + endif + return csv#EvalColumn(a:col, 'SumColumn', first, last) +endfu " Initialize Plugin "{{{2 let b:csv_start = exists("b:csv_start") ? b:csv_start : 1 let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$') @@ -2823,7 +2672,7 @@ " Vim Modeline " {{{2 " vim: set foldmethod=marker et: doc/ft-csv.txt [[[1 -1884 +1771 *ft-csv.txt* For Vim version 7.4 Last Change: Thu, 15 Jan 2015 Author: Christian Brabandt @@ -2861,8 +2710,6 @@ 3.23 Transforming into a table..............|csv-tabularize| 3.24 Add new empty columns..................|AddColumn_CSV| 3.25 Substitute in columns..................|Substitute_CSV| - 3.26 Count values inside a column...........|Count_CSV| - 3.27 Maximum/Minimum values ................|MaxCol_CSV| 4. CSV Filetype configuration...................|csv-configuration| 4.1 Delimiter...............................|csv-delimiter| 4.2 Column..................................|csv-column| @@ -2882,9 +2729,7 @@ 5.1 CSVPat()................................|CSVPat()| 5.2 CSVField()..............................|CSVField()| 5.3 CSVCol()................................|CSVCol()| - 5.4 CSVCount()..............................|CSVCount()| - 5.4 CSVMax()................................|CSVMax()| - 5.4 CSVMin()................................|CSVMin()| + 5.4 CSVSum()................................|CSVSum()| 6. CSV Tips and Tricks..........................|csv-tips| 6.1 Statusline..............................|csv-stl| 6.2 Slow CSV plugin.........................|csv-slow| @@ -3034,7 +2879,7 @@ If you would like all columns to be visually arranged, you can use the `:ArrangeColumn` or `:CSVArrangeColumn` command: > - :[range]ArrangeColumn[!] [] + :[range]ArrangeColumn[!] Beware, that this will change your file and depending on the size of your file may slow down Vim significantly. This is highly experimental. @@ -3048,11 +2893,6 @@ no column width has been calculated before, the width will be calculated, even if the '!' has not been given. -If is given, will use the Row, to calculate the width, else will -calculate the maximum of at least the first 10,000 rows to calculate the -width. The limit of 10,000 is set to speed up the processing and can be -overriden by setting the "b:csv_arrange_use_all_rows" variable (see below). - If [range] is not given, it defaults to the current line. By default, the columns will be righ-aligned. If you want a different @@ -3206,10 +3046,7 @@ reverses the order based on column 3. -The column number can be optionally followed by any of the flags [i], [n], -[x] and [o] for [i]gnoring case, sorting by [n]umeric, he[x]adecimal -or [o]ctal value. - +Instead of a column, you can give the flag 'n' to have it sort numerically. When no column number is given, it will sort by the column, on which the cursor is currently. @@ -3263,7 +3100,7 @@ delimiter will be stripped away from each value and also empty values won't be considered. -By default, Vim uses the a numerical format that uses the '.' as decimal +By default, Vim uses the a numerica format that uses the '.' as decimal separator while there is no thousands separator. If youre file contains the numbers in a different format, you can use the /format/ option to specify a different thousands separator or a different decimal separator. The format @@ -3382,14 +3219,12 @@ |aaa, bbbb,ccc ` - *csv-textobjects* Also, the csv plugin defines these text-object: if Inner Field (contains everything up to the delimiter) + af Outer Field (contains everything up to and including the delimiter) -iL Inner Line (visually linewise select all lines, that - has the same value at the cursor's column) Note, that the , , K and J overlap Vim's default mapping for ||, ||, |J| and |K| respectively. Therefore, this functionality has been @@ -3717,58 +3552,6 @@ Substitutes in each column starting from the third each number and appends the EURO suffix to it. - -3.26 Count Values inside a Column *CountCol_CSV* ---------------------------------- -You can let Vim output the number of values inside a column using the `:CSVCountCol` -command > - - :[range]CountCol [nr] [distinct] - -This outputs the number of [distinct] values visible in the column [nr] -If [distinct] is not given, count's all values. Note, header rows and folded -rows won't be counted. - -See also |csv-aggregate-functions| - - - *MinCol_CSV* -3.27 Maximum/Minimum value of a Column *MaxCol_CSV* ---------------------------------------- -You can let Vim output the 10 maximum/minimum values of a column using the -`:CSVMaxCol` command > - - :[range]MaxCol [nr] [/format/] - :[range]MinCol [nr] [/format/] - -This outputs the result of the column within the range given. If no range -is given, this will calculate the max value of the whole column. If is not -given, this calculates the sum for the column the cursor is on. Note, that the -delimiter will be stripped away from each value and also empty values won't be -considered. - -By default, Vim uses the a numerical format that uses the '.' as decimal -separator while there is no thousands separator. If youre file contains -the numbers in a different format, you can use the /format/ option to specify -a different thousands separator or a different decimal separator. The format -needs to be specified like this: - /x:y/ -where 'x' defines the thousands separator and y defines the decimal -separator and each one is optional. This means, that > - - :MaxCol 1 /:,/ - -uses the default thousands separator and ',' as the decimal separator and > - - :MaxCol 2 / :./ - -uses the Space as thousands separator and the '.' as decimal separator. - -Note, if you Vim is compiled without floating point number format (|+float|), -Vim will only aggregate the integer part and therefore won't use the 'y' -argument in the /format/ specifier. - -See also |csv-aggregate-functions| ============================================================================== 4. CSV Configuration *csv-configuration* @@ -4142,19 +3925,6 @@ |:CSVSumCol|) startline and endline specify the lines to consider, if empty, will be first and last line. -5.5 CSVCount(col, fmt, startline, endline[, distinct]) *CSVCount()* ------------------------------------------------------- -Returns the count of values for column col. If the optional parameter -[distinct] is given, only returns the distinct number of values. - -5.6 CSVMax(col, fmt, startline, endline) *CSVMax()* ------------------------------------------------------- -Returns the 10 largest values for column col. - -5.7 CSVMin(col, fmt, startline, endline) *CSVMin()* ------------------------------------------------------- -Returns the 10 smallest values for column col. - ============================================================================== 6. CSV Tips and Tricks *csv-tips* @@ -4331,17 +4101,12 @@ 6.5 Syntax error when opening a CSV file *csv-syntax-error* ---------------------------------------- -If you see this error: > - - CSV Syntax:Invalid column pattern, using default pattern \%([^,]*,\|$\) -< This happens usually, when the syntax script is read before the filetype plugin, so the plugin did not have a chance to setup the column delimiter correctly. -The easy way to fix it, is to make sure the :syntax on (|:syn-on|) statement -comes after the :filetype plugin (|:filetype-plugin-on|) statement in your -|.vimrc| +The easy way to fix it, is to reverse the order of the :syntax on (|:syn-on|) +and :filetype plugin (|:filetype-plugin-on|) statements in your |.vimrc| Alternatively, you can simply call |InitCSV| and ignore the error. @@ -4388,35 +4153,6 @@ - |InitCSV| accepts a '!' for keeping the b:delimiter (|csv-delimiter|) variable (https://github.com/chrisbra/csv.vim/issues/43 reported by Jeet Sukumaran, thanks!) -- New text-object iL (Inner Line, to visually select the lines that have the - same value in the cursor column, as requested at - https://github.com/chrisbra/csv.vim/issues/44, thanks justmytwospence!) -- |:CSVArrangeColumn| can be given an optional row number and the width will - be calculated using that row. (https://github.com/chrisbra/csv.vim/issues/45 - reported by jchain, thanks!) -- Allow for hexadecimal |Sort_CSV| - (https://github.com/chrisbra/csv.vim/issues/46, reported by ThomsonTan, - thanks!) -- support all flags for |Sort_CSV| as for the builting |:sort| command (except - for "u" and "r") -- prevent mapping of and in visual mode (reported by naught101 at - https://github.com/chrisbra/csv.vim/issues/50, thanks!) -- prevent increasing column width on subsequent call of |:ArrangeColumn_CSV| - (reported by naught101 at https://github.com/chrisbra/csv.vim/issues/51, - thanks!) -- New Count function |CSVCount()| (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/49, thanks!) -- fix pattern generation for last column -- |ConvertData_CSV| should filter out folded lines (reported by jungle-booke - at https://github.com/chrisbra/csv.vim/issues/53, thanks!) -- Make |:CSVTable| ignore folded lines (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/56, thanks!) -- Better filtering for dynamic filters (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/57, thanks!) -- Implement a |MaxCol_CSV| and |MinCol_CSV| command (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/60, thanks!) -- Make |UnArrangeColumn_CSV| strip leading and trailing whitespace (reported - by SuperFluffy at https://github.com/chrisbra/csv.vim/issues/62, thanks!) 0.31 Jan 15, 2015 {{{1 - fix that H on the very first cell, results in an endless loop @@ -4709,7 +4445,7 @@ vim:tw=78:ts=8:ft=help:norl:et:fdm=marker:fdl=0 syntax/csv.vim [[[1 -169 +163 " A simple syntax highlighting, simply alternate colors between two " adjacent columns " Init {{{2 @@ -4840,26 +4576,20 @@ hi def link CSVComment Comment endfun -fu! HiLink(name, target) "{{{3 - if !hlexists(a:name) - exe "hi def link" a:name a:target - endif -endfu - fu! DoSyntaxDefinitions() "{{{3 syn spell toplevel " Not really needed syn case ignore - call HiLink("CSVColumnHeaderOdd", "WarningMsg") - call HiLink("CSVColumnHeaderEven", "WarningMsg") + hi def link CSVColumnHeaderOdd WarningMsg + hi def link CSVColumnHeaderEven WarningMsg if get(g:, 'csv_no_column_highlight', 0) - call HiLink("CSVColumnOdd", "Normal") - call HiLink("CSVColumnEven", "Normal") + hi def link CSVColumnOdd Normal + hi def link CSVColumnEven Normal else - call HiLink("CSVColumnOdd", "DiffAdd") - call HiLink("CSVColumnEven","DiffChange") + hi def link CSVColumnOdd DiffAdd + hi def link CSVColumnEven DiffChange endif endfun === modified file 'vim/bundle/csv.vim/doc/ft-csv.txt' --- vim/bundle/csv.vim/doc/ft-csv.txt 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/doc/ft-csv.txt 2015-02-13 09:59:55 +0000 @@ -35,8 +35,6 @@ 3.23 Transforming into a table..............|csv-tabularize| 3.24 Add new empty columns..................|AddColumn_CSV| 3.25 Substitute in columns..................|Substitute_CSV| - 3.26 Count values inside a column...........|Count_CSV| - 3.27 Maximum/Minimum values ................|MaxCol_CSV| 4. CSV Filetype configuration...................|csv-configuration| 4.1 Delimiter...............................|csv-delimiter| 4.2 Column..................................|csv-column| @@ -56,9 +54,7 @@ 5.1 CSVPat()................................|CSVPat()| 5.2 CSVField()..............................|CSVField()| 5.3 CSVCol()................................|CSVCol()| - 5.4 CSVCount()..............................|CSVCount()| - 5.4 CSVMax()................................|CSVMax()| - 5.4 CSVMin()................................|CSVMin()| + 5.4 CSVSum()................................|CSVSum()| 6. CSV Tips and Tricks..........................|csv-tips| 6.1 Statusline..............................|csv-stl| 6.2 Slow CSV plugin.........................|csv-slow| @@ -208,7 +204,7 @@ If you would like all columns to be visually arranged, you can use the `:ArrangeColumn` or `:CSVArrangeColumn` command: > - :[range]ArrangeColumn[!] [] + :[range]ArrangeColumn[!] Beware, that this will change your file and depending on the size of your file may slow down Vim significantly. This is highly experimental. @@ -222,11 +218,6 @@ no column width has been calculated before, the width will be calculated, even if the '!' has not been given. -If is given, will use the Row, to calculate the width, else will -calculate the maximum of at least the first 10,000 rows to calculate the -width. The limit of 10,000 is set to speed up the processing and can be -overriden by setting the "b:csv_arrange_use_all_rows" variable (see below). - If [range] is not given, it defaults to the current line. By default, the columns will be righ-aligned. If you want a different @@ -242,9 +233,6 @@ align the third column and all following columns right align. (Note: decimal aligning might slow down Vim and additionally, if the value is no decimal number it will be right aligned). -If you change the alignment parameter, you need to use the "!" attribute, the -next time you run the |:ArrangeCol| command, otherwise for performance -reasons, it won't be considered. Note, arranging the columns can be very slow on large files or many columns (see |csv-slow| on how to increase performance for this command). For large files, @@ -306,8 +294,6 @@ ----------- Reinitialize the Plugin. Use this, if you have changed the configuration of the plugin (see |csv-configuration| ). -If you use the bang (!) attribute, it will keep the b:delimiter configuration -variable. *:CSVHeader* 3.9 Header lines *Header_CSV* @@ -383,10 +369,7 @@ reverses the order based on column 3. -The column number can be optionally followed by any of the flags [i], [n], -[x] and [o] for [i]gnoring case, sorting by [n]umeric, he[x]adecimal -or [o]ctal value. - +Instead of a column, you can give the flag 'n' to have it sort numerically. When no column number is given, it will sort by the column, on which the cursor is currently. @@ -440,7 +423,7 @@ delimiter will be stripped away from each value and also empty values won't be considered. -By default, Vim uses the a numerical format that uses the '.' as decimal +By default, Vim uses the a numerica format that uses the '.' as decimal separator while there is no thousands separator. If youre file contains the numbers in a different format, you can use the /format/ option to specify a different thousands separator or a different decimal separator. The format @@ -559,14 +542,12 @@ |aaa, bbbb,ccc ` - *csv-textobjects* Also, the csv plugin defines these text-object: if Inner Field (contains everything up to the delimiter) + af Outer Field (contains everything up to and including the delimiter) -iL Inner Line (visually linewise select all lines, that - has the same value at the cursor's column) Note, that the , , K and J overlap Vim's default mapping for ||, ||, |J| and |K| respectively. Therefore, this functionality has been @@ -894,60 +875,6 @@ Substitutes in each column starting from the third each number and appends the EURO suffix to it. - -3.26 Count Values inside a Column *CountCol_CSV* ---------------------------------- -You can let Vim output the number of values inside a column using the `:CSVCountCol` -command > - - :[range]CountCol [nr] [distinct] - -This outputs the number of [distinct] values visible in the column [nr] -If [distinct] is not given, count's all values. Note, header rows and folded -rows won't be counted. - -See also |csv-aggregate-functions| - - - *MinCol_CSV* -3.27 Maximum/Minimum value of a Column *MaxCol_CSV* ---------------------------------------- -You can let Vim output the 10 maximum/minimum values of a column using the -`:CSVMaxCol` command > - - :[range]MaxCol [nr][distinct] [/format/] - :[range]MinCol [nr][distinct] [/format/] - -This outputs the result of the column within the range given. If no range -is given, this will calculate the max value of the whole column. If is not -given, this calculates the sum for the column the cursor is on. Note, that the -delimiter will be stripped away from each value and also empty values won't be -considered. - -By default, Vim uses the a numerical format that uses the '.' as decimal -separator while there is no thousands separator. If youre file contains -the numbers in a different format, you can use the /format/ option to specify -a different thousands separator or a different decimal separator. The format -needs to be specified like this: - /x:y/ -where 'x' defines the thousands separator and y defines the decimal -separator and each one is optional. This means, that > - - :MaxCol 1 /:,/ - -uses the default thousands separator and ',' as the decimal separator and > - - :MaxCol 2 / :./ - -uses the Space as thousands separator and the '.' as decimal separator. - -If [distinct] is given, only returns the number of distinct values. - -Note, if you Vim is compiled without floating point number format (|+float|), -Vim will only aggregate the integer part and therefore won't use the 'y' -argument in the /format/ specifier. - -See also |csv-aggregate-functions| ============================================================================== 4. CSV Configuration *csv-configuration* @@ -1321,19 +1248,6 @@ |:CSVSumCol|) startline and endline specify the lines to consider, if empty, will be first and last line. -5.5 CSVCount(col, fmt, startline, endline[, distinct]) *CSVCount()* ------------------------------------------------------- -Returns the count of values for column col. If the optional parameter -[distinct] is given, only returns the distinct number of values. - -5.6 CSVMax(col, fmt, startline, endline) *CSVMax()* ------------------------------------------------------- -Returns the 10 largest values for column col. - -5.7 CSVMin(col, fmt, startline, endline) *CSVMin()* ------------------------------------------------------- -Returns the 10 smallest values for column col. - ============================================================================== 6. CSV Tips and Tricks *csv-tips* @@ -1510,17 +1424,12 @@ 6.5 Syntax error when opening a CSV file *csv-syntax-error* ---------------------------------------- -If you see this error: > - - CSV Syntax:Invalid column pattern, using default pattern \%([^,]*,\|$\) -< This happens usually, when the syntax script is read before the filetype plugin, so the plugin did not have a chance to setup the column delimiter correctly. -The easy way to fix it, is to make sure the :syntax on (|:syn-on|) statement -comes after the :filetype plugin (|:filetype-plugin-on|) statement in your -|.vimrc| +The easy way to fix it, is to reverse the order of the :syntax on (|:syn-on|) +and :filetype plugin (|:filetype-plugin-on|) statements in your |.vimrc| Alternatively, you can simply call |InitCSV| and ignore the error. @@ -1564,50 +1473,8 @@ - do not allow |:CSVTable| command for csv files, that's what the |:CSVTabularize| command is for. - add progressbar for the |:CSVArrangeCol| command. -- |InitCSV| accepts a '!' for keeping the b:delimiter (|csv-delimiter|) variable - (https://github.com/chrisbra/csv.vim/issues/43 reported by Jeet Sukumaran, - thanks!) -- New text-object iL (Inner Line, to visually select the lines that have the - same value in the cursor column, as requested at - https://github.com/chrisbra/csv.vim/issues/44, thanks justmytwospence!) -- |:CSVArrangeColumn| can be given an optional row number and the width will - be calculated using that row. (https://github.com/chrisbra/csv.vim/issues/45 - reported by jchain, thanks!) -- Allow for hexadecimal |Sort_CSV| - (https://github.com/chrisbra/csv.vim/issues/46, reported by ThomsonTan, - thanks!) -- support all flags for |Sort_CSV| as for the builting |:sort| command (except - for "u" and "r") -- prevent mapping of and in visual mode (reported by naught101 at - https://github.com/chrisbra/csv.vim/issues/50, thanks!) -- prevent increasing column width on subsequent call of |:ArrangeColumn_CSV| - (reported by naught101 at https://github.com/chrisbra/csv.vim/issues/51, - thanks!) -- New Count function |CSVCount()| (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/49, thanks!) -- fix pattern generation for last column -- |ConvertData_CSV| should filter out folded lines (reported by jungle-booke - at https://github.com/chrisbra/csv.vim/issues/53, thanks!) -- Make |:CSVTable| ignore folded lines (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/56, thanks!) -- Better filtering for dynamic filters (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/57, thanks!) -- Implement a |MaxCol_CSV| and |MinCol_CSV| command (reported by jungle-booke at - https://github.com/chrisbra/csv.vim/issues/60, thanks!) -- Make |UnArrangeColumn_CSV| strip leading and trailing whitespace (reported - by SuperFluffy at https://github.com/chrisbra/csv.vim/issues/62, thanks!) -- Do not sort headerlines (reported by jungle-booke at https://github.com/chrisbra/csv.vim/issues/63, - thanks!) -- Do not error out in |:ArrangeCol| command, if line does not have that many - columns (reported by SuperFluffy at https://github.com/chrisbra/csv.vim/issues/64, thanks) -- Use |OptionSet|autocommand to adjust window for |CSV_Header| command -- when doing |:ArrangeCol| with bang attribute, unarrange first, so that if - the alignment changed, it will be adjusted accordingly -- Allow distinct keyword for |MaxCol_CSV| and |MinCol_CSV| command (reported - by jungle-boogie at https://github.com/chrisbra/csv.vim/issues/67, thanks!) 0.31 Jan 15, 2015 {{{1 -- supports for Vim 7.3 dropped - fix that H on the very first cell, results in an endless loop (https://github.com/chrisbra/csv.vim/issues/31, reported by lahvak, thanks!) - fix that count for |AddColumn| did not work (according to the documentation) === modified file 'vim/bundle/csv.vim/ftplugin/csv.vim' --- vim/bundle/csv.vim/ftplugin/csv.vim 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/ftplugin/csv.vim 2015-02-13 09:59:55 +0000 @@ -10,43 +10,13 @@ " Some ideas are taken from the wiki http://vim.wikia.com/wiki/VimTip667 " though, implementation differs. -" Plugin folklore "{{{1 -if v:version < 700 || exists('b:did_ftplugin') - finish -endif -let b:did_ftplugin = 1 - -let s:cpo_save = &cpo -set cpo&vim +" Plugin folklore "{{{2 fu! DetermineSID() let s:SID = matchstr(expand(''), '\zs\d\+\ze_DetermineSID$') endfu call s:DetermineSID() delf s:DetermineSID -let s:csv_numeric_sort = v:version > 704 || v:version == 704 && has("patch341") -if !s:csv_numeric_sort "{{{2 - fu! CSVSortValues(i1, i2) "{{{3 - return (a:i1+0) == (a:i2+0) ? 0 : (a:i1+0) > (a:i2+0) ? 1 : -1 - endfu -endif -if !exists("##OptionSet") "{{{2 - " No OptionSet autocommands - fu! CSV_SetSplitOptions(window) "{{{3 - if exists("s:local_stl") - " local horizontal statusline - for opt in items({'&nu': &l:nu, '&rnu': &l:rnu, '&fdc': &fdc}) - if opt[1] != getwinvar(a:window, opt[0]) - call setwinvar(a:window, opt[0], opt[1]) - endif - endfor - " Check statusline (airline might change it) - if getwinvar(a:window, '&l:stl') != s:local_stl - call setwinvar(a:window, '&stl', s:local_stl) - endif - endif - endfun -endif -" Function definitions: "{{{1 + fu! CSVArrangeCol(first, last, bang, limit) range "{{{2 if &ft =~? 'csv' call ArrangeCol(a:first, a:last, a:bang, a:limit) @@ -55,6 +25,15 @@ endif endfu +if v:version < 700 || exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +" Function definitions: "{{{2 " Script specific functions "{{{2 fu! Warn(mess) "{{{3 echohl WarningMsg @@ -181,6 +160,33 @@ " disabled currently, because otherwise when switching ft " I think, all functions need to be read in again and this " costs time. + " + " let b:undo_ftplugin .= "| delf Warn | delf Init | + " \ delf GetPat | delf SearchColumn | delf DelColumn | + " \ delf HiCol | delf GetDelimiter | delf WColumn | + " \ delf MaxColumns | delf ColWidth | delf ArCol | + " \ delf PrepUnArCol | delf UnArCol | + " \ delf CalculateColumnWidth | delf Columnize | + " \ delf GetColPat | delf SplitHeaderLine | + " \ delf SplitHeaderToggle | delf MoveCol | + " \ delf SortComplete | delf SortList | delf Sort | + " \ delf CSV_WCol | delf CopyCol | delf MoveColumn | + " \ delf SumColumn csv#EvalColumn | delf DoForEachColumn | + " \ delf PrepareDoForEachColumn | delf CSVMappings | + " \ delf Map | delf EscapeValue | delf FoldValue | + " \ delf PrepareFolding | delf OutputFilters | + " \ delf SortFilter | delf GetColumn | + " \ delf RemoveLastItem | delf DisableFolding | + " \ delf CheckHeaderLine | + " \ delf AnalyzeColumn | delf Vertfold | + " \ delf InitCSVFixedWidth | delf LocalCmd | + " \ delf CommandDefinitions | delf NumberFormat | + " \ delf NewRecord | delf MoveOver | delf Menu | + " \ delf NewDelimiter | delf DuplicateRows | delf IN | + " \ delf SaveOptions | delf CheckDuplicates | + " \ delf CompleteColumnNr | delf CSVPat | delf Transpose | + " \ delf LocalSettings() | delf AddColumn | delf SubstituteInColumn + " \ delf SetupAutoCmd() | delf CSV_CloseBuffer endfu fu! LocalSettings(type) "{{{3 @@ -257,14 +263,15 @@ augroup END endif endfu -fu! GetPat(colnr, maxcolnr, pat, allowmore) "{{{3 - " if a:allowmmore, allows more to match after the pattern + +fu! GetPat(colnr, maxcolnr, pat) "{{{3 if a:colnr > 1 && a:colnr < a:maxcolnr if !exists("b:csv_fixed_width_cols") return '^' . GetColPat(a:colnr-1,0) . '\%([^' . \ b:delimiter . ']\{-}\)\?\zs' . a:pat . '\ze' . - \ (a:allowmore ? ('\%([^' . b:delimiter .']\{-}\)\?' . - \ b:delimiter . GetColPat(a:maxcolnr - a:colnr, 0). '$') : '') + \ '\%([^' . b:delimiter .']\{-}\)\?' . + \ b:delimiter . GetColPat(a:maxcolnr - a:colnr, 0) . + \ '$' else return '\%' . b:csv_fixed_width_cols[(a:colnr - 1)] . 'c\zs' \ . a:pat . '.\{-}\ze\%' @@ -273,22 +280,24 @@ elseif a:colnr == a:maxcolnr if !exists("b:csv_fixed_width_cols") return '^' . GetColPat(a:colnr - 1,0) . - \ '\zs' . a:pat . '\ze$' + \ '\%([^' . b:delimiter . + \ ']\{-}\)\?\zs' . a:pat . '\ze' else return '\%' . b:csv_fixed_width_cols[-1] . - \ 'c\zs' . a:pat . '\ze$' + \ 'c\zs' . a:pat . '\ze' endif else " colnr = 1 if !exists("b:csv_fixed_width_cols") return '^' . '\%([^' . b:delimiter . ']\{-}\)\?\zs' . a:pat . - \ (a:allowmore ? ('\ze\%([^' . b:delimiter . ']*\)\?' . b:delimiter . - \ GetColPat(a:maxcolnr -1 , 0) . '$') : '') + \ '\ze\%([^' . b:delimiter . ']*\)\?' . b:delimiter . + \ GetColPat(a:maxcolnr -1 , 0) . '$' else return a:pat . '\ze.\{-}\%' . b:csv_fixed_width_cols[1] . 'c' endif endif return '' endfu + fu! SearchColumn(arg) "{{{3 try let arglist=split(a:arg) @@ -331,7 +340,7 @@ call Warn("There exists no column " . colnr) return 1 endif - let @/ = GetPat(colnr, maxcolnr, '\%('.pat. '\)', 1) + let @/ = GetPat(colnr, maxcolnr, '\%('.pat. '\)') try " force redraw, so that the search pattern isn't shown exe "norm! n\" @@ -345,6 +354,8 @@ echohl Normal endtry endfu + + fu! DeleteColumn(arg) "{{{3 let _wsv = winsaveview() if a:arg =~ '^[/]' @@ -367,6 +378,7 @@ endif call winrestview(_wsv) endfu + fu! DelColumn(colnr) "{{{3 let maxcolnr = MaxColumns() let _p = getpos('.') @@ -404,6 +416,7 @@ setl ro endif endfu + fu! HiCol(colnr, bang) "{{{3 if a:colnr > MaxColumns() && !a:bang call Warn("There exists no column " . a:colnr) @@ -433,9 +446,6 @@ " Additionally, filter all matches, that could have been used earlier let matchlist=getmatches() call filter(matchlist, 'v:val["group"] !~ s:hiGroup') - " remove matches, that come from matchaddpos() - " setmatches() can't handle them. - call filter(matchlist, 'has_key(v:val, "pattern")') call setmatches(matchlist) if a:bang return @@ -445,6 +455,7 @@ exe ":2match " . s:hiGroup . ' /' . pat . '/' endif endfu + fu! GetDelimiter(first, last) "{{{3 if !exists("b:csv_fixed_width_cols") let _cur = getpos('.') @@ -478,6 +489,7 @@ return '' endif endfu + fu! WColumn(...) "{{{3 " Return on which column the cursor is let _cur = getpos('.') @@ -511,7 +523,7 @@ let temp=getpos('.')[2] let j=1 let ret = 1 - for i in sort(b:csv_fixed_width_cols, s:csv_numeric_sort ? 'n' : 's:CSVSortValues') + for i in sort(b:csv_fixed_width_cols, "SortList") if temp >= i let ret = j endif @@ -521,13 +533,22 @@ call setpos('.',_cur) return ret endfu + fu! MaxColumns(...) "{{{3 - let this_col = exists("a:1") + if exists("a:0") && a:0 == 1 + let this_col = 1 + else + let this_col = 0 + endif "return maximum number of columns in first 10 lines if !exists("b:csv_fixed_width_cols") - let i = this_col ? a:1 : 1 + if this_col + let i = a:1 + else + let i = 1 + endif while 1 - let l = getline(i, (this_col ? i : i+10)) + let l = getline(i, i+10) " Filter comments out let pat = '^\s*\V'. escape(b:csv_cmt[0], '\\') @@ -553,9 +574,8 @@ return len(b:csv_fixed_width_cols) endif endfu -fu! ColWidth(colnr, ...) "{{{3 - " if a:1 is given, specifies the row, for which to calculate the width - " + +fu! ColWidth(colnr) "{{{3 " Return the width of a column " Internal function let width=20 "Fallback (wild guess) @@ -565,9 +585,6 @@ if !exists("b:csv_list") " only check first 10000 lines, to be faster let last = line('$') - if exists("a:1") - let last = a:1 - endif if !get(b:, 'csv_arrange_use_all_rows', 0) if last > 10000 let last = 10000 @@ -582,9 +599,13 @@ endif try for item in b:csv_list - call add(tlist, get(item, a:colnr-1, '')) + call add(tlist, item[a:colnr-1]) endfor - " do not strip leading whitespace + " we have a list of the first 10 rows + " Now transform it to a list of field a:colnr + " and then return the maximum strlen + " That could be done in 1 line, but that would look ugly + "call map(list, 'split(v:val, b:col."\\zs")[a:colnr-1]') call map(tlist, 'substitute(v:val, ".", "x", "g")') call map(tlist, 'strlen(v:val)') return max(tlist) @@ -606,9 +627,8 @@ endif endif endfu -fu! ArrangeCol(first, last, bang, limit, ...) range "{{{3 - " a:1, optional width parameter of line from which to take the width - " + +fu! ArrangeCol(first, last, bang, limit) range "{{{3 " explicitly give the range as argument to the function if exists("b:csv_fixed_width_cols") " Nothing to do @@ -616,22 +636,18 @@ return endif let cur=winsaveview() - if a:bang || (exists("a:1") && !empty(a:1)) - if a:bang && exists("b:col_width") - " Unarrange, so that if csv_arrange_align has changed - " it will be adjusted automaticaly - call PrepUnArrangeCol(a:first, a:last) + if a:bang + if a:bang + " Force recalculating the Column width + unlet! b:csv_list b:col_width endif - " Force recalculating the Column width - unlet! b:csv_list b:col_width elseif a:limit > -1 && a:limit < getfsize(fnamemodify(bufname(''), ':p')) return endif if !exists("b:col_width") " Force recalculation of Column width - let row = exists("a:1") ? a:1 : '' - call CalculateColumnWidth(row) + call CalculateColumnWidth() endif if &ro @@ -660,6 +676,7 @@ call winrestview(cur) endtry endfu + fu! ProgressBar(cnt, max) "{{{3 if get(g:, 'csv_no_progress', 0) return @@ -676,6 +693,7 @@ let s:temp = s:val endif endfu + fu! PrepUnArrangeCol(first, last) "{{{3 " Because of the way, Vim works with " a:firstline and a:lastline parameter, @@ -697,22 +715,26 @@ " Clean up variables, that were only needed for Columnize() function call winrestview(cur) endfu + fu! UnArrangeCol(match) "{{{3 " Strip leading white space, also trims empty records: - return substitute(a:match, '\%(^\s\+\)\|\%(\s\+\ze'.b:delimiter. '\?$\)', '', 'g') + if get(b:, 'csv_arrange_leftalign',0) + return substitute(a:match, '\s\+\ze'. b:delimiter. '\?$', '', '') + else + return substitute(a:match, '^\s\+', '', '') + endif + " only strip leading white space, if a non-white space follows: + "return substitute(a:match, '^\s\+\ze\S', '', '') endfu -fu! CalculateColumnWidth(row) "{{{3 + +fu! CalculateColumnWidth() "{{{3 " Internal function, not called from external, " does not work with fixed width columns let b:col_width=[] try let s:max_cols=MaxColumns(line('.')) for i in range(1,s:max_cols) - if empty(a:row) - call add(b:col_width, ColWidth(i)) - else - call add(b:col_width, ColWidth(i,a:row)) - endif + call add(b:col_width, ColWidth(i)) endfor catch /csv:no_col/ call Warn("Error: getting Column numbers, aborting!") @@ -723,6 +745,7 @@ " this was only necessary for calculating the max width unlet! b:csv_list s:columnize_count s:decimal_column endfu + fu! Columnize(field) "{{{3 " Internal function, not called from external, " does not work with fixed width columns @@ -825,6 +848,7 @@ return printf("%*S", width+1 , a:field) endif endfun + fu! GetColPat(colnr, zs_flag) "{{{3 " Return Pattern for given column if a:colnr > 1 @@ -849,25 +873,16 @@ endif return pat . (a:zs_flag ? '\zs' : '') endfu + fu! SetupAutoCmd(window,bufnr) "{{{3 " Setup QuitPre autocommand to quit cleanly aug CSV_QuitPre au! exe "au QuitPre * call CSV_CloseBuffer(".winbufnr(a:window).")" - if !exists("##OptionSet") - exe "au CursorHold call CSV_SetSplitOptions(".a:window.")" - else - exe "au OptionSet foldcolumn,number,relativenumber call CSV_SetOption(".a:bufnr. - \ ", ".bufnr('%').", expand(''), v:option_new)" - endif + exe "au CursorHold call CSV_SetSplitOptions(".a:window.")" aug END endfu -fu! CSV_SetOption(csvfile, header, option, value) "{{{3 - " only trigger if the option is called in the correct buffer - if getbufvar(a:csvfile, 'csv_SplitWindow') && bufnr('') == a:csvfile - call setbufvar(a:header, '&'.a:option, a:value) - endif -endfu + fu! SplitHeaderLine(lines, bang, hor) "{{{3 if exists("b:csv_fixed_width_cols") call Warn("Header does not work with fixed width column!") @@ -952,33 +967,29 @@ if !exists("b:csv_SplitWindow") return endif + exe b:csv_SplitWindow . "wincmd w" + if exists("_stl") + let &l:stl = _stl + endif + if exists("_sbo") + let &sbo = _sbo + endif + setl noscrollbind nocursorbind try - let winnr = winnr() - if winnr == b:csv_SplitWindow || winbufnr(b:csv_SplitWindow) == bufnr('') - " window already closed - return - endif - exe b:csv_SplitWindow . "wincmd w" - if exists("_stl") - let &l:stl = _stl - endif - if exists("_sbo") - let &sbo = _sbo - endif - setl noscrollbind nocursorbind - call CSV_CloseBuffer(bufnr('%')) + noa wincmd c catch /^Vim\%((\a\+)\)\=:E444/ " cannot close last window catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped " no-op - finally - unlet! b:csv_SplitWindow - aug CSV_Preview - au! - aug END - aug! CSV_Preview endtry + "pclose! + unlet! b:csv_SplitWindow + aug CSV_Preview + au! + aug END + aug! CSV_Preview endif endfu + fu! SplitHeaderToggle(hor) "{{{3 if !exists("b:csv_SplitWindow") :call SplitHeaderLine(1,0,a:hor) @@ -986,6 +997,7 @@ :call SplitHeaderLine(1,1,a:hor) endif endfu + " TODO: from here on add logic for fixed-width csv files! fu! MoveCol(forward, line, ...) "{{{3 " Move cursor position upwards/downwards left/right @@ -1021,7 +1033,7 @@ let line=line('$') endif if foldclosed(line) != -1 - let line = line > line('.') ? foldclosedend(line) + 1 : foldclosed(line) + let line = line > line('.') ? foldclosedend(line) : foldclosed(line) endif " Generate search pattern @@ -1107,23 +1119,23 @@ call setpos('.', a) endif endfun + fu! SortComplete(A,L,P) "{{{3 return join(range(1,MaxColumns()),"\n") endfun + +fu! SortList(a1, a2) "{{{3 + return a:a1+0 == a:a2+0 ? 0 : a:a1+0 > a:a2+0 ? 1 : -1 +endfu + fu! Sort(bang, line1, line2, colnr) range "{{{3 - " :Sort command - let wsv = winsaveview() - let flag = matchstr(a:colnr, '[nixo]') - call CheckHeaderLine() - let line1 = a:line1 - let line2 = a:line2 - if line1 <= s:csv_fold_headerline - let line1 += s:csv_fold_headerline - endif - if line2 <= s:csv_fold_headerline - let line2 += s:csv_fold_headerline - endif - let col = (empty(a:colnr) || a:colnr !~? '\d\+[nixo]\?') ? WColumn() : a:colnr+0 + let wsv=winsaveview() + if a:colnr =~? 'n' + let numeric = 1 + else + let numeric = 0 + endif + let col = (empty(a:colnr) || a:colnr !~? '\d\+') ? WColumn() : a:colnr+0 if col != 1 if !exists("b:csv_fixed_width_cols") let pat= '^' . GetColPat(col-1,1) . b:col @@ -1133,10 +1145,11 @@ else let pat= '^' . GetColPat(col,0) endif - exe line1. ','. line2. "sort". (a:bang ? '!' : '') . - \' r'. flag. ' /' . pat . '/' + exe a:line1. ','. a:line2. "sort". (a:bang ? '!' : '') . + \' r ' . (numeric ? 'n' : '') . ' /' . pat . '/' call winrestview(wsv) endfun + fu! CopyCol(reg, col, cnt) "{{{3 " Return Specified Column into register reg let col = a:col == "0" ? WColumn() : a:col+0 @@ -1183,6 +1196,7 @@ return a endif endfu + fu! MoveColumn(start, stop, ...) range "{{{3 " Move column behind dest " Explicitly give the range as argument, @@ -1238,8 +1252,11 @@ call setline(i, join(fields, '')) endfor + call winrestview(wsv) + endfu + fu! AddColumn(start, stop, ...) range "{{{3 " Add new empty column " Explicitly give the range as argument, @@ -1306,8 +1323,10 @@ " comments should by default be skipped (pattern shouldn't match) exe printf("sil %d,%ds/%s/%s/e", a:start, a:stop, pat, subst) endif + call winrestview(wsv) endfu + fu! SumColumn(list) "{{{3 " Sum a list of values, but only consider the digits within each value " parses the digits according to the given format (if none has been @@ -1344,65 +1363,7 @@ return sum endif endfu -fu! MaxColumn(list) "{{{3 - " Sum a list of values, but only consider the digits within each value - " parses the digits according to the given format (if none has been - " specified, assume POSIX format (without thousand separator) If Vim has - " does not support floats, simply sum up only the integer part - if empty(a:list) - return 0 - else - let result = [] - for item in a:list - if empty(item) - continue - endif - let nr = matchstr(item, '-\?\d\(.*\d\)\?$') - let format1 = '^-\?\d\+\zs\V' . s:nr_format[0] . '\m\ze\d' - let format2 = '\d\+\zs\V' . s:nr_format[1] . '\m\ze\d' - try - let nr = substitute(nr, format1, '', '') - if has("float") && s:nr_format[1] != '.' - let nr = substitute(nr, format2, '.', '') - endif - catch - let nr = 0 - endtry - call add(result, has("float") ? str2float(nr) : nr+0) - endfor - let result = sort(result, s:csv_numeric_sort ? 'n' : 's:CSVSortValues') - let ind = len(result) > 9 ? 9 : len(result) - if has_key(get(s:, 'additional', {}), 'distinct') && s:additional['distinct'] - if exists("*uniq") - let result=uniq(result) - else - let l = {} - for item in result - let l[item] = get(l, 'item', 0) - endfor - let result = keys(l) - endif - endif - return s:additional.ismax ? reverse(result)[:ind] : result[:ind] - endif -endfu -fu! CountColumn(list) "{{{3 - if empty(a:list) - return 0 - elseif has_key(get(s:, 'additional', {}), 'distinct') && s:additional['distinct'] - if exists("*uniq") - return len(uniq(sort(a:list))) - else - let l = {} - for item in a:list - let l[item] = get(l, 'item', 0) + 1 - endfor - return len(keys(l)) - endif - else - return len(a:list) - endif -endfu + fu! DoForEachColumn(start, stop, bang) range "{{{3 " Do something for each column, " e.g. generate SQL-Statements, convert to HTML, @@ -1425,10 +1386,6 @@ endif for item in range(a:start, a:stop, 1) - if foldlevel(line) - " Filter out folded lines (from dynamic filter) - continue - endif let t = g:csv_convert let line = getline(item) if line =~ '^\s*\V'. escape(b:csv_cmt[0], '\\') @@ -1470,7 +1427,9 @@ new call append('$', result) 1d _ + endfun + fu! PrepareDoForEachColumn(start, stop, bang) range"{{{3 let pre = exists("g:csv_pre_convert") ? g:csv_pre_convert : '' let g:csv_pre_convert=input('Pre convert text: ', pre) @@ -1483,6 +1442,7 @@ fu! EscapeValue(val) "{{{3 return '\V' . escape(a:val, '\') endfu + fu! FoldValue(lnum, filter) "{{{3 call CheckHeaderLine() @@ -1503,6 +1463,7 @@ endfor return (result > 0) endfu + fu! PrepareFolding(add, match) "{{{3 if !has("folding") return @@ -1542,14 +1503,41 @@ let col = WColumn() let max = MaxColumns() let a = GetColumn(line('.'), col) - let a = ProcessFieldValue(a) - let pat = '\%(^\|'.b:delimiter. '\)\@<='.EscapeValue(a). - \ '\m\ze\%('.b:delimiter.'\|$\)' + + if !exists("b:csv_fixed_width") + try + " strip leading whitespace + if (a =~ '\s\+'. b:delimiter . '$') + let b = split(a, '^\s\+\ze[^' . b:delimiter. ']\+')[0] + else + let b = a + endif + catch /^Vim\%((\a\+)\)\=:E684/ + " empty pattern - should match only empty columns + let b = a + endtry + + " strip trailing delimiter + try + let a = split(b, b:delimiter . '$')[0] + catch /^Vim\%((\a\+)\)\=:E684/ + let a = b + endtry + + if a == b:delimiter + try + let a=repeat(' ', ColWidth(col)) + catch + " no-op + endtry + endif + endif " Make a column pattern let b= '\%(' . \ (exists("b:csv_fixed_width") ? '.*' : '') . - \ GetPat(col, max, pat, 0) . '\)' + \ GetPat(col, max, EscapeValue(a) . '\m') . + \ '\)' let s:filter_count += 1 let b:csv_filter[s:filter_count] = { 'pat': b, 'id': s:filter_count, @@ -1577,38 +1565,7 @@ endif call winrestview(cpos) endfu -fu! ProcessFieldValue(field) "{{{3 - let a = a:field - if !exists("b:csv_fixed_width") - try - " strip leading whitespace - if (a =~ '\s\+'. b:delimiter . '$') - let b = split(a, '^\s\+\ze[^' . b:delimiter. ']\+')[0] - else - let b = a - endif - catch /^Vim\%((\a\+)\)\=:E684/ - " empty pattern - should match only empty columns - let b = a - endtry - - " strip trailing delimiter - try - let a = split(b, b:delimiter . '$')[0] - catch /^Vim\%((\a\+)\)\=:E684/ - let a = b - endtry - - if a == b:delimiter - try - let a=repeat(' ', ColWidth(col)) - catch - " no-op - endtry - endif - endif - return a -endfu + fu! OutputFilters(bang) "{{{3 if !a:bang call CheckHeaderLine() @@ -1649,10 +1606,12 @@ endif endif endfu + fu! SortFilter(a, b) "{{{3 return a:a.id == a:b.id ? 0 : \ a:a.id > a:b.id ? 1 : -1 endfu + fu! GetColumn(line, col) "{{{3 " Return Column content at a:line, a:col let a=getline(a:line) @@ -1673,6 +1632,7 @@ endif return substitute(a, '^\s\+\|\s\+$', '', 'g') endfu + fu! RemoveLastItem(count) "{{{3 for [key,value] in items(b:csv_filter) if value.id == a:count @@ -1680,12 +1640,14 @@ endif endfor endfu + fu! DisableFolding() "{{{3 setl nofen fdm=manual fdc=0 fdl=0 if !get(g:, 'csv_disable_fdt',0) && exists("s:fdt") && exists("s:fcs") exe printf("setl fdt=%s fcs=%s", s:fdt, escape(s:fcs, '\\|')) endif endfu + fu! NumberFormat() "{{{3 let s:nr_format = [',', '.'] if exists("b:csv_thousands_sep") @@ -1695,6 +1657,7 @@ let s:nr_format[1] = b:csv_decimal_sep endif endfu + fu! CheckHeaderLine() "{{{3 if !exists("b:csv_headerline") let s:csv_fold_headerline = 1 @@ -1702,6 +1665,7 @@ let s:csv_fold_headerline = b:csv_headerline endif endfu + fu! AnalyzeColumn(...) "{{{3 let maxcolnr = MaxColumns() if len(a:000) == 1 @@ -1730,12 +1694,10 @@ let res[item]+=1 endfor - let max_items = reverse(sort(values(res), s:csv_numeric_sort ? 'n' : 's:CSVSortValues')) - " What about the minimum 5 items? + let max_items = reverse(sort(values(res))) let count_items = keys(res) if len(max_items) > 5 call remove(max_items, 5, -1) - call map(max_items, 'printf(''\V%s\m'', escape(v:val, ''\\''))') call filter(res, 'v:val =~ ''^''.join(max_items, ''\|'').''$''') endif @@ -1752,7 +1714,7 @@ let i=1 for val in max_items for key in keys(res) - if res[key] =~ val && i <= len(max_items) + if res[key] == val && i <= len(max_items) if !empty(b:delimiter) let k = substitute(key, b:delimiter . '\?$', '', '') else @@ -1775,6 +1737,7 @@ echo printf("different values: %d", len(count_items)) unlet max_items endfunc + fu! Vertfold(bang, col) "{{{3 if a:bang do Syntax @@ -1793,7 +1756,7 @@ else let colnr=a:col endif - let pat=GetPat(colnr, MaxColumns(), '.*', 1) + let pat=GetPat(colnr, MaxColumns(), '.*') if exists("b:csv_fixed_width_cols") && \ pat !~ '^\^\.\*' " Make the pattern implicitly start at line start, @@ -1805,6 +1768,7 @@ exe "syn match CSVFold /" . pat . "/ conceal cchar=+" endif endfu + fu! InitCSVFixedWidth() "{{{3 if !exists("+cc") " TODO: make this work with a custom matchadd() command for older @@ -1856,13 +1820,14 @@ endw let b:csv_fixed_width_cols=[] let tcc=0 - let b:csv_fixed_width_cols = sort(keys(Dict), s:csv_numeric_sort ? 'n' : 's:CSVSortValues') - let b:csv_fixed_width = join(sort(keys(Dict), s:csv_numeric_sort ? 'n' : 's:CSVSortValues'), ',') + let b:csv_fixed_width_cols = sort(keys(Dict), "SortList") + let b:csv_fixed_width = join(sort(keys(Dict), "SortList"), ',') call Init(1, line('$')) let &l:cc=_cc redraw! endfu + fu! NewRecord(line1, line2, count) "{{{3 if a:count =~ "\D" call Warn("Invalid count specified") @@ -1897,6 +1862,7 @@ call append(nr, line) endfor endfu + fu! MoveOver(outer) "{{{3 " Move over a field " a:outer means include the delimiter @@ -1932,6 +1898,7 @@ call winrestview(_wsv) let @/ = _s endfu + fu! CSVMappings() "{{{3 call Map('noremap', 'W', ':call MoveCol(1, line("."))') call Map('noremap', '', ':call MoveCol(1, line("."))') @@ -1940,31 +1907,30 @@ call Map('noremap', '', ':call MoveCol(-1, line("."))') call Map('noremap', 'H', ':call MoveCol(-1, line("."), 1)') call Map('noremap', 'K', ':call MoveCol(0, line(".")-v:count1)') - call Map('nnoremap', '', ':call MoveCol(0, line(".")-v:count1)') + call Map('noremap', '', ':call MoveCol(0, line(".")-v:count1)') call Map('noremap', 'J', ':call MoveCol(0, line(".")+v:count1)') - call Map('nnoremap', '', ':call MoveCol(0, line(".")+v:count1)') + call Map('noremap', '', ':call MoveCol(0, line(".")+v:count1)') call Map('nnoremap', '', ':call PrepareFolding(1, 1)') call Map('nnoremap', '', ':call PrepareFolding(1, 0)') call Map('nnoremap', '', ':call PrepareFolding(0, 1)') call Map('imap', '', 'ColumnMode()', 'expr') " Text object: Field - call Map('xnoremap', 'if', ':call MoveOver(0)') - call Map('xnoremap', 'af', ':call MoveOver(1)') + call Map('vnoremap', 'if', ':call MoveOver(0)') + call Map('vnoremap', 'af', ':call MoveOver(1)') call Map('omap', 'af', ':norm vaf') call Map('omap', 'if', ':norm vif') - call Map('xnoremap', 'iL', ':call SameFieldRegion()') - call Map('omap', 'iL', ':call SameFieldRegion()') " Remap original values to a sane backup call Map('noremap', 'J', 'J') call Map('noremap', 'K', 'K') - call Map('xnoremap', 'W', 'W') - call Map('xnoremap', 'E', 'E') + call Map('vnoremap', 'W', 'W') + call Map('vnoremap', 'E', 'E') call Map('noremap', 'H', 'H') call Map('noremap', 'L', 'L') call Map('nnoremap', '', '') call Map('nnoremap', '', '') call Map('nnoremap', '', '') endfu + fu! CommandDefinitions() "{{{3 call LocalCmd("WhatColumn", ':echo WColumn(0)', \ '-bang') @@ -1976,8 +1942,8 @@ call LocalCmd("DeleteColumn", ':call DeleteColumn()', \ '-nargs=? -complete=custom,SortComplete') call LocalCmd("ArrangeColumn", - \ ':call ArrangeCol(, , 0, -1, )', - \ '-range -bang -nargs=?') + \ ':call ArrangeCol(, , 0, -1)', + \ '-range -bang') call LocalCmd("UnArrangeColumn", \':call PrepUnArrangeCol(, )', \ '-range') @@ -2005,15 +1971,6 @@ call LocalCmd("SumCol", \ ':echo csv#EvalColumn(, "SumColumn", ,)', \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("MaxCol", - \ ':echo csv#EvalColumn(, "MaxColumn", ,, 1)', - \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("MinCol", - \ ':echo csv#EvalColumn(, "MaxColumn", ,, 0)', - \ '-nargs=? -range=% -complete=custom,SortComplete') - call LocalCmd("CountCol", - \ ':echo csv#EvalColumn(, "CountColumn", ,)', - \ '-nargs=? -range=% -complete=custom,SortComplete') call LocalCmd("ConvertData", \ ':call PrepareDoForEachColumn(,,0)', \ '-bang -nargs=? -range=%') @@ -2040,6 +1997,7 @@ call LocalCmd('Substitute', ':call SubstituteInColumn(,,)', \ '-nargs=1 -range=%') endfu + fu! Map(map, name, definition, ...) "{{{3 let keyname = substitute(a:name, '[<>]', '', 'g') let expr = (exists("a:1") && a:1 == 'expr' ? '' : '') @@ -2057,12 +2015,11 @@ let unmap = 'ounmap' elseif a:map == 'imap' let unmap = 'iunmap' - elseif a:map == 'xnoremap' - let unmap = 'xunmap' endif let b:undo_ftplugin .= "| " . unmap . " " . a:name endif endfu + fu! LocalCmd(name, definition, args) "{{{3 if !exists(':'.a:name) exe "com! -buffer " a:args a:name a:definition @@ -2073,6 +2030,7 @@ call LocalCmd('CSV'.a:name, a:definition, a:args) endif endfu + fu! Menu(enable) "{{{3 if a:enable " Make a menu for the graphical vim @@ -2103,6 +2061,7 @@ sil! amenu disable CSV endif endfu + fu! SaveOptions(list) "{{{3 let save = {} for item in a:list @@ -2110,6 +2069,7 @@ endfor return save endfu + fu! NewDelimiter(newdelimiter, firstl, lastl) "{{{3 let save = SaveOptions(['ro', 'ma']) if exists("b:csv_fixed_width_cols") @@ -2157,6 +2117,7 @@ endif unlet! _delim endfu + fu! IN(list, value) "{{{3 for item in a:list if item == a:value @@ -2165,6 +2126,7 @@ endfor return 0 endfu + fu! DuplicateRows(columnlist) "{{{3 let duplicates = {} let cnt = 0 @@ -2203,6 +2165,7 @@ fu! CompleteColumnNr(A,L,P) "{{{3 return join(range(1,MaxColumns()), "\n") endfu + fu! CheckDuplicates(list) "{{{3 let string = a:list if string =~ '\d\s\?-\s\?\d' @@ -2212,6 +2175,7 @@ let list=split(string, ',') call DuplicateRows(list) endfu + fu! Transpose(line1, line2) "{{{3 " Note: - Comments will be deleted. " - Does not work with fixed-width columns @@ -2289,15 +2253,22 @@ unlet! transposed call winrestview(_wsv) endfu + + fu! NrColumns(bang) "{{{3 - try - let cols = empty(a:bang) ? MaxColumns() : MaxColumns(line('.')) - catch - " No column or comment line - call Warn("No valid CSV Column!") - endtry + if !empty(a:bang) + try + let cols = MaxColumns(line('.')) + catch + " No column or comment line + call Warn("No valid CSV Column!") + endtry + else + let cols = MaxColumns() + endif echo cols endfu + fu! Tabularize(bang, first, last) "{{{3 if match(split(&ft, '\.'),'csv') == -1 call Warn("No CSV filetype, aborting!") @@ -2336,14 +2307,8 @@ let b:csv_arrange_leftalign = 1 endif let newlines=[] - let content=[] while line <= a:last - if foldclosed(line) != -1 - let line = foldclosedend(line) + 1 - continue - endif let curline = getline(line) - call add(content, curline) if empty(split(curline, b:delimiter)) " only empty delimiters, add one empty delimiter " (:NewDelimiter strips trailing delimiter @@ -2354,11 +2319,6 @@ let line+=1 endw unlet! line - let delim=b:delimiter - new - call setline(1,content) - let b:delimiter=delim - call Init(1,line('$'), 1) if exists("b:csv_fixed_width_cols") let cols=copy(b:csv_fixed_width_cols) let pat = join(map(cols, ' ''\(\%''. v:val. ''c\)'' '), '\|') @@ -2374,7 +2334,7 @@ else " don't clear column width variable, might have been set in the " plugin! - sil call ArrangeCol(1, line('$'), 0, -1) + sil call ArrangeCol(a:first, a:last, 0, -1) if !get(b:, 'csv_arrange_leftalign',0) for line in newlines let cline = getline(line) @@ -2394,24 +2354,24 @@ endif let marginline = s:td.scol. join(map(copy(b:col_width), 'repeat(s:td.hbar, v:val)'), s:td.cros). s:td.ecol - call NewDelimiter(s:td.vbar, 1, line('$')) + call NewDelimiter(s:td.vbar, a:first, a:last+adjust_last) "exe printf('sil %d,%ds/%s/%s/ge', a:first, (a:last+adjust_last), " \ (exists("b:csv_fixed_width_cols") ? pat : b:delimiter ), s:td.vbar) " Add vertical bar in first column, if there isn't already one - exe printf('sil %d,%ds/%s/%s/e', 1, line('$'), + exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last, \ '^[^'. s:td.vbar. s:td.scol. ']', s:td.vbar.'&') " And add a final vertical bar, if there isn't one already - exe printf('sil %d,%ds/%s/%s/e', 1, line('$'), + exe printf('sil %d,%ds/%s/%s/e', a:first, a:last+adjust_last, \ '[^'. s:td.vbar. s:td.ecol. ']$', '&'. s:td.vbar) " Make nice intersection graphs - let line = split(getline(1), s:td.vbar) + let line = split(getline(a:first), s:td.vbar) call map(line, 'substitute(v:val, ''[^''.s:td.vbar. '']'', s:td.hbar, ''g'')') " Set top and bottom margins - call append(0, s:td.ltop. join(line, s:td.dhor). s:td.rtop) - call append(line('$'), s:td.lbot. join(line, s:td.uhor). s:td.rbot) + call append(a:first-1, s:td.ltop. join(line, s:td.dhor). s:td.rtop) + call append(a:last+adjust_last+1, s:td.lbot. join(line, s:td.uhor). s:td.rbot) if s:csv_fold_headerline > 0 - call append(1 + s:csv_fold_headerline, marginline) + call append(a:first + s:csv_fold_headerline, marginline) let adjust_last += 1 endif " Syntax will be turned off, so disable this part @@ -2424,7 +2384,7 @@ "ru syntax/csv.vim if a:bang - exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', 1 + s:csv_fold_headerline, line('$') + adjust_last, + exe printf('sil %d,%ds/^%s\zs\n/&%s&/e', a:first + s:csv_fold_headerline, a:last + adjust_last, \ '[^'.s:td.scol. '][^'.s:td.hbar.'].*', marginline) endif @@ -2432,6 +2392,7 @@ let &l:ma = _ma call winrestview(_c) endfu + fu! SubstituteInColumn(command, line1, line2) range "{{{3 " Command can be something like 1,2/foobar/foobaz/ to replace in 1 and second column " Command can be something like /foobar/foobaz/ to replace in the current column @@ -2491,7 +2452,7 @@ endw else for colnr in columns - let @/ = GetPat(colnr, maxcolnr, cmd[1], 1) + let @/ = GetPat(colnr, maxcolnr, cmd[1]) while search(@/) exe printf("%d,%ds//%s%s", a:line1, a:line2, cmd[2], (has_flags ? '/'. cmd[3] : '')) if !has_flags || (has_flags && cmd[3] !~# 'g') @@ -2520,6 +2481,7 @@ call call('setreg', _search) endtry endfu + fu! ColumnMode() "{{{3 let mode = mode() if mode =~# 'R' @@ -2534,52 +2496,9 @@ fu! Timeout(start) "{{{3 return localtime()-a:start < 2 endfu -fu! SameFieldRegion() "{{{3 - " visually select the region, that has the same value in the cursor field - let col = WColumn() - let max = MaxColumns() - let field = GetColumn(line('.'), col) - let line = line('.') - - let limit = [line, line] - " Search upwards and downwards from the current position and find the - " limit of the current selection - while line > 1 - let line -= 1 - if GetColumn(line, col) ==# field - let limit[0] = line - else - break - endif - endw - let line = line('.') - while line > 1 && line < line('$') - let line += 1 - if GetColumn(line, col) ==# field - let limit[1] = line - else - break - endif - endw - exe printf(':norm! %dGV%dG',limit[0],limit[1]) -endfu -fu! CSV_CloseBuffer(buffer) "{{{3 - " Setup by SetupAutoCmd autocommand - try - if bufnr((a:buffer)+0) > -1 - exe a:buffer. "bw" - endif - catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped - " no-op - finally - augroup CSV_QuitPre - au! - augroup END - augroup! CSV_QuitPre - endtry -endfu + " Global functions "{{{2 -fu! csv#EvalColumn(nr, func, first, last, ...) range "{{{3 +fu! csv#EvalColumn(nr, func, first, last) range "{{{3 " Make sure, the function is called for the correct filetype. if match(split(&ft, '\.'), 'csv') == -1 call Warn("File is no CSV file!") @@ -2610,7 +2529,6 @@ " parse the optional number format let format = matchstr(a:nr, '/[^/]*/') - let s:additional={} call NumberFormat() if !empty(format) try @@ -2631,13 +2549,6 @@ endif endtry endif - let distinct = matchstr(a:nr, '\') - if !empty(distinct) - let s:additional.distinct=1 - endif - if function(a:func) is# function("\".s:SID."_MaxColumn") - let s:additional.ismax = a:1 - endif try let result=call(function(a:func), [column]) return result @@ -2652,6 +2563,7 @@ call winrestview(save) endtry endfu + " return field index (x,y) with leading/trailing whitespace and trailing " delimiter stripped (only when a:0 is not given) fu! CSVField(x, y, ...) "{{{3 @@ -2682,68 +2594,15 @@ endif " encapsulates GetPat(), that returns the search pattern for a " given column and tries to set the cursor at the specific position - let pat = GetPat(a:colnr, MaxColumns(), a:0 ? a:1 : '.*', 1) + let pat = GetPat(a:colnr, MaxColumns(), a:0 ? a:1 : '.*') "let pos = match(pat, '.*\\ze') + 1 " Try to set the cursor at the beginning of the pattern " does not work "call setcmdpos(pos) return pat endfu -fu! CSVSum(col, fmt, first, last) "{{{3 - let first = a:first - let last = a:last - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - return csv#EvalColumn(a:col, 'SumColumn', first, last) -endfu -fu! CSVMax(col, fmt, first, last) "{{{3 - let first = a:first - let last = a:last - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - return csv#EvalColumn(a:col, 'MaxColumn', first, last, 1) -endfu -fu! CSVMin(col, fmt, first, last) "{{{3 - let first = a:first - let last = a:last - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - return csv#EvalColumn(a:col, 'MaxColumn', first, last, 0) -endfu -fu! CSVCount(col, fmt, first, last, ...) "{{{3 - let first = a:first - let last = a:last - let distinct = 0 - if empty(first) - let first = 1 - endif - if empty(last) - let last = line('$') - endif - if !exists('s:additional') - let s:additional = {} - endif - if exists("a:1") && !empty(a:1) - let s:additional['distinct'] = 1 - endif - let result=csv#EvalColumn(a:col, 'CountColumn', first, last, distinct) - unlet! s:additional['distinct'] - return (empty(result) ? 0 : result) -endfu + fu! CSV_WCol(...) "{{{3 - " Needed for airline try if exists("a:1") && (a:1 == 'Name' || a:1 == 1) return printf("%s", WColumn(1)) @@ -2755,6 +2614,48 @@ endtry endfun +fu! CSV_SetSplitOptions(window) "{{{3 + if exists("s:local_stl") + " local horizontal statusline + for opt in items({'&nu': &l:nu, '&rnu': &l:rnu, '&fdc': &fdc}) + if opt[1] != getwinvar(a:window, opt[0]) + call setwinvar(a:window, opt[0], opt[1]) + endif + endfor + " Check statusline (airline might change it) + if getwinvar(a:window, '&l:stl') != s:local_stl + call setwinvar(a:window, '&stl', s:local_stl) + endif + endif +endfun + +fu! CSV_CloseBuffer(buffer) "{{{3 + " Setup by SetupAutoCmd autocommand + try + if bufnr((a:buffer)+0) > -1 + exe a:buffer. "bw" + endif + catch /^Vim\%((\a\+)\)\=:E517/ " buffer already wiped + " no-op + finally + augroup CSV_QuitPre + au! + augroup END + augroup! CSV_QuitPre + endtry +endfu + +fu! CSVSum(col, fmt, first, last) "{{{3 + let first = a:first + let last = a:last + if empty(first) + let first = 1 + endif + if empty(last) + let last = line('$') + endif + return csv#EvalColumn(a:col, 'SumColumn', first, last) +endfu " Initialize Plugin "{{{2 let b:csv_start = exists("b:csv_start") ? b:csv_start : 1 let b:csv_end = exists("b:csv_end") ? b:csv_end : line('$') === modified file 'vim/bundle/csv.vim/syntax/csv.vim' --- vim/bundle/csv.vim/syntax/csv.vim 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/syntax/csv.vim 2015-02-13 09:59:55 +0000 @@ -128,26 +128,20 @@ hi def link CSVComment Comment endfun -fu! HiLink(name, target) "{{{3 - if !hlexists(a:name) - exe "hi def link" a:name a:target - endif -endfu - fu! DoSyntaxDefinitions() "{{{3 syn spell toplevel " Not really needed syn case ignore - call HiLink("CSVColumnHeaderOdd", "WarningMsg") - call HiLink("CSVColumnHeaderEven", "WarningMsg") + hi def link CSVColumnHeaderOdd WarningMsg + hi def link CSVColumnHeaderEven WarningMsg if get(g:, 'csv_no_column_highlight', 0) - call HiLink("CSVColumnOdd", "Normal") - call HiLink("CSVColumnEven", "Normal") + hi def link CSVColumnOdd Normal + hi def link CSVColumnEven Normal else - call HiLink("CSVColumnOdd", "DiffAdd") - call HiLink("CSVColumnEven","DiffChange") + hi def link CSVColumnOdd DiffAdd + hi def link CSVColumnEven DiffChange endif endfun === modified file 'vim/bundle/csv.vim/todo.txt' --- vim/bundle/csv.vim/todo.txt 2015-08-25 11:56:54 +0000 +++ vim/bundle/csv.vim/todo.txt 2015-02-13 09:59:55 +0000 @@ -1,10 +1,6 @@ ## Open items ## ---------------- -- use xsv for aligning columns? (xsv does not work, skips the delimiter) - use csvkit for aligning columns? - Should work more efficient/faster for larger csv files - (huge csv files can cause OOM on :ArrangeCol) - ArrangeColumn collapse command, This should collapse (conceal) overly wide columns so that the columns won't be too wide. === modified file 'vim/bundle/icalendar.vim/.git/index' Binary files vim/bundle/icalendar.vim/.git/index 2015-08-25 11:56:54 +0000 and vim/bundle/icalendar.vim/.git/index 2015-02-13 10:04:41 +0000 differ === modified file 'vim/bundle/icalendar.vim/.git/logs/HEAD' --- vim/bundle/icalendar.vim/.git/logs/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/icalendar.vim/.git/logs/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f Jan Pobrislo 1440501762 +0200 clone: from https://github.com/vim-scripts/icalendar.vim.git +0000000000000000000000000000000000000000 542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f Jan Pobrislo 1423821862 +0100 clone: from https://github.com/vim-scripts/icalendar.vim.git === modified file 'vim/bundle/icalendar.vim/.git/logs/refs/heads/master' --- vim/bundle/icalendar.vim/.git/logs/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/icalendar.vim/.git/logs/refs/heads/master 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f Jan Pobrislo 1440501762 +0200 clone: from https://github.com/vim-scripts/icalendar.vim.git +0000000000000000000000000000000000000000 542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f Jan Pobrislo 1423821862 +0100 clone: from https://github.com/vim-scripts/icalendar.vim.git === modified file 'vim/bundle/icalendar.vim/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/icalendar.vim/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/icalendar.vim/.git/logs/refs/remotes/origin/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f Jan Pobrislo 1440501762 +0200 clone: from https://github.com/vim-scripts/icalendar.vim.git +0000000000000000000000000000000000000000 542fff45385b1b5ad9781b0ad4878ba3b7ee9d5f Jan Pobrislo 1423821862 +0100 clone: from https://github.com/vim-scripts/icalendar.vim.git === modified file 'vim/bundle/tabular/.git/index' Binary files vim/bundle/tabular/.git/index 2015-08-25 11:56:54 +0000 and vim/bundle/tabular/.git/index 2015-02-13 10:04:41 +0000 differ === modified file 'vim/bundle/tabular/.git/logs/HEAD' --- vim/bundle/tabular/.git/logs/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/tabular/.git/logs/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 60f25648814f0695eeb6c1040d97adca93c4e0bb Jan Pobrislo 1440501790 +0200 clone: from https://github.com/godlygeek/tabular.git +0000000000000000000000000000000000000000 60f25648814f0695eeb6c1040d97adca93c4e0bb Jan Pobrislo 1423821865 +0100 clone: from https://github.com/godlygeek/tabular.git === modified file 'vim/bundle/tabular/.git/logs/refs/heads/master' --- vim/bundle/tabular/.git/logs/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/tabular/.git/logs/refs/heads/master 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 60f25648814f0695eeb6c1040d97adca93c4e0bb Jan Pobrislo 1440501790 +0200 clone: from https://github.com/godlygeek/tabular.git +0000000000000000000000000000000000000000 60f25648814f0695eeb6c1040d97adca93c4e0bb Jan Pobrislo 1423821865 +0100 clone: from https://github.com/godlygeek/tabular.git === modified file 'vim/bundle/tabular/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/tabular/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/tabular/.git/logs/refs/remotes/origin/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 60f25648814f0695eeb6c1040d97adca93c4e0bb Jan Pobrislo 1440501790 +0200 clone: from https://github.com/godlygeek/tabular.git +0000000000000000000000000000000000000000 60f25648814f0695eeb6c1040d97adca93c4e0bb Jan Pobrislo 1423821865 +0100 clone: from https://github.com/godlygeek/tabular.git === modified file 'vim/bundle/vim-KWEasy/.git/index' Binary files vim/bundle/vim-KWEasy/.git/index 2015-08-25 11:56:54 +0000 and vim/bundle/vim-KWEasy/.git/index 2015-02-13 10:04:41 +0000 differ === modified file 'vim/bundle/vim-KWEasy/.git/logs/HEAD' --- vim/bundle/vim-KWEasy/.git/logs/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-KWEasy/.git/logs/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 3db7e1b38438cdbaeb8080b8f59175228a96748c Jan Pobrislo 1440501794 +0200 clone: from https://github.com/dahu/vim-KWEasy +0000000000000000000000000000000000000000 3db7e1b38438cdbaeb8080b8f59175228a96748c Jan Pobrislo 1423821867 +0100 clone: from https://github.com/dahu/vim-KWEasy === modified file 'vim/bundle/vim-KWEasy/.git/logs/refs/heads/master' --- vim/bundle/vim-KWEasy/.git/logs/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-KWEasy/.git/logs/refs/heads/master 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 3db7e1b38438cdbaeb8080b8f59175228a96748c Jan Pobrislo 1440501794 +0200 clone: from https://github.com/dahu/vim-KWEasy +0000000000000000000000000000000000000000 3db7e1b38438cdbaeb8080b8f59175228a96748c Jan Pobrislo 1423821867 +0100 clone: from https://github.com/dahu/vim-KWEasy === modified file 'vim/bundle/vim-KWEasy/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/vim-KWEasy/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-KWEasy/.git/logs/refs/remotes/origin/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 3db7e1b38438cdbaeb8080b8f59175228a96748c Jan Pobrislo 1440501794 +0200 clone: from https://github.com/dahu/vim-KWEasy +0000000000000000000000000000000000000000 3db7e1b38438cdbaeb8080b8f59175228a96748c Jan Pobrislo 1423821867 +0100 clone: from https://github.com/dahu/vim-KWEasy === modified file 'vim/bundle/vim-eunuch/.git/index' Binary files vim/bundle/vim-eunuch/.git/index 2015-08-25 11:56:54 +0000 and vim/bundle/vim-eunuch/.git/index 2015-02-13 10:04:41 +0000 differ === modified file 'vim/bundle/vim-eunuch/.git/logs/HEAD' --- vim/bundle/vim-eunuch/.git/logs/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/.git/logs/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 eb8b2d54fb537ee93f762f6331265057a3f69727 Jan Pobrislo 1440501790 +0200 clone: from git://github.com/tpope/vim-eunuch.git +0000000000000000000000000000000000000000 8c996336ceecbfb7290c7c9b409195f190866548 Jan Pobrislo 1423821866 +0100 clone: from git://github.com/tpope/vim-eunuch.git === modified file 'vim/bundle/vim-eunuch/.git/logs/refs/heads/master' --- vim/bundle/vim-eunuch/.git/logs/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/.git/logs/refs/heads/master 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 eb8b2d54fb537ee93f762f6331265057a3f69727 Jan Pobrislo 1440501790 +0200 clone: from git://github.com/tpope/vim-eunuch.git +0000000000000000000000000000000000000000 8c996336ceecbfb7290c7c9b409195f190866548 Jan Pobrislo 1423821866 +0100 clone: from git://github.com/tpope/vim-eunuch.git === modified file 'vim/bundle/vim-eunuch/.git/logs/refs/remotes/origin/HEAD' --- vim/bundle/vim-eunuch/.git/logs/refs/remotes/origin/HEAD 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/.git/logs/refs/remotes/origin/HEAD 2015-02-13 10:04:41 +0000 @@ -1,1 +1,1 @@ -0000000000000000000000000000000000000000 eb8b2d54fb537ee93f762f6331265057a3f69727 Jan Pobrislo 1440501790 +0200 clone: from git://github.com/tpope/vim-eunuch.git +0000000000000000000000000000000000000000 8c996336ceecbfb7290c7c9b409195f190866548 Jan Pobrislo 1423821866 +0100 clone: from git://github.com/tpope/vim-eunuch.git === added file 'vim/bundle/vim-eunuch/.git/objects/pack/pack-17fac5dd012dfa9041b26fad3c208d5873c77a73.idx' Binary files vim/bundle/vim-eunuch/.git/objects/pack/pack-17fac5dd012dfa9041b26fad3c208d5873c77a73.idx 1970-01-01 00:00:00 +0000 and vim/bundle/vim-eunuch/.git/objects/pack/pack-17fac5dd012dfa9041b26fad3c208d5873c77a73.idx 2015-02-13 09:59:55 +0000 differ === added file 'vim/bundle/vim-eunuch/.git/objects/pack/pack-17fac5dd012dfa9041b26fad3c208d5873c77a73.pack' Binary files vim/bundle/vim-eunuch/.git/objects/pack/pack-17fac5dd012dfa9041b26fad3c208d5873c77a73.pack 1970-01-01 00:00:00 +0000 and vim/bundle/vim-eunuch/.git/objects/pack/pack-17fac5dd012dfa9041b26fad3c208d5873c77a73.pack 2015-02-13 09:59:55 +0000 differ === removed file 'vim/bundle/vim-eunuch/.git/objects/pack/pack-7fe2de0377d4f40c95609d3ec288d75a7bda600d.idx' Binary files vim/bundle/vim-eunuch/.git/objects/pack/pack-7fe2de0377d4f40c95609d3ec288d75a7bda600d.idx 2015-08-25 11:56:54 +0000 and vim/bundle/vim-eunuch/.git/objects/pack/pack-7fe2de0377d4f40c95609d3ec288d75a7bda600d.idx 1970-01-01 00:00:00 +0000 differ === removed file 'vim/bundle/vim-eunuch/.git/objects/pack/pack-7fe2de0377d4f40c95609d3ec288d75a7bda600d.pack' Binary files vim/bundle/vim-eunuch/.git/objects/pack/pack-7fe2de0377d4f40c95609d3ec288d75a7bda600d.pack 2015-08-25 11:56:54 +0000 and vim/bundle/vim-eunuch/.git/objects/pack/pack-7fe2de0377d4f40c95609d3ec288d75a7bda600d.pack 1970-01-01 00:00:00 +0000 differ === modified file 'vim/bundle/vim-eunuch/.git/packed-refs' --- vim/bundle/vim-eunuch/.git/packed-refs 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/.git/packed-refs 2015-02-13 09:59:55 +0000 @@ -1,2 +1,2 @@ # pack-refs with: peeled fully-peeled -eb8b2d54fb537ee93f762f6331265057a3f69727 refs/remotes/origin/master +8c996336ceecbfb7290c7c9b409195f190866548 refs/remotes/origin/master === modified file 'vim/bundle/vim-eunuch/.git/refs/heads/master' --- vim/bundle/vim-eunuch/.git/refs/heads/master 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/.git/refs/heads/master 2015-02-13 09:59:55 +0000 @@ -1,1 +1,1 @@ -eb8b2d54fb537ee93f762f6331265057a3f69727 +8c996336ceecbfb7290c7c9b409195f190866548 === modified file 'vim/bundle/vim-eunuch/.git/shallow' --- vim/bundle/vim-eunuch/.git/shallow 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/.git/shallow 2015-02-13 09:59:55 +0000 @@ -1,1 +1,1 @@ -eb8b2d54fb537ee93f762f6331265057a3f69727 +8c996336ceecbfb7290c7c9b409195f190866548 === modified file 'vim/bundle/vim-eunuch/README.markdown' --- vim/bundle/vim-eunuch/README.markdown 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/README.markdown 2015-02-13 09:59:55 +0000 @@ -6,7 +6,6 @@ * `:Remove`: Delete a buffer and the file on disk simultaneously. * `:Unlink`: Like `:Remove`, but keeps the now empty buffer. * `:Move`: Rename a buffer and the file on disk simultaneously. -* `:Rename`: Like `:Move`, but relative to the current file's containing directory. * `:Chmod`: Change the permissions of the current file. * `:Mkdir`: Create a directory, defaulting to the parent of the current file. * `:Find`: Run `find` and load the results into the quickfix list. @@ -16,7 +15,6 @@ * `:SudoEdit`: Edit a privileged file with `sudo`. * File type detection for `sudo -e` is based on original file name. * New files created with a shebang line are automatically made executable. -* New init scripts are automatically prepopulated with `/etc/init.d/skeleton`. [guard]: https://github.com/guard/guard === modified file 'vim/bundle/vim-eunuch/doc/eunuch.txt' --- vim/bundle/vim-eunuch/doc/eunuch.txt 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/doc/eunuch.txt 2015-02-13 09:59:55 +0000 @@ -19,9 +19,6 @@ File type detection for files edited with `sudoedit` and `sudo -e` happens based on the original file name. -New init scripts are automatically prepopulated with `/etc/init.d/skeleton`, -if available. - COMMANDS *eunuch-commands* *eunuch-:Remove* === modified file 'vim/bundle/vim-eunuch/plugin/eunuch.vim' --- vim/bundle/vim-eunuch/plugin/eunuch.vim 2015-08-25 11:56:54 +0000 +++ vim/bundle/vim-eunuch/plugin/eunuch.vim 2015-02-13 09:59:55 +0000 @@ -61,8 +61,7 @@ \ endif | \ endif | \ unlet s:src | - \ unlet s:dst | - \ filetype detect + \ unlet s:dst function! s:Rename_complete(A, L, P) abort let sep = s:separator() @@ -182,7 +181,7 @@ execute win.'wincmd w' endfunction -augroup eunuch +augroup shebang_chmod autocmd! autocmd BufNewFile * let b:brand_new_file = 1 autocmd BufWritePost * unlet! b:brand_new_file @@ -198,13 +197,6 @@ \ edit | \ unlet b:chmod_post | \ endif - - autocmd BufNewFile */init.d/* - \ if filereadable("/etc/init.d/skeleton") | - \ keepalt read /etc/init.d/skeleton | - \ 1delete_ | - \ endif | - \ set ft=sh augroup END " vim:set sw=2 sts=2: