![]() The reason I didn't notice this difference is that terminal Vim renders the characters the same way.Tip Run vimtutor in a terminal to learn the first Vim commands. It does, and ga with cursor on ä gives " typed Therefore this is likely a MacVim-specific problem.ī.) I was wrong to say this does not affect terminal Vim. Other filesystems seem to favor but not enforce UNF-C, composed. fileencodings is set to ucs-bom,utf-8,default,latin1 and fileformats to unix,dos,mac.Ī.) NFS+ requires file names to only contain characters in Unicode Normal Form D, that is, accented accented characters are decomposed. fileencoding defaults to encoding if it is not set, but I have also tried setting it explicitly before writing the buffer to file with no difference. But I have tested that it is already set by the time my vimrc is sourced (that's why I don't set it myself) so I figure that should be ok. I'm not sure where this option is set since latin1 is the default, I'm not setting it in my vimrc and :verbose set encoding doesn't tell me anything. Terminal Vim does not seem to have this problem.Įncoding is set to utf-8. There is no byte value 228 (ä) or 168 (¨) anywhere in the buffer. When I run it for a line with ja¨derberg.txt I get jaderberg.txt. I wrote a function to loop through all characters on the line and convert each to a number and back to a char, then write the results to the buffer. With the cursor on j and pressing l until end of line, here is how the line changes. If I move the cursor over the characters ja¨derberg.txt in the buffer, they change. I'm not sure what other info is relevant, so ask and I'll add. I don't understand why Vim should fail to correctly display the decomposed ä that is actually stored in the file name, and only when I give the file name with a decomposed ä. This breaks the symmetry though, I have to use terminal.app to navigate to a file, edit in MacVim (using mvim of course), quit MacVim and open up the terminal again. This seems to correspond to a difference between composed and decomposed characters. But, since the terminal.app doesn't support many of vim's rich features, I decided to make the step to MacVim. MacVim is a GUI version of vim for macOS MacVim is a port of the text editor Vim to macOS that is meant to integrate seamlessly with the native user interface. I don't know much about this, but I can tell there is a difference between how Terminal treats the character ä that I type and the character ä that is stored in a file name and completed with. "Accented characters" can be stored as a single code point or as a series of code points. Why is my status line not displaying the file name correctly when I open MacVim from Terminal and tab-complete the filename? If I type mvim jä Terminal refuses to complete the file name. ![]() If in Terminal I type out the whole file name, mvim jäderberg.txt, everything is fine. The file opens, but the statusline displays ja¨derberg.txt. Now I run MacVim from Terminal by typing mvim j. I do i% to put the file name into the buffer and it puts jäderberg.txt. set number ' Highlight cursor line underneath the cursor. filetype indent on ' Turn syntax highlighting on. filetype plugin on ' Load an indent file for the detected file type. filetype on ' Enable plugins and load plugin for the detected file type. My status line displays the file name jäderberg.txt. Vim will be able to try to detect the type of file is use. In MacVim I type :tabe jäderberg.txt to open a buffer for that file.
0 Comments
Leave a Reply. |