-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
64 lines (50 loc) · 1.26 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
let mapleader = ' ' " Change mapleader
set clipboard=unnamed,unnamedplus " Use the OS clipboard by default
set ignorecase " Ignore case of searches
set hlsearch " Highlight search words
set incsearch " Incremental search
set smartcase " When searching try to be smart about cases
set number " Enable line numbers
set relativenumber " Use relative line numbers
set scrolloff=12
" Remap keys for ortholinear keyboard
noremap 0 $
noremap ! 0
" Swap { to }
noremap { }
noremap } {
" Copy cursor to end
noremap Y y$
" Remap reundo
noremap U <C-r>
" Better Indent
vnoremap > >gv
vnoremap < <gv
" Increment/Decrement
nnoremap + <C-a>
nnoremap - <C-x>
xnoremap + <C-a>
xnoremap - <C-x>
" Clear search highlight
nnoremap <esc> :noh<return><esc>
" Fast save and quiting
nnoremap <Leader>q :q<CR>
nnoremap <Leader>w :w<CR>
" Fix * (Keep the cursor position, don't move to next match)
nmap * *N
" Fix n and N. Keeping cursor in center
nmap n nzz
nmap N Nzz
" Fix (CTRL + d) and (CTRL + u). Keeping cursor in center
nmap <C-d> <C-d>zz
nmap <C-u> <C-u>zz
" Faster movement to end and beginning of the line
nnoremap L $
nnoremap H ^
vnoremap L $
vnoremap H ^
" Window navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>