vim: add ligature and logcat color

This commit is contained in:
Mathieu Maret 2022-01-03 16:06:03 +01:00
parent d0cbe54bb6
commit 3dbb62d303
6 changed files with 154 additions and 3 deletions

24
.vim/after/syntax/c.vim Normal file
View File

@ -0,0 +1,24 @@
if !has('conceal')
finish
endif
setlocal conceallevel=1
syntax clear cOperator
"syntax match cOperator "++" conceal cchar=⧺
"syntax match cOperator "=\@<!===\@!" conceal cchar=⇔
syntax match cOperator "!=" conceal cchar=
syntax match cOperator "<=" conceal cchar=
syntax match cOperator ">=" conceal cchar=
syntax match cOperator "<<" conceal cchar=«
syntax match cOperator ">>" conceal cchar=»
syntax match cOperator "::" conceal cchar=
syntax match cOperator "->" conceal cchar=
syntax match cOperator "||" conceal cchar=
hi! link cOperator Operator
hi! link Conceal Operator

24
.vim/after/syntax/cpp.vim Normal file
View File

@ -0,0 +1,24 @@
if !has('conceal')
finish
endif
setlocal conceallevel=1
syntax clear cppOperator
"syntax match cppOperator "++" conceal cchar=⧺
"syntax match cppOperator "=\@<!===\@!" conceal cchar=≖
syntax match cppOperator "!=" conceal cchar=
syntax match cppOperator "<=" conceal cchar=
syntax match cppOperator ">=" conceal cchar=
syntax match cppOperator "<<" conceal cchar=«
syntax match cppOperator ">>" conceal cchar=»
syntax match cppOperator "::" conceal cchar=
syntax match cppOperator "->" conceal cchar=
syntax match cppOperator "||" conceal cchar=
hi! link cppOperator Operator
hi! link Conceal Operator

View File

@ -0,0 +1,45 @@
scriptencoding utf-8
if exists('g:no_vim_fancy_text') || !has('conceal') || &enc != 'utf-8'
finish
endif
syntax match pyFancyOperator "<=" conceal cchar=
syntax match pyFancyOperator ">=" conceal cchar=
syntax match pyFancyOperator "=\@<!===\@!" conceal cchar=
syntax match pyFancyOperator "!=" conceal cchar=
syntax match pyFancyOperator "\<\%(\%(math\|np\|numpy\)\.\)\?sqrt\>" conceal cchar=
syntax match pyFancyKeyword "\<\%(\%(math\|np\|numpy\)\.\)\?pi\>" conceal cchar=π
syntax match pyFancyOperator "\<\%(\%(math\|np\|numpy\)\.\)\?ceil\>" conceal cchar=
syntax match pyFancyOperator "\<\%(\%(math\|np\|numpy\)\.\)\?floor\>" conceal cchar=
syntax match pyFancyOperator " \* " conceal cchar=
syntax match pyFancyOperator " / " conceal cchar=÷
syntax match pyFancyOperator "\( \|\)\*\*\( \|\)2\>" conceal cchar=²
syntax match pyFancyOperator "\( \|\)\*\*\( \|\)3\>" conceal cchar=³
syntax match pyFancyOperator "\( \|\)\*\*\( \|\)n\>" conceal cchar=
syntax keyword pyFancyStatement int conceal cchar=
syntax keyword pyFancyStatement float conceal cchar=
syntax keyword pyFancyStatement complex conceal cchar=
syntax keyword pyFancyBuiltin len conceal cchar=#
syntax keyword pyFancyStatement lambda conceal cchar=λ
syntax keyword pyFancyStatement None conceal cchar=
syntax keyword pyFancyOperator in conceal cchar=
syntax keyword pyFancyOperator or conceal cchar=
syntax keyword pyFancyOperator and conceal cchar=
syntax keyword pyFancySpecial True conceal cchar=𝐓
syntax keyword pyFancySpecial False conceal cchar=𝐅
syntax keyword pyFancyOperator sum conceal cchar=
syntax keyword pyFancyBuiltin all conceal cchar=
syntax keyword pyFancyBuiltin any conceal cchar=
syntax keyword pyFancyBuiltin not conceal cchar=
hi link pyFancyStatement Statement
hi link pyFancyKeyword Keyword
hi link pyFancyBuiltin Builtin
hi link pyFancySpecial Keyword
hi link pyFancyOperator Operator
hi! link Conceal Operator
setlocal conceallevel=1

View File

@ -0,0 +1,20 @@
scriptencoding utf-8
if exists('g:no_vim_fancy_text') || !has('conceal') || &enc != 'utf-8'
finish
endif
syntax match rsFancyOperator "!=" conceal cchar=
syntax match rsFancyOperator "<=" conceal cchar=
syntax match rsFancyOperator ">=" conceal cchar=
syntax match rsFancyOperator "<<" conceal cchar=«
syntax match rsFancyOperator ">>" conceal cchar=»
syntax match rsFancyOperator "::" conceal cchar=
syntax match rsFancyOperator "->" conceal cchar=
syntax match rsFancyOperator "=>" conceal cchar=
syntax match rsFancyOperator "||" conceal cchar=
hi! link rsFancyOperator Operator
hi! link Conceal Operator
setlocal conceallevel=1

30
.vim/syntax/logcat.vim Normal file
View File

@ -0,0 +1,30 @@
" Vim syntax file
" Language: logcat
" Maintainer: Naseer Ahmed <naseer.ahmed@gmail.com>
" Latest Revision: 2009-08-10
if exists("b:current_syntax")
finish
endif
"Define colors
hi def LogF_color ctermfg=white guifg=white ctermbg=red guibg=red
hi def LogE_color ctermfg=red guifg=red
hi def LogW_color ctermfg=brown guifg=brown
hi def LogI_color ctermfg=blue guifg=blue
hi def LogD_color ctermfg=darkgreen guifg=darkgreen
hi def LogV_color ctermfg=gray guifg=gray
syn match LogF 'F/.*'
syn match LogE 'E/.*'
syn match LogW 'W/.*'
syn match LogI 'I/.*'
syn match LogD 'D/.*'
syn match LogV 'V/.*'
hi def link LogF LogF_color
hi def link LogE LogE_color
hi def link LogW LogW_color
hi def link LogI LogI_color
hi def link LogD LogD_color
hi def link LogV LogV_color

14
.vimrc
View File

@ -28,7 +28,7 @@
" M-left/right horizontal size " M-left/right horizontal size
" M-up/down vertical size " M-up/down vertical size
" gc comment/uncomment " gc comment/uncomment
" C-K indent selection " C-K in normal:indent selection
" \-a Set Kernel Coding style " \-a Set Kernel Coding style
" from a.vim " from a.vim
" :A[SVTN] Switch between header/file , split, vertical, tab, next match " :A[SVTN] Switch between header/file , split, vertical, tab, next match
@ -44,6 +44,11 @@
":map " Normal, visual, select and operator bindings ":map " Normal, visual, select and operator bindings
":map! "insert and command-line mode bindings ":map! "insert and command-line mode bindings
":redir END ":redir END
" C-K in insert for ligature. See available ligature with :digraphs
" Could be disabled with :set conceallevel=0. See after/syntax for custom
" settings
" Require a font with ligature support
""""""""""" """""""""""
" GENERAL " " GENERAL "
""""""""""" """""""""""
@ -190,13 +195,16 @@ set shiftwidth=8
"filetype specific action "filetype specific action
augroup IrisPython augroup FtSpecific
au Filetype markdown set tabstop=4 shiftwidth=4 softtabstop=4 au Filetype markdown set tabstop=4 shiftwidth=4 softtabstop=4
au BufRead,BufNewFile *.iris set ft=python au BufRead,BufNewFile *.iris set ft=python
au BufRead,BufNewFile *.ino set tabstop=4 shiftwidth=4 softtabstop=4 au BufRead,BufNewFile *.ino set tabstop=4 shiftwidth=4 softtabstop=4
au BufRead,BufNewFile *.asm set ft=nasm au BufRead,BufNewFile *.asm set ft=nasm
"hand written GNU AS "hand written GNU AS
au BufRead,BufNewFile *.S set ft=asm au BufRead,BufNewFile *.S set ft=asm
au BufRead,BufNewFile *.logcat set filetype=logcat
au BufRead,BufNewFile logcat set filetype=logcat
au BufNewFile,BufRead *.lc set filetype=logcat
" python " python
" autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab " autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
@ -238,7 +246,7 @@ augroup IndentFind
augroup END augroup END
noremap <C-K> :py3f ~/.vim/syntax/clang-format.py<CR> noremap <C-K> :py3f ~/.vim/syntax/clang-format.py<CR>
inoremap <C-K> <ESC>:py3f ~/.vim/syntax/clang-format.py<CR>i "inoremap <C-K> <ESC>:py3f ~/.vim/syntax/clang-format.py<CR>i
set wildignore+=*.o,*.d,*.dex,*.class,*.png,*.jpeg,*.jpg,*.pdf set wildignore+=*.o,*.d,*.dex,*.class,*.png,*.jpeg,*.jpg,*.pdf