We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


Using a Preferred Editor in VSQL — Vertica Forum

Using a Preferred Editor in VSQL

[Deleted User][Deleted User] Administrator
edited April 2018 in Tips from the Team

Jim Knicely. authored this tip.

The vsql \e and \edit meta-commands let you edit the query buffer (or specified file) with an external editor. The default editor on Linux is vi and notepad.exe on Windows systems. Because vsql searches the environment variables VSQL_EDITOR, EDITOR, and VISUAL (in that order) for an editor to use, you can set one to your preferred editor!

Example:

[dbadmin@s18384357 ~]$ export EDITOR=vim

For folks that use vsql and the editor VIM, you can enable syntax highlight by adding the following lines to ~/.vimrc ::wink:

if $_ == "/opt/vertica/bin/vsql"
      set syntax=sql
endif

Have Fun!

Sign In or Register to comment.