-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.vim
85 lines (72 loc) · 1.85 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
colorscheme desert
set numberwidth=1
set number relativenumber
set ignorecase smartcase
set list
set listchars=tab:-\ ,trail:.
set pumheight=5
let g:editorconfig = v:false
set shortmess+=I
set inccommand=nosplit
let g:netrw_fastbrowse = 0
"disable mouse, we have tmux for that
set mouse=
set shiftwidth=4
set tabstop=4
set expandtab
set splitright splitbelow
set noswapfile nobackup nowritebackup
set undofile
set nomodeline
set hidden
set linebreak breakindent
set breakat=\
set breakindentopt=shift:4
map Q <C-w>w
map 0 ^
nmap gb :ls<CR>:b<Space>
nmap <silent> gl :b #<CR>
noremap <silent> <C-k> :bnext<CR>
noremap <silent> <C-j> :bprev<CR>
noremap <silent> <C-c><C-c> :nohlsearch<CR>
inoremap <silent> <C-k> <Esc>:bprev<CR>
inoremap <silent> <C-j> <Esc>:bnext<CR>
map <silent> <C-]> :ltag <C-r><C-w> \| lopen<CR>
noremap Č :
"disable arrow keys
map <Left> <Nop>
map <Right> <Nop>
map <Up> <Nop>
map <Down> <Nop>
imap <Left> <Nop>
imap <Right> <Nop>
imap <Up> <Nop>
imap <Down> <Nop>
"remap Ctrl+c to Esc
inoremap <C-C> <Esc>
vnoremap <C-C> <Esc>
"insert tab
inoremap <S-Tab> <C-v><Tab>
"move between brackets
inoremap () ()<Left>
inoremap {} {}<Left>
inoremap [] []<Left>
inoremap "" ""<Left>
inoremap '' ''<Left>
inoremap {<CR> {<CR>}<C-o>O
command! -nargs=+ Grep silent! grep! <args> | cwindow | setlocal nowrap
command! -nargs=1 -complete=file File enew | set buftype=nofile | 0read !find . -iname '*<args>*'
command! Reload source $HOME/.config/nvim/init.vim
command! W w
command! Mkdir :!mkdir -p '%:h'
" go to the position where you left
autocmd BufReadPost * silent! normal! g'"
" disable ignore case in insert mode
autocmd InsertEnter * set noignorecase | set nolist
autocmd InsertLeave * set ignorecase | set list
" handle resizing terminal window
autocmd VimResized * wincmd =
lua <<EOF
vim.g.editorconfig = false
EOF
silent! source $HOME/.config/nvim/local.vim