-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
54 lines (43 loc) · 1.37 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
""""""""""""""""""""""""""""""""""""""""""""
" General Settings
""""""""""""""""""""""""""""""""""""""""""""
" Enable filetype plugins
filetype plugin on
filetype indent on
" Set to auto read when a file is changed from the outside
set autoread
" :W sudo saves the file
" (useful for handling the permission-denied error)
command W w !sudo tee % > /dev/null
" Set the textwidth to wrap at 80-chars
set textwidth=80
" Height of the command bar
set cmdheight=2
" Set backspace
set backspace=indent,eol,start
set encoding=utf8
set number
""""""""""""""""""""""""""""""""""""""""""""
" Line numbers
""""""""""""""""""""""""""""""""""""""""""""
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif
autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
augroup END
""""""""""""""""""""""""""""""""""""""""""""
" Color Settings
""""""""""""""""""""""""""""""""""""""""""""
syntax on
set background=dark
""""""""""""""""""""""""""""""""""""""""""""
" Git Settings
""""""""""""""""""""""""""""""""""""""""""""
set noswapfile
autocmd Filetype gitcommit setlocal spell textwidth=72
" https://superuser.com/a/904718
vnoremap \y y:call system("pbcopy", getreg("\""))<CR>
nnoremap \p :call setreg("\"", system("pbpaste"))<CR>p
noremap YY "+y<CR>
noremap P "+gP<CR>
noremap XX "+x<CR>