comparison vim/autoload/ludo.vim @ 483:1a54ffbc3b15

Remove goyo stuff, add quicklist toggle.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 24 Sep 2020 23:07:10 -0700
parents b7682004288d
children 232351531855
comparison
equal deleted inserted replaced
482:4bd564a3c9a2 483:1a54ffbc3b15
95 endfor 95 endfor
96 endfor 96 endfor
97 call ludo#trace("Exclude list: ".join(g:pathogen_disabled, ', ')) 97 call ludo#trace("Exclude list: ".join(g:pathogen_disabled, ', '))
98 endfunction 98 endfunction
99 99
100 " Goyo writing mode tweaks 100 " Toggle quicklist window
101 " 101 "
102 let s:ludo_revert = {} 102 function! ludo#toggle_quicklist() abort
103 let l:qlwin = -1
104 let l:wincount = winnr('$')
105 for l:winidx in range(1, l:wincount)
106 let l:winbuftype = getwinvar(l:winidx, '&buftype', '')
107 if l:winbuftype == 'quickfix'
108 let l:qlwin = l:winidx
109 break
110 endif
111 endfor
103 112
104 function! ludo#on_goyo_enter() 113 if l:qlwin < 0
105 let s:ludo_revert = { 114 copen
106 \'spell': &spell, 115 else
107 \'copyindent': &copyindent, 116 cclose
108 \'smartindent': &smartindent, 117 endif
109 \'autoindent': &autoindent,
110 \'list': &list,
111 \'showmode': &showmode,
112 \'showcmd': &showcmd,
113 \'scrolloff': &scrolloff,
114 \'complete': &complete,
115 \'background': &background
116 \}
117 set spell
118 set nocopyindent nosmartindent noautoindent nolist noshowmode noshowcmd
119 set scrolloff=999
120 set complete+=s
121 set bg=light
122 if !has('gui_running')
123 let g:solarized_termcolors=256
124 endif
125 endfunction
126
127 function! ludo#on_goyo_leave()
128 if len(s:ludo_revert) == 0
129 call ludo#error("Can't revert settings!")
130 return
131 endif
132 for [key, val] in items(s:ludo_revert)
133 execute 'let &'.key.' = '.string(val)
134 endfor
135 let s:ludo_revert = {}
136 endfunction
137
138 function! ludo#writingmode()
139 Goyo
140 endfunction 118 endfunction
141 119
142 " Better tags browser using FZF 120 " Better tags browser using FZF
143 " 121 "
144 function! ludo#run_fzf_tags(args, bang) abort 122 function! ludo#run_fzf_tags(args, bang) abort