From c330b99d632821aa1b9d4e5d633185f279f95647 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 4 Jan 2018 21:13:54 -0600 Subject: [PATCH] .vimrc: Add 'goyo' plugin - Distraction-free writing in Vim --- .vimrc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.vimrc b/.vimrc index ee4bc90..7e1ebb0 100644 --- a/.vimrc +++ b/.vimrc @@ -19,6 +19,8 @@ call plug#begin('~/.vim/plugged') Plug 'airblade/vim-gitgutter' Plug 'altercation/vim-colors-solarized' +Plug 'junegunn/goyo.vim' +Plug 'junegunn/limelight.vim' Plug 'kien/ctrlp.vim' Plug 'kopischke/vim-fetch' Plug 'mileszs/ack.vim' @@ -87,6 +89,27 @@ let g:airline_symbols.maxlinenr = '' " gitgutter let g:gitgutter_enabled = 0 " disable by default +" goyo + limelight +let g:goyo_width = 95 +let g:limelight_conceal_ctermfg = 240 + +function! s:goyo_enter() + if exists('$TMUX') + silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z + endif + Limelight +endfunction + +function! s:goyo_leave() + if exists('$TMUX') + silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z + endif + Limelight! +endfunction + +autocmd! User GoyoEnter nested call goyo_enter() +autocmd! User GoyoLeave nested call goyo_leave() + " --------------------------------------------------------------------------- " Terminal Settings " --------------------------------------------------------------------------- @@ -123,6 +146,7 @@ if &t_Co > 2 || has("gui_running") syntax enable " syntax highligting let g:solarized_termcolors=&t_Co " use 256 colors for solarized + let g:solarized_termtrans=1 colorscheme solarized let g:airline_theme='solarized16' " vim-airline theme @@ -331,6 +355,8 @@ nmap ht :GitGutterToggle nmap hp GitGutterPreviewHunk nmap hu GitGutterUndoHunk nmap hs GitGutterStageHunk +" goyo +nnoremap G :Goyo " -------------------------------------------------------------------------- " Functions -- 2.47.1