set number set relativenumber syntax on " 设置缩进 set tabstop=4 " 设置 Tab 显示为 4 个空格 set softtabstop=4 " 编辑模式下退格键回退 4 个空格 set shiftwidth=4 " 设置自动缩进的宽度为 4 个空格 set expandtab " 将 Tab 转换为空格 set autoindent " 启用自动缩进 lua require('plugins') " config for hop motion plugin let mapleader=" " nnoremap w HopWord nnoremap s HopChar2 nnoremap j HopLine nnoremap k HopLineStart xnoremap w HopWord xnoremap s HopChar2 xnoremap j HopLine xnoremap k HopLineStart " 支持便捷粘贴复制 nnoremap y "+y nnoremap p "+p xnoremap y "+y xnoremap p "+p inoremap + for n in range(char2nr('a'), char2nr('z')) let c = nr2char(n) if c ==# 'y' || c ==# 'p' | continue | endif execute 'nnoremap ' . c . 'y "' . c . 'y' execute 'xnoremap ' . c . 'y "' . c . 'y' execute 'nnoremap ' . c . 'p "' . c . 'p' execute 'xnoremap ' . c . 'p "' . c . 'p' endfor