Vim: underscore(_) automatically converted to (<-)

前端 未结 4 722
长情又很酷
长情又很酷 2021-01-14 11:45

I have been writing R scripts in Vim for some time now. Starting an hour ago, I began facing an issue that every time I type an underscore (_), it gets automati

4条回答
  •  臣服心动
    2021-01-14 12:17

    To add more options to what you can do, Nvim-R has not only R_assign_map as @konrad pointed out, but R_assign which manages how the feature works. A previous answer on duplicate answer mentioned an outdated version of R_assign (older name) being set to 0 as the answer.

    I have found that the actual way to use this variable as of at least this post date (while the variable is still called R_assign) that there are 2 valid values thus 3 functions. I have only tried values of -1 to 3, but I found 1 and 2 to produce something, so here they are:

    • Invalid values (let R_assign=-1 (anything but 1 and 2)) made it so that _ produced <- and any subsequent _ keys produced more <-
    • let R_assign=1 produced the default documented behaviour of 1 _ makes a <- and the next _ makes (thus two _) a single _
    • let R_assign=2 flips it so that a single _ makes _ and another _ makes a <- (so two _ for a <-)

提交回复
热议问题