How to stop emacs from replacing underbar with - in ess-mode
From ESS's manual (look under "Changes/New Features in 5.2.0"):
ESS[S]: Pressing underscore ("_") once inserts " <- " (as before); pressing underscore twice inserts a literal underscore. To stop this smart behaviour, add "(ess-toggle-underscore nil)" to your .emacs after ess-site has been loaded
How to change smart assign key (_ to -) binding in ESS
Here's the docstring for ess-smart-S-assign-key
:
Documentation:
Key used by `ess-smart-S-assign'. By default bound to
underscore, but can be set to any key. If this key is customized,
you must add
(ess-toggle-S-assign nil)
(ess-toggle-S-assign nil)
after the line that sets the customization and evaluate these
lines or reboot emacs. The first call clears the default
`ess-smart-S-assign' assignment and the second line re-assigns
it to the customized setting.
So: put this in your .emacs
file to get the desired behavior:
(setq ess-smart-S-assign-key ":")
(ess-toggle-S-assign nil)
(ess-toggle-S-assign nil)
Kind of ugly, but it works.
How to set up custom automatic character replacement in emacs ess?
The simplest solution is to just bind a key to insert a string:
(define-key ess-mode-map (kbd "|") "%>%")
You can still insert |
with C-q |
. I'm not sure about the map's name; you'll almost certainly want to limit the key binding to ess-mode
.
Emacs ESS Mode - Tabbing for Comment Region
Use '###' if you don't want the comments indented. According to the manual,
By default, comments beginning with
‘###’ are aligned to the beginning of
the line. Comments beginning with ‘##’
are aligned to the current level of
indentation for the block containing
the comment. Finally, comments
beginning with ‘#’ are aligned to a
column on the right (the 40th column
by default, but this value is
controlled by the variable
comment-column,) or just after the
expression on the line containing the
comment if it extends beyond the
indentation column.
Related Topics
Automating Version Increase of R Packages
Adding Lagged Variables to an Lm Model
What Does ..Level.. Mean in Ggplot::Stat_Density2D
Specifying Column Types When Importing Xlsx Data to R with Package Readxl
Odds Ratios Instead of Logits in Stargazer() Latex Output
How to Select Rows from Data.Frame with 2 Conditions
Duplicate a Column in Data Frame and Rename It to Another Column Name
Real Time, Auto Updating, Incremental Plot in R
Convert Data from Many Rows to Many Columns
How to Preserve Transparency in Ggplot2
What's the Difference Between Reactive Value and Reactive Expression
How to Add a Scale Bar (For Linear Distances) to Ggmap
Plotly as Png in Knitr/Rmarkdown
Update Multiple Data.Table Columns Elegantly
How to Access the Data Frame That Has Been Passed to Ggplot()