-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc.general
executable file
·73 lines (62 loc) · 1.69 KB
/
vimrc.general
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
" General vim settings.
filetype plugin indent on
" color fixes for diffing
hi DiffChange term=bold ctermbg=92 guibg=DarkMagenta
hi DiffText term=reverse cterm=bold ctermbg=124 gui=bold guibg=Red
" General editor settings.
set cursorline
set tw=0
set ts=2
set sw=2
set ic
set smartcase
set ai
set incsearch
set nocompatible
syntax on
set backspace=indent,eol,start
set background=dark
set expandtab
set vb
set scrolloff=10
set ttimeoutlen=10
set lazyredraw
" Convenience for fast, careless typing.
com Q q
com W w
com WQ wq
com Wq wq
" Highlight parts of a line that are past the line limit.
autocmd BufNewFile,BufRead *.c,*.cc,*.h,*.py,*.sh,*.js,*.borg,*BUILD,*.gcl setlocal cc=81
autocmd BufNewFile,BufRead *.java,*.go setlocal cc=101
autocmd BufNewFile,BufRead *.java,*.go set ts=2
hi ColorColumn ctermbg=darkgrey guibg=darkgrey
" For showing tabs, useful for Go.
set list
set listchars=tab:»\
hi SpecialKey guifg=darkgrey ctermfg=darkgrey
" Key mappings.
map <C-A> <Home>
map <C-E> <End>
cmap <C-R> s///g<Left><Left><Left>
map! <C-A> <Home>
map! <C-E> <End>
map <F4> :set hlsearch!<CR>
imap <F4> <ESC>:set hlsearch!<CR>a
" toggle paste with F3
nnoremap \tp :set invpaste paste?<CR>
nmap <F3> \tp
imap <F3> <C-O>\tp
set pastetoggle=<F3>
" Highlight color
hi Search term=reverse ctermbg=Red ctermfg=White guibg=Red guifg=White
" Return to line we were on when we quit.
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" Stolen from cgw
",v brings up my .vimrc
"",V reloads it -- making all changes active (have to save first)
map ,v :sp $HOME/.vimrc<CR><C-W>_
map <silent> ,V :source $HOME/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>