Sunday, September 6, 2020

Re: Broken Q key... how can I leave vim without saving?

Hi,

Jürgen Krämer schrieb am 02.09.2020 um 10:57:
>
> tuxic@posteo.de schrieb am 02.09.2020 um 10:40:
>> On 09/02 05:28, Paolo Bolzoni wrote:
>>>
>>> It is not a joke, my laptop keyboard is broken and seldom the keys Q,
>>> 4, Ins, and few others stop working.
>>> Is there a way to leave vim without saving without using the Q key?
>>
>> From insert mode try:
>>
>> <ESC>:exit
>
> this will save changes. One way to quit without saving changes I could
> think of is to first reload the buffer and exit then:
>
> :e! | exit

or in a lucky moment, when your Q key works, put something like

nnoremap <A-F4> :q<cr>
nnoremap <A-C-F4> :q!<cr>

in your ~/.vimrc. You can do this for the other keys, too, and even
map <F4> to 4, which (to my surprise) even works for entering a count
in front of a normal mode command, e.g., <F4>dd expands to 4dd.

Regards,
Jürgen

--
--
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/38e32a85-6e91-0ecc-56a0-4452b2ddbef1%40googlemail.com.

No comments:

Post a Comment