Re: Does gVim has long term plan to support Emacs' frame feature? (For multi monitors)

2019-03-07 Thread lith
> I want to know: does gVim has long term plan to support Emacs' frame 
> feature?, which is very handy if you want to use it across multi monitor.

IIRC it came up in the recent feature poll.

That said, you can send commands from one GVIM instance to another instance -- 
e.g. make it open a file etc. Before vim's new async features, some plugins 
used this for background tasks.

-- 
-- 
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: GVIM: alt/meta keys: inconsistent results for getchar(0)

2019-02-21 Thread lith
> When I run this code in Windows GVIM and press, e.g.,  in a row:
> 
> sleep 1|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor
> 
> I get a mix of '<80>^H<80>ku' and '<80>^H'.

Additional question: When I press  only once, I get one 
'<80>^H<80>ku' and 9 '<80>^H' although no key is pressed at that time.

This can also be done with:

echo getchar()|for i in range(10) | echo string(getchar(0)) | sleep 50m | 
endfor

Is that expected? In this situation, I'd naivly expect the first getchar() to 
return '<80>^H<80>ku', and the subsequent getchar(0) to return 0.

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


GVIM: alt/meta keys: inconsistent results for getchar(0)

2019-02-20 Thread lith
Hi!

When I run this code in Windows GVIM and press, e.g.,  in a row:

sleep 1|for i in range(10) | echo string(getchar(0)) | sleep 50m | endfor

I get a mix of '<80>^H<80>ku' and '<80>^H'.

When I increase the timeout to 150m, I get only '<80>^H<80>ku', which seems 
correct.

Is this expected? Is it a bug? Is there another way to make sure I get the 
right key code other that using sleep?

Regards,
Tom

-- 
-- 
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: Feature/plugin dependency checks in plugins

2019-02-17 Thread lith
> for the version (and if so how)

Many plugins define a variable that holds the plugin version

let g:loaded_FOO = 100

in plugin/FOO.vim.

> There is also the concern that if 
> you are using a plugin manager some other plugin which you depend 
> on may not be loaded yet even though it eventually will be.

Do you really have to check for that dependency in the file under the plugin 
directory? IMHO it's often sufficient to check dependencies in an autoload file 
which also solves this problem.

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


Re: VIM & Eclipse

2018-11-24 Thread lith
> You could get a "vimlike" experience by installing the vrapper plugin for 
> eclipse, but it's not quite the same.

vrapper is quite ok actually. It also supports creating maps etc. I think it's 
worth a try. Once you decided that eclipse (or any other full fledged IDE) is 
the better tool for the problem at hand, you're probably better of with just 
using eclispe the way it is plus a light vim-mode plugin.

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


BufReadPre event vs file that isn't readable for now: How to mount a volume before reading the file?

2018-04-07 Thread lith
Hi!

Let's say, I want to edit a file that is on a volume that is not mounted yet. 
From the perspective of vim, the file doesn't exist. Whenever I want to edit 
that file, I have to mount that volume first.

The docs on the BufReadPre event say:

BufReadPre  When starting to edit a new buffer, before
reading the file into the buffer.  Not used
if the file doesn't exist.

So, I cannot use this event to prepare reading a file that is temporarily 
unavailable, e.g., because its volume isn't mounted yet.

Is there another event that I can use to mount the volume before reading the 
file.

Regards,
Tom

-- 
-- 
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: Vim website hosting

2018-03-28 Thread lith
You're right of course. I also agree with the "vendor lock-in" argument.

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


Re: Vim website hosting

2018-03-28 Thread lith
> > What about Github pages?
> > 
> > https://pages.github.com/

This also was my first though.

> Sorry, we don't want to discuss other hosting services now and github 
> pages does not allow to run dynamic scripting pages which is what we 
> need.

What is actually needed? Couldn't the vim homepage to without the plugins 
directory. Github supports labels (e.g. vim-plugin) to mark a repo as a vim 
plugin. What else do you need dynamic scripts for?

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


Re: Advice needed: best practices for vim plugin testing

2017-10-20 Thread lith
> I have tried a couple of other vim plugins for testing with little/no success.

Which one did you try? Are you looking for something like vader 
?

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


Re: standard way include plugin as a dependency of another plugin

2017-08-01 Thread lith
> I'm writing a plugin and want it to depend on another plugin installed. At 
> the moment I just have a line
> 
> source 

I sometimes use something like this:

if !exists('g:loaded_DEPENDENCY') || g:loaded_DEPENDENCY < 100
runtime plugin/DEPENDENCY.vim
if !exists('g:loaded_DEPENDENCY') || g:loaded_DEPENDENCY < 100
echoerr 'DEPENDENCY >= 1.00 is required'
finish
endif
endif

This makes sure plugin/DEPENDENCY.vim is loaded. The file has to be in the 
runtimepath. This solution is suboptimal if g:loaded_DEPENDENCY < 100 though.

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


Re: [ANN] minpac v1.0: a minimal package manager for Vim 8

2017-04-28 Thread lith
> About this? Well it's fixed.

Not the original author but I ran into similar problems with optional plugins 
that didn't load files in the after directory properly. Thi soccurred with vim 
8.0 since I didn't use the pack feature before. Anyway, I cannot reconstruct 
the problem exactly because ...

Shameless plug: I wrote autopack[1] to facilitate the loading of optional "pack 
plugins" which also provides IMHO better support for configuring plugins in 
packs via before and after scripts (actually packrc/before/PLUGIN.vim and 
packrc/after/PLUGIN.vim).

Regards


[1] http://www.vim.org/scripts/script.php?script_id=5526
https://github.com/tomtom/autopack_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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Fixate window layout?

2017-03-23 Thread lith
2017-03-23 0:02 GMT+01:00 Shawn H Corey :

> > Try 'winfixheight' and 'winfixwidth'.
> >
>
> And 'winpos' for position.


Maybe I didn't make myself clear. With "window" I refer to windows in vim,
not the frame of the gui window.

When I execute the following:

e foo
vsplit bar
windo setl winfixheight winfixwidth

I end up with a tabpage with two vertically split windows.

The commands `wincmd c`, `bdelete` will remove the split and I end up with
a single vim window. Neither winfixheight nor winfixwidth protected me from
this. But I'd rather expect/want the other window to not change at all and
the current window be displaying a new empty buffer -- or the previous
buffer if any.

I know that there are some vim tips (i personally use vimtip 1078) & code
snippets around that can replace `wincmd c` or `bdelete` and won't change
the layout but this doesn't keep plugins from changing the layout.

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


Fixate window layout?

2017-03-22 Thread lith
Hi!

When switching back from eclipse to vim, I sometimes find it (still) surprising 
that vim doesn't seem to provide a way to "fixate" the window layout. While I 
think the volatility of the window layout is an advantage when working on a 
small screen, it can be annoying on a big screen, where I would prefer certain 
windows to never change their size or position.

What are currently the best options to make certain windows stay put regardless 
of how the other windows on the tab page change? Does Vim8 add anything new in 
this respect?

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


Reschedule a timer?

2017-02-18 Thread lith
Hi!

Is there a way to reschedule/delay a timer. Something like:

let t = timer_start(1000, 'DoSomething')

Then after, say, 500ms:

call timer_reschedule(1000)

Then wait another 1000ms for DoSomething to be called.

I could of course stop the old and start a new timer but I guess this would 
waste  resources and be quite inefficient if being done very often.

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


Re: Having certain lines readonly

2017-01-15 Thread lith
> Thank for your post. I figured out that I can simulate readonly lines by 
> keeping metadata about lines and remapping all keys to a function which 
> decides upon that  metadata whether to put the character in question.

An alternative approach would be to use the CursorMoved(I) events to toggle the 
readonly option depending on which line the cursor is located at.

E.g. the setsyntax plugin 
(http://www.vim.org/scripts/script.php?script_id=2076) can be used to achieve 
something like this based on the syntax group under the cursor.

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


Re: Revert keys values in dict

2016-04-06 Thread lith
> Such tricks are usually used in
> plugins where you e.g. have mappings like “escape sequence to escaped
> character” for decoder and “escaped character to escape sequence” for
> encoder or something like this

I didn't question the intent per se but the "cool one-liner" requirement.

-- 
-- 
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: Revert keys values in dict

2016-04-03 Thread lith
> > I would like to make values become keys in this dict, is it possible
> > in one simple command  ?
> However, with a dirty hack, it becomes possible to do this with a 
> almost-oneliner:

The problem with these oneliners is that values can be empty strings (keys must 
not be empty) and that there may be duplicate values that would have to be 
reconciled. You'd have to deal with these cases somehow.

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


Re: Unintentionally closing Vim with many buffers open

2015-12-05 Thread lith
> Then I have to reopen Vim and reopen all the buffers I was working on.

Check out :help views-sessions

There are some session manager plugins around on vim.org that do exactly what 
you want. I personally prefer the "most recently used files" though -- like 
(shameless plug) tmru_vim.

HTH

-- 
-- 
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: vim - how to enable searching in vim editor and finding/highlighting pattern that is only in non-commented block/line

2015-08-27 Thread lith
 I am looking for a way to search in vim editor and to find text highlighted 
 only for pattern found in non-commented blocks/lines.

With the trag[1] plugin you could do:

:Trag -i PATTERN

This will search all files in the current project though and not just the 
current buffer.

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


How to determine whether an option is boolean?

2015-05-05 Thread lith
Hi!

Some vim options are boolean, i.e. integers with the possible values 0 and 1. 
You can, e.g., set `ai` and `noai` or use `let ai = 1`. Other options are 
numeric/integer or string values.

type(option) can only be used to distinguish string from bool/int options. 
exist('noai') returns 0, so it cannot be used to distinguish bool from int 
options. Is there another way to determine whether an option is a bool (an int 
that takes only the values 0 or 1) or an int?

Regards,
Tom

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


Best way to programmatically define a function

2015-04-26 Thread lith
Hi!

What's the best way to create a function that creates functions?

I currently construct a string with the vim code, put that into a register, and 
then evaluate the register. See 
https://github.com/tomtom/tcomment_vim/blob/master/plugin/tcomment.vim#L165 for 
an example.

This works well but seems to cause serious problems in certain situations with 
certain installations. See here for an example report: 
https://github.com/tomtom/tcomment_vim/issues/140

Is this a known issue with certain versions of gvim?

Is there an alternative way to achieve this that doesn't cause the problem 
reported above?

Regards,
Tom

-- 
-- 
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: Best way to programmatically define a function

2015-04-26 Thread lith
 It is very strange to do this via a register. Just use `execute join(fn, 
 \n)`.

Hm ... I'm pretty sure the last time I tried the more obvious solution it 
didn't work for defining functions. Thanks.

Thanks for pointing out the problem with the register.

-- 
-- 
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: Recommendation for Plugin Manager with VimBall

2015-04-09 Thread lith
Am Mittwoch, 8. April 2015 18:32:47 UTC+2 schrieb Gary Furash:
 I would like to use a package manager like Pathogen, but most package 
 managers don't handle Vimballs. What do you all recommend?

Which problem exactly do you want to solve? The vimball.rb ruby script[1] can 
be used to easily install a vimball as a bundle (if configured correctly): 
`vimball.rb --repo install myplugin.vba` -- it might be necessary to define 
config.yml file to use the right bundle directory.


[1] https://github.com/tomtom/vimball.rb

-- 
-- 
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: VIM on a small embedded system

2014-12-06 Thread lith
 on an Arietta G25 I have installed Gentoo Linux and (of course :)
 vim.

I used to run vim on a zaurus sl-c300, which worked fine. Sometimes it was 
necessary, for certain filetypes, to turn off indentation (indentexpr) and fold 
expressons (foldexpr) which can cause noticeable lags under certain 
circumstances but should be ok most of the time.

Regards,
Tom

-- 
-- 
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: shorten the display of url's while note taking

2014-10-09 Thread lith
 You could use the conceal feature to hide parts of the text. Then by 
 default when you move the cursor onto the line, the hidden text would be 
 shown. Or you could set it up so that only happens in visual mode, or insert 
 mode.

I use this for a similar purpose in the viki plugin. Unfortunately, it doesn't 
play well with word wrap which is why text with shortened URLs tends to look 
awkward.

An alternative solution is link maps, i.e. use a shortcut in the text and 
have the URL for that shortcut defined in a specially formatted 
table/definition list someplace else -- similar to footnotes.

-- 
-- 
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: --remote-expr

2014-04-22 Thread lith
 Why this one does not work :
 vim --servername GVIM101 --remote-expr SchedulingTask('2014-04-22 
 15:06:30','BasicTask()')

You should probably enclose the expr in quotes: SchedulingTask('2014-04-22 
15:06:30','BasicTask()')

-- 
-- 
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: Vim Spreadsheets

2014-03-25 Thread lith
 I'm thinking using Vim for spreadsheets, for a few reasons:

You didn't say what you are trying to achieve. Why do you think a spreadsheet 
is the right approach to solve that problem? Why not keep the data in csv files 
and then manipulate the data from a script (e.g. written in R) you evaluate 
interactivly (somehow)?

-- 
-- 
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: Poll: What's good about plugin managers?

2014-03-24 Thread lith
 Vundle appears to be popular

Regarding vundle: I'm no vundle user but I recently stumbled over this blog 
entry while googling for something else: 
http://gmarik.info/blog/2014/02/04/why-i-stopped-contributing-to-vundle

Given the commits list though, it seems vundle is still alive and kicking: 
https://github.com/gmarik/Vundle.vim/commits/master

It would be interesting if the authors of all those plugins would chime in and 
explain why they wrote X while Y already existed and what it does better or 
worse.

-- 
-- 
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: Automatic completion from word list

2014-03-23 Thread lith
 likelycomplete seems to think that  is not a real file type,
 which is unfortunate as it's what I'm in half the time.

If you're writing prose, I'd suggest to set ft to text or something similar. 
(Or use markdown markup.)

 The parameters are all global but my language and abbreviations
 settings are per window which makes interfacing the two
 difficult.

It's possible to override filetype by setting b:likelycomplete_filetype. I 
guess I could add w:likelycomplete_filetype (a window specific variable), which 
would help solving your problem.

 Fuzzy matching has a perceptible delay, even with a small
 dictionary (13_000 words, 100 kB)

That's possible. :-) I should probably add a quick ranking mode. By default, 
likelycomplete remembers the words you write most frequently.

I guess adding

  let g:likelycomplete#match_beginning = 1

should improve the situation. By default it also takes into account 
middle-of-word matches.

I think we should continue the situation off list. If you want you could also 
file issues at https://github.com/tomtom/likelycomplete_vim/issues

Regards,
Tom

-- 
-- 
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: Poll: What's good about plugin managers?

2014-03-23 Thread lith
 Is it fine to have a choice of plugin managers, or is this causing a
 headache (for users and/or for plugin writers).  If yes, then we should
 pick one plugin manager and retire the others.

I'm glad you picked this topic up.

I personally use simple shell scripts to keep the git repos up to date. I don't 
think having the plugin manager built-in is a necessity although it would make 
things easier for newcomers, I guess.

IMHO almost any choice is better than the current situation.

-- 
-- 
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: Automatic completion from word list

2014-03-17 Thread lith
 Is there any particular reason why
 https://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
 suggests installing as a Pathogen bundle

This page is linked from the github repo. The install instructions are meant 
for users who want to use the github repo. The repo is for people who want to 
use the version I use.

 https://github.com/tomtom/likelycomplete_vim/blob/master/doc/likelycomplete.txt
 only talks about vimballs (of which I see none under
 https://github.com/tomtom/likelycomplete_vim/) ?

The (rarely updated) vimball is on vim.org[1]. Install instructions in the help 
file are the same I use for vim.org.

I personally install vim plugins from their source code repo if one is 
available.

 This may be a trivial question to those in the know but I'm
 confused by the zoo of installation methods for Vim add-ons /
 plug-ins / scripts / whatever they're called. At this moment,
 freedom from choice is what I want. g

The problem here is that the vim ecosystem has significantly changed during 
the past years with the advent of, e.g., github and plugin managers that know 
how to deal with git repos and the like. Unfortunately, VIM doesn't have such a 
full-fledged plugin manager built-in what causes this confusion. (There is GLVS 
but that's from a different era when plugins were still distributed as zip 
files.)

Anyway, I admit this could be confusing. I'll revise my install instructions. 
Thanks for your feedback.

@all:
Does somebody know a comprehensive vim plugin installation guide that covers 
vimballs, zip files, addon managers etc.?


[1] http://www.vim.org/scripts/script.php?script_id=4889

-- 
-- 
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: Automatic completion from word list

2014-03-08 Thread lith
 E.G. I type atmcy then space or punctuation and
 automatically is inserted because that's the match for
 /^a.*t.*m.*c.*y/ in the word list.

I'm currently working on a plugin[1] that can be configured to fit your example 
to some extent:

let g:likelycomplete#select_imap = 'c-s-space'
let g:likelycomplete#use_fuzzy_matches = 1
let g:likelycomplete_filetypes = [your filetype]
let g:likelycomplete#other_sources = ['g:my_words']
let g:my_words = ['automatically']

This allows you to type

atmcy

On c-s-space users will be presented a list of possible completions, 
including automatically. (There is also an option to use c-xc-u but 
that's less useful for long lists.)

It's not the typical use case of that plugin though. :-)

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


Re: Neovim

2014-02-22 Thread lith
  Plugins are long-running programs/jobs (coprocesses)
 
 This is a terrible idea. Only a few plugins can get a benefit.

From what I gather, this should enable writing plugins in any 
language/interpreter, which is a good thing.

I just hope NeoVim keeps full compatibility with existing vim plugins.

-- 
-- 
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/groups/opt_out.


Re: Vim Weekly

2014-01-29 Thread lith
 On the contrary. vim-wikia was started specifically BECAUSE the original
 vim tips, hosted on vim.org, were seeing excessive amounts of spam, and
 it was too hard to deal with the spam.

Let's not forget (IIRC :): When the spam tips started, you could post tips 
without logging in which is sort of an invitation for spam. vim.org still 
doesn't use captchas to guard against bots registering as new users.

-- 
-- 
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/groups/opt_out.


Re: Link to vimweekly.... possible replacement for vimwikia

2014-01-28 Thread lith
 The goal here is very simple, - I will serve as the maintainer of the project 
 and will be responsible for all the edits. The tips on VimWeekly will heavily 
 based on community input, stackoverflow, books and the ultimate vim manual. 

I think it would be a good idea to collect the tips in a way that makes them 
accessible through vim help. There are scripts that convert vimwikia tip pages 
to vim help format. I think your newsletter should provide similar 
functionality -- e.g. by making them also accessible via github in plain text 
format that could later on be converted to vim help files.

I personally think a weekly newsletter is a good format to fight information 
overload and to distribute news/tips to the community.

Regards,
Tom

-- 
-- 
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/groups/opt_out.


Follow external command output

2014-01-14 Thread lith
If you don't use the output, you might want to use screen/tmux and a related 
vim plugin.

-- 
-- 
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/groups/opt_out.


improving Vim - Kickstarter - brainstorming - goals - who wants to join?

2013-11-26 Thread lith
There definitely always is some space for improvements. I'd nevertheless like 
to ask if you really think that more of the same is a significant improvement. 
Vim is a versatile editor the way it is. I still wish it would have emacs-like 
overlays and maybe js as scripting languagee, since I'm convinced js will gain 
more dominant in the years to come but it really doesn't matter that much.

Rather than a slightly improved version of vim, I'd like to see a free version 
of vim for eclipse that is able to run any vim plugin and fully integrates with 
eclipse (though eclim already is great) and/or a browser/web based version of 
vim that runs any vim plugin and that works with the local file system or files 
on some server.

Just my 2c :-)

-- 
-- 
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/groups/opt_out.


Re: Vim on an embedded system

2013-10-27 Thread lith
 Currently I am mainly editing Lua code. Unfortunately this
 seems to be damn slow...partly I am waiting for the characters
 to appear on the screen or that a movement of the cursor finally
 happens.

Do you have any plugins installed? I don't know the lua ftplugin but maybe (if 
there is any) it does things that cause this slow-down. I ran vim on a zaurus 
handheld for some time. Back then, such slow-downs were mostly caused by 
foldexpr, indentexpr, things that happen at CursorMoved(I) etc. Otherwise 
performance was acceptable.

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


Re: How plugin writers write help document?

2013-09-02 Thread lith
 But some of them don't have Vim style document.
 I am wondering is there any support tool for write vim document.
 Or is there any good practice while writing Vim style document.

It's not necessarily good practice but I wrote a ruby script[1] that takes a 
template file (which usually contains some sort of Getting started section) 
and a file list and then extracts comments from a plugin's vim source files and 
creates a help file for you. IMHO it's easier to keep the help file up to date 
this way.

[1]
https://github.com/tomtom/vimtlib/blob/master/ruby/vimdedoc.rb

-- 
-- 
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/groups/opt_out.


Re: Plans for Vim 7.4

2013-05-09 Thread lith
 I'd like to see the breakindent patch included.

Yes, please!

-- 
-- 
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/groups/opt_out.




Re: Passing optional arguments from function to function.

2013-02-14 Thread lith
 function! Echo (...)
 
   echo printf(...)
 
 endfunction

Check :h a:000 and :h call(). You could then use:

echo call(printf, a:000)

HTH

-- 
-- 
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/groups/opt_out.




Re: Gurus - does/can Vim have a functionality resembling Info?

2013-02-14 Thread lith
 the functionality of the info utility to enable easy navigation

You could use one of vim's personal wikis: vimwiki or viki, or a plugin for 
markdown/rst (restructured text) that enables hyperlinks, or an outliner 
plugin, or an orgmode clone, or plain text + utl plugin, or plain text + vim's 
own gf shortcut (see :h gf).

Some of the plugins mentioned above can be used in conjunction with the voom 
plugin in order to facilitates navigation.

There are also some plugins that generate tables of contents like, e.g., ttoc 
-- no need to write the toc (aka top node) yourself.

HTH

-- 
-- 
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/groups/opt_out.




Re: Script to send selected text from Vim to R in Ubuntu

2013-02-05 Thread lith
 a script that takes a selection in Vim and sends it to R

You should probably run R via screen/tmux and then use a vim plugin for 
screen/tmux to send the code to R. You could either use a generic plugin or, 
e.g., rcom[1] (which can use screen.vim or its own functions) for that purpose.

Since your question is specifically about R, you might also want to check the 
vim-R-plugin[2], which provides a more complete, more sophisticated, but also 
more complex solution for your problem.

HTH


[1] https://github.com/tomtom/rcom_vim
[2] http://www.vim.org/scripts/script.php?script_id=2628

-- 
-- 
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/groups/opt_out.




Re: StartUp of Gvim is too slow

2013-01-07 Thread lith
 So, now, i would like to call a function that is in one plugin.
 Is it possible to load only one plugin and without _vimrc ? 
 let's you choose which plugins to activate easily.

Alternatively, you could use the tplugin script 
(http://www.vim.org/scripts/script.php?script_id=2917), which will define proxy 
commands  catch calls to undefined functions (similar to the AsNeeded plugin) 
in order to enable plugins only when they are needed. You have to run the 
:TPluginScan command first in order to enable tplugin. You can still use VAM or 
a similar plugin manager to download  update your plugins.

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


Re: vim: is there any task/time management plugin available and which one is the best?

2012-12-23 Thread lith
Am Freitag, 21. Dezember 2012 23:31:47 UTC+1 schrieb ping:
 I've been
   doing it manually for long time and feel it not scalable...
 
 external tools are one option, any good
   choice in vim?

I personally use (but I also created it ;-) vikitaks[1], which is based on the 
viki[2] plugin. See here for a mini-demo: 
http://vimsomnia.blogspot.co.at/search/label/vikitasks

The task lists are defined in viki syntax, which looks like this:

#A 2012-12-20 :call @family Say hello
#A 2012-12-21 End of the world
#B 2012-12-22 Plan B

Partial support for todo.txt syntax is also implemented.

The vikitasks commands then collects these tasks lists and displays a unified 
task list that can filtered by keywords etc.

It can be configured to display (over)due tasks when starting vim. Other than 
that it doesn't support reminders, though.

HTH


[1] http://www.vim.org/scripts/script.php?script_id=2894
[2] http://www.vim.org/scripts/script.php?script_id=861

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


Re: special keymap depending on language

2012-11-27 Thread lith
 So my question is rather simple: can I load this file only when editing
 in French? 

I once created the linglang plugin to handle mixed-language texts 
(http://www.vim.org/scripts/script.php?script_id=2292) but haven't used it much 
since. You'd have to create a file with words that are likely to occur in 
French text.

For French, I think it would be sufficient to search for vowels with accents to 
determine whether it's English or German. There is no way to decide on the 
language of an empty buffer though. :-)

I made good experiences with determining a text's language using compression 
algorithms (i.e. zip). It's rather easy to implement and relies on different 
compression factors of text written in different languages. I can point you to 
an implementation in ruby if you're interested.

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


Re: Tmux-style window resizing in vim?

2012-11-09 Thread lith
 But tinykeymap doesn't work out of the box.
 Just installed it from the vim.org site

Thanks for the error report. The script relied on mapleader to be set. It 
should work now.

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


Re: Tmux-style window resizing in vim?

2012-10-27 Thread lith
 Other niceties from tmux are that you can press C-bj to carry on
 resizing, whereas in vim you'd have to use

You can use plugins like tinymode or tinykeymap (and some others) to create 
such maps.

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


Re: Enforcing coding standards using vim

2012-10-20 Thread lith
 Is there a way to enforce certain coding standards for C or C++ code,
 beyond indentation (for which I found google.vim). Stuff like:

If there is a (external) style checker available that fits your needs, you 
could use it as compiler (or via plugins like syntastic or checksyntax) to 
identify lines that don't meet your requirements.

Alternatively, you could define a after/syntax/c/style.vim file and define 
syntax groups that match  highlight frequent mistakes. But I don't think 
that's a good idea in your case though.

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


Re: Listing/finder plugins like command-t, ctrlp, fuzzyfinder

2012-08-20 Thread lith
 What I want is to get a list of plugins which makes sense to support in my 
 aurum plugin for OpenAny mappings: mappings that bring you a prompt listing 
 files present in given revision that can be then opened. Three of them 
 mentioned in the title are already supported.

tlib (http://www.vim.org/scripts/script.php?script_id=1863) provides a 
tlib#input#List() function that is used in several plugins of mine (see 
https://github.com/tomtom) and a few others. Here is an example for how to 
configure it:
https://github.com/tomtom/tselectbuffer_vim/blob/master/autoload/tselectbuffer.vim

You might also be interested in this vimtips page:
http://vim.wikia.com/wiki/Script:List_of_scripts_that_provide_advanced_UI_elements

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


Re: vim: what the current best practice to work with excel file (xlsx)?

2012-06-08 Thread lith
 csv (comma delimited)                 some of my data contains
 comma

If your method of changing the field separator doesn't work, as a last resort 
you could also change the locale (some use ; as field separator). Or, the 
proper solution, you could enclose the field in quotes (you'd probably have to 
research the proper escaping rules).

It's odd that OO or LibreOffice cannot open the file. Can you import the file 
into google docs?

Regards,
Tom

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


Re: How do you use vim on android device?

2012-05-15 Thread lith
 So, is there a widely used standard vim for android?

There is also Vim Touch. Not all that useful in its present condition but a 
project to keep an eye on.

https://play.google.com/store/apps/details?id=net.momodalo.app.vimtouch

Regards,
Tom

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


Re: where can I download vimtips.txt

2012-05-08 Thread lith
Am Sonntag, 6. Mai 2012 11:02:05 UTC+2 schrieb 鹏 左:
 I added a plugin called totd.vim which will show me a tip a day when launch 
 vim, but I don't know where to download vimtips.txt. I went to Vim Tips Wiki 
 but still can't find where to download it, any one knows. Many thanks!

I wrote a small ruby script that converts a wikia xml dump, which can be 
downloaded from http://wikistats.wikia.com/v/vi/vim/pages_current.xml.gz, to 
vim help format: https://github.com/tomtom/vimtips2help.rb

Maybe that's of some help for you.

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


Re: Plugin manager with dependencies and selective bundle load

2012-04-26 Thread lith
Hi,

 I love how fast vim loads using tplugin and how it changes the runtime path 
 on demand.
 But then I also found some limitations. Seems thare is no way to tell the 
 tool not to load some plugins, also the dependency system looks a little but 
 clunky because it is based on files rather than bundles.

I'm not sure what you mean by not loading plugins. Since version 0.14, you 
can define shallow root directories. Plugins in such a directory can be 
loaded by means of the :TPlugin command but shouldn't be automatically loaded 
if you call one if its commands or functions etc.

Dependency handling can admittedly be improved. tplugin knows three ways of 
handling dependencies:

(1) Don't handle dependencies and load plugins as needed (this won't work if a 
plugin tests if another plugin was already loaded by checking the existence of 
a variable)

(2) Check if a plugins checks for the existence of loaded_PLUGIN_NAME (this 
requires that the plugin authors adhered to the formatting rules which they 
probably didn't :-)

(3) Use the info in *-addon-info.txt files if the plugin provides one.

If the above fails, you can define a file _tplugin_PLUGIN_NAME.vim to define 
dependencies like:
call TPluginDependencies('THIS_PLUGIN', ['OTHER_PLUGIN'])

I guess you could put this definitions also into vimrc.

HTH
Tom

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


Re: Vim complete/suggest - sort by most used

2012-02-23 Thread lith
Am Donnerstag, 23. Februar 2012 15:29:19 UTC+1 schrieb MarcWeber:

 This would require Vim keeping history about which ones you used most in
 the past = that would be complex.

It would seem feasible if there were a CompletionDone event. Such an event 
would be useful in other situations -- e.g. code skeleton expansion. 
Unfortunately, vim doesn't provide such an event, though I vaguely remember 
that somebody wrote a patch for that.

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


Re: How to debug when vim becomes quite slow?

2012-02-19 Thread lith
Am Samstag, 18. Februar 2012 15:15:00 UTC+1 schrieb kindle4ever:

 When i open a file with 4000line code, the response of vim becomes quit 
 slow. At the mean time i input a word, vim costs 40% cpu. After switching 
 to another vimrc, it works fine again.


Does this happen only with specific filetypes? In my experience, a badly 
programmed foldexpr function can slow down things considerably if it causes 
vim to frequently rescan the whole file.

Regards,
Tom

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


Re: set a mark in an arbitrary file

2012-01-30 Thread lith
Am Montag, 30. Januar 2012 10:39:06 UTC+1 schrieb Samuel Ferencik:

 I keep losing my (uppercase) marks, and would like to set them up in 
 my .vimrc. I'd do this using setpos(), but that requires a buffer 
 number. I want to call something like setpos('A, ['filename.c', 1, 
 1, 0]). 


I guess you could add the buffer to the arguments list. A buffer will then 
be created but not loaded.

argadd filename.c
call setpos('A, [bufnr('filename.c'), 1, 1, 0])

HTH
Tom

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


Re: tracking text

2012-01-27 Thread lith


  Basically i am trying to track all the new text 
  i'm adding to a file. 

 Great! By the way, I searched the vim.org scripts for signs and came 
 up with a few plugins that might already do what you're looking for


In case the files are under a vcs (git, svn, hg), I'd like to add 
quickfixsigns (http://www.vim.org/scripts/script.php?script_id=2584) to the 
list.

The OP could also be interested in the SaveSigns plugin (
http://www.vim.org/scripts/script.php?script_id=2992) that lets users save 
signs.

Regards,
Tom

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


balloneval: balloonexpr over empty lines

2012-01-19 Thread lith
Hi,

I noticed that bexpr doesn't seem to get called when the mouse pointer 
hovers over an empty line. This can be easily be tested with:

vimrc:
set nocp
set beval
set bexpr=MyBalloonExpr()
function! MyBalloonExpr()
return 'Cursor is at line ' . v:beval_lnum .
\', column ' . v:beval_col .
\ ' of file ' .  bufname(v:beval_bufnr) .
\ ' on word ' . v:beval_text . ''
endf

$ gvim -u vimrc

Is there a way to change this behaviour and to make vim display balloons 
over empty lines?

Regards,
Tom

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


Re: balloneval: balloonexpr over empty lines

2012-01-19 Thread lith
Hi,

Am Donnerstag, 19. Januar 2012 17:54:29 UTC+1 schrieb Sergey Khorev:

 Out of curiosity, what would you do show for empty lines?


The quickfixsigns plugin uses balloons to display additional information 
about a sign when the mouse pointer hovers over a sign. This is especially 
useful, e.g., when displaying git diff information. Unfortunately this 
doesn't work when the line is empty -- e.g. when you replaced text with an 
empty line.

Would it be possible to change the test to (len == 0  no_sign_at_line)?

Regards,
Tom

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


Re: Can vim create table like this?

2012-01-09 Thread lith
Am Dienstag, 10. Januar 2012 06:03:02 UTC+1 schrieb Karthick:

  You can do calculations. Neither the wiki nor the code of table.zip
  contained the word sum. Didn't read the docs though.

 But it is possible to script it in vim. I would do it little
 differently than what was shown in video...

While it's possible in vim to add up visually selected numbers, I think 
you'd have a hard time implementing field functions as shown in the video. 
I bet they used overlays (
http://www.gnu.org/savannah-checkouts/gnu/emacs/manual/html_node/elisp/Overlays.html)
 
to implement these field functions. Unfortunately, vim doesn't have such a 
feature (yet?).

Regards,
Tom

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


Re: What abbreviates filenames in tab labels?

2011-12-22 Thread lith
Am Donnerstag, 22. Dezember 2011 02:47:35 UTC+1 schrieb Rich Healey:

 Which puts /t/p/t/f/file_a  /t/p/t/f/file_b  /t/p/t/f/file_c in the tab 
 bar.

 I want to implement something similar for fugitive, so I'm looking for the 
 behaviour that controls this to implement it similarly.


Are you looking for pathshorten()?

Regards,
Tom

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


Re: vim vs. ebooks

2011-12-19 Thread lith
Hi,

Am Sonntag, 18. Dezember 2011 10:15:56 UTC+1 schrieb ds:

 has anybody seen any good and / or interesting workaround for reading 
 ebooks (HTML, EPUB, FB2, [RTF]) in vim?


You can convert the file at the FileReadCmd event to text (or to html and 
then to text) -- you should set the buffer to readonly and maybe 
buftype=nowrite/nofile? You should be aware though that most markup will be 
lost during conversion which is why I personally don't consider this such a 
good idea.

Regards,
Tom

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


Re: password generator

2011-12-17 Thread lith
Am Freitag, 16. Dezember 2011 14:35:50 UTC+1 schrieb Steve Hall:

 The best passwords include the most character possibilities. This

 But one can always use a random generator to replace the
 non-acceptable characters one by one, looping until you get one that
 fits.

Some more sophisticated password generators can generate passwords that are 
somewhat pronounceable and thus easier to remember. One could of course ask 
whether that is an advantage or not.

Regards,
Tom

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


Re: rating manipulations on www.vim.org have taken place

2011-11-29 Thread lith


 If throwing out old votes seems too drastic, maybe the votes
 could be displayed according to their age, with totals computed
 over the past 6 months, 1 year, or the entire history.

I didn't follow this thread to closely but IIRC some of those ratings could 
stem from clicks on search pages. For the period of time, GET was used (see 
another posting in this thread), some links in google results pointed to a 
link that would send a rating but not to the actual plugin page. A user 
most probably didn't even notice the difference -- I thus wouldn't 
necessarily assume abuse.

I wouldn't consider removing old ratings (or yearly cutting them down to 
50%) a problem. It would rather help to weed out outdated scripts.

Regards,
Tom

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


Re: Backporting script to vim 6.3 (need help)

2011-11-25 Thread lith


 So then I guess I won't be able to return mulitple arguments. I need
 to do some rewriting then... hmmm

In vim6 there are only two types available: string and numbers.

You can use strings to emulate arrays (there is a quite usable library for 
that but I forgot its name ... genutils maybe? ... not multvals it was). 
For dictionaries, you could use array whose values match specific patterns 
... somehow. :-)

An alternative approach is to pass around strings that define local 
variables when being executed. E.g.

function! Foo(a)
return let val1='foo. escape(a:a, ') .'|let val2 ='bar. 
escape(a:a, ') .'
endf

function! Bar(a)
exec Foo(a:a)
echo Bar a:a is val1 and val2
endf

call Bar(lala)

You might want to reconsider updating vim. :-)

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


Re: Link to part of the same file

2011-10-02 Thread lith
Am Freitag, 30. September 2011 19:04:24 UTC+2 schrieb Fernando Basso:

 What would be a good way (if possible at all) to have vim link, say, a 
 table of contents to each section?


A few thoughts:

You could also use tags, I guess, and the use taglist or a similar plugin.

There are a few plugins around (e.g. my own ttoc) that display an overview 
of a buffer's structure (e.g. lines that match a certain regexp like 
headings) and that let users quickly jump from section to section. Similar 
to the example in :h definition-search, you could also use the following 
command:

map F4 :ilist! /\\section/Barlet nr = input('Match: ')Barexe 
'ijump! ' . nr .' /\\section/'CR 

]], [[ let you jump between sections -- if the filetype plugin supports it.

HTH
Tom

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


Re: recolor the extra gray pixels around fullscreen gvim.

2011-09-13 Thread lith


 $ strace -e trace=file gvim +q | grep themes/ | sed 1q
 access(/home/bhaskell/.themes/Raleigh/gtk-2.0/gtkrc, F_OK) = -1 ENOENT 
 (No such file or directory)


I use a custom theme based on Ambiance theme. When I run the above command 
(with | since strace prints the output on stderr) I get

access(/home/tom/.themes/Ambiance/gtk-2.0/gtkrc, F_OK) = -1 ENOENT (No 
such file or directory)

When I put this file and put the above code snippet there, the background 
has changed but scroll bars and the like are displayed in gtk's default 
theme.

Any ideas what I am doing wrong? I run ubuntu 10.04, gnome 2.30.2, gvim 
7.3-280.

Regards,
Tom

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


Swank Protocol and Async Events

2011-09-07 Thread lith
hi,

i guess you could use python/ruby and fork a process that listens to a 
connection. since fork probably isn't supported on windows, in order to provide 
a cross-platform solution you might have to start an app (e.g. a second intance 
of vim) that knows how to send commands to vim via its server/client interface.

there is nothing missing in vim. but you have to take a slightly different 
approach than with emacs.

hth
tom

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


Aw: substitute function

2011-08-11 Thread lith


Am Donnerstag, 11. August 2011 07:24:39 UTC+2 schrieb Chen San:

 if i just input the command let i=0 | 
 g/src=/s//\='src='.g:imglist[i].''/g | let i=i+1 into the ex command 
 line, it just worked as i expected.


I assume that this line is interpreted by vim as

let i=0
g/src=/s//\='src='.g:imglist[i].''/g | let i=i+1

i.e. the let command is executed on every item.

The way you broke that line down, variable i will be incremented only after 
running :g over the buffer.

HTH
Tom

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


Aw: substitute function

2011-08-11 Thread lith


 The way you broke that line down, variable i will be incremented only after 
 running :g over the buffer.


This means it's up to the command if | is part of the argument or if it 
breaks a line into separate statements. This is confusing, since you have to 
check each commands documentation or run tests, but can also be quite 
useful. See also :help command-bar.

Regards,
Tom

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


Aw: Re: substitute function

2011-08-11 Thread lith


Am Donnerstag, 11. August 2011 10:17:19 UTC+2 schrieb Chen San:

 it's odd, i just join the next two lines together with | ,and it works, 
 thanks for your idea.


It isn't odd if you consider how vim parses these lines:

g/src=/s//\='src='.g:imglist[i].''/g
 let i+=1


is equivalent to:

fun! Foo()
  s//\='src='.g:imglist[i].''/g
endf

g/src=/call Foo()
let i+=1

while

g/src=/s//\='src='.g:imglist[i].''/g | let i+=1


is equivalent to

fun! Foo()
  s//\='src='.g:imglist[i].''/g
  let i+=1
endf

g/src=/call Foo()

HTH

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


Aw: Re: Aw: Re: vim function not first-class variable? how to create an alias for vim function ?

2011-07-07 Thread lith


Am Mittwoch, 6. Juli 2011 19:34:05 UTC+2 schrieb ZyX:

 There are anonymous functions (:h numbered-function):
 let s:F={}
 function s:F.func()
 echo Here
 endfunction
 . It is not possible to call anonymous function without a reference to it 
 and 
 you can't create the reference using function() call, so the above code 
 effectively restricts write/execute access to the script (unless you pass 
 s:F.func, s:F or s: somewhere).


Such anonymous dictionary functions a.k.a. numbered functions can be 
called by there name too. You can thus do the following:

let d = {}
function! d.Foo() dict
return 10
endf

echo d.Foo()
 = 10

echo d[Foo]
 = 93

echo call(93, [], d)
 = 10

These anonymous functions thus aren't really anonymous if you know the 
number.

Regards,
Tom

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


Aw: Re: vim function not first-class variable? how to create an alias for vim function ?

2011-07-06 Thread lith


Am Dienstag, 5. Juli 2011 10:41:23 UTC+2 schrieb MarcWeber:

 Excerpts from pansz's message of Tue Jul 05 10:24:05 +0200 2011:
  I want to do some coding like this:

 let F = function('Foobar')

 call call(F, [arg1, arg2], { optional self dict })

One caveat though, IIRC if F refers to a script local function, it cannot be 
called from outside of the script context.

This makes me wonder if there is a usecase, where the first argument to 
call() has to be a Funcref and cannot be a string (the name of a function).

Regards,
Tom

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


printing/:hardcopy vs long lines (tw=0)

2011-07-06 Thread lith
Hi,

Sometime I set tw=0 and use linebreak + breakat to have the lines softwrap 
at certain characters. Unfortunately, :hardcopy seems to ignore the value of 
linebreak + breakat.

Is there a way to make :hardcopy break long lines at the characters set in 
the breakat option?

Regards,
Tom

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


Aw: vim plugins www.vim.org - future

2011-07-01 Thread lith


 We could move all existing plugins on www.vim.org (which don't have any
 maintainers) to a github account - the way vim-scripts has done it.

Isn't this self-contradictory? A plugin with no maintainer will probably 
never be updated. Why maintain it in a DVCS then? If somebody wants to 
create a fork, he/she is free to maintain the fork on github/bitbucket/etc.

BTW I wouldn't make vim.org too dependent on github. Different people prefer 
different VCS or hosts. Maybe the plugin form could contain an URL field 
that is used to retrieve the README, wherever it is hosted. I'd display the 
README as plain text only.

I personally think tags would be a great step forward.

Regards,
Tom

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


Aw: Re: Conditionally generated templates

2011-06-27 Thread lith
Hi,
 


 Error detected while processing function tskeleton#Setup: 
 line   10: 
 Unknown skeleton: php.php 


Oops. The current version assumes that you also have 
http://www.vim.org/scripts/download_script.php?src_id=11545 installed (a set 
of standard templates). These files were originally distributed with 
tskeleton. I'll upload a new version of the plugin that doesn't assume those 
files are available.

I did manage to figure another error I was getting as I guess the file 
 has to be saved before I can use my TSkeletonBit 


It might have been a problem with an earlier version but it shouldn't be a 
problem any more. I'd appreciate if you could describe in detail (maybe in a 
personal mail or via the bug tracker 
https://github.com/tomtom/tskeleton_vim/issues) how you trigger that error. 
Thanks.

Regards,
Tom

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


Aw: Re: Conditionally generated templates

2011-06-27 Thread lith
Hi,

Sorry, I meant this file:
http://www.vim.org/scripts/download_script.php?src_id=7022

Regards,
Tom

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


Aw: Re: Conditionally generated templates

2011-06-24 Thread lith


 With mu-template, you'll need a template-file named 
 ~/.vim/after/template/php.vim that contains

For comparison, here is Luc's template converted to tskeleton:

tskel:before
let s:filename = expand('%:p')
let s:parts=split(s:filename,'/')
let s:class=matchstr(s:parts[-1], '.*\ze\.')
let s:base=join(s:parts[0:-2],'_')
/tskel:before
tskel:after
unlet s:filename s:parts s:class s:base 
/tskel:after
?php class +s:class:C+ extends +s:base:C+ {
++
}

If you save it as ~/.vim/skeletons/bits/php/class, this will create a 
class skeleton/snippet. If you want to fill all php files with the above 
skeleton, save it as ~/.vim/skeletons/templates/php/php #.php.

Regards,
Tom

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


Aw: Re: Aw: Re: Conditionally generated templates

2011-06-24 Thread lith
Hi,

Am Freitag, 24. Juni 2011 18:49:21 UTC+2 schrieb Luc Hermitte:

 With mu-template, I had to add a hook in order to load project-specific 
 settings (defined with plugins like local_vimrc)



Something similar would be necessary with tskeletons too in order to 
determine the project's source directory. I skipped it in the above example.

Out of curiosity, does tskeleton support template-file inclusions ?


You can include snippets if that's what you meant.

+bit:other_snippet+
 

 as they imply some complexity if we want to support things like a 
 switch-snippet that loads the case-snippet for every value from an 
 enumeration.


I haven't tried something like this before but you should be able to do:

+for(s:var in s:parts)+
+bit:other_snippet+
+endfor(s:var)+

where other_snippet is:

Part: +s:var+

 but that requires a lot of context pushespops

Every snippet is expanded in a scratch buffer of its own.

Regards,
Tom

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


Aw: Re: How to execute :s command without adding the search pattern to the search history?

2011-06-14 Thread lith


Am Dienstag, 14. Juni 2011 08:27:50 UTC+2 schrieb Ben Schmidt: 

 Can't you just use histdel() after :s or :/ to get the unwanted entry

 
That's what I do now. There is a problem with that approach though. When a 
function that executes :s + histdel(-1) calls a function that does the same, 
2 items are removed, which is wrong. A Wokula's approach tries to deal with 
that.

Regards,
Tom

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


Aw: Re: How to execute :s command without adding the search pattern to the search history?

2011-06-13 Thread lith


Am Montag, 13. Juni 2011 14:52:20 UTC+2 schrieb Charles Campbell:

 For :s, use substitute().


Please correct my if I'm wrong, but the use of substitute() would also 
require the use of getline(), :delete, insert() etc. Marks would get lost. 
Cursor positioning would have to be done by hand. Multi-line patterns would 
make it even worse. Or am I missing something?

Regards,
Tom

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


How to execute :s command without adding the search pattern to the search history?

2011-06-09 Thread lith
Hi,

Is there a way to execute the :s or :/ command from a script without adding 
any patterns to the search history. I.e. is there a command like 
:keephistory (similar to :keepjumps) or any other solution that let's me 
execute a command without changing the search history?

Regards,
Tom

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


Aw: Re: How to execute :s command without adding the search pattern to the search history?

2011-06-09 Thread lith
Hi,

Thanks. I didn't expect to find a function to solve this problem. Thanks.

Regards,
Tom

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


Re: Any non-programmer users of Vim here?

2011-04-09 Thread lith


 My preference, in my current state of ignorance, anyway, would be to never 
 insert hard line breaks. I do have to share most of my writing with people 
 who don't know anything but Word. So when ready for sharing I would import 
 into another application for formatting. Apple's TextEdit is perfectly 
 adequate most of the time. 


HTML actually is a great format for exchange documents. See here for some 
tools that could prove useful:
http://en.wikipedia.org/wiki/Lightweight_markup_language

Regards,
Tom

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


Re: Any non-programmer users of Vim here?

2011-04-08 Thread lith
Hi, 

 Well, guess I'm not so old after all. But still old.

Usually people are worried about vi(m) being old. :-) vi is 35 years old. 
(According to wikipedia it was first written 1976). And vim turned 20 this 
year it seems.

Regards,
Tom

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


Re: Any non-programmer users of Vim here?

2011-04-07 Thread lith
Hi,

On Thursday, April 7, 2011 10:15:37 PM UTC+2, Eric Weir wrote:

 Still, as I imagine many are, I'm a bit intimidated complexity of the 
 commands and the steep learning curve. So, I'm wondering if there are any 
 ordinary, nonprogrammer writers here who've gotten comfortable with Vim as a 
 writer's editor -- or is that just ridiculous to think of?


I think it's a matter of how much of your work you will be doing with vim. 
Learning the vi(m) style to work with plain text pays off if you do most of 
your text editing tasks in vim. If you still use word processors and other 
text editors a lot, I personally wouldn't consider vim a good choice.

There is also the question how you get text edited with vim into some format 
you can submit. vim isn't particularly good at editing text with no hard 
line breaks (tw=0), i.e. soft wrap. In order to get some text formatting 
into e.g. Word, most likely requires the use of some command line tool that 
converts the text to something Word can read. I'm not sure such tools are 
easy to use for somebody who has never written a single line of code.

Regards,
Tom

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


Re: detaching tabs

2009-09-30 Thread lith

 Yes. I was speaking about a functionality as is supported e.g. by Firefox.

What you call window would be a new instance of gvim. You could thus
start a new instance and then close the current buffer and use
remote_send() to open it in the other instance. E.g.,

! start gvim --server-name Foo
let fname = fnameescape(expand('%:p'))
bd!
call echo remote_send(Foo, :e . fname .\cr)

Or something like that.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Suggest a vim task for a college workshop

2009-08-24 Thread lith

 The second task has been, for the past 2 years, writing a small C
 program and compiling it from vim, using :!. I think we can do
 something a bit more exciting than that. Care to suggest something?

For students who already know the basic editing commands, the creation
of a tags file and how to make use of it comes to mind.

I'd also make sure they know how to search for vim plugins and
information on the vim wiki. The use of vim plugins would IMHO require
a basic understanding of the layout of the vimfiles directory. So one
task could be to install a plugin and to customize a certain option by
setting a variable in vimrc or in after/plugin/whatever.vim --
depending on what is appropriate.

--~--~-~--~~~---~--~~
You received this message from the vim_use maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---