Let's say we handle a file that needs various speciffic settings: We have a file type, syntax, colorscheme, highlights, tab widths and more. Also, we have multiple plugins with
Now, we want to derive another file from that, like extracting matching lines. The extracted lined share many properties with the original file, but not all: The syntax has possibly changed: Maybe there were no consecutive lines of the matched lines possible.
Let's say we handle a file that needs various speciffic settings: We have a file type, syntax, colorscheme, highlights, tab widths and more. Also, we have multiple plugins with file speciffic settings.
Now we derive a new file, say we extract matching lines. How can we transfer the settings from the old file to the new?
There may be two different cases to handle: in one case, the new file is created from the old one by a series of changes on a copy of the file content - the copy could possibly include the settings, so they can be just kept the same.
The other case is that the new file is created independently, like output of a shell command. Here, the settings really need to be copied over.
:setfiletype javascript
.