Size: a a a

2019 December 04

SA

Sergio Araujo in NeoVim
the zz command moves the cursor line to the middle of screen
источник

SA

Sergio Araujo in NeoVim
If by any change, after making a search I want to get back to my previous location I just press <Ctrl-o>
источник

SA

Sergio Araujo in NeoVim
...
источник

SA

Sergio Araujo in NeoVim
An interesting alias to edit your init.vim very fast:

alias ne='nvim ~/.config/nvim/init.vim'
источник

SA

Sergio Araujo in NeoVim
But you can open nvim and then press Ctrl-o twice to open the last edited file
источник

SA

Sergio Araujo in NeoVim
here on my zshrc I have a "lvim" command to open the last edited file on nvim

alias lvim='vim -c "normal '\''0"'
источник

SA

Sergio Araujo in NeoVim
On my init.vim I also have:

nnoremap <leader>v :e $MYVIMRC<cr>
источник

SA

Sergio Araujo in NeoVim
obviously I also have:

let mapleader = ","

the above command makes "," become my <Leader> command. For more see :h leader
источник

SA

Sergio Araujo in NeoVim
HOW TO SHOW THE FULL PATH TO THE CURRENT FILE?

1 Ctrl-g
источник

SA

Sergio Araujo in NeoVim
...
источник

SA

Sergio Araujo in NeoVim
## How to replace first n occurrences of a character for each line?
+ https://stackoverflow.com/a/49590581/2571881

Suppose, I have

   type,type,type,type,description,description,description.
   type,type,type,type,description,description.

I want to -

   type|type|type|type|description,description,description.
   type|type|type|type|description,description.

Solution:

Nothing sofisticated but it get's the job done

   :%norm f,r|;.;.;.
   :'<,'>s/\%V,\%V/|/g
источник

Q(

QoBi BeN NuN (THiaGo NuNeS) in NeoVim
I should use the leader key.
источник

SA

Sergio Araujo in NeoVim
If you want you can map to any other key like <F-2>
источник

SA

Sergio Araujo in NeoVim
instead of <leader>
источник

SA

Sergio Araujo in NeoVim
but the leader allows us to create like much more "mappings"
источник

Q(

QoBi BeN NuN (THiaGo NuNeS) in NeoVim
Sergio Araujo
but the leader allows us to create like much more "mappings"
I agree. I don't like using plugins. I think I need to learn how to do something before automating in.
источник

SA

Sergio Araujo in NeoVim
Have you learned about "text-objects"?
источник

Q(

QoBi BeN NuN (THiaGo NuNeS) in NeoVim
Sergio Araujo
Have you learned about "text-objects"?
nope
источник

SA

Sergio Araujo in NeoVim
After learning about it you will tell yourself: Oh man, why I haven't learned about this before!
источник

SA

Sergio Araujo in NeoVim
to select the whole paragraph just press  vip
wich means "visual inner paragraph"
источник