From 575d73275c7fc149625b2a3ed45d37b90983d95e Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 8 Feb 2017 12:08:10 -0600 Subject: [PATCH] fix some old paths, neovim distraction free mode updates --- setup | 2 +- shell/bashrc | 4 ++-- text-editor/neovim/init.vim | 16 +++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/setup b/setup index 9b59f3f..987d6b4 100755 --- a/setup +++ b/setup @@ -46,7 +46,7 @@ links=( # text editor files "$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="" diff --git a/shell/bashrc b/shell/bashrc index b14cbce..58f2da2 100644 --- a/shell/bashrc +++ b/shell/bashrc @@ -18,10 +18,10 @@ BASE16_SHELL="$DOTFILES_PATH/common/colors/shell" [[ $- == *i* ]] && stty -ixon # 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 -source "$DOTFILES_PATH/common/scripts/get-colors.bash" +source "$DOTFILES_PATH/os-specific/arch-linux/scripts/get-colors.bash" # import our aliases source "$DOTFILES_PATH/shell/aliases" diff --git a/text-editor/neovim/init.vim b/text-editor/neovim/init.vim index fcadd7d..500e72a 100644 --- a/text-editor/neovim/init.vim +++ b/text-editor/neovim/init.vim @@ -193,13 +193,14 @@ endif let base16colorspace=256 set background=dark -colorscheme current +colorscheme base16-donokai fun! ShowSpaceIndentation() hi WhiteSpaces ctermfg=black ctermbg=8 match WhiteSpaces /^ \+/ endfunction +" a toggle-able minimalistic "distraction-free" text editing mode let s:distractionFreeMode = 0 fun! DistractionFreeModeFunc() AirlineToggle @@ -222,9 +223,22 @@ fun! DistractionFreeModeFunc() set showcmd set number hi NonText ctermfg=gray guifg=gray + colorscheme base16-donokai endif 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 mz :DistractionFreeMode :command! SpaceIndents call ShowSpaceIndentation()