mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-31 19:47:10 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95d358ae3d | ||
|
|
cea61a5719 | ||
|
|
28c29d94f2 | ||
|
|
1028d3847c | ||
| 3498c6b739 | |||
| 83eb7d861e | |||
| 22090129ec | |||
|
|
5b0ca2a63b | ||
|
|
c5fa136a1f | ||
|
|
9a63aaff74 | ||
| 5e68077ac2 | |||
| 72b9acd710 | |||
|
|
469044bb2a | ||
|
|
96a362474c | ||
|
|
1b9dfac671 | ||
|
|
7dbaf8204b |
4
Brewfile
4
Brewfile
@@ -50,6 +50,8 @@ brew "pkg-config"
|
|||||||
brew "choose-rust"
|
brew "choose-rust"
|
||||||
# Cross-platform make
|
# Cross-platform make
|
||||||
brew "cmake"
|
brew "cmake"
|
||||||
|
# Dependency manager for Cocoa projects
|
||||||
|
brew "cocoapods"
|
||||||
# Get, unpack, build, and install modules from CPAN
|
# Get, unpack, build, and install modules from CPAN
|
||||||
brew "cpanminus"
|
brew "cpanminus"
|
||||||
# Open source suite of directory software
|
# Open source suite of directory software
|
||||||
@@ -276,6 +278,8 @@ cask "dbngin"
|
|||||||
cask "docker"
|
cask "docker"
|
||||||
# Reimagine your terminal
|
# Reimagine your terminal
|
||||||
cask "fig"
|
cask "fig"
|
||||||
|
# UI toolkit for building applications for mobile, web and desktop
|
||||||
|
cask "flutter"
|
||||||
# Unofficial overcast.fm podcast app
|
# Unofficial overcast.fm podcast app
|
||||||
cask "fog"
|
cask "fog"
|
||||||
# Typeface made for developers
|
# Typeface made for developers
|
||||||
|
|||||||
18
config/astronvim/lua/user/.luacheckrc
Normal file
18
config/astronvim/lua/user/.luacheckrc
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
-- Global objects
|
||||||
|
globals = {
|
||||||
|
"astronvim",
|
||||||
|
"astronvim_installation",
|
||||||
|
"vim",
|
||||||
|
"bit",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Rerun tests only if their modification time changed
|
||||||
|
cache = true
|
||||||
|
|
||||||
|
-- Don't report unused self arguments of methods
|
||||||
|
self = false
|
||||||
|
|
||||||
|
ignore = {
|
||||||
|
"631", -- max_line_length
|
||||||
|
"212/_.*", -- unused argument, for vars with "_" prefix
|
||||||
|
}
|
||||||
20
config/astronvim/lua/user/.neoconf.json
Normal file
20
config/astronvim/lua/user/.neoconf.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"neodev": {
|
||||||
|
"library": {
|
||||||
|
"enabled": true,
|
||||||
|
"plugins": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neoconf": {
|
||||||
|
"plugins": {
|
||||||
|
"lua_ls": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lspconfig": {
|
||||||
|
"lua_ls": {
|
||||||
|
"Lua.format.enable": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,6 +22,7 @@ return {
|
|||||||
["<leader>b"] = { name = "Buffers" },
|
["<leader>b"] = { name = "Buffers" },
|
||||||
-- quick save
|
-- quick save
|
||||||
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||||
|
["<leader>P"] = { ":Telescope projects<cr>", desc = "Update Projects listing" },
|
||||||
},
|
},
|
||||||
t = {
|
t = {
|
||||||
-- setting a mapping to false will disable it
|
-- setting a mapping to false will disable it
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ return {
|
|||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
-- disable notifications when toggling UI elements
|
-- disable notifications when toggling UI elements
|
||||||
ui_notifications_enabled = true,
|
ui_notifications_enabled = true,
|
||||||
|
-- enable experimental resession.nvim session management (will be default in AstroNvim v4)
|
||||||
|
resession_enabled = false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
-- If you need more control, you can use the function()...end notation
|
-- If you need more control, you can use the function()...end notation
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ return {
|
|||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
auto_open = true,
|
auto_open = true,
|
||||||
position = "right"
|
position = "bottom"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ import = "astrocommunity.editing-support.refactoring-nvim" },
|
{ import = "astrocommunity.editing-support.refactoring-nvim" },
|
||||||
@@ -40,8 +40,15 @@ return {
|
|||||||
{ import = "astrocommunity.indent.mini-indentscope" },
|
{ import = "astrocommunity.indent.mini-indentscope" },
|
||||||
{ import = "astrocommunity.markdown-and-latex.glow-nvim" },
|
{ import = "astrocommunity.markdown-and-latex.glow-nvim" },
|
||||||
{ import = "astrocommunity.motion.harpoon" },
|
{ import = "astrocommunity.motion.harpoon" },
|
||||||
|
{ import = "astrocommunity.pack.ansible" },
|
||||||
|
{ import = "astrocommunity.pack.bash" },
|
||||||
|
{ import = "astrocommunity.pack.docker" },
|
||||||
|
{ import = "astrocommunity.pack.go" },
|
||||||
|
{ import = "astrocommunity.pack.html-css" },
|
||||||
|
{ import = "astrocommunity.pack.markdown" },
|
||||||
{ import = "astrocommunity.pack.php" },
|
{ import = "astrocommunity.pack.php" },
|
||||||
{ import = "astrocommunity.project.neoconf-nvim" },
|
{ import = "astrocommunity.pack.typescript" },
|
||||||
|
{ import = "astrocommunity.pack.vue" },
|
||||||
{ import = "astrocommunity.project.nvim-spectre" },
|
{ import = "astrocommunity.project.nvim-spectre" },
|
||||||
{ import = "astrocommunity.project.project-nvim" },
|
{ import = "astrocommunity.project.project-nvim" },
|
||||||
{ import = "astrocommunity.test.neotest" },
|
{ import = "astrocommunity.test.neotest" },
|
||||||
|
|||||||
@@ -4,29 +4,41 @@ return {
|
|||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
-- overrides `require("mason-lspconfig").setup(...)`
|
-- overrides `require("mason-lspconfig").setup(...)`
|
||||||
opts = {
|
opts = function(_, opts)
|
||||||
ensure_installed = {
|
-- add more things to the ensure_installed table protecting against community packs modifying it
|
||||||
"diagnosticls",
|
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
|
||||||
},
|
-- "lua_ls",
|
||||||
},
|
})
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
-- use mason-null-ls to configure Formatters/Linter
|
-- use mason-null-ls to configure Formatters/Linter
|
||||||
-- installation for null-ls sources
|
-- installation for null-ls sources
|
||||||
{
|
{
|
||||||
"jay-babu/mason-null-ls.nvim",
|
"jay-babu/mason-null-ls.nvim",
|
||||||
-- overrides `require("mason-null-ls").setup(...)`
|
-- overrides `require("mason-null-ls").setup(...)`
|
||||||
opts = {
|
opts = function(_, opts)
|
||||||
automatic_setup = true,
|
-- add more things to the ensure_installed table protecting against community packs modifying it
|
||||||
automatic_installation = true,
|
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
|
||||||
},
|
-- "prettier",
|
||||||
|
-- "stylua",
|
||||||
|
})
|
||||||
|
opts.automatic_setup = true
|
||||||
|
opts.automatic_installation = true
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
-- overrides `require("mason-nvim-dap").setup(...)`
|
-- overrides `require("mason-nvim-dap").setup(...)`
|
||||||
opts = {
|
opts = function(_, opts)
|
||||||
automatic_installation = true,
|
-- add more things to the ensure_installed table protecting against community packs modifying it
|
||||||
automatic_setup = true,
|
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
|
||||||
ensure_installed = { "python", "php", "js", "bash" },
|
"python",
|
||||||
},
|
"php",
|
||||||
|
"js",
|
||||||
|
"bash"
|
||||||
|
})
|
||||||
|
opts.automatic_installation = true
|
||||||
|
opts.automatic_setup = true
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,14 +30,8 @@ return {
|
|||||||
null_ls.builtins.diagnostics.tfsec,
|
null_ls.builtins.diagnostics.tfsec,
|
||||||
null_ls.builtins.diagnostics.trail_space,
|
null_ls.builtins.diagnostics.trail_space,
|
||||||
null_ls.builtins.diagnostics.tsc,
|
null_ls.builtins.diagnostics.tsc,
|
||||||
null_ls.builtins.diagnostics.vacuum,
|
|
||||||
null_ls.builtins.diagnostics.vint,
|
|
||||||
null_ls.builtins.diagnostics.vulture,
|
|
||||||
null_ls.builtins.diagnostics.yamllint,
|
|
||||||
null_ls.builtins.diagnostics.zsh,
|
null_ls.builtins.diagnostics.zsh,
|
||||||
null_ls.builtins.formatting.blade_formatter,
|
|
||||||
null_ls.builtins.formatting.clang_format,
|
null_ls.builtins.formatting.clang_format,
|
||||||
null_ls.builtins.formatting.eslint,
|
|
||||||
null_ls.builtins.formatting.fixjson,
|
null_ls.builtins.formatting.fixjson,
|
||||||
null_ls.builtins.formatting.isort,
|
null_ls.builtins.formatting.isort,
|
||||||
null_ls.builtins.formatting.jq,
|
null_ls.builtins.formatting.jq,
|
||||||
@@ -45,7 +39,6 @@ return {
|
|||||||
null_ls.builtins.formatting.shfmt.with {
|
null_ls.builtins.formatting.shfmt.with {
|
||||||
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" },
|
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" },
|
||||||
},
|
},
|
||||||
null_ls.builtins.formatting.stylelint,
|
|
||||||
}
|
}
|
||||||
return config -- return final config table
|
return config -- return final config table
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
opts = {
|
opts = function(_, opts)
|
||||||
ensure_installed = {
|
opts.ensure_installed = require("astronvim.utils").list_insert_unique(opts.ensure_installed, {
|
||||||
"bash",
|
"bash",
|
||||||
"c",
|
"c",
|
||||||
"cmake",
|
"cmake",
|
||||||
@@ -28,6 +28,6 @@ return {
|
|||||||
"vim",
|
"vim",
|
||||||
"vue",
|
"vue",
|
||||||
"yaml",
|
"yaml",
|
||||||
},
|
})
|
||||||
},
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule config/nvim updated: d47914f112...f3e69c05a0
@@ -149,7 +149,7 @@ function section_brew
|
|||||||
have brew && {
|
have brew && {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
install)
|
install)
|
||||||
brew bundle install --file="$BREWFILE" && msg_yay "Done!"
|
brew bundle install --file="$BREWFILE" --force --quiet && msg_yay "Done!"
|
||||||
;;
|
;;
|
||||||
update)
|
update)
|
||||||
brew update && brew outdated && brew upgrade && brew cleanup
|
brew update && brew outdated && brew upgrade && brew cleanup
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ gitdirty()
|
|||||||
if [[ "${d:0:2}" == "--" ]] || [[ "$d" == "vendor" ]] || [[ "$d" == "node_modules" ]]; then
|
if [[ "${d:0:2}" == "--" ]] || [[ "$d" == "vendor" ]] || [[ "$d" == "node_modules" ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
cd "$d" > /dev/null
|
cd "$d"
|
||||||
|
|
||||||
# If we have `.git` folder, check it.
|
# If we have `.git` folder, check it.
|
||||||
if [[ -d ".git" ]]; then
|
if [[ -d ".git" ]]; then
|
||||||
@@ -58,7 +58,7 @@ gitdirty()
|
|||||||
printf " %s %s\n" "$ICON" "$(pwd)"
|
printf " %s %s\n" "$ICON" "$(pwd)"
|
||||||
else
|
else
|
||||||
# If it wasn't git repository, check subdirectories.
|
# If it wasn't git repository, check subdirectories.
|
||||||
gitdirtyrepos -- *
|
gitdirtyrepos ./*
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
cd .. > /dev/null
|
cd .. > /dev/null
|
||||||
|
|||||||
BIN
local/bin/phpcs
BIN
local/bin/phpcs
Binary file not shown.
50
local/bin/x-sha256sum-matcher
Executable file
50
local/bin/x-sha256sum-matcher
Executable file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# x-sha256sum-matcher
|
||||||
|
#
|
||||||
|
# Check if two files are the same
|
||||||
|
#
|
||||||
|
# Ismo Vuorinen <https://github.com/ivuorinen> 2023
|
||||||
|
# MIT License
|
||||||
|
|
||||||
|
# ENV Variables
|
||||||
|
: "${VERBOSE:=0}" # VERBOSE=1 x-sha256sum-matcher file1 file2
|
||||||
|
|
||||||
|
file_1="$1"
|
||||||
|
file_2="$2"
|
||||||
|
|
||||||
|
# return sha256sum for file
|
||||||
|
# $1 - filename (string)
|
||||||
|
get_sha256sum() {
|
||||||
|
sha256sum "$1" | head -c 64
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $# -eq 0 ] && {
|
||||||
|
echo "Usage: $0 file1.sh file2.sh" && exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
msg() {
|
||||||
|
[[ "$VERBOSE" -eq 1 ]] && echo "$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
error() {
|
||||||
|
msg "(!) ERROR: $1" && exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ ! -f "$file_1" ]; then
|
||||||
|
error "File 1 does not exist: $file_1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$file_2" ]; then
|
||||||
|
error "File 2 does not exist: $file_2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
file_1_hash=$(get_sha256sum "$file_1")
|
||||||
|
file_2_hash=$(get_sha256sum "$file_2")
|
||||||
|
|
||||||
|
if [ "$file_1_hash" != "$file_2_hash" ]; then
|
||||||
|
error "Files do not match"
|
||||||
|
else
|
||||||
|
msg "(*) Success: Files do match"
|
||||||
|
exit 0;
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -35,8 +35,10 @@ for f in ${PBB_CHAPTERS[@]}; do
|
|||||||
HEADER=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
|
HEADER=$(grep -e '^[#] ' "$f" | head -1 | awk '{print tolower($2)}')
|
||||||
CHEAT_FILE="$CHEAT_DEST/${HEADER}"
|
CHEAT_FILE="$CHEAT_DEST/${HEADER}"
|
||||||
|
|
||||||
if [ ! -f "$CHEAT_FILE" ]; then
|
replacable "$f" "$CHEAT_FILE"
|
||||||
cp "$f" "$CHEAT_FILE" && msg_run "$CHEAT_FILE"
|
override=$?
|
||||||
|
if [ "$override" -ne 1 ]; then
|
||||||
|
cp "$f" "$CHEAT_FILE" && msg_run "Updated: $CHEAT_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LC_ALL=C perl -pi.bak -e 's/\<\!-- CHAPTER END --\>//' "$CHEAT_FILE"
|
LC_ALL=C perl -pi.bak -e 's/\<\!-- CHAPTER END --\>//' "$CHEAT_FILE"
|
||||||
|
|||||||
@@ -51,8 +51,10 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
|
|||||||
TLDR_FILE="$SECTION_DIR/${FILENAME}"
|
TLDR_FILE="$SECTION_DIR/${FILENAME}"
|
||||||
# echo "-> dest: $TLDR_FILE"
|
# echo "-> dest: $TLDR_FILE"
|
||||||
|
|
||||||
if [ ! -f "$TLDR_FILE" ]; then
|
replacable "$FILE" "$TLDR_FILE"
|
||||||
cp "$FILE" "$TLDR_FILE" && msg_run "$TLDR_FILE"
|
override=$?
|
||||||
|
if [ "$override" -ne 1 ]; then
|
||||||
|
cp "$FILE" "$TLDR_FILE" && msg_run "Updated: $TLDR_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$TLDR_FILE" ] && [ '---' != "$(head -1 < "$TLDR_FILE")" ]; then
|
if [ -f "$TLDR_FILE" ] && [ '---' != "$(head -1 < "$TLDR_FILE")" ]; then
|
||||||
|
|||||||
@@ -230,3 +230,42 @@ rnd()
|
|||||||
{
|
{
|
||||||
echo $RANDOM | md5sum | head -c 20
|
echo $RANDOM | md5sum | head -c 20
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# return sha256sum for file
|
||||||
|
# $1 - filename (string)
|
||||||
|
function get_sha256sum()
|
||||||
|
{
|
||||||
|
sha256sum "$1" | head -c 64
|
||||||
|
}
|
||||||
|
|
||||||
|
# Replacable file
|
||||||
|
#
|
||||||
|
# $1 - filename (string)
|
||||||
|
# $2 - filename (string)
|
||||||
|
#
|
||||||
|
# Returns 1 when replacable, 0 when not replacable.
|
||||||
|
function replacable()
|
||||||
|
{
|
||||||
|
FILE1="$1"
|
||||||
|
FILE2="$2"
|
||||||
|
|
||||||
|
[[ ! -r "$FILE1" ]] && { msg_err "File 1 ($FILE1) does not exist" && return 1; }
|
||||||
|
[[ ! -r "$FILE2" ]] && { msg_err "File 2 ($FILE2) does not exist" && return 1; }
|
||||||
|
|
||||||
|
FILE1_HASH=$(get_sha256sum "$FILE1")
|
||||||
|
FILE2_HASH=$(get_sha256sum "$FILE2")
|
||||||
|
|
||||||
|
[[ $FILE1_HASH = "" ]] && {
|
||||||
|
msg_err "Could not get hash for file 1 ($FILE1)" && return 1;
|
||||||
|
}
|
||||||
|
[[ $FILE2_HASH = "" ]] && {
|
||||||
|
msg_err "Could not get hash for file 2 ($FILE2)" && return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
[[ "$FILE1_HASH" == "$FILE2_HASH" ]] && {
|
||||||
|
msg_ok "Files match, not replacable" && return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Submodule tools/dotbot updated: da928a4c6b...b04a3f1844
Reference in New Issue
Block a user