资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vim高亮c语言函数 vim语法高亮 python

vim中,c语言里自己定义的变量能不能高亮显示

不能,高亮显示功能是高亮显示关键字、各种括号,自己定义的变量不是关键字,所以不能高亮显示,不光是在Vim,其他的文本编辑器也是一样的。

十载的武威网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。网络营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整武威建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联从事“武威网站设计”,“武威网站推广”以来,每个客户项目都认真落实执行。

在使用Linux vim编辑器写c语言,不明白高亮显示的红色、绿色代表什么意思?

用vim很多年了。没明白你所说的高亮红和高亮绿是个什么情况。

常年用vim的人一般都会有为自己定制的vim。所以你说这种高亮、红、绿,估计很多人不会明白是什么意思。我的c语言里面就完全没有类似的。对应的Python配置里面倒是有块状红色,表示那一行代码逻辑或者语法上有明显错误。

怎样在Ubuntu里设置vim加亮显示c语言函数名?

在~/.vimrc中加入syntax on就行了。下面是我的配置文件,可以直接用,我也是在网上拼凑的

" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just

" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime

" you can find below. If you wish to change any of those settings, you should

" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten

" everytime an upgrade of the vim packages is performed. It is recommended to

" make changes after sourcing debian.vim since it alters the value of the

" 'compatible' option.

" This line should not be removed as it ensures that various options are

" properly set to work with the Vim-related packages available in Debian.

runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible

" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous

" options, so any other options should be set AFTER setting 'compatible'.

"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next

" line enables syntax highlighting by default.

"新建.c,.h,.sh,.java文件,自动插入文件头

autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"

""定义函数SetTitle,自动插入文件头

func SetTitle()

"如果文件类型为.sh文件

if filetype == 'sh'

call setline(1,"\#########################################################################")

call append(line("."), "\# File Name: ".expand("%"))

call append(line(".")+1, "\# Author: Leo ")

call append(line(".")+2, "\# mail: kuling729@gmail点抗 ")

call append(line(".")+3, "\# Created Time: ".strftime("%c"))

call append(line(".")+4, "\#########################################################################")

call append(line(".")+5, "\#!/bin/bash")

call append(line(".")+6, "")

else

call setline(1, "/*************************************************************************")

call append(line("."), " File Name: ".expand("%"))

call append(line(".")+1, " Author: Leo")

call append(line(".")+2, " Mail: kuling729@gmail点抗 ")

call append(line(".")+3, " Created Time: ".strftime("%c"))

call append(line(".")+4, " ************************************************************************/")

call append(line(".")+5, "")

endif

if filetype == 'cpp'

call append(line(".")+6, "#includeiostream")

call append(line(".")+7, "using namespace std;")

call append(line(".")+8, "")

endif

if filetype == 'c'

call append(line(".")+6, "#includestdio.h")

call append(line(".")+7, "")

endif

"新建文件后,自动定位到文件末尾

autocmd BufNewFile * normal G

endfunc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

if has("syntax")

syntax on

endif

set number

set tabstop=4

set softtabstop=4

set shiftwidth=4

set autoindent

set cindent

colorscheme evening

let g:indent_guides_guide_size=1

set tags=tags;

set autochdir

" If using a dark background within the editing area and syntax highlighting

" turn on this option as well

"set background=dark

" Uncomment the following to have Vim jump to the last position when

" reopening a file

"if has("autocmd")

" au BufReadPost * if line("'\"") 1 line("'\"") = line("$") | exe "normal! g'\"" | endif

"endif

" Uncomment the following to have Vim load indentation rules and plugins

" according to the detected filetype.

"if has("autocmd")

" filetype plugin indent on

"endif

" The following are commented out as they cause vim to behave a lot

" differently from regular Vi. They are highly recommended though.

"set showcmd " Show (partial) command in status line.

"set showmatch " Show matching brackets.

"set ignorecase " Do case insensitive matching

"set smartcase " Do smart case matching

"set incsearch " Incremental search

"set autowrite " Automatically save before commands like :next and :make

"set hidden " Hide buffers when they are abandoned

"set mouse=a " Enable mouse usage (all modes)

" Source a global configuration file if available

if filereadable("/etc/vim/vimrc.local")

source /etc/vim/vimrc.local

endif


网站栏目:vim高亮c语言函数 vim语法高亮 python
地址分享:http://cdkjz.cn/article/ddisihd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220