-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
122 lines (91 loc) · 2.81 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
"""""""""""
" General "
"""""""""""
" Set the color scheme
colorscheme desert
" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
set nocompatible
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on
" Enable syntax highlighting
syntax on
" Set maximum tabs available via 'vim -p '
set tabpagemax=999
" Always open in tabs
augroup open-tabs
au!
au VimEnter * ++nested if !&diff | tab all | tabfirst | endif
augroup end
" Use CTRL + arrows to switch tabs
nnoremap <C-Left> :tabprevious<CR>
nnoremap <C-Right> :tabnext<CR>
" Sets number of lines of history VIM has to remember
set history=500
" Enable mouse support
if has('mouse')
set mouse=a
endif
" Better command-line completion
set wildmenu
" Show partial commands in the last line of the screen
set showcmd
" Highlight searches
set hlsearch
" search as characters are entered
set incsearch
" Enable spell checking
set spell spelllang=en_us,de_de
""""""""""""""
" Usabillity "
""""""""""""""
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" Allow backspacing over autoindent, line breaks and start of insert action
set backspace=indent,eol,start
" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set autoindent
" Stop certain movements from always going to the first character of a line.
set nostartofline
" Display the cursor position on the last line of the screen or in the status
" line of a window
set ruler
" Always display the status line, even if only one window is displayed
set laststatus=2
" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
set confirm
" Set the command window height to 2 lines, to avoid many cases of having to
" "press <Enter> to continue"
set cmdheight=2
" Display line numbers on the left
set number
"""""""""""""""
" Indentation "
"""""""""""""""
" coming from other editors would expect.
set tabstop=6
set softtabstop=6
" set spaces instead of tabs
set expandtab
" Linebreak on 72 characters
"set lbr
"set tw=72
""""""""""""""""""
" User Interface "
""""""""""""""""""
" Highlight matching [{()}]
set showmatch
""""""""""""""""""""
" Show whitespaces "
""""""""""""""""""""
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()