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' diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 42da65a..a333f4c 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -3,11 +3,18 @@ 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 -- }} +-- 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 +end + local use = require('packer').use return require('packer').startup({function() @@ -86,12 +93,25 @@ 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', } + use { -- vim-illuminate: highlight other occurrences of the word under cursor + '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', + 'regex', + } + }) + end + } -- IDE features ---- LSP @@ -186,7 +206,7 @@ return require('packer').startup({function() require("null-ls").setup({ sources = { null_ls.builtins.code_actions.refactoring, - null_ls.builtins.formatting.clang_format, + null_ls.builtins.formatting.jq, } }) end @@ -272,13 +292,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', @@ -327,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' }, @@ -431,14 +444,12 @@ return require('packer').startup({function() } end } - use { -- cheat.sh integration - 'dbeniamine/cheat.sh-vim', - } use { -- nvim-align: Align text '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 = { @@ -448,9 +459,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', } @@ -548,9 +556,12 @@ 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 + if (Packer_bootstrap) then print('Please wait for packer to install plugins') require('packer').sync() end @@ -568,7 +579,7 @@ config = { -- Don't ask before removing plugins autoremove = true, -- Limit max jobs to avoid getting killed on low-end hardware - max_jobs = 2, + max_jobs = Packer_max_jobs, }}) -- how to align all plugin descriptions: select all plugins in visual line, :'<,'>Align \(.\+use { -- .\+: \+\)\@<=[^ ][^:]\+$ 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 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 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"