philipx | 1 Oct 10:15 2011

Set gfn based on screen resolution

Is there a way to determine the screen resolution in gVim and act upon
that information, for example to set a different font size?

I seem to find myself working in two different modes: either on my
laptop or on a large screen. Maybe I'm getting old, or maybe the
distance to the screen is different between the two (I suspect I sit
closer to the laptop's screen), but I use Menlo:h11 on my laptop and
I'd like :h12 or even :h13 when I'm connected to the monitor.

Thank you!

--

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

Tony Mechelynck | 1 Oct 11:57 2011
Picon

Re: Set gfn based on screen resolution

On 01/10/11 10:15, philipx wrote:
> Is there a way to determine the screen resolution in gVim and act upon
> that information, for example to set a different font size?
>
> I seem to find myself working in two different modes: either on my
> laptop or on a large screen. Maybe I'm getting old, or maybe the
> distance to the screen is different between the two (I suspect I sit
> closer to the laptop's screen), but I use Menlo:h11 on my laptop and
> I'd like :h12 or even :h13 when I'm connected to the monitor.
>
> Thank you!
>

I don't think you can ask Vim for the pixel size of your screen, but you 
can do almost as good (after gvim startup, i.e. either in the gvimrc or 
in a GUIEnter autocommand):

1. Set some standard 'guifont'
2. :set lines=999 columns=9999
(gvim will now set its screen size to within one character cell of your 
monitor size, and adjust the option values accordingly)
3. Compare &lines and/or &columns with some reference values and 
increase the 'guifont' size if larger.

Note: There are several incompatible platform-dependent 'guifont' 
formats, and each gvim version recognizes only one of them. If someday 
you find yourself on Linux and try to set the 'guifont' you set on 
Windows, it may or may not give you an error but it will almost 
certainly not set the font you expected. See 
http://vim.wikia.com/wiki/Setting_the_font_in_the_GUI
(Continue reading)

Dennis Benzinger | 1 Oct 12:41 2011
Picon
Picon

Re: Set gfn based on screen resolution

Hi!

Am 01.10.2011 10:15, schrieb philipx:
> Is there a way to determine the screen resolution in gVim and act upon
> that information, for example to set a different font size?
> [...]

You could use system() to execute a program to query the resolution. For
example "xdpyinfo" or "xwininfo -root" if you are running under an X server.

HTH,
Dennis Benzinger

--

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

François Ingelrest | 1 Oct 15:34 2011
Picon

Netrw ErrorMsg is undefined

Hi all,

After updating my netrw plugin (v143), I now get this error the first
time I do :Explore in a Vim session:

Error detected while processing /home/ingelres/.vim/autoload/netrw.vim:
line  164:
E117: Unknown function: netrw#ErrorMsg

This did not happen with v141d, but I think this happened as well with
v142. Am I the only one getting this?

--

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

Charles E Campbell Jr | 1 Oct 17:43 2011

Re: Netrw ErrorMsg is undefined

François Ingelrest wrote:
> Hi all,
>
> After updating my netrw plugin (v143), I now get this error the first
> time I do :Explore in a Vim session:
>
> Error detected while processing /home/ingelres/.vim/autoload/netrw.vim:
> line  164:
> E117: Unknown function: netrw#ErrorMsg
>
> This did not happen with v141d, but I think this happened as well with
> v142. Am I the only one getting this?
>
>    
The latest version of netrw is v143, and netrw#ErrorMsg is at line#8056 
in autoload/netrw.vim.  I can't duplicate the problem; so please look 
into  :help netrw-debug  for a way to proceed.

Regards,
Chip Campbell

--

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

François Ingelrest | 1 Oct 19:22 2011
Picon

Re: Netrw ErrorMsg is undefined

On Sat, Oct 1, 2011 at 17:43, Charles E Campbell Jr wrote:
> The latest version of netrw is v143, and netrw#ErrorMsg is at line#8056 in
> autoload/netrw.vim.  I can't duplicate the problem; so please look into
>  :help netrw-debug  for a way to proceed.

After a bit of debugging, I found that this is caused by the following
line in my .vimrc:

let g:netrw_cursorline=1

If I comment this line, the error disappears.

--

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

porphyry5 | 1 Oct 17:13 2011
Picon

Re: replace e flag works in command but fails if that command in key mapping

Using vim 7.2 on slackware 13.1
OK, I've traced the problem with the error flag not being suppressed.  It is
caused because vim is still using an old version of .vimrc, not the current
version, i.e. it is using a version preceding my addition of the e flag to
those replace commands.

It does so because of another mapping in my .vimrc

" Type ;q to save all files and close out session
:map ;q :wa<CR>:mksession! ~/vim.ses<CR>:qa<CR>

According to :h mksession "When [!] is included an existing file is
overwritten."  But that is not happening, and there is no warning message. 
I closed out one of my open buffers, and ran that ;q command, then started
vim again.  And the buffer that I had specifically closed out was back in
the open buffers list.  When I separately rm vim.ses, and then run the ;q
command, it creates the vim.ses as expected.

So I decided to rm vim.ses in the mapping, changing it to

:map ;q :!rm ~/vim.ses<CR>:wa<CR>:mksession! ~/vim.ses<CR>:qa<CR>

but this caused a warning message to be displayed, requiring me to press
Enter to execute the rm, so I changed it again to

:map ;q :silent! rm ~/vim.ses<CR>:wa<CR>:mksession! ~/vim.ses<CR>:qa<CR>

which is certainly silent, but doesn't remove the file.

I seem to be going deeper and deeper into a morass with this seemingly
(Continue reading)

Ismail, Mohd F. | 2 Oct 02:09 2011
Picon

Vim 7.2 on CentOS 6 - set ruler has no effect

Hi,

I'm using CentOS 6, with vim 7.2.  For whatever reason, there is no row and column info at the bottom right corner.  I check the /etc/vimrc and set ruler is enabled.  What could be the problem?

--Farid

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

Tony Mechelynck | 2 Oct 03:19 2011
Picon

Re: Vim 7.2 on CentOS 6 - set ruler has no effect

On 02/10/11 02:09, Ismail, Mohd F. wrote:
> Hi,
>
> I'm using CentOS 6, with vim 7.2. For whatever reason, there is no row
> and column info at the bottom right corner. I check the /etc/vimrc and
> set ruler is enabled. What could be the problem?
>
> --Farid

What does Vim answer to ":echo has('cmdline_info')" (without the double 
quotes but with the single ones)? If it's 0 (zero), then the 'ruler' 
feature wasn't included at compile-time.

BTW, Vim 7.2 is obsolete now (though admittedly less than the Vim 5.x I 
saw someone use recently). The current version is 7.3.329. If you're 
interested, see
   http://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial
   http://users.skynet.be/antoine.mechelynck/vim/compunix.htm

Best regards,
Tony.
-- 
After a number of decimal places, nobody gives a damn.

--

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

Fernando Basso | 2 Oct 14:43 2011
Picon

Re: Link to part of the same file

On Sep 30, 2:17 pm, Tony Mechelynck <antoine.mechely... <at> gmail.com>
wrote:

> It depends on the filetype (tables of contents are written very
> differently in Vim helpfiles and in HTML, and they're implicit in
> Wikimedia source) so you would have to code an ad-hoc filetype-dependent
> function. Probably set it up in ~/.vim/after/ftplugin/≤filetype>.vim
> (replacing <filetype> by the filetype, and, on Windows only, .vim by
> vimfiles), possibly with the bulk of the function code in some autoload
> script.

I don't mean to write in vim and then convert it to html. I mean, to
have
links inside vim buffers it self, something like vim help files.

--

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