Finally I found a solution, which I described here. So it is a matter of the right terminal and the right font configured there.
Vim is not able to recognize the sanskrit words as words. So when I move through the text with e.g. 'w', 'e' or 'b' the behaviour is unpredictable. Sometimes the cursor arrives in the middle of the word. For my needs that should be no problem. I will see what happens, when I work with vim-macros. Working mainly with LaTeX, I solve this with creating a \newcommand for each Sanskrit stanza in a separate file. So in the main file I do not have to work with ligatures.
Update - Jul 5 2023
After a few days of test phase I give a short update. It is not a perfect solution, but better what I had before.
I work with kitty as a terminal and in the ~/.config/kitty/kitty.conf
I changed the fonts to DejaVu Sans Mono
.
Kitty
has a function to specify special fonts for particular characters. I tried to change with symbol_map U+900-U+097F Sanskrit 2003
according to the Sanskrit Unicodes. Interestingly the output is nicer with a global DejaVu Sans Mono
than with special fonts. Might be this is because Sanskrit 2003
fonts is not an official font of kitty (kitty +list-fonts
lists only: SourceCodeVF, Source Code Pro, Nimbus Mono PS, Liberation Mono, Iosevka Term, DejaVu Sans Mono and Bitstream Vera Sans Mono). Maybe it is possible to include more fonts into kitty?
So with Kitty
and DejaVu Sans Mono
I got the best results with the output. So the "display-issue" I have solved. But still I cannot edit the Sanskrit-Ligatures the proper way:
Typing with fcitx5
When I import the ligatures from a Devanagari-Engine
like Sanscript I have nice results. When I try to typ myself with fcitx5 the ligatures are not formed proper and the words become "splitted". Maybe I have to try fcitx5-gtk?
Editing with Vim commands
Editing with Vim commands is difficult because the fonts too become sometimes "splitted" and Vim does not recognize the ligatures as a word. A bit tricky.
So I still avoid to edit the ligatures as much as possible in Vim. I created for the use with ´tex` some .sty-files with macros of the Sanskrit stanzas which I include into the many document.
The trial with GUI neovimgtk was no success.
Any hints for improvement are welcome.