1.安装
2.配置
这是我的vim 配饰文件,基本的功能都能实现,在这里做一个备份,省的以后重装系统还要到处找这个配置文件(/etc/vim/vimrc) :
" 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
" following enables syntax highlighting by default.
if has("syntax")
syntax on
endif
" 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)
"*******************************************************
"Personal configuration
"*******************************************************
set fileencodings=utf-8,gbk,ucs-bom,cp936
set encoding=utf-8
set nocompatible
set number
filetype on
filetype indent on
filetype plugin on
set history=1000
set background=dark
syntax on
"set autoindent
"set smartindent
set showmatch
set guioptions-=T
set vb t_vb=
set ruler
set nohls
:set cindent
set tabstop=4
set shiftwidth=8
set incsearch
set cursorline
set nobackup
set mouse=a
set hlsearch "set high light search, cancel the high light is set nohlsearch
:set laststatus=2
:set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CSCOPE settings for vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
" This file contains some boilerplate settings for vim's cscope interface,
" plus some keyboard mappings that I've found useful.
"
" USAGE:
" -- vim 6: Stick this file in your ~/.vim/plugin directory (or in a
" 'plugin' directory in some other directory that is in your
" 'runtimepath'.
"
" -- vim 5: Stick this file somewhere and 'source cscope.vim' it from
" your ~/.vimrc file (or cut and paste it into your .vimrc).
"
" NOTE:
" These key maps use multiple keystrokes (2 or 3 keys). If you find that vim
" keeps timing you out before you can complete them, try changing your timeout
" settings, as explained below.
"
" Happy cscoping,
"
" Jason Duell jduell@alumni.princeton.edu 2002/3/7
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" This tests to see if vim was configured with the '--enable-cscope' option
" when it was compiled. If it wasn't, time to recompile vim...
if has("cscope")
""""""""""""" Standard cscope/vim boilerplate
" use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
set cscopetag
" check cscope for definition of a symbol before checking ctags: set to 1
" if you want the reverse search order.
set csto=0
" add any cscope database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add the database pointed to by environment variable
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
" show msg when any other cscope db added
set cscopeverbose
""""""""""""" My cscope/vim key mappings
"
" The following maps all invoke one of the following cscope search types:
"
" 's' symbol: find all references to the token under cursor
" 'g' global: find global definition(s) of the token under cursor
" 'c' calls: find all calls to the function name under cursor
" 't' text: find all instances of the text under cursor
" 'e' egrep: egrep search for the word under cursor
" 'f' file: open the filename under cursor
" 'i' includes: find files that include the filename under cursor
" 'd' called: find functions that function under cursor calls
"
" Below are three sets of the maps: one set that just jumps to your
" search result, one that splits the existing vim window horizontally and
" diplays your search result in the new window, and one that does the same
" thing, but does a vertical split instead (vim 6 only).
"
" I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's
" unlikely that you need their default mappings (CTRL-\'s default use is
" as part of CTRL-\ CTRL-N typemap, which basically just does the same
" thing as hitting 'escape': CTRL-@ doesn't seem to have any default use).
" If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all
" of these maps to use other keys. One likely candidate is 'CTRL-_'
" (which also maps to CTRL-/, which is easier to type). By default it is
" used to switch between Hebrew and English keyboard mode.
"
" All of the maps involving the <cfile> macro use '^<cfile>$': this is so
" that searches over '#include <time.h>" return only references to
" 'time.h', and not 'sys/time.h', etc. (by default cscope will return all
" files that contain 'time.h' as part of their name).
" To do the first type of search, hit 'CTRL-\', followed by one of the
" cscope search types above (s,g,c,t,e,f,i,d). The result of your cscope
" search will be displayed in the current window. You can use CTRL-T to
" go back to where you were before the search.
"
nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
" Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type
" makes the vim window split horizontally, with search result displayed in
" the new window.
"
" (Note: earlier versions of vim may not have the :scs command, but it
" can be simulated roughly via:
" nmap <C-@>s <C-W><C-S> :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>
" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one (vim 6 and up only)
"
" (Note: you may wish to put a 'set splitright' in your .vimrc
" if you prefer the new window on the right instead of the left
nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
nmap <C-@><C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
""""""""""""" key map timeouts
"
" By default Vim will only wait 1 second for each keystroke in a mapping.
" You may find that too short with the above typemaps. If so, you should
" either turn off mapping timeouts via 'notimeout'.
"
"set notimeout
"
" Or, you can keep timeouts, by uncommenting the timeoutlen line below,
" with your own personal favorite value (in milliseconds):
"
"set timeoutlen=4000
"
" Either way, since mapping timeout settings by default also set the
" timeouts for multicharacter 'keys codes' (like <F1>), you should also
" set ttimeout and ttimeoutlen: otherwise, you will experience strange
" delays as vim waits for a keystroke after you hit ESC (it will be
" waiting to see if the ESC is actually part of a key code like <F1>).
"
"set ttimeout
"
" personally, I find a tenth of a second to work well for key code
" timeouts. If you experience problems and have a slow terminal or network
" connection, set it higher. If you don't set ttimeoutlen, the value for
" timeoutlent (default: 1000 = 1 second, which is sluggish) is used.
"
"set ttimeoutlen=100
endif
" Title: Verilog HDL/SystemVerilog HDVL indent file
" Maintainer: Mingzhi Li <limingzhi05@mail.nankai.edu.cn>
" Last Change: 2007-12-16 20:10:57 CST
"
" Buffer Variables:
" b:verilog_indent_width : indenting width(default value: shiftwidth)
"
" Install:
" Drop it to ~/.vim/indent
"
" URL:
" http://www.vim.org/scripts/script.php?script_id=2091
"
" Revision Comments:
" Mingzhi Li 2007-12-16 20:09:39 CST Version 1.2
" Bug fixes
" Mingzhi Li 2007-12-13 23:47:54 CST Version 1.1
" Bug fix, improve performance and add introductions
" Mingzhi Li 2007-12-7 22:16:41 CST Version 1.0
" Initial version
"
" Known Limited:
" This indent file can not work well, when you break the long line into
" multi-line manually, such as:
" always @(posedge a or posedge b
" or posedge c ) begin
" //...
" end
" Recommend to use the coding style(wraped by vim automatically) as following:
" always @(posedge a or posedge b or posedge c ) begin
" //...
" end
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal indentexpr=GetVerilog_SystemVerilogIndent()
setlocal indentkeys=!^F,o,O,0),0},0{,=begin,=end,=fork,=join,=endcase,=join_any,=join_none
setlocal indentkeys+==endmodule,=endfunction,=endtask,=endspecify
setlocal indentkeys+==endclass,=endpackage,=endsequence,=endclocking
setlocal indentkeys+==endinterface,=endgroup,=endprogram,=endproperty
setlocal indentkeys+==`else,=`endif
" Only define the function once.
if exists("*GetVerilog_SystemVerilogIndent")
finish
endif
set cpo-=C
function s:comment_ind(lnum)
let line = getline(a:lnum)
if line =~ '^\s*\/\/'
return -1
endif
let firstPos = match(line,'\S') + 1
if firstPos == 0
return -1
endif
let endPos = match(line,'\s*$')
let flag1 = 0
let flag2 = 0
if (synIDattr(synID(a:lnum, firstPos, 1), "name") =~? '\(Comment\|String\)$')
let flag1 = 1
endif
if (synIDattr(synID(a:lnum, endPos, 1), "name") =~? '\(Comment\|String\)$' )
let flag2 = 1
endif
if ((1 == flag1)&&(1 == flag2))
let firstPos = match(line,'\*\/') + 2
if (synIDattr(synID(a:lnum, firstPos, 1), "name") =~? '\(Comment\|String\)$')
return -1
else
return 3
endif
endif
if (1 == flag1)
return 1
endif
if (1 == flag2)
return 0
endif
return 2
endfunction
function s:prevnonblanknoncomment(lnum)
let lnum = prevnonblank(a:lnum)
while lnum > 0
if (-1 != s:comment_ind(lnum))
break
endif
let lnum = prevnonblank(lnum - 1)
endwhile
return lnum
endfunction
function s:removecommment(line,comment_ind)
if (a:comment_ind == 2)
return a:line
endif
if (a:comment_ind == -1)
return ""
endif
if (a:comment_ind == 1)
return substitute(a:line,'^.\{-}\*\/',"","")
endif
let myline01 = a:line;
if (a:comment_ind == 3)
let myline01 = substitute(myline01,'^.\{-}\*\/',"","")
endif
let myline01 = substitute(myline01,'\/\*.*$',"","")
return substitute(myline01,'\/\/.*$',"","")
endfunction
function GetVerilog_SystemVerilogIndent()
if exists('b:verilog_indent_width')
let offset = b:verilog_indent_width
else
let offset = &sw
endif
" Find a non-blank and valid line above the current line.
let lnum = s:prevnonblanknoncomment(v:lnum - 1)
" At the start of the file use zero indent.
if lnum == 0
return 0
endif
let ind = indent(lnum)
let curr_line_ind = s:comment_ind(v:lnum)
"if curr_line_ind == -1
" return ind
"endif
let curr_line = s:removecommment(getline(v:lnum),curr_line_ind)
let curr_line2 = substitute(curr_line,'^\s*','','')
let match_result = matchstr(curr_line2,'^\<\(end\|else\|end\(case\|task\|function\|clocking\|interface\|module\|class\|specify\|package\|sequence\|group\|property\)\|join\|join_any\|join_none\)\>\|^}\|`endif\|`else')
if len(match_result) > 0
if match_result =~ '\<end\>'
let match_start = '\<begin\>'
let match_mid = ''
let match_end = '\<end\>'
elseif match_result =~ '\<else\>'
let last_line_ind = s:comment_ind(lnum)
let last_line = s:removecommment(getline(lnum),last_line_ind)
if last_line =~ '^\s*end\|^\s*}'
return indent(lnum)
else
let match_start = '\<if\>'
let match_mid = ''
let match_end = '\<else\>'
endif
elseif match_result =~ 'join'
let match_start = '\<fork\>'
let match_mid = ''
let match_end = '\<\(join\|join_none\|join_any\)\>'
elseif match_result =~ '}'
let match_start = '{'
let match_mid = ''
let match_end = '}'
elseif match_result =~ '`else'
let match_start = '`if'
let match_mid = ''
let match_end = '`else'
elseif match_result =~ '`endif'
let match_start = '`if'
let match_mid = '`else'
let match_end = '`endif'
else
let match_start = substitute(match_result,'^end','','')
let match_start = '\<' . match_start . '\>'
let match_mid = ''
let match_end = '\<' . match_result. '\>'
endif
call cursor(v:lnum,1)
let match_line = searchpair(match_start,match_mid,match_end,'bW',
\" synIDattr(synID(line('.'),col('.'),1),'name')"
\. "=~? '\\(Comment\\|String\\)$'")
if match_line > 0
return indent(match_line)
endif
endif
let last_line_ind = s:comment_ind(lnum)
let last_line = s:removecommment(getline(lnum),last_line_ind)
let indent0 = 0
let indent1 = 0
let indent2 = 0
let de_indent0 = 0
let pat0 = '[{(]\s*$'
let pat1 = '\<\(begin\|fork\)\>\s*\(:\s*\w\+\s*\)\=\s*$'
let pat2 = '`\@<!\<\(if\|else\)\>'
let pat3 = '\<\(always\|initial\|for\|foreach\|always_comb\|always_ff\|always_latch\|final\|repeat\|while\|constraint\|do\)\>'
let pat5 = '\<\(case\%[[zx]]\|task\|function\|class\|interface\|clocking\|randcase\|package\|specify\)\>'
let pat6 = '^\s*\(\w\+\s*:\)\=\s*\<covergroup\>'
let pat7 = '^\s*\<\(begin\|fork\)\>\s*\(:\s*\w\+\s*\)\='
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if last_line =~ pat0 || last_line =~ pat1
let indent0 = 1
endif
" Indent after if/else/for/case/always/initial/specify/fork blocks
if (last_line =~ pat2 || last_line =~ pat3 || last_line =~ ':\s*$') && (last_line !~ ';\s*$')
let indent1 = 1
elseif last_line =~ pat5 || last_line =~ pat6
let indent2 = 1
elseif last_line =~ '^\s*`\<\(ifdef\|else\|ifndef\)\>'
return ind + offset
endif
let sum1 = indent0 + indent1 + indent2
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if (curr_line =~ pat7 || curr_line =~ '^\s*{')
let de_indent0 = 1
endif
if (sum1 == 0) && (last_line !~ '^\s*end\|\<begin\>') &&
\ (curr_line =~ ')\s*;\s*$') &&
\ (last_line =~ ',\s*$' || last_line =~ '\w\s*$\|]\s*$\|)\s*$')
return ind - offset
endif
let sum2 = de_indent0
if indent0 + indent1 + sum2 == 0
let lnum2 = s:prevnonblanknoncomment(lnum - 1)
let last_line2_ind = s:comment_ind(lnum2)
let last_line2 = s:removecommment(getline(lnum2),last_line2_ind)
if ((last_line2 !~ pat0 && last_line2 !~ pat1) &&
\ (last_line2 =~ pat2 || last_line2 =~ pat3 || last_line2 =~ ':\s*$') &&
\ (last_line =~ ';\s*$'))
return indent(lnum2)
endif
endif
" Return the indention
if (indent0 == 0 && indent1 == 1 && de_indent0 == 1)
return ind
elseif sum1 > 0
return ind + offset
elseif sum2 > 0
return ind - offset
else
return ind
endif
endfunction
" vim:sw=2
"***********************Verilg & SystemVerilog Configure Ends*******************
"********************************************************************************
"Mark Sets
"********************************************************************************
let mapleader = "."
"***********************Mark Sets End*******************************************
"********************************************************************************
"Personal configuration is End
"********************************************************************************
" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif
- linux下vim的安装与配置(centos)
1.vim的安装 #yum search vim //查看vim相关软件信息 #yum install -y vim* //在线安装vim 2.vim的配置 (1)~/.viminfo 在vim ...
- ubuntu16.04下vim的安装与配置
一.安装vim 使用命令 $ sudo apt-get install vim 来安装vim,安装后的vim需要进行一些配置,不然使用起来会有些不方便,比如不会自动缩进. 二.配置vim 使用命令 ...
- Ubuntu下VIM的安装及其配置——Linux篇
一.Ubuntu系统默认内置: 实际上ubuntu默认没有安装老版本的vi,只装了vim.vi是vim.tiny(vim的最小化版本,不含 GUI,并且仅含有一小部分功能,并且默认与vi兼容.此软件包 ...
- Linux下vim的安装及配置
目录 一.vim的下载 二.vim的基本知识 三.vim的基本配置 四.vim与外部文件的复制粘贴 一.vim的下载 Ubuntu系统,输入命令: sudo apt install vim Cento ...
- CentOS 6.5 下HeartBeat的安装与配置
CentOS 6.5 下HeartBeat的安装与配置 参考网站: http://wenku.baidu.com/link?url=BvqJatdx1m12PLil-7YA1zkM0yUOEO8OnN ...
- linux下svn的安装与配置
---恢复内容开始--- linux下svn的安装与配置 Linux发行版本:CentOS6.5 1.安装subversion sudo yum -y install subversion 2.创建s ...
- nginx在Centos7.5下源码安装和配置
安装nginx 安装nginx依赖包 yum install -y pcre-devel zlib-devel openssl-devel wget gcc tree vim 进入目录/root/se ...
- Centos7 下的SVN安装与配置
Centos7 下的SVN安装与配置 1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临 ...
- linux下redis的安装及配置启动
linux下redis的安装及配置启动 标签: redisnosql 2014-10-24 14:04 19732人阅读 评论(0) 收藏 举报 分类: 数据与性能(41) wget http:/ ...
随机推荐
- java 操作redis
使用Java操作Redis需要jedis-2.1.0.jar,如果需要使用Redis连接池的话,还需commons-pool-1.5.4.jar package com.test; import ja ...
- 老oj1965:polygon半平面交
题目链接:http://192.168.2.240:8080/JudgeOnline/showproblem?problem_id=1965 polygon半平面交 Time Limit:1000MS ...
- 浙大pat 1059 题解
1059. Prime Factors (25) 时间限制 50 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 HE, Qinming Given ...
- 转Rollback后undo到底做了些什么?
转自:http://biancheng.dnbcw.info/oracle/309191.html Rollback后undo到底做了些什么? 从概念上讲,undo正好与redo相对.当你对数据执行修 ...
- IE6下的bug
一.IE6双倍边距bug 当页面上的元素使用float浮动时,不管是向左还是向右浮动:只要该元素带有margin像素都会使该值乘以2,例如“margin-left:10px” 在IE6中,该值就会被解 ...
- NOIP2005-普及组复赛-第一题-陶陶摘苹果
题目描述 Description 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个30厘米高的板凳,当她不能直接用手摘到苹果的时候,就会踩到板凳 ...
- Sublime Text学习笔记
1.快捷键(Key Bindings) Preferences -> Key Bindings ->Default 会打开一个配置文件,里面全是配置信息 2.代码片段(Snippe ...
- Xcode8中添加SnapKit框架报错,编译失败
既然SnapKit的作者说SnapKit已经支持Swift3.0了,那么我们就先来适配SnapKit,首先用Xcode8新建一个空项目,利用Cocoapods导入SnapKit. Podfile 打 ...
- 一把刀终极配置 For XP v2.0 免费绿色版
软件名称: 一把刀终极配置 For XP 软件语言: 简体中文 授权方式: 免费软件 运行环境: WinXP 软件大小: 924KB 图片预览: 软件简介: 一把刀终极配置 For XP,用于快速方便 ...
- javascript动画效果之匀速运动(修订版)
在编写多块同时触发运动的时候,发现一个BUG, timer = setInterval(show, 30);本来show是一个自定义函数,当设为timer = setInterval(show(one ...