> Hi,
>
> Try using 'set guifont=Consolas:h11' instead and also move the statement to
> the end of _vimrc file.
>
> Ricardo Silva
>
>
>
>
>
>
>
> On Thu, Aug 18, 2011 at 2:57 PM, cyboman <rail.shafigu...@gmail.com> wrote:
> > i decided to change default font and included the following command
> > into my _vimrc file
>
> > set guifont=Consolas:h11:cANSI
>
> > but the strange thing is that Vim doesn't seem to care. i closed it
> > and then reopened but for some reason the font is not set to what i
> > told it to be. i even rebooted my machine and tried to reopen Vim
> > again. the result is still the same, Vim doesn't want to the font. it
> > is still the default one. does anybody know what might be the problem?
>
> > any help is appreciated
>
> > --
> > 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, visithttp://www.vim.org/maillist.php
i found out what the problem was and before i explain what happened i
would like to apologize to everyone because i forgot to give you all
the information (as i found out later)
i'm using a variation of vim called exVim. it is simply gVim/Vim with
a lot of plugins prepackaged. it has its own _vimrc_ex file which i
source. i took a look at it and found code which changes the font.
this code is triggered upon an event GUIEnter, which would explain why
my font setting wouldn't work (event would occur after my setting and
hence the font would be changed). if you are interested the code is
below.
thanks everyone for your help. again i apologize for not providing you
with all the information.
if has("gui_running")
" check and determine the gui font after GUIEnter.
" NOTE: getfontname function only works after GUIEnter.
au GUIEnter * call s:SetGuiFont()
endif
" set guifont
function s:SetGuiFont()
if has("gui_gtk2")
set guifont=Luxi\ Mono\ 10
elseif has("x11")
" Also for GTK 1
set guifont=*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-
*
elseif has("mac")
if getfontname( "Bitstream_Vera_Sans_Mono" ) != ""
set guifont=Bitstream\ Vera\ Sans\ Mono:h13
elseif getfontname( "DejaVu\ Sans\ Mono" ) != ""
set guifont=DejaVu\ Sans\ Mono:h13
endif
elseif has("gui_win32")
let font_name = ""
if getfontname( "Bitstream_Vera_Sans_Mono" ) != ""
set guifont=Bitstream_Vera_Sans_Mono:h10:cANSI
let font_name = "Bitstream_Vera_Sans_Mono"
elseif getfontname( "Consolas" ) != ""
set guifont=Consolas:h11:cANSI " this is the default
visual studio font
let font_name = "Consolas"
else
set guifont=Lucida_Console:h10:cANSI
let font_name = "Lucida_Console"
endif
silent exec "nnoremap <unique> <M-F1> :set
guifont=".font_name.":h11:cANSI<CR>"
endif
endfunction
--
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
No comments:
Post a Comment