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

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

--------

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

--------

BuyVM老牌商家新增迈阿密机房 不限流量 月付2美元

我们很多老用户对于BuyVM商家还是相当熟悉的,也有翻看BuyVM相关的文章可以追溯到2014年的时候有介绍过,不过那时候介绍这个商家并不是很多,主要是因为这个商家很是刁钻。比如我们注册账户的信息是否完整,以及我们使用是否规范,甚至有其他各种问题导致我们是不能购买他们家机器的。以前你嚣张是很多人没有办法购买到其他商家的机器,那时候其他商家的机器不多。而如今,我们可选的商家比较多,你再也嚣张不起来。...

SugarHosts新增Windows云服务器sugarhosts六折无限流量云服务器六折优惠

SugarHosts糖果主机商我们较早的站长们肯定是熟悉的,早年是提供虚拟主机起家的,如今一直还在提供虚拟主机,后来也有增加云服务器、独立服务器等。数据中心涵盖美国、德国、香港等。我们要知道大部分的海外主机商都只提供Linux系统云服务器。今天,糖果主机有新增SugarHosts夏季六折的优惠,以及新品Windows云服务器/云VPS上线。SugarHosts Windows系统云服务器有区分限制...

华纳云,3折低至优惠云服务器,独立服务器/高防御服务器低至6折,免备案香港云服务器CN2 GIA三网直连线路月付18元起,10Mbps带宽不限流量

近日华纳云发布了最新的618返场优惠活动,主要针对旗下的免备案香港云服务器、香港独立服务器、香港高防御服务器等产品,月付6折优惠起,高防御服务器可提供20G DDOS防御,采用E5处理器V4CPU性能,10Mbps独享CN2 GIA高速优质带宽,有需要免备案香港服务器、香港云服务器、香港独立服务器、香港高防御服务器、香港物理服务器的朋友可以尝试一下。华纳云好不好?华纳云怎么样?华纳云服务器怎么样?...

vim配置为你推荐
主机租用独立主机出租是什么意思国际域名注册顶级域名怎样注册com域名空间域名解析,我是一个新手站长,我买了一个空间跟一个COM域名,空间自带一个2级域名,我想把这个COM域名绑定到空间上,咋么办?急急急!求大神帮我,我创建一个游戏论坛,也查不到资料,可以给20元,我的手机13685455534,谢谢网站空间域名网站、域名空间三者的关系重庆虚拟空间重庆合川宝龙城市广场有前途么网站空间商域名空间商怎么做香港虚拟主机香港虚拟主机多少钱一年呢?虚拟主机服务商请问哪个服务商的虚拟主机比较好呀北京虚拟主机北京服务好的虚拟主机代理商介绍几个?论坛虚拟主机我要做个论坛,是用虚拟主机呢?还是用空间?除论坛外还有好及个单页,还带数据库。
中国域名注册 免费linux主机 看国外视频直播vps 动态域名解析软件 stablehost 电影服务器 香港主机 vmsnap3 parseerror 国内php空间 qq数据库 seednet 河南m值兑换 789电视 hostloc 如何用qq邮箱发邮件 1美金 网购分享 网站加速软件 游戏服务器出租 更多