最近大病一场,还是身体最重要啊!
几周没写文章了,实在是太懒了。今天把自己的vimrc贴出来,希望对大家有所启发。
我的vimrc也是在别人的基础上进行了自己的修改。对vimrc,是不能直接拷贝使用的,不然会有严重的不适。所以还是自己理解了之后,再形成自己的vimrc较好。
此vimrc是用在windows上的,如果在linux上使用,把MySys()的返回值改为"linux"。
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" This vimrc is based on the vimrc by Amix, URL:
" http://www.amix.dk/vim/vimrc.html
" Maintainer: Easwy
" Version: 0.1
" Last Change: 31/05/07 09:17:57
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Get out of VI's compatible mode..
set nocompatible
" Platform
function! MySys()
return "windows"
endfunction
"Sets how many lines of history VIM har to remember
set history=400
" Chinese
if MySys() == "windows"
set encoding=utf-8
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set fileencodings=ucs-bom,utf-8,gb18030,cp936,big5,euc-jp,euc-kr,latin1
endif
"Enable filetype plugin
filetype plugin on
filetype indent on
"Set to auto read when a file is changed from the outside
set autoread
"Have the mouse enabled all the time:
set mouse=a
"Set mapleader
let mapleader = ","
let g:mapleader = ","
"Fast saving
nmap <silent> <leader>ww :w<cr>
nmap <silent> <leader>wf :w!<cr>
"Fast quiting
nmap <silent> <leader>qw :wq<cr>
nmap <silent> <leader>qf :q!<cr>
nmap <silent> <leader>qq :q<cr>
nmap <silent> <leader>qa :qa<cr>
"Fast remove highlight search
nmap <silent> <leader><cr> :noh<cr>
"Fast redraw
nmap <silent> <leader>rr :redraw!<cr>
" Switch to buffer according to file name
function! SwitchToBuf(filename)
"let fullfn = substitute(a:filename, "^\\~/", $HOME . "/", "")
" find in current tab
let bufwinnr = bufwinnr(a:filename)
if bufwinnr != -1
exec bufwinnr . "wincmd w"
return
else
" find in each tab
tabfirst
let tab = 1
while tab <= tabpagenr("$")
let bufwinnr = bufwinnr(a:filename)
if bufwinnr != -1
exec "normal " . tab . "gt"
exec bufwinnr . "wincmd w"
return
endif
tabnext
let tab = tab + 1
endwhile
" not exist, new tab
exec "tabnew " . a:filename
endif
endfunction
"Fast edit vimrc
if MySys() == 'linux'
"Fast reloading of the .vimrc
map <silent> <leader>ss :source ~/.vimrc<cr>
"Fast editing of .vimrc
map <silent> <leader>ee :call SwitchToBuf("~/.vimrc")<cr>
"When .vimrc is edited, reload it
autocmd! bufwritepost .vimrc source ~/.vimrc
elseif MySys() == 'windows'
" Set helplang
set helplang=cn
"Fast reloading of the _vimrc
map <silent> <leader>ss :source ~/_vimrc<cr>
"Fast editing of _vimrc
map <silent> <leader>ee :call SwitchToBuf("~/_vimrc")<cr>
"When _vimrc is edited, reload it
autocmd! bufwritepost _vimrc source ~/_vimrc
endif
" For windows version
if MySys() == 'windows'
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function! MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Set font
"if MySys() == "linux"
" set gfn=Monospace\ 11
"endif
" Avoid clearing hilight definition in plugins
if !exists("g:vimrc_loaded")
"Enable syntax hl
syntax enable
" color scheme
if has("gui_running")
set guioptions-=T
set guioptions-=m
set guioptions-=L
set guioptions-=r
colorscheme darkblue_my
"hi normal guibg=#294d4a
else
colorscheme desert_my
endif " has
endif " exists(...)
"Some nice mapping to switch syntax (useful if one mixes different languages in one file)
map <leader>$ :syntax sync fromstart<cr>
autocmd BufEnter * :syntax sync fromstart
"Highlight current
"if has("gui_running")
" set cursorline
" hi cursorline guibg=#333333
" hi CursorColumn guibg=#333333
"endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Fileformats
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Favorite filetypes
set ffs=unix,dos
nmap <leader>fd :se ff=dos<cr>
nmap <leader>fu :se ff=unix<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM userinterface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Set 7 lines to the curors - when moving vertical..
"set so=7
" Maximum window when GUI running
if has("gui_running")
set lines=9999
set columns=9999
endif
"Turn on WiLd menu
set wildmenu
"Always show current position
set ruler
"The commandbar is 2 high
set cmdheight=2
"Show line number
set nu
"Do not redraw, when running macros.. lazyredraw
set lz
"Change buffer - without saving
"set hid
"Set backspace
set backspace=eol,start,indent
"Bbackspace and cursor keys wrap to
"set whichwrap+=<,>,h,l
set whichwrap+=<,>
"Ignore case when searching
"set ignorecase
"Include search
set incsearch
"Highlight search things
set hlsearch
"Set magic on
set magic
"No sound on errors.
set noerrorbells
set novisualbell
set t_vb=
"show matching bracets
"set showmatch
"How many tenths of a second to blink
"set mat=2
""""""""""""""""""""""""""""""
" Statusline
""""""""""""""""""""""""""""""
"Always hide the statusline
set laststatus=2
function! CurDir()
let curdir = substitute(getcwd(), '/home/easwy/', "~/", "g")
return curdir
endfunction
"Format the statusline
"set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c
</
分享到:
相关推荐
1、vimrc 放到vim 目录下 2、vimfiles 新建bundle目录 3、下载插件(https://github.com/gmarik/vundle)将vundle整个目录丢进bundle目录 4、下面见证奇迹的时刻到了 命令行输入:BundleInstall 回车 哦了 此配置...
我的第一个 vim 插件:vim-better-default, 说是 “插件”, 有点投机取巧的意思,其实一点技术含量也没有,只不过是为了简化我的 .vimrc 文件将一些比较通用的部分包装起来而已。
vim由一个程序员开发,并且为更多的程序员所使用,所以vim对开发人员的强大支持,也就可以理解了。quickfix模式的引入就是一个例子。quickfix模式,是一种加速你开发的工作方式,使你不必离开vim,就可以快速的完成...
用于在linux开发golang的整套vim插件包之vimrc文档设置
.vim文件夹下的目录直接拷贝到<vim安装路径>\<vim版本号>下,例如在我的电脑上,就将.vim下的所有目录拷贝至:C:\Program Files\Vim\vim73 即可。 .vimrc文件直接覆盖<vim安装目录>下的_vimrc文件,或者选取有用的...
一款 很棒的 使用命令的编辑器 支持主流的开发语言,通过安装插件可以打造成很炫的集成开发环境!
与笔者Flask开发笔记配套的,笔者所使用vimrc的文件。基于已经装有vim的扩展工具管理工具Vundle,用于安装vim其他的扩展功能。文件中为基本扩展功能命令,安装其他可按需要再自行添加。
vim-boxdraw使用Python脚本完成大部分工作。 要为此插件做出贡献,您需要 Python 2.7.x和3.5.x(我们希望在大多数平台上支持系统Python) pip install -U pytest 运行单元测试 在python目录中, pytest
一、linux-vim C开发环境主要由下列文件组成: (一)VIM插件 winmanager.vim - 提供侧边栏功能-F9打开,修改版显示到右侧 taglist.vim - 提供函数以及变量列表,整合到侧边栏 winfileexplorer.vim - 修改版:不...
vim-vue-plugin .vue文件的Vim语法和缩进插件。 主要受到mxw / vim-jsx的启发。 安装如何安装VundleVim插件'leafOfTree vim-vue-plugin Vim语法和.vue文件的缩进插件。 主要受到mxw / vim-jsx的启发。 安装如何安装...
将vim配置下linux下web开发利器!
vim-bootstrap Vim Bootstrap是生成器,提供了一种简单的方法来生成vim,NeoVim,NeoVim-Qt,MacVim和GVim的.vimrc配置。 前提条件该发行版旨在与vim-bootstrap一起使用。Vim Bootstrap生成器提供了一种为vim,...
我只是简单地修改了一些用于长生不老药开发的东西。 1. 安装运行时: git clone git@github.com:gregpardo/vim-elixir-ide.git ~/.vim_elixir_runtime sh ~/.vim_elixir_runtime/bin/install 注意:您系统的 Vim ...
vim-bootstrap:一个简单、易用的 .vimrc 配置文件生成工具,也可通过网站点选生成。支持 Vim、NeoVim、NeoVim-Qt、MacVim 和 GVim
例如,使用vim-plug将其添加到.vimrc / init.vim中:插入'doums / darcula'然后在vim中运行::source $ MYVIMRC:PlugInstall如果您使用vim package:h packages。 用法将其放在您的.vimrc / init.vim中:...
说明仓库介绍wbsmm-vimrc 不单单是我的vim配置,还包括我在linux上开发机的一些配置.在公司用ssh登录开发机写代码.所以本vim配置是针对终端,我并不是vim党,且一直认为能够本地开发的项目,还是用IDE更好 T^T.安装方式...
当我忘记了一些.vimrc时,会不厌其烦地检查我,因此我制作了一个可以完全自定义的quickmenu插件:格式正确,并仔细地涂上了序言我的.vimrc中定义了许多键盘映射。 当我忘记了一些.vimrc时,我会很累,因此我做了这个...
确保您已使用自己喜欢的插件管理器在vimrc First install插件中设置了termguicolors。 请注意,您应该使用插件管理器的内置工具来重命名插件。 vim-plug插入'embark-theme / vim',{'as':'embark'} vim-packager .....
这个vimrc是一组用于开发代码的vim绑定。 它始于我使用和。 最近,我转向了Pathogen并对其进行了扩展。 安装 首先,您需要安装。 mkdir -p ~/.vim/autoload ~/.vim/bundle && \ curl -LSso ~/.vim/autoload/...
所有技巧都是从Vim Tips Wiki下载的,经过解析和格式化以使其看起来和工作方式...vim-plug将以下配置添加到您的.vimrc中。 用:PlugInstall插入“ danilamihailov / vim-tips-wiki”安装。 或使用您最喜欢的插件管理