Giter VIP home page Giter VIP logo

material.vim's Introduction

material.vim

A port of the Material color scheme for Vim/Neovim.

Installation

Using vim-plug (modify this to work with your Vim package manager of choice):

Plug 'kaicataldo/material.vim', { 'branch': 'main' }

Usage

To enable this color scheme, add the following to your Vim (~/.vimrc) or Neovim (~/.config/nvim/init.vim) configuration:

colorscheme material

True Colors

True colors are a requirement for this color scheme to work properly. To enable this, place the following in your ~/.vimrc or ~/.config/nvim/init.vim file:

" For Neovim 0.1.3 and 0.1.4 - https://github.com/neovim/neovim/pull/2198
if (has('nvim'))
  let $NVIM_TUI_ENABLE_TRUE_COLOR = 1
endif

" For Neovim > 0.1.5 and Vim > patch 7.4.1799 - https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162
" Based on Vim patch 7.4.1770 (`guicolors` option) - https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd
" https://github.com/neovim/neovim/wiki/Following-HEAD#20160511
if (has('termguicolors'))
  set termguicolors
endif

Theme

There are five color schemes - default, palenight, ocean, lighter, and darker.

Aditionally, Material's legacy edition (Community Material), is supported for each color scheme - default-community, palenight-community, ocean-community, lighter-community, and darker-community.

This amounts to a total of ten theme options (defaulting to default), that can be configured as follows:

let g:material_theme_style = 'default' | 'palenight' | 'ocean' | 'lighter' | 'darker' | 'default-community' | 'palenight-community' | 'ocean-community' | 'lighter-community' | 'darker-community'

Italics

To enable italics (0 or off by default), please add the following to your configuration file:

let g:material_terminal_italics = 1

Full configuration example

let g:material_terminal_italics = 1
let g:material_theme_style = 'lighter'
colorscheme material

JavaScript

The vim-javascript plugin, which provides fine-grained JS syntax highlighting features, is highly recommended for proper JavaScript highlighting. The theme will still work without the plugin, however JS highlighting will be minimal.

lightline.vim

To use the theme, install lightline.vim with your Vim package manager of choice and then add the following to your configuration file:

let g:lightline = { 'colorscheme': 'material_vim' }

The theme will change to match the theme option specified.

Note: The included theme is called material_vim because lightline.vim comes with its own version of a material theme (which does not change based on the theme version selected).

airline.vim

To use the included vim-airline theme:

let g:airline_theme = 'material'

lualine.nvim

To use the included lualine.nvim theme:

require('lualine').setup({
  options = {
    theme = require('material.lualine'),
  },
})

Terminal Color Scheme

Corresponding terminal color schemes are included in this repo. You can find them here.

Vim in macOS

The default version of vim on macOS doesn't support termguicolors. In order for the colorscheme to work properly you need to apply the terminal colors from above. Or you can install the latest version from brew.

Troubleshooting

Italics not rendering correctly

Italicized text sometimes does not rendering correctly in iTerm2. Before making an issue, if you use iTerm2, please see if this addition to your .vimrc fixes the issue for you:

" Fix italics in Vim
if !has('nvim')
  let &t_ZH="\e[3m"
  let &t_ZR="\e[23m"
endif

Thanks

Thanks to @equinusocio for the original Material theme as well as palenight.vim and quantum, both of which were of great help when I first started this project.

material.vim's People

Contributors

ashwinvis avatar avgvsto avatar cherryman avatar cpmsmith avatar elliotcourant avatar fymyte avatar garand avatar gko avatar kaicataldo avatar kgehmlich avatar klauer avatar kykosic avatar lmlorca avatar muditjoshi98 avatar socksthefennec avatar vkaracic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

material.vim's Issues

Palenight lightline and cursor line

First off great theme really liking being able to go between the material themes and get the sublime text material theme look.

I was going to adjust the cursorline and the lightline theme personally though. For me the backing color is a little too close to what the default theme color palette is. Wanted to see if you at all agreed and wanted a PR to change it closer to how palenight.vim has it.

Thanks again

All identifiers are red in ts files

Hey! I just installed this theme, and for some reason it makes all the identifiers in .ts files red. Is there a way to change that? I'm really used to them being white in vscode's material theme

image

I'm using lunarvim; Here is my config:

local linters = require "lvim.lsp.null-ls.linters"
linters.setup {
  { command = "eslint", filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" } }
}

local formatters = require "lvim.lsp.null-ls.formatters"
formatters.setup {
  {
    command = "prettier",
    filetypes = { "typescript", "typescriptreact", "javascriptreact", "javascriptreact" },
  },
}

require("lvim.lsp.manager").setup "tailwindcss"

local code_actions = require "lvim.lsp.null-ls.code_actions"
code_actions.setup {
  {
    exe = "eslint",
    filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact", "vue" },
  },
}

lvim.format_on_save.enabled = true

lvim.lsp.buffer_mappings.normal_mode['H'] = { vim.lsp.buf.hover, "Show documentation" }
lvim.keys.normal_mode["gD"] = "<cmd>lua vim.lsp.buf.declaration()<CR>"

lvim.colorscheme = "material"

lvim.plugins = {
  {
    "zbirenbaum/copilot.lua",
    cmd = "Copilot",
    event = "InsertEnter",
  },
  {
    "zbirenbaum/copilot-cmp",
    after = { "copilot.lua" },
    config = function()
      require("copilot_cmp").setup()
    end,
  },
  {
    "kaicataldo/material.vim",
    config = function()
      vim.g.material_theme_style = "default-community"
      vim.g.material_terminal_italics = true
    end,
  },
}

local ok, copilot = pcall(require, "copilot")
if not ok then
  return
end

copilot.setup {
  suggestion = {
    keymap = {
      accept = "<c-l>",
      next = "<c-j>",
      prev = "<c-k>",
      dismiss = "<c-h>",
    },
  },
}

local opts = { noremap = true, silent = true }
vim.api.nvim_set_keymap("n", "<c-s>", "<cmd>lua require('copilot.suggestion').toggle_auto_trigger()<CR>", opts)```

Appreciate any help!

color is not expected

VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 19 2019 12:07:03)
macOS version

	syntax on

	if (has("nvim"))
  	"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  	let $NVIM_TUI_ENABLE_TRUE_COLOR=1
	endif

	"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
	"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
	" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
	if (has("termguicolors"))
		set termguicolors
	endif
	"let g:material_theme_style = 'default' | 'palenight' | 'dark'
	let g:material_theme_style = 'palenight'
	let g:material_terminal_italics = 1

	set background=dark
	colorscheme material 

image

vim airline can't resolve material theme

Hello, this is more of a question

Will you make the theme work with vim-airline again ?

Since the last update 4 days ago, airline can't find the theme

It worked before, no issues, both gVim and terminal vim

Thanks.

dark and palenight don't work

Hello, I am using vim 8.1 on macOS, the default works fine, but the other theme styles don't work.

" set color scheme
set background=dark
colorscheme material

" Enable true colors
if (has("termguicolors"))
  set termguicolors
endif

let g:material_theme_style = 'palenight'
let g:material_terminal_italics = 1

Above settings make a default display.

screen shot 2018-08-21 at 10 06 38 pm

Airline theme is not loaded

As for title, the bundled airline theme does not work in my configuration. Moreover, when executing the command :AirlineTheme material to temporarily set the theme as the one to use, I get as output airline: these is an error in theme material. I use neovim, and in my configuration I set the variable airline_theme as suggested.

I upload my neovim configuration as a txt, since Github complains if I leave the ".vim" extension.
init.vim.txt

Thank you

This is the best Material Theme for Vim, the others don't even come close.

Thank you :)

W18: Invalid character in group name

Hello,
I just updated and got this error. I use vim 9.0.0910. I tried to debug and the problem is in this file, the work that you did yesterday :) 05efa0c

I solved it by adding if condition after L563 " Tree-sitter , upto L591.

if has('nvim')
...
endif

I don't know how to ask if it has tree-sitter :D

Found possible other solutions, but I don't know how to implement them.
elixir issue on nvim-treesiter repo and among the comments I found this

If you could be kind enough to implement at least the if statement :)

Thanks.

copy material.vim to colorschemes folder?

will vim-plug automatically copy the material.vim file to the colorschemes directory, or does need to be done manually?

without moving the material.vim file i get this:

E185: Cannot find color scheme 'material'

Control sequence spitout with Kitty terminal

I am getting control sequence dumps into my terminal stdin, I assume it's this plugin as my .vimrc is minimal and contains nothing special except for loading this plugin. I've checked that my TERM is set appropriately, xterm-kitty and this issue keeps cropping up. Does the following mean anything to the devs here?

Here's the issue I am referencing: kovidgoyal/kitty#2018

iTerm themes failing import.

I downloaded the iTerm palenight theme and tried importing within iTerm but am receiving the following error:

The selected file could not be read or did not contain a valid color scheme

Increase the contrast of line numbers in palenight?

Thanks a lot for the great theme, it's by far my favourite one!

I would like to ask you whether it's possible to increase the contrast of the line numbers in the palenight theme. They're sometimes a bit hard to read (or do I just need glasses? ๐Ÿ˜†). Is there any way to make the line numbers more visible? Thanks again! ๐Ÿ˜„

Conceal characters colors not set

Hey there,
I love that theme but had for quite some time a problem with it, that it renders conceal characters with wrong colors( by default DarkGrey ):

screenshot_20190301_105206

I checked the documentation for neovim and vim and found the reason:

hi Conceal guibg=material guifg=material

Fixes it, but doesn't look super good. If you have time, could you tell me which colors should be appropriate ?

Python syntax-highlighting

Hi,
My python syntax highlighting is not working as I expected. Not entirely sure if that is an issue with this theme or my vim configuration. I am currently using vim-polyglot and this theme. Here is a screenshot showing that the syntax is not being highlighted:

Screenshot 2019-03-24 at 11 02 54

As you can see there is almost no hightlighting.

If this is a case of this theme not having python language support, I'd be more than happy to make one.

Just to showcase it working in JS here is another screenshot:

Screenshot 2019-03-24 at 11 06 25

Mention vim-javascript in README

It took me quite a while to come across the vim-javascript plugin. Until finding it, I thought this colour scheme was seriously lacking.

It would be great for other newcomers who use JavaScript if the README mentioned that the vim-javascript plugin would greatly improve their experience (along with any other plugins that improve this colour scheme's syntax highlighting).

Once that's installed, this plugin is fantastic! Thanks for taking the time!

Update vim-javascript styles

We can add a lot more fine-grained syntax highlighting for JavaScript to match the original Material theme using the syntax that is defined here.

Matching parenthesis highlighting confusing (MatchParen)

This may just be me/my terminal/some misconfiguration, but I find matching parentheses very easy to confuse with the cursor. (neovim nightly, default theme style, alacritty / screen-256color)

Current settings call s:SetHighlight('MatchParen', s:comments, s:cyan, 'bold')
image
(match parenthesis first, then cursor)

An arbitrary tweak on my end (that's not likely within the parameters of the original theme): call s:SetHighlight('MatchParen', s:caret, s:bg, 'bold') results in a bit more pleasing:
image
(match parenthesis first, then cursor)

For anyone else with the same issue, it's fortunately easy enough to fix on your own without modifying material.vim:

hi MatchParen cterm=bold ctermfg=220 gui=bold guifg=#ffcc00 guibg=#263238

material_theme_style doesn't change anything

Hello, thanks for this awesome theme. I'm trying to set it up to use the dark version, but when I add let g:material_theme_style = 'dark' in my .vimrc file (or = 'palenight' for that matter), it continues to stay on the default version.

Everything else seems to work great though.

only part of the code get highlighted

Hi, thanks for you contribution!
I am trying to use your plugin and find only part of the code get highlighted.
image
See in the figure, 'Rules' and 'constructor' haven't been hightlighted. Do you have only idea why this happens?
Thanks!

Italic font color

Hi--

just wanting to do a small configuration change so that the comments are lighter (whiter). Currently looks like this and is hard to see.

image

What values would I need to change to make this work?

Thank you,

Original color scheme

Hi,

I really liked the old color scheme, would you consider making an "original" variant. The current default foreground color is way too bright...

Add support for vim-airline again

After the changes in #21 (specifically edfed09), support for vim-airline was removed with the message:

the current version is broken and I'm not using vim-airline at the moment

There's another closed issue (#26) that also brings this up, so I sent a PR (#30) to add it back but it's still broken. From the discussion in #30 (comment), I'm closing the PR and opening this issue to track this feature.


For now, I'm sticking to the old version to keep using it with vim-airline:

Plug 'kaicataldo/material.vim', {'commit': '5aabe47'}

Poor HTML highlighting

2020-07-23-15:43:30

Tags and their attributes are the same color. In the original vscode version, tags are red, and attributes are purple, but here I see everything in the same purple.

I'm using the lastest neovim version. Tried disabling all plugins. My settings are pretty much default:

" True Color Support
if (has("termguicolors"))
 set termguicolors
endif

" Material Theme
let g:material_term1nal_italics = 1
let g:material_theme_style = 'darker'
colorscheme material

Nvim creates problems while opening after the theme installation

Hi, I am a little new to the vim world. I am trying to install this theme. I used vim-plug to install the theme and the theme was installed successfully. Here are my configurations for the theme:

Plug 'kaicataldo/material.vim'

syntax enable
set background=dark

if (has("nvim"))
  "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
  let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif

"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
  set termguicolors
endif

let g:material_theme_style = 'palenight'
let g:material_terminal_italics = 1
let g:airline_theme = 'material'
let g:lightline = { 'colorscheme': 'material_vim' }

colorscheme material

Now neovim throws an error when I open any file with this error:

Error detected while processing /Users/mac/.config/nvim/init.vim:
line   47:
E185: Cannot find color scheme 'material'
Press ENTER or type command to continue

not sure what am I missing here.

Add Lualine theme

Lualine has it's own material theme but โ€“ similiar to the builtin lightline theme โ€“ it does not sync with the style of the vim theme.
Would it be possible to add it?

Thank you for this awesome vim theme and your time put into it! :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.