vim基本構成

7242 ワード

vim 8.2設定に基づいています.
1.golangは8.2バージョンでgolang構文でハイライトされています.
2.vimインストーラのhtmlはcssとjavascriptのインデントが見にくいので、gg=Gコマンドをダウンロードしてcssとjavascriptコード付きhtmlファイルを完全にフォーマットする必要があります.ダウンロードアドレス:web_indent
3.emmetのインストール、ダウンロードアドレス:emmet、ダウンロード後、対応するファイルをvimの対応するフォルダにコピーすればいい.デフォルトのemmetショートカット:ctrl+y+.
4.私のvimプロファイル:
" Ultimate VIMRC without plugin
" Copyrights @ Yavobo
" Version 0.10
" Created in 2016.11.02 11:11
" Updated in 2020.03.10 16:19
"
" Describe:
"   This is an version of no plugin.
"   That's my favours!
"

" 1.base {{{
syntax on
filetype indent plugin on
set nocompatible
set nobackup
set noswapfile
set history=2048
set autochdir
set whichwrap=b,s,,[,]
set nobomb
set backspace=indent,eol,start whichwrap+=,[,]
set ff=unix
set cindent shiftwidth=4
" Vim               
set clipboard+=unnamed
"    alt         
set winaltkeys=no
" }}}

" 2.Lang & Encoding {{{
let $LANG = 'en_US.UTF-8'
language messages zh_CN.UTF-8
set encoding=utf-8
set termencoding=cp936
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set langmenu=zh_CN.utf-8
set imcmdline
"         
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
" }}}

" 3.Theme {{{
" Set Number line and Cursor line

" Set Status line
set laststatus=2
set statusline=[%{&ff}:%{&fenc}]%F%m%r%h\ %w\ \ %=%l,%c\ %L
set cmdheight=1

" Set font
if has("win32")
    set guifont=YaHei_Consolas_Hybrid:h16
endif

" Normal setup
"      /   
set guioptions-=T
set guioptions-=m
set guioptions-=L
set guioptions-=r
set guioptions-=b

"      
if has("gui_running") && has("win32")
    map  :call libcallnr("gvimfullscreen.dll","ToggleFullScreen", 0)
    au GUIEnter * simalt ~x
endif
"  F11    
imap  :call libcallnr("gvimfullscreen.dll","ToggleFullScreen", 0)
" }}}

" 4.Behavior {{{
set autoindent
set mouse=a
set backspace=2
set wrap
set smartindent
set tabstop=4
set softtabstop=4
set expandtab

"set ai!
map  :tabnext
map  :tabnew

set number
set cursorline
    " For windows 7
    " Display will not be normal in terminal when set t_Co to 256, it must be set to 8
    " ------------------------------------------------------------------------
    "set t_Co=8
    colorscheme ron
    highlight Normal ctermbg=Black
    "highlight LineNr term=NONE cterm=NONE ctermbg=DarkCyan ctermfg=Yellow
    highlight LineNr term=NONE cterm=NONE ctermfg=Green
    highlight CursorLine term=NONE cterm=NONE ctermbg=DarkBlue
    highlight CursorLineNr term=NONE cterm=NONE ctermbg=DarkGreen ctermfg=Red

    " For windows 10
    " Display will be same as gui in terminal to set t_Co to 256
    " ----------------------------------------------------------
"set t_Co=256
"colorscheme torte
"highlight Normal ctermbg=235
"highlight LineNr term=NONE cterm=NONE ctermbg=234 ctermfg=yellow
"highlight CursorLine term=NONE cterm=NONE ctermbg=238
"highlight CursorLineNr term=NONE cterm=NONE ctermbg=236 ctermfg=red

if has("gui_running")
    colorscheme desert
    highlight CursorLine guibg=#555555
    highlight LineNr guibg=#222222
    highlight CursorLineNr guifg=yellow
endif
"     
highlight TabLine guibg=#121212 guifg=red term=underline cterm=bold ctermfg=red ctermbg=gray
highlight TabLineSel guibg=#121212 guifg=yellow term=bold cterm=bold ctermbg=Red ctermfg=yellow

" 5.others     
if has("win32")
    " vimrc          , windows
    autocmd! bufwritepost _vimrc source %
else
    " vimrc          , linux
    autocmd! bufwritepost .vimrc source %
endif

" 6.Extend 
"     
"          
" inoremap ' ''i
" inoremap " ""i
" inoremap ( ()i
" inoremap [ []i
" inoremap { {}O
" }}}