From: Victoria <victorias.linux@gmail.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Cc: Victorias.Linux@gmail.com
Subject: Nvim as external editor in psql as Postgres root user - .vimrc (environment?) issue
Date: Fri, 16 Mar 2018 10:47:46 -0700
Message-ID: <20180316104746.1e23e682@gmail.com> (raw)
Hello; I am using PostgreSQL v.10.2 as a root user (sudo -u postgres -i) on my local Arch Linux installation.
I want to use Neovim (nvim v.0.2.2) as my external editor (\e) in psql; the current default is the Arch Linux default system editor, vi.
If I add this to my ~/.psqlrc (/home/victoria/.psqlrc)
\setenv EDITOR "/usr/bin/nano"
then I can use nano, no problem.
However, if I replace that with
\setenv EDITOR "/usr/bin/nvim"
and chown this postgres directory (to get around a .local/ permissions error that arises)
sudo chown -R postgres:victoria /var/lib/postgres
when I type \e in psql I can edit in nvim.
The issue I have is that as I am in a postgres environment, my user (victoria) ~/.vimrc file (I link my nvim.init file to it) is not being loaded, so I don't have access to my Vim/NeoVim settings.
I tried the nvim -u "<path-to-vimrc>" type statements in my ~/.psqlrc, but that throws an error about not a valid path (again, likely due to the Pg root environment?).
Suggestions? Thank you.
==============================================================================
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: victorias.linux@gmail.com
Subject: Re: Nvim as external editor in psql as Postgres root user - .vimrc (environment?) issue
In-Reply-To: <20180316104746.1e23e682@gmail.com>
References: <20180316104746.1e23e682@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox