[R-sig-Debian] Open a text file with vi/vim in another Terminal

2021-12-17 Thread Patrice Kiener
With Debian and macOS, the default editor (getenv("EDITOR") or getOption("editor")) is "vi" which opens vi/vim. The following instruction: fileREP <- file.path(R.home("etc"), "repositories") system2(getOption("editor"), fileREP, wait = FALSE) works fine with Windows but is inappropriate

Re: [R-sig-Debian] Open a text file with vi/vim in another Terminal

2021-12-17 Thread Dirk Eddelbuettel
Patrice, Also: if you are on a terminal, have you discovered tmux / byobu yet to multiplex? It is fairly magic as you can just open as many 'sessions with the outer sessions', the sessions persist and many more advantages. I talked a little about this (with short videos) last year

Re: [R-sig-Debian] Open a text file with vi/vim in another Terminal

2021-12-17 Thread Dirk Eddelbuettel
On 17 December 2021 at 18:48, Patrice Kiener wrote: | | With Debian and macOS, the default editor (getenv("EDITOR") or | getOption("editor")) is "vi" which opens vi/vim. The following instruction: | |fileREP <- file.path(R.home("etc"), "repositories") |system2(getOption("editor"),

Re: [R-sig-Debian] Open a text file with vi/vim in another Terminal

2021-12-17 Thread Ivan Krylov
On Fri, 17 Dec 2021 18:48:29 +0100 Patrice Kiener wrote: >system2(getOption("editor"), fileREP, wait = FALSE) Starting a new terminal is somewhat hard, but the shortest path to getting this particular command working would be options(editor = 'gvim'). It's almost like Vim in a terminal,

Re: [R-sig-Debian] Open a text file with vi/vim in another Terminal

2021-12-17 Thread Ivan Krylov
On Fri, 17 Dec 2021 21:13:12 +0100 Patrice Kiener wrote: > The instruction for the text editor > > system2(getOption("editor"), fileREP, wait = FALSE) > > works fine on Windows (it opens Notepad.exe, or Notepad++.exe in my > Rprofile.site) but not on Unix. "A file.edit() but with the

Re: [R-sig-Debian] Open a text file with vi/vim in another Terminal

2021-12-17 Thread Dirk Eddelbuettel
On 17 December 2021 at 21:13, Patrice Kiener wrote: | Thank you for your suggestions. Let's give more details. The idea is to | insert the code in a function and then in a (private) package. We have | to rely on the default editors provided by the OS to R and cannot invent | a new editor, as