设置vim配置文件(VIM configuration file)

vim配置  时间:2021-01-11  阅读:()

vim配置文件VIM configuration fileset nocompatible "关闭vi兼容模式syntax on "自动语法高亮colorscheme peak "设定配色方案set number显示行号set cursorline "突出显示当前行set ruler "打开状态栏标尺set shiftwidth = 4 "设定< <和> >命令移动时的宽度为4set softtabstop = 4 "使得按退格键时可以一次删掉4个空格set tabstop = 4 "设定table长度为4set nobackup "覆盖文件时不备份set autochdir "自动切换当前目录为当前文件所在的目录

"开启插件filetype() plugin indent on set backupcopy = yes "设置备份时的行为为覆盖set ignorecase smartcase "搜索时忽略大小写,但在有一个或以上大写字母时仍保持对大小写敏感set nowrapscan "禁止在搜索到文件两端时重新搜索

set incsearch "输入搜索内容时就显示搜索结果set hlsearch "搜索时高亮显示被找到的文本set noerrorbells "关闭错误信息响铃set novisualbell "关闭使用可视响铃代替呼叫the set t _vb = "置空错误铃声的终端代码

"set showmatch"插入括号时,短暂地跳转到匹配的对应括号"set matchtime = 2"短暂跳转到匹配括号的时间

"设置魔术set magic set hidden "允许在有未保存的修改时切换缓冲区,此时的修改由vim负责保存set guioptions - = t "隐藏工具栏set guioptions - = m "隐藏菜单栏set smartindent "开启新行时使用智能自动缩进set backspace = indent, eol, start

"不设定在插入状态无法用退格键和delete键删除回车符set cmdheight = 1 "设定命令行的行数为1

set laststatus = 2 "显示状态栏(默认值为1,无法显示状态栏)set statusline = \% < f [% 1% m% *% n% r% h] = \% y \% 0% {&f ileformat} \% {& encoding} \% c% l /% l%) \

"设置在状态行显示的信息set foldenable "开始折叠set foldmethod = syntax "设置语法折叠set foldcolumn = 0 "设置折叠区域的宽度setlocal foldlevel = 1 "设置折叠层数为

"set foldclose = all"设置为自动关闭折叠

"nnoremap < space > @= ((foldclosed (line (' . ' )) < 0) . zc ' , 'zo ' ) < cr >

"用空格键来开关折叠

"return os type, ec, windows, or linux, mac, et. st. .function! mysys ()if has ("win16") | | has ("win32") | | has ("win64") | | has ("win95")return "windows"

elseif has ("unix")return "linux"endif

Endfunction

"User directory variable" $VIMFILES "I f (MySys) = = "windows"

Let $VIMFILES = $VIM. '/vimfi les'

Elseif (MySys) = = "linux"

L et $VI MFI LES = $HOME. '/.v im'

Endif

"Set the doc document directory

Let helptags=$VIMFILES. '/doc'

"Sets font and Chinese support

If has ("Win32")

Set guifont=Inconsolata:h12:cANSI

Endif

"Configuring a multilingual environment If has ("multi_byte")

"UTF-8 encoding

Set encoding=utf-8

Set termencoding=utf-8

Set formatoptions+=mM

Set, fencs=utf-8, GBK

If v:lang = ~?' ^\ (zh\) \|\ (ja\) \|\ (ko\) .Set ambiwidth=double

Endif

If has ("Win32")

S our ce $VI MRUNTI ME/de l menu.v im

S our ce $VI MRUNTI ME/menu.v im

Language messages zh_CN.utf-8

Endif

Else

Echoerr, Sorry, this, version, of (g) , VIM, was, not, , compiled,with, +multi_byte"

Endif

"Buffers operation shortcuts!

Nnoremap <C-RETURN>: bnext<CR>

Nnoremap <C-S-RETURN>: bprev ious<CR>

"Tab operation shortcuts!

Nnor emap <C-TAB>: t abnext<CR>

Nnoremap <C-S-TAB>: tabprev<CR>

"Shortcut key on tab

"Map TN: tabnext<cr>. "

"Map TP: tabprevious<cr>. "

"Map Td: tabnew. <cr>. "

"Map Te: tabedit. "

"Map TC: tabclose<cr>. "

"When the window is split, the hotkey for switching is connected two times, such as moving from the bottom window. "

"The cursor to the upper window requires <c-w><c-w>k, which is very cumbersome and is now heavily mapped to" <c-k> ""Time will be very convenient. "

Nnoremap <C-h> <C-w>h

Nnoremap <C-j> <C-w>j

Nnoremap <C-k> <C-w>k

Nnoremap <C-l> <C-w>l

Some good mapping conversion syntax (useful when mixing different languages in a file)

Nnoremap <leader>1: set f iletype=xhtml<CR>

Nnoremap <leader>2: set f iletype=css<CR>

Nnoremap <leader>3: set f iletype=javascript<CR>

Nnoremap <leader>4: set f iletype=php<CR>

"Set, f ileformats=unix, DOS, Mac. "

"Nmap <leader>fd: Se f ileformat=dos<CR>. "

"Nmap <leader>fu: Se f ileformat=unix<CR>. "

"Use, Ctrl+[l |n|p|cc], to, list|next|previous| jump, to, count,the, result. "

"Map <C-x>l <ESC>: c l<CR>. "

"Map <C-x>n <ESC>: cn<CR>. "

"Map <C-x>p <ESC>: cp<CR>. "

"Map <C-x>c <ESC>: cc<CR>. "

"Let Tohtml generate HTML with the CSS syntax. "

"Syntax/2html.vim, you can use: runtime! Syntax/2html.vim!"Let html_use_css=1

"General settings for Python files, such as not tab, etc.Autocmd, FileType, python, set, tabstop=4, shiftwidth=4,expandtab

Autocmd, FileType, python, map, <F12>: Python%<CR>!

"Ctrl+c replication in selected state

VMap <C-c> "+y"

"Open JavaScript fold

Let b:javascript_fold=1

"Open JavaScript support for DOM, HTML, and CSS

Let javascript_enable_domhtmlcss=1

"Sets the path to the dictionary ~/.vim/dict/ file

Autocmd, f iletype, JavaScript, set,dictionary=$VIMFILES/dict/javascript.dict

如果CSS设置字典= autocmd vimfiles美元/字典/ css.dict 如果PHP设置字典= autocmd vimfiles美元/字典/ php.dict

“---------------------------------------------------------

“插件切换bufexplorer.vim缓冲器

“是全屏方式查看全部打开的文件列表

“左右方式查看BS上下方式查看\ \

“---------------------------------------------------------

--------

“---------------------------------------------------------

--------

ReadyDedis:VPS全场5折,1G内存套餐月付2美元起,8个机房可选_服务器安装svn

ReadyDedis是一家2018年成立的国外VPS商家,由印度人开设,主要提供VPS和独立服务器租用等,可选数据中心包括美国洛杉矶、西雅图、亚特兰大、纽约、拉斯维加斯、杰克逊维尔、印度和德国等。目前,商家针对全部VPS主机提供新年5折优惠码,优惠后最低套餐1GB内存每月仅需2美元起,所有VPS均为1Gbps端口不限流量方式。下面列出几款主机配置信息。CPU:1core内存:1GB硬盘:25GB ...

HostKvm香港VPS七折:$5.95/月KVM-2GB内存/40GB硬盘/500GB月流量

HostKvm是一家成立于2013年的国外主机服务商,主要提供VPS主机,基于KVM架构,可选数据中心包括日本、新加坡、韩国、美国、俄罗斯、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。商家本月针对香港国际机房提供特别7折优惠码,其他机房全场8折,优惠后2G内存香港VPS每月5.95美元起,支持使用PayPal或者支付宝付款。下面以香港国际(HKGlobal)为...

Advinservers:美国达拉斯便宜VPS/1核/4GB/80GB SSD/1Gbps不限流量/月付$2.5/美国10Gbps高防服务器/高达3.5TBDDos保护$149.99元/月

Advinservers,国外商家,公司位于新泽西州,似乎刚刚新成立不久,主要提供美国和欧洲地区VPS和独立服务器业务等。现在有几款产品优惠,高达7.5TB的存储VPS和高达3.5TBDDoS保护的美国纽约高防服务器,性价比非常不错,有兴趣的可以关注一下,并且支持Paypal付款。官方网站点击直达官方网站促销产品第一款VPS为预购,预计8月1日交付。CPU为英特尔至强 CPU(X 或 E5)。官方...

vim配置为你推荐
已备案域名查询已经有个顶级域名,怎么查询是否备案?虚拟主机代理哪家虚拟主机商的代理比较好域名服务域名服务有何作用?如何设置?域名主机域名,主机空间和网站文件三者之间的区别是什么云服务器租用租用云服务器,要注意什么?网站空间商域名空间商怎么做国内最好的虚拟主机国内虚拟主机哪家的好?虚拟主机软件虚拟主机管理软件那个最好用?合肥虚拟主机哪里的虚拟主机空间实惠?大连虚拟主机大连哪些地方的网通机房好?
cn域名 济南域名注册 fastdomain 国外bt 哈喽图床 淘宝双十一2018 国内加速器 老左来了 免费申请网站 免费申请个人网站 linux使用教程 厦门电信 登陆空间 qq金券 cdn服务 深圳主机托管 数据湾 九零网络 木马检测 瓦工工资 更多