Re: Trouble building Huge Vim8 on CentOS 7

2017-04-05 Thread Tony Mechelynck
On Wed, Apr 5, 2017 at 4:18 AM, Mun  wrote:
> Hi,
>
> On Tue, Mar 21, 2017 at 07:13 PM PDT, L A Walsh wrote:
> LAW> Mun wrote:
> LAW> >I tried to find a yum package that provides SMlib.h, but my system said:
> LAW> >"No matches found".  Sigh.
> LAW> 
> LAW>I found I had to create my own reverse index of packages in my
> LAW> distro to find files.
> LAW>
> LAW> basically a:
> LAW>  "rpm -qpl path-to-pkg/pkg.rpm   > path-to-rpmlist/pkg.rpm.lst"
> LAW> for each rpm in my distro (so each rpm file list ends up in a
> LAW> different file).
> LAW>
> LAW> It's the only way to find a file that I've found.  It's 550Meg
> LAW> of just rpm-file lists.  That said, how to find files in your
> LAW> distro, isn't really a 'vim question', but a question for
> LAW> people who know how to find things in your distro.
> LAW>
> LAW>
> LAW> Dunno if it is helpful, but in suse13.2, it's in libSM-devel.
>
> Thanks for the reply.  I was able to finally get vim to compile, but it
> was a little painful to discover all of the dependencies.
>
> If there exists documentation which specifies the dependencies for a
> "huge gui" implementation on CentOS7, I missed it.
>
> Kind regards,
>
> --
> Mun

The output of rpm queries is often inwieldy, so it's useful to grep
them for what you're looking for. For instance, to see which of the
foobar packages are installed,

rpm -qa | grep ^foobar

(notice the initial ^ which has the same meaning as in a Vim pattern)
is much nicer than looking at the full rpm -qa output.


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


Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode

2017-04-05 Thread Jacky Liu
I am switching back to console Vim because it solved the No.1 problem of Gvim: 
it doesn't allow another thread to start a X based graphical UI, as it will 
clash with the one of its own. Also it now supports true color and is much 
faster in responding user ops.

Unfortunately I bumped into the old Alt key mapping problem. After examining 
all possibilities I think setting the key codes in Vim is the most practical:

function! s:ConsoleMapAltKey()
let char= 'a'
while char <= 'z'
exec "set =\".char
let char= nr2char(1+char2nr(char))
endwhile

set ttimeout
set ttimeoutlen=30
endfunction


This supposedly should tell Vim that the  key will generate  
leading key sequences, and enable Vim to tell them apart from user input of 
 followed by other keys by the different time lapse.

This works perfectly under Normal and Command mode, no ambiguity when  was 
pressed, but not in Insert mode, where the  key combination will 
always be accepted as one  followed by another key from the user. I tried 
explicitly doing key mapping:

imap   xxx

and it didn't work. Can anyone enlighten me on this, 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode

2017-04-05 Thread Jacky Liu
My Vim version is 8.0.540 if it helps

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode

2017-04-05 Thread Tony Mechelynck
On Wed, Apr 5, 2017 at 3:48 PM, Jacky Liu  wrote:
> My Vim version is 8.0.540 if it helps

What does ":verbose set timeoutlen" answer?

I recommend someting like the following settings:

if exists('+timeout')
" should a timeout be applied to keys and mappings?
" 'timeout' true=yes false=no
" 'ttimeout' (not used if 'timeout' is true) time out on key codes
" 'timeoutlen' timeout duration on mappings
" 'ttimeoutlen': timeout duration on keycodes
" (use 'timeoutlen') if negative)
" durations are in milliseconds
set timeout timeoutlen=5000 ttimeoutlen=250
" ttimeoutlen should be longer than the hardware cycle but shorter
than your fastest typing speed
" timeoutlen should be longer than your slowest typing speed
endif

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


Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode

2017-04-05 Thread Jacky Liu

> 
> What does ":verbose set timeoutlen" answer?
> 
> I recommend someting like the following settings:
> 
> if exists('+timeout')
> " should a timeout be applied to keys and mappings?
> " 'timeout' true=yes false=no
> " 'ttimeout' (not used if 'timeout' is true) time out on key codes
> " 'timeoutlen' timeout duration on mappings
> " 'ttimeoutlen': timeout duration on keycodes
> " (use 'timeoutlen') if negative)
> " durations are in milliseconds
> set timeout timeoutlen=5000 ttimeoutlen=250
> " ttimeoutlen should be longer than the hardware cycle but shorter
> than your fastest typing speed
> " timeoutlen should be longer than your slowest typing speed
> endif
> 
> Best regards,
> Tony.


Yes, the 'timeout' option is usable with my Vim, yet I'm afraid it doesn't help 
much here. For the Meta key mapping to work in Insert mode I have to do 
keymapping like this:

inoremapj   InsertModeKeymapping('M-j')

And this will introduce ambiguity to the  key, Vim get stuck for a while 
to resolve it whenever the key was pressed under Insert mode. Also, from my 
understanding, the default status with 'timeout' not set equals 'timeoutlen' 
being set to infinite time, which is indifferent with, say, a large number.


-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Alt key mapping: "set " works in Normal/Command mode, but not in Insert mode

2017-04-05 Thread Jacky Liu
After a few tries I found something that looks a little bit strange to me: the 
Insert mode meta keymapping actually works, *only if* you set at least one 
mapping with the leading .

Previously I tried my best to avoid mapping the  leading keys, although it 
works, because it would introduce ambiguity and get Vim stuck when  was 
pressed, but all the  mappings wouldn't work then, like they were all 
ignored.

Now I've found this:

inoremap m

with this key mapping in place, suddenly, all my  mappings in Insert mode 
works!

But this mapping still introduces ambiguity to the Escape key, a dilemma ...




-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


execute sub command without moving cursor

2017-04-05 Thread Ni Va
Hi,


I use this kind of command but it moves my cursor pos.


silent! exe '?^BEGIN?,/^END/s/^NETWORK.*$/\="NETWORK".s:inc()." \/\/In ".s[0]." 
: ".s[1]/e'


Can I avoid to move cursor when I replace executing sub command ?
Thanks
niva

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


single shot mapping insert mode backwards line move

2017-04-05 Thread Sylvain Viart
Hi,

I'm trying to build a function for solving some completion hacking.
I mean, I would like to quickly move my cursor in insertmod backward in
the current line and cycle though the positions.

My idea is to define 2 key bindings:

imap  which will detect some char in the current line [=/]
imap  which will delete one space backward

hitting c-left would bring my cursor in insert mode just after the char
matched:

I represent the cursor with a pipe

var=pipo/molo|
 
var=pipo/|molo

var=|pipo/molo

 

and each c-left cycle through matchable character, and back where we
started the mapping

I would know if I can imap  temporary so it will finish my cycle
and move the cursor back to the started position, saved in a mark (may
be some offset compute, because I inserted space).
That way I can come back to insert mode and hit  to have file
completion fore example, with the modified path and having filename
completed with current path.

Do I need to handle the imap  myself or it there some instant
one-shot mapping?

Here is my function draft:

" supprime l'espace dans la completion "test_ nom_class"
imap  miF x`ia
" insert l'espace sur in char
[=/] 
imap  :call Lookup_back()a

" var=pipo/molo
func! Lookup_back()
  let l = getline('.')
  let s = 0
  " save the line txt in g:last_l, will be our memory + g:last_match
  if exists("g:last_l")
if l == g:last_l
  let s = g:last_match + 1
else
  let g:last_l = l
endif
  else
" init
norm mi
let g:last_l = l
  endif

  " reverse it
  let r = join(reverse(split(l, '\zs')), '')
  let p = match(r, '[=/][^ ]', s)
  let g:last_match = p

  if p > -1
call cursor(line('.'), col("'i") - p)
  else
let g:last_l = ""
" put back at 'i
"call cursor(line('.'), col("'i"))
  endif
  echo p
endf

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: execute sub command without moving cursor

2017-04-05 Thread Nikolay Aleksandrovich Pavlov
2017-04-05 22:21 GMT+03:00 Ni Va :
> Hi,
>
>
> I use this kind of command but it moves my cursor pos.
>
>
> silent! exe '?^BEGIN?,/^END/s/^NETWORK.*$/\="NETWORK".s:inc()." \/\/In 
> ".s[0]." : ".s[1]/e'
>
>
> Can I avoid to move cursor when I replace executing sub command ?
> Thanks
> niva

You can restore it afterwards: use winsaveview()+winrestview().
Otherwise you will have to emulate `:substitute` with search() and
setline() and this is going to be way too tricky.

>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to vim_use+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Different syntax behavior in vim 7.4

2017-04-05 Thread Chandra
Hello,
I see a syntax behavior change between vim 7.4 and earlier version. (We are 
yet to update VIM version to 8.0+ in our company.)

I use different syntax for lines that begin with "//" (Comments) and lines that 
begin with "//:" (embedded Perl Code). I was able to achieve this with earlier 
version of vim by specifying this in the syntax file,

 syn match embPerlCode "^\s*//:.*"

and this in .gvimrc,

 highlight embPerlCode gui=bold guifg=maroon

This works fine in version 7.2 (didn't check in 7.3). But in version 7.4 the 
behavior has changed. The embPerlCode lines are shown with syntax color of 
Comments.

Is there a way to get around this and get back the previous behavior?

thanks,
Chandra

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different syntax behavior in vim 7.4

2017-04-05 Thread Dominique Pellé
Chandra  wrote:

> Hello,
> I see a syntax behavior change between vim 7.4 and earlier
> version. (We are yet to update VIM version to 8.0+ in our company.)
>
> I use different syntax for lines that begin with "//" (Comments) and
> lines that begin with "//:" (embedded Perl Code). I was able to
> achieve this with earlier version of vim by specifying this in the
> syntax file,
>
>  syn match embPerlCode "^\s*//:.*"
>
> and this in .gvimrc,
>
>  highlight embPerlCode gui=bold guifg=maroon
>
> This works fine in version 7.2 (didn't check in 7.3). But in version
> 7.4 the behavior has changed. The embPerlCode lines are
> shown with syntax color of Comments.
>
> Is there a way to get around this and get back the previous behavior?

Using vim-8.0.543 (gtk3 gui), it works as expected for me
i.e. I see different colors for comments if I do:

$ vim -f -g \
  -c 'syntax on' \
  -c 'setfiletype cpp' \
  -c 'syn match embPerlCode "^\s*//:.*"' \
  -c 'hi embPerlCode gui=bold guifg=maroon' \
  -c 'call setline(1, ["// a cpp comment", "//: an empPerlCode comment"])'

Can you double check?

If you use vim-7.2 or 7.3, you're missing a lot of
fixes and useful new features.

Dominique

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RFE: enable gvim to open a buffer or tab in a new window

2017-04-05 Thread L. A. Walsh

Paul wrote:

On Tuesday, 28 March, 2017 at 13:08:03 BST, L A Walsh wrote:
Just the other day, I had two files open in tabs (.cc and .h: a C++ 
source &
header).  Instead of window switching, I wanted to change my visual 
layout for
1 pair of files to see them side-by-side (and when I was done, close 
the 2nd

display leaving the 2nd file as a 2nd tab in the 1st window.


Why not just :vsplit the other file into the current tab, and :quit it 
when done?

---
   If vsplit could split the file into another window, that'd be great!

But I want to be able to arrange the windows side-by-side -- maybe 1
on each side or, rarely, maybe 2 on each side (one above another).

Trying to simulate all of this in 1 window is near impossible,
but being able to view multiple files at the same time in
some side-by-side or one-on-top seems like a fairly basic
desire.  Right now, I have 10 different copies of gvim running,
each with 2 files (c++ source & header) and another 4 copies
with other work/projects in them.  At times I have 6-8 gvim's
open on my desktop each w/different files that I move between
to analyze call paths between different modules.

In this case, sometimes I want to view the header & c++ source
side-by-side in two windows and when done, I'd like to move
the header-file-window back into a tab of the source-file-window.

When I have to make code changes in multiple windows, it is
a hassle that I don't have the same history list in common
so I can repeat commands in each window instead of having to type
them, afresh, in each window.

People who do development get larger screens and multiple screens
so they can have multiple files and projects open at the same
time.

Does that help understand my use case?

Thanks!
Linda

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Different syntax behavior in vim 7.4

2017-04-05 Thread Chandrasekaran Venkatraman
Yes, I could get the expected syntax display with vim 8.0 .

Thanks.

On Wed, Apr 5, 2017 at 3:43 PM, Dominique Pellé 
wrote:

> Chandra  wrote:
>
> > Hello,
> > I see a syntax behavior change between vim 7.4 and earlier
> > version. (We are yet to update VIM version to 8.0+ in our company.)
> >
> > I use different syntax for lines that begin with "//" (Comments) and
> > lines that begin with "//:" (embedded Perl Code). I was able to
> > achieve this with earlier version of vim by specifying this in the
> > syntax file,
> >
> >  syn match embPerlCode "^\s*//:.*"
> >
> > and this in .gvimrc,
> >
> >  highlight embPerlCode gui=bold guifg=maroon
> >
> > This works fine in version 7.2 (didn't check in 7.3). But in version
> > 7.4 the behavior has changed. The embPerlCode lines are
> > shown with syntax color of Comments.
> >
> > Is there a way to get around this and get back the previous behavior?
>
> Using vim-8.0.543 (gtk3 gui), it works as expected for me
> i.e. I see different colors for comments if I do:
>
> $ vim -f -g \
>   -c 'syntax on' \
>   -c 'setfiletype cpp' \
>   -c 'syn match embPerlCode "^\s*//:.*"' \
>   -c 'hi embPerlCode gui=bold guifg=maroon' \
>   -c 'call setline(1, ["// a cpp comment", "//: an empPerlCode comment"])'
>
> Can you double check?
>
> If you use vim-7.2 or 7.3, you're missing a lot of
> fixes and useful new features.
>
> Dominique
>
> --
> --
> 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 a topic in the
> Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/vim_use/bO4pbg3nvoU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> vim_use+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.