Skip to main content

Connect to Vim server, edit files, evaluate Vim expressions, and send commands to Vim.

Project description

vim-client - send commands to the Vim editor

The command-line tools vim-client-edit, vim-client-diff and the Python module vim_client will allow you to connect to a Vim server and make it:

  • Edit files or directories in new tabs,
  • Compare files (similar to vimdiff),
  • Evaluate expressions and return their result,
  • Send commands to Vim.

It will allow you, for example, to make Vim edit or diff files from outside of Vim (e.g. from a shell like Bash, Zsh, etc.).

License

Copyright (c) James Cherti.

Distributed under terms of the MIT license.

Requirements

  • Python >= 3.0
  • The Vim editor ('vim' or 'gvim' in $PATH. Vim must be compiled with |+clientserver|, which is the case of most Vim distributions, because the Python module vim_client uses command-line arguments vim --remote-*)

Installation

sudo pip install vim-client

The 'vim-client-*' command-line tools

Edit a file in the current window/tab:

vim-client-edit file1

Edit multiple files/directories in separate tabs:

vim-client-edit --tab file1 file2 file3

Edit multiple files/directories in stacked horizontal splits:

vim-client-edit --split file1 file2

Edit multiple files/directories in side-by-side vertical splits (To open vertical splits on the right of the current window, use the Vim option set splitright):

vim-client-edit --vsplit file1 file2

Edit and compare up to eight files in a new tab:

vim-client-diff --tab file1 file2

Recommendations

Add aliases to ~/.bashrc

It is recommended to add the following aliases to your ~/.bashrc:

alias gvim='vim-client-edit --tab'
alias vim='vim-client-edit --tab'
alias vi='vim-client-edit --tab'
alias vimdiff='vim-client-diff --tab'

Start diff mode with vertical splits (vim-client-diff)

Add the following line to your ~/.vimrc:

set diffopt+=vertical

Create desktop launchers

File: /usr/local/share/applications/vim-client-edit.desktop

[Desktop Entry]
Name=vim-client-edit
GenericName=Vim Client Edit
Comment=Vim Client Edit
Exec=vim-client-edit --tab %F
Terminal=false
Type=Application
Keywords=Text;editor;
Icon=gvim
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

File: /usr/local/share/applications/vim-client-diff.desktop

[Desktop Entry]
Name=vim-client-diff
GenericName=Vim Client Diff
Comment=Vim Client Diff
Exec=vim-client-diff --tab %F
Terminal=false
Type=Application
Keywords=Text;editor;
Icon=gvim
Categories=Utility;TextEditor;
StartupNotify=false
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vim-client-1.0.5.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vim_client-1.0.5-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file vim-client-1.0.5.tar.gz.

File metadata

  • Download URL: vim-client-1.0.5.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for vim-client-1.0.5.tar.gz
Algorithm Hash digest
SHA256 1010156d9efcdd064166011bd59dd6c8a56787863586108df38e8c21f55eef4b
MD5 fb3f2559c6424b614da2e231695695ef
BLAKE2b-256 4fbd729dfcea99ad554b27ba9aa7f80f842859c28e7940f8e3dad121bd3ed0d3

See more details on using hashes here.

File details

Details for the file vim_client-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: vim_client-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

File hashes

Hashes for vim_client-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7314c6546c5856d1861675af4ff7e37af3c2cd283469bb8c6b20c9be5c8bcd93
MD5 25f5156503d42d5820a992c37da41e54
BLAKE2b-256 0c58694c2f1354991203cb7c6b7bda08b320c52d1f1e10f87ffba062f96f1bcc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page