"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Linux vim config (/etc/vimrc)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use Vim defaults (much better!)
" This should the priority setting, otherwise problems can appear
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 编码设置
" fileformats(ffs)(vim才有)可指定多个,会依载入的档案形式来调整ff。
" 例如:set ffs=unix, dos ff=unix则预设为unix格式,但如读入的是dos格式的
" 档案,会自动调整为dos格式,这样存档时就会以dos格式存档。设置即为:
" set fileformats=unix
" set fileformat=unix并不会依据载入的档案形式来调整ff,并且只用unix形式
" 所以,可以解决windows下的^M问题。
" :set ff 可以查看当前文件fileformat
" :set ffs 查看vim设置
" 其实fileformats可以这样调整
" set fileformats=unix,dos 这样也应该是可以解决^M问题的,让vim自动
" 去选择是用dos,还是unix的,这应该是vim的默认设置,
" 当然也可以选择全局替换:%s/^M//g
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set fileencodings=utf-8,gb2312,gbk,gb18030
set termencoding=utf-8
set fileformat=unix
"set fileformats=unix
set encoding=prc
set bs=indent,eol,start " allow backspacing over everything in insert mode
set ai " always set autoindenting on
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
" than 50 lines of registers
" 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/*,/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 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
if &term=="xterm"
set t_Co=8
set t_Sb=[4%dm
set t_Sf=[3%dm
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 检测文件类型
" 载入文件类型插件
" 为特定文件类型载入相关缩进文件
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype on
filetype plugin on
filetype indent on
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" GUI config
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set ruler " show the cursor position all the time
set shortmess=atl " 启动的时候不显示援助索马里儿童的提示
set scrolloff=3 " 光标移动到buffer的顶部和底部时保持3行距离
" Don't wake up system with blinking cursor:
let &guicursor = &guicursor . ",a:blinkon0"
set history=50 " keep 50 lines of command line history
set number " 显示行号
set nobackup " no backup file
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 缩进
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set tabstop=4 " 设定 tab 长度为4
set shiftwidth=4 " 缩进的空格数
set expandtab " 是否在缩进和遇到Tab键时使用空格代替;使用noexpandtab取消设置
set autoindent " 自动缩进
set smartindent
set cindent " Automatically adjust the indented length
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" python config
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 自动补全
" 配置说明
" 1. 下载pydiction, pydiction中包括了complete-dict和python_pydiction.vim
" 2. cp complete-dict to /home/tony/.vim/dict/pydiction/
" cp python_pydiction to /home/tony/.vim/plugin/
" 3. $ sudo vim /etc/vimrc
" add:
" filetype plugin on
" let g:pydiction_location = '/home/tony/.vim/dict/pydiction/complete-dict'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 快捷键说明
" 需要补全到时候,按住tab键,便可以看到补全的内容
" 然后通过ctrl-n, ctrl-p可以上下选择
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype plugin on
let g:pydiction_location = '/home/tony/.vim/dict/pydiction/complete-dict'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Tag list(ctags)
" 配置说明
" 1. 安装ctags,正常yum中都会有提供
" 2. 下载taglist, 解压缩, 里面有doc/taglist.txt和plugin/taglist.vim
" 3. cp taglist.vim to ~/.vim/plugin/
" cp taglist.txt to ~/.vim/doc/taglist.txt
" 4. 使用ctags
" $ cd ~/workspace/ProjectForge/ 此为源码到根目录
" $ ctags -R 此时目录里面就生成了一个tags文件
" $ vim ~/workspace/ProjectForge/filename.java 打开一个文件
" 在vim中运行命令:
" :set tags=/home/tony/workspace/ProjectForge/tags 该命令将tags文件加入到
" vim中来,也可以将这句话放到~/.vimrc中去,如果经常在这个工程编程的话
"
" 光标在源码出:
" Ctrl + ] 会跳转到方法那
" Ctrl + t 又跳回到函数被调用的地方
" 5. 使用taglist
" 进入Vim后用下面的命令打开taglist窗口
" :Tlist
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Ctags_Cmd='/usr/bin/ctags' " 设定系统中ctags程序到位置
let Tlist_Show_One_file=1 " 不同时显示多个的tag,只显示当前文件的
let Tlist_Exit_OnlyWindow=1 " 如果taglist窗口是最后一个窗口,则推出vim
"在右侧显示总是有点问题,那就默认显示在左侧,就很实用了。
"let Tlist_Use_Right_Window=1 " 在右侧窗口中显示taglist窗口
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" winmanager config
" 配置说明:
" 1. 下载winmanager, 解压缩
" 2. 操作同taglist类似
" let g:winManagerWindowLayout='TagList|FileExplorer' 显示顺序,TagList在上,FileExplorer在下
" let g:winManagerWidth=30 30像素的宽度
" nmap wm :WMToggle 自定义快捷键
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:winManagerWindowLayout='TagList|FileExplorer'
let g:winManagerWidth=30
nmap wm :WMToggle
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
分享到:
相关推荐
vim配置文件,可以直接使用,ubuntu在/etc/vim/vimrc
vim 是和很好的编辑工具,通过简单的配置,可以很好的适应C/C++ 的编码习惯,只需将 该配置文件 替换到 linux 跟目录下 :/etc/vimrc 替换成该文件即可,很好用的,完全个人实践,,,
Linux下开发工具Vim,轻量级,反应迅速。对于熟练的编程人员,如虎添翼。支持自动补全,代码跳转,文件浏览器,函数列表,文件和Buffer快速查找,必不可少的神器
vim编译器好用, 使用, 最为经典的配置文件
自己linux下的vim配置,作为保存记录
这是我在LINUX下的VIM配置文件和对应的一些插件,用于C,JAVA,HTML还是不错, 欢迎下载试用改造。 其中vimrc放在/etc下,.vimrc,.vim是家目录 vim-addon也放在家目录
linux下vim 的配置文件.先下载vundle.vim
集成了vim常用插件,Ctags Tlist winmanager Grep SuperTab,可实现文件浏览器、函数跳转、成员列表等快捷功能,并专门针对PHP开发加强了自动补全功能(使用tab键即可)
linux vim配置以及插件 linux vim配置以及插件
vim配置信息,包括了: 1. 基础配置; 2. 树状结构 3. 自动补全功能 4. 生成文件头 5. 折叠设置
vim 插件
适合于linux内核开发的vim配置,直接到home就可以啦。
此文档为Linux下vim的配置文档,包括高亮,行数显示,gvim等插件,直接解压到Linux用户home目录下,重新登录即可使用。
linux,ubuntu中vim配置包。linux若要使用vim,需要先安装vim包。
vim ctags cscope 配置
Linux下的vim配置和插件管理 怎么让你的VIM变得更强大
配置 vim快捷键,方便vim进行开放,文本处理,删除、添加、替换、粘贴,彻底告别鼠标
vim下常用快捷键使用技巧,基本配置设置,gvim设置,编辑技巧和配置文件设置
自己做的,虚拟机下linux操作系统,将vim改善为IDE,有具体步骤的