-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathft.vim
43 lines (35 loc) · 1.7 KB
/
ft.vim
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
" Vimscript
aug init-vim
au! BufNewFile,BufFilePre,BufRead *.vim se ft=vim
\ shiftwidth=2 tabstop=2 softtabstop=2
\ foldmethod=marker
aug END
" markdown
aug init-md
au! BufNewFile,BufFilePre,BufRead *.markdown,*.md,*.mdown,*.mkd,*.mkdn,*.mdwn se ft=markdown
\ expandtab shiftwidth=2 tabstop=2 softtabstop=2
\ formatoptions+=croq
aug END
" Set some general options
au FileType sh,zsh,octave,c,cpp,go,julia se shiftwidth=2 tabstop=2 softtabstop=2
au FileType asm,fsharp,html,json,css,scss,javascriptreact,typescriptreact,lua,tex se shiftwidth=4 tabstop=4 softtabstop=4 et
" enable accessing GNU Octave documentation from vim using GNU TexInfo (lol)
let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!'
au FileType octave let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' .
\ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' . s:conditionalEnd
au FileType octave au TermOpen * startinsert
au FileType octave setl keywordprg=:te\ info\ octave\ --init-file\ ~/.config/texinfo/config\ --index-search
" Enable spell-checking for certain files
au FileType markdown,mail setl spell spelllang=en_us
" Limit line length for text files
au FileType text,markdown,tex setl textwidth=180
" Contains CSS for markdown + page + highlight
let g:mkdp_markdown_css = '/home/fra/.config/nvim/mkdp/customStyle.css'
" Trick plugin into hosting colors.css so we get nice themes
let g:mkdp_highlight_css = '/home/fra/.config/nvim/mkdp/colors.css'
" set to 1, preview server available to others in your network
" by default, the server listens on localhost (127.0.0.1)
let g:mkdp_open_to_the_world = 1
let g:mkdp_port = '3456'
" Markdown preview
nmap <Leader>md <Plug>MarkdownPreviewToggle