File: edit_file.Rd

package info (click to toggle)
r-cran-usethis 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: sh: 26; makefile: 17; cpp: 6; ansic: 3
file content (36 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/edit.R
\name{edit_file}
\alias{edit_file}
\alias{edit_template}
\title{Open file for editing}
\usage{
edit_file(path, open = rlang::is_interactive())

edit_template(template = NULL, open = rlang::is_interactive())
}
\arguments{
\item{path}{Path to target file.}

\item{open}{Whether to open the file for interactive editing.}

\item{template}{The target template file. If not specified, existing template
files are offered for interactive selection.}
}
\value{
Target path, invisibly.
}
\description{
Opens a file for editing in RStudio, if that is the active environment, or
via \code{\link[utils:file.edit]{utils::file.edit()}} otherwise. If the file does not exist, it is
created. If the parent directory does not exist, it is also created.
\code{edit_template()} specifically opens templates in \code{inst/templates} for use
with \code{\link[=use_template]{use_template()}}.
}
\examples{
\dontrun{
edit_file("DESCRIPTION")
edit_file("~/.gitconfig")
}
}
\keyword{internal}