aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2015-09-14 05:29:53 +0200
committerMax Christian Pohle2015-09-14 05:29:53 +0200
commitf11183e8daa88e99215d48bb6c5c726e3d84b06c (patch)
tree7d12f0a11a3bb9679e743d74478b5021b077f2bd
parent44f1e79ccd79c3983b59cb9c36a2af1e55738da1 (diff)
downloadvim-karlmarks-f11183e8daa88e99215d48bb6c5c726e3d84b06c.tar.bz2
vim-karlmarks-f11183e8daa88e99215d48bb6c5c726e3d84b06c.zip
fixed some bugs with easy movement
-rw-r--r--doc/shortcuts.txt3
-rw-r--r--vimrc42
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]
2f{char} - move cursor to the character {char}
3
1[visual mode] - with selected lines 4[visual mode] - with selected lines
2gq - formats text so that it fits in whatever :set textwidth was set 5gq - formats text so that it fits in whatever :set textwidth was set
3 6
diff --git a/vimrc b/vimrc
index a355697..4788809 100644
--- a/vimrc
+++ b/vimrc
@@ -47,13 +47,14 @@ set ts=2 sts=2 sw=2 expandtab | " indentation which i like (abbr: tabstop, softt
47set autoindent | " always set autoindenting on 47set autoindent | " always set autoindenting on
48set copyindent | " copy the previous indentation on autoindenting 48set copyindent | " copy the previous indentation on autoindenting
49set scrolloff=2 | " always keeps at least two lines visible (when seeking) 49set scrolloff=2 | " always keeps at least two lines visible (when seeking)
50set selectmode=key,mouse | " make [strg+]shift-{left|right} enter SELECT mode (windows alike) 50set selectmode=mouse | " avoid using select mode (only with mouse)
51set selection=exclusive | " includes last character of the selection into following command (like x or d)
51 52
52set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap 53set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap
53set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap 54set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap
54set diffopt+=iwhite,filler | " lets diff ignore white spaces 55set diffopt+=iwhite,filler | " lets diff ignore white spaces
55set spell spelllang=en,de | " enable spell checker 56set spell spelllang=en,de | " enable spell checker
56set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) 57set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore)
57set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews 58set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews
58set linebreak | " do not wrap in the middle of words 59set linebreak | " do not wrap in the middle of words
59set showcmd | " displays status line messages while selecting (matrix size) 60set showcmd | " displays status line messages while selecting (matrix size)
@@ -126,16 +127,17 @@ endif
126 127
127if has("gui_running") 128if 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)
139else 141else
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
164nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before 166nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before
165nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line 167nnoremap <End> g$| " and make the <End> key position the cursor after the last char of that line
168function ExtendedHome()
169 let column = col('.')
170 normal! ^
171 if column == col('.')
172 normal! 0
173 endif
174endfunction
175noremap <Home> ^
176noremap <silent> <Home> :call ExtendedHome()<CR>
177
178nnoremap <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
170inoremap <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) 184inoremap <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
187set makeprg=make\ test
188nnoremap <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"
..