forked from rtregaskis/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 3
/
vimrc
161 lines (120 loc) · 3.31 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
" display filename and path in window title
set title
colorscheme koehler
" taken from debian.vim
set nocompatible
set backspace=indent,eol,start
set directory=/var/tmp//
" enable mouse in all modes
set mouse=a
" make mouse behave like mac/windows/gnome
set mousemodel=popup_setpos
set splitbelow
set splitright
" hilight search results
set hlsearch
" incremental search
" set incsearch
" show patching parentheses
set showmatch
" always display status line
set laststatus=2
" highlight current line
" set cursorline
" emulate default status line; add git branch info
" requires addon from http://github.com/taq/vim-git-branch-info
let g:git_branch_status_head_current=1
let g:git_branch_status_text=''
let g:git_branch_status_nogit=''
if exists ("GitBranchInfoString")
set statusline=%<%f\ %{GitBranchInfoString()}\ %h%m%r%=%-14.(%l,%c%V%)\ %P
en
set ruler
" show partial command in status line
set showcmd
" display possible choices when tab completing
set wildmenu
set shiftwidth=4
set tabstop=4
set autoindent
set noet
set nowrap
set linebreak
set modeline
set number
filetype on
filetype plugin on
syntax on
" hide toolbars, tearoff menu items and don't fork
set guioptions-=T
set guioptions-=t
set guioptions+=f
if has ("win32")
set guifont=DejaVu_Sans_Mono:h9
elseif has ("mac")
set guifont=Monaco:h12
else
set guifont=Monospace\ 10
endif
set display+=lastline
set spelllang=en_gb
autocmd FileType mail setlocal spell
autocmd FileType debchangelog setlocal expandtab
" don't use tabs in python files
autocmd FileType python setlocal expandtab
if filereadable ("~/.vim/python.vim")
autocmd FileType python source ~/.vim/python.vim
endif
autocmd filetypedetect BufNewFile,BufRead COMMIT_EDITMSG set ft=gitcommit
" actionscript, not atlas
autocmd! filetypedetect BufNewFile,BufRead *.as
autocmd filetypedetect BufNewFile,BufRead *.as set ft=actionscript
set pastetoggle=<F10>
" Make navigation behave more sensible when 'wrap' is set.
" Taken from <http://www.vim.org/tips/tip.php?tip_id=38>
"map <up> gk
"map <down> gj
"map <home> g<home>
"map <end> g<end>
"imap <up> <C-o>gk
"imap <down> <C-o>gj
"imap <home> <C-o>g<home>
"imap <end> <C-o>g<end>
filetype indent on
" disable syntax highlighting in diff mode
if &diff
"set columns=151
"map :q :qa
syn off
endif
" automatically load the GUI when run under X11
if has('gui') && $DISPLAY != ''
gui
endif
"set listchars=eol:,tab:␉\ ,trail:␠,extends:>,precedes:<,nbsp:␠
"set list
"autocmd BufWritePost,FileWritePost /home/sam/src/occ/data/occ.py silent !ln -sf <afile>:p ~/.openoffice.org2/user/Scripts/python/occ.py
if &term =~ "screen"
set ttymouse=xterm2
endif
" highlight TrailWhitespace ctermbg=red guibg=#ffdecd
" match TrailWhitespace /\s\+$\| \+\ze\t\|[^\t]\zs\t\+/
"autocmd Syntax * syn match TrailWhitespace /\s\+$\| \+\ze\t/
"
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>
let notabs = 1
nnoremap <silent> <F8> :let notabs=!notabs<Bar>:if notabs<Bar>:tabo<Bar>:else<Bar>:tab ball<Bar>:tabn<Bar>:endif<CR>
"
" set up pathogen
execute pathogen#infect()
nmap <F8> :TagbarToggle<CR>
" autoopen tag bar for lua
if has("gui_running")
if !&diff
autocmd BufEnter *.lua nested TagbarOpen
autocmd BufEnter *.py nested TagbarOpen
autocmd BufEnter *.js nested TagbarOpen
end
endif
au BufRead,BufNewFile *.md set ft=markdown