Vim Tips Wiki
Register
We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 86: Line 86:
   
 
Here are some changes that fix both:
 
Here are some changes that fix both:
<s>nnoremap <expr> . line(".") == line("$") ? "." : ".g`["</s>
+
nnoremap <expr> . line(".") == line("$") ? "." : ".g`["
 
[[User:Andres.p|Andres.p]] 04:27, December 8, 2010 (UTC)
 
[[User:Andres.p|Andres.p]] 04:27, December 8, 2010 (UTC)
 
'''EDIT''': Actually, I was anticipating the position after "."
 
 
Here's the true solution:
 
<pre>
 
function! ResDot(count)
 
execute "normal!" count . "."
 
if line("'[") <= line("$")
 
normal! g`[
 
endif
 
endfunction
 
 
nnoremap <silent> . :<C-U>call ResDot(v:count1)<CR>
 
</pre>
 
[[User:Andres.p|Andres.p]] 05:14, December 8, 2010 (UTC)
 
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)