chore: A bunch of things.

Themery for nvim, tmux theme, zsh stuff
This commit is contained in:
Afonso Franco 2024-01-03 15:12:33 +00:00
parent 203921b304
commit 9435f9d024
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
17 changed files with 457 additions and 153 deletions

View file

@ -0,0 +1,22 @@
import = [
"~/.config/alacritty/catppuccin-latte.toml"
]
[env]
TERM = "xterm-256color"
[font]
size = 14.0
[font.normal]
family = "FiraCode Nerd Font Mono"
style = "Light"
[window]
opacity = 0.95
option_as_alt = "Both"
dynamic_padding = true
[window.padding]
x = 2
y = 2

View file

@ -1,17 +0,0 @@
import:
- ~/.config/alacritty/catppuccin/catppuccin-frappe.yml
env:
TERM: tmux-256color
window:
padding:
x: 2
y: 2
opacity: 0.85
font:
normal:
family: FiraCode Nerd Font Mono
style: Light
size: 10.0

View file

@ -0,0 +1,75 @@
[colors.primary]
background = "#EFF1F5"
foreground = "#4C4F69"
dim_foreground = "#4C4F69"
bright_foreground = "#4C4F69"
[colors.cursor]
text = "#EFF1F5"
cursor = "#DC8A78"
[colors.vi_mode_cursor]
text = "#EFF1F5"
cursor = "#7287FD"
[colors.search.matches]
foreground = "#EFF1F5"
background = "#6C6F85"
[colors.search.focused_match]
foreground = "#EFF1F5"
background = "#40A02B"
[colors.footer_bar]
foreground = "#EFF1F5"
background = "#6C6F85"
[colors.hints.start]
foreground = "#EFF1F5"
background = "#DF8E1D"
[colors.hints.end]
foreground = "#EFF1F5"
background = "#6C6F85"
[colors.selection]
text = "#EFF1F5"
background = "#DC8A78"
[colors.normal]
black = "#5C5F77"
red = "#D20F39"
green = "#40A02B"
yellow = "#DF8E1D"
blue = "#1E66F5"
magenta = "#EA76CB"
cyan = "#179299"
white = "#ACB0BE"
[colors.bright]
black = "#6C6F85"
red = "#D20F39"
green = "#40A02B"
yellow = "#DF8E1D"
blue = "#1E66F5"
magenta = "#EA76CB"
cyan = "#179299"
white = "#BCC0CC"
[colors.dim]
black = "#5C5F77"
red = "#D20F39"
green = "#40A02B"
yellow = "#DF8E1D"
blue = "#1E66F5"
magenta = "#EA76CB"
cyan = "#179299"
white = "#ACB0BE"
[[colors.indexed_colors]]
index = 16
color = "#FE640B"
[[colors.indexed_colors]]
index = 17
color = "#DC8A78"

View file

@ -1,4 +1,6 @@
require("core.variables") require("core.variables")
require('core.package_manager') require('core.package_manager')
require('plugins.remote-theme') require('plugins.remote-theme')
require('winbar')
require('core.theme')
require('impatient') require('impatient')

View 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

View 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]"
})

View file

@ -34,7 +34,7 @@ require("bufferline").setup({
icon = "", icon = "",
style = "icon", style = "icon",
}, },
buffer_close_icon = '', buffer_close_icon = '',
modified_icon = '', modified_icon = '',
close_icon = '', close_icon = '',
left_trunc_marker = '', left_trunc_marker = '',

View file

@ -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

View file

@ -14,33 +14,33 @@ local check_backspace = function()
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" return col == 0 or vim.fn.getline("."):sub(col, col):match "%s"
end end
--   פּ ﯟ   some other good icons -- 󰃐 󰆩 󰙅 󰛡  󰅲 some other good icons
local kind_icons = { local kind_icons = {
Text = "", Text = "󰉿",
Method = "m", Method = "m",
Function = "", Function = "󰊕",
Constructor = "", Constructor = "",
Field = "", Field = "",
Variable = "", Variable = "󰆧",
Class = "", Class = "󰌗",
Interface = "", Interface = "",
Module = "", Module = "",
Property = "", Property = "",
Unit = "", Unit = "",
Value = "", Value = "󰎠",
Enum = "", Enum = "",
Keyword = "", Keyword = "󰌋",
Snippet = "", Snippet = "",
Color = "", Color = "󰏘",
File = "", File = "󰈙",
Reference = "", Reference = "",
Folder = "", Folder = "󰉋",
EnumMember = "", EnumMember = "",
Constant = "", Constant = "󰇽",
Struct = "", Struct = "",
Event = "", Event = "",
Operator = "", Operator = "󰆕",
TypeParameter = "", TypeParameter = "󰊄",
Copilot = "", Copilot = "",
DB = "󰆼", DB = "󰆼",
} }
@ -110,20 +110,19 @@ cmp.setup {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item) format = function(entry, vim_item)
-- Kind icons -- Kind icons
--vim_item.kind = string.format("%s", kind_icons[vim_item.kind]) -- if vim.tbl_contains({ "nvim_lsp" }, entry.source.name) then
if vim.tbl_contains({ "nvim_lsp" }, entry.source.name) then -- tailwind = require("tailwindcss-colorizer-cmp")
tailwind = require("tailwindcss-colorizer-cmp") -- return tailwind.formatter(entry, vim_item)
return tailwind.formatter(entry, vim_item) -- else
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.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 = ({
vim_item.menu = ({ nvim_lsp = "[LSP]",
nvim_lsp = "[LSP]", ["vim-dadbod-completion"] = "[󰆼]",
["vim-dadbod-completion"] = "[󰆼]", nvim_lua = "[LSP]",
nvim_lua = "[LSP]", path = "[Path]",
path = "[Path]", })[entry.source.name]
})[entry.source.name] return vim_item
return vim_item -- end
end
end, end,
}, },
sorting = { sorting = {
@ -195,7 +194,13 @@ cmp.setup {
}, },
experimental = { experimental = {
ghost_text = true, ghost_text = false,
native_menu = false, native_menu = false,
}, },
} }
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)

View file

@ -5,15 +5,19 @@ lazy.setup({
'lewis6991/impatient.nvim', 'lewis6991/impatient.nvim',
-------------------------------------------THEMES------------------------------------------ -------------------------------------------THEMES------------------------------------------
{
'zaldih/themery.nvim',
config = function()
require('plugins.themery')
end
},
{ {
'catppuccin/nvim', 'catppuccin/nvim',
name = "catppuccin", name = "catppuccin",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
config = function()
require('plugins.catppuccin')
end
}, },
{ "ellisonleao/gruvbox.nvim", priority = 1000 },
-------------------------------------------------------QOL--------------------------------- -------------------------------------------------------QOL---------------------------------
{ {
"zbirenbaum/copilot.lua", "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", "folke/which-key.nvim",
event = "VeryLazy", event = "VeryLazy",
init = function() init = function()
@ -80,7 +95,6 @@ lazy.setup({
--Change add and remove surroundings from words --Change add and remove surroundings from words
'tpope/vim-surround', 'tpope/vim-surround',
'tpope/vim-obsession',
{ {
'NvChad/nvim-colorizer.lua', 'NvChad/nvim-colorizer.lua',
@ -89,22 +103,22 @@ lazy.setup({
end end
}, },
{ -- {
"roobert/tailwindcss-colorizer-cmp.nvim", -- "roobert/tailwindcss-colorizer-cmp.nvim",
event = "VeryLazy", -- event = "VeryLazy",
config = function() -- config = function()
require("tailwindcss-colorizer-cmp").setup({ -- require("tailwindcss-colorizer-cmp").setup({
color_square_width = 2, -- color_square_width = 2,
}) -- })
end -- end
}, -- },
{ -- {
'laytan/tailwind-sorter.nvim', -- 'laytan/tailwind-sorter.nvim',
event = "VeryLazy", -- event = "VeryLazy",
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' }, -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' },
build = 'cd formatter && bun i && bun run build', -- build = 'cd formatter && bun i && bun run build',
config = true, -- config = true,
}, -- },
--Database integration --Database integration
-- 'tpope/vim-dadbod', -- 'tpope/vim-dadbod',
-- { -- {
@ -135,42 +149,35 @@ lazy.setup({
-- Rename variable pop up -- Rename variable pop up
'stevearc/dressing.nvim', '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', -- 'krady21/compiler-explorer.nvim',
ft = {'python','ipynb'}, -- 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', 'windwp/nvim-autopairs',
config = function() config = function()
require('nvim-autopairs').setup({ require 'plugins.autopairs'
map_cr = true,
map_bs = true,
})
end end
}, },
@ -211,17 +218,7 @@ lazy.setup({
}, },
--LSP Status --LSP Status
{ 'j-hui/fidget.nvim',
'j-hui/fidget.nvim',
tag = 'legacy',
config = function()
require('fidget').setup {
window = {
blend = 0,
}
}
end
},
{ {
"rcarriga/nvim-dap-ui", "rcarriga/nvim-dap-ui",
@ -298,6 +295,8 @@ lazy.setup({
end end
}, },
'kaarmu/typst.vim',
--Sticky headers --Sticky headers
{ {
'nvim-treesitter/nvim-treesitter-context', 'nvim-treesitter/nvim-treesitter-context',
@ -306,6 +305,8 @@ lazy.setup({
end end
}, },
"runoshun/vim-alloy",
--Tabs --Tabs
{ {
'akinsho/bufferline.nvim', 'akinsho/bufferline.nvim',

View 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.
})

View 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

View file

@ -9,7 +9,7 @@ set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tomhey/tmux-remote-sessions' set -g @plugin 'tomhey/tmux-remote-sessions'
# Plugin settings # Plugin settings
set -g @catppuccin_flavour 'frappe' set -g @catppuccin_flavour 'latte'
set -g @catppuccin_window_tabs_enabled on set -g @catppuccin_window_tabs_enabled on
set -g @resurrect-strategy-nvim 'session' set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on' set -g @resurrect-capture-pane-contents 'on'

45
.config/zsh/main.zsh Normal file
View file

@ -0,0 +1,45 @@
HISTSIZE=10000000
SAVEHIST=10000000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_VERIFY
export EDITOR=nvim
export READER=mupdf
# Add paths
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
export PATH="$HOME/.bun/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/.local/share/nvim/mason/bin:$PATH"
export PATH="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.ghcup/bin:$PATH"
export PATH="/usr/bin/vendor_perl:$PATH"
if [ "$(arch)" = "arm64" ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
else
eval "$(/usr/local/bin/brew shellenv)"
fi
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# opam configuration
source $HOME/.opam/opam-init/init.zsh > /dev/null 2>&1 || true

View file

@ -0,0 +1,2 @@
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion)
ZSH_TMUX_AUTOSTART=true

View file

@ -1,8 +1,5 @@
# ~/.config/zsh/qol.zsh # ~/.config/zsh/qol.zsh
bindkey '^H' backward-kill-path-component
bindkey '^[[3;5~' kill-word
backup() { backup() {
cp $1 $1.bak cp $1 $1.bak
} }

View file

@ -1,5 +1,6 @@
IdentityFile ~/.ssh/id_ed25519_sk IdentityFile ~/.ssh/id_ed25519_sk
IdentityFile ~/.ssh/id_ed25519_sk_secondary IdentityFile ~/.ssh/id_ed25519_sk_secondary
IdentityFile ~/.ssh/id_rsa
Host gon Host gon
ControlMaster auto ControlMaster auto