-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_vimrc
112 lines (100 loc) · 2.38 KB
/
dot_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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
"color
syntax enable
colorscheme darkblue
highlight Normal ctermbg=none
highlight NonText ctermbg=none
highlight LineNr ctermbg=none
highlight Folded ctermbg=none
highlight EndOfBuffer ctermbg=none
"essential
if &compatible
set nocompatible
endif
set list
set ruler
set number
set hidden
set incsearch
set showmatch
set smartcase
set expandtab
set tabstop=2
set nowrapscan
set ignorecase
set autoindent
set cursorline
set matchtime=1
set history=1000
set shiftwidth=2
set pumheight=10
set encoding=utf-8
scriptencoding utf-8
set display=lastline
set nrformats=alpha,octal,hex,bin
set fileencodings=utf-8,ios-2022-jp,euc-jp,sjis,cp932
set listchars=tab:»-,trail:·,extends:»,precedes:«,nbsp:%
"like spacemacs
let g:mapleader = "\<Space>"
nnoremap <Space> <Nop>
nnoremap <leader>fed :<C-u>e ~/.vimrc<CR>
nnoremap <leader>feR :<C-u>w<CR>:so ~/.vimrc<CR>
"quit
nnoremap <leader>qq :<C-u>qa<CR>
nnoremap <leader>wq :<C-u>wq<CR>
"number
nnoremap <leader>nn :<C-u>set nu!<CR>
nnoremap <leader>nr :<C-u>set rnu!<CR>
"highlight
nnoremap <leader><leader> :<C-u>nohlsearch<CR>
"window
nnoremap <leader>w- <C-w>s
nnoremap <leader>w/ <C-w>v
nnoremap <leader>ww <C-w>w
nnoremap <leader>wW <C-w>W
nnoremap <leader>0 <C-w>t
nnoremap <leader>1 <C-w>t<C-w>w
nnoremap <leader>2 <C-w>t<C-w>w<C-w>w
nnoremap <leader>3 <C-w>t<C-w>w<C-w>w<C-w>w
nnoremap <leader>4 <C-w>t<C-w>w<C-w>w<C-w>w<C-w>w
nnoremap <leader>5 <C-w>t<C-w>w<C-w>w<C-w>w<C-w>w<C-w>w
nnoremap <leader>w= <C-w>=
nnoremap <leader>w< <C-w><
nnoremap <leader>w> <C-w>>
nnoremap <leader>wd <C-w>c
"buffer
nnoremap <leader>b :<C-u>b
nnoremap <leader>bb :<C-u>ls<CR>
nnoremap <leader>bp :<C-u>bp<CR>
nnoremap <leader>bn :<C-u>bn<CR>
nnoremap <leader>bd :<C-u>bd<CR>
"file explorer
nnoremap <leader>ff :<C-u>E<CR>
nnoremap <leader>f- :<C-u>Se<CR>
nnoremap <leader>f/ :<C-u>Ve<CR>
"replace
nnoremap <leader>s :<C-u>%s///g<Left><Left><Left>
vnoremap <leader>s :s///g<Left><Left><Left>
"cursor
noremap k gk
noremap j gj
noremap gk k
noremap gj j
noremap H ^
noremap L $
cnoremap <C-f> <Right>
cnoremap <C-b> <Left>
cnoremap <C-a> <C-b>
cnoremap <C-u> <C-e><C-u>
"other
nnoremap Y y$
nnoremap > >>
nnoremap < <<
nnoremap x "_x
nnoremap s "_s
inoremap <C-]> <ESC><Right>
"fileType
augroup fileType
autocmd!
"whitespace
autocmd BufNewFile,BufRead *.ws setlocal noautoindent noexpandtab tabstop=1 listchars=tab:–~,trail:·,eol:¬,extends:»,precedes:«,nbsp:%
augroup END