chore: A bunch of things.
Themery for nvim, tmux theme, zsh stuff
This commit is contained in:
parent
203921b304
commit
9435f9d024
17 changed files with 457 additions and 153 deletions
38
.config/nvim/lua/core/theme.lua
Normal file
38
.config/nvim/lua/core/theme.lua
Normal file
|
@ -0,0 +1,38 @@
|
|||
-- Themery block
|
||||
-- This block will be replaced by Themery.
|
||||
require("catppuccin").setup({
|
||||
flavour = "latte", -- latte, frappe, macchiato, mocha
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
fidget = true,
|
||||
telescope = true,
|
||||
leap = true,
|
||||
mason = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
vim.cmd("colorscheme catppuccin-latte")
|
||||
vim.g.theme_id = 4
|
||||
-- end themery block
|
10
.config/nvim/lua/plugins/autopairs.lua
Normal file
10
.config/nvim/lua/plugins/autopairs.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
local Rule = require('nvim-autopairs.rule')
|
||||
local npairs = require('nvim-autopairs')
|
||||
|
||||
npairs.setup({
|
||||
map_cr = true,
|
||||
map_bs = true,
|
||||
check_ts = true,
|
||||
enable_check_bracket_line = true,
|
||||
ignored_next_char = "[%w]"
|
||||
})
|
|
@ -34,7 +34,7 @@ require("bufferline").setup({
|
|||
icon = "▎",
|
||||
style = "icon",
|
||||
},
|
||||
buffer_close_icon = '',
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
--local colorscheme = "onedark"
|
||||
|
||||
require("catppuccin").setup({
|
||||
flavour = "frappe", -- latte, frappe, macchiato, mocha
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
fidget = true,
|
||||
telescope = true,
|
||||
leap = true,
|
||||
mason = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
local colorscheme = "catppuccin"
|
||||
|
||||
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
|
@ -14,33 +14,33 @@ local check_backspace = function()
|
|||
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
|
||||
end
|
||||
|
||||
-- פּ ﯟ some other good icons
|
||||
-- some other good icons
|
||||
local kind_icons = {
|
||||
Text = "",
|
||||
Text = "",
|
||||
Method = "m",
|
||||
Function = "",
|
||||
Function = "",
|
||||
Constructor = "",
|
||||
Field = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Variable = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Keyword = "",
|
||||
Keyword = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
Operator = "",
|
||||
TypeParameter = "",
|
||||
Copilot = "",
|
||||
DB = "",
|
||||
}
|
||||
|
@ -110,20 +110,19 @@ cmp.setup {
|
|||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
--vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||
if vim.tbl_contains({ "nvim_lsp" }, entry.source.name) then
|
||||
tailwind = require("tailwindcss-colorizer-cmp")
|
||||
return tailwind.formatter(entry, vim_item)
|
||||
else
|
||||
vim_item.kind = string.format('[%s %s]', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
["vim-dadbod-completion"] = "[]",
|
||||
nvim_lua = "[LSP]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end
|
||||
-- if vim.tbl_contains({ "nvim_lsp" }, entry.source.name) then
|
||||
-- tailwind = require("tailwindcss-colorizer-cmp")
|
||||
-- return tailwind.formatter(entry, vim_item)
|
||||
-- else
|
||||
vim_item.kind = string.format('[%s %s]', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
|
||||
vim_item.menu = ({
|
||||
nvim_lsp = "[LSP]",
|
||||
["vim-dadbod-completion"] = "[]",
|
||||
nvim_lua = "[LSP]",
|
||||
path = "[Path]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
-- end
|
||||
end,
|
||||
},
|
||||
sorting = {
|
||||
|
@ -195,7 +194,13 @@ cmp.setup {
|
|||
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
ghost_text = false,
|
||||
native_menu = false,
|
||||
},
|
||||
}
|
||||
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
|
|
|
@ -5,15 +5,19 @@ lazy.setup({
|
|||
'lewis6991/impatient.nvim',
|
||||
|
||||
-------------------------------------------THEMES------------------------------------------
|
||||
{
|
||||
'zaldih/themery.nvim',
|
||||
config = function()
|
||||
require('plugins.themery')
|
||||
end
|
||||
},
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
name = "catppuccin",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require('plugins.catppuccin')
|
||||
end
|
||||
},
|
||||
{ "ellisonleao/gruvbox.nvim", priority = 1000 },
|
||||
-------------------------------------------------------QOL---------------------------------
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
|
@ -46,6 +50,17 @@ lazy.setup({
|
|||
},
|
||||
|
||||
{
|
||||
'declancm/cinnamon.nvim',
|
||||
config = function()
|
||||
require('cinnamon').setup {
|
||||
scroll_limit = 10000,
|
||||
always_scroll = true,
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
|
@ -80,7 +95,6 @@ lazy.setup({
|
|||
|
||||
--Change add and remove surroundings from words
|
||||
'tpope/vim-surround',
|
||||
'tpope/vim-obsession',
|
||||
|
||||
{
|
||||
'NvChad/nvim-colorizer.lua',
|
||||
|
@ -89,22 +103,22 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
|
||||
{
|
||||
"roobert/tailwindcss-colorizer-cmp.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("tailwindcss-colorizer-cmp").setup({
|
||||
color_square_width = 2,
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
'laytan/tailwind-sorter.nvim',
|
||||
event = "VeryLazy",
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' },
|
||||
build = 'cd formatter && bun i && bun run build',
|
||||
config = true,
|
||||
},
|
||||
-- {
|
||||
-- "roobert/tailwindcss-colorizer-cmp.nvim",
|
||||
-- event = "VeryLazy",
|
||||
-- config = function()
|
||||
-- require("tailwindcss-colorizer-cmp").setup({
|
||||
-- color_square_width = 2,
|
||||
-- })
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- 'laytan/tailwind-sorter.nvim',
|
||||
-- event = "VeryLazy",
|
||||
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' },
|
||||
-- build = 'cd formatter && bun i && bun run build',
|
||||
-- config = true,
|
||||
-- },
|
||||
--Database integration
|
||||
-- 'tpope/vim-dadbod',
|
||||
-- {
|
||||
|
@ -135,42 +149,35 @@ lazy.setup({
|
|||
|
||||
-- Rename variable pop up
|
||||
'stevearc/dressing.nvim',
|
||||
{
|
||||
'krady21/compiler-explorer.nvim',
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("compiler-explorer").setup({
|
||||
url = "https://godbolt.org",
|
||||
infer_lang = true, -- Try to infer possible language based on file extension.
|
||||
line_match = {
|
||||
highlight = true, -- highlight the matching line(s) in the other buffer.
|
||||
jump = true, -- move the cursor in the other buffer to the first matching line.
|
||||
},
|
||||
open_qflist = true, -- Open qflist after compilation if there are diagnostics.
|
||||
split = "split", -- How to split the window after the second compile (split/vsplit).
|
||||
compiler_flags = "", -- Default flags passed to the compiler.
|
||||
job_timeout_ms = 25000, -- Timeout for libuv job in milliseconds.
|
||||
languages = { -- Language specific default compiler/flags
|
||||
c = {
|
||||
compiler = "cg132"
|
||||
}
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'luk400/vim-jukit',
|
||||
ft = {'python','ipynb'},
|
||||
},
|
||||
-- {
|
||||
-- 'krady21/compiler-explorer.nvim',
|
||||
-- event = "VeryLazy",
|
||||
-- config = function()
|
||||
-- require("compiler-explorer").setup({
|
||||
-- url = "https://godbolt.org",
|
||||
-- infer_lang = true, -- Try to infer possible language based on file extension.
|
||||
-- line_match = {
|
||||
-- highlight = true, -- highlight the matching line(s) in the other buffer.
|
||||
-- jump = true, -- move the cursor in the other buffer to the first matching line.
|
||||
-- },
|
||||
-- open_qflist = true, -- Open qflist after compilation if there are diagnostics.
|
||||
-- split = "split", -- How to split the window after the second compile (split/vsplit).
|
||||
-- compiler_flags = "", -- Default flags passed to the compiler.
|
||||
-- job_timeout_ms = 25000, -- Timeout for libuv job in milliseconds.
|
||||
-- languages = { -- Language specific default compiler/flags
|
||||
-- c = {
|
||||
-- compiler = "cg132"
|
||||
-- }
|
||||
-- },
|
||||
-- })
|
||||
-- end
|
||||
-- },
|
||||
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
config = function()
|
||||
require('nvim-autopairs').setup({
|
||||
map_cr = true,
|
||||
map_bs = true,
|
||||
})
|
||||
require 'plugins.autopairs'
|
||||
end
|
||||
},
|
||||
|
||||
|
@ -211,17 +218,7 @@ lazy.setup({
|
|||
},
|
||||
|
||||
--LSP Status
|
||||
{
|
||||
'j-hui/fidget.nvim',
|
||||
tag = 'legacy',
|
||||
config = function()
|
||||
require('fidget').setup {
|
||||
window = {
|
||||
blend = 0,
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
'j-hui/fidget.nvim',
|
||||
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
@ -298,6 +295,8 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
|
||||
'kaarmu/typst.vim',
|
||||
|
||||
--Sticky headers
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
|
@ -306,6 +305,8 @@ lazy.setup({
|
|||
end
|
||||
},
|
||||
|
||||
"runoshun/vim-alloy",
|
||||
|
||||
--Tabs
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
|
|
93
.config/nvim/lua/plugins/themery.lua
Normal file
93
.config/nvim/lua/plugins/themery.lua
Normal file
|
@ -0,0 +1,93 @@
|
|||
require("themery").setup({
|
||||
themes = { {
|
||||
name = "Gruvbox dark",
|
||||
colorscheme = "gruvbox",
|
||||
before = [[
|
||||
vim.opt.background = "dark"
|
||||
]],
|
||||
},
|
||||
{
|
||||
name = "Gruvbox light",
|
||||
colorscheme = "gruvbox",
|
||||
before = [[
|
||||
vim.opt.background = "light"
|
||||
]]
|
||||
},
|
||||
{
|
||||
name = "Catppuccin Frappe",
|
||||
colorscheme = "catppuccin-frappe",
|
||||
before = [[
|
||||
require("catppuccin").setup({
|
||||
flavour = "frappe", -- latte, frappe, macchiato, mocha
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
fidget = true,
|
||||
telescope = true,
|
||||
leap = true,
|
||||
mason = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
]]
|
||||
},
|
||||
{
|
||||
name = "Catppuccin Latte",
|
||||
colorscheme = "catppuccin-latte",
|
||||
before = [[
|
||||
require("catppuccin").setup({
|
||||
flavour = "latte", -- latte, frappe, macchiato, mocha
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
treesitter = true,
|
||||
treesitter_context = true,
|
||||
fidget = true,
|
||||
telescope = true,
|
||||
leap = true,
|
||||
mason = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
]]
|
||||
},
|
||||
},
|
||||
themeConfigFile = "~/.config/nvim/lua/core/theme.lua", -- Described below
|
||||
livePreview = true, -- Apply theme while browsing. Default to true.
|
||||
})
|
71
.config/nvim/lua/winbar.lua
Normal file
71
.config/nvim/lua/winbar.lua
Normal file
|
@ -0,0 +1,71 @@
|
|||
local folder_icon = ""
|
||||
|
||||
local M = {}
|
||||
|
||||
--- Window bar that shows the current file path (in a fancy way).
|
||||
---@return string
|
||||
function M.render()
|
||||
-- Get the path and expand variables.
|
||||
local path = vim.fs.normalize(vim.fn.expand '%:p' --[[@as string]])
|
||||
|
||||
-- Replace slashes by arrows.
|
||||
local separator = ' %#WinbarSeparator# '
|
||||
|
||||
local prefix, prefix_path = '', ''
|
||||
|
||||
-- If the window gets too narrow, shorten the path and drop the prefix.
|
||||
if vim.api.nvim_win_get_width(0) < math.floor(vim.o.columns / 3) then
|
||||
path = vim.fn.pathshorten(path)
|
||||
else
|
||||
-- For some special folders, add a prefix instead of the full path (making
|
||||
-- sure to pick the longest prefix).
|
||||
---@type table<string, string>
|
||||
local special_dirs = {
|
||||
DOTFILES = "/Users/afonso/.config",
|
||||
HOME = vim.env.HOME,
|
||||
PROJECTS = "/Users/afonso/projects",
|
||||
["University"] = "/Users/afonso/projects/University",
|
||||
["Personal"] = "/Users/afonso/projects/Personal",
|
||||
}
|
||||
for dir_name, dir_path in pairs(special_dirs) do
|
||||
if vim.startswith(path, vim.fs.normalize(dir_path)) and #dir_path > #prefix_path then
|
||||
prefix, prefix_path = dir_name, dir_path
|
||||
end
|
||||
end
|
||||
if prefix ~= '' then
|
||||
path = path:gsub('^' .. prefix_path, '')
|
||||
prefix = string.format('%%#WinBarSpecial#%s %s%s', folder_icon, prefix, separator)
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove leading slash.
|
||||
path = path:gsub('^/', '')
|
||||
|
||||
return table.concat {
|
||||
' ',
|
||||
prefix,
|
||||
table.concat(
|
||||
vim.iter.map(function(segment)
|
||||
return string.format('%%#Winbar#%s', segment)
|
||||
end, vim.split(path, '/')),
|
||||
separator
|
||||
),
|
||||
}
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('BufWinEnter', {
|
||||
group = vim.api.nvim_create_augroup('mariasolos/winbar', { clear = true }),
|
||||
desc = 'Attach winbar',
|
||||
callback = function(args)
|
||||
if
|
||||
not vim.api.nvim_win_get_config(0).zindex -- Not a floating window
|
||||
and vim.bo[args.buf].buftype == '' -- Normal buffer
|
||||
and vim.api.nvim_buf_get_name(args.buf) ~= '' -- Has a file name
|
||||
and not vim.wo[0].diff -- Not in diff mode
|
||||
then
|
||||
vim.wo.winbar = "%{%v:lua.require'winbar'.render()%}"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue