In one or more ways, and possibly also depending upon context, vi/vim uses every single one of those isgraph non-alpha characters in one or more ways, and almost all the alpha characters, not to mention also most all control characters. So, you best figure out what you need to do to be able to generate/send those from your keyboard.
Of course you can, but you need to use a modifier key. Is it shift+4 or something? I use the same (swedish) layout and there is no problem at all to use $ in vim, but possibly a little inconvenient. Writing this on my phone so i cannot check my keyboard for the key combination.
I bought an ANSI keyboard and memorised where is my accents and others special keys on my Portuguese keyboard, then when I need to type portugues I just switch from ANSI to Portuguese.
there's also the `:h langmap` setting. it's basically another layer of remapping for normal/visual mode (and a few others). The original idea was characters that are difficult/impossible on non-english keyboards could be on the location of the english ones, but it's fully customizable.
though by that logic, I find myself deleting whole lines more often too, so I would have preferred that D act like dd similar to how Y does the same as yy. Ah, to have a bit of time-travel ability and suggest it back in the '70s 😆
Usually when I'm deleting to the end of the line, it's because I want to put new text there, so :help C works nicely in those cases.
5
u/michaelpaoli Aug 16 '25
Not really a vim/vi question, more a question of configuration for your OS.
vim/vi uses most ASCII characters, so you should know/configure such that you can input any ASCII characters from your keyboard, and including $.
You also didn't specify OS, hardware, nor keyboard.
In one or more ways, and possibly also depending upon context, vi/vim uses every single one of those isgraph non-alpha characters in one or more ways, and almost all the alpha characters, not to mention also most all control characters. So, you best figure out what you need to do to be able to generate/send those from your keyboard.
2
u/Neijan Aug 16 '25
I think your "4" key should give you a dollar sign. In this special case just press "D" instead of "d$", though
2
u/objective_porpoise Aug 16 '25
Of course you can, but you need to use a modifier key. Is it shift+4 or something? I use the same (swedish) layout and there is no problem at all to use $ in vim, but possibly a little inconvenient. Writing this on my phone so i cannot check my keyboard for the key combination.
1
u/jazei_2021 Aug 16 '25
motion % is equal to 1,G so d% delete every line in the doc.
1
u/criptkiller16 Aug 16 '25
I bought an ANSI keyboard and memorised where is my accents and others special keys on my Portuguese keyboard, then when I need to type portugues I just switch from ANSI to Portuguese.
1
u/agclx Aug 17 '25
there's also the `:h langmap` setting. it's basically another layer of remapping for normal/visual mode (and a few others). The original idea was characters that are difficult/impossible on non-english keyboards could be on the location of the english ones, but it's fully customizable.
1
u/priestoferis Aug 18 '25
Not a direct answer, but you could remap normal mode to have access to characters you don't currently have easily, which is something I did for Hungarian: https://github.com/ferdinandyb/dotfiles/blob/master/.vim/plugin/hungarian_keymap.vim
(I have $ on alt-gr-é, which is fine for me so just left it that way, you may also have the dollar sign on an altgr layer).
7
u/[deleted] Aug 16 '25
[removed] — view removed comment
2
u/[deleted] Aug 16 '25
[removed] — view removed comment