init.vim
" Vim with all enhancements
"文件管理器,我想試一下ranger
syntax enable
syntax on
let mapleader=" "
set number " 顯示行號(hào)
set relativenumber " 顯示相對(duì)行號(hào)
set hlsearch " 搜索結(jié)果高亮
set autoindent " 自動(dòng)縮進(jìn)
set smartindent " 智能縮進(jìn)
set tabstop=4 " 設(shè)置tab制表符號(hào)所占寬度為4
set softtabstop=4 " 設(shè)置按tab時(shí)縮進(jìn)寬度為4
set shiftwidth=4 " 設(shè)置自動(dòng)縮進(jìn)寬度為4
set expandtab " 縮進(jìn)時(shí)將tab制表服轉(zhuǎn)為空格
set showcmd " Display incomplete commands.
set clipboard=unnamedplus " 開(kāi)啟系統(tǒng)剪切板
set cursorline " 高亮當(dāng)前行
set ignorecase " 設(shè)置忽略大小寫(xiě)
set smartcase " 設(shè)置智能大小寫(xiě)
set ruler " 設(shè)置顯示當(dāng)前位置
set showcmd " 顯示命令
set scrolloff=5 "顯示5行
"關(guān)閉vi兼容模式"
set nocompatible
"設(shè)置歷史記錄步數(shù)"
set history=1000
noremap ; :
inoremap jj <Esc>
inoremap tab <C>n
noremap <LEADER><CR> : nohlsearch<CR>
" Enable Mouse
if has('mouse')
set mouse=a
endif
if has('clipboard')
if has('unnamedplus') " When possible use + register for copy-paste
set clipboard=unnamed,unnamedplus
else " On mac and Windows, use * register for copy-paste
set clipboard=unnamed
endif
endif
" set autoread
filetype on " 開(kāi)啟文件類(lèi)型檢測(cè)
filetype plugin indent on " 開(kāi)啟文件類(lèi)型插件檢測(cè)
syntax on " 開(kāi)啟語(yǔ)法高亮
"設(shè)置esc的生效時(shí)間
set timeout
set timeoutlen=800
set magic
set encoding=utf-8
set termencoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8,gbk,big5
endif
language messages zh_CN.utf-8
" Vim
colorscheme desert
lua require('basic')
basic.lua
-- 邊輸入邊搜索
vim.o.incsearch = true
-- 禁止創(chuàng)建備份文件
vim.o.backup = false
vim.o.writebackup = false
vim.o.swapfile = false
-- 補(bǔ)全增強(qiáng)
vim.o.wildmenu = true
-- Dont' pass messages to |ins-completin menu|
vim.o.shortmess = vim.o.shortmess .. 'c'
-- 補(bǔ)全最多顯示10行
vim.o.pumheight = 10
-- 永遠(yuǎn)顯示 tabline
vim.o.showtabline = 2