Create comfortable home office setup

This commit is contained in:
2020-04-08 12:51:57 +02:00
parent 52c33cce79
commit dbcb96e2c2
7 changed files with 31 additions and 19 deletions

View File

@@ -1,6 +1,5 @@
""Basic stuff
set number
set ttyfast
set encoding=utf8
set clipboard+=unnamedplus
set nofoldenable
@@ -49,8 +48,15 @@ let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set laststatus=0
""Set Markdown filetype for neomutt
autocmd BufNewFile,BufRead /tmp/neomutt* set filetype=markdown
""Quitting whether Goyo is active or not
""Quit whether Goyo is active or not
function! s:goyo_enter()
if executable('tmux') && strlen($TMUX)
silent !tmux set status off
silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
endif
set noshowmode
set noshowcmd
set scrolloff=999
let b:quitting = 0
let b:quitting_bang = 0
autocmd QuitPre <buffer> let b:quitting = 1
@@ -58,15 +64,19 @@ function! s:goyo_enter()
endfunction
function! s:goyo_leave()
" Quit Vim if this is the only remaining buffer
if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
if b:quitting_bang
qa!
else
qa
endif
if executable('tmux') && strlen($TMUX)
silent !tmux set status on
silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
endif
set showmode
set showcmd
set scrolloff=5
if b:quitting_bang
qa!
else
qa
endif
endfunction
autocmd! User GoyoEnter call <SID>goyo_enter()
autocmd! User GoyoLeave call <SID>goyo_leave()
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()