I would like to know, how can I set a terminal text editor as a default desktop application? I want to double-click file and open it in terminal editor.
I think that the right way to do this is to create a Desktop Launcher for your alternative editor, and then modify the MIME database to associate it as the default application for your target mimetype(s).
Create a minimal
[Desktop Entry] Type=Application Exec=/usr/bin/nano %F Terminal=true Name=MyEdit
You may want to add at least a suitable
Iconfield, if you have one.
[Default Applications] x-scheme-handler/mailto=thunderbird.desktop message/rfc822=thunderbird.desktop application/x-extension-eml=thunderbird.desktop text/plain=myedit.desktop
Update the MIME database
After that, double-clicking a plain text file in the Nautilus file manager should open a gnome-terminal and run
nano on the file.
Short answer: I hope I am wrong, but this is likely impossible or prohibitively difficult.
The general answer is you would want to set your terminal as the default App in the GUI, with some some arguments to it. In my experience, Terminals tend not to support "run this application" as an argument and last time I did something like this I had a launcher set an ENV variable which I then checked in my shell's .dotfile to do the right thing. So, you would have to convince your file browser to use an action like "export MAGIC_EDITOR=launch-vim; konsole %s" and then your shell would check MAGIC_EDITOR and pull %s as what ... $1?
This can get fragile and may need to be re-done after an upgrade or if you change your terminal preference, &c.
Far easier to use the GUI form of those text editors. (Example: gvim is pretty nice, but I prefer the font/colors I already have in my terminal.)
Of course, within the terminal, you can set the EDITOR and/or VISUAL environment variables.