diff options
-rw-r--r-- | doc/shortcuts.txt | 3 | ||||
-rw-r--r-- | vimrc | 42 |
2 files changed, 33 insertions, 12 deletions
diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index 51a7521..6b88797 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt | |||
@@ -1,3 +1,6 @@ | |||
1 | [normal mode] | ||
2 | f{char} - move cursor to the character {char} | ||
3 | |||
1 | [visual mode] - with selected lines | 4 | [visual mode] - with selected lines |
2 | gq - formats text so that it fits in whatever :set textwidth was set | 5 | gq - formats text so that it fits in whatever :set textwidth was set |
3 | 6 | ||
@@ -47,13 +47,14 @@ set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softt | |||
47 | set autoindent | " always set autoindenting on | 47 | set autoindent | " always set autoindenting on |
48 | set copyindent | " copy the previous indentation on autoindenting | 48 | set copyindent | " copy the previous indentation on autoindenting |
49 | set scrolloff=2 | " always keeps at least two lines visible (when seeking) | 49 | set scrolloff=2 | " always keeps at least two lines visible (when seeking) |
50 | set selectmode=key,mouse | " make [strg+]shift-{left|right} enter SELECT mode (windows alike) | 50 | set selectmode=mouse | " avoid using select mode (only with mouse) |
51 | set selection=exclusive | " includes last character of the selection into following command (like x or d) | ||
51 | 52 | ||
52 | set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap | 53 | set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap |
53 | set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap | 54 | set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap |
54 | set diffopt+=iwhite,filler | " lets diff ignore white spaces | 55 | set diffopt+=iwhite,filler | " lets diff ignore white spaces |
55 | set spell spelllang=en,de | " enable spell checker | 56 | set spell spelllang=en,de | " enable spell checker |
56 | set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) | 57 | set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) |
57 | set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews | 58 | set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews |
58 | set linebreak | " do not wrap in the middle of words | 59 | set linebreak | " do not wrap in the middle of words |
59 | set showcmd | " displays status line messages while selecting (matrix size) | 60 | set showcmd | " displays status line messages while selecting (matrix size) |
@@ -126,16 +127,17 @@ endif | |||
126 | 127 | ||
127 | if has("gui_running") | 128 | if has("gui_running") |
128 | set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like | 129 | set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like |
129 | set guitablabel=%t | " do not display full path as tabname | 130 | set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode |
130 | set guioptions+=m | " menu bar | 131 | set guitablabel=%t | " do not display full path as tabname |
131 | set guioptions+=T | " toolbar | 132 | set guioptions+=m | " menu bar |
132 | set guioptions+=r | " right-hand scroll bar | 133 | set guioptions+=T | " toolbar |
133 | set guioptions-=c | " use console dialogs instead of popups | 134 | set guioptions+=r | " right-hand scroll bar |
134 | set guioptions+=a | " autoselect: copy&paste using middleclick | 135 | set guioptions-=c | " use console dialogs instead of popups |
135 | set guioptions+=e | " add tab pages | 136 | set guioptions+=a | " autoselect: copy&paste using middleclick |
136 | set guioptions+=p | " use gui pointer callback for x11 | 137 | set guioptions+=e | " add tab pages |
137 | set toolbariconsize=large | " make the icon toolbar as big as possible | 138 | set guioptions+=p | " use gui pointer callback for x11 |
138 | "set columns=80 | " set initial window width (so that it fits the terminals) | 139 | set toolbariconsize=large | " make the icon toolbar as big as possible |
140 | "set columns=80 | " set initial window width (so that it fits the terminals) | ||
139 | else | 141 | else |
140 | if &term =~? 'mlterm\|xterm\|screen' | 142 | if &term =~? 'mlterm\|xterm\|screen' |
141 | set t_Co=256 | " fixes incompatibilities with our color scheme | 143 | set t_Co=256 | " fixes incompatibilities with our color scheme |
@@ -163,6 +165,18 @@ nnoremap j gj|nnoremap k gk| " do not jump over wrapped lines | |||
163 | 165 | ||
164 | nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before | 166 | nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before |
165 | nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line | 167 | nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line |
168 | function ExtendedHome() | ||
169 | let column = col('.') | ||
170 | normal! ^ | ||
171 | if column == col('.') | ||
172 | normal! 0 | ||
173 | endif | ||
174 | endfunction | ||
175 | noremap <Home> ^ | ||
176 | noremap <silent> <Home> :call ExtendedHome()<CR> | ||
177 | |||
178 | nnoremap <C-z> u | ||
179 | |||
166 | 180 | ||
167 | 181 | ||
168 | " plugin hotkeys | 182 | " plugin hotkeys |
@@ -170,6 +184,10 @@ map <C-l> :TlistToggle<CR>| " bind TagList to Hotkey Ctrl+L | |||
170 | inoremap <buffer> ( <C-X><C-o><C-p>(| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) | 184 | inoremap <buffer> ( <C-X><C-o><C-p>(| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) |
171 | 185 | ||
172 | 186 | ||
187 | set makeprg=make\ test | ||
188 | nnoremap <F5> :!make<CR>| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) | ||
189 | |||
190 | |||
173 | "================================================================================ | 191 | "================================================================================ |
174 | " deactivated on-demand commands (just in case one needs them one day) | 192 | " deactivated on-demand commands (just in case one needs them one day) |
175 | " | 193 | " |