当前位置:网站首页>My VIM profile
My VIM profile
2022-07-02 08:06:00 【programmercherry】
open linux terminal
root Under the user vim /root/.vimrc
Excellent blog
Refer to the post
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set the default decoding
set fenc=utf-8
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936
" Do not use vi Keyboard mode , It is vim Their own
set nocompatible
" history Number of lines to be recorded in the file
set history=100
" When dealing with unsaved or read-only files , Pop up confirmation
set confirm
" And windows Share clipboard
set clipboard+=unnamed
" Detect file types
filetype on
" Load file type plug-in
filetype plugin on
" Load related indented files for a specific file type
filetype indent on
" Save global variables
set viminfo+=!
" Words with the following symbols should not be separated by line breaks
set iskeyword+=_,$,@,%,#,-
" Syntax highlighting
syntax on
" Highlight character , Let it not be affected 100 Column restrictions
:highlight OverLength ctermbg=red ctermfg=white guibg=red guifg=white
:match OverLength '\%101v.*'
" Status line color
highlight StatusLine guifg=SlateBlue guibg=Yellow
highlight StatusLineNC guifg=Gray guibg=White
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" File settings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Don't back up files ( Choose according to your own needs )
set nobackup
" Do not generate swap file , When buffer Hide it when it's discarded
setlocal noswapfile
set bufhidden=hide
" The number of pixel lines inserted between characters
set linespace=0
" Command line autocomplete in enhanced mode
set wildmenu
" The line number and column number at the cursor position are displayed on the status line
set ruler
set rulerformat=%20(%2*%<%f%=\ %m%r\ %3l\ %c\ %p%%%)
" Command line ( In the status line ) Height , The default is 1, Here is 2
set cmdheight=2
" Make the backspace key (backspace) Normal processing indent, eol, start etc.
set backspace=2
" allow backspace And cursor keys across line boundaries
set whichwrap+=<,>,h,l
" Can be in buffer Using the mouse anywhere ( similar office Double click in the workspace to locate )
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" When it's launched, it doesn't show the hint of helping Somali children
set shortmess=atI
" By using : commands command , Tell us which line of the document has been changed
set report=0
" Not allow vim Make a nasty drip
set noerrorbells
" Show white space between divided windows , Easy to read
set fillchars=vert:\ ,stl:\ ,stlnc:\
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Search and match
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Highlight the matching brackets
set showmatch
" Match the highlighted time of brackets ( The unit is one tenth of a second )
set matchtime=5
" Ignore case when searching
set ignorecase
" Don't highlight the sentence being searched (phrases)
set nohlsearch
" In search , Highlight the words and sentences one by one ( similar firefox Search for )
set incsearch
" Input :set list The command is what should be displayed ?
set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$
" Cursor moves to buffer Keep the top and bottom of 3 Row distance
set scrolloff=3
" Don't blink
set novisualbell
" What my status line shows ( Including file type and decoding )
set statusline=%F%m%r%h%w\[POS=%l,%v][%p%%]\%{
strftime(\"%d/%m/%y\ -\ %H:%M\")}
" Always show status lines
set laststatus=2
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text formatting and typesetting
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Auto format
set formatoptions=tcrqn
" Inherit the indent of the previous line , Especially for multiline comments
set autoindent
" by C The program provides automatic indentation
set smartindent
" Use C Indent of style
set cindent
" The box drawings are 4
set tabstop=4
" Indent uniformly to 4
set softtabstop=4
set shiftwidth=4
" Don't use spaces instead of tabs
set noexpandtab
" Don't change lines
set nowrap
" Use tabs at the beginning of lines and paragraphs
set smarttab
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags Set up
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sort by name
let Tlist_Sort_Type = "name"
" Show the window on the right
let Tlist_Use_Right_Window = 1
" Compression way
let Tlist_Compart_Format = 1
" If only one buffer,kill Windows also kill fall buffer
let Tlist_Exist_OnlyWindow = 1
" Don't close other files tags
let Tlist_File_Fold_Auto_Close = 0
" Don't show the fold tree
let Tlist_Enable_Fold_Column = 0
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Autocommands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Display line numbers only when the following file types are detected , Plain text files do not display
if has("autocmd")
autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->
autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o
autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe " normal g`\"" |
\ endif
endif "has("autocmd")
" F5 Compile and run C Program ,F6 Compile and run C++ Program
" Please note that , The following code is in windows An error will be reported when using
" Need to get rid of it. ./ These two characters
" C Compile and run
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
exec "!gcc % -o %<"
exec "! ./%<"
endfunc
" C++ Compile and run
map <F6> :call CompileRunGpp()<CR>
func! CompileRunGpp()
exec "w"
exec "!g++ % -o %<"
exec "! ./%<"
endfunc
" Can display beautifully .NFO file
set encoding=utf-8
function! SetFileEncodings(encodings)
let b:myfileencodingsbak=&fileencodings
let &fileencodings=a:encodings
endfunction
function! RestoreFileEncodings()
let &fileencodings=b:myfileencodingsbak
unlet b:myfileencodingsbak
endfunction
au BufReadPre *.nfo call SetFileEncodings('cp437')|set ambiwidth=single au BufReadPost *.nfo call RestoreFileEncodings()
" Highlight normal txt file ( need txt.vim Script )
au BufRead,BufNewFile * setfiletype txt
" Use the space bar to turn on and off folding
set foldenable
set foldmethod=manual
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc':'zo')<CR>
" minibufexpl General settings of plug-ins
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
边栏推荐
猜你喜欢

w10升级至W11系统,黑屏但鼠标与桌面快捷方式能用,如何解决

【Wing Loss】《Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks》

Income in the first month of naked resignation

In the era of short video, how to ensure that works are more popular?

EKLAVYA -- 利用神经网络推断二进制文件中函数的参数

【双目视觉】双目矫正

【学习笔记】Matlab自编高斯平滑器+Sobel算子求导

Remplacer l'auto - attention par MLP

Using transformer for object detection and semantic segmentation
![Open3d learning note 5 [rgbd fusion]](/img/0a/41d38e4b0295b6674143f3f74a4a8d.png)
Open3d learning note 5 [rgbd fusion]
随机推荐
简易打包工具的安装与使用
力扣每日一题刷题总结:字符串篇(持续更新)
OpenCV 6.4 中值滤波器的使用
A brief analysis of graph pooling
OpenCV常用方法出处链接(持续更新)
業務架構圖
On the back door of deep learning model
Meta learning Brief
多站点高可用部署
Open3d learning note 4 [surface reconstruction]
深入理解JVM
Open3D学习笔记一【初窥门径,文件读取】
【MobileNet V3】《Searching for MobileNetV3》
Hystrix dashboard cannot find hystrix Stream solution
SQL server如何卸载干净
Brief introduction of prompt paradigm
Array and string processing, common status codes, differences between PHP and JS (JS)
Summary of open3d environment errors
【双目视觉】双目立体匹配
[learning notes] numerical differentiation of back error propagation