diff --git a/README.md b/README.md index 0c0170d..4cc7478 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,8 @@ - add logic to the main run script to handle cloning of this repo - add logic to the main run script to set `BOX_SETUP_OS` var, either input param or detect - config for nvim -- config for mpd, mpc, ncmpcpp - config for ghostty +- config for mpd, mpc, ncmpcpp - config for mpv - also, on macos, get it to open within terminal or just don't install it - config for gimp, `src_files/.config/GIMP` (dir) @@ -48,6 +48,6 @@ - build in flags/logic for skipping certain installs/builds (and maybe configs?) on a given system (i.e. don't install on a company box, on a server, etc.) - decide on and implement approach for languages and versioning - - docker? or alternatives like podman? any license concerns? - asdf, or language-specific version managers? + - docker? or alternatives like podman? any license concerns? - hybrid of the above? diff --git a/installs_and_builds/s02_utils b/installs_and_builds/s02_utils index 3746112..059eceb 100755 --- a/installs_and_builds/s02_utils +++ b/installs_and_builds/s02_utils @@ -8,7 +8,9 @@ ${=BOX_SETUP_INSTALL_COMMAND} \ fzf \ make \ cmake \ - gettext + gettext \ + grep \ + ripgrep [[ "$BOX_SETUP_OS" = "macos" ]] && ${=BOX_SETUP_INSTALL_COMMAND} coreutils diff --git a/installs_and_builds/s12_web_browser b/installs_and_builds/s12_web_browser index eee009d..63b7566 100755 --- a/installs_and_builds/s12_web_browser +++ b/installs_and_builds/s12_web_browser @@ -1,7 +1,8 @@ #!/bin/zsh -local option_prefix='' -[[ "$BOX_SETUP_OS" = "macos" ]] && option_prefix='--cask' -local firefox_package_name='firefox' -[[ "$BOX_SETUP_OS" = "debian" ]] && firefox_package_name='firefox-esr' -${=BOX_SETUP_INSTALL_COMMAND} "$option_prefix" "$firefox_package_name" +# TODO: replace firefox with brave or another browser +# local option_prefix='' +# [[ "$BOX_SETUP_OS" = "macos" ]] && option_prefix='--cask' +# local firefox_package_name='firefox' +# [[ "$BOX_SETUP_OS" = "debian" ]] && firefox_package_name='firefox-esr' +# ${=BOX_SETUP_INSTALL_COMMAND} "$option_prefix" "$firefox_package_name" diff --git a/installs_and_builds/s18_file_manager b/installs_and_builds/s18_file_manager index 0be0990..30f1e98 100755 --- a/installs_and_builds/s18_file_manager +++ b/installs_and_builds/s18_file_manager @@ -1,4 +1,4 @@ #!/bin/zsh -# TODO: pick filemanager; consider: lf, ranger, others? +# TODO: do i even want a filemanager? if yes, pick one; consider: lf, ranger, others? # ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder diff --git a/installs_and_builds/s49_languages_general b/installs_and_builds/s49_languages_general index 1ed628f..6d29520 100755 --- a/installs_and_builds/s49_languages_general +++ b/installs_and_builds/s49_languages_general @@ -7,4 +7,5 @@ #${=BOX_SETUP_INSTALL_COMMAND} "$lua_package" liblua5.1-0-dev +# TODO: do i want to install luarocks? lazy.nvim plugin manager currently expects it #luarocks install luacheck diff --git a/src_files/.config/nvim/init.lua b/src_files/.config/nvim/init.lua index 2b5d4e9..c1a2a49 100644 --- a/src_files/.config/nvim/init.lua +++ b/src_files/.config/nvim/init.lua @@ -1 +1 @@ -print("print from init.lua file") +require("david_standard") diff --git a/src_files/.config/nvim/lua/david_standard/colorscheme_settings.lua b/src_files/.config/nvim/lua/david_standard/colorscheme_settings.lua new file mode 100644 index 0000000..783c39e --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/colorscheme_settings.lua @@ -0,0 +1,23 @@ +function SetColorSchemeWrapper(scheme) + scheme = scheme or "sorbet" + vim.cmd.colorscheme(scheme) + + -- Allow for transparency + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +end +SetColorSchemeWrapper() + +-- TODO: get this working as desired +-- autocmd('BufEnter', { +-- group = ThePrimeagenGroup, -- TODO: group needed? +-- callback = function() +-- if vim.bo.filetype == "zig" then +-- pcall(SetColorSchemeWrapper, "tokyonight-night") +-- else +-- pcall(SetColorSchemeWrapper, "rose-pine-main") +-- pcall(SetColorSchemeWrapper, "slate") +-- end +-- end +-- }) + diff --git a/src_files/.config/nvim/lua/david_standard/init.lua b/src_files/.config/nvim/lua/david_standard/init.lua new file mode 100644 index 0000000..33e7f63 --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/init.lua @@ -0,0 +1,6 @@ +require("david_standard.settings") +require("david_standard.remaps") +require("david_standard.lazy_nvim") + +require("david_standard.plugin_key_mappings") +require("david_standard.colorscheme_settings") diff --git a/src_files/.config/nvim/lua/david_standard/lazy_nvim.lua b/src_files/.config/nvim/lua/david_standard/lazy_nvim.lua new file mode 100644 index 0000000..735138d --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/lazy_nvim.lua @@ -0,0 +1,28 @@ +local path_lazy_nvim = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(path_lazy_nvim) then + local git_output = vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", + path_lazy_nvim, + }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo( + { { "Failed to clone lazy.nvim:\n" }, { git_output }, }, + true, + {} + ) + vim.fn.getchar() + end +end +vim.opt.rtp:prepend(path_lazy_nvim) + +require("lazy").setup({ + spec = { + { import = "david_standard.plugins_lazy" }, + }, + checker = { enabled = false }, + change_detection = { notify = false }, +}) diff --git a/src_files/.config/nvim/lua/david_standard/plugin_key_mappings.lua b/src_files/.config/nvim/lua/david_standard/plugin_key_mappings.lua new file mode 100644 index 0000000..2f64147 --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugin_key_mappings.lua @@ -0,0 +1,36 @@ +-- telescope +local builtin = require('telescope.builtin') +local custom_tscope_grep = function() + builtin.grep_string({ search = vim.fn.input("grep > ")}) +end +vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope find files' }) +vim.keymap.set('n', 'ft', builtin.live_grep, { desc = 'Telescope find text (live_grep)' }) +vim.keymap.set('n', 'fT', custom_tscope_grep, { desc = 'Telescope find text (grep_string)' }) +vim.keymap.set('n', 'fg', builtin.git_files, { desc = 'Telescope find git-tracked files' }) +vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope buffers' }) +vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope help tags' }) + +-- harpoon +local harpoon = require("harpoon") +vim.keymap.set("n", "ha", function() harpoon:list():add() end) +vim.keymap.set("n", "hA", function() harpoon:list():prepend() end) +vim.keymap.set("n", "hl", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) +vim.keymap.set("n", "hn", function() harpoon:list():next() end) +vim.keymap.set("n", "hp", function() harpoon:list():prev() end) +vim.keymap.set("n", "z", function() harpoon:list():select(1) end) +vim.keymap.set("n", "x", function() harpoon:list():select(2) end) +vim.keymap.set("n", "c", function() harpoon:list():select(3) end) +vim.keymap.set("n", "v", function() harpoon:list():select(4) end) +vim.keymap.set("n", "Z", function() harpoon:list():replace_at(1) end) +vim.keymap.set("n", "X", function() harpoon:list():replace_at(2) end) +vim.keymap.set("n", "C", function() harpoon:list():replace_at(3) end) +vim.keymap.set("n", "V", function() harpoon:list():replace_at(4) end) + +-- undotree +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) + +-- fugitive (git integration) +vim.keymap.set("n", "gG", vim.cmd.Git) +vim.keymap.set("n", "gg", ":Git --paginate ") -- shortcut, arbitrary git commands +vim.keymap.set("n", "gs", function() vim.cmd.Git({ "--paginate status" }) end) +vim.keymap.set("n", "gc", function() vim.cmd.Git({ "commit -a" }) end) diff --git a/src_files/.config/nvim/lua/david_standard/plugins_lazy/colorschemes.lua b/src_files/.config/nvim/lua/david_standard/plugins_lazy/colorschemes.lua new file mode 100644 index 0000000..cdf7e17 --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugins_lazy/colorschemes.lua @@ -0,0 +1,49 @@ +return { + -- TODO: decide which of these i won't be using, then remove from this file + { + "ellisonleao/gruvbox.nvim", + name = "gruvbox", + -- priority = 1000, + opts = { + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- "hard", "soft", or "" + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + }, + }, + { + "rose-pine/neovim", + name = "rose-pine", + }, + { + "folke/tokyonight.nvim", + lazy = false, + opts = { + style = "night", -- "night", "storm", "moon", "day" + styles = { + functions = {} -- disable italic for functions + }, + on_colors = function(colors) + colors.hint = colors.orange + colors.error = "#ff0000" + end + }, + } +} diff --git a/src_files/.config/nvim/lua/david_standard/plugins_lazy/fugitive_git.lua b/src_files/.config/nvim/lua/david_standard/plugins_lazy/fugitive_git.lua new file mode 100644 index 0000000..e756a3b --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugins_lazy/fugitive_git.lua @@ -0,0 +1,3 @@ +return { + { "tpope/vim-fugitive" }, +} diff --git a/src_files/.config/nvim/lua/david_standard/plugins_lazy/harpoon.lua b/src_files/.config/nvim/lua/david_standard/plugins_lazy/harpoon.lua new file mode 100644 index 0000000..ed152dc --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugins_lazy/harpoon.lua @@ -0,0 +1,11 @@ +return { + { + "ThePrimeagen/harpoon", + branch = "harpoon2", -- https://github.com/ThePrimeagen/harpoon/tree/harpoon2 + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + end, + }, +} diff --git a/src_files/.config/nvim/lua/david_standard/plugins_lazy/telescope.lua b/src_files/.config/nvim/lua/david_standard/plugins_lazy/telescope.lua new file mode 100644 index 0000000..66427b0 --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugins_lazy/telescope.lua @@ -0,0 +1,30 @@ +local glob_patterns_find_files = { + "-g", "!**/.git/**", + "-g", "!**/build/**", + "-g", "!**/node_modules/**", +} +local glob_patterns_live_grep = { + unpack(glob_patterns_find_files), -- same for now +} + +return { + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { + pickers = { + find_files = { + find_command = { + "rg", "--no-ignore", "--hidden", "--files", + unpack(glob_patterns_find_files), + }, + }, + live_grep = { + additional_args = { + "--no-ignore", "--hidden", + unpack(glob_patterns_live_grep), + } + }, + }, + }, +} diff --git a/src_files/.config/nvim/lua/david_standard/plugins_lazy/treesitter.lua b/src_files/.config/nvim/lua/david_standard/plugins_lazy/treesitter.lua new file mode 100644 index 0000000..08eafb2 --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugins_lazy/treesitter.lua @@ -0,0 +1,73 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + branch = 'master', + lazy = false, + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "vimdoc", "bash", "lua", "c", "cpp", "go", "python", "ruby", + "html", "css", "json", "sql", "javascript", "jsdoc", + "markdown", "markdown_inline", + -- "odin", "zig", "ocaml", "java", "typescript", + }, + sync_install = false, -- install `ensure_installed` parsers synchronously + auto_install = true, -- install missing on BufEnter, requires tree-sitter CLI + ignore_install = {}, + -- indent = { enable = true }, -- TODO: do i want this? + highlight = { + enable = true, -- `false` will disable the whole extension + disable = function(lang, buf) + for i, v in ipairs({ "html", }) do + if lang == v then + print("treesitter disabled for this language") + return true + end + end + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > (100 * 1024) then -- 100 KB + vim.notify( + "larger file, treesitter disabled for performance", + vim.log.levels.WARN, + {title = "Treesitter"} + ) + return true + end + end, + -- true, false, or list of langs; may cause slowness or duplicate highlights + additional_vim_regex_highlighting = { "markdown" }, + }, + }) + + -- TODO: decide if needed/wanted + -- local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() + -- treesitter_parser_config.templ = { + -- install_info = { + -- url = "https://github.com/vrischmann/tree-sitter-templ.git", + -- files = {"src/parser.c", "src/scanner.c"}, + -- branch = "master", + -- }, + -- } + + -- vim.treesitter.language.register("templ", "templ") + end + }, + { + "nvim-treesitter/nvim-treesitter-context", + after = "nvim-treesitter", + opts = { + enable = true, -- can enable/disable via manual command + multiwindow = false, + max_lines = 0, -- lines the window should span; x <= 0 means no limit + min_window_height = 10, -- min window height to enable; x <= 0 means no limit + line_numbers = true, + multiline_threshold = 40, -- max lines to show for a single context + trim_scope = 'outer', -- 'inner', 'outer'; discard lines if max_lines exceeded + mode = 'cursor', -- 'cursor', 'topline'; line used to calculate context + separator = "-", -- 1 char, like '-'; only shown when >= 2 lines above + zindex = 20, -- z-index of the context window + on_attach = nil, -- (fun(buf: integer): boolean); return false to disable attaching + }, + }, +} diff --git a/src_files/.config/nvim/lua/david_standard/plugins_lazy/undotree.lua b/src_files/.config/nvim/lua/david_standard/plugins_lazy/undotree.lua new file mode 100644 index 0000000..67aef8e --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/plugins_lazy/undotree.lua @@ -0,0 +1,3 @@ +return { + "mbbill/undotree", +} diff --git a/src_files/.config/nvim/lua/david_standard/remaps.lua b/src_files/.config/nvim/lua/david_standard/remaps.lua new file mode 100644 index 0000000..de1da84 --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/remaps.lua @@ -0,0 +1,82 @@ +vim.keymap.set("n", "d", vim.cmd.Ex) + +-- vim.keymap.set("v", "J", ":m '>+1gv=gv") +-- vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- vim.api.nvim_set_keymap("n", "tf", "PlenaryTestFile", { noremap = false, silent = false }) + +-- vim.keymap.set("n", "J", "mzJ`z") +-- vim.keymap.set("n", "", "zz") +-- vim.keymap.set("n", "", "zz") +-- vim.keymap.set("n", "n", "nzzzv") +-- vim.keymap.set("n", "N", "Nzzzv") +-- vim.keymap.set("n", "=ap", "ma=ap'a") +-- vim.keymap.set("n", "zig", "LspRestart") + +-- vim.keymap.set("n", "vwm", function() +-- require("vim-with-me").StartVimWithMe() +-- end) +-- vim.keymap.set("n", "svwm", function() +-- require("vim-with-me").StopVimWithMe() +-- end) + +-- -- greatest remap ever +-- vim.keymap.set("x", "p", [["_dP]]) + +-- -- next greatest remap ever : asbjornHaland +-- vim.keymap.set({ "n", "v" }, "y", [["+y]]) +-- vim.keymap.set("n", "Y", [["+Y]]) + +-- vim.keymap.set({ "n", "v" }, "d", "\"_d") + +-- -- This is going to get me cancelled +-- vim.keymap.set("i", "", "") + +-- vim.keymap.set("n", "Q", "") +-- vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +-- vim.keymap.set("n", "", "silent !tmux-sessionizer -s 0 --vsplit") +-- vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer -s 0") +-- vim.keymap.set("n", "f", function() +-- require("conform").format({ bufnr = 0 }) +-- end) + +-- vim.keymap.set("n", "", "cnextzz") +-- vim.keymap.set("n", "", "cprevzz") +-- vim.keymap.set("n", "k", "lnextzz") +-- vim.keymap.set("n", "j", "lprevzz") + +-- vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) +-- vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) + +-- vim.keymap.set( +-- "n", +-- "ee", +-- "oif err != nil {}Oreturn err" +-- ) + +-- vim.keymap.set( +-- "n", +-- "ea", +-- "oassert.NoError(err, \"\")F\";a" +-- ) + +-- vim.keymap.set( +-- "n", +-- "ef", +-- "oif err != nil {}Olog.Fatalf(\"error: %s\\n\", err.Error())jj" +-- ) + +-- vim.keymap.set( +-- "n", +-- "el", +-- "oif err != nil {}O.logger.Error(\"error\", \"error\", err)F.;i" +-- ) + +-- vim.keymap.set("n", "ca", function() +-- require("cellular-automaton").start_animation("make_it_rain") +-- end) + +-- vim.keymap.set("n", "", function() +-- vim.cmd("so") +-- end) + diff --git a/src_files/.config/nvim/lua/david_standard/settings.lua b/src_files/.config/nvim/lua/david_standard/settings.lua new file mode 100644 index 0000000..edb2e9d --- /dev/null +++ b/src_files/.config/nvim/lua/david_standard/settings.lua @@ -0,0 +1,33 @@ +vim.g.mapleader = " " + +-- vim.opt.guicursor = "" + +vim.opt.nu = true +vim.opt.relativenumber = true + +-- vim.opt.tabstop = 4 +-- vim.opt.softtabstop = 4 +-- vim.opt.shiftwidth = 4 +-- vim.opt.expandtab = true + +-- vim.opt.smartindent = true + +-- vim.opt.wrap = false + +-- vim.opt.swapfile = false +-- vim.opt.backup = false +-- vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +-- vim.opt.undofile = true + +-- vim.opt.hlsearch = false +-- vim.opt.incsearch = true + +-- vim.opt.termguicolors = true + +-- vim.opt.scrolloff = 8 +-- vim.opt.signcolumn = "yes" +-- vim.opt.isfname:append("@-@") + +-- vim.opt.updatetime = 50 + +-- vim.opt.colorcolumn = "90"