当前位置:网站首页>DMU software syntax highlighting VIM setting -- Learning Notes 6

DMU software syntax highlighting VIM setting -- Learning Notes 6

2022-06-27 06:43:00 Analysis of breeding data


use vim When programming , DMU No syntax highlights for keywords , I don't feel comfortable , Just set it up , And record the process .

The effect of setting is as follows

DMU Software Syntax highlighting vim Set up -- Learning notes 6_ Syntax highlighting

Set up the process

This time the setting is relatively simple , Divide the key words into :


  • Model model, such as DMU1, DMU2…
  • Different components part, such as DATA, VARIATE, MODEL…
  • Different structural types type, such as PED, COR…
  • newly build DIR.vim file , Set relevant parameters in it
  • newly build DIR_suffix.vim file , Set suffix read

DIR.vim file :

       
"------------------------------------------------------------------------------"
" Description
"------------------------------------------------------------------------------"

" vim syntax highlighting file for DMU programs

" Author: Deng Fei <[email protected]>
" Created: Unknown
" Modified: 2018-11-18
" License: GPLv2

syn keyword model DMU1 DMU4 DMU5 DMUAI RJMC

syn keyword part COMMENT ANALYSE DATA VARIABLE MODEL GLMM GLMM_PRED REDUCE MIXTURE VAR_STR VAR_REST PRECOND SOLUTION PRIOR RESIDUALS TRAITS ABSORB RANDOM REGRES NOCOV

syn keyword type PED DOM COR GRE PGMIX ABS_QTL GROUP VAR COV COR V_RATIO ASCII

hi model ctermfg=Yellow
hi part ctermfg=red
hi type ctermfg=Green
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.

Put the above content , Save as :DIR.vim file , Put it in :~/.vim/syntax In the folder . without syntax Folder , Just create a new one .

       
cp DIR.vim ~/.vim/syntax/
  • 1.

DIR_suffix.vim file :

       
au BufRead,BufNewFile *.DIR set filetype=DIR
  • 1.

Save the above to DIR_suffix.vim Asking price , Put it in :~/.vim/ftdetect In the folder . without ftdetect Folder , Just create a new one .

       
cp DIR_suffix.vim ~/.vim/ftdetect/
  • 1.

test

Use the following code , New file test.DIR, And then use vim open , See if grammar highlighting is successful :

       
$ANALYSE 1 1 0 0
$DATA ASCII (8,15,0) dat_dmu.txt
$VARIABLE
ID F1 F2 F3 F4 F5
y1
$MODEL
1
0
1 0 5 2 3 4 5 1
1
0
0
$VAR_STR 1 PED 2 ASCII ped_dmu.txt
$DMUAI
10
1d-7
1d-6
1
0
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.

The effect is as follows :

DMU Software Syntax highlighting vim Set up -- Learning notes 6_vim_02

If you're interested in data analysis , For software operations , For data organization , Understanding the results , Any questions , Please feel free to contact me. .

DMU Software Syntax highlighting vim Set up -- Learning notes 6_2d_03



原网站

版权声明
本文为[Analysis of breeding data]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202161659093586.html