Commit 263de80b authored by HiPhish's avatar HiPhish

Move some code over to ftplugin

parent e8c0b674
......@@ -33,6 +33,20 @@ setlocal shiftwidth=8
nnoremap <buffer> g? :call <SID>help()<CR>
" Settings inside this condition only apply rendered Info files, not on-disc
" Info files.
if &buftype =~? 'nofile'
setlocal bufhidden=hide
setlocal noswapfile
setlocal nonumber
setlocal nomodified
setlocal foldcolumn=0
setlocal colorcolumn=0
setlocal nolist
setlocal nospell
setlocal concealcursor="nc"
setlocal conceallevel=2
endif
" Echo a quick instruction list
function! s:help()
......
......@@ -181,11 +181,8 @@ function! s:readReference(ref)
endif
" We will lock it after assembly
setlocal modifiable
setlocal readonly
setlocal noswapfile
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal modifiable
" Make sure to redirect the standard error into the void
let l:cmd = s:encodeCommand(a:ref, {'stderr': '/dev/null'})
......@@ -248,18 +245,10 @@ function! s:readReference(ref)
call s:buildMenu()
call s:collectXRefs()
" Now lock the file and set all the remaining options
" Now lock the file, this will set all the remaining options
setlocal filetype=info
setlocal nonumber
setlocal norelativenumber
setlocal nomodifiable
setlocal nomodified
setlocal foldcolumn=0
setlocal colorcolumn=0
setlocal nolist
setlocal nospell
setlocal concealcursor="nc"
setlocal conceallevel=2
setlocal readonly
endfunction
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment