Questions tagged [file-formats]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
19 views

fileformat=dos not persistent despite "set hidden fileformats=dos,unix"

I have posted about making fileformat=dos persistent in past years, here and here. So far, the best advice is :set fileformats=dos,unix hidden. It does cause fileformat=dos to persist, but only for ...
user2153235's user avatar
2 votes
2 answers
94 views

Export Libreoffice Thesaurus to Vim compatible format with a macro?

It has been impossible for me to find an offline Spanish thesaurus in a format that worked in Vim. Libreoffice Spanish Thesaurus looks good, needs some conditional modifications and is 66000 lines ...
MrM's user avatar
  • 23
1 vote
1 answer
132 views

Hide ^M in file with mixed line endings without modifying the file

I have a file with mixed Unix-style (LF) and Windows-style (CRLF) line endings. If a file has consistent endings on all lines, vim will display all the lines without any special marking on the end. If ...
Keith Thompson's user avatar
4 votes
3 answers
116 views

How do I get VIM to keep the Ctrl-Z at the end of a CP/M or DOS file?

I'm using Vim 8.2 to edit some text files for a very old MSX-DOS system; these have a Ctrl-Z (0x1A) character after the final CR LF to indicate the end of the file, as is usual with CP/M and similar ...
cjs's user avatar
  • 347
0 votes
1 answer
119 views

How to set fileformat based on file type?

In a project I need to set fileformat=dos for all *.html files. Is it possible to do with autocmd? My fileformats=unix,dos by default, since I'm on Linux. I've tried the simplest way: autocmd BufRead *...
d.k's user avatar
  • 638
1 vote
1 answer
55 views

Make vim remember the fileformat of a buffer (round 2)

I followed the advice here to make only one buffer hidden so that it remembers settings like fileformat=dos: set bufhidden=hide " This should be the solution e ++ff=dos " All the ^M ...
user2153235's user avatar
1 vote
2 answers
240 views

Using vim // gvim with unix file format under Windows 10 + Cygwin gets errors from both

This is the second of two errors posted tonight. As mentioned before, I did re-install vim/gvim 8.2 to make sure I'd installed it as administrator, as instructed, to make sure the batch files, etc., ...
GTbrewer's user avatar
2 votes
1 answer
948 views

Why does not Vim feed the correct set of newline characters?

I'm trying to wrap my head around how Vim deals with line endings in different file formats. Say you have a file with DOS line endings, file.txt: echo -en 'line1\nline2' > file.txt unix2dos file....
ollehu's user avatar
  • 23
1 vote
1 answer
29 views

Why does :read ++edit doesn't set fileformat, fileencoding?

When comparing a buffer to it's on disk file, I regularly do (omitting the diffthis): :botright vnew :r ++edit # According to https://vimhelp.org/insert.txt.html#%3Aread the option ++edit should set ...
JohnDoe's user avatar
  • 363
2 votes
1 answer
93 views

Make vim remember the fileformat of a buffer

I am using vim to view Spyder's Python comman history. I set to :e +=ff=dos to get rid of ^M at the end of each line. When I switch to another file, then switch back, the fileformat is unix again. ...
user2153235's user avatar
0 votes
1 answer
68 views

Define a fold that can not be searched, and that isn't affected by other fold commands?

POD is a markup file that is used by Perl. It's a pretty unreasonable documentation format that has nothing to do with perl (accept for being the only known use-case), and it's sometimes found ...
Evan Carroll's user avatar
  • 1,226
2 votes
1 answer
3k views

View ^M as newline in vim without persistent file conversion

When editing a dos-format file from a codebase which is mainly used with Visual Studio in a Windows environment on my local Ubuntu machine with VIM, I get to see the ^M character instead of a newline. ...
easytarget's user avatar
4 votes
1 answer
1k views

How to prevent vim-jsx from mangling my indentation?

Looks like the issue is caused by vim-jsx. Given: componentDidMount: function() { ▐$.ajax({ }); I press enter to move $.ajax onto a new line and the top line folds as well: componentDidMount: ...
firedev's user avatar
  • 2,362
1 vote
0 answers
717 views

Editing rich text document (.rtf) [duplicate]

In college sometimes we are not allowed to use MS Word (because we cant use autocorrect or the red underline) and I also want to use VIM so I can type quicker. Is there a way how I can make and edit ...
iProgram's user avatar
  • 1,589
15 votes
1 answer
6k views

Is it possible to easily work with .odt, .doc, .docx, .rtf, and other non-plain-text formats in Vim?

Occasionally someone sends me a .odt, .doc, and .docx file; opening them in OpenOffice is always a pain because, well, OpenOffice. Right now I use a variety of commandline tools (such as odt2txt) to ...
Martin Tournoij's user avatar