commit 72b16c3201e60f360d0b89edc045401dca624af7
parent 00fadae2fe1a35fbdbe347c5a1247552661dfcfc
Author: Anders Damsgaard <andersd@riseup.net>
Date: Fri, 1 Dec 2017 09:47:19 -0500
add ftdetect scripts for detecting file types
Diffstat:
9 files changed, 68 insertions(+), 33 deletions(-)
diff --git a/links/.vim/ftdetect/arduino.vim b/links/.vim/ftdetect/arduino.vim
@@ -0,0 +1,4 @@
+augroup arduino_identify
+ autocmd! BufNewFile,BufRead *.pde setlocal ft=arduino
+ autocmd! BufNewFile,BufRead *.ino setlocal ft=arduino
+augroup END
diff --git a/links/.vim/ftdetect/cuda.vim b/links/.vim/ftdetect/cuda.vim
@@ -0,0 +1,3 @@
+augroup cuda_identify
+ autocmd! BufNewFile,BufRead *.cuh setlocal ft=cuda
+augroup END
diff --git a/links/.vim/ftdetect/markdown.vim b/links/.vim/ftdetect/markdown.vim
@@ -0,0 +1,4 @@
+augroup markdown_identify
+ autocmd! BufRead,BufNewFile *.md set filetype=markdown
+ autocmd! BufRead,BufNewFile *.mkd set filetype=markdown
+augroup END
diff --git a/links/.vim/ftplugin/binary.vim b/links/.vim/ftplugin/binary.vim
@@ -0,0 +1,11 @@
+" vim -b : edit binary using xxd-format!
+augroup Binary
+ autocmd! " remove all vimrc autocommands
+ autocmd BufReadPre *.bin let &bin=1
+ autocmd BufReadPost *.bin if &bin | %!xxd
+ autocmd BufReadPost *.bin set ft=xxd | endif
+ autocmd BufWritePre *.bin if &bin | %!xxd -r
+ autocmd BufWritePre *.bin endif
+ autocmd BufWritePost *.bin if &bin | %!xxd
+ autocmd BufWritePost *.bin set nomod | endif
+augroup END
diff --git a/links/.vim/ftplugin/mail.vim b/links/.vim/ftplugin/mail.vim
@@ -0,0 +1,8 @@
+augroup mail_typography
+ call pencil#init({'wrap': 'soft', 'textwidth': 80, 'conceallevel': 0})
+ call litecorrect#init()
+ setlocal spell spl=en_us
+ setlocal fdo+=search
+ setlocal list
+ setlocal formatoptions=alw2qt " automatically reflow paragraphs
+augroup END
diff --git a/links/.vim/ftplugin/markdown.vim b/links/.vim/ftplugin/markdown.vim
@@ -0,0 +1,12 @@
+augroup emoji_complete
+ setlocal completefunc=emoji#complete
+augroup END
+
+augroup markdown_typography
+ call pencil#init({'wrap': 'soft', 'textwidth': 80, 'conceallevel': 0})
+ call litecorrect#init()
+ setlocal spell spl=en_us
+ setlocal fdo+=search
+ setlocal list
+ setlocal formatoptions=alw2qt " automatically reflow paragraphs
+augroup END
diff --git a/links/.vim/ftplugin/tex.vim b/links/.vim/ftplugin/tex.vim
@@ -1,3 +1,24 @@
-let g:vimtex_quickfix_latexlog = {
- \ 'overfull' : 0,
- \ 'underfull' : 0}
+augroup latex_options
+
+ let g:vimtex_quickfix_latexlog = {
+ \ 'overfull' : 0,
+ \ 'underfull' : 0}
+
+ " customize what is concealed in LaTeX documents:
+ " a = conceal accents/ligatures
+ " d = conceal delimiters
+ " g = conceal Greek
+ " m = conceal math symbols
+ " s = conceal superscripts/subscripts
+ let g:tex_conceal="agm"
+
+augroup END
+
+augroup latex_typography
+ call pencil#init({'wrap': 'soft', 'textwidth': 80, 'conceallevel': 0})
+ call litecorrect#init()
+ setlocal spell spl=en_us
+ setlocal fdo+=search
+ setlocal list
+ setlocal formatoptions=alw2qt " automatically reflow paragraphs
+augroup END
diff --git a/links/.vim/plugin/filetypes.vim b/links/.vim/plugin/filetypes.vim
@@ -1,29 +0,0 @@
-" set file type for unrecognized extensions
-augroup ArduinoFileTypes
- autocmd! BufNewFile,BufRead *.pde setlocal ft=arduino
- autocmd! BufNewFile,BufRead *.ino setlocal ft=arduino
-augroup END
-
-augroup CudaFileTypes
- autocmd! BufNewFile,BufRead *.cuh setlocal ft=cuda
-augroup END
-
-" enable spell and settings for text writing by default for certain file types
-augroup ReadableFileTypes
- autocmd FileType tex,latex,md,markdown,mkd,rst,mail
- \ call pencil#init({'wrap': 'soft', 'textwidth': 80, 'conceallevel': 0})
- \ | call litecorrect#init()
- \ | setl spell spl=en_us
- \ | setl fdo+=search
- \ | setl nocursorcolumn
- \ | setl list
- \ | setl formatoptions=alw2qt " automatically reflow paragraphs
-augroup END
-
-" customize what is concealed in LaTeX documents:
-" a = conceal accents/ligatures
-" d = conceal delimiters
-" g = conceal Greek
-" m = conceal math symbols
-" s = conceal superscripts/subscripts
-let g:tex_conceal="agm"
diff --git a/links/.vim/plugins.vim b/links/.vim/plugins.vim
@@ -5,6 +5,7 @@ call plug#begin('~/.vim/vim-plugs') " Specify a directory for plugins
"""""" Misc """"""
Plug 'tpope/vim-unimpaired' " nav. errors with ]q, newlines with ]spc
Plug 'johngrib/vim-game-code-break' " :VimGameCodeBreak
+Plug 'junegunn/vim-emoji' " autocomplete :smiley: with C-x C-u
"""""" Appearance """"""
Plug 'itchyny/lightline.vim' " lighter status line
@@ -80,7 +81,7 @@ Plug 'godlygeek/tabular' " line up text (req for vim-markdown)
Plug 'plasticboy/vim-markdown'
" Mail
-Plug 'vim-scripts/mutt-aliases' " auto complete from ~/.mutt/aliases
+"Plug 'vim-scripts/mutt-aliases' " auto complete from ~/.mutt/aliases
" LaTeX
Plug 'lervag/vimtex'