Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: enable autocomplete via tabbing #74

Open
cscheeder opened this issue Jul 27, 2021 · 4 comments
Open

Feature request: enable autocomplete via tabbing #74

cscheeder opened this issue Jul 27, 2021 · 4 comments

Comments

@cscheeder
Copy link

Hi, I love here() and use it a lot. I just thought that it would be super cool to be able to get autocomplete/suggestions for file paths as it works outside of here().

Or is there a trick how that's already possible?

Thanks :)

@leowill01
Copy link

Can we please have this implemented? I'd like to use {here}, but currently the here() function is nearly useless to me because I have a lot of nested folders and I don't memorize the long paths in order to specify where a file or folder is by manually typing in each item in the path from the here() root.

@abalter
Copy link

abalter commented Nov 28, 2023

I was about to make this request myself. I huge downside of file.path and here is the lack of tab completion.

@krlmlr
Copy link
Member

krlmlr commented Nov 28, 2023

Thanks for the nudge.

In RStudio, you could type

here("file<tab>

and it would autocomplete the file with its full path relative to the RStudio project (which is frequently also the project root):

here("my/local/file.txt"

This is a perfectly valid input for here() . Would that help? Do we need to document this better?

@abalter
Copy link

abalter commented Dec 13, 2023

I am considering a use case that goes beyond that, and may not be something that is a goal for {here}. Highly structured projects can lead to tall directory trees:

(base) balter@expiyes:~$ tree rnaseq_proj/
rnaseq_proj/
├── align
│   ├── logs
│   ├── reports
│   ├── results
│   └── src
│       ├── alignment_diagnostics.Rmd
│       └── run_bwa.Rmd
├── config.R
├── data
│   └── raw
│       └── test.fastq
├── setup
│   ├── logs
│   ├── reports
│   ├── results
│   └── src
│       └── run_fastqc.Rmd
└── trim
    ├── logs
    ├── reports
    ├── results
    └── src
        ├── trim_diagnostics.Rmd
        └── trim_sequences.Rmd

So, I frequently like to create variables for file paths, e.g.:

raw_data_dir = here("data/raw")

Or, maybe I have another reason to have a folder name in a variable.

test_type = "raw"
test_fastq_file = here("data", test_type, "test.fastq")

I think it would be awesome if here and (file.path) would use intellisense so that I could do

data_dir = here("data")
test_fastq_file = here(data_dir, test_type, <tab>......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants