Skip to content

Commit 486de9c

Browse files
committed
feat: use new default color scheme on nvim 0.10
otherwise uses catppuccin
1 parent cb3e80b commit 486de9c

File tree

8 files changed

+79
-52
lines changed

8 files changed

+79
-52
lines changed

init.lua

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@
1313
require 'config.global'
1414
require 'config.lazy'
1515
require 'config.autocommands'
16-
require 'config.colors'

lua/config/colors.lua

-5
This file was deleted.

lua/config/lazy.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require('lazy').setup('plugins', {
2121
path = '~/projects',
2222
fallback = true,
2323
},
24-
install = { colorscheme = { 'catppuccin', 'habamax' } },
24+
install = {},
2525
checker = { enabled = false },
2626
rtp = {
2727
disabled_plugins = {

lua/plugins/colorthemes.lua

+18
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,26 @@ return {
55
{
66
'catppuccin/nvim',
77
name = 'catppuccin',
8+
-- using new default on nvim 0.10 now for a while to test
9+
enabled = function()
10+
-- only enabled catppuccin on lower versions
11+
local has_new_default_theme = vim.fn.has 'nvim-0.10' == 1
12+
if has_new_default_theme then
13+
-- change cursor color for terminal insert mode
14+
-- (because cursor shape does not change for now)
15+
vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' })
16+
end
17+
return not has_new_default_theme
18+
end,
819
lazy = false, -- make sure we load this during startup if it is your main colorscheme
920
priority = 1000, -- make sure to load this before all the other start plugins
21+
config = function()
22+
-- set colorscheme and overwrite highlights
23+
vim.cmd.colorscheme 'catppuccin-mocha'
24+
local colors = require 'catppuccin.palettes.mocha'
25+
vim.api.nvim_set_hl(0, 'Tabline', { fg = colors.green, bg = colors.mantle })
26+
vim.api.nvim_set_hl(0, 'TermCursor', { fg = '#A6E3A1', bg = '#A6E3A1' })
27+
end,
1028
},
1129
{
1230
'olimorris/onedarkpro.nvim',

lua/plugins/completion.lua

+15-14
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ return {
1111
'hrsh7th/nvim-cmp',
1212
event = 'InsertEnter',
1313
dependencies = {
14-
{ 'hrsh7th/cmp-nvim-lsp' },
15-
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
16-
{ 'hrsh7th/cmp-buffer' },
17-
{ 'hrsh7th/cmp-path' },
18-
{ 'hrsh7th/cmp-calc' },
19-
{ 'hrsh7th/cmp-emoji' },
20-
{ 'saadparwaiz1/cmp_luasnip' },
21-
{ 'f3fora/cmp-spell' },
22-
{ 'ray-x/cmp-treesitter' },
23-
{ 'kdheepak/cmp-latex-symbols' },
24-
{ 'jmbuhr/cmp-pandoc-references' },
25-
{ 'L3MON4D3/LuaSnip' },
26-
{ 'rafamadriz/friendly-snippets' },
27-
{ 'onsails/lspkind-nvim' },
14+
'hrsh7th/cmp-nvim-lsp',
15+
'hrsh7th/cmp-nvim-lsp-signature-help',
16+
'hrsh7th/cmp-buffer',
17+
'hrsh7th/cmp-path',
18+
'hrsh7th/cmp-calc',
19+
'hrsh7th/cmp-emoji',
20+
'saadparwaiz1/cmp_luasnip',
21+
'f3fora/cmp-spell',
22+
'ray-x/cmp-treesitter',
23+
'kdheepak/cmp-latex-symbols',
24+
'jmbuhr/cmp-pandoc-references',
25+
'L3MON4D3/LuaSnip',
26+
'rafamadriz/friendly-snippets',
27+
'onsails/lspkind-nvim',
28+
'jmbuhr/otter.nvim',
2829
},
2930
config = function()
3031
local cmp = require 'cmp'

lua/plugins/lsp.lua

+24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
return {
2+
{
3+
-- for lsp features in code cells / embedded code
4+
'jmbuhr/otter.nvim',
5+
dev = true,
6+
dependencies = {
7+
{
8+
'neovim/nvim-lspconfig',
9+
'nvim-treesitter/nvim-treesitter',
10+
'hrsh7th/nvim-cmp',
11+
},
12+
},
13+
opts = {
14+
lsp = {
15+
hover = {
16+
border = require('misc.style').border,
17+
},
18+
},
19+
buffers = {
20+
set_filetype = true,
21+
},
22+
handle_leading_whitespace = true,
23+
},
24+
},
25+
226
{
327
'neovim/nvim-lspconfig',
428
dependencies = {

lua/plugins/quarto.lua

+6-25
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
return {
22

3-
{ -- requires plugins in treesitter.lua and lsp.lua
3+
{ -- requires plugins in lua/plugins/treesitter.lua and lua/plugins/lsp.lua
4+
-- for complete functionality (language features)
45
'quarto-dev/quarto-nvim',
56
ft = { 'quarto' },
67
dev = false,
@@ -14,30 +15,10 @@ return {
1415
},
1516
},
1617
dependencies = {
17-
{
18-
-- for language features in code cells
19-
-- specifically needs its source added for nvim-cmp in completion.lua
20-
'jmbuhr/otter.nvim',
21-
dev = false,
22-
dependencies = {
23-
{
24-
'neovim/nvim-lspconfig',
25-
'nvim-treesitter/nvim-treesitter',
26-
'hrsh7th/nvim-cmp',
27-
},
28-
},
29-
opts = {
30-
lsp = {
31-
hover = {
32-
border = require('misc.style').border,
33-
},
34-
},
35-
buffers = {
36-
set_filetype = true,
37-
},
38-
handle_leading_whitespace = true,
39-
},
40-
},
18+
-- for language features in code cells
19+
-- configured in lua/plugins/lsp.lua and
20+
-- added as a nvim-cmp source in lua/plugins/completion.lua
21+
'jmbuhr/otter.nvim',
4122
},
4223
},
4324

lua/plugins/ui.lua

+15-6
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ return {
274274

275275
{ -- highlight markdown headings and code blocks etc.
276276
'lukas-reineke/headlines.nvim',
277-
enabled = true,
277+
enabled = false,
278278
dependencies = 'nvim-treesitter/nvim-treesitter',
279279
config = function()
280280
require('headlines').setup {
@@ -304,15 +304,24 @@ return {
304304
{ -- show images in nvim!
305305
'3rd/image.nvim',
306306
enabled = true,
307+
dependencies = {
308+
{
309+
-- needs:
310+
-- sudo apt installl luajit
311+
-- <https://github.com/vhyrro/luarocks.nvim>
312+
'vhyrro/luarocks.nvim',
313+
priority = 1001, -- this plugin needs to run before anything else
314+
opts = {
315+
rocks = { 'magick' },
316+
},
317+
},
318+
},
307319
config = function()
308320
-- Requirements
309321
-- https://github.com/3rd/image.nvim?tab=readme-ov-file#requirements
310322
-- check for dependencies with `:checkhealth kickstart`
311-
-- otherwise set `enabled = false` in the plugin spec
312-
-- Example for configuring Neovim to load user-installed installed Lua rocks:
313-
--$ luarocks --local --lua-version=5.1 install magick
314-
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?/init.lua;'
315-
package.path = package.path .. ';' .. vim.fn.expand '$HOME' .. '/.luarocks/share/lua/5.1/?.lua;'
323+
-- needs:
324+
-- sudo apt install libmagickwand-dev
316325

317326
require('image').setup {
318327
backend = 'kitty',

0 commit comments

Comments
 (0)