Thursday, January 19, 2023

Why does (my) Vim leave the cursor to the last mark even if I don't save the file?

Ok, the title is probably not accurate, so I'll try to explain.


Let's say I have a file with 5 lines

--------------------------

This is line 1
Another line
More lines
Even more lines
This is the last line

-------------------------

I save the file (Esc w q). When I reopen it, the cursor is at the end of
line 5.

Then I move the cursor up two lines. I quit without saving (Esc q!).

When I reopen the file, the cursor is now at the 3rd line.

Is this intended behaviour? If so, how can I tell Vim to ignore
movements but just this time?

$ cat .vim/vimrc
source $VIMRUNTIME/defaults.vim

"set shellcmdflag=-ic
set dir=~/.vim/tmp
set expandtab
set autoindent
set mouse=r

digraph bl 8226 " Insert Bullet with <CTRL>+k bl


iabbrev cwd <C-R>=strftime("%a %d/%m %H:%M")
iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
iabbrev mydate2 <C-R>=strftime("%Y%m%d")

map <f5> :1m$<cr>








--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/66b03b8d-a530-b179-ed9b-f7fc6f8975e7%40yahoo.com.

No comments: