Questions tagged [find-file]
is the most frequently used command for opening files in Emacs.
126
questions
0
votes
0answers
39 views
Disable `icomplete` with Emacs `find-file`
I have been experimenting with various completion frameworks in Emacs. I am currently using consult together with icomplete. I like the way things are working for me but I would like to disable ...
2
votes
1answer
186 views
C-x C-f Problem:
When i want to create a new file with C-x C-f (ido-find-file), and type main.lua, Emacs does not create a new file in the current directory (default-directory). Instead, it visits an existing main....
0
votes
1answer
42 views
How to open a file in other window in the middle of function run?
I use notmuch to read emails.
I've configured notmuch to call offlineimap via pre-new hook.
When I press G to refresh my notmuch buffer, I want emacs to open my offlineimap log file in another window ...
1
vote
0answers
26 views
find-file-hook when visiting file literally
I'm trying to hook into find-file-literally to turn off some global minor modes when visiting a file literally (which I usually do for large files).
However, it does not appear that find-file-hook is ...
1
vote
2answers
38 views
How can I make sure that Emacs opens files with extension `*.rec` as normal text files?
How can I make sure that Emacs opens files with extension *.rec as normal text files?
When I try to open a file with the extnsion *.rec, I get the error message Running someFile.rec...done without the ...
1
vote
0answers
21 views
Multi-directory tab completion for find-file?
I am frequently diving through many layers of directory hierarchies (thanks, Java) to find files named like this…
java/test/com/company/thing/test/testy/testier/testier/Tester.java
The main issue ...
0
votes
1answer
70 views
dired by name - change directory and create new file
I want to open a new file in a different directory than the current one.
Pressing C-x C-f -> I could enter a file name. But I don't.
Pressing RET
The directory listing (mode (dired by name)) comes ...
1
vote
2answers
54 views
completion-ignored-filenames?
Is there a way to do ignore whole file names the same way as
'completion-ignored-extensions' ignores filename extensions?
For example, I would like to blacklist __pycache__/, so that if the default ...
0
votes
0answers
51 views
Windows File open SLOW
Windows 10
Emacs 27.1
From C-x C-f File
Till seeing the file actually open can take almost a minute!
Tried emacs instead of runemacs.
Also Menu-file-visit
All the same
I think there's some Mcafee ...
1
vote
1answer
54 views
Global `C-x C-f` binding is overridden
I don't like ido-find-file, which seems to be the default response to C-x C-f in my Emacs 23.1.1 installation on Centos. I tried to change it in my .emacs file:
(global-set-key (kbd "C-x C-f"...
0
votes
1answer
98 views
C-x C-f, Cannot complete file name for desktop folders
I am new to Emacs. I am trying to access a file in the "Emacs" folder on my desktop.
I run the C-x C-f command, then type ~/Desktop/Em.
I then hit TAB, but there's no completion. Emacs says [...
0
votes
1answer
107 views
Don't show “.” and “..” in counsel-find-file
I have a thing where I just don't like editing directories in emacs, and I never want to enter dired mode. Any time anything might want to put me into dired mode, I would prefer it not do that and ...
0
votes
2answers
54 views
Unable to find files with ssh and environment variables
I have installed exec-path-from-shell as well as included the following in my init.el
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize))
within my ~/.bash_profile I have ...
0
votes
1answer
29 views
Open folder in emacs and type name to match file
I have this line in my init.el:
(global-set-key (kbd "C-c g") (lambda() (interactive) (find-file "~/Dropbox/myorgfiles")))
So when I type C-c g I get the directory contents of the ...
4
votes
1answer
133 views
how to open a file without using Ivy
Under most operations, when I open a file with C-x C-f Ivy pops up my narrowing list at the bottom and its great.
However, I have a current situation when I'd like to open a file on a remote host in ...
2
votes
1answer
70 views
How to add a specific extension on filename for new files?
Say i create a new file using find-file (by typing a non-existing filename, since it create a newfile with said filename) How could i add the .org extensions at the end automatically?
I heard of ...
0
votes
1answer
74 views
How to pass the result of yank to find-file?
So I wanted to basically copy the current selection, then yanking it into find-file, as when using:
C-SPC: set-mark-command
M-w: kill-ring-save
C-x C-f: find-file
C-y: yank
While that works great, I ...
0
votes
0answers
7 views
find-file using ido exact word pattern search
I was using regular find-file, where when I type e and press tab it will suggests files that are starting with e.
I have enabled: (ido-mode 1). I realize when I type e and press two times tab (I do ...
0
votes
1answer
43 views
How to delete backward word in find-file using ido?
I was using regular find-file, and have a current setup to delete a word, which was working inside find-file.
(defun backward-delete-word (arg)
"Delete characters backward until encountering the ...
0
votes
1answer
58 views
Opening files in new frame
I'm using a fairly frame-oriented workflow (or trying to). I've run into something strange. If I write this:
(defun find-file-existing (filename)
"Edit the existing file FILENAME.
Like \\[find-...
2
votes
1answer
98 views
ivy counsel find-file with similar name
In the directory I have mongodb.js, now I want to create a db.js file but if I type the name and press enter counsel-find-file use regex to open mongodb.js.
How can i create a db.js with counsel-find-...
1
vote
2answers
48 views
Strange behaivor counting lines in hooks `find-file-hook` or `text-mode-hook`
For me, the clearest measure for the size of a file is its number of lines.
So, I want this information in my mode line.
I am using Doom emacs and, even I could define my own mode line, for such a ...
3
votes
1answer
61 views
how to show local file listings with C-x C-f through IVY when starting in a remote file buffer
System: Mac OSX catalina
Emacs: 26.3
I use Ivy as my completion framework.
Problem is when I am editing a remote buffer over ssh using Tramp, and then I want to look at a file on my local machine.
...
1
vote
1answer
62 views
list files in directory in reverse order of date
When finding files with Ctrl-x Ctrl-f and then pressing Tab, to list the file completion names, is there a way to list these files in reverse order of their dates (when they were last edited)? ...
1
vote
2answers
87 views
Setup find-file-at-point to treat tilde as project root
A JavaScript project is setup with webpack path resolver like this:
resolve: {
alias: {
'~': path.resolve(cwd, 'src')
}
},
This has the effect that a line in c:/...
1
vote
1answer
103 views
How to use helm to find files that match regex in subdirectory?
I had this functionality working until I recently revamped my init files. Now, I can't figure out how to get it back.
I use helm-find-file (mapped to C-x C-f) for finding and opening files. I used ...
1
vote
2answers
84 views
Helm Find Files: prefer certain extensions
Helm find files lists files of the same name alphabetically.
a.aux
a.log
a.tex
b.aux
b.log
b.tex
This is annoying as I want the .tex file 99% of the time. Is it possible to prefer certain extensions ...
1
vote
1answer
33 views
Help; how use Persistent Sets of Completion Candidates for search?
I want to use a set of files inside my directory ~/Dokumente to search for changes in title, content. So I saved such a set of file names persistently, using C-} during file-name completion with ...
2
votes
2answers
94 views
Instruct Emacs never to open files of a certain type or size
In Emacs by default there is a large file warning threshold. I would prefer to instruct Emacs never to open files of a certain type or size. These are files I would prefer always to open in an ...
1
vote
0answers
160 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 ...
1
vote
0answers
35 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
213 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
35 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
36 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
52 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
...
1
vote
0answers
29 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 ...
3
votes
0answers
134 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---|
|----|----| -> ...
5
votes
2answers
99 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
71 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
49 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 ...
4
votes
4answers
2k 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
229 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
293 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?...
3
votes
1answer
489 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
49 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
38 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).
...
3
votes
1answer
415 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
117 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
192 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 ...
4
votes
1answer
278 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 ...