I'm using tabbed mode but it doesn't seem to (or I don't know how to) open different files in different tabs. Could anyone tell me of a way to achieve this?
You can open multiple files at once with filename globbing, just as you would use in your shell.
e.g.: C-x C-f *.txt RET to open all text files in the current directory.
I don't use any kind of tab library (and Emacs does not offer tabs by default, so I'll echo 0x4b's query about where your tabs are coming from?), but if it displays each buffer in a different tab, then this may be enough to do what you want.
Related
Is it possible to open the same file buffer(editor) in multiple VSCode windows? This is not the same as opening the same file more than once. In the later, if you forget to save edits in one window, and then save different edits in another window, you end up with conflicts. I'm curious if it's possible to have the same buffer opened (mirrored?) in different windows, such that the view is identical for that file across all windows. So if I make changes in the file (even before saving), those changes also show in every other window that the buffer is opened in. I've searched around a lot but can't really find anything. Thanks.
Use the Split Editor command: Ctrl + \.
You can also use the icon in the top right. Hold Alt to split down.
Opening whole directories (each one requiring a new window) doesn’t play well with editing lots of little scripts/config files scattered in different folders.
Yes, you can! Here are three ways:
Either by running code {yourfilename here} in a terminal.
Dragging the file from a file explorer onto the open VSCode window.
Use the menu item "File/Open file... (Ctrl + O)", see image.
You don't have to open a folder in VSCode!
In VSCode create a New Window (instance) and open all the files you're interested in from anywhere on your disk.
If you want to keep this selection for later, you can Save Workspace As .. for later usage.
While the command line is very useful for most of the tasks, I sometimes resort to a graphical file explorer (like Nautilus, Thunar, PCmanFM). I would like a keyboard shortcut or a context-menu entry to open such a graphical file explorer _in the current directory. I know the converse is possible with nautilus-open-terminal. Is there currently a way to do that?
It may require writing a perl-extension, but I do not know enough of perl and urxvt to find how to capture the current PWD.
Assuming you're using Bash as your shell, here's an alias you could add to your .bashrc:
alias nh="nautilus file://$(pwd)"
I called it nh for "Nautilus here". So from the comman-line you would simply type:
nh
for a nautilus window in the shell's current directory.
I have no idea what's involved in adding something to the urxvt context menu - sorry.
Well, I quickly hacked a small extension to do this: https://github.com/raphaelfournier/urxvt-perl.
The opening of the file browser can be triggered with the right-click menu or a keyboard shortcut. The selection can be a directory, but also a filename, which will then be opened by the application associated with it in the file browser.
When navigating through a deep directory tree with find-file (C-x C-f), I often find myself 1) tapping the Tab key to autocomplete a directory name, and 2) immediately tapping the Tab key again to see the contents of that directory. I do this so routinely that I'd love it if I didn't have to hit Tab a second time to see those contents.
Is there a way to automatically display the contents of a directory after autocompleting its name?
Also, I've played around with ido-mode and helm, but I wasn't a huge fan of either, so I ended up switching back to the default find-file.
I hesitate to say this, as I doubt you will find it satisfactory wrt what you are looking for, but in case it helps:
You can configure Icicles so that it immediately shows all candidates and updates the matches as you type. See Icicles Incremental Completion.
The relevant options are icicle-show-Completions-initially-flag and icicle-incremental-completion (and maybe icicle-find-file-expand-directory-flag).
(There are also options icicle-incremental-completion-delay and icicle-incremental-completion-threshold.)
If you don't like ido-mode or helm, you might find icomplete-mode more to your liking: it doesn't overwrite as many keybindings as ido does.
Does Emacs have the capability to open recent files (e.g. a menu like File > Open Recent...)?
I know that Aquamacs, for OS X, has this feature. But is it common to all Emacs versions?
The most idiomatic method of providing this functionality that I know of is through the use of recentf-mode (more here). I enable it in my initialization file with:
(require 'recentf)
(recentf-mode 1)
It then provides an interactive function, recentf-open-files, which I bind to C-x f, which provides a numbered menu of recently opened files that spans sessions, i.e. even if you shut down emacs and restart it, it will retain your recently opened files. You can bind the function to an accelerator with another line in your initialization file, like:
(global-set-key "\C-xf" 'recentf-open-files)
(Optional)
If you make extensive use of Tramp, recentf will track those files too, and do it's periodic cleanup thing which can be a real mess since the files are remote. Prevent this by putting this in your startup file:
(setq recentf-auto-cleanup 'never)
Ordinary GNU Emacs doesn't have a menu showing recently open files. However, all Emacs commands have history, including find-file (C-x C-f). Selecting “File | Open” in the menu or opening a file with emacsclient also adds to this history. After you press C-x C-f, press up and down to navigate the history of opened files.
The history is saved between sessions if you enable session saving with the desktop package.
If you just want to save the minibuffer history between emacs invocations you can put the following in your .emacs:
(savehist-mode 1)
Unlike the desktop package that can save all your open buffers across invocations, this does just the minibuffer history (e.g. when opening a file you can use the up arrow to navigate the list of files you opened in a previous session).
GNU Emacs does include library recentf.el, since Emacs 22. Just do as indicated by R.P. Dillon.