Coder Social home page Coder Social logo

Comments (8)

jojoyuji avatar jojoyuji commented on July 25, 2024 1

I think I got the problem, somehow setting termguicolors after colorscheme gruvbox messed up the colorscheme,
try setting the colorscheme after termguicolors:

...
opt("o", "termguicolors", true)
viml "colorscheme gruvbox8"

from vim-gruvbox8.

jojoyuji avatar jojoyuji commented on July 25, 2024

Hi @edu-ant-vi ,
Could you try instead:

vim.cmd([[colorscheme gruvbox8]])

And see if it works?

from vim-gruvbox8.

eduardo-antunes avatar eduardo-antunes commented on July 25, 2024

I tried it now, but the same thing happens. I believe they are actually the same function under the hood.

from vim-gruvbox8.

jojoyuji avatar jojoyuji commented on July 25, 2024

how are you installing gruvbox8?
I think it is a loading order issue. I imagine you're setting the colorscheme before loading gruvbox8.

I'm using packer.nvim and this is how it is for me:

  use {
    'lifepillar/vim-gruvbox8',
    setup = function()
      vim.g.gruvbox_contrast_dark='hard'
      vim.cmd([[colorscheme gruvbox8_hard]])
    end
  }

from vim-gruvbox8.

eduardo-antunes avatar eduardo-antunes commented on July 25, 2024

I'm using packer too. I was setting the colorscheme after loading gruvbox8, but outside of packer.startup. I rearranged my config to do it the way you showed, but it didn't work, even after I tried reinstalling it.

from vim-gruvbox8.

jojoyuji avatar jojoyuji commented on July 25, 2024

Can you share your init.lua and related nvim dotfiles?

from vim-gruvbox8.

eduardo-antunes avatar eduardo-antunes commented on July 25, 2024

Sure. My only dotfile at the moment is the init.lua:

-- 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>")

from vim-gruvbox8.

eduardo-antunes avatar eduardo-antunes commented on July 25, 2024

It worked, thank you very much :)

from vim-gruvbox8.

Related Issues (20)

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.