-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
96 lines (89 loc) · 1.94 KB
/
.vimrc
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
86
87
88
89
90
91
92
93
94
95
96
let mapleader=" "
let g:netrw_banner=0
filetype plugin indent on
set nocompatible
" Autocommands {{{
augroup autosave
au TextChanged,InsertLeave * if &modifiable && !empty(bufname()) | update | endif
augroup END
" }}}
" Options {{{
set shortmess+=I
set laststatus=2
set backspace=indent,eol,start
set hidden
set ignorecase
set smartcase
set incsearch
set hls
set noerrorbells visualbell t_vb=
set mouse+=a
set ai
set tabstop=8
set softtabstop=4
set shiftwidth=4
set expandtab
set splitbelow splitright
set nrformats+=alpha
set autochdir
set foldmethod=marker
set formatoptions+=/ro
set undofile
set undodir=~/.vim/undo
set cpoptions-=_
set gdefault
set autoread
set signcolumn=yes
" }}}
" Mappings {{{
" nvo mode
noremap <leader>p "0p
noremap <leader>P "0P
" Normal Mode {{{
nmap Q <Nop> " 'Q' in normal mode enters Ex mode. You almost never want this.
nnoremap <leader>w :w<CR>
nnoremap Y y$
nnoremap <leader>a <cmd>Lex 30<CR>
nnoremap <leader>u g~w
nnoremap <leader>fm <cmd>Neoformat<CR>
nnoremap <leader>y "+y
nnoremap <leader>Y "+y$
nnoremap <leader>yy "+yy
nnoremap <leader>- <C-^>
nnoremap <Up> <cmd>resize -4<CR>
nnoremap <Down> <cmd>resize +4<CR>
nnoremap <Left> <cmd>vertical resize -4<CR>
nnoremap <Right> <cmd>vertical resize +4<CR>
nnoremap <C-n> <cmd>noh<CR>
nnoremap vs <cmd>vs<CR>
nnoremap gJ @="Jx"<CR>
nnoremap gn ngn<esc>
nnoremap <M-k> <cmd>m -2<CR>
nnoremap <M-j> <cmd>m +1<CR>
nnoremap [c <cmd>cprevious<CR>
nnoremap ]c <cmd>cnext<CR>
nnoremap v <C-v>
nnoremap <C-v> v
nnoremap <C-,> gT
nnoremap <C-.> gt
nnoremap <S-CR> S<CR><ESC>
nnoremap <C-CR> o<ESC>
" }}}
" Visual Mode {{{
xnoremap <leader>i g<C-a>
xnoremap <leader>y "+y
xnoremap <M-j> :m '>+1<CR>gv
xnoremap <M-k> :m '<-2<CR>gv
xnoremap p "_dP
xnoremap // y/\\V<C-R>=escape(@\",'/')<CR><CR>
xnoremap > >gv
xnoremap < <gv
xnoremap <C-l> lOhO
xnoremap <C-h> hOlO
xnoremap <C-j> joko
xnoremap <C-k> kojo
" }}}
" Insert Mode {{{
inoremap <M-k> <esc><cmd>m -2<CR>a
inoremap <M-j> <esc><cmd>m +1<CR>a
" }}}