Fork me on GitHub
#emacs
<
2017-04-18
>
pesterhazy10:04:39

Vim has ^X^F to complete the filename at point. If you type /etc/ho ^X^F, it'll offer you /etc/hosts

pesterhazy10:04:12

Is that something you can do with Emacs? I'm assuming helm is involved, but I can't find a reference in the docs.

pesterhazy10:04:30

I can do ^X^F and then ^U^U^C i in then helm buffer

pesterhazy10:04:56

not as easy as in Vim though 🙂

kliph13:04:08

@pesterhazy typing TAB in emacs -q runs minibuffer-complete in the Find file: prompt for me

pesterhazy13:04:42

@kliph, that doesn't work for me, either in emacs -q -nw (emacs 25.1.1) nor in my default spacemacs

pesterhazy13:04:21

oh, you mean after typing ^X^F?

pesterhazy13:04:42

yeah, but I want to insert the filename in the current buffer

pesterhazy13:04:44

e.g. I type cp /etc/ho when writing a .sh file

pesterhazy13:04:50

and now want to complete that filename

kliph13:04:16

have a look at https://www.emacswiki.org/emacs/InsertFileName , I'm not aware of an easy way to do this in plain old emacs

pesterhazy13:04:03

thanks I'll have a look

kliph13:04:08

I imagine you're in shell-script-mode. If you're using some sort of completion library, you could also look into enabling it in that mode

pesterhazy13:04:47

yeah but I like it generally too (imagine requiring a relative path in javascript)

kliph13:04:38

I'd imagine that you could configure it more generally too 😄

cmack14:04:57

C-h a tells me there is a helm-complete-file-name-at-point command. It seems to do the action in your example… it gives completions for /etc/ho as /etc/hosts

pesterhazy14:04:36

that's pretty good