Wednesday, June 30, 2021

Re: Prevent vim from polluting the file system with a bunch of temporary $HOME/.viminf[a-z] files

On 2021-06-30, Chris Jones wrote:
> No idea where these files come from or what they're for. I ended up
> grepping the reference manual for clues and am none the wiser. Internet
> searches also failed to give me an answer.
>
> Is there any way to tell vim NOT to create them in the first place?

It looks like the :wviminfo command will write those. See

:help :wv

Unfortunately, I couldn't find any explanation of why "old temp
files [would be] left behind", nor any other reference to "viminf*".

I looked in the source, viminfo.c. From a quick read, it looks like
Vim creates a temporary file with a name like that and uses it to
build the viminfo file. When Vim finishes building that file, it
renames it to the default ~/.viminfo or whatever name the user has
chosen via the -i command-line option or the 'viminfo' or
'viminfofile' options.

If that rename fails, Vim prints an error message and tries to
delete the temporary file.

The best way to avoid having those files laying around is to find
out why Vim is unable to rename them and fix that problem. Watch
for error messages when Vim closes.

HTH,
Gary

--
--
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/20210701013009.GC22769%40phoenix.

Prevent vim from polluting the file system with a bunch of temporary $HOME/.viminf[a-z] files

No idea where these files come from or what they're for. I ended up
grepping the reference manual for clues and am none the wiser. Internet
searches also failed to give me an answer.

Is there any way to tell vim NOT to create them in the first place?

Thanks,

CJ

--
--
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/YNzkU6Yan1nPKVeU%40turki.local.

Re: How can I undock a file panel from a split window?



On Wednesday, June 30, 2021 at 12:17:08 PM UTC-4 v...@tlinx.org wrote:
On 2021/06/29 03:05, rwmit...@gmail.com wrote:
> The source code is available - you're free to use to make what ever
> changes make you happy.
----
How many people do you think would be capable of making such changes?

Certainly not me, which is why I suggested a reasonable work-around
until you said you wanted multiple windows editing the same file with
live updates across all of them.

Having said that, I'm using MacVim and with whatever settings/plugins
I have, it automatically updates the buffer when the file changes externally,
but not until bringing it back into focus (which would be a fail for your use).

I tend to use each MacVim window as a session with related files and
sometimes want to break off a file into a new session.  I wouldn't have
looked/found a solution until you brought it up.  For me, it works great,
so I thank you for bringing the subject up.

--
--
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/243dc7db-6af0-4fef-bbca-3f3a419d0b92n%40googlegroups.com.

Re: How can I undock a file panel from a split window?

On 2021/06/29 03:05, rwmit...@gmail.com wrote:
> The source code is available - you're free to use to make what ever
> changes make you happy.
----
How many people do you think would be capable of making such changes?

At least I know programming, unlike some poor soul on a list who
was telling me that his 'Object Class' should act like a language native
array because his documentation said so. I asked how he told
the language-translator that his Object should be treated as though
it was derived from the native array implementation. He said his
documentation should be all that was necessary.

So if I write that gvim already has this feature because my .vim
file's documentation says so, do ya suppose it will automatically
appear? :-)


As far as me making changes in vim, it would be easier for me to
write a module plugin for the linux kernel that I could load &
unload. Does vim have such a compiled plugin system with which
the windowing API can be called to provide the necessary support?
If so, then maybe your statement is reasonable. But if I have to
know all the internals about what I am adding to, then it seems
that modular extensibility wasn't part of the core design either.

Lack of that would seem to make your statement a bit unrealistic
in a reasonable timeframe.

FWIW, that vim can runtime-load language extensions makes it much
ahead of most sw projects.




--
--
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/60DC9890.3020307%40tlinx.org.

Tuesday, June 29, 2021

Re: How can I undock a file panel from a split window?

On Di, 29 Jun 2021, L A Walsh wrote:

> but I can use split and get 4 panels open in 1 copy of vim.
> Already I can do multiple panels with 1 vim, just not disconnected.

Correct. Note, Vim is open source, so you can contribute and give
something back.

Best,
Christian
--
Tatsächlich weicht in Wahrheit die Realität häufig von der Wirklichkeit ab.

--
--
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/20210629110436.GD222622%40256bit.org.

Re: How can I undock a file panel from a split window?

The source code is available - you're free to use to make what ever changes make you happy.

On Tuesday, June 29, 2021 at 4:56:21 AM UTC-4 v...@tlinx.org wrote:
On 2021/06/28 21:07, Tony Mechelynck wrote:
>
> Well, one copy of Vim means one panel and that's that,
but I can use split and get 4 panels open in 1 copy of vim.
Already I can do multiple panels with 1 vim, just not disconnected.



--
--
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/384bbdbb-267d-43ce-ab05-c4ec677d2f2an%40googlegroups.com.

Re: How can I undock a file panel from a split window?

On 2021/06/28 21:07, Tony Mechelynck wrote:
>
> Well, one copy of Vim means one panel and that's that,
but I can use split and get 4 panels open in 1 copy of vim.
Already I can do multiple panels with 1 vim, just not disconnected.



--
--
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/60DADFD6.7010904%40tlinx.org.

Monday, June 28, 2021

Re: How can I undock a file panel from a split window?

On Tue, Jun 29, 2021 at 4:06 AM L A Walsh <vim@tlinx.org> wrote:
>
> On 2021/06/16 03:45, rwmit...@gmail.com wrote:
> >
> > Campbell has a very straightforward approach of accomplishing the
> > same end result by saving the contents of the current buffer, and then
> > starting a new instance of gvim with that buffer. (I don't use gvim,
> > so I hope I got that right. I did get it work to my satisfaction with
> > MacVim).
> >
> > Is there a reason Campbell's solution does not work for you?
> > Ultimately, isn't the end result the most important part?
> ----
> Because starting a separate copy of Vim isn't what I asked for. I
> want separate,
> windows onto the same file -- one vim, but with splits I can
> undock/detach and
> move around as separate windows (but still on the same buffer in the
> same copy
> of vim).
>
> I.e. if I split gvim into 4 panels, on the same file, and focus
> at the same area, I can type in 1 window and see results in the other
> panels.
> Now I just want to detach one or more of those panels -- they will still
> be on
> the same file using the same copy of vim -- just that they can be moved
> around
> separately from each other.
>
> Does that explain why/how Campbell's solution isn't solving the same
> problem?

Well, one copy of Vim means one panel and that's that, so the answer
is: you can't.

Best regards,
Tony.

--
--
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/CAJkCKXu2pbJ%2BLuAvrLu%2BUrEPFcPJEUO5XZj1vsVzuQMt9MnNpg%40mail.gmail.com.

Re: Introducing a dedicated unicode mode in Vim

On 2021/06/26 23:02, Manas wrote:
> Hi folks, I was thinking about the following idea.
> As Rust introduced usage of non-ascii characters as identifiers
>
----
You do realize perl has had that for over a decade?

--
--
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/60DA8050.7030403%40tlinx.org.

Re: How can I undock a file panel from a split window?

On 2021/06/16 03:45, rwmit...@gmail.com wrote:
>
> Campbell has a very straightforward approach of accomplishing the
> same end result by saving the contents of the current buffer, and then
> starting a new instance of gvim with that buffer. (I don't use gvim,
> so I hope I got that right. I did get it work to my satisfaction with
> MacVim).
>
> Is there a reason Campbell's solution does not work for you?
> Ultimately, isn't the end result the most important part?
----
Because starting a separate copy of Vim isn't what I asked for. I
want separate,
windows onto the same file -- one vim, but with splits I can
undock/detach and
move around as separate windows (but still on the same buffer in the
same copy
of vim).

I.e. if I split gvim into 4 panels, on the same file, and focus
at the same area, I can type in 1 window and see results in the other
panels.
Now I just want to detach one or more of those panels -- they will still
be on
the same file using the same copy of vim -- just that they can be moved
around
separately from each other.

Does that explain why/how Campbell's solution isn't solving the same
problem?

--
--
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/60DA7FB8.4010200%40tlinx.org.

Sunday, June 27, 2021

Re: Introducing a dedicated unicode mode in Vim

On Sun, Jun 27, 2021 at 11:32:21AM +0530, Manas wrote:
> I wanted to know that will it be interesting to add a dedicated support
> for typing unicode characters in Vim? Like we have insert and replace
> modes, will it be useful to have a "unicode-mode" which when activated
> can enable a typist to type in unicodes at ease and allow them to type
> those characters continuously? Current implementations of using <C-v> for
> unicodes and <C-k> for digraphs become tedious for typing continually.

Probably you can set this in your .vimrc:

`autocmd set digraph`

I had the reverse problem a while ago in mutt, where vim is my editor --
making a typo, hitting <backspace>, typing the right character and
ending up with Japanese katakana or hiragana. After some searching, I
found out that I had a line in my .vimrc that triggered this when
writing an email. Your wish is the reverse of this, although I don't
know if the line above is syntaxually right. But you just can find out.

As with my line that only worked when composing an email in mutt, you
could set it in your .vimrc only to work for specific file types, etc.
The original line I had is

`autocmd BufNewFile,BufRead /tmp/mutt* set noautoindent filetype=mail
wm=0 tw=78 digraph nonumber nolist`

Since I am a search-copy-paste sysadmin, I can't tell you what to change
for your purposes, but there is plenty of info on the Net.

//meine

--
--
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/YNiSSQus3%2B%2BiJMhd%40trackstand.

Re: Introducing a dedicated unicode mode in Vim

> Hi folks, I was thinking about the following idea.
>
> As Rust introduced usage of non-ascii characters as identifiers
> < https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html#unicode-identifiers >,
> I wanted to know that will it be interesting to add a dedicated support
> for typing unicode characters in Vim? Like we have insert and replace
> modes, will it be useful to have a "unicode-mode" which when activated
> can enable a typist to type in unicodes at ease and allow them to type
> those characters continuously? Current implementations of using <C-v> for
> unicodes and <C-k> for digraphs become tedious for typing continually.
>
> Of course, people will use this mode while writing various documents as
> well, and it will not merely be specific to rust devs.
>
> What do you folks think about this?

We already have support for input methods. These were originally aimed
at Asian language, but should work for anything.

Implementation of an input method is tricky and involves user
preferences. Making something Vim-specific has the disadvantage that
you can't use it in other programs.

--
You have the right to remain silent. Anything you say will be
misquoted, then used against you.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.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_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202106271008.15RA8G6Y582968%40masaka.moolenaar.net.

Saturday, June 26, 2021

Re: Introducing a dedicated unicode mode in Vim

Hi folks, I was thinking about the following idea.

As Rust introduced usage of non-ascii characters as identifiers
< https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html#unicode-identifiers >,
I wanted to know that will it be interesting to add a dedicated support
for typing unicode characters in Vim? Like we have insert and replace
modes, will it be useful to have a "unicode-mode" which when activated
can enable a typist to type in unicodes at ease and allow them to type
those characters continuously? Current implementations of using <C-v> for
unicodes and <C-k> for digraphs become tedious for typing continually.

Of course, people will use this mode while writing various documents as
well, and it will not merely be specific to rust devs.

What do you folks think about this?
--
Manas

--
--
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/20210627060221.mxo6zok4otcqxb3c%40nitro-5.

Re: Plugin works in TUI not GUI

On Sat, Jun 26, 2021 at 01:30:29AM +0200, Julius Hamilton wrote:
> I can confirm the installation in Gvim was successful with the command
> :MakeTestPage.
>
> For some reason, :set ft=txtfmt has not returned the expected confirmation
> message, and appears to do nothing.

When there is a difference between Vim in TUI en GVim, mostly that is
because of some setting in your .vimrc file. Finding the setting that
triggers different behavour can be a challenge though...

//meine

--
--
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/YNeW2wRUlkSuQXtc%40trackstand.

Re: Plugin works in TUI not GUI

Romain Lafourcade wrote:

> You are making a category error: what you have trouble with is txtfmt, not
> Vim. Instead of spamming Vim's mailing list, I would suggest you use the
> txtfmt's dedicated issue tracker.

Let's be tolerant, we can't expect every plugin to have a place to ask
questions.  Sure, if a plugin has it's own way to discuss problems,
please go there.  But otherwise the vim-use maillist can be used.  And
someone may point to a better place.  It's not like vim-use is that
overloaded.

This mailing list is indeed far from overloaded but, case in point, the plugin in question does have an issue tracker: https://github.com/bpstahlman/txtfmt/issues.

--
Romain Lafourcade

--
--
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/CAJoB-M-aqn%3Dux5myHjz0mnYfAdDCwiJzxdt6j4eeZT%2B8rNxy6g%40mail.gmail.com.

Re: Plugin works in TUI not GUI

Romain Lafourcade wrote:

> You are making a category error: what you have trouble with is txtfmt, not
> Vim. Instead of spamming Vim's mailing list, I would suggest you use the
> txtfmt's dedicated issue tracker.

Let's be tolerant, we can't expect every plugin to have a place to ask
questions. Sure, if a plugin has it's own way to discuss problems,
please go there. But otherwise the vim-use maillist can be used. And
someone may point to a better place. It's not like vim-use is that
overloaded.


--
hundred-and-one symptoms of being an internet addict:
33. You name your children Eudora, Mozilla and Dotcom.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.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_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202106261004.15QA4HmZ286930%40masaka.moolenaar.net.

Re: Txtfmt

> Which of these files are mandatory and which are optional? txtfmt includes:
>
> LICENSE install_details.txt
> README.md mb_patch.txt
> detailed_description.txt plugin
> doc release_notes.txt
> ftplugin syntax
> indent_patch.txt
>
> Do I need to add all of them?

The plugin only needs the sub-directories and files in ftplugin and
syntax. They are essential for the plugin to work. When you already have those directories, you can put the files into there. Otherwise, you'll have to make them in your .vim directory.

License and Release notes are not essential. The Read-me and
detailed_description are for your own reference, a short how-to or
'manual'. indent_patch I don't know, seems a description of the last
changes.

> I just cloned the repository with the git clone command. Does this retrieve
> the raw file?

Yes it does

When you cloned it the right way, all files will be put in the proper
directories. I must confess, that I sometimes miss the right place, and
have to correct things by hand.

> I will try out Pathogen next.
> I haven't tested out what I did above because I'm not familiar with the
> commands for using this plugin yet.

New plugins always have to be experienced. I have very few, and often
delete them after trying.
> > A straightforward 'how-to' you can find here:

> >
> > https://danishpraka.sh/2018/06/09/vim-plugin-install.html
>
> I tried this out, I don't think it worked, but I'll keep investigating.
There are a lot of sites that describe the installation of plugins. As
a non-techie, most of them are not clear to me. That is why I installed
the files by hand.

Kind Regards,

//meine

--
--
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/YNbu2f%2BCMbcrka0V%40trackstand.

Re: Plugin works in TUI not GUI

@Mr. Julius Hamilton, kindly reply to my previous emails if you received it. Thank you so much. :) 

On Sat, Jun 26, 2021, 7:30 AM Julius Hamilton, <julkhami@gmail.com> wrote:
I recently installed the plugin txtfmt and used it successfully in Vim TUI mode.

It is activated with the command :set ft=txtfmt. Then, to highlight a region, you enter \h, then it prompts you for a color.

I can confirm the installation in Gvim was successful with the command :MakeTestPage.

For some reason, :set ft=txtfmt has not returned the expected confirmation message, and appears to do nothing.

Could anyone shed light on why this might be?

Thank you very much,
Julius

--
--
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/CAGrXgp3kBFOObs0tgwV%3D_44UbJi39MjRd%2BfnPdpAxMFQ7_dDSQ%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/CA%2BCSdQGA3LhhtX0uqJa1qsiu8ASwa5oFHJsMs5VJuRzfrbZS2w%40mail.gmail.com.

Re: Plugin works in TUI not GUI

You are making a category error: what you have trouble with is txtfmt, not Vim. Instead of spamming Vim's mailing list, I would suggest you use the txtfmt's dedicated issue tracker.

Le samedi 26 juin 2021 à 01:30:48 UTC+2, julk...@gmail.com a écrit :
I recently installed the plugin txtfmt and used it successfully in Vim TUI mode.

It is activated with the command :set ft=txtfmt. Then, to highlight a region, you enter \h, then it prompts you for a color.

I can confirm the installation in Gvim was successful with the command :MakeTestPage.

For some reason, :set ft=txtfmt has not returned the expected confirmation message, and appears to do nothing.

Could anyone shed light on why this might be?

Thank you very much,
Julius

--
--
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/235a9fc1-81e7-48ce-9661-2d0575c91c4cn%40googlegroups.com.

Friday, June 25, 2021

Plugin works in TUI not GUI

I recently installed the plugin txtfmt and used it successfully in Vim TUI mode.

It is activated with the command :set ft=txtfmt. Then, to highlight a region, you enter \h, then it prompts you for a color.

I can confirm the installation in Gvim was successful with the command :MakeTestPage.

For some reason, :set ft=txtfmt has not returned the expected confirmation message, and appears to do nothing.

Could anyone shed light on why this might be?

Thank you very much,
Julius

--
--
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/CAGrXgp3kBFOObs0tgwV%3D_44UbJi39MjRd%2BfnPdpAxMFQ7_dDSQ%40mail.gmail.com.

Re: equivalent of get() for a string ?

Marc,

try this here:

if get(g:, 'purescript_update_path')
call PurescriptUpdatePath()
endif

You can omit the v:false in get(), see `:help get()` for more details.
g:, w: and b: return the global, window-local, and buffer-local dictionary,
respectively. See `:help g:` for more details. For example, if you run `:echo g:`
in the command-line it will print all the global variables as a dictionary. When
we pass g:, b: or w: to get(), we essentially use the following overload:
get({dict}, {key} [, {default}])


On 2021-06-24, Marc Chantreux wrote:
> hello people,
>
> I would like this
>
> if exists('g:purescript_update_path')
> if g:purescript_update_path
> call PurescriptUpdatePath()
> endif
> endif
>
> To be something like
>
> if get('g:purescript_update_path',v:false)
> call PurescriptUpdatePath()
> endif
>
> but get() doesn't work with strings and i don't find something close.
> did i miss something from the doc ?
>
> regards,
> marc
>
>
>
> --
> --
> 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/YNTfT1yVXYWRHawY%40prometheus.u-strasbg.fr.

--
--
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/YNZGJKKlbDPdwgN2%40laptop.homenetwork.

Keymapping txtfmt

Hello everyone,

I am a beginner, so just looking for a little guidance while I read tutorials.

I would like to custom map commands from the txtfmt highlighting plugin.

My understanding so far is that this could be achieved with a basic syntax such as:

map 1 \hf=bi,cg

However, the txtfmt command is such that first you must enter \h, then enter f=bi,cg into a command input prompt that gets displayed.

How might I achieve this two step command with Vim keymappings?

Thank you,
Julius

--
--
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/CAGrXgp0dieZtd0rzz22SVRLaB8gcPYoyCGbT4NkHcBg9xuZzQA%40mail.gmail.com.

Re: Txtfmt


The most crude and straightforward way of installing a plugin is just by
dropping the <plugin>.vim file in your ~/.vim/plugin/ directory.


Thanks very much. This help is invaluable.


You can do the same for the files that have to go into /ftplugin/, /syntax/,
etc. Just follow the directory structure on the Github site for the
right place on your computer.

Which of these files are mandatory and which are optional? txtfmt includes: 

LICENSE install_details.txt
README.md mb_patch.txt
detailed_description.txt plugin
doc release_notes.txt
ftplugin syntax
indent_patch.txt

Do I need to add all of them?




Be sure to download the raw version of the plugin code! On the website,
click until you reach the file and see the code, click the [Raw] button,
right-click and 'save page as...' in the directory mentioned above. The
right name will be already given. Note that different files for
different sub-folders can have the same name -- work in an organized
manner!

I just cloned the repository with the git clone command. Does this retrieve the raw file?



My experience is that this works all the time.

Other possibility is using the description for installing a plugin with
the use of Patogen, Vundle or Git -- just follow instructions, and all
files will be placed in the right directories.

I will try out Pathogen next.
I haven't tested out what I did above because I'm not familiar with the commands for using this plugin yet.



A straightforward 'how-to' you can find here:

https://danishpraka.sh/2018/06/09/vim-plugin-install.html


I tried this out, I don't think it worked, but I'll keep investigating.

Thanks very much,
Julius





--
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/YNXlzPtlZvKM7WIo%40trackstand.

--
--
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/CAGrXgp1NCs%3DGRqZ7qMYGQ%2B21ek0m-dYJppPdRP7wmKyn33pRuw%40mail.gmail.com.

Re: Txtfmt

On Thu, Jun 24, 2021 at 09:50:51PM +0200, Julius Hamilton wrote:
> Hey,
>
> I am trying to get up and running with this highlighting plug in:
> https://github.com/bpstahlman/txtfmt/blob/master/README.md.
>
> Its a bit complicated and I was wondering if someone could please walk me
> through the basic steps of installation and use.

The most crude and straightforward way of installing a plugin is just by
dropping the <plugin>.vim file in your ~/.vim/plugin/ directory. You can
do the same for the files that have to go into /ftplugin/, /syntax/,
etc. Just follow the directory structure on the Github site for the
right place on your computer.

Be sure to download the raw version of the plugin code! On the website,
click until you reach the file and see the code, click the [Raw] button,
right-click and 'save page as...' in the directory mentioned above. The
right name will be already given. Note that different files for
different sub-folders can have the same name -- work in an organized
manner!

My experience is that this works all the time.

Other possibility is using the description for installing a plugin with
the use of Patogen, Vundle or Git -- just follow instructions, and all
files will be placed in the right directories. When not (gitting them to
the wrong directory) you can relocate the files by hand as mentioned
above.

A straightforward 'how-to' you can find here:

https://danishpraka.sh/2018/06/09/vim-plugin-install.html

Good Luck!

//meine

--
--
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/YNXlzPtlZvKM7WIo%40trackstand.

Thursday, June 24, 2021

Re: equivalent of get() for a string ?

hello Salman,

> Shameless plug: my GetVar script (
> https://www.vim.org/scripts/script.php?script_id=353) does this.

thanks for noticing but i can't add such a dependency as i'm trying to
fix an existing package and would like to push my code upstream at
some point.

regards,
marc


--
--
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/YNTvovJVc29t7DS6%40prometheus.u-strasbg.fr.

Re: equivalent of get() for a string ?

Shameless plug: my GetVar script (https://www.vim.org/scripts/script.php?script_id=353) does this.

On Thu, Jun 24, 2021 at 3:49 PM Marc Chantreux <eiro@phear.org> wrote:
hello people,

I would like this

    if exists('g:purescript_update_path')
        if g:purescript_update_path
            call PurescriptUpdatePath()
        endif
    endif

To be something like

    if get('g:purescript_update_path',v:false)
        call PurescriptUpdatePath()
    endif

but get() doesn't work with strings and i don't find something close.
did i miss something from the doc ?

regards,
marc



--
--
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/YNTfT1yVXYWRHawY%40prometheus.u-strasbg.fr.


--
 
Salman

I, too, shall something make and glory in the making.

--
--
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/CANuxnEdHYCsNq2kiSko%3DMKYPCCobX9wrzczhkF3t-z1FUResyw%40mail.gmail.com.

Txtfmt

Hey,

I am trying to get up and running with this highlighting plug in: https://github.com/bpstahlman/txtfmt/blob/master/README.md.

Its a bit complicated and I was wondering if someone could please walk me through the basic steps of installation and use.

1. I have to download it. Should I git clone it into my .vim file, or should I try to install it via a package manager like Pathogen or something?

2. Do I have to run any commands to get Vim to recognize the new package and allow me to use its own commands?

Thanks very much,
Julius


--
--
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/CAGrXgp3ySK40tzorG59spPLArCAb12zvhO5wkr4jVTXZDk%2BJ3Q%40mail.gmail.com.

equivalent of get() for a string ?

hello people,

I would like this

if exists('g:purescript_update_path')
if g:purescript_update_path
call PurescriptUpdatePath()
endif
endif

To be something like

if get('g:purescript_update_path',v:false)
call PurescriptUpdatePath()
endif

but get() doesn't work with strings and i don't find something close.
did i miss something from the doc ?

regards,
marc



--
--
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/YNTfT1yVXYWRHawY%40prometheus.u-strasbg.fr.

Re: C compiler

Thank you.
For some reason, I had to use apt install vim instead of apt-get install vim. Then it was easy.

Thanks very much,
Julius



On Thu, Jun 24, 2021, 18:04 Christian Brabandt <cblists@256bit.org> wrote:

On Do, 24 Jun 2021, Julius Hamilton wrote:

> Hey,
>
> I got the error "No acceptable C compiler found in $PATH" when trying to make Vim.
>
> I am using Andronix, a modded Linux OS, specifically Ubuntu.
>
> Does anyone know what C compiler I should install?

gcc should work fine. You probably need a couple of more packages. On
ubuntu, to get started for building vim, one usually needs to run

apt-get build-dep vim-gtk

Best,
Christian
--
Wußten Sie schon...
... daß Lampenschirme eigentlich total überflüssig sind, da Lampen nur
selten draußen im Regen rumlaufen?

--
--
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/20210624160430.GC222622%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_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGrXgp1BsEn5NLCqW4FDikMSyscnqVsGZdmQRWkwEKWrHhn7YQ%40mail.gmail.com.

Re: C compiler

On Do, 24 Jun 2021, Julius Hamilton wrote:

> Hey,
>
> I got the error "No acceptable C compiler found in $PATH" when trying to make Vim.
>
> I am using Andronix, a modded Linux OS, specifically Ubuntu.
>
> Does anyone know what C compiler I should install?

gcc should work fine. You probably need a couple of more packages. On
ubuntu, to get started for building vim, one usually needs to run

apt-get build-dep vim-gtk

Best,
Christian
--
Wußten Sie schon...
... daß Lampenschirme eigentlich total überflüssig sind, da Lampen nur
selten draußen im Regen rumlaufen?

--
--
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/20210624160430.GC222622%40256bit.org.

C compiler

Hey,

I got the error "No acceptable C compiler found in $PATH" when trying to make Vim.

I am using Andronix, a modded Linux OS, specifically Ubuntu.

Does anyone know what C compiler I should install?

Thank you,
Julius

--
--
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/CAGrXgp1wRfLxjOAe-Td_iKSP2ogDbXZvDENKrYz6pRwPi8C3rQ%40mail.gmail.com.

Tuesday, June 22, 2021

Re: syntaxcomplete#Complete() and nested filetypes

On 2021-06-22, David Fishburn <dfishburn.vim@gmail.com> wrote:
> Life,
>
> I am not sure I quite understand your use case for the plugin.

Thanks for the feedback. My goal is to have some sort of
context-sensitive completion. My use case is ConTeXt, which can include
MetaPost blocks:

\starttext
TeX code here: filetype is `context`
\startMPcode
% Nested filetype here is `mp`.
% MetaPost code here.
% Only `mpSomething` syntax groups should be used for
% completion.
\stopMPcode
TeX code again: filetype is again `context`.
Only `contextSomething` syntax groups should be used.
\stoptext

Within the ...MPcode block, where a nested filetype is active, I'd like
completion only for that filetype. AFAICT, I can add MetaPost syntax
groups using omni_syntax_group_include_context, but they will be active
throughout the buffer.

The snippet I have posted allows me to do that sort of context-sensitive
completion, but maybe there is a better/more efficient way.

Thanks,
Life.

--
--
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/sas9l7%244pe%241%40ciao.gmane.io.

Monday, June 21, 2021

Re: syntaxcomplete#Complete() and nested filetypes

Life, 

I am not sure I quite understand your use case for the plugin.

:h ft-syntax-omni

In the example I provide there, I am editing a PHP file, which has embedded HTML and JavaScript.
So I need syntaxComplete to also provide JavaScript functions, not just PHP functions.

That examples demonstrates how to use the syntaxcomplete variables like:
    let g:omni_syntax_group_include_php = 'php\w\+,javaScript\w\+,html\w\+'

I can help if you give me a bit more to go on with a concrete example of commands and what you expected / want to see.

David


On Mon, Jun 21, 2021 at 6:23 AM Lifepillar <lifepillar@lifepillar.me> wrote:
On 2021-06-21, Lifepillar <lifepillar@lifepillar.me> wrote:
> I would like to use syntaxcomplete#Complete() in a filetype that
> includes a nested filetype.

This is what I have so far, which appears to be working in filetype
`foobar` with nested filetype `xyz`:

    def foobarcomplete#Complete(findstart: number, base: string): any
      if findstart == 1
        syntaxcomplete#OmniSyntaxClearCache()

        if len(synstack(line("."), 1)) > 0 &&
          synIDattr(synstack(line("."), 1)[0], "name") ==# '^xyz'
          g:omni_syntax_group_include_foobar = 'xyz\w\+'
        else
          unlet! g:omni_syntax_group_include_foobar
        endif
      endif

        return syntaxcomplete#Complete(findstart, base)
    enddef

If you have better ideas, let me know! I especially do not like that
I have to clear the cache.

Thanks,
Life.

--
--
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/sappac%243eh%242%40ciao.gmane.io.

--
--
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/CAJ_EjQgRzQYoShaRyeOcUve8V5052LdP%2BvW5GCFLV444mF7_0A%40mail.gmail.com.

Re: syntaxcomplete#Complete() and nested filetypes

On 2021-06-21, Lifepillar <lifepillar@lifepillar.me> wrote:
> I would like to use syntaxcomplete#Complete() in a filetype that
> includes a nested filetype.

This is what I have so far, which appears to be working in filetype
`foobar` with nested filetype `xyz`:

def foobarcomplete#Complete(findstart: number, base: string): any
if findstart == 1
syntaxcomplete#OmniSyntaxClearCache()

if len(synstack(line("."), 1)) > 0 &&
synIDattr(synstack(line("."), 1)[0], "name") ==# '^xyz'
g:omni_syntax_group_include_foobar = 'xyz\w\+'
else
unlet! g:omni_syntax_group_include_foobar
endif
endif

return syntaxcomplete#Complete(findstart, base)
enddef

If you have better ideas, let me know! I especially do not like that
I have to clear the cache.

Thanks,
Life.

--
--
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/sappac%243eh%242%40ciao.gmane.io.

syntaxcomplete#Complete() and nested filetypes

I would like to use syntaxcomplete#Complete() in a filetype that
includes a nested filetype. The only way I have found so far is to
define my own completion function that checks whether the current
position is within the nested filetype, then calls OmniSyntaxList() with
the appropriate regular expression. Something along these lines:

if synIDattr(...) =~ '^nestedfiletype'
matches = OmniSyntaxList(['^nestedfiletype\w\+'])
else
matches = OmniSyntaxList(['^mainfiletype\w\+'])
endif

This is simple enough, but (1) it does not benefit from
syntaxcomplete#Complete() caching, and (2) it requires my own function.

Perhaps, there is a more canonical way to achieve what I want?

Ideally, I would like to set omnifunc=syntaxcomplete#Complete(), and
have Vim figure out the filetype to use for the current completion.
I see that there are some global variables to tweak the completion
behaviour (g:omni_syntax_group_include, ...), but I have not found how
to use them for the my purpose.

Thanks,
Life.

--
--
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/sapo54%24bnf%241%40ciao.gmane.io.

Re: Search for pattern in the first few lines of a buffer

On 2021-06-21, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
> Hi,
>
> On Sun, Jun 20, 2021 at 3:59 AM Lifepillar <lifepillar@lifepillar.me> wrote:
>>
>> I need to programmatically search for a pattern in the first ten lines
>> of a given buffer, and save the match in a variable when found. Say, the
>> pattern is:
>>
>> % KEY = value
>>
>> I need to extract the value if the above appears in the first lines of
>> the buffer. Of course, the state of the buffer's window, such as the
>> cursor's position, etc., and the content of registers should not be
>> affected. How would you do that?
>>
>
> You can use getbufline() to read the first 10 lines of the buffer
> as a list and then use match() to find the index of the item matching
> a pattern in the list. You can then use substitute() or matchstr()
> to extract the value.

That is a simple strategy!

Thanks,
Life.

--
--
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/sapng8%24vev%241%40ciao.gmane.io.

Sunday, June 20, 2021

Re: Search for pattern in the first few lines of a buffer

Hi,

On Sun, Jun 20, 2021 at 3:59 AM Lifepillar <lifepillar@lifepillar.me> wrote:
>
> I need to programmatically search for a pattern in the first ten lines
> of a given buffer, and save the match in a variable when found. Say, the
> pattern is:
>
> % KEY = value
>
> I need to extract the value if the above appears in the first lines of
> the buffer. Of course, the state of the buffer's window, such as the
> cursor's position, etc., and the content of registers should not be
> affected. How would you do that?
>

You can use getbufline() to read the first 10 lines of the buffer
as a list and then use match() to find the index of the item matching
a pattern in the list. You can then use substitute() or matchstr()
to extract the value.

Regards,
Yegappan

--
--
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/CAAW7x7%3DrqQTTci3oSWsJFZ3Ai-D68Bvp5Z7dwKSgY8m3AObnUA%40mail.gmail.com.

Re: Translating complete functions to Vim9

> Is there a way to turn a completion function (:h complete-functions)
> into Vim9 script?
>
> The issue is that such functions are called twice, and they are expected
> to return values of different types in each call.

You can use the return type "any".

I know in typescript it is possible to combine two types, e.g. you can
use "string | number". But not many other languages use this. I am not
convinced adding the combined type to Vim 9 script is a good choice.

For newly added builtin functions we will avoid mixing types, both for
the arguments and for the returned value. But several of the existing
functions do allow for different types, since they were designed for
runtime type checking.

--
hundred-and-one symptoms of being an internet addict:
28. You have comandeered your teenager's phone line for the net and even his
friends know not to call on his line anymore.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.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_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202106201332.15KDWgCU336895%40masaka.moolenaar.net.

Search for pattern in the first few lines of a buffer

I need to programmatically search for a pattern in the first ten lines
of a given buffer, and save the match in a variable when found. Say, the
pattern is:

% KEY = value

I need to extract the value if the above appears in the first lines of
the buffer. Of course, the state of the buffer's window, such as the
cursor's position, etc., and the content of registers should not be
affected. How would you do that?

Thanks,
Life.

--
--
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/san735%24vqe%241%40ciao.gmane.io.

Saturday, June 19, 2021

Translating complete functions to Vim9

Is there a way to turn a completion function (:h complete-functions)
into Vim9 script?

The issue is that such functions are called twice, and they are expected
to return values of different types in each call.

Thanks,
Life.

--
--
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/salle7%24pfs%241%40ciao.gmane.io.

Wednesday, June 16, 2021

Re: How can I undock a file panel from a split window?

On Di, 15 Jun 2021, L A Walsh wrote:

> > That is not supported, Vim only works with one toplevel window.
> ----
>
> Why can't it allow undocking like other GUI apps? I'm not wanting
> it to be a separate instance of vim -- since I want it to be a
> different view on the same file -- so it's not like something that
> would need interprocess communication -- but really just another GUI
> window like browsers (like firefox or palemoon), like, I think,
> Visual Studio, or Thunderbird. Seems like its not an uncommon feature,
> and certainly would fit well with the idea of being able to undock
> separate windows or tabs from the main window, no?
> I.e. might it not be supportable?

It has simply not been implemented.

Best,
Christian
--
Wie man sein Kind nicht nennen sollte:
Ute Rus

--
--
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/20210616111309.GH532641%40256bit.org.

Re: How can I undock a file panel from a split window?

I suspect it isn't supportable due to decisions early on and the evolution of the code over many years.  Making the change properly would require changes throughout the code.  If Bram says it can't be done, I believe him.

Campbell has a very  straightforward approach of accomplishing the same end result by saving the contents of the current buffer, and then starting a new instance of gvim with that buffer. (I don't use gvim, so I hope I got that right.  I did get it work to my satisfaction with MacVim).

Is there a reason Campbell's solution does not work for you?  Ultimately, isn't the end result the most important part?

On Tuesday, June 15, 2021 at 11:37:58 PM UTC-4 v...@tlinx.org wrote:
On 2021/06/10 09:44, Bram Moolenaar wrote:
>> If I use split, I can create a separate panel that
>> is a view on a file.
>>
>> How can I undock it?
>>
>
> That is not supported, Vim only works with one toplevel window.
>
----

Why can't it allow undocking like other GUI apps? I'm not wanting
it to be a separate instance of vim -- since I want it to be a
different view on the same file -- so it's not like something that
would need interprocess communication -- but really just another GUI
window like browsers (like firefox or palemoon), like, I think,
Visual Studio, or Thunderbird. Seems like its not an uncommon feature,
and certainly would fit well with the idea of being able to undock
separate windows or tabs from the main window, no?
I.e. might it not be supportable?


--
--
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/27615ce3-363b-4589-9f5d-efae9dc2d2b8n%40googlegroups.com.

Tuesday, June 15, 2021

Re: How can I undock a file panel from a split window?

On 2021/06/10 09:44, Bram Moolenaar wrote:
>> If I use split, I can create a separate panel that
>> is a view on a file.
>>
>> How can I undock it?
>>
>
> That is not supported, Vim only works with one toplevel window.
>
----

Why can't it allow undocking like other GUI apps? I'm not wanting
it to be a separate instance of vim -- since I want it to be a
different view on the same file -- so it's not like something that
would need interprocess communication -- but really just another GUI
window like browsers (like firefox or palemoon), like, I think,
Visual Studio, or Thunderbird. Seems like its not an uncommon feature,
and certainly would fit well with the idea of being able to undock
separate windows or tabs from the main window, no?
I.e. might it not be supportable?


--
--
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/60C971D5.5000605%40tlinx.org.

Friday, June 11, 2021

Re: How can I undock a file panel from a split window?

Ultimately I added:

  let curfile = @%

and added that to:

  call system("mvim ".curfile." -S ".shellescape(sessionfile).' -c "set lines='.h.' columns='.w.'"'.' -c "winpos '.x.' '.y.'"')

and it seems to work for me.  I'm assuming mvim is lacking something gvim automatically does.

On Friday, June 11, 2021 at 11:47:15 AM UTC-4 rwmit...@gmail.com wrote:

I tried it. I'm using MacVim.  I edited the plugin replacing 'gvim' with 'mvim'.

It closes the current tab (good), opens a new macvim window (good) that is empty (bad).

I'm guessing the purpose of creating a new tmpname is to hold the contents of the current buffer without forcing it to be saved first, except the current buffer isn't getting written?
On Thursday, June 10, 2021 at 7:56:56 PM UTC-4 Charles Campbell wrote:
L A Walsh wrote:
> If I use split, I can create a separate panel that
> is a view on a file.
>
> How can I undock it?
>
Its not exactly what you're asking for, but I wrote something called
"Detach" which will detach a tab into its own process. ctrl-w T will
move a window into a new tab. The :Detach command will cause the
currently visible tab and all its windows to be brought up in a separate
gvim. Detaching a tab yields two independent instances of vim/gvim: they
do not share variables, vim functions, etc. If you're interested, you
may get it from http://www.drchip.org/astronaut/vim.index.html#DETACH .

Regards,
Chip Campbell

--
--
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/df9c16e4-9a53-4ccb-8e0f-93c7620b61adn%40googlegroups.com.

Re: How can I undock a file panel from a split window?


I tried it. I'm using MacVim.  I edited the plugin replacing 'gvim' with 'mvim'.

It closes the current tab (good), opens a new macvim window (good) that is empty (bad).

I'm guessing the purpose of creating a new tmpname is to hold the contents of the current buffer without forcing it to be saved first, except the current buffer isn't getting written?
On Thursday, June 10, 2021 at 7:56:56 PM UTC-4 Charles Campbell wrote:
L A Walsh wrote:
> If I use split, I can create a separate panel that
> is a view on a file.
>
> How can I undock it?
>
Its not exactly what you're asking for, but I wrote something called
"Detach" which will detach a tab into its own process. ctrl-w T will
move a window into a new tab. The :Detach command will cause the
currently visible tab and all its windows to be brought up in a separate
gvim. Detaching a tab yields two independent instances of vim/gvim: they
do not share variables, vim functions, etc. If you're interested, you
may get it from http://www.drchip.org/astronaut/vim.index.html#DETACH .

Regards,
Chip Campbell

--
--
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/c1f615ec-5f1f-456c-be3c-b06e657d688bn%40googlegroups.com.

Re: How can I undock a file panel from a split window?

On Fri, Jun 11, 2021 at 2:29 PM rwmit...@gmail.com <rwmitchell@gmail.com> wrote:
>
> That link returns a 404 for me. I was able to backup to just
> ```http://www.drchip.org```
> but now that is hanging. (no error, just not returning)
> On Thursday, June 10, 2021 at 7:56:56 PM UTC-4 Charles Campbell wrote:
>>
>> L A Walsh wrote:
>> > If I use split, I can create a separate panel that
>> > is a view on a file.
>> >
>> > How can I undock it?
>> >
>> Its not exactly what you're asking for, but I wrote something called
>> "Detach" which will detach a tab into its own process. ctrl-w T will
>> move a window into a new tab. The :Detach command will cause the
>> currently visible tab and all its windows to be brought up in a separate
>> gvim. Detaching a tab yields two independent instances of vim/gvim: they
>> do not share variables, vim functions, etc. If you're interested, you
>> may get it from http://www.drchip.org/astronaut/vim.index.html#DETACH .
>>
>> Regards,
>> Chip Campbell
>
> --
> --
> 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
>
The correct URL is http://www.drchip.org/astronaut/vim/index.html#DETACH
It differs from the one Dr. Chip gave by one slash replacing a dot.
It sends you to a link to a .vba.gz (a gzipped |vimball|) which IIUC
contains the software and help for the :Detach command.

Best regards,
Tony.

--
--
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/CAJkCKXvX649WWhD8C31CCgA7zNOT8U1TLssDT2Yen28fyVK5fQ%40mail.gmail.com.