配置檔案vimrc

MaChao發表於2020-11-05
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

Plug 'VundleVim/Vundle.vim'
Plug 'altercation/vim-colors-solarized'
Plug 'https://github.com/tomasr/molokai'
Plug 'https://github.com/nanotech/jellybeans.vim'
Plug 'https://github.com/morhetz/gruvbox'
Plug 'ervandew/supertab'
Plug 'junegunn/vim-easy-align'                            
Plug 'jiangmiao/auto-pairs'
Plug 'https://github.com/vim-scripts/fcitx.vim.git'
Plug 'mattn/emmet-vim'
Plug 'mattn/vimgrep'
Plug 'posva/vim-vue'
Plug 'Shougo/neocomplcache.vim'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'Yggdroot/indentLine'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-scripts/TagHighlight'
Plug 'itchyny/lightline.vim'

" Plug 'junegunn/fzf.vim'

Plug '~/my-prototype-plugin'
" Initialize plugin system
call plug#end()

set cursorline
" 顯示行號
set number
" 相對行號
set relativenumber
" 高亮當前行
set cursorline
" 游標遇到圓括號、方括號、大括號時,自動高亮對應的另一個圓括號、方括號和大
set showmatch
set nowrap "設定不折行"
set scrolloff=5 "距離頂部和底部5行"
set cursorline "突出顯示當前行"
set cursorcolumn "突出顯示當前列"
set autoindent
set undofile
set autochdir
set history=1000
set wildmenu
set wildmode=longest:list,full

noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>

nnoremap <silent> [b :bprevious<CR>
nnoremap <silent> ]b :bnext<CR>
nnoremap <silent> [B :bfirst<CR>
nnoremap <silent> ]B :blast<CR>

" autocmd vimenter * NERDTree
map <C-n> :NERDTreeToggle<CR>
let NERDTreeMinimalUI = 1
let NERDTreeShowHidden = 1
" o 開啟關閉檔案或目錄
" e 以檔案管理的方式開啟選中的目錄
" t 在標籤頁中開啟
" T 在標籤頁中開啟,但游標仍然留在 NERDTree
" r 重新整理游標所在的目錄
" R 重新整理當前根路徑
" X 收起所有目錄
" p 小寫,跳轉到游標所在的上一級路徑
" P 大寫,跳轉到當前根路徑
" J 到第一個節點
" K 到最後一個節點
" I 顯示隱藏檔案
" m 顯示檔案操作選單
" C 將根路徑設定為游標所在的目錄
" u 設定上級目錄為根路徑
" ctrl + w + w 游標自動在左右側視窗切換
" ctrl + w + r 移動當前視窗的佈局位置
" :tabc 關閉當前的 tab
" :tabo   關閉所有其他的 tab
" :tabp   前一個 tab
" :tabn   後一個 tab
" gT      前一個 tab
" gt      後一個 tab

let NERDTreeChDirMode=1
let NERDTreeShowBookmarks=1
let NERDTreeWinSize=25
let NERDTreeShowHidden=1
let NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$', '\.git$']

syntax enable
set background=dark
" colorscheme solarized
" set background=light
" colorscheme molokai
" colorscheme jellybeans
colorscheme gruvbox 

let g:user_emmet_leader_key='<C-Z>'

au BufNewFile,BufRead *.php,*.html,*.js,*.css,*.vue,*.txt set tabstop=2
au BufNewFile,BufRead *.php,*.html,*.js,*.css,*.vue,*.txt set softtabstop=2
au BufNewFile,BufRead *.php,*.html,*.js,*.css,*.vue,*.txt set shiftwidth=2
au BufNewFile,BufRead *.php,*.html,*.js,*.css,*.vue,*.txt set expandtab
au BufNewFile,BufRead *.php,*.html,*.js,*.css,*.vue,*.txt set autoindent
au BufNewFile,BufRead *.php,*.html,*.js,*.css,*.vue,*.txt set fileformat=unix


" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)"

相關文章

www.ruanyifeng.com/blog/2018/09/vim...

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章