導航:首頁 > 編程語言 > vimjava語法檢查

vimjava語法檢查

發布時間:2024-08-23 03:34:46

A. Vim如何設置java語法顏色

/etc/下面可以找到vim的配置文件,文件名是vimrc,打開它,這裡面全是vim的初始配置,在最後加入color murphy或者是colorscheme murphy。保存
cd /usr/share/vim/vim72/colorsls 打開murphy 它就是colors目錄下面其中的一個配置文件不包含.vim的文件名。
我們接著研究,其實這下面都是一些關於vim的不同顏色方案的組合。你可以打開這些文件看看裡面的實際內容。也許試過了所有的顏色方案後,沒有一個讓你覺得滿意的,那就改一個自己滿意的,怎麼做呢?

首先找一個自己覺得還比較喜歡的顏色方案的配置文件,比如morning.vim,復制一份。打開它。
我們修改其中的顏色,注意其中的幾行:
hi Normal ctermfg = Black ctermbg=Grey guifg=Black guibg=grey98
hi Commnet ...
hi Statement ...
hi Type...
hi Number...

我們先說這里列出的第一行
hi 是高亮的意思,是light的縮寫
Normal這個段指的是什麼樣的文本,這是Normal是指普通文本。
ctermfg是指vim以終端方式運行時前景的顏色
ctermfg是指vim以終端方式運行時背景景的顏色
guifg是指vim以GUI方式運行時前景的顏色
guibg是指vim以GUI方式運行時背景的顏色

因為我們這里討論的是在終端啟動vim所以我只關注第2,3段位,忽略4,5段位。
後面行和第一行的格式相似,多了一個term欄位,我們暫且不去管它。其中我們要關注是第二欄位所表示是什麼,下面列出這些所代表的意義:
Comment any comment
Constantany constant
Stringa string constant: "this is a string"
Character a character constant: 'c', '/n'
Numbera number constant: 234, 0xff
Booleanabooleanconstant: TRUE, false
Floata floating point constant: 2.3e10

Identifierany variable name
Functionfunction name (also: methods for classes)

Statementany statement
Conditionalif, then, else, endif, switch, etc.
Repeatfor,do, while, etc.
Labelcase, default, etc.
Operator"sizeof", "+", "*", etc.
Keywordany other keyword
Exception try, catch, throw

PreProcgeneric Preprocessor
Includepreprocessor #include
Definepreprocessor #define
MacrosameasDefine
PreConditpreprocessor #if, #else, #endif, etc.

Typeint, long, char, etc.
StorageClassstatic,register, volatile, etc.
Structure struct, union, enum, etc.
TypedefA typedef

Specialany special symbol
SpecialCharspecial character in a constant
Tagyou can useCTRL-]on this
Delimitercharacter that needs attention
SpecialCommentspecial things inside a comment
Debugdebugging statements

Underlinedtext that stands out, HTML links

Ignoreleft blank, hidden

Errorany erroneous construct

Todoanything that needs extra attention; mostly the
keywords TODO FIXME and XXX
參照上面的內容就可以把配置文件改成我們想要的樣子了,保存退出。

讓我們在回到/etc/vimrc,打開它,比如我們剛才新改的配置文件我們取的名字是my_conf.vim,在最後行,加入如下內容:
color my_conf
讓後保存退出。重新打開vim,看看我們修改的成果。

B. 求用java語言編譯的具有一定的糾錯能力的由(單詞、類別)所組成的二元組序列的語法分析

1、在電腦任意盤新建一個文本文檔→右鍵選擇Edit with Vim打開就可以了,便可以開始進行編寫語言。

C. vim中syntastic插件為什麼對java語法檢查不管用

Sysntastic不起作用的原因是,
沒有設置 CLASSPATH 環境變數。
之前在一本書中看到JDK1.5以後不必設置CLASSPATH變數,
Systastic還需要用到這個環境變數。。。

D. linux vim怎樣設置java語法高亮

首先是讓Vi語法高亮顯示

vi ~/.vimrc
如果沒有則新建
添加syntax on

如果報錯
E319: Sorry, the command is not available in this version: syntax enable
Press ENTER or type command to continue
則可能vim是tiny版本。重新安裝vim即可
「 apt-get install vim"

我的linux版本是
Linux version 2.6.18-6-686 (Debian
2.6.18.dfsg.1-18etch1) ([email protected]) (gcc version 4.1.2 20061115
(prerelease) (Debian 4.1.1-21)) #1 SMP Sun Feb 10 22:11:31 UTC 2008
當初是使用netinstall版本安裝的,所以很有可能是tiny版本

然後一些其他的設置
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cindent
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
set nu //自動顯示行號
set hlsearch //搜索結果高亮顯示

閱讀全文

與vimjava語法檢查相關的資料

熱點內容
數據挖掘能實現什麼 瀏覽:686
e420硬體升級 瀏覽:225
QQ域名防紅代碼 瀏覽:756
viahdwin10 瀏覽:448
360軟體小助手怎麼添加文件夾 瀏覽:401
電視內置網路有什麼好處 瀏覽:81
微信10分鍾下款口子 瀏覽:62
中國買賣書畫的網站有哪個 瀏覽:648
vb程序最小公倍數 瀏覽:747
迅雷雲盤下載的文件怎麼找不到 瀏覽:49
樹莓派做win10電視盒子 瀏覽:690
模仁編程是什麼意思 瀏覽:267
分數app 瀏覽:135
硬碟格式化文件系統 瀏覽:325
如果禁用分頁文件 瀏覽:80
公司級的路由器密碼設置 瀏覽:581
京東app的好物榜怎麼進 瀏覽:803
word打開臨時文件夾 瀏覽:686
如何復制選中的數據 瀏覽:96

友情鏈接