11 examples for vim

{{ score }}
  # Vim open multiple files
vim -O file1 file2 # Vertical split
vim -o file1 file2 # Horizontal split
vim -p file1 file2 # Tabbed

# You can use wildecard too
vim -o *.txt
{{ score }}
  # Vim edit remote file (Works with FTP and SFTP too)
vim scp://user@host/path/file.name
{{ score }}
  # Vim has an intricate system of splits and tabs. 
# A full session can be saved with the command 
# :mksession file.vim
# the command below restores every split and tab
vim -S file.vim
{{ score }}
  # Starts vim with a blank vimrc. (Effectively starting vim in "safe" mode)
vim -u NONE
{{ score }}
  # Run Vim command(s) right after start
vim +'h motion | only | tabe +h text-object | only | tabe +h leader | only'
{{ score }}
  # Encrypt files using vim
vim -x my-secret-file

# Remember the password :-)
vim my-secret-file
{{ score }}
  # Open file.txt placing the cursor at line 123
vim file.txt +123
{{ score }}
  # Pipe to the Vim
echo 'some stuff' | vim -
{{ score }}
  # Create a vim instance called SERV that can be remotely controlled.
vim --servername SERV

# Send .vimrc for the instance to edit.
vim --servername SERV --remote ~/.vimrc

# Send keys to the remote server telling it to quit
vim --servername SERV --remote-send ":q"

# vim must be compiled with "clientserver".
# This can easily be provided on Arch by installing the gvim package.
{{ score }}
  # Opens FILE in binary mode, so you can edit binary files with Vim
vim -b FILE

# Once you've opened it, you can type :%!xxd to run it through the xxd program,
# giving you a hexedit like interface. :%!xxd -r will convert it back to binary
{{ score }}
  # Type a file name after vim in order to open the vim editior with that text file
vim pythonExample.py
vim README.txt
vim PerlExample.pl