#What cmd shortcut is used to move the cursor to the end of the last line & move to the new line?

30 messages · Page 1 of 1 (latest)

warm vapor
#

I'm working using Linux Mint - Cinnamon 64-bit:

vi .bashrc

While re-configuring default .bashrc file, I'm struggling w/ the transition from the existing last line to the new blank line to add new entries.

The problem is how to place the cursor after the written lines at the very end, without selecting the last character of the text as it is works by default.

What I have already tried:

  1. using the shortcut as:

Press Ctrl + E (Moves the cursor to the end of the line).

  1. using the shortcut as:

Press Ctrl + O or Enter (Moves to the next line / executes).

  1. using commands as:

Press i (to enter Insert mode)
Press Enter to move to the next line

  1. using the shortcut as:

Press Shift + D

none of these solutions work & help to move from the last line to the new line.

To clarify:

I'm not looking bind commands for just switching lines, at least, now.

I appreciate any suggestions or alternative ways, specifically, related to command line as it needs per requirements.

#

What cmd shortcut is used to move the cursor to the end of the last line & move to the next line?

#

What cmd shortcut is used to move the cursor to the end of the last line & move to the new line?

lean geyser
#

Wouldn't it be easier to use nano or xed at this point?

lean geyser
#

But for your question, I think Shift+g goes to the end of the file, and then o to insert a new line

warm vapor
#

see:

lean geyser
#

Shift+a places the cursor at the end of the line in text mode. I think that's what you want?

warm vapor
#

the cursor is locating on the last letter, so it forces me to use shortcuts to put in the state as:

warm vapor
# warm vapor

but I know till this moment only how to put on the new line, but how to put it next to "fi", still in the process

lean geyser
#

When the cursor is on the last letter, press a to type after it

warm vapor
lean geyser
#

o goes to the new line

#

You're welcome )

warm vapor
#

I stuck two days with it, if not you my pain costs me 1 more day no less

lean geyser
#

Might I ask why use vi at all?

warm vapor
lean geyser
#

nano is also present in most distros or easily installed, I think it way more painless than vi or vim

warm vapor
lean geyser
warm vapor
#

The first time it goes down, the second time it prints 'o'. Ok, I'll update here if I find the reason.

lean geyser
#

Ah, yeah.... it creates a new line AND goes to text mode, so hit esc and o again

warm vapor
#

Nvm, it should work simply "Enter"

#

It works also with "Enter"

lean geyser
#

in text mode, yeah

lean geyser
#

Text mode is when you can type normally