-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
125 lines (98 loc) · 3.5 KB
/
.vimrc
File metadata and controls
125 lines (98 loc) · 3.5 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
116
117
118
119
120
121
122
123
124
125
" My favoite color scheme.
color zellner
" Turn on colors.
syntax on
" Remember 700 lines of history.
set history=700
" Ignore case when searching unless it contains uppercase letters.
set ignorecase
set smartcase
" Make search act like search in Firefox
set incsearch
" Turn off backups
set nobackup
" Use spaces instead of tabs
set expandtab
set autoindent
set smartindent
set wrap "wrap lines
" Python commands.
augroup python
" Remove all other autocmds.
autocmd!
" Automatically turn tabs into spaces in .py files.
autocmd Filetype python retab!
" Make tab characters stand out
autocmd Filetype python setlocal list
" Make with pep8 first, then with pylint. Pylint requires an rcfile
" though.
autocmd Filetype python setlocal makeprg=pep8\ %;pylint\ --reports=n\ --output-format=parseable\ --rcfile=~/.pylintrc\ %
" This errorformat isn't perfect for either pep8 or pylint, but it works
" decently for both.
autocmd Filetype python setlocal errorformat=%f:%l%m
augroup end
" Gradle stuff (groovy)
augroup gradle
" Remove all other autocmds.
autocmd!
" Set syntax highlighting to Groovy
autocmd BufRead,BufNewFile *.gradle set filetype=groovy
" We seem to be using tabs for these
autocmd Filetype groovy setlocal nolist
autocmd Filetype groovy setlocal noexpandtab
augroup end
" Tell vim to use LaTeX, not some other TeX; turn on spell checker for only
" LaTeX and ReStructuredText.
au Filetype * set nospell
let g:tex_flavor='latex'
au Filetype tex set spell
au Filetype rst set spell
" If I'm in ReST, allow easy LaTeX injection with these macros. @a is inline
" LaTeX and @b is regular LaTeX.
au Filetype rst nnoremap @a i:rl:`$$`<esc>hi
au Filetype rst nnoremap @b i:rl:`\[\]`<esc>hhi
" Display line number and character position.
set ruler
" Load C syntax highlighting when editing interactive c files (for robot
" project).
au BufRead,BufNewFile *.ic set filetype=c
" Load C syntax highlighting when editing nesC files (for CSE-5473 project).
au BufRead,BufNewFile *.nc set filetype=c
" My own escape key that isn't as far away as the actual one. Using both jk
" and kj allows me to just jam the keyboard with the speed of one key but
" still have my escape key on home row.
inoremap jk <esc>
inoremap kj <esc>
" Allow backspacing in normal mode.
nmap <Backspace> i<Backspace><Right><esc>
" Insert a single character with the enter key in normal mode.
nnoremap <CR> i<Space><esc>r
" No need to be compatible with vi.
set nocompatible
" Set tabs to 4 spaces and auto tabs to four spaces.
set shiftwidth=4
set tabstop=4
" Set the title in terminals.
set title
" Enable cmdline autocomplete.
set wildmenu
" Know what type of file I'm editing.
filetype plugin on
" Paradigm recommended this one, but it makes restructured text unbearable.
" Removed.
" filetype indent on
" If I'm in the command line window, make escape able to close it.
au CmdwinEnter * nnoremap <buffer> <ESC> :q<cr>
" Mark trailing spaces with this ugly character to make them hard to miss.
set listchars=trail:·
" The default fold colors are terrible.
highlight Folded ctermbg=darkgrey ctermfg=green
" Have :tabf only show things in present directory, NOT /usr/include as it
" normally is by default. See ":help :tabf" -> ":help 'path'".
set path=.,,
" Set the spacebar to my leader key.
let mapleader = " "
" Do not highlight words that Vim thinks should be capitalized. In my
" experience, it's usually wrong, and it can look terrible on transparent
" terminal backgrounds
highlight clear spellcap