summaryrefslogtreecommitdiffhomepage
path: root/vimrc
diff options
context:
space:
mode:
author_Tradam <[email protected]>2021-10-04 03:34:53 -0400
committerGitHub <[email protected]>2021-10-04 03:34:53 -0400
commit20a7207d9348b5dbeb2955a2f21cff64adc6347b (patch)
tree47c4e0567efd0fb07052f14c69374afbc10483c4 /vimrc
parentdb45b2b72575591cab9b7b9b601214e2405ee453 (diff)
downloadVim-Configs-20a7207d9348b5dbeb2955a2f21cff64adc6347b.tar.gz
Vim-Configs-20a7207d9348b5dbeb2955a2f21cff64adc6347b.zip
Update vimrc
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc18
1 files changed, 16 insertions, 2 deletions
diff --git a/vimrc b/vimrc
index 376a110..1d3d4cb 100644
--- a/vimrc
+++ b/vimrc
@@ -164,6 +164,20 @@ augroup remember_folds
autocmd BufWinEnter ?* silent loadview | filetype detect
augroup END
+function! MakeSession()
+ let cwd = getcwd()
+ let filename = cwd . '/.vim'
+ exe "mksession! " . filename
+ exe "tabedit! " . filename
+ exe "silent g:^cd :d"
+ exe "silent g:^lcd :d"
+ " exe "silent %s:\V" . cwd . "/::ge"
+ " ^ Don’t work because getcwd() expand the ~ while mksession does not !
+ exe "silent %s?\\v \\~=/.+/? ?g"
+ " ^ backslash need to be protected
+ exe "x"
+endfunction
+
" Prefer to split below
set splitbelow
@@ -245,8 +259,8 @@ let g:vimwiki_listsyms = ' ~✓' "✗○●
augroup ft_vimwiki
au!
au BufRead,BufNewFile *.wiki set filetype=vimwiki
- au FileType vimwiki inoremap <silent> <buffer> <expr> <CR> pumvisible() ? "\<CR>" : "<Esc>:VimwikiReturn 1 5<CR>"
- au FileType vimwiki inoremap <silent> <buffer> <expr> <S-CR> pumvisible() ? "\<S-CR>" : "<Esc>:VimwikiReturn 2 2<CR>"
+ au FileType vimwiki inoremap <silent> <buffer> <expr> <CR> complete_info()['selected'] > -1 ? "\<CR>" : "<Esc>:VimwikiReturn 1 5<CR>"
+ au FileType vimwiki inoremap <silent> <buffer> <expr> <S-CR> complete_info()['selected'] > -1 ? "\<S-CR>" : "<Esc>:VimwikiReturn 2 2<CR>"
augroup END
" what program should vimtex use to show live edits