-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasevimrc
More file actions
90 lines (72 loc) · 1.98 KB
/
Copy pathbasevimrc
File metadata and controls
90 lines (72 loc) · 1.98 KB
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
set ignorecase
" Replace unnamed register with system clipboard
"set clipboard=unnamedplus
" Leader key combos
let mapleader=" "
noremap <leader>w :w<CR>
noremap <leader>q :q<CR>
noremap <leader><leader> ``
" Search and replace
nnoremap <leader>h :%s/
vnoremap <leader>h :s/
" Cycles to next search match and puts cursor in middle of screen
nnoremap n nzz
nnoremap <S-n> Nzz
" Insert mode leader combos
"inoremap jj <Esc>
inoremap jk <Esc>
" Split panes
noremap <leader>v :vsplit <CR>
noremap <leader>s :split<CR>
" Navigate panes
noremap <C-left> <C-w><C-h>
noremap <C-down> <C-w><C-j>
noremap <C-up> <C-w><C-k>
noremap <C-right> <C-w><C-l>
"noremap <C-h> <C-w><C-h>
"noremap <C-l> <C-w><C-l>
"noremap <C-k> <C-w><C-k>
"noremap <C-j> <C-w><C-j>
" Navigate tabs
noremap <S-left> gT
noremap <S-right> gt
"noremap <S-h> gT
"noremap <S-l> gt
" Quick indent of last visual selection
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
" Use system clipboard
nnoremap <leader>p "+p
nnoremap <leader>P "+P
vnoremap <leader>p "+p
vnoremap <leader>P "+P
" <leader>y prefixes yank with the system clipboard register so we can
" still use motions with the yank command. We do the same with d and c.
nnoremap <leader>y "+y
vnoremap <leader>y "+y
nnoremap <leader>d "+d
vnoremap <leader>d "+d
nnoremap <leader>D "+D
vnoremap <leader>D "+D
nnoremap <leader>c "+c
vnoremap <leader>c "+c
nnoremap <leader>C "+C
vnoremap <leader>C "+C
" Select all
noremap <leader>a ggVG
" Append ; to end of line
"noremap <leader>; :s/;\?$/;/<CR>
"inoremap ;; <esc>:s/;\?$/;/<CR>A
noremap <leader>; mzA;<esc>`z:delm z<CR>
inoremap ;; <esc>A;
" Append .ConfigureAwait(false) to end of line
noremap <leader>ca :s/;\?$/.ConfigureAwait(false);/<CR>
inoremap ca; <esc>:s/;\?$/.ConfigureAwait(false);/<CR>A
" Exit insert mode and save
inoremap ww <esc>:w<cr>
" const
inoremap cn<space> const
" Jump outside any parentheses or quotes:
inoremap jj <Esc>/[)}"'>]<CR>:nohl<CR>a
" Reduce blank lines to single blank line
noremap <leader>j :?.?+1,/./-2d<CR>