Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bitcrazed
Last active May 7, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitcrazed/26429ead29d1729f8251e3cff16c2308 to your computer and use it in GitHub Desktop.
Save bitcrazed/26429ead29d1729f8251e3cff16c2308 to your computer and use it in GitHub Desktop.
Vim settings for Bash on Windows & Windows Console
set number
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set mouse=a
syntax enable
if &term =~ '256color'
" The following two lines solve the BCE issue described here: https://sunaku.github.io/vim-256color-bce.html
set term=screen-256color
set t_ut=
set background=dark
" Be sure to store your `<theme>.vim` files in ~/.vim/colors/
colorscheme gruvbox
"colorscheme monokai
"colorscheme solarized
endif
@sorenrichenberg
Copy link

I'm trying to get the solarized colorscheme working in neovim for wsl 2 in Windows terminal. I found this gist from microsoft/WSL#1706 which has been locked due to incivility.

srichenberg@wswn:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy
srichenberg@wswn:~$ vim -version
NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by team+vim@tracker.debian.org

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

I'm getting an error E518: Unknown option: term=screen-256color from line 15 of your gist when I source my vimrc. I have seen set term=screen-256color on other sites and so far its the only suggestion I've been able to find.

I have tried uncommenting line 27 in my vimrc pictured below. When I do, the colorscheme starts working as expected but it's nearly impossible to see my cursor over the cream colored background since the cursor remains grey.

image

@bitcrazed
Copy link
Author

Hi @sorenrichenberg - I'd recommend following popular vim docs on how to use 256 colors: https://vim.fandom.com/wiki/256_colors_in_vim, rather than a gist from 2017 for the legacy Console 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment