当前位置:网站首页>GVIM [III] [u vimrc configuration]
GVIM [III] [u vimrc configuration]
2022-07-07 14:10:00 【Stool flower*】
GVIM It can be modified by vimrc To flexibly configure your editor .
Here is my first vimrc:
" Set the background theme
"colo Candy
set nocompatible
" Vim with all enhancements
source $VIMRUNTIME/vimrc_example.vim
" Remap a few keys for Windows behavior
source $VIMRUNTIME/mswin.vim
set expandtab
"set tabstop=4
set guifont=Courier_New:h14
"set guifont=DejaVu\ Sans\ Mono\:h14
"colorscheme eighties " Theme Settings
" Set window size
winpos 100 100
set lines=25 columns=80
" Use the internal diff if available.
" Otherwise use the special 'diffexpr' for Windows.
if &diffopt !~# 'internal'
set diffexpr=MyDiff()
endif
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 arg1 = substitute(arg1, '!', '\!', 'g')
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg2 = substitute(arg2, '!', '\!', 'g')
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let arg3 = substitute(arg3, '!', '\!', 'g')
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
if empty(&shellxquote)
let l:shxq_sav = ''
set shellxquote&
endif
let cmd = '"' . $VIMRUNTIME . '\diff"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
let cmd = substitute(cmd, '!', '\!', 'g')
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
if exists('l:shxq_sav')
let &shellxquote=l:shxq_sav
endif
endfunction
" Auto full screen
"autocmd GUIEnter * simalt ~x
" Set encoding "
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
" According to the line Numbers "
set nu
set number
" Highlight current line "
"set cursorline
"set cul "cursorline Abbreviated form "
" Highlight the current column "
"set cursorcolumn
"set cuc "cursorcolumn Abbreviated form "
" Enable mouse "
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" Show bracket matching "
set showmatch
" Set indent "
" Set up Tab The length is 2 Space "
set tabstop=2
" Set the auto indent length to 2 Space "
set shiftwidth=2
" Inherit the indent of the previous line , For multiline comments "
set autoindent
" Set paste mode "
" Show spaces and tab The key in Vim When pasting with the right mouse button in, many indents and spaces will appear at the beginning of the line , adopt set paste You can paste content in insert mode without any format deformation 、 Random indentation and other problems ."
set paste
"vimrc Show spaces and tab key "
"Vim By default, the editor does not display tab And space characters , The following display effects can be obtained through the following configuration , Easy to locate input errors ."
set listchars=tab:>-,trail:-
" Set to load automatically when files are changed
set autoread
"quickfix Pattern
autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>
" Code completion
set completeopt=preview,menu
" Save automatically
set autowrite
" Set the number of context lines
set so=1
" Syntax highlighting
set syntax=on
" And windows Share clipboard
set clipboard+=unnamed
" Cancel automatic backup and generation swp file
set noundofile
set nobackup
set nowb
set noswapfile
" by C The program provides automatic indentation
set smartindent
" When it's launched, it doesn't show the hint of helping Somali children
set shortmess=atI
" Ignore case
"set ic(ignorecase Abbreviation ) Ignore case
"set noic(noignorecase Abbreviation ) Don't ignore case
" What the status line shows
"set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
set statusline=\ [POS=%l,%v][%p%%]\ %{strftime(\"20%y/%m/%d\ -\ %H:%M\")}
" Open file type detection , Only by adding this sentence can we use intelligence to complete
set completeopt=longest,menu
" plug-in unit "
set nocompatible " Remove VIM Uniformity , must "
filetype off " must "
" Settings include vundle Runtime path related to initialization "
set rtp+=$VIM/vimfiles/bundle/Vundle.vim/
call vundle#begin('$VIM/vimfiles/bundle/')
" Enable vundle Management plug-in , must "
Plugin 'VundleVim/Vundle.vim'
" Add other plug-ins here , The installed plug-ins need to be placed in vundle#begin and vundle#end Between "
" install github The plug-in format on is Plugin ' user name / Plugin warehouse name '"
" Bracket color alignment
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'https://github.com/schmich/vim-guifont'
" Catalog
Plugin 'preservim/nerdtree'
Plugin 'preservim/nerdcommenter'
call vundle#end()
filetype plugin indent on " load vim Built in scripts related to the syntax and file type of the plug-in , must "
autocmd VimEnter * RainbowParenthesesToggle
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Automatic loading NERDTree
"autocmd VimEnter * NERDTree
" Set up NerdTree
map <F3> :NERDTreeMirror<CR>
map <F3> :NERDTreeToggle<CR>
Basically, every command is annotated , Let's look at it in combination with the notes , I don't need to comment out some commands , You can also cancel the comment to see what the function is .
" plug-in unit " At first, we added two GVIM plug-in unit ,GVIM The functions of plug-ins are very complete , You can install different plug-ins according to your needs . I have two installed here :NERDTree and rainbow_parentheses.NERDTree It's a file directory ,rainbow_parentheses Is the bracket color alignment . As shown below :

Installation method :
Gvim Tree directory plug-in NERDTree Installation method
vim plug-in unit ——rainbow
vim plug-in unit : rainbow_parentheses[ Brackets highlight ]
The files in the blog are from my github Download from .
Other blogs in this series
边栏推荐
- 现在网上开户安全么?那么网上开户选哪个证券公司?
- 请问,我kafka 3个分区,flinksql 任务中 写了 join操作,,我怎么单独给join
- 【日常训练--腾讯精选50】231. 2 的幂
- 交换机和路由器的异同
- call undefined function openssl_ cipher_ iv_ length
- 最长上升子序列模型 AcWing 1012. 友好城市
- Parsing of XML files
- How does MySQL control the number of replace?
- What are the principles for distinguishing the security objectives and implementation methods that cloud computing security expansion requires to focus on?
- Common response status codes
猜你喜欢

SAKT方法部分介绍
![Supply chain supply and demand estimation - [time series]](/img/2c/82d118cfbcef4498998298dd3844b1.png)
Supply chain supply and demand estimation - [time series]
![[fortress machine] what is the difference between cloud fortress machine and ordinary fortress machine?](/img/fb/17e029b1d955965d7e2e0f58701d91.png)
[fortress machine] what is the difference between cloud fortress machine and ordinary fortress machine?

Did login metamask

Vmware共享主机的有线网络IP地址

Xshell connection server changes key login to password login

2022-7-7 Leetcode 844.比较含退格的字符串
![SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1](/img/10/6de1ee8467b18ae03894a8d5ba95ff.png)
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1

为租客提供帮助

数据流图,数据字典
随机推荐
Move base parameter analysis and experience summary
Is the spare money in your hand better to fry stocks or buy financial products?
Leetcode simple question sharing (20)
带你掌握三层架构(建议收藏)
Is it safe to open an account online now? Which securities company should I choose to open an account online?
Leecode3. Longest substring without repeated characters
属性关键字Aliases,Calculated,Cardinality,ClientName
Interface automation test - solution of data dependency between interfaces
Huawei image address
供应链供需预估-[时间序列]
请问,redis没有消费消息,都在redis里堆着是怎么回事?用的是cerely 。
Learning breakout 2 - about effective learning methods
The meaning of variables starting with underscores in PHP
Laravel5 call to undefined function openssl cipher iv length() 报错 PHP7开启OpenSSL扩展失败
Laravel5 call to undefined function OpenSSL cipher IV length() error php7 failed to open OpenSSL extension
[daily training -- Tencent select 50] 231 Power of 2
Oracle advanced (V) schema solution
Excellent open source system recommendation of ThinkPHP framework
Cesium 已知一点经纬度和距离求另一个点的经纬度
UML 顺序图(时序图)