-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtohtml
65 lines (51 loc) · 1.49 KB
/
tohtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
" This is a Vimscript used for printing files with syntax colouring
" =============== Begin NeoBundle Initialization ===============
" Initialize
if has ('vim_starting')
set nocompatible
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))
let g:neobundle#install_max_processes = 8
let g:neobundle#install_process_timeout = 500
" NeoBundle dependencies
NeoBundleFetch 'Shougo/neobundle.vim'
" Colour schemes
NeoBundle 'Relaxed-Green'
NeoBundle 'tomasr/molokai'
" Finalize
call neobundle#end()
NeoBundleCheck
" Enable built-in plugins
filetype plugin indent on
syntax on
runtime plugin/tohtml.vim
" =============== End NeoBundle Initialization ================
" Set colorscheme
colorscheme relaxedgreen
" Settings needed to preserve formatting
set wrap
set linebreak "Wrap lines at convenient points
set scrolloff=3 "See the surrounding lines when cursor is at the edge of the screen
set nu "Absolute line numbers
set window=40
set textwidth=0 "Disable automatically creating a new line after 80 chars
set nolist
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
" Printing stuff
function Print_html_file()
if $FILE_FORMAT != ""
set filetype=$FILE_FORMAT
endif
if $LINE_NO == 0
set nonu
endif
if $OUTPUT == ""
echoerr "Output path not defined"
else
TOhtml
w! $OUTPUT
qa!
endif
endfunction
autocmd BufRead * :call Print_html_file()