0

Unsure where to look for this, but since this morning every file I create is of type plaintext.

The last thing I did was remove vim to install the gtk-3 version for python support etc. Just Just before this I did make a python, C# and go file simply by using

touch file.<extension type>

What part of linux goes over assigning filetypes? Did I destroy something by building the gtk version of vim?

Update To further specify what I did before it changed. Before installing vim gtk-3 I used the following command to remove my old install

sudo apt remove vim vim-runtime gvim

then I installed the gtk version with

sudo apt install vim-gtk3

Ran PlugInstall in vim, the plugins.

-YouCompleteMe

-LightLine

-Polyglot

Afterwards I wanted to try it out so I did a

touch test.py

Straight away I noticed the icon was a plaintext, also the description said 'text/plain'. All my old files were still using their respective types. Even when open in a editor the autocomplete suggestions worked.

2

What part of linux goes over assigning filetypes? Did I destroy something by building the gtk version of vim?

Under Linux file name extensions have no bearing on the contents of the file. They are often consistent for convenience and software is not meant to take decisions based on extensions.

  • Yeah quite new to linux, was actually reading about this right now. The question might be phrased a bit wrong now I know this. But it's still a mystery why I can't just make a new file like i did before. The issue is my editor won't use the specific presets for those files and all files have the plain text icon/description. – GreatGaja May 21 '20 at 16:35
  • You need to define what happened before and what happens now. Under what software, etc. – Pedro May 21 '20 at 16:37
  • I updated the question with a more specific description of what I did. – GreatGaja May 21 '20 at 16:48
  • Thanks, response stands as accurate against what you asked. both touch a.b or touch c.py should yield the same type of file and the file manager should assign the same icon to both. Now if you edit one and add a line defining the interpreter (#/usr/bin/env python), the icons should change, again regardless of the extension (I hope for the sake of nautilus). – Pedro May 21 '20 at 16:51
  • After specifying anything specific to the language it actually changed when doing a write. Even with just a simple print statement. I was totally unaware of linux handling of file types like this. I will mark this as a answer since the extensions in name is just a trick/feature that I borked somehow when changing software. Learned something new, I will have to go on a hunt to see what part of debian does the extension by name trick. – GreatGaja May 21 '20 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.