Browse Source

vim: add ligature and logcat color

master
Mathieu Maret 2 weeks ago
parent
commit
7e39156edf
  1. 24
      .vim/after/syntax/c.vim
  2. 24
      .vim/after/syntax/cpp.vim
  3. 45
      .vim/after/syntax/python.vim
  4. 20
      .vim/after/syntax/rust.vim
  5. 30
      .vim/syntax/logcat.vim
  6. 14
      .vimrc

24
.vim/after/syntax/c.vim

@ -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

@ -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

45
.vim/after/syntax/python.vim

@ -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

20
.vim/after/syntax/rust.vim

@ -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

@ -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

@ -28,7 +28,7 @@
" M-left/right horizontal size
" M-up/down vertical size
" gc comment/uncomment
" C-K indent selection
" C-K in normal:indent selection
" \-a Set Kernel Coding style
" from a.vim
" :A[SVTN] Switch between header/file , split, vertical, tab, next match
@ -44,6 +44,11 @@
":map " Normal, visual, select and operator bindings
":map! "insert and command-line mode bindings
":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 "
"""""""""""
@ -190,13 +195,16 @@ set shiftwidth=8
"filetype specific action
augroup IrisPython
augroup FtSpecific
au Filetype markdown set tabstop=4 shiftwidth=4 softtabstop=4
au BufRead,BufNewFile *.iris set ft=python
au BufRead,BufNewFile *.ino set tabstop=4 shiftwidth=4 softtabstop=4
au BufRead,BufNewFile *.asm set ft=nasm
"hand written GNU AS
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
" autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
@ -238,7 +246,7 @@ augroup IndentFind
augroup END
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

Loading…
Cancel
Save