GTK file/folder tree view: enable only highlighting/selecting file name - linux

since this is my first question here, I hope I do not distract you ;-)
I have wondered for a long time now wether there was an option in any
GTK setting that allows me (p.ex. in Nautilus) to select only the file's
or folder's name in an expanded tree view, NOT like this:
https://www.dropbox.com/s/fkeit8nk6ezhjnv/BadNautilus.png?dl=0
But more like this:
https://www.dropbox.com/s/52b9iv2lz0zvahl/GoodSystem7.png?dl=0
In the top picture you see that I wanted to get the context menu of
my home folder while I had the "Downloads" folder expanded, p.ex.
for opening a terminal.
If a (right-)click in the middle of nowhere would be taken as being directed at the current view's top level folder (in this example, my home folder), opening a terminal wouldn't be that of a problem.
Another example: Suppose I wanted to add a new file by selecting right click->New document->... (any template here). This is not possible in a folder
where I have to scroll down because it has so much content in it.
So summing it up:
There are context menu actions that "belong" to the empty screen space in a folder view below the listed files (at least in Nautilus) that I also want to be able to use in a folder which is so crowded that there is no more empty screen space. I know some, at least System 7 finder and Win (up to XP), file managers which are capable of this. Is it possible to system-wide set
the screen space next to the file name string to be equivalent to the empty screen space below a file listing?
Any ideas?
Best regards,
JohnS

Related

How do I add items to a menu in Sublime 3?

I want to add a couple of items to the Edit menu in Sublime 3. In fact, I just want to copy the Find and the Replace menu items from the Find menu. Call me lazy, but I just want to use the same Alt-E menu shortcuts I've grown accustomed to across so many other programs. I don't like making the mental switch from Alt-E to Alt-I when I switch from Sublime to anything else.
Anyway, from the sublime documentation I read that I can create a file Main.sublime-menu in the Packages/Default (or Packages/User) directory. The JSON format is easy enough to follow. But the problem is that there is no such file by default. If I add one (and I did) then sumblime replaces the entire main menu, which is not the result I want.
I don't want to replace the entire menu, I just want to add two entries to the Edit menu. Ideally, I would like to copy & paste the Find and Replace entries from the Find menu. That would save me the time of figuring out the command names.
Resource files that ship with Sublime are stored in sublime-package files that exist in a special folder stored in the installation folder of Sublime (where the executable is), which keeps them safe from modification because Sublime will replace them wholesale when it updates.
You can view the content of any resource file currently known to Sublime by using the View Package File command from the command palette. It will show you a list of every resource, and you can filter the list the same as the command palette entries to drill down to find what you need:
Choosing an item from this list will open the file for you to look at. If it's coming from a sublime-package file, it will be a read-only buffer that you can't modify to remind you that you can't edit the file. Resources that come from your Packages folder directly will be editable, however (such as your User package).
The Default package is where things like the default settings, key bindings and menus are defined. So although what you see in the list depends on the packages you have installed, the item you want here is Default/Main.sublime-menu.
Note that if your intention is to just add some items, you want to put your modifications into your User package. Any items you add here will augment the existing menu; that is, you can only add items, you can't modify or remove them.
If you put the file into the Default package folder (which you may or may not have to create), the file you create will override the one that's provided inside of the sublime-package file. You would do this if you want to remove entries, change what command they execute, etc.
If you go that route, note that Sublime will use this file forever even if a future update modifies the file. In that case I would recommend the OverrideAudit package (disclaimer: I am the author of said package) as it will warn you when that happens.
If this is your intention, OverrideAudit's Create Override command will allow you to seamlessly open the file and save it to create the override, saving you the trouble of finding the right place to put the file.

Can I filter sidebar directories by name (in sublime text 3) to quickly find node module, for example?

Here is my example, where I could have some input to filter directory subfolders.
The direct answer to the question is that this is not possible; the list of files and folders in the side bar is controlled by what folders you add and the settings that you include/exclude files and folders from within those folders. In theory you could try to modify the settings to change what appears in the side bar, but every time those settings change the file catalog needs to be rebuilt, which is something that can take some time (particularly in something with a large node_modules folder). It also causes all of the folders in the side bar to fold up.
The expected workflow is more designed around working with files than with working with groups of folders and that workflow centers around the Goto Anything panel. Choosing Goto > Goto Anything in the menu will open a panel showing you a list of every file that is currently contained in the side bar (except binary files).
The panel can filter text via fuzzy matching using as many search terms as you want (in any order you want) and will move the most likely matches closer to the top of the list. It also learns over time what files you pick when you use certain filters.
For your use case here you can open the panel and use a filter like node_modules or nmod/ to filter to files in the node_modules/ directory, acorn/ to see only files that exist in folders that match acorn, or a combination. You can also include fragments of filenames like lodash/ indjs to bring the index.js of the `lodash/ package to the top of the list.
The best way to get a feel for how this works is to play with it a little bit. Note also that the context menu in open files has a Reveal in side bar command that will focus the side bar on that file, which can be a handy way to see the other siblings of files you have open.

Sublime Text 3: import projects list from folder/files to OpenRecent list

I save several projects in a same folder by manual click Project -> Save Project As...
and I used to use cmd + ctrl + p to open Switch Projectlist to switch between projects
and everything's works fine.
but today, I accidentally remove my Switch Project list in by click Project -> Open Recent -> Clear Items, so my Switch Project list is empty now...
I know I could add them back through reopen ALL my projects. due to the number of projects is pretty a lot, that will be kind of annoying to add them back one by one.
I wanna know if there's a smarter way to do that for me.
maybe import all my *.sublime-project files from folder or something.
thanks
Short of manually opening every project, I don't think there is any way to do something like this directly. There isn't a command or plugin endpoint that I'm aware of that lets you open a project by name or filename, so it's not possible to create a plugin to do the work, and Sublime doesn't have the ability to pre-load the list of packages directly either.
That said, it is possible to manually update the list of recent projects, but whether or not that is more or less work than opening all of the projects is something to consider.
If you use Preferences > Browse Packages from the menu or the command palette, a file browser will open on your Packages folder. From there go up one directory level and go inside of the Local folder, where you will find a Session.sublime_session file.
Sublime saves it's state into this file when you quit it, and uses it to restore state when you start it again. Here you will find all of the saved information, such as the windows and files that were open and so on.
Changing this file will change the data that Sublime loads, so you can modify the session file to set up the data that you want. You need to make sure that you modify the file while Sublime is not running or your changes will be ignored and clobbered away. Also it's a good idea to make a backup of the file before you start in case things go pear shaped.
Down near the bottom of the file you will find a top level key named workspaces, and inside of it a recent_workspaces key:
"workspaces":
{
"recent_workspaces":
[
"/home/tmartin/local/src/OverrideAudit/OverrideAudit.sublime-workspace",
]
}
This is where the list of recent projects is stored for use in the menu and the quick switch project command. Particular things to notice are that the entries are naming sublime-workspace files, and that the paths are absolute.
NOTE: On windows, the filenames stored in the session file are in a format like /C/Users/tmartin and not c:\users\tmartin; on that platform you need to make sure that you adjust the paths accordingly. As long as there is already at least one entry in the list when you look at the session file, you can easily see how to construct the paths that you need.
Despite the name of the commands and menu items, what you're actually switching between is different workspaces. Every sublime-project is associated with a sublime-workspace file, which acts as a dedicated sublime_session file for that particular project. This mapping is one-to-many in that you can have multiple workspaces for the same project file, allowing you to reference the same paths in multiple windows but have different window layouts.
While Sublime is not running you can edit this file to add in the full paths to all of your workspace files; when you start Sublime up the list will be populated (every sublime-workspace file knows what sublime-project it is associated with).
What remains is whether or not it's quick to come up with the list of files in a way that you can easily paste them into the session file.

Unable to search Sublime editor folder files

I am new to Sublime, used to using Dreamweaver as my web editor. I have my project folder open in the Sublime Text 3 and I need to search all the files for a particular link https://test.com. From what I found on the web I need to hit Shift+Ctrl+F, enter my search string and then in Where: type the folder path I want to search. I have done that but the result set is empty even though I know the string I am searching for is there multiple times.
I tried entering the full path: W:\Web\App1 (where App1 is the folder I have opened as the project folder) as well as App1 but nothing gets returned. What am I doing wrong here?
Similar to Ctrl+Shift+F, you can right-click on the folder you want to search in, then choose 'Find in Folder'
In the bottom 'Find' box, make sure to have the 'Find options buttons' (on the left of the image) correctly set.
This is a very powerful option I use very often. Now I've tested in my SublimeText3 to look for an url like the one you provide and it works fine, as usual. With this setup:
Regular Expression: Off, Case Sensitive: Off, Whole Words: Off
...but this options are pretty straightforward and shouldn't affect your basic searches.

How to add comments to folder in linux and view them with mouse cursor

I run simulations for various choices of parameters. For each choice I store the resulting data in a folder, like
/home/me/Documents/MyProject/C=10/1.dat
/home/me/Documents/MyProject/C=10/2.dat
/home/me/Documents/MyProject/C=10/3.dat
...
and
/home/me/Documents/MyProject/C=20/1.dat
/home/me/Documents/MyProject/C=20/2.dat
/home/me/Documents/MyProject/C=20/3.dat
...and so forth.
would like to write a little text file AAA.txt which contains not just the C parameter but all the others too. Then when viewing this folder which contains the data I want to hold my cursor on the little file symbol and have a little box appear. This box should show just the content of AAA.txt, so I can quickly check which set of parameters was used in this particular run.
Anyone know how to do this? I use Ubuntu 14.04
I am not aware of ways to give you a custom "tooltip". As an alternative, you could look into creating custom thumbnails of your .dat files.
See here for how to do that with nautilus; the default file browser for Ubuntu.
Alternatively, you might look into what Gloobus can do for you.

Resources