-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
56 lines (44 loc) · 1.09 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
syntax on
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set ai
set noswapfile
set number
set relativenumber
set smartindent
set hlsearch
set ruler
set paste
set mouse=a
set clipboard=unnamedplus
" Plug
" keybindings
nnoremap <SPACE> <Nop>
let mapleader = " "
"--" Moves highlighted text together in visual mode with J and K
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
"--" Does not move mouse when appending lines with J
nnoremap J mzJ`z
" Cursor in middle of screen after these commands
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
nnoremap n nzzzv
nnoremap N Nzzzv
"--" Can delete highlight without copying it and then paste the current buffer
xnoremap <leader>p \"_dP
"--" Yank multiple lines to clipboard easily
nnoremap <leader>y +y
vnoremap <leader>y +y
nnoremap <leader>Y +Y
"--" Only difference between escape and ctrl+c
inoremap <C-c> <Esc>
"--" Do not use Q
nnoremap Q <nop>
"--" Can easily replace all the words in a file
nnoremap <leader>s :%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>
"--" Have j and k working with word wrap
nnoremap k gk
nnoremap j gj