proc toInsert w { $w yview -pickplace insert }
bind Text <Left> { %W mark set insert insert-1chars; toInsert %W} 
bind Text <Right> { %W mark set insert insert+1chars; toInsert %W}
bind Text <Down> { %W mark set insert insert+1lines; toInsert %W}
bind Text <Up> { %W mark set insert insert-1lines; toInsert %W}
bind Text <Control-b> { %W mark set insert insert-1chars; toInsert %W} 
bind Text <Control-f> { %W mark set insert insert+1chars; toInsert %W}
bind Text <Control-n> { %W mark set insert insert+1lines; toInsert %W}
bind Text <Control-p> { %W mark set insert insert-1lines; toInsert %W}
bind Text <Control-e> { %W mark set insert {insert lineend}; toInsert %W}
bind Text <Control-a> { %W mark set insert {insert linestart}; toInsert %W}
bind Text <Control-d> { %W delete insert insert+1c; toInsert %W}
bind Text <Control-k> { set killRing [%W get insert {insert lineend}]; %W delete insert {insert lineend} }
bind Text <Control-y> { %W insert insert $killRing }
bind Text <Mod1-greater> { %W mark set insert end; toInsert %W}
bind Text <Mod1-less> { %W mark set insert "1.0"; toInsert %W}
bind Text <Mod1-Delete> { %W delete {insert-1c wordstart} insert; toInsert %W}
bind Text <Mod1-b> { %W mark set insert {insert-1c wordstart}; toInsert %W}
bind Text <Mod1-f> { %W mark set insert {insert+1c wordend}; toInsert %W}
bind Text <Mod1-d> { %W delete insert {insert+1c wordend}; toInsert %W}

proc llast list { return [lindex $list [expr [llength $list]-1]] }
proc textHeight t { return [llast [$t configure -height]] }

bind Text <Control-v> { %W mark set insert "insert+[textHeight %W]l"; toInsert %W}
bind Text <Mod1-v> { %W mark set insert "insert-[textHeight %W]l"; toInsert %W}