-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
68 lines (58 loc) · 1.91 KB
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
call plug#begin('~/.config/nvim/plugged')
Plug 'mattn/emmet-vim'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'neoclide/coc.nvim', {'do': { -> coc#util#install()}}
Plug 'vim-airline/vim-airline'
Plug 'Yggdroot/indentLine'
Plug 'arcticicestudio/nord-vim'
Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'kristijanhusak/defx-icons'
call plug#end()
set number "设置行号
"set relativenumber "相对行号
set showcmd "命令模式底部显示键入指令
set nocompatible "不与vi兼容
syntax on "语法高亮
syntax enable
colorscheme nord
set autoindent
set tabstop=2
set shiftwidth=4
set expandtab
set softtabstop=2
set ignorecase
set smartcase
inoremap jk <Esc>
inoremap ( ()<Esc>i
inoremap [ []<Esc>i
inoremap { {}<Esc>i
inoremap " ""<Esc>i
inoremap ' ''<Esc>i
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" 使用 ;e 切换显示文件浏览,使用 ;a 查找到当前文件位置
let g:maplocalleader=';'
nnoremap <silent> <LocalLeader>e
\ :<C-u>Defx -resume -toggle -buffer-name=tab`tabpagenr()`<CR>
nnoremap <silent> <LocalLeader>a
\ :<C-u>Defx -resume -buffer-name=tab`tabpagenr()` -search=`expand('%:p')`<CR>
function! s:defx_mappings() abort
" Defx window keyboard mappings
setlocal signcolumn=no
" 使用回车打开文件
nnoremap <silent><buffer><expr> <CR> defx#do_action('multi', ['drop'])
endfunction
call defx#custom#option('_', {
\ 'columns': 'indent:git:icons:filename',
\ 'winwidth': 25,
\ 'split': 'vertical',
\ 'direction': 'topleft',
\ 'listed': 1,
\ 'show_ignored_files': 0,
\ 'root_marker': '≡ ',
\ 'ignored_files':
\ '.mypy_cache,.pytest_cache,.git,.hg,.svn,.stversions'
\ . ',__pycache__,.sass-cache,*.egg-info,.DS_Store,*.pyc,*.swp'
\ })
autocmd FileType defx call s:defx_mappings()