Compare commits

..

No commits in common. "aae0389dcaa4a7e2e6bcfd71152657c40df06307" and "ca2760f4773b9fcefc7e4bf5422c1c5e633dce82" have entirely different histories.

14 changed files with 85 additions and 14 deletions

View File

@ -1,2 +0,0 @@
---
- location: ~/.vim

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
.netrwhist
bundle/*
plugs/*

View File

@ -86,3 +86,7 @@ endsnippet
snippet *[ "GitHub style checkbox"
* [${1: }] $0
endsnippet
snippet [[ "lit named ID match" i
[[${1:name}:%[a-zA-Z0-9]+]]
endsnippet

View File

@ -32,13 +32,13 @@ class ${1:name} {
endsnippet
snippet template "Template"
template <class ${1:type}>$0
template <class ${1:T}$2>$0
endsnippet
snippet namespace "Named or anonymous namespace"
namespace $1${1/(\w+)/ /}{
$0
} // ${1/(\w*)/(?1:$1:anonymous)/}
} // namespace${1/(\w*)/(?1: $1:)/}
endsnippet
snippet const_cast "Const cast" i

View File

@ -0,0 +1,7 @@
function! s:set_lit_cfg_filetype()
set filetype=python
ALEDisableBuffer
endfunction
au BufNewFile,BufReadPost lit.cfg call s:set_lit_cfg_filetype()
au BufNewFile,BufReadPost lit.local.cfg call s:set_lit_cfg_filetype()

View File

@ -5,6 +5,7 @@ hi link markdownHeadingDelimiter PreProc
hi link markdownLinkDelimiter PreProc
hi link markdownLinkTextDelimiter PreProc
hi link markdownUrl Include
hi link markdownError None
" Add match for GitHub style check boxes
syn match markdownCheckboxTick '\[\zsx\ze\]' contained

View File

@ -1,3 +1,6 @@
syn keyword zshOption interactivecomments INTERACTIVE_COMMENTS
syn region zshBlock matchgroup=zshParans start="{" end="}" transparent fold
hi link zshParans Delimiter
syn region zshParentheses matchgroup=Delimiter start='(' skip='\\)' end=')' transparent fold
syn region zshParentheses matchgroup=Delimiter start="{" end="}" transparent fold
" TODO: Correctly highlight associative array assignment, see zshVariableDef.
hi link zshOperator Operator

View File

@ -20,6 +20,8 @@ function! do#rstrip_lines()
call cursor(l:line, l:column)
endfunction
" TODO: Strip white space from left of all lines, retains relative indentation.
" Set the tab width for the current filetype
function! do#set_tab_width(width)
execute 'setlocal tabstop='.a:width

View File

@ -95,7 +95,7 @@ if has('gui_running') || &t_Co == 256
call s:hi('Cursor', '', '', 'reverse')
call s:hi('CursorIM', '', '', '')
call s:hi('CursorColumn', '235', '', '')
call s:hi('CursorLine', '', '', '')
call s:hi('CursorLine', '', '0', '')
call s:hi('Directory', '', '', '')
call s:hi('DiffAdd', '2', '', '')
call s:hi('DiffChange', '', '', '')

View File

@ -1,2 +1,3 @@
" Set .ll files to LLVM IR filetype
au BufNewFile,BufReadPost *.ll set filetype=llvm
au BufNewFile,BufReadPost *.test set filetype=llvm

View File

@ -5,6 +5,8 @@ command! ISort call do#isort()
" TODO: Make RStripLines work on a range
command! RStripLines call do#rstrip_lines()
" TODO: Strip white space from left of all lines, retains relative indentation.
" Set tab width
command! -nargs=1 TabWidth call do#set_tab_width(<f-args>)

View File

@ -21,6 +21,8 @@ endif
set laststatus=2
" Show the line and colum number of a cursor position
set ruler
" Show the current line with different highlighting
set cursorline
" Enhanced command line completion
set wildmenu
@ -91,7 +93,7 @@ set noshowmode
" Show relative line numbers & current line number
set number
if has('relativenumber')
if exists('+relativenumber')
set relativenumber
endif

View File

@ -37,6 +37,9 @@ syn keyword cppConstant __cplusplus
" C++11
if !exists('cpp_no_cpp11')
" Identifiers with special meaning: override final
" TODO: These should not be keyword's, instead highlight based on context
" since these can be used as regular identifiers outside of those contexts.
syn keyword cppModifier override final
syn keyword cppType char16_t char32_t nullptr_t
syn keyword cppExceptions noexcept
@ -51,11 +54,55 @@ if !exists('cpp_no_cpp11')
" however if the match starts before the beginning of the keyword it will be
" chosen instead so we can specialze for this case.
syn match cppStatement '=\s*\(delete\|default\)\>\ze\s*;\?' contains=cOperator display
" Attribute Specifier Sequence
" Match: [[attribute-list]]
syn region cppAttributeDelimiter matchgroup=cppDelimiter start='\[\[' skip='\[\[' end='\]\]' transparent contains=cppAttribute,cppNamespace,cppAttributeUsing,cppAttributeUsingNamespace,cDelimiter,cString,cOperator,cNumber,cppFunction,cFunction
" Standard Attributes
syn keyword cppAttribute noreturn carries_dependency contained
endif
" C++14
if !exists('cpp_no_cpp14')
syn match cppNumber display '\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>'
" Standard Attributes
syn keyword cppAttribute deprecated contained
endif
" C++17
if !exists('cpp_no_cpp17')
" Attribute Specifier Sequence
" Match: [[using attribute-namespace: attribute-list]]
syn match cppAttributeUsingNamespace '\s\+\zs\w\+\ze\s*:' contained contains=cppAttributeUsing
syn keyword cppAttributeUsing using contained
" Standard Attributes
syn keyword cppAttribute fallthrough nodiscard maybe_unused contained
hi def link cppAttributeUsing cppStatement
hi def link cppAttributeUsingNamespace cInclude
hi def link cppAttributeUsingDelimiter cppDelimiter
endif
" C++20
if !exists('cpp_no_cpp20')
syn keyword cppStatement concept requires
" TODO: Attribute Specifier Sequence
" Match: [[contract-attribute-token contract-level(opt) identifier(opt): expression]]
"
" Standard Attributes
syn keyword cppAttribute likely unlikely no_unique_address contained
syn keyword cppAttribute expects ensures assert contained
" Contract Levels
syn keyword cppAttribute default audit axiom contained
"
" TODO: These should not be keyword's, instead highlight based on context
" since these can be used as regular identifiers outside of those contexts.
" These only occur inside an contracts generalised attribute.
syn keyword cppModifier audit axiom
endif
if !exists('cpp_no_function')
@ -73,14 +120,14 @@ if !exists('cpp_no_delimiters')
" Match: nested namespace expressions: expr::
" ^^^^
syn match cppNestedName '\w\+::' display contains=cppDelimiter
syn match cppNamespace '\w\+::' display contains=cppDelimiter
" Match: label: as a Label and public: protected: private: as a Statement
" ^^^^^ ^^^^^^ ^^^^^^^^^ ^^^^^^^
syn match cUserCont "^\s*\I\i*\s*:$" contains=cUserLabel,cppAccess display
hi default link cppDelimiter cDelimiter
hi default link cppNestedName cInclude
hi default link cppNamespace cInclude
endif
if !exists('cpp_no_operators') && !exists('cpp_no_delimiters')
@ -114,5 +161,6 @@ hi def link cppConstant Constant
hi def link cppRawStringDelimiter Delimiter
hi def link cppRawString String
hi def link cppNumber Number
hi def link cppAttribute Keyword
let b:current_syntax = 'cpp'

7
vimrc
View File

@ -48,7 +48,7 @@ if !platform#is_windows()
let g:ycm_warning_symbol = '▸'
let g:ycm_goto_buffer_command = 'horizontal-split'
endif
if has('python') || has('python3')
if has('python')
" ultisnips - snippet engine
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
endif
@ -175,8 +175,11 @@ let g:sh_fold_enabled = 1
" xterm-color-table.vim - view term and hex colors
Plug 'guns/xterm-color-table.vim'
" CMake, GLSL, HLSL, OpenCL C syntax
" SPIR-V syntax
Plug 'kbenzie/vim-spirv'
let g:spirv_current_id_highlight = 'ctermbg=234, guibg=#1c1c1c'
" CMake, GLSL, HLSL, OpenCL C syntax
Plug 'rperier/vim-cmake-syntax'
Plug 'tikhomirov/vim-glsl'
Plug 'beyondmarc/hlsl.vim'