From f11183e8daa88e99215d48bb6c5c726e3d84b06c Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Mon, 14 Sep 2015 05:29:53 +0200 Subject: fixed some bugs with easy movement --- doc/shortcuts.txt | 3 +++ 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 @@ +[normal mode] +f{char} - move cursor to the character {char} + [visual mode] - with selected lines gq - formats text so that it fits in whatever :set textwidth was set 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 set autoindent | " always set autoindenting on set copyindent | " copy the previous indentation on autoindenting set scrolloff=2 | " always keeps at least two lines visible (when seeking) -set selectmode=key,mouse | " make [strg+]shift-{left|right} enter SELECT mode (windows alike) +set selectmode=mouse | " avoid using select mode (only with mouse) +set selection=exclusive | " includes last character of the selection into following command (like x or d) set whichwrap=b,s,<,>,[,] | " beyond beginning/end line causes cusor to wrap set backspace=indent,eol,start| " allow backspacing over everything in insert mode, not needed with whichwrap set diffopt+=iwhite,filler | " lets diff ignore white spaces set spell spelllang=en,de | " enable spell checker -set virtualedit=onemore " one character beyond the line length should be navigatable (options: all,insert,block,onemore) +set virtualedit=onemore | " one character beyond the line length should be navigatable (options: all,insert,block,onemore) set breakindent cpoptions+=n | " when wrapping lines indent wrapped line to align with the previews set linebreak | " do not wrap in the middle of words set showcmd | " displays status line messages while selecting (matrix size) @@ -126,16 +127,17 @@ endif if has("gui_running") set guicursor=n-v-c:ver30-Cursor-blinkon500-blinkoff500 | " how the caret looks like - set guitablabel=%t | " do not display full path as tabname - set guioptions+=m | " menu bar - set guioptions+=T | " toolbar - set guioptions+=r | " right-hand scroll bar - set guioptions-=c | " use console dialogs instead of popups - set guioptions+=a | " autoselect: copy&paste using middleclick - set guioptions+=e | " add tab pages - set guioptions+=p | " use gui pointer callback for x11 - set toolbariconsize=large | " make the icon toolbar as big as possible - "set columns=80 | " set initial window width (so that it fits the terminals) + set mouseshape+=n:beam,v:beam | " display a text input cursor even in normal and selection mode + set guitablabel=%t | " do not display full path as tabname + set guioptions+=m | " menu bar + set guioptions+=T | " toolbar + set guioptions+=r | " right-hand scroll bar + set guioptions-=c | " use console dialogs instead of popups + set guioptions+=a | " autoselect: copy&paste using middleclick + set guioptions+=e | " add tab pages + set guioptions+=p | " use gui pointer callback for x11 + set toolbariconsize=large | " make the icon toolbar as big as possible + "set columns=80 | " set initial window width (so that it fits the terminals) else if &term =~? 'mlterm\|xterm\|screen' 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 nnoremap $ g$| " and make the $ key position the cursor after the last char of that line, not before nnoremap g$| " and make the key position the cursor after the last char of that line +function ExtendedHome() + let column = col('.') + normal! ^ + if column == col('.') + normal! 0 + endif +endfunction +noremap ^ +noremap :call ExtendedHome() + +nnoremap u + " plugin hotkeys @@ -170,6 +184,10 @@ map :TlistToggle| " bind TagList to Hotkey Ctrl+L inoremap ( (| " when opening a bracket: call the OmniComplete function, display the menu, but deselect the first entry (C-p) +set makeprg=make\ test +nnoremap :!make| " classic key binding: press F5 to compile and execute (if you have a Makefile with make test doing that) + + "================================================================================ " deactivated on-demand commands (just in case one needs them one day) " -- cgit v1.2.3