Wednesday, November 20, 2024

Re: load two plugins for one file type

Thank you. Have created a plugin file and put that into the ~/.vim/after/ftplugin. It is working.

But one thing that I was doing in the plugin script was setting foldmethod, foldexpr, and foldtext with setlocal. But these were not being run because they were put after the "if exists" check I am doing in the plugin so that it is not loaded twice. I moved these before the "if exists" check. Is this the way to do it for plugins? Or should these be done in another file?

Here is the start of the plugin...

// Should these be moved somewhere else. This is a file type plugin.
setlocal foldmethod=expr foldexpr=PodFold()
setlocal foldtext=PodFoldText()

if exists("g:loaded_podotl")
        finish
endif
let g:loaded_podotl = 1

Regards

On Wed, Nov 20, 2024 at 8:06 PM Charles Campbell <astrocec50@gmail.com> wrote:
Riza Dindir wrote:
> Thanks
>
> On Mon, Nov 18, 2024 at 9:57 PM Gary Johnson <garyjohn@spocom.com
> <mailto:garyjohn@spocom.com>> wrote:
>
>     On 2024-11-18, Riza Dindir wrote:
>     > Hello
>     >
>     > Is it possible to load two script files for one file type? For
>     instance vim
>     > defines its own plugin for a file type. I want to extend that,
>     or add a new
>     > style of mappings for that file type.
>     >
>     > Would it be possible to load two plugin files, one in the
>     default vim plugins
>     > directory, ftplugin which I do not want to change, and one in
>     the ~/.vim/
>     > ftplugin directory which I have access to (to change, update)
>     for a file type?
>
>     Yes.  Put your changes in a new file,
>     ~/.vim/after/ftplugin/<filetype>.vim, where <filetype> is the name
>     of the file type you want to affect.  For example,
>     ~/.vim/after/ftplugin/python.vim.
>
>     Vim loads filetype plugins in the order determined by 'runtimepath'.
>     For Unix, that would normally be:
>
>         1.  ~/.vim/ftplugin/<filetype>.vim
>         2.  $VIM/vimfiles/ftplugin/<filetype>.vim
>         3.  $VIMRUNTIME/ftplugin/<filetype>.vim
>         4.  $VIM/vimfiles/after/ftplugin/<filetype>.vim
>         5.  ~/.vim/after/ftplugin/<filetype>.vim
>
>     Vim's default plugins are in $VIMRUNTIME; local system-wide plugins
>     are in $VIM/vimfiles; and your personal plugins are in ~/.vim.
>
>     By putting your changes in your "after" directory, you can override
>     settings made by the other plugins for that file type and not have
>     your settings overridden by them.
>
>     See
>         :help ftplugin-overrule
>         :help 'runtimepath'
>
In $VIM/vimfiles/ftplugin you can create a directory called "vim/" and
put multiple files (plugins) in it, too. They'll all be loaded.
In $VIM/vimfiles/after/ftplugin you can do the same thing; these plugins
will be loaded later in the cycle.

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 visit https://groups.google.com/d/msgid/vim_use/CA%2Bek4BEiB5pTksp3W6PwBCu2_0LqPz1i8mCoe-jyP6Kwqqo01w%40mail.gmail.com.

Re: Alt keys not sent to Vim :terminal

On Wed, 20 Nov 2024 14:05:11 -0500
Enan Ajmain <3nan.ajmain@gmail.com> wrote:
> Hi,
>
> I'm in Windows. In Linux, I always use Tmux for my terminal use cases.
> But since Tmux doesn't exist in Windows, I wanted to use the embedded
> terminal in Vim. It works great. Except --
>
> The alt keys are sending accent letters. For example, I am using Clink,
> which adds GNU readline-like features to Command Prompt. So I can use
> Alt-f and Alt-b to move cursor one word forward and backward. It works
> in external terminal emulator. But it doesn't work in Vim's embedded
> terminal.
>
> C:> this is a word æâ
>
> Above you can see the accented characters æ and â where I pressed Alt-b
> and Alt-f respectively. This issue exists in both TUI Vim and GVim.
>
> How can I fix this issue?
>
> Note that I checked with pressing <Ctrl-v><Alt-f> in insert mode in a
> non-terminal buffer and it indeed put æ. So I'm thinking if I can send
> some other code corresponding to Alt-f, it will work, but I'm not sure.
>
> --
> Enan
>
> P.S. Ctrl keys work fine. Ctrl-a/e moves the cursor to the start/end of
> the line.

As usual, I got the solution right after I asked for help. I needed to
send Esc for Alt keys:


for i in range(65,90) + range(97,122)
let c = nr2char(i)
exec "tnoremap <A-".c."> <Esc>".c
exec "tnoremap <A-C-".c."> <Esc><C-".c.">"
endfor

--
Enan

--
--
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 visit https://groups.google.com/d/msgid/vim_use/20241120155715.0000781d%40gmail.com.

Alt keys not sent to Vim :terminal

Hi,

I'm in Windows. In Linux, I always use Tmux for my terminal use cases.
But since Tmux doesn't exist in Windows, I wanted to use the embedded
terminal in Vim. It works great. Except --

The alt keys are sending accent letters. For example, I am using Clink,
which adds GNU readline-like features to Command Prompt. So I can use
Alt-f and Alt-b to move cursor one word forward and backward. It works
in external terminal emulator. But it doesn't work in Vim's embedded
terminal.

C:> this is a word æâ

Above you can see the accented characters æ and â where I pressed Alt-b
and Alt-f respectively. This issue exists in both TUI Vim and GVim.

How can I fix this issue?

Note that I checked with pressing <Ctrl-v><Alt-f> in insert mode in a
non-terminal buffer and it indeed put æ. So I'm thinking if I can send
some other code corresponding to Alt-f, it will work, but I'm not sure.

--
Enan

P.S. Ctrl keys work fine. Ctrl-a/e moves the cursor to the start/end of
the line.

--
--
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 visit https://groups.google.com/d/msgid/vim_use/20241120140511.0000017e%40gmail.com.

Re: HG-Bridge disabled (Mercurial connection refused)

On Wed, Nov 20, 2024 at 11:10 AM Christian Brabandt <cblists@256bit.org> wrote:
>
>
> On Wed, 20 Nov 2024, Christian Brabandt wrote:
>
> >
> > On Wed, 20 Nov 2024, Tony Mechelynck wrote:
> >
> > > On Tue, Nov 19, 2024 at 4:47 PM Christian Brabandt <cblists@256bit.org> wrote:
> > > >
> > > > Hi,
> > > > just to let everybody know. Because of serious load issues, the HG
> > > > bridge is disabled for now.
> > > >
> > > > Just for my reference, how many users are still using it hg.256bit.org?
> > >
> > > I don't know how many are, but as I suppose you already know, I am one
> > > of them. For some reason Mercurial feels congenial to me and git
> > > doesn't.
> > >
> > > My current Mercurial configuration includes the following remote
> > > repository aliases, which I am listing alphabetically below with name,
> > > URL, and current response to "hg in". Some of them may be obsolete.
> > > bitbucket = https://bitbucket.org/vim-mirror/vim
> > > Not found.
> > > default = http://hg.256bit.org/vim
> > > Not found.
> > > osdn = https://hg.osdn.net/view/vim/vim
> > > Certificate has expired.
> > > In other words, the latter one is still responding, but rejecting the
> > > request for lack of an up-to-date certificate.
> > > I practically always pull from the "default" source unless, like now,
> > > it really goes down.
> >
> > Oh, Apparently I am still pushing to osdn, I thought I had disabled this
> > long time ago. For the time being, you can continue to use that one.
>
> Hm, I can still pull using --insecure
>
> But pushing is totally broken:
> ```
> pushing to ssh://chrisbra@osdn//hgroot/vim/vim
> remote: logger: socket /dev/log: Connection refused
> searching for changes
> remote: abort: No usable temporary directory found in ['/tmp',
> '/var/tmp', '/usr/tmp', '/home/users/c/ch/chrisbra']
> abort: unexpected response: empty string
> ```
> and neither can I push using https urls, so this repository is at
> ```
> changeset: 36245:368dd9765c4d
> tag: tip
> user: Christian Brabandt <cb@256bit.org>
> date: Sat Oct 05 17:15:03 2024 +0200
> summary: runtime(compiler): add cppcheck linter compiler plugin
> ```
>
> We will setup a secondary vim.org mercurial mirror, but this will take
> some time.

Take all the time you need ; in the meantime I have two temporary
solutions as I mentioned in another thread (1. keep using Vim 9.1.873
compiled from my own config options when hg.256bit.org/vim was still
online ; 2. fall back on the Vim from my Linux distro, which will
always be a little behind the times but not much and will never be
exactly what I would have configured myself, but it is usable ;
currently it is at 9.1.836, Huge, with GTK3 GUI).

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 visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsRfVC9aqiwOox3WB3GPCiyOufAfa2EfK66_YiwJNXZ%2BQ%40mail.gmail.com.

Re: HG-Bridge disabled (Mercurial connection refused)

On Wed, 20 Nov 2024, Christian Brabandt wrote:

>
> On Wed, 20 Nov 2024, Tony Mechelynck wrote:
>
> > On Tue, Nov 19, 2024 at 4:47 PM Christian Brabandt <cblists@256bit.org> wrote:
> > >
> > > Hi,
> > > just to let everybody know. Because of serious load issues, the HG
> > > bridge is disabled for now.
> > >
> > > Just for my reference, how many users are still using it hg.256bit.org?
> >
> > I don't know how many are, but as I suppose you already know, I am one
> > of them. For some reason Mercurial feels congenial to me and git
> > doesn't.
> >
> > My current Mercurial configuration includes the following remote
> > repository aliases, which I am listing alphabetically below with name,
> > URL, and current response to "hg in". Some of them may be obsolete.
> > bitbucket = https://bitbucket.org/vim-mirror/vim
> > Not found.
> > default = http://hg.256bit.org/vim
> > Not found.
> > osdn = https://hg.osdn.net/view/vim/vim
> > Certificate has expired.
> > In other words, the latter one is still responding, but rejecting the
> > request for lack of an up-to-date certificate.
> > I practically always pull from the "default" source unless, like now,
> > it really goes down.
>
> Oh, Apparently I am still pushing to osdn, I thought I had disabled this
> long time ago. For the time being, you can continue to use that one.

Hm, I can still pull using --insecure

But pushing is totally broken:
```
pushing to ssh://chrisbra@osdn//hgroot/vim/vim
remote: logger: socket /dev/log: Connection refused
searching for changes
remote: abort: No usable temporary directory found in ['/tmp',
'/var/tmp', '/usr/tmp', '/home/users/c/ch/chrisbra']
abort: unexpected response: empty string
```
and neither can I push using https urls, so this repository is at
```
changeset: 36245:368dd9765c4d
tag: tip
user: Christian Brabandt <cb@256bit.org>
date: Sat Oct 05 17:15:03 2024 +0200
summary: runtime(compiler): add cppcheck linter compiler plugin
```

We will setup a secondary vim.org mercurial mirror, but this will take
some time.

Sorry,
Christian
--
Bride, n.:
A woman with a fine prospect of happiness behind her.
-- Ambrose Bierce, "The Devil's Dictionary"

--
--
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 visit https://groups.google.com/d/msgid/vim_use/Zz21fw1ezmkMTGVd%40256bit.org.

Re: HG-Bridge disabled (Mercurial connection refused)

P.S.

On Wed, Nov 20, 2024 at 10:49 AM Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
>
> On Wed, Nov 20, 2024 at 10:34 AM Christian Brabandt <cblists@256bit.org> wrote:
> […]
> > Oh, Apparently I am still pushing to osdn, I thought I had disabled this
> > long time ago. For the time being, you can continue to use that one.
> […]
>
> I would, if it would let me ; but AFAICT Mercurial is adamant about
> not letting me pull from a server with an out-of-date certificate.

P.S. Apparently you aren't pushing to it anymore, and since long ago
from the number of bytes hg says were exchanged (611 sent 525
received). I removed the s in https and tried the same URL ; it
answered "no changes found".
>
> 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 visit https://groups.google.com/d/msgid/vim_use/CAJkCKXvwZhracnaZcJFY7p0JY%3DqtNu%3DjuyYapQ%3DjoTOW8vyYXQ%40mail.gmail.com.

Re: HG-Bridge disabled (Mercurial connection refused)

On Wed, Nov 20, 2024 at 10:34 AM Christian Brabandt <cblists@256bit.org> wrote:
[…]
> Oh, Apparently I am still pushing to osdn, I thought I had disabled this
> long time ago. For the time being, you can continue to use that one.
[…]

I would, if it would let me ; but AFAICT Mercurial is adamant about
not letting me pull from a server with an out-of-date certificate.

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 visit https://groups.google.com/d/msgid/vim_use/CAJkCKXvko%3DQONo59-_d2NSERajsoqAmKxLTmg5T0RrHoawvY3g%40mail.gmail.com.