map <expr> h Key_h()
map <expr> j Key_j()
map <expr> k Key_k()
map <expr> l Key_l()
That also works like a charm. Somewhere in the those functions I call setpos() like this:
call setpos(".", [0, a:line, a:column, 0])
Unfortunately the only thing this does is to send cursor the first column at the line it is currently in. Further movement with h,j,k,l does nothing. From inside the mapped functions Key_h(), Key_j() I return nothing, since cursor movement is already performed.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
function Key_k()
let l:lineToGo = line(".") - 1
let l:columnToGo = col(".")
let b:noteUnderCursor = GetNoteOnLine(l:lineToGo)
call Key_Movement(l:lineToGo, l:columnToGo)
endfunction
function Key_Movement(line, column)
if !empty(b:noteUnderCursor)
if !(b:noteUnderCursor["line"] == a:line)
let l:indentLen = strlen(b:noteUnderCursor["indent"])
" accounting for "| " portion just after whispace indent
let l:indentLen = l:indentLen + 3
if a:column <= l:indentLen
call setpos(".", [0, a:line, l:indentLen, 0])
return
endif
endif
endif
call setpos(".", [0, a:line, a:column, 0])
endfunction
noremap <silent> k :call Key_k()<CR>
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/fyzeSj9BKNI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+unsubscribe@googlegroups.com.