15 votes
Accepted

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

You should be able to add something like this to your vimrc: autocmd BufReadPost *.odt :%!odt2txt % That will send the entire buffer through the odt2txt program after it's read in by vim, but only ...
user avatar
  • 4,690
6 votes
Accepted

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

There are two problems with your approach. First is using -b which turns on the 'binary' setting and the binary setting will ignore fileformat. See this snippet of :help 'binary': Also, '...
user avatar
  • 25.8k
4 votes

Make vim remember the fileformat of a buffer

Add dos to your fileformats option. If fileformats contains dos and all lines of a file end with <CR><NL> the fileformat option of that file is automatically set to dos. Addendum: @...
user avatar
4 votes
Accepted

View ^M as newline in vim without persistent file conversion

^M visible with ff=dos If set ff? reports that the file is dos and you are seeing ^M carriage return characters at the end of any lines, then your file already has broken, non-conforming line-endings....
user avatar
  • 27.5k
2 votes
Accepted

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

You can add an autocmd to have Vim execute :e ++ff=dos every time this particular file is read or reloaded. Assuming the path to the file, after resolving symbolic links, is ~/VendorApp/DataCamp/...
user avatar
  • 25.8k
2 votes
Accepted

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

You're confusing fileformat (dos or unix) and fileencoding (utf-8, iso-8859-1) with filetype (yaml, c, python, tex, etc.) With ++edit, the :read command will set the former two (so you can read a ...
user avatar
  • 25.8k
2 votes

How to prevent vim-jsx from mangling my indentation?

According to mxw/vim-jsx#63 there may have been a bug in pangloss' vim-javascript that triggered this issue. It doesn't reproduce on the current (circa 2016 Feb 8) master branches for vim-jsx and its ...
user avatar
1 vote

How to set fileformat based on file type?

There are in fact 4 different ways to do this. You can read all of them in :h new-filetype. I will only describe the simplest solution: In your user runtime directory, create a new file in your ...
user avatar
1 vote

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

You can probably use foldexpr to do this. Here is a gist written by a person on the Internet. It defines a foldexpr function for folding the POD format. I tried it on a random Perl script I found on ...
user avatar
  • 1,643

Only top scored, non community-wiki answers of a minimum length are eligible