Compare commits

...

7 Commits

Author SHA1 Message Date
10da4ea372 Update .gitmodules, relocate asdf 2025-02-21 16:30:30 +02:00
68525d5ae4 Update update-submodules.yml 2025-02-21 16:25:27 +02:00
github-actions[bot]
7311f2576e chore: update pre-commit hooks (#82)
Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>
2025-02-20 09:19:54 +02:00
721d3c0d15 chore(tmux): tweak plugin order and paths
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-19 10:18:06 +02:00
c82e183ff9 chore(config): ideavim config update
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-19 10:17:36 +02:00
1b6a93650b chore(config): fish config tweaks and function fix
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-19 10:15:01 +02:00
aa85bb0c72 feat(bin): raycast helpers
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-19 10:13:52 +02:00
14 changed files with 484 additions and 76 deletions

View File

@@ -25,15 +25,20 @@ jobs:
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: Update submodules
run: |
if git commit -am"chore(git): Update submodules (automated)
$(git submodule --quiet foreach \
'tag="$(git describe --tags --abbrev=0 origin/HEAD)"
git submodule sync
git submodule foreach --quiet '
tag="$(git describe --tags --abbrev=0 origin/HEAD)"
if [ "$(git describe --tags)" != "$tag" ]; then
git checkout --quiet "$tag"
echo "$name" "$tag"
fi')"
then
echo "$name updated to $tag"
fi
'
if git diff --quiet; then
echo "No updates for submodules."
else
git add .
git commit -m "chore(git): Update submodules (automated)"
git show --raw
git push
fi

2
.gitmodules vendored
View File

@@ -75,7 +75,7 @@
ignore = dirty
[submodule "asdf"]
path = local/bin/asdf
path = local/asdf
url = https://github.com/asdf-vm/asdf.git
ignore = dirty

View File

@@ -49,7 +49,7 @@ repos:
- id: actionlint
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.171.1
rev: 39.174.3
hooks:
- id: renovate-config-validator

View File

@@ -5,7 +5,6 @@
# ASDF configuration code
source $HOME/.local/asdf/asdf.fish
fish_add_path $HOME/.cargo/bin
fish_add_path $HOME/.local/bin
fish_add_path $HOME/.local/share/nvim/mason/bin
fish_add_path $HOME/.local/state/composer/vendor/bin

View File

@@ -1,4 +1,4 @@
function ll --wraps=ls --wraps=exa_git --description 'alias ll exa_git'
function ll --wraps=exa_git --description 'alias ll exa_git'
exa_git $argv
end

View File

@@ -1,57 +1,203 @@
"" Source your .vimrc
"source ~/.vimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" https://github.com/ville6000/dotfiles/blob/main/vimrc
" To get a list of Actions run `:actionlist `
let mapleader = "\<SPACE>"
set so=10
set showmode
set showcmd
set smartcase
set incsearch
set hlsearch
set relativenumber number
set clipboard+=unnamed
set ideajoin
set ideamarks
set idearefactormode=normal
" Map esc to :noh
map <esc> :noh<cr>
nnoremap <leader>n :noh<return>
nmap j gj
nmap k gk
nmap <leader>j :tabnext<CR>
nmap <leader>k :tabprevious<CR>
nmap <leader>l b #<CR>
:nmap <c-o> <Action>(Back)
:nmap <c-i> <Action>(Forward)
:map <leader>H <Action>(MethodUp)
:map <leader>L <Action>(MethodDown)
:map <leader>o <Action>(FileStructurePopup)
:map <leader>m <Action>(ShowIntentionActions)
nmap <leader>ss <Action>(GotoSymbol)
" File management and navigation commands
nmap <leader>fl <Action>(RecentLocations)
nmap <leader>fc <Action>(FindInPath)
nmap <leader>fr <Action>(RecentFiles)
nmap <leader>fe :NERDTreeToggle<CR>
nmap <Leader>fu :action FindUsages<CR>
nmap <Leader>ff :action GotoFile<CR>
nmap <leader>fi <Action>(SelectIn)
nmap <leader>fp <Action>(ReplaceInPath)
nmap <leader>fo <Action>(OpenFile)
nmap <leader>fs <Action>(ManageRecentProjects)
nmap <leader>fw <Action>(CloseActiveTab)
nmap <Leader>sr :action RecentFiles<CR>
nmap <Leader>se :action SearchEverywhere<CR>
nmap <leader>st <Action>(TextSearchAction)
nmap <leader>ss <Action>(GotoSymbol)
nmap <leader>sa <Action>(GotoAction)
" Find text
nmap <Leader>ft :action FindText<CR>
nmap <leader>dx <Action>(Debug)
nmap <leader>dc <Action>(ContextDebug)
nmap <leader>dv <Action>(ViewBreakpoints)
nmap <leader>de <Action>(EditBreakpoint)
nmap <leader>dm <Action>(XDebugger.MuteBreakpoints)
nmap <leader>dt <Action>(ToggleLineBreakpoint)
nmap <leader>dC <Action>(RunToCursor)
nmap <leader>di <Action>(StepInto)
nmap <leader>do <Action>(StepOver)
nmap <leader>dr <Action>(Resume)
nmap <leader>dR <Action>(EvaluateExpression)
nmap <leader>dw <Action>(ActivateDebugToolWindow)
nmap <leader>gd <Action>(GotoDeclaration)
nmap <leader>go <Action>(GotoSuperMethod)
nmap <leader>gD <Action>(GotoTypeDeclaration)
nmap <leader>gi <Action>(GotoImplementation)
nmap <leader>gT <Action>(GotoTest)
nmap <leader>gp :action VcsShowPrevChangeMarker<CR>
nmap <leader>gn :action VcsShowNextChangeMarker<CR>
" Trigger tests
map <Leader>tt <Action>(RiderUnitTestRunContextAction)
let g:WhichKeyDesc_tests = "<leader>t Tests"
let g:WhichKeyDesc_tests_run = "<leader>tt Run Tests"
nmap <Leader>cc :action CommentByLineComment<CR>
nmap <leader>lf <Action>(ReformatCode)
nmap <leader>li <Action>(InspectCode)
:map <leader>lr <Action>(RenameElement)
nmap <leader>ll <Action>(Refactorings.QuickListPopupAction)
nmap <leader>Gc <Action>(Vcs.Show.Local.Changes)
nmap <leader>Ga <Action>(Annotate)
:map <leader>gh <Action>(ShowHoverInfo)
nmap <Leader>vv :vsplit<CR>
nmap <Leader>vs :split<CR>
nmap <Leader>ww :action HideAllWindows<CR>
nmap <Leader>wt :action ActivateTerminalToolWindow<CR>
nmap <Leader>wd :action ActivateDatabaseToolWindow<CR>
" Open project tree window
nmap <Leader>e :action ActivateProjectToolWindow<CR>
nnoremap <leader>cf :action ReformatCode<CR>
" Bookmarks
nmap <leader>bm <Action>(Bookmarks)
nmap <leader>bs <Action>(ShowBookmarks)
nmap <leader>bt <Action>(ActivateBookmarksToolWindow)
nmap <leader>bb <Action>(ToggleBookmark)
nmap <leader>be <Action>(EditBookmark)
nmap <leader>bp <Action>(GotoPreviousBookmark)
nmap <leader>bn <Action>(GotoNextBookmark)
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
" Turn off Copilot
nmap <leader>cp :action Copilot.Toggle<CR>
" Disable timeout for which-key
set notimeout
" Navigate back
nmap <leader> <C-o>
" mark as a global mark/
nnoremap ma mA
nnoremap mb mB
nnoremap mc mC
nnoremap md mD
nnoremap me mE
nnoremap mf mG
nnoremap mh mH
nnoremap mi mI
nnoremap mj mJ
nnoremap mk mK
nnoremap ml mL
nnoremap mm mM
nnoremap mn mN
nnoremap mo mO
nnoremap mp mP
nnoremap mq mQ
nnoremap mr mR
nnoremap ms mS
nnoremap mt mT
nnoremap mu mU
nnoremap mv mV
nnoremap mw mW
nnoremap mx mX
nnoremap my mY
nnoremap mz mZ
" go to global marks
nnoremap 'a `A
nnoremap 'b `B
nnoremap 'c `C
nnoremap 'd `D
nnoremap 'e `E
nnoremap 'f `G
nnoremap 'h `H
nnoremap 'i `I
nnoremap 'j `J
nnoremap 'k `K
nnoremap 'l `L
nnoremap 'm `M
nnoremap 'n `N
nnoremap 'o `O
nnoremap 'p `P
nnoremap 'q `Q
nnoremap 'r `R
nnoremap 's `S
nnoremap 't `T
nnoremap 'u `U
nnoremap 'v `V
nnoremap 'w `W
nnoremap 'x `X
nnoremap 'y `Y
nnoremap 'z `Z
" ---
set cursorline " Highlight current line
set nocompatible " disable compatibility mode with vi
filetype off " disable filetype detection (but re-enable later, see below)
set undolevels=1000 " Number of undo levels
set backspace=indent,eol,start " Backspace behaviour
" Don't use Ex mode, use Q for formatting.
map Q gq
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
" Find more examples here: https://jb.gg/share-ideavimrc
" https://github.com/ville6000/dotfiles/blob/main/vimrc
set nocompatible " disable compatibility mode with vi
filetype off " disable filetype detection (but re-enable later, see below)
set encoding=utf-8 " UTF-8
set number " Show line numbers
set laststatus=2 " Always show statusline (even with only single window)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
set hlsearch " Highlight all search results
set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set cindent " Use 'C' style program indenting
set expandtab " Use spaces instead of tabs
set shiftwidth=4 " Number of auto-indent spaces
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set ruler " Show row and column ruler information
set cursorline " Highlight current line
set undolevels=1000 " Number of undo levels
set backspace=indent,eol,start " Backspace behaviour
set so=5
" move vertically by visual line (don't skip wrapped lines)
nmap j gj
nmap k gk
syntax enable
filetype plugin indent on
@@ -63,9 +209,6 @@ Plug 'ctrlpvim/ctrlp.vim'
call plug#end()
set termguicolors
set background=dark
let ayucolor="dark"
colorscheme ayu
if has('gui_running')
set macligatures

View File

@@ -137,25 +137,26 @@ set -g @mode_indicator_sync_mode_style 'bg=default,fg=red'
set -g @fzf-url-bind 'u'
set -g @fzf-url-history-limit '2000'
# ── Sourcing the plugins ──────────────────────────────────────────────
run-shell "$HOME/.config/tmux/plugins/tmux-sensible/sensible.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-window-name/tmux_window_name.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-mode-indicator/mode_indicator.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-suspend/suspend.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-continuum/continuum.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-sessionist/sessionist.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-yank/yank.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-current-pane-hostname/current_pane_hostname.tmux"
run-shell "$HOME/.config/tmux/plugins/tmux-fzf-url/fzf-url.tmux"
# ── Own scripts ───────────────────────────────────────────────────────
# If we started tmux with a session name, rename it.
run-shell "$HOME/.dotfiles/config/tmux/rename-session.sh"
# Load theme based on tmux-dark-notify state.
# This script helps states where dark-notify is not available,
# and we want to have light or dark state constantly available.
run-shell "$HOME/.config/tmux/theme-activate.sh"
run-shell "$HOME/.dotfiles/config/tmux/theme-activate.sh"
# If we started tmux with a session name, rename it.
run-shell "$HOME/.config/tmux/rename-session.sh"
# ── Sourcing the plugins ──────────────────────────────────────────────
run-shell "$HOME/.config/tmux/plugins/tmux-dark-notify/main.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sensible/sensible.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-window-name/tmux_window_name.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-mode-indicator/mode_indicator.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-suspend/suspend.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-continuum/continuum.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/sessionist.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-yank/yank.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-current-pane-hostname/current_pane_hostname.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-fzf-url/fzf-url.tmux"
run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-dark-notify/main.tmux"

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Note: Lungo v2.0.4 required
# Install via Mac App Store: https://apps.apple.com/app/id1263070803
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Lungo: Activate
# @raycast.mode silent
# Optional parameters:
# @raycast.icon ./images/lungo.png
# @raycast.packageName Lungo
# Documentation:
# @raycast.author Lungo
# @raycast.authorURL https://sindresorhus.com/lungo
# @raycast.description Deactivate Lungo.
# @raycast.argument1 { "type": "text", "placeholder": "hours", "optional": true, "percentEncoded": true }
# @raycast.argument2 { "type": "text", "placeholder": "minutes", "optional": true, "percentEncoded": true }
open --background "lungo:activate?hours=$1&minutes=$2"

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Note: Lungo v2.0.4 required
# Install via Mac App Store: https://apps.apple.com/app/id1263070803
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Lungo: Deactivate
# @raycast.mode silent
# Optional parameters:
# @raycast.icon ./images/lungo.png
# @raycast.packageName Lungo
# Documentation:
# @raycast.author Lungo
# @raycast.authorURL https://sindresorhus.com/lungo
# @raycast.description Deactivate Lungo.
open --background lungo:deactivate

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Note: Lungo v2.0.4 required
# Install via Mac App Store: https://apps.apple.com/app/id1263070803
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Lungo: Toggle
# @raycast.mode silent
# Optional parameters:
# @raycast.icon ./images/lungo.png
# @raycast.packageName Lungo
# Documentation:
# @raycast.author Lungo
# @raycast.authorURL https://sindresorhus.com/lungo
# @raycast.description Toggle Lungo.
# @raycast.argument1 { "type": "text", "placeholder": "hours", "optional": true, "percentEncoded": true }
# @raycast.argument2 { "type": "text", "placeholder": "minutes", "optional": true, "percentEncoded": true }
open --background "lungo:toggle?hours=$1&minutes=$2"

View File

@@ -0,0 +1,100 @@
#!/usr/bin/env python3
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Convert Markdown to Telegram Format
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🔄
# @raycast.packageName Conversions
# @raycast.description Convert Markdown formatting to Telegram format, excluding processing inside code blocks or quotes
# Documentation:
# @raycast.author Maxim Borzov
# @raycast.authorURL https://github.com/borzov
import re
import subprocess
# Set environment variables and encoding
env_vars = {'LANG': 'en_US.UTF-8'}
encoding = 'utf-8'
def paste():
"""Read text from the clipboard."""
return subprocess.check_output('pbpaste', env=env_vars).decode(encoding)
def copy(text):
"""Write text to the clipboard."""
process = subprocess.Popen('pbcopy', env=env_vars, stdin=subprocess.PIPE)
process.communicate(text.encode(encoding))
def convert_markdown(text):
"""Convert Markdown formatting to Telegram format."""
lines = text.split('\n')
converted_lines = []
in_code_block = False
for line in lines:
# Check if the line is a code block delimiter
if line.startswith('```'):
in_code_block = not in_code_block
converted_lines.append(line)
continue
# Skip quotes and only format if not in a code block
if not in_code_block and not line.startswith('>'):
# Format headers with emojis and bold text
if line.startswith('# '):
line = f"⚫️ **{line[2:].strip()}**\n"
elif line.startswith('## '):
line = f"◾️ **{line[3:].strip()}**\n"
elif line.startswith('### '):
line = f"▪️ **{line[4:].strip()}**\n"
elif line.startswith('#### '):
line = f"🔹 **{line[5:].strip()}**\n"
elif line.startswith('##### '):
line = f"📌 **{line[6:].strip()}**\n"
elif line.startswith('###### '):
line = f"🔰 **{line[7:].strip()}**\n"
else:
# Format bold text
line = re.sub(r'(?<!\\)\*{2}(.*?)\*{2}', r'**\1**', line)
line = re.sub(r'(?<!\\)_{2}(.*?)_{2}', r'**\1**', line)
# Format italic text
line = re.sub(r'(?<!\\|\*)\*(?!\*)(.+?)(?<!\*)\*(?![\*_])', r'__\1__', line)
line = re.sub(r'(?<!\\|_)_(?!_)(.+?)(?<!_)_(?![\*_])', r'__\1__', line)
# Format strikethrough text
line = re.sub(r'(?<!\\)~{2}(.*?)~{2}', r'~~\1~~', line)
# Format spoilers
line = re.sub(r'(?<!\\)\|\|(.*?)\|\|', r'||\1||', line)
# Format underline text
line = re.sub(r'(?<!\\)-{2}(.*?)-{2}', r'--\1--', line)
# Format links
line = re.sub(r'(?<!\\)\[(.*?)\]\((.*?)\)', r'[\1](\2)', line)
# Format inline code
line = re.sub(r'(?<!\\)`(.*?)`', r'`\1`', line)
converted_lines.append(line)
# Add empty lines between paragraphs
result = []
for i in range(len(converted_lines)):
result.append(converted_lines[i])
if i < len(converted_lines) - 1:
cur = converted_lines[i].strip()
next = converted_lines[i+1].strip()
if cur and next and not cur.startswith(('*', '-', '```', '|', '>')) and not next.startswith(('*', '-', '```', '|', '>')):
result.append('')
return '\n'.join(result)
if __name__ == "__main__":
try:
markdown_text = paste()
converted_text = convert_markdown(markdown_text)
copy(converted_text)
print("✅ Markdown converted and copied to clipboard")
except Exception as e:
print(f"❌ Error during conversion: {str(e)}")

21
local/bin/raycast/sp.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Dependency: requires the 1password cli: https://developer.1password.com/docs/cli/
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Login password to clipboard
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 🔐
# @raycast.packageName Password to clipboard
# @raycast.description Returns password from 1Password
# Documentation:
# @raycast.author Ismo Vuorinen
# @raycast.authorURL https://github.com/ivuorinen
set -euo pipefail
op read "op://Svea/3hzhctmvovbwlgulv7mgy25rf4/login-input" | pbcopy

View File

@@ -0,0 +1,26 @@
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Tidal: Toggle Play/Pause
# @raycast.mode silent
# @raycast.packagename Tidal
# Optional parameters
# @raycast.icon images/tidal-logo.png
# Documentation:
# @raycast.author Cebrail AKTAS
# @raycast.authorURL https://github.com/AktasC
# @raycast.description Play/Pause Tidal
tell application "System Events"
tell process "TIDAL"
click first menu item of menu "Playback" of menu bar 1
if name of first menu item of menu "Playback" of menu bar 1 is "Play" then
log "▶️"
else
log "⏸"
end if
end tell
end tell

View File

@@ -0,0 +1,49 @@
#!/usr/bin/swift
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title Zalgo Text
// @raycast.mode silent
// @raycast.author Adam Zethraeus
// @raycast.authorURL https://github.com/adam-zethraeus
// @raycast.packageName Conversions
// @raycast.icon 👹
// @raycast.argument1 { "type": "text", "placeholder": "Text to Z̶̶͚̯͗a̩̞͜͜l̫͕ͬͨ̿g͈̫͂ͤ͆͢o̠͚̞ͥ" }
// @raycast.argument2 { "type": "text", "optional": true, "placeholder": "Intensity=5" }
// Documentation:
// @raycast.description Converts text to z̫̫̐a̳ͩl̓͂̀ͅg͔̚o̷̦̣͢ t̳͆ḛ̊͟ẍ̮̝́t̵̔ͯ͝
import Cocoa
// zalgo function credit mattt @ https://gist.github.com/mattt/b46ab5027f1ee6ab1a45583a41240033
func zalgo(_ string: String, intensity: Int = 5) -> String {
let combiningDiacriticMarks = 0x0300...0x036f
let latinAlphabetUppercase = 0x0041...0x005a
let latinAlphabetLowercase = 0x0061...0x007a
var output: [UnicodeScalar] = []
for scalar in string.unicodeScalars {
output.append(scalar)
guard (latinAlphabetUppercase).contains(numericCast(scalar.value)) ||
(latinAlphabetLowercase).contains(numericCast(scalar.value))
else {
continue
}
for _ in 0...(Int.random(in: 1...intensity)) {
let randomScalarValue = Int.random(in: combiningDiacriticMarks)
output.append(Unicode.Scalar(randomScalarValue)!)
}
}
return String(String.UnicodeScalarView(output))
}
NSPasteboard.general.clearContents()
let text = CommandLine.arguments[1]
let intensityString = CommandLine.arguments[2]
let intensity = Int(intensityString) ?? 5
let zalgoText = zalgo(text, intensity: intensity)
NSPasteboard.general.setString(zalgoText, forType: .string)
print("\(zalgoText) copied to clipboard")