vimrc 配置

vim编辑器如若需要很好的使用,则必须配置好vimrc文件,如下为个人最近配置,包含基本的命令,ctag,映射等

 1 set nocompatible

  2 "source $VIMRUNTIME/mswin.vim
  3 "set guifont=Courier:h10
  4 "source ~/.vim/indent/verilog.vim
  5 set guifont=Andale\ Mono\ 16
  6 set number
  7 "set ffs=dos
  8 "set lines=42
  9 "set tabstop=4
 10 "set shiftwidth=4
 11 set tabstop=4 shiftwidth=4 expandtab
 12 "display file path in bottom
 13 set ls=2
 14 "set smartindent
 15 "
 16 "show the full path of the current editing file
 17 set statusline+=%F
 18 "use file type plugin indent, it will work for verilog
 19 filetype plugin indent on
 20 set noswf
 21 hi linenr guifg=blue
 22 set ic
 23 "use a nicer color scheme
 24 color desert
 25 "incremental search
 26 set is
 27 syn on
 28 set hlsearch
 29 set nu
 30 "map <F5> :e!<CR>G:/error\\|warning<CR>G
 31 "map <F6> :e!<CR>G:sleep 1<CR><F6>
 32  "automatically set current path be the current file path
 33 "au BufEnter * silent! lcd expand("%:p:h")
 34 set autochdir
 35
 36 " gV: donnot automatically reselct one area after command is executed
 37 "map <C-R> :!comment.bat<CR>gV<CR>
 38 "map <C-T> :!uncomment.bat<CR>gV<CR>
 39 "use three slash plus space for space in file
 40
 41 "artis01 setting
 42 set tags=./tags,../tags,../../tags,../../../tags,../../../../tags,/home/panqs/s60-repo-bare/tags
 43 "map <F9> :cd /home/panqs/trunk/source/bin\|make -j8<cr>
 44 "map <F5> yiw:cd /home/panqs/trunk\|L <c-r>0
 45 "map <F6> yiw:cd /home/panqs/trunk/\|G <c-r>0
 46 set path=./,/home/panqs/s60-repo-bare/source/include
 47
 48
 49 "comment out block of lines using //
 50 "<Esc> out of select mode
 51
 52 "comment for C++
 53 "au BufEnter *.cpp vmap <F7> :g/^/s//\/\//g<CR>gV<Esc>:noh<CR>
 54 "comment for Perl
 55 "au BufEnter *.pl vmap <F7> :g/^/s//\#/g<CR>gV<Esc>:noh<CR>
 56 "comment for tex
 57 "au BufEnter *.tex vmap <F7> :g/^/s//%/g<CR>gV<Esc>:noh<CR>
 58 "uncomment out block of lines
 59 au BufEnter *.cpp vmap <F8> :g/^/s/\s\=\/\///g<CR>gV<Esc>:noh<CR>
 60 au BufEnter *.pl vmap <F8> :g/^/s/\s\=\#//g<CR>gV<Esc>:noh<CR>
 61 "au BufEnter *.tex vmap <F8> :g/^/s/\s\=%//g<CR>gV<Esc>:noh<CR>
  62 "
 63 "use F9 to trigger build
 64
 65 map <F7> :copen <CR>
 66 "map <F5> yiw:cd ~/artis01doc/fpga_dev\|L <c-r>0
 67 "map <F6> yiw:cd ~/artis01doc/fpga_dev/fpga\|G <c-r>0
 68 "map <F5> yiw:cd ~/pj1304code\|L <c-r>0
 69 "map <F6> yiw:cd ~/pj1304code\|G <c-r>0
 70 map <F3> :let @"=expand("%:p")<CR>
 71 vnoremap <M-F8> =gV
 72 "let Grep_Key = '<F9>'
 73 "let Grep_Path = 'C:\WINNT\system32\grep.exe'
 74 "let Fgrep_Path = 'C:\WINNT\system32\fgrep.exe'
 75 "let Egrep_Path = 'C:\WINNT\system32\egrep.exe'
 76 "let Grep_Find_Path = 'c:\WINNT\system32\find.exe'
 77 "let Grep_Xargs_Path = 'c:\WINNT\system32\xargs.exe'
 78 "let Grep_Default_Options = '-i -r'
 79
 80 "inoremap \f <C-R>=Func()<CR>
 81
 82 "function! Func()
 83 "let cmd = "perl c:/gtang/test.pl " . expand("%:p")
 84 "let retValue = system(cmd)
 85 "return retValue
 86 "endfunction
 87
 88 "au BufEnter * cd %:p:h
 89
 90 au BufRead,BufNewFile *.md set syntax=markdown
 91
 92 "------------------ for latex------------------
 93 "REQUIRED. This makes vim invoke latex-suite when you open a tex file.
 94 filetype plugin on
 95
 96 " IMPORTANT: win32 users will need to have 'shellslash' set so that latex
 97 " can be called correctly.
 98 set shellslash
 99
100 " IMPORTANT: grep will sometimes skip displaying the file name if you
101 " search in a singe file. This will confuse latex-suite. Set your grep
102 " program to alway generate a file-name.
103 "set grepprg=grep\ -nH\ $*
104
105 " OPTIONAL: This enables automatic indentation as you type.
106 "filetype indent on
107 "------------------------------------------------ end
108 "
109
110 "hookup to git grep
111 func GitGrep(...)
112     let save = &grepprg
113     set grepprg=git\ grep\ -n\ $*
114     let s = 'grep'
115     for i in a:000
116     let s = s . ' ' . i
117     endfor
118     exe s
119     let &grepprg = save
120     endfun
121 command -nargs=? G call GitGrep(<f-args>)
122
123 func Gitls(...)
124   let save = &grepprg
125   set grepprg=gitls\ $*
126   let s = 'grep'
127   for i in a:000
128     let s = s . ' ' . i
129   endfor
130   exe s
131   let &grepprg = save
132 endfun
133 command -nargs=? L call Gitls(<f-args>)
134
135
136 "try to display sonoscape code which is commented in cp936 encoding
137 let &fileencodings = substitute(&fileencodings, 'latin1', 'cp936,\0', '')
138
139
140 "enable me to go through windows using tab key
141 nmap <tab> <c-w>w
142 nmap <S-tab> <c-w>W
143 "set cursorline cursorcolumn
144 "
145
146 "this will let the process keep on running
147 let g:ConqueTerm_ReadUnfocused = 1
148
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
根据引用,在CSDN博客上有一篇文章提供了一个接地气版的Linux .vimrc配置文件,可以直接使用,你可以参考这篇文章了解更多相关说明。同时根据引用,.vimrc文件是用来配置vim编辑器功能开关的配置文件,分为系统配置和用户配置两种。系统配置文件存放在vim的安装路径内,而用户配置文件.vimrc则由用户自己创建,存放在用户根目录下。根据引用,用户配置文件.vimrc中的配置内容可以根据个人需求进行设置,如颜色主题、语法高亮、自动缩进等。如果你想在Linux上配置vimrc,你可以参考CSDN博客中的这篇文章。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [【vimrc_linux】](https://download.csdn.net/download/neptuneys/11239215)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [04 .vimrc文件配置](https://blog.csdn.net/qq_43244515/article/details/124779889)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值