Questions tagged [invocation]

Questions about the different options that vim can take from the shell and the different commands to start the editor.

A first reading about Vim's command line options should be man vim.

Vim can be started from the shell in different ways, e.g.:

  • vim The "normal" way, everything is default.
  • ex Start in Ex mode. Go to Normal mode with the :vi command.
  • view Start in read-only mode. You will be protected from writing the files.
  • gvim/gview The GUI version. Starts a new window.

Also some common options are:

  • -u allows to specify a file to use as configuration file other than the .vimrc
  • -c allows to specify an ex mode command to be executed after the first file was read.
  • -w allows to record in a file every keystrokes issued in Vim.
57 questions
24
votes
5 answers

Is it possible to pipe vim commands to vim?

I want to run the following shell. wea-this is the end of the second word | vim j exit 0 Which I had hoped would pipe the key strokes w (move forward a word) then e (end of the word) then a (append) then -this is the end of the second word (text)…
Jason Basanese
  • 969
  • 1
  • 8
  • 17
8
votes
3 answers

How do I introduce a "light mode", in which not all plugins are loaded?

My Vim config includes plugins that try to handle current project, build tags, etc. This is quite useful for my daily programming in Vim, but it's just annoying when I use Vim for some quick edits, like: edit a git commit message; edit a shell…
Dmitry Frank
  • 183
  • 4
5
votes
1 answer

Start vim with ex-command and append it to vim's command history

When I start vim with an ex-command as command line parameter, it won't show up in vim's command history. Why? Can I tell vim to do so? Minimal example: vim -c 'execute "help -c"' Why I'm asking: After grepping (with rg) in the command line,…
MaxGyver
  • 231
  • 1
  • 8
4
votes
0 answers

vim ~/symlink-to-dir/file resolves symlink to target instead of symlink path

vim ~/symlink-to-dir/file resolves the symlink and shows me ~/real-dir/file in the status line and in echo expand('%'). After a few hours of experiments I found the problem is reproducible. The conditions for the bug are (~/.vim/ and ~/.vimrc are…
phd
  • 141
  • 3
3
votes
2 answers

How can I automatically execute normal mode keystrokes with a terminal command when opening Vim?

How do I run vim with file.txt and screen center at line 100? Basically I would like to use zz mapping when starting Vim. This does not work: vim -c "zz" file.txt +100
name
  • 965
  • 2
  • 8
  • 8
1
vote
2 answers

how to load multiple files into separate buffers from zsh command line?

I have a list of files like step-1.py, step-2.py etc and if I try to open them with vim files-*.py then I get a list of buffers like: :ls 1 %a "step-10.py" 2 "step-11.py" 3 "step-12.py" 4 "step-13.py" 5 "step-14.py" …
alec
  • 795
  • 6
  • 20
0
votes
1 answer

Command line argument for lengthy command

I keep a sys.md file where I record a dated entry of every modification I make to my system (mostly installations of software, sometimes configuration changes) and based on an old Hacker News link about a did file I came up with the idea of an alias…
mas
  • 555
  • 1
  • 4
  • 13