1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:00:04 +08:00

Fix goyo support

This commit is contained in:
wsdjeg 2017-02-01 22:49:15 +08:00
parent 737858bde3
commit b9105b575d
4 changed files with 21 additions and 10 deletions

View File

@ -25,10 +25,10 @@
- [Awesome ui](#awesome-ui) - [Awesome ui](#awesome-ui)
- [Language specific mode](#language-specific-mode) - [Language specific mode](#language-specific-mode)
- [c/c++ support](#cc-support) - [c/c++ support](#cc-support)
- python support
- [go support](#go-support) - [go support](#go-support)
- rust support - rust support
- php support - php support
- python support
- perl support - perl support
- lua support - lua support
- [Unite centric work-flow](#unite-centric-work-flow) - [Unite centric work-flow](#unite-centric-work-flow)

View File

@ -27,6 +27,9 @@ function! SpaceVim#default#SetOptions() abort
set relativenumber set relativenumber
set number set number
" hide cmd
set noshowcmd
" indent " indent
set autoindent set autoindent
set smartindent set smartindent
@ -78,7 +81,6 @@ function! SpaceVim#default#SetOptions() abort
set nowritebackup set nowritebackup
set matchtime=0 set matchtime=0
set ruler set ruler
set showcmd
set showmatch set showmatch
set showmode set showmode
"menuone: show the pupmenu when only one match "menuone: show the pupmenu when only one match

View File

@ -4,6 +4,7 @@ function! SpaceVim#layers#tools#plugins() abort
\ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}], \ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}],
\ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}], \ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}],
\ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}], \ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', 'loadconf' : 1}],
\ ['junegunn/limelight.vim', { 'on_cmd' : 'Limelight'}],
\ ['Yggdroot/LeaderF', {'merged' : 0}], \ ['Yggdroot/LeaderF', {'merged' : 0}],
\ ['google/vim-searchindex'], \ ['google/vim-searchindex'],
\ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}], \ ['simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'}],

View File

@ -1,18 +1,26 @@
let s:save_option = {}
function! s:goyo_enter() 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 noshowmode
set noshowcmd set noshowcmd
set scrolloff=999 set scrolloff=999
Limelight if exists(':Limelight') == 2
Limelight
let s:save_option['limelight'] = 1
endif
endfunction endfunction
function! s:goyo_leave() function! s:goyo_leave()
silent !tmux set status on let &showmode = s:save_option['showmode']
set showmode let &showcmd = s:save_option['showcmd']
set showcmd let &scrolloff = s:save_option['scrolloff']
set scrolloff=5 if get(s:save_option,'limelight', 0)
execute 'Limelight!'
endif
endfunction endfunction
augroup goyo_map augroup goyo_map
autocmd! User GoyoEnter nested call <SID>goyo_enter() autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave() autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup END augroup END