Questions tagged [find-file]

is the most frequently used command for opening files in Emacs.

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

How to create a file when it doens't exist in the project?

I've remapped C-x C-f to projectile-find-file since I mostly open files corresponding to the project I'm in. However when I need to create a new file, I fill in the name and projectile doens't find ...
1
vote
0answers
37 views

Debugging slow find-file performance

Trying to figure out why find-file (C-x C-f) operations are taking a long time on Windows 10 with emacs 26.3. I tried to do profiling and got following results. - command-execute ...
0
votes
0answers
19 views

Is there is an existing parser for `.gitignore` files?

Is there is an existing parser for .gitignore files? Maybe there is some Elisp package that includes something like this? Ideally, I would like to be able to read a .gitignore file in a given ...
1
vote
0answers
46 views

How to open two files in two frames on startup?

Here's what I'm trying to make happen: on startup, I want emacs to split vertically into two windows displaying two different files, with my to-do list on the left side of the screen and my notes on ...
1
vote
1answer
22 views

Append to a list inside an alist for custom find-file behaviour

cc-other-file-alist is part of find-file that looks something like this. (("\\.cc\\'" (".hh" ".h")) ("\\.hpp\\'" (".cpp")) ;; more such entries ) This is an alist where I'd like to append an ...
0
votes
1answer
29 views

Using the :match attribute for custom matching for a Helm source

I'm trying to create a Helm source which matches the basename of files. I created a source which splits the basename of files in recentf list and puts the path behind it in parens (it uses the (...
1
vote
1answer
32 views

Function to find a file or open a URL depending on argument?

Q: in there a function that can find a file or open a URL as needed? I have a string that can be either a) a local filename, or b) a URL. Is there an existing function that I can call on the string ...
0
votes
0answers
17 views

xemacs loading second java file on opensuse

I am having a problem with loading a second java file in xemacs 21.5.34-17.6 on NAME="openSUSE Tumbleweed" VERSION="20190721" The first java file loads with no problem. If I try to load a second ...
1
vote
0answers
21 views

Using helm to create a file while in a helm session

I often find myself in a command that queries for a filename e.g. diff-tell-file-name. This command asks me what file to apply a diff to. In my case, often the file does not exist and I would like ...
0
votes
0answers
54 views

How to resolve symlinks when visiting an individual non version controlled file

Emacs takes care that symlinked files are resolved before visiting a version controlled file. This behavior is set by vc-follow-symlinks, which is by default "ask". One can set it to nil, but even ...
1
vote
0answers
36 views

How to make find-file-other-window reuse existing window

Is it possible to make find-file-other-window open the file in a pre-existing window instead of creating a new one? Currently: |A---|B---| |A-|C-|B---| |----|----| -> ...
4
votes
2answers
65 views

How to pipe large files through fold before opening?

On a regular basis I need to open files that have really long lines, which unfortunately causes emacs to grind to a halt. My understanding is that this is a long-term issue with the renderer. I've ...
0
votes
0answers
38 views

Emacs cannot find virtual drive defined by MS Windows command `subst`

I am using spacemacs (0.200.13@26.1), but this should be applicable to vanilla Emacs too. The version of Emacs I'm experiencing this issue on is "GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-...
1
vote
1answer
43 views

Search files in folder

Windows 10, Emacs 26.1 dired+ I want in dired mode find files by names, content Approach#1 - use external tools. What tools you can suggest? Approach#2 - use only built-in Emacs function on ...
3
votes
4answers
301 views

Find file in directory

I switched to Org Mode and Emacs few weeks ago. I find it incredibly better than my previous (simple but effective) setup based on markdown files and VS Code editor. I'm learning new features ...
4
votes
1answer
114 views

Open directory containing file during counsel-file-jump

I use counsel-file-jump to search files recursively. I would like to open the directory that contains a particular file candidate. I can execute counsel-dired after I open the file, which allows me to ...
0
votes
1answer
137 views

Direct emacs that open file from the pwd from shell buffer

I use shell mode, often. I use the c-xc-f. Most of the time, the start directory for looking for file, correspond to the PWD of the emacs shell buffer. Can i set that it is always the case/or reset it?...
0
votes
0answers
39 views

Error when opening encrypted file

I cannot open my beancount encrypted file; executing M-x toggle-debug-on-error I get the following backtrace: Debugger entered--Lisp error: (wrong-type-argument arrayp nil) file-truename(nil) ...
2
votes
1answer
245 views

Equivalent to `ido-find-file` functionality for ivy/counsel?

I really like how ido-find-file, if it can’t find a file matching your string (and you’ve let it idle for like a second), will search your whole home directory for files matching that string, and then ...
0
votes
1answer
42 views

Opening an Emacs file to a specific word in the file

In Vim it is trivial to open a file from the command line to a specific word in the document. For e.g. to open the file "Contacts.txt" to "Bob" one would type: vim Contacts.txt +/Bob In Emacs it ...
1
vote
1answer
33 views

Don't offer non-file-name as a file name in find-file

When opening a file with find-file, the default entry in the minibuffer is the current directory. If I press Down, I see the name of the current file (if the current buffer is visiting a file). ...
2
votes
1answer
167 views

Function to open all Org files in a folder recursively

I am looking for a way to open all Org (or Fountain) files in a folder using one function. Essentially, I am seeking to open all available files of a certain type (.org or .fountain) within a folder ...
0
votes
1answer
64 views

Wrong default-directory when inside a tmux session

I'm trying to use tmux inside emacs for a long time. I want to use it to attach to remote (long living) session. Attaching to sessions works fine but I have some problems in my daily workflow because ...
1
vote
1answer
59 views

How to avoid a dialog box for input (e.g. “Open File” behavior)?

I generally like to use the emacs-gtk3 package for my editing since I find it has better compatibility with my clipboard and a couple packages I use..but I don't like opening files in the GUI version ...
2
votes
1answer
128 views

open files at last-edited position

What I want to achieve is this. I open a bunch of files, edit them and quit Emacs. then tomorrow I open one the files and I want Emacs to jump to the last edited position on that file. How can I ...
1
vote
0answers
240 views

Emacs 26-1 Problems : find-file and neotree

The Problems: I just did a full re-install to Fedora 29, which included the dnf install emacs command. This installed emacs 26-1; formerly I was using emacs 25.2. Formerly, my emacs initialization ...
1
vote
1answer
376 views

Wrong type argument: stringp, (“~/capture.org”)

I am setting up a few hydras, one of which should open a frequently accessed file. The following command works, if I bind a keyboard sequence to it: (lambda () (interactive) (find-file "~/capture.org"...
1
vote
2answers
321 views

Disable ivy for find-file

Is it possible to disable ivy-mode for file prompts? In a past I used find-file to copy current file name or path to file. dired-do-rename also is broken by Ivy: no default completion for current ...
0
votes
1answer
40 views

Including standard boiler-plate on opening a new latex file [duplicate]

Most of my \LaTeX files have the same boiler plate code, so I would like Emacs to automatically insert this boiler-plate whenever I open a fresh, blank \LaTeX file. In particular, I would like to ...
1
vote
2answers
235 views

Command to invoke menu-bar's open-file?

The traditional way of opening a file is via C-x C-f (find-file). I don't know since when this has been the case, but in Emacs 27.0.50 (Linux), using the menu bar's File -> Open File invokes the GTK ...
4
votes
2answers
748 views

Template for new file

When opening a new file of certain types, I would like some boilerplate to be inserted. That is, when opening a buffer for a file that does not yet exist, insert some predefined text, optionally with ...
2
votes
4answers
95 views

How to find a directory with given depth from current directory?

Is it possible from within Emacs to find directories with a given depth from the current directory from within Emacs and receive their respective location in form of a list? I want it to work cross ...
1
vote
2answers
953 views

How do I open a file in spacemacs?

Say I have spacemacs open and now I want to launch some sort of file browser to open a file. How do I do it? I have found SPC f f which sort of works but the navigation is quite cumbersome. There is ...
1
vote
1answer
411 views

How to edit and return value of string in Emacs Lisp?

Here is what I wish to achieve: (defun rcd-edit-value (value) (let ((file (make-temp-file "rcd-db-" nil ".txt" value))) (find-file file) (string-from-file))) (defun string-from-...
3
votes
2answers
394 views

Set a global default directory

I want a "default directory" which is constant across all contexts (buffers, packages, etc). That is, when working on multiple files, opening a new terminal, doing anything which requires a starting ...
3
votes
4answers
747 views

How show recent files?

windows 10, emacs 26.1 Suppose I open 10 files. And then restart Emacs. After restart I need to see what files (recent) I was open before. Is it possible to show some buffer that contain name of ...
1
vote
1answer
47 views

Icicle: After load icicles the ido mode is gone?

windows 10, emacs 26.1, icicles Before Icicles when I type C-x C-f is show list of folders/files in ido mode. And it's very comfortable for me. But after I install Icicles and turn on icy-mode the ...
1
vote
0answers
25 views

Find dirrectories paths from a list of names via tramp session

I have a remote host accessing via tramp there is a list of directori names I'd like to find on that host. What I do now - connect to remote server and while read -r name; do find / -type d -name "$...
2
votes
1answer
52 views

Open folder `/ssh:example.com` or file in it

You can open SSH resources in Emacs. Unfortunately, the pathspec used for SSH resources conflicts with possible paths in the virtual file system. If I run sudo mkdir "/ssh:example.com" sudo touch "/...
4
votes
2answers
222 views

find-file for file path with space in windows

In Windows, both find-file and helm-find-file don't work if there's space in the file name. For example: I move cursor to the anywhere in the string "c:/a/b.yaml", and then call find-file (C-x C-f), ...
1
vote
1answer
66 views

How to limit the up-directory search for file info

As Emacs opens a file it does all sorts of useful things including walking up the directory tree for more information (repos etc). I'm in a situation where I need to curtail that climb. Is there a ...
2
votes
1answer
168 views

Omit current and parent directories in Ivy find-file completion

I'm using Ivy in a fairly standard Spacemacs setup. When I'm opening a file I'd like . and .. to be omitted from the list of completion candidates. In particular, I'd like to be able to tab through ...
0
votes
1answer
126 views

auto-insert mode switch to new file

I managed to insert a template to certain sripts with autocomplete. Example: (auto-insert-mode) (setq auto-insert-query nil) (setq auto-insert-alist '(((ess-mode . "R script") nil "# R ...
5
votes
3answers
496 views

When using C-x C-f turn off the suggestions

When i do C-x C-f to create a new file in the directory A, if emacs finds another file in another directory (say B) with exact same name, in the mini-buffer it changes the path to the other existing ...
1
vote
1answer
284 views

Combine find file at point and find file in project

I'm very new to customizing Emacs, and haven't written Elisp commands before. I'm struggling to find a command and key binding that combines find-file-at-point and find-file-in-project (or similar), ...
1
vote
2answers
92 views

How to get a string under quotes surrounding the cursor in elisp?

I am trying to write a function that opens a file under the cursor. I need to get the string between quotes that is surrounding the cursor in my elisp function so that I can use that string to call ...
2
votes
5answers
708 views

Quick jump to a specific line of a file

After opening a .txt file with Emacs, when the point is at the line /folder/subfolder/file.xml:435 How can I fast jump to line 435 of the above mentioned file? What I tried: dired-at-point and ...
0
votes
0answers
121 views

can I have swiper and counsel as “add-ons” and not the default binding

I like the powers that counsel/ivy/swiper gives me, specially for C-s and C-x C-f, but since installing it, I've started missing the vanilla emacs C-s and C-x C-f. It would be awesome if I can "call" ...
0
votes
1answer
27 views

Can I “find-file //hostname/dirname/filename”

GNU Emacs 24.5.1 (i686-pc-mingw32); local host is MS Windows 7; remote machines are all running variants of MS Windows. I would swear I've used this syntax (most recently less than a month ago) but ...
4
votes
3answers
423 views

Display path and filename in a minibuffer

Eval this code: (defun xx-display-filename (filename) "" (interactive "Ffilename: ") (message (concat "Filename is: " filename))) Let's assume that I am editing a ~/.emacs.d/personal/custom.el ...