Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Vim 9.0 colorscheme support - no syntax highlighting #245

Closed
richeney opened this issue Sep 7, 2022 · 5 comments · May be fixed by #384
Closed

[BUG] Vim 9.0 colorscheme support - no syntax highlighting #245

richeney opened this issue Sep 7, 2022 · 5 comments · May be fixed by #384
Assignees
Labels
Area-image Changes to the base/tools image bug Something isn't working Iteration-Backlog Cloud Shell team will address this in the future Status-Committed Committed item by the Cloud Shell team

Comments

@richeney
Copy link

richeney commented Sep 7, 2022

Vim has recently been updated to v9.0 in the image. The coloured syntax highlighting is not working for me and vim is monochrome.

Vim is recognising the filetypes correctly (:set filetype?). Looking at the colorscheme support (:colorscheme , CTRL+D), there is only desert in there.

I installed vim 9.0 into Ubuntu on WSL2 and colorscheme support was fine there.

Is there something that needs to be done to add the colorscheme support back in for the container?

@richeney richeney added bug Something isn't working Triage-needed Triage needed by Cloud Shell team labels Sep 7, 2022
@maertendMSFT maertendMSFT added Area-image Changes to the base/tools image Status-In_review Item under consideration by the Cloud Shell team Iteration-Backlog Cloud Shell team will address this in the future and removed Triage-needed Triage needed by Cloud Shell team labels Sep 8, 2022
@acederberg
Copy link

@richeney I was looking for a solution for exactly this! I would prefer to edit with syntax highlighting. Same symptoms - I have a colorscheme (gruvbox) and a filetype (ps1) yet no color.

@maertendMSFT maertendMSFT added Status-Committed Committed item by the Cloud Shell team and removed Status-In_review Item under consideration by the Cloud Shell team labels Jan 5, 2023
@hima-gadupudi
Copy link
Contributor

Currently CloudShell support supports default vim color scheme. If you want more colors in your shell, please follow the instructions below and install the color schemes you like.

Step-1: Create "colors" dir in your homedir. Change cwd to colos dir.

  • cd .vim
  • mkdir colors
  • cd colors

Step-2: Perform wget on the color scheme that you are interested in. Showing an example for lunaperche colors cheme to install.

Start using installed color schemes in your vim.

@richeney
Copy link
Author

I should have mentioned that I am comfortably using .vim file. (I created my own cloudshell colorscheme to match the standard colours, which I install using an Ansible role.)

The issue with the Cloud Shell image is that there is

  1. only desert (and any user installed schemes)

    In vim if you type :colo it will show the current scheme; :colo and CTRL+D then it lists out the available schemes.

  2. no syntax highlighting

WSL running jammy

image

  • syntax highlighting ✅
  • full set of schemes ✅

Cloud Shell in Windows Terminal

image

  • syntax highlighting ❌
  • full set of schemes ❌

Cloud Shell in the browser

image

  • syntax highlighting ❌
  • full set of schemes ❌

@hima-gadupudi, would you reopen the issue?

@nathanweeks
Copy link

Lack of syntax highlighting support in Azure Cloud Shell's vim is still an issue.

@nathanweeks
Copy link

#384 proposes adding the vim-extra package to the Cloud Shell base image to resolve this issue.

In the interim, one could manually install vim runtime files in their Cloud Shell home directory as described at https://www.vim.org/runtime.php. I'm familiar with vim / runtime version compatibility guarantees; if one wants to install the version of the runtime associated with their exact version of vim, the instructions could be adapted thus:

$ vim --version | head -n 2
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar  1 2024 01:01:28)
Included patches: 1-2121
$ VIMVERSION=$(vim --version | awk 'NR==1 {v=$5; FS="-"} NR == 2 {t=$2} END {print v "." t}')
$ echo $VIMVERSION
9.0.2121
$ mkdir -p ~/.vim
$ wget -O - https://github.com/vim/vim/archive/refs/tags/v${VIMVERSION}.tar.gz | tar -C ~/.vim -xzf -  vim-${VIMVERSION}/runtime/ --strip-components=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-image Changes to the base/tools image bug Something isn't working Iteration-Backlog Cloud Shell team will address this in the future Status-Committed Committed item by the Cloud Shell team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants