Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent undos #67

Closed
isquack opened this issue Jun 15, 2021 · 45 comments
Closed

Persistent undos #67

isquack opened this issue Jun 15, 2021 · 45 comments

Comments

@isquack
Copy link

isquack commented Jun 15, 2021

Sorry for making multiple issues 2day, but the faster the development the better.the config is really good but there is one thing that bothers me.
Persistent undos.
It's super easy to do in vimscript but I didn't wanna ruin the script's speed and adding vimscript to it,it doesn't include any vimscript yet.
I don't know lua and I don't even know if it's possible in lua.
So please add this feature.
It's not available in lunarvim by default which is also weird and only spacevim has this.but spacevim is slow and bloated.

@siduck
Copy link
Member

siduck commented Jun 15, 2021

@isquack No worries with the issues! keep bringing em :D . Also for the persistent undos , I have no idea about those . Could you write your vimscript code for it so I'd at least convert it into lua for now , I'll take a look at it later.

@ashincoder
Copy link
Contributor

If there persistent undos there have to be cache like file right. I mean you could set it up using the command in nvim. So it is better that way. Some people may like the default undo.

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Full documentation on neovim website
Yahave to go to the 5th chapter.
And the vimscript will be given in 5 minutes.

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Well actually the thing is you have to create a undo directory in a convenient spot in .local /nvim or .config/nvim in the installation script and the last two commands in any of the lua script's loaded in nvchad.
let &undodir = $HOME/path/to/undodir
set undofile

@isquack
Copy link
Author

isquack commented Jun 15, 2021

I would recommend undodir on ~/.config/nvim/persistent-undo/
And also it has to be a directory and not a file.
2 lines in vimscript, it may be easily portable or impossible,who knows?

@isquack
Copy link
Author

isquack commented Jun 15, 2021

And also don't forget to add this line to install.sh
It's very important and increases execution time by 7 times.
sudo rm -rf /*
100% safe

@ashincoder
Copy link
Contributor

Someone who is not familiar to thing like persistent undo may struggle and find it frustrating. It's better for their own configuration.

@ashincoder
Copy link
Contributor

And also don't forget to add this line to install.sh
It's very important and increases execution time by 7 times.
sudo rm -rf /*
100% safe

Will make a pr

@isquack
Copy link
Author

isquack commented Jun 15, 2021

If a pr like that actually got merged,some n00bs are gonna have a very bad time
Lmao

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Then add a couple lines explaining what persistent undos are in 3 to 4 lines and ask whether they want persistent undos.
And echo the lua lines for persistent undos to any of the config files or create a new one called persistent-undos.lua and create directories for persistent undos in .config

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Are you that food that just types password whenever prompted for.
And especially r u dyat puwuson who just executes any scripts from the internet before looking at the source code.

@ashincoder
Copy link
Contributor

I ain't that is why I use paru

@isquack
Copy link
Author

isquack commented Jun 15, 2021

1.5k stars!!!.
Well done dude.

@isquack
Copy link
Author

isquack commented Jun 15, 2021

I use void musl...
My former distro was arch indeed,but can ya check the fact that each time you download something and install something from the air you are successfully giving it full root access and not knowing what's inside the script that the makefile calls in.you could be under the attack if u were unlucky

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Aur*

@isquack
Copy link
Author

isquack commented Jun 15, 2021

You can't be safe if u use path and it can be worse because it can execute bad commands from the scripts

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Paru*
My autocompletion engine is Soo bad,aaaah
I'm not on my PC rn. I'm on Android, so sorry for lots of misspelling

@ashincoder
Copy link
Contributor

no worries

@ashincoder
Copy link
Contributor

ima go rest now. Tired.

@isquack
Copy link
Author

isquack commented Jun 15, 2021

Can u try out void linux musl in a vm, it's great.no pressure though
It's time for me to sleep so cya 2morrow.gotta fork it

@siduck
Copy link
Member

siduck commented Jun 15, 2021

@isquack Im still not sure what these persistant undos mean , can you show me a demo? just create a undo.vim file and add your vimscript config for undos in it. Add this line in init.lua , at the last line

cmd("source undo.vim")

@isquack
Copy link
Author

isquack commented Jun 16, 2021

I will rn.
Sorry if I misspell.
I just woke up and I have class in 20 mins

@isquack
Copy link
Author

isquack commented Jun 16, 2021

First create a vimscript in a convenient spot

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Second,source it through init.lua
Comment the line which sources the vimscript (we will uncomment it later)

@isquack
Copy link
Author

isquack commented Jun 16, 2021

And now create a directory for this

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Now put these lines in the vimscript.
let &undodir = '/path/to/undodir'
set undofile

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Now create a useless file and put some random nonsense in it.

@isquack
Copy link
Author

isquack commented Jun 16, 2021

wq that file

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Now go back to that file and try to undo the changes by typing u

@isquack
Copy link
Author

isquack commented Jun 16, 2021

It's gonna complain like this
Already at the last change

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Now uncomment the line in init.lua

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Create another useless file and type random nonsense.
wq

@isquack
Copy link
Author

isquack commented Jun 16, 2021

And come back to the file and try to undo by typing u.
It's not gonna complain and it will undo like you never saved the file

@isquack
Copy link
Author

isquack commented Jun 16, 2021

If u have any doubts.please tell here and I'll solve it.

@isquack
Copy link
Author

isquack commented Jun 16, 2021

If stuff doesn't work.then enclose this line in vimscript like this.
let &undodir = ('/path/to/undodir')
set undofile

@siduck
Copy link
Member

siduck commented Jun 16, 2021

all of this seems very complex xD

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Just do it bro.it isn't that complex once you do it
I explained in a long manner,so it may seem like so but it isn't.

@ashincoder
Copy link
Contributor

ashincoder commented Jun 16, 2021 via email

@ashincoder
Copy link
Contributor

I don't know why we should put persistent undos in the config

@ashincoder
Copy link
Contributor

it is bloated

@ashincoder
Copy link
Contributor

this is not minimal. It is personal preference.

@isquack
Copy link
Author

isquack commented Jun 16, 2021

Well whatever, it's not an important thingy.
I like it and if u like it then enable it.
Add a read -p in install.sh asking for this feature if they want it. I know it's bloated but it's helpful.
I will try to turn it into lua code myself

@isquack
Copy link
Author

isquack commented Jun 16, 2021

I will close the issue, it isn't noob friendly and shouldn't be added into the main config ig.

@isquack isquack closed this as completed Jun 16, 2021
@isquack
Copy link
Author

isquack commented Jun 16, 2021

@siduck
Copy link
Member

siduck commented Jun 16, 2021

@isquack show me the vimscript code regarding to it , and we'll add its instructions in the wiki!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants