-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
42 lines (33 loc) · 1.44 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
" ╭─────────────────────────────────────────────╮
" │ Written by Fady nagh from http://fadyio.com │
" │ Email:me@fadyio.com │
" │ Github: @fadyio │
" ╰─────────────────────────────────────────────╯
" Better paste
vnoremap <silent> p "_dP
" Disable annoying command line thing
nnoremap <silent> q: :q<CR>
" Easy insertion of a trailing ; or , from insert mode
inoremap <silent> ;; <Esc>A;<Esc>
inoremap <silent> ,, <Esc>A,<Esc>
" Delete char without copying it
nnoremap <silent> x "_x
" Unhighlight what you searched for
nnoremap <silent> <Esc><Esc> <Esc>:nohlsearch<CR><Esc>
" Visual --
" Stay in indent mode
vnoremap <silent> < <gv
vnoremap <silent> > >gv
" Move text up and down
vnoremap <silent> <A-j> :m .+1<CR>==
vnoremap <silent> <A-k> :m .-2<CR>==
" Maintain the cursor position when yanking a visual selection
" http://ddrscott.github.io/blog/2016/yank-without-jank/
vnoremap <silent> y myy`y
vnoremap <silent> Y myY`y
" Visual Block --
" Move text up and down
xnoremap <silent> J :move '>+1<CR>gv-gv
xnoremap <silent> K :move '<-2<CR>gv-gv
xnoremap <silent> <A-j> :move '>+1<CR>gv-gv
xnoremap <silent> <A-k> :move '<-2<CR>gv-gv