Compare commits

...

6 Commits

Author SHA1 Message Date
Ismo Vuorinen
9c05733b5d zsh: Starship config, removed rb and py bundles 2023-02-07 09:35:18 +02:00
d4e02bbb89 zsh: Added brew sbin to path 2023-02-06 23:20:41 +02:00
32dbec6476 nvim: Plugins cleanup 2023-02-06 22:32:27 +02:00
Ismo Vuorinen
980fc9aa7d zsh: Installed starship
https://starship.rs/
2023-01-31 15:38:41 +02:00
Ismo Vuorinen
a2c3de1b3b brew: Installed quitter 2023-01-31 15:38:19 +02:00
Ismo Vuorinen
16d455a262 2023-01-30 2023-01-30 12:16:20 +02:00
11 changed files with 58 additions and 88 deletions

View File

@@ -148,6 +148,8 @@ brew "ruby"
brew "shellcheck" brew "shellcheck"
# Autoformat shell script source code # Autoformat shell script source code
brew "shfmt" brew "shfmt"
# Cross-shell prompt for astronauts
brew "starship"
# Version control system designed to be a better CVS # Version control system designed to be a better CVS
brew "subversion" brew "subversion"
# Send macOS User Notifications from the command-line # Send macOS User Notifications from the command-line
@@ -250,6 +252,8 @@ cask "qlstephen"
cask "quicklook-json" cask "quicklook-json"
# QuickLook generator for Adobe Swatch Exchange files # QuickLook generator for Adobe Swatch Exchange files
cask "quicklookase" cask "quicklookase"
# Automatically hides or quits apps after periods of inactivity
cask "quitter"
# Move and resize windows using keyboard shortcuts or snap areas # Move and resize windows using keyboard shortcuts or snap areas
cask "rectangle" cask "rectangle"
# MySQL/MariaDB database management # MySQL/MariaDB database management

View File

@@ -48,11 +48,6 @@ require('packer').startup(function(use)
after = 'nvim-treesitter', after = 'nvim-treesitter',
} }
-- Git related plugins
use 'tpope/vim-fugitive'
use 'tpope/vim-rhubarb'
use 'lewis6991/gitsigns.nvim'
-- Theme based off the Material Pale Night -- Theme based off the Material Pale Night
use 'drewtempelmeyer/palenight.vim' use 'drewtempelmeyer/palenight.vim'
-- Fancier statusline -- Fancier statusline
@@ -342,18 +337,6 @@ require('indent_blankline').setup {
show_current_context_start = true, show_current_context_start = true,
} }
-- Gitsigns
-- See `:help gitsigns.txt`
require('gitsigns').setup {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
}
-- [[ Configure Telescope ]] -- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()` -- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup { require('telescope').setup {
@@ -485,16 +468,6 @@ require('nvim-treesitter.configs').setup {
}, },
} }
-- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()
require('orgmode').setup({
org_agenda_files = {
vim.fn.expand '~/.local/share/_nvalt/**/*',
vim.fn.expand '~/.dotfiles/local/org/**/*'
},
org_default_notes_file = vim.fn.expand '~/.local/share/_nvalt/refile.org',
})
-- LSP settings. -- LSP settings.
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)

View File

@@ -76,36 +76,10 @@ return function(use)
end, end,
}) })
-- nvim orgmode, to get me use nvim even more.
use({
"nvim-orgmode/orgmode",
config = function()
require('orgmode').setup_ts_grammar()
end,
})
-- Markdown support -- Markdown support
use 'preservim/vim-markdown' use 'preservim/vim-markdown'
use 'godlygeek/tabular' use 'godlygeek/tabular'
-- obsidian plugin for nvim
-- https://github.com/epwalsh/obsidian.nvim
use({
"epwalsh/obsidian.nvim",
config = function()
require("obsidian").setup({
dir = '~/.local/share/_nvalt',
notes_subdir = "notes",
daily_notes = {
folder = "_daily"
},
completion = {
nvim_cmp = true, -- if using nvim-cmp, otherwise set to false
}
})
end
})
-- Creates missing folders on save -- Creates missing folders on save
-- https://github.com/jghauser/mkdir.nvim -- https://github.com/jghauser/mkdir.nvim
use { 'jghauser/mkdir.nvim' } use { 'jghauser/mkdir.nvim' }

9
config/starship.toml Normal file
View File

@@ -0,0 +1,9 @@
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# Inserts a blank line between shell prompts
add_newline = true
# Replace the '' symbol in the prompt with '➜'
[character] # The name of the module we are configuring is 'character'
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'

View File

@@ -22,32 +22,32 @@ function section_install
case "$1" in case "$1" in
all) all)
$0 install antigen && msg_done "New antigen installed" $0 install antigen
$0 install macos && msg_done "macOS Defaults set" $0 install macos
$0 install brew && msg_done "Brewfile defined apps has been installed" $0 install brew
$0 install ext_gh && msg_done "Extensions for GitHub CLI have been installed" $0 install ext_gh
$0 install ext_go && msg_done "Go packages have been installed" $0 install ext_go
;; ;;
antigen) antigen)
curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" && msg_done "🎉 Done!" curl -L git.io/antigen > "$DOTFILES/local/bin/antigen.zsh" && msg_done "🎉 New antigen installed!"
;; ;;
brew) brew)
brew bundle install --file="$BREWFILE" && msg_done "🎉 Done!" brew bundle install --file="$BREWFILE" && msg_done "🎉 macOS Defaults set!"
;; ;;
macos) macos)
bash "$DOTFILES/scripts/set-macos-defaults.sh" && msg_done "🎉 Done!" bash "$DOTFILES/scripts/set-macos-defaults.sh" && msg_done "🎉 Brewfile defined apps has been installed!"
;; ;;
ext_go) ext_go)
bash "$DOTFILES/scripts/install-go-packages.sh" && msg_done "🎉 Done!" bash "$DOTFILES/scripts/install-go-packages.sh" && msg_done "🎉 Go packages have been installed!"
;; ;;
ext_gh) ext_gh)
bash "$DOTFILES/scripts/install-gh-extensions.sh" && msg_done "🎉 Done!" bash "$DOTFILES/scripts/install-gh-extensions.sh" && msg_done "🎉 Extensions for GitHub CLI have been installed!"
;; ;;
settler) settler)
bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Done!" bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Settler has been run!"
;; ;;
*) *)
menu_section "$USAGE_PREFIX" "all | antigen | brew | macos | ext_go | ext_gh | settler" menu_section "$USAGE_PREFIX" "all | antigen | brew | ext_gh | ext_go | macos | settler"
menu_item "all" "Installs antigen, macos, brew, ext_gh and ext_go" menu_item "all" "Installs antigen, macos, brew, ext_gh and ext_go"
menu_item "antigen" "Updates the antigen.zsh file" menu_item "antigen" "Updates the antigen.zsh file"
menu_item "brew" "Install Brewfile contents" menu_item "brew" "Install Brewfile contents"
@@ -103,7 +103,7 @@ function section_dotfiles
case "$1" in case "$1" in
link) link)
rcup -B "$HOSTNAME" -f -v && msg_done "🎉 Done!" rcup -B "$HOSTNAME" -f -v && msg_done "🎉 dotfiles have been linked!"
;; ;;
update) update)
# Updates .dotfiles/scripts/install.sh and formats it # Updates .dotfiles/scripts/install.sh and formats it
@@ -112,16 +112,20 @@ function section_dotfiles
&& sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \ && sed -i '' "s|$HOME|\$HOME|g" "$INSTALL_SCRIPT" \
&& sed -i '' "s|install.sh|$(basename "$INSTALL_SCRIPT")|g" "$INSTALL_SCRIPT" && sed -i '' "s|install.sh|$(basename "$INSTALL_SCRIPT")|g" "$INSTALL_SCRIPT"
$0 dotfiles shfmt $0 dotfiles shfmt
msg_done "🎉 Done!" $0 dotfiles link
msg_done "🎉 dotfiles updated and linked!"
;; ;;
shfmt) shfmt)
# Format shell scripts according to following rules. # Format shell scripts according to following rules.
shfmt -fn -l -w -i 2 -ci -sr -bn "$DOTFILES" find "$DOTFILES" \
\( -name '*.sh' -or -name '*.zsh' -or -name 'x-*' -or -not '*.pl' \) \
-exec shfmt -fn -l -w -i 2 -ci -sr -bn {} \;
msg_done "🎉 dotfiles have been formatted!"
;; ;;
*) *)
menu_section "$USAGE_PREFIX" "link | update | shfmt" menu_section "$USAGE_PREFIX" "link | update | shfmt"
menu_item "link" "Use rcrc to update dotfile links" menu_item "link" "Use rcrc to update dotfile links"
menu_item "update" "Updates dotfile links, installs host specific overrides automatically" menu_item "update" "Updates dotfile links (scripts/install.sh), formats it and runs it."
menu_item "shfmt" "Run shfmt to all dotfiles" menu_item "shfmt" "Run shfmt to all dotfiles"
;; ;;
esac esac

2
rcrc
View File

@@ -1,2 +1,2 @@
EXCLUDES="*.md *.sh *.lock.json Brewfile scripts *-secret" EXCLUDES="*.md *.sh *.lock.json Brewfile scripts *-secret xbar"
HOSTNAME=$(hostname -s) HOSTNAME=$(hostname -s)

View File

@@ -9,7 +9,7 @@
# env VERBOSE=1 sh install-dotfiles.sh # env VERBOSE=1 sh install-dotfiles.sh
# #
# DO NOT EDIT THIS FILE # DO NOT EDIT THIS FILE
# #
# This file is generated by rcm(7) as: # This file is generated by rcm(7) as:
# #
# rcup -B 0 -g # rcup -B 0 -g
@@ -22,14 +22,12 @@
: ${MKDIR:=/bin/mkdir} : ${MKDIR:=/bin/mkdir}
: ${RM:=/bin/rm} : ${RM:=/bin/rm}
: ${DIRNAME:=/usr/bin/dirname} : ${DIRNAME:=/usr/bin/dirname}
verbose() verbose() {
{
if [ "$VERBOSE" -gt 0 ]; then if [ "$VERBOSE" -gt 0 ]; then
echo "$@" echo "$@"
fi fi
} }
handle_file_cp() handle_file_cp() {
{
if [ -e "$2" ]; then if [ -e "$2" ]; then
printf "%s " "overwrite $2? [yN]" printf "%s " "overwrite $2? [yN]"
read overwrite read overwrite
@@ -47,8 +45,7 @@ handle_file_cp()
$MKDIR -p "$($DIRNAME "$2")" $MKDIR -p "$($DIRNAME "$2")"
$CP -R "$1" "$2" $CP -R "$1" "$2"
} }
handle_file_ln() handle_file_ln() {
{
if [ -e "$2" ]; then if [ -e "$2" ]; then
printf "%s " "overwrite $2? [yN]" printf "%s " "overwrite $2? [yN]"
read overwrite read overwrite
@@ -86,9 +83,9 @@ handle_file_ln "$HOME/.dotfiles/local/bin/antigen.zsh" "$HOME/.local/bin/antigen
handle_file_ln "$HOME/.dotfiles/local/bin/dfm" "$HOME/.local/bin/dfm" handle_file_ln "$HOME/.dotfiles/local/bin/dfm" "$HOME/.local/bin/dfm"
handle_file_ln "$HOME/.dotfiles/local/bin/git-dirty" "$HOME/.local/bin/git-dirty" handle_file_ln "$HOME/.dotfiles/local/bin/git-dirty" "$HOME/.local/bin/git-dirty"
handle_file_ln "$HOME/.dotfiles/local/bin/x-check-git-attributes" "$HOME/.local/bin/x-check-git-attributes" handle_file_ln "$HOME/.dotfiles/local/bin/x-check-git-attributes" "$HOME/.local/bin/x-check-git-attributes"
handle_file_ln "$HOME/.dotfiles/local/bin/x-dupes" "$HOME/.local/bin/x-dupes" handle_file_ln "$HOME/.dotfiles/local/bin/x-dupes.pl" "$HOME/.local/bin/x-dupes.pl"
handle_file_ln "$HOME/.dotfiles/local/bin/x-foreach" "$HOME/.local/bin/x-foreach" handle_file_ln "$HOME/.dotfiles/local/bin/x-foreach" "$HOME/.local/bin/x-foreach"
handle_file_ln "$HOME/.dotfiles/local/bin/x-multi-ping" "$HOME/.local/bin/x-multi-ping" handle_file_ln "$HOME/.dotfiles/local/bin/x-multi-ping.pl" "$HOME/.local/bin/x-multi-ping.pl"
handle_file_ln "$HOME/.dotfiles/local/bin/x-open-ports" "$HOME/.local/bin/x-open-ports" handle_file_ln "$HOME/.dotfiles/local/bin/x-open-ports" "$HOME/.local/bin/x-open-ports"
handle_file_ln "$HOME/.dotfiles/local/bin/x-ssl-expiry-date" "$HOME/.local/bin/x-ssl-expiry-date" handle_file_ln "$HOME/.dotfiles/local/bin/x-ssl-expiry-date" "$HOME/.local/bin/x-ssl-expiry-date"
handle_file_ln "$HOME/.dotfiles/local/bin/x-until-error" "$HOME/.local/bin/x-until-error" handle_file_ln "$HOME/.dotfiles/local/bin/x-until-error" "$HOME/.local/bin/x-until-error"

View File

@@ -104,3 +104,10 @@ function menu_item()
LINE=$(printf '%-15s %-30s\n' "$1" "$2") LINE=$(printf '%-15s %-30s\n' "$1" "$2")
echo -e "$(__log_indent)$(__log_marker) $LINE" echo -e "$(__log_indent)$(__log_marker) $LINE"
} }
# https://stackoverflow.com/a/85932
function fn_exists()
{
declare -f -F "$1" > /dev/null
return $?
}

20
zshrc
View File

@@ -5,7 +5,7 @@
autoload -U colors zsh/terminfo autoload -U colors zsh/terminfo
colors colors
export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:/usr/local/sbin:$PATH" export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:$PATH"
if [ command -v brew &> /dev/null ]; then if [ command -v brew &> /dev/null ]; then
BREW_BIN=$(brew --prefix)/bin BREW_BIN=$(brew --prefix)/bin
@@ -65,7 +65,7 @@ ssh-add -A 2>/dev/null;
if command -v antigen &> /dev/null; then if command -v antigen &> /dev/null; then
antigen use oh-my-zsh antigen use oh-my-zsh
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai # antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
antigen bundle ssh-agent antigen bundle ssh-agent
antigen bundle colored-man-pages antigen bundle colored-man-pages
@@ -80,8 +80,8 @@ if command -v antigen &> /dev/null; then
hash php 2>/dev/null && antigen bundle php hash php 2>/dev/null && antigen bundle php
hash nvm 2>/dev/null && antigen bundle nvm hash nvm 2>/dev/null && antigen bundle nvm
hash docker 2>/dev/null && antigen bundle docker hash docker 2>/dev/null && antigen bundle docker
hash ruby 2>/dev/null && antigen bundle ruby # hash ruby 2>/dev/null && antigen bundle ruby
hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv # hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin
hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin
# antigen bundle voronkovich/phpcs.plugin.zsh # antigen bundle voronkovich/phpcs.plugin.zsh
@@ -108,11 +108,13 @@ if hash op 2>/dev/null; then
fi fi
# gcloud is present # gcloud is present
if hash gcloud 2>/dev/null; then #if hash gcloud 2>/dev/null; then
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet) # GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc" # [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc" # [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
fi #fi
eval "$(starship init zsh)"
# Fig post block. Keep at the bottom of this file. # Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh" [[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"