table mode
This commit is contained in:
parent
0336587752
commit
b2bbdc7aa1
|
@ -0,0 +1 @@
|
|||
cp -r $(pwd)/home/.config ~
|
|
@ -19,7 +19,7 @@ set completeopt=menuone,noinsert,noselect
|
|||
" Set completeopt to have a better completion experience"
|
||||
set completeopt=menuone,noinsert,noselect
|
||||
|
||||
" load nvim-tree stuff
|
||||
" load extra stuff
|
||||
runtime nvim-tree.vim
|
||||
|
||||
call plug#begin()
|
||||
|
@ -40,10 +40,13 @@ Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install' }
|
|||
Plug 'nanotee/zoxide.vim'
|
||||
Plug 'jpalardy/vim-slime', { 'for': 'python' }
|
||||
Plug 'hanschen/vim-ipython-cell', { 'for': 'python' }
|
||||
Plug 'dhruvasagar/vim-table-mode'
|
||||
runtime markdownpreview.vim
|
||||
|
||||
call plug#end()
|
||||
|
||||
" load extra stuff
|
||||
runtime table-mode.vim
|
||||
|
||||
" no default mappings for vim smoothie (fancy scrolling)
|
||||
let g:smoothie_no_default_mappings = 1
|
||||
|
|
|
@ -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>' : '__'
|
Loading…
Reference in New Issue