Tidy up keybindings and organize plugin files for nvim

Setup lsp

Organize tmux conf
This commit is contained in:
ItaloBorrelli 2025-05-05 11:59:19 -07:00
parent 0cbec58d0c
commit b6ef39529c
18 changed files with 206 additions and 267 deletions

View File

@ -1,10 +1,10 @@
-- Initialize lazy.nvim
require("config.lazy")
-- Set leader key
-- Setup leader keys before loading lazy.nvim
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Initialize lazy.nvim
require("config.lazy")
-- Source other configuration files
require("keybindings")
require("settings")

View File

@ -1,35 +1,37 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
spec = {
-- import your plugins
{ import = "plugins" },
{ import = "plugins.file_navigation" },
{ import = "plugins.language_support" },
{ import = "plugins.lsp" },
{ import = "plugins.ui" },
{ import = "plugins.util" },
},
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
-- don't notify on changes to configs
change_detection = { enabled = false },
})

View File

@ -0,0 +1,14 @@
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
opts.desc = "Navigate window left"
map("n", "<leader>h", "<C-w>h", opts)
opts.desc = "Navigate window down"
map("n", "<leader>j", "<C-w>j", opts)
opts.desc = "Navigate window up"
map("n", "<leader>k", "<C-w>k", opts)
opts.desc = "Navigate window right"
map("n", "<leader>l", "<C-w>l", opts)

View File

@ -1,22 +0,0 @@
return {
"romgrk/barbar.nvim",
dependencies = {
"lewis6991/gitsigns.nvim", -- OPTIONAL: for git status
"nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons
},
keys = {
{ "<Tab>", "<cmd>BufferNext<cr>", desc = "next tab" },
{ "<S-Tab>", "<cmd>BufferPrevious<cr>", desc = "previous tab" },
{ "<leader>x", "<cmd>BufferClose<cr>", desc = "close tab" },
},
init = function()
vim.g.barbar_auto_setup = false
end,
config = function()
require("barbar").setup({
animation = true,
auto_hide = true,
clickable = true,
})
end,
}

View File

@ -1,58 +0,0 @@
return {
{
"stevearc/conform.nvim",
config = function()
local conform = require("conform")
conform.setup({
formatters_by_ft = {
lua = { "stylua" },
nginx = { "nginxfmt" },
yaml = { "yamlfix" },
-- Use the "*" filetype to run formatters on all filetypes.
-- ["*"] = { "codespell" },
},
format_on_save = {
-- Enable or disable auto-formatting on save
lua = true,
nginx = true,
yaml = true,
},
-- Set this to change the default values when calling conform.format()
-- This will also affect the default values for format_on_save/format_after_save
default_format_opts = {
lsp_format = "fallback",
},
-- If this is set, Conform will run the formatter on save.
-- It will pass the table to conform.format().
-- This can also be a function that returns the table.
format_on_save = {
-- I recommend these options. See :help conform.format for details.
lsp_format = "fallback",
timeout_ms = 500,
},
-- If this is set, Conform will run the formatter asynchronously after save.
-- It will pass the table to conform.format().
-- This can also be a function that returns the table.
format_after_save = {
lsp_format = "fallback",
},
-- Set the log level. Use `:ConformInfo` to see the location of the log file.
log_level = vim.log.levels.ERROR,
-- Conform will notify you when a formatter errors
notify_on_error = true,
-- Conform will notify you when no formatters are available for the buffer
notify_no_formatters = true,
})
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 500,
})
end, { desc = "Format file or range (in visual mode)" })
end,
},
}

View File

@ -1,49 +0,0 @@
return {
{
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
config = function()
local mason = require("mason")
local mason_lspconfig = require("mason-lspconfig")
local mason_tool_installer = require("mason-tool-installer")
local null_ls = require("null-ls")
-- Enable mason and configure icons
mason.setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = "",
},
},
})
mason_lspconfig.setup({
ensure_installed = {
"cssls",
"dockerls",
"html",
"jsonls",
"lua_ls",
"vimls",
"yamlls",
},
})
mason_tool_installer.setup({
ensure_installed = {
"codespell",
"nginx-config-formatter",
"stylua",
"yamlfix",
"yamllint",
},
})
end,
},
}

View File

@ -1,26 +0,0 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
requires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- for file icons
"MunifTanjim/nui.nvim",
},
config = function()
require("neo-tree").setup({
filesystem = {
filtered_items = {
visible = true, -- Hide files and folders starting with a dot `.`
hide_dotfiles = false,
hide_gitignored = false,
},
},
})
vim.api.nvim_set_keymap(
"n",
"<leader>e",
":Neotree toggle<CR>",
{ noremap = true, silent = true }
)
end,
}

View File

@ -1,3 +0,0 @@
return {
"MunifTanjim/nui.nvim",
}

View File

@ -1,12 +0,0 @@
return {
"nvim-treesitter/nvim-treesitter",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"lua",
},
highlight = { enable = true },
indent = { enable = true },
})
end,
}

View File

@ -1,3 +0,0 @@
return {
"nvim-lua/plenary.nvim",
}

View File

@ -1,9 +1,74 @@
return {
"rebelot/kanagawa.nvim",
lazy = false, -- Ensure the plugin is loaded on startup
priority = 1000, -- Load this plugin first to apply the color scheme early
config = function()
-- Set the Kanagawa color scheme
vim.cmd("colorscheme kanagawa")
end,
{
"comfysage/cuddlefish.nvim",
config = function()
require("cuddlefish").setup({
theme = {
accent = "pink",
},
editor = {
transparent_background = false,
},
style = {
tabline = { "reverse" },
search = { "italic", "reverse" },
incsearch = { "italic", "reverse" },
types = { "italic" },
keyword = { "italic" },
comment = { "italic" },
},
})
end,
},
{ "maxmx03/dracula.nvim" },
{
"rebelot/kanagawa.nvim",
},
{ "2giosangmitom/nightfall.nvim" },
{
"olimorris/onedarkpro.nvim",
},
{ "pauchiner/pastelnight.nvim" },
{ "numToStr/Sakura.nvim" },
{
"folke/tokyonight.nvim",
},
{
"yorumicolors/yorumi.nvim",
},
{
"zaldih/themery.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd("colorscheme deeper-night")
local themery = require("themery")
themery.setup({
-- List of swappable colorschemes.
themes = {
"cuddlefish",
"deeper-night",
"onedark_dark",
"dracula",
"yorumi",
"nord",
"tokyonight-moon",
"kanagawa-dragon",
"sakura",
"pastelnight",
},
livePreview = true, -- Apply theme while picking. Default to true.
})
themery.setThemeByIndex(1, true)
vim.keymap.set("n", "<leader>tt", function()
local numberOfThemes = #themery.getAvailableThemes()
local currentThemeIndex = themery.getCurrentTheme().index
local nextThemeIndex = (currentThemeIndex % numberOfThemes) + 1
themery.setThemeByIndex(nextThemeIndex, true)
end, { noremap = true })
end,
},
}

View File

@ -1,3 +0,0 @@
return {
"lambdalisue/vim-suda",
}

View File

@ -1,18 +0,0 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}

View File

@ -8,6 +8,6 @@ vim.o.smartindent = true -- Insert indents automatically
vim.filetype.add({
pattern = {
[".*/etc/nginx/.*/.*%.conf"] = "nginx",
[".*/etc/nginx/.*/.*%.conf"] = "nginx", -- Make conf files in the nginx folder can be formatted with nginx formatter
},
})

View File

@ -0,0 +1,35 @@
##################
### CATPPUCCIN ###
##################
set -g @catppuccin_flavor "frappe"
set -g status-right-length 100
set -g status-left-length 100
# Window
set -g @catppuccin_window_status_style "rounded"
run ~/.config/tmux/plugins/tmux/catppuccin.tmux
## Window global/default configuration
set -g @catppuccin_window_text " #W"
set -g @catppuccin_window_status "icon"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_number_position "left"
## Window current configuration
set -g @catppuccin_window_current_text " #W"
set -g @catppuccin_window_current_fill "all"
set -g @catppuccin_window_current_number_color "#{@thm_maroon}"
set -g @catppuccin_window_text_color "#{@thm_surface_0}"
set -g @catppuccin_window_number_color "#{@thm_rosewater}"
# Status
set -gF status-left ""
set -gF status-right "#{@catppuccin_status_session}"
set -agF status-right "#{@catppuccin_status_directory}"
set -agF status-right "#{@catppuccin_status_user}"
set -agF status-right "#{@catppuccin_status_host}"
set -agF status-right "#{E:@catppuccin_status_date_time}"

View File

@ -1,23 +1,19 @@
#############
### THEME ###
#############
###############
### PLUGINS ###
###############
set -g default-terminal "tmux-256color"
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tpm'
set -g @catppuccin_flavor "mocha" # latte, frappe, macchiato, or mocha
set -g @catppuccin_window_status_style "rounded" # basic, rounded, slanted, custom, or none
set -g status-right-length 100
set -g status-right "#{E:@catppuccin_status_application}#{E:@catppuccin_status_session}"
set -g status-left ""
################
### BINDINGS ###
################
## PREFIXED
### PREFIXED ###
# r : RELOAD
bind r source-file ~/.config/tmux/tmux.conf
@ -43,9 +39,11 @@ bind C-Down resize-pane -D 5 \; switch-client -T prefix
bind C-Up resize-pane -U 5 \; switch-client -T prefix
bind C-Right resize-pane -R 5 \; switch-client -T prefix
bind M-m select-pane -l
# Alt-c : CHANGE SESSION ROOT DIR
bind M-c attach-session -c "#{pane_current_path}"
## UNPREFIXED
### UNPREFIXED ###
# Alt-arrow : SWITCH PANES
bind -n M-Left select-pane -L
@ -62,6 +60,7 @@ bind -n M-l select-pane -R
# Alt-z : FULL SCREEN
bind -n M-z resize-pane -Z
################
### SETTINGS ###
################
@ -79,7 +78,10 @@ set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
## Vi mode copying
#######################
### VI MODE COPYING ###
#######################
# Enable Vi keybindings in copy mode
set-window-option -g mode-keys vi
@ -93,8 +95,17 @@ bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel
# Bind 'Y' to copy the entire buffer to the system clipboard
bind-key -T copy-mode-vi Y send -X copy-pipe-and-cancel
##################
### LOCAL CONF ###
##################
############
### LOAD ###
############
# Catppuccin conf
source-file ~/.config/tmux/catppuccin.conf
# Local conf if using
if-shell "[ -f ~/.config/tmux/local.tmux.conf ]" "source-file ~/.config/tmux/local.tmux.conf"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# Install with git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
run ~/.config/tmux/plugins/tpm/tpm

5
.gitignore vendored
View File

@ -4,10 +4,13 @@
# Except
!.config/hypr/*
!.config/neofetch/*
!.config/nvim/init.lua
!.config/nvim/lua/*
!.config/tmux/*
!.config/tmux/tmux.conf
!.config/tmux/catppuccin.conf
.config/tmux/local.tmux.config
!.config/waybar/*

View File

@ -200,15 +200,15 @@
# Transparent background.
typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=
# Green prompt symbol if the last command succeeded.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=2
# Red prompt symbol if the last command failed.
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=196
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=1
# Default prompt symbol.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION=''
# Prompt symbol in command vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION=''
# Prompt symbol in visual vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='V'
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION=''
# Prompt symbol in overwrite vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶'
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true
@ -221,9 +221,9 @@
##################################[ dir: current directory ]##################################
# Current directory background color.
typeset -g POWERLEVEL9K_DIR_BACKGROUND=4
typeset -g POWERLEVEL9K_DIR_BACKGROUND=15
# Default current directory foreground color.
typeset -g POWERLEVEL9K_DIR_FOREGROUND=254
typeset -g POWERLEVEL9K_DIR_FOREGROUND=8
# If directory is too long, shorten some of its segments to the shortest possible unique
# prefix. The shortened directory can be tab-completed to the original.
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
@ -233,7 +233,7 @@
typeset -g POWERLEVEL9K_DIR_SHORTENED_FOREGROUND=250
# Color of the anchor directory segments. Anchor segments are never shortened. The first
# segment is always an anchor.
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=255
typeset -g POWERLEVEL9K_DIR_ANCHOR_FOREGROUND=8
# Display anchor directory segments in bold.
typeset -g POWERLEVEL9K_DIR_ANCHOR_BOLD=true
# Don't shorten directories that contain any of these files. They are anchors.
@ -362,17 +362,20 @@
#####################################[ vcs: git status ]######################################
# Version control background colors.
typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND=2
typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=3
typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=2
typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=3
typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND=5
typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND=10
typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND=1
typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND=8
# Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon.
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON='\uF126 '
# Untracked files icon. It's really a question mark, your font isn't broken.
# Change the value of this parameter to show a different icon.
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='?'
# Git status icons
typeset -g POWERLEVEL9K_VCS_UNTRACKED_ICON='🗐 '
typeset -g POWERLEVEL9K_VCS_UNSTAGED_ICON='✪ '
typeset -g POWERLEVEL9K_VCS_STAGED_ICON='✚ '
typeset -g POWERLEVEL9K_VCS_STASH_ICON='⚑ '
typeset -g POWERLEVEL9K_VCS_CONFLICT_ICON='×'
# Formatter for Git status.
#
@ -455,15 +458,15 @@
# ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42.
(( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}${VCS_STATUS_PUSH_COMMITS_AHEAD}"
# *42 if have stashes.
(( VCS_STATUS_STASHES )) && res+=" ${clean}*${VCS_STATUS_STASHES}"
(( VCS_STATUS_STASHES )) && res+=" ${clean}${POWERLEVEL9K_VCS_CONFLICT_ICON}${POWERLEVEL9K_VCS_STASH_ICON}${VCS_STATUS_STASHES}"
# 'merge' if the repo is in an unusual state.
[[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
# ~42 if have merge conflicts.
(( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}~${VCS_STATUS_NUM_CONFLICTED}"
(( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}${POWERLEVEL9K_VCS_STAGED_ICON}${POWER}${VCS_STATUS_NUM_CONFLICTED}"
# +42 if have staged changes.
(( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}+${VCS_STATUS_NUM_STAGED}"
(( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}${POWERLEVEL9K_VCS_STAGED_ICON}${VCS_STATUS_NUM_STAGED}"
# !42 if have unstaged changes.
(( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}!${VCS_STATUS_NUM_UNSTAGED}"
(( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}${POWERLEVEL9K_VCS_UNSTAGED_ICON}${VCS_STATUS_NUM_UNSTAGED}"
# ?42 if have untracked files. It's really a question mark, your font isn't broken.
# See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
# Remove the next line if you don't want to see untracked files at all.
@ -1758,7 +1761,7 @@
####################################[ time: current time ]####################################
# Current time color.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=0
typeset -g POWERLEVEL9K_TIME_BACKGROUND=7
typeset -g POWERLEVEL9K_TIME_BACKGROUND=15
# Format for the current time: 09:51:02. See `man 3 strftime`.
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# If set to true, time will update when you hit enter. This way prompts for the past