Re: Folding
On 2011-06-03, Eric Weir wrote: On Jun 2, 2011, at 10:36 AM, Gary Johnson wrote: I don't like all that clutter in the fold line, either, but I do like to see the number of lines in the fold, so I modified the appearance of the fold line with this in my ~/.vimrc. set foldtext=MyFoldText() MyFoldText() ... You could do something similar to get the appearance you want. I wrote it before the repeat() function was available, so it could probably be rewritten with five fewer lines today. Thanks, Gary. As I mentioned in my original post on this thread, I'm not a programmer. I think I understand what this does, but from your description, not the code. As I understand it eliminates all text except the number of lines. I want to eliminate the number of lines and keep the text from the first line of the fold. And I have absolutely no idea how to go about revising the code to make it do what I want. The example at the top of :help fold-foldtext does that. (The line beginning :set foldtext=v:folddashes...) Try that and see if it does what you want. 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: Folding
On Jun 4, 2011, at 3:27 AM, Gary Johnson wrote: On 2011-06-03, Eric Weir wrote: I want to eliminate the number of lines and keep the text from the first line of the fold. And I have absolutely no idea how to go about revising the code to make it do what I want. The example at the top of :help fold-foldtext does that. (The line beginning :set foldtext=v:folddashes...) Try that and see if it does what you want. Thanks, Gary. Comes close. I still get a report of the number of lines in the fold. I just plunked the line as is from the help screen into my .vimrc, but I can't read it, and don't see how to modify it to get rid of the number of lines report. Is there a way to do that? -- Eric Weir Decatur, GA USA eew...@bellsouth.net -- 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: non-interactive vimdiff to stdout
Reply to message «Re: non-interactive vimdiff to stdout», sent 18:14:22 04 June 2011, Saturday by ZyX: Signs are also implemented now, including icons. Original message: Reply to message «Re: non-interactive vimdiff to stdout», sent 09:13:30 03 June 2011, Friday by ZyX: If you are interested, input hack is now implemented in frawor-port branch: http://formatvim.hg.sourceforge.net/hgweb/formatvim/formatvim/file/frawor- port. Lots of examples are in *.ok files in directory «test/» (you should see those that have -r1, -n1 or -oN where N=1). Live examples have urls like http://formatvim.sourceforge.net/concealed.tex_C0-D0-F0-L0-c0-l_q_q-n0-r1.h tml (created using zmv -C '(*).ok' 'outs/${${${${${1//_/__}//\%/_}//$/_d}//!/_b}///_g}.html' scp outs/*.html \ zyxsf,format...@frs.sourceforge.net:/home/groups/f/fo/formatvim/htdocs : here following replacement are done: _ - __, % - _, $ - _d, ! - _b, - _g). It is not guaranteed that live examples were created using latest revision. Original message: Reply to message «Re: non-interactive vimdiff to stdout», sent 06:22:11 06 April 2011, Wednesday by Benjamin Fritz: Certainly this would be ideal, but the diff filler (for example) is already copyable when ideally it should not be either. I don't know if we can do this in all case. For example do you make 'listchars' stuff copy as the actual character or as the substituted text? I'd rather do a element with a background and 100% width though. They are now copied as displayed. It is in TODO list. I hadn't thought of the effect of wrapping. The update I mention that is coming soon turns on wrapping in the pre sections. I'll need to be careful! Sorry, I briefly forgot the actual property used. I'm just applying a white-space: pre-wrap rule to the pre block containing the code is all. Nothing fancy and really useful for the text files with long lines I sometimes work with. It wraps between the line numbers and 'showbreak' doesn't apply but it is a lot better than the results from g:html_no_pre. I actually got a patch including this from someone on #vim but wasn't sure I wanted to include that portion at first. If you implement that input hack it would not wrap between the line numbers. TOhtml uses the fileencoding of the buffer it is converting to store the generated HTML, if set and if it can find an appropriate IANA-approved name to use for it. Otherwise it uses encoding, or failing that defaults to UTF-8. The problem I ran into is as follows: 1. In my .vimrc, I have setglobal fileencoding=latin1 because most of the files I work are code which needs to be in this encoding 2. I have encoding=utf-8 to allow fancy Unicode characters in various options and in plugins 3. I recently started using the CCTree plugin ( http://www.vim.org/scripts/script.php?script_id=2368 ) which uses CScope to give you a nice call tree of your C code. I wanted to convert this to HTML to share with someone. 4. CCTree uses a new buffer with buftype=nofile, but does not bother setting the fileencoding. Probably because with buftype=nofile, the buffer is never intended to be written, so as long as 'encoding' can represent the characters used, it does not matter at all. 5. Because CCTree does not set fenc, it defaults to the global value: latin1. Therefore TOhtml tried to create an HTML file encoded as ISO-8859-1. 6. The special Unicode characters in the CCTree cannot be converted to latin1. I had to either regenerate with an override or edit the ...charset=... line and save in the correct encoding. I saw this problem specifically on CCTree, but I imagine that many other plugins act in the same way, since their buffers are never intended to be written. So I am simply adding a check that buftype is either blank or 'help', and if not, skipping the 'fileencoding' and starting with 'encoding' for the HTML document. I wonder why you use non-utf8 encodings at all: if one wants different encoding it is not too difficult to add a meta (which is ignored unless host does not send any encoding in HTTP headers) and do `w ++enc='. Original message: On Tue, Apr 5, 2011 at 1:08 PM, ZyX zyx@gmail.com wrote: I see. TOhtml does not use an element to span the whole line. Perhaps it should for this case. The alternative would be to pad with spaces I guess, to the maximum line length similar to what you say you do for diff lines, below. If you will pad lines with spaces you will have to do something to make them uncopyable. Certainly this would be ideal, but the diff filler (for example) is already copyable when ideally it should not be either. I don't know if we can do this in all case. For example do you make 'listchars' stuff copy as the actual character or as the substituted text? I'd rather do a
Trying to escape tab in exe
If I type in the following ex command: :e /home/tim/prj/cgi/baker/xmlimport/controllers/ and then press TAB, I get a wildmenu for the target directory. Yay! But I can't get this same function to work programmatically. I have the following two functions: function! EdDir(dir) execute 'e ' . a:dir . '/\Tab' endfunction function! EdControllers() execute 'call EdDir(' . g:ControllerFolder . ')' endfunction where g:ControllerFolder is '/home/tim/prj/cgi/baker/xmlimport/controllers' If I execute : call EdControllers()cr vim opens a new file /home/tim/prj/cgi/baker/xmlimport/controllers/Tab grrr! So how do I escape the Tab? I've tried :h execute, and don't find any help there. thanks using vim 7.2 Huge version with GTK2-GNOME GUI -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.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: Trying to escape tab in exe
On 05/06/11 00:30, Tim Johnson wrote: If I type in the following ex command: :e /home/tim/prj/cgi/baker/xmlimport/controllers/ and then press TAB, I get a wildmenu for the target directory. Yay! But I can't get this same function to work programmatically. I have the following two functions: function! EdDir(dir) execute 'e ' . a:dir . '/\Tab' endfunction function! EdControllers() execute 'call EdDir(' . g:ControllerFolder . ')' endfunction where g:ControllerFolder is '/home/tim/prj/cgi/baker/xmlimport/controllers' If I execute : call EdControllers()cr vim opens a new file /home/tim/prj/cgi/baker/xmlimport/controllers/Tab grrr! So how do I escape the Tab? I've tried :h execute, and don't find any help there. thanks using vim 7.2 Huge version with GTK2-GNOME GUI IIRC, the relevant setting is 'wildcharm' (q.v.). HTH, Tony. -- hundred-and-one symptoms of being an internet addict: 103. When you find yourself in the Computer section of Barnes Noble enjoying yourself. -- 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: Trying to escape tab in exe
On Saturday, June 04, 2011 19:00:39 Tony Mechelynck wrote: On 05/06/11 00:30, Tim Johnson wrote: If I type in the following ex command: :e /home/tim/prj/cgi/baker/xmlimport/controllers/ and then press TAB, I get a wildmenu for the target directory. Yay! But I can't get this same function to work programmatically. I have the following two functions: --- - function! EdDir(dir) execute 'e ' . a:dir . '/\Tab' endfunction --- - function! EdControllers() execute 'call EdDir(' . g:ControllerFolder . ')' endfunction --- - where g:ControllerFolder is '/home/tim/prj/cgi/baker/xmlimport/controllers' If I execute : call EdControllers()cr vim opens a new file /home/tim/prj/cgi/baker/xmlimport/controllers/Tab grrr! So how do I escape the Tab? I've tried :h execute, and don't find any help there. thanks using vim 7.2 Huge version with GTK2-GNOME GUI IIRC, the relevant setting is 'wildcharm' (q.v.). another way to approach it would be to call glob() with an asterisk in place of the Tab sc -- 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: Trying to escape tab in exe
* Tony Mechelynck antoine.mechely...@gmail.com [110604 16:09]: vim opens a new file /home/tim/prj/cgi/baker/xmlimport/controllers/Tab grrr! So how do I escape the Tab? I've tried IIRC, the relevant setting is 'wildcharm' (q.v.). Thank you for the reply Tony. I did the following: set wildcharm=Tab in the same file as the code I have included. sourced the file again, but I still have the problem. My brain has still not grokked this problem. I've even tried (from the example in the helpfile): set wildcharm=C-Z with code changes to execute 'e ' a:dir . '/\C-Z' or execute 'e ' a:dir . '/C-Z' and blush I get a file name C-Z. Not what I want - obviously. thanks again -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.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: Trying to escape tab in exe
* sc tooth...@swbell.net [110604 16:24]: using vim 7.2 Huge version with GTK2-GNOME GUI IIRC, the relevant setting is 'wildcharm' (q.v.). another way to approach it would be to call glob() with an asterisk in place of the Tab sc Thanks sc, but could you illustrate with an example: `glob' is new to me, so I am in meantime looking at help and doing some experimenting. cheers -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.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: Trying to escape tab in exe
On 05/06/11 02:26, Tim Johnson wrote: * Tony Mechelynckantoine.mechely...@gmail.com [110604 16:09]: vim opens a new file /home/tim/prj/cgi/baker/xmlimport/controllers/Tab grrr! So how do I escape the Tab? I've tried IIRC, the relevant setting is 'wildcharm' (q.v.). Thank you for the reply Tony. I did the following: set wildcharm=Tab in the same file as the code I have included. sourced the file again, but I still have the problem. My brain has still not grokked this problem. I've even tried (from the example in the helpfile): set wildcharm=C-Z with code changes to execute 'e ' a:dir . '/\C-Z' or execute 'e ' a:dir . '/C-Z' andblush I get a file nameC-Z. Not what I want - obviously. thanks again Ah, sorry, I missed that thing about escaping the tab. See :help expr-string :help literal-string Within single quotes, every character is taken literally, even a backslash, except that two single quotes mean one. You should have used double quotes with backslash-escaping, like this (referring to your original post): exec 'e' a:dir . /\t or execute 'e ' . a.dir . /\Tab HTH, Tony. -- THE LESSER-KNOWN PROGRAMMING LANGUAGES #13: SLOBOL SLOBOL is best known for the speed, or lack of it, of its compiler. Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to travel to Bolivia to pick the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE. -- 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: non-interactive vimdiff to stdout
On Jun 3, 9:14 am, ZyX zyx@gmail.com wrote: Reply to message «Re: non-interactive vimdiff to stdout», sent 09:13:30 03 June 2011, Friday by ZyX: If you are interested, input hack is now implemented in frawor-port branch:http://formatvim.hg.sourceforge.net/hgweb/formatvim/formatvim/file/fr Lots of examples are in *.ok files in directory «test/» (you should see those that have -r1, -n1 or -oN where N=1). Live examples have urls likehttp://formatvim.sourceforge.net/concealed.tex_C0-D0-F0-L0-c0-l_q_q-n... (created using zmv -C '(*).ok' 'outs/${${${${${1//_/__}//\%/_}//$/_d}//!/_b}///_g}.html' scp outs/*.html \ zyxsf,format...@frs.sourceforge.net:/home/groups/f/fo/formatvim/htdocs : here following replacement are done: _ - __, % - _, $ - _d, ! - _b, - _g). It is not guaranteed that live examples were created using latest revision. I've actually been playing around with some prototyping for this as well. What's the extra span for, with class=over? I could not figure out a purpose for it. I'm not 100% sure I'm going to implement this fully. The non-copyable area is easy to accomplish with the input with readonly attribute set. But the unselectable quality depends an IE-proprietary attribute (unselectable) or on experimental CSS3 properties which if I am not mistaken have been removed from the latest working draft. If someone can point to a recent CSS3 draft with the user-select property defined, I'd be happy to be proven wrong... I am thinking that I will probably implement the non-copyable bit, but I'm really not sure I can justify to myself the invalid markup required for the unselectable portion. Any thoughts? I would really like to have an unselectable, uncopyable region for the line numbers and fold column. By the way, I looked at the specific link you gave...how do you unfold the text? Or is this an example of one which cannot be unfolded? I know I read that your plugin supports this. I'm not sure if you care, but the text is still selectable in Opera, which doesn't seem to support the user-select property. -- 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: non-interactive vimdiff to stdout
On Jun 4, 3:40 pm, ZyX zyx@gmail.com wrote: Reply to message «Re: non-interactive vimdiff to stdout», sent 18:14:22 04 June 2011, Saturday by ZyX: Signs are also implemented now, including icons. Cool, do you have an example of that? I'd be interested to see, but it probably won't go into TOhtml any time in the near future unless specifically requested. -- 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: Trying to escape tab in exe
* Tony Mechelynck antoine.mechely...@gmail.com [110604 18:04]: Within single quotes, every character is taken literally, even a backslash, except that two single quotes mean one. Aha! You should have used double quotes with backslash-escaping, like this (referring to your original post): exec 'e' a:dir . /\t or execute 'e ' . a.dir . /\Tab :) Now we are getting somewhere. With your example above, I get the directory itself in a vim buffer window. Which is useful, but preferable, I want to see the wildmenu for the directory. As if I were to manually in ex type: e /home/http/run/baker/xmlimport/modelsTab thanks -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.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: Trying to escape tab in exe
exec 'e' a:dir . /\t or execute 'e ' . a.dir . /\Tab :) Now we are getting somewhere. With your example above, I get the directory itself in a vim buffer window. Which is useful, but preferable, I want to see the wildmenu for the directory. As if I were to manually in ex type: e /home/http/run/baker/xmlimport/modelsTab Try the feedkeys() function: :call feedkeys('e ' . a.dir . /\Tab) If you check out the help for feedkeys() you will see documentation about a second argument which you might like to include and experiment with to get the results you want reliably. I haven't tested it, so I may be completely wrong, but I think it might be what you want! 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: Trying to escape tab in exe
* Ben Schmidt mail_ben_schm...@yahoo.com.au [110604 19:05]: Try the feedkeys() function: :call feedkeys('e ' . a.dir . /\Tab) If you check out the help for feedkeys() you will see documentation about a second argument which you might like to include and experiment with to get the results you want reliably. I haven't tested it, so I may be completely wrong, but I think it might be what you want! Ben, I think you may be on to something here: executing call feedkeys('e ' . a:dir . /\Tab) puts /home/tim/prj/cgi/baker/xmlimport/models/^I into ex which is not what we want (it's interpeted as a search pattern), however `feedkeys' looks promising. It is late where I am at. I will pursue this further in the morning. Thanks everybody. -- Tim tim at johnsons-web dot com or akwebsoft dot com http://www.akwebsoft.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