LinuxCommandLibrary

gvim

Edit text files graphically

TLDR

Open gvim

$ gvim
copy

Open a specific file
$ gvim [path/to/file]
copy

SYNOPSIS

gvim [options] [[+command] | [+/pattern]] [file] ...

PARAMETERS

-c command or +command
    Execute command after loading first file

+/pattern
    Position cursor at first match of pattern

-d or -D
    Diff mode with files or directory

-e
    Start in Ex mode (no Normal mode)

-E
    Easy Ex mode (improved Ex)

-f or -fg
    Foreground (X11: don't detach)

-g
    GUI mode (default for gvim)

-h or --help
    Show help

--version
    Show version info

-N
    No vi-compatible mode

-n
    No swap file use

-o[N]
    Open N windows (default 1)

-O[N]
    Horizontal splits for N windows

-p[N]
    Open N tab pages

-R
    Readonly mode

-r[file]
    Recover crashed session

-u norc|NONE|file
    Use (none)/specified vimrc file

-U gvimrc
    Use specified gvimrc file

-v
    Vi mode (backward compatible)

-X
    Disable X11 mouse/clipboard

--remote[-send][-wait][+cmd]
    Send to existing gvim server

--servername name
    Set server name for remote

DESCRIPTION

gVim provides a graphical user interface for Vim, the ubiquitous modal text editor known for efficiency and extensibility. It retains Vim's powerful features—syntax highlighting, macros, plugins, buffers, windows, tabs, spell checking—while adding GUI elements like menus, toolbars, scrollbars, and mouse support.

Ideal for Linux users with X11/Wayland desktops preferring visual navigation over terminals. Supports multi-window editing, splits, remote file opening, and custom fonts/colors via ~/.gvimrc. Modal operation (normal/insert/visual/command) enables rapid editing with keyboard-centric workflows.

Launch with gvim file.txt or gvim -p *.txt for tabbed files. Integrates clipboard, printing, and dialogs. Cross-platform, highly customizable, used by developers for code, configs, prose.

Extends console Vim seamlessly; most options shared. GUI-specific: adjustable font (set guifont=*), geometry, reverse video.

CAVEATS

Requires GUI environment (X11/Wayland via XWayland). Performance overhead vs console vim. Swap files may clutter; use -n. Wayland clipboard issues possible without tweaks.

CONFIG FILES

~/.vimrc, ~/.gvimrc (user); /etc/vim/vimrc, /etc/gvim/gvimrc (system).
Example: set guifont=Monospace\ 12 guioptions-=T

GUI FEATURES

Menus (:emenu), toolbar toggle (set guioptions+=T), fullscreen (set fu), font dialog (:set guifont=*)

REMOTE USE

gvim --servername GVIM --remote-silent file.txt opens in existing instance; --remote-send sends keys.

HISTORY

Developed by Bram Moolenaar; Vim started 1991 as vi clone. gVim X11 port 1992 (v1.14). Evolved with Vim: Neovim fork 2014 competes. Current: Vim 9.1 (2024), gVim mirrors. Widely used in Unix/Linux for 30+ years.

SEE ALSO

vim(1), vi(1), vimdiff(1), vimtutor(1), xxd(1)

Copied to clipboard