HNHacker News
TopNewBestAskShowJobs

cadiolis

2 karma · joined February 1, 2016

submissionscomments
cadiolis··on Improve your PostgreSQL workflow with vim and dbext
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...