Hacker News new | comments | ask | show | jobs | submit login
Improve your PostgreSQL workflow with vim and dbext (jonathansacramento.com)
3 points by jmsmistral on Jan 22, 2016 | hide | past | web | favorite | 3 comments

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!

Applications are open for YC Summer 2019

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