设置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上下方式查看\ \

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

--------

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

--------

FBICDN,0.1元解决伪墙/假墙攻击,超500 Gbps DDos 防御,每天免费流量高达100G,免费高防网站加速服务

最近很多网站都遭受到了伪墙/假墙攻击,导致网站流量大跌,间歇性打不开网站。这是一种新型的攻击方式,攻击者利用GWF规则漏洞,使用国内服务器绑定host的方式来触发GWF的自动过滤机制,造成GWF暂时性屏蔽你的网站和服务器IP(大概15分钟左右),使你的网站在国内无法打开,如果攻击请求不断,那么你的网站就会是一个一直无法正常访问的状态。常规解决办法:1,快速备案后使用国内服务器,2,使用国内免备案服...

牦牛云(3.5USD/月 )阿里云国际版云服务器 1核1G40G

收到好多消息,让我聊一下阿里云国际版本,作为一个阿里云死忠粉,之前用的服务器都是阿里云国内版的VPS主机,对于现在火热的阿里云国际版,这段时间了解了下,觉得还是有很多部分可以聊的,毕竟,实名制的服务器规则导致国际版无需实名这一特点被无限放大。以前也写过几篇综合性的阿里云国际版vps的分析,其中有一点得到很多人的认同,那句是阿里云不管国内版还是国际版的IO读写速度实在不敢恭维,相对意义上的,如果在这...

ShineServers(5美元/月)荷兰VPS、阿联酋VPS首月五折/1核1G/50GB硬盘/3TB流量/1Gbps带宽

优惠码50SSDOFF 首月5折50WHTSSD 年付5折15OFF 85折优惠,可循环使用荷兰VPSCPU内存SSD带宽IPv4价格购买1核1G50G1Gbps/3TB1个$ 9.10/月链接2核2G80G1Gbps/5TB1个$ 12.70/月链接2核3G100G1Gbps/7TB1个$ 16.30/月链接3核4G150G1Gbps/10TB1个$ 18.10/月链接阿联酋VPSCPU内存SS...

vim配置为你推荐
域名主机域名和主机名之间的区别是什么虚拟主机申请现在做网站申请虚拟主机选择哪种合适?网站空间域名网站、域名空间三者的关系云服务器租用云服务器租用需要注意哪些方面asp网站空间谁有能申请免费的ASP空间网站?100m虚拟主机100元虚拟主机虚拟主机系统虚拟主机上的系统与电脑操作系统差别?重庆虚拟主机重庆市邮政速递物流公司渝北分公司双龙揽投部客服电话天津虚拟主机天津哪个是新网互联代理呢,我打算购买邮局?mysql虚拟主机哪些类型的虚拟主机支持数据库?
海外域名注册 韩国服务器租用 免费linux主机 欧洲欧洲vps 域名备案批量查询 花生壳域名贝锐 漂亮qq空间 仿牌空间 优惠码 gateone 卡巴斯基永久免费版 idc是什么 100m独享 php空间购买 彩虹云 网购分享 网页加速 空间申请 阿里云个人邮箱 广州主机托管 更多