How can script the rename of pane in tmux to reflect the current directory? - keyboard-shortcuts

I'd like to make a quick key in TMUX that queries the current directory and makes some portion of it the name of the pane window. Normally, I rename the pane window with ctrl-b , only to then add some indication about the where it is in the file system. It might be nice if I could both automate it putting the name there or even have new pane window open with this title.
So how can script a new keyboard shortcut like ctrl-b T that will add the title?

You can use #{pane_current_path} on most platforms (not OpenBSD) to get the pane's working directory. So you can do for example "tmux renamew '#{pane_current_path}'" to rename a single window, or put it in automatic-rename-format to automatically include it in every window name.
You might find the = modifier to be useful to trim the path (look at FORMATS in the manual).
If you want it to be shortened more intelligently your best bet is to rename it to $PWD from the shell prompt either with "tmux renamew" or by turning on allow-rename and using the rename escape sequence \033k$PWD\033\.

Related

How to copy search results in IntelliJ to paste them elsewhere?

I would like to remember my team the ports used for debugging, for several projects.
A Ctrl-F in a directory, and I have my results under IntelliJ_2021.1.3 Ultimate I'm using,
but I have no way to paste them, like they are on this window, either with Ctrl-C or Ctrl-Ins , on another location in order to send a mail to my teammates.
Does a workaround exist, or has this feature been implemented in a later version I should try to upgrade to?
I don't think there is a simple and direct way to do what you want. However, there is a workaround:
Run your search, and then from the Find in Files window click the Open in Find Window button:
Right-click anywhere within that Find window listing the occurrences, then select Export to Text File from the context menu:
An Export Preview window will open, showing the search results in expanded hierarchical form, reflecting the structure under the directory you searched. Within that window you can select any contiguous portion of text, then right click and select Copy from the context menu:
You can then paste the selected text into any other window, and massage the results as necessary:
Notes:
This is only a workaround because unfortunately I don't see a way to directly copy the results in your screen shot, in which each line shows a both a search occurrence and its file location. That information is still in the copied text, but it may take a bit of effort to get it in the form you want.
The Copy button in the Export Preview window ignores any text selection and blindly copies everything, so use Copy from the context menu instead if selecting a subset of the text.
I used IntelliJ IDEA 2023.1 EAP (Ultimate Edition). I don't know whether this functionality exists in your version.

Shortcut for opening the definition file in a split vertical group in vscode

Are there any shortcuts to open the definition (e.g.: a method definition) in a split vertical group? By ctrl + click on the usage of method, it opens in a new tab. It bothers me, because I have to leave my own tab.
(I know that after opening in a new tab, by pressing ctrl + \ it will be open it in a new group, but this also has the same problem: I lose my own tab, and a second problem: when I want to close the definition file, I have to close it from both the 2nd group and the 1st group.)
Are there any shortcuts to open the definition file directly in a new group?
Ctrl+Alt+Click seems to open the definiton file in a split editor.
It'll open to whatever you have this setting:
Workbench > Editor: Open Side By Side Direction // options are right and down
Note that it'll directly open the definiton file in a split editor only if there is a single possible defintion file. For example, you may have both a source and a dist folder with the same files in them (after some task runner commands perhaps). If there is more than one option, vscode will instead open a peek window with the multiple references listed to the right side. You can Ctrl+Click on whichever of those you want to open to the side.

URL to make SSMS start and connect to a db?

It would be nice to have a bunch of reference links somewhere, that could also be used to start SSMS.
Is this possible? and get it to use an already open instance?
e.g. sqlwb -E -S Server\instance
but I'm not sure if you can do this in the form of a URL
i.e. how to make a URL run CMD
Right click on your shortcut for SSMS (or copy existing one),i.e. that thing on which you click to open SSMS.
Open Properties --> tab Shortcut.
Add options to target text box
For ex., I have:
"D:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe" -nosplash -S localhost -d _A
to avoid splash, to connect automatically to database __A, etc.
You will get help by adding non-existent option
, pressing OK, double-click shortcut
I'm not sure you can do this in a URL directly, but you could certainly create URLs to .cmd batch files (in the form of a UNC path) which contained the relevant commands.
To make a "url" run a cmd file, format it in this way:
file:///c:\folder path\myfile.cmd
If you want to embed one of these file links in a document (like Word or email) then you may need to add angle brackets around it:
<file:///c:\folder path\myfile.cmd>
and the editor will make it into a link automatically. (alternatively you could just highlight some text, right click and create a file hyperlink using the first syntax).
Launching executables from URL is a very bad idea and a security hole. I advise to avoid doing this for many reasons.

VB.NET call desktop application from 2 shortcuts - supply different parameters

I have a desktop application which reads files from a specified folder, then deposits the files to a folder in a third party document management system based on criteria that the user provides.
My question is:
is it possible to somehow provide different parameters to the code, depending on which shortcut of the application the user clicked on to start it up?
You can add command line parameters to a shortcut icon. Here's how you can do it in Windows:
On the Start Menu, navigate to Notepad.
Right click on Notepad and choose Send To > Desktop (Create Shortcut)
Right click on the newly-created desktop icon and choose Properties
Add your command line parameters to the Target text box.
For example, if you want notepad to open up the hosts file, this would be the content of Target property:
%SystemRoot%\system32\notepad.exe "C:\WINDOWS\system32\drivers\etc\hosts"
You can put pretty much anything into the Target property of a shortcut that you would put into a command line.
Yes.
The easiest way would be to have the shortcut pass those parameters in via the command line.
You could also use conditional compilation variables, and have 2 different .exes. You should be able to find samples of both approaches (command line and conditional compilation variable) in help.

jedit navigating file system with keys when opening a file

How to make jedit navigating file system with left, down keys. So when in the ctrl-o form, if I press left key after the cursor is at the first character of file name, it should jump up the file browser tree and every left key press would move up higher in directory. It used to work out of the box with 5-6 old jedit, but these newer versions, I can't get it to work.
This alone made me love jedit for so many years.
An alternative usage is to type .. into the filename label then enter ( or ../.. to go up two levels ). To go down into a directory or open a file name, type the few characters of the file or directory then hit tab to autocomplete the name of the node then enter. Once you autocomplete the name you can use the up and down arrows to select in the current directory hierarchy.
Not a direct answer, but I find this to be a rather quick mode.
Alternatively, you can switch focus to the file hierarchy pane with shift+tab , shift+tab and then use the arrow keys. Not sure if this is exactly what you're looking for, because I don't use this navigation mode.
I prefer my previous answer.