-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
79 lines (58 loc) · 1.35 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
color murphy
syntax enable
set tabstop=4
set softtabstop=4
" UI Config
set number
set showcmd
filetype indent on
set wildmenu
set lazyredraw
set showmatch
" Searching
set incsearch
set hlsearch
nnoremap <leader><space> :nohlsearch<CR>
" Folding
set foldenable
set foldlevelstart=10
set foldnestmax=10
nnoremap <space> za
set foldmethod=indent
" Movement
nnoremap j gj
nnoremap k gk
" highlight last inserted text
nnoremap gV `[v`]
" CtrlP settings
let g:ctrlp_match_window = 'bottom,order:ttb'
let g:ctrlp_switch_buffer = 0
let g:ctrlp_working_path_mode = 0
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" The encoding displayed
set encoding=utf-8
" The encoding written
set fileencoding=utf-8
filetype plugin on
set grepprg=grep\ -nH\ $*
" This enables automatic indentation as you type.
filetype indent on
" Clipboard stuff
set clipboard=unnamedplus
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <C-r><C-o>+
" Preserve clipboard on leave
if executable("xsel")
function! PreserveClipboard()
call system("xsel -ib", getreg('+'))
endfunction
function! PreserveClipboadAndSuspend()
call PreserveClipboard()
suspend
endfunction
autocmd VimLeave * call PreserveClipboard()
nnoremap <silent> <c-z> :call PreserveClipboadAndSuspend()<cr>
vnoremap <silent> <c-z> :<c-u>call PreserveClipboadAndSuspend()<cr>
endif