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

FT specific work dir settings #316

Open
matthias-Q opened this issue Feb 3, 2023 · 4 comments
Open

FT specific work dir settings #316

matthias-Q opened this issue Feb 3, 2023 · 4 comments

Comments

@matthias-Q
Copy link

Hi,
I am using iron.nvim mainly for julia code. My problem is, that my neovim is in the repo root (ensured by nvim-rooter) and the source file is located for example in src/main.jl

If the Julia code includes relative imports (e.g. include('otherfile.jl')), then this file cannot be found because neovim is still in the repo root.

Is it possible to add a filetype specific option in iron.nvim to set the workdir before opening the REPL?

@wangl-cc
Copy link

wangl-cc commented Feb 14, 2023

Hi, I'm also using iron.nvim for julia. I think you can try change the cmd of julia repl definition with code to set workdir, like this:

repl_definition = {
  julia = {
    command = {
      "julia",
      "--project",
      "-e",
      [[Base.Filesystem.cd("src")]],
      "-i",
    },
  },
},

@matthias-Q
Copy link
Author

This does not work. Iron starts and exits immediately, I cannot even read the error message.

@wangl-cc
Copy link

It works for me:

截屏2023-02-15 10 01 46

Do you miss the -i option?

@matthias-Q
Copy link
Author

No, I probably missed the -e

It works for now. I will close this after some testing. Thanks

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

2 participants