Re: Opening files in new windows
On 05/18/2011 11:28 PM, Ven Tadipatri wrote: Ah, ok, so they are 'tabs'. But why should ctrl+w, gf open a new tab as opposed to a new window? And I can see that gt navigates through tabs, but is there a way I can navigate forward 3 tabs, like :b3 for buffers? The gt command accepts a count to go to a specific tab. So if you have 6 tabs, you can do '4gt' to go the tab 4. There is also the gT command to go to the previous tab. Jeroen -- website: http://budts.be/ - twitter: @teranex ___ Registered Linux User #482240 - GetFirefox.com - ubuntu.com -- 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 make shift, ctrl keys sticky
On Wed, 18 May 2011, sinbad wrote: On May 19, 8:57 am, sinbad wrote: On May 19, 7:15 am, Tim Chase wrote: On 05/18/2011 08:58 PM, sinbad wrote: to avoid this i've been thinking if i can make the shift and ctrl keys sticky it might help to reduce the pain Usually sticky-keys are an accessibility feature of your OS. Since Vim doesn't see the individual shift/ctrl keypress (but rather just sees the combined key-code, e.g. "control+R"), it doesn't have a way to detect these modifiers. With further info about your OS (and if Linux/BSD, what sort of desktop environment), it would be easier to guide you to an appropriate setting. -tim i am running on windows vista. but actually i use vim in linux environment. i telnet to the linux server using putty. that' where i work. it's sad to hear that vim can't listen to individual ctrl shift key hits. It's not sad. It's unnecessary. doesn't do anything in Vim, so Vim doesn't need to listen for pressed by itself. Windows Vista should have plenty of support for sticky keys. Just holding down for 8 or more seconds should bring up a prompt asking about accessibility options. If that doesn't work (usually because the prompt was disabled in the past), just google: Windows Vista sticky keys And you'll get a large list of instructions. The first suggests that pressing the Windows logo key and at the same time will bring up the "Ease of Access Center". There, you should be able to adjust keyboard settings, including "Sticky Keys". btw, i use vim inside a gnu screen session, if that matters. The above instructions (either just holding or the "Ease of Access Center") should work for any application at all under Windows. With the exception of games and applications that hide their keyboard shortcuts or menus until you hold , most programs (under most OS'es) don't listen for so-called "modifier keys" on their own. -- Best, Ben -- 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 make shift, ctrl keys sticky
On May 19, 8:57 am, sinbad wrote: > On May 19, 7:15 am, Tim Chase wrote: > > > On 05/18/2011 08:58 PM, sinbad wrote: > > > > to avoid this i've been thinking if i can make the shift and > > > ctrl keys sticky it might help to reduce the pain > > > Usually sticky-keys are an accessibility feature of your OS. > > Since Vim doesn't see the individual shift/ctrl keypress (but > > rather just sees the combined key-code, e.g. "control+R"), it > > doesn't have a way to detect these modifiers. > > > With further info about your OS (and if Linux/BSD, what sort of > > desktop environment), it would be easier to guide you to an > > appropriate setting. > > > -tim > > i am running on windows vista. but actually i use vim in linux > environment. > i telnet to the linux server using putty. that' where i work. > it's sad to hear that vim can't listen to individual ctrl shift key > hits. > > -sinbad btw, i use vim inside a gnu screen session, if that matters. -sinbad -- 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 make shift, ctrl keys sticky
On May 19, 7:15 am, Tim Chase wrote: > On 05/18/2011 08:58 PM, sinbad wrote: > > > to avoid this i've been thinking if i can make the shift and > > ctrl keys sticky it might help to reduce the pain > > Usually sticky-keys are an accessibility feature of your OS. > Since Vim doesn't see the individual shift/ctrl keypress (but > rather just sees the combined key-code, e.g. "control+R"), it > doesn't have a way to detect these modifiers. > > With further info about your OS (and if Linux/BSD, what sort of > desktop environment), it would be easier to guide you to an > appropriate setting. > > -tim i am running on windows vista. but actually i use vim in linux environment. i telnet to the linux server using putty. that' where i work. it's sad to hear that vim can't listen to individual ctrl shift key hits. -sinbad -- 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 make shift, ctrl keys sticky
On 05/18/2011 08:58 PM, sinbad wrote: to avoid this i've been thinking if i can make the shift and ctrl keys sticky it might help to reduce the pain Usually sticky-keys are an accessibility feature of your OS. Since Vim doesn't see the individual shift/ctrl keypress (but rather just sees the combined key-code, e.g. "control+R"), it doesn't have a way to detect these modifiers. With further info about your OS (and if Linux/BSD, what sort of desktop environment), it would be easier to guide you to an appropriate setting. -tim -- 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 make shift, ctrl keys sticky
hi, lately i have been facing lot of trouble to enter key combinations involving shifts, ctrls. this has something to do with my little finger. i use left hand's little finger to hold ctrl and shift keys, whenever i try to hold the shift/ctrl key and move the hand to reach other keys lot of stress is being put on that finger and it is giving me pain like hell. sometimes i have to hold my finger and press it hard for the pain to go away. i am so used to use that finger to enter shift/ctr keys, no matter how many times i tell myself not to use i end up using it without my knowledge. to avoid this i've been thinking if i can make the shift and ctrl keys sticky it might help to reduce the pain, by sticky i mean, if i want to enter single CAPS letter. instead of holding the shift key, i will just tap the shift key once and the next immediate character i type should consider as if i am holding the shift key. the same goes for ctrl key as well. i don't use alt very often, but any solution for this will apply to alt as well. Any thoughts would be appreciated. thanks sinbad -- 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
perl support upgrade overwrites my changes to templates
Dear Vim community: after I unzipped the newest perl support plugin, it overwrote stuff in ~/.vim/perl-support/templates is there an easy way to perserve local edits so next upgrade won't overwrite useful stuff.. I could do this manually and diff and merge but hopefully there is a better way. Thanks! Jim -- 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: Opening files in new windows
On 2011-05-18, Ven Tadipatri wrote: > So I'm in vim currently looking at a file that has another filename > and I want to be able to open that particular file in a new, I guess > 'buffer'. I tried ctrl+w then gf, but that opens it up into something > that looks like a tab. Correct. See :help CTRL-W_gf You probably wanted Ctrl-W f, which opens the file under the cursor in a split window. See :help CTRL-W_f > The only way I could figure out how to navigate to it is by > clicking on the tab at the top of the screen. First of all, I'm > quite confused between tabs, windows, buffers, and viewports. :help windows-intro > Normally when I have a file open, I can do :new or :sp and look at > another file and jump to it using ctrl+w, but the behavior for ctrl+w, > then gf seems to be different. Furthermore I can't seem to get to the > other 'tabs' using ctrl+w or :next or :bn. Is there some other command > for navigating these tabs or whatever they're called? :help tab-page >Could someone help clarify things? All I want to do is be able to > highlight the name of a file, and open it up in the > buffer/window/viewport/tab/whatever that I get when I do :new, so I > can navigate to it using ctrl+w. HTH, Gary -- 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: Opening files in new windows
On Wed, May 18, 2011 at 4:28 PM, Ven Tadipatri wrote: > Ah, ok, so they are 'tabs'. But why should ctrl+w, gf open a new tab > as opposed to a new window? And I can see that gt navigates through > tabs, but is there a way I can navigate forward 3 tabs, like :b3 for > buffers? I could yank the filename into a register, then do :sp and > paste it from the register, but it's a bit cumbersome. > I might not be much help -- and you very well may be more experienced in vim than I -- but for me dealing with files I use NERDTree. Also tried FuzzyFinder which is pretty nice too, but have ended up just using NT. Otherwise kind of a pain to be typing or copying the file paths all the time, at least from what I have found. > > Thanks, > Ven > > On Wed, May 18, 2011 at 5:18 PM, Ven Tadipatri > wrote: > > So I'm in vim currently looking at a file that has another filename > > and I want to be able to open that particular file in a new, I guess > > 'buffer'. I tried ctrl+w then gf, but that opens it up into something > > that looks like a tab. The only way I could figure out how to navigate > > to it is by clicking on the tab at the top of the screen. First of > > all, I'm quite confused between tabs, windows, buffers, and viewports. > > Normally when I have a file open, I can do :new or :sp and look at > > another file and jump to it using ctrl+w, but the behavior for ctrl+w, > > then gf seems to be different. Furthermore I can't seem to get to the > > other 'tabs' using ctrl+w or :next or :bn. Is there some other command > > for navigating these tabs or whatever they're called? > > Could someone help clarify things? All I want to do is be able to > > highlight the name of a file, and open it up in the > > buffer/window/viewport/tab/whatever that I get when I do :new, so I > > can navigate to it using ctrl+w. > > > > Thanks, > > Ven > > > > -- > 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 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: Character encoding in vim
* Ven Tadipatri [2011.05.18 16:30]: > It looks like the directional quotes aren't being rendered correctly > in my vim editor. They show up as ~@~Y and ~@~X. How do I change this > so they show up properly? This usually happens when 'encoding' or 'fileencoding' don't match the content of the file. What are they set to when you edit that file? > Also I set up a shortcut (Ctrl+L) to get rid of all the ^M file > endings, but it would be nice if they showed up correctly as well. ^M's show up only when the file is malformed (i.e. it contains both unix end-of-lines and DOS end-of-lines) so vim can't decide which format to choose for the file. If the file is homogenous with respect to line endings, then you won't see them. -- JR -- 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: Opening files in new windows
Ah, ok, so they are 'tabs'. But why should ctrl+w, gf open a new tab as opposed to a new window? And I can see that gt navigates through tabs, but is there a way I can navigate forward 3 tabs, like :b3 for buffers? I could yank the filename into a register, then do :sp and paste it from the register, but it's a bit cumbersome. Thanks, Ven On Wed, May 18, 2011 at 5:18 PM, Ven Tadipatri wrote: > So I'm in vim currently looking at a file that has another filename > and I want to be able to open that particular file in a new, I guess > 'buffer'. I tried ctrl+w then gf, but that opens it up into something > that looks like a tab. The only way I could figure out how to navigate > to it is by clicking on the tab at the top of the screen. First of > all, I'm quite confused between tabs, windows, buffers, and viewports. > Normally when I have a file open, I can do :new or :sp and look at > another file and jump to it using ctrl+w, but the behavior for ctrl+w, > then gf seems to be different. Furthermore I can't seem to get to the > other 'tabs' using ctrl+w or :next or :bn. Is there some other command > for navigating these tabs or whatever they're called? > Could someone help clarify things? All I want to do is be able to > highlight the name of a file, and open it up in the > buffer/window/viewport/tab/whatever that I get when I do :new, so I > can navigate to it using ctrl+w. > > Thanks, > Ven > -- 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: Opening files in new windows
On Wed, May 18, 2011 at 4:18 PM, Ven Tadipatri wrote: > So I'm in vim currently looking at a file that has another filename > and I want to be able to open that particular file in a new, I guess > 'buffer'. I tried ctrl+w then gf, but that opens it up into something > that looks like a tab. The only way I could figure out how to navigate > to it is by clicking on the tab at the top of the screen. First of > all, I'm quite confused between tabs, windows, buffers, and viewports. > Normally when I have a file open, I can do :new or :sp and look at > another file and jump to it using ctrl+w, but the behavior for ctrl+w, > then gf seems to be different. Furthermore I can't seem to get to the > other 'tabs' using ctrl+w or :next or :bn. Is there some other command > for navigating these tabs or whatever they're called? > Could someone help clarify things? All I want to do is be able to > highlight the name of a file, and open it up in the > buffer/window/viewport/tab/whatever that I get when I do :new, so I > can navigate to it using ctrl+w. > One simple way to open in a horizontal split would be :sp file_path_here > > Thanks, > Ven > > -- > 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 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
Opening files in new windows
So I'm in vim currently looking at a file that has another filename and I want to be able to open that particular file in a new, I guess 'buffer'. I tried ctrl+w then gf, but that opens it up into something that looks like a tab. The only way I could figure out how to navigate to it is by clicking on the tab at the top of the screen. First of all, I'm quite confused between tabs, windows, buffers, and viewports. Normally when I have a file open, I can do :new or :sp and look at another file and jump to it using ctrl+w, but the behavior for ctrl+w, then gf seems to be different. Furthermore I can't seem to get to the other 'tabs' using ctrl+w or :next or :bn. Is there some other command for navigating these tabs or whatever they're called? Could someone help clarify things? All I want to do is be able to highlight the name of a file, and open it up in the buffer/window/viewport/tab/whatever that I get when I do :new, so I can navigate to it using ctrl+w. Thanks, Ven -- 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: Vst plugin and latex
On Wed, May 18, 2011 at 8:10 AM, Jostein Berntsen wrote: > On 18.05.11,09:53, Charles Campbell wrote: > > Jostein Berntsen wrote: > > >I checked out the Vst plugin for vim that works with restructured text: > > > > > >http://www.vim.org/scripts/script.php?script_id=1334 > > > > > >This seems to convert text to html quite well. > > > > > >I also tested the conversion of files to latex, but that seems to > > >collapse indents and remove linebreaks for all text. Has anyone found a > > >solution for this? > > > > > May I suggest attempting to contact the author of that plugin? He > > may or may not monitor this list. > > Thanks, I will do that. I used to be a heavy user of VST, but I switched over to the real reStructuredText (http://docutils.sourceforge.net/) a few years ago. VST is essentially a hack. A clever hack, but fragile and unmaintained. I've successfully used docutils and the Sphinx wrapper ( http://sphinx.pocoo.org/) on Windows, Mac, and Linux. Sphinx is under active development. If all you're trying to do is generate good looking printed output, you don't even need to convert to LaTeX: rst2pdf ( http://code.google.com/p/rst2pdf/) will convert straight from reST to PDF. -- /George V. Reilly geo...@reilly.org Twitter: @georgevreilly http://www.georgevreilly.com/blog http://blogs.cozi.com/tech -- 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
Character encoding in vim
It looks like the directional quotes aren't being rendered correctly in my vim editor. They show up as ~@~Y and ~@~X. How do I change this so they show up properly? Also I set up a shortcut (Ctrl+L) to get rid of all the ^M file endings, but it would be nice if they showed up correctly as well. Thanks, Ven -- 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 GUI font inside function
Thanks everyone, pretty similar answers here http://stackoverflow.com/questions/6042326/vim-set-gui-font-inside-a-function with additional solution for Win32 On Wed, May 18, 2011 at 3:49 PM, Ben Schmidt wrote: >> e.g. :exe "set gfn=Monaco " . a:n > > That space needs escaping for :set. > > :exe "set gfn=Monaco\\ " . a:n > > or > > :exe 'set gfn=Monaco\ ' . a:n > > Which is one reason why, as both of us agree, I think, using :let is better. > > Ben. > > > > -- > 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 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: error file for quick fix
On 2011-05-18, cyboman wrote: > On May 17, 4:02 pm, Gary Johnson wrote: > > On 2011-05-17, cyboman wrote: > > > On May 11, 9:29 am, Ben Schmidt wrote: > > > > On 11/05/11 11:11 PM, cyboman wrote: > > > > > > > i have the following settings in my _vimrc for make > > > > > > > set makeef=error.err " the errorfile for :make and :grep > > > > > set makeprg=gmake.exe\ --win32 > > > > > set errorformat=%f\(%l\)\ :\ %m,%C\ \ %p^\,%C%p~,%A\"%f\"\\,%l%m\,%C%m > > > > > \,%Z > > > > > > > unfortunately i'm not able to find theerror.errfileafter > > > > > compilation. can someone help me out? where does vim storeerror.err > > > > >file? > > > > > > It is deleted. > > > > > > :help :make > > > > > > Step 8. > > > > > > Ben. > > > > > does anybody know of a way of saving thisfile, without telling > > > vim :saveas or :write. make mappings as follows > > > nmap :cd src:make all:cd ..:copen > > > nmap :cd src:make rebuild:cd ..:copen > > > nmap :cd src:make final:cd ..:copen > > > > > thefileis not saved after i close thequickfixlist window. it > > > would be nice to have the ability to save the output to afile > > > automatically and then overwrite it every time there is a recompile. > > > so i could read it later if needed. does anybody have any suggestions? > > > > You could change 'shellpipe', 'makeprg' or the program named by > > 'makeprg', depending on the facilities available from your OS, to > > save a copy of theerrorfilesomeplace. You can then load this > > copy any time using the :cfile command. > > > > Regards, > > Gary > i'm using WinXP. > > if have the following settings in my _vimrc > > set shellredir=>%s\ 2>&1 > nmap :cd src:make all:cd .. > nmap :cd src:make rebuild:cd .. > nmap :cd src:make final:cd .. > > and then do :copen, the file is saved and i can see it in my NerdTree > plugin. I'm not seeing that. I made those settings and typed . This appeared at the bottom of the screen: :!make all >C:\DOCUM~1\username\LOCALS~1\Temp\VIe2734.tmp 2>&1 (1 of 1): "making something" :cd .. Press ENTER or type command to continue I opened Windows Explorer and looked in that Temp directory. There was no VIe2734.tmp file there. I executed :copen. Still no VIe2734.tmp file. That's what I would expect given Ben's reply. I was using Vim 7.3.138 on Windows XP. Regards, Gary -- 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: error file for quick fix
On May 17, 4:02 pm, Gary Johnson wrote: > On 2011-05-17, cyboman wrote: > > On May 11, 9:29 am, Ben Schmidt wrote: > > > On 11/05/11 11:11 PM, cyboman wrote: > > > > > i have the following settings in my _vimrc for make > > > > > set makeef=error.err " the errorfile for :make and :grep > > > > set makeprg=gmake.exe\ --win32 > > > > set errorformat=%f\(%l\)\ :\ %m,%C\ \ %p^\,%C%p~,%A\"%f\"\\,%l%m\,%C%m > > > > \,%Z > > > > > unfortunately i'm not able to find theerror.errfileafter > > > > compilation. can someone help me out? where does vim storeerror.err > > > >file? > > > > It is deleted. > > > > :help :make > > > > Step 8. > > > > Ben. > > > does anybody know of a way of saving thisfile, without telling > > vim :saveas or :write. make mappings as follows > > nmap :cd src:make all:cd ..:copen > > nmap :cd src:make rebuild:cd ..:copen > > nmap :cd src:make final:cd ..:copen > > > thefileis not saved after i close thequickfixlist window. it > > would be nice to have the ability to save the output to afile > > automatically and then overwrite it every time there is a recompile. > > so i could read it later if needed. does anybody have any suggestions? > > You could change 'shellpipe', 'makeprg' or the program named by > 'makeprg', depending on the facilities available from your OS, to > save a copy of theerrorfilesomeplace. You can then load this > copy any time using the :cfile command. > > Regards, > Gary i'm using WinXP. if have the following settings in my _vimrc set shellredir=>%s\ 2>&1 nmap :cd src:make all:cd .. nmap :cd src:make rebuild:cd .. nmap :cd src:make final:cd .. and then do :copen, the file is saved and i can see it in my NerdTree plugin. if i have my settings as set shellredir=>%s\ 2>&1 nmap :cd src:make all:cd ..:copen nmap :cd src:make rebuild:cd ..:copen nmap :cd src:make final:cd ..:copen the window with QuickFix list opens and i can navigate through the errors. however the error file is not saved. does anybody know what is the issue? -- 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: Vst plugin and latex
On 18.05.11,09:53, Charles Campbell wrote: > Jostein Berntsen wrote: > >I checked out the Vst plugin for vim that works with restructured text: > > > >http://www.vim.org/scripts/script.php?script_id=1334 > > > >This seems to convert text to html quite well. > > > >I also tested the conversion of files to latex, but that seems to > >collapse indents and remove linebreaks for all text. Has anyone found a > >solution for this? > > > May I suggest attempting to contact the author of that plugin? He > may or may not monitor this list. Thanks, I will do that. Jostein -- 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: Vst plugin and latex
Jostein Berntsen wrote: I checked out the Vst plugin for vim that works with restructured text: http://www.vim.org/scripts/script.php?script_id=1334 This seems to convert text to html quite well. I also tested the conversion of files to latex, but that seems to collapse indents and remove linebreaks for all text. Has anyone found a solution for this? May I suggest attempting to contact the author of that plugin? He may or may not monitor this list. Furthermore, in order for him to address this issue, it'd be best to include an example along with precise instructions for how to obtain the misbehaviors you've noted. Also, try your example without your usual environment; ie. something like vim -u simple.vimrc somefile.txt <<>> where simple.vimrc is: set nocp filetype plugin indent on 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
Re: BufReadPost getfsize and scp
David wrote: On 17 Mai, 22:50, Charles Campbell wrote: Please try v5h of LargeFile.vim (available at http://mysite.verizon.net/astronaut/vim/index.html#LARGEFILE). I tried it and so far it does not do the job. In this autocommand: au BufReadPost * \ if&ch< 2&& line2byte(line("$"))>= g:LargeFile*1024*1024 \| if exists("b:LargeFile_mode")&& b:LargeFile_mode == 0|call LargeFile(1,expand(""))|endif \| echomsg "***note*** handling a large file" \| endif The if exists("b:LargeFile_mode") does not work for me. If I cut the whole second if it does. But it does not work even then if I open a file using tabedit scp://..., because&ch seems be 2. I think v24i will now implement automatic large file handling via scp/ftp. Please check my website again. 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
Re: set GUI font inside function
e.g. :exe "set gfn=Monaco " . a:n That space needs escaping for :set. :exe "set gfn=Monaco\\ " . a:n or :exe 'set gfn=Monaco\ ' . a:n Which is one reason why, as both of us agree, I think, using :let is better. Ben. -- 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 GUI font inside function
But when I'm using external monitor, I want my font to be bigger than 10. So I want to pass the font size as parameter. I've tried fun! DarkScheme(n) colorscheme molokai set gfn="Monaco ".a:n " and set gfn="Monaco\ ".a:n " and also set gfn=Monaco\ a:n call DarkIndentGuides() endf but it's not working. It ignores the font size in any of these examples. How do I do that? Thanks! Easiest is: let &gfn="Monaco ".a:n :help :let-option Ben. -- 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 GUI font inside function
On Wed, May 18, 2011 11:05 am, Vladimir Rybas wrote: > But when I'm using external monitor, I want my font to be bigger than 10. > So > I want to pass the font size as parameter. I've tried > > fun! DarkScheme(n) > colorscheme molokai > set gfn="Monaco ".a:n > " and set gfn="Monaco\ ".a:n > " and also set gfn=Monaco\ a:n > call DarkIndentGuides() > endf > > but it's not working. It ignores the font size in any of these examples. > How > do I do that? Thanks! the set can't handle expressions. You want to evaluate an expression and use the result as an ex command. Therefore, use the :exe command, e.g. :exe "set gfn=Monaco " . a:n or alternatively use :let &gfn="Monaco " . a:n regards, Christian -- 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: 'commandline' vs ':e' for jump to line (FEAT. REQ)
On 18/05/11 9:27 PM, Tim Chase wrote: On 05/18/2011 03:32 AM, Ben Schmidt wrote: Here's a simple solution for .vimrc that might work: command! -nargs=1 -bang Edit call FileAndLine("e","",) command! -nargs=1 -bang Split call FileAndLine("sp","",) function! FileAndLine(cmd,bang,arg) let file=matchstr(a:arg,'.\{-}\ze:') let line=matchstr(a:arg,':\zs\d\+') exec a:cmd.a:bang." +".line." ".fnameescape(file) endfunction Then :Edit abc.vim:12 will turn into :e +12 abc.vim and :Split the same, but into :sp not :e. Passes on a ! too. Not tested much, and may have nasty edge cases, but should be a good start. Edge-cases that stick out to me involve non-digit text after the colon such as "C:\path\to\file.txt", "resident_evil:afterlife.mov" or "rockets:321blastoff.swf" This could be remedied by tightening the regexps: let file=matchstr(a:arg,'^.*\ze:\d\+$') let line=matchstr(a:arg,'^.*:\zs\d\+') Indeed. I was, perhaps foolishly, thinking about an entire error message, so avoiding matching too much with greedy matches, e.g. something like foo.c:25: error: whatever But it's probably the user's responsibility to copy/paste a bit more accurately than that. Still...if I had to use copy/paste at all, rather than Vim's quickfix, if I could, I'd probably just be lazy and triple click or something to grab a whole line and slam it in! And it seems unliekly to me that gcc would find an error in "resident_evil:afterlife.mov" or "rockets:321blastoff.swf". :-) And there are failure conditions if the filename doesn't contain a colon, so you might put in a check something like if file=='' let file=a:arg endif if line=='' let line=1 endif before issuing the :exec call. Thanks for the second pair of eyes! Those are definitely good checks. Ben. -- 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: 'commandline' vs ':e' for jump to line (FEAT. REQ)
On 05/18/2011 03:32 AM, Ben Schmidt wrote: Here's a simple solution for .vimrc that might work: command! -nargs=1 -bang Edit call FileAndLine("e","",) command! -nargs=1 -bang Split call FileAndLine("sp","",) function! FileAndLine(cmd,bang,arg) let file=matchstr(a:arg,'.\{-}\ze:') let line=matchstr(a:arg,':\zs\d\+') exec a:cmd.a:bang." +".line." ".fnameescape(file) endfunction Then :Edit abc.vim:12 will turn into :e +12 abc.vim and :Split the same, but into :sp not :e. Passes on a ! too. Not tested much, and may have nasty edge cases, but should be a good start. Edge-cases that stick out to me involve non-digit text after the colon such as "C:\path\to\file.txt", "resident_evil:afterlife.mov" or "rockets:321blastoff.swf" This could be remedied by tightening the regexps: let file=matchstr(a:arg,'^.*\ze:\d\+$') let line=matchstr(a:arg,'^.*:\zs\d\+') And there are failure conditions if the filename doesn't contain a colon, so you might put in a check something like if file=='' let file=a:arg endif if line=='' let line=1 endif before issuing the :exec call. -tim -- 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
Vst plugin and latex
I checked out the Vst plugin for vim that works with restructured text: http://www.vim.org/scripts/script.php?script_id=1334 This seems to convert text to html quite well. I also tested the conversion of files to latex, but that seems to collapse indents and remove linebreaks for all text. Has anyone found a solution for this? Jostein -- 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
set GUI font inside function
Hi everyone, I'm not sure that's right way to do this, but here's the thing. I want to switch my Vim between dark scheme and light scheme. However, the `colorscheme` is not the only thing that should be switched. I want to switch the font, and indent guides color as well. So I've came up with this function: fun! DarkScheme() colorscheme molokai set gfn=Monaco\ 10 call DarkIndentGuides() endf But when I'm using external monitor, I want my font to be bigger than 10. So I want to pass the font size as parameter. I've tried fun! DarkScheme(n) colorscheme molokai set gfn="Monaco ".a:n " and set gfn="Monaco\ ".a:n " and also set gfn=Monaco\ a:n call DarkIndentGuides() endf but it's not working. It ignores the font size in any of these examples. How do I do that? Thanks! -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
Re: 'commandline' vs ':e' for jump to line (FEAT. REQ)
Ben's function works. I will checkout Karthick proposal too. Quickfix is not what I want because I want to use :e main.c:3 in other cases (except compile) too. But these you mentioned about autocomand seems pretty nice. I will check them out. Thanks to all of you On May 18, 11:34 am, Karthick Gururaj wrote: > On Wed, May 18, 2011 at 1:08 PM, crabsody wrote: > > Hi Christian! > > > No this is probably not what I want. But quickfix is a great feature I > > didn't know about. Thank you very much. I will check it out when I > > have the time to recompile vim with quickfix option. > > Well, quickfix seems to be exactly what you need.. you can do a > :make > and then have all the compile errors in a quickfix window. Clicking on > an error will take you to the corresponding file/line. > > > Now hat I want is to be able instead of issuing :e +3 main.c to > > issue :myfunction main.c:3 Is there any solution to this? Maybe I > > should do a script which will substitue main.c:3 with +3 main.c. Is > > this easy to do? I don't know how... > > If you use a autocommand for a file that matches *:[0123456789]* along > with functions for scanning entries from the given filename ( > or "%"), you will be able to do: > :e main.c:22 > and open main.c with cursor on line 22. > > See, > :help :au > :help scanf -- 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: 'commandline' vs ':e' for jump to line (FEAT. REQ)
On Wed, May 18, 2011 at 1:08 PM, crabsody wrote: > Hi Christian! > > No this is probably not what I want. But quickfix is a great feature I > didn't know about. Thank you very much. I will check it out when I > have the time to recompile vim with quickfix option. Well, quickfix seems to be exactly what you need.. you can do a :make and then have all the compile errors in a quickfix window. Clicking on an error will take you to the corresponding file/line. > Now hat I want is to be able instead of issuing :e +3 main.c to > issue :myfunction main.c:3 Is there any solution to this? Maybe I > should do a script which will substitue main.c:3 with +3 main.c. Is > this easy to do? I don't know how... If you use a autocommand for a file that matches *:[0123456789]* along with functions for scanning entries from the given filename ( or "%"), you will be able to do: :e main.c:22 and open main.c with cursor on line 22. See, :help :au :help scanf -- 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: 'commandline' vs ':e' for jump to line (FEAT. REQ)
On 18/05/11 5:38 PM, crabsody wrote: Hi Christian! No this is probably not what I want. But quickfix is a great feature I didn't know about. Thank you very much. I will check it out when I have the time to recompile vim with quickfix option. Now hat I want is to be able instead of issuing :e +3 main.c to issue :myfunction main.c:3 Is there any solution to this? Maybe I should do a script which will substitue main.c:3 with +3 main.c. Is this easy to do? I don't know how... Here's a simple solution for .vimrc that might work: command! -nargs=1 -bang Edit call FileAndLine("e","",) command! -nargs=1 -bang Split call FileAndLine("sp","",) function! FileAndLine(cmd,bang,arg) let file=matchstr(a:arg,'.\{-}\ze:') let line=matchstr(a:arg,':\zs\d\+') exec a:cmd.a:bang." +".line." ".fnameescape(file) endfunction Then :Edit abc.vim:12 will turn into :e +12 abc.vim and :Split the same, but into :sp not :e. Passes on a ! too. Not tested much, and may have nasty edge cases, but should be a good start. Ben. -- 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: 'commandline' vs ':e' for jump to line (FEAT. REQ)
Hi Christian! No this is probably not what I want. But quickfix is a great feature I didn't know about. Thank you very much. I will check it out when I have the time to recompile vim with quickfix option. Now hat I want is to be able instead of issuing :e +3 main.c to issue :myfunction main.c:3 Is there any solution to this? Maybe I should do a script which will substitue main.c:3 with +3 main.c. Is this easy to do? I don't know how... On May 17, 9:43 pm, Christian Brabandt wrote: > Hi crabsody! > > On Di, 17 Mai 2011, crabsody wrote: > > > gcc issues warnings as this main.c:22 > > So I got this in my mouse clipboard ready to paste it. So I need :e > > main.c:22 to work or sth similar. For example :myfunction main.c:22. Can > > someone help? > > I am not sure I understand your question. But I think, you are looking > for the quickfix feature. See the help at > :h quickfix > :h 30.1 > > That should get you started. > > regards, > Christian -- 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