-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.vimrc
More file actions
115 lines (85 loc) · 3.17 KB
/
.vimrc
File metadata and controls
115 lines (85 loc) · 3.17 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
set fileencodings=utf-8,latin1
set encoding=utf-8
set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
" Enable Line Numbers (left-hand side)
set number
" Auto-Indenting + pastemode (sorta works)
set autoindent " always set autoindenting on
"map <F2> :set noautoindent<CR>i
"imap <F2> <ESC>:set noautoindent<CR>i
"map <F3> <ESC>:set autoindent<CR>
"imap <F3> <ESC>:set autoindent<CR>
map ` :set nonumber<CR>:set paste<CR>i
au InsertLeave * set nopaste
au InsertLeave * set number
set showmode
" Highlight under the cursor
"autocmd CursorMoved * exe printf('match IncSearch /\<%s\>/', expand('<cword>'))
"set backup " keep a backup file
set viminfo='20,\"5000 " read/write a .viminfo file, don't store more than 50 lines of registers
set history=500 " keep 50 lines of command line history
" Show Matches as you type in search
set incsearch
" Status bar (bottom) shows line filename and number
set ruler
set title
set ls=1
" When opening a file, jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" Highlight matches for the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" More gental scrolling with Shift-up/down
map <S-Up> 10k10<C-Y>zz
imap <S-Up> <ESC>10k10<C-Y>zzi
map <S-Down> 10j10<C-E>zz
imap <S-Down> <ESC>10j10<C-E>zzi
map <C-Up> <C-u>M
map <C-Down> <C-d>M
" Shortcut "d-z" deletes the rest of the line.
nnoremap dz d$
" Tabs = two spaces
set tabstop=13 softtabstop=2 shiftwidth=2 expandtab
syntax match Tab /\t/
hi Tab gui=underline guifg=blue ctermbg=blue
" F2 = Tabs, F3 = 2spaces, F4 = 13wide-Tabs
map <F2> <ESC>:set tabstop=5 softtabstop=5 shiftwidth=5 noexpandtab <CR>
imap <F2> <ESC>:set tabstop=5 softtabstop=5 shiftwidth=5 noexpandtab <CR>i
map <F3> <ESC>:set tabstop=13 softtabstop=2 shiftwidth=2 expandtab <CR>
imap <F3> <ESC>:set tabstop=13 softtabstop=2 shiftwidth=2 expandtab <CR>i
map <F4> <ESC>:set tabstop=13 softtabstop=13 shiftwidth=13 noexpandtab <CR>
imap <F4> <ESC>:set tabstop=13 softtabstop=13 shiftwidth=13 noexpandtab <CR>i
" Still not entirely clear what this crap does...
if has("cscope") && filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
" Pathogen for managing other vim plugins
call pathogen#infect()
source /usr/share/vim/google/google.vim
" This would enable scroll-wheel support from command-line Vim, which is cool,
" but it breaks select-to-copy while Vim is in find-mode.
"set mouse=a
augroup module
autocmd BufRead,BufNewFile *.inc set syntax=cpp
autocmd BufRead,BufNewFile *.blueprint set syntax=gcl
" Default to Tab mode for Makefile and *.php
autocmd BufRead,BufNewFile *.php set tabstop=5 softtabstop=5 shiftwidth=5 noexpandtab
autocmd BufRead,BufNewFile Makefile set tabstop=5 softtabstop=5 shiftwidth=5 noexpandtab
augroup END