-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
86 lines (66 loc) · 1.29 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
set nocompatible
filetype off
" encoding
set encoding=utf8
" file
filetype plugin indent on
set autoread
set noswapfile
" tab and indent
set autoindent
set tabstop=4
set shiftwidth=2
set expandtab
set smarttab
set ai
set si
" code
set number
syntax on
" search
set hlsearch
set incsearch
" theme
let g:solarized_termcolors=256
set background=dark
let mapleader = ";"
" ====== Keys ======
" apply macros with Q
nnoremap Q @q
vnoremap Q :norm @q<cr>
" quicker indentation
nnoremap > >>
nnoremap < <<
nnoremap = ==
" dont loose selection on indenting
vnoremap > >gv
vnoremap < <gv
" dot works in visual selection mode!
vnoremap . :norm.<cr>
" D deletes to the end of the line
nnoremap D d$
" Y yanks to the end of the line
nnoremap Y y$
" better line begin (H) and end (L)
noremap H ^
noremap L $
vnoremap L g_
map <leader>c caw
map <leader>w :w!<cr>
map <leader>q :q!<cr>
map <leader>e :wq<cr>
map <silent> <leader><cr> :noh<cr>
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
" switch line
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
" change cursor position in insert mode
inoremap <C-h> <left>
inoremap <C-l> <right>
inoremap <C-j> <down>
inoremap <C-k> <up>