From f380d032d99bec01de5edb3e6909081fb83afd5f Mon Sep 17 00:00:00 2001 From: Felix Nehrke Date: Fri, 25 Feb 2022 00:52:56 +0100 Subject: [PATCH] update .vimrc --- .vimrc | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/.vimrc b/.vimrc index 81dc1ad..51e5764 100644 --- a/.vimrc +++ b/.vimrc @@ -30,6 +30,7 @@ Plugin 'git@github.com:tpope/vim-surround.git' Plugin 'git@github.com:vim-airline/vim-airline.git' Plugin 'git@github.com:vim-syntastic/syntastic.git' Plugin 'git@github.com:vimwiki/vimwiki.git' +Plugin 'git@github.com:tpope/vim-cucumber.git' call vundle#end() " End: Manage plugins @@ -67,8 +68,8 @@ highlight CusrsorLine ctermbg=green colorscheme gruvbox " sorted alphabetically to avoid conflicts, even if it's harder to read! -imap :botright terminal ++close -inoremap :call align()a +nnoremap :botright terminal ++close +inoremap :botright terminal ++close nmap , :NERDTreeFocus nmap c :NERDTreeClose nmap d :VimwikiDiaryIndex @@ -95,7 +96,6 @@ nmap tp :Tabularize /\|/l1 nmap tt :Tabularize /\|/l1 nmap u :UndotreeToggle nmap w :set wrap! -nmap :botright terminal ++close nmap gv :vertical wincmd f augroup jsgroup @@ -123,25 +123,10 @@ augroup vimwikigroup autocmd FileType vimwiki nmap to :VimwikiTOC autocmd FileType vimwiki noremap ZZ :Goyo!:q " Fix broken backspace functionality on mac - autocmd FileType vimwiki nmap VimwikiGoBackLink - "autocmd BufRead,BufNewFile *.wiki :Goyo 80 - "autocmd FileType vimwiki nmap tp :Tabularize /\|/l0 - "autocmd FileType vimwiki nmap tt :Tabularize /\|/l0 - inoremap - - " Autocommit stuff - "autocmd BufWritePost $HOME/vimwiki/* execute 'silent ! FILE=$(basename %); cd $(dirname %); if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1 ; then git add $FILE > /dev/null 2>&1; git commit -m $FILE > /dev/null 2>&1; git push > /dev/null 2>&1; fi' + if has("unix") + let s:uname = system("uname -s") + if s:uname == "Darwin" + autocmd FileType vimwiki nmap VimwikiGoBackLink + endif + endif augroup end - -" Utility function to format tables in real time -" (only for pipe-separated tables) -function! s:align() - let p = '^\s*|\s.*\s|\s*' - if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) - let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) - let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) - Tabularize/|/l1 - normal! 0 - call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) - endif -endfunction