mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-11-13 16:32:30 -05:00
17 lines
443 B
VimL
17 lines
443 B
VimL
|
" This Tabular TableFormat() function is taken from the
|
||
|
" vim-markdown project by plasticboy, which can be found
|
||
|
" at https://github.com/plasticboy/vim-markdown and is
|
||
|
" licensed with the MIT license.
|
||
|
function! s:TableFormat()
|
||
|
let l:pos = getpos('.')
|
||
|
normal! {
|
||
|
call search('|')
|
||
|
normal! j
|
||
|
s/[^|]//g
|
||
|
Tabularize /|
|
||
|
s/ /-/g
|
||
|
call setpos('.', l:pos)
|
||
|
endfunction
|
||
|
|
||
|
command! -buffer TableFormat call s:TableFormat()
|