-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path07vimrc
executable file
·70 lines (60 loc) · 1.43 KB
/
07vimrc
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
" -uオプションの弊害対応
set nocompatible
set backspace=indent,eol,start
" Lesson02
" Syntax and colorscheme
syntax enable
"colorscheme desert
" Lesson02
" Easy Escape
inoremap <silent>jj <ESC>
inoremap <silent>jk <ESC>
" Lesson03
" Edit and Source vimrc easily.
nnoremap <Space>ev :vsplit $MYVIMRC<CR>
nnoremap <Space>sv :source $MYVIMRC<CR>
" Lesson05
" Close with <Space>
nnoremap <Space>w :<C-u>w<CR>
nnoremap <Space>W :<C-u>wq<CR>
nnoremap <Space>q :<C-u>q<CR>
nnoremap <Space>Q :<C-u>q!<CR>
" Lesson05
" Go down as you see
noremap j gj
noremap k gk
noremap gj j
noremap gk k
" Lesson05
" We don't want to reach for ^ or $.
noremap <Space>h ^
"noremap <Space>h 0 #好みで
noremap <Space>l $
" Lesson06
" Plugin
if ! filereadable(expand('~/.vim/autoload/plug.vim'))
!curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-surround'
call plug#end()
" Lesson07
" Window operation
nnoremap s <Nop>
nnoremap ss :<C-u>split<CR>
nnoremap sv :<C-u>vsplit<CR>
" Move around window
nnoremap sj <C-w>j
nnoremap sk <C-w>k
nnoremap sl <C-w>l
nnoremap sh <C-w>h
" Move window
nnoremap sJ <C-w>J
nnoremap sK <C-w>K
nnoremap sL <C-w>L
nnoremap sH <C-w>H
" Lesson07
" quickfix and vim[grep
nnoremap <C-n> :cnext<CR>
nnoremap <C-p> :cprevious<CR>
nnoremap <Space>vp :vim ** \| cw<Left><Left><Left><Left><Left><Left><Left><Left>