我的Linux系统的VIMRC
" llvm CODING GUIDELines conformance for VIM
" $Revision$
"
" Maintainer: The LLVM Team, http://llvm.org
" WARNING: Read before you source in all these commands and macros! Some
" of them may change VIM behavior that you depend on.
"
" You can run VIM with these settings without changing your current setup with:
" $ vim -u /path/to/llvm/utils/vim/vimrc
" It's VIM, not VI
set nocompatible
" A tab produces a 2-space indentation
set softtabstop=4
set shiftwidth=4
set expandtab
" Highlight trailing whitespace and lines longer than 80 columns.
highlight LongLine ctermbg=DarkYellow guibg=DarkYellow
highlight WhitespaceEOL ctermbg=DarkYellow guibg=DarkYellow
if v:version >= 702
" Lines longer than 80 columns.
"au BufWinEnter * let w:m0=matchadd('LongLine', '\%>80v.\+', -1)
au BufWinEnter * let w:m0=matchadd('Underlined', '\%>80v.\+', -1)
" Whitespace at the end of a line. This little dance suppresses
" whitespace that has just been typed.
au BufWinEnter * let w:m1=matchadd('WhitespaceEOL', '\s\+$', -1)
au InsertEnter * call matchdelete(w:m1)
au InsertEnter * let w:m2=matchadd('WhitespaceEOL', '\s\+\%#\@<!$', -1)
au InsertLeave * call matchdelete(w:m2)
au InsertLeave * let w:m1=matchadd('WhitespaceEOL', '\s\+$', -1)
else
"au BufRead,BufNewFile * syntax match LongLine /\%>80v.\+/
au BufRead,BufNewFile * syntax match Underlined /\%>80v.\+/
au InsertEnter * syntax match WhitespaceEOL /\s\+\%#\@<!$/
au InsertLeave * syntax match WhitespaceEOL /\s\+$/
endif
" Enable filetype detection
filetype on
" Optional
" C/C++ programming helpers
augroup csrc
au!
autocmd FileType * set nocindent smartindent
autocmd FileType c,cpp set cindent
augroup END
" Set a few indentation parameters. See the VIM help for cinoptions-values for
" details. These aren't absolute rules; they're just an approximation of
" common style in LLVM source.
set cinoptions=:0,g0,(0,Ws,l1
" Add and delete spaces in increments of `shiftwidth' for tabs
set smarttab
" Highlight syntax in programming languages
syntax on
" LLVM Makefiles can have names such as Makefile.rules or TEST.nightly.Makefile,
" so it's important to categorize them as such.
augroup filetype
au! BufRead,BufNewFile *Makefile* set filetype=make
augroup END
" In Makefiles, don't expand tabs to spaces, since we need the actual tabs
autocmd FileType make set noexpandtab
" Useful macros for cleaning up code to conform to LLVM coding guidelines
" Delete trailing whitespace and tabs at the end of each line
command! DeleteTrailingWs :%s/\s\+$//
" Convert all tab characters to two spaces
command! Untab :%s/\t/ /g
" Enable syntax highlighting for LLVM files. To use, copy
" utils/vim/llvm.vim to ~/.vim/syntax .
augroup filetype
au! BufRead,BufNewFile *.ll set filetype=llvm
augroup END
" Enable syntax highlighting for tablegen files. To use, copy
" utils/vim/tablegen.vim to ~/.vim/syntax .
augroup filetype
au! BufRead,BufNewFile *.td set filetype=tablegen
augroup END
" Additional vim features to optionally uncomment.
"set showcmd
"set showmatch
"set showmode
"set incsearch
"set ruler
" Clang code-completion support. This is somewhat experimental!
" A path to a clang executable.
let g:clang_path = "clang++"
" A list of options to add to the clang commandline, for example to add
" include paths, predefined macros, and language options.
let g:clang_opts = [
\ "-x","c++",
\ "-D__STDC_LIMIT_MACROS=1","-D__STDC_CONSTANT_MACROS=1",
\ "-Iinclude" ]
function! ClangComplete(findstart, base)
if a:findstart == 1
" In findstart mode, look for the beginning of the current identifier.
let l:line = getline('.')
let l:start = col('.') - 1
while l:start > 0 && l:line[l:start - 1] =~ '\i'
let l:start -= 1
endwhile
return l:start
endif
" Get the current line and column numbers.
let l:l = line('.')
let l:c = col('.')
" Build a clang commandline to do code completion on stdin.
let l:the_command = shellescape(g:clang_path) .
\ " -cc1 -code-completion-at=-:" . l:l . ":" . l:c
for l:opt in g:clang_opts
let l:the_command .= " " . shellescape(l:opt)
endfor
" Copy the contents of the current buffer into a string for stdin.
" TODO: The extra space at the end is for working around clang's
" apparent inability to do code completion at the very end of the
" input.
" TODO: Is it better to feed clang the entire file instead of truncating
" it at the current line?
let l:process_input = join(getline(1, l:l), "\n") . " "
" Run it!
let l:input_lines = split(system(l:the_command, l:process_input), "\n")
" Parse the output.
for l:input_line in l:input_lines
" Vim's substring operator is annoyingly inconsistent with python's.
if l:input_line[:11] == 'COMPLETION: '
let l:value = l:input_line[12:]
" Chop off anything after " : ", if present, and move it to the menu.
let l:menu = ""
let l:spacecolonspace = stridx(l:value, " : ")
if l:spacecolonspace != -1
let l:menu = l:value[l:spacecolonspace+3:]
let l:value = l:value[:l:spacecolonspace-1]
endif
" Chop off " (Hidden)", if present, and move it to the menu.
let l:hidden = stridx(l:value, " (Hidden)")
if l:hidden != -1
let l:menu .= " (Hidden)"
let l:value = l:value[:l:hidden-1]
endif
" Handle "Pattern". TODO: Make clang less weird.
if l:value == "Pattern"
let l:value = l:menu
let l:pound = stridx(l:value, "#")
" Truncate the at the first [#, <#, or {#.
if l:pound != -1
let l:value = l:value[:l:pound-2]
endif
endif
" Filter out results which don't match the base string.
if a:base != ""
if l:value[:strlen(a:base)-1] != a:base
continue
end
endif
" TODO: Don't dump the raw input into info, though it's nice for now.
" TODO: The kind string?
let l:item = {
\ "word": l:value,
\ "menu": l:menu,
\ "info": l:input_line,
\ "dup": 1 }
" Report a result.
if complete_add(l:item) == 0
return []
endif
if complete_check()
return []
endif
elseif l:input_line[:9] == "OVERLOAD: "
" An overload candidate. Use a crazy hack to get vim to
" display the results. TODO: Make this better.
let l:value = l:input_line[10:]
let l:item = {
\ "word": " ",
\ "menu": l:value,
\ "info": l:input_line,
\ "dup": 1}
" Report a result.
if complete_add(l:item) == 0
return []
endif
if complete_check()
return []
endif
endif
endfor
return []
endfunction ClangComplete
" This to enables the somewhat-experimental clang-based
" autocompletion support.
set omnifunc=ClangComplete
set number
set nobackup
set noswapfile
"set ignorecase
set hlsearch
set incsearch
"set autochdir
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
match Character /\t/
hi Character term=standout ctermfg=0 ctermbg=3 guifg=Black guibg=DarkYellow
let Tlist_Ctags_Cmd = 'ctags'
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window = 1
au BufNewFile,BufRead *.md set filetype=lisp
cs add ./cscope.out
nmap <F2> :cs f s <C-R>=expand("<cword>")<CR><CR>
nmap <F3> :cs f g <C-R>=expand("<cword>")<CR><CR>
nmap <F4> :cs f f <C-R>=expand("<cword>")<CR><CR>
我的Linux系统的VIMRC的更多相关文章
- linux系统各种乱码问题
linux系统乱码问题 最近使用ubuntu操作系统(客户端)在ssh连接linux服务器的时候发现乱码问题,但是本机查看中文显示中文没有问题,只是在使用终端more查看本地或远端gbk之类中文编码的 ...
- linux系统下Vi编辑器或者Vim编辑器设置显示行号、自动缩进、调整tab键宽度的技巧?
工作中嫌vim 中一个tab键的宽度太大,linux系统默认,没改之前是一个tab键宽度是8个字符,想改成4个字符, 操作如下:(注意:这是在root用户下)cd ~vim .vimrc添加如下几行: ...
- Linux系统一本通(实用篇)
本人最近一直在ubuntu,接下来和大家分享我曾经踩过的坑,和一些非常实用的命令知识- 安装中的磁盘分配 一般来说,在linux系统中都有最少两个挂载点,分别是/ (根目录)及 swap(交换分区), ...
- 一般的linux系统默认安装的vim是精简版
一般的linux系统默认安装的vim是精简版(vim-tiny),所以不能配置语法检查等属性或获取在线帮助.需要安装vim-x:x.x.x,vim-common,vim-runtime. :synta ...
- 实验三:Linux系统用户管理及VIM配置
项目 内容 这个作业属于哪个课程 班级课程的主页链接 这个作业的要求在哪里 作业要求链接地址 学号-姓名 17043133-木腾飞 学习目标 1.学习Linux系统用户管理2.学习vim使用及配置 实 ...
- 实验三 Linux系统用户管理及VIM配置
项目 内容 这个作业属于哪个课程 班级课程的主页链接 这个作业的要求在哪里 作业要求链接接地址 学号-姓名 17041428-朱槐健 作业学习目标 1.学习Linux系统用户管理 2.学习vim使用 ...
- 在Linux系统下运行微信Web开发者工具
微信Web开发者工具只有window版本和mac版本,如果想要在Linux系统下运行微信Web开发者工具,需要花费很大周折. 注:带 * 的步骤或文件为不确定是否管用的步骤或文件.本人系统为Linux ...
- Linux实战教学笔记06:Linux系统基础优化
第六节 Linux系统基础优化 标签(空格分隔):Linux实战教学笔记-陈思齐 第1章 基础环境 第2章 使用网易163镜像做yum源 默认国外的yum源速度很慢,所以换成国内的. 第一步:先备份 ...
- Linux系统中的Device Mapper学习
在linux系统中你使用一些命令时(例如nmon.iostat 如下截图所示),有可能会看到一些名字为dm-xx的设备,那么这些设备到底是什么设备呢,跟磁盘有什么关系呢?以前不了解的时候,我也很纳闷. ...
随机推荐
- 对STM32的NVIC_PriorityGroupConfig使用及优先级分组方式理解(转)
源:http://blog.chinaunix.net/uid-22670933-id-3443085.html STM32有43个channel的settable的中断源:AIRC(Applicat ...
- 【HighCharts系列教程】三、图表属性——chart
一.chart属性说明 Chart是HighCharts图表中主要属性,包括了图表区域的颜色.线条.高度.宽度.对齐.图表类型等诸多属性,也是HighCharts图表中必须配置的属性之一. 配置cha ...
- R.layout.main cannot be resolved解决办法
今天敲的代码 package com.sharpandroid.activity; import android.R; import android.app.Activity; import andr ...
- Extjs4---Cannot read property 'addCls' of null - heirenheiren的专栏 - 博客频道 - CSDN.NET
body { font-family: 微软雅黑,"Microsoft YaHei", Georgia,Helvetica,Arial,sans-serif,宋体, PMingLi ...
- strace 分析 跟踪 进程错误
strace是什么? 按照strace官网的描述, strace是一个可用于诊断.调试和教学的Linux用户空间跟踪器.我们用它来监控用户空间进程和内核的交互,比如系统调用.信号传递.进程状态变更等. ...
- ibatis resultMap 的用法
先看个具体的例子: <resultMap id=”get-product-result” class=”com.ibatis.example.Product”> <result pr ...
- RabbitMQ 消息队列 配置
CentOS 7 x64 rabbitmq 一.CentOS 7 yum 添加epel 源 yum -y install epel-release 1. yum -y install erlang ...
- iOS平台软件开发工具(一)-新建的工程使用CocoaPods工具集成第三方框架
CocoaPods是一款集合了上千个第三方开源库的开发工具,能够大幅度的提升团队项目的开发效率,降低时间成本. 那么就看一下CocoaPods这个工具在项目中的使用体现吧. 我们马上用ASIHTTPR ...
- mysql优化----第一篇:综述
一 系统层面 查看CPU和IO状态,确定瓶颈.增 更换设备 二 数据库层面 1 参数优化. 参考文章<mysql性能优化----调整参数>增大数据库内存缓存等设置. 参考 http: ...
- Android控件系列之RadioButton&RadioGroup
学习目的: 1.掌握在Android中如何建立RadioGroup和RadioButton 2.掌握RadioGroup的常用属性 3.理解RadioButton和CheckBox的区别 4.掌握Ra ...