vim配置信息 vimrc

vimrc文件是vim的环境设置文件。

整体的vim的设置是在 /etc/vimrc 文件中。

不建议修改/etc/vimrc 文件,每个用户可以在用户根目录中设置vim,新建 ~/.vimrc.

我的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
filetype plugin indent on  (更符合python语法,遇关键字会自动缩进)

if &term=="xterm"
     set t_Co=8
     set t_Sb=m
     set t_Sf=m
endif

" Don‘t wake up system with blinking cursor:
" http://www.linuxpowertop.org/known.php
let &guicursor = &guicursor . ",a:blinkon0"
时间: 2024-08-02 15:10:19

vim配置信息 vimrc的相关文章

【vim配置】.vimrc

set nocompatible set enc=utf-8 "-show line number "set number "-enable filetype plugin filetype plugin on set history=500 syntax on set autoindent set smartindent "-show brackets match set showmatch "-show status set ruler "-

vim 配置

1 此vim配置有以下优点: 2 3 1,按F5可以直接编译并执行C.C++.java代码以及执行shell脚本,按“F8”可进行C.C++代码的调试 4 2,自动插入文件头 ,新建C.C++源文件时自动插入表头:包括文件名.作者.联系方式.建立时间等,读者可根据需求自行更改 5 3,映射“Ctrl + A”为全选并复制快捷键,方便复制代码 6 4,按“F2”可以直接消除代码中的空行 7 5,“F3”可列出当前目录文件,打开树状文件目录 8 6,支持鼠标选择.方向键移动 9 7,代码高亮,自动缩

Linux 的vim 配置

一.vim介绍 Vim是一个类似于Vi的著名的功能强大.高度可定制的文本编辑器,在Vi的基础上改进和增加了很多特性.VIM是纯粹的自由软件. vim常用的三种命令模式: 1.命令模式(command mode) 输入 vim test.c 会直接进入命令行模式,输入i,进入插入模式. 2.插入模式(Insert mode) 按ESC,进入命令行模式 : w (保存当前文件) : wq (保存并退出vim) : q! (强制退出vim) 3.底行模式(last line mode) 二.vim配置

vim 配置备忘录

一.配置平台 系统:xubuntu  14.04.1  32位 vim:vim  7.4 插件管理:用vundle进行插件管理 适用范围:主要用来C编程 二.预备工作 1.安装vim-syntax-gtk(高亮显示) $ sudo apt-get install vim-syntax-gtk 2.安装vundle(插件管理) GitHub地址:https://github.com/gmarik/Vundle.vim $ git clone https://github.com/gmarik/Vu

Mac 下VIM配置

Mac下VIM配置 首先,我们去这里下载MacVim,也可用这个网址:(http://code.google.com/p/macvim/),进入后的界面如下: _______________________________________________________________________ Download Download MacVim 7.3 (snapshot 65) for OS X 10.8 (Mountain Lion). (Released September 1, 2

快速学习C语言三: 开发环境, VIM配置, TCP基础,Linux开发基础,Socket开发基础

上次学了一些C开发相关的工具,这次再配置一下VIM,让开发过程更爽一些. 另外再学一些linux下网络开发的基础,好多人学C也是为了做网络开发. 开发环境 首先得有个Linux环境,有时候家里机器是Windows,装虚拟机也麻烦,所以还不如30块钱 买个腾讯云,用putty远程练上去写代码呢. 我一直都是putty+VIM在Linux下开发代码,好几年了,只要把putty和VIM配置好,其实 开发效率挺高的. 买好腾讯云后,装个Centos,会分配个外网IP,然后买个域名,在DNSPod解析过去

vim配置及插件安装管理(超级详细)

vim配置及插件安装管理(超级详细) 分类: Linux 相关2012-07-26 09:34 97079人阅读 评论(18) 收藏 举报 vimsearchbuffertags浏览器microsoft 1 写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用的IDE是何等的重要啊, 估计很多人就是卡在这个门槛上了, "工欲善其事, 必先利其器"

vim配置及插件安装管理(超级详细)[转]

1 写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用的IDE是何等的重要啊, 估计很多人就是卡在这个门槛上了, "工欲善其事, 必先利其器"嘛, 我想如果有一个很好用的IDE, 那些Linux牛人也会欢迎的. 这都是劳动人民的美好愿望罢了, 我今天教大家把gvim改装成一个简易IDE, 说它"简易"是界面上看起来&quo

vim配置及插件安装管理

写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用的IDE是何等的重要啊, 估计很多人就是卡在这个门槛上了, "工欲善其事, 必先利其器"嘛, 我想如果有一个很好用的IDE, 那些Linux牛人也会欢迎的. 这都是劳动人民的美好愿望罢了, 我今天教大家把gvim改装成一个简易IDE, 说它"简易"是界面上看起来"