Merge branch 'master' of git.blakenorth.net/home/git/dotfiles
This commit is contained in:
commit
2c0d21938d
5 changed files with 45 additions and 28 deletions
|
@ -111,6 +111,12 @@ M.gitsigns = function()
|
||||||
},
|
},
|
||||||
attach_to_untracked = true,
|
attach_to_untracked = true,
|
||||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
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 = {
|
current_line_blame_opts = {
|
||||||
virt_text = true,
|
virt_text = true,
|
||||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||||
|
|
|
@ -3,11 +3,18 @@
|
||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
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]]
|
vim.cmd [[packadd packer.nvim]]
|
||||||
end
|
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
|
local use = require('packer').use
|
||||||
|
|
||||||
return require('packer').startup({function()
|
return require('packer').startup({function()
|
||||||
|
@ -86,12 +93,25 @@ return require('packer').startup({function()
|
||||||
vim.cmd 'command! COL ColorizerToggle'
|
vim.cmd 'command! COL ColorizerToggle'
|
||||||
end,
|
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)
|
use { -- lumen: make vim respect the system light/dark theme setting (linux + macos)
|
||||||
'vimpostor/vim-lumen',
|
'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', '<a-i>', 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
|
-- IDE features
|
||||||
---- LSP
|
---- LSP
|
||||||
|
@ -186,7 +206,7 @@ return require('packer').startup({function()
|
||||||
require("null-ls").setup({
|
require("null-ls").setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.code_actions.refactoring,
|
null_ls.builtins.code_actions.refactoring,
|
||||||
null_ls.builtins.formatting.clang_format,
|
null_ls.builtins.formatting.jq,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
@ -272,13 +292,6 @@ return require('packer').startup({function()
|
||||||
require('blake.other').gitsigns()
|
require('blake.other').gitsigns()
|
||||||
end,
|
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
|
use { -- toggleterm: terminal
|
||||||
'akinsho/toggleterm.nvim',
|
'akinsho/toggleterm.nvim',
|
||||||
branch = 'main',
|
branch = 'main',
|
||||||
|
@ -327,9 +340,9 @@ return require('packer').startup({function()
|
||||||
require('blake.other').indent_blankline()
|
require('blake.other').indent_blankline()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
-- use { -- targets.vim: fix ci' and other things to work right
|
use { -- targets.vim: fix ci' and other things to work better
|
||||||
-- 'wellle/targets.vim',
|
'wellle/targets.vim',
|
||||||
-- }
|
}
|
||||||
use { -- nvim-tree: File explorer
|
use { -- nvim-tree: File explorer
|
||||||
'kyazdani42/nvim-tree.lua',
|
'kyazdani42/nvim-tree.lua',
|
||||||
requires = { 'kyazdani42/nvim-web-devicons' },
|
requires = { 'kyazdani42/nvim-web-devicons' },
|
||||||
|
@ -431,14 +444,12 @@ return require('packer').startup({function()
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
use { -- cheat.sh integration
|
|
||||||
'dbeniamine/cheat.sh-vim',
|
|
||||||
}
|
|
||||||
use { -- nvim-align: Align text
|
use { -- nvim-align: Align text
|
||||||
'RRethy/nvim-align',
|
'RRethy/nvim-align',
|
||||||
}
|
}
|
||||||
use { -- comment.nvim: toggle comments - gb and gc
|
use { -- comment.nvim: toggle comments - gb and gc
|
||||||
'numToStr/Comment.nvim',
|
'PowerUser64/Comment.nvim',
|
||||||
|
branch = 'lockmarks',
|
||||||
config = function()
|
config = function()
|
||||||
require('Comment').setup {
|
require('Comment').setup {
|
||||||
mappings = {
|
mappings = {
|
||||||
|
@ -448,9 +459,6 @@ return require('packer').startup({function()
|
||||||
}
|
}
|
||||||
end
|
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
|
use { -- filetype.nvim: detect filetype a lot faster than stock neovim
|
||||||
'nathom/filetype.nvim',
|
'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)
|
use { -- tpope: sleuth: automatically get info about files and apply it to vim (tabs vs spaces, etc)
|
||||||
'tpope/vim-sleuth',
|
'tpope/vim-sleuth',
|
||||||
}
|
}
|
||||||
|
use { -- tpope: eunuch: some unix shell commands in vim
|
||||||
|
'tpope/vim-eunuch',
|
||||||
|
}
|
||||||
|
|
||||||
-- Bootstrap packer if needed {
|
-- Bootstrap packer if needed {
|
||||||
if (packer_bootstrap) then
|
if (Packer_bootstrap) then
|
||||||
print('Please wait for packer to install plugins')
|
print('Please wait for packer to install plugins')
|
||||||
require('packer').sync()
|
require('packer').sync()
|
||||||
end
|
end
|
||||||
|
@ -568,7 +579,7 @@ config = {
|
||||||
-- Don't ask before removing plugins
|
-- Don't ask before removing plugins
|
||||||
autoremove = true,
|
autoremove = true,
|
||||||
-- Limit max jobs to avoid getting killed on low-end hardware
|
-- 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 { -- .\+: \+\)\@<=[^ ][^:]\+$
|
-- how to align all plugin descriptions: select all plugins in visual line, :'<,'>Align \(.\+use { -- .\+: \+\)\@<=[^ ][^:]\+$
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Purpose: edit nvim configuration while being cd'd into the directory that
|
# Purpose: edit nvim configuration while being cd'd into the directory that
|
||||||
# most of the files live so they can easily be :e'd
|
# most of the files live so they can easily be :e'd
|
||||||
# Usage: nvc
|
# Usage: nvc [$EDITOR options]
|
||||||
cd ~/.config/nvim/lua/blake \
|
cd ~/.config/nvim/lua/blake \
|
||||||
&& nvim ../../init.lua
|
&& $EDITOR "$@" ../../init.lua
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
# [optional: operation (source, exec, command or nothing)] \
|
# [optional: operation (source, exec, command or nothing)] \
|
||||||
careful_source() {
|
careful_source() {
|
||||||
if test "${4:--f}" "$1"; then
|
if test "${4:--f}" "$1"; then
|
||||||
${5:-source} "$1"
|
${5:-.} "$1"
|
||||||
else
|
else
|
||||||
if test -n "${2+foo}"; then
|
if test -n "${2+foo}"; then
|
||||||
printf "%s\n" "$2" >&2
|
printf "%s\n" "$2" >&2
|
||||||
|
|
2
.zshrc
2
.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"
|
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 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" && \
|
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"
|
print -P "%F{160}▓▒░ The clone has failed.%f%b"
|
||||||
elif [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
elif [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
|
|
Loading…
Add table
Reference in a new issue