Friday, May 24, 2019

Re: [Legacy Email] how to call vim on files that are the results of a grep -l command in bash?

On Fri, 2019-05-24 at 04:40 -0700, DwigtArmyOfChampions wrote:
> [EXTERNAL SOURCE]
>
>
>
> From a bash shell I can type "grep -l 'foo' *" and that will output a list of files that contain 'foo'. I want to vim that list of files. In other words, assuming the grep command returns file1,
> file2, ... filen, I want to run the command:
>
> vim file1 file2 file3 ... filen
>
> I tried "grep -l 'foo' * | vim" and "grep -l 'foo' * | xargs | vim' but those didn't work. Any ideas?
>
> --


vim $(grep -l foo)


--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/910a7cf2180c990a7d8eb6e09a4b5fa5879d5856.camel%40omnicell.com.
For more options, visit https://groups.google.com/d/optout.

how to call vim on files that are the results of a grep -l command in bash?

From a bash shell I can type "grep -l 'foo' *" and that will output a list of files that contain 'foo'. I want to vim that list of files. In other words, assuming the grep command returns file1, file2, ... filen, I want to run the command:

vim file1 file2 file3 ... filen

I tried "grep -l 'foo' * | vim" and "grep -l 'foo' * | xargs | vim' but those didn't work. Any ideas?

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/7d6607c5-2a07-4556-830c-a546045d317b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wednesday, May 22, 2019

Re: Vim "by far the best editor on the iPad"

> On May 21, 2019, at 6:07 PM, 'Lifepillar' via vim_use <vim_use@googlegroups.com> wrote:
>
> On 18 May 2019, at 20:17, Eric Weir <eeweir@bellsouth.net> wrote:
>>
>> Lotsa questions about running Vim on an iPad within the constraints of iOS/iVim. For starters, just two: Is it possible to create folders in the iVim sandbox, e.g., in the .vim folder?
>
> Yes. You can do it with netrw:
>
> :edit .
> d
> Type directory name
>
> You may get an error, but the directory is created. Anyway, much easier is to copy your .vim folder from your Mac using iTunes. For more about moving files into and from iVim, see `:help ios-share`. For iOS-specific information, see `:help ios`. You may long-tap with one finger to hide/show the extended keys above the keyboard and long-tap with two fingers to hide the keyboard (type with one finger to show it again): this will make more room for reading. Use two fingers to scroll.

Thanks much for the response.

I succeeded in creating a new folder. When I try to delete it I get "unable to remove directory…." and "Cannot make changes, 'modifiable' is off" I was able to rename it, though.

Wow! Copy the entire .vim folder to the iPad? I had assumed much of would be incompatible, that I'd have to recreate my setup piecemeal, one step at a time. E.g., I have vundle installed. It requires git. I gather there are a number of git apps for iOS. If I have one installed will sandboxing of apps allow vim to access git when I run vundle?

>> Where is the .vimrc?
>
> In /private/var/mobile/Containers/Data/Application/APP-ID/Documents. Use :lcd to see the full path.
> You may access your sandboxed directory with netrw as above:
>
> :edit .
> :Rex (to exit netrw)
>
> See :help netrw for more information (only a subset of netrw functionality is working in iVim).

When I do :Rex nothing happens.

Does iVim have a default .vimrc? Or do I have to create it? If the former I don't find it.

I know I'm being I'm being really dense. I've been away from vim a good while. It will start coming back. Meantime, I appreciate the help.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eeweir@bellsouth.net

"(I)t is important that awake people be awake... the darkness around us is deep."

- William Stafford

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/A03E028D-B436-4F49-A7E0-81D6D3628117%40bellsouth.net.
For more options, visit https://groups.google.com/d/optout.

Tuesday, May 21, 2019

Re: Vim "by far the best editor on the iPad"

On 18 May 2019, at 20:17, Eric Weir <eeweir@bellsouth.net> wrote:
>
>
> Lotsa questions about running Vim on an iPad within the constraints of iOS/iVim. For starters, just two: Is it possible to create folders in the iVim sandbox, e.g., in the .vim folder?

Yes. You can do it with netrw:

:edit .
d
Type directory name

You may get an error, but the directory is created. Anyway, much easier is to copy your .vim folder from your Mac using iTunes. For more about moving files into and from iVim, see `:help ios-share`. For iOS-specific information, see `:help ios`. You may long-tap with one finger to hide/show the extended keys above the keyboard and long-tap with two fingers to hide the keyboard (type with one finger to show it again): this will make more room for reading. Use two fingers to scroll.

For plugins, pure VimScript plugins should generally work (but keep in mind that iVim is based on Vim 7.4). If a plugin requires Python, Perl or Ruby then you're out of luck.

> Where is the .vimrc?

In /private/var/mobile/Containers/Data/Application/APP-ID/Documents. Use :lcd to see the full path.
You may access your sandboxed directory with netrw as above:

:edit .
:Rex (to exit netrw)

See :help netrw for more information (only a subset of netrw functionality is working in iVim).

Life.

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/BE3389BA-D12A-4816-ABF0-162057A218AC%40icloud.com.
For more options, visit https://groups.google.com/d/optout.

Re: Vim "by far the best editor on the iPad"

> On May 21, 2019, at 3:19 PM, Bram Moolenaar <Bram@moolenaar.net> wrote:
>
>>
>> When I do :vimtutor in iVim on my iPad or in MacVim on my MacBook I
>> get "not an editor command." Anyone have any ideas about why?
>
> It is a shell command, not a command to use inside Vim.
>
> % vimtutor

Thanks.

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eeweir@bellsouth.net

"(I)t is important that awake people be awake... the darkness around us is deep."

- William Stafford

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/AACA8298-41BD-46A5-9084-6489725F2F1C%40bellsouth.net.
For more options, visit https://groups.google.com/d/optout.

(Obscure) problem with bash syntax highlighting

bash allows (yes, it is a "bashism") syntax like:

$ echo ${var:9:5}

To mean extract a substring of the variable, starting at position 9 and of length 5.

But is also allows the offset (and then length, too, but ignore that for now) to be
negative.  But, alas, as noted in "man bash", if the offset is negative, you have to
put a space after the :, in order to avoid ambiguity with the usual ${var:-xxx}
construct.  So, you have to write:

$ echo ${var: -9:5}

Alas, vim flags this as an error.  If I take out the space before the -, the
highlighting is OK.  But with the space, it is flagged as error.

Can this be fixed?

Note: I tried contacting the listed author/maintainer (Charles Campbell) via email first (before posting this), but the mail bounced.  It looks like the sh.vim file hasn't been updated since 2014.

Note also: This was tested under VIM 7.4 (which is what I use).  If it has been fixed in a later version, please let me know.

Re: Vim "by far the best editor on the iPad"

Eric Weir wrote:

> > On May 18, 2019, at 2:17 PM, Eric Weir <eeweir@bellsouth.net> wrote:
> >
> > As I indicated in my initial post, I've largely been away from Vim for a few years. Lotsa things have become Greek to me that once we're not. Help Appreciated.
>
> When I do :vimtutor in iVim on my iPad or in MacVim on my MacBook I
> get "not an editor command." Anyone have any ideas about why?

It is a shell command, not a command to use inside Vim.

% vimtutor

--
hundred-and-one symptoms of being an internet addict:
5. You find yourself brainstorming for new subjects to search.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/201905211919.x4LJJBaA016550%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.