Skip to content

Commit c8fd959

Browse files
committed
feat: fix broken espanso quick access, add :k for quick kanata
1 parent 053a38e commit c8fd959

File tree

1 file changed

+28
-58
lines changed

1 file changed

+28
-58
lines changed

quickVimAction.psm1

Lines changed: 28 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ $sessionMap = @{
100100
"pw" = "pwsh"
101101
"nv" = "nvim"
102102
"nu" = "nushell"
103-
"m" = "mouse"
104103
"ob" = "obsidian"
105104
"es" = "espanso"
106105
"vk" = "vulkan-samples"
106+
"m" = "mouse"
107107
"wts" = "wt_shader"
108108
}
109109
function :vs {
@@ -322,26 +322,27 @@ function :obsidian(
322322
}
323323
}
324324

325-
# INFO: switch workspace.
326-
$workspaceNameTable = @{
327-
"j" = "Journal-code-eda"
328-
"jc" = "Journal-code-eda"
329-
"o" = "Obs-Nvim"
330-
"on" = "Obs-Nvim"
331-
}
332-
function :ow {
333-
$defaultWorkspace = "Obs-Nvim"
334-
335-
# Prepare arguments
336-
$argument = $args -join " "
337-
$workspaceName = $workspaceNameTable[$argument] ?? "$defaultWorkspace"
338-
339-
$originalURI = "obsidian://advanced-uri?vault=$global:vaultName&workspace=$workspaceName"
340-
(Start-Process "$originalURI" &) | Out-Null
341-
}
342-
325+
# # INFO: switch workspace.
326+
# $workspaceNameTable = @{
327+
# "j" = "Journal-code-eda"
328+
# "jc" = "Journal-code-eda"
329+
# "o" = "Obs-Nvim"
330+
# "on" = "Obs-Nvim"
331+
# }
332+
# function :ow {
333+
# $defaultWorkspace = "Obs-Nvim"
334+
#
335+
# # Prepare arguments
336+
# $argument = $args -join " "
337+
# $workspaceName = $workspaceNameTable[$argument] ?? "$defaultWorkspace"
338+
#
339+
# $originalURI = "obsidian://advanced-uri?vault=$global:vaultName&workspace=$workspaceName"
340+
# (Start-Process "$originalURI" &) | Out-Null
341+
# }
342+
#
343343
Set-Alias -Name :o -Value :obsidian
344-
Set-Alias -Name :oo -Value obsidian-cli
344+
# Set-Alias -Name :oo -Value obsidian-cli
345+
#
345346
# TODO: make the note taking add the #tag on it. so I could enter the note and start wrting on it right away without adding tag.
346347
function :jrnl {
347348
$argument = $args
@@ -399,6 +400,7 @@ function :jrnl {
399400
}
400401
Invoke-Expression "jrnl $argument"
401402
}
403+
Set-Alias -Name j -Value :jrnl
402404

403405
# INFO: call `Get-UniqueEntryJrnl table` to get current jrnltable list.
404406
function Get-UniqueEntryJrnl {
@@ -436,42 +438,6 @@ function Get-UniqueEntryJrnl {
436438
}
437439
return $all_list
438440
}
439-
440-
Set-Alias -Name j -Value :jrnl
441-
442-
# WARN: recently I found symlink affects recursive tools like fzf and fd a lot...
443-
# Might change that kind of add sy,links everywhere.
444-
$global:HighWay = "D:\ProgramDataD\1_AllActiveProject"
445-
function :hw($destinationName = $null, $HighWaylinkName = "hw", $dir = $global:HighWay, $Remove = $null) {
446-
$currentDir = (Get-Location)
447-
$currentDirLeaf = Split-Path -Path $currentDir -Leaf
448-
if ($Remove -ne $null) {
449-
rm "$global:HighWay/$currentDirLeaf"
450-
rm "$currentDir/$HighWaylinkName"
451-
}
452-
else {
453-
# HACK: create highway symlink within $pwd. To be fair, avoid this altogether.
454-
if ((Test-Path "$currentDir/$HighWaylinkName") -eq $false) {
455-
# New-Item $HighWaylinkName -ItemType SymbolicLink -Value $dir
456-
Write-Output "$HighWaylinkName`n" | Add-Content -Path .\.gitignore
457-
}
458-
else {
459-
Write-Host "Symlink $HighWaylinkName Already Exist" -ForegroundColor Green
460-
}
461-
462-
# INFO: source of highway.
463-
if ($destinationName -eq $null) {
464-
$destinationName = $currentDirLeaf
465-
}
466-
if ((Test-Path "$global:HighWay/$destinationName") -eq $false) {
467-
New-Item "$global:HighWay/$destinationName" -ItemType SymbolicLink -Value $currentDir
468-
Write-Output "$destinationName`n" | Add-Content -Path "$global:HighWay\.gitignore"
469-
}
470-
else {
471-
Write-Host "Symlink $destinationName Already Exist" -ForegroundColor Green
472-
}
473-
}
474-
}
475441
# NOTE: Espanso powershell wrapper.
476442
$espansoAlias = @{
477443
"st" = "status"
@@ -488,13 +454,17 @@ function :e {
488454

489455
if ($argument -eq "editInNvimSession ") {
490456
$espansoNvimSession = "espanso"
491-
nvim -c "lua require('resession').load `"$espansoNvimSession`""
457+
$codeEditor = "neovide --frame none -- "
458+
Invoke-Expression "$codeEditor -c 'lua require(`"resession`").load `"$espansoNvimSession`"'"
492459
}
493460
else {
494-
Invoke-Expression "espansod $argument"
461+
Invoke-Expression "espanso $argument"
495462
}
496463
}
497464
# INFO: function to switch between applications. Right now it's based on the Show-Window function.
498465
function :s {
499466
Show-Window "$args"
500467
}
468+
function :k{
469+
470+
}

0 commit comments

Comments
 (0)