Sunday, June 23, 2024

Re: ":b {bufname}" tab-completion uses whole filepath

On 2024-06-14, Enan Ajmain <3nan.ajmain@gmail.com> wrote:
> I use ':b' quite often. And I use a substring of the bufname to jump to
> that buffer. Works quite well.
>
> But a problem is that the substring I provide isn't only matched with
> the buffer names but also the filenames. See these examples:
>
> :ls
> 1 #h "example\predict.py" line 25
> 2 a "deeplog\deeplog.py" line 0
> 4 %a "example\train.py" line 37
> :b deep<tab>
>
> Then when I type ":b deep<tab>", the matches shown are:
>
> E:\projects\log-parsing\deeplog\example\predict.py
> deeplog\deeplog.py
> E:\projects\log-parsing\deeplog\example\train.py
>
> We can see that vim is matching the filepaths instead of only the buffer
> names. Can I change this behavior? Preferably with vimscripting, --

If you don't mind using a (lightweight) plugin, you can do it with my
Zeef¹ plugin. Zeef has a buffer switcher, which may or may not work for
you, but simplifying the creation of one tailored to your own specific
needs is the very purpose of the plugin. This is an example:

vim9script
import autoload 'zeef.vim'

def SwitchToBuffer(items: list<string>)
execute 'buffer' matchstr(items[0], '^\s*\zs\d\+')
enddef

zeef.Open(
execute('ls')->split("\n"),
SwitchToBuffer,
'Choose buffer',
{multi: false},
)

Hope this helps,
Life.

¹ https://github.com/lifepillar/vim-zeef



--
--
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/v599m0%248b7%241%40ciao.gmane.io.

Re: partial syntax in vim

On 2024-06-17, Andreas Otto <aotto1968zwei@gmail.com> wrote:
> Hi is it possible to change the syntax for a limit part of a file?

Yes. See :help syn-include and :help mysyntaxfile-add.

> example: tcl file with bash syntax used with "pseudo code" vim: push … vim:

I do not recommend using comments with `vim:` because they are
interpreted specially by Vim. Just use (for instance):

if {checkNotIgnore("DIFF")} {
File_Exec_BASH {
# syntax=bash
[...]
# pop syntax
} <@stdin >@stdout 2>@stderr
}

Create ~/.vim/after/syntax/tcl.vim with this content:

unlet b:current_syntax
syn include @Bash syntax/bash.vim
syn region tclBash matchgroup=Comment start=/^\s*# syntax=bash/ end=/^\s*# pop syntax/ contains=@Bash
let b:current_syntax = "tcl"

Hope this helps,
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/v598nh%2433u%241%40ciao.gmane.io.

Sunday, June 16, 2024

partial syntax in vim

Hi is it possible to change the syntax for a limit part of a file?
example: tcl file with bash syntax used with "pseudo code" vim: push … vim: pop

if {checkNotIgnore("DIFF")} {
  File_Exec_BASH {
    # vim: push syntax=bash
    set -ue

    [[ "$(yes_or_no.bash 'want to exit?')" == "y" ]] && exit

    declare -a files=($(find . -name .vimrc 2>/dev/null))

    git diff "${files[@]}"

    if [[ $(git status --porcelain "${files[@]}") ]] ; then
      if [[ "$(yes_or_no.bash 'commit changes?')" = "y" ]] ; then
        git commit -m lng_Shortcut.tcl "${files[@]}"
      fi
      :
    fi
    exit 0
    # vim: pop syntax
  } <@stdin >@stdout 2>@stderr
}

--
--
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/abc1d980-74a7-4192-a288-6ad802758888n%40googlegroups.com.

Saturday, June 15, 2024

Re: ":b {bufname}" tab-completion uses whole filepath

On Fr, 14 Jun 2024, Enan Ajmain wrote:

> On Fri, 14 Jun 2024 22:52:10 +0200
> Christian Brabandt <cblists@256bit.org> wrote:
> >
> > You could try the following mapping:
> >
> > :cnoremap <expr> B getcmdtype()==#':'&&getcmdpos()==1?'b */':'B'
> >
> > And then type :B which would expand to :b */ on the commandline and then
> > whatever you type would be anchored to the directory separator.
>
> I think the cnoremap only maps 'B' to expand to "b */" if it's at the
> start of the commandline. But what's "b */" supposed to do? I added
> this mapping and then typed "deep" (so the whole commandline became "b
> */deep" and then pressed tab. It didn't do anything. No completion.

Ah Windows, I didn't think about it. So unless you use shellslash,
you'll need to change the mapping to use a backslash instead:

:cnoremap <expr> B getcmdtype()==#':'&&getcmdpos()==1?'b *\':'B'

> Could you explain the logic behind "anchored to the directory
> separator"?

The idea is, that you want everything that you typed to be matched after
a directory separator. So instead of :b deeplog<tab> which presents you
with 3 different files, anchor the pattern to the directory separator:
\deeplog.py which Vim shall then only complete if it matches the
directory separator followed by whatever you enter.

> Note that I also tried "b *\" and "b *\\" since I'm in Windows.

Try if :b *\<pattern><tab> works for you.


Thanks,
Christian
--
Unfair animal names:

-- tsetse fly -- bullhead
-- booby -- duck-billed platypus
-- sapsucker -- Clarence
-- Gary Larson

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

Friday, June 14, 2024

Re: ":b {bufname}" tab-completion uses whole filepath

junegunn/fzf.vim solves this nicely. It builds on junegunn/fzf to fuzzy search on buffer names. Look into its :Buffers alongside other handy helper methods.


On Fri, 14 Jun 2024, 20:52 Christian Brabandt, <cblists@256bit.org> wrote:

On Fr, 14 Jun 2024, Enan Ajmain wrote:

> I use ':b' quite often.  And I use a substring of the bufname to jump to
> that buffer.  Works quite well.
>
> But a problem is that the substring I provide isn't only matched with
> the buffer names but also the filenames.  See these examples:
>
>     :ls
>       1 #h   "example\predict.py"           line 25
>       2  a   "deeplog\deeplog.py"           line 0
>       4 %a   "example\train.py"             line 37
>     :b deep<tab>
>
> Then when I type ":b deep<tab>", the matches shown are:
>
>     E:\projects\log-parsing\deeplog\example\predict.py
>     deeplog\deeplog.py
>     E:\projects\log-parsing\deeplog\example\train.py
>
> We can see that vim is matching the filepaths instead of only the buffer
> names.  Can I change this behavior?  Preferably with vimscripting, but
> I'm willing to change source code too since I use this too often.
>
> To be clear: I want only this match to be shown:
>
>     deeplog\deeplog.py

You could try the following mapping:

:cnoremap <expr> B getcmdtype()==#':'&&getcmdpos()==1?'b */':'B'

And then type :B which would expand to :b */ on the commandline and then
whatever you type would be anchored to the directory separator.

Thanks,
Christian
--
TAILFINS!! ... click ...

--
--
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/Zmytev/J%2BUjT7XXH%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/CAOmRJrdSq0_psQiU40%2BUTAjJCy-unbBJ__vStbK4CpMP%2B74JOQ%40mail.gmail.com.

Re: ":b {bufname}" tab-completion uses whole filepath

On Fri, 14 Jun 2024 22:52:10 +0200
Christian Brabandt <cblists@256bit.org> wrote:
>
> You could try the following mapping:
>
> :cnoremap <expr> B getcmdtype()==#':'&&getcmdpos()==1?'b */':'B'
>
> And then type :B which would expand to :b */ on the commandline and then
> whatever you type would be anchored to the directory separator.

I think the cnoremap only maps 'B' to expand to "b */" if it's at the
start of the commandline. But what's "b */" supposed to do? I added
this mapping and then typed "deep" (so the whole commandline became "b
*/deep" and then pressed tab. It didn't do anything. No completion.

Could you explain the logic behind "anchored to the directory
separator"?

Note that I also tried "b *\" and "b *\\" since I'm in Windows.


--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20240614190301.00004a7e%40gmail.com.

Re: ":b {bufname}" tab-completion uses whole filepath

On Fr, 14 Jun 2024, Enan Ajmain wrote:

> I use ':b' quite often. And I use a substring of the bufname to jump to
> that buffer. Works quite well.
>
> But a problem is that the substring I provide isn't only matched with
> the buffer names but also the filenames. See these examples:
>
> :ls
> 1 #h "example\predict.py" line 25
> 2 a "deeplog\deeplog.py" line 0
> 4 %a "example\train.py" line 37
> :b deep<tab>
>
> Then when I type ":b deep<tab>", the matches shown are:
>
> E:\projects\log-parsing\deeplog\example\predict.py
> deeplog\deeplog.py
> E:\projects\log-parsing\deeplog\example\train.py
>
> We can see that vim is matching the filepaths instead of only the buffer
> names. Can I change this behavior? Preferably with vimscripting, but
> I'm willing to change source code too since I use this too often.
>
> To be clear: I want only this match to be shown:
>
> deeplog\deeplog.py

You could try the following mapping:

:cnoremap <expr> B getcmdtype()==#':'&&getcmdpos()==1?'b */':'B'

And then type :B which would expand to :b */ on the commandline and then
whatever you type would be anchored to the directory separator.

Thanks,
Christian
--
TAILFINS!! ... click ...

--
--
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/Zmytev/J%2BUjT7XXH%40256bit.org.

Re: ":b {bufname}" tab-completion uses whole filepath

On 2024-06-14, Enan Ajmain wrote:
> I use ':b' quite often. And I use a substring of the bufname to jump to
> that buffer. Works quite well.
>
> But a problem is that the substring I provide isn't only matched with
> the buffer names but also the filenames. See these examples:
>
> :ls
> 1 #h "example\predict.py" line 25
> 2 a "deeplog\deeplog.py" line 0
> 4 %a "example\train.py" line 37
> :b deep<tab>
>
> Then when I type ":b deep<tab>", the matches shown are:
>
> E:\projects\log-parsing\deeplog\example\predict.py
> deeplog\deeplog.py
> E:\projects\log-parsing\deeplog\example\train.py
>
> We can see that vim is matching the filepaths instead of only the buffer
> names. Can I change this behavior? Preferably with vimscripting, but
> I'm willing to change source code too since I use this too often.
>
> To be clear: I want only this match to be shown:
>
> deeplog\deeplog.py

The full buffer name _is_ the full file name. Vim usually tries to
show the user a shorter name such as the relative file name. If, in
your example, you were to :cd to some other directory and execute
:ls again, you would see those buffer names as full path names.

I don't know of a built-in command or option that will give you what
you want. I think you would have to write a function that would
search the buffer list for a buffer whose basename or relative path
contained the substring you supplied and execute the :b command with
that name. Just the bufname() function with the appropriate
file-pattern would do a lot of the work.

You could then create a command to call that function. The command
name would have to begin with an upper-case letter, but you can also
use :cabbrev to create an abbreviation that expands 'b' at the
beginning of the command line to your command name. That would let
you continue to use the :b command that your fingers are used to.

For <tab> to work, you'd also need to create a completion function
that followed the same matching rules as your buffer function.

Maybe not simple, but doable in vimscript.

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/20240614193251.GA15474%40phoenix.

":b {bufname}" tab-completion uses whole filepath

I use ':b' quite often. And I use a substring of the bufname to jump to
that buffer. Works quite well.

But a problem is that the substring I provide isn't only matched with
the buffer names but also the filenames. See these examples:

:ls
1 #h "example\predict.py" line 25
2 a "deeplog\deeplog.py" line 0
4 %a "example\train.py" line 37
:b deep<tab>

Then when I type ":b deep<tab>", the matches shown are:

E:\projects\log-parsing\deeplog\example\predict.py
deeplog\deeplog.py
E:\projects\log-parsing\deeplog\example\train.py

We can see that vim is matching the filepaths instead of only the buffer
names. Can I change this behavior? Preferably with vimscripting, but
I'm willing to change source code too since I use this too often.

To be clear: I want only this match to be shown:

deeplog\deeplog.py

Here's the version info:

:ver
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 21 2024 02:04:14)
MS-Windows 64-bit console version
Included patches: 1-426
Compiled by ACER@JUDAS
Huge version without GUI. Features included (+) or not (-):
+acl +ex_extra +multi_lang -tag_any_white
+arabic +extra_search -mzscheme -tcl
+autocmd -farsi -netbeans_intg +termguicolors
+autochdir +file_in_path +num64 -terminal
+autoservername +find_in_path +packages -termresponse
-balloon_eval +float +path_extra +textobjects
+balloon_eval_term +folding -perl +textprop
-browse -footer +persistent_undo -tgetent
++builtin_terms -gettext +popupwin +timers
+byte_offset -hangul_input -postscript +title
+channel +iconv/dyn +printer -toolbar
+cindent +insert_expand +profile +user_commands
+clientserver +ipv6 -python +vartabs
+clipboard +job -python3 +vertsplit
+cmdline_compl +jumplist +quickfix +vim9script
+cmdline_hist +keymap +reltime +viminfo
+cmdline_info +lambda +rightleft +virtualedit
+comments +langmap -ruby +visual
+conceal +libcall +scrollbind +visualextra
+cryptv +linebreak +signs +vreplace
-cscope +lispindent +smartindent +vtp
+cursorbind +listcmds -sodium +wildignore
+cursorshape +localmap -sound +wildmenu
+dialog_con -lua +spell +windows
+diff +menu +startuptime +writebackup
+digraphs +mksession +statusline -xattr
-dnd +modify_fname -sun_workshop -xfontset
-ebcdic +mouse +syntax -xim
+emacs_tags -mouseshape +tag_binary -xpm_w32
+eval +multi_byte_ime/dyn -tag_old_static -xterm_save
system vimrc file: "$VIM\vimrc"
user vimrc file: "$HOME\_vimrc"
2nd user vimrc file: "$HOME\vimfiles\vimrc"
3rd user vimrc file: "$VIM\_vimrc"
user exrc file: "$HOME\_exrc"
2nd user exrc file: "$VIM\_exrc"
defaults file: "$VIMRUNTIME\defaults.vim"
Compilation: gcc -I. -Iproto -DWIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall -O3 -fomit-frame-pointer -freg-struct-return
Linking: gcc -I. -Iproto -DWIN32 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DHAVE_PATHDEF -DFEAT_HUGE -DHAVE_STDINT_H -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -march=x86-64 -Wall -O3 -fomit-frame-pointer -freg-struct-return -s -municode -o vim.exe -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion -lws2_32 -lole32 -luuid

--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20240614124918.000005b6%40gmail.com.

Sunday, June 2, 2024

Re: Error building Vim

Enan,

Thank you for your detailed explanation. I had, indeed, failed to install both Python 2 and 3 and had only installed 3, though was building for both. Once I figured out that beginner error, I've been doing just fine with it. 

I got lucky with putting everything in my PATH, but the -I tip isn't something I'd thought to include myself. Very useful. 

Thank you, again.

Salman

On Mon, Jun 3, 2024, 00:29 Enan Ajmain <3nan.ajmain@gmail.com> wrote:
On Mon, 27 May 2024 23:09:16 -0400
Salman Halim <salmanhalim@gmail.com> wrote:
> Hello,
>
> I'm trying to set up a new Windows 11 laptop and have followed the steps in
> INSTALLpc.txt after getting the latest Vim repository from git. When I try
> to compile with Python support, I get the following error and compilation
> stops. I'm hoping someone can tell me what to do about this.
>
> if_python.c:66:10: fatal error: Python.h: No such file or directory
>    66 | #include <Python.h>
>       |          ^~~~~~~~~~
> compilation terminated.

Your compiler is failing to find the python header file.  MinGW doesn't
provide headers for Python.  You'll have to provide it yourself.

Install Python.  Install the version you want.  Get the location of the
executable by running Python and then running these Python statements:

  import sys
  print(sys.executable)

Assume the output is: C:\Python\python.exe

Then go into C:\Python and you should see a include/ folder (also a lib/
folder, which will come into use later).  There should be a Python.h
file, and all other Python-related header files, in this folder.  Add
this folder to the include folders when running the compiler (-I flag).

You'll also have to add the lib/ folder to the library folders when
linking (-l flag).  I can't remember the specific commands or flags.
Since you're building from source, I'm sure you know your C and GCC.

Good luck.

> My command-line (executed from inside vim/src):
>
> mingw32-make -f Make_ming.mak -j$NUMBER_OF_PROCESSORS GUI=yes FEATURES=HUGE
> PYTHON3=c:/Python312 PYTHON3_VER=312 PYTHON=c:/Python27 PYTHON_VER=27
> DYNAMIC_PYTHON=yes STATIC_STDCPLUS=yes DIRECTX=yes
>
> I've tried changing 'mingw32-make' to just 'make' and still get the same
> error. Running it with 'clean' instead of all the other parameters works as
> expected.
>
> I would appreciate any help here, please.
>
> Thank you and best regards,
>



--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20240603002938.00002012%40gmail.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/CANuxnEeYicCNExurLQZ%3D2yyYUsS-0sh4sWUKL7GoWL0a%3DLbUyw%40mail.gmail.com.

Re: Error building Vim

On Mon, 27 May 2024 23:09:16 -0400
Salman Halim <salmanhalim@gmail.com> wrote:
> Hello,
>
> I'm trying to set up a new Windows 11 laptop and have followed the steps in
> INSTALLpc.txt after getting the latest Vim repository from git. When I try
> to compile with Python support, I get the following error and compilation
> stops. I'm hoping someone can tell me what to do about this.
>
> if_python.c:66:10: fatal error: Python.h: No such file or directory
> 66 | #include <Python.h>
> | ^~~~~~~~~~
> compilation terminated.

Your compiler is failing to find the python header file. MinGW doesn't
provide headers for Python. You'll have to provide it yourself.

Install Python. Install the version you want. Get the location of the
executable by running Python and then running these Python statements:

import sys
print(sys.executable)

Assume the output is: C:\Python\python.exe

Then go into C:\Python and you should see a include/ folder (also a lib/
folder, which will come into use later). There should be a Python.h
file, and all other Python-related header files, in this folder. Add
this folder to the include folders when running the compiler (-I flag).

You'll also have to add the lib/ folder to the library folders when
linking (-l flag). I can't remember the specific commands or flags.
Since you're building from source, I'm sure you know your C and GCC.

Good luck.

> My command-line (executed from inside vim/src):
>
> mingw32-make -f Make_ming.mak -j$NUMBER_OF_PROCESSORS GUI=yes FEATURES=HUGE
> PYTHON3=c:/Python312 PYTHON3_VER=312 PYTHON=c:/Python27 PYTHON_VER=27
> DYNAMIC_PYTHON=yes STATIC_STDCPLUS=yes DIRECTX=yes
>
> I've tried changing 'mingw32-make' to just 'make' and still get the same
> error. Running it with 'clean' instead of all the other parameters works as
> expected.
>
> I would appreciate any help here, please.
>
> Thank you and best regards,
>



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

Saturday, June 1, 2024

Re: unexpected value from mode(1) command

On 05/26/2024 10:42 PM, M wrote:
> вс, 26 мая 2024 г., 19:25 Mike <mssr953@gmail.com>:
>
>> Hello.
>>
>> If, in normal mode, I type a colon followed by the command "echo
>> mode(1)", the value "n" is displayed in the command-line area indicating
>> normal mode. I would have expected something beginning with "c" which
>> would be consistent with what ":help cmdline-mode" states.
>>
>> Could someone explain why the observed behavior should have been expected?
>>
>> Thanks in advance for the education!
>>
>> --
>> --
>> 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/v2vnpp%24i0q%241%40ciao.gmane.io
>> .
>>
>
> Vim stays in Command-line mode as long as user _is editing_ the command
> line. After enter key has been pressed Vim gets back into the Normal mode,
> as explained at `:help mode-switching` topic.
>
> Kind regards,
>
>>
>
Thanks for the explanation and link, it certainly explains what I'm
seeing. It just seemed odd that an ex-command is being executed in
"normal" mode. But, now that I think about it, autocommands do invoke
ex-commands and we do expect them to be aware of the current buffer's
mode setting.

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

Re: Vim in Windows Command Prompt only has 16 colors to work with

I had for a long time

if has("win32") && !has("gui_running")
    set t_Co=256
endif

in my configuration to make it 256 colors aware.
On Saturday, May 25, 2024 at 6:19:05 AM UTC+10 DwigtArmyOfChampions wrote:
If I launch vim from the Windows 10 cmd line and then run the command "echo &t_Co" it only returns 16. Is there any way to get at least 256 colors to display in a regular cmd window, if not full color?

--
--
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/24050da4-4487-49f3-86dd-fa7370a23d83n%40googlegroups.com.

Monday, May 27, 2024

man.vim plugin : « troff: [...]cannot select font 'CW' »

hi,

this is the warning I get when I use Man command, to call wget's man page for example.
one appears for each line where CW is used (I guess).

I get the same warnings from command line : man wget | vim -

--
$vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 26 2024 00:11:37)
Included patches: 1-445
Compiled by Arch Linux
Huge version without GUI.[...]

--
--
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/96574e80-0607-4058-8dad-bc81e67546d9n%40googlegroups.com.

Error building Vim

Hello,

I'm trying to set up a new Windows 11 laptop and have followed the steps in INSTALLpc.txt after getting the latest Vim repository from git. When I try to compile with Python support, I get the following error and compilation stops. I'm hoping someone can tell me what to do about this.

if_python.c:66:10: fatal error: Python.h: No such file or directory
   66 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.

My command-line (executed from inside vim/src):

mingw32-make -f Make_ming.mak -j$NUMBER_OF_PROCESSORS GUI=yes FEATURES=HUGE PYTHON3=c:/Python312 PYTHON3_VER=312 PYTHON=c:/Python27 PYTHON_VER=27 DYNAMIC_PYTHON=yes STATIC_STDCPLUS=yes DIRECTX=yes

I've tried changing 'mingw32-make' to just 'make' and still get the same error. Running it with 'clean' instead of all the other parameters works as expected.

I would appreciate any help here, please.

Thank you and best regards,

--
 
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/CANuxnEdHmE60wbQa95f8puM%2BmmZrFWvDdOmuV-i_u8bssNjQ0A%40mail.gmail.com.

Re: Adapting swich-case indentation

Hi radl...,

On Monday, 2024-05-27 15:06:51 -0700, radl...@gmail.com wrote:

> Is there a way to bend Vim to my will in indenting C switch-case statements
> with local scopes delimited by braces. Here's what I mean: (Vim 9.1 on
> MacOS (M2 chip and Intel x86-64)
> int main() {
> int n = 42;
> switch (n) {
> case 42: {
> int twice = 2*n;
> }
> }
> }

Play with the cinoptions values, see :h 'cinoptions-values'

Adding l1 should suit your case. So
:set cinoptions=l1
if you don't have other values already.

Eike

--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A
Use LibreOffice! https://www.libreoffice.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/ZlUa6oIb4TJNoKQZ%40kulungile.erack.de.

Adapting swich-case indentation

Is there a way to bend Vim to my will in indenting C switch-case statements with local scopes delimited by braces.  Here's what I mean: (Vim 9.1 on MacOS (M2 chip and Intel x86-64) 
int main() {
    int n = 42;
    switch (n) {
        case 42: {
            int twice = 2*n;
        }        
    }
}

The above example illustrates what I want:.  But when I visual-select those lines and press =. I get this:
int main() {
    int n = 42;
    switch (n) {
        case 42: {
                     int twice = 2*n;
                 }
    }

The compiler insists on the braces because of that local int twice variable;   putting the opening brace of the case: on its own line helps, but then I have a deviation from my preferred style. 

Please note that this example is contrived to illustrate the problem, not an excerpt from  an actual program..

Am I just finally asking too much of Vim?

--
--
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/e1c52cd7-710b-4d27-a4cb-c601b3f3fa80n%40googlegroups.com.

Sunday, May 26, 2024

Re: unexpected value from mode(1) command



вс, 26 мая 2024 г., 19:25 Mike <mssr953@gmail.com>:
Hello.

If, in normal mode, I type a colon followed by the command "echo
mode(1)", the value "n" is displayed in the command-line area indicating
normal mode.  I would have expected something beginning with "c" which
would be consistent with what ":help cmdline-mode" states.

Could someone explain why the observed behavior should have been expected?

Thanks in advance for the education!

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

Vim stays in Command-line mode as long as user _is editing_ the command line. After enter key has been pressed Vim gets back into the Normal mode, as explained at `:help mode-switching` topic.

Kind regards,

--
--
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/CAFsTB%2BLM4b8pGtSsNu292J-o-zZCD4%2BKCzN5_CN%2B%2BYncPqXKUA%40mail.gmail.com.

Re: problem to create a shortcut

For the record, the following worked for me:

```
function GotoMark(str) abort
  execute printf('/MARK_%s', a:str)
endfunction

command -nargs=* Gm call GotoMark(<f-args>)

" test
new | put =['abc', 'MARK_X', 'def']
Gm X
```

Note that `:/{pattern}` is a shorter way of saying `:global/{pattern}/` if all you care about is the side-effect of moving the cursor; technically, the latter moves to the last occurrence of the pattern while `:/` moves to the next occurrence (with wrap-around controlled by the 'wrapscan' option).

--
--
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/2025f52d-65f1-40f6-8a1e-c5d01be15c63n%40googlegroups.com.

unexpected value from mode(1) command

Hello.

If, in normal mode, I type a colon followed by the command "echo
mode(1)", the value "n" is displayed in the command-line area indicating
normal mode. I would have expected something beginning with "c" which
would be consistent with what ":help cmdline-mode" states.

Could someone explain why the observed behavior should have been expected?

Thanks in advance for the education!

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

Saturday, May 25, 2024

Re: problem to create a shortcut

Note: The very first message to this list is always moderated, so
sometimes it takes a bit of time until a moderator notices a new message
in the queue waiting for approval.

On Sa, 25 Mai 2024, Andreas Otto wrote:

> the following  code does NOT work.
> The goal is to use a shortcut like "Gmx" to jump to a mark "MARK_X" in the test.
> to make it more useable U want to create a function with the last string (in the case above "X" as argument.
>
> question: HOW I write a "goto-mark" function in vim?

In its simplest form the following should work:

function GotoMark(str)
exe 'g/MARK_' .. a:str
endfunction


Thanks,
Christian
--
Line Printer paper is strongest at the perforations.

--
--
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/ZlGiAQGXJ6%2B98wsy%40256bit.org.

problem to create a shortcut

the following  code does NOT work.
The goal is to use a shortcut like "Gmx" to jump to a mark "MARK_X" in the test.
to make it more useable U want to create a function with the last string (in the case above "X" as argument.

question: HOW I write a "goto-mark" function in vim?

" old → works
command! -nargs=0 Gmu    silent g/MARK_U\>/
command! -nargs=0 Gmv    silent g/MARK_V\>/
command! -nargs=0 Gmw    silent g/MARK_W\>/
command! -nargs=0 Gmx    silent g/MARK_X\>/
command! -nargs=0 Gmy    silent g/MARK_Y\>/
command! -nargs=0 Gmz    silent g/MARK_Z\>/

" new → doesn't work
function GotoMark(str)
  "execute("g/MARK_" . a:str . "/")
  "execute("g/MARK_" . "PN" . "/")
  g/MARK_PN/
endfunction

command! -nargs=1 Gm     silent call GotoMark(<f-args>)
"command! -nargs=1 GM     silent execute("g/MARK_" . string(<f-args>) . "/")
"command! -nargs=1 GM     silent g/MARK_PN/

--
--
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/a9f7041d-2265-42c5-9802-3b5463237381n%40googlegroups.com.

Friday, May 24, 2024

Vim in Windows Command Prompt only has 16 colors to work with

If I launch vim from the Windows 10 cmd line and then run the command "echo &t_Co" it only returns 16. Is there any way to get at least 256 colors to display in a regular cmd window, if not full color?

--
--
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/b9bdca24-389c-457d-995f-a06ec6fa5859n%40googlegroups.com.

Wednesday, May 22, 2024

Can netrw be used to connect to ifs on an AS400?

Would it allow member editing as well?

--
--
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/96bea487-df3d-4cc1-b9de-1ccde1063cd3n%40googlegroups.com.

Re: Mark special characters

* Christian Brabandt <cblists@256bit.org> [240522 09:01]:
> On Mi, 22 Mai 2024, Igor wrote:
> > I would like to distinguish normal spaces with characters that are in
> > vim displayed as spaces, but are some non-space characters. Is there a
> > way to display those characters so that I will spot them as special
> > characters?
>
> Someone shared the following on the list a few years ago
> https://groups.google.com/g/vim_use/c/FuEGojGwKCM/m/V1K8VAWWKrEJ
>
> and since then I have it in my .vimrc even so I should probably change
> it to a WinEnter autocommand.

Why WinEnter? Won't that set this much more often than necessary?

> " Highlight special white space
> hi def link WhiteSpaceError Error
> match WhiteSpaceError /[\x0b\x0c\u00a0\u1680\u180e\u2000-\u200a\u2028\u202f\u205f\u3000]/
>
> Thanks,
> Christian
> --
> Almost anything derogatory you could say about today's software design
> would be accurate.
> -- K. E. Iverson
^^^^^^^^^^^^^
Are you an APL fan?

...Marvin

--
--
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/Zk4L5ZS7Sc4r51Jt%40basil.wdw.

Re: Mark special characters

On Mi, 22 Mai 2024, Igor wrote:

> Hi, I use latest vim v9.1.0429 on Windows 11.
>
> In the file I have received I was convinced there are spaces between
> words, but there were some special characters and so when I tried to
> execute the commands in my cmd I have got very strange syntax errors.
> Probably some special character has been copied from Microsoft Word.
>
> I would like to distinguish normal spaces with characters that are in
> vim displayed as spaces, but are some non-space characters. Is there a
> way to display those characters so that I will spot them as special
> characters?

Someone shared the following on the list a few years ago
https://groups.google.com/g/vim_use/c/FuEGojGwKCM/m/V1K8VAWWKrEJ

and since then I have it in my .vimrc even so I should probably change
it to a WinEnter autocommand.

" Highlight special white space
hi def link WhiteSpaceError Error
match WhiteSpaceError /[\x0b\x0c\u00a0\u1680\u180e\u2000-\u200a\u2028\u202f\u205f\u3000]/

Thanks,
Christian
--
Almost anything derogatory you could say about today's software design
would be accurate.
-- K. E. Iverson

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

Mark special characters

Hi,
I use latest vim v9.1.0429 on Windows 11.

In the file I have received I was convinced there are spaces between words, but there were some special characters and so when I tried to execute the commands in my cmd I have got very strange syntax errors. Probably some special character has been copied from Microsoft Word.

I would like to distinguish normal spaces with characters that are in vim displayed as spaces, but are some non-space characters. Is there a way to display those characters so that I will spot them as special characters?

Regards

--
--
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/dedaf00b-8d58-46d9-ad4c-175e102dea65n%40googlegroups.com.

Saturday, May 18, 2024

Termdebug in docker?

Hi all,

is there anyone who tried to use/is using Termdebug to debug in docker?
If so, how did you setup the whole machinery?

Thanks,
/Ubaldo


--
--
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%2BnhgoO9-VLEgU0DL4dZNDN0%2B_YR%2BUZvsG3DzcqTbXMa9%3DHqxw%40mail.gmail.com.

Friday, May 17, 2024

Re: Using vim9 script in cmd-line without vim9cmd

As also wrote on github, I second this. However:

1. vim9 variables are script-scoped. If you declare from the command line, e.g. `:var a = 0` what shall be the scope of `a`?
2. Having an option set vim9cmdline (false as default) to switch the command line interpreter between legacy and vim9 script looks a viable idea to me

My 2 cents,
/Ubaldo
 

On Wednesday 15 May 2024 at 10:57:01 UTC+2 Girish wrote:
Can this feature be added without major upheaval? Basically, I want to execute vim9 script without typing 'vim9cmd' in command line. Turn off legacy script in command line, and only use vim9 script. Today, we cannot even declare a vim9 variable in command 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 on the web visit https://groups.google.com/d/msgid/vim_use/fd62e037-5dd9-4cb4-a074-21dc05b048afn%40googlegroups.com.

Thursday, May 16, 2024

Python or Powershell library for Vim-Server functionality?

All,

Are there any libs for Python3 or Powershell to utilize the vim-server functionality in Windows?

I'm asking because I'm trying to find one that's safe to install.

Thank you,
  helpdeskaleer

--
--
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/CAEJF0%2B3Yn94GLSq4fUS7fiKV--sh5XS8rQwhhg4s_-DXNMtVkA%40mail.gmail.com.

Wednesday, May 15, 2024

Using vim9 script in cmd-line without vim9cmd

Can this feature be added without major upheaval? Basically, I want to execute vim9 script without typing 'vim9cmd' in command line. Turn off legacy script in command line, and only use vim9 script. Today, we cannot even declare a vim9 variable in command 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 on the web visit https://groups.google.com/d/msgid/vim_use/ab9b59bb-aff5-4912-b44f-fba5f492bd76n%40googlegroups.com.

Tuesday, May 14, 2024

Termdebug in vim9?

Hi all,

I was in need of a debugger for embedded systems and I built all a machinery around Termdebug. I eventually made it work in satisfactory manner, or., let's say, it met my needs. However, I wanted to make some other changes and I figured that I had to change the Termdebug source code. However, given that I cannot script with the legacy language, and given that I had a surgery ten days ago that keep me locked at home (all good and all fine if you were asking) I took the freedom of converting Termdebug in Vim9 language. I tested it a bit and it seems to work fine.

If you want to give it a shot and give some feedback, here is where it is stored:


There is also the original plugin in legacy scripting language. If you open both the versions in a vertical split, then you can compare them back-to-back fairly easily. There is also a changes.txt so you can see my intentions on what I wish to do with it. :) 

If you believe that the work is well-done I can issue a PR towards Vim repo. Or I can make some changes reported in changes.txt file and make a PR. You let me know :)   
Otherwise if you think it's a bad porting (and I would be perfectly fine with that given that I am an applied mathematician, not a programmer :D) I will hack the current version by throwing away all the things that I don't need and use the "leftovers" it as basis for a plugin that I actually kinda need. :) 

Cheers,
/Ubaldo 

--
--
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%2BnhgoNCY668Q%2BGfrGFwjF7_0XFyF3visnGgtkzOaCmRu3eEew%40mail.gmail.com.

Monday, May 13, 2024

Re: vim cannot write a file being saved by OneDrive but Notepad++ can

I found a reference to whitelisting a program with Windows, here:

https://answers.microsoft.com/en-us/windows/forum/all/ransomeware-protection-adding-applications-to-the/842850e6-4312-49b6-9c10-09bf3ba1804a

Sadly I followed the instructions and it didn't fix the problem.

My IT guy came by and suggested I go to "Windows Security > Virus & threat protection > Protection history", and click on a recent item.

Sure enough, it showed

App or process blocked: gvim.exe
...
Blocked by: Controlled folder access

There was a link, "Controlled folder access settings" > "Allow an app through Controlled folder access" which shows "Allow an app through Controlled folder access".

There's a list there of allowed apps, and a button, "+ Add an allowed app".  I used that to allow gvim and away I went. No more problems.


On Monday, May 13, 2024 at 4:07:46 PM UTC-4 Richard Pennenga wrote:
Has anyone else seen this?

I have an existing text file (foo.py) in a folder backed up by OneDrive.  I created the file using Notepad++.  I opened the file using vim, modified the text and tried to write it (":w<cr>").  I get the following:

"foo.py" E514: Write error (file system full?)
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!

Notepad++ can read and write the file just fine.

Any ideas?

--
--
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/b2b5431c-6d7d-4a3f-96ab-8284bfa86042n%40googlegroups.com.

vim cannot write a file being saved by OneDrive but Notepad++ can

Has anyone else seen this?

I have an existing text file (foo.py) in a folder backed up by OneDrive.  I created the file using Notepad++.  I opened the file using vim, modified the text and tried to write it (":w<cr>").  I get the following:

"foo.py" E514: Write error (file system full?)
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!

Notepad++ can read and write the file just fine.

Any ideas?

--
--
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/721af91f-cb89-4085-af35-0dc4802e8671n%40googlegroups.com.

Friday, May 10, 2024

Re: Access class member from command line

On 2024-05-10, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
>> Right now, the only issue I have is with autoload scripts in my vimrc,
>> but I see that it's being tracked as #13313 in GitHub. Other than that,
>> I must say that Vim 9 script has been rock solid for me (no more
>> crashes), and very pleasant to use!
>>
>
> I have opened the PR https://github.com/vim/vim/pull/14740 to address
> this issue.

I've just tried that, and it works like a charm! For older versions of
Vim, I've found that I can create a symlink in ~/.vim/autoload, e.g.:

cd ~/.vim/autoload
ln -s ../pack/plugins/foo/autoload/foo.vim

Then foo.vim is found by `import autoload` in my vimrc.

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/v1lu3p%24ead%243%40ciao.gmane.io.

Thursday, May 9, 2024

Re: Access class member from command line

Hi,

On Thu, May 9, 2024 at 1:16 AM Lifepillar <lifepillar@lifepillar.me> wrote:
>
> On 2024-05-09, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
> > Hi,
> >
> > On Wed, May 8, 2024 at 2:11 PM Lifepillar <lifepillar@lifepillar.me> wrote:
> >> > Looks like a bug. Should be able to do `foo.Config.option = true`
> >>
> >> Indeed. And fixed. That works with the latest Vim (9.1.399).
> >>
> >
> > Yes. This should be addressed by patch 9.1.0398. If you see any
> > additional problems
> > in using different types of imported variables in a Vim9 script (after
> > this patch), please
> > open an issue. In particular, look for any issues in using nested types.
>
> Right now, the only issue I have is with autoload scripts in my vimrc,
> but I see that it's being tracked as #13313 in GitHub. Other than that,
> I must say that Vim 9 script has been rock solid for me (no more
> crashes), and very pleasant to use!
>

I have opened the PR https://github.com/vim/vim/pull/14740 to address
this issue.

Regards,
Yegappan

>
> >> >> But how do I access the class member from the command line? Is that even
> >> >> possible?
> >>
> >> I still haven't found a way to do that, and I'm starting to think that
> >> it is not currently possible. If I put this in ~/.vim/autoload/foo.vim:
> >>
> >

--
--
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/CAAW7x7nJHG36B%3Dspo2Xr0Y27FB7wDETn%2BV0p_PancBwtQN0Fmg%40mail.gmail.com.

Re: Access class member from command line

On 2024-05-09, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
> Hi,
>
> On Wed, May 8, 2024 at 2:11 PM Lifepillar <lifepillar@lifepillar.me> wrote:
>> > Looks like a bug. Should be able to do `foo.Config.option = true`
>>
>> Indeed. And fixed. That works with the latest Vim (9.1.399).
>>
>
> Yes. This should be addressed by patch 9.1.0398. If you see any
> additional problems
> in using different types of imported variables in a Vim9 script (after
> this patch), please
> open an issue. In particular, look for any issues in using nested types.

Right now, the only issue I have is with autoload scripts in my vimrc,
but I see that it's being tracked as #13313 in GitHub. Other than that,
I must say that Vim 9 script has been rock solid for me (no more
crashes), and very pleasant to use!

>> >> But how do I access the class member from the command line? Is that even
>> >> possible?
>>
>> I still haven't found a way to do that, and I'm starting to think that
>> it is not currently possible. If I put this in ~/.vim/autoload/foo.vim:
>>
>
> A class in a Vim9 script is a script-local variable. So it cannot be
> directly accessed
> from outside the script (without using the script name).

I'm not sure I understand. Classes can be exported, and I'm prepending
the script name, so why doesn't this work in the command line?

:echo foo#C.member

where the script is ~/.vim/autoload/foo.vim, `C` is an exported class
defined in foo.vim, and `member` is a static variable of C. Maybe
because `C` is a type? For comparison, this works in a script:

import autoload 'foo.vim'
echo foo.C.member

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

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Yeah. In-fact there are apparently no reasons to use term_sendkeys…

Best,
/Ubaldo

> Il giorno 9 mag 2024, alle ore 09:27, Christian Brabandt <cblists@256bit.org> ha scritto:
>
> 
>> On Do, 09 Mai 2024, Ubaldo Tiberi wrote:
>>
>> Ok! Makes sense! Thanks!
>>
>> But that lead me to the following question: why use gdb mi instead of
>> term_sendkeys, jobs and channel?
>
> jobs and channels will always be used. Using term_sendkeys sounds
> brittle however.
>
>
> Thanks,
> Chris
> --
> Moon, n.:
> 1. A celestial object whose phase is very important to hackers. See
> PHASE OF THE MOON. 2. Dave Moon (MOON@MC).
>
> --
> --
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/5EK-lEmgPto/unsubscribe.
> To unsubscribe from this group and all its topics, 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/Zjx648DK4ZLE4nch%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/EA456E57-5BB0-4017-970C-D4B73A752E17%40gmail.com.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

On Do, 09 Mai 2024, Ubaldo Tiberi wrote:

> Ok! Makes sense! Thanks!
>
> But that lead me to the following question: why use gdb mi instead of
> term_sendkeys, jobs and channel?

jobs and channels will always be used. Using term_sendkeys sounds
brittle however.


Thanks,
Chris
--
Moon, n.:
1. A celestial object whose phase is very important to hackers. See
PHASE OF THE MOON. 2. Dave Moon (MOON@MC).

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

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Ok! Makes sense! Thanks!

But that lead me to the following question: why use gdb mi instead of term_sendkeys, jobs and channel?

That way we would be OS independent and we would also not depend on external tools features (in this case gdb mi) for which we have zero control.

… genuinely asking. :-)

Best,
/Ubaldo

> Il giorno 9 mag 2024, alle ore 09:08, Christian Brabandt <cblists@256bit.org> ha scritto:
>
> 
>> On Mi, 08 Mai 2024, Ubaldo Tiberi wrote:
>>
>> Hi!
>>
>> I thanks for your reply.
>> have already read it but It didn't answer any of my questions.
>
> I think the reason is, that on Windows using a pty may not always work.
> This is briefly mentioned at :h 'termwintype'. If you sure it works for
> you (because your Windows is new enough or you have winpty), you could
> give it a shot in termdebug with the following patch applied and then
> setting the termwintype option:
>
> ```patch
> diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
> index 50833f0df..8236fc2b0 100644
> --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
> +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
> @@ -196,7 +196,7 @@ func s:StartDebug_internal(dict)
> elseif exists('g:termdebug_use_prompt')
> let use_prompt = g:termdebug_use_prompt
> endif
> - if has('terminal') && !has('win32') && !use_prompt
> + if has('terminal') && (!has('win32') || !empty(&termwintype)) && !use_prompt
> let s:way = 'terminal'
> else
> let s:way = 'prompt'
> ```
>
> Thanks,
> Chris
> --
> Confess your sins to the Lord and you will be forgiven;
> confess them to man and you will be laughed at.
> -- Josh Billings
>
> --
> --
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/5EK-lEmgPto/unsubscribe.
> To unsubscribe from this group and all its topics, 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/Zjx2WJlua8j1jQAa%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/FD4DA0C5-20C6-4A44-8646-FDEE38F8A13A%40gmail.com.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

I meant, I read 'termdebug-prompt' :-) 

Best,
/Ubaldo

Il giorno 9 mag 2024, alle ore 08:18, Ubaldo Tiberi <ubaldo.tiberi@gmail.com> ha scritto:

termdebug-prompt'

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

On Mi, 08 Mai 2024, Ubaldo Tiberi wrote:

> Hi! 
>
> I thanks  for your reply.
> have already read it but It didn't answer any of my questions. 

I think the reason is, that on Windows using a pty may not always work.
This is briefly mentioned at :h 'termwintype'. If you sure it works for
you (because your Windows is new enough or you have winpty), you could
give it a shot in termdebug with the following patch applied and then
setting the termwintype option:

```patch
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 50833f0df..8236fc2b0 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -196,7 +196,7 @@ func s:StartDebug_internal(dict)
elseif exists('g:termdebug_use_prompt')
let use_prompt = g:termdebug_use_prompt
endif
- if has('terminal') && !has('win32') && !use_prompt
+ if has('terminal') && (!has('win32') || !empty(&termwintype)) && !use_prompt
let s:way = 'terminal'
else
let s:way = 'prompt'
```

Thanks,
Chris
--
Confess your sins to the Lord and you will be forgiven;
confess them to man and you will be laughed at.
-- Josh Billings

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

Wednesday, May 8, 2024

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Hi! 

I thanks  for your reply.
have already read it but It didn't answer any of my questions. 

Best,
/Ubaldo
On Thursday 9 May 2024 at 01:48:06 UTC+2 Alessandro Antonello wrote:
Hi, Tiberi.

You should take a look in the help of 'termdebug-prompt'. There you can find why your Vim version is using prompt instead of terminal.
I hope this message reaches you.

Regards,

Em ter., 7 de mai. de 2024 às 10:34, Ubaldo Tiberi <ubaldo...@gmail.com> escreveu:
Hi all,

I have noticed that Termdebug for Windows uses a "prompt" buffer instead of a terminal for the gdb interpreter. 

  - Is there any reason why is that? 
  - Is there any plan to "upgrade" the Termdebug Windows version to use a terminal buffer instead?  

Thanks!

/Ubaldo

--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CA%2BnhgoMvaBm_EMyQut%3DGtC_ax0LowK4dv_xWMmQR3%2BbYcMniHw%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/b50a0d86-b5b6-4db3-8c86-9086a3eb4cecn%40googlegroups.com.