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.).
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 a new tab:
vim-client-edit file1
Compare two files:
vim-client-diff file1 file2
Add aliases to ~/.bashrc
It is recommended to add the following aliases to your ~/.bashrc
:
alias gvim=vim-client-edit
alias vim=vim-client-edit
alias vi=vim-client-edit
alias vimdiff=vim-client-diff
Add to ~/.vimrc
If you prefer to start diff mode with vertical splits:
set diffopt+=vertical
License
Copyright (c) James Cherti.
Distributed under terms of the MIT license.
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.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for vim_client-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a4063e1e5658b58746651239ff2ebf3f4bef5886cfaaf806dc297bcf6abe7fe |
|
MD5 | 9ccea62d5147b55615b935304f909309 |
|
BLAKE2b-256 | 9865a8a1ca704e5786727f682eb7959e50c9ad76b80923cc1a4e09c156a502dc |