diff --git a/.vim/bundle/vim-toml/LICENSE b/.vim/bundle/vim-toml/LICENSE new file mode 100644 index 0000000..d04c502 --- /dev/null +++ b/.vim/bundle/vim-toml/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2013 Caleb Spare + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.vim/bundle/vim-toml/README.md b/.vim/bundle/vim-toml/README.md new file mode 100644 index 0000000..49b705c --- /dev/null +++ b/.vim/bundle/vim-toml/README.md @@ -0,0 +1,17 @@ +# vim-toml + +Vim syntax for [TOML](https://github.com/toml-lang/toml). + +## Installation + +### Pathogen + +Set up [Pathogen](https://github.com/tpope/vim-pathogen) then clone/submodule this repo into `~/.vim/bundle/toml`, or wherever you've pointed your Pathogen. + +### Vundle + +Set up [Vundle](https://github.com/VundleVim/Vundle.vim) then add `Plugin 'cespare/vim-toml'` to your vimrc and run `:PluginInstall` from a fresh vim. + +## Contributing + +Contributions are very welcome! Just open a PR. diff --git a/.vim/bundle/vim-toml/ftdetect/toml.vim b/.vim/bundle/vim-toml/ftdetect/toml.vim new file mode 100644 index 0000000..885f823 --- /dev/null +++ b/.vim/bundle/vim-toml/ftdetect/toml.vim @@ -0,0 +1,2 @@ +" Rust uses several TOML config files that are not named with .toml. +autocmd BufNewFile,BufRead *.toml,Cargo.lock,*/.cargo/config set filetype=toml diff --git a/.vim/bundle/vim-toml/ftplugin/toml.vim b/.vim/bundle/vim-toml/ftplugin/toml.vim new file mode 100644 index 0000000..6e205c2 --- /dev/null +++ b/.vim/bundle/vim-toml/ftplugin/toml.vim @@ -0,0 +1,37 @@ +" File: ftplugin/toml.vim +" Author: Kevin Ballard +" Description: FileType Plugin for Toml +" Last Change: Dec 09, 2014 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:save_cpo = &cpo +set cpo&vim + +setlocal commentstring=#\ %s + +" Add NERDCommenter delimiters + +let s:delims = { 'left': '#' } +if exists('g:NERDDelimiterMap') + if !has_key(g:NERDDelimiterMap, 'toml') + let g:NERDDelimiterMap.toml = s:delims + endif +elseif exists('g:NERDCustomDelimiters') + if !has_key(g:NERDCustomDelimiters, 'toml') + let g:NERDCustomDelimiters.toml = s:delims + endif +else + let g:NERDCustomDelimiters = { 'toml': s:delims } +endif +unlet s:delims + +let b:undo_ftplugin = "" + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: set et sw=4 ts=4: diff --git a/.vim/bundle/vim-toml/syntax/toml.vim b/.vim/bundle/vim-toml/syntax/toml.vim new file mode 100644 index 0000000..1025053 --- /dev/null +++ b/.vim/bundle/vim-toml/syntax/toml.vim @@ -0,0 +1,54 @@ +" Language: TOML +" Maintainer: Caleb Spare +" URL: https://github.com/cespare/vim-toml +" LICENSE: MIT + +if exists("b:current_syntax") + finish +endif + +syn match tomlEscape /\\[btnfr"/\\]/ display contained +syn match tomlEscape /\\u\x\{4}/ contained +syn match tomlEscape /\\U\x\{8}/ contained +hi def link tomlEscape SpecialChar + +syn match tomlLineEscape /\\$/ contained +hi def link tomlLineEscape SpecialChar + +" Basic strings +syn region tomlString oneline start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape +" Multi-line basic strings +syn region tomlString start=/"""/ end=/"""/ contains=tomlEscape,tomlLineEscape +" Literal strings +syn region tomlString oneline start=/'/ end=/'/ +" Multi-line literal strings +syn region tomlString start=/'''/ end=/'''/ +hi def link tomlString String + +syn match tomlInteger /\<[+-]\=[0-9]\(_\=\d\)*\>/ display +hi def link tomlInteger Number + +syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\.\d\+\>/ display +syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\(\.[0-9]\(_\=\d\)*\)\=[eE][+-]\=[0-9]\(_\=\d\)*\>/ display +hi def link tomlFloat Float + +syn match tomlBoolean /\<\%(true\|false\)\>/ display +hi def link tomlBoolean Boolean + +" https://tools.ietf.org/html/rfc3339 +syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}T\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)/ display +hi def link tomlDate Constant + +syn match tomlTable /^\s*\[[^#\[\]]\+\]\s*\(#.*\)\?$/ contains=tomlComment +hi def link tomlTable Identifier + +syn match tomlTableArray /^\s*\[\[[^#\[\]]\+\]\]\s*\(#.*\)\?$/ contains=tomlComment +hi def link tomlTableArray Identifier + +syn keyword tomlTodo TODO FIXME XXX BUG contained +hi def link tomlTodo Todo + +syn match tomlComment /#.*/ contains=@Spell,tomlTodo +hi def link tomlComment Comment + +let b:current_syntax = "toml" diff --git a/.vimrc b/.vimrc index 0212bdb..56e6c32 100644 --- a/.vimrc +++ b/.vimrc @@ -84,17 +84,18 @@ augroup cfile autocmd BufRead,BufNewFile */systemd*/*.{c,h,cpp,hx} set tabstop=8|set shiftwidth=8 " qemu source files autocmd BufRead,BufNewFile */qemu*/*.{c,h,cpp,hx} set tabstop=4|set shiftwidth=4 - " dbndns source files - autocmd BufRead,BufNewFile */dbndns*/*.{c,h,cpp,hx} set tabstop=8|set shiftwidth=2 augroup END +autocmd FileType diff set noexpandtab|set tabstop=8|set shiftwidth=8|set autoindent|set smartindent autocmd FileType html set isk+=:,/,~ autocmd FileType java set expandtab|set autoindent|set smartindent +autocmd FileType json set expandtab|set tabstop=2|set shiftwidth=2|set autoindent|set smartindent autocmd FileType make set noexpandtab|set tabstop=8|set shiftwidth=8|set autoindent|set smartindent autocmd FileType perl set expandtab|set autoindent|set nosmartindent autocmd FileType python set expandtab|set autoindent|set nosmartindent autocmd FileType ruby set expandtab|set autoindent|set nosmartindent -autocmd FileType diff set noexpandtab|set tabstop=8|set shiftwidth=8|set autoindent|set smartindent +autocmd FileType toml set expandtab|set tabstop=2|set shiftwidth=2|set autoindent|set smartindent +autocmd FileType yaml set expandtab|set tabstop=2|set shiftwidth=2|set autoindent|set smartindent " ============== " Autocommands Group @@ -198,24 +199,6 @@ if filereadable(FTFILE) source FTFILE endif -" ====================== -" Universal Text Linking -" ====================== - -let UTLFILE="~/.vim/plugin/utl.vim" -if filereadable(UTLFILE) - source UTLFILE -endif - -" ====================== -" VimIM -" ====================== - -let VIMIMFILE="~/.vim/plugin/vimim.vim" -if filereadable(VIMIMFILE) - source VIMIMFILE -endif - " ====================== " Vim plug " ====================== @@ -270,7 +253,7 @@ let g:syntastic_go_checkers = 1 " ====================== " rust " ====================== -let g:rustfmt_autosave = 0 +let g:rustfmt_autosave = 1 set hidden let g:racer_cmd = '~/.cargo/bin/racer'