Jump to last position in same buffer

It is well known how to jump to the last position in the jumplist: <C-o>
Quite often, that will lead me to some other buffer I have open. How do I jump only to positions in the current buffer?

1 Like
1 Like

Thanks a lot. This is exactly what I was looking for.

try these mappings:

local keys = { '[', ']', '{', '}' }
for i = 1, #keys do
    local rhs = string.format([==[%s<c-g>u]==], keys[i])
    local lhs = keys[i]
    map('i', lhs, rhs, {})
end