Saturday, May 31, 2014

Re: Filetype specificity for menus

* Christian Brabandt <cblists@256bit.org> [140531 05:19]:
> Hi Tim!
>
> On Fr, 30 Mai 2014, Tim Johnson wrote:
>
> > I'm using vim 7.3 Huge Gtk2-gnome gui, on ubuntu 12.04.
> >
> > I've used vim for many years but have not figured out how to do the
> > following :
> >
> > Make a menu item coded for a specific filetype *not* be present in a
> > buffer of a different filetype.
> >
> > Example : with python.vim, a menu for python-specific actions is
> > installed. Switching to a javascript buffer, the python menu
> > remains. It would be great if it were to go away.
>
> I think, all that is possible is to disable a certain menu but you can't
> actually removed it once it was defined.
thanks Christian. At long last I have found something that I like
better about that editor that starts with 'e'. Since that is
pretty much the only thing I like better .... I wonder if the
following is possible in vim :

Disable the installation of filetype-specific menus.
Of course I could do it by tweaking the code of the .vim source
file, but that is a "rigged" solution IMHO. Is there a vim
command that would stop a menu from being loaded in the first
place?
This would be useful if I were using an alternate computer, such
as one of my netbooks with a small screen which might not be able
to accomadate the number of menus that might accumulate if I have
a session with multiple filetypes.

thanks
--
Tim
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Filetype specificity for menus

Hi Tim!

On Fr, 30 Mai 2014, Tim Johnson wrote:

> I'm using vim 7.3 Huge Gtk2-gnome gui, on ubuntu 12.04.
>
> I've used vim for many years but have not figured out how to do the
> following :
>
> Make a menu item coded for a specific filetype *not* be present in a
> buffer of a different filetype.
>
> Example : with python.vim, a menu for python-specific actions is
> installed. Switching to a javascript buffer, the python menu
> remains. It would be great if it were to go away.

I think, all that is possible is to disable a certain menu but you can't
actually removed it once it was defined.

Best,
Christian
--
Die Arroganz der Kleinen ist es, immer von sich, die der Großen nie
von sich zu reden.
-- François Marie Voltaire

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Filetype specificity for menus

Hello,


> Make a menu item coded for a specific filetype *not* be present in a
> buffer of a different filetype.
>
> Example : with python.vim, a menu for python-specific actions is
> installed. Switching to a javascript buffer, the python menu
> remains. It would be great if it were to go away.

Years ago I have patched Michaels Gedes's buffer-menu plugin.
The end result is there: https://code.google.com/p/lh-vim/source/browse/misc/trunk/plugin/buffermenu.vim

Just use :Bmenu, :Binoremenu, etc to define a new menu entry.


If you want to define a menu entry and a mapping in one go, I have defined several functions in lh-vim-lib that exploit buffermenu if installed: https://code.google.com/p/lh-vim/wiki/lhVimLib#Menus_related_functions

See the test file: https://code.google.com/p/lh-vim/source/browse/vim-lib/trunk/tests/lh/test-menu-map.vim

I also provide a way to define cyclic options (like: Build in {Debug, Release, ReleaseWithInfo}). See the test file: https://code.google.com/p/lh-vim/source/browse/vim-lib/trunk/tests/lh/test-toggle-menu.vim

HTH,

--
Luc Hermitte
http://lh-vim.googlecode.com/

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Friday, May 30, 2014

Filetype specificity for menus

I'm using vim 7.3 Huge Gtk2-gnome gui, on ubuntu 12.04.

I've used vim for many years but have not figured out how to do the
following :

Make a menu item coded for a specific filetype *not* be present in a
buffer of a different filetype.

Example : with python.vim, a menu for python-specific actions is
installed. Switching to a javascript buffer, the python menu
remains. It would be great if it were to go away.

thanks
--
Tim
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com

--
--
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.
For more options, visit https://groups.google.com/d/optout.

How to keep only patterns in string

Hi,

I got a string that contains some informations that I need to keep and if possible dispatch into array.


The string:

some title informations


tat local distant
-------------------------
OK U: \\10.198.169.0\users
OK V: \\10.198.168.0\users
OK W: \\10.198.167.0\users
OK Y: \\10.198.166.0\users





I would like to obtain a list in vimscript that contains:
myList=[U,V,W,Y]



Thank you

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: installation language

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512



On May 30, 2014 11:51:30 AM GMT+03:00, eNG1Ne <communicator.ngn@gmail.com> wrote:
>I'm temporarily obliged to install everything I need on a new Windows 7
>PC, until I get back to Liinux and (relative) sanity. I'm already
>frustrated with the difficulties of trying to tell it I want UK
>English, a dot as decimal separator, and a Belgian 102-AZERTY keyboard
>… and irritated that while many installs have gone for English as
>interface language, GVim has installed itself in Dutch.
>
>Not that this prevents me from using the editor, especially as I
>generally use the command line, but for comfort and familiarity – how
>can I get a guaranteed installation in English?

Try :language en<Tab>, this will probably show you the name(s) of available English locales. :language C should work in any case. After you figure out what works put it into your vimrc, guarded with :if has('win32') (linux locales have different names, except for C locale).

Usually vim ships with all translations at once and untranslated English variant is for sure embedded in the executable. You should get it with C locale.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1

iQI1BAEBCgAfBQJTiD5BGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj
HhHSvgWHEACc6qTiwMURAa3UrcVDBU4XluE+HpC0DH9ypUe28dBgflEwsawngs1A
ke8fXzhZvprNWEWgL5eOmZNKSJxRb9xXDVhSDYKAkZ8y4a8ip4qYSiWChQZQWbEJ
iw6RJWkkjicTwZlS8B/baqeCK75sG/JkFWfs3dyGA60+R8nxbqCWRb4FFVvyovqk
uqjmHhbygttBb2aOdalFIdSohlj5CUxwbqF+ldo6S6T0Qb90bEsu0pAibINPS3UT
cxi6UwqIUmT9BOKhMgGTD1mpEnKyH+bd2aZvGTHRYoC10NUyIbaHISH7aSZ77MwB
FnOvdJu5PK+aCNOD4gRqF5IYFkZRuNXDpZl8PfAaQ0VLNjavHl1uhHGUfGEmAD03
+m8gEAqwst0I8i9NMto7d8CSvcNize7N7kNthIe1pTNCkHkBoZ4Xi6wfEpLxipqu
XO1+1YTpEp4vyPDy0ajZJAVqobixG1W7hy8wz0JIdwNChQYJGrDngG89F4pR3ILK
5q1drib8CxaW0exnQeKejBz/WYTbrPu5UzLtiUbKT9kb9uao12bNbGPr9un/HTys
3looE9kgSmsE9IEc6b7TY63Sle75MKzN6yYzsYb3LEL7/jiMLZaOQc/LRjQ9NcFg
6zHXfaEm/BR8L4YLi3PQkXFWW22H68Rrw0bLPORcWGj2Z9H7x63IWw==
=FoWt
-----END PGP SIGNATURE-----

--
--
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.
For more options, visit https://groups.google.com/d/optout.

installation language

I'm temporarily obliged to install everything I need on a new Windows 7 PC, until I get back to Liinux and (relative) sanity. I'm already frustrated with the difficulties of trying to tell it I want UK English, a dot as decimal separator, and a Belgian 102-AZERTY keyboard … and irritated that while many installs have gone for English as interface language, GVim has installed itself in Dutch.

Not that this prevents me from using the editor, especially as I generally use the command line, but for comfort and familiarity – how can I get a guaranteed installation in English?

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Thursday, May 29, 2014

How to create a short help for Evil

How to provide a short help page for Evil? I need a command line

:help

that lists the Evil key bindings whenever the user is in evil-mode. In emacs mode, the user must get the normal emacs help. I will provide the text for the help file.

The persons who need the help are lawyers who use emacs, since it offers a program called org-mode, that lawyers need for many of their applications. These lawyers don't know much about Vim, therefore they need the help file. I posted this question in this Vim group, because most Evil users are from the Vim community.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Copy the full path of the file opened in my current buffer.

On Thursday, May 29, 2014 9:52:15 AM UTC-5, Arup Rakshit wrote:
>
> Thanks. I am away from my PC, so not able to test it. Just wanted to know "ap
>
> will copy the file path to *clipboard* right ? Basically I want it to copy and
>
> paste in my console for my project related works.
>
>

Um...no.

This command is two parts. '"a' specifies register 'a', which is internal to Vim. This is NOT the system clipboard. 'p' is the "put" or "paste" command. So this command pastes from an internal register, it does not copy to the system clipboard.

For that, instead of :let @a=expand("%:p") you need to specify the system clipboard:

:let @+=expand("%:p")

This assumes your Vim is compiled to be capable of copy-paste with the system clipboard.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Copy the full path of the file opened in my current buffer.

On Thu, May 29, 2014 at 9:38 AM, Tim Chase <vim@tim.thechases.com> wrote:
On 2014-05-29 05:01, Arup Rakshit wrote:
> How can I copy the output of Ctrl-G ? I want to get the and copy
> the full path of the file opened in my current buffer.

You can assign it to a register such as "a":

  :let @a=expand('%:p')

I do this so often that I added the following to my .vimrc:

if has('win32')
    nnoremap <Leader>fn :let @*=substitute(expand("%:p"), "/", "\\", "g")<cr>
else
    nnoremap <Leader>fn :let @*=expand("%:p")<cr>
endif

So on Windows (primary platform), when I use the mapping it converts to backslashes so that I can for example attach the file to an email, or whatever.  When on *nix, just use the filename.

But I copy the filename into the system clipboard.

HTH,
David

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Copy the full path of the file opened in my current buffer.

On Thursday, May 29, 2014 08:38:51 AM Tim Chase wrote:
> On 2014-05-29 05:01, Arup Rakshit wrote:
> > How can I copy the output of Ctrl-G ? I want to get the and copy
> > the full path of the file opened in my current buffer.
>
> You can assign it to a register such as "a":
> :let @a=expand('%:p')
>
> and then paste it with
>
> "ap

Thanks. I am away from my PC, so not able to test it. Just wanted to know "ap
will copy the file path to *clipboard* right ? Basically I want it to copy and
paste in my console for my project related works.


--
================
Regards,
Arup Rakshit

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Opening large files?

Hi Bram,

2014/5/14 Wed 23:19:38 UTC+9 Ken Takata wrote:
> Hi Bram,
>
> 2014/5/13 Tue 20:12:59 UTC+9 Bram Moolenaar wrote:
> > Ken Takata wrote:
> >
> > > 2014/5/13 Tue 3:40:37 UTC+9 Bram Moolenaar wrote:
> > > > So is the patch now ready to be included, or did you still have a
> > > > problem to fix?
> > >
> > > I think it's ready. I don't see any regressions with the patch (at least in my
> > > use cases).
> > > Updating the tests is another todo item.
> >
> > Well, it's better to have tests before including it. The tests might
> > find a flaw.
>
> OK, I wrote very simple tests for getfsize(), getfperm(), getftime(),
> getftype() and :checktime.
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/09e276a96d721ded06d8a140e730638ffdfb18ca/add-stat-test.patch

I have updated the tests for 7.4.315. (Just renamed from test107 to test108.)
https://bitbucket.org/k_takata/vim-ktakata-mq/src/tip/add-stat-test.patch

Regards,
Ken Takata

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Copy the full path of the file opened in my current buffer.

On 2014-05-29 05:01, Arup Rakshit wrote:
> How can I copy the output of Ctrl-G ? I want to get the and copy
> the full path of the file opened in my current buffer.

You can assign it to a register such as "a":

:let @a=expand('%:p')

and then paste it with

"ap

-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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Copy the full path of the file opened in my current buffer.

From the page you showed, "%y should.

On 29 May 2014 13:02, "Arup Rakshit" <tuka.08@gmail.com> wrote:
Hi,

How can I copy the output of Ctrl-G ? I want to get the and copy the full path of the file opened in my current buffer. I got Ctrl-G from the http://vim.wikia.com/wiki/Get_the_name_of_the_current_file, which is showing the output as I want. But how to copy the output ?

--
--
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.
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Copy the full path of the file opened in my current buffer.

Hi,

How can I copy the output of Ctrl-G ? I want to get the and copy the full path of the file opened in my current buffer. I got Ctrl-G from the http://vim.wikia.com/wiki/Get_the_name_of_the_current_file, which is showing the output as I want. But how to copy the output ?

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Wednesday, May 28, 2014

Re: screen draw problem and EasyTags question

On 05/28/2014 03:36 PM, Charles Campbell wrote:
> billy pilgrim wrote:
>> I am running V7.3 (Huge version with GTK2-GNOME GUI on Ubuntu 12.04
>> (LTS), and upon occasion when I page down, or up, there are a few
>> lines (~2) that do not get drawn. When I move the cursor over them,
>> they are (re)drawn, but not initially. I have never had this problem
>> with vim before, despite a couple of decades of use. This is not a
>> huge problem, but it is irritating. Anyone have any ideas?
>>
> Do you mean that you're getting blank lines, or perhaps no syntax
> highlighting? If the latter, what filetype are you using? This
> latter situation may be caused by synchronization (:help syn-sync). If
> the first meaning is intended, then are you using vim or gvim? Are you
> using fullscreen and a large monitor? (I'm wondering if there's a
> terminal refresh issue involved).
>
> Regards,
> C Campbell
>
I mean that I'm getting blank lines, and I am using gvim. It is a large
monitor( 27"), but not quite full screen. The resolution is 1920 x
1080. I recently changed to the GEFORCE GT 630 video card from NVidia.

Thanks for your help,

:bp:

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: screen draw problem and EasyTags question

billy pilgrim wrote:
> I am running V7.3 (Huge version with GTK2-GNOME GUI on Ubuntu 12.04 (LTS), and upon occasion when I page down, or up, there are a few lines (~2) that do not get drawn. When I move the cursor over them, they are (re)drawn, but not initially. I have never had this problem with vim before, despite a couple of decades of use. This is not a huge problem, but it is irritating. Anyone have any ideas?
>
Do you mean that you're getting blank lines, or perhaps no syntax
highlighting? If the latter, what filetype are you using? This latter
situation may be caused by synchronization (:help syn-sync). If the
first meaning is intended, then are you using vim or gvim? Are you using
fullscreen and a large monitor? (I'm wondering if there's a terminal
refresh issue involved).

Regards,
C Campbell

--
--
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.
For more options, visit https://groups.google.com/d/optout.

screen draw problem and EasyTags question

I am running V7.3 (Huge version with GTK2-GNOME GUI on Ubuntu 12.04 (LTS), and upon occasion when I page down, or up, there are a few lines (~2) that do not get drawn. When I move the cursor over them, they are (re)drawn, but not initially. I have never had this problem with vim before, despite a couple of decades of use. This is not a huge problem, but it is irritating. Anyone have any ideas?


Also, I am using the EasyTags plugin (which is quite good, I think), and have a problem: I am rewriting a program, and will frequently pull up the original to see what they thought they were doing, and then the functions in that file get pulled into the tag file (which I don't want). Anyone know a) if that can be stopped, or b) where the tagfile is kept so I can delete them manually? I did email the plugin author, but I haven't received a response yet.

Thank you very much,
:bp:

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Tuesday, May 27, 2014

Re: grep and quickfix

On 27 May 2014, Ben Fritz <fritzophrenic@gmail.com> wrote:
> On Monday, May 26, 2014 6:47:53 PM UTC-5, Mark Volkmann wrote:
> > On Monday, May 26, 2014 5:28:11 PM UTC-5, Mark Volkmann wrote:
> > > The issue is a conflict is between grep and jshint.vim. When I
> > > search for .js files that contain a given string, it finds them,
> > > then runs jshint on the first file. It finds no issues in the
> > > file, but that replaces the quickfix list that had been populated
> > > with search results with an empty list of jshint warnings. Any
> > > idea how I can make those two coexist?
> >
> > Looks like the key is to use
> > :colder
> > to get to the previous quickfix list created by grep.
>
> Ah, so you have a plugin that runs when you open the first file,
> overriding your quickfix list.
>
> I have two suggestions then:
>
> 1. Use :grep! instead of :grep to avoid opening the first match
> automatically.
> 2. Use ':noautocmd grep' to avoid running any plugins when the file is
> opened. Note this will prevent the filetype/syntax rules from loading
> as well, so it's probably better to use the first suggestion.
>
> I mainly suggest method (2) because it can be very useful with
> :vimgrep, especially using the ! variant :vimgrep!. It often speeds up
> your search. See http://vim.wikia.com/wiki/Find_in_files_within_Vim

Alternatively:

3. Use :lgrep / :lvimgrep instead of :grep / :vimgrep, to put search
results in a loclist, rather than in the quickfix list.

3'. Use something like syntastic to run jshint checks, which
automatically puts check results in a loclist.

I personally prefer syntastic combined with Ack, which is a frontend
to ack, which in turn is a (much) better grep:

http://beyondgrep.com/

/lcd

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: grep and quickfix

On Monday, May 26, 2014 6:47:53 PM UTC-5, Mark Volkmann wrote:
> On Monday, May 26, 2014 5:28:11 PM UTC-5, Mark Volkmann wrote:
> > The issue is a conflict is between grep and jshint.vim. When I search for .js files that contain a given string, it finds them, then runs jshint on the first file. It finds no issues in the file, but that replaces the quickfix list that had been populated with search results with an empty list of jshint warnings. Any idea how I can make those two coexist?
>
> Looks like the key is to use
> :colder
> to get to the previous quickfix list created by grep.

Ah, so you have a plugin that runs when you open the first file, overriding your quickfix list.

I have two suggestions then:

1. Use :grep! instead of :grep to avoid opening the first match automatically.
2. Use ':noautocmd grep' to avoid running any plugins when the file is opened. Note this will prevent the filetype/syntax rules from loading as well, so it's probably better to use the first suggestion.

I mainly suggest method (2) because it can be very useful with :vimgrep, especially using the ! variant :vimgrep!. It often speeds up your search. See http://vim.wikia.com/wiki/Find_in_files_within_Vim

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: matching the last part of a url -> and in a syntax file

Eric Smith wrote:
> Tim Chase wrote on Fri-23-May 14 6:32PM
>> \(http|\S*\/\)\@<=\w\+\/\=\S\@!
> Thanks Tim, this works perfectly when tested with matchstr(),
> however I need ti in a syntax file and there it appears to be a
> noop. I tried;
> syn match last_url '\(http\S*\/\)\@<=\w\+\/\=\S\@!'
>
> Any ideas?
>
It should "work perfectly" as is in a syntax file, too. I suspect that
you have some syntax priority issues going on.

* later syntax takes priority over earlier syntax:
syn clear
syn match One 'abc'
syn match Two 'abc'

hi link One Function
hi link Two Identifier

use this with a file containing only "abc". Result: abc is highlighted
using #2 (Identifier). Swap syn-matches One and Two and abc will be
highlighted using #1.

* regions have their own syntax highlighting, and may contain other
syntax recognition.
* nextgroup elevates priority of such syntax

Anyway, its involved. So, may I suggest trying my plugin

http://www.drchip.org/astronaut/vim/index.html#HILINKS

with its :HLT! command, move the cursor over the url: you'll be told
what highlighting groups are in use with the text under the cursor.

Regards,
Chip Campbell

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Monday, May 26, 2014

Re: grep and quickfix

On Monday, May 26, 2014 5:28:11 PM UTC-5, Mark Volkmann wrote:
> The issue is a conflict is between grep and jshint.vim. When I search for .js files that contain a given string, it finds them, then runs jshint on the first file. It finds no issues in the file, but that replaces the quickfix list that had been populated with search results with an empty list of jshint warnings. Any idea how I can make those two coexist?

Looks like the key is to use
:colder
to get to the previous quickfix list created by grep.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: grep and quickfix

The issue is a conflict is between grep and jshint.vim. When I search for .js files that contain a given string, it finds them, then runs jshint on the first file. It finds no issues in the file, but that replaces the quickfix list that had been populated with search results with an empty list of jshint warnings. Any idea how I can make those two coexist?

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Sunday, May 25, 2014

Re: Get expansion of digraph in VimL

On 25/05/14 08:17, Nikolay Pavlov wrote:
>
> On May 25, 2014 4:24 AM, "Tony Mechelynck" <antoine.mechelynck@gmail.com
> <mailto:antoine.mechelynck@gmail.com>> wrote:
> >
> > On 23/05/14 13:19, John Little wrote:
> >>
> >> On Friday, May 23, 2014 10:36:56 AM UTC+12, Nate Soares wrote:
> >>>
> >>> Is there a way to get the expansion of a digraph (entered e.g. with
> ^K in insert mode) programatically?
> >>
> >>
> >> There isn't a vim script way to do this directly. I can think of
> two ways, one somewhat unclean, the other pedestrian.
> >>
> >> Firstly, this approach may have side effects, might spoil your
> screen layout, and harm innocent animals:
> >>
> >> function! ExpandDigraph(dig)
> >> if a:dig !~ '^..$'
> >> return ""
> >> endif
> >> new
> >> exe "norm! a\<c-k>" . a:dig . "\<esc>"
> >> let result = getline(".")
> >> close!
> >> return result
> >> endfunc
> >>
> >> Secondly: capture the output of the command :digraph, (:help redir)
> and reformat it to one column (that's tricky because there's lots of
> funny characters), and write it to a file, say "digraphs.txt". Then,
> >>
> >> function! ExpandDigraph(dig)
> >> if !exists("s:digs")
> >> let s:digs = {}
> >> for line in readfile("digraphs.txt")
> >> let s:digs[line[0:1]] = line[3:]
> >> endfor
> >> endif
> >> return has_key(s:digs, a:dig) ? s:digs[a:dig] : ""
> >> endfunc
> >>
> >>> For example, I have vim set up to insert the ellipsis character '…'
> when I type "^K..". Is there a way, programatically, to write a function
> ExpandDigraph such that ExpandDigraph("..") yields "…"?
> >>
> >>
> >> BTW, with my vim 7.4.274 on linux ".." is a digraph for "‥" U+2025
> TWO DOT LEADER, not an ellipsis, "…" U+2026 HORIZONTAL ELLIPSIS. My vim
> only has digraphs for U+22EF MIDLINE HORIZONTAL ELLIPSIS and U+22EE
> VERTICAL ELLIPSIS. If you've defined your own digraphs, and you use my
> second approach you'd have to add yours to the file.
> >>
> >> Regards, John Little
> >>
> >
> > Note that nothing forbids having more than one digraph for the same
> character, and in fact by default some characters have both an RFC1345
> digraph and a "legacy Vim" digraph (as the latter was used before Vim
> digraphs were standardized to RFC1345). Having more than one character
> for a single digraph, however, is of course not possible: trying to
> define a new equivalent for an existing digraph replaces it.
> >
> > The above function would always return the last character-pair in the
> list for any given character, for instance (with the default digraphs)
> n~ (the legacy digraph) and not n? (the RFC1345 digraph) for U+00F1
> LATIN SMALL LETTER N WITH TILDE. (Any previous digraph for the same
> character would be replaced when creating the Dictionary.)
>
> ?! Quoted functions solve forward problem: given n? return U+00F1, not
> backward: given U+00F1 return n?.

Oops, sorry.


>
> >
> >
> > Best regards,
> > Tony.
--
With every passing hour our solar system comes forty-three thousand
miles closer to globular cluster M13 in the constellation Hercules, and
still there are some misfits who continue to insist that there is no
such thing as progress.
-- Ransom K. Ferm


--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: puzzling mapping behavior

On 2014-05-25 20:33, tom arnall wrote:
> nmap <c-y> 0i``<CR><esc>:%s/\s\*\n\s\*\n\s\*\n/\r\r/g<CR>/^``<CR>
>
> produces what seems to me an incorrect behavior. if the %s doesn't
> find anything, the cursor ends up on the line after the "``" mark.
> until recently it would land on the first "`" mark, i.e., where i
> want it. adding 'k' to the mapping has no effect

I suspect you want to add the "e" flag after your "g" because the
search fails. You may want to read at

:help map_return " particularly the "when an error is encountered..."

:help :s_flags " for info on the "e" flag

The error causes the mapping to stop being processed before you get
to the search returning you to the double back-ticks.

-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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: grep and quickfix

On 26/05/14 03:18, Jean-Rene David wrote:
> * Mark Volkmann [2014.05.25 20:44]:
>> When I run this:
>> :grep some-word **/*.js
>> it outputs lots of matches.
>> Then I run this:
>> :copen
>> and there is nothing in the quickfix list.
>> Isn't the grep command supposed to populate that?
>> Any ideas what I might be doing wrong?
>> I have not modified the grepprg or grepformat options.
>
> The most likely error is that grepformat doesn't
> match the output that you get. But you're not
> giving us much to go on.
>
> Can you perhaps show us what one line of output
> looks like?
>
> And while you're at it, can you show us the values
> of grepprg and grepformat, just to be sure?
>

Or you might try using :vimgrep (q.v.) instead of :grep, unless your
*.js files are too big for Vim's memory space.

Best regards,
Tony.
--
Some people live life in the fast lane. You're in oncoming traffic.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

puzzling mapping behavior

this mapping:

nmap <c-y> 0i``<CR><esc>:%s/\s\*\n\s\*\n\s\*\n/\r\r/g<CR>/^``<CR>

produces what seems to me an incorrect behavior. if the %s doesn't
find anything, the cursor ends up on the line after the "``" mark.
until recently it would land on the first "`" mark, i.e., where i want
it. adding 'k' to the mapping has no effect

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: grep and quickfix

* Mark Volkmann [2014.05.25 20:44]:
> When I run this:
> :grep some-word **/*.js
> it outputs lots of matches.
> Then I run this:
> :copen
> and there is nothing in the quickfix list.
> Isn't the grep command supposed to populate that?
> Any ideas what I might be doing wrong?
> I have not modified the grepprg or grepformat options.

The most likely error is that grepformat doesn't
match the output that you get. But you're not
giving us much to go on.

Can you perhaps show us what one line of output
looks like?

And while you're at it, can you show us the values
of grepprg and grepformat, just to be sure?

--
JR

--
--
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.
For more options, visit https://groups.google.com/d/optout.

grep and quickfix

When I run this:
:grep some-word **/*.js
it outputs lots of matches.
Then I run this:
:copen
and there is nothing in the quickfix list.
Isn't the grep command supposed to populate that?
Any ideas what I might be doing wrong?
I have not modified the grepprg or grepformat options.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Saturday, May 24, 2014

Re: Get expansion of digraph in VimL


On May 25, 2014 4:24 AM, "Tony Mechelynck" <antoine.mechelynck@gmail.com> wrote:
>
> On 23/05/14 13:19, John Little wrote:
>>
>> On Friday, May 23, 2014 10:36:56 AM UTC+12, Nate Soares wrote:
>>>
>>> Is there a way to get the expansion of a digraph (entered e.g. with ^K in insert mode) programatically?
>>
>>
>> There isn't a vim script way to do this directly.  I can think of two ways, one somewhat unclean, the other pedestrian.
>>
>> Firstly, this approach may have side effects, might spoil your screen layout, and harm innocent animals:
>>
>> function! ExpandDigraph(dig)
>>      if a:dig !~ '^..$'
>>          return ""
>>      endif
>>      new
>>      exe "norm! a\<c-k>" . a:dig . "\<esc>"
>>      let result = getline(".")
>>      close!
>>      return result
>> endfunc
>>
>> Secondly: capture the output of the command :digraph, (:help redir) and reformat it to one column (that's tricky because there's lots of funny characters), and write it to a file, say "digraphs.txt".  Then,
>>
>> function! ExpandDigraph(dig)
>>      if !exists("s:digs")
>>          let s:digs = {}
>>          for line in readfile("digraphs.txt")
>>              let s:digs[line[0:1]] = line[3:]
>>          endfor
>>      endif
>>      return has_key(s:digs, a:dig) ? s:digs[a:dig] : ""
>> endfunc
>>
>>> For example, I have vim set up to insert the ellipsis character '…' when I type "^K..". Is there a way, programatically, to write a function ExpandDigraph such that ExpandDigraph("..") yields "…"?
>>
>>
>> BTW, with my vim 7.4.274 on linux ".." is a digraph for "‥" U+2025 TWO DOT LEADER, not an ellipsis, "…" U+2026 HORIZONTAL ELLIPSIS. My vim only has digraphs for U+22EF MIDLINE HORIZONTAL ELLIPSIS and U+22EE VERTICAL ELLIPSIS.  If you've defined your own digraphs, and you use my second approach you'd have to add yours to the file.
>>
>> Regards, John Little
>>
>
> Note that nothing forbids having more than one digraph for the same character, and in fact by default some characters have both an RFC1345 digraph and a "legacy Vim" digraph (as the latter was used before Vim digraphs were standardized to RFC1345). Having more than one character for a single digraph, however, is of course not possible: trying to define a new equivalent for an existing digraph replaces it.
>
> The above function would always return the last character-pair in the list for any given character, for instance (with the default digraphs) n~ (the legacy digraph) and not n? (the RFC1345 digraph) for U+00F1 LATIN SMALL LETTER N WITH TILDE. (Any previous digraph for the same character would be replaced when creating the Dictionary.)

?! Quoted functions solve forward problem: given n? return U+00F1, not backward: given U+00F1 return n?.

>
>
> Best regards,
> Tony.
> --
> Execution
>
> If people were not afraid of death,
> Then what would be the use of an executioner?
> If people were only afraid of death,
> And you executed everyone who did not obey,
> No one would dare to disobey you.
> Then what would be the use of an executioner?
> People fear death because death is an instrument of fate.
> When people are killed by execution rather than by fate,
> This is like carving wood in the place of a carpenter.
> Those who carve wood in place of a carpenter
> Often injure their hands.
>                 -- Lao Tse, "Tao Te Ching"
>
>
> --
> --
> 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.
> 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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Speed of vim-fugitive in virtualized Windows

On Sat, May 24, 2014 at 4:50 PM, Eric Christopherson <echristopherson@gmail.com> wrote:
I haven't done any formal timing, but my initial impression was that Parallels slowed it down the least; however, today I'm finding that its behavior is also slow.

Correction FYI: VMware Fusion is the one that impacts least on speed of this particular operation.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Get expansion of digraph in VimL

On 23/05/14 13:19, John Little wrote:
> On Friday, May 23, 2014 10:36:56 AM UTC+12, Nate Soares wrote:
>> Is there a way to get the expansion of a digraph (entered e.g. with ^K in insert mode) programatically?
>
> There isn't a vim script way to do this directly. I can think of two ways, one somewhat unclean, the other pedestrian.
>
> Firstly, this approach may have side effects, might spoil your screen layout, and harm innocent animals:
>
> function! ExpandDigraph(dig)
> if a:dig !~ '^..$'
> return ""
> endif
> new
> exe "norm! a\<c-k>" . a:dig . "\<esc>"
> let result = getline(".")
> close!
> return result
> endfunc
>
> Secondly: capture the output of the command :digraph, (:help redir) and reformat it to one column (that's tricky because there's lots of funny characters), and write it to a file, say "digraphs.txt". Then,
>
> function! ExpandDigraph(dig)
> if !exists("s:digs")
> let s:digs = {}
> for line in readfile("digraphs.txt")
> let s:digs[line[0:1]] = line[3:]
> endfor
> endif
> return has_key(s:digs, a:dig) ? s:digs[a:dig] : ""
> endfunc
>
>> For example, I have vim set up to insert the ellipsis character '…' when I type "^K..". Is there a way, programatically, to write a function ExpandDigraph such that ExpandDigraph("..") yields "…"?
>
> BTW, with my vim 7.4.274 on linux ".." is a digraph for "‥" U+2025 TWO DOT LEADER, not an ellipsis, "…" U+2026 HORIZONTAL ELLIPSIS. My vim only has digraphs for U+22EF MIDLINE HORIZONTAL ELLIPSIS and U+22EE VERTICAL ELLIPSIS. If you've defined your own digraphs, and you use my second approach you'd have to add yours to the file.
>
> Regards, John Little
>

Note that nothing forbids having more than one digraph for the same
character, and in fact by default some characters have both an RFC1345
digraph and a "legacy Vim" digraph (as the latter was used before Vim
digraphs were standardized to RFC1345). Having more than one character
for a single digraph, however, is of course not possible: trying to
define a new equivalent for an existing digraph replaces it.

The above function would always return the last character-pair in the
list for any given character, for instance (with the default digraphs)
n~ (the legacy digraph) and not n? (the RFC1345 digraph) for U+00F1
LATIN SMALL LETTER N WITH TILDE. (Any previous digraph for the same
character would be replaced when creating the Dictionary.)


Best regards,
Tony.
--
Execution

If people were not afraid of death,
Then what would be the use of an executioner?
If people were only afraid of death,
And you executed everyone who did not obey,
No one would dare to disobey you.
Then what would be the use of an executioner?
People fear death because death is an instrument of fate.
When people are killed by execution rather than by fate,
This is like carving wood in the place of a carpenter.
Those who carve wood in place of a carpenter
Often injure their hands.
-- Lao Tse, "Tao Te Ching"

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Speed of vim-fugitive in virtualized Windows

I use Tim Pope's excellent vim-fugitive for working with Git in Vim. But I find that when I run it in a Windows 8.1 virtual machine, various operations are very slow, compared to running it in OS X, Linux, or even native Windows. I haven't used a lot of its functionality, but one thing I've noticed in particular that is very slow is :cnext and friends after loading the revisions to the repository into quickfix with :Glog --. I also haven't used a lot of Git functionality in Windows, so I don't know if it's slow in general; but the simple things I do like adding, committing, branching, getting logs, etc. seem snappy enough.

Does anyone else even experiences this in such environments? I've noticed slowness in VirtualBox, VMware Fusion, and Parallels (all running on OS X), but the degree of slowness varies a little between them and between occasions using the same repository. I haven't done any formal timing, but my initial impression was that Parallels slowed it down the least; however, today I'm finding that its behavior is also slow.

And does anyone know what causes this? I know I find that Windows performance is slower in general in VMs, so it might just be a little slowness in the MSYS versions of GNU libraries that Git uses, plus a little slowness in Git, plus a little slowness in Vim, plus a little slowness in the plugin (which is interpreted, after all); but I'd like to find out there's something simple that could be done to speed it up.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: NERDtree : open with external editor / program

On Monday, May 12, 2014 1:35:13 PM UTC+2, Der Seb wrote:
> On Wednesday, June 6, 2012 2:40:52 PM UTC+2, Clem wrote:
> > Hi,
> >
> >
> >
> > I could not find a way to open files with external programs / editors, with
> >
> > NERDtree, based on file extensions (for example, opening a .odt file
> >
> > launches libreoffice with filename as parameter). Is there a way to do so ?
> >
> > Thanks
> >
> >
> >
> > --
> >
> > View this message in context: http://vim.1045645.n5.nabble.com/NERDtree-open-with-external-editor-program-tp5708803.html
> >
> > Sent from the Vim - General mailing list archive at Nabble.com.
>
> Hi,
>
> I overworked this open plugin a little bit and apart it from the other plugins in a single github repro (https://github.com/aufgang001)/vim-nerdtree_plugin_open)

Sorry, for the typo in the link:
https://github.com/aufgang001/vim-nerdtree_plugin_open
(https://github.com/aufgang001)/vim-nerdtree_plugin_open)

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Friday, May 23, 2014

Re: Get expansion of digraph in VimL

On Sat, May 24, 2014 at 12:02 AM, Nikolay Pavlov <zyx.vim@gmail.com> wrote:
>
> On May 24, 2014 4:38 AM, "John Little" <John.B.Little@gmail.com> wrote:
>>
>> On Saturday, May 24, 2014 12:21:27 AM UTC+12, ZyX wrote:
>> > Digraphs work also in Ex mode. So I would rather use it, CTRL-\ e and
>> > getcmdline() are your friends here: this way there are no or almost no
>> > side-effects. At least I do not know any side-effects other then inevitable
>> > things like heating the processor a bit. Example I used to test CTRL-K . .
>> > expansion:
>> >
>> >
>> > execute 'normal!' ":\<C-k>..\<C-\>eextend(g:, {'digraph':
>> > getcmdline()}).digraph\n"
>> >
>> > This even did not alter cmd and expr history (it would if I typed
>> > :normal! argument myself).

Thank you Nikolay and John! This is extremely useful.

Justin M. Keyes

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Get expansion of digraph in VimL


On May 24, 2014 4:38 AM, "John Little" <John.B.Little@gmail.com> wrote:
>
> On Saturday, May 24, 2014 12:21:27 AM UTC+12, ZyX wrote:
> > Digraphs work also in Ex mode. So I would rather use it, CTRL-\ e and getcmdline() are your friends here: this way there are no or almost no side-effects. At least I do not know any side-effects other then inevitable things like heating the processor a bit. Example I used to test CTRL-K . . expansion:
> >
> >
> >     execute 'normal!' ":\<C-k>..\<C-\>eextend(g:, {'digraph': getcmdline()}).digraph\n"
> >
> > This even did not alter cmd and expr history (it would if I typed :normal! argument myself).
>
> Yes, using the command line instead of a scratch buffer is much nicer.  But saving the result by manipulating the dictionary that holds the global variables, then because the function that manipulates returns the dictionary, using the dict.key syntax to avoid an error, well, (referring to my earlier jocular phrase) this animal got a headache puzzling it out.  If I want an expression to have side effects, I think of a function:

g: dictionary is not the only dictionary out there. There is also l:, but I would suggest just creating a new one inside function.

>
> function! SaveCmd()
>     let g:EDcmd = getcmdline()
> endfunc
> function! ExpandDigraph(dig)
>     if a:dig !~ '^..$'
>         return ""
>     endif
>     exe "norm! :\<c-k>" . a:dig . "\<c-\>eSaveCmd()\n"
>     return g:EDcmd
> endfunc
>
> That relies on the fact that an incomplete "normal" command is abandoned; one could add \<c-c> to explicitly abandon it I suppose.
>
> Regards, John Little
>
> --
> --
> 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.
> 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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Get expansion of digraph in VimL

On Saturday, May 24, 2014 12:21:27 AM UTC+12, ZyX wrote:
> Digraphs work also in Ex mode. So I would rather use it, CTRL-\ e and getcmdline() are your friends here: this way there are no or almost no side-effects. At least I do not know any side-effects other then inevitable things like heating the processor a bit. Example I used to test CTRL-K . . expansion:
>
>
>     execute 'normal!' ":\<C-k>..\<C-\>eextend(g:, {'digraph': getcmdline()}).digraph\n"
>
> This even did not alter cmd and expr history (it would if I typed :normal! argument myself).

Yes, using the command line instead of a scratch buffer is much nicer. But saving the result by manipulating the dictionary that holds the global variables, then because the function that manipulates returns the dictionary, using the dict.key syntax to avoid an error, well, (referring to my earlier jocular phrase) this animal got a headache puzzling it out. If I want an expression to have side effects, I think of a function:

function! SaveCmd()
let g:EDcmd = getcmdline()
endfunc
function! ExpandDigraph(dig)
if a:dig !~ '^..$'
return ""
endif
exe "norm! :\<c-k>" . a:dig . "\<c-\>eSaveCmd()\n"
return g:EDcmd
endfunc

That relies on the fact that an incomplete "normal" command is abandoned; one could add \<c-c> to explicitly abandon it I suppose.

Regards, John Little

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: matching the last part of a url -> and in a syntax file

Tim Chase wrote on Fri-23-May 14 6:32PM
> \(http|\S*\/\)\@<=\w\+\/\=\S\@!

Thanks Tim, this works perfectly when tested with matchstr(),
however I need ti in a syntax file and there it appears to be a
noop. I tried;
syn match last_url '\(http\S*\/\)\@<=\w\+\/\=\S\@!'

Any ideas?

--
Eric Smith

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: matching the last part of a url

On 2014-05-23 16:10, Eric Smith wrote:
> http|www.foo.bar/baz/baz -> I want to match baz
> http|www.foo.bar/baz/baz/ -> I want to match baz/
> http|www.foo.bar/baz/baz/biz -> I want to match biz

Your "http|" is a little odd (I'd normally expect "https\=://", but if
that's actually what you have, you should be able to do something like

\(http|\S*\/\)\@<=\w\+\/\=\S\@!

It's a little sloppy, as it assumes that the results you want to find
match "\w\+" while other characters could legitimately be there.
But that should give you the foundation for improving it.

It roughly translates to

\(
http|\S*\/
\)\@>= assert that the stuff preceding this is contextually a URL
\w\+ the pattern we actually want
\/\= optionally a trailing slash
\S\@! assert that a non-whitespace doesn't follow the slash

-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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

matching the last part of a url

I am not managing to crack this for a syntax highlight rile.

http|www.foo.bar/baz/baz -> I want to match baz
http|www.foo.bar/baz/baz/ -> I want to match baz/
http|www.foo.bar/baz/baz/biz -> I want to match biz

Thanks for any solution.

Eric

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: How can I pass user input value to vimgrep?

Actually backward/forward-slash, space were needed and the script was not
working without them.
Finally I decided to put them in their own places. However I changed my
script a little and it is working as expected.
Here is it:

" Last Change: 2014-05-23 Friday: 12:03:38 PM
" -----------------------Implementation of a simple feature
" -----------------------"Find in Files and Directories"
" -----------------------like Notepad++ -----------------
" -----------------------Created & Edited by Pinaki Sekhar Gupta
<appugupta007@gmail.com>------------------------
" -----------------------Licence: No licence is better than
everything-------------------------------------------



:menu Edit.Find\ in\ Files :<Esc>:<Esc>:call Find_in_Files() <Cr>

function Find_in_Files()

" -----------------------raw method-----------------
" :vimgrep /GNU/ C:\CodeBlocks\TDM-GCC-64\include\*.txt
" :cw
" --------------------------------------------------

let what2find = inputdialog("search term", "", "cancel pressed")
let directory = browsedir("Browse the directory","")
let filetype = inputdialog("filetype", "", "cancel pressed")
let forwardslash = "/"
let space = " "

if has("win32") || has("win16") || has("win64")
" ========== MS Windows ===========
let wildcard = "\\*."
elseif has("macunix") || has("unix") || has("mac") || has("os2") ||
has("beos")
" ========== Linux/OS-X/Unix ===========
let wildcard = "\/*."
endif

if what2find != "" && what2find != "cancel pressed" && directory != ""
&& filetype != ""

" port to test whether the nested strings are
working or not
"
http://vim.1045645.n5.nabble.com/How-can-I-pass-user-input-value-to-vimgrep-td5721661.html
" :echom "Hello, " . "world"
" Hello, world "
http://learnvimscriptthehardway.stevelosh.com/chapters/26.html
" echo forwardslash . what2find . forwardslash . space .
directory . wildcard . filetype

:execute "vimgrep /" . what2find . forwardslash . space .
fnameescape(directory) . wildcard . filetype
:cw

else
" process if user press okay
if what2find != "cancel pressed" && directory != "cancel pressed"
&& filetype != "cancel pressed"

:execute "vimgrep /" . what2find . forwardslash . space .
fnameescape(directory) . wildcard . filetype
:cw

endif
endif
endfunction

I am still looking for an improvement suggestion so that it can search the
directory recursively, and more interestingly I want to look into the
extension-less files like C++'s 'iostream' etc, and Linux created text file
that does not have extension unless I give one.





--
View this message in context: http://vim.1045645.n5.nabble.com/How-can-I-pass-user-input-value-to-vimgrep-tp5721661p5721684.html
Sent from the Vim - General mailing list archive at Nabble.com.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Get expansion of digraph in VimL


On May 23, 2014 3:19 PM, "John Little" <John.B.Little@gmail.com> wrote:
>
> On Friday, May 23, 2014 10:36:56 AM UTC+12, Nate Soares wrote:
> > Is there a way to get the expansion of a digraph (entered e.g. with ^K in insert mode) programatically?
>
> There isn't a vim script way to do this directly.  I can think of two ways, one somewhat unclean, the other pedestrian.
>
> Firstly, this approach may have side effects, might spoil your screen layout, and harm innocent animals:
>
> function! ExpandDigraph(dig)
>     if a:dig !~ '^..$'
>         return ""
>     endif
>     new
>     exe "norm! a\<c-k>" . a:dig . "\<esc>"
>     let result = getline(".")
>     close!
>     return result
> endfunc

Digraphs work also in Ex mode. So I would rather use it, CTRL-\ e and getcmdline() are your friends here: this way there are no or almost no side-effects. At least I do not know any side-effects other then inevitable things like heating the processor a bit. Example I used to test CTRL-K . . expansion:

    execute 'normal!' ":\<C-k>..\<C-\>eextend(g:, {'digraph': getcmdline()}).digraph\n"

This even did not alter cmd and expr history (it would if I typed :normal! argument myself).

>
> Secondly: capture the output of the command :digraph, (:help redir) and reformat it to one column (that's tricky because there's lots of funny characters), and write it to a file, say "digraphs.txt".  Then,
>
> function! ExpandDigraph(dig)
>     if !exists("s:digs")
>         let s:digs = {}
>         for line in readfile("digraphs.txt")
>             let s:digs[line[0:1]] = line[3:]
>         endfor
>     endif
>     return has_key(s:digs, a:dig) ? s:digs[a:dig] : ""
> endfunc
>
> > For example, I have vim set up to insert the ellipsis character '…' when I type "^K..". Is there a way, programatically, to write a function ExpandDigraph such that ExpandDigraph("..") yields "…"?
>
> BTW, with my vim 7.4.274 on linux ".." is a digraph for "‥" U+2025 TWO DOT LEADER, not an ellipsis, "…" U+2026 HORIZONTAL ELLIPSIS. My vim only has digraphs for U+22EF MIDLINE HORIZONTAL ELLIPSIS and U+22EE VERTICAL ELLIPSIS.  If you've defined your own digraphs, and you use my second approach you'd have to add yours to the file.
>
> Regards, John Little
>
> --
> --
> 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.
> 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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Get expansion of digraph in VimL

On Friday, May 23, 2014 11:19:41 PM UTC+12, John Little wrote:

> close!

Woops, that should be

quit!

Just discovered a bunch of hidden windows...

Regards, John Little

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Get expansion of digraph in VimL

On Friday, May 23, 2014 10:36:56 AM UTC+12, Nate Soares wrote:
> Is there a way to get the expansion of a digraph (entered e.g. with ^K in insert mode) programatically?

There isn't a vim script way to do this directly. I can think of two ways, one somewhat unclean, the other pedestrian.

Firstly, this approach may have side effects, might spoil your screen layout, and harm innocent animals:

function! ExpandDigraph(dig)
if a:dig !~ '^..$'
return ""
endif
new
exe "norm! a\<c-k>" . a:dig . "\<esc>"
let result = getline(".")
close!
return result
endfunc

Secondly: capture the output of the command :digraph, (:help redir) and reformat it to one column (that's tricky because there's lots of funny characters), and write it to a file, say "digraphs.txt". Then,

function! ExpandDigraph(dig)
if !exists("s:digs")
let s:digs = {}
for line in readfile("digraphs.txt")
let s:digs[line[0:1]] = line[3:]
endfor
endif
return has_key(s:digs, a:dig) ? s:digs[a:dig] : ""
endfunc

> For example, I have vim set up to insert the ellipsis character '…' when I type "^K..". Is there a way, programatically, to write a function ExpandDigraph such that ExpandDigraph("..") yields "…"?

BTW, with my vim 7.4.274 on linux ".." is a digraph for "‥" U+2025 TWO DOT LEADER, not an ellipsis, "…" U+2026 HORIZONTAL ELLIPSIS. My vim only has digraphs for U+22EF MIDLINE HORIZONTAL ELLIPSIS and U+22EE VERTICAL ELLIPSIS. If you've defined your own digraphs, and you use my second approach you'd have to add yours to the file.

Regards, John Little

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Library/framework to manage uniformly *all* programming languages

2014-05-23 01:23, Miles Fidelman skrev:
> At least in my case, my response has nothing to do with yours

Mine neither -- I was commenting on the OP's remark, not yours,
wasn't I? Besides I agreed witth you if anything: the set of "all
programing languages" is too big and too varied to be handled
uniformly, and the set of "mainstream" languages is variable
across time and whom you ask. That said a bit more coordination
when it comes to binding assignment might not be a bad idea,
although it should not and cannot be enforced -- it can only be
achieved by plugin developers looking at what others have done,
or even better by making things user-customizable. Which
functionality you use often or seldom also varies by individual,
and in time for each individual, I daresay.

/bpj

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Library/framework to manage uniformly *all* programming languages

2014-05-22 17:30 GMT+02:00 xen <xen@dds.nl>:
Hi, thanks for your feedback on your own issue.


Correct, I'm lazy and I wanted to know if someone had this idea before me.

Laziness is not a good starting point for something like this you know, because it mostly means you're asking people to do things you could very well do yourself for yourself. There is a fine line between asking for help because it is the most effective way forward, and asking for help because you can't be bothered to help yourself....

:)

I'm basically insulting you and you're smiling in response? :P haha.


Yes, I thought to "mainstream" programming languages.

Right.


In fact I thought to code reduction.
For example, to highlight all the identifiers we have to handle the
identifiers. Refactorings like inlining or extracting require handling the
identifiers too, and so on.

Okay I don't know exactly what you mean, maybe something like what Facebook does to its Javascript code? They replace all occurrences of all identifiers with the smallest possible replacements that are possible as a matter of short strings being used. So if you examine their code, you will not find anything other than "a" or "vx" variables and function names. You can bet that's not how they wrote it, but they minimize the data transmission in terms of JS code and CSS descriptors, all the while using such elaborate automation schemes that the code that is left is still huge beyond comparison. So all of their visible code is generated and packed and extremely hard to debug by a user. You can't really see what it's doing so you either have to use some real good debugging tools, or just watch the network connections (GET queries) it tries to make as a result of that code execution, if you want to analyse the page.


To have one mapping, one definition of refactorings, etc.
For example, all the OOP refactorings work in OOP languages, why shall we
reimplement them in each PL?
My goal is to reduce the learning time, for example, if I learn a new OOP
PL, I don't want to learn new bindings, I just want to learn how to code
with it and I know that OOP Principles don't change.

You are talking about VIM bindings for the plugins you use, right? So this is only a personal goal right? So you are intending to spend an awful lot of time developing a framework for yourself so that you can save time on learning some new editor bindings every time you learn a new OOP language?.....

How often exactly do you intend to do that? I know I'm being inquisitive, but I just want to help you become clear on what it is you want to do, and not end up asking other people for help on something that would only be valuable to you if someone else took the pain of actually doing it for you..........

I mean it is perfectly fine to ask for help, but not on something that you just want to be done FOR you so you can be a lazy ass mofo ;-).

And I'm being this inquisitive because if someone else goes and helps you while not understanding what you exactly want to do, it will not end up helping you anyway.

So get a grip on yourself! People don't learn a new programming language every few weeks. /Not even you/ :D. The number of mainstream languages is extremely limited and the number of native OOP languages even more so. Like, there is OOP in PHP but it's not exactly the mother of OOP languages. What I've seen of Python thus far doesn't seem like hugely OOP either. Then there's Ruby, which is also an interpreted scripting language as far as I know. Then you have the nearly deceased Java and what is left is C++/C#/Objective C and all that stuff.

OOP in PHP is particularly strange. PHP has these weird concepts of error handling that I fail to grasp in their essence. I'm only familiar with Wordpress but it serves a case. Most if not the vast majority of exposed functions in Wordpress (all of it is exposed if it's not in an object) are just plain functions that are suitably named to avoid namespace collisions. All the error handling that exists seeems to be catered towards debugging your code instead of handling proper fail protection. Then they provide a OO layer if you want it, in case you want your code to be really user friendly and reusable. Part of that extention is the thing called "exceptions" which is neat and all but no native code uses it so you can only use it as a wrapper around the core functions or (likely) your own low level functions. So what it comes down to is that you end up manually checking NULL conditions all over the place, which is tiring, more so when a function can return both "NULL" and something else that evaluates to false. And you *can* provide a seemingly-neat OO wrapper that does graceful error handling (try, catch). But you will have to define every single Exception class that you need if you require any differentiation.

Then there is Python. Excellence par excellence in terms of graceful error handling. I've never used it, yet, but that code is NEAT. I guess it is very much OOP, don't know the scope of that yet. But very very different from something like Java or C#.

So all in all I really honestly believe that the goal of wanting to have one-size-fits-all refactoring application or whatever is just an idle fancy that you should let go off, and instead try to figure out what the real thing is you want to achieve, which will be much easier to accomplish, I am sure.

It is a common experience of many tech helpers that people come to them and ask about specific solutions that are vague and elaborate, when after a while it turns out that the problem giver has skipped a few steps and settled on a supposed "wanted" solution when it's not what he/she really wanted after all. Meaning, perhaps you are being too specific in what you want and you should backtrack and explain more of your feelings.

Anyway, good luck.


Xen.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

I just wanted to know if this kind of abstraction was already implemented, it seems that it's not the case, no problem.
I can try to do it, maybe fail, but the route one takes is more important than the destination.

Thanks.

--
--
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.
For more options, visit https://groups.google.com/d/optout.