Archiving last old version

This commit is contained in:
Dreaded_X 2018-04-20 00:10:38 +02:00
parent 433cf36e8a
commit 2a4d99d3ac
37 changed files with 1902 additions and 467 deletions

View File

@ -11,15 +11,16 @@
# Sensitivity in %. If you think the bars are to low/response is to littei, try # Sensitivity in %. If you think the bars are to low/response is to littei, try
# increasing this value 200 means double height. Accepts only non-negative values. # increasing this value 200 means double height. Accepts only non-negative values.
sensitivity = 1.5 # sensitivity = 4
sensitivity = 4
# Autosens will atempt to decrease sensitivity if cava peaks. 1 = on, 0 = off # Autosens will atempt to decrease sensitivity if cava peaks. 1 = on, 0 = off
autosens = 0 autosens = 0
# The number of bars. 0 (default) sets it to auto (fil upp console). # The number of bars. 0 (default) sets it to auto (fil upp console).
# width of bras and space between bars in number of characters. Default witdth 3 and space 1. # width of bras and space between bars in number of characters. Default witdth 3 and space 1.
; bars = 0 ; bars = 35
bar_width = 2 bar_width = 1
bar_spacing = 1 bar_spacing = 1
@ -65,28 +66,31 @@ higher_cutoff_freq = 10000
# visual styles, may be 'stereo' or 'mono'. # visual styles, may be 'stereo' or 'mono'.
# Stereo mirrors both channels with low frequencies in center. # Stereo mirrors both channels with low frequencies in center.
# Mono avrages both channels and outputs left to right lowest to highest frequencies # Mono avrages both channels and outputs left to right lowest to highest frequencies
style = mono style = stereo
[color] [color]
# supported colors are: red, green, yellow, magenta, cyan, white, blue, black. # supported colors are: red, green, yellow, magenta, cyan, white, blue, black.
; background = black ; background = black
foreground = red ; foreground = red
gradient = 1
gradient_color_1 = '#ff0000'
gradient_color_2 = '#220000'
[smoothing] [smoothing]
# multiplier for the integral smoothing calculations. Takes values from 0 - 0.99. # multiplier for the integral smoothing calculations. Takes values from 0 - 0.99.
# Higher values means smoother, but less precise. 0 to disable. # Higher values means smoother, but less precise. 0 to disable.
; integral = 0.7 integral = 0
# disables or enables the so-called "Monstercat smoothing". Default: 1. Set to 0 to disable. # disables or enables the so-called "Monstercat smoothing". Default: 1. Set to 0 to disable.
; monstercat = 1 monstercat = 1
# Set gravity multiplier for "drop off". Higher values means bars will drop faster. # Set gravity multiplier for "drop off". Higher values means bars will drop faster.
# Accepts only non-negative values. 0.5 means half gravity, 2 means double. Set to 0 to disable "drop off". # Accepts only non-negative values. 0.5 means half gravity, 2 means double. Set to 0 to disable "drop off".
gravity = 3 gravity = 100
# In bar height, bars that whould have been lower that this will not be drawn. # In bar height, bars that whould have been lower that this will not be drawn.
@ -99,7 +103,7 @@ gravity = 3
# remember to uncomment more then one key! More keys = more precision. # remember to uncomment more then one key! More keys = more precision.
# Look at readme.md on github for further explanations and examples. # Look at readme.md on github for further explanations and examples.
; 1 = 1 # bass ; 1 = 1 # bass
; 2 = 1 ; 2 = 3
; 3 = 1 # midtone ; 3 = 2 # midtone
; 4 = 1 ; 4 = 2
; 5 = 1 # treble ; 5 = 1 # treble

View File

@ -1,22 +1,30 @@
/* .header-bar.default-decoration { */ window.ssd separator:first-child + headerbar:backdrop,
/* padding-top: 3px; */ window.ssd separator:first-child + headerbar,
/* padding-bottom: 3px; */ window.ssd headerbar:first-child:backdrop,
/* } */ window.ssd headerbar:first-child,
/* */ window.ssd headerbar:last-child:backdrop,
/* .header-bar.default-decoration .button.titlebutton { */ window.ssd headerbar:last-child,
/* padding-top: 2px; */ window.ssd stack headerbar:first-child:backdrop,
/* padding-bottom: 2px; */ window.ssd stack headerbar:first-child,
/* } */ window.ssd stack headerbar:last-child:backdrop,
window.ssd stack headerbar:last-child,
window.ssd decoration,
window.ssd headerbar.titlebar {
border-radius: 0;
}
/* .window-frame:backdrop, */ window.ssd headerbar * {
/* .window-frame, */ margin-top: -100px;
/* .window-frame.tiled, */ color: #222d32; /* May need to tweak, this matches Adwaita Dark */
/* .window-frame.popup{ */ }
/* box-shadow:none;} */
/* */ window.ssd headerbar.titlebar,
/* .window-frame.tooltip.csd, */ window.ssd headerbar.titlebar button.titlebutton {
/* .window-frame.popup.csd, */ border: none;
/* .window-frame.popup { */ font-size: 0;
/* border-radius:0px; */ height: 0;
/* box-shadow: none; */ margin: 0;
/* margin: 0px;} */ max-height: 0;
min-height: 0;
padding: 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,15 @@
call plug#begin('~/.dotfiles/nvim/.config/nvim/plugged') call plug#begin('~/.dotfiles/nvim/.config/nvim/plugged')
Plug 'kien/ctrlp.vim' " Plug 'kien/ctrlp.vim'
Plug 'FelikZ/ctrlp-py-matcher' " Plug 'FelikZ/ctrlp-py-matcher'
Plug 'Raimondi/delimitMate' Plug 'Raimondi/delimitMate'
Plug 'morhetz/gruvbox' Plug 'morhetz/gruvbox'
Plug 'Yggdroot/indentLine' " Plug 'Yggdroot/indentLine'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'godlygeek/tabular' Plug 'godlygeek/tabular'
" Plug 'majutsushi/tagbar' " Plug 'majutsushi/tagbar'
Plug 'tomtom/tcomment_vim' Plug 'tomtom/tcomment_vim'
Plug 'bling/vim-airline' Plug 'bling/vim-airline'
Plug 'tommcdo/vim-exchange' Plug 'tommcdo/vim-exchange'
Plug 'justinmk/vim-matchparenalways'
Plug 'tpope/vim-surround' Plug 'tpope/vim-surround'
Plug 'christoomey/vim-tmux-navigator' Plug 'christoomey/vim-tmux-navigator'
Plug 'MarcWeber/vim-addon-mw-utils' Plug 'MarcWeber/vim-addon-mw-utils'
@ -29,23 +28,44 @@ Plug 'Valloric/YouCompleteMe'
Plug 'moll/vim-bbye' Plug 'moll/vim-bbye'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'tikhomirov/vim-glsl' Plug 'tikhomirov/vim-glsl'
Plug 'rust-lang/rust.vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'digitaltoad/vim-pug'
call plug#end() call plug#end()
let g:ctrlp_custom_ignore = '\v[\/](bin|docs)$' silent! so .vimlocal
" let g:ctrlp_custom_ignore = '\v[\/](bin|build|docs)$'
map <silent> <C-P> :call fzf#run(fzf#wrap('custom', {'source': 'ag -g ""'}, 0))<cr>
let g:fzf_layout = { 'down': '~20%' }
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
let delimitMate_expand_cr = 1 let delimitMate_expand_cr = 1
set mouse=a
colorscheme gruvbox colorscheme gruvbox
set t_Co=256 set t_Co=256
set t_ZH= set t_ZH=
set t_ZR= set t_ZR=
set background=dark set background=dark
" let g:indentLine_char = '│'
" let g:indentLine_color_term = 239
set list lcs=tab:\│\ set list lcs=tab:\│\
" map <silent> <M-a> :NERDTreeToggle<cr>
map <silent> <F2> :NERDTreeToggle<cr> map <silent> <F2> :NERDTreeToggle<cr>
" map <silent> <M-2> :TagbarToggle<cr> " map <silent> <M-2> :TagbarToggle<cr>
@ -78,6 +98,8 @@ let g:UltiSnipsExpandTrigger="<c-s>"
syntax on syntax on
filetype plugin indent on filetype plugin indent on
au BufRead,BufNewFile *.lang setfiletype lang
set smartindent set smartindent
set number set number
set relativenumber set relativenumber
@ -102,23 +124,26 @@ map <S-K> 10k
map <silent> <C-B> :Bdelete<cr> map <silent> <C-B> :Bdelete<cr>
autocmd FileType go let &makeprg="go run %:p:h/*.go" " autocmd FileType go let &makeprg="go run %:p:h/*.go"
autocmd FileType go map <F10> :Make<cr> " autocmd FileType go map <F10> :Make<cr>
"
" autocmd FileType tex map <F9> :Dispatch arara %<cr>
"
" autocmd FileType cpp map <F9> :Make<cr>
" autocmd FileType cpp map <S-F9> :Make clean all<cr>
autocmd FileType tex map <F9> :Dispatch arara %<cr> " if filereadable(expand("%:p:h")."/CMake/default/Makefile")
" let &makeprg="cd CMake/default && make"
autocmd FileType cpp map <F9> :Make<cr> " autocmd FileType cpp map <F10> :Make debug<cr>
autocmd FileType cpp map <S-F9> :Make clean all<cr> " endif
" if filereadable(expand("%:p:h")."/build/cmake/Makefile")
if filereadable(expand("%:p:h")."/CMake/defualt/Makefile") " function KeyBind(platform)
let &makeprg="cd CMake/default && make" " let &makeprg="cd cmake/configs/".a:platform." && make"
autocmd FileType cpp map <F10> :Make debug<cr> " execute 'autocmd FileType cpp map <F10> :Start cd cmake/configs/'.a:platform.' && ./run-engine.sh; echo "\nPress [enter] to close" && read<cr>'
endif " execute 'autocmd FileType cpp map <S-F10> :Start cd cmake/configs/'.a:platform.' && ./debug-engine.sh<cr>'
if filereadable(expand("%:p:h")."/build/cmake/Makefile") " endfunction
let &makeprg="cd build/cmake && make" " call KeyBind("linux")
autocmd FileType cpp map <F10> :Start cd build/cmake && ./run-engine.sh; echo "\nPress [enter] to close" && read<cr> " endif
autocmd FileType cpp map <S-F10> :Start cd build/cmake && ./debug-engine.sh<cr>
endif
map <silent> <F4> :call ToggleQuickfixList()<cr> map <silent> <F4> :call ToggleQuickfixList()<cr>
" map <silent> <F7> :grep -F TODO -R ./src/**/*.cpp ./include/**/*.h<cr> :cw<cr> " map <silent> <F7> :grep -F TODO -R ./src/**/*.cpp ./include/**/*.h<cr> :cw<cr>

@ -1 +1 @@
Subproject commit cb5756943fdd3ba062f101a5aba34acdd34d1356 Subproject commit d183f11fa72471ed6c4df595b4047dfff98abf75

@ -1 +1 @@
Subproject commit 8a803267a741cff3d6147650745f83c8f2125578 Subproject commit a0710a4937ab9dc10bc0a8b56b41fcc88534147c

@ -1 +1 @@
Subproject commit 8bc47fd1c40cdad9ea1f36c0cf13592c70ea65e9 Subproject commit 728b57a6564c1d2bdfb9b9e0f2f8c5ba3d7e0c5c

@ -1 +1 @@
Subproject commit 91bae6876031ececf151cc4f28aa5fb8c93681e4 Subproject commit 16504d394e145e0372d2491e02769d241350399a

@ -1 +1 @@
Subproject commit 2a2617310b0fb4c0daf02be2ba465fada257f2d0 Subproject commit 86b9824b89cf52d4b748ea2a27885607c98c881a

@ -1 +1 @@
Subproject commit 35c859179da4ad4f96eb8255e428904436a0b4b4 Subproject commit 68572ef46143c5c7d420a6ec86f1ec4595765ce5

@ -0,0 +1 @@
Subproject commit 8e75da9834abb22f8d7ece3f4ca4324a14fa18a6

@ -1 +1 @@
Subproject commit 60f25648814f0695eeb6c1040d97adca93c4e0bb Subproject commit 00e1e7fcdbc6d753e0bc8043e0d2546fa81bf367

@ -1 +1 @@
Subproject commit 7c4277754b6b77fb80b47cd4a7384d1e2d6c1538 Subproject commit a48da32365498162579bc6384584596aa7f36b1d

@ -1 +1 @@
Subproject commit 34b13299b5da7ad66ea387027d458bd54127687c Subproject commit c96db6151fde9d06a8fed71b7df05c6dbb3f14fe

@ -1 +1 @@
Subproject commit 3c420ed63f54a3359d5bc4e500cb9abd0c9177c5 Subproject commit 423f264e753cec260b4f14455126e6db7ba429af

@ -1 +1 @@
Subproject commit eaf2034163b9b9dab2217d10c48ae0d52e90d07b Subproject commit c2ffb8b3ec114301795036f7bf22995746d2acaf

@ -0,0 +1 @@
Subproject commit 83469fd71b0b1a8b2e20762814fcc24c7625e2d0

@ -0,0 +1 @@
Subproject commit 63072927d28348864a0372f5d091ff9585535ff3

@ -1 +1 @@
Subproject commit fc8d1e68cd58fb3ffdd56109bf855cda92b10b70 Subproject commit c5b1bbe1662d76c0aa9f6d325c3fb1b8db62ba02

@ -1 +1 @@
Subproject commit 9373a8471cd968e5e4605c3487f80c9364d412b2 Subproject commit 05d82b87711c6c8b9b7389bfb91c24bc4f62aa87

@ -1 +1 @@
Subproject commit bdd216827ae53cdf70d933bb30762da9bf42cad4 Subproject commit f3ccb0c12ee4985b8808f83059830a24cc92821c

@ -1 +1 @@
Subproject commit 8fe259720a96d4930696d8497be0d89657125990 Subproject commit d2f514ded8061ccb91230f1c096c63bda974c8a1

@ -0,0 +1 @@
Subproject commit ddc5592f8c36bf4bd915c16b38b8c76292c2b975

@ -1 +1 @@
Subproject commit 042aec6f06e958d74f072855bfd365a671aaf49b Subproject commit 71d91aec383ad3b72d8830db5d50d9bf4a8563f6

@ -1 +1 @@
Subproject commit 2d05440ad23f97a7874ebd9b5de3a0e65d25d85c Subproject commit e49d6c2459e0f5569ff2d533b4df995dd7f98313

@ -1 +1 @@
Subproject commit eaa5289b5161ef2c24fb66364ad563ea4ef5b170 Subproject commit d724094e7128acd7375cc758008f1e1688130877

@ -1 +1 @@
Subproject commit 11dc568dbfd7a56866a4354c737515769f08e9fe Subproject commit 1ac95a86c0facb1be8abec924cf79fd642cec386

View File

@ -0,0 +1,491 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Nov 17
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
let s:ft = matchstr(&ft, '^\([^.]\)\+')
" A bunch of useful C keywords
syn keyword cStatement goto break return continue asm
syn keyword cLabel case default
syn keyword cConditional if else switch
syn keyword cRepeat while for do
syn keyword cTodo contained TODO FIXME XXX
syn match cTodo contained "@todo"
syn match cTodo contained "@note"
" It's easy to accidentally add a space after a backslash that was intended
" for line continuation. Some compilers allow it, which makes it
" unpredictable and should be avoided.
syn match cBadContinuation contained "\\\s\+$"
" cCommentGroup allows adding matches for special things in comments
syn cluster cCommentGroup contains=cTodo,cBadContinuation
" String and Character constants
" Highlight special characters (those which have a backslash) differently
syn match cSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
if !exists("c_no_utf")
syn match cSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
endif
if !exists("c_no_cformat")
" Highlight % items in strings.
if !exists("c_no_c99") " ISO C99
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
else
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
endif
syn match cFormat display "%%" contained
endif
" cCppString: same as cString, but ends at end of line
if s:ft ==# "cpp" && !exists("cpp_no_cpp11") && !exists("c_no_cformat")
" ISO C++11
syn region cString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
syn region cCppString start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
elseif s:ft ==# "c" && !exists("c_no_c11") && !exists("c_no_cformat")
" ISO C99
syn region cString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
syn region cCppString start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
else
" older C or C++
syn match cFormat display "%%" contained
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
endif
syn region cCppSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
syn cluster cStringGroup contains=cCppString,cCppSkip
syn match cCharacter "L\='[^\\]'"
syn match cCharacter "L'[^']*'" contains=cSpecial
if exists("c_gnu")
syn match cSpecialError "L\='\\[^'\"?\\abefnrtv]'"
syn match cSpecialCharacter "L\='\\['\"?\\abefnrtv]'"
else
syn match cSpecialError "L\='\\[^'\"?\\abfnrtv]'"
syn match cSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
endif
syn match cSpecialCharacter display "L\='\\\o\{1,3}'"
syn match cSpecialCharacter display "'\\x\x\{1,2}'"
syn match cSpecialCharacter display "L'\\x\x\+'"
if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
" ISO C11 or ISO C++ 11
if exists("c_no_cformat")
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
else
syn region cString start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
endif
syn match cCharacter "[Uu]'[^\\]'"
syn match cCharacter "[Uu]'[^']*'" contains=cSpecial
if exists("c_gnu")
syn match cSpecialError "[Uu]'\\[^'\"?\\abefnrtv]'"
syn match cSpecialCharacter "[Uu]'\\['\"?\\abefnrtv]'"
else
syn match cSpecialError "[Uu]'\\[^'\"?\\abfnrtv]'"
syn match cSpecialCharacter "[Uu]'\\['\"?\\abfnrtv]'"
endif
syn match cSpecialCharacter display "[Uu]'\\\o\{1,3}'"
syn match cSpecialCharacter display "[Uu]'\\x\x\+'"
endif
"when wanted, highlight trailing white space
if exists("c_space_errors")
if !exists("c_no_trail_space_error")
syn match cSpaceError display excludenl "\s\+$"
endif
if !exists("c_no_tab_space_error")
syn match cSpaceError display " \+\t"me=e-1
endif
endif
" This should be before cErrInParen to avoid problems with #define ({ xxx })
if exists("c_curly_error")
syn match cCurlyError "}"
syn region cBlock start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold
else
syn region cBlock start="{" end="}" transparent fold
endif
" Catch errors caused by wrong parenthesis and brackets.
" Also accept <% for {, %> for }, <: for [ and :> for ] (C99)
" But avoid matching <::.
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
if exists("c_no_curly_error")
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "^^<%\|^%>"
else
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
endif
elseif exists("c_no_bracket_error")
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "<%\|%>"
else
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
syn match cParenError display ")"
syn match cErrInParen display contained "[{}]\|<%\|%>"
endif
else
if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
syn match cParenError display "[\])]"
syn match cErrInParen display contained "<%\|%>"
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
else
syn region cParen transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
syn match cParenError display "[\])]"
syn match cErrInParen display contained "[\]{}]\|<%\|%>"
syn region cBracket transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
endif
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine
syn region cCppBracket transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
syn match cErrInBracket display contained "[);{}]\|<%\|%>"
endif
if s:ft ==# 'c' || exists("cpp_no_cpp11")
syn region cBadBlock keepend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold
endif
"integer number, or floating point number without a dot and with "f".
syn case ignore
syn match cNumbers display transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctalError,cOctal
" Same, but without octal error (for comments)
syn match cNumbersCom display contained transparent "\<\d\|\.\d" contains=cNumber,cFloat,cOctal
syn match cNumber display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
"hex number
syn match cNumber display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
" Flag the first zero of an octal number as something special
syn match cOctal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
syn match cOctalZero display contained "\<0"
syn match cFloat display contained "\d\+f"
"floating point number, with dot, optional exponent
syn match cFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
"floating point number, starting with a dot, optional exponent
syn match cFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
"floating point number, without dot, with exponent
syn match cFloat display contained "\d\+e[-+]\=\d\+[fl]\=\>"
if !exists("c_no_c99")
"hexadecimal floating point number, optional leading digits, with dot, with exponent
syn match cFloat display contained "0x\x*\.\x\+p[-+]\=\d\+[fl]\=\>"
"hexadecimal floating point number, with leading digits, optional dot, with exponent
syn match cFloat display contained "0x\x\+\.\=p[-+]\=\d\+[fl]\=\>"
endif
" flag an octal number with wrong digits
syn match cOctalError display contained "0\o*[89]\d*"
syn case match
if exists("c_comment_strings")
" A comment can contain cString, cCharacter and cNumber.
" But a "*/" inside a cString in a cComment DOES end the comment! So we
" need to use a special type of cString: cCommentString, which also ends on
" "*/", and sees a "*" at the start of the line as comment again.
" Unfortunately this doesn't very well work for // type of comments :-(
syn match cCommentSkip contained "^\s*\*\($\|\s\+\)"
syn region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip
syn region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial
syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError,@Spell
if exists("c_no_comment_fold")
" Use "extend" here to have preprocessor lines not terminate halfway a
" comment.
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell extend
else
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError,@Spell fold extend
endif
else
syn region cCommentL start="//" skip="\\$" end="$" keepend contains=@cCommentGroup,cSpaceError,@Spell
if exists("c_no_comment_fold")
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell extend
else
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell fold extend
endif
endif
" keep a // comment separately, it terminates a preproc. conditional
syn match cCommentError display "\*/"
syn match cCommentStartError display "/\*"me=e-1 contained
syn keyword cOperator sizeof
if exists("c_gnu")
syn keyword cStatement __asm__
syn keyword cOperator typeof __real__ __imag__
endif
syn keyword cType int long short char void
syn keyword cType signed unsigned float double
if !exists("c_no_ansi") || exists("c_ansi_typedefs")
syn keyword cType size_t ssize_t off_t wchar_t ptrdiff_t sig_atomic_t fpos_t
syn keyword cType clock_t time_t va_list jmp_buf FILE DIR div_t ldiv_t
syn keyword cType mbstate_t wctrans_t wint_t wctype_t
endif
if !exists("c_no_c99") " ISO C99
syn keyword cType _Bool bool _Complex complex _Imaginary imaginary
syn keyword cType int8_t int16_t int32_t int64_t
syn keyword cType uint8_t uint16_t uint32_t uint64_t
if !exists("c_no_bsd")
" These are BSD specific.
syn keyword cType u_int8_t u_int16_t u_int32_t u_int64_t
endif
syn keyword cType int_least8_t int_least16_t int_least32_t int_least64_t
syn keyword cType uint_least8_t uint_least16_t uint_least32_t uint_least64_t
syn keyword cType int_fast8_t int_fast16_t int_fast32_t int_fast64_t
syn keyword cType uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t
syn keyword cType intptr_t uintptr_t
syn keyword cType intmax_t uintmax_t
endif
if exists("c_gnu")
syn keyword cType __label__ __complex__ __volatile__
endif
syn keyword cStructure struct union enum typedef
syn keyword cStorageClass static register auto volatile extern const
if exists("c_gnu")
syn keyword cStorageClass inline __attribute__
endif
if !exists("c_no_c99") && s:ft !=# 'cpp'
syn keyword cStorageClass inline restrict
endif
if !exists("c_no_c11")
syn keyword cStorageClass _Alignas alignas
syn keyword cOperator _Alignof alignof
syn keyword cStorageClass _Atomic
syn keyword cOperator _Generic
syn keyword cStorageClass _Noreturn noreturn
syn keyword cOperator _Static_assert static_assert
syn keyword cStorageClass _Thread_local thread_local
syn keyword cType char16_t char32_t
endif
if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
if exists("c_gnu")
syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__
endif
syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
syn keyword cConstant __STDC_VERSION__
syn keyword cConstant CHAR_BIT MB_LEN_MAX MB_CUR_MAX
syn keyword cConstant UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX
syn keyword cConstant CHAR_MIN INT_MIN LONG_MIN SHRT_MIN
syn keyword cConstant CHAR_MAX INT_MAX LONG_MAX SHRT_MAX
syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
if !exists("c_no_c99")
syn keyword cConstant __func__ __VA_ARGS__
syn keyword cConstant LLONG_MIN LLONG_MAX ULLONG_MAX
syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX
syn keyword cConstant UINT8_MAX UINT16_MAX UINT32_MAX UINT64_MAX
syn keyword cConstant INT_LEAST8_MIN INT_LEAST16_MIN INT_LEAST32_MIN INT_LEAST64_MIN
syn keyword cConstant INT_LEAST8_MAX INT_LEAST16_MAX INT_LEAST32_MAX INT_LEAST64_MAX
syn keyword cConstant UINT_LEAST8_MAX UINT_LEAST16_MAX UINT_LEAST32_MAX UINT_LEAST64_MAX
syn keyword cConstant INT_FAST8_MIN INT_FAST16_MIN INT_FAST32_MIN INT_FAST64_MIN
syn keyword cConstant INT_FAST8_MAX INT_FAST16_MAX INT_FAST32_MAX INT_FAST64_MAX
syn keyword cConstant UINT_FAST8_MAX UINT_FAST16_MAX UINT_FAST32_MAX UINT_FAST64_MAX
syn keyword cConstant INTPTR_MIN INTPTR_MAX UINTPTR_MAX
syn keyword cConstant INTMAX_MIN INTMAX_MAX UINTMAX_MAX
syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
endif
syn keyword cConstant FLT_RADIX FLT_ROUNDS
syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
syn keyword cConstant LC_NUMERIC LC_TIME
syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
" Add POSIX signals as well...
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
syn keyword cConstant SIGUSR1 SIGUSR2
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
syn keyword cConstant TMP_MAX stderr stdin stdout
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
" POSIX 2001
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
" non-POSIX signals
syn keyword cConstant SIGWINCH SIGINFO
" Add POSIX errors as well
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
" math.h
syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
endif
if !exists("c_no_c99") " ISO C99
syn keyword cConstant true false
endif
" Accept %: for # (C99)
syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
if !exists("c_no_if0")
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
if !exists("c_no_if0_fold")
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
else
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
endif
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
if !exists("c_no_if0_fold")
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
else
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
endif
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
endif
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
syn match cIncluded display contained "<[^>]*>"
syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
"syn match cLineSkip "\\$"
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
" Highlight User Labels
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
if s:ft ==# 'c' || exists("cpp_no_cpp11")
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell,@cStringGroup
endif
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
syn cluster cLabelGroup contains=cUserLabel
syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
if s:ft ==# 'cpp'
syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
else
syn match cUserCont display "^\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
syn match cUserCont display ";\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
endif
syn match cUserLabel display "\I\i*" contained
" Avoid recognizing most bitfields as labels
syn match cBitField display "^\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
syn match cBitField display ";\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
if exists("c_minlines")
let b:c_minlines = c_minlines
else
if !exists("c_no_if0")
let b:c_minlines = 50 " #if 0 constructs can be long
else
let b:c_minlines = 15 " mostly for () constructs
endif
endif
if exists("c_curly_error")
syn sync fromstart
else
exec "syn sync ccomment cComment minlines=" . b:c_minlines
endif
" Define the default highlighting.
" Only used when an item doesn't have highlighting yet
hi def link cFormat cSpecial
hi def link cCppString cString
hi def link cCommentL cComment
hi def link cCommentStart cComment
hi def link cLabel Label
hi def link cUserLabel Label
hi def link cConditional Conditional
hi def link cRepeat Repeat
hi def link cCharacter Character
hi def link cSpecialCharacter cSpecial
hi def link cNumber Number
hi def link cOctal Number
hi def link cOctalZero PreProc " link this to Error if you want
hi def link cFloat Float
hi def link cOctalError cError
hi def link cParenError cError
hi def link cErrInParen cError
hi def link cErrInBracket cError
hi def link cCommentError cError
hi def link cCommentStartError cError
hi def link cSpaceError cError
hi def link cSpecialError cError
hi def link cCurlyError cError
hi def link cOperator Operator
hi def link cStructure Structure
hi def link cStorageClass StorageClass
hi def link cInclude Include
hi def link cPreProc PreProc
hi def link cDefine Macro
hi def link cIncluded cString
hi def link cError Error
hi def link cStatement Statement
hi def link cCppInWrapper cCppOutWrapper
hi def link cCppOutWrapper cPreCondit
hi def link cPreConditMatch cPreCondit
hi def link cPreCondit PreCondit
hi def link cType Type
hi def link cConstant Constant
hi def link cCommentString cString
hi def link cComment2String cString
hi def link cCommentSkip cComment
hi def link cString String
hi def link cComment Comment
hi def link cSpecial SpecialChar
hi def link cTodo Todo
hi def link cBadContinuation Error
hi def link cCppOutSkip cCppOutIf2
hi def link cCppInElse2 cCppOutIf2
hi def link cCppOutIf2 cCppOut
hi def link cCppOut Comment
let b:current_syntax = "c"
unlet s:ft
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8

View File

@ -0,0 +1,119 @@
" Vim syntax file
" Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
" Last Change: 2015 Nov 10
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Read the C syntax to start with
if version < 600
so <sfile>:p:h/c.vim
else
runtime! syntax/c.vim
unlet b:current_syntax
endif
" C++ extensions
syn keyword cppStatement new delete this friend using
syn keyword cppAccess public protected private
syn keyword cppModifier inline virtual explicit export
syn keyword cppType bool wchar_t
syn keyword cppExceptions throw try catch
syn keyword cppOperator operator typeid
syn keyword cppOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
syn match cppCast "\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
syn keyword cppStorageClass mutable
syn keyword cppStructure class typename template namespace
syn keyword cppBoolean true false
syn keyword cppConstant __cplusplus
" C++ 11 extensions
if !exists("cpp_no_cpp11")
syn keyword cppModifier override final
syn keyword cppType nullptr_t
syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype thread_local
syn keyword cppConstant nullptr
syn keyword cppConstant ATOMIC_FLAG_INIT ATOMIC_VAR_INIT
syn keyword cppConstant ATOMIC_BOOL_LOCK_FREE ATOMIC_CHAR_LOCK_FREE
syn keyword cppConstant ATOMIC_CHAR16_T_LOCK_FREE ATOMIC_CHAR32_T_LOCK_FREE
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
endif
" C++ 14 extensions
if !exists("cpp_no_cpp14")
syn match cppNumber display "\<0b[01]\+\(u\=l\{0,2}\|ll\=u\)\>"
endif
" The minimum and maximum operators in GNU C++
syn match cppMinMax "[<>]?"
" Default highlighting
if version >= 508 || !exists("did_cpp_syntax_inits")
if version < 508
let did_cpp_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink cppAccess cppStatement
HiLink cppCast cppStatement
HiLink cppExceptions Exception
HiLink cppOperator Operator
HiLink cppStatement Statement
HiLink cppModifier Type
HiLink cppType Type
HiLink cppStorageClass StorageClass
HiLink cppStructure Structure
HiLink cppBoolean Boolean
HiLink cppConstant Constant
HiLink cppRawStringDelimiter Delimiter
HiLink cppRawString String
HiLink cppNumber Number
delcommand HiLink
endif
function! RawStringEnableCodeSnip(filetype,start,end,textSnipHl) abort
let ft=toupper(a:filetype)
let group='textGroup'.ft
if exists('b:current_syntax')
let s:current_syntax=b:current_syntax
" Remove current syntax definition, as some syntax files (e.g. cpp.vim)
" do nothing if b:current_syntax is defined.
unlet b:current_syntax
endif
execute 'syntax include @'.group.' syntax/'.a:filetype.'.vim'
try
execute 'syntax include @'.group.' after/syntax/'.a:filetype.'.vim'
catch
endtry
if exists('s:current_syntax')
let b:current_syntax=s:current_syntax
else
unlet b:current_syntax
endif
execute 'syntax region textSnip'.ft.'
\ matchgroup='.a:textSnipHl.'
\ start=+'.a:start.'+ end=+'.a:end.'+
\ contains=@'.group
endfunction
call RawStringEnableCodeSnip("chaiscript", 'R"chaiscript(', ')chaiscript"', 'cppRawString')
call RawStringEnableCodeSnip("lua", 'R"lua(', ')lua"', 'cppRawString')
let b:current_syntax = "cpp"
" vim: ts=8

View File

@ -0,0 +1,39 @@
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" @todo \ at end of line should continue on next line
" Hello this is a test to see if it auto wraps the text when the text has been
" going on for way too long
" syn match langSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
" We only highlight valid escape characters as for now it just ignores unknown
" thing
syn match langSpecial display contained "\\[abfnrtv]"
syn match langError "^.\+"
syn keyword langTodo contained TODO FIXME XXX NOTE
syn match langTodo contained "@todo"
syn match langTodo contained "@note"
syn region langSection start="^\s*\[" end="\]"
syn match langKey "^.\{-}\ze="
syn match langValue "[#=]\zs.*$" contains=langSub,langSpecial,langValue
syn match langValue contained "\\\n.\+" contains=langValue
" syn match langSub "{[^}]\+}" " This is for fmt support
syn match langSub "{\d\+}"
syn match langComment "[#;].*$" contains=langTodo
hi def link langTodo Todo
hi def link langSpecial Special
hi def link langSection Type
hi def link langKey Identifier
hi def link langValue String
hi def link langValue2 String
hi def link langSub Constant
hi def link langComment Comment
hi def link langError Error
let b:current_syntax = "lang"
" vim: sts=2 sw=2 et

20
scripts/current_song Executable file
View File

@ -0,0 +1,20 @@
META=$(qdbus org.mpris.MediaPlayer2.mopidy /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata)
TITLE=$(echo "$META" | grep title | cut -d " " -f2-)
ARTIST=$(echo "$META" | grep artist | cut -d " " -f2-)
FILE=$(echo ~/.lyrics/$ARTIST - $TITLE.txt)
TRACKLIST=$(cat "$FILE")
POSITION=$(qdbus org.mpris.MediaPlayer2.mopidy /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)
PLAYING="Intro"
for TRACK in `echo "$TRACKLIST" | grep -oP "\[\d{2}:\d{2}\]" | sed "s/\[//g"`; do
MIN=$(echo $TRACK | grep -oP "\d{2}(?=:)" | sed 's/^0*//')
SEC=$(echo $TRACK | grep -oP "\d{2}(?=])" | sed 's/^0*//')
TIME=$(echo "$((MIN*60*1000000+SEC*1000000))")
if [ $POSITION -gt $TIME ]; then
PLAYING=$(echo "$TRACKLIST" | grep "$TRACK")
fi
done
echo "$PLAYING"

5
scripts/dmenu_run_perso Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# colors taken from the solarized color scheme, see .Xresources
dmenu_run -b -i -nb "#FDF6E3" -nf "#839496" -sf "#FFFFFF" -sb "#DC322F" -fn 'Source Code Pro-9'

168
scripts/podcasts Executable file
View File

@ -0,0 +1,168 @@
#!/bin/bash
# GUID=0d7c1b6929d53
GUID=70998f4a07e13
function get_first_number {
printf "%03.f" $(echo $1 | sed -r 's/\./_/g' | sed -r 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/')
# echo $1 | sed -r 's/\./_/' | sed -r 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/'
}
# $1 = SEARCH
function get_tracklist_url {
LINKS=$(curl -F 'search_selection=9' -F 'main_search='"$1" https://www.1001tracklists.com/search/result.php --silent |\
grep -o '<a href=['"'"'"][^"'"'"']*['"'"'"]' |\
sed -e 's/^<a href=["'"'"']//' -e 's/["'"'"']$//')
SEARCH=$(echo $1 | tr '[:upper:]' '[:lower:]')
echo "$LINKS" | grep "$(echo ${SEARCH// /\.*})"
}
function get_tracklist_id {
SOURCE=$(curl https://www.1001tracklists.com$1 --silent | grep "id_tracklist\" value=")
ID=$(get_first_number "$SOURCE")
echo $ID
}
# $1 = ID
function get_tracklist {
curl -H "Cookie: guid=$GUID" --data "idTL=$1" https://www.1001tracklists.com/ajax/export_tracklist.php --silent
}
# $1 = JSON
# $2 = KEY
function parse_json {
echo $1 | jq -r ".$2"
}
# $1 = NUMBER
function write_tracklist {
echo "Trying to download tracklist"
JSON=$(get_tracklist "$(get_tracklist_id "$(get_tracklist_url "$SEARCH_BASE $1")")")
echo "$JSON"
if "$(parse_json "$JSON" "success")"; then
# TRACKLIST=$(echo $JSON | jq -r ".tlTxt")
echo "$(parse_json "$JSON" "tlTxt")" | sed 's/\r//' > "/home/tim/Muziek/$FEED_NAME/$ARTIST - $ALBUM $1.txt"
else
echo "FAILED: $(parse_json "$JSON" "message")"
fi
}
# $1 = FILE
# $2 = NUMVER
function tag_file {
# id3 -M -d -t "$ALBUM $NUMBER" -a "$ARTIST" -l "$ALBUM" -n $2 $1
# id3v2 --APIC cover.jpg $1
echo "Tagging $1 $2"
tageditor --set --force-rewrite --remove-other-fields title="$ALBUM $2" artist="$ARTIST" album="$ALBUM" cover=cover.jpg --files "$1" -v
tageditor --set --force-rewrite track="$2" --files "$1" -v
# Maybe we should check if the file is a mp3
# id3ted -T $2 $1
rm $1.bak 2> /dev/null
}
# $1 = SONG
# $2 = NUMBER
function rename_file {
FILENAME=$(echo "$ALBUM" "$2")
FILENAME=$(echo "${FILENAME// /_}.${1##*.}")
echo "$1 -> $FILENAME"
mv "$1" "$FILENAME" 2> /dev/null
}
function do_feed {
echo "$ARTIST - $ALBUM"
#Check if there are new episodes
NEW_EPISODE_COUNT=$(podfox update $FEED_NAME | grep "new episode." | wc -l)
SONGS=""
if [ -z $(echo $NEW_EPISODE_COUNT | grep 0) ]; then
echo "Downloading new episodes"
SONGS=$(podfox download $FEED_NAME --how-many=$NEW_EPISODE_COUNT)
fi
for SONG in `find . | grep -e "mp3" -e "m4a"`; do
NUMBER=$(get_first_number "$SONG")
if [ ! -f "/home/tim/Muziek/$FEED_NAME/$ARTIST - $ALBUM $NUMBER.txt" ]; then
# This should be a seperate loop, that downloads all missing tracklists
# echo "Tracklist disabled"
echo $SONG $NUMBER
write_tracklist $NUMBER
fi
done
for SONG in `echo $SONGS | sed 's/ /\n/g' | grep -v "http" | grep -e ".mp3" -e ".m4a"`; do
# Now all we need to do is use podfox to figure out if there are new podcasts and tag those
NUMBER=$(get_first_number "$SONG")
tag_file "$SONG" "$NUMBER"
rename_file "$SONG" "$NUMBER"
done
}
# function do_feed2 {
# echo "$ARTIST - $ALBUM"
# #Check if there are new episodes
# # NEW_EPISODE_COUNT=$(podfox update $FEED_NAME | grep "new episode." | wc -l)
# NEW_EPISODE_COUNT=0
# SONGS=""
#
# if [ -z $(echo $NEW_EPISODE_COUNT | grep 0) ]; then
# echo "Downloading new episodes"
# SONGS=$(podfox download $FEED_NAME --how-many=$NEW_EPISODE_COUNT)
# fi
#
# for SONG in `find . | grep -e "mp3" -e "m4a"`; do
# NUMBER=$(get_first_number "$SONG")
#
# if [ ! -f "/home/tim/.lyrics/$ARTIST - $ALBUM $NUMBER.txt" ]; then
# # This should be a seperate loop, that downloads all missing tracklists
# # echo "Tracklist disabled"
# echo $SONG $NUMBER
# write_tracklist $NUMBER
# fi
# done
#
# for SONG in `echo $SONGS | sed 's/ /\n/g' | grep -v "http" | grep -e ".mp3" -e ".m4a"`; do
# # Now all we need to do is use podfox to figure out if there are new podcasts and tag those
# NUMBER=$(get_first_number "$SONG")
#
# tag_file "$SONG" "$NUMBER"
#
# rename_file "$SONG" "$NUMBER"
# done
# }
ARTIST="Oliver Heldens"
ALBUM="Heldeep Radio"
SEARCH_BASE="Oliver Heldens Heldeep Radio"
FEED_NAME="heldeep"
cd /home/tim/Muziek/heldeep
do_feed
ARTIST="Sam Feldt"
ALBUM="Heartfeldt Radio"
SEARCH_BASE="Sam Feldt Heartfeldt Radio"
FEED_NAME="heartfeldt"
cd /home/tim/Muziek/heartfeldt
do_feed
# ARTIST="Mr. Belt & Wezol"
# ALBUM="Music Club"
# SEARCH_BASE="Mr. Belt Wezol Music Club"
# FEED_NAME="music-club"
# cd /home/tim/Muziek/music-club
# do_feed2
ARTIST="Mr. Belt & Wezol"
ALBUM="The Cuckoo's Nest"
SEARCH_BASE="Mr. Belt Wezol The Cuckoos Nest"
FEED_NAME="cuckoos-nest"
cd /home/tim/Muziek/cuckoos-nest
do_feed
mopidy local scan

3
scripts/start-ncmpcpp Executable file
View File

@ -0,0 +1,3 @@
/usr/lib/gnome-terminal/gnome-terminal-server --app-id nl.ncmpcpp --name ncmpcpp &
sleep 0.2
gnome-terminal --app-id nl.ncmpcpp -e ncmpcpp

3
scripts/start-vim Executable file
View File

@ -0,0 +1,3 @@
/usr/lib/gnome-terminal/gnome-terminal-server --app-id nl.vim --name vim &
sleep 0.2
gnome-terminal --app-id nl.vim --title "Vim" -e "nvim \"$@\""

View File

@ -16,9 +16,11 @@ export TERM="screen-256color"
export SAL_USE_VCLPLUGIN="gtk" export SAL_USE_VCLPLUGIN="gtk"
export GOPATH="$HOME/.local/go" export GOPATH="$HOME/.local/go"
export PATH="$HOME/.local/go/bin:$PATH" export PATH="$HOME/.local/go/bin:$PATH"
export USE_CCACHE=1
#setting aliases #setting aliases
alias cl="clear" alias cl="clear"
alias mtgames.nl="gnome-terminal -x ssh server@188.166.73.149 -t tmux a"
alias vim="nvim" alias vim="nvim"
alias tmux="tmux -2" alias tmux="tmux -2"
alias attach="tmux a" alias attach="tmux a"
@ -26,3 +28,9 @@ alias wcp="wc -l **/src/**/*.cpp **/include/**/*.h"
#start tmux #start tmux
if [ -z "$TMUX" ]; then tmux; exit; fi if [ -z "$TMUX" ]; then tmux; exit; fi
export FZF_DEFAULT_OPTS='--height 20%'
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh