Single post
jump to repliesDo 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
14 visible replies; 3 more replies hidden or not public
back to top@adele nano with syntax highlighting
@ravenlb nano hides the end of the line if it has more chars than terminal columns. Not easy to read your text
@ravenlb thx, but I've got a solution with vim
@adele np, thanks for sharing that solution
@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.
@gjherbiet wahoo! I had never seen these movement combinations. It is exactly what I need to keep on using vim in this context.
Thank you very much 😘
@gjherbiet @adele Forgot about that. Thanks
@adele I write every sentence on a new line, then I use vim/nvim.
@adele if it's what I'm imagining, you can use keys `gj` to go down one line (even when multi line paragraph) also same goes for `gk` for going up one line.
@peach YES mapped to cursor arrows, it is perfect ! Thx
@adele no probs. Happy to help. 🙂
@adele vim with markdown mode and a fixed line length. So your lines are being wrapped at that length and you only have small lines.
Can be configured in vim or via editorconfig.




