Remove specific vimrc for mutt and add goyo config to vim

This commit is contained in:
Thomas Dehaeze 2019-02-03 17:49:24 +01:00
parent f7b29241ab
commit 6db22475e6
2 changed files with 35 additions and 5 deletions

View File

@ -348,7 +348,7 @@ bind index,pager y edit-label
*** Open in Vim *** Open in Vim
#+BEGIN_SRC conf #+BEGIN_SRC conf
bind index,pager V noop bind index,pager V noop
macro index,pager V "|nvim -u ~/.vim/vimrc.mutt -c 'setlocal ft=mail' -c 'setlocal buftype=nofile' -<enter>" "open in vim" macro index,pager V "|nvim -c 'setlocal ft=mail' -c 'setlocal buftype=nofile' -<enter>" "open in vim"
#+END_SRC #+END_SRC
*** Make quick html view macro *** Make quick html view macro
@ -776,7 +776,7 @@ unset record
** Use Vim to compose email, with a few default options. ** Use Vim to compose email, with a few default options.
#+BEGIN_SRC conf #+BEGIN_SRC conf
set editor = "nvim -u ~/.vim/vimrc.mutt -c ':Goyo' -c '/\\n--' -c ':noh' -c 'startinsert'" set editor = "nvim -c ':Goyo' -c '/\\n--' -c ':noh' -c 'startinsert'"
#+END_SRC #+END_SRC
** Basic Options ** Basic Options

View File

@ -783,6 +783,36 @@ let g:goyo_margin_top = 2
let g:goyo_margin_bottom = 2 let g:goyo_margin_bottom = 2
#+END_SRC #+END_SRC
This is for soft line breaks
#+BEGIN_SRC conf
function! s:goyo_enter()
set wrap linebreak nolist textwidth=0 wrapmargin=0
let b:quitting = 0
let b:quitting_bang = 0
autocmd QuitPre <buffer> let b:quitting = 1
cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q!
endfunction
#+END_SRC
Quit Vim if this is the only remaining buffer
#+BEGIN_SRC conf
function! s:goyo_leave()
if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
if b:quitting_bang
qa!
else
qa
endif
endif
endfunction
#+END_SRC
#+BEGIN_SRC conf
autocmd! User GoyoEnter call <SID>goyo_enter()
autocmd! User GoyoLeave call <SID>goyo_leave()
#+END_SRC
** tpope/vim-surround ** tpope/vim-surround
#+BEGIN_SRC conf #+BEGIN_SRC conf
vmap Si S(i_<esc>f) vmap Si S(i_<esc>f)