Better distraction-free editing

This commit is contained in:
Daniel Flanagan 2018-07-05 10:07:38 -05:00
parent f37af9701f
commit d9391ced2d
2 changed files with 12 additions and 23 deletions

View file

@ -210,3 +210,5 @@ xnoremap > >gv
nmap ga <Plug><EasyAlign> nmap ga <Plug><EasyAlign>
xmap ga <Plug><EasyAlign> xmap ga <Plug><EasyAlign>
nnoremap <silent> <Leader>df :DistractionFreeMode<CR>

View file

@ -153,9 +153,10 @@ Plug 'tpope/vim-fugitive' " vim git commands
Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object
Plug 'wellle/targets.vim' " adds some more handy text objects 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 '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 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', {'dir': '~/.fzf', 'do': './install --all'} " fuzzy file finding
Plug 'junegunn/fzf.vim' " helpers for using fzf in vim Plug 'junegunn/fzf.vim' " helpers for using fzf in vim
@ -258,27 +259,15 @@ endif
" a toggle-able minimalistic distraction-free text editing mode " a toggle-able minimalistic distraction-free text editing mode
let s:distractionFreeMode = 0 let s:distractionFreeMode = 0
fun! DistractionFreeModeFunc() fun! DistractionFreeModeFunc()
AirlineToggle
VimroomToggle
if s:distractionFreeMode == 0 if s:distractionFreeMode == 0
let s:distractionFreeMode = 1 let s:distractionFreeMode = 1
set nocursorline AirlineToggle
set laststatus=0 Goyo
set noshowmode
set noruler
set noshowcmd
set nonumber
hi NonText ctermfg=black guifg=black
else else
let s:distractionFreeMode = 0 let s:distractionFreeMode = 0
set cursorline Goyo!
set showmode AirlineToggle
set ruler AirlineRefresh
set laststatus=2
set showcmd
set number
hi NonText ctermfg=black guifg=black
colorscheme base16-donokai
endif endif
endfunction endfunction
@ -291,12 +280,10 @@ endfunction
" run the previous checking function every time we leave a window " run the previous checking function every time we leave a window
if has('autocmd') if has('autocmd')
autocmd WinLeave * call CheckCloseDistractionFreeMode() " autocmd WinLeave * call CheckCloseDistractionFreeMode()
endif endif
nnoremap <silent> <Leader>df :DistractionFreeMode<CR> command! DistractionFreeMode call DistractionFreeModeFunc()
:command! DistractionFreeMode call DistractionFreeModeFunc()
let bindingsfile=$vimdir.'/bindings.vim' let bindingsfile=$vimdir.'/bindings.vim'
exec 'source ' . bindingsfile exec 'source ' . bindingsfile