Merge branch 'tablemode'

This commit is contained in:
Christoph J. Scherr 2023-07-04 19:38:43 +02:00
commit d702e43215
Signed by: PlexSheep
GPG Key ID: 25B4ACF7D88186CC
2 changed files with 14 additions and 0 deletions

1
conf-only.sh Executable file
View File

@ -0,0 +1 @@
cp -r $(pwd)/home/.config ~

View File

@ -0,0 +1,13 @@
function! s:isAtStartOfLine(mapping)
let text_before_cursor = getline('.')[0 : col('.')-1]
let mapping_pattern = '\V' . escape(a:mapping, '\')
let comment_pattern = '\V' . escape(substitute(&l:commentstring, '%s.*$', '', ''), '\')
return (text_before_cursor =~? '^' . ('\v(' . comment_pattern . '\v)?') . '\s*\v' . mapping_pattern . '\v$')
endfunction
inoreabbrev <expr> <bar><bar>
\ <SID>isAtStartOfLine('\|\|') ?
\ '<c-o>:TableModeEnable<cr><bar><space><bar><left><left>' : '<bar><bar>'
inoreabbrev <expr> __
\ <SID>isAtStartOfLine('__') ?
\ '<c-o>:silent! TableModeDisable<cr>' : '__'