forked from jbeyers/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
139 lines (111 loc) · 3.52 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
" Start off with Pathogen to manage plugins. See:
" https://github.com/tpope/vim-pathogen
call pathogen#infect()
" Settings that I use every day.
behave xterm
" Automatically use indenting according to filetype
:filetype indent on
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backspace=2
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set expandtab
set hidden
set hlsearch
set ignorecase
set incsearch
set nonumber
set tabstop=4
set scrolloff=4
set shiftwidth=4
set wildmode=longest,list
filetype plugin on
" Settings for solarized colorscheme. See:
" https://github.com/altercation/vim-colors-solarized
syntax enable
set background=light
if has('gui_running')
colorscheme solarized
endif
"syntax on
" Next and previous buffers
" These are commented out, since I use Terminator, which maps these to
" next/previous windows in the terminal.
"map <C-S-Tab> :bp<C-M>
"map <C-Tab> :bn<C-M>
" This is commented out because it messes with snipMate tab completion. Still
" need to see if it works better this way.
" function InsertTabWrapper()
" let col = col('.') - 1
" if !col || getline('.')[col - 1] !~ '\k'
" return "\<tab>"
" else
" return "\<c-p>"
" endif
" endfunction
" inoremap <tab> <c-r>=InsertTabWrapper()<cr>
" iskeyword: Add the dash ('-') as "letter" to "words".
" iskeyword=@,48-57,_,192-255 (default)
set iskeyword=@,48-57,_,192-255,-
" Obvious mappings
map <PageUp> <C-B>
map <PageDown> <C-F>
let loaded_vimspell=1
set tags=./tags;
"
" 2008 mappings for often-repeated macros
nmap ;t Oimport pdb;pdb.set_trace()<esc>
nmap ;r a/<esc>f dt>
" Remove "control-m"s at the end of lines
nmap ;rcm %s/<C-M>$//g
" Insert current date
map ;d O<C-R>=strftime("%Y-%m-%d")<cr><Esc>
" Tidy up html
map ;ht :!tidy -q -i --show-errors 0<CR>
" xml and html files tabstops should be 4 spaces
autocmd BufNewFile,BufRead *.py set tabstop=4 shiftwidth=4
autocmd BufNewFile,BufRead *.yml set tabstop=2 shiftwidth=2
" Plone dev
" Vdex files (ATVocabularyManager uses these)
autocmd BufNewFile,BufRead *.vdex set filetype=xml
au BufNewFile,BufRead *.zctl set filetype=python
" Recognise pt and zcml files
au BufNewFile,BufRead *.pt set filetype=html.pt
au BufNewFile,BufRead *.zcml set filetype=xml.zcml
" Snipmate needs to recognise files for snipmate_for_django.
au FileType python set ft=python.django " For SnipMate
au FileType html set ft=htmldjango.html " For SnipMate
" CSS tidy integration
au filetype css setlocal equalprg=csstidy\ -\ --template=$HOME/.vim/curly.tpl\ --preserve_css=true\ --silent=true
" Stuff for flex development
au BufNewFile,BufRead *.mxml set filetype=xml
au BufNewFile,BufRead *.as set filetype=actionscript
syntax on
" Syntastic status line.
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" Syntastic disable the signs down the left-hand side
let g:syntastic_enable_signs=0
" put a different color background on the 80th column
set colorcolumn=80
" syntastic js checker jshint
let g:syntastic_javascript_checkers = ['jshint']
" Don't let syntastic check my rst files!
let g:syntastic_mode_map = { 'passive_filetypes': ['java', 'rst'] }
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
setglobal fileencoding=utf-8
"setglobal bomb
set fileencodings=ucs-bom,utf-8,latin1
endif
" Remove the Windows ^M - when the encodings gets messed up
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
" No annoying sound on errors
set errorbells
set visualbell
set t_vb=
set tm=500