2016-03-09 17:02 GMT+03:00 Tim Chase <v...@tim.thechases.com>: > add the following to your vimrc: > > let myfile='/path/to/your/file' > > then you can invoke vim with > > vim -c 'exe "e ".myfile' > > which is a bit awkward, so you might want to make an alias if you > intend to do it frequently.
You forgot `fnameescape()`: `vim -c 'execute "edit" fnameescape(myfile)'`. In most cases this can also be written as vim -c 'edit `=myfile`' Unlike your variant which does not allow a huge number of characters including spaces and `[]` which are not uncommon, `=myfile` does not allow only newline characters inside `myfile`. Has a problem that if `myfile` matches some pattern in `&wildignore` option vim will not open anything, so this variant is for manual uses only, for scripts (aliases, user commands, etc: for any place which is written once) there is fnameescape(). > > -tim > > > -- > -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_use" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_use+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.