-
Notifications
You must be signed in to change notification settings - Fork 0
/
xvimrc
36 lines (34 loc) · 1.02 KB
/
xvimrc
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
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set cindent shiftwidth=2
set smartindent
set mouse=a
set cursorline
set cursorcolumn
hi CursorLine term=none cterm=none guibg=#303000 ctermbg=234
filetype indent on
filetype plugin on
filetype plugin indent on
set clipboard=unnamed
" shortcut config
imap jj <Esc>
nnoremap <Space> :
map <TAB> >
map <S-TAB> <
" shift + j/k to switch buffer
nmap <silent> <S-j> :bp<CR>
nmap <silent> <S-k> :bn<CR>
" delete buffer
nmap <silent> <leader>d :bn\|bd #<CR>
" U = redo
nmap <S-u> <C-r>
" leader-s to save
noremap <silent> <leader>s :update<CR>
vnoremap <silent> <leader>s <C-C>:update<CR>gv
" inoremap <silent> <C-S> <C-O>:update<CR> to enable insert mode after saving
inoremap <silent> <leader>s <Esc>:update<CR>
inoremap <expr> <Tab> pumvisible() ? "\<C-y>" : "\<Tab>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' : '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' : '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'