Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lazysql + zellij + helix #157

Open
oskretc opened this issue Jan 22, 2025 · 1 comment
Open

lazysql + zellij + helix #157

oskretc opened this issue Jan 22, 2025 · 1 comment

Comments

@oskretc
Copy link

oskretc commented Jan 22, 2025

Thanks for lazysql

In case any one is searching on how to integrate lazysql with zellij and hx (floating) as external editor

I have tested this in WSL2 but should work on any linux

I'm no expert in batch files but I found this working

2 files are needed in the PATH: sql_terminal.sh and sql_editor.sh

then export the variables

export SQL_TERMINAL=sql_terminal.sh
export SQL_EDITOR=sql_editor.sh

sql_terminal.sh

#!/bin/bash

file="/tmp/hextemp.lck"
touch $file

zellij run -fc -- bash sql_editor.sh $3

while [ -e "$file" ]; do
  sleep 1 # Wait for 1 second before checking again
done

sql_editor.sh

#!/bin/bash

hx $1
rm -rf /tmp/hextemp.lck

In helix, I have sqls for autocomplete and formatting. works great.

@jorgerojas26
Copy link
Owner

This is really interesting. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants