From 4a9fef89815889507b812ef1e39f0396a679a584 Mon Sep 17 00:00:00 2001 From: Wayne-Cole <77279425+Wacky404@users.noreply.github.com> Date: Sun, 15 Dec 2024 22:55:39 -0600 Subject: cleanup: adding in and removing dirs to .config --- .config/.workloggerconfig.json | 54 +++++++ .config/borders/bordersrc | 33 +++++ .config/fastfetch/config.jsonc | 34 +++++ .config/nvim/after/ftplugin/c.lua | 5 + .config/nvim/init.lua | 41 +++--- .config/nvim/lua/cole/core/colorscheme.lua | 38 ----- .config/nvim/lua/cole/core/keymaps.lua | 76 ---------- .config/nvim/lua/cole/core/options.lua | 41 ------ .config/nvim/lua/cole/plugins-setup.lua | 167 --------------------- .config/nvim/lua/cole/plugins/autopairs.lua | 30 ---- .config/nvim/lua/cole/plugins/comment.lua | 6 - .config/nvim/lua/cole/plugins/dadbod-setup.lua | 7 - .config/nvim/lua/cole/plugins/formatter.lua | 65 --------- .config/nvim/lua/cole/plugins/gitsigns.lua | 8 - .config/nvim/lua/cole/plugins/linter-setup.lua | 16 -- .config/nvim/lua/cole/plugins/lsp/lspconfig.lua | 81 ----------- .config/nvim/lua/cole/plugins/lsp/lspsaga.lua | 19 --- .config/nvim/lua/cole/plugins/lsp/mason.lua | 38 ----- .config/nvim/lua/cole/plugins/lualine.lua | 6 - .config/nvim/lua/cole/plugins/nvim-cmp.lua | 53 ------- .config/nvim/lua/cole/plugins/nvim-tree.lua | 63 -------- .config/nvim/lua/cole/plugins/telescope.lua | 25 ---- .config/nvim/lua/cole/plugins/transparent.lua | 40 ----- .config/nvim/lua/cole/plugins/treesitter.lua | 34 ----- .config/nvim/lua/cole/plugins/vimtex-setup.lua | 34 ----- .config/nvim/lua/wacky/core/colorscheme.lua | 38 +++++ .config/nvim/lua/wacky/core/keymaps.lua | 79 ++++++++++ .config/nvim/lua/wacky/core/options.lua | 41 ++++++ .config/nvim/lua/wacky/plugins-setup.lua | 177 +++++++++++++++++++++++ .config/nvim/lua/wacky/plugins/autopairs.lua | 30 ++++ .config/nvim/lua/wacky/plugins/comment.lua | 6 + .config/nvim/lua/wacky/plugins/dadbod-setup.lua | 6 + .config/nvim/lua/wacky/plugins/dap-setup.lua | 15 ++ .config/nvim/lua/wacky/plugins/formatter.lua | 64 ++++++++ .config/nvim/lua/wacky/plugins/gitsigns.lua | 8 + .config/nvim/lua/wacky/plugins/linter-setup.lua | 16 ++ .config/nvim/lua/wacky/plugins/lsp/lspconfig.lua | 85 +++++++++++ .config/nvim/lua/wacky/plugins/lsp/lspsaga.lua | 19 +++ .config/nvim/lua/wacky/plugins/lsp/mason.lua | 38 +++++ .config/nvim/lua/wacky/plugins/lualine.lua | 6 + .config/nvim/lua/wacky/plugins/nvim-cmp.lua | 61 ++++++++ .config/nvim/lua/wacky/plugins/nvim-tree.lua | 63 ++++++++ .config/nvim/lua/wacky/plugins/telescope.lua | 25 ++++ .config/nvim/lua/wacky/plugins/transparent.lua | 40 +++++ .config/nvim/lua/wacky/plugins/treesitter.lua | 34 +++++ .config/nvim/lua/wacky/plugins/vimtex-setup.lua | 34 +++++ .config/nvim/plugin/packer_compiled.lua | 19 ++- .config/sketchybar/colors.lua | 1 + .config/sketchybar/items/widgets/stocks.lua | 16 ++ .config/sketchybar/settings.lua | 4 +- .config/sketchybar_backup/plugins/battery.sh | 28 ++++ .config/sketchybar_backup/plugins/clock.sh | 7 + .config/sketchybar_backup/plugins/front_app.sh | 10 ++ .config/sketchybar_backup/plugins/space.sh | 7 + .config/sketchybar_backup/plugins/volume.sh | 20 +++ .config/sketchybar_backup/sketchybarrc | 91 ++++++++++++ 56 files changed, 1231 insertions(+), 871 deletions(-) create mode 100644 .config/.workloggerconfig.json create mode 100755 .config/borders/bordersrc create mode 100644 .config/fastfetch/config.jsonc create mode 100644 .config/nvim/after/ftplugin/c.lua delete mode 100644 .config/nvim/lua/cole/core/colorscheme.lua delete mode 100644 .config/nvim/lua/cole/core/keymaps.lua delete mode 100644 .config/nvim/lua/cole/core/options.lua delete mode 100644 .config/nvim/lua/cole/plugins-setup.lua delete mode 100644 .config/nvim/lua/cole/plugins/autopairs.lua delete mode 100644 .config/nvim/lua/cole/plugins/comment.lua delete mode 100644 .config/nvim/lua/cole/plugins/dadbod-setup.lua delete mode 100644 .config/nvim/lua/cole/plugins/formatter.lua delete mode 100644 .config/nvim/lua/cole/plugins/gitsigns.lua delete mode 100644 .config/nvim/lua/cole/plugins/linter-setup.lua delete mode 100644 .config/nvim/lua/cole/plugins/lsp/lspconfig.lua delete mode 100644 .config/nvim/lua/cole/plugins/lsp/lspsaga.lua delete mode 100644 .config/nvim/lua/cole/plugins/lsp/mason.lua delete mode 100644 .config/nvim/lua/cole/plugins/lualine.lua delete mode 100644 .config/nvim/lua/cole/plugins/nvim-cmp.lua delete mode 100644 .config/nvim/lua/cole/plugins/nvim-tree.lua delete mode 100644 .config/nvim/lua/cole/plugins/telescope.lua delete mode 100644 .config/nvim/lua/cole/plugins/transparent.lua delete mode 100644 .config/nvim/lua/cole/plugins/treesitter.lua delete mode 100644 .config/nvim/lua/cole/plugins/vimtex-setup.lua create mode 100644 .config/nvim/lua/wacky/core/colorscheme.lua create mode 100644 .config/nvim/lua/wacky/core/keymaps.lua create mode 100644 .config/nvim/lua/wacky/core/options.lua create mode 100644 .config/nvim/lua/wacky/plugins-setup.lua create mode 100644 .config/nvim/lua/wacky/plugins/autopairs.lua create mode 100644 .config/nvim/lua/wacky/plugins/comment.lua create mode 100644 .config/nvim/lua/wacky/plugins/dadbod-setup.lua create mode 100644 .config/nvim/lua/wacky/plugins/dap-setup.lua create mode 100644 .config/nvim/lua/wacky/plugins/formatter.lua create mode 100644 .config/nvim/lua/wacky/plugins/gitsigns.lua create mode 100644 .config/nvim/lua/wacky/plugins/linter-setup.lua create mode 100644 .config/nvim/lua/wacky/plugins/lsp/lspconfig.lua create mode 100644 .config/nvim/lua/wacky/plugins/lsp/lspsaga.lua create mode 100644 .config/nvim/lua/wacky/plugins/lsp/mason.lua create mode 100644 .config/nvim/lua/wacky/plugins/lualine.lua create mode 100644 .config/nvim/lua/wacky/plugins/nvim-cmp.lua create mode 100644 .config/nvim/lua/wacky/plugins/nvim-tree.lua create mode 100644 .config/nvim/lua/wacky/plugins/telescope.lua create mode 100644 .config/nvim/lua/wacky/plugins/transparent.lua create mode 100644 .config/nvim/lua/wacky/plugins/treesitter.lua create mode 100644 .config/nvim/lua/wacky/plugins/vimtex-setup.lua create mode 100644 .config/sketchybar/items/widgets/stocks.lua create mode 100755 .config/sketchybar_backup/plugins/battery.sh create mode 100755 .config/sketchybar_backup/plugins/clock.sh create mode 100755 .config/sketchybar_backup/plugins/front_app.sh create mode 100755 .config/sketchybar_backup/plugins/space.sh create mode 100755 .config/sketchybar_backup/plugins/volume.sh create mode 100755 .config/sketchybar_backup/sketchybarrc diff --git a/.config/.workloggerconfig.json b/.config/.workloggerconfig.json new file mode 100644 index 0000000..c4ca21c --- /dev/null +++ b/.config/.workloggerconfig.json @@ -0,0 +1,54 @@ +{ + "savepath": "Documents/GitHub/worklogger/Output/", + "backuppath": "Documents/worklogger/", + "fileformat": "csv", + "loglvl": "Warning", + "jobs": [ + { + "name": "great company", + "projects": [ + { + "proj 1": "null", + "proj 2": "0987654321", + "proj 3": "1234567890" + } + ] + }, + { + "name": "not so great company", + "projects": [ + { + "codename: secrete": "404", + "govwork": "902753203", + "exemplary": "9023hdalw903" + } + ] + }, + { + "name": "UASYS", + "projects": [ + { + "General": "anything", + "EI": "Educational Institution" + } + ] + }, + { + "name": "Paces", + "projects": [ + { + "Interconnection": "InterConnection Queue" + } + ] + }, + { + "name": "EPRI", + "projects": [ + { + "GridFast": "12345", + "Exemplar": "12345" + } + ] + } + ] +} diff --git a/.config/borders/bordersrc b/.config/borders/bordersrc new file mode 100755 index 0000000..4d11a72 --- /dev/null +++ b/.config/borders/bordersrc @@ -0,0 +1,33 @@ +#!/bin/bash + +# options for borders +# colors are in ... +orange_brown=0xffC46210 +light_blue=0xffC9FFE5 +blood=0xFF8A0303 +black=0xff181819 +white=0xffe2e2e3 +red=0xfffc5d7c +blood=0xFF8A0303 +green=0xff9ed072 +blue=0xff76cce0 +cog_blue=0xff6a97b8 +yellow=0xffe7c664 +orange=0xfff39660 +orange_brown=0xffC46210 +magenta=0xffb39df3 +grey=0xff7f8490 +pink=0xffffc0cb +purple=0xff8a00c2 +transparent=0x00000000 + + +options=( + # square; other option + style=round + width=10.0 + hidpi=off + active_color=0xffffc0cb + inactive_color=0xff8a00c2 +) +borders "${options[@]}" diff --git a/.config/fastfetch/config.jsonc b/.config/fastfetch/config.jsonc new file mode 100644 index 0000000..1b83845 --- /dev/null +++ b/.config/fastfetch/config.jsonc @@ -0,0 +1,34 @@ +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "modules": [ + //"title", + //"separator", + "os", + "host", + "kernel", + "uptime", + "packages", + "shell", + //"display", + "de", + "wm", + "wmtheme", + //"theme", + //"icons", + //"font", + //"cursor", + "terminal", + "terminalfont", + "cpu", + "gpu", + "memory", + "swap", + "disk", + //"localip", + //"battery", + "poweradapter", + //"locale", + "break", + "colors" + ] +} diff --git a/.config/nvim/after/ftplugin/c.lua b/.config/nvim/after/ftplugin/c.lua new file mode 100644 index 0000000..7e76438 --- /dev/null +++ b/.config/nvim/after/ftplugin/c.lua @@ -0,0 +1,5 @@ +local opt = vim.opt_local -- for conciseness + +-- tabs and indention +opt.tabstop = 2 +opt.shiftwidth = 2 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b12b9b7..f94783d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,20 +1,21 @@ -require("cole.plugins-setup") -require("cole.core.options") -require("cole.core.keymaps") -require("cole.core.colorscheme") -require("cole.plugins.transparent") -require("cole.plugins.comment") -require("cole.plugins.nvim-tree") -require("cole.plugins.lualine") -require("cole.plugins.telescope") -require("cole.plugins.nvim-cmp") -require("cole.plugins.lsp.mason") -require("cole.plugins.lsp.lspsaga") -require("cole.plugins.lsp.lspconfig") -require("cole.plugins.autopairs") -require("cole.plugins.treesitter") -require("cole.plugins.gitsigns") -require("cole.plugins.formatter") -require("cole.plugins.vimtex-setup") -require("cole.plugins.linter-setup") -require("cole.plugins.dadbod-setup") +require("wacky.plugins-setup") +require("wacky.core.options") +require("wacky.core.keymaps") +require("wacky.core.colorscheme") +require("wacky.plugins.transparent") +require("wacky.plugins.comment") +require("wacky.plugins.nvim-tree") +require("wacky.plugins.lualine") +require("wacky.plugins.telescope") +require("wacky.plugins.nvim-cmp") +require("wacky.plugins.lsp.mason") +require("wacky.plugins.lsp.lspsaga") +require("wacky.plugins.lsp.lspconfig") +require("wacky.plugins.autopairs") +require("wacky.plugins.treesitter") +require("wacky.plugins.gitsigns") +require("wacky.plugins.formatter") +require("wacky.plugins.vimtex-setup") +require("wacky.plugins.linter-setup") +require("wacky.plugins.dadbod-setup") +require("wacky.plugins.dap-setup") diff --git a/.config/nvim/lua/cole/core/colorscheme.lua b/.config/nvim/lua/cole/core/colorscheme.lua deleted file mode 100644 index 9c35834..0000000 --- a/.config/nvim/lua/cole/core/colorscheme.lua +++ /dev/null @@ -1,38 +0,0 @@ -local status, err = pcall(vim.cmd, "colorscheme bluloco") -if not status then - print(err) - return -end - -require("bluloco").setup({ - style = "light", -- "auto" | "dark" | "light" - transparent = true, - italics = false, - terminal = vim.fn.has("gui_running") == 1, -- bluoco colors are enabled in gui terminals per default. - guicursor = true, -}) - --- require("tokyonight").setup({ --- -- your configuration comes here --- -- or leave it empty to use the default settings --- style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` --- light_style = "day", -- The theme is used when the background is set to light --- transparent = true, -- Enable this to disable setting the background color --- terminal_colors = false, -- Configure the colors used when opening a `:terminal` in [Neovim](https://github.com/neovim/neovim) --- styles = { --- -- Style to be applied to different syntax groups --- -- Value is any valid attr-list value for `:help nvim_set_hl` --- comments = { italic = true }, --- keywords = { italic = true }, --- functions = {}, --- variables = {}, --- -- Background styles. Can be "dark", "transparent" or "normal" --- sidebars = "transparent", -- style for sidebars, see below --- floats = "transparent", -- style for floating windows --- }, --- sidebars = { "terminal", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` --- day_brightness = 0.5, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors --- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. --- dim_inactive = false, -- dims inactive windows --- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold --- }) diff --git a/.config/nvim/lua/cole/core/keymaps.lua b/.config/nvim/lua/cole/core/keymaps.lua deleted file mode 100644 index 6d84f5a..0000000 --- a/.config/nvim/lua/cole/core/keymaps.lua +++ /dev/null @@ -1,76 +0,0 @@ --- set leader key to space -vim.g.mapleader = " " - -local keymap = vim.keymap -- for conciseness - ---------------------- --- General Keymaps ---------------------- - --- use jk to exit insert mode -keymap.set("i", "jk", "") - --- clear search highlights -keymap.set("n", "ch", ":nohl") - --- delete single character without copying into register -keymap.set("n", "x", '"_x') - --- increment/decrement numbers -keymap.set("n", "+", "") -- increment -keymap.set("n", "-", "") -- decrement - --- window management -keymap.set("n", "sv", "v") -- split window vertically -keymap.set("n", "sh", "s") -- split window horizontally -keymap.set("n", "se", "=") -- make split windows equal width & height -keymap.set("n", "sx", ":close") -- close current split window - --- terminal -vim.keymap.set("t", "", [[]]) - --- toggle-terminal -keymap.set("n", "tt", ":ToggleTerm dir=git_dir") ----------------------- --- keymap.set("n", "to", ":tabnew") -- open new tab --- keymap.set("n", "tx", ":tabclose") -- close current tab --- keymap.set("n", "tn", ":tabn") -- go to next tab --- keymap.set("n", "tp", ":tabp") -- go to previous tab ----------------------- - ----------------------- --- Plugin Keybinds ----------------------- - --- vim-maximizer -keymap.set("n", "sm", ":MaximizerToggle") -- toggle split window maximization - --- nvim-tree -keymap.set("n", "e", ":NvimTreeToggle") -- toggle file explorer - --- telescope -keymap.set("n", "ff", "Telescope find_files") -- find files within current working directory, respects .gitignore -keymap.set("n", "fs", "Telescope live_grep") -- find string in current working directory as you type -keymap.set("n", "fc", "Telescope grep_string") -- find string under cursor in current working directory -keymap.set("n", "fb", "Telescope buffers") -- list open buffers in current neovim instance -keymap.set("n", "fh", "Telescope help_tags") -- list available help tags - --- telescope git commands -keymap.set("n", "gc", "Telescope git_commits") -- list all git commits (use to checkout) ["gc" for git commits] -keymap.set("n", "gfc", "Telescope git_bcommits") -- list git commits for current file/buffer (use to checkout) ["gfc" for git file commits] -keymap.set("n", "gb", "Telescope git_branches") -- list git branches (use to checkout) ["gb" for git branch] -keymap.set("n", "gs", "Telescope git_status") -- list current changes per file with diff preview ["gs" for git status] - --- restart lsp server -keymap.set("n", "rs", ":LspRestart") -- mapping to restart lsp if necessary - --- DAP : basic commands --------------------------- ---keymap.set("n", "con", ":lua require('dap').continue()") -- continue the debugger ---keymap.set("n", "so", ":lua require('dap').step_over()") -- step over a line ---keymap.set("n", "si", ":lua require('dap').step_into()") -- step into a line ---keymap.set("n", "ol", ":lua require('dap').step_out()") -- step out of a line ---keymap.set("n", "tb", ":lua require'dap'.toggle_breakpoint())") -- toggle a breakpoint for debugger ---keymap.set("n", "b", ":lua require('dap').set_breakpoint()") -- make a breakpoint at a line ---keymap.set("n", "rl", ":lua require('dap').run_last()") -- run the last action --------------------------- diff --git a/.config/nvim/lua/cole/core/options.lua b/.config/nvim/lua/cole/core/options.lua deleted file mode 100644 index 7675260..0000000 --- a/.config/nvim/lua/cole/core/options.lua +++ /dev/null @@ -1,41 +0,0 @@ -local opt = vim.opt -- for conciseness - --- line numbers -opt.relativenumber = true -opt.number = true - --- tabs & indentation -opt.tabstop = 4 -opt.shiftwidth = 4 -opt.expandtab = true -opt.autoindent = true - --- line wrapping -opt.wrap = false - ---search settings -opt.ignorecase = true -opt.smartcase = true - --- cursor line -opt.cursorline = true - --- appearance -opt.termguicolors = true -opt.background = "dark" -opt.signcolumn = "yes" - --- backspace -opt.backspace = "indent,eol,start" - ---clipboard -opt.clipboard:append("unnamedplus") - --- split windows -opt.splitright = true -opt.splitbelow = true - -opt.iskeyword:append("-") - --- fold method -opt.foldmethod = "manual" diff --git a/.config/nvim/lua/cole/plugins-setup.lua b/.config/nvim/lua/cole/plugins-setup.lua deleted file mode 100644 index 5284389..0000000 --- a/.config/nvim/lua/cole/plugins-setup.lua +++ /dev/null @@ -1,167 +0,0 @@ --- auto install packer 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() -- true if packer was just installed - --- autocommand that reloads neovim and installs/updates/removes plugins --- when file is saved -vim.cmd([[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins-setup.lua source | PackerSync - augroup end -]]) - --- import packer safely -local status, packer = pcall(require, "packer") -if not status then - return -end - --- add list of plugins to install -return packer.startup(function(use) - -- packer can manage itself - use("wbthomason/packer.nvim") - - use("nvim-lua/plenary.nvim") -- lua functions that many plugins use - - -- transparent background - use("xiyaowong/transparent.nvim") - - -- Color Scheme is here!!! - use({ "uloco/bluloco.nvim", requires = { "rktjmp/lush.nvim" } }) -- preferred colorscheme atm - - use("christoomey/vim-tmux-navigator") -- tmux & split window navigation - - use("szw/vim-maximizer") -- maximizes and restores current window - - -- essential plugins - use("tpope/vim-surround") -- add, delete, change surroundings (it's awesome) - use("inkarkat/vim-ReplaceWithRegister") -- replace with register contents using motion (gr + motion) - - -- commenting with gc - use("numToStr/Comment.nvim") - - -- file explorer - use("nvim-tree/nvim-tree.lua") - - -- vs-code like icons - use("nvim-tree/nvim-web-devicons") - - -- statusline - use("nvim-lualine/lualine.nvim") - - -- fuzzy finding w/ telescope - use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) -- dependency for better sorting performance - use({ - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - }) -- fuzzy finder - - -- autocompletion - use("hrsh7th/nvim-cmp") -- completion plugin - use("hrsh7th/cmp-buffer") -- source for text in buffer - use("hrsh7th/cmp-path") -- source for file system paths - - -- snippets - use("L3MON4D3/LuaSnip") -- snippet engine - use("saadparwaiz1/cmp_luasnip") -- for autocompletion - use("rafamadriz/friendly-snippets") -- useful snippets - - -- managing & installing lsp servers, linters & formatters - use("williamboman/mason.nvim") -- in charge of managing lsp servers, linters & formatters - use("williamboman/mason-lspconfig.nvim") -- bridges gap b/w mason & lspconfig - use("mfussenegger/nvim-lint") -- installed because of mypy linter - - -- configuring lsp servers - use("neovim/nvim-lspconfig") -- easily configure language servers - use("hrsh7th/cmp-nvim-lsp") -- for autocompletion - use({ - "glepnir/lspsaga.nvim", - branch = "main", - requires = { - { "nvim-tree/nvim-web-devicons" }, - { "nvim-treesitter/nvim-treesitter" }, - }, - }) -- enhanced lsp uis - - -- vs-code like icons for autocompletion - use("onsails/lspkind.nvim") - - -- treesitter configuration - use({ - "nvim-treesitter/nvim-treesitter", - run = function() - local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) - ts_update() - end, - }) - - -- dadbod for Databases - use({ - "kristijanhusak/vim-dadbod-ui", - requires = { 'tpope/vim-dadbod' }, - dependencies = { - { 'kristijanhusak/vim-dadbod-completion', - ft = { 'sql' }, - cmd = { - 'DBUI', - 'DBUIToggle', - 'DBUIAddConnection', - 'DBUIFindBuffer', - }, - config = function() - -- place my small config changes here - vim.g.db_ui_use_nerd_fonts = 1 - end, - } }, - }) - - -- auto closing - use("windwp/nvim-autopairs") -- autoclose parens, brackets, quotes, etc... - use({ "windwp/nvim-ts-autotag", after = "nvim-treesitter" }) -- autoclose tags - - -- git integration - use("lewis6991/gitsigns.nvim") -- show line modifications on left hand side - - -- nvim-formatter - require("packer").use({ "mhartington/formatter.nvim" }) - - -- toggle terminal - use({ - "akinsho/toggleterm.nvim", - tag = "*", - config = function() - require("toggleterm").setup({ - size = 15, - direction = "horizontal", - autochdir = false, - }) - end, - }) - - -- Markdown Preview - use({ - "iamcco/markdown-preview.nvim", - run = "cd app && npm install", - setup = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - ft = { "markdown" }, - }) - - -- vimtex for LaTeX files - use("lervag/vimtex") - - if packer_bootstrap then - require("packer").sync() - end -end) diff --git a/.config/nvim/lua/cole/plugins/autopairs.lua b/.config/nvim/lua/cole/plugins/autopairs.lua deleted file mode 100644 index 19890bb..0000000 --- a/.config/nvim/lua/cole/plugins/autopairs.lua +++ /dev/null @@ -1,30 +0,0 @@ --- import nvim-autopairs safely -local autopairs_setup, autopairs = pcall(require, "nvim-autopairs") -if not autopairs_setup then - return -end - --- configure autopairs -autopairs.setup({ - check_ts = true, -- enable treesitter - ts_config = { - lua = { "string" }, -- don't add pairs in lua string treesitter nodes - javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes - java = false, -- don't check treesitter on java - }, -}) - --- import nvim-autopairs completion functionality safely -local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") -if not cmp_autopairs_setup then - return -end - --- import nvim-cmp plugin safely (completions plugin) -local cmp_setup, cmp = pcall(require, "cmp") -if not cmp_setup then - return -end - --- make autopairs and completion work together -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/.config/nvim/lua/cole/plugins/comment.lua b/.config/nvim/lua/cole/plugins/comment.lua deleted file mode 100644 index 89a3d62..0000000 --- a/.config/nvim/lua/cole/plugins/comment.lua +++ /dev/null @@ -1,6 +0,0 @@ -local setup, comment = pcall(require, "Comment") -if not setup then - return -end - -comment.setup() diff --git a/.config/nvim/lua/cole/plugins/dadbod-setup.lua b/.config/nvim/lua/cole/plugins/dadbod-setup.lua deleted file mode 100644 index 7af9cd5..0000000 --- a/.config/nvim/lua/cole/plugins/dadbod-setup.lua +++ /dev/null @@ -1,7 +0,0 @@ -local status, db_ui = pcall(require, "dadbod-ui") -if not status then - return -end - -vim.g.db_ui_variable_prefix = 'DB_' - diff --git a/.config/nvim/lua/cole/plugins/formatter.lua b/.config/nvim/lua/cole/plugins/formatter.lua deleted file mode 100644 index 84d503f..0000000 --- a/.config/nvim/lua/cole/plugins/formatter.lua +++ /dev/null @@ -1,65 +0,0 @@ --- Utilities for creating configurations -local util = require("formatter.util") - --- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands -require("formatter").setup({ - -- Enable or disable logging - logging = true, - -- Set the log level - log_level = vim.log.levels.WARN, - -- All formatter configurations are opt-in - filetype = { - -- current languges - python = { require("formatter.filetypes.python").autopep8 }, - cpp = { require("formatter.filetypes.cpp").clangformat }, - c = { require("formatter.filetypes.cpp").clangformat }, - latex = { require("formatter.filetypes.latex").latexindent }, - markdown = { require("formatter.filetypes.markdown").prettier }, - html = { require("formatter.filetypes.html").prettier }, - -- Formatter configurations for filetype "lua" go here - -- and will be executed in order - lua = { - -- "formatter.filetypes.lua" defines default configurations for the - -- "lua" filetype - require("formatter.filetypes.lua").stylua, - - -- You can also define your own configuration - function() - -- Supports conditional formatting - if util.get_current_buffer_file_name() == "special.lua" then - return nil - end - - -- Full specification of configurations is down below and in Vim help - -- files - return { - exe = "stylua", - args = { - "--search-parent-directories", - "--stdin-filepath", - util.escape_path(util.get_current_buffer_file_path()), - "--", - "-", - }, - stdin = true, - } - end, - }, - - -- Use the special "*" filetype for defining formatter configurations on - -- any filetype - ["*"] = { - -- "formatter.filetypes.any" defines default configurations for any - -- filetype - require("formatter.filetypes.any").remove_trailing_whitespace, - }, - }, -}) - -local augroup = vim.api.nvim_create_augroup -local autocmd = vim.api.nvim_create_autocmd -augroup("__formatter__", { clear = true }) -autocmd("BufWritePost", { - group = "__formatter__", - command = ":FormatWrite", -}) diff --git a/.config/nvim/lua/cole/plugins/gitsigns.lua b/.config/nvim/lua/cole/plugins/gitsigns.lua deleted file mode 100644 index 22f7ba6..0000000 --- a/.config/nvim/lua/cole/plugins/gitsigns.lua +++ /dev/null @@ -1,8 +0,0 @@ --- import gitsigns plugin safely -local setup, gitsigns = pcall(require, "gitsigns") -if not setup then - return -end - --- configure/enable gitsigns -gitsigns.setup() diff --git a/.config/nvim/lua/cole/plugins/linter-setup.lua b/.config/nvim/lua/cole/plugins/linter-setup.lua deleted file mode 100644 index 186cfb2..0000000 --- a/.config/nvim/lua/cole/plugins/linter-setup.lua +++ /dev/null @@ -1,16 +0,0 @@ --- specifies linter for each filetype -require("lint").linters_by_ft = { - python = { "mypy" }, -} - -vim.api.nvim_create_autocmd({ "BufWritePost" }, { - callback = function() - -- try_lint without arguments runs the linters defined in `linters_by_ft` - -- for the current filetype - require("lint").try_lint() - - -- You can call `try_lint` with a linter name or a list of names to always - -- run specific linters, independent of the `linters_by_ft` configuration - -- require("lint").try_lint("cspell") - end, -}) diff --git a/.config/nvim/lua/cole/plugins/lsp/lspconfig.lua b/.config/nvim/lua/cole/plugins/lsp/lspconfig.lua deleted file mode 100644 index 7ad20d3..0000000 --- a/.config/nvim/lua/cole/plugins/lsp/lspconfig.lua +++ /dev/null @@ -1,81 +0,0 @@ --- import lspconfig plugin safely -local lspconfig_status, lspconfig = pcall(require, "lspconfig") -if not lspconfig_status then - return -end - --- import cmp-nvim-lsp plugin safely -local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") -if not cmp_nvim_lsp_status then - return -end - -local keymap = vim.keymap -- for conciseness - --- enable keybinds only for when lsp server available -local on_attach = function(client, bufnr) - -- keybind options - local opts = { noremap = true, silent = true, buffer = bufnr } - - -- set keybinds - keymap.set("n", "gf", "Lspsaga lsp_finder", opts) -- show definition, references - keymap.set("n", "gD", "lua vim.lsp.buf.declaration()", opts) -- go to declaration - keymap.set("n", "gd", "Lspsaga peek_definition", opts) -- see definition and make edits in window - keymap.set("n", "gi", "lua vim.lsp.buf.implementation()", opts) -- go to implementation - keymap.set("n", "K", "lua vim.lsp.buf.hover()", opts) -- see variable in hover - keymap.set("n", "ca", "Lspsaga code_action", opts) -- see available code actions - keymap.set("n", "rn", "Lspsaga rename", opts) -- smart rename - keymap.set("n", "D", "Lspsaga show_line_diagnostics", opts) -- show diagnostics for line - keymap.set("n", "d", "Lspsaga show_cursor_diagnostics", opts) -- show diagnostics for cursor - keymap.set("n", "[d", "Lspsaga diagnostic_jump_prev", opts) -- jump to previous diagnostic in buffer - keymap.set("n", "]d", "Lspsaga diagnostic_jump_next", opts) -- jump to next diagnostic in buffer - keymap.set("n", "K", "Lspsaga hover_doc", opts) -- show documentation for what is under cursor - keymap.set("n", "o", "LSoutlineToggle", opts) -- see outline on right hand side -end - --- used to enable autocompletion (assign to every lsp server config) -local capabilities = cmp_nvim_lsp.default_capabilities() - --- Change the Diagnostic symbols in the sign column (gutter) --- (not in youtube nvim video) -local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " } -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) -end - -local servers = { - "clangd", - "arduino_language_server", - "ltex", - "jedi_language_server", - "biome", -} - -for _, lsp in pairs(servers) do - require("lspconfig")[lsp].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) -end - --- configure lua server (with special settings) -lspconfig["lua_ls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { -- custom settings for lua - Lua = { - -- make the language server recognize "vim" global - diagnostics = { - globals = { "vim" }, - }, - workspace = { - -- make language server aware of runtime files - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, -}) diff --git a/.config/nvim/lua/cole/plugins/lsp/lspsaga.lua b/.config/nvim/lua/cole/plugins/lsp/lspsaga.lua deleted file mode 100644 index 90f5d57..0000000 --- a/.config/nvim/lua/cole/plugins/lsp/lspsaga.lua +++ /dev/null @@ -1,19 +0,0 @@ --- import lspsaga safely -local saga_status, saga = pcall(require, "lspsaga") -if not saga_status then - return -end - -saga.setup({ - -- keybinds for navigation in lspsaga window - scroll_preview = { scroll_down = "", scroll_up = "" }, - -- use enter to open file with definition preview - definition = { - edit = "", - }, - ui = { - colors = { - normal_bg = "#022746", - }, - }, -}) diff --git a/.config/nvim/lua/cole/plugins/lsp/mason.lua b/.config/nvim/lua/cole/plugins/lsp/mason.lua deleted file mode 100644 index 5a71612..0000000 --- a/.config/nvim/lua/cole/plugins/lsp/mason.lua +++ /dev/null @@ -1,38 +0,0 @@ --- import mason plugin safely -local mason_status, mason = pcall(require, "mason") -if not mason_status then - return -end - --- import mason-lspconfig plugin safely -local mason_lspconfig_status, mason_lspconfig = pcall(require, "mason-lspconfig") -if not mason_lspconfig_status then - return -end - --- enable mason and configure icons -mason.setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", - }, - }, -}) - -mason_lspconfig.setup({ - -- list of servers for mason to install - ensure_installed = { - "lua_ls", - "clangd", - "arduino_language_server", - "ltex", - "jedi_language_server", - "html", - "tailwindcss", - "biome", - }, - -- auto-install configured servers (with lspconfig) - automatic_installation = true, -- not the same as ensure_installed -}) diff --git a/.config/nvim/lua/cole/plugins/lualine.lua b/.config/nvim/lua/cole/plugins/lualine.lua deleted file mode 100644 index 99425cd..0000000 --- a/.config/nvim/lua/cole/plugins/lualine.lua +++ /dev/null @@ -1,6 +0,0 @@ -local status, lualine = pcall(require, "lualine") -if not status then - return -end - -lualine.setup() diff --git a/.config/nvim/lua/cole/plugins/nvim-cmp.lua b/.config/nvim/lua/cole/plugins/nvim-cmp.lua deleted file mode 100644 index 2730814..0000000 --- a/.config/nvim/lua/cole/plugins/nvim-cmp.lua +++ /dev/null @@ -1,53 +0,0 @@ -local cmp_status, cmp = pcall(require, "cmp") -if not cmp_status then - return -end - -local luasnip_status, luasnip = pcall(require, "luasnip") -if not luasnip_status then - return -end - --- import lspkind plugin safely -local lspkind_status, lspkind = pcall(require, "lspkind") -if not lspkind_status then - return -end - --- load vs-code like snippets from plugins (e.g. friendly-snippets) -require("luasnip/loaders/from_vscode").lazy_load() - -vim.opt.completeopt = "menu,menuone,noselect" - -cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), -- previous suggestion - [""] = cmp.mapping.select_next_item(), -- next suggestion - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), -- show completion suggestions - [""] = cmp.mapping.abort(), -- close completion window - [""] = cmp.mapping.confirm({ select = false }), - }), - -- sources for autocompletion - sources = cmp.config.sources({ - { name = "nvim_lsp" }, -- lsp - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - { name = "spell" }, -- spell checker - { name = "treesitter" }, - }), - -- configure lspkind for vs-code like icons - formatting = { - format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", - }), - }, -}) diff --git a/.config/nvim/lua/cole/plugins/nvim-tree.lua b/.config/nvim/lua/cole/plugins/nvim-tree.lua deleted file mode 100644 index fb5a889..0000000 --- a/.config/nvim/lua/cole/plugins/nvim-tree.lua +++ /dev/null @@ -1,63 +0,0 @@ -local setup, nvimtree = pcall(require, "nvim-tree") -if not setup then - return -end - --- recommended settings from nvim-tree documentation -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 - --- change color for arrows in tree to light blue -vim.cmd([[ highlight NvimTreeIndentMarker guifg=#3FC5FF ]]) - --- configure nvim-tree -nvimtree.setup({ - -- change folder arrow icons - renderer = { - icons = { - glyphs = { - folder = { - arrow_closed = "", -- arrow when folder is closed - arrow_open = "", -- arrow when folder is open - }, - }, - }, - }, - -- disable window_picker for - -- explorer to work well with - -- window splits - actions = { - open_file = { - window_picker = { - enable = false, - }, - }, - }, - -- git = { - -- ignore = false, - -- }, -}) - --- open nvim-tree on setup - -local function open_nvim_tree(data) - -- buffer is a [No Name] - local no_name = data.file == "" and vim.bo[data.buf].buftype == "" - - -- buffer is a directory - local directory = vim.fn.isdirectory(data.file) == 1 - - if not no_name and not directory then - return - end - - -- change to the directory - if directory then - vim.cmd.cd(data.file) - end - - -- open the tree - require("nvim-tree.api").tree.open() -end - -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/.config/nvim/lua/cole/plugins/telescope.lua b/.config/nvim/lua/cole/plugins/telescope.lua deleted file mode 100644 index c5c7b22..0000000 --- a/.config/nvim/lua/cole/plugins/telescope.lua +++ /dev/null @@ -1,25 +0,0 @@ -local telescope_setup, telescope = pcall(require, "telescope") -if not telescope_setup then - return -end - -local actions_setup, actions = pcall(require, "telescope.actions") -if not actions_setup then - return -end - --- configure telescope -telescope.setup({ - -- configure custom mappings - defaults = { - mappings = { - i = { - [""] = actions.move_selection_previous, -- move to prev result - [""] = actions.move_selection_next, -- move to next result - [""] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist - }, - }, - }, -}) - -telescope.load_extension("fzf") diff --git a/.config/nvim/lua/cole/plugins/transparent.lua b/.config/nvim/lua/cole/plugins/transparent.lua deleted file mode 100644 index f5e84e5..0000000 --- a/.config/nvim/lua/cole/plugins/transparent.lua +++ /dev/null @@ -1,40 +0,0 @@ -local transparent_setup, transparent = pcall(require, "transparent") -if not transparent_setup then - print("Error: transparent is not working") - return -end - -transparent.setup({ -- Optional, you don't have to run setup. - groups = { -- table: default groups - "Normal", - "NormalNC", - "Comment", - "Constant", - "Special", - "Identifier", - "Statement", - "PreProc", - "Type", - "Underlined", - "Todo", - "String", - "Function", - "Conditional", - "Repeat", - "Operator", - "Structure", - "LineNr", - "NonText", - "SignColumn", - "CursorLine", - "CursorLineNr", - "StatusLine", - "StatusLineNC", - "EndOfBuffer", - }, - extra_groups = { - "NormalFloat", -- floating windows - "NvimTreeNormal", -- nvim tree - }, -- table: additional groups that should be cleared - exclude_groups = {}, -- table: groups you don't want to clear -}) diff --git a/.config/nvim/lua/cole/plugins/treesitter.lua b/.config/nvim/lua/cole/plugins/treesitter.lua deleted file mode 100644 index b99c0f3..0000000 --- a/.config/nvim/lua/cole/plugins/treesitter.lua +++ /dev/null @@ -1,34 +0,0 @@ --- import nvim-treesitter plugin safely -local status, treesitter = pcall(require, "nvim-treesitter.configs") -if not status then - return -end - --- configure treesitter -treesitter.setup({ - -- enable syntax highlighting - highlight = { - enable = true, - }, - -- enable indentation - indent = { enable = true }, - -- enable autotagging (w/ nvim-ts-autotag plugin) - autotag = { enable = true }, - -- ensure these language parsers are installed - ensure_installed = { - "arduino", - "c", - "cpp", - "latex", - "python", - "json", - "markdown", - "markdown_inline", - "bash", - "lua", - "vim", - "gitignore", - }, - -- auto install above language parsers - auto_install = true, -}) diff --git a/.config/nvim/lua/cole/plugins/vimtex-setup.lua b/.config/nvim/lua/cole/plugins/vimtex-setup.lua deleted file mode 100644 index 64f9f17..0000000 --- a/.config/nvim/lua/cole/plugins/vimtex-setup.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Fixes focus loss problems on macOS --- wrapping in vim.cmd() --- vim.cd() Executes Vim Script commands -vim.cmd([[ -function! s:TexFocusVim() abort - silent execute "!open -a iTerm" - redraw! -endfunction - -augroup vimtex_event_focus - au! - au User VimTexEventViewReverse call s:TexFocusVim() -augroup END -]]) - --- Viewer method, upon compilation -vim.g.vimtex_view_method = "skim" - --- View Option -vim.g.vimtex_view_general_viewer = "skim" -vim.g.vimtex_view_general_options = "--unique" - --- Determine to automatically open PDF viewer after compilation -vim.g.vimtex_view_automatic = 1 - --- Most VimTex mappings rely on localleader and this can be changed --- with the following line: -vim.g.maplocalleader = "," - --- Keymappings for VimTeX - --- Trigger VimTexView --- nmap v (vimtex-view) -vim.api.nvim_set_keymap("n", "v", "(vimtex-view)", { noremap = true }) diff --git a/.config/nvim/lua/wacky/core/colorscheme.lua b/.config/nvim/lua/wacky/core/colorscheme.lua new file mode 100644 index 0000000..9c35834 --- /dev/null +++ b/.config/nvim/lua/wacky/core/colorscheme.lua @@ -0,0 +1,38 @@ +local status, err = pcall(vim.cmd, "colorscheme bluloco") +if not status then + print(err) + return +end + +require("bluloco").setup({ + style = "light", -- "auto" | "dark" | "light" + transparent = true, + italics = false, + terminal = vim.fn.has("gui_running") == 1, -- bluoco colors are enabled in gui terminals per default. + guicursor = true, +}) + +-- require("tokyonight").setup({ +-- -- your configuration comes here +-- -- or leave it empty to use the default settings +-- style = "storm", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` +-- light_style = "day", -- The theme is used when the background is set to light +-- transparent = true, -- Enable this to disable setting the background color +-- terminal_colors = false, -- Configure the colors used when opening a `:terminal` in [Neovim](https://github.com/neovim/neovim) +-- styles = { +-- -- Style to be applied to different syntax groups +-- -- Value is any valid attr-list value for `:help nvim_set_hl` +-- comments = { italic = true }, +-- keywords = { italic = true }, +-- functions = {}, +-- variables = {}, +-- -- Background styles. Can be "dark", "transparent" or "normal" +-- sidebars = "transparent", -- style for sidebars, see below +-- floats = "transparent", -- style for floating windows +-- }, +-- sidebars = { "terminal", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` +-- day_brightness = 0.5, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors +-- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. +-- dim_inactive = false, -- dims inactive windows +-- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold +-- }) diff --git a/.config/nvim/lua/wacky/core/keymaps.lua b/.config/nvim/lua/wacky/core/keymaps.lua new file mode 100644 index 0000000..a841058 --- /dev/null +++ b/.config/nvim/lua/wacky/core/keymaps.lua @@ -0,0 +1,79 @@ +-- set leader key to space +vim.g.mapleader = " " + +local keymap = vim.keymap -- for conciseness + +--------------------- +-- General Keymaps +--------------------- + +-- use jk to exit insert mode +keymap.set("i", "jk", "") + +-- clear search highlights +keymap.set("n", "ch", ":nohl") + +-- delete single character without copying into register +keymap.set("n", "x", '"_x') + +-- increment/decrement numbers +keymap.set("n", "+", "") -- increment +keymap.set("n", "-", "") -- decrement + +-- window management +keymap.set("n", "sv", "v") -- split window vertically +keymap.set("n", "sh", "s") -- split window horizontally +keymap.set("n", "se", "=") -- make split windows equal width & height +keymap.set("n", "sx", ":close") -- close current split window + +-- open diagnostics +keymap.set("n", "da", ":lua vim.diagnostic.open_float()") -- open diagnostic + +-- terminal +vim.keymap.set("t", "", [[]]) + +-- toggle-terminal +keymap.set("n", "tt", ":ToggleTerm dir=git_dir") +---------------------- +-- keymap.set("n", "to", ":tabnew") -- open new tab +-- keymap.set("n", "tx", ":tabclose") -- close current tab +-- keymap.set("n", "tn", ":tabn") -- go to next tab +-- keymap.set("n", "tp", ":tabp") -- go to previous tab +---------------------- + +---------------------- +-- Plugin Keybinds +---------------------- + +-- vim-maximizer +keymap.set("n", "sm", ":MaximizerToggle") -- toggle split window maximization + +-- nvim-tree +keymap.set("n", "e", ":NvimTreeToggle") -- toggle file explorer + +-- telescope +keymap.set("n", "ff", "Telescope find_files") -- find files within current working directory, respects .gitignore +keymap.set("n", "fs", "Telescope live_grep") -- find string in current working directory as you type +keymap.set("n", "fc", "Telescope grep_string") -- find string under cursor in current working directory +keymap.set("n", "fb", "Telescope buffers") -- list open buffers in current neovim instance +keymap.set("n", "fh", "Telescope help_tags") -- list available help tags + +-- telescope git commands +keymap.set("n", "gc", "Telescope git_commits") -- list all git commits (use to checkout) ["gc" for git commits] +keymap.set("n", "gfc", "Telescope git_bcommits") -- list git commits for current file/buffer (use to checkout) ["gfc" for git file commits] +keymap.set("n", "gb", "Telescope git_branches") -- list git branches (use to checkout) ["gb" for git branch] +keymap.set("n", "gs", "Telescope git_status") -- list current changes per file with diff preview ["gs" for git status] + +-- restart lsp server +keymap.set("n", "rs", ":LspRestart") -- mapping to restart lsp if necessary + +-- DAP : basic commands +-------------------------- +keymap.set("n", "con", ":lua require('dap').continue()") -- continue the debugger +keymap.set("n", "so", ":lua require('dap').step_over()") -- step over a line +keymap.set("n", "si", ":lua require('dap').step_into()") -- step into a line +keymap.set("n", "ol", ":lua require('dap').step_out()") -- step out of a line +keymap.set("n", "tb", ":lua require'dap'.toggle_breakpoint())") -- toggle a breakpoint for debugger +keymap.set("n", "b", ":lua require('dap').set_breakpoint()") -- make a breakpoint at a line +keymap.set("n", "rl", ":lua require('dap').run_last()") -- run the last action +-------------------------- diff --git a/.config/nvim/lua/wacky/core/options.lua b/.config/nvim/lua/wacky/core/options.lua new file mode 100644 index 0000000..7675260 --- /dev/null +++ b/.config/nvim/lua/wacky/core/options.lua @@ -0,0 +1,41 @@ +local opt = vim.opt -- for conciseness + +-- line numbers +opt.relativenumber = true +opt.number = true + +-- tabs & indentation +opt.tabstop = 4 +opt.shiftwidth = 4 +opt.expandtab = true +opt.autoindent = true + +-- line wrapping +opt.wrap = false + +--search settings +opt.ignorecase = true +opt.smartcase = true + +-- cursor line +opt.cursorline = true + +-- appearance +opt.termguicolors = true +opt.background = "dark" +opt.signcolumn = "yes" + +-- backspace +opt.backspace = "indent,eol,start" + +--clipboard +opt.clipboard:append("unnamedplus") + +-- split windows +opt.splitright = true +opt.splitbelow = true + +opt.iskeyword:append("-") + +-- fold method +opt.foldmethod = "manual" diff --git a/.config/nvim/lua/wacky/plugins-setup.lua b/.config/nvim/lua/wacky/plugins-setup.lua new file mode 100644 index 0000000..e1e72c9 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins-setup.lua @@ -0,0 +1,177 @@ +-- auto install packer 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() -- true if packer was just installed + +-- autocommand that reloads neovim and installs/updates/removes plugins +-- when file is saved +vim.cmd([[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins-setup.lua source | PackerSync + augroup end +]]) + +-- import packer safely +local status, packer = pcall(require, "packer") +if not status then + return +end + +-- add list of plugins to install +return packer.startup(function(use) + -- packer can manage itself + use("wbthomason/packer.nvim") + + use("nvim-lua/plenary.nvim") -- lua functions that many plugins use + + -- transparent background + use("xiyaowong/transparent.nvim") + + -- Color Scheme is here!!! + use({ "uloco/bluloco.nvim", requires = { "rktjmp/lush.nvim" } }) -- preferred colorscheme atm + + use("christoomey/vim-tmux-navigator") -- tmux & split window navigation + + use("szw/vim-maximizer") -- maximizes and restores current window + + -- essential plugins + use("tpope/vim-surround") -- add, delete, change surroundings (it's awesome) + use("inkarkat/vim-ReplaceWithRegister") -- replace with register contents using motion (gr + motion) + + -- commenting with gc + use("numToStr/Comment.nvim") + + -- file explorer + use("nvim-tree/nvim-tree.lua") + + -- vs-code like icons + use("nvim-tree/nvim-web-devicons") + + -- statusline + use("nvim-lualine/lualine.nvim") + + -- fuzzy finding w/ telescope + use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) -- dependency for better sorting performance + use({ + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + }) -- fuzzy finder + + -- autocompletion + use("hrsh7th/nvim-cmp") -- completion plugin + use("hrsh7th/cmp-buffer") -- source for text in buffer + use("hrsh7th/cmp-path") -- source for file system paths + + -- snippets + use("L3MON4D3/LuaSnip") -- snippet engine + use("saadparwaiz1/cmp_luasnip") -- for autocompletion + use("rafamadriz/friendly-snippets") -- useful snippets + + -- managing & installing lsp servers, linters & formatters + use("williamboman/mason.nvim") -- in charge of managing lsp servers, linters & formatters + use("williamboman/mason-lspconfig.nvim") -- bridges gap b/w mason & lspconfig + use("mfussenegger/nvim-lint") -- installed because of mypy linter + + -- configuring lsp servers + use("neovim/nvim-lspconfig") -- easily configure language servers + use("hrsh7th/cmp-nvim-lsp") -- for autocompletion + use({ + "glepnir/lspsaga.nvim", + branch = "main", + requires = { + { "nvim-tree/nvim-web-devicons" }, + { "nvim-treesitter/nvim-treesitter" }, + }, + }) -- enhanced lsp uis + + -- vs-code like icons for autocompletion + use("onsails/lspkind.nvim") + + -- treesitter configuration + use({ + "nvim-treesitter/nvim-treesitter", + run = function() + local ts_update = require("nvim-treesitter.install").update({ with_sync = true }) + ts_update() + end, + }) + + -- dadbod for Databases + use({ + "kristijanhusak/vim-dadbod-ui", + requires = { "tpope/vim-dadbod" }, + dependencies = { + { + "kristijanhusak/vim-dadbod-completion", + ft = { "sql" }, + cmd = { + "DBUI", + "DBUIToggle", + "DBUIAddConnection", + "DBUIFindBuffer", + }, + config = function() + -- place my small config changes here + vim.g.db_ui_use_nerd_fonts = 1 + end, + }, + }, + }) + + -- auto closing + use("windwp/nvim-autopairs") -- autoclose parens, brackets, quotes, etc... + use({ "windwp/nvim-ts-autotag", after = "nvim-treesitter" }) -- autoclose tags + + -- git integration + use("lewis6991/gitsigns.nvim") -- show line modifications on left hand side + + -- nvim-formatter + require("packer").use({ "mhartington/formatter.nvim" }) + + -- toggle terminal + use({ + "akinsho/toggleterm.nvim", + tag = "*", + config = function() + require("toggleterm").setup({ + size = 15, + direction = "horizontal", + autochdir = false, + }) + end, + }) + + -- Markdown Preview + use({ + "iamcco/markdown-preview.nvim", + run = "cd app && npm install", + setup = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }) + + -- vimtex for LaTeX files + use("lervag/vimtex") + + -- dap and dapui + use({ + "rcarriga/nvim-dap-ui", + requires = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + }, + }) + if packer_bootstrap then + require("packer").sync() + end +end) diff --git a/.config/nvim/lua/wacky/plugins/autopairs.lua b/.config/nvim/lua/wacky/plugins/autopairs.lua new file mode 100644 index 0000000..19890bb --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/autopairs.lua @@ -0,0 +1,30 @@ +-- import nvim-autopairs safely +local autopairs_setup, autopairs = pcall(require, "nvim-autopairs") +if not autopairs_setup then + return +end + +-- configure autopairs +autopairs.setup({ + check_ts = true, -- enable treesitter + ts_config = { + lua = { "string" }, -- don't add pairs in lua string treesitter nodes + javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes + java = false, -- don't check treesitter on java + }, +}) + +-- import nvim-autopairs completion functionality safely +local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") +if not cmp_autopairs_setup then + return +end + +-- import nvim-cmp plugin safely (completions plugin) +local cmp_setup, cmp = pcall(require, "cmp") +if not cmp_setup then + return +end + +-- make autopairs and completion work together +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/.config/nvim/lua/wacky/plugins/comment.lua b/.config/nvim/lua/wacky/plugins/comment.lua new file mode 100644 index 0000000..89a3d62 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/comment.lua @@ -0,0 +1,6 @@ +local setup, comment = pcall(require, "Comment") +if not setup then + return +end + +comment.setup() diff --git a/.config/nvim/lua/wacky/plugins/dadbod-setup.lua b/.config/nvim/lua/wacky/plugins/dadbod-setup.lua new file mode 100644 index 0000000..1905580 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/dadbod-setup.lua @@ -0,0 +1,6 @@ +local status, _ = pcall(require, "dadbod-ui") +if not status then + return +end + +vim.g.db_ui_variable_prefix = "DB_" diff --git a/.config/nvim/lua/wacky/plugins/dap-setup.lua b/.config/nvim/lua/wacky/plugins/dap-setup.lua new file mode 100644 index 0000000..f13de2c --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/dap-setup.lua @@ -0,0 +1,15 @@ +require("dapui").setup() + +local dap, dapui = require("dap"), require("dapui") +dap.listeners.before.attach.dapui_config = function() + dapui.open() +end +dap.listeners.before.launch.dapui_config = function() + dapui.open() +end +dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() +end +dap.listeners.before.event_exited.dapui_config = function() + dapui.close() +end diff --git a/.config/nvim/lua/wacky/plugins/formatter.lua b/.config/nvim/lua/wacky/plugins/formatter.lua new file mode 100644 index 0000000..f1e5cfc --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/formatter.lua @@ -0,0 +1,64 @@ +-- Utilities for creating configurations +local util = require("formatter.util") + +-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands +require("formatter").setup({ + -- Enable or disable logging + logging = true, + -- Set the log level + log_level = vim.log.levels.WARN, + -- All formatter configurations are opt-in + filetype = { + -- current languges + python = { require("formatter.filetypes.python").autopep8 }, + cpp = { require("formatter.filetypes.cpp").clangformat }, + c = { require("formatter.filetypes.cpp").clangformat }, + latex = { require("formatter.filetypes.latex").latexindent }, + markdown = { require("formatter.filetypes.markdown").prettier }, + html = { require("formatter.filetypes.html").prettier }, + -- Formatter configurations for filetype "lua" go here + -- and will be executed in order + lua = { + -- "formatter.filetypes.lua" defines default configurations for the + -- "lua" filetype + require("formatter.filetypes.lua").stylua, + + -- You can also define your own configuration + function() + -- Supports conditional formatting + if util.get_current_buffer_file_name() == "special.lua" then + return nil + end + + -- Full specification of configurations is down below and in Vim help + -- files + return { + exe = "stylua", + args = { + "--search-parent-directories", + "--stdin-filepath", + util.escape_path(util.get_current_buffer_file_path()), + "--", + "-", + }, + stdin = true, + } + end, + }, + -- Use the special "*" filetype for defining formatter configurations on + -- any filetype + ["*"] = { + -- "formatter.filetypes.any" defines default configurations for any + -- filetype + require("formatter.filetypes.any").remove_trailing_whitespace, + }, + }, +}) + +local augroup = vim.api.nvim_create_augroup +local autocmd = vim.api.nvim_create_autocmd +augroup("__formatter__", { clear = true }) +autocmd("BufWritePost", { + group = "__formatter__", + command = ":FormatWrite", +}) diff --git a/.config/nvim/lua/wacky/plugins/gitsigns.lua b/.config/nvim/lua/wacky/plugins/gitsigns.lua new file mode 100644 index 0000000..22f7ba6 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/gitsigns.lua @@ -0,0 +1,8 @@ +-- import gitsigns plugin safely +local setup, gitsigns = pcall(require, "gitsigns") +if not setup then + return +end + +-- configure/enable gitsigns +gitsigns.setup() diff --git a/.config/nvim/lua/wacky/plugins/linter-setup.lua b/.config/nvim/lua/wacky/plugins/linter-setup.lua new file mode 100644 index 0000000..186cfb2 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/linter-setup.lua @@ -0,0 +1,16 @@ +-- specifies linter for each filetype +require("lint").linters_by_ft = { + python = { "mypy" }, +} + +vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + -- try_lint without arguments runs the linters defined in `linters_by_ft` + -- for the current filetype + require("lint").try_lint() + + -- You can call `try_lint` with a linter name or a list of names to always + -- run specific linters, independent of the `linters_by_ft` configuration + -- require("lint").try_lint("cspell") + end, +}) diff --git a/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua b/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua new file mode 100644 index 0000000..80316ea --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/lsp/lspconfig.lua @@ -0,0 +1,85 @@ +-- import lspconfig plugin safely +local lspconfig_status, lspconfig = pcall(require, "lspconfig") +if not lspconfig_status then + return +end + +-- import cmp-nvim-lsp plugin safely +local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") +if not cmp_nvim_lsp_status then + return +end + +local keymap = vim.keymap -- for conciseness + +-- enable keybinds only for when lsp server available +local on_attach = function(client, bufnr) + -- keybind options + local opts = { noremap = true, silent = true, buffer = bufnr } + + -- set keybinds + keymap.set("n", "gf", "Lspsaga lsp_finder", opts) -- show definition, references + keymap.set("n", "gD", "lua vim.lsp.buf.declaration()", opts) -- go to declaration + keymap.set("n", "gd", "Lspsaga peek_definition", opts) -- see definition and make edits in window + keymap.set("n", "gi", "lua vim.lsp.buf.implementation()", opts) -- go to implementation + keymap.set("n", "K", "lua vim.lsp.buf.hover()", opts) -- see variable in hover + keymap.set("n", "ca", "Lspsaga code_action", opts) -- see available code actions + keymap.set("n", "rn", "Lspsaga rename", opts) -- smart rename + keymap.set("n", "D", "Lspsaga show_line_diagnostics", opts) -- show diagnostics for line + keymap.set("n", "d", "Lspsaga show_cursor_diagnostics", opts) -- show diagnostics for cursor + keymap.set("n", "[d", "Lspsaga diagnostic_jump_prev", opts) -- jump to previous diagnostic in buffer + keymap.set("n", "]d", "Lspsaga diagnostic_jump_next", opts) -- jump to next diagnostic in buffer + keymap.set("n", "K", "Lspsaga hover_doc", opts) -- show documentation for what is under cursor + keymap.set("n", "o", "LSoutlineToggle", opts) -- see outline on right hand side +end + +-- used to enable autocompletion (assign to every lsp server config) +local capabilities = cmp_nvim_lsp.default_capabilities() + +-- Change the Diagnostic symbols in the sign column (gutter) +-- (not in youtube nvim video) +local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) +end + +local servers = { + "clangd", + "arduino_language_server", + "ltex", + "jedi_language_server", + "biome", + "metals", +} + +for _, lsp in pairs(servers) do + require("lspconfig")[lsp].setup({ + capabilities = capabilities, + on_attach = on_attach, + }) +end + +-- configure metals server with defaults +lspconfig["metals"].setup({}) + +-- configure lua server (with special settings) +lspconfig["lua_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { -- custom settings for lua + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + workspace = { + -- make language server aware of runtime files + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, + }, + }, +}) diff --git a/.config/nvim/lua/wacky/plugins/lsp/lspsaga.lua b/.config/nvim/lua/wacky/plugins/lsp/lspsaga.lua new file mode 100644 index 0000000..90f5d57 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/lsp/lspsaga.lua @@ -0,0 +1,19 @@ +-- import lspsaga safely +local saga_status, saga = pcall(require, "lspsaga") +if not saga_status then + return +end + +saga.setup({ + -- keybinds for navigation in lspsaga window + scroll_preview = { scroll_down = "", scroll_up = "" }, + -- use enter to open file with definition preview + definition = { + edit = "", + }, + ui = { + colors = { + normal_bg = "#022746", + }, + }, +}) diff --git a/.config/nvim/lua/wacky/plugins/lsp/mason.lua b/.config/nvim/lua/wacky/plugins/lsp/mason.lua new file mode 100644 index 0000000..5a71612 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/lsp/mason.lua @@ -0,0 +1,38 @@ +-- import mason plugin safely +local mason_status, mason = pcall(require, "mason") +if not mason_status then + return +end + +-- import mason-lspconfig plugin safely +local mason_lspconfig_status, mason_lspconfig = pcall(require, "mason-lspconfig") +if not mason_lspconfig_status then + return +end + +-- enable mason and configure icons +mason.setup({ + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, + }, +}) + +mason_lspconfig.setup({ + -- list of servers for mason to install + ensure_installed = { + "lua_ls", + "clangd", + "arduino_language_server", + "ltex", + "jedi_language_server", + "html", + "tailwindcss", + "biome", + }, + -- auto-install configured servers (with lspconfig) + automatic_installation = true, -- not the same as ensure_installed +}) diff --git a/.config/nvim/lua/wacky/plugins/lualine.lua b/.config/nvim/lua/wacky/plugins/lualine.lua new file mode 100644 index 0000000..99425cd --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/lualine.lua @@ -0,0 +1,6 @@ +local status, lualine = pcall(require, "lualine") +if not status then + return +end + +lualine.setup() diff --git a/.config/nvim/lua/wacky/plugins/nvim-cmp.lua b/.config/nvim/lua/wacky/plugins/nvim-cmp.lua new file mode 100644 index 0000000..5911160 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/nvim-cmp.lua @@ -0,0 +1,61 @@ +local cmp_status, cmp = pcall(require, "cmp") +if not cmp_status then + return +end + +local luasnip_status, luasnip = pcall(require, "luasnip") +if not luasnip_status then + return +end + +-- import lspkind plugin safely +local lspkind_status, lspkind = pcall(require, "lspkind") +if not lspkind_status then + return +end + +-- load vs-code like snippets from plugins (e.g. friendly-snippets) +require("luasnip/loaders/from_vscode").lazy_load() + +vim.opt.completeopt = "menu,menuone,noselect" + +cmp.setup({ + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), -- previous suggestion + [""] = cmp.mapping.select_next_item(), -- next suggestion + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion window + [""] = cmp.mapping.confirm({ select = false }), + }), + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, -- lsp + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + { name = "spell" }, -- spell checker + { name = "treesitter" }, + }), + -- configure lspkind for vs-code like icons + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...", + }), + }, +}) + +-- setup for vim-dadbod +cmp.setup.filetype({ "sql" }, { + sources = { + { name = "vim-dadbod-completion" }, + { name = "buffer" }, + }, +}) diff --git a/.config/nvim/lua/wacky/plugins/nvim-tree.lua b/.config/nvim/lua/wacky/plugins/nvim-tree.lua new file mode 100644 index 0000000..fb5a889 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/nvim-tree.lua @@ -0,0 +1,63 @@ +local setup, nvimtree = pcall(require, "nvim-tree") +if not setup then + return +end + +-- recommended settings from nvim-tree documentation +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- change color for arrows in tree to light blue +vim.cmd([[ highlight NvimTreeIndentMarker guifg=#3FC5FF ]]) + +-- configure nvim-tree +nvimtree.setup({ + -- change folder arrow icons + renderer = { + icons = { + glyphs = { + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open + }, + }, + }, + }, + -- disable window_picker for + -- explorer to work well with + -- window splits + actions = { + open_file = { + window_picker = { + enable = false, + }, + }, + }, + -- git = { + -- ignore = false, + -- }, +}) + +-- open nvim-tree on setup + +local function open_nvim_tree(data) + -- buffer is a [No Name] + local no_name = data.file == "" and vim.bo[data.buf].buftype == "" + + -- buffer is a directory + local directory = vim.fn.isdirectory(data.file) == 1 + + if not no_name and not directory then + return + end + + -- change to the directory + if directory then + vim.cmd.cd(data.file) + end + + -- open the tree + require("nvim-tree.api").tree.open() +end + +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/.config/nvim/lua/wacky/plugins/telescope.lua b/.config/nvim/lua/wacky/plugins/telescope.lua new file mode 100644 index 0000000..c5c7b22 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/telescope.lua @@ -0,0 +1,25 @@ +local telescope_setup, telescope = pcall(require, "telescope") +if not telescope_setup then + return +end + +local actions_setup, actions = pcall(require, "telescope.actions") +if not actions_setup then + return +end + +-- configure telescope +telescope.setup({ + -- configure custom mappings + defaults = { + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist + }, + }, + }, +}) + +telescope.load_extension("fzf") diff --git a/.config/nvim/lua/wacky/plugins/transparent.lua b/.config/nvim/lua/wacky/plugins/transparent.lua new file mode 100644 index 0000000..f5e84e5 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/transparent.lua @@ -0,0 +1,40 @@ +local transparent_setup, transparent = pcall(require, "transparent") +if not transparent_setup then + print("Error: transparent is not working") + return +end + +transparent.setup({ -- Optional, you don't have to run setup. + groups = { -- table: default groups + "Normal", + "NormalNC", + "Comment", + "Constant", + "Special", + "Identifier", + "Statement", + "PreProc", + "Type", + "Underlined", + "Todo", + "String", + "Function", + "Conditional", + "Repeat", + "Operator", + "Structure", + "LineNr", + "NonText", + "SignColumn", + "CursorLine", + "CursorLineNr", + "StatusLine", + "StatusLineNC", + "EndOfBuffer", + }, + extra_groups = { + "NormalFloat", -- floating windows + "NvimTreeNormal", -- nvim tree + }, -- table: additional groups that should be cleared + exclude_groups = {}, -- table: groups you don't want to clear +}) diff --git a/.config/nvim/lua/wacky/plugins/treesitter.lua b/.config/nvim/lua/wacky/plugins/treesitter.lua new file mode 100644 index 0000000..b99c0f3 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/treesitter.lua @@ -0,0 +1,34 @@ +-- import nvim-treesitter plugin safely +local status, treesitter = pcall(require, "nvim-treesitter.configs") +if not status then + return +end + +-- configure treesitter +treesitter.setup({ + -- enable syntax highlighting + highlight = { + enable = true, + }, + -- enable indentation + indent = { enable = true }, + -- enable autotagging (w/ nvim-ts-autotag plugin) + autotag = { enable = true }, + -- ensure these language parsers are installed + ensure_installed = { + "arduino", + "c", + "cpp", + "latex", + "python", + "json", + "markdown", + "markdown_inline", + "bash", + "lua", + "vim", + "gitignore", + }, + -- auto install above language parsers + auto_install = true, +}) diff --git a/.config/nvim/lua/wacky/plugins/vimtex-setup.lua b/.config/nvim/lua/wacky/plugins/vimtex-setup.lua new file mode 100644 index 0000000..64f9f17 --- /dev/null +++ b/.config/nvim/lua/wacky/plugins/vimtex-setup.lua @@ -0,0 +1,34 @@ +-- Fixes focus loss problems on macOS +-- wrapping in vim.cmd() +-- vim.cd() Executes Vim Script commands +vim.cmd([[ +function! s:TexFocusVim() abort + silent execute "!open -a iTerm" + redraw! +endfunction + +augroup vimtex_event_focus + au! + au User VimTexEventViewReverse call s:TexFocusVim() +augroup END +]]) + +-- Viewer method, upon compilation +vim.g.vimtex_view_method = "skim" + +-- View Option +vim.g.vimtex_view_general_viewer = "skim" +vim.g.vimtex_view_general_options = "--unique" + +-- Determine to automatically open PDF viewer after compilation +vim.g.vimtex_view_automatic = 1 + +-- Most VimTex mappings rely on localleader and this can be changed +-- with the following line: +vim.g.maplocalleader = "," + +-- Keymappings for VimTeX + +-- Trigger VimTexView +-- nmap v (vimtex-view) +vim.api.nvim_set_keymap("n", "v", "(vimtex-view)", { noremap = true }) diff --git a/.config/nvim/plugin/packer_compiled.lua b/.config/nvim/plugin/packer_compiled.lua index 6410ebb..06b4698 100644 --- a/.config/nvim/plugin/packer_compiled.lua +++ b/.config/nvim/plugin/packer_compiled.lua @@ -49,8 +49,8 @@ local function save_profiles(threshold) end time([[Luarocks path setup]], true) -local package_path_str = "/Users/cole/.cache/nvim/packer_hererocks/2.1.1720049189/share/lua/5.1/?.lua;/Users/cole/.cache/nvim/packer_hererocks/2.1.1720049189/share/lua/5.1/?/init.lua;/Users/cole/.cache/nvim/packer_hererocks/2.1.1720049189/lib/luarocks/rocks-5.1/?.lua;/Users/cole/.cache/nvim/packer_hererocks/2.1.1720049189/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/Users/cole/.cache/nvim/packer_hererocks/2.1.1720049189/lib/lua/5.1/?.so" +local package_path_str = "/Users/cole/.cache/nvim/packer_hererocks/2.1.1732813678/share/lua/5.1/?.lua;/Users/cole/.cache/nvim/packer_hererocks/2.1.1732813678/share/lua/5.1/?/init.lua;/Users/cole/.cache/nvim/packer_hererocks/2.1.1732813678/lib/luarocks/rocks-5.1/?.lua;/Users/cole/.cache/nvim/packer_hererocks/2.1.1732813678/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/Users/cole/.cache/nvim/packer_hererocks/2.1.1732813678/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 @@ -171,6 +171,16 @@ _G.packer_plugins = { path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-cmp", url = "https://github.com/hrsh7th/nvim-cmp" }, + ["nvim-dap"] = { + loaded = true, + path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-dap", + url = "https://github.com/mfussenegger/nvim-dap" + }, + ["nvim-dap-ui"] = { + loaded = true, + path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-dap-ui", + url = "https://github.com/rcarriga/nvim-dap-ui" + }, ["nvim-lint"] = { loaded = true, path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-lint", @@ -181,6 +191,11 @@ _G.packer_plugins = { path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", url = "https://github.com/neovim/nvim-lspconfig" }, + ["nvim-nio"] = { + loaded = true, + path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-nio", + url = "https://github.com/nvim-neotest/nvim-nio" + }, ["nvim-tree.lua"] = { loaded = true, path = "/Users/cole/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", diff --git a/.config/sketchybar/colors.lua b/.config/sketchybar/colors.lua index a664cfa..751cfd6 100644 --- a/.config/sketchybar/colors.lua +++ b/.config/sketchybar/colors.lua @@ -13,6 +13,7 @@ return { magenta = 0xffb39df3, grey = 0xff7f8490, pink = 0xffffc0cb, + purple = 0xff8a00c2, transparent = 0x00000000, bar = { diff --git a/.config/sketchybar/items/widgets/stocks.lua b/.config/sketchybar/items/widgets/stocks.lua new file mode 100644 index 0000000..073c6cb --- /dev/null +++ b/.config/sketchybar/items/widgets/stocks.lua @@ -0,0 +1,16 @@ +local icons = require("icons") +local colors = require("colors") +local settings = require("settings") +local sbar = require("sketchybar") + +local popup_width = 250 + +local stock_icon = sbar.add("item", "widgets.stocks", { + position = "middle", + icon = { drawing = false }, + label = { + string = "$??.??", -- this needs to be formatted depending on the data + padding_left = -1, + font = { family = settings.font.numbers }, + }, +}) diff --git a/.config/sketchybar/settings.lua b/.config/sketchybar/settings.lua index bad1d71..6123c8b 100644 --- a/.config/sketchybar/settings.lua +++ b/.config/sketchybar/settings.lua @@ -5,8 +5,8 @@ return { -- battery widget batt_background = colors.black, batt_color_default = colors.green, - batt_color_25 = colors.cog_blue, - batt_color_0 = colors.orange, + batt_color_25 = colors.purple, + batt_color_0 = colors.pink, -- cpu widget cpu_background = colors.black, -- volume widget diff --git a/.config/sketchybar_backup/plugins/battery.sh b/.config/sketchybar_backup/plugins/battery.sh new file mode 100755 index 0000000..fad0c18 --- /dev/null +++ b/.config/sketchybar_backup/plugins/battery.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +PERCENTAGE="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)" +CHARGING="$(pmset -g batt | grep 'AC Power')" + +if [ "$PERCENTAGE" = "" ]; then + exit 0 +fi + +case "${PERCENTAGE}" in + 9[0-9]|100) ICON="" + ;; + [6-8][0-9]) ICON="" + ;; + [3-5][0-9]) ICON="" + ;; + [1-2][0-9]) ICON="" + ;; + *) ICON="" +esac + +if [[ "$CHARGING" != "" ]]; then + ICON="󱐋" +fi + +# The item invoking this script (name $NAME) will get its icon and label +# updated with the current battery status +sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}%" diff --git a/.config/sketchybar_backup/plugins/clock.sh b/.config/sketchybar_backup/plugins/clock.sh new file mode 100755 index 0000000..9f5624a --- /dev/null +++ b/.config/sketchybar_backup/plugins/clock.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# The $NAME variable is passed from sketchybar and holds the name of +# the item invoking this script: +# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting +ICON="󰸘" +sketchybar --set "$NAME" icon="$ICON" label="$(date '+%m/%d %I:%M %p')" diff --git a/.config/sketchybar_backup/plugins/front_app.sh b/.config/sketchybar_backup/plugins/front_app.sh new file mode 100755 index 0000000..fb6d0b3 --- /dev/null +++ b/.config/sketchybar_backup/plugins/front_app.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +# Some events send additional information specific to the event in the $INFO +# variable. E.g. the front_app_switched event sends the name of the newly +# focused application in the $INFO variable: +# https://felixkratz.github.io/SketchyBar/config/events#events-and-scripting + +if [ "$SENDER" = "front_app_switched" ]; then + sketchybar --set "$NAME" label="$INFO" +fi diff --git a/.config/sketchybar_backup/plugins/space.sh b/.config/sketchybar_backup/plugins/space.sh new file mode 100755 index 0000000..b8602b5 --- /dev/null +++ b/.config/sketchybar_backup/plugins/space.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# The $SELECTED variable is available for space components and indicates if +# the space invoking this script (with name: $NAME) is currently selected: +# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item + +sketchybar --set "$NAME" background.drawing="$SELECTED" diff --git a/.config/sketchybar_backup/plugins/volume.sh b/.config/sketchybar_backup/plugins/volume.sh new file mode 100755 index 0000000..6e69a5d --- /dev/null +++ b/.config/sketchybar_backup/plugins/volume.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# The volume_change event supplies a $INFO variable in which the current volume +# percentage is passed to the script. + +if [ "$SENDER" = "volume_change" ]; then + VOLUME="$INFO" + + case "$VOLUME" in + [6-9][0-9]|100) ICON="󰕾" + ;; + [3-5][0-9]) ICON="󰖀" + ;; + [1-9]|[1-2][0-9]) ICON="󰕿" + ;; + *) ICON="󰖁" + esac + + sketchybar --set "$NAME" icon="$ICON" label="$VOLUME%" +fi diff --git a/.config/sketchybar_backup/sketchybarrc b/.config/sketchybar_backup/sketchybarrc new file mode 100755 index 0000000..ed7bae1 --- /dev/null +++ b/.config/sketchybar_backup/sketchybarrc @@ -0,0 +1,91 @@ +# This is a demo config to showcase some of the most important commands. +# It is meant to be changed and configured, as it is intentionally kept sparse. +# For a (much) more advanced configuration example see my dotfiles: +# https://github.com/FelixKratz/dotfiles + +PLUGIN_DIR="$CONFIG_DIR/plugins" + +##### Bar Appearance ##### +# Configuring the general appearance of the bar. +# These are only some of the options available. For all options see: +# https://felixkratz.github.io/SketchyBar/config/bar +# If you are looking for other colors, see the color picker: +# https://felixkratz.github.io/SketchyBar/config/tricks#color-picker + +sketchybar --bar position=top height=40 blur_radius=20 color=0x40000000 + +##### Changing Defaults ##### +# We now change some default values, which are applied to all further items. +# For a full list of all available item properties see: +# https://felixkratz.github.io/SketchyBar/config/items + +default=( + padding_left=5 + padding_right=5 + icon.font="Hack Nerd Font:Bold:17.0" + label.font="Hack Nerd Font:Bold:14.0" + icon.color=0xffffffff + label.color=0xffffffff + icon.padding_left=3 + icon.padding_right=4 + label.padding_left=4 + label.padding_right=4 +) +sketchybar --default "${default[@]}" + +##### Adding Mission Control Space Indicators ##### +# Let's add some mission control spaces: +# https://felixkratz.github.io/SketchyBar/config/components#space----associate-mission-control-spaces-with-an-item +# to indicate active and available mission control spaces. + +SPACE_ICONS=("1" "2" "3" "4" "5" "6" "7" "8" "9" "10") +for i in "${!SPACE_ICONS[@]}" +do + sid="$(($i+1))" + space=( + space="$sid" + icon="${SPACE_ICONS[i]}" + icon.padding_left=7 + icon.padding_right=7 + background.color=0x40ffffff + background.corner_radius=5 + background.height=25 + label.drawing=off + script="$PLUGIN_DIR/space.sh" + click_script="yabai -m space --focus $sid" + ) + sketchybar --add space space."$sid" left --set space."$sid" "${space[@]}" +done + +##### Adding Left Items ##### +# We add some regular items to the left side of the bar, where +# only the properties deviating from the current defaults need to be set + +sketchybar --add item chevron left \ + --set chevron icon= label.drawing=off \ + --add item front_app left \ + --set front_app icon.drawing=off script="$PLUGIN_DIR/front_app.sh" \ + --subscribe front_app front_app_switched + +##### Adding Right Items ##### +# In the same way as the left items we can add items to the right side. +# Additional position (e.g. center) are available, see: +# https://felixkratz.github.io/SketchyBar/config/items#adding-items-to-sketchybar + +# Some items refresh on a fixed cycle, e.g. the clock runs its script once +# every 10s. Other items respond to events they subscribe to, e.g. the +# volume.sh script is only executed once an actual change in system audio +# volume is registered. More info about the event system can be found here: +# https://felixkratz.github.io/SketchyBar/config/events + +sketchybar --add item clock right \ + --set clock update_freq=10 icon= script="$PLUGIN_DIR/clock.sh" \ + --add item volume right \ + --set volume script="$PLUGIN_DIR/volume.sh" \ + --subscribe volume volume_change \ + --add item battery right \ + --set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \ + --subscribe battery system_woke power_source_change + +##### Force all scripts to run the first time (never do this in a script) ##### +sketchybar --update -- cgit v1.3-3-g829e