Vim build error "no terminal library found" [Was: Reformatting numbered lists]

625 views
Skip to first unread message

Erik Christiansen

unread,
Mar 17, 2011, 8:50:35 AM3/17/11
to vim...@googlegroups.com
Reply-To: dva...@internode.on.net
In-Reply-To: <8fc5808f-0fa2-4ad8...@17g2000prr.googlegroups.com>

On Wed, Mar 16, 2011 at 10:39:43AM -0700, Bee wrote:
> On Mar 16, 12:02�am, Erik Christiansen <dva...@internode.on.net>
> wrote:
> >
> > I'll try to fly for a while without '2', but will have to change my
> > habits for it to (potentially) work. If it doesn't, I suppose I could
> > try modelines or au, to fudge my way to a working compromise.
>
> Create two mappings to switch:
>
> map <Leader>fon :set fo-=2 fo+=n<cr>
> map <Leader>fo2 :set fo-=n fo+=2<cr>
>
> Or one to toggle:
>
> function! Foo()
> if &fo =~ "2"
> set fo-=2 fo+=n
> else
> set fo-=n fo+=2
> endif
> endfun
> map <Leader>foo :call Foo()<cr>

Oooooh! Thank you very much for those. :-)

While simple mappings normally appeal most, I have F12 as pastetoggle,
and another handy toggle on F11 could be learnt by association.

After using fo-=2 fo+=n for a day or two, I now have to try to find out
what is causing frequent weirdness when formatting a simple paragraph,
devoid of any digits, and therefore incapable of triggering the current
formatlistpat, IIUC. With:

formatoptions=croqltn
formatlistpat=^\s*\(\d\|\a\)\+\.\s*
autoindent
textwidth=72

Vim now mishandles a gq} performed on:


I couldn't see anything but screw heads when hovering over the last two
photos. (But then I'm arguably GUI dyslexic, possibly due to decades pushing
characters.)

giving this oddly skewed result:


I couldn't see anything but screw heads when hovering over the last two
photos. (But then I'm arguably GUI dyslexic, possibly due to decades
pushing
characters.)

Although that can't trigger the \d in formatlistpat, removing the 'n'
from formatoptions allowed gq} to work:


I couldn't see anything but screw heads when hovering over the last two
photos. (But then I'm arguably GUI dyslexic, possibly due to decades
pushing characters.)

My Vim 7.1 is the latest for the Ubuntu 8.04.4 LTS on this host.
Perhaps I have to build from source, to try a more current Vim on this
host. It might be easier to defer attempts to get numbered lists to
work. ;-)

Ah!, that spurious indent occurred spontaneously on a line wrap while
typing in insert mode.

OK, a quick check to see that I have the build-essential and
linux-headers-$(uname -r) packages on this box, fetch the 7.3 source,
and "sudo make":

checking for tgetent in -lncurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
checking for tgetent in -lcurses... no
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.

Fine, let's do:

$ sudo apt-get install ncurses
...
Package ncurses is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ncurses has no installation candidate

OK, after an:

$ apt-cache search curses | more

let's try this, in case the name changed:

$ sudo apt-get install ncurses-base
...
ncurses-base is already the newest version.

Ah, this might have terminal libraries:

$ sudo apt-get install ncurses-term

Nah, that didn't help in the slightest.

It's getting late. Maybe I have to look for the ncurses .deb for ubuntu
8.04 LTS at some other site ... tomorrow.

Erik

--
"Meddle not in the affairs of Wizards, mortal ...
For thou art crunchy and taste good with ketchup"

Benjamin R. Haskell

unread,
Mar 17, 2011, 9:17:38 AM3/17/11
to vim...@googlegroups.com
On Thu, 17 Mar 2011, Erik Christiansen wrote:

> [...]


>
> OK, a quick check to see that I have the build-essential and
> linux-headers-$(uname -r) packages on this box, fetch the 7.3 source,
> and "sudo make":

You shouldn't need `sudo` for the `make` portion. Just if you then
`make install` to directories that you don't own.


> checking for tgetent in -lncurses... no
> checking for tgetent in -ltermlib... no
> checking for tgetent in -ltermcap... no
> checking for tgetent in -lcurses... no
> no terminal library found
> checking for tgetent()... configure: error: NOT FOUND!
> You need to install a terminal library; for example ncurses.
>
> Fine, let's do:
>
> $ sudo apt-get install ncurses
> ...

Partly from the FAQ[1]... save yourself a bunch of trouble and do:

$ rpm -qf $(which vim)
$ sudo apt-get build-dep [whatever the prior command reported]

(or combined:)
$ rpm -qf --qf='%{NAME}\n' $(which vim) | xargs sudo apt-get build-dep

That will install all the prereqs you'll need to build the package from
source. (at least in the way your distro configures it)

--
Best,
Ben

[1] http://vimhelp.appspot.com/vim_faq.txt.html#faq-35.10 (jump down to
"1) On Debian based distribution...")

Christian Brabandt

unread,
Mar 17, 2011, 9:44:53 AM3/17/11
to vim...@googlegroups.com
On Thu, March 17, 2011 2:17 pm, Benjamin R. Haskell wrote:
> On Thu, 17 Mar 2011, Erik Christiansen wrote:
>
>> [...]
>>
>> OK, a quick check to see that I have the build-essential and
>> linux-headers-$(uname -r) packages on this box, fetch the 7.3 source,
>> and "sudo make":
>
> You shouldn't need `sudo` for the `make` portion. Just if you then
> `make install` to directories that you don't own.
>
>
>> checking for tgetent in -lncurses... no
>> checking for tgetent in -ltermlib... no
>> checking for tgetent in -ltermcap... no
>> checking for tgetent in -lcurses... no
>> no terminal library found
>> checking for tgetent()... configure: error: NOT FOUND!
>> You need to install a terminal library; for example ncurses.
>>
>> Fine, let's do:
>>
>> $ sudo apt-get install ncurses
>> ...
>
> Partly from the FAQ[1]... save yourself a bunch of trouble and do:
>
> $ rpm -qf $(which vim)
> $ sudo apt-get build-dep [whatever the prior command reported]
>
> (or combined:)
> $ rpm -qf --qf='%{NAME}\n' $(which vim) | xargs sudo apt-get build-dep

I doubt there is any Debian based distribution, that uses rpm ;)
Instead of the rpm command, use
dpkg -S $(which vim)


regards,
Christian

Jürgen Krämer

unread,
Mar 17, 2011, 10:05:23 AM3/17/11
to vim...@googlegroups.com

Hi,

the way you have set formatlistpat "photos." is interpreted as the
start of an item in a list. You get better results with

:set formatlistpat=^\\s*\\(\\d\\+\\\|\\a\\)\\.\\s*

Note that I have moved the \+ quantifier to immediately behind \d so
that only one or more digits and exactly one letter are allowed as
"numbers".

Regards,
J�rgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

Erik Christiansen

unread,
Mar 17, 2011, 10:32:12 AM3/17/11
to vim...@googlegroups.com
On Thu, Mar 17, 2011 at 09:17:38AM -0400, Benjamin R. Haskell wrote:
> On Thu, 17 Mar 2011, Erik Christiansen wrote:
>
>> [...]
>>
>> OK, a quick check to see that I have the build-essential and
>> linux-headers-$(uname -r) packages on this box, fetch the 7.3 source,
>> and "sudo make":
>
> You shouldn't need `sudo` for the `make` portion. Just if you then
> `make install` to directories that you don't own.
>

Agreed. That is my normal practice, but I don't appear to read so well
late at night, and misinterpreted src/INSTALL.

>> checking for tgetent in -lncurses... no
>> checking for tgetent in -ltermlib... no
>> checking for tgetent in -ltermcap... no
>> checking for tgetent in -lcurses... no
>> no terminal library found
>> checking for tgetent()... configure: error: NOT FOUND!
>> You need to install a terminal library; for example ncurses.
>>
>> Fine, let's do:
>>
>> $ sudo apt-get install ncurses
>> ...
>
> Partly from the FAQ[1]... save yourself a bunch of trouble and do:
>
> $ rpm -qf $(which vim)
> $ sudo apt-get build-dep [whatever the prior command reported]

Thank you for the build-dep hint. When apt showed that it only had
source for vim 7.1, I went to vim.org for 7.3. Using apt's build-dep for
an old version of vim to fudge a build of externally sourced source did
not occur to me.

There's no rpm on ubuntu, but it wasn't needed.

Thanks again.

Erik

--
If at first you don't succeed, try again.
Then Quit. No use being a damn fool about it. - W.C. Fields

Erik Christiansen

unread,
Mar 17, 2011, 10:40:05 AM3/17/11
to vim...@googlegroups.com

And:

$ dpkg -S $(which vim) | wc -l
...
17478

makes "[whatever the prior command reported]" awkward to put on the
command line. However, I simply settled for:

$ sudo apt-get build-dep vim

That was near enough for nearly 2 a.m. (It fetched tens times what I
really needed, I think, but it built.)

Erik

--
If at first you don't succeed, destroy all evidence that you tried.
- Ralf Hildebrandt, on postfix-users.

Erik Christiansen

unread,
Mar 17, 2011, 11:21:02 AM3/17/11
to vim...@googlegroups.com
On Thu, Mar 17, 2011 at 03:05:23PM +0100, J�rgen Kr�mer wrote:
>
> the way you have set formatlistpat "photos." is interpreted as the
> start of an item in a list. You get better results with
>
> :set formatlistpat=^\\s*\\(\\d\\+\\\|\\a\\)\\.\\s*
>
> Note that I have moved the \+ quantifier to immediately behind \d so
> that only one or more digits and exactly one letter are allowed as
> "numbers".

Thank you very much! :-)

You've seen by analysis what I've been stumbling toward through a tedious
process of elimination, including updating to 7.3. (Overcoming my
pathological aversion to all the backslashes, and belatedly translating it
to more resemble a posix ERE; ^\s*(\d|\a)+\.\s* , I can now understand
it. Should have done that _much_ earlier.)

It's a slippery slope. You'll have me reading (with difficulty) vim's RE
dialect before long, ... and it doesn't hurt as much as I expected.)
Maybe I can write a small awk script to translate both ways. The trouble
is I'll understand vim REs by the time it works right.

Thanks again.

Erik

P.S. Some years ago, I tried bulding vim with a posix regex library.
It was a delight to use, except that the help broke.

--
History doesn't always repeat itself. Sometimes it just screams,
'Why don't you listen to me?' and lets fly with a big stick.
--John W. Campbell Jr.

Reply all
Reply to author
Forward
0 new messages