fix some old paths, neovim distraction free mode updates

This commit is contained in:
Daniel Flanagan 2017-02-08 12:08:10 -06:00
parent db059d115b
commit 575d73275c
3 changed files with 18 additions and 4 deletions

2
setup
View file

@ -46,7 +46,7 @@ links=(
# text editor files # text editor files
"$dfp/text-editor/neovim" "$XDG_CONFIG_HOME/nvim" "$dfp/text-editor/neovim" "$XDG_CONFIG_HOME/nvim"
"$dfp/common/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/current.vim" "$dfp/common/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim"
) )
source="" source=""

View file

@ -18,10 +18,10 @@ BASE16_SHELL="$DOTFILES_PATH/common/colors/shell"
[[ $- == *i* ]] && stty -ixon [[ $- == *i* ]] && stty -ixon
# import the fonts we're using so we can pass them to other applications # import the fonts we're using so we can pass them to other applications
source "$DOTFILES_PATH/common/scripts/get-fonts.bash" source "$DOTFILES_PATH/os-specific/arch-linux/scripts/get-fonts.bash"
# import the functions that retrieve our theme colors # import the functions that retrieve our theme colors
source "$DOTFILES_PATH/common/scripts/get-colors.bash" source "$DOTFILES_PATH/os-specific/arch-linux/scripts/get-colors.bash"
# import our aliases # import our aliases
source "$DOTFILES_PATH/shell/aliases" source "$DOTFILES_PATH/shell/aliases"

View file

@ -193,13 +193,14 @@ endif
let base16colorspace=256 let base16colorspace=256
set background=dark set background=dark
colorscheme current colorscheme base16-donokai
fun! ShowSpaceIndentation() fun! ShowSpaceIndentation()
hi WhiteSpaces ctermfg=black ctermbg=8 hi WhiteSpaces ctermfg=black ctermbg=8
match WhiteSpaces /^ \+/ match WhiteSpaces /^ \+/
endfunction endfunction
" a toggle-able minimalistic "distraction-free" text editing mode
let s:distractionFreeMode = 0 let s:distractionFreeMode = 0
fun! DistractionFreeModeFunc() fun! DistractionFreeModeFunc()
AirlineToggle AirlineToggle
@ -222,9 +223,22 @@ fun! DistractionFreeModeFunc()
set showcmd set showcmd
set number set number
hi NonText ctermfg=gray guifg=gray hi NonText ctermfg=gray guifg=gray
colorscheme base16-donokai
endif endif
endfunction endfunction
" prevents normal window navigation and closing while in DistractionFreeMode
fun! CheckCloseDistractionFreeMode()
if s:distractionFreeMode == 1
call DistractionFreeModeFunc()
endif
endfunction
" run the check function every time we leave a window
if has('autocmd')
autocmd WinLeave * call CheckCloseDistractionFreeMode()
endif
nnoremap <silent> <Leader>mz :DistractionFreeMode<CR> nnoremap <silent> <Leader>mz :DistractionFreeMode<CR>
:command! SpaceIndents call ShowSpaceIndentation() :command! SpaceIndents call ShowSpaceIndentation()