diff --git a/.gitconfig b/.gitconfig index 4fb06ec..439cf21 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,3 +1 @@ base/git -base/nvim -base/tmux diff --git a/base/Dockerfile b/base/Dockerfile index 8881333..68eaf29 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -46,7 +46,7 @@ COPY tmux/tmux.conf /home/x/.tmux.conf # Should already be installed for Yay but repeating stuff to keep everything in blocks RUN sudo pacman -S --noconfirm git RUN mkdir -p /home/x/.config/git -COPY git/gitconfig /home/x/.gitconfig +#COPY ~/.gitconfig /home/x/.gitconfig COPY git/confs/ /home/x/.config/git/ ## Tofu diff --git a/base/git/gitconfig b/base/git/gitconfig deleted file mode 100644 index 15c2eeb..0000000 --- a/base/git/gitconfig +++ /dev/null @@ -1,11 +0,0 @@ -[includeIf "gitdir:/home/x/Projects/xestro/"] - path = ~/.config/git/xestro.conf - -[includeIf "gitdir:/home/x/Projects/repobase/"] - path = ~/.config/git/repobase.conf - -[includeIf "gitdir:/home/x/Projects/gitlab/"] - path = ~/.config/git/gitlab.conf - -[includeIf "gitdir:/home/x/Projects/github/"] - path = ~/.config/git/github.conf diff --git a/base/nvim/init.lua b/base/nvim/init.lua new file mode 100644 index 0000000..fb28bf7 --- /dev/null +++ b/base/nvim/init.lua @@ -0,0 +1,240 @@ +-- Bootstrap lazy.nvim if it's not installed +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim", lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-- Plugin setup using lazy.nvim +require("lazy").setup({ + + { + "voldikss/vim-floaterm", + lazy = false, + }, + { + "preservim/nerdtree", + lazy = false, + }, + { + "junegunn/vim-easy-align", + lazy = false, + }, + + + {'akinsho/toggleterm.nvim', version = "*", config = true}, + + { + "folke/tokyonight.nvim", + lazy = false, -- load immediately + priority = 1000, -- make sure it loads first + config = function() + require("tokyonight").setup({ + style = "night", + transparent = true, + }) + vim.cmd("colorscheme tokyonight") + end + }, + + { + "neovim/nvim-lspconfig", + config = function() + -- Basic on_attach function for keybindings + local on_attach = function(_, bufnr) + local opts = { noremap = true, silent = true, buffer = bufnr } + local keymap = vim.keymap.set + + keymap("n", "gd", vim.lsp.buf.definition, opts) + keymap("n", "K", vim.lsp.buf.hover, opts) + keymap("n", "rn", vim.lsp.buf.rename, opts) + keymap("n", "ca", vim.lsp.buf.code_action, opts) + keymap("n", "gr", vim.lsp.buf.references, opts) + end + + -- Basic LSP servers setup + local lspconfig = require("lspconfig") + + -- Example: Python (pyright) + lspconfig.pyright.setup { + on_attach = on_attach, + } + + -- Example: TypeScript/JavaScript (tsserver) + lspconfig.ts_ls.setup { + on_attach = on_attach, + } + + -- Example: Lua (for Neovim config dev) + lspconfig.lua_ls.setup { + on_attach = on_attach, + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + }, + }, + } + + lspconfig.dockerls.setup { + on_attach = on_attach, + } + + lspconfig.terraformls.setup { + on_attach = on_attach, + } + + lspconfig.phpactor.setup { + on_attach = on_attach, + cmd = { "phpactor", "language-server" }, + filetypes = { "php" }, + root_dir = lspconfig.util.root_pattern("composer.json", ".git"), + } + + end + }, + + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", -- snippet engine + "saadparwaiz1/cmp_luasnip", -- snippet completions + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + + cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + -- Confirm selection (only if one is explicitly selected) + [''] = cmp.mapping(function(fallback) + if cmp.visible() and cmp.get_selected_entry() then + cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) + else + fallback() + end + end, { 'i', 's' }), + + -- Navigate the menu + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { 'i', 's' }), + + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { 'i', 's' }), + }, + -- Avoid auto-selecting the first item + completion = { + completeopt = 'menu,menuone,noinsert', + }, + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }), + }) + end + }, + + { + "williamboman/mason.nvim", + config = true + }, + { + "williamboman/mason-lspconfig.nvim", + dependencies = { "mason.nvim", "neovim/nvim-lspconfig" }, + config = function() + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { "lua_ls" }, -- this installs lua-language-server + }) + end, + }, + + { + 'lewis6991/gitsigns.nvim', + config = function() + require('gitsigns').setup({ + current_line_blame = true, + current_line_blame_opts = { + delay = 300, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + }, + current_line_blame_formatter = ', - ', + }) + end, + } + + +}) + +-- Set key +vim.g.mapleader = " " + +-- Floaterm appearance (optional) +vim.g.floaterm_width = 0.9 +vim.g.floaterm_height = 0.85 +vim.g.floaterm_borderchars = '─│─│╭╮╯╰' + +-- g: open Floaterm running lazygit +vim.keymap.set("n", "g", function() + vim.cmd("FloatermNew --name=lazygit --autoclose=2 lazygit") +end, { noremap = true, silent = true }) + +-- : toggle NERDTree in current window +vim.keymap.set("n", "", ":NERDTreeToggle", { noremap = true, silent = true }) + +-- EasyAlign key mappings +vim.keymap.set("x", "ga", ":EasyAlign", { noremap = true, silent = true }) +vim.keymap.set("n", "ga", "(EasyAlign)") + +require("toggleterm").setup { + open_mapping = [[]], + direction = "horizontal", -- or "float" or "vertical" + start_in_insert = true, + insert_mappings = true, + terminal_mappings = true, + close_on_exit = true, + shell = vim.o.shell -- use your default shell +} + +-- Set 2 spaces and no tabs for Terraform files +vim.api.nvim_create_autocmd("FileType", { + pattern = "terraform", + callback = function() + vim.bo.expandtab = true -- use spaces instead of tabs + vim.bo.shiftwidth = 2 -- size of an indent + vim.bo.softtabstop = 2 -- number of spaces per + end, +}) + +vim.opt.clipboard = "unnamedplus" +vim.opt.termguicolors = true +vim.opt.signcolumn = "yes" + + +vim.opt.number = true -- Enable absolute line numbers +vim.opt.relativenumber = false -- Disable relative line numbers +vim.opt.colorcolumn = "80" diff --git a/base/tmux/tmux.conf b/base/tmux/tmux.conf new file mode 100644 index 0000000..9d0233e --- /dev/null +++ b/base/tmux/tmux.conf @@ -0,0 +1,61 @@ +# vim:set ft=tmux: + +# --> Catppuccin (Mocha) +set -ogq @thm_bg "#1e1e2e" +set -ogq @thm_fg "#cdd6f4" + +# Colors +set -ogq @thm_rosewater "#f5e0dc" +set -ogq @thm_flamingo "#f2cdcd" +set -ogq @thm_pink "#f5c2e7" +set -ogq @thm_mauve "#cba6f7" +set -ogq @thm_red "#f38ba8" +set -ogq @thm_maroon "#eba0ac" +set -ogq @thm_peach "#fab387" +set -ogq @thm_yellow "#f9e2af" +set -ogq @thm_green "#a6e3a1" +set -ogq @thm_teal "#94e2d5" +set -ogq @thm_sky "#89dceb" +set -ogq @thm_sapphire "#74c7ec" +set -ogq @thm_blue "#89b4fa" +set -ogq @thm_lavender "#b4befe" + +# Surfaces and overlays +set -ogq @thm_subtext_1 "#a6adc8" +set -ogq @thm_subtext_0 "#bac2de" +set -ogq @thm_overlay_2 "#9399b2" +set -ogq @thm_overlay_1 "#7f849c" +set -ogq @thm_overlay_0 "#6c7086" +set -ogq @thm_surface_2 "#585b70" +set -ogq @thm_surface_1 "#45475a" +set -ogq @thm_surface_0 "#313244" +set -ogq @thm_mantle "#181825" +set -ogq @thm_crust "#11111b" + +# Enable mouse mode +set -g mouse on + +# Set status bar at bottom (default) +set -g status-position bottom + +# Center window list +set -g status-justify centre + +# Style the status bar with your theme +set -g status-bg '#1e1e2e' +set -g status-fg '#cdd6f4' + +# Active window style +set-window-option -g window-status-current-style "bg=#313244,fg=#cba6f7,bold" +set-window-option -g window-status-current-format " #I:#W " + +# Inactive windows style +set-window-option -g window-status-style "bg=#1e1e2e,fg=#7f849c" +set-window-option -g window-status-format " #I:#W " + +# Left/right status sections (can be empty or decorated) +set -g status-left "" +set -g status-right "" + + +set -g xterm-keys on