栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

vim配置(嵌入式C语言开发)

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vim配置(嵌入式C语言开发)

一、序言

      本文针对是对于嵌入式开发者,个人而言比较好用一些的配置版本

二、使用方法

      在家目录中添加**.vimrc**文件,将配置添加进去即可。

三、.vimrc配置文件

      除了一些基础配置以外,还添加了一些好用的插件:Vundle、ctags、cscope等。使用效果图如下:

"    Author: Pitnitus
"    Created: 2022-01-01
" LastChange: 2022-05-08

"iGENERAL SETTINGS: {{{1
" To use VIM settings, out of VI compatible mode.
set nocompatible
" Enable file type detection.
filetype plugin indent on
" Syntax highlighting.
syntax on
" Setting colorscheme
" Other settings.
set   autoindent
set   autoread
set   autowrite
set   background=dark
set   backspace=indent,eol,start
set nobackup
set   cindent
set   cinoptions=:0
set   cursorline
set   completeopt=longest,menuone
set noexpandtab
set   fileencodings=utf-8,gb2312,gbk,gb18030
set   fileformat=unix
set   foldenable
set   foldmethod=marker
set   guioptions-=T
set   guioptions-=m
set   guioptions-=r
set   guioptions-=l
set   helpheight=10
set   helplang=cn
set   hidden
"set   history=100
set   hlsearch
set   ignorecase
set   incsearch
set   laststatus=2
set   mouse-=a
set   number
set   paste
set   pumheight=10
set   ruler
set   scrolloff=5
set   shiftwidth=4
set   showcmd
set   smartindent
set   smartcase
set   tabstop=4
set   termencoding=utf-8
set   textwidth=80
set   whichwrap=h,l
set   wildignore=*.bak,*.o,*.e,*~
set   wildmenu
set   wildmode=list:longest,full
set nowrap
"""""""""""""""""""""""""""""""""""""
"1 Vundle manage
set nocompatible 	"be iMproved, required
filetype off		"required

"set the runtime path to include Vundle and initialize
set rtp+=~/Vundle.vim
call vundle#begin()

"let Vundle manage Vundle, required
Plugin 'Vundle.vim'

"All of your Plugins must be added before the following line
call vundle#end()	" required
filetype plugin indent on "required


"""""""""""""""""""""""""""""""""""""'
"ctags manage
"sudo apt-get install ctags
"Use :
"    Process use command "ctags -R"
"	ctrl+] --> 
"	ctrl+T <--
:set tags=tags

""""""""""""""""""""""""""""""""""""
"cscope manage
"sudo apt-get install cscope
"
"cscope : build-in datalib:cscope-Rbq;
"	F5 : find c char;
"	F6 : find a string
"	F7 : find handle's define
"	F8 : find it who used handle
if has("cscope")
	set csprg=/usr/bin/cscope
	set csto=1
	set nocsverb
	"add any database in current directory
	if filereadable("cscope.out")
		cs add cscope.out
	endif
	set csverb
endif
:set cscopequickfix=s-,c-,d-,i-,t-,e-

nmap   :cs find s =expand("") 
nmap   :cs find t =expand("") 
nmap   :cs find c =expand("") 
nmap   :cs find d =expand("") 

"""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plugin 'majutsushi/tagbar' " Tag bar"
" Tagbar
let g:tagbar_width=40
autocmd BufReadPost *.cpp,*.c,*.h,*.cc,*.cxx call tagbar#autoopen()

""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plugin 'scrooloose/nerdtree'
" NetRedTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let NERDTreeWinSize=15
let NERDTreeShowLineNumbers=5
let NERDTreeAutoCenter=1
let NERDTreeShowBookmarks=1

""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tools for language rules to check
Plugin 'w0rp/ale'

let g:ale_sign_columm_always=1
let g:ale_sign_error = 'X'
let g:ale_sign_sign_warning = 'w'
let g:ale_statusline_format = ['X %d', '~~ %d', '/ OK']
let g:ale_echo_msg_format = '[%linter%] %code: %%s'
let g:ale_lint_on_text_changed = 'normal'
let g:ale_lint_on_insert_leave = 1
let g:ale_c_gcc_options = '-Wall -O2 -std=c99'
let g:ale_cpp_gcc_options = '-Wall -O2 -std=c++14'
let g:ale_c_cppcheck_options = ''
let g:ale_cpp_cppcheck_options = ''

""""""""""""""""""""""""""""""""""""""""""""""""""
Plugin 'Valloric/YouCompleteMe'

set number

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/867784.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号