-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to open file in terminal editor #103
Conversation
Add suffix @, that causes the file to be opened in the default terminal editor (set to vim), using the default terminal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. I think this is a great idea!
I'd love to merge it, but as it is, the description in the README.md is a bit hard to understand. I had assumed that the @
should come at the start of the command, e.g., @/home/dog/cat.txt
, and I had trouble getting it to work. If you could attend to the two comments I made then I'd be happy to merge it.
I know the instructions for the usage of the other operators isn't very clear either, this is something I should improve on.
Thanks!
@@ -195,7 +196,8 @@ Dmenu-extended understands the following modifier characters when entering a spe | |||
1. **+** (plus) - Manually add an entry to the cache | |||
2. **-** (minus) - Remove a manually added entry from the cache | |||
3. **:** (colon) - Open with | |||
4. **;** (semi-colon) - Execute in terminal | |||
4. **@** (at) - Open in default terminal editor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a note that the @
symbol must come at the end of the command?
README.md
Outdated
@@ -228,6 +230,10 @@ There are a few different ways to use the colon operator, summarised by example | |||
* `/home/me/Documents/writing.txt:gedit` - Open this file with gedit. | |||
* `gedit:/home/me/Documents/writing.txt` - Open this file with gedit. | |||
|
|||
### **@** (at) - Open in terminal editor | |||
|
|||
Default editor is set to `vim`, but it can be changed in the preferences (`"terminal_editor"`). The terminal window is closed as soon as the application is exited. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could put an example in here for the way to use the operator like the :
operator (above) I think that would help people understand how to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added an example, since also :
and ;
are suffixes, I thought it was not necessary. How does it look now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thank you :)
Add suffix @, that causes the file to be opened in the default terminal
editor (set to vim), using the default terminal.
I made these modification because I find it difficult to open files in a terminal in some other way. The alternative is the one you described here, but while it works for the file manager (where the app is called directly), somehow it doesn't work for in dmenu_extended for me (
xdg_open
insists in opening a terminal withless
). It may be caused by some issues with concatenation of commandsxdg_open -> terminal emulator -> terminal app -> file
.No idea, but this is a direct way to solve the problem and it doesn't need a system-wide change (like changing the default application for a filetype).
There is also the non small benefit that the method
open_in_terminal_editor(path)
can be called directly by plugins.