diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..0897bed --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -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 diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index 7642c8e..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -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 diff --git a/.config/alacritty/catppuccin-latte.toml b/.config/alacritty/catppuccin-latte.toml new file mode 100644 index 0000000..2255dfd --- /dev/null +++ b/.config/alacritty/catppuccin-latte.toml @@ -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" diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index efe7eb3..a393426 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,4 +1,6 @@ require("core.variables") require('core.package_manager') require('plugins.remote-theme') +require('winbar') +require('core.theme') require('impatient') diff --git a/.config/nvim/lua/core/theme.lua b/.config/nvim/lua/core/theme.lua new file mode 100644 index 0000000..c814c32 --- /dev/null +++ b/.config/nvim/lua/core/theme.lua @@ -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 diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..c24b33d --- /dev/null +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -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]" +}) diff --git a/.config/nvim/lua/plugins/bufferline.lua b/.config/nvim/lua/plugins/bufferline.lua index 81bee4d..ea0c1d5 100644 --- a/.config/nvim/lua/plugins/bufferline.lua +++ b/.config/nvim/lua/plugins/bufferline.lua @@ -34,7 +34,7 @@ require("bufferline").setup({ icon = "▎", style = "icon", }, - buffer_close_icon = '', + buffer_close_icon = '', modified_icon = '●', close_icon = '', left_trunc_marker = '', diff --git a/.config/nvim/lua/plugins/catppuccin.lua b/.config/nvim/lua/plugins/catppuccin.lua deleted file mode 100644 index b2f8e34..0000000 --- a/.config/nvim/lua/plugins/catppuccin.lua +++ /dev/null @@ -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 diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 5732f1b..5ad0408 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -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() +) diff --git a/.config/nvim/lua/plugins/lazy.lua b/.config/nvim/lua/plugins/lazy.lua index ef3d301..6d6c167 100644 --- a/.config/nvim/lua/plugins/lazy.lua +++ b/.config/nvim/lua/plugins/lazy.lua @@ -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', diff --git a/.config/nvim/lua/plugins/themery.lua b/.config/nvim/lua/plugins/themery.lua new file mode 100644 index 0000000..576cddc --- /dev/null +++ b/.config/nvim/lua/plugins/themery.lua @@ -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. +}) diff --git a/.config/nvim/lua/winbar.lua b/.config/nvim/lua/winbar.lua new file mode 100644 index 0000000..243670d --- /dev/null +++ b/.config/nvim/lua/winbar.lua @@ -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 + 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 diff --git a/.config/tmux/tmux_plugins.conf b/.config/tmux/tmux_plugins.conf index f131165..5d831b6 100644 --- a/.config/tmux/tmux_plugins.conf +++ b/.config/tmux/tmux_plugins.conf @@ -9,7 +9,7 @@ set -g @plugin 'tmux-plugins/tmux-continuum' set -g @plugin 'tomhey/tmux-remote-sessions' # Plugin settings -set -g @catppuccin_flavour 'frappe' +set -g @catppuccin_flavour 'latte' set -g @catppuccin_window_tabs_enabled on set -g @resurrect-strategy-nvim 'session' set -g @resurrect-capture-pane-contents 'on' diff --git a/.config/zsh/main.zsh b/.config/zsh/main.zsh new file mode 100644 index 0000000..19c1040 --- /dev/null +++ b/.config/zsh/main.zsh @@ -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 diff --git a/.config/zsh/overrides.zsh b/.config/zsh/overrides.zsh new file mode 100644 index 0000000..accfb29 --- /dev/null +++ b/.config/zsh/overrides.zsh @@ -0,0 +1,2 @@ +ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion) +ZSH_TMUX_AUTOSTART=true diff --git a/.config/zsh/qol.zsh b/.config/zsh/qol.zsh index fc28619..e723104 100644 --- a/.config/zsh/qol.zsh +++ b/.config/zsh/qol.zsh @@ -1,8 +1,5 @@ # ~/.config/zsh/qol.zsh -bindkey '^H' backward-kill-path-component -bindkey '^[[3;5~' kill-word - backup() { cp $1 $1.bak } diff --git a/.ssh/config b/.ssh/config index faef381..8f8c605 100644 --- a/.ssh/config +++ b/.ssh/config @@ -1,5 +1,6 @@ IdentityFile ~/.ssh/id_ed25519_sk IdentityFile ~/.ssh/id_ed25519_sk_secondary +IdentityFile ~/.ssh/id_rsa Host gon ControlMaster auto