From: Simon Ruderich Date: Sun, 6 Nov 2016 11:37:25 +0000 (+0100) Subject: psql: add, postgresql configuration file X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=8a793a31d6328feb328a501ab3222add8f0bb903;p=config%2Fdotfiles.git psql: add, postgresql configuration file --- diff --git a/.gitignore b/.gitignore index a0d0192..2f5d841 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /ghc/x86_64-linux-*/ /lftp/rl_history /maxima/maxout.gnuplot_pipes +/psql/history +/psql/psqlrc /sqlite/sqliterc diff --git a/psql/psqlrc.in b/psql/psqlrc.in new file mode 100644 index 0000000..8733b4f --- /dev/null +++ b/psql/psqlrc.in @@ -0,0 +1,39 @@ +-- Postgresql client configuration file. + +-- Copyright (C) 2016 Simon Ruderich +-- +-- This file is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This file is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this file. If not, see . + + +-- Shut up \pset during this config script. +\set QUIET on + +-- Automatically switch to vertical mode when the columns don't fit on screen. +\pset expanded auto + +-- Use unicode characters for borders. +\pset linestyle unicode + +-- Uppercase keywords when completing. Thanks to [1] (read on 2016-08-06). +-- [1]: http://phili.pe/posts/postgresql-on-the-command-line/ +\set COMP_KEYWORD_CASE upper + +-- "ignorespace ignoredups" +\set HISTCONTROL ignoreboth +-- Set path to history file and increase it. +\set HISTFILE HISTFILE_PATH +\set HISTSIZE 100000 + +-- But display the normal psql welcome message. +\set QUIET off diff --git a/setup.sh b/setup.sh index 43ad66f..c04bc52 100755 --- a/setup.sh +++ b/setup.sh @@ -44,6 +44,13 @@ if installed maxima; then link maxima ~/.maxima fi +if installed psql; then + generate psql/psqlrc .in simple_cpp \ + HISTFILE_PATH -- "`pwd`/psql/history" + sed_i 's/^#/--/' psql/psqlrc + link psql/psqlrc ~/.psqlrc +fi + # MySQL client. if installed mysql; then link mysql/my.cnf ~/.my.cnf