init.vim
" Vim with all enhancements
"文件管理器,我想试一下ranger
syntax enable
syntax on
let mapleader=" "
set number " 显示行号
set relativenumber " 显示相对行号
set hlsearch " 搜索结果高亮
set autoindent " 自动缩进
set smartindent " 智能缩进
set tabstop=4 " 设置tab制表符号所占宽度为4
set softtabstop=4 " 设置按tab时缩进宽度为4
set shiftwidth=4 " 设置自动缩进宽度为4
set expandtab " 缩进时将tab制表服转为空格
set showcmd " Display incomplete commands.
set clipboard=unnamedplus " 开启系统剪切板
set cursorline " 高亮当前行
set ignorecase " 设置忽略大小写
set smartcase " 设置智能大小写
set ruler " 设置显示当前位置
set showcmd " 显示命令
set scrolloff=5 "显示5行
"关闭vi兼容模式"
set nocompatible
"设置历史记录步数"
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 " 开启文件类型检测
filetype plugin indent on " 开启文件类型插件检测
syntax on " 开启语法高亮
"设置esc的生效时间
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
-- 禁止创建备份文件
vim.o.backup = false
vim.o.writebackup = false
vim.o.swapfile = false
-- 补全增强
vim.o.wildmenu = true
-- Dont' pass messages to |ins-completin menu|
vim.o.shortmess = vim.o.shortmess .. 'c'
-- 补全最多显示10行
vim.o.pumheight = 10
-- 永远显示 tabline
vim.o.showtabline = 2
标签:neovim,缩进,set,utf,--,配置,vim,设置
From: https://www.cnblogs.com/nuralim/p/17716126.html