From b9105b575dd0060a504f5688cbd91fd9f10ec57b Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Wed, 1 Feb 2017 22:49:15 +0800 Subject: [PATCH] Fix goyo support --- README.md | 2 +- autoload/SpaceVim/default.vim | 4 +++- autoload/SpaceVim/layers/tools.vim | 1 + config/plugins/goyo.vim | 24 ++++++++++++++++-------- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a6d942b01..ca8576f35 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ - [Awesome ui](#awesome-ui) - [Language specific mode](#language-specific-mode) - [c/c++ support](#cc-support) + - python support - [go support](#go-support) - rust support - php support - - python support - perl support - lua support - [Unite centric work-flow](#unite-centric-work-flow) diff --git a/autoload/SpaceVim/default.vim b/autoload/SpaceVim/default.vim index db662e66a..98a10d622 100644 --- a/autoload/SpaceVim/default.vim +++ b/autoload/SpaceVim/default.vim @@ -27,6 +27,9 @@ function! SpaceVim#default#SetOptions() abort set relativenumber set number + " hide cmd + set noshowcmd + " indent set autoindent set smartindent @@ -78,7 +81,6 @@ function! SpaceVim#default#SetOptions() abort set nowritebackup set matchtime=0 set ruler - set showcmd set showmatch set showmode "menuone: show the pupmenu when only one match diff --git a/autoload/SpaceVim/layers/tools.vim b/autoload/SpaceVim/layers/tools.vim index 0612a5bb4..722e67b70 100644 --- a/autoload/SpaceVim/layers/tools.vim +++ b/autoload/SpaceVim/layers/tools.vim @@ -4,6 +4,7 @@ function! SpaceVim#layers#tools#plugins() abort \ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}], \ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}], \ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}], + \ ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}], \ ['Yggdroot/LeaderF', {'merged' : 0}], \ ['google/vim-searchindex'], \ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}], diff --git a/config/plugins/goyo.vim b/config/plugins/goyo.vim index 6e638f3fb..ea1f02ad5 100644 --- a/config/plugins/goyo.vim +++ b/config/plugins/goyo.vim @@ -1,18 +1,26 @@ +let s:save_option = {} function! s:goyo_enter() - silent !tmux set status off + let s:save_option['showmode'] = &showmode + let s:save_option['showcmd'] = &showcmd + let s:save_option['scrolloff'] = &scrolloff set noshowmode set noshowcmd set scrolloff=999 - Limelight + if exists(':Limelight') == 2 + Limelight + let s:save_option['limelight'] = 1 + endif endfunction function! s:goyo_leave() - silent !tmux set status on - set showmode - set showcmd - set scrolloff=5 + let &showmode = s:save_option['showmode'] + let &showcmd = s:save_option['showcmd'] + let &scrolloff = s:save_option['scrolloff'] + if get(s:save_option,'limelight', 0) + execute 'Limelight!' + endif endfunction augroup goyo_map -autocmd! User GoyoEnter nested call goyo_enter() -autocmd! User GoyoLeave nested call goyo_leave() + autocmd! User GoyoEnter nested call goyo_enter() + autocmd! User GoyoLeave nested call goyo_leave() augroup END