Re: vim7: problem with regex subst and combining chars
On Wed, May 17, 2006 at 08:34:22AM -0700, Ron Aaron wrote: Arrgh! I can't send this message to the list, for some reason! Maybe because it has strange characters in it? OK: you can download my test.zip from here: http://ronware.org/test.zip In it you will find a file 'test.txt' which is UTF8 and will tell you how to see the problem I am finding with using s/// with combining characters. I can confirm the problem (on Linux, GTK2, enc=utf-8, vim 7.0.000). Maybe I can get the offending characters to the list. The following should be a no-op: :s/.*/ but it is not on the following line of voweled Hebrew: הִלְכּוֹת I notice other problems. For example, $ (in Normal mode) takes me to the fifth character. (With 'ruler' set, I see 17-5 in the status line.) Maybe there is a null byte in the fifth or sixth multi-byte character? --Benji Fisher
Re: vim7: problem with regex subst and combining chars
I notice other problems. For example, $ (in Normal mode) takes me to the fifth character. (With 'ruler' set, I see 17-5 in the status line.) Maybe there is a null byte in the fifth or sixth multi-byte character? I think $ and ruler are working correctly; the other 'characters' are combining characters and you cannot navigate to them directly. But if you do 'ga' on the second character, you'll see it's composed of two characters (05dc and 05b0). Thanks for verifying the problem isn't just my builds :)
vim patch: fixing resetting dictionary function
In the following I am creating a dictionary, associating a function with the dictionary and then reassociating a new function with the name of the original function. Try this without the fix and you get: ADD n=9 Error detected while processing /home/emberson/vim/foo.vim: line 14: E475: Invalid argument: 1 ADD n=9 Note that 1 is the index of the function in the dictionary. Try it with the fix you get: ADD n=9 MULTIPLY n=20 script: let x = {} function x.foo(a,b) dict echo ADD return a:a + a:b endfunction let n = x.foo(4,5) echo n= . n function! x.foo(a,b) dict echo MULTIPLY return a:a * a:b endfunction let n = x.foo(4,5) echo n= . n patch for eval.c: 18410c18410,18420 while (arg[j] != NUL (j == 0 ? eval_isnamec1(arg[j]) --- /* The name can be an index into a dictionary. */ /* There maybe a better way, this demonstrates a fix. */ while (arg[j] != NUL VIM_ISDIGIT(arg[j])) ++j; if (arg[j] != NUL) { if (*arg == K_SPECIAL) j = 3; else j = 0; while (arg[j] != NUL (j == 0 ? eval_isnamec1(arg[j]) 18413,18414c18423,18425 if (arg[j] != NUL) emsg_funcname(_(e_invarg2), arg); --- if (arg[j] != NUL) emsg_funcname(_(e_invarg2), arg); } -- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
page scrolling
Hello, please, point me to the command, which allow to scroll page line by line, like in mc viewer (F3) with arrow keys Thank you -- regards, Hegai Ilya
Re: page scrolling
Hi, Ilya Hegai wrote: please, point me to the command, which allow to scroll page line by line, like in mc viewer (F3) with arrow keys :help CTRL-E :help CTRL-Y Regards, Jürgen -- Jürgen Krämer Softwareentwicklung HABEL GmbH Co. KGmailto:[EMAIL PROTECTED] Hinteres Öschle 2 Tel: +49 / 74 61 / 93 53 - 15 78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99
automatic gvim start and problems
hi all i work with gvim 6.3.71 using 3-4 windows at the same time; i save them all using the following script that is automatically executed upon start of kde 3.3 being saved in ~/.kde/Autostart # start.sh # session for polar_angle_* # /usr/bin/gvim -S ~/codes/polar_angle/Session_polar_abc.vim /usr/bin/gvim -S ~/codes/polar_angle/Session_polar_d.vim # when i re-login all files are opened in the correct way but if, say, i had 4 windows of gvim then i see the 4 windows and also other 4 windows of gvim with the welcome screen; the same happen with any other number of gvim windows and so on if anyone can help me on this thank you very much -- roberto OS: GNU/Linux, Debian Sarge -- roberto OS: GNU/Linux, Debian Sarge
I don't have $VIMRUNTIME after installation
I'm using ubuntu breezy 5.10 I have installed vim70. I don't have this environment variable. The user manual makes a lot of reference to it. Help me.
Re: I don't have $VIMRUNTIME after installation
Vim will not create environment varible, and it just maintains one inside itselft. lauch vim, and enter echo $VIMRUNTIME in Ex-mode to see. :echo $VIMRUNTIME On 5/18/06, victor NOAGBODJI [EMAIL PROTECTED] wrote: I'm using ubuntu breezy 5.10 I have installed vim70. I don't have this environment variable. The user manual makes a lot of reference to it. Help me. -- leal @ www.leal.cn
Re: Indentations - possible Vim7 bug
What's the value of your 'paste' option? On 5/18/06, Dan Clarke [EMAIL PROTECTED] wrote: Hi. I've just installed Vim 7. l use MS Windows. I've found a problems with the indentations. You can replicate it by doing the following ... - Copy a whole word into the clipboard. - In a C/C++ file, position the cursor on a line of text that is indented. - Press the 'o' key to go onto the next line in insert mode. - (The next line should automatically be indented to match the previous line). - Now press control-v to paste the word from the clipboard. In previous versions of Vim this pasted word would of appeared indented. In Vim7, for some reason the auto indentation seems to of been deleted. Thanks, - Dan
Re: automatic gvim start and problems
On 5/18/06, roberto [EMAIL PROTECTED] wrote: hi all i work with gvim 6.3.71 using 3-4 windows at the same time; i save them all using the following script that is automatically executed upon start of kde 3.3 being saved in ~/.kde/Autostart # start.sh # session for polar_angle_* # /usr/bin/gvim -S ~/codes/polar_angle/Session_polar_abc.vim /usr/bin/gvim -S ~/codes/polar_angle/Session_polar_d.vim # when i re-login all files are opened in the correct way but if, say, i had 4 windows of gvim then i see the 4 windows and also other 4 windows of gvim with the welcome screen; the same happen with any other number of gvim windows and so on if anyone can help me on this thank you very much You need to atttach examples you your real session files (Session_polar_abc.vim , Session_polar_d.vim) for this to be answerable. Yakov
Re: Indentations - possible Vim7 bug
The paste option isn't set. If I set it, auto indentation doesn't work at all, and when I press 'control-v', it just pastes a caret character instead of what's in the clipboard. - Dan Eric Arnold wrote: What's the value of your 'paste' option? On 5/18/06, Dan Clarke [EMAIL PROTECTED] wrote: Hi. I've just installed Vim 7. l use MS Windows. I've found a problems with the indentations. You can replicate it by doing the following ... - Copy a whole word into the clipboard. - In a C/C++ file, position the cursor on a line of text that is indented. - Press the 'o' key to go onto the next line in insert mode. - (The next line should automatically be indented to match the previous line). - Now press control-v to paste the word from the clipboard. In previous versions of Vim this pasted word would of appeared indented. In Vim7, for some reason the auto indentation seems to of been deleted. Thanks, - Dan
Re: CurorLine, set cursorline: slow, slower, slowest ?!
On 5/18/06, Meino Christian Cramer [EMAIL PROTECTED] wrote: Hi, VIM has a neat feature to highlight the line the cursor is in. This makes reading wide texts easier. Unfortunatley (at least with my system) moving the cursor become very slow. Is there a way out (a config trich for example) or any other thing to get a fast cursor in a highlighted line ? I am using: xterm-256color mrxvt linux 2.6.16-16 AMD X2 64 3800+ vim7.0.017 I just tried scrolling with cursorline it on a maximixed terminal (74 lines, 203 columns) and it's *not* slow for me. I tried xterm, Konsole, mrxvt, and urxvt. Yakov
Re: ctrl+shift key mappings
Thanks. Now I've got some good multi-bytes to multi-chew on :-) On 5/18/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: Eric Arnold wrote: Hey. Do you know any simple key sequence to test whether code I'm adding to Vim is handling mbytes correctly? Unfortunately, even if I got Japanese installed, I've forgotten the few Kanji I knew :-P if termencoding == let termencoding = encoding endif set encoding=utf-8 setglobal bomb enew then set Insert mode and start adding characters. See :help i_CTRL-V_digit :help ga :help g8 If you want a sample UTF-8 file with various multibyte characters in it, you may download my front page http://users.skynet.be/antoine.mechelynck/index.htm (browse to it with any browser then File - Save As or similar). Best regards, Tony. P.S. For that kind of questions, it is usually better to send them to the list (so everyone can reply) rather than privately to one person.
Re: automatic gvim start and problems
On 5/18/06, roberto [EMAIL PROTECTED] wrote: On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 5/18/06, roberto [EMAIL PROTECTED] wrote: # start.sh # session for polar_angle_* # /usr/bin/gvim -S ~/codes/polar_angle/Session_polar_abc.vim /usr/bin/gvim -S ~/codes/polar_angle/Session_polar_d.vim # when i re-login all files are opened in the correct way but if, say, i had 4 windows of gvim then i see the 4 windows and also other 4 windows of gvim with the welcome screen; the same happen with any other number of gvim windows and so on You need to atttach examples you your real session files (Session_polar_abc.vim , Session_polar_d.vim) for this to be answerable. here it is: i paste only one since it is extremely long... Opens two windows for me: (1) polar_bal.c and (2) polar_angle_d.c Is this good or bad ? Yakov
Re: Tables.
On Wed, May 17, 2006 at 07:50:08PM -0700, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh I already implemented that. See the VarTab() function in foo.vim (my file of example vim functions): http://www.vim.org/script.php?script_id=72 HTH --Benji Fisher
search next, prev while in /pattern editing
I am using incsearch. I wanted to define 2 mappings that act while I am in /search pattern editing mode, and that take me to next/prev match while leaving the cursor in /pattern commandline. Is it possible ? Yakov
Re: Tables.
On Wed, May 17, 2006 at 04:52:50PM -0400, cga2000 wrote: Does vim provide any form of native support for drawing tables? I have tried a couple of plugins and they don't seem to play well with my setup, presumably because I have temporarily switched my locale back from UTF-8 to en_US (due to problems with other applications that do are not yet utf8-ready). When in UTF-8 I was able to manually draw nice-looking tables to dress up text that I had previously formatted in rows and columns by using digraphs (Ctrl+K hh/vv etc..) and though there were some issues with printing I was all-in-all quite happy. The functionalities I had in mind would probably do something like this: 1. Assist text entry by letting you define tab stops, 2. Let you select a column of text and justify it, 3. Provide some means of inserting vertical lines at each tab stop, 4. Assist in creating horizontal lines by adding the ad hoc character where a vertical and a horizontal line intersect, 5. Reformat the table frame when box drawing characters are not available (replacing line intersections by '+' for instance). But then again I have little experience with vim and there is probably a vim way of doing this that I have not even imagined. So I am open to better strategies. You mention trying some plugins, but you did not say which ones, so I do not know if you have already tried these suggestions. For (1) see my other post on this thread. I think that Dr. C's Align plugin can do (2) and his DrawIt plugin can help with the rest. http://www.vim.org/scripts/script.php?script_id=294 http://www.vim.org/scripts/script.php?script_id=40 HTH --Benji Fisher
Re: Indentations - possible Vim7 bug [PATCH]
On Thu, May 18, 2006 at 10:20:38AM +, Dan Clarke wrote: Hi. I've just installed Vim 7. l use MS Windows. I've found a problems with the indentations. You can replicate it by doing the following ... - Copy a whole word into the clipboard. - In a C/C++ file, position the cursor on a line of text that is indented. - Press the 'o' key to go onto the next line in insert mode. - (The next line should automatically be indented to match the previous line). - Now press control-v to paste the word from the clipboard. In previous versions of Vim this pasted word would of appeared indented. In Vim7, for some reason the auto indentation seems to of been deleted. Thanks, - Dan The following patch to $VIMRUNTIME/autoload/patch.vim (simple enough to apply manually if you do not have a patch program) should fix this problem. 15c15 let paste#paste_cmd['i'] = 'Esc' . paste#paste_cmd['n'] . 'gi' --- let paste#paste_cmd['i'] = 'xBSEsc' . paste#paste_cmd['n'] . 'gi' HTH --Benji Fisher
clearing the command line
I''ve been chasing this for a while, so I might as well ask, even though it seems like a stupid question. What's the right way to clear the command line between echo blocks in a script, without causing a full screen redraw? Everything I try eventually fails when the command line has been scrolled/grown upwards by output longer than cmdheight. I can't see the exact rule, since some things like: echo :CR normal : etc., come close, but no cigar.
Re: clearing the command line
On 5/18/06, Eric Arnold [EMAIL PROTECTED] wrote: I''ve been chasing this for a while, so I might as well ask, even though it seems like a stupid question. What's the right way to clear the command line between echo blocks in a script, without causing a full screen redraw? Everything I try eventually fails when the command line has been scrolled/grown upwards by output longer than cmdheight. I can't see the exact rule, since some things like: echo :CR normal : etc., come close, but no cigar. When output was longer than cmdheight, if you look at the sceen contents and the statusline in this situation, you'll see it's shifted upward in a manner that never happens during editing, essentially screen is corrupted. That's why I think redraw is the only way out of this. Yakov
Vim7 - intellisense problem
In my workplace, our coding standard states that we have to declare our variables on the next line from the variable type. The intellisense in vim7 doesn't work when it's like this. For example ... typedef struct { int i; }my_structure; void main (void) { my_structure var1; my_structure var2; var1. this doesn't work var2. this does work } I guess we're not the only place that declares variables over multiple lines. Any way I can get around this? Would be really nice to get intellisense working for our projects. Cheers, - Dan
Re: search next, prev while in /pattern editing
On Thu, May 18, 2006 at 12:27:26PM +, Yakov Lerner wrote: I am using incsearch. I wanted to define 2 mappings that act while I am in /search pattern editing mode, and that take me to next/prev match while leaving the cursor in /pattern commandline. Is it possible ? Yakov If you only use / and not ? then :cmap C-N CR/Up :cmap C-P C-CN/Up should work. If you want it to work with both / and ?, you have to work a little harder. Try this: cmap C-N C-R=Next()CRPlugNext fun! Next() if getcmdtype() == / cmap PlugNext CR/up elseif getcmdtype() == ? cmap PlugNext CRNN?Up else cmap PlugNext Nop endif return endfun The other direction is left as an exercise. HTH --Benji Fisher
Re: clearing the command line
On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 5/18/06, Eric Arnold [EMAIL PROTECTED] wrote: I''ve been chasing this for a while, so I might as well ask, even though it seems like a stupid question. What's the right way to clear the command line between echo blocks in a script, without causing a full screen redraw? Everything I try eventually fails when the command line has been scrolled/grown upwards by output longer than cmdheight. I can't see the exact rule, since some things like: echo :CR normal : etc., come close, but no cigar. When output was longer than cmdheight, if you look at the sceen contents and the statusline in this situation, you'll see it's shifted upward in a manner that never happens during editing, essentially screen is corrupted. That's why I think redraw is the only way out of this. Yakov That's true in some, but not all cases, which is what gives me any hope. For example, let cmdheight = 1 exe normal :echo\cr let cmdheight = s:tmp_cmdheight works when the statusbar has been pushed up a small number of lines. It seems to know how to recover without a full redraw. If it gets pushed up even more, then it fails to clear. The command also doesn't reflect the pushed position of the statusline, so there's no way to put a case for it in the script that way.
Re: search next, prev while in /pattern editing
I think this does what you want. You only need to use /, though, since you can now go up and down while in / : cmap silent C-X c-cN:redrawCR/c-p cmap silent C-Z c-cn:redrawCR/c-p
Re: search next, prev while in /pattern editing
On 5/18/06, Eric Arnold [EMAIL PROTECTED] wrote: I think this does what you want. You only need to use /, though, since you can now go up and down while in / : cmap silent C-X c-cN:redrawCR/c-p cmap silent C-Z c-cn:redrawCR/c-p Rats. This works only if you set the @/ variable first by hitting return normally, which will highlight the pattern, then subsequence ^X or ^Y will move to the right pattern. Benji's simple example has the same problem if you start with c-p These come close, but the first time you use them, they do something slightly different than subsequent times. ^R go up *2* matches, and ^S just goes to what looks like the current match (i.e. it doesn't appear to move). It's all a problem of where the cursor actually is v.s. where the highlighting is for incsearch. cmap silent c-r crNN:redrawCR/c-p cmap silent c-s cr:redrawCR/c-p
RE: clearing the command line
-Original Message- From: Eric Arnold [mailto:[EMAIL PROTECTED] Sent: 18 May 2006 15:09 To: vim.org user list Subject: clearing the command line I''ve been chasing this for a while, so I might as well ask, even though it seems like a stupid question. What's the right way to clear the command line between echo blocks in a script, without causing a full screen redraw? Everything I try eventually fails when the command line has been scrolled/grown upwards by output longer than cmdheight. I can't see the exact rule, since some things like: echo :CR normal : etc., come close, but no cigar. Not sure if it helps, but try this: :map ,x :let a=10CR and execute it by ',x' (no apostrophies) and then see for comparison this: :map ,x :let a=10CR/BS execute and see the difference. Is it something you were looking for? ---Zdenek
Shell command history in VIM?
Hi, Is there a way to enable history view of all the shell command executed under vim, i.e. with :! shell_command Regards, Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you.
Re: Shell command history in VIM?
Op donderdag 18 mei 2006 16:38, schreef Wijaya Edward: Hi, Is there a way to enable history view of all the shell command executed under vim, i.e. with :! shell_command Well, as long as the info is known by vim (see :help viminfo), you could do: q: to open the command-line window and then: g/^!/p to print all the lines beginning with ! Regards, Peter Palm
Re: Shell command history in VIM?
On 5/18/06, Wijaya Edward [EMAIL PROTECTED] wrote: Is there a way to enable history view of all the shell command executed under vim, i.e. with :! shell_command In an indirect way, sort of, yes. You need to, first, pull all history lines (using either redir+:history, or using histget() function), and second, filter out lines not beginning with '!'. Finally, you'd add resulting lines into temp buffer for viewing. Is this what you are looking for ? Yakov
Vertical selection
Hi all, Is it possible to make a vertical selection in a text, to have a rectangular selection in the text ? If so, how ? thank you, best regads. Eddine
Re: page scrolling
^E and ^Y will move the visual window by one line. Comes in handy to adjust the screen to center a block of text. Also very handy are these keyboard sequences: z. put line-with-cursor in middle of screen zCR put line-with-cursor at top of screen z- put line-with-cursor at bottom of screen
Re: Vertical selection
Hi, Baha-Eddine MOKADEM wrote: Is it possible to make a vertical selection in a text, to have a rectangular selection in the text ? If so, how ? :help ctrl-v Regards, Jürgen -- Jürgen Krämer Softwareentwicklung HABEL GmbH Co. KGmailto:[EMAIL PROTECTED] Hinteres Öschle 2 Tel: +49 / 74 61 / 93 53 - 15 78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99
Re: automatic gvim start and problems
On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: Opens two windows for me: (1) polar_bal.c and (2) polar_angle_d.c Is this good or bad ? Yakov actually this is what happens: it opens one window splitted in two, with half of it showing (1) polar_bal.c and the other showing (2) polar_angle_d.c but then it also open another blank window with the usual welcome screen of gvim this is bad, the former is good, i mean i want only one window not two... -- roberto OS: GNU/Linux, Debian Sarge
Re: automatic gvim start and problems
On 5/18/06, roberto [EMAIL PROTECTED] wrote: On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: Opens two windows for me: (1) polar_bal.c and (2) polar_angle_d.c Is this good or bad ? Yakov actually this is what happens: it opens one window splitted in two, with half of it showing (1) polar_bal.c and the other showing (2) polar_angle_d.c but then it also open another blank window with the usual welcome screen of gvim this is bad, the former is good, i mean i want only one window not two... Yes it opens one GUI window split in two for me. Does not open 2nd blank window for me, no. Something is broken in your environment, roberto. 6.3 is old. Maybe it's time to install vim6.4 or vim7. Try to check on another machine in your neighborhood. Looks like something special on your machine. Yakov
Re: automatic gvim start and problems
roberto wrote: On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: Opens two windows for me: (1) polar_bal.c and (2) polar_angle_d.c Is this good or bad ? Yakov actually this is what happens: it opens one window splitted in two, with half of it showing (1) polar_bal.c and the other showing (2) polar_angle_d.c but then it also open another blank window with the usual welcome screen of gvim this is bad, the former is good, i mean i want only one window not two... Well, how do you invoke it? I woiuld expect that invoking Vim just once with a -S argument would have it open what is known in vimspeak as two windows, i.e., one window (as you name them) split in two. See :help -S Best regards, Tony.
Re: automatic gvim start and problems
On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 5/18/06, roberto [EMAIL PROTECTED] wrote: On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: Opens two windows for me: (1) polar_bal.c and (2) polar_angle_d.c Is this good or bad ? Yakov actually this is what happens: it opens one window splitted in two, with half of it showing (1) polar_bal.c and the other showing (2) polar_angle_d.c but then it also open another blank window with the usual welcome screen of gvim this is bad, the former is good, i mean i want only one window not two... Can you post a screenshot ? It's unusual what happens to you. Yakov
Re: search next, prev while in /pattern editing
On 5/18/06, Eric Arnold [EMAIL PROTECTED] wrote: On 5/18/06, Eric Arnold [EMAIL PROTECTED] wrote: I think this does what you want. You only need to use /, though, since you can now go up and down while in / : cmap silent C-X c-cN:redrawCR/c-p cmap silent C-Z c-cn:redrawCR/c-p Thanks to everybody who responded. Yakov
Re: CurorLine, set cursorline: slow, slower, slowest ?!
From: Yakov Lerner [EMAIL PROTECTED] Subject: Re: CurorLine, set cursorline: slow, slower, slowest ?! Date: Thu, 18 May 2006 11:56:52 + On 5/18/06, Meino Christian Cramer [EMAIL PROTECTED] wrote: Hi, VIM has a neat feature to highlight the line the cursor is in. This makes reading wide texts easier. Unfortunatley (at least with my system) moving the cursor become very slow. Is there a way out (a config trich for example) or any other thing to get a fast cursor in a highlighted line ? I am using: xterm-256color mrxvt linux 2.6.16-16 AMD X2 64 3800+ vim7.0.017 I just tried scrolling with cursorline it on a maximixed terminal (74 lines, 203 columns) and it's *not* slow for me. I tried xterm, Konsole, mrxvt, and urxvt. Yakov Hi Yakov, thank you for your reply. I forgot to mention that I am using vim, not gvim (!) and that in my colorscheme the following was set: hi Normal ctermbg=lightgray ctermfg=Black hi CursorLine ctermbg=White guibg=Grey90 What do you uses for your speedy vim ? :O) Keep hacking! mcc
Re: Vim7 - intellisense problem
On 5/18/06, Dan Clarke [EMAIL PROTECTED] wrote: In my workplace, our coding standard states that we have to declare our variables on the next line from the variable type. The intellisense in vim7 doesn't work when it's like this. Vim7 does not have Intellisense - Intellisense is a trademarked name. Vim7 has Omni Completion. Are you using the properly patched ctags? Can you verify it works on your system if you move the variables to the same line? The ccomplete script simply runs through the tags file. Have you generated a proper tag file, and can you jump around via these tags?
Re: Tables.
On Thu, 18 May 2006 at 8:23am, Benji Fisher wrote: On Wed, May 17, 2006 at 07:50:08PM -0700, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh I already implemented that. See the VarTab() function in foo.vim (my file of example vim functions): http://www.vim.org/script.php?script_id=72 HTH --Benji Fisher Oops... I searched for scripts and didn't find anything dealing with this kind of tabs, so got curious and went ahead and wrote a small plugin for this. I hope there is more to be offered in this, than your VarTab() function, especially that there is a GUI tabstop setter, and it maps Tab to insert the right number of spaces. I am attaching the plugin, and hope to get some feedback. You need genutils.vim also, and read the plugin header. -- HTH, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com softtabs.vim: Lookup filenames from tagfiles. Author: Hari Krishna (hari_vim at yahoo dot com) Last Change: 18-May-2006 @ 10:55 Created: 17-May-2006 Requires:Vim-7.0, genutils.vim(1.19) Version: 1.0.1 Licence: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License. See http://www.gnu.org/copyleft/gpl.txt Download From: http://www.vim.org//script.php?script_id= Usage: - Use STEdit to bring up an editor for setting soft-tab stops (or to just view them). You would see two lines, one with numbers to guide you, and another to show the current tab stops. Use space bar or click with left mouse button to toggle tabstops. You can of course use any editor command to mark tabstops by replacing the space with a v (or even save/compose your tabstop lines somewhere and replace the whole line here). To save changes at the end, use :wq command (or just :w, to leave the window open). - Use STTgl to toggle using tabstops. TODO: - More testing. - A command to reset tab stops. - A command to add a tabstop at the current cursor position. - Do more with tabstops (investigate). if exists('loaded_softtabs') finish endif if v:version 700 echomsg 'softtabs: You need at least Vim 7.0' finish endif if !exists('loaded_genutils') runtime plugin/genutils.vim endif if !exists('loaded_genutils') || loaded_genutils 119 echomsg 'softtabs: You need a newer version of genutils.vim plugin' finish endif let g:loaded_softtabs = 1 Make sure line-continuations won't cause any problem. This will be restored at the end let s:save_cpo = cpo set cpovim if !exists('s:myBufNum') let s:myBufNum = -1 let s:windowName = '[Soft Tabs]' let s:tabstops = range(9, 80, 8) endif if (! exists(no_plugin_maps) || ! no_plugin_maps) \ (! exists(no_softtabs_maps) || ! no_softtabs_maps) noremap script silent PlugSoftTabs :STEditCR inoremap script expr PlugSoftTabStop SIDFillToNextTab() if !hasmapto('PlugSoftTabs', 'n') nmap unique silent F6 PlugSoftTabs endif endif command! STEdit :call SIDSetupSoftTabs() command! STTgl :call SIDToggleSoftTabStop() function! s:ToggleSoftTabStop() if maparg('Tab', 'i') == 'PlugSoftTabStop' iunmap Tab else imap Tab PlugSoftTabStop endif endfunction function! s:SetupSoftTabs() call s:SetupBuffer() call OptClearBuffer() call append(0, repeat(join(range(1,8), ''), 10)) call append(1, repeat(' ', 80)) silent! 3d _ The blank line. 2 for tst in s:tabstops call s:ToggleMark(tst) endfor setl nomodified endfunction function! s:FillToNextTab() FIXME: Place holder return repeat(' ', 8) let curCol = col('.') Search for next column for col in s:tabstops if curCol col return repeat(' ', (col - curCol)) endif endfor return \Tab endfunction function! s:UpdateTabStops() if bufnr('%') == s:myBufNum let tabstr = getline(2) if tabstr != '' let s:tabstops = [] Determine the tab stops. let tabl = split(tabstr, 'v', 1) let tabCnt = 0 for ea in tabl call add(s:tabstops, strlen(ea) + 1 + \ (tabCnt == 0 ? 0 : s:tabstops[tabCnt-1])) let tabCnt = tabCnt + 1 endfor endif endif setl nomodified endfunction function! s:AddTabStop(col) endfunction function!
Re: right-to-left text selection
On Wed, 17 May 2006 at 11:41pm, Jared wrote: On 5/17/2006 11:11 PM, Eric Arnold wrote: While the visual mode selection is active, hitting o moves to the opposite corner. SNIP Keep in mind that it doesn't work the same with a selection made by the mouse, since that leaves it in select mode not visual mode, which has some properties like insert mode, but in general has to be treated differently. Use ^G to switch visual/select modes. Ok, this was the problem. I was using select mode rather than visual mode, and it was behaving exactly as you described. If I select the text, then hit ^gol^c, I can finally select all text, including the last character. Yay! Not exactly the easiest key sequence, but at least I can make it work now. Thanks, Eric! -- Jared If this worksout for you, try creating a map, something like: vnoremap F12 C-GolC-C or even, C-C itself to be: vnoremap C-C C-GolC-C You might even be able to map the LeftRelease to do this automatically, not sure how you have selection mode setup, but if you give your settings, I can try to get a mapping work for you. -- HTH, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: search next, prev while in /pattern editing
On Thu, 18 May 2006 at 9:31am, Benji Fisher wrote: On Thu, May 18, 2006 at 12:27:26PM +, Yakov Lerner wrote: I am using incsearch. I wanted to define 2 mappings that act while I am in /search pattern editing mode, and that take me to next/prev match while leaving the cursor in /pattern commandline. Is it possible ? Yakov If you only use / and not ? then :cmap C-N CR/Up :cmap C-P C-CN/Up should work. If you want it to work with both / and ?, you have to work a little harder. Try this: cmap C-N C-R=Next()CRPlugNext fun! Next() if getcmdtype() == / cmap PlugNext CR/up elseif getcmdtype() == ? cmap PlugNext CRNN?Up else cmap PlugNext Nop endif return endfun The other direction is left as an exercise. HTH --Benji Fisher The problem with this approach is that you can't cancel out of the search prompt and expect to be back at the original cursor position. Also, C-N is now lost for other modes, though you can fix that problem using the new expr map (see below), but may I first suggest you try my chcmdmode.vim plugin? I have the ^S at search prompt to do just this, and I have a few more maps that could be useful for you too. Now, back to improving what Benji suggested: cmap expr C-N Next() fun! Next() if getcmdtype() == / return \CR/\up elseif getcmdtype() == ? return \CRNN?\Up else return \C-N endif endfun You see, there is no temporary mapping involved, and you still didn't loose C-N for other modes. -- HTH, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: clearing the command line
On Thu, 18 May 2006 at 7:33am, Eric Arnold wrote: On 5/18/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 5/18/06, Eric Arnold [EMAIL PROTECTED] wrote: I''ve been chasing this for a while, so I might as well ask, even though it seems like a stupid question. What's the right way to clear the command line between echo blocks in a script, without causing a full screen redraw? Everything I try eventually fails when the command line has been scrolled/grown upwards by output longer than cmdheight. I can't see the exact rule, since some things like: echo :CR normal : etc., come close, but no cigar. When output was longer than cmdheight, if you look at the sceen contents and the statusline in this situation, you'll see it's shifted upward in a manner that never happens during editing, essentially screen is corrupted. That's why I think redraw is the only way out of this. Yakov That's true in some, but not all cases, which is what gives me any hope. For example, let cmdheight = 1 exe normal :echo\cr let cmdheight = s:tmp_cmdheight works when the statusbar has been pushed up a small number of lines. It seems to know how to recover without a full redraw. If it gets pushed up even more, then it fails to clear. The command also doesn't reflect the pushed position of the statusline, so there's no way to put a case for it in the script that way. I never face this issue, as in all my maps, I try to avoid the output of commands appearing on the screen. Here are some techniques off the top of my head (you might find more if you search all my plugins, for maps): - Use silent where possible. - To execute functions on command-line, use C-R=func()CR instead of func()CR - When it is still necessary to clear the command-line, use :BS -- HTH, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
problem with SVNCommit in svncommand.vim
Hello, Having a bit of trouble committing files. If I typed :SVNCommit or Leadersc, it always says the current file is not a working copy, for eg: --This line, and those below, will be ignored-- svn: 'exaile.py' is not a working copy At this point none of the following actually commit the file: :w, :wq, :q! SVNLog and SVNStatus /do/ work on the same file, however, I can't seem to figure out how to close the scratch buffer on SVNLog without closing the original file. Can someone help me out here?
Re: Vertical selection
On Thu, 18 May 2006, John Love-Jensen wrote: Hi Eddine, Is it possible to make a vertical selection in a text, to have a rectangular selection in the text ? If so, how ? Yes, you are looking for the Visual mode blockwise. ^V to initiate Visual mode blockwise. Use movement keys to get to where you want the block to span. Use y (yank) or x (cut) to put the block into the register (as a block) Use p (put) to insert the register (as a block) into the buffer For more info... :help CTRL-V :help ' :help ' There are probably a zillion variants and tricks with Visual mode blockwise. I find that these simple ones suffice for all my needs. One more extremely useful thing to do in Visual Block mode is to hit I or A (capital) to insert/append the same text for all the lines that have been selected. -- Gerald
Always display full path in tab?
I have been looking through the documentation on vim (yes I even tried using :h tabline) in an attempt to always list the full path in my tabs. I can't see what option I need to enable so that the full path displays. Presently if I edit a file that exists in a rather long path, I see abbreviations in the path names (like /h/v/s/foo.bar). What do I need to do to enable? Thanks...and if this is in the documentation and I overlooked it...sorry - I will deserve the RTFM comments ;) In all seriousness I probably spent a good hour looking...just want the answer now :) Scot -- Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-754-4592 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Re: Always display full path in tab?
On 5/18/06, Scot P. Floess [EMAIL PROTECTED] wrote: I have been looking through the documentation on vim (yes I even tried using :h tabline) in an attempt to always list the full path in my tabs. I can't see what option I need to enable so that the full path displays. Presently if I edit a file that exists in a rather long path, I see abbreviations in the path names (like /h/v/s/foo.bar). What do I need to do to enable? Thanks...and if this is in the documentation and I overlooked it...sorry - I will deserve the RTFM comments ;) In all seriousness I probably spent a good hour looking...just want the answer now :) I've also failed to find that, but I want the opposite. I only want to see file names, no abbreviated directory paths. I've been there's a plug-in to let you do this, but it only works if you use the non-GUI version. I prefer to use the GUI version. -- R. Mark Volkmann Object Computing, Inc.
Re: Shell command history in VIM?
On 2006-05-18, Wijaya Edward [EMAIL PROTECTED] wrote: Hi, Is there a way to enable history view of all the shell command executed under vim, i.e. with :! shell_command If you are content to look at them one line at a time, just type :! and then use the up arrow to step through all of the command in your history buffer that begin with :!. One way to see all these commands at once is to type q: in normal mode or type the 'cedit' character in command mode to open the command-line window. Then execute g/^! HTH, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: Always display full path in tab?
From: Mark Volkmann, May 18, 2006 3:24 PM On 5/18/06, Scot P. Floess [EMAIL PROTECTED] wrote: list the full path in my tabs. I've also failed to find that, but I want the opposite. function! TabpageName(mode) if a:mode == 1 return fnamemodify(expand(%), :p:h) elseif a:mode == 2 let name = fnamemodify(expand(%), :p:t) if name == return (Untitled) endif return name endif endfunction function! TabpageState() if modified != 0 return '*' else return '' endif endfunction set guitablabel=%{TabpageName(2)}%{TabpageState()} Change the argument in the TabpageName() call to 1 for full paths. -- Steve Hall [ digitect mindspring com ] :: Cream... something good to put in your Vim! :: http://cream.sourceforge.net
Re: Vertical selection (fwd)
[I wasn't sure if Eddine sent this out to everybody, so I'm forwarding this to the list.] You're welcome, Eddine :) -- Gerald -- Forwarded message -- Date: Thu, 18 May 2006 22:20:24 +0200 From: Baha-Eddine MOKADEM [EMAIL PROTECTED] To: Gerald Lai [EMAIL PROTECTED] Subject: Re: Vertical selection Once again, Victor, Gerald, Eljay and J?rgen thank for all of you !!! It's a real pleasure to get quick and precise responses. Thank you again. Eddine
Re: Vertical selection
Baha-Eddine MOKADEM wrote: Is it possible to make a vertical selection in a text, to have a rectangular selection in the text ? If so, how ? In addition to the ctrl-v answer: vis.vim, available at http://vim.sourceforge.net/scripts/script.php?script_id=1195 , allows one to apply any Ex command to a visual block selected region. Two common uses: sorting the contents of just the visual block and restricting a substitute to take place over just the visual block. Regards, Chip Campbell
Re: HTML editing with vim: where to start ?
Dnia czwartek, 18 maja 2006 03:49, David Fishburn napisał: Since Ivan mentioned he is using PHP with his HTML, closetag will be very useful for him. PHP/HTML/XML omni-completion mixes *extremely* well :) m.
Re: HTML editing with vim: where to start ?
Dnia środa, 17 maja 2006 22:27, Ivan Vecerina napisał: Mikolaj Machowski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] : Dnia wtorek, 16 maja 2006 14:17, Ivan Vecerina napisał: : - get vim to automatically close/complete the innermost previously : opened tag. : : What do you mean automatically?. You can do: : : inoremap / /c-xc-o That's a great step forward, and I was able to make this work in a .html file. But it would not work in a PHP file Works for me. Where can I find documentation for this feature (seems to be part of the vim70 new enhancements), with which help keyword/tag ? :help ft-html-omni :help ft-php-omni :help ft-css-omni :help ft-javascript-omni [ I would never have fould this by chance, c-x does cut by default on my install... ] :behave mswin? How do I do an s/.../.../ on the current visual block? [ I guess I can find out, but maybe you could answer this by the way ] For operation on visual blocks you need special plugins. Don't remember names (never need them). m.
Oddities bugs
Hello all :) Just rehashing the recent threads that suggested some odd behavior with Vim 7. I haven't heard much about them on vim@vim.org, perhaps they've been fixed already. Anyway, here are the archive links all in one place: i_CTRL-E when completeopt has longest http://groups.yahoo.com/group/vim/message/68969 i_C-r= + \C-o http://groups.yahoo.com/group/vim/message/68932 vim7: two issues with insert mode completion http://groups.yahoo.com/group/vim/message/69205 echon space ? http://groups.yahoo.com/group/vim/message/69193 Could someone confirm the status on these issues? Thanks. -- Gerald
Re: HTML editing with vim: where to start ?
Mikolaj Machowski wrote: Dnia środa, 17 maja 2006 22:27, Ivan Vecerina napisał: Mikolaj Machowski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [...] [ I would never have fould this by chance, c-x does cut by default on my install... ] :behave mswin? [...] my guess is :source $VIMRUNTIME/mswin.vim -- the script that cripples Vim in a not-very-successful attempt to make it more Windows-like. WTF, if you want a Windows-like editor, don't use Vim, use Notepad! IMHO mswin.vim is better done without. Best regards, Tony.
Re: Wierd message message on startup
Furash Gary wrote: Today, when I open a file with gvim (windows), it shows me a popup with the following and seems to work okay. What is this telling me? There isn't any error message, it just prints out the following --- Auto-Commands --- filetypedetect BufEnter *.xpmif getline(1) =~ XPM2 | setf xpm2 | else | setf xpm | endif *.xpm2setf xpm2 filetypedetect BufNewFile *.otlsetfiletype vo_base *.olnsetfiletype xoutliner ?\+.origexe doau filetypedetect BufRead . expand(afile:r) ?\+.bakexe doau filetypedetect BufRead . expand(afile:r) ?\+.oldexe doau filetypedetect BufRead . expand(afile:r) ?\+.newexe doau filetypedetect BufRead . expand(afile:r) ?\+.rpmsave exe doau filetypedetect BufRead . expand(afile:r) ?\+.rpmnew exe doau filetypedetect BufRead . expand(afile:r) *~let s:name = expand(afile) | let s:short = substitute(s:name, '\~$', '', '') | if Gary Furash, MBA, PMP, Applications Manager Maricopa County Attorney's Office my guess is, maybe you have an :autocommand (or :au) statement with no command, as follows: display all autocommands au display all autocommands for a single event: au BufEnter display all autocommands for a single group au filetypedetect display all autocommands for a single event and pattern au BufNewFile *.vim etc. see :help autocmd.txt :help autocmd-list Anything displayed in gvim before the GUI is actually started, comes up in a popup. To display it in the GUI itself, there are two methods; - start the GUI early by means of the :gui statement - display it late by means of an autocommand for the VimEnter event. see :help :gui :helpgrep :gui :help VimEnter Best regards, Tony.
Re: Tables.
On Thu, May 18, 2006 at 01:55:03PM EDT, Hari Krishna Dara wrote: On Thu, 18 May 2006 at 8:23am, Benji Fisher wrote: On Wed, May 17, 2006 at 07:50:08PM -0700, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh I already implemented that. See the VarTab() function in foo.vim (my file of example vim functions): http://www.vim.org/script.php?script_id=72 HTH --Benji Fisher Oops... I searched for scripts and didn't find anything dealing with this kind of tabs, so got curious and went ahead and wrote a small plugin for this. I hope there is more to be offered in this, than your VarTab() function, especially that there is a GUI tabstop setter, and it maps Tab to insert the right number of spaces. I am attaching the plugin, and hope to get some feedback. You need genutils.vim also, and read the plugin header. Thanks to all. This was just a general question.. something I planned to keep on the back burner for a while.. so I'm not sure when I will have the time to look into this further. Saving this thread for later reference. cga
Re: Tables.
On Wed, May 17, 2006 at 10:50:08PM EDT, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh Thanks much, saving this for later. cga
Re: Tables.
On Thu, May 18, 2006 at 02:36:05AM EDT, Stano Sitar wrote: cga2000 napsal(a): The functionalities I had in mind would probably do something like this: 1. Assist text entry by letting you define tab stops, 2. Let you select a column of text and justify it, 3. Provide some means of inserting vertical lines at each tab stop, 4. Assist in creating horizontal lines by adding the ad hoc character where a vertical and a horizontal line intersect, 5. Reformat the table frame when box drawing characters are not available (replacing line intersections by '+' for instance). Try program sc sc is an anicent spreadsheet calculator for console (text only, no mouse) It does everything you want, it is very small, it exists for number of platforms (for dos and Windows version look for gnuish collection) keybindings in sc are very vi-like You can make script that sends data from vim to sc, format data in sc and export them back to vim best regards Stanislav Definitely the better strategy. I'll keep this in mind for when I have more time to look into it. I downloaded it to take a look. Is there a some kind of user guide or other resource that might help getting started? I also found another text-mode spreadsheet called slsc. Would you know if either of these is still maintained and where I should go, should I need some form of assistance? Thanks, cga
Re: Tables.
On Thu, May 18, 2006 at 08:23:00AM EDT, Benji Fisher wrote: On Wed, May 17, 2006 at 07:50:08PM -0700, Suresh Govindachar wrote: cga2000 wrote: But I was not thinking of these tab stops.. more in the line of typewriter stuff, I guess. Creating an imap involving the following operations might do the job: ---set up the typewriter style tab-stops--- let twtabs=[3, 5, 10, 28, 40, 58] ---then imap tab to something involving the following--- let idx=0 while (getpos('.')[2] = twtabs[idx]) let idx += 1 endwhile ---then something like--- cursor(0, twtabs[idx]) ---or--- normal (twtabs[idx] - getpos('.')[2])l --Suresh I already implemented that. See the VarTab() function in foo.vim (my file of example vim functions): http://www.vim.org/script.php?script_id=72 Thanks. Will play with that too. I was wondering if another approach such as using a markup language that supports tables might not be preferable in the long run. What I mean by this is that it might be a little more difficult to start off with but might provide more control and facilities and end up being a more portable solution. html would be an obvious candidate but I suppose that there are others in the linux world? Is there any way I can split the screen and have the source version of a document written in a markup language in one window and the compiled version in the other? With a simple command or key combo that I could issue in the source window that would cause a refresh of what is displayed in the other window..? Or is vim just not suited for this kind of approach? Thanks, cga
Re: Oddities bugs
Hi Gerald, On 5/18/06, Gerald Lai [EMAIL PROTECTED] wrote: Hello all :) Just rehashing the recent threads that suggested some odd behavior with Vim 7. I haven't heard much about them on vim@vim.org, perhaps they've been fixed already. Anyway, here are the archive links all in one place: i_CTRL-E when completeopt has longest http://groups.yahoo.com/group/vim/message/68969 i_C-r= + \C-o http://groups.yahoo.com/group/vim/message/68932 vim7: two issues with insert mode completion http://groups.yahoo.com/group/vim/message/69205 echon space ? http://groups.yahoo.com/group/vim/message/69193 Could someone confirm the status on these issues? Thanks. You have to wait for Bram to come back from vacation to get update on these problems/bugs. - Yegappan