Skip to main content

Questions tagged [vim9]

To flag questions about features introduced with vim9 that are not vim9script questions

Filter by
Sorted by
Tagged with
-1 votes
2 answers
36 views

What options shall be set for loading ftplugins? [duplicate]

Consider the following script: vim9script filetype plugin indent on import "./plugin/myplugin.vim" exe $"edit testfile.py" MyCommand In the specific case, ...
Barzi2001's user avatar
  • 630
1 vote
1 answer
84 views

Recommended way of scripting: Ex commands or vimscript functions?

While scripting I could achieve the same result both through Ex commands and vimscript functions, for example: var filename = "foo.txt" exe "new" filename # Ex ...
Barzi2001's user avatar
  • 630
0 votes
2 answers
32 views

How to convert octal in ascii characters by using substitute() in Vim9?

My attempt: vim9script var text = 'Hello \\123world\\045!' echom text->substitute('\\\o\o\o', => printf("%c", str2nr(submatch(0), 8)), 'g') result in E15 and E116.
Barzi2001's user avatar
  • 630
1 vote
1 answer
46 views

csv column colors in Vim 9

I just upgraded Vim to version 9.1 (under Windows). Seems now it improved the display of csv files, commas are shown as vertical lines (|), and the columns are displayed alternatively as yellow and ...
athos's user avatar
  • 207
0 votes
1 answer
28 views

Using the return of a user defined function in an :execute statement

I am trying to get the output of the following function to an :execute statement such as I have this in my .vimrc def GetBufAbsPath(): string return substitute(expand("%:p"), '[^\/]\+$', ...
freddie_ventura's user avatar
1 vote
1 answer
76 views

Start Vim window at a certain size?

Is there anything I can put in my _vimrc for gVim to make the window open a certain width/height?
leeand00's user avatar
  • 3,601
1 vote
2 answers
97 views

How to noremap plugin functions that take arguments?

I am aware that it is good practice to map some plugin function, like for example the piece of code that follows (Vim9): import autoload "../lib/my_script.vim" noremap <unique> <...
Barzi2001's user avatar
  • 630
4 votes
1 answer
115 views

Why doesn't Vim recognize a pair of <\> as a single unit?

I'm kind of confused about why doesn't Vim accept di> operation on this piece of text: <This is a random text but has a backslash at the end\> but rather does on this: <This is a text with ...
nekomekoraiyuu's user avatar
2 votes
3 answers
511 views

How can I avoid built-in filetype detection?

I have a plugin for detecting and syntax highlighting *.k - source files in a given programming language. My ~/.vimrc contains only: se nocp rtp+=~/k/vim-k " the language plugin sy on And ...
ngn's user avatar
  • 163
-1 votes
2 answers
85 views

Prevent <c-w>q to quit Vim when there is only one window left

I wish to close windows and wipe out the associated buffers with <c-w>q but at the same time I want to prevent to quit Vim when there is only one window left. My attempt is as follows: ...
Barzi2001's user avatar
  • 630
1 vote
1 answer
49 views

Is there any way to automatically adjust OS specific environment variables, path, etc. format?

Often in my scripts I have some ugly snippets like the following: vim9script var bin = "" if has("win32") bin = "\\bin" else bin = "/bin" endif g:...
Barzi2001's user avatar
  • 630
2 votes
1 answer
44 views

How to change the internal vim python sys.path?

I have learned that py3eval('print(sys.path)') return the sys.path used internally by Vim. Say that i want add a new_path to the current sys.path. How shall I do? I would appreciate solutions that ...
Barzi2001's user avatar
  • 630
0 votes
1 answer
63 views

Block comment syntax colouring being lost while moving, but redraw will fix

I frequently use block comments to disable sections of terraform code using /* to start disabling and */ to complete. As expected, the code will turn "grey" and lose syntax highlights. ...
Peter McEvoy's user avatar
0 votes
3 answers
377 views

Switch focus to :terminal buffer

I am trying to recreate the functionality of the very old conque plugin via terminal in modern vim. So far I have found a few plugins that send code to a terminal buffer. However, these do not update ...
shabbychef's user avatar
0 votes
0 answers
62 views

Vim 9.0.1420 update: opening the same file twice without warning message is unfortunately now possible?

I observed that in the recent update for Vim, specifically vim 9.0.1420, it is now possible to create a text file, open it, and then open the same file through another terminal window without ...
DavidC.'s user avatar
  • 101
0 votes
1 answer
45 views

Vim doesn't display my echo if it's 2 characters

On Vim 9 linux running this code: inoremap <C-n> <C-o>:echo "aa"<CR> doesn't display anything whereas: inoremap <C-n> <C-o>:echo "aaaa"<CR> ...
Hamster's user avatar
0 votes
0 answers
49 views

How to highlight all the columns of a window?

Consider the following snippet: vim9script var winid = win_getid() var winwidth = winwidth(winid) var range = [] for lnum in range(10, 20) add(range, [lnum, 0, winwidth(winid)]) endfor var m = ...
Barzi2001's user avatar
  • 630
0 votes
2 answers
104 views

Vim9script commands from command line result in E1124. Is it normal?

If I run e.g. :var a = 1 from the command line I end up in E1124: "var" cannot be used in legacy vimscript. Running on MacVim 9.0.1276. Is it normal behavior?
Barzi2001's user avatar
  • 630
10 votes
3 answers
1k views

Syntax highlighting for shell scripts broken

Since recently my syntax highlighting for ft=sh (also syn=sh is set) is broken: Why is that? How can I fix it? Edit: I'm using Vim 9.0 with patches 1-1302. I add here the code from the screenshot. ...
pfnuesel's user avatar
  • 744
0 votes
0 answers
91 views

Different behaviour after upgrade Vim from v7.4.326 to 9.0.813

I have 2 Linux servers (SLES 12.5): On the first server I have vim version 7.4.326, On the other vim version 9.0.813. If I open the same file on both servers, Vim behaves differently. On server with ...
lazydba's user avatar
1 vote
1 answer
110 views

How can I control the color of my Vim terminal?

I'm using the nord theme on gVim 9.0. My Vim terminal appear with Black color: Here in console mode: Here in normal mode: How could I control it? Remark: I had a different behavior using Vim 8.2
Vivian De Smedt's user avatar
0 votes
1 answer
56 views

Some Normal mode mappings not working in vim9 anymore

I have the following in my configuration: nnoremap µ iii nnoremap ° ioo I'm using gvim, on Windows 10, using an azerty keyboard (so µ is <S-*> and ° is <S-)). The mappings work in vim8, but ...
Minh-Tâm TRAN's user avatar
0 votes
1 answer
105 views

How can I make 'quickfixtextfunc' work with cfilter using a vim9's "def" function?

On Windows 10, using gvim, when editing a file like the following example: foo foobar baz As long as I use a function and not a def, I can do the following and Cfilter will work as expected: :...
Minh-Tâm TRAN's user avatar
2 votes
1 answer
554 views

Vim appimage can't run on Ubuntu 22.04

Vim has a official AppImage (cool). But I can't run it on Ubuntu 22.04. I suppose that some dependencies are lost. My problem is that I can't identify what exactly are. I see the terminal output when ...
Moqtite's user avatar
  • 33
1 vote
2 answers
156 views

Gvim Python loading issue (despite being correctly installed)

I found a lot of questions about it, some problem was about 32 or 64 bit, other was about python support compiled in vim, etc. None was my case. Preamble: Software installed I installed Python on ...
Antonio's user avatar
  • 287
2 votes
1 answer
2k views

Using Github Copilot with Regular Vim [closed]

I'm not finding much out there in terms of docs about using copilot with regular vim (everything I've come across is about using it with nvim / neovim) The copilot.vim docs mention it should support ...
kjones's user avatar
  • 153
5 votes
1 answer
435 views

How can I convert vim8 function mapping to vim9?

I have a function in vim8 as: function! BSkipQuickFix(command) let start_buffer = bufnr('%') execute a:command while &buftype ==# 'quickfix' && bufnr('%') != start_buffer execute ...
BaRud's user avatar
  • 491
2 votes
1 answer
725 views

How do I :let a global variable in my vimrc in vim9script?

I am trying to change my vimrc to vim9script. For inbuilt fortran help, (:h fortran) we have: :let fortran_free_source=1 This is giving an error: E1126: Cannot use :let in Vim9 script If I remove ...
BaRud's user avatar
  • 491
1 vote
1 answer
561 views

How to unlet a variable in Vim 9 script?

In Vim9 script :let cannot be used. An existing variable is assigned to without any command. The same for global, window, tab, buffer and Vim variables, because they are not really declared. Those ...
user90726's user avatar
  • 123
1 vote
1 answer
634 views

'Undefined variable' error: why?

vim9script set laststatus=2 set statusline= var separator = ' ' set statusline+=%{expand('%:p')} set statusline+=%{separator} set statusline+=%l:%v Error: Undefined variable: separator Why is ...
john c. j.'s user avatar
2 votes
1 answer
523 views

How can I enable .xml syntax highlighting for .xaml files?

I am trying to enable .xml syntax highlighting in Vim for .xaml files since .xaml files don't have syntax highlighting of its own. I came across a post on Stack Overflow which recommended to use au ...
Jose Membreno's user avatar
5 votes
1 answer
538 views

Vim9: How will '#' characters be handled in colors/* files now?

Vim9 now interprets '#' as the start of comment, but I use this character in color setting files. For instance: hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red ctermbg=darkblue
al-'s user avatar
  • 53
2 votes
2 answers
2k views

How to get vertical wild menu using wildoptions=pum on Vim 9?

I would like to test the new vertical wildmenu of Vim 9. I read that set wildoptions=pum should provide it. But I'm not successful. Is there another setting to set to get it?
Vivian De Smedt's user avatar