summaryrefslogtreecommitdiff
path: root/.vimrc
blob: 789fb4e9697f1b6d25ce5c40fa054e234a5b2105 (plain)
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
" =======================================================
" GENERAL
" =======================================================

" Colorscheme
colorscheme desert

" Filetype
filetype indent on
filetype plugin on

" More general stuff
set nu
set fenc=utf-8
set modeline
set ts=4
set sw=4
set sts=4
set expandtab
set guifont=Monospace\ 12
set spelllang=de_20

if has("gui") " nice cursorline in the gui
    set cursorline
endif

let mapleader = ","
let &guicursor = &guicursor . ",a:blinkon0"

" statusline
set laststatus=2 " always show line
set statusline=%-3.3n\ %f\ %r%w[%{strlen(&ft)?&ft:'none'},%{strlen(&fenc)?&fenc:&enc.'\ (G)'},%{&fileformat}]%m%=%-14.(%l,%c%V%)%<%P

" =======================================================
" COMPLETION
" =======================================================

" Omnicomplete
autocmd FileType python set omnifunc=pythoncomplete#Complete
" nothing set for C/C++ -- done by the autoload feature
set completeopt=longest,menu,preview
set tags+=~/.vim/tags

for tag in split(glob("~/.vim/tags.d/*"), "\n")
    let &tags .= "," . tag
endfor

" Allow Return to select a match
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"

" pydiction
let g:pydiction_location = '~/.vim/pydiction/complete-dict'

" =======================================================
" CUSTOM MAPPINGS
" =======================================================

" Some maps
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
nmap <silent> <F12> :Tlist<CR>
nmap <silent> <F11> :TlistUpdate<CR>
nmap <silent> <F4> :ls<CR>:buf
map <C-Tab> gt
map <C-S-Tab> gT

" Remap the 'file-toggle' cmd, as it does not work on my keyboard
map <C-6> <C-^>
imap <S-Tab> <C-X><C-O>

" =======================================================
" PLUGINS AND LANGUAGES
" =======================================================

" Stuff for the TagList-Plugin
let Tlist_Sort_Type = "name"
let Tlist_File_Fold_Auto_Close = 1
let Tlist_Exit_OnlyWindow = 1

" Stuff for the NERD Tree Plugin
let NERDTreeWinPos = 0 "have it on the right site

" Stuff for the cvs plugin
let VCSCommitOnWrite = 0

" Autotag -- correct C++ handling
let g:autotagCtagsCmd="ctags --c++-kinds=+p --fields=+iaS --extra=+q"

" stuff for gentoo syntax
let g:ebuild_error_on_trailing_whitespace=1 " show trailing whitespaces
let g:bugsummary_browser="firefox %s"

" for toggling in python
let g:toggle_words_dict = {'python': [['if', 'elif', 'else'], ['True','False']]} 
let python_highlight_numbers = 1
let python_highlight_space_errors = 1

" default to latex for .tex files
let g:tex_flavor = "latex"

" =======================================================
" FINAL
" =======================================================

" turn of any existing search
if has("autocmd")
    au VimEnter * nohls
endif