Skip to content
MhlovPublic

About

Wrapper for vim servers.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svim

Wrapper for Vim servers

Dependencies

  • Perl 5.10 or later
  • Vim (compiled with +clientserver support)
  • tmux (optional)
  • x-terminal-emulator (optional)

Usage

svim.pl [options] server name [Vim arguments]
svim.pl +a [Vim arguments]
svim.pl +A [Vim arguments]
svim.pl

Options

  • +t - Run a Vim server in a new terminal window.
  • +T - Run a Vim server in a new tmux window.
  • +h - Split the current tmux window horizontally and run a Vim server.
  • +v - Split the current tmux window vertically and run a Vim server.
  • +a - Select a server from a list.
  • +A - Similar to +a, but automatically selects the server if there is only one. If there are no servers, a server named A is started.

Environment

VIM_BIN

Specifies the Vim executable. The default is vim.

TERMINAL

Specifies the terminal emulator executable. The default is x-terminal-emulator.

TMUX_BIN

Specifies the tmux executable. The default is tmux.

SVIM_LOCK_FILE

Specifies the lock file used to prevent concurrent instances. The default is $XDG_RUNTIME_DIR/svim.lock, or /var/lock/svim.lock if $XDG_RUNTIME_DIR is not set.

Examples

svim.pl FOO hello-world

Run the FOO Vim server and edit hello-world file on it.

svim.pl +t BAR

Run the BAR Vim server in a new terminal window.

svim.pl BAR "+call cursor(34,1)" baz.md

Edit file baz.md on BAR Vim server and position the cursor on line 34.

svim.pl +A qux.pl

Select a server on which to edit qux.pl. If there is only one running server, it is selected automatically. If there are no running servers, server A is started.

zsh completion

mkdir -p ~/.zsh/functions
cp zsh-completion/_svim.pl ~/.zsh/functions/

aliases in .zshrc

alias svils='vim --serverlist'
alias svimls='svils'

alias svi='svim.pl'
alias svim='svi'

alias wsvi='svim +t'
alias wsvim='wsvi'

alias savi='svim +A'
alias savim='savi'

alias wsavi='svim +tA'
alias wsavim='wsavi'

alias tsvi='svim.pl +T'
alias tvsvi='svim.pl +v'
alias thsvi='svim.pl +h'
alias tsvim='tsvi'
alias tvsvim='tvsvi'
alias thsvim='thsvi'

update-desktop-vi-server.pl

Handling desktop files for Vim servers. (Can work without svim.pl.)

screenshot01

Usage

Add the following lines to your .vimrc:

if has("autocmd")
    augroup SVIM
        autocmd!
        autocmd VimEnter * silent execute "!update-desktop-vi-server.pl&" | redraw!
        autocmd VimLeave * !update-desktop-vi-server.pl 1
    augroup END
endif

About

Wrapper for vim servers.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages