Home Comments Thread
New Thread

1 Comment

giscus-bot giscus-bot 2022-12-17 03:54:00
Guest *baptiste auguie* @ 2018-08-04 22:17:32 originally posted:

thanks for the tip; I've often wanted a shortcut for system("open .") on my mac,

delayedAssign('open', {  
system('open .')  
invisible(getwd())  
})  
yihui yihui 2022-12-17 03:54:01

The problem is that it only works once (I guess you are aware of that). Once the delayed assignment is fulfilled, open will be getwd(), and it won't open the directory again if you run open in the console.

Originally posted on 2018-08-05 02:21:40

giscus-bot giscus-bot 2022-12-17 03:54:02
Guest *baptiste auguie* @ 2018-08-05 02:47:23 originally posted:

yes :( found out after I posted this

giscus-bot giscus-bot 2022-12-17 03:54:03
Guest *Michael* @ 2018-08-06 19:03:08 originally posted:

makeActiveBinding would work here:

makeActiveBinding("open", function(){  
system('open .')  
invisible(getwd())  
}, .GlobalEnv)

Sign in to join the discussion

Sign in with GitHub