Hide tmux status and add ability to toggle preview

This commit is contained in:
Mark Vainomaa 2016-06-19 02:29:58 +03:00
parent 0ac1234126
commit 7ce0667ab8
1 changed files with 20 additions and 1 deletions

View File

@ -14,6 +14,7 @@ set wildmode=longest,list,full
set completeopt-=preview
set shortmess+=cI
set noshowmode
set shortmess+=I
set nostartofline
set wrap
set textwidth=0
@ -99,6 +100,16 @@ function! Load_color_scheme(info)
endif
endfunction
" Toggle preview
function! s:preview_toggle()
if &completeopt =~# "preview"
setlocal completeopt-=preview
pc
else
setlocal completeopt+=preview
endif
endfunction
" Plugin configurations
let g:airline_theme = 'powerlineish'
@ -191,12 +202,19 @@ call plug#end()
" Goyo
function! s:on_goyo_enter()
if exists('$TMUX')
silent !tmux set status off
endif
setlocal nocursorline
Limelight
endfunction
function! s:on_goyo_leave()
if exists('$TMUX')
silent !tmux set status on
endif
setlocal cursorline
Limelight!
endfunction
@ -231,7 +249,8 @@ nnoremap <silent> <C-o> :w<CR>
nnoremap <silent> <C-A-x> :q!<CR>
" Remove search highlighting
nnoremap <silent> <C-A-a> :noh<CR>
" Preview toggle
nnoremap <silent> <Leader>p :call <SID>preview_toggle()<CR>
" Commands from plugins