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

Make filename not editable #327

Closed
otavioschwanck opened this issue Jun 30, 2022 · 2 comments
Closed

Make filename not editable #327

otavioschwanck opened this issue Jun 30, 2022 · 2 comments

Comments

@otavioschwanck
Copy link

Would be nice to make the filenames not editable. Sometimes :%s/old/new/gr changes the filename and breaks ctrlsf on save.

A good suggestion for the future is that when filename is changed, also, renames the file

@dyng
Copy link
Owner

dyng commented Jul 7, 2022

I don't know how vim can make some specific lines uneditable (only read-only mode for the whole file). Thanks for your suggestion, if you get some ideas to approach this, please let me know.

@dyng dyng closed this as completed Jul 7, 2022
@otavioschwanck
Copy link
Author

I don't know how vim can make some specific lines uneditable (only read-only mode for the whole file). Thanks for your suggestion, if you get some ideas to approach this, please let me know.

@dyng

You can export a list of the lines that are readonly at first. like: [22,44,66].

You also export in the background a copy of the ctrlsf file.

Add a autocmd, every time the file is changed, verify those lines, if they are different then the copy, revert only those line to the original values.

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

2 participants