-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
95 lines (79 loc) · 2.63 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"should be invoked from ~/.vimrc like this:
"source ~/dotfiles/vimrc
"or substitute "~' with the true path to the repo
"or symlink ~/.vimrc to this file's path, that works too
set nocompatible " be iMproved, required
let mapleader = "\\"
source ~/dotfiles/plugins.vim
augroup vimrc_rainbow
"vim-rainbow for lisp only
au FileType lisp call rainbow#load()
"vim-rainbow excluding black
let g:rainbow_ctermfgs = ['brown', 'Darkblue', 'darkgray', 'darkgreen', 'darkcyan', 'darkred', 'darkmagenta', 'brown', 'gray', 'darkmagenta', 'Darkblue', 'darkgreen', 'darkcyan', 'darkred', 'red']
augroup END
" " enable this if languages other than Go are hanging on draw/redraw and failing
" " syntax highlighting
" set re=2
set tabstop=4
set softtabstop=0
set shiftwidth=4 "set default indenting to 4 spaces
set expandtab
set autoindent
set noimdisable
set iminsert=0
set imsearch=0
set noswapfile
set relativenumber "set relative numberlines
set number "show the line number of the one i'm on
set ruler "show the line and character number in bottom right, reset by compatible(/nocompatible?)
set textwidth=100
set scrolloff=1
"show the 80 char rule
set colorcolumn=+1
"but not in ugly red
highlight ColorColumn ctermbg=DarkBlue
set laststatus=2
set ignorecase
set smartcase
"make backspace work
set backspace=indent,eol,start
"lets search/replace work across many buffers
set hidden
" catch common save and quit mistakes
command! WQ wq "meant wq
command! Wq wq "meant wq
command! W w "meant w
command! Q q "meant q
"split verticallly
command Vba :vert ba "would be better as :vba but that needs plugin
command VBA :vert ba "and that plugin doesn't seem to be maintained in years
" copy visualy selected text to clip board
vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR>
"broken on Mac, I think?
" map ^[ means the Escape key, this is <Esc>+ etc.
map + <C-W>5+
map - <C-W>5-
map . <C-W>5>
map , <C-W>5<
map <C-+> <C-W>+
map <C--> <C-W>-
" map Ctrl+I to increment, replacing Ctrl+A which is used for tmux
map <C-I> <C-A>
"toggle numbers for printing or mouse copy-paste C-n for 'number'
nmap <C-n> :set invrelativenumber invnumber<CR>
"toggle pastemode C-p for 'paste'
nmap <C-p> :set invpaste<CR>
" check for updates to .vimrc
augroup myvimrc
au!
au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END
"set the :E to have the nice file tree structure
let g:netrw_liststyle=3
"for switching to big windows and back
nmap te :tabedit %<CR>
nmap td :tabclose<CR>
"load Go-focused aliases
source ~/dotfiles/go-mappings.vim
cnoreabbrev vres vertical resize