-
Notifications
You must be signed in to change notification settings - Fork 47
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
Theme doesn't load automatically upon start up when using a lua config #36
Comments
Hi @edu-ant-vi , vim.cmd([[colorscheme gruvbox8]]) And see if it works? |
I tried it now, but the same thing happens. I believe they are actually the same function under the hood. |
how are you installing gruvbox8? I'm using use {
'lifepillar/vim-gruvbox8',
setup = function()
vim.g.gruvbox_contrast_dark='hard'
vim.cmd([[colorscheme gruvbox8_hard]])
end
} |
I'm using packer too. I was setting the colorscheme after loading gruvbox8, but outside of |
Can you share your |
Sure. My only dotfile at the moment is the -- Initial setup ---------------------------------------------------------------
-- vim.o for setting global options
-- vim.bo for setting buffer-scoped options
-- vim.wo for setting window-scoped options
local viml = vim.api.nvim_command -- to execute vim commands
local g = vim.g -- a table of global variables
local scopes = {o = vim.o, b = vim.bo, w = vim.wo}
local function opt(scope, key, value)
scopes[scope][key] = value
if scope ~= "o" then scopes["o"][key] = value end
end
local function map(mode, lhs, rhs, opts)
local options = {noremap = true}
if opts then options = vim.tbl_extend("force", options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
-- Plugin declarations ---------------------------------------------------------
viml "packadd packer.nvim"
require("packer").startup(function()
use {"wbthomason/packer.nvim", opt = true} -- packer itself
use "lifepillar/vim-gruvbox8" -- gruvbox but faster
use "pbrisbin/vim-colors-off" -- good ol' grey scale
use "arcticicestudio/nord-vim" -- blue-ish, icy theme
use "sheerun/vim-polyglot" -- extra language support
use "ms-jpq/chadtree" -- file manager
-- use "nvim-treesitter"
-- use "neovim/nvim-lspconfig"
use "ryanoasis/vim-devicons" -- pretty icons
end)
-- General settings ------------------------------------------------------------
viml "syntax on"
viml "colorscheme gruvbox8"
viml "filetype plugin indent on"
opt("o", "hidden", true)
opt("w", "wrap", false)
opt("o", "hlsearch", false)
opt("o", "errorbells", false)
opt("w", "number", true)
opt("w", "relativenumber", true)
opt("o", "incsearch", true)
opt("o", "scrolloff", 8)
opt("o", "sidescrolloff", 8 )
opt("o", "lazyredraw", true)
opt("o", "mouse", "a")
opt("o", "termguicolors", true)
local indent = 4
opt("b", "tabstop", indent)
opt("b", "softtabstop", indent)
opt("b", "expandtab", true)
opt("b", "shiftwidth", indent)
opt("b", "smartindent", true)
opt("o", "ignorecase", true)
opt("o", "joinspaces", false)
opt("o", "shiftround", true)
opt("o", "smartcase", true)
opt("o", "splitbelow", true)
opt("o", "splitright", true)
opt("o", "wildmode", "list:longest")
opt("w", "list", true)
-- General key bindings --------------------------------------------------------
g.mapleader = " "
g.maplocalleader = " m"
map("n", "<leader>w", "<C-w>")
map("n", "<leader><leader>", "<cmd>bnext<cr>")
map("n", "<leader>ec", "<cmd>edit $MYVIMRC<cr>")
map("n", "<leader>lc", "<cmd>luafile $MYVIMRC<cr>")
-- çç to switch to normal mode
map("i", "çç", "<esc>")
map("v", "çç", "<esc>")
map("t", "çç", "<C-\\><C-n>")
-- Paste to and from the system"s clipboard
map("", "<C-y>", "\"+y")
map("", "<C-p>", "\"+p")
-- Plugin configuration ----------------------------------------------------------
-- Plugin-specific maps ----------------------------------------------------------
map("n", "<leader>.", "<cmd>CHADopen<cr>") |
I think I got the problem, somehow setting ...
opt("o", "termguicolors", true)
viml "colorscheme gruvbox8"
|
It worked, thank you very much :) |
I'm using a lua config in the nightly build of neovim. For some reason, neovim loads the default theme instead of gruvbox8 whenever I start it up; I have to do a ":luafile ~/.config/nvim/init.lua" for it to load. I've done some testing, and this problem only happens with gruvbox8 and only when using an init.lua. Here's the line I use to set the colorscheme in my config:
Any idea of what's going on?
(P.S.: english is not my native language, sorry if I've made some mistake)
The text was updated successfully, but these errors were encountered: