Tag Archives: vimrc

GVIM configuration file (_ User defined configuration (no plug-in) record of vimrc

_ The personal configuration of vimrc file (without plug-in) is as follows

......
(_vimrc original configuration, no changes)
......

" ============================= ↓ custom ↓ ===============================

" ------------------------ Basic settings
" Turn off compatibility with vi
set nocompatible

" reload files when changed on disk, i.e. via `git checkout`
" set autoread

" Turn off ringing when there is an error message
" set noerrorbells
"
" Customize the backup file location
set backupdir=D:/softwares/GVim/Vim/backupFiles

" Turn off automatic backups
" set nobackup

" disable automatic generation of .un~ files
" set noundofile

" set ------------------------ encoding
" set the character encoding used internally by Vim, which is applied to the characters used in buffers, registers, and expressions
" set encoding=utf-8

" sets a list of character encodings that represent the list of alternative character encodings used by Vim to automatically detect file encodings
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1,gbk

" Set the list of alternatives that participate in the automatic detection of the newline () format type
set fileformats=unix,dos,mac  

" Set the encoding method used by the terminal
set termencoding=utf-8

"set langmenu=zh_cn.utf-8
"language messages zh_CN.UTF-8

" indicates the way auto-formatting is done. = can be used to auto-format code in Vim's visual mode. m means to branch on any multibyte character with a value higher than 255; B means not to insert a space between two multibyte characters when joining lines
"set formatoptions+=m
"set formatoptions+=B

" ------------------------ Display settings
" set font
set guifont=Ubuntu\ Mono:h12

" set colorscheme
colorscheme evening

" turn on syntax highlighting
" syntax enable
syntax on

" Turn on file type detection
filetype indent on

" Show line numbers
set number

" Show the row and column numbers of the current cursor position
set ruler

" shows the current mode
set showmode

" Briefly jump to the corresponding matching bracket when inserting brackets
set showmatch

" the time to jump to the matching bracket when inserting a bracket
set matchtime=2

" always show status bar
set laststatus=2

" highlight the current line
set cursorline

" Highlight the current column
" set cursorcolumn

" Disable line breaks
" set nowrap

" ------------------------ search settings
" set search content highlighting
set hlsearch

" turn on pre-matching (match as you type the search)
" set incsearch

" Ignore case in search
set ignorecase

" smart search (when both ignorecase and smartcase options are on, Vim assumes that the current lookup (search) is case-sensitive if the search pattern contains uppercase letters. If the search pattern does not contain any uppercase letters, Vim assumes that the search should be case-insensitive)
set smartcase

" ------------------------ indent setting
" set tab = 4 spaces
set tabstop=4

" set the number of columns to indent when performing indent operations in Vim normal mode ( << and &>&> commands )
set shiftwidth=4

" Set the newly added line to have the same indent as the previous line
" set autoindent

" ------------------------ Other settings
" set Vim's default registers to be shared with the system clipboard
set clipboard+=unnamed

" set alt key not to map to menu bar
set winaltkeys=no

" Map F2 as a shortcut to show line numbers or not
nnoremap <F2&> :set nu! nu?<CR&>

" Make vimrc configuration changes take effect immediately
" if has("autocmd")
	autocmd BufWritePost _vimrc source D:/softwares/GVim/Vim
" endif