Hacker News new | comments | show | ask | jobs | submit login
Improve your PostgreSQL workflow with vim and dbext (jonathansacramento.com)
3 points by jmsmistral 544 days ago | hide | past | web | 3 comments | favorite



Some other tips for using vim and dbext.

1. Since it is using psql, you can run things like `\dt` to show a list of tables. See the psql docs for all the commands available.

2. your .psqlrc is now your friend. Check my psqlrc for some ideas [1]. For example I use `\pset null ยค` to render nulls and also `\pset linestyle unicode` and `\pset border 2` for better table rendering

3. Variables in psql are super handy. See the examples in my psqlrc but for example I can execute `:ps` in vim/dbext and it runs the query I have defined against against the 'ps' variable in my psqlrc which is a query similar to the pgAdmin server status window

4. Recommend https://github.com/krisajenkins/vim-postgresql-syntax for syntax highlighting on psql output. See the function DBextPostResult in my vimrc (in dotfiles below) on how to enable.

[1] https://github.com/collinpeters/dotfiles/blob/master/psql/ps...


Cheers for the valuable tips! I'll be adding these to the page with due credit :)


That's pretty neat!




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: