Single post

jump to replies

Do you know a good CLI text editor for text writing (blog post in markdown) on Linux terminal

I like vim but I hate the cursor move when you have long lines (paragraph) on several screen lines.
I expect that going up with the cursor up key, I go up one screen line, but vim go up a full paragraph. It's not easy to move in your text.

What do you use ? I need something easy to use (no time to learn many keys combinations)

#cli #vim #texteditor #markdown

edit: got a solution with vim (gj/gk mapped to cursor arrows), see in replies below

2 replies

back to top
Guillaume-Jean Herbiet , @gjherbiet@mamot.fr
(open profile)

@adele ˋgjˋ and ˋgkˋ allow you to move the cursor to the character in the next or previous display lines, even when lines wrap (see ˋ:help gjˋ and :help gkˋ).

It is not recommended to map that to ˋjˋ and ˋkˋ as it changes the way distances are computed in cursor movements, but you can bind this to the up/down arrows:

ˋˋˋ
nnoremap <Up> gk
nnoremap <Down> gj
xnoremap <Up> gk
xnoremap <Down> gj
inoremap <Up> <C-O>gk
inoremap <Down> <C-O>gj
ˋˋ
for normal, visual and insert modes.