diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2025-04-20 08:53:06 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2025-04-20 08:53:06 -0400 |
| commit | 46104afebb5fa61a059652b1682ddf6b80e83d37 (patch) | |
| tree | 1f16872989139c1d2a5af00c1db2694dbcb1285e | |
| parent | update configs (diff) | |
| download | dotfiles-46104afebb5fa61a059652b1682ddf6b80e83d37.zip | |
Update dotfiles
| -rw-r--r-- | .config/nvim/init.lua | 452 | ||||
| -rw-r--r-- | .config/nvim/plugin/packer_compiled.lua | 189 | ||||
| -rw-r--r-- | .tmux.conf | 1 | ||||
| -rw-r--r-- | README.md | 9 | ||||
| -rwxr-xr-x | bin/yt-download-mp3 | 6 | ||||
| -rwxr-xr-x | executables/bin/gh-clone-all (renamed from bin/gh-clone-all) | 0 | ||||
| -rw-r--r-- | gdb/.gdbinit (renamed from .gdbinit) | 1 | ||||
| -rw-r--r-- | ghostty/.config/ghostty/config | 52 | ||||
| -rw-r--r-- | git/.gitconfig (renamed from .gitconfig) | 7 | ||||
| -rw-r--r-- | gpg/gpg-agent.conf (renamed from gpg-agent.conf) | 0 | ||||
| -rw-r--r-- | homebrew/Brewfile | 17 | ||||
| -rwxr-xr-x | install.sh | 171 | ||||
| -rw-r--r-- | nvim/.config/nvim/init.lua | 4 | ||||
| -rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 3 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/autocmds.lua | 3 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/keymaps.lua | 2 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/lazy.lua | 24 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/options.lua | 20 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/colorscheme.lua | 11 | ||||
| -rw-r--r-- | nvim/.config/nvim/stylua.toml | 7 | ||||
| -rw-r--r-- | tmux/.tmux.conf | 61 | ||||
| -rwxr-xr-x | zsh/.zshrc (renamed from .zshrc) | 10 |
22 files changed, 274 insertions, 776 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua deleted file mode 100644 index efbf222..0000000 --- a/.config/nvim/init.lua +++ /dev/null @@ -1,452 +0,0 @@ -vim.g.mapleader = " " -vim.opt.scrolloff = 10 -vim.g.python3_host_prog = "/Users/eugene/.pyenv/versions/3.11.5/bin/python" -vim.opt.visualbell = true -vim.opt.encoding = "utf-8" -vim.opt.fileencoding = "utf-8" -vim.opt.number = true -vim.opt.linebreak = true -vim.opt.splitbelow = true -vim.opt.splitright = true -vim.opt.shiftwidth = 4 -vim.opt.backspace = { "indent", "eol", "start" } -vim.cmd("filetype plugin indent on") - --- Whitespace settings per filetype -vim.api.nvim_create_autocmd("FileType", { - pattern = "python", - command = "setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4", -}) - -vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { - pattern = "*.go", - command = "setlocal noet tabstop=4 shiftwidth=4 softtabstop=4", -}) - -vim.api.nvim_create_autocmd("FileType", { - pattern = { "javascript", "typescript", "java", "rust", "c", "cpp", "lua" }, - command = "setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2", -}) - --- Automatically install packer.nvim if not installed -local ensure_packer = function() - local fn = vim.fn - local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" - if fn.empty(fn.glob(install_path)) > 0 then - fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path }) - vim.cmd([[packadd packer.nvim]]) - return true - end - return false -end - -local packer_bootstrap = ensure_packer() - --- Autocommand to reload Neovim whenever you save the init.lua -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost init.lua source <afile> | PackerSync - augroup end -]]) - --- Plugin manager setup using packer.nvim -require("packer").startup(function(use) - -- Packer can manage itself - use("wbthomason/packer.nvim") - - -- Auto complete - use("neovim/nvim-lspconfig") - use("hrsh7th/nvim-cmp") - use("hrsh7th/cmp-nvim-lsp") - use("hrsh7th/cmp-buffer") - use("hrsh7th/cmp-path") - use("hrsh7th/cmp-cmdline") - - -- Telescope for advanced searching - use({ - "nvim-telescope/telescope.nvim", - tag = "0.1.8", - requires = { { "nvim-lua/plenary.nvim" } }, - }) - - -- Telescope FZF extension - use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) - - -- Tags-based plugin for searching symbols - use("ludovicchabant/vim-gutentags") - - -- Git gutter - use("airblade/vim-gitgutter") - - -- Status bar - use("nvim-lualine/lualine.nvim") - - -- Git wrapper with :G - use("tpope/vim-fugitive") - - -- GitHub vim fugitive plugin - use("tpope/vim-rhubarb") - - -- Editorconfig file support - use("editorconfig/editorconfig-vim") - - -- Theme - use("sainnhe/everforest") - - -- Go support - use({ "fatih/vim-go", run = ":GoUpdateBinaries" }) - - -- Treesitter for better syntax highlighting - use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) - - -- File explorer - use("kyazdani42/nvim-tree.lua") - - -- LSP Installer - use("williamboman/mason.nvim") - use("williamboman/mason-lspconfig.nvim") - - -- Install luasnip and friendly-snippets - use({ - "L3MON4D3/LuaSnip", - requires = { "rafamadriz/friendly-snippets" }, - }) - - use({ - "jose-elias-alvarez/null-ls.nvim", - requires = { "nvim-lua/plenary.nvim" }, - }) - - use("chaoren/vim-wordmotion") - - -- Terminal - use({ "akinsho/toggleterm.nvim", tag = "v2.12.0" }) - - use({ - "amrbashir/nvim-docs-view", - opt = true, - cmd = { "DocsViewToggle" }, - config = function() - require("docs-view").setup({ - position = "right", - width = 50, - }) - end, - }) - - use({ - "ellisonleao/glow.nvim", - config = function() - require("glow").setup({ - width = 120 - }) - end, - }) - - -- Automatically set up configuration after cloning packer.nvim - -- This should be kept at the end after all plugins - if packer_bootstrap then - require("packer").sync() - end -end) - --- Null ls setup -local null_ls = require("null-ls") - -null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - }, -}) - --- Treesitter setup -require("nvim-treesitter.configs").setup({ - ensure_installed = { - "c", - "cpp", - "go", - "python", - "javascript", - "typescript", - "java", - "rust", - "lua", - }, - highlight = { - enable = true, - }, - incremental_selection = { - enable = true, - }, - indent = { - enable = true, - }, -}) - --- Lualine setup -require("lualine").setup({ - options = { - theme = "everforest", - section_separators = { "", "" }, - component_separators = { "", "" }, - }, -}) - --- Nvim-tree setup -require("nvim-tree").setup({ - view = { - side = "left", - width = 30, - }, - actions = { - open_file = { - quit_on_open = false, - }, - }, -}) - --- Mason setup -require("mason").setup() -require("mason-lspconfig").setup({ - ensure_installed = { "clangd", "pyright", "gopls", "ts_ls", "rust_analyzer", "jdtls", "lua_ls" }, -}) - --- Setup luasnip with nvim-cmp -local cmp = require("cmp") -local luasnip = require("luasnip") - -require("luasnip.loaders.from_vscode").lazy_load() - -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = { - ["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }), - ["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }), - ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), - ["<C-y>"] = cmp.config.disable, - ["<C-e>"] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - ["<CR>"] = cmp.mapping.confirm({ select = true }), - ["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }), - ["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }), - }, - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "treesitter" }, - { name = "buffer" }, - { name = "path" }, - }), -}) - --- Setup lspconfig. -local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) - -local lspconfig = require("lspconfig") -local lsp_servers = { "clangd", "pyright", "gopls", "ts_ls", "rust_analyzer", "jdtls", "lua_ls" } - -lspconfig.lua_ls.setup({ - settings = { - Lua = { - runtime = { - version = "LuaJIT", - -- Lua path - path = vim.split(package.path, ";"), - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { "vim" }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - telemetry = { - enable = false, - }, - }, - }, -}) - -for _, lsp in ipairs(lsp_servers) do - if lsp ~= "lua_ls" then - lspconfig[lsp].setup({ - capabilities = capabilities, - }) - end -end - --- Telescope setup -require("telescope").setup({ - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - prompt_prefix = "> ", - selection_caret = "> ", - path_display = { "smart" }, - }, - pickers = { - find_files = { - theme = "dropdown", - }, - live_grep = { - theme = "dropdown", - }, - buffers = { - theme = "dropdown", - }, - help_tags = { - theme = "dropdown", - }, - }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, -}) - -require("telescope").load_extension("fzf") - --- Theme setup -vim.opt.termguicolors = true -vim.g.everforest_background = "soft" -vim.g.everforest_better_performance = 1 -vim.g.everforest_disable_italic_comment = 1 -vim.cmd("colorscheme everforest") - --- Syntax highlighting -vim.cmd("syntax on") - --- Terminal setup -require("toggleterm").setup({ - size = 20, - open_mapping = [[<c-\>]], -- Toggle terminal with Ctrl-\ - hide_numbers = true, - shade_filetypes = {}, - shade_terminals = true, - shading_factor = "1", -- The degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light - start_in_insert = true, - insert_mappings = true, -- Whether or not the open mapping applies in insert mode - persist_size = true, - direction = "horizontal", -- 'vertical' | 'horizontal' | 'window' | 'float' - close_on_exit = true, -- Close the terminal window when the process exits - shell = vim.o.shell, -- Change the default shell - float_opts = { - border = "curved", -- 'single' | 'double' | 'shadow' | 'curved' - winblend = 0, - highlights = { - border = "Normal", - background = "Normal", - }, - }, -}) - ---- Key mappings - --- Telescope 'Find Files' -vim.api.nvim_set_keymap( - "n", - "<leader>ff", - ":Telescope find_files find_command=rg,--ignore,--hidden,--files,--glob=!**/.git<CR>", - { noremap = true, silent = true } -) --- Telescope 'Find Grep' for text search -vim.api.nvim_set_keymap("n", "<leader>fg", ":Telescope live_grep<CR>", { noremap = true, silent = true }) --- Telescope 'Find symbols' -vim.api.nvim_set_keymap("n", "<leader>fs", ":Telescope lsp_document_symbols<CR>", { noremap = true, silent = true }) --- Telescope 'Find Workspace Symbols' -- Finds all symbols across the workspace rather than a single file -vim.api.nvim_set_keymap( - "n", - "<leader>fw", - ":Telescope lsp_dynamic_workspace_symbols<CR>", - { noremap = true, silent = true } -) --- Telescope 'Find buffers' -vim.api.nvim_set_keymap("n", "<leader>fb", ":Telescope buffers<CR>", { noremap = true, silent = true }) - --- Telescope 'Format' -- Formats the current file asyncronously -vim.api.nvim_set_keymap( - "n", - "<leader>lf", - ":lua vim.lsp.buf.format({ async = true })<CR>", - { noremap = true, silent = true } -) - --- 'Git status' -vim.api.nvim_set_keymap("n", "<leader>gs", ":G<CR>", { noremap = true, silent = true }) --- 'Git diff' -vim.api.nvim_set_keymap("n", "<leader>gd", ":Gdiff<CR>", { noremap = true, silent = true }) --- 'Git diff --staged' -vim.api.nvim_set_keymap("n", "<leader>gds", ":Gdiff --staged<CR>", { noremap = true, silent = true }) - --- Toggle/Update docs view -vim.api.nvim_set_keymap("n", "<leader>dt", ":DocsViewToggle<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<leader>du", ":DocsViewUpdate<CR>", { noremap = true, silent = true }) - --- Close the current window -vim.api.nvim_set_keymap("n", "<leader>q", ":q<CR>", { noremap = true, silent = true }) --- Save the current file -vim.api.nvim_set_keymap("n", "<leader>w", ":w<CR>", { noremap = true, silent = true }) - -vim.api.nvim_set_keymap("i", "<C-k>", "<cmd>lua require'luasnip'.jump(1)<CR>", { silent = true }) -vim.api.nvim_set_keymap("i", "<C-j>", "<cmd>lua require'luasnip'.jump(-1)<CR>", { silent = true }) -vim.api.nvim_set_keymap("s", "<C-k>", "<cmd>lua require'luasnip'.jump(1)<CR>", { silent = true }) -vim.api.nvim_set_keymap("s", "<C-j>", "<cmd>lua require'luasnip'.jump(-1)<CR>", { silent = true }) - --- Mappings for opening terminals -vim.api.nvim_set_keymap("n", "<leader>tt", ":ToggleTerm<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap( - "n", - "<leader>th", - ":ToggleTerm size=15 direction=horizontal<CR>", - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "<leader>tv", - ":ToggleTerm size=60 direction=vertical<CR>", - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap("n", "<leader>tf", ":ToggleTerm direction=float<CR>", { noremap = true, silent = true }) --- Increase terminal height -vim.api.nvim_set_keymap("n", "<leader>+", ":resize +5<CR>", { noremap = true, silent = true }) --- Decrease terminal height -vim.api.nvim_set_keymap("n", "<leader>-", ":resize -5<CR>", { noremap = true, silent = true }) --- Increase terminal width (for vertical terminals) -vim.api.nvim_set_keymap("n", "<leader>>", ":vertical resize +5<CR>", { noremap = true, silent = true }) --- Decrease terminal width (for vertical terminals) -vim.api.nvim_set_keymap("n", "<leader><", ":vertical resize -5<CR>", { noremap = true, silent = true }) --- Map <Esc> in terminal mode to exit to normal mode -vim.api.nvim_set_keymap("t", "<Esc>", "<C-\\><C-n>", { noremap = true, silent = true }) - --- Use Ctrl-[hjkl] to navigate between splits -vim.api.nvim_set_keymap("n", "<C-k>", ":wincmd k<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<C-j>", ":wincmd j<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<C-h>", ":wincmd h<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<C-l>", ":wincmd l<CR>", { noremap = true, silent = true }) - -vim.api.nvim_set_keymap("n", "<leader>e", ":NvimTreeToggle<CR>", { noremap = true, silent = true }) -vim.api.nvim_set_keymap("n", "<leader><space>", ":noh<CR>", { noremap = true, silent = true }) - --- Key mapping to preview markdown -vim.api.nvim_set_keymap("n", "<leader>mp", ":Glow<CR>", { noremap = true, silent = true }) diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua deleted file mode 100644 index 5160679..0000000 --- a/.config/nvim/plugin/packer_compiled.lua +++ /dev/null @@ -1,189 +0,0 @@ --- Automatically generated packer.nvim plugin loader code - -if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then - vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') - return -end - -vim.api.nvim_command('packadd packer.nvim') - -local no_errors, error_msg = pcall(function() - -_G._packer = _G._packer or {} -_G._packer.inside_compile = true - -local time -local profile_info -local should_profile = false -if should_profile then - local hrtime = vim.loop.hrtime - profile_info = {} - time = function(chunk, start) - if start then - profile_info[chunk] = hrtime() - else - profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 - end - end -else - time = function(chunk, start) end -end - -local function save_profiles(threshold) - local sorted_times = {} - for chunk_name, time_taken in pairs(profile_info) do - sorted_times[#sorted_times + 1] = {chunk_name, time_taken} - end - table.sort(sorted_times, function(a, b) return a[2] > b[2] end) - local results = {} - for i, elem in ipairs(sorted_times) do - if not threshold or threshold and elem[2] > threshold then - results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' - end - end - if threshold then - table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') - end - - _G._packer.profile_output = results -end - -time([[Luarocks path setup]], true) -local package_path_str = "/Users/eugene/.cache/nvim/packer_hererocks/2.1.1720049189/share/lua/5.1/?.lua;/Users/eugene/.cache/nvim/packer_hererocks/2.1.1720049189/share/lua/5.1/?/init.lua;/Users/eugene/.cache/nvim/packer_hererocks/2.1.1720049189/lib/luarocks/rocks-5.1/?.lua;/Users/eugene/.cache/nvim/packer_hererocks/2.1.1720049189/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/Users/eugene/.cache/nvim/packer_hererocks/2.1.1720049189/lib/lua/5.1/?.so" -if not string.find(package.path, package_path_str, 1, true) then - package.path = package.path .. ';' .. package_path_str -end - -if not string.find(package.cpath, install_cpath_pattern, 1, true) then - package.cpath = package.cpath .. ';' .. install_cpath_pattern -end - -time([[Luarocks path setup]], false) -time([[try_loadstring definition]], true) -local function try_loadstring(s, component, name) - local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) - if not success then - vim.schedule(function() - vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) - end) - end - return result -end - -time([[try_loadstring definition]], false) -time([[Defining packer_plugins]], true) -_G.packer_plugins = { - ["cmp-buffer"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/cmp-buffer", - url = "https://github.com/hrsh7th/cmp-buffer" - }, - ["cmp-cmdline"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/cmp-cmdline", - url = "https://github.com/hrsh7th/cmp-cmdline" - }, - ["cmp-nvim-lsp"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", - url = "https://github.com/hrsh7th/cmp-nvim-lsp" - }, - ["cmp-path"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/cmp-path", - url = "https://github.com/hrsh7th/cmp-path" - }, - ["editorconfig-vim"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/editorconfig-vim", - url = "https://github.com/editorconfig/editorconfig-vim" - }, - everforest = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/everforest", - url = "https://github.com/sainnhe/everforest" - }, - fzf = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/fzf", - url = "https://github.com/junegunn/fzf" - }, - ["fzf.vim"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/fzf.vim", - url = "https://github.com/junegunn/fzf.vim" - }, - ["lualine.nvim"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/lualine.nvim", - url = "https://github.com/nvim-lualine/lualine.nvim" - }, - ["mason-lspconfig.nvim"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", - url = "https://github.com/williamboman/mason-lspconfig.nvim" - }, - ["mason.nvim"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/mason.nvim", - url = "https://github.com/williamboman/mason.nvim" - }, - ["nvim-cmp"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/nvim-cmp", - url = "https://github.com/hrsh7th/nvim-cmp" - }, - ["nvim-lspconfig"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", - url = "https://github.com/neovim/nvim-lspconfig" - }, - ["nvim-tree.lua"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", - url = "https://github.com/kyazdani42/nvim-tree.lua" - }, - ["nvim-treesitter"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/nvim-treesitter", - url = "https://github.com/nvim-treesitter/nvim-treesitter" - }, - ["packer.nvim"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/packer.nvim", - url = "https://github.com/wbthomason/packer.nvim" - }, - ["vim-fugitive"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/vim-fugitive", - url = "https://github.com/tpope/vim-fugitive" - }, - ["vim-gitgutter"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/vim-gitgutter", - url = "https://github.com/airblade/vim-gitgutter" - }, - ["vim-go"] = { - loaded = true, - path = "/Users/eugene/.local/share/nvim/site/pack/packer/start/vim-go", - url = "https://github.com/fatih/vim-go" - } -} - -time([[Defining packer_plugins]], false) - -_G._packer.inside_compile = false -if _G._packer.needs_bufread == true then - vim.cmd("doautocmd BufRead") -end -_G._packer.needs_bufread = false - -if should_profile then save_profiles() end - -end) - -if not no_errors then - error_msg = error_msg:gsub('"', '\\"') - vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') -end diff --git a/.tmux.conf b/.tmux.conf deleted file mode 100644 index 207d7e8..0000000 --- a/.tmux.conf +++ /dev/null @@ -1 +0,0 @@ -set -g mouse on @@ -4,12 +4,11 @@ Personal dotfiles. ## Installation - To get the repo and install the dotfiles, you'll want to do a git clone and run the included shell script. ``` -$ git clone git@github.com:eugenetriguba/dotfiles.git -$ cd dotfiles -$ chmod u+x install.sh -$ ./install.sh +git clone git@github.com:eugenetriguba/dotfiles.git +cd dotfiles +chmod u+x install.sh +./install.sh ``` diff --git a/bin/yt-download-mp3 b/bin/yt-download-mp3 deleted file mode 100755 index 8f5e144..0000000 --- a/bin/yt-download-mp3 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -for url in "$@"; do - yt-dlp -x --audio-format mp3 "$url" -done - diff --git a/bin/gh-clone-all b/executables/bin/gh-clone-all index 742189b..742189b 100755 --- a/bin/gh-clone-all +++ b/executables/bin/gh-clone-all @@ -1 +1,2 @@ set disassembly-flavor intel + diff --git a/ghostty/.config/ghostty/config b/ghostty/.config/ghostty/config new file mode 100644 index 0000000..92e8963 --- /dev/null +++ b/ghostty/.config/ghostty/config @@ -0,0 +1,52 @@ +# This is the configuration file for Ghostty. +# +# This template file has been automatically created at the following +# path since Ghostty couldn't find any existing config files on your system: +# +# /Users/eugene/Library/Application Support/com.mitchellh.ghostty/config +# +# The template does not set any default options, since Ghostty ships +# with sensible defaults for all options. Users should only need to set +# options that they want to change from the default. +# +# Run `ghostty +show-config --default --docs` to view a list of +# all available config options and their default values. +# +# Additionally, each config option is also explained in detail +# on Ghostty's website, at https://ghostty.org/docs/config. + +# Config syntax crash course +# ========================== +# # The config file consists of simple key-value pairs, +# # separated by equals signs. +# font-family = Iosevka +# window-padding-x = 2 +# +# # Spacing around the equals sign does not matter. +# # All of these are identical: +# key=value +# key= value +# key =value +# key = value +# +# # Any line beginning with a # is a comment. It's not possible to put +# # a comment after a config option, since it would be interpreted as a +# # part of the value. For example, this will have a value of "#123abc": +# background = #123abc +# +# # Empty values are used to reset config keys to default. +# key = +# +# # Some config options have unique syntaxes for their value, +# # which is explained in the docs for that config option. +# # Just for example: +# resize-overlay-duration = 4s 200ms + +theme = tokionight +font-family = "Hack" +font-size = 14 + +keybind = cmd+/=new_split:right +keybind = cmd+.=new_split:down +keybind = global:cmd+shift+t=toggle_quick_terminal + diff --git a/.gitconfig b/git/.gitconfig index c0d0551..11cc75f 100644 --- a/.gitconfig +++ b/git/.gitconfig @@ -3,11 +3,9 @@ email = eugenetriguba@gmail.com signingkey = E2C90ACA3CC16B98 [core] - editor = vim + editor = nvim whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol excludesfile = ~/.gitignore -[alias] - undo = reset HEAD~ [pull] ff = only [fetch] @@ -21,6 +19,3 @@ [gpg] program = gpg -[credential "https://github.gatech.edu"] - helper = - helper = !/opt/homebrew/bin/gh auth git-credential diff --git a/gpg-agent.conf b/gpg/gpg-agent.conf index ccfe41d..ccfe41d 100644 --- a/gpg-agent.conf +++ b/gpg/gpg-agent.conf diff --git a/homebrew/Brewfile b/homebrew/Brewfile index 8c30d62..f5f631c 100644 --- a/homebrew/Brewfile +++ b/homebrew/Brewfile @@ -5,6 +5,7 @@ brew "act" brew "ansible" brew "bat" brew "bats-core" +brew "bolt" brew "bgpstream" brew "ca-certificates" brew "clang-format" @@ -14,7 +15,6 @@ brew "colima" brew "composer" brew "coreutils" brew "curl" -brew "eugenetriguba/bolt/bolt" brew "fd" brew "ffmpeg" brew "fzf" @@ -49,7 +49,7 @@ brew "openssl@3" brew "pinentry-mac" brew "pipx" brew "poetry" -brew "postgresql@14" +brew "postgresql" brew "pre-commit" brew "pyenv" brew "pyenv-virtualenv" @@ -66,6 +66,7 @@ brew "speedtest-cli" brew "splint" brew "stylua" brew "telnet" +brew "tmux" brew "terraform" brew "tldr" brew "tree" @@ -75,30 +76,20 @@ brew "xz" brew "yt-dlp" brew "zlib" cask "1password" -cask "anki" -cask "calibre" -cask "discord" cask "docker" cask "elgato-control-center" -cask "figma" cask "firefox" cask "font-hack-nerd-font" cask "font-inter" cask "font-menlo-for-powerline" cask "google-chrome" +cask "ghostty" cask "iterm2" cask "logi-options-plus" cask "mullvadvpn" cask "obsidian" cask "omnifocus" cask "pocket-casts" -cask "qbittorrent" cask "raycast" cask "rectangle" -cask "rstudio" -cask "signal" cask "spotify" -cask "transmission" -cask "vagrant" -cask "visual-studio-code" -cask "zotero" @@ -1,5 +1,5 @@ #!/bin/sh -# +# # Install the Homebrew Brewfile and setup symbolic links to the # dotfiles. # @@ -8,15 +8,18 @@ # If the install was not successful, exits with a # 1 status code. install_homebrew() { - /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> $HOME/.zprofile - eval "$(/opt/homebrew/bin/brew shellenv)" - - homebrew_exists=$(command -v brew) - if test -z "$homebrew_exists"; then - echo "Failed to install homebrew" - exit 1 - fi + /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + ( + echo + echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' + ) >>$HOME/.zprofile + eval "$(/opt/homebrew/bin/brew shellenv)" + + homebrew_exists=$(command -v brew) + if test -z "$homebrew_exists"; then + echo "Failed to install homebrew" + exit 1 + fi } # Prompt the user for confirmation on an action. @@ -28,108 +31,78 @@ install_homebrew() { # Returns: # 0 on yes. 1 on no. prompt_for_confirmation() { - printf "$1 [y/n]: " - read answer - if [ "$answer" != "${answer#[Yy]}" ]; then - return 0 - else - return 1 - fi + printf "$1 [y/n]: " + read answer + if [ "$answer" != "${answer#[Yy]}" ]; then + return 0 + else + return 1 + fi } ensure_symlink_exists() { - source_path="$1" - link_path="$2" + source_path="$1" + link_path="$2" - echo "Checking link to '$link_path'.." - if [ -L $link_path ]; then - if [ -e $link_path ]; then - echo "Valid '$link_path' link exists." - else - echo "'$link_path' link exists, but it is a broken link." - prompt_for_confirmation "Delete and relink?" - answer=$? - if [ $answer -eq 0 ]; then - rm -r "$link_path" || exit 1 - ln -s "$source_path" "$link_path" || exit 1 - echo "Successfully created link to '$link_path'" - else - echo "Leaving file alone, moving on.." - fi - fi - elif [ -e $link_path ]; then - echo "'$link_path' exists, but it isn't a symbolic link file." - prompt_for_confirmation "Delete and relink?" - answer=$? - if [ $answer -eq 0 ]; then - rm -r "$link_path" || exit 1 - ln -s "$source_path" "$link_path" || exit 1 - echo "Successfully created link to '$link_path'" - else - echo "Leaving file alone, moving on.." - fi + echo "Checking link to '$link_path'.." + if [ -L $link_path ]; then + if [ -e $link_path ]; then + echo "Valid '$link_path' link exists." else - echo "Link to '$link_path' does not exist. Creating.." + echo "'$link_path' link exists, but it is a broken link." + prompt_for_confirmation "Delete and relink?" + answer=$? + if [ $answer -eq 0 ]; then + rm -r "$link_path" || exit 1 ln -s "$source_path" "$link_path" || exit 1 + echo "Successfully created link to '$link_path'" + else + echo "Leaving file alone, moving on.." + fi fi -} - -install_packer() { - echo "Installing packer.nvim.." - if [ ! -d "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then - git clone --depth 1 https://github.com/wbthomason/packer.nvim \ - "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" + elif [ -e $link_path ]; then + echo "'$link_path' exists, but it isn't a symbolic link file." + prompt_for_confirmation "Delete and relink?" + answer=$? + if [ $answer -eq 0 ]; then + rm -r "$link_path" || exit 1 + ln -s "$source_path" "$link_path" || exit 1 + echo "Successfully created link to '$link_path'" else - echo "packer.nvim is already installed." + echo "Leaving file alone, moving on.." fi + else + echo "Link to '$link_path' does not exist. Creating.." + ln -s "$source_path" "$link_path" || exit 1 + fi } main() { - has_homebrew=$(command -v brew) - if test -z "$has_homebrew"; then - prompt_for_confirmation "I couldn't find a homebrew installation. Would you like to install homebrew?" - answer=$? - if [ $answer -eq 0 ]; then - install_homebrew - else - echo "Exiting, can't continue without homebrew installed." - exit 0 - fi + has_homebrew=$(command -v brew) + if test -z "$has_homebrew"; then + prompt_for_confirmation "I couldn't find a homebrew installation. Would you like to install homebrew?" + answer=$? + if [ $answer -eq 0 ]; then + install_homebrew + else + echo "Exiting, can't continue without homebrew installed." + exit 0 fi - - echo "Found homebrew installation. Installing Brewfile.." - (cd homebrew && brew bundle || exit 1) - - echo "Brewfile successfully installed. Moving to linking dotfiles.." - - echo "Linking bin.." - mkdir "$HOME/src" - ensure_symlink_exists "$PWD/bin" "$HOME/src/bin" - - echo "Linking gdb init.." - ensure_symlink_exists "$PWD/.gdbinit" "$HOME/.gdbinit" - - echo "Linking git config.." - ensure_symlink_exists "$PWD/.gitconfig" "$HOME/.gitconfig" - - echo "Linking tmux config.." - ensure_symlink_exists "$PWD/.tmux.conf" "$HOME/.tmux.conf" - - echo "Linking zshrc.." - ensure_symlink_exists "$PWD/.zshrc" "$HOME/.zshrc" - - echo "Linked gpg agent config.." - mkdir -p $HOME/gnupg - ensure_symlink_exists "$PWD/gpg-agent.conf" "$HOME/gnupg/gpg-agent.conf" - gpgconf --kill gpg-agent # Reload the GPG agent - - echo "Linking vim config.." - mkdir -p $HOME/.config/nvim - ensure_symlink_exists "$PWD/.config/nvim/init.lua" "$HOME/.config/nvim/init.lua" - - install_packer - echo "Running PackerSync to install plugins.." - nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' + fi + + echo "Found homebrew installation. Installing Brewfile.." + (cd homebrew && brew bundle || exit 1) + echo "Brewfile successfully installed. Moving to linking dotfiles.." + + stow executables + stow nvim + stow zsh + stow git + stow gdb + stow gpg + stow tmux + stow ghostty + echo "Successfully linked all dotfiles." } main diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua new file mode 100644 index 0000000..44471a6 --- /dev/null +++ b/nvim/.config/nvim/init.lua @@ -0,0 +1,4 @@ +require("config.options") +require("config.keymaps") +require("config.autocmds") +require("config.lazy") diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json new file mode 100644 index 0000000..57d2f1e --- /dev/null +++ b/nvim/.config/nvim/lazy-lock.json @@ -0,0 +1,3 @@ +{ + "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" } +} diff --git a/nvim/.config/nvim/lua/config/autocmds.lua b/nvim/.config/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..e9a8b1b --- /dev/null +++ b/nvim/.config/nvim/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +local augroup = vim.api.nvim_create_augroup +local autocmd = vim.api.nvim_create_autocmd + diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..ee7c68b --- /dev/null +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -0,0 +1,2 @@ +vim.g.mapleader = "<Space>" +vim.g.maplocalleader = "\\" diff --git a/nvim/.config/nvim/lua/config/lazy.lua b/nvim/.config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..1e3f505 --- /dev/null +++ b/nvim/.config/nvim/lua/config/lazy.lua @@ -0,0 +1,24 @@ +-- 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 +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + install = { colorscheme = { "tokyonight" } }, + checker = { enabled = true }, -- Check for plugin updates automatically. +}) diff --git a/nvim/.config/nvim/lua/config/options.lua b/nvim/.config/nvim/lua/config/options.lua new file mode 100644 index 0000000..80522dc --- /dev/null +++ b/nvim/.config/nvim/lua/config/options.lua @@ -0,0 +1,20 @@ +local opt = vim.opt + +-- Line numbers +opt.number = true +opt.relativenumber = true + +-- Indentation +opt.expandtab = true +opt.smartindent = true +opt.shiftwidth = 2 +opt.tabstop = 2 + +-- Search +opt.ignorecase = true +opt.smartcase = true + +-- UI +opt.termguicolors = true +opt.signcolumn = "yes" +opt.cursorline = true diff --git a/nvim/.config/nvim/lua/plugins/colorscheme.lua b/nvim/.config/nvim/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..be7f5b8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/colorscheme.lua @@ -0,0 +1,11 @@ +return { + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = { style = "moon" }, + init = function() + vim.cmd([[colorscheme tokyonight]]) + end, + } +} diff --git a/nvim/.config/nvim/stylua.toml b/nvim/.config/nvim/stylua.toml new file mode 100644 index 0000000..57334f3 --- /dev/null +++ b/nvim/.config/nvim/stylua.toml @@ -0,0 +1,7 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 +line_endings = "Unix" +quote_style = "AutoPreferSingle" +call_parentheses = "None" + diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..b18c61c --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,61 @@ +# Set terminal colors +set-option -sa terminal-overrides ",xterm*:Tc" + +# Enable mouse support +set -g mouse on + +# Start windows and panes at 1, not 0 +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +# kill pane +bind-key x kill-pane + +# Pane resizing +bind -n M-h resize-pane -L +bind -n M-l resize-pane -R +bind -n M-k resize-pane -U +bind -n M-j resize-pane -D + +# Move window to the left +bind -n M-i swap-window -t -1 + +# Move window to the right +bind -n M-o swap-window -t +1 + +# Set vi mode +set-window-option -g mode-keys vi + +# Use visual selection mode as vi +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel + +# Save and restore session +set -g @resurrect-save 'S' +set -g @resurrect-restore 'R' + +# Tmux theme +set -g @catppuccin_flavour 'mocha' +set -g @catppuccin_right_separator "█" +set -g @catppuccin_left_separator "█" + +TMUX_FZF_ORDER="session|window|pane|command|keybinding" +TMUX_FZF_OPTIONS="-p -w 90% -h 70% -m" + +# more options here: https://github.com/sainnhe/tmux-fzf/issues/6#issuecomment-578750879 +bind w run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/window.sh switch" + +# Plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'sainnhe/tmux-fzf' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'oca159/catppuccin-tmux' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @resurrect-strategy-nvim 'session' + +run '~/.tmux/plugins/tpm/tpm' @@ -19,7 +19,7 @@ export PAGER="less" export GPG_TTY=$(tty) export SRC_DIR="$HOME/src" -export BIN_DIR="$SRC_DIR/bin" +export BIN_DIR="$HOME/bin" export PATH="$BIN_DIR:$PATH" export PATH="$HOME/.poetry/bin:$PATH" @@ -42,7 +42,7 @@ eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" export PNPM_HOME="/Users/eugene/Library/pnpm" case ":$PATH:" in @@ -50,9 +50,11 @@ case ":$PATH:" in *) export PATH="$PNPM_HOME:$PATH" ;; esac +eval "$(brew shellenv)" export LDFLAGS="-L/opt/homebrew/lib" export CPPFLAGS="-I/opt/homebrew/include" export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib" +export PATH="/opt/homebrew/opt/curl/bin:$PATH" alias gs="git status" alias gc="git commit" @@ -72,9 +74,7 @@ alias h="history 25" alias j="jobs -l" alias l="ls -alG" +alias lg="lazygit" alias vi="nvim" alias vim="nvim" -alias vicfg="nvim ~/.config/nvim/init.lua" - -alias python="python3" |