Commit b4804312 authored by Murukesh Mohanan's avatar Murukesh Mohanan

Merge submodule contents for vim/master

parents f4eb43ff 45210f85
.VimballRecord
.netrwhist
doc/*
plugged
view
spell/en.utf-8.add.spl
autoload/plug.vim.old
# Partially stolen from https://bitbucket.org/mblum/libgp/src/2537ea7329ef/.ycm_extra_conf.py
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c++14',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x', 'c++',
# This path will only work on OS X, but extra paths that don't exist are not
# harmful
'-isystem', '/usr/local/include',
'-isystem', '/usr/local/include/eigen3',
'-I', 'include',
'-I.',
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if compilation_database_folder:
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def FlagsForFile( filename ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile( filename )
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
else:
# relative_to = DirectoryOfThisScript()
relative_to = os.path.dirname(os.path.abspath(filename))
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}
# My vimrc
This repository contains my `.vim` folder. The `vimrc` file is inside the folder.
Of note:
- `sudo` write: `cmap w!! w !sudo tee >/dev/null %`
If you opened a root-owned file but forgot to use `sudo`, use `:w!!` to write.
- Only the latest for me:
let g:syntastic_cpp_compiler_options=' -std=c++11'
let g:syntastic_python_python_exec = '/usr/bin/python3'
- May the `Shift` not be with you:
nore ; :
nore , ;
## [Plugins](bundle)
Since I use `vim-plug` to handle plugins, a `:PlugInstall` would be appropriate on first run.
- [vim-plug](https://github.com/junegunn/vim-plug) - for managing plugins
- [supertab](https://github.com/ervandew/supertab) - for completion awesomeness
- [syntastic](https://github.com/scrooloose/syntastic) - for highlighting the living daylights out of syntax errors
- [YouCompleteMe](https://github.com/Valloric/YouCompleteMe.git)
- [vim-airline](https://github.com/bling/vim-airline)
- [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim.git)
- [diffchar.vim](https://github.com/vim-scripts/diffchar.vim)
- [molokai](https://github.com/tomasr/molokai.git)
- [nerdtree](https://github.com/scrooloose/nerdtree.git)
- [tabular](https://github.com/godlygeek/tabular.git)
- [tagbar](https://github.com/majutsushi/tagbar.git)
- [vim-fugitive](https://github.com/tpope/vim-fugitive.git)
- [vim-go](https://github.com/fatih/vim-go.git)
- [vim-markdown](https://github.com/gabrielelana/vim-markdown)
- [vim-surround](https://github.com/tpope/vim-surround.git)
- [vimtex](https://github.com/lervag/vimtex)
- [vim2hs](https://github.com/dag/vim2hs) - Haskell in all its visual beauty:
symbol :: Eq s => s -> Parser s s
symbol a x = satisfy (a == ) x
Becomes:
symbol :: Eq s ⇒ s → Parser s s
symbol a x = satisfy (a ≡ ) x
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
autocmd BufNewFile,BufRead *.pro set filetype=prolog
autocmd BufNewFile,BufRead *.md set filetype=markdown
autocmd BufNewFile,BufRead */debian/rules.d/* set filetype=make
setlocal spell textwidth=72
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_auto_type_info = 1
let g:go_fmt_command = "goimports"
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
nnoremap <buffer> <leader>r :GoRun<cr>
nnoremap <buffer> <leader>pc :pc<cr>
nnoremap <buffer> <leader>d :GoRun % --debug<cr>
nnoremap <buffer> <leader>t :GoTest -v -cpu=8<cr>
set completeopt-=longest
set completeopt-=preview
let g:echodoc_enable_at_startup = 1
"let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
"let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
setlocal colorcolumn=+1
setlocal spell spelllang=en_gb
autocmd CursorHold <buffer> update
highlight ColorColumn ctermbg=grey guibg=grey
inoremap 1-- <!-- section -->
setlocal shiftwidth=2 softtabstop=2 tabstop=2
setlocal expandtab
inoremap <buffer> [[ \begin{}<Esc>i
setlocal colorcolumn=+1
setlocal spell spelllang=en_gb
autocmd CursorHold <buffer> update
inoremap <buffer> $ $$<left>
inoremap <buffer> <leader>g \gls{}<left>
inoremap <buffer> glr \gls{rsa}
inoremap <buffer> glg \gls{gpg}
inoremap <buffer> glf \gls{fr}
highlight ColorColumn ctermbg=grey guibg=grey
"let g:vimtex_latexmk_options ='-pdflatex="xelatex -shell-escape %O %S " -pdf -dvi- -ps- -synctex=1'
let g:vimtex_latexmk_options ='-pdf'
"let g:LatexBox_latexmk_options = ' -xelatex '
"let g:LatexBox_latexmk_async = 1
"let g:LatexBox_latexmk_preview_continuously = 1
"let g:LatexBox_quickfix = 4
let g:vimtex_view_general_viewer = 'qpdfview'
let g:vimtex_view_general_options = '--unique @pdf\#src:@tex:@line:@col'
" In qpdfview, use the following for source editor:
" gvim --remote-tab-silent +%2 %1
let g:vimtex_view_general_options_latexmk = '--unique'
setlocal keywordprg=:help
setlocal shiftwidth=2 softtabstop=2 tabstop=2
setlocal expandtab
let g:airline#extensions#tabline#enabled = 1
if has("gui_running")
if has("gui_gtk2")
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 13
set guioptions-=r
endif
endif
let g:airline_powerline_fonts = 1
set textwidth=80
if has("gui_running")
if has("gui_gtk2")
set guifont=Ubuntu\ Mono\ for\ Powerline\ 13
endif
endif
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
set textwidth=80
if has("gui_running")
if has("gui_gtk2")
set guifont=Ubuntu\ Mono\ for\ Powerline\ 13
set guioptions-=r
endif
endif
let g:airline_powerline_fonts = 1
set textwidth=80
if has("gui_running")
if has("gui_gtk2")
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 13
set guioptions-=r
endif
endif
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
if has("gui_running")
set guifont=Ubuntu_Mono:h13
set guioptions-=r
endif
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
let g:syntastic_python_python_exec = '/usr/local/bin/python3'
let g:ycm_python_binary_path = '/usr/local/bin/python3'
Mohanan
Murukesh
qubit
cryptosystem
cryptosystems
SVP
CVP
m
Feynman
qubits
Hermite
arity
NTRU
cyrptosystems
teleportation
Guwahati
Karuna
Kalita
isospectrally
PHP
Chennai
IIT
Raman
Bhaskar
Bodhitree
Menezes
Gitlab
LDAP
Debian
plugin
Django
playlist
Bodhitree
CSS
API
foo
Debian
LDAP
Ubuntu
Roshan
plugin
plugins
PPA
PPAs
CLI
hostgroup
hostgroups
Gooner
Facebook
murukesh
mohanan
IIT
Firefox
Github
URLs
Apache2
subdomains
Voronoi
MySQL
Kalyan
Maharashtra
Kerala
Malayalam
Alexandra
Rhett
Gavroche
Daneel
Anathem
bullwhip
manpage
manpages
filetype
QEMU
deduplication
ciphertext
ciphertexts
filesystem
YJLinux
Kubernetes
JSON
kubernetes
YNW
Redis
servergroup
RolesDB
CKMS
OpenStack
MYM
Kanseito
syslog
YAML
config
ACL
OpenStack
dtests
timestamp
perf
Compactions
GC
compactions
timeseries
Rakuten
IoT
microservices
" Vim syntax file for browsing debian package.
" copyright (C) 2007, arno renevier <arenevier@fdn.fr>
" Distributed under the GNU General Public License (version 2 or above)
" Last Change: 2007 December 07
"
" Latest version of that file can be found at
" http://www.fdn.fr/~arenevier/vim/syntax/deb.vim
" It should also be available at
" http://www.vim.org/scripts/script.php?script_id=1970
if exists("b:current_syntax")
finish
endif
syn match debComment '^".*'
syn match debInfoFilename '^\* \.\/.*'
syn match debDataFilename '^\.\/.*[^/]$'
syn match debDirname '^\..*\/$'
syn match debSymlink '^\.\/.* -> .*$' contains=debSymlinkTarget,debSymlinkArrow,debSymlinkName
syn match debSymlinkName '^\S*' contained
syn match debSymlinkTarget '\S*$' contained
syn match debSymlinkArrow '->' contained
hi def link debComment Comment
hi def link debInfoFilename Type
hi def link debDataFilename PreProc
hi def link debSymlinkName Identifier
hi def link debSymlinkTarget PreProc
" Vim Syntax File
"
" Language: Prolog
" Maintainers: Aleksandar Dimitrov <aleks.dimitrov@googlemail.com>
" Created: Jul 31st, 2008
" Changed: Fri Aug 1 2008
" Remark: This file mostly follows
" http://www.sics.se/sicstus/docs/3.7.1/html/sicstus_45.html
" but also features some SWI-specific enhancements.
" The BNF cannot be followed strictly, but I tried to do my best.
"
" TODO: - Difference Lists
" - Constraint logic programming
if version < 600
syn clear
elseif exists("b:current_syntax")
finish
endif
syntax case match
syntax keyword prologISOBuiltIn var nonvar integer float number atom string
\atomic compound unify_with_occurs_check fail false true repeat call once
\catch throw abolish retract asserta assertz current_predicate clause open
\close stream_property set_stream_position set_input set_output current_ouput
\nl put_byte put_char put_code flush_output get_byte get_code get_char
\peek_byte peek_code peek_char at_end_of_stream write_term write_canonical
\write writeq read read_term functor arg copy_term atom_codes atom_chars
\char_code number_chars number_codes atom_length sub_atom op current_op
\char_conversion current_char_conversion is mod rem div round float
\float_fractional_part float_integer_part truncate floor ceiling sqrt sin cos
\atan log findall bagof setof sub_atom
syntax keyword prologSWIBuiltIn rational callable ground cyclic_term subsumes subsumes_chk
\unifiable use_module compare apply not ignore call_with_depth_limit call_cleanup
\print_message print_message_lines message_hook on_signal current_signal block exit
\term_hash redefine_system_predicate retractall assert recorda recordz recorded
\erase flag compile_predicates index current_atom
\current_blob current_functor current_flag current_key dwim_predicate nth_clause
\predicate_property open_null_stream current_stream is_stream stream_position_data
\seek set_stream see tell append seeing telling seen set_prolog_IO told
\wait_for_input byte_count character_count line_count line_position read_clause
\put tab ttyflush get0 get skip get_single_char copy_stream_data print portray
\read_history prompt setarg nb_setarg nb_linkarg duplicate_term numbervars
\term_variables atom_number name term_to_atom atom_to_term atom_concat
\concat_atom atom_prefix normalize_space collation_key char_type string_to_list
\code_type downcase_atom upcase_atom collation_key locale_sort string_to_atom
\string_length string_concat sub_string between succ plus rdiv max min random
\integer rationalize ceil xor tan asin acos pi e cputime eval msb lsb popcount
\powm arithmetic_function current_arithmetic_function is_list memberchk length
\sort msort keysort predsort merge merge_set maplist forall writeln writef
\swritef format format_predicate current_format_predicate tty_get_capability
\tty_goto tty_put set_tty tty_size shell win_exec win_shell win_folder
\win_registry_get_value getenv setenv unsetenv setlocale unix date time
\get_time stamp_date_time date_time_stamp date_time_value format_time
\parse_time window_title win_window_pos win_has_menu win_insert_menu
\win_insert_menu_item access_file exists_file file_directory_name file_base_name
\same_file exists_directory delete_file rename_file size_file time_file
\absolute_file_name is_absolute_file_name file_name_extension expand_file_name
\prolog_to_os_filename read_link tmp_file make_directory working_directory chdir
\garbage_collect garbage_collect_atoms trim_stacks stack_parameter dwim_match
\wildcard_match sleep qcompile portray_clause acyclic_term clause_property
\setup_and_call_cleanup message_to_string phrase hash with_output_to fileerrors
\read_pending_input prompt1 same_term sub_string merge_set
syntax cluster prologBuiltIn contains=prologSWIBuiltIn,prologISOBuiltIn
syntax match prologArithmetic /\*\*\?\|+\|\/\/\?\|\/\\\|<<\|>>\|\\\/\?\|\^/
\contained containedin=prologBody
syntax match prologRelations /=\.\.\|!\|=:=\|=\?<\|=@=\|=\\=\|>=\?\|@=\?<\|@>=\?\|\\+\|\\\?=\?=\|\\\?=@=\|=/
\contained containedin=prologBody
syntax region prologCComment fold start=/\/\*/ end=/\*\// contains=prologTODO,@Spell
syntax match prologComment /%.*/ contains=prologTODO,@Spell
syntax region prologCommentFold fold start=/^\zs\s*%/ skip=/^\s*%/ end=/^\ze\s*\([^%]\|$\)/ contains=prologComment
syntax keyword prologTODO FIXME TODO fixme todo Fixme FixMe Todo ToDo XXX xxx contained
syntax cluster prologComments contains=prologCComment,prologComment,prologCommentFold
syntax region prologBody fold start=/\(:-\|?-\)/ end=/\./
\contains=@prologAll,prologPredicateWithArity
syntax region prologDCGBody fold start=/-->/ end=/\./
\contains=@prologAll,prologDCGSpecials
syntax match prologNumber /\<\d\+\>/ contained
syntax match prologNumber /\<\d\+\.\d\+\>/ contained
syntax match prologAtom /\<\l\w*\>\ze\([^(]\|$\)/ contained
syntax match prologVariable /\<\(_\|\u\)\w*\>/ contained
syntax match prologChar /\<\0'\(\\\)\?.\>/ contained
syntax match prologHead /\<\l\w*\>/ nextgroup=prologBody,prologDCGBody skipwhite
syntax region prologHeadWithArgs start=/\<\l\w*\>(/ end=/)/ nextgroup=prologBody,prologDCGBody contains=@prologAll
syntax match prologOpStatement /indexed\|discontiguous\|dynamic\|module_transparent\|multifile\|volatile\|initialization/
\containedin=prologBody contained
syntax region prologDCGSpecials start=/{/ end=/}/ contained contains=@prologAll
syntax region prologTuple fold start=/\W\zs(/ end=/)/ contained containedin=prologPredicate,prologBody contains=@prologAll
syntax region prologPredicate start=/\<\l\w*\>\ze(/ end=/)/ contains=@prologAll
syntax match prologPredicateWithArity /\<\l\w*\>\/\d\+/ contains=@prologBuiltIn,prologArity
syntax match prologArity contained /\/\d\+/
syntax cluster prologPredicates contains=prologPredicate,prologPredicateWithArity
syntax region prologList start=/\[/ end=/\]/ contains=prologListDelimiters,@prologAll,prologPredicateWithArity contained
syntax match prologListDelimiters /[,|]/ contained
syntax cluster prologAll contains=prologList,prologPredicate,prologTuple,@prologTerms,@prologComments,prologQuoted,@prologBuiltIn,prologRelations,prologArithmetic,prologDiffList
syntax cluster prologTerms contains=prologVariable,prologAtom,prologList,
\prologNumber,prologErrorTerm,prologChar
syntax match prologQuotedFormat /\~\(\d*[acd\~DeEgfGiknNpqrR@st\|+wW]\|`.t\)/ contained
syntax region prologQuoted start=/'/ end=/'/ contains=prologQuotedFormat,@Spell
syntax match prologErrorVariable /\<\(_\|\u\)\w*\>/
syntax region prologErrorTerm start=/\<\(_\|\u\)\w*\>(/ end=/)/
"""" Highlights
highlight link prologErrorVariable Error
highlight link prologErrorTerm Error
highlight link prologOpStatement Preproc
highlight link prologComment Comment
highlight link prologCComment Comment
highlight link prologTODO TODO
highlight link prologAtom Constant
highlight link prologChar Constant
highlight link prologVariable Identifier
highlight link prologNumber Number
highlight link prologISOBuiltIn Keyword
highlight link prologSWIBuiltIn Keyword
highlight link prologRelations Statement
highlight link prologQuotedFormat Special
highlight link prologQuoted String
highlight link prologPredicate Normal
highlight link prologPredicateWithArity Normal
highlight link prologHead Constant
highlight link prologHeadWithArgs Normal
highlight link prologBody Statement
highlight link prologDCGBody Statement
highlight link prologList Type
highlight link prologListDelimiters Type
highlight link prologArity Type
highlight link prologDCGSpecials Type
highlight link prologTuple Type
highlight link prologDiffList Type
syn sync minlines=20 maxlines=50
let b:current_syntax = "prolog"
" Vim syntax file
" Language: Vala
" Maintainers: Emmanuele Bassi <ebassi@gnome.org>
" Hans Vercammen <hveso3@gmail.com>
" pancake <pancake@nopcode.org>
" Sebastian Reichel <sre@ring0.de>
" Last Change: 2012-02-19
" Filenames: *.vala *.vapi
"
" REFERENCES:
" [1] http://live.gnome.org/Vala
"
" TODO: Possibly when reaching vala 1.0 release
" - validate code attributes
" - better error checking for known errors
" - full support for valadoc
"
" add vala in /usr/share/vim/vim73/scripts.vim below ruby
" to have shebang support
if exists("b:current_syntax")
finish
endif
let s:vala_cpo_save = &cpo
set cpo&vim
" Types
syn keyword valaType bool char double float size_t ssize_t string unichar void
syn keyword valaType int int8 int16 int32 int64 long short
syn keyword valaType uint uint8 uint16 uint32 uint64 ulong ushort
" Storage keywords
syn keyword valaStorage class delegate enum errordomain interface namespace struct
" repeat / condition / label
syn keyword valaRepeat break continue do for foreach return while
syn keyword valaConditional else if switch assert
" User Labels
syn keyword valaLabel case default
" Modifiers
syn keyword valaModifier abstract const dynamic ensures extern inline internal override
syn keyword valaModifier private protected public requires signal static virtual volatile weak
syn keyword valaModifier async owned unowned
" Constants
syn keyword valaConstant false null true
" Exceptions
syn keyword valaException try catch finally throw
" Unspecified Statements
syn keyword valaUnspecifiedStatement as base construct delete get in is lock new out params ref sizeof set this throws typeof using value var yield
" Comments
syn cluster valaCommentGroup contains=valaTodo
syn keyword valaTodo contained TODO FIXME XXX NOTE
" valadoc Comments (ported from javadoc comments in java.vim)
" TODO: need to verify valadoc syntax
if !exists("vala_ignore_valadoc")
syn cluster valaDocCommentGroup contains=valaDocTags,valaDocSeeTag
syn region valaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
syn match valaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=valaDocParam
syn match valaDocParam contained "\s\S\+"
syn match valaDocTags contained "@\(author\|brief\|version\|return\|deprecated\)\>"
syn region valaDocSeeTag contained matchgroup=valaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=valaDocSeeTagParam
syn match valaDocSeeTagParam contained @"\_[^"]\+"\|<a\s\+\_.\{-}</a>\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend
endif
" Comment Strings (ported from c.vim)
if exists("vala_comment_strings")
syn match valaCommentSkip contained "^\s*\*\($\|\s\+\)"
syn region valaCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=valaSpecialChar,valaCommentSkip
syn region valaComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=valaSpecialChar
syn cluster valaCommentStringGroup contains=valaCommentString,valaCharacter,valaNumber
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaComment2String,valaCharacter,valaNumber,valaSpaceError,@Spell
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell extend fold
if !exists("vala_ignore_valadoc")
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,@valaCommentStringGroup,valaCommentStartError,valaSpaceError,@Spell
endif
else
syn region valaCommentL start="//" end="$" keepend contains=@valaCommentGroup,valaSpaceError,@Spell
syn region valaComment matchgroup=valaCommentStart start="/\*" end="\*/" contains=@valaCommentGroup,valaCommentStartError,valaSpaceError,@Spell
if !exists("vala_ignore_valadoc")
syn region valaDocComment matchgroup=valaCommentStart start="/\*\*" end="\*/" keepend contains=@valaCommentGroup,@valaDocCommentGroup,valaCommentStartError,valaSpaceError,@Spell
endif
endif
syn region valaPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1
syn match valaPreCondit display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
" Comment if 0 blocks (ported from c.vim)
if !exists("vala_no_if0")
syn region valaCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end=".\@=\|$" contains=valaCppOut2 fold
syn region valaCppOut2 contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=valaSpaceError,valaCppSkip
syn region valaCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=valaSpaceError,valaCppSkip
endif
" match comment errors
syntax match valaCommentError display "\*/"
syntax match valaCommentStartError display "/\*"me=e-1 contained
" match the special comment /**/
syn match valaComment "/\*\*/"
" Vala Code Attributes
syn region valaAttribute start="^\s*\[" end="\]$" contains=valaComment,valaString keepend
syn region valaAttribute start="\[CCode" end="\]" contains=valaComment,valaString
" Avoid escaped keyword matching
syn match valaUserContent display "@\I*"
" Strings and constants
syn match valaSpecialError contained "\\."
syn match valaSpecialCharError contained "[^']"
syn match valaSpecialChar contained +\\["\\'0abfnrtvx]+
syn region valaString start=+"+ end=+"+ end=+$+ contains=valaSpecialChar,valaSpecialError,valaUnicodeNumber,@Spell
syn region valaVerbatimString start=+"""+ end=+"""+ contains=@Spell
syn match valaUnicodeNumber +\\\(u\x\{4}\|U\x\{8}\)+ contained contains=valaUnicodeSpecifier
syn match valaUnicodeSpecifier +\\[uU]+ contained
syn match valaCharacter "'[^']*'" contains=valaSpecialChar,valaSpecialCharError
syn match valaCharacter "'\\''" contains=valaSpecialChar
syn match valaCharacter "'[^\\]'"
syn match valaNumber display "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>"
syn match valaNumber display "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\="
syn match valaNumber display "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>"
syn match valaNumber display "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>"
" when wanted, highlight trailing white space
if exists("vala_space_errors")
if !exists("vala_no_trail_space_error")
syn match valaSpaceError display excludenl "\s\+$"
endif
if !exists("vala_no_tab_space_error")
syn match valaSpaceError display " \+\t"me=e-1
endif
endif
" when wanted, set minimum lines for comment syntax syncing
if exists("vala_minlines")
let b:vala_minlines = vala_minlines
else
let b:vala_minlines = 50
endif
exec "syn sync ccomment valaComment minlines=" . b:vala_minlines
" code folding
syn region valaBlock start="{" end="}" transparent fold
" The default highlighting.
hi def link valaType Type
hi def link valaStorage StorageClass
hi def link valaRepeat Repeat
hi def link valaConditional Conditional
hi def link valaLabel Label
hi def link valaModifier StorageClass
hi def link valaConstant Constant
hi def link valaException Exception
hi def link valaUnspecifiedStatement Statement
hi def link valaUnspecifiedKeyword Keyword
hi def link valaContextualStatement Statement
hi def link valaCommentError Error
hi def link valaCommentStartError Error
hi def link valaSpecialError Error
hi def link valaSpecialCharError Error
hi def link valaSpaceError Error
hi def link valaTodo Todo
hi def link valaCommentL valaComment
hi def link valaCommentStart valaComment
hi def link valaCommentSkip valaComment
hi def link valaComment Comment
hi def link valaDocComment Comment
hi def link valaDocTags Special
hi def link valaDocParam Function
hi def link valaDocSeeTagParam Function
hi def link valaAttribute PreCondit
hi def link valaCommentString valaString
hi def link valaComment2String valaString
hi def link valaString String
hi def link valaVerbatimString String
hi def link valaCharacter Character
hi def link valaSpecialChar SpecialChar
hi def link valaNumber Number
hi def link valaUnicodeNumber SpecialChar
hi def link valaUnicodeSpecifier SpecialChar
hi def link valaPreCondit PreCondit
if !exists("vala_no_if0")
hi def link valaCppSkip valaCppOut
hi def link valaCppOut2 valaCppOut
hi def link valaCppOut Comment
endif
let b:current_syntax = "vala"
let &cpo = s:vala_cpo_save
unlet s:vala_cpo_save
" vim: ts=8
This diff is collapsed.
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