VI Editor: Move to EOL instead of last character

前端 未结 2 1955
Happy的楠姐
Happy的楠姐 2021-02-03 12:10

I\'m most often finding myself having to work with plain old vi on minimalistic terminals that tend to act differently than the vim on big distros, and so the behavior trips me

2条回答
  •  时光说笑
    2021-02-03 12:21

    I am guessing you want to use o to "open" a new line. However I have provided some ways to insert text via vi

    Insert commands

    It should be noted that vi/vim's cursor sets on top of a character not between character like most editors.

    • i insert text before the cursor
    • a append text after the cursor
    • I insert text before the first non-blank in the line
    • A append text to the end of a line
    • o begin a new line below the current one and start insert mode
    • O begin a new line above the current one and start insert mode
    • S/cc delete the current line and start insert.
    • c{motion} delete {motion} and start insert mode. Read as change
    • C Delete from current position to end of line and start insert mode
    • s remove character under cursor and start insert mode
    • r replace one character
    • R start replace mode. Think of it as overwrite

    For help on any of these command type :h {command} so help on A would be :h A

提交回复
热议问题