LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2016, 07:51 AM   #1
PACMANchasingme
Member
 
Registered: Mar 2015
Distribution: Arch
Posts: 57

Rep: Reputation: Disabled
Double clicking text files in Thunar file manager and launching vim?


I used to double click and open sublime, but I'm done with that editor.

Currently I have to open a terminal and type vim /path/ but I'd like to just do this by double clicking.
 
Old 03-11-2016, 08:34 AM   #2
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Normandy, France
Distribution: Debian stretch/sid
Posts: 398
Blog Entries: 14

Rep: Reputation: 241Reputation: 241Reputation: 241
Quote:
Originally Posted by PACMANchasingme View Post
Currently I have to open a terminal and type vim /path/ but I'd like to just do this by double clicking.
Either use the graphical version GVim or right-click on the text file and choose the “open with“ option. There, define your own command with the last option in the context-menu. The command must call a terminal-application which must execute vim:
Code:
xterm -e vim
or any other terminal emulator.

In both cases do not forget to check the option where you are asked if the file-type shall permanently be associated with the set command.

Last edited by Michael Uplawski; 03-11-2016 at 08:52 AM.
 
Old 03-11-2016, 08:46 AM   #3
PACMANchasingme
Member
 
Registered: Mar 2015
Distribution: Arch
Posts: 57

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Michael Uplawski View Post
Either use the graphical version of Vim: GVim
or right-click on the text file and choose the the “open with“ option. There, define your own command with the last option in the context-menu. The command must call a terminal-application which must execute vim:
Code:
xterm -e vim
or any other terminal emulator.
xterm -e vim works fine. I use terminator though.

When I put in terminator vim, nothing happens.
 
Old 03-11-2016, 09:00 AM   #4
hydrurga
Senior Member
 
Registered: Nov 2008
Distribution: Linux Mint 18 MATE
Posts: 1,209

Rep: Reputation: 341Reputation: 341Reputation: 341Reputation: 341
Quote:
Originally Posted by PACMANchasingme View Post
xterm -e vim works fine. I use terminator though.

When I put in terminator vim, nothing happens.
Have you had a look at the terminator options in man terminator to use the one that effectively says "Run this program in the terminal window"?

For example, Michael's call to xterm used the flag -e to indicate the program to run in xterm.
 
Old 03-11-2016, 01:22 PM   #5
PACMANchasingme
Member
 
Registered: Mar 2015
Distribution: Arch
Posts: 57

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Have you had a look at the terminator options in man terminator to use the one that effectively says "Run this program in the terminal window"?

For example, Michael's call to xterm used the flag -e to indicate the program to run in xterm.
Quote:
-e, --command=COMMAND
Runs the specified command instead of your default shell or profile specified command. Note: if Terminator is launched as x-terminal-emulator -e behaves like -x,
and the longform becomes --execute2=COMMAND

-x, --execute COMMAND [ARGS]
Runs the rest of the command line instead of your default shell or profile specified command.
terminator -e vim, does nothing

terminator -x vim, launches an empty vim but doesn't open the contents of the file at all.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Double Clicking on Open Office files leads to very slow opening NewKubuntuGuy Linux - Software 15 01-17-2012 07:37 PM
Thunar File Manager shows text files as Adobe bridge workspace files bret381 Linux - Software 6 01-01-2011 10:23 AM
How can I run a .sh file by double-clicking on it??? kevinx17910 Linux - Newbie 11 06-11-2010 06:45 PM
How to Create an executable file in linux which opens by double-clicking it shivanand Linux - General 5 08-30-2005 01:10 AM
File Manager and Double-clicking Jongi Linux - Newbie 3 09-04-2003 11:28 AM


All times are GMT -5. The time now is 03:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration