From d9391ced2d4e0ed786329636bb0054aa7538bff7 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 5 Jul 2018 10:07:38 -0500 Subject: [PATCH] Better distraction-free editing --- apps/neovim/bindings.vim | 2 ++ apps/neovim/init.vim | 33 ++++++++++----------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/apps/neovim/bindings.vim b/apps/neovim/bindings.vim index 649082b..379985d 100644 --- a/apps/neovim/bindings.vim +++ b/apps/neovim/bindings.vim @@ -210,3 +210,5 @@ xnoremap > >gv nmap ga xmap ga + +nnoremap df :DistractionFreeMode diff --git a/apps/neovim/init.vim b/apps/neovim/init.vim index df294b9..97e07c5 100644 --- a/apps/neovim/init.vim +++ b/apps/neovim/init.vim @@ -153,9 +153,10 @@ Plug 'tpope/vim-fugitive' " vim git commands Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object Plug 'wellle/targets.vim' " adds some more handy text objects Plug 'dbakker/vim-projectroot' " adds helper functions for getting to a project's root directory -Plug 'mikewest/vimroom' " distraction-free editing +" Plug 'mikewest/vimroom' " distraction-free editing +" let g:vimroom_sidebar_height = 0 +Plug 'junegunn/goyo.vim' " better distraction-free editing Plug 'editorconfig/editorconfig-vim' " loads project-specific editor settings -let g:vimroom_sidebar_height = 0 Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --all'} " fuzzy file finding Plug 'junegunn/fzf.vim' " helpers for using fzf in vim @@ -258,27 +259,15 @@ endif " a toggle-able minimalistic distraction-free text editing mode let s:distractionFreeMode = 0 fun! DistractionFreeModeFunc() - AirlineToggle - VimroomToggle if s:distractionFreeMode == 0 let s:distractionFreeMode = 1 - set nocursorline - set laststatus=0 - set noshowmode - set noruler - set noshowcmd - set nonumber - hi NonText ctermfg=black guifg=black + AirlineToggle + Goyo else let s:distractionFreeMode = 0 - set cursorline - set showmode - set ruler - set laststatus=2 - set showcmd - set number - hi NonText ctermfg=black guifg=black - colorscheme base16-donokai + Goyo! + AirlineToggle + AirlineRefresh endif endfunction @@ -291,12 +280,10 @@ endfunction " run the previous checking function every time we leave a window if has('autocmd') - autocmd WinLeave * call CheckCloseDistractionFreeMode() + " autocmd WinLeave * call CheckCloseDistractionFreeMode() endif -nnoremap df :DistractionFreeMode - -:command! DistractionFreeMode call DistractionFreeModeFunc() +command! DistractionFreeMode call DistractionFreeModeFunc() let bindingsfile=$vimdir.'/bindings.vim' exec 'source ' . bindingsfile