Questions tagged [argument-list]

Questions about the usage and the manipulation of the argument list. The argument list is the list of file names you give when starting Vim.

Filter by
Sorted by
Tagged with
2
votes
0answers
25 views

Can I define window position/contents via command line arguments ? Maybe a sort of parameterised session file? [duplicate]

I would like to open, say, 4 files and then have windows arranged in a grid so that the first file was in top left, second bottom left, third top right and fourth bottom right. So a command like this (...
3
votes
2answers
43 views

How to pre-process command line arguments provided to vim?

I want to add support for various formats of filenename with linenumber for vim to understand. E.g. I get output from git grep <keyword> like this: first/foo.py:123: first/bar.py:333: second/foo....
2
votes
1answer
55 views

Use cases of “:rewind”? How does it differ from “:b1”?

After reading :help :rewind :rew[ind] [++opt] [+cmd] Start editing the first file in the argument list. This fails when changes have been made and Vim does not want to |abandon| the ...
1
vote
2answers
33 views

How to set read only for only one buffer

I'm using vim with some plugins, such as Nerdtree, YCM, to build an coding environment. Now I want to achieve this: When I execute the command vim, a file containing some ASCII image, will be loaded ...
2
votes
2answers
54 views

Plugin to edit whole datasets/projects

I'm using vim all the time for text editing these days, and have a particular use case: editing a dataset using successive commands. The main problem, as often, is fixing things, ideally rather ...
0
votes
0answers
28 views

How can I see what arguments vim was invoked with?

Is it possible to see what arguments vim was invoked with when it was run? vim -O foo bar To show -O foo bar, but especially if there are configurations set like -Z?
2
votes
1answer
52 views

How to add files to argument list without adding them to buffer list?

I would like to run some command on each .js file of project. Argument list seems like a perfect usecase for it. :arga **/*.js :argdo 'some_command' The problem is that using :arga **/*.js adds all ....
0
votes
1answer
203 views

Use the arglist without opening the files

When I use the args command it opens the files: :args `find . -name \*.html` I would like to do an operation on the arglist without opening the files at all in a buffer, or either opening them one ...
1
vote
1answer
422 views

How can i get the arglist count?

I am writing a bash script about session management and what I want is if there's something in the arglist not to source the session. But I couldn't find a way to check the length of :args First of ...
3
votes
1answer
1k views

How to call the fzf Ag command with multiple arguments?

The plugin fzf.vim defines the following vim command here: command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, <bang>0)' the fzt#vim#ag function seems to allow passing all the ag ...
3
votes
1answer
48 views

how to use the number returned by arglistid()

In the doc little is said about this number. Can we retrieve the entire arglist using this number and get all the versions of arglist?
2
votes
2answers
3k views

Handling Complex Arguments in a Vim Command

I am working on a VIM plugin that will require a certain level of complexity for handling arguments passed to a command. :MyCommand -item=banana -command=ls\-ltra -pattern=./* However, I am not sure ...
0
votes
1answer
1k views

Exiting back to normal mode in terminal buffer from Vimscript

<C-\><C-n> is working as (I'd) exepected, but not from a Vimscript. I am trying to make a script that will: open Neovim's :terminal run a python script exit from the terminal input mode ...
3
votes
2answers
326 views

How does double star work in vim?

When I run shopt -s globstar; ls -1 tests/**/Helpers/**/*.php in bash I get: tests/Helpers/Layout.php tests/Helpers/Link.php tests/Helpers/LinksPage.php tests/Helpers/LiqpayRedirect.php tests/Helpers/...
3
votes
2answers
429 views

Passing a # character to the shell in vimscript?

In my previous question, I passed an argument into a Vimscript function and concatenated it into the command line. This works great, but when you pass a string that contains the # character, it balks ...
4
votes
2answers
179 views

Can I run -c in batch mode (without opening the curses display)?

I find myself performing a small shell loop (involving vim) to transform files into the correct line endings for my system. It looks as follows: for i in *; do vim -c 'set ff=dos' -c 'wq' $i; done ...
1
vote
1answer
193 views

How to remove lines matching pattern in all files changed in one editing session?

I'm trying to create function and a mapping to insert/remove breakpoints in python code. So far I got this function! AddBreakPoint() let l:line = line('.') let l:indentChar = ' ' call ...
1
vote
1answer
208 views

navigating multiple files - arguments and buffers

I've been learning vi (as an autodidact) for some weeks. Actually I'm not yet sure about if I'm using vi or vim (does the command vi open vim if vim is installed?). Now I'm trying to edite multiple ...
2
votes
1answer
96 views

Is is possible to change the order of the argument list?

When I have multiple files in the argument list, can I rearrange the order of the list? For example :args [A.md] B.md C.md D.md E.md F.md is there a command/series of commands that gives me :args ...
3
votes
2answers
97 views

Is it possible to add a file to the argument list with in netrw?

I am a heavy user of the argument list and I always have the files which are important for my current task in it. Now I started to use netrw more often to search through the files system. But I can't ...
0
votes
1answer
272 views

Why argdo applies changes only to the last file?

Given the following files with two trailing spaces at the end: $ echo "test1 " > test1.txt; echo "test2 " > test2.txt; echo "test3 " > test3.txt $ hexdump -C *.txt 00000000 74 65 73 74 ...