Saturday, December 30, 2017

Re: Saving key mappings

Hi Guido,

Apologies if this is tagnential or not helpful, but some more details of the specific use-case could be helpful! Is it something that you may be able to do with a filetype plugin or similar? If not, is it possible that you could install a plugin which needs manually called to be activated? That way, you could do something similar to `gvim '+MyPluginFunction' to execute MyPluginFunction when it loads.

I think that there are a number of ways to do this, and it's hard to know what the right way is without more details. I get the sense that what you're doing may be accomplished with a tiletype plugin, though!

Hopefully this is helpful,
Bailey


 30. Dec 2017 06:59 by guido.milanese@gmail.com:

I know that macros and mappings are one of the most frequently discussed topics, so I do apologise if it is a question posed (n = n + 1) times.
I have written a program that, obviously among other tasks, calls (g)vim and opens a given file. I would like to instruct my program to call (g)vim with a given set of key mappings (the ones saved with 'q', as '@a', for example). Would this be possible?
Example: '@c' write '[', pasts the content of system clipboard using "*p and closes ']'.
I know that I can write all :map and :set settings using :mk. I see two options:
* if I cannot save key mappings, I could map the functions to a key, save them to a file: how can I read from this file?
* could marvim be a good solution? In order to publish my program, I would not like to use functions not provided by standard gvim.

The ideal would be something like:

gvim -u file-with-keypmapping textfile

but this would probably ignore the vimrc of the user!


Thank you!
guido, from Northern Italy

--
--
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.

Using `--noplugin` fails to suppress package under `~/.vim/pack/...`

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Nov 5 2017 23:25:13)
Included patches: 1-1272
Compiled by Arch Linux
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt +tcl/dyn
+balloon_eval +folding +mouse_xterm +termguicolors
+browse -footer +multi_byte +terminal
++builtin_terms +fork() +multi_lang +terminfo
+byte_offset +gettext -mzscheme +termresponse
+channel -hangul_input +netbeans_intg +textobjects
+cindent +iconv +num64 +timers
+clientserver +insert_expand +packages +title
+clipboard +job +path_extra +toolbar
+cmdline_compl +jumplist +perl/dyn +user_commands
+cmdline_hist +keymap +persistent_undo +vertsplit
+cmdline_info +lambda +postscript +virtualedit
+comments +langmap +printer +visual
+conceal +libcall +profile +visualextra
+cryptv +linebreak +python/dyn +viminfo
+cscope +lispindent +python3/dyn +vreplace
+cursorbind +listcmds +quickfix +wildignore
+cursorshape +localmap +reltime +wildmenu
+dialog_con_gui +lua/dyn +rightleft +windows
+diff +menu +ruby/dyn +writebackup
+digraphs +mksession +scrollbind +X11
+dnd +modify_fname +signs -xfontset
-ebcdic +mouse +smartindent +xim
+emacs_tags +mouseshape +startuptime -xpm
+eval +mouse_dec +statusline +xsmp_interact
+ex_extra +mouse_gpm -sun_workshop +xterm_clipboard
+extra_search -mouse_jsbterm +syntax -xterm_save
+farsi +mouse_netterm +tag_binary
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "/etc/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lnsl -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.26/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.26/core_perl/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lieee -lm
Hi there,

Sorry if this is a duplicate, I tried sending to `vim@vim.org` but I think
that address is incorrect?

Anyway, I have encountered some unexpected behaviour when using the
`--noplugin` option. Namely, it does not seem to suppress packages
installed under `~/.vim/pack/...`

I have attached my Vim version information. My Vim configuration is stored
at https://github.com/cryptarch/vimfiles.git

Specific steps to reproduce the behaviour I am seeing:

$ mkdir -pv ~/.vim/pack/git-plugins/start
$ cd ~/.vim/pack/git-plugins/start
$ git clone https://github.com/w0rp/ale.git # A linting plugin
$ cd /tmp
$ cat > ./main.c << EOF
int main(int* argc, char** argv) { /* Note error in first argument */
return 0;
}
EOF
$ vim --noplugin ./main.c # ALE still reports error on first line.

Is there something I might have misconfigured? Am I using the new plugin
system incorrectly?

Thanks for your time :)


~ 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: Saving key mappings

On Sat, Dec 30, 2017 at 3:59 PM, Guido Milanese
<guido.milanese@gmail.com> wrote:
> I know that macros and mappings are one of the most frequently discussed topics, so I do apologise if it is a question posed (n = n + 1) times.
> I have written a program that, obviously among other tasks, calls (g)vim and opens a given file. I would like to instruct my program to call (g)vim with a given set of key mappings (the ones saved with 'q', as '@a', for example). Would this be possible?
> Example: '@c' write '[', pasts the content of system clipboard using "*p and closes ']'.
> I know that I can write all :map and :set settings using :mk. I see two options:
> * if I cannot save key mappings, I could map the functions to a key, save them to a file: how can I read from this file?
> * could marvim be a good solution? In order to publish my program, I would not like to use functions not provided by standard gvim.
>
> The ideal would be something like:
>
> gvim -u file-with-keypmapping textfile
>
> but this would probably ignore the vimrc of the user!
>
>
> Thank you!
> guido, from Northern Italy

There are several possibilities, but first, how do I save macros
created by q + letter? Answer: They are in the register by that
letter. If your 'viminfo' setting is non-empty, these registers are
saved when Vim exits and restored at next startup. By default, up to
50 lines are saved for all registers, but you can increase or decrease
that number of lines to anything between zero and infinity.
see
:help viminfo-<
:help :registers

Mappings can be saved in a Vim script:
• Any mappings which you always want available should be defined in your vimrc.
see :help vimrc
• Mappings which you want defined only for files of a certain filetype
should be defined in a filetype-plugin for that filetype: for
instance, if you want certain mappings to be defined when you edit
html sources, you should define them with the <buffer> modifier in a
script named (on Windows) %HOME%\vimfiles\after\ftplugin\html.vim or
(on Unix-like systems, including Mac OS X IIUC)
~/.vim/after/ftplugin/html.vim — the "after" subdirectory serves to
define them "after" anything defined by the filetype-plugins
distributed with Vim, so the latter won't override your own mappings
see
:help :map-<buffer>
:help after-directory
:help ftplugin
• Mappings which you want defined only on demand can be defined in a
script placed anywhere Vim normally *won't* look for it. For instance
in .../macros/... instead of .../after/ftplugin/... Then you enable it
by reading that script with a :source statement. Use <buffer> or not
in the :map (or :map!, :imap, nnoremap, etc.) statement, depending on
whether you want these macros to be buffer-local or global.
see :help :source

Similarly, user-defined functions and commands can also be defined in
the same kinds of Vim scripts (including, for those you always want
available, in your vimrc)
see
:help :function
and in particular :help E124
:help :command
and in particular :help E174

To source a certain script at startup *in addition* to your vimrc, use
a -S {filename} argument on your Vim command-line. (If the script is
named Session.vim in the current directory, then its name can be
omitted provided that -S comes last on the command-line.)
see :help -S


Best regards,
Tony.

--
--
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.

Saving key mappings

I know that macros and mappings are one of the most frequently discussed topics, so I do apologise if it is a question posed (n = n + 1) times.
I have written a program that, obviously among other tasks, calls (g)vim and opens a given file. I would like to instruct my program to call (g)vim with a given set of key mappings (the ones saved with 'q', as '@a', for example). Would this be possible?
Example: '@c' write '[', pasts the content of system clipboard using "*p and closes ']'.
I know that I can write all :map and :set settings using :mk. I see two options:
* if I cannot save key mappings, I could map the functions to a key, save them to a file: how can I read from this file?
* could marvim be a good solution? In order to publish my program, I would not like to use functions not provided by standard gvim.

The ideal would be something like:

gvim -u file-with-keypmapping textfile

but this would probably ignore the vimrc of the user!


Thank you!
guido, from Northern Italy

--
--
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.

Savin macros for later use

I know that macros and mappings are one of the most frequently discussed topics, so I do apologise if it is a question posed (n = n + 1) times.
I have written a program that, obviously among other tasks, calls (g)vim and opens a given file. I would like to instruct my program to call (g)vim with a given set of key mappings (the ones saved with 'q', as '@a', for example). Would this be possible?
Example: '@c' write '[', pasts the content of system clipboard using "*p and closes ']'.
I know that I can write all :map and :set settings using :mk. I see two options:

* if I cannot save key mappings, I could map the functions to a key, save them to a file: how can I read from this file?
* could marvim be a good solution? In order to publish my program, I would not like to use functions not provided by standard gvim.

Thank you!
guido, from Northern Italy




--
--
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, December 29, 2017

Re: :terminal mode ques

2017-12-29 17:30 GMT+03:00 M Kelly <mckelly2833@gmail.com>:
>> > Off course you can. Type CTRL+\ CTRL+N and the terminal buffer will become a regular buffer without ending the job. Then you can yank, mark or do whatever you need.
>> >
>> >
>> > To go back to Terminal mode just type A.
>>
>> ok, yes, but this is more effort than before. In more detail, if I am in a non-vim shell I can type cd then click on a dir with the mouse and click again to paste and its there. In vim terminal mode I would like to do the same, if it is at all possible I am not sure. In a vim terminal I can type cd then c-\ c-n then hold the mouse and drag across the dir then type i/a then paste but it would be really awesome if I could use typical shell/term mouse events when in vim terminal mode.
>
> Maybe go into visual mode (ie c-\ c-n) with a mouse click and then go back to terminal mode with another click ??

<C-\><C-n> goes to normal mode, not visual. And you should be able to
use :tnoremap to remap mouse clicks as well, though I have not tested
that. There are some examples for other modes in `:h mouse-using`.

>
>
> --
> --
> 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: toggle cursor guide from via command line?

On Friday, December 29, 2017 at 1:16:09 PM UTC-5, Tony Mechelynck wrote:
> On Fri, Dec 29, 2017 at 6:23 PM, Richard Mitchell wrote:
> > Can the cursor guide be toggled via a script/command line?
> >
> > Normally I like the cursor guide on, but I'm writing some code that moves the cursor around the screen quit a bit and the cursor guide is distracting. I'd like the program to be able to disable it on start and then restore it at the end.
> >
> > Thanks!
>
> What exactly do you call the cursor guide?
>
> If you mean the horizontal and/or vertical highlight on the line
> and/or column containing the cursor, that's governed by an option:
> :help 'cursorcolumn'
> :help 'cursorline'
>
> If you want to freeze the viewport while your script makes changes
> above the first visible line or below the last one, I'm afraid you
> can't, but maybe there is some subtlety I missed.
>
> If you mean the variously shaped spot at the very character cell
> you're changing, then:
> - in a terminal in a non-Windows OS, it's under control of the
> terminal, the only way Vim can act on it is by means of the termcap
> codes t_SI, t_SR and t_EI (qq.v.)
> - in the Windows console and in gvim, it is under control of
> the 'guicursor' option (q.v.)
>
> If you mean the (left, right and/or bottom) scrollbars, then in gvim
> they are under control of the 'guioptions' option (q.v.). In a
> terminal they are under control of the terminal and I think Vim can't
> touch them.
>
> If you mean the numbers at lower right telling you (in numbers) the
> current line and column, that's under control of the 'ruler' and/or
> 'statusline' options (qq.v.).
>
> Oh, and before you ask, q.v. and qq.v. are common English
> abbreviations for the Latin prases "quem/quam/quod vide" ("look it
> up") and "quos/quas/quæ vide" ("look them up") respectively.
>
>
> Best regards,
> Tony.

I'm an idiot and posted to the wrong group, was meant for iterm2.

--
--
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: toggle cursor guide from via command line?

On Fri, Dec 29, 2017 at 6:23 PM, Richard Mitchell <rwmitchell@gmail.com> wrote:
> Can the cursor guide be toggled via a script/command line?
>
> Normally I like the cursor guide on, but I'm writing some code that moves the cursor around the screen quit a bit and the cursor guide is distracting. I'd like the program to be able to disable it on start and then restore it at the end.
>
> Thanks!

What exactly do you call the cursor guide?

If you mean the horizontal and/or vertical highlight on the line
and/or column containing the cursor, that's governed by an option:
:help 'cursorcolumn'
:help 'cursorline'

If you want to freeze the viewport while your script makes changes
above the first visible line or below the last one, I'm afraid you
can't, but maybe there is some subtlety I missed.

If you mean the variously shaped spot at the very character cell
you're changing, then:
- in a terminal in a non-Windows OS, it's under control of the
terminal, the only way Vim can act on it is by means of the termcap
codes t_SI, t_SR and t_EI (qq.v.)
- in the Windows console and in gvim, it is under control of
the 'guicursor' option (q.v.)

If you mean the (left, right and/or bottom) scrollbars, then in gvim
they are under control of the 'guioptions' option (q.v.). In a
terminal they are under control of the terminal and I think Vim can't
touch them.

If you mean the numbers at lower right telling you (in numbers) the
current line and column, that's under control of the 'ruler' and/or
'statusline' options (qq.v.).

Oh, and before you ask, q.v. and qq.v. are common English
abbreviations for the Latin prases "quem/quam/quod vide" ("look it
up") and "quos/quas/quæ vide" ("look them up") respectively.


Best regards,
Tony.

--
--
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.

toggle cursor guide from via command line?

Can the cursor guide be toggled via a script/command line?

Normally I like the cursor guide on, but I'm writing some code that moves the cursor around the screen quit a bit and the cursor guide is distracting. I'd like the program to be able to disable it on start and then restore it at the end.

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.

Re: :terminal mode ques

> > Off course you can. Type CTRL+\ CTRL+N and the terminal buffer will become a regular buffer without ending the job. Then you can yank, mark or do whatever you need.
> >
> >
> > To go back to Terminal mode just type A.
>
> ok, yes, but this is more effort than before. In more detail, if I am in a non-vim shell I can type cd then click on a dir with the mouse and click again to paste and its there. In vim terminal mode I would like to do the same, if it is at all possible I am not sure. In a vim terminal I can type cd then c-\ c-n then hold the mouse and drag across the dir then type i/a then paste but it would be really awesome if I could use typical shell/term mouse events when in vim terminal mode.

Maybe go into visual mode (ie c-\ c-n) with a mouse click and then go back to terminal mode with another click ??


--
--
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, December 28, 2017

Re: :terminal mode ques

> Off course you can. Type CTRL+\ CTRL+N and the terminal buffer will become a regular buffer without ending the job. Then you can yank, mark or do whatever you need.
>
>
> To go back to Terminal mode just type A.

ok, yes, but this is more effort than before. In more detail, if I am in a non-vim shell I can type cd then click on a dir with the mouse and click again to paste and its there. In vim terminal mode I would like to do the same, if it is at all possible I am not sure. In a vim terminal I can type cd then c-\ c-n then hold the mouse and drag across the dir then type i/a then paste but it would be really awesome if I could use typical shell/term mouse events when in vim terminal mode.

thx

--
--
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: :terminal mode ques

Off course you can. Type CTRL+\ CTRL+N and the terminal buffer will become a regular buffer without ending the job. Then you can yank, mark or do whatever you need.

To go back to Terminal mode just type A.

Em 28 de dez de 2017 14:54, "M Kelly" <mckelly2833@gmail.com> escreveu:
Hi again,

Also I cannot seem to select any text with the mouse in terminal mode.
I understand I cannot edit the terminal buffer but I do still want to cut/paste from the mouse to the command line from time to time.
Anyone know of a way to make this work ?

thanks again as always to everyone for their work and help,
-mark

--
--
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: :terminal mode ques

Hi again,

Also I cannot seem to select any text with the mouse in terminal mode.
I understand I cannot edit the terminal buffer but I do still want to cut/paste from the mouse to the command line from time to time.
Anyone know of a way to make this work ?

thanks again as always to everyone for their work and help,
-mark

--
--
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, December 27, 2017

Re: :terminal mode ques

> 1). is there a way to get vim to exit if the only buffer was a terminal in the current window and that job ends ?

Perhaps something related to autocmd BufLeave ... to close/end 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.

:terminal mode ques

Hi,

I am using :terminal and it is great!, thank you.
I have two questions if anyone can help -

1). is there a way to get vim to exit if the only buffer was a terminal in the current window and that job ends ?

2). is there a way to start several :terminal windows but have them hidden and then how would I switch from one to the other ? (ie I don't want tiled windows but just one and switch between them with a shortcut key)

thanks for any insight,
-mark

--
--
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, December 25, 2017

Re: macro to save messages to a local folder

* Pau (vim.unix@gmail.com) wrote:
> pressing "s"
> choosing mailbox
> (I choose afanyat_manolo)
> Confirm the question
> Append messages to /home/pau/correu/afanyat_manolo? ([yes]/no):
>
> Then mutt will ask me whether I want to purge the message when quitting.
>
> That's 5 steps.
Try pressing capitalized "C", double quotes excluded.
But this is vim channel, not mutt channel.

--
Gua Chung Lim

To live is to love.

--
--
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, December 23, 2017

Re: Help needed on terminal mappings

On 09/11/2017 12:36, Lifepillar wrote:
> On 08/11/2017 22:15, Bram Moolenaar wrote:

>> Hmm, perhaps you could try something like this:
>>
>>     :tmap <expr> <Esc>b SendToTerm("\<Esc>b")
>>     func SendToTerm(what)
>>       call term_sendkeys('', a:what)
>>       return ''
>>     endfunc
>>
>> No idea if this works, haven't tried it.
>
> That appears to work fine!

A follow-up on this: I have found that a drawback of your solution is
that, in an instance of Vim run inside a Vim terminal window, I need to
type Esc twice to return to Normal mode (I often happen to run Vim
inside Vim e.g., when I `git commit`).

What I am using now instead is this:

tnoremap <s-left> <esc>b
tnoremap <s-right> <esc>f

The first time I tried, I used ^[b and ^[f (with literal Esc), but that
did not work (^[b and ^[f on the rhs were translated into <s-left> and
<s-right> because of my settings). With <esc>, though, it works as
expected.

To recap, my configuration is as follows:

1. My terminal sends ^[b and ^[f when I type alt-left/right arrows.

2. In my vimrc, terminal keycodes ^[b and ^[f are tied to Vim
keycodes <s-left>/<s-right> using:

set <s-left>=^[b
set <s-right>=^[f

This makes alt-arrows work as shift-arrows in Insert and Command
mode, which means that I can jump between words with those key
combinations. A Vim terminal window, though, now sees \033[1;2D
and \033[1;2D when I type alt-arrows (because Shift-arrows are
mapped to those sequences by my terminal).

3. To fix that, I remap <s-left> and <s-right> in Terminal mode to send
the original sequence:

tnoremap <s-left> <esc>b
tnoremap <s-right> <esc>f

So, now I have alt-arrows work consistently in all modes, even in Vim
instances run inside a terminal window run inside a Vim instance run
inside etc... and Esc returns to Normal mode immediately under all
circumstances.

I don't know whether this strategy has any drawback (it seems fine so
far for me), and I may be missing something.

But if it is useful, you might want to update the terminal-special-key
section in the manual.

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

Thursday, December 21, 2017

macro to save messages to a local folder

Dear all,

I'm trying to find out how to save files from an IMAP mail inbox to a
local inbox folder by pressing a combination of keys.

I know that mutt can do this by

pressing "s"
choosing mailbox
(I choose afanyat_manolo)
Confirm the question
Append messages to /home/pau/correu/afanyat_manolo? ([yes]/no):

Then mutt will ask me whether I want to purge the message when quitting.

That's 5 steps.

I am trying out how to do this in one step (choose mailbox, do not
ask for confirmation, do not delete from the current folder, etc).

But I cannot figure out how to do this with a macro.

Any help will be appreciated.

thanks,

Pau

--
--
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.

syntime report slow/lags

Hi,

Here is a syntime report that show slow regexp

TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN
0.703272 897 78 0.007309 0.000784 cCustomAngleBrackets \v%(<operator\_s*)@<!%(%(\_i|template\_s*)@<=\<[<=]@!|\<@<!\<[[:space:]<=]@!)
0.089086 827 0 0.049759 0.000108 cppRawString \%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(
0.053747 898 71 0.000639 0.000060 cCustomFunc \w\+\s*(\@=



How can I fix the first and second one ?
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: directx config lag on virtual machine

Le mardi 19 décembre 2017 10:43:18 UTC+1, Ni Va a écrit :
> Hi,
>
> Despite of it works fine on physical machine Windows 10, gvim 8.0.1406 lags on virtual machine AMD 64 Seven.
>
> set guifont=Noto_Mono_for_Powerline:h9:w5:cANSI:qDRAFT
> set rop=type:directx,gamma:0.1,contrast:0.1,level:0.2,geom:2,renmode:6,taamode:2
>
>
>
> Just forward/backward page command lags.
>
> Is there a way to set diagnostic ?
> Thank you

Considering this topic I join the synctime report.

http://eduncan911.com/software/fix-slow-scrolling-in-vim-and-neovim.html

--
--
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, December 19, 2017

directx config lag on virtual machine

Hi,

Despite of it works fine on physical machine Windows 10, gvim 8.0.1406 lags on virtual machine AMD 64 Seven.

set guifont=Noto_Mono_for_Powerline:h9:w5:cANSI:qDRAFT
set rop=type:directx,gamma:0.1,contrast:0.1,level:0.2,geom:2,renmode:6,taamode:2



Just forward/backward page command lags.

Is there a way to set diagnostic ?
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.

Sunday, December 17, 2017

Re: highlighting prefixed keywords

On Sun, Dec 17, 2017 at 9:14 PM, Tim Chase <vim@tim.thechases.com> wrote:
> On 2017-12-17 19:16, Jorge Almeida wrote:
>> Just a detail: is it possible to enumerate the keywords in a
>> separate declaration, to improve maintainability? (The actual list
>> is more extense). I'm thinking of something similar to:
>>
>> syntax keyword Foo open close mount umount
>>

> syn match jaKeyword /\<c\%(umount\|mount\|open\|close\)/hs=s+1
> hi def link jaKeyword Identifier
>
> which simplifies the syntax a bit.
>
OK, thanks. As it stands now it does the job.

Syntax highlighting is a great feature. Pity that it's so difficult to learn.

Cheers

Jorge

--
--
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: highlighting prefixed keywords

On 2017-12-17 19:16, Jorge Almeida wrote:
> Just a detail: is it possible to enumerate the keywords in a
> separate declaration, to improve maintainability? (The actual list
> is more extense). I'm thinking of something similar to:
>
> syntax keyword Foo open close mount umount
>
> Even if it's not possible, this is good enough.

Also, one might use

syn match jaKeyword /\<c\%(umount\|mount\|open\|close\)/hs=s+1
hi def link jaKeyword Identifier

which simplifies the syntax a bit.

Despite multiple attempts, I was unable to get it to work with
syn-keyword as it seems to want a Word boundary between the /\<c/ and
the keyword. I tried

syn region jaKeywordRegion start='\<c'rs=s+1 end='\>' contains=jaKeyword transparent
"syn keyword jaKeyword contained umount mount open close
syn match jaKeyword contained /umount\|mount\|open\|close/
hi def link jaKeyword Identifier

and it worked fine with the "match" version but failed with the
"keyword" version. I also tried various configurations of ms= and
rs= offsets to no avail.

-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: highlighting prefixed keywords

On Sun, Dec 17, 2017 at 7:02 PM, Tim Chase <vim@tim.thechases.com> wrote:
> On 2017-12-17 18:49, Jorge Almeida wrote:
>> I need to apply custom highligthing in a setup that should be simple
>> for people who understand highligthing:
>>
>> I have a bunch of keywords with a common prefix, the single
>> character 'c'. The keywords are to be listed one by one, not
>> obtained via some algorithm. Example:
>>
>> cmount
>> cumount
>> copen
>> cclose
>> (etc)
>>
>> So, I want to highlight these keywords, *minus the prefix*, with
>> some colour (say, the same colour for all keywords). That is, in
>> "cmount", only "mount" should be coloured, not the leading 'c'.
>
> Does
>
> :match Error /\%(\<c\)\@<=\w\+/
>
> give you what you're looking for? Alternatively, if they're a fixed
> list of keywords, you can join them together something like
>
> :match Error /\%(\<c\)\@<=\(mount\|umount\|open\|close\)/
>
Indeed it does! (Well, the latter suggestion does.)

I did this:

highlight macro_skin guibg=bg guifg=DarkGreen gui=bold ctermfg=022 cterm=bold
match macro_skin /\%(\<c\)\@<=\(mount\|umount\|open\|close\)/

And that's it. (And just a few minutes after posting, to boot!)

Just a detail: is it possible to enumerate the keywords in a separate
declaration, to improve maintainability? (The actual list is more
extense). I'm thinking of something similar to:

syntax keyword Foo open close mount umount

Even if it's not possible, this is good enough.

Thanks

Jorge

--
--
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: highlighting prefixed keywords

On 2017-12-17 18:49, Jorge Almeida wrote:
> I need to apply custom highligthing in a setup that should be simple
> for people who understand highligthing:
>
> I have a bunch of keywords with a common prefix, the single
> character 'c'. The keywords are to be listed one by one, not
> obtained via some algorithm. Example:
>
> cmount
> cumount
> copen
> cclose
> (etc)
>
> So, I want to highlight these keywords, *minus the prefix*, with
> some colour (say, the same colour for all keywords). That is, in
> "cmount", only "mount" should be coloured, not the leading 'c'.

Does

:match Error /\%(\<c\)\@<=\w\+/

give you what you're looking for? Alternatively, if they're a fixed
list of keywords, you can join them together something like

:match Error /\%(\<c\)\@<=\(mount\|umount\|open\|close\)/

You can adjust the color group to something other than Error, as
that's just what I chose by default.

-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.

highlighting prefixed keywords

I need to apply custom highligthing in a setup that should be simple
for people who understand highligthing:

I have a bunch of keywords with a common prefix, the single character
'c'. The keywords are to be listed one by one, not obtained via some
algorithm. Example:

cmount
cumount
copen
cclose
(etc)

So, I want to highlight these keywords, *minus the prefix*, with some
colour (say, the same colour for all keywords). That is, in "cmount",
only "mount" should be coloured, not the leading 'c'.

TIA

Jorge Almeida

--
--
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: Any way to make packadd load plugins in start when -u NONE or --noplugins are passed

>
> That is a reasonable request. If the "start" packages were not loaded
> then :packadd can also look there.
>


When I saw these replies I thought, "well now I have some vacation days, this is a good time to try to go and implement this".

But I see Bram already added it himself, so 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: Any way to make packadd load plugins in start when -u NONE or --noplugins are passed

Alejandro Hernandez wrote:

> Testing plugins in isolation is frequently done. Under the current
> system, all
> plugins one wants to test have to be moved under `opt` to be able to
> use `:packadd`. Relying on `:runtime` is both error-prone and
> cumbersome. There's no need for the user to replicate `:packadd`
> functionality using `:runtime`, because there are things one needs to
> take into account (sourcing all plugin files, adding to runtimepath),
> which would be better done by `:packadd`.
>
> I propose changing `:packadd` behavior to load ANY plugin, whether
> it's in `opt` or `start`, defaulting to doing nothing if it was added
> already. This idempotent and least-surprise behavior is what I
> expected from `:packadd` before I read the documentation.
>
> Adding an argument to `:packadd` is also fine, although a bit more
> "surpriseful".

That is a reasonable request. If the "start" packages were not loaded
then :packadd can also look there.

--
hundred-and-one symptoms of being an internet addict:
114. You are counting items, you go "0,1,2,3,4,5,6,7,8,9,A,B,C,D...".

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

Re: Ring bell when search wraps? (i.e. on "search hit BOTTOM, continuing at TOP")

On Saturday, December 16, 2017 at 4:16:54 PM UTC+11, Asheq Imran wrote:
> I miss the message that says
> "search hit BOTTOM, continuing at TOP"

The solution is to adjust the highlight that applies to that message. That depends on what colorscheme you use, but if using a dark background, something like the following works.

:hi WarningMsg ctermfg=15 ctermbg=12 guifg=White guibg=Red gui=NONE

John

--
--
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, December 16, 2017

Re: Any way to make packadd load plugins in start when -u NONE or --noplugins are passed

Testing plugins in isolation is frequently done. Under the current system, all
plugins one wants to test have to be moved under `opt` to be able to use
`:packadd`. Relying on `:runtime` is both error-prone and cumbersome. There's no
need for the user to replicate `:packadd` functionality using `:runtime`,
because there are things one needs to take into account (sourcing all plugin
files, adding to runtimepath), which would be better done by `:packadd`.

I propose changing `:packadd` behavior to load ANY plugin, whether it's in `opt`
or `start`, defaulting to doing nothing if it was added already. This idempotent
and least-surprise behavior is what I expected from `:packadd` before I read the
documentation.

Adding an argument to `:packadd` is also fine, although a bit more "surpriseful".

--
--
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.

Corrupt display when editing remotely via ssh

Hi,

I'm having problems with garbling of the displayed text when ssh'ing
into
a remote machine to edit a file. Here's a 'MWE' of the steps that
produce
the problem.

1. Open xterm on local_machine (Slackware 14.1), check environment:
TERM is 'xterm'
XTERM_VERSION is 'X.Org 7.6.0(297)

2. Ssh to remote_machine (CentOS 6.9), and I'm in a pseudo terminal:
$ ps -o 'cmd=' -pp $(ps -o 'ppid=' -p $$)
returns (for example):
sshd: me@pts/14

3. Check the environment on remote_machine:
TERM is 'xterm'

4. Open a text file for editing:
$ vim -N -u NONE myfile.txt

The vim version on remote_machine is 7.4.629, and is compiled with
+terminfo and ++builtin_terms.

5. Check value of 'term in Vim:
:set term
and it shows 'term=xterm'

6. Move around using e.g. Ctrl-f, Ctrl-b, do some deletions and
insertions, and text gets garbled (details below).

Interestingly, if I then explicitly set the terminal in Vim:
:set term=xterm
the garbling goes away...


The "garbling" duplicates that reported by Lowell Specht in this thread:

https://groups.google.com/forum/#!searchin/vim_use/ssh$20redraw|sort:relevance/vim_use/vJZJMe4fFgE/brm6sh1aBgAJ
or
https://tinyurl.com/k9t7a4g

For example, moving around with Ctrl-f and Ctrl-b causes many lines to
be duplicated and not wrap correctly. Resizing the window does the same
thing. Eventually, any displayed line is a jumble of blocks of text
from other
lines.

When deleting characters from a line, trailing characters are left in
their
original positions. For example, applying '4x' to 'rain' in 'The rain
in Spain stays
mainly in the plain.' leaves 'The in Spain stays mainly in the
plain.ain.'. Executing
':redraw' or ':redraw!' has no effect. If I save the garbled file and
reopen it, I get a
proper-looking file.

Obviously, I have a fairly simple work-around (set the terminal
explicitly each
time I start Vim), but if anyone can suggest the cause and a solution, I
would
appreciate it.

Regards,
Norm

--
--
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, December 15, 2017

Ring bell when search wraps? (i.e. on "search hit BOTTOM, continuing at TOP")

When I search for something and it it wraps to the other end of the buffer, I sometimes feel disoriented about where I am in the buffer because I miss the message that says "search hit BOTTOM, continuing at TOP".

I would like for the bell to ring so the wrap is more obvious.

Can I do it, or should I open an issue on Github? I imagine this helping a lot of people.

--
--
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: multi-line searches doesn't mark the found items on the whole

On Monday, December 11, 2017 at 3:53:56 PM UTC-6, Erhy wrote:
> Hello!
> Have a rare csv, in which some items have more then one line.
>
> My search pattern is
>
> /\;"\%([ A-Za-z0-9\n\/\.\,\:äöüÄÖÜ\-]\+\)"\;
>
> But if the found item is very big, not all of them is marked as found.
>
> Are there special settings?
>
> Thank you
> Erhy

I think you're saying sometimes the match is not highlighted according to the 'hlsearch' option. From the help for that option:

When the search pattern can match an end-of-line, Vim will try to
highlight all of the matched text. However, this depends on where the
search starts. This will be the first line in the window or the first
line below a closed fold. A match in a previous line which is not
drawn may not continue in a newly drawn line.

In other words, you probably are not seeing a match that starts before the lines which are currently displayed on-screen. Does that match what you're seeing?

--
--
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: Strange behavior of vimdiff in vim v8.0.1390 on Windows

On Fr, 15 Dez 2017, Igor Forca wrote:

> Hi,
> this is mystery to me. I have restarted Windows and retested and now diff in vim works without a problem.
>
> I don't understand what was wrong before. But I both files were marked as completely different - both windows in red background.
>
> In my humble opinion there must be some strange bug or something that I can't reproduce anymore.

Perhaps a third (invisible) buffer in diff mode?


Christian
--
Programmierweisheit:
Unsere Fehler von heute sichern uns unser Brot von morgen.

--
--
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: Strange behavior of vimdiff in vim v8.0.1390 on Windows

Hi,
this is mystery to me. I have restarted Windows and retested and now diff in vim works without a problem.

I don't understand what was wrong before. But I both files were marked as completely different - both windows in red background.

In my humble opinion there must be some strange bug or something that I can't reproduce anymore.
Regards

--
--
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.

Strange behavior of vimdiff in vim v8.0.1390 on Windows

1;;"1612";"SI";"01 ";"EUR";"101100112 ";;;;;;"0 ";;"EUR";;+0000000000000000245667.340000;+0000000000000000245667.340000;;;;;
1;;"1612";"SI";"01 ";"EUR";"101100139 ";;;;;;"0 ";;"EUR";;+0000000000000000099299.650000;+0000000000000000099299.650000;;;;;
1;;"1612";"SI";"01 ";"EUR";"101100112 ";;;;;;"0 ";;"EUR";;+0000000000000000245667.340000;+0000000000000000245667.340000;;;;;
1;;"1612";"SI";"01 ";"EUR";"101100139 ";;;;;;"0 ";;"EUR";;+0000000000000000099299.650000;+0000000000000000099299.650000;;;;;
Hi,
I am using latest development version v8.0.1390 of gVim from https://github.com/vim/vim-win32-installer/releases/

I see strange behavior of vim diff.
I did:
:e a.txt
:vert diffsp b.txt

To do the diff, but to my surprise everything is marked with red color. I have stripped down file to only two lines in each of file (a.txt and b.txt) and repeted the steps above. The same problem.

Then I did checksum:
C:\>sha1sum a.txt
a4b6ed7fd2085472061ecc981d48c48fecc94251 *a.txt

C:\>sha1sum b.txt
a4b6ed7fd2085472061ecc981d48c48fecc94251 *b.txt

and getting the same checksum. Looks like files are identical, but vim diff displays them like they would be completely different.

I have never experience something like this before. Maybe development version problem or something else?

Can someone please confirm the problem or hint to me what may be wrong in my case.

Regards

--
--
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, December 14, 2017

Re: Built VIM from source. Shortly after received update notification through apt which overrode my custom VIM.

If you installed the package after you created it with checkinstall, it is now a package like any other, and will be upgraded etc. along with other packages when you do apt-get management. You can tell apt-get to ignore the package during upgrade with "echo 'vim hold' | dpkg --set-selections".

--
--
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, December 13, 2017

Re: Vim calendar for 2018

Hello Vim users!

> I have updated the handy desktop calendar for 2018. It prints on one
> sheet of paper and, after folding and applying a bit of glue, stands on
> your desk.
>
> It is available in English and Dutch. You can find the PDF files on my
> website: http://moolenaar.net/#Calendar

Turns out "ncal -w 2018" shows the wrong week numbers! I have corrected
that now.

Happy Vimming!

PS. Still shopping for presents? Please use the links on this page, a
percentage goes to the children in Uganda:
http://iccf-holland.org/click1.html
It doesn't cost you anything!

--
From "know your smileys":
:^[/ mean-smiley-with-cigarette

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

Can vim complete file names without expanding env vars?

Hi,

I am wondering if it is possible to expand file names without
modifying any environment variables in the path?

For example, if I want to expand the following via <CTRL-X><CTRL-F>:

$HOME/file

I'd like for vim to expand "file" but leave $HOME as is.

Thanks,

--
Mun

--
--
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: pattern for substitution including linefeed and carriage return

Thank you Stucky,
but I have no Linux.

With my old MS Word 2003 I was able to delete the items with linefeeds

Erhy


Am Mittwoch, 13. Dezember 2017 15:04:09 UTC+1 schrieb C.v.St.:
>
> See more at https://tools.ietf.org/html/rfc4180
>
> BUT parsing such input by vim (i.e. 'regexp') seems to me to be
> overly complex (or even unworkable?). Number or fields and newlines
> are unlimited. So the structure is a lot easier to work with by
> 'real' CSV Libraries (e.g. in Perl or Python) or spreadsheet programs.
> (Or even the simple 'csvtool' on command line in Linux)
>
> Stucki

--
--
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: pattern for substitution including linefeed and carriage return

Am 12/11/2017 um 11:06 PM schrieb Erhy:
...
>> valid in CSV if enquoted?
>
> It's also odd for me. But the file comes from a banking institution.

Well, then it's not 'odd' but typical. You get something like:
-------------------------------- kind of symbolically:
first some text like title or explanations, then column/field) names
field;names;separated;by semicolon;and;explaining the following lines
data1;data2;data3;data4 blanks OK;OK! OK;more data up to EOL
DATA1;DATA2;;;;" and like an address with quoted multiple lines
Who
Where
City
etc.etc.etc."
or;even;"a first field
with newline";"a
second
field
with
newlines";still in line 3 of data;end of field 6 of logical line 3
---------------------------------------------------------------------
as long as you have e.g. 5 separators (here ';' so 6 fields of data)
and all cases of 'newline in a field' are quoted in double quotes,
this is correct for the so called 'Comma Separated Values'.
(Where 'banking', mostly uses semicolon for the delimiter,
because '.' is often used in fields.

See more at https://tools.ietf.org/html/rfc4180

BUT parsing such input by vim (i.e. 'regexp') seems to me to be
overly complex (or even unworkable?). Number or fields and newlines
are unlimited. So the structure is a lot easier to work with by
'real' CSV Libraries (e.g. in Perl or Python) or spreadsheet programs.
(Or even the simple 'csvtool' on command line in Linux)

Stucki

--
--
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, December 12, 2017

Re: Built VIM from source. Shortly after received update notification through apt which overrode my custom VIM.

On 2017-12-12, Phil Fernandez wrote:
> I downloaded the source code for the latest VIM from github and
> followed the directions for building it from source. I am on
> Ubuntu Budgie 17.10. I compiled VIM with several features that
> I wanted, such as both Python and Python3, as well as Perl and
> several other interpreters. After finishing with setting up my
> vimrc, plugins and all that good stuff, I ran apt update &&
> dist-upgrade on the terminal, and apt downloaded and installed
> a different version of VIM on my system. When I built vim I used
> the checkinstall method which allowed for easy removal later down
> the road if need be. Maybe this has something to do with it? My
> support for most of the interpreters that I built for is gone now.
> Why did apt take it upon itself to update VIM and override my
> custom built version?

The Vim that your distribution provides is generally installed in
/usr/bin and the runtime files are installed in /usr/share/vim. The
distribution "owns" those files and is free to update them as it
chooses when you update the distribution's packages.

A Vim that you build yourself should be installed in /usr/local/bin
and the runtime files in /usr/local/share/vim. That's where the Vim
configure and make system installs it by default. That convention
prevents you from overwriting the distribution's files and vice
versa.

I'm not familiar with the checkinstall method. Perhaps it puts
files under /usr instead of /usr/local by default. If so, you
should change that.

Regards,
Gary

--
--
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.

Built VIM from source. Shortly after received update notification through apt which overrode my custom VIM.

I downloaded the source code for the latest VIM from github and followed the directions for building it from source. I am on Ubuntu Budgie 17.10. I compiled VIM with several features that I wanted, such as both Python and Python3, as well as Perl and several other interpreters. After finishing with setting up my vimrc, plugins and all that good stuff, I ran apt update && dist-upgrade on the terminal, and apt downloaded and installed a different version of VIM on my system. When I built vim I used the checkinstall method which allowed for easy removal later down the road if need be. Maybe this has something to do with it? My support for most of the interpreters that I built for is gone now. Why did apt take it upon itself to update VIM and override my custom built version?

--
--
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, December 11, 2017

Re: pattern for substitution including linefeed and carriage return

Am Montag, 11. Dezember 2017 17:38:43 UTC+1 schrieb Eike Rathke:
> Hi Erhy,
>
> As a side note, you are aware that such multi-line field content is
> valid in CSV if enquoted?

It's also odd for me. But the file comes from a banking institution.
There are only linefeeds in the file and it is art to find the next logical line.
The items which span more line have
"
to mark them as text item

Erhy

--
--
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.

multi-line searches doesn't mark the found items on the whole

Hello!
Have a rare csv, in which some items have more then one line.

My search pattern is

/\;"\%([ A-Za-z0-9\n\/\.\,\:äöüÄÖÜ\-]\+\)"\;

But if the found item is very big, not all of them is marked as found.

Are there special settings?

Thank you
Erhy

--
--
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: pattern for substitution including linefeed and carriage return

Hi Erhy,

On Sunday, 2017-12-10 08:08:36 -0800, Erhy wrote:

> I got an CSV file in which some items have more lines
> and I want to delete them. This items have also textmarkers "
> e.g.
> 30.11.2017;"Name";"Legend
> for name
> is not found";"New York";

As a side note, you are aware that such multi-line field content is
valid in CSV if enquoted? If for some reason the processing software
isn't capable to cope with multi-line content I'd rather suggest to only
replace the embedded newlines with spaces, so the actual field content
is preserved instead of stripped.

Eike

--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
Use LibreOffice! https://www.libreoffice.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.
For more options, visit https://groups.google.com/d/optout.

Sunday, December 10, 2017

[netrw] How to use netrw#Call() to create custom mappings

Hello.
I want to customize some of the shortcuts in Netrw.
I have seen it provides a global variable which is a dictionary of key mappings and function calls.
I paste here  a snippet from the help:
Example: Clear netrw's marked file list via a mapping on gu >
    " ExampleUserMap: {{{2
    fun! ExampleUserMap(islocal)
      call netrw#Modify("netrwmarkfilelist",[])
      call netrw#Modify('netrwmarkfilemtch_{bufnr("%")}',"")
      let retval= ["refresh"]
      return retval
    endfun

    let g:Netrw_UserMaps= [["gu","ExampleUserMap"]]

What I am trying to do is to use this mechanism to map u to browse up dir rather than -, so I did the next:
function! utils#UserNetrwBrowseUpDir( islocal )
    call netrw#Call("NetrwBrowseUpDir", 1)
endfunction

let g:Netrw_UserMaps= [["u","utils#UserNetrwBrowseUpDir"]]

Well the mapping is working, using netrw#Call() I can call internal functions in netrw.vim,
but I got an error in NetrwBrowseUpDir( islocal ), basically the argument is passed as a list whereas it should be a number.
This is netrw#Call() 
fun! netrw#Call(funcname,...)
  if a:0 > 0
   exe "call s:".a:funcname."(".string(a:000).")"
  else
   exe "call s:".a:funcname."()"
  endif
endfun

I don't know how I have to pass my argument to netrw#Call()  in order to be passed as a single integer to  NetrwBrowseUpDir() .

Thanks and sorry for the long email.

P
--
Un saludo
Best Regards
Pablo Giménez

--
--
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: pattern for substitution including linefeed and carriage return

Am 12/10/2017 um 10:50 PM schrieb Erhy:

> In my CSV file this multiline fields have
> different number of lines, least two
> and contain various text.
>
> Is it also possible to delete such items at once?

>> :s/;"[^"]*\n\([^"]*\n\)[^"]*";/;"";/

As usual :%s..... applies the substitution
to all lines of a file (the complete syntax
of ranges is seen in ":help cmdline-ranges")

Stucki

--
--
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: pattern for substitution including linefeed and carriage return

Stucki, thanks for your answer!

In my CSV file this multiline fields have
different number of lines, least two
and contain various text.

Is it also possible to delete such items at once?

Thank you all

Erhy



Am Sonntag, 10. Dezember 2017 20:01:55 UTC+1 schrieb C.v.St.:
> Am 12/10/2017 um 05:08 PM schrieb Erhy:
> > ... This items have also textmarkers " e.g.
> > 30.11.2017;"Name";"Legend
> > for name
> > is not found";"New York";
> So You want to delete the contents of cases, where
> the Last thing of the line is not the ", followed
> by line(s) with no " at all, up to the line, which
> contains, but does not begin with "?
> (Which misses some cases, and will work only mostly,
> as it depends on having the single ;" in the first
> and the single "; on the last line of change.
> So Lines with broken pairs of ", or with extra newline
> without ", or lines with newline in the first or the
> last field, would break or be ignored.)
>
> The simple case might be done with:
>
> :s/;"[^"]*\n\([^"]*\n\)[^"]*";/;"";/
>
> OR do you want to remove the newlines only and keep
> the text? Which I believe would be more complicated,
> because of the newlines inside of the \(...\) pair.
>
> Stucki

--
--
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: pattern for substitution including linefeed and carriage return

On 2017-12-10 09:52, Gary Johnson wrote:
> A pattern that will match that string is
>
> "Legend\nfor name\nis not found"
>
> :help /\_.

The "\_" convention holds for things other than "." to add the "and
include newline" connotation, so you can change your spaces to

Legend\_s\+for\_s\+name\_s\+is\_s\+not\_s\+found

which would allow a new-line as part of any of the whitespace in your
sentence.

-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: pattern for substitution including linefeed and carriage return

Am 12/10/2017 um 05:08 PM schrieb Erhy:
> ... This items have also textmarkers " e.g.
> 30.11.2017;"Name";"Legend
> for name
> is not found";"New York";
So You want to delete the contents of cases, where
the Last thing of the line is not the ", followed
by line(s) with no " at all, up to the line, which
contains, but does not begin with "?
(Which misses some cases, and will work only mostly,
as it depends on having the single ;" in the first
and the single "; on the last line of change.
So Lines with broken pairs of ", or with extra newline
without ", or lines with newline in the first or the
last field, would break or be ignored.)

The simple case might be done with:

:s/;"[^"]*\n\([^"]*\n\)[^"]*";/;"";/

OR do you want to remove the newlines only and keep
the text? Which I believe would be more complicated,
because of the newlines inside of the \(...\) pair.

Stucki

--
--
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.