From 932f7764b5787ad038d016bc26051a61a265cc71 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 19 Aug 2022 13:53:02 -0700 Subject: [PATCH 01/16] shell: nvc: pass through arguments to $EDITOR --- .config/shell/bin/nvc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/shell/bin/nvc b/.config/shell/bin/nvc index d6869fb..920241a 100755 --- a/.config/shell/bin/nvc +++ b/.config/shell/bin/nvc @@ -1,6 +1,6 @@ #!/bin/sh # Purpose: edit nvim configuration while being cd'd into the directory that # most of the files live so they can easily be :e'd -# Usage: nvc +# Usage: nvc [$EDITOR options] cd ~/.config/nvim/lua/blake \ - && nvim ../../init.lua + && $EDITOR "$@" ../../init.lua From e20be55819870e05c0e8c712f1101a4470c26cb1 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 19 Aug 2022 23:52:14 -0700 Subject: [PATCH 02/16] zsh: add extra newline before 'Please Wait for plugins to install' --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index a3f6302..f12968f 100644 --- a/.zshrc +++ b/.zshrc @@ -15,7 +15,7 @@ ${SKIP_PLUGINS:-false} || { print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" command mkdir -p "$ZINIT_HOME_DIR" && command chmod g-rwX "$ZINIT_HOME_DIR" command git clone https://github.com/zdharma-continuum/zinit "$ZINIT_HOME_DIR/bin" && \ - print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b\nPlease wait while plugins install." || \ + print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b\n\nPlease wait while plugins install." || \ print -P "%F{160}▓▒░ The clone has failed.%f%b" elif [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" From fa06fe9866878c44b8f6cf955698c52d8771809b Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 21 Aug 2022 20:57:19 -0700 Subject: [PATCH 03/16] shell: sh compatibility --- .config/shell/shrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/shell/shrc b/.config/shell/shrc index 3022331..d027687 100644 --- a/.config/shell/shrc +++ b/.config/shell/shrc @@ -19,7 +19,7 @@ # [optional: operation (source, exec, command or nothing)] \ careful_source() { if test "${4:--f}" "$1"; then - ${5:-source} "$1" + ${5:-.} "$1" else if test -n "${2+foo}"; then printf "%s\n" "$2" >&2 From 5c1f01f3a22f2663b6bfadbcee8a65034e731286 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 24 Aug 2022 04:11:15 -0700 Subject: [PATCH 04/16] nvim: move vim-illuminate, add config, and use personal repo --- .config/nvim/lua/blake/plugins.lua | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 53875eb..192f5bc 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -3,7 +3,7 @@ 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 - packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + Packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) vim.cmd [[packadd packer.nvim]] end -- }} @@ -92,6 +92,20 @@ return require('packer').startup({function() use { -- lumen: make vim respect the system light/dark theme setting (linux + macos) 'vimpostor/vim-lumen', } + use { -- vim-illuminate: highlight other occurrences of the word under cursor + -- 'RRethy/vim-illuminate', + -- commit = '27f6ef135a88d9410a33cf92fc47f5c018df552c', + 'PowerUser64/vim-illuminate', + branch = 'wrapscan', + config = function() + require('illuminate').configure({ + providers = { + 'treesitter', + 'regex', + } + }) + end + } -- IDE features ---- LSP @@ -180,7 +194,8 @@ return require('packer').startup({function() } use { -- null-ls: Support for lots of programming tools, but through nvim lsp 'jose-elias-alvarez/null-ls.nvim', - requires = { 'nvim-lua/plenary.nvim' }, + disable = true, + -- requires = { 'nvim-lua/plenary.nvim' }, config = function() local null_ls = require("null-ls") require("null-ls").setup({ @@ -448,9 +463,6 @@ return require('packer').startup({function() } end } - use { -- vim-illuminate: highlight other occurrences of the word under cursor - 'RRethy/vim-illuminate', - } use { -- filetype.nvim: detect filetype a lot faster than stock neovim 'nathom/filetype.nvim', } @@ -550,7 +562,7 @@ return require('packer').startup({function() } -- Bootstrap packer if needed { - if (packer_bootstrap) then + if (Packer_bootstrap) then print('Please wait for packer to install plugins') require('packer').sync() end From 1fd1dc8ac17d8cc2e8470a9dfc618791d4af6dcd Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 24 Aug 2022 04:11:50 -0700 Subject: [PATCH 05/16] nvim: lower packer's max_jobs to 5 in termux --- .config/nvim/lua/blake/plugins.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 192f5bc..cff5c2b 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -8,6 +8,13 @@ if fn.empty(fn.glob(install_path)) > 0 then end -- }} +-- Reduce the maximum number of jobs in termux (a terminal for android) +if os.getenv("TERMUX_VERSION") ~= nil then + Packer_max_jobs = 5 +else + Packer_max_jobs = 100 +end + local use = require('packer').use return require('packer').startup({function() @@ -580,7 +587,7 @@ config = { -- Don't ask before removing plugins autoremove = true, -- Limit max jobs to avoid getting killed on low-end hardware - max_jobs = 50, + max_jobs = Packer_max_jobs, }}) -- how to align all plugin descriptions: select all plugins in visual line, :'<,'>Align \(.\+use { -- .\+: \+\)\@<=[^ ][^:]\+$ From 663a03ee17c4103cb36d4034a623e422d681fa34 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 24 Aug 2022 04:53:27 -0700 Subject: [PATCH 06/16] nvim: look for WEAK_SYSTEM variable as well as TERMUX_VERSION --- .config/nvim/lua/blake/plugins.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index cff5c2b..cfaafab 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -8,8 +8,8 @@ if fn.empty(fn.glob(install_path)) > 0 then end -- }} --- Reduce the maximum number of jobs in termux (a terminal for android) -if os.getenv("TERMUX_VERSION") ~= nil then +-- Reduce the maximum number of jobs in termux (a terminal for android) or if WEAK_SYSTEM is set to true +if os.getenv("TERMUX_VERSION") ~= nil or os.getenv("WEAK_SYSTEM") == "true" then Packer_max_jobs = 5 else Packer_max_jobs = 100 From 203556ba97149e26ffb95c144ee95793f86de09b Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:38:17 -0700 Subject: [PATCH 07/16] nvim: show gitsigns where dotfiles live --- .config/nvim/lua/blake/other.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.config/nvim/lua/blake/other.lua b/.config/nvim/lua/blake/other.lua index d64f436..6f65e73 100644 --- a/.config/nvim/lua/blake/other.lua +++ b/.config/nvim/lua/blake/other.lua @@ -111,6 +111,12 @@ M.gitsigns = function() }, attach_to_untracked = true, current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + worktrees = { + { + toplevel = vim.env.HOME, + gitdir = vim.env.HOME .. '/git/dotfiles' + }, + }, current_line_blame_opts = { virt_text = true, virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' From c47d4a5d28d9468597d3409f6a5bce13144b0c7d Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:39:17 -0700 Subject: [PATCH 08/16] nvim: delete old nvim-tree --- .config/nvim/lua/blake/plugins.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index cff5c2b..5c310ad 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -294,13 +294,6 @@ return require('packer').startup({function() require('blake.other').gitsigns() end, } - -- use { -- nvim-tree: file manager - -- 'kyazdani42/nvim-tree.lua', - -- requires = { 'kyazdani42/nvim-web-devicons' }, - -- config = function() - -- require('blake.other').nvimtree() - -- end - -- } use { -- toggleterm: terminal 'akinsho/toggleterm.nvim', branch = 'main', From 9db718e3031783a9a727b1ee6727698ecc900b83 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:40:09 -0700 Subject: [PATCH 09/16] nvim: FIRST PR - now I don't need to use my own illuminate branch --- .config/nvim/lua/blake/plugins.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 5c310ad..6e3cb4f 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -100,11 +100,13 @@ return require('packer').startup({function() 'vimpostor/vim-lumen', } use { -- vim-illuminate: highlight other occurrences of the word under cursor - -- 'RRethy/vim-illuminate', - -- commit = '27f6ef135a88d9410a33cf92fc47f5c018df552c', - 'PowerUser64/vim-illuminate', - branch = 'wrapscan', + 'RRethy/vim-illuminate', + -- commit = '27f6ef135a88d9410a33cf92fc47f5c018df552c', -- for finding the correct color to make highlights config = function() + vim.keymap.set('n', '', require('illuminate').toggle_freeze_buf) + vim.api.nvim_set_hl(0, "IlluminatedWordText", { bg = "#3b4261" }) + vim.api.nvim_set_hl(0, "IlluminatedWordRead", { bg = "#3b4261" }) + vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { bg = "#3b4261" }) require('illuminate').configure({ providers = { 'treesitter', From 22f15d427ed91a3040e2ed88f9e6077ac0a3459c Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:41:18 -0700 Subject: [PATCH 10/16] nvim: remove ifdef-highlighting --- .config/nvim/lua/blake/plugins.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 6e3cb4f..290c933 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -93,9 +93,6 @@ return require('packer').startup({function() vim.cmd 'command! COL ColorizerToggle' end, } - use { -- ifdef-highlighting: highlight c/c++ ifdef's - :Define :Undefine - 'vim-scripts/ifdef-highlighting' - } use { -- lumen: make vim respect the system light/dark theme setting (linux + macos) 'vimpostor/vim-lumen', } From 14a6f1f16878283ef6a69fd319c4cabdd76be065 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:43:32 -0700 Subject: [PATCH 11/16] nvim: un-disable null-ls and add jq for formatting --- .config/nvim/lua/blake/plugins.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 290c933..1b498a7 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -200,14 +200,13 @@ return require('packer').startup({function() } use { -- null-ls: Support for lots of programming tools, but through nvim lsp 'jose-elias-alvarez/null-ls.nvim', - disable = true, - -- requires = { 'nvim-lua/plenary.nvim' }, + requires = { 'nvim-lua/plenary.nvim' }, config = function() local null_ls = require("null-ls") require("null-ls").setup({ sources = { null_ls.builtins.code_actions.refactoring, - null_ls.builtins.formatting.clang_format, + null_ls.builtins.formatting.jq, } }) end From d75eaa24af5b6926038881c72dfc8074faf8c8a0 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:44:19 -0700 Subject: [PATCH 12/16] nvim: re-add targets.vim --- .config/nvim/lua/blake/plugins.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 1b498a7..7f19fb5 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -340,9 +340,9 @@ return require('packer').startup({function() require('blake.other').indent_blankline() end } - -- use { -- targets.vim: fix ci' and other things to work right - -- 'wellle/targets.vim', - -- } + use { -- targets.vim: fix ci' and other things to work better + 'wellle/targets.vim', + } use { -- nvim-tree: File explorer 'kyazdani42/nvim-tree.lua', requires = { 'kyazdani42/nvim-web-devicons' }, From 80ecc7c2ba8b38a3ce7327a3fe6e173eed18d830 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:45:11 -0700 Subject: [PATCH 13/16] nvim: remove cheat.sh-vim (cool, but I didn't use it) --- .config/nvim/lua/blake/plugins.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 7f19fb5..7c41922 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -444,9 +444,6 @@ return require('packer').startup({function() } end } - use { -- cheat.sh integration - 'dbeniamine/cheat.sh-vim', - } use { -- nvim-align: Align text 'RRethy/nvim-align', } From 32c9cd3c1b696956a9c3aec7dbcd5732eff85d0f Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:45:45 -0700 Subject: [PATCH 14/16] nvim: temporary: swap to own branch of Comment.nvim --- .config/nvim/lua/blake/plugins.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 7c41922..22a4f9c 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -448,7 +448,8 @@ return require('packer').startup({function() 'RRethy/nvim-align', } use { -- comment.nvim: toggle comments - gb and gc - 'numToStr/Comment.nvim', + 'PowerUser64/Comment.nvim', + branch = 'lockmarks', config = function() require('Comment').setup { mappings = { From b439deb468e2549f455bb8d69142ee8182ab0347 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:46:41 -0700 Subject: [PATCH 15/16] nvim: add tpope/eunuch --- .config/nvim/lua/blake/plugins.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 22a4f9c..ecf298e 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -556,6 +556,9 @@ return require('packer').startup({function() use { -- tpope: sleuth: automatically get info about files and apply it to vim (tabs vs spaces, etc) 'tpope/vim-sleuth', } + use { -- tpope: eunuch: some unix shell commands in vim + 'tpope/vim-eunuch', + } -- Bootstrap packer if needed { if (Packer_bootstrap) then From 06df2258c6286db4293fe5ff83564c1b4e0aa8a5 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Thu, 25 Aug 2022 02:53:07 -0700 Subject: [PATCH 16/16] nvim: parens --- .config/nvim/lua/blake/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index cfaafab..1d1d486 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -9,7 +9,7 @@ end -- }} -- Reduce the maximum number of jobs in termux (a terminal for android) or if WEAK_SYSTEM is set to true -if os.getenv("TERMUX_VERSION") ~= nil or os.getenv("WEAK_SYSTEM") == "true" then +if (os.getenv("TERMUX_VERSION") ~= nil) or (os.getenv("WEAK_SYSTEM") == "true") then Packer_max_jobs = 5 else Packer_max_jobs = 100