Sunday, December 29, 2019

Re: unchangeable lines

This probably isn't what the original poster had in mind, but this made me think what if vim could use a template file that acted as a mask?

Anywhere characters (X for example) existed in the mask file, those positions would not be changeable in the 'edit' file.

If the movement commands skipped over the masked positions, you'd have a really handy tool for editing forms.

I don't know to who this would appeal, can't imagine there are a lot of people jonesing over a modal editor for forms instead of an html form and mouse.



On Sunday, December 29, 2019 at 10:59:14 AM UTC-5, Salman Halim wrote:
Might be useful. I currently use something such as the InlineEdit plugin to extract the lines I want to modify. (This also helps in big files where syntax highlighting is slow.)

How would this be persisted? If it adds markers within the same file, the file won't be compatible with other editors. Maybe a second file would be saved alongside the main file, but with a different extension to indicate that it contains metadata. (Abc.txt and ABC.txt.vimmetadata)

For a Vim-script solution, you'd probably have to remap every single command that can change text (i, a, c, d, r, their upper-case variants, etc.) that would have to check to see whether the range of lines affected contains any of the fixed lines and abort if so. 

--

Salman

On Sun, Dec 29, 2019, 10:44 Efraim Yawitz <efraim...@gmail.com> wrote:
I wonder if this could be easily hacked into the code of vim by creating a new syntax group called Unchangeable or something and adding code to make it uneditable.

Maybe for now, create a syntax group and highlight it in a way that it reminds you not to change that text.

On Fri, 27 Dec 2019 at 09:58, Christian Brabandt <cbl...@256bit.org> wrote:

On Fr, 27 Dez 2019, Vladimir Stenbock wrote:

> Is it possible to mark some lines as unchangeable ?

This is not possible. A custom handmade plugin might work around this by
saving/restoring of lines, but in the core, Vim does not support this.

Best,
Christian
--
Eine Erfolgsformel kann ich dir nicht geben; aber ich kann dir sagen,
was zum Mißerfolg führt: Der Versuch, jedem gerecht zu werden.
                -- Herbert Swope

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191227075846.GN9787%40256bit.org.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAPKXbB6iCUF-Xy%3D_OvgZSCW3nn4UknDcTsxaBWjz%3D80eaY%2By1g%40mail.gmail.com.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/8d7f9c26-ac19-42c1-ba7c-231263c2abb2%40googlegroups.com.

No comments: