Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [vim9]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
95 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?
0 votes
1 answer
62 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. ...
1 vote
1 answer
44 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 ...
2 votes
1 answer
527 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 ...
0 votes
1 answer
27 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"), '[^\/]\+$', ...
1 vote
1 answer
74 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?
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. ...
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> <...
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 ...
2 votes
3 answers
503 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 ...
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?
1 vote
2 answers
147 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 ...
-1 votes
2 answers
76 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: ...
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:...
2 votes
1 answer
41 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 ...
0 votes
3 answers
372 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 ...
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 ...
0 votes
1 answer
44 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> ...
0 votes
0 answers
48 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 = ...
0 votes
0 answers
89 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 ...
1 vote
1 answer
97 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
0 votes
1 answer
52 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 ...
0 votes
1 answer
103 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: :...
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 ...
5 votes
1 answer
428 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 ...
2 votes
1 answer
699 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 ...
1 vote
1 answer
534 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 ...
1 vote
1 answer
612 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 ...
2 votes
1 answer
509 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 ...
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