vimrc文件

if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
   set fileencodings=ucs-bom,utf-8,latin1
endif

set nocompatible    " Use Vim defaults (much better!)
set bs=indent,eol,start        " allow backspacing over everything in insert mode
"set ai            " always set autoindenting on
"set backup        " keep a backup file
set viminfo=‘20,\"50    " read/write a .viminfo file, don‘t store more
            " than 50 lines of registers
set history=50        " keep 50 lines of command line history
set ruler        " show the cursor position all the time

" Only do this part when compiled with support for autocommands
if has("autocmd")
  augroup redhat
  autocmd!
  " In text files, always limit the width of text to 78 characters
  " autocmd BufRead *.txt set tw=78
  " When editing a file, always jump to the last cursor position
  autocmd BufReadPost *
  \ if line("‘\"") > 0 && line ("‘\"") <= line("$") |
  \   exe "normal! g‘\"" |
  \ endif
  " don‘t write swapfile on most commonly used directories for NFS mounts or USB sticks
  autocmd BufNewFile,BufReadPre /media/*,/run/media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
  " start with spec file template
  autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
  augroup END
endif

if has("cscope") && filereadable("/usr/bin/cscope")
   set csprg=/usr/bin/cscope
   set csto=0
   set cst
   set nocsverb
   " add any database in current directory
   if filereadable("cscope.out")
      cs add $PWD/cscope.out
   " else add database pointed to by environment
   elseif $CSCOPE_DB != ""
      cs add $CSCOPE_DB
   endif
   set csverb
endif

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endif

filetype plugin on

if &term=="xterm"
     set t_Co=8
     set t_Sb=[4%dm
     set t_Sf=[3%dm
endif

" Don‘t wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0"
set go=
"color desert
"set background=light
colorscheme molokai
syntax on
set number
set ts=4
set softtabstop=4
set autoindent

set nocompatible
filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin ‘gmarik/Vundle.vim‘
Bundle "scrooloose/nerdtree"
Bundle ‘Valloric/YouCompleteMe‘
Bundle ‘tpope/vim-rails‘
Bundle "tomasr/molokai"
Bundle "Lokaltog/vim-powerline"

call vundle#end()
filetype plugin indent on

“NERDTree
nmap <F5> :NERDTreeToggle<cr>

"outo input the auther
"input F4 to add
map <F4> ms:call AddAuthor()<cr>‘s

"AddAuthor()
function AddAuthor()
        let n=1
        while n < 5
                let line = getline(n)
                if line =~‘^\s*\*\s*\S*Last\s*modified\s*:\s*\S*.*$‘
                        call UpdateTitle()
                        return
                endif
                let n = n + 1
        endwhile
        call AddTitle()
endfunction

"UpdateTitle()
function UpdateTitle()
        normal m‘
        execute ‘/* Last modified\s*:/[email protected]:.*[email protected]\=strftime(": %Y-%m-%d %H:%M")@‘
        normal "
        normal mk
        execute ‘/* Filename\s*:/[email protected]:.*[email protected]\=": ".expand("%:t")@‘
        execute "noh"
        normal ‘k
        echohl WarningMsg | echo "Successful in updating the copy right." | echohl None
endfunction

"AddTitle()
function AddTitle()
        call append(0,"/**********************************************************")
        call append(1," * Author        : Trainee")
        call append(2," * Email         : You kown")
        call append(3," * Last modified : ".strftime("%Y-%m-%d %H:%M"))
        call append(4," * Filename      : ".expand("%:t"))
        call append(5," * Description   : ")
        call append(6," * *******************************************************/")
        echohl WarningMsg | echo "Successful in adding the copyright." | echohl None
endfunction
时间: 2024-10-11 22:40:31

vimrc文件的相关文章

vim 配置.vimrc文件

下面这个.vimrc文件是根据公司里的一个前辈配置的,这里记录下,方便以后使用.它的功能,其实跟网上很多.vimrc配置的相比,还是小儿科.我记录下来,主要还是因为自己已经习惯了这个工作环境跟快捷键. """""""""""""""""""""""""&quo

vim的.vimrc文件设置

set nocompatibleset autowriteset autoreadset nobackupset noswapfile " --- syntax and indent ---syntax onset tabstop=4set softtabstop=4set shiftwidth=4set autoindentset smartindentset cindentset expandtabset nolinebreakset showmatchset wrap" ---e

Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决

在终端下使用vim进行编辑时,默认情况下,编辑的界面上是没有显示行号.语法高亮度显示.智能缩进 等功能的.为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc.在启动vim时,当前用户根目录下的.vimrc文件会被自动读取,该文件可以包含一些设置甚至脚本, 所以,一般情况下把.vimrc文件创建在当前用户的根目录下比较方便,即创建的命令为:$vi ~/.vimrc #支持putty鼠标粘贴 if has('mouse') set mouse -= a endif 设置完后$:x 

我的vimrc文件

vim的一直被称为神器,确实有很多优点,但是vim到一键编译实在是一个大问题,网络上有很多配置文件,但是大多都是同一份文件到复制粘贴,不太好用. 经过这么长时间到摸索,我终于在自己到电脑上配置好了vim,下面粘贴一下我到vimrc文件. " This line should not be removed as it ensures that various options are " properly set to work with the Vim-related packages

Linux下的.vimrc文件

因为各种原因,经常需要对vim编辑环境进行设置,但总是忘记具体命令,记下来,方便以后使用,也希望可以帮助到其他刚入门的朋友. 首先,默认的Vim的配置目录在 /etc/vim目录下.在root用户根目录下用命令 vim /etc/vim/vimrc即可打开vimrc文件进行编辑.如没有,可自己创建一个,一般都有. 然后,根据个人需要进行设置. 以下列出了一些经常用到的设置: **双引号开始的行为注释行 **set nocompatible       去掉有关vi一致性模式,避免以前版本的一些b

.vimrc文件配置及航意

1.  vimrc文件常见语句释义 设定 tab 的位置          :set tabstop=4 输入 tab 时自动将其转化为空格          :set expandtab          如果此时需要输入真正的 tab,则输入 Ctrl+V, tab,在 Windows 下是 Ctrl+Q, tab 将已存在的 tab 都转化为空格          :retab 设定编辑模式下 tab 的视在宽度         :set softtabstop         这不改变

个人vim配置(.vimrc文件分享)

syntax enable syntax on colorscheme desert set nu! set nowrap set nobackup set backspace=2 set tabstop=4 set encoding=utf-8 set linebreak set ruler set guioptions+=b filetype plugin indent on set guifont=Monospace\ 12 "在终端窗口运行vim的话,终端对字体的设置高于vim本身对字体

编辑vimrc文件需要安装bundle插件问题

版本信息:uname -aLinux localhost.localdomain 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linuxcat /etc/issueRed Hat Enterprise Linux Server release 6.1 (Santiago)Kernel \r on an \m 在网上找了一些~/.vimrc文件,写入~/.vimrc文

vimrc文件配置的全文收录(史上最全,附带中文解释)

一.vi与vim的不同vi类似于windows的记事本,比较适合编辑普通文本,但是用于编写脚本代码就不太合适了,缺少高亮显示代码.自动缩进等重要功能:而vim类似于windows下的高级编辑器,为了提高开发效率,需要使用vim而不是vi.因此,首先做如下调整,以便只使用vim作为开发脚本的功能工具: [[email protected] ~]# echo 'alias vi=vim' >> /etc/profile[[email protected] ~]# tail -1 /etc/prof

.vimrc文件配置

map <F9> :call SaveInputData()<CR> func! SaveInputData() exec "tabnew" exec 'normal "+gP' exec "w! /tmp/input_data" endfunc "colorscheme torte "colorscheme murphy "colorscheme desert "colorscheme de