Re: VimWiki - released finally
On 6/5/07, Sebastian Menge [EMAIL PROTECTED] wrote: [cross-posted to vim, vim-dev, vim-announce, wikia-l] Hi all Finally I have imported all the vim tips from http://vim.org/tips to http://vim.wikia.com and set up a minimal infrastructure to keep things going. Not everything is perfect, but I think it is usable now. Thanks to all the support from [EMAIL PROTECTED] and especially to the very kind wikia community (#wikia on freenode and the mailing list, Greetings!). Some words on contribution: A good wiki depends on two main factors: Excellent content and a lively community. We have a lot of good content now, but to make it excellent we need You! If you ever posted a tip or a comment to the old tips database, please have a look at it on the wiki, and review the page. Every little bit helps! See you on the wiki, Sebastian. Very good work Sebastian, it looks great to me. I have already come across a new tip on vim wikia that I hadn't known anything about which I thought I might draw programmer's attention to (sorry if you already know about it). Tip #1267, which is a tip to enable a programmer to see (by a simple key combination of his/her choice), in which function they are. Very useful if you have just landed in the middle of a long function during a search for example, you know longer have to move around inside the buffer to find which function you are in, just type your chosen key combination: see http://vim.wikia.com/wiki/Show_current_function_name_(for_C_programmers) if you are interested. Thanks very much to the original author of the tip and to everyone who has contributed to setting up the vim wikia. Rob.
Re: VimWiki - released finally
On 6/5/07, Sebastian Menge [EMAIL PROTECTED] wrote: [cross-posted to vim, vim-dev, vim-announce, wikia-l] Hi all Finally I have imported all the vim tips from http://vim.org/tips to http://vim.wikia.com and set up a minimal infrastructure to keep things going. Not everything is perfect, but I think it is usable now. Thanks to all the support from vim@vim.org and especially to the very kind wikia community (#wikia on freenode and the mailing list, Greetings!). Some words on contribution: A good wiki depends on two main factors: Excellent content and a lively community. We have a lot of good content now, but to make it excellent we need You! If you ever posted a tip or a comment to the old tips database, please have a look at it on the wiki, and review the page. Every little bit helps! See you on the wiki, Sebastian. Very good work Sebastian, it looks great to me. I have already come across a new tip on vim wikia that I hadn't known anything about which I thought I might draw programmer's attention to (sorry if you already know about it). Tip #1267, which is a tip to enable a programmer to see (by a simple key combination of his/her choice), in which function they are. Very useful if you have just landed in the middle of a long function during a search for example, you know longer have to move around inside the buffer to find which function you are in, just type your chosen key combination: see http://vim.wikia.com/wiki/Show_current_function_name_(for_C_programmers) if you are interested. Thanks very much to the original author of the tip and to everyone who has contributed to setting up the vim wikia. Rob.
Re: how can I add this feature to vim!!
Michael F. Lamb wrote: jaywee wrote: *! Swap caps lock and escape, good for Vim remove Lock = Caps_Lock keysym Escape = Caps_Lock keysym Caps_Lock = Escape add Lock = Caps_Lock *to a file named .speedswapper to the home directory, and run *xmodmap ~/.speedswapper* in a terminal, I follow the guide and finally done! but the bad thing is I have to run the command every time I reboot ubuntu!! so any helps?? If it's a default Ubuntu install, meaning you're a Gnome user, name the file .Xmodmap rather than .speedswapper. When you log in, it should detect it automatically, and ask if you wish to use it. You might also find that configuration option available in the Gnome Keyboard Properties part of the system configuration menu, I'm not sure. Hi, I've been using this tip for ages and find it very useful, but I have the same problem as jaywee and none of the solutions so far suggested have solved the problem. I am using Debian Etch with KDE 3.5.5. In my home directory, I have tried creating a .xinitrc with the same contents as the .speedswapper file (there wasn't one already existing), I have tried creating a .Xmodmap file with the same contents and I have looked in the KDE control panel for anything that might be able to do this, but didn't find anything. It's not a big problem, but it just would be nice to have it done automatically :-) Thanks for any help, Rob.
Re: how can I add this feature to vim!!
[EMAIL PROTECTED] wrote: Robert Cussons wrote: Michael F. Lamb wrote: jaywee wrote: *! Swap caps lock and escape, good for Vim remove Lock = Caps_Lock keysym Escape = Caps_Lock keysym Caps_Lock = Escape add Lock = Caps_Lock *to a file named .speedswapper to the home directory, and run *xmodmap ~/.speedswapper* in a terminal, I follow the guide and finally done! but the bad thing is I have to run the command every time I reboot ubuntu!! so any helps?? If it's a default Ubuntu install, meaning you're a Gnome user, name the file .Xmodmap rather than .speedswapper. When you log in, it should detect it automatically, and ask if you wish to use it. You might also find that configuration option available in the Gnome Keyboard Properties part of the system configuration menu, I'm not sure. Hi, I've been using this tip for ages and find it very useful, but I have the same problem as jaywee and none of the solutions so far suggested have solved the problem. I am using Debian Etch with KDE 3.5.5. In my home directory, I have tried creating a .xinitrc with the same contents as the .speedswapper file (there wasn't one already existing), I have tried creating a .Xmodmap file with the same contents and I have looked in the KDE control panel for anything that might be able to do this, but didn't find anything. It's not a big problem, but it just would be nice to have it done automatically :-) Thanks for any help, Rob. Hi, to make commands to be run when your desktop first loads I found this page useful: http://gentoo-wiki.com/HOWTO_Autostart_Programs so, to ensure your keys get swapped when KDE starts, put the commands into any accessible file (~/.speedswapper above). Then create a shell script in the appropriate directory for your distribution (on xfce4 here it is ~/.config/autostart, and in KDE it is ~/.kde/Autostart) that calls xmodmap: #!/bin/bash xmodmap ~/.speedswapper Make that executable (chmod +x ~/.kde/Autostart/swapscript) Thanks so much Chris, I should have known to look in the Gentoo pages, they are always very helpful and generally well explained. and you should have what you want (just in case any of you are lawyers, I, of course, do not mean to imply that this solution will give you everything that you want, just the required results of this question). Just have to wait 'til next time I log out and and in again to see if I achieve nirvana... ;-) cheers Chris
Re: Tip#166 Caps_lock and Escape switch and imwheel
Robert Cussons wrote: --snip-- So, on with the problem. I was using the excellent Tip#166 to switch the Caps Lock and Escape keys and it worked wonderfully. Then on Friday, I tried to install imwheel as non-root, don't know if this is possible, but I read the documentation and it didn't mention that it wasn't (incidentally, I was doing this following http://physics.ou.edu/~mcraven/mathmouse.html as a way of getting the mouse wheel to work properly in mathematica under Linux). Anyway I got complaints when trying to install it as it couldn't make the directory /etc/X11/imwheel as I cannot log in as root. So I gave up on that idea and as far as I was concerned had deleted anything to do with imwheel as I used its configure command to install under the prefix of my home directory. The problem is that now when I run the xmodmap ~/.speedswapper command that has worked up until now, the escape key behaves like Caps lock as intended, but the Caps lock key seems to be acting as both Caps lock AND escape, i.e. it will change me from insert to normal mode, but also turns on Caps lock! I am running KDE 3.3.2, Debian Sarge. The speedswapper file is as follows: ! Swap caps lock and escape, good for Vim remove Lock = Caps_Lock keysym Escape = Caps_Lock keysym Caps_Lock = Escape add Lock = Caps_Lock --snip-- Machine just been updated to Debian Etch and the problem has disappeared, not sure why, but I'm happy to have this mapping back, it's so useful, thanks very much to Leif Wickland for posting it. Rob.
Re: yanking text
A.J.Mechelynck wrote: Robert Cussons wrote: Hi, I think a question like this was posted a long time ago, but I can't remember where or the answer, so please excuse me for asking it again. If I yank the next word with yw the cursor stays where it is. However if I want to yank text backwards from my current position for example to get the last word I use yb and the cursor moves to the beginning of the word. As I thought these two motion commands were the inverse and they appear to operate like that, why the difference in their reaction under the y operator? Thanks Rob. The answer doesn't have a help tag, but it is somewhere under the description of the yank command in change.txt: sorry, did look at the help file, but didn't read the whole section and it was right at the end : quote Note that after a characterwise yank command, Vim leaves the cursor on the first yanked character that is closest to the start of the buffer. This means that yl doesn't move the cursor, but yh moves the cursor one character left. Rationale: In Vi the y command followed by a backwards motion would sometimes not move the cursor to the first yanked character, because redisplaying was skipped. In Vim it always moves to the first character, as specified by Posix. With a linewise yank command the cursor is put in the first line, but the column is unmodified, thus it may not be on the first yanked character. /quote Best regards, Tony. Few moments pause while I look up what POSIX isso this method is standard compliant with other Unix systems, but is not so useful for effective text editing IMHO as when I yank text backwards it is because I want to use that text again at some later part of the document (as I like most people, I believe) write documents from start to finish (with a lot of detours admittedly ;-)), so to me it would make more sense to leave the cursor alone. Is this purely a compliance reason then or does someone have some text editing reason for doing it aswell? If I wanted to change this behaviour, would I be right in thinking that I would have to define the yank command followed by a motion to set a mark, do the yank command then return to that mark? Actually just done a bit of reading in the help file and it appears I don't need marks, I could make use of the `] function, so then all I would want is to change the behaviour of any backwards yank to the same command, but with `] tagged on the end. However, you can only remap single keys can't you, so I guess something like: nnoremap ymotion ymotion`] wouldn't work, and I wouldn't know how to include the motion without specifying them all individually. Or is this all a very bad idea and shouldn't be done anyway ;-) Thanks for any input, Rob.
Re: calling normal commands from ex/a function
fREW wrote: Hey everyone, How do I have a function call Normal commands? Example: I'd like to make a function that will open a certain file, and then set the foldlevel to 1, and then go to the right window. So I have: function TodoListMode() execute :e ~/.todo.otl execute :Calendar endfunction and then after the second command I want to do: ctrlwl zM zr Thanks! -fREW Hi fREW, execute normal! ctrlwl zM zr would be my guess, but I've never tried writing my own functions, this is adapted from someone else's work, so someone else's input would be useful :-) Rob.
yanking text
Hi, I think a question like this was posted a long time ago, but I can't remember where or the answer, so please excuse me for asking it again. If I yank the next word with yw the cursor stays where it is. However if I want to yank text backwards from my current position for example to get the last word I use yb and the cursor moves to the beginning of the word. As I thought these two motion commands were the inverse and they appear to operate like that, why the difference in their reaction under the y operator? Thanks Rob.
Re: Favorite little-known feature
Hans-Juergen Becker wrote: Am Samstag, den 05.05.2007, 12:33 +0200 schrieb Christoph Haas: Selecting a block (Ctrl-V), then pressing I (shift-i) and entering text which then gets inserted into all rows of the block at the same column. This is one of the features I love when editing DNS zone files. I've tried to that some time ago, because i though that should work the way you described it. But it didn't and still doesn't work on my vim, so i'm quite surprised by your tip :-) But as it doesn't work: do you have to enable some setting to use that feature? I'm using vim version 7.0 on Debian Lenny. Thanks, Hans-Juergen Which part doesn't work, I presume you can select a block of text with Ctrl-V, I'm just interested as I also find this a very useful feature, but it works for me :-). You also must press I, not i. Just noticed that one thing Christoph didn't write is that you have to press Escape to leave insert mode at the end of the process, has that helped?
Re: undo line numbers wrong
Yakov Lerner wrote: On 5/2/07, Robert Cussons [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 5/2/07, Robert Cussons [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 4/27/07, Robert Cussons [EMAIL PROTECTED] wrote: Thanks Tony, doubt he'll be that interested as he's an emacs user! But anyway some time next week I will try and convince him. You can install latest vim under your $HOME -- this does not require any root privileges -- with a single command, a script 'vim7-install.sh'. Script vim7-install.sh is at http://www.vim.org/scripts/script.php?script_id=1473 vim7-install.sh : {download + build + install} latest vim7 [from svn sources] in 1 command Yakov Thanks very much Yakov, just done that and it seems to have worked fine, there's just a couple of curious things: 1) below is the first part of the output, what are the errors right at the bottom of this part? [EMAIL PROTECTED]:~$ sh ./vim7-install.sh This will download, build and install vim7 (using svn). Select one of the following: 1) You know root password and you want to install vim globally for all users on this computer (into /usr/local/bin) 2) You do not know root password or you want to install vim under your $HOME/bin directory 2 # previously downloaded source found. * checking for locally modified files ... Found locally modified files (dir=/var/tmp/user4046/vim7_from_svn/vim7) * M src/auto/config.mk Found locally modified files (dir=/var/tmp/user4046/vim7_from_svn/vim7) * Select (1) Discard local changes (2) Keep local changes [1] ? 2 + cd /var/tmp/user4046/vim7_from_svn/vim7 + svn up Error validating server certificate for 'https://svn.sourceforge.net:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: *.sourceforge.net - Valid: from Jan 17 18:17:01 2007 GMT until Mar 18 18:17:01 2008 GMT - Issuer: Equifax Secure Certificate Authority, Equifax, US - Fingerprint: a1:3a:51:83:60:5e:81:07:be:6c:06:d1:db:34:9b:d8:b9:40:b5:d0 (R)eject, accept (t)emporarily or accept (p)ermanently? p svn: PROPFIND request failed on '/svnroot/vim/vim7' svn: PROPFIND of '/svnroot/vim/vim7': Could not read status line: Secure connection truncated (https://svn.sourceforge.net) svn returned error(s). Press Enter to continue, Ctrl-C to stop 2) it says I should validate the certificate manually, but how do you actually go about doing that? 3) the final part of the output is as follows: make[1]: Leaving directory `/var/tmp/user4046/vim7_from_svn/vim7/src' Build and install successful *** *** Warning: directory $HOME/bin is not in you PATH! You need to add directory $HOME/bin to your PATH to run new vim but if I do the following: [EMAIL PROTECTED]:~/bin$ echo $HOME /the/cussons [EMAIL PROTECTED]:~/bin$ echo $PATH /usr/the_local/bin/:/usr/bin/:/the/cussons/bin/:/usr/local/bin:/bin:/usr/bin/X11:/usr/games:/the/cussons/bin/clewn/:/the/cussons/LeoScript/crudeleo-1.9/ you can see that $HOME/bin is in my PATH, therefore, does your error message actually mean that as there is a version of vim in /usr/bin/ that this one will be loaded first and therefore, I should place /the/cussons/bin/ before it in the PATH to give it preference? 1. Just answer 'p' to accept the certificate permanently. 2. The check for $HOME/bin in the path is not comlpete indeed. a) Type 'type vim' in bash to see which vim is taken, one from your /usr/bin or from $HOME/bin. b) Put $HOME/bin to the *front* of your path, before /usr/bin and before /usr/local/bin and before all other dirs that might contain other version of vim. c) Additionally, put this in your .bashrc: alias vim=$HOME/bin/vim' d) I recommend that you do both (b) and (c), and then check 'type vim' again. I will need to fix vim7-install.sh to fix that $HOME/bin in the end. I need to check that $HOME/bin is before other /usr/* dirs, not only *somewhere* in the PATH. Somewhere in the PATH is not good check. In your case, script was confused by the trailing slash in $HOME/bin/, it expects $HOME/bin. I'll fix that, too. Thanks for reporting. Yakov Thanks for the utility, had already resolved the problems with the PATH just thought I should let you know. Is the part below in the error just to do with the certificate, or something else? svn: PROPFIND request failed on '/svnroot/vim/vim7' svn: PROPFIND of '/svnroot/vim/vim7': Could not read status line: Secure connection truncated (https://svn.sourceforge.net) svn returned error(s). Press Enter to continue, Ctrl-C to stop Also what does it mean by manually validating the certificate, it is not relevant to this install, but just wondering if anyone out there knows what it means? Error validating server
Re: undo line numbers wrong
Yakov Lerner wrote: On 5/2/07, Robert Cussons [EMAIL PROTECTED] wrote: Yakov Lerner wrote: On 4/27/07, Robert Cussons [EMAIL PROTECTED] wrote: Thanks Tony, doubt he'll be that interested as he's an emacs user! But anyway some time next week I will try and convince him. You can install latest vim under your $HOME -- this does not require any root privileges -- with a single command, a script 'vim7-install.sh'. Script vim7-install.sh is at http://www.vim.org/scripts/script.php?script_id=1473 vim7-install.sh : {download + build + install} latest vim7 [from svn sources] in 1 command Yakov Thanks very much Yakov, just done that and it seems to have worked fine, there's just a couple of curious things: 1) below is the first part of the output, what are the errors right at the bottom of this part? [EMAIL PROTECTED]:~$ sh ./vim7-install.sh This will download, build and install vim7 (using svn). Select one of the following: 1) You know root password and you want to install vim globally for all users on this computer (into /usr/local/bin) 2) You do not know root password or you want to install vim under your $HOME/bin directory 2 # previously downloaded source found. * checking for locally modified files ... Found locally modified files (dir=/var/tmp/user4046/vim7_from_svn/vim7) * M src/auto/config.mk Found locally modified files (dir=/var/tmp/user4046/vim7_from_svn/vim7) * Select (1) Discard local changes (2) Keep local changes [1] ? 2 + cd /var/tmp/user4046/vim7_from_svn/vim7 + svn up Error validating server certificate for 'https://svn.sourceforge.net:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: *.sourceforge.net - Valid: from Jan 17 18:17:01 2007 GMT until Mar 18 18:17:01 2008 GMT - Issuer: Equifax Secure Certificate Authority, Equifax, US - Fingerprint: a1:3a:51:83:60:5e:81:07:be:6c:06:d1:db:34:9b:d8:b9:40:b5:d0 (R)eject, accept (t)emporarily or accept (p)ermanently? p svn: PROPFIND request failed on '/svnroot/vim/vim7' svn: PROPFIND of '/svnroot/vim/vim7': Could not read status line: Secure connection truncated (https://svn.sourceforge.net) svn returned error(s). Press Enter to continue, Ctrl-C to stop 2) it says I should validate the certificate manually, but how do you actually go about doing that? 3) the final part of the output is as follows: make[1]: Leaving directory `/var/tmp/user4046/vim7_from_svn/vim7/src' Build and install successful *** *** Warning: directory $HOME/bin is not in you PATH! You need to add directory $HOME/bin to your PATH to run new vim but if I do the following: [EMAIL PROTECTED]:~/bin$ echo $HOME /the/cussons [EMAIL PROTECTED]:~/bin$ echo $PATH /usr/the_local/bin/:/usr/bin/:/the/cussons/bin/:/usr/local/bin:/bin:/usr/bin/X11:/usr/games:/the/cussons/bin/clewn/:/the/cussons/LeoScript/crudeleo-1.9/ you can see that $HOME/bin is in my PATH, therefore, does your error message actually mean that as there is a version of vim in /usr/bin/ that this one will be loaded first and therefore, I should place /the/cussons/bin/ before it in the PATH to give it preference? 1. Just answer 'p' to accept the certificate permanently. 2. The check for $HOME/bin in the path is not comlpete indeed. a) Type 'type vim' in bash to see which vim is taken, one from your /usr/bin or from $HOME/bin. b) Put $HOME/bin to the *front* of your path, before /usr/bin and before /usr/local/bin and before all other dirs that might contain other version of vim. c) Additionally, put this in your .bashrc: alias vim=$HOME/bin/vim' d) I recommend that you do both (b) and (c), and then check 'type vim' again. I will need to fix vim7-install.sh to fix that $HOME/bin in the end. I need to check that $HOME/bin is before other /usr/* dirs, not only *somewhere* in the PATH. Somewhere in the PATH is not good check. In your case, script was confused by the trailing slash in $HOME/bin/, it expects $HOME/bin. I'll fix that, too. Thanks for reporting. Yakov Thanks for the utility, had already resolved the problems with the PATH just thought I should let you know. Is the part below in the error just to do with the certificate, or something else? svn: PROPFIND request failed on '/svnroot/vim/vim7' svn: PROPFIND of '/svnroot/vim/vim7': Could not read status line: Secure connection truncated (https://svn.sourceforge.net) svn returned error(s). Press Enter to continue, Ctrl-C to stop Also what does it mean by manually validating the certificate, it is not relevant to this install, but just wondering if anyone out there knows what it means? Error validating server certificate for 'https://svn.sourceforge.net:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually
Re: undo line numbers wrong
Thanks Bram and Tony, haven't been ignoring your replies, but it's my work machine and they have just updated to Debian Etch, but I haven't restarted my machine yet as I have a lot of things running at the moment and so was waiting for the weekend. Anyway just this morning I thought I would check on which version was actually packaged on Etch and it is: 1:7.0-122+1etch2 So I guess that won't help much if patch 182 is especially important! Soas it's my work machine and I don't have root access, do I need to go and talk nicely to the system administrator to get him to apply these patches? Thanks for all the help, Rob. Bram Moolenaar wrote: Rob Cussons wrote: just wondering if anyone else had experienced an error message like this. It seems that every so often, I've not managed to find any systematics to this, when I try to perform an undo, I get undo line numbers wrong or something similar, sorry I don't have the exact error in front of me, it happened about 5 minutes ago and I was in the middle of something, so I just dealt with it! It doesn't happen very often, but when it does if I later try to undo something, it all goes a bit haywire and seems to not undo the last change etc. Sorry this is so vague, if it happens again, I'll see if I can pin it down better. Just wondered if anyone else had experienced this and maybe knew the cause. What is your :version output? Hi Bram, below is the :version output. :version VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 16 2006 12:51:49) Included patches: 1-35 There were a few updates to the undo function, especially patch 182. You could try including all the patches that are available. If the problem persists please try to find out what triggers the problem. There might also be something in your environment that matters (esp. plugins). It works fine for everybody else, so what is different for you?
Re: undo line numbers wrong
Bram Moolenaar wrote: Rob Cussons wrote: just wondering if anyone else had experienced an error message like this. It seems that every so often, I've not managed to find any systematics to this, when I try to perform an undo, I get undo line numbers wrong or something similar, sorry I don't have the exact error in front of me, it happened about 5 minutes ago and I was in the middle of something, so I just dealt with it! It doesn't happen very often, but when it does if I later try to undo something, it all goes a bit haywire and seems to not undo the last change etc. Sorry this is so vague, if it happens again, I'll see if I can pin it down better. Just wondered if anyone else had experienced this and maybe knew the cause. What is your :version output? Hi Bram, below is the :version output. :version VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 16 2006 12:51:49) Included patches: 1-35 Compiled by [EMAIL PROTECTED] Big version with GTK2 GUI. Features included (+) or not (-): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile -python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save system vimrc file: $VIM/vimrc user vimrc file: $HOME/.vimrc user exrc file: $HOME/.exrc system gvimrc file: $VIM/gvimrc user gvimrc file: $HOME/.gvimrc system menu file: $VIMRUNTIME/menu.vim fall-back for $VIM: /usr/share/vim Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -DXTHREADS -I/usr/includ e/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/ include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/i nclude -O2 -g -Wall -I/usr/X11R6/include Linking: gcc -L/usr/X11R6/lib -L/usr/local/lib -o vim -Wl,--export-dynamic -lgtk-x1 1-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1 .0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXt -lncurses -lgpm
[Fwd: [Fwd: Latex Suite - question about font shortcut FMD]]
I haven't received any response from Srinath or Mikolaj, so I thought I would ask on the Vim list, hope no one minds a specific plugin related request on the list, but if I can't contact the maintainers I didn't know who else to ask. Thanks for any help, Rob. Original Message Subject: [Fwd: Latex Suite - question about font shortcut FMD] Date: Thu, 15 Feb 2007 14:44:35 +0100 From: Robert Cussons [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Tried your old e-mail address first ;-) Original Message Subject: Latex Suite - question about font shortcut FMD Date: Thu, 15 Feb 2007 14:09:52 +0100 From: Robert Cussons [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED], [EMAIL PROTECTED] Dear Srinath and Mikolaj, I work with a nuclear physics model called FMD, so as you can imagine, each time I type FMD I would prefer it if latex suite didn't interpret that as an abbreviation for \textmd{}++ :-) I found the following lines in the wizardfuncs.vim from line 308 onwards: Font shortcuts {{{ let g:fontshortcuts = '' \.\n Font shortcuts \.\n mapleader is a value of g:Tex_Leader \.\n Shortcuts Effects \.\n IvV Iv V \.\n FBF .g:Tex_Leader.bf \\textbf{} {\\bfseries } \.\n FMD .g:Tex_Leader.md \\textmd{} {\\mdseries } \.\n \.\n FTT .g:Tex_Leader.tt \\texttt{} {\\ttfamily } \.\n FSF .g:Tex_Leader.sf \\textsf{} {\\sffamily } \.\n FRM .g:Tex_Leader.rm \\textrm{} {\\rmfamily } \.\n \.\n FUP .g:Tex_Leader.up \\textup{} {\\upshape } \.\n FSL .g:Tex_Leader.sl \\textsl{} {\\slshape } \.\n FSC .g:Tex_Leader.sc \\textsc{} {\\scshape } \.\n FIT .g:Tex_Leader.it \\textit{} {\\itshape } }}} Can I remove this particular functionality by putting a before the line to do with FMD? So that it would read: \.\n FMD .g:Tex_Leader.md\\textmd{} {\\mdseries } does this have the desired effect of commenting this out? Do I need to do anything else, or will this automatically take effect next time I open a .tex file. Many thanks to you both for your help and a great plugin, Rob.
Re: [SPAM?]Re: Vim 7 performance notes
George V. Reilly wrote: Yakov Lerner wrote: On 2/4/07, Yakov Lerner [EMAIL PROTECTED] wrote: On 2/4/07, Alexei Alexandrov [EMAIL PROTECTED] wrote: Gnu malloc (glibc) is exceptionally fast, iirc. It is possible to benchmark the malloc speed during the ./configure time. And auto-select the initital size depending on the results. The procmail this similar technique in configure: It automatically benchmarks it's own builtin strstr() vs system's strstr() and selects the one which is faster. In this particular case the speed of malloc is not the only factor. Big fraction of time is spent in memset() while initializing the array with zeros. That's why I thought that it's reasonable to benchmark malloc() relative to the time it takes to memset() that same area. (When benchmarking, you need to know what to compare it to). If you compare time it takes to malloc N bytes to the time it takes to memset() same N bytes, you can tell the speed of malloc *relative* to the time of memset()ting same size. So you will automatically know which one is realtively more expensive, the memset() or the malloc(). And then maybe the optimal initial size will be size where memset() time is equal to the malloc() time ? The break-even, so to say, in which neither of two time dominates the other ? memset() is an O(N) operation. Its running time has to be proportional to N because it has to touch every single byte. If the pagefile gets involved, it's still O(N), but with a much larger constant. malloc()'s running time is much harder to say anything about. Not only can it vary widely between different implementations, it also depends upon the state of the system. Is the heap fragmented? Is it suffering from lock contention? (Not a problem with single-threaded apps like Vim.) Is the memory already in the process's working set, or does malloc have to ask the OS for more pages? Is the system under intense memory pressure and will the malloc() operation cause paging to disk? Finally, malloc(N) is probably independent of N. It has to find a free entry of size N in its data structures, which is very dependent on both the implementation and the preceding factors. Benchmarking malloc() in ./configure is not likely to tell you very much about its performance in a workload you care about. Sorry to butt in here, but I had a question about all this discussion on malloc. If you are talking about the C function malloc which I think you are as you referred to glibc, then as far as I am aware, malloc does not zero the memory that is allocated, it merely allocates it, so I do not see where memset would be used. calloc on the other hand, also zeros the memory that it allocates. Sorry if I am completely misguided but just interested to know other people's thoughts on it. Cheers, Rob.
Re: getting rid of beep in vim
Thanks Tony, very prompt and helpful as always. --snip-- Inverting the display means changing black to white, white to black, yellow to blue, blue to yellow, red to cyan, cyan to red, green to magenta, magenta to green, etc., all over the screen. The visual bell does it for a fraction of a second, if enabled. As noted under :help 'visualbell', to disable both visual and audio bell, you must set 'visualbell' *ON* (not off), I assume this is because if you turn off visual bell it is assumed that you would want an audible one? and clear the corresponding pseudo-termcap entry, as follows: no bells wanted set vb t_vb= must reset it again when the GUI starts if has(gui) autocmd GUIEnter * set t_vb= endif I don't know what a pseudo-termcap entry is but naively I don't see why you have to renew a command you've already given when the GUI starts up. Thanks again, Rob.
Re: getting rid of beep in vim
Bill McCarthy wrote: On Wed 24-Jan-07 1:41am -0600, Robert Cussons wrote: I'm sorry, I know this should be a problem that I can resolve for myself, but I have searched the vim help under bells and visualbell and tried what it says and it doesn't seem to work, so your help would be greatly appreciated. Basically, I always get the beeping sound when I press 'k' but I'm already at the top of the file, for example and I want to turn it off. I am running vim 7.0 on Windows XP Pro SP2. I have: set vb t_vb='' To do this, all you need in your _vimrc is: set vb t_vb= That will eliminate sounds and flashing in Vim. For Gvim, you also need, in your _gvimrc: set t_vb= because entering the GUI sets 't_vb'. See :help 'vb' Thanks Bill, I implemented this on Tony's advice and it has worked, finally there is silence :-)
getting rid of beep in vim
Hi all, I'm sorry, I know this should be a problem that I can resolve for myself, but I have searched the vim help under bells and visualbell and tried what it says and it doesn't seem to work, so your help would be greatly appreciated. Basically, I always get the beeping sound when I press 'k' but I'm already at the top of the file, for example and I want to turn it off. I am running vim 7.0 on Windows XP Pro SP2. I have: set vb t_vb='' in my _vimrc, I have also set it without the quote marks. I also have set novb and: set noeb in my _vimrc and I still get the noise! I am starting to wonder if my _vimrc is actually being read from, it is located in: C:\Program Files\Vim, although I put a copy into: C:\Program Files\Vim\vim70 to see if that would resolve it but it made no difference. Is there a way to get vim to tell me which _vimrc it has read when loading? If I type: :set t_vb=? into gvim, I get: t_vb=^[|f which I believe reads as escape character f according to the help file, which has the sentence: In the GUI, 't_vb' defaults to Esc|f, which inverts the display for 20 msec. I don't understand what inverts the display means, unless it means turn the display upside down, which sounds a bit strange! Anyway, it was the fact that I seem to have the default value that leads me to believe that my _vimrc isn't being read. Sorry for the rambling, but if someone has the time to explain all this to me (or even some of it) I would be very grateful, thanks very much for any help. Rob.
partial commands shown below buffer
Happy New Year to everyone. On my windows gvim7 installation, I have a command displayed as I am typing it just below the buffer I am working on, so for example if I type: +2yy then each character up until I hit the last y will be displayed as I type them. This is not so in my KDE Linux installation. Please can someone tell me which option I need to turn on so that I see this in the Linux install. Many thanks, Rob.
Re: Ignore matches that are commented out - was How to edit a macro
Yakov Lerner wrote: On 11/1/06, Robert Cussons [EMAIL PROTECTED] wrote: Hi everyone, In a C programme for example is there a way to get Vim to ignore matches that are commented out when searching for a string? I found another solution, posted on this list in 2004 (not by me). This list archive is full of gold! It does seem to be very useful, I shall check it more often. http://marc.theaimsgroup.com/?l=vimm=108617062626551w=2 Subject:Re: How to skip comments during search From: vim vim9527 () 21cn ! com Date: 2004-06-02 10:06:43 Message-ID: 000f01c44889$54e17e40$ab00a8c0 () zhao function! SearchNoComment(str, opt) let b:found = 0 while (b:found == 0) call search(a:str, a:opt) let b:name=synIDattr( synID(line('.'), col('.'), 1), name) Whether it's within a comment? if b:name !~? comment let b:found=1 endif endwhile endfunction and, then map the n and N command as follows: nnoremap n :silent call SearchNoComment('C-R=@/CR', 'f')CR nnoremap N :silent call SearchNoComment('C-R=@/CR', 'b')CR For the first search, you use /pattern as normal, for the later search of the same pattern, just use n or N. It won't work for the first search, unless you use :call SearchNoComment('pattern', 'f') I think it's impossible to enable such a feature in a incremental search, is it? Note, you needn't to map # and * command, it's naturally n and N, separately. Thanks Yakov, I will give this function a try over the next few days and see if it does what I want.
How to edit a macro
Hi everyone, In a C programme for example is there a way to get Vim to ignore matches that are commented out when searching for a string? Thanks, Rob.
Re: search visual block
Jean-Rene David wrote: * Lev Lvovsky [2006.10.17 17:15]: Is it possible to search for a string by selecting that string in visual mode? Meaning, if I highlight something, and then want to search for that thing which is highlighted in the rest of the doc? You already got lots of good answers. Here's another one. I've had this in my vimrc for years, and use it when the string I'm searching for is not a keyword. It works both forward and backward, puts the searched pattern in the search history and doesn't screw up any register. -- cut here --- Search for visually selected text {{{ From an idea by Michael Naumann, Jürgen Krämer. function! VisualSearch(direction) range let l:saved_reg = @ execute normal! vgvy let l:pattern = escape(@, '\\/.*$^~[]') let l:pattern = substitute(l:pattern, \n$, , ) if a:direction == 'b' execute normal ? . l:pattern . else execute normal / . l:pattern . endif let @/ = l:pattern let @ = l:saved_reg endfunction vnoremap silent * :call VisualSearch('f')CR vnoremap silent # :call VisualSearch('b')CR -- cut here --- HTH, This sounds brilliant Jean-Rene, I put it into my .vimrc, but it doesn't seem to work, I did notice that between the if and else there are which just act as comments as they are on newlines, didn't know if this was just my text wrapping, so I tried putting them on the line above, both with a space between or not, didn't know if that might be cause but that didn't seem to help either. Sorry I may be missing something obvious, but I'd like to get this to work as it seems very useful. I was selecting text in visual mode, then pressing / or ? and I just get the normal action of pressing / or ? Thanks, Rob.
Re: search visual block
Benji Fisher wrote: On Wed, Oct 18, 2006 at 12:28:28PM +0200, Robert Cussons wrote: Jean-Rene David wrote: [snip] -- cut here --- Search for visually selected text {{{ From an idea by Michael Naumann, Jürgen Krämer. function! VisualSearch(direction) range let l:saved_reg = @ execute normal! vgvy let l:pattern = escape(@, '\\/.*$^~[]') let l:pattern = substitute(l:pattern, \n$, , ) if a:direction == 'b' execute normal ? . l:pattern . else execute normal / . l:pattern . endif let @/ = l:pattern let @ = l:saved_reg endfunction vnoremap silent * :call VisualSearch('f')CR vnoremap silent # :call VisualSearch('b')CR -- cut here --- I think the original included raw CR characters in the two :execute lines. Both are intended to end with ^M (which is how they appeared in my copy of Jean-Rene's note). I think your e-mail client broke the lines, leading to syntax errors. That may well be, don't know too much about how mozilla -mail works I try to avoid such problems by not including raw CR, ESC, etc. characters in my vim scripts. I suggest replacing the two :execute lines with execute normal ? . l:pattern . \CR and execute normal / . l:pattern . \CR HTH --Benji Fisher Everything seems to work fine now, except the searched for items aren't highlighted like they normally are when I search, is there a simple reason or am I just asking for too much, sorry I can't sort this out myself, but I don't understand the function well enough to see a possilbe reason, the only thing I could think of that might cause it would be this in my .vimrc Clears search highlighting by just hitting a return. The BS clears the command line. (From Zdenek Sekera [EMAIL PROTECTED] on the vim list.) I added the final cr to restore the standard behaviour of cr to go to the next line and the mz and `z to return the cursor to its precommand position :nnoremap CR mz:nohlsearchCR/BSCR`z However, if this were interfering it would clear the command line as well and I don't see that so it can't be the cause. Thanks, Rob.
Re: search visual block
Jean-Rene David wrote: * Robert Cussons [2006.10.18 06:30]: I did notice that between the if and else there are which just act as comments as they are on newlines, Sorry, I should have known that wouldn't come out right. There's a literal newline between the quotes. You can enter it by pressing CTRL-VCTRL-M. Here's that section of code with the literal newline entered as two separate characters: if a:direction == 'b' execute normal ? . l:pattern . ^M else execute normal / . l:pattern . ^M endif I was selecting text in visual mode, then pressing / or ? and I just get the normal action of pressing / or ? I agree with what you say below completely, I just didn't express myself clearly enough in the paragraph above, I was just telling you the actions I had performed and it appears I should have been pressing * or # not / or ? as I originally thought, but the lack of the literal newline was causing it not to work too. Well you could do it with / and ? but I like to keep their behavior intact as it is useful to extend the visual region. I remapped * and # instead, as shown in these lines: vnoremap silent * :call VisualSearch('f')CR vnoremap silent # :call VisualSearch('b')CR I prefer that because these don't have any special meaning in visual mode and it ties in nicely with the search next/previous word function they have in normal mode. Thanks for your help, Rob.
Re: search visual block
Jean-Rene David wrote: * Robert Cussons [2006.10.18 09:29]: Everything seems to work fine now, except the searched for items aren't highlighted like they normally are when I search Whether or not search items are highlighted depends on the value of the 'hlsearch' option. The search item gets highlighted on my end when the option is set. Is yours set? :set hls? This is quite strange, it is set, i.e. :set hls? returns hlsearch If I use your visual selection when I first launch gvim, then it works with the highlighting. If I then use Enter to clear the highlighting according to this line in my .vimrc that I gave before: :nnoremap CR mz:nohlsearchCR/BSCR`z then the highlighting is no longer displayed as is expected. If I then do :set hls? again, I get again: hlsearch but if I use your visual selection tool again then this time I get no highlighting. Of course if I set hls again using :set hls then it works fine again until I press enter. So what I was thinking was just to add a :set hls at the start of your function, then it should alway highlight the searched for items, however I tried variations on including it but no nothing about scripting so they didn't work, can you tell me how I should add it? I tried the below but it didn't work. Thanks, Rob. Search for visually selected text {{{ From an idea by Michael Naumann, Jürgen Krämer. function! VisualSearch(direction) range set hlsearch let l:saved_reg = @ execute normal! vgvy let l:pattern = escape(@, '\\/.*$^~[]') let l:pattern = substitute(l:pattern, \n$, , ) if a:direction == 'b' execute normal ? . l:pattern . \r else execute normal / . l:pattern . \r endif let @/ = l:pattern let @ = l:saved_reg endfunction vnoremap silent * :call VisualSearch('f')CR vnoremap silent # :call VisualSearch('b')CR
Re: [SPAM?]Re: VIM as C++ IDE
This is brilliant, I've never used make from inside Vim before, please surpress your sniggersAs I am working on Linux with a microsoft ergonomic keyboard, I have an unused windows button or two, how would I map the right hand one to the same mapping as below, i.e. instead of F12? As KDE's control centre in the custom shortcuts returns Win for the windows button, I tried: map Win+M ESC:wkEnter:makekEnter:copekEnter but it doesn't seem to do anything, how does Vim interpret the windows key? Many thanks, Rob. [EMAIL PROTECTED] wrote: Peng Yu [EMAIL PROTECTED] 写于 2006-10-14 05:59:29: map F12 ESC:wkEnter:makekEnter Can some body provide some script to satisfy my more general requirement? I want press F12, then make is called. The error window will not be closed unless I do so. When I brower the error, the file where the error is from will be open automatically and the cursor is put in the error line? Thanks, Peng for that simple, don't need any plugin: map F12 ESC:wkEnter:makekEnter:copekEnter You see, just add the :cope will do the trick. Note that the cursor will be in :cope window then, you may need to press an enter key to go into the first error. But what to do when there's no error? then CR does nothing. -- Sincerely, Pan, Shi Zhu. ext: 2606
Re: VIM as C++ IDE
[EMAIL PROTECTED] wrote: As far as I know Vim cannot recognize the Win key (Please correct me if I'm wrong). In fact, it isn't that difficult to type all those, so I'd refer to keep the :cope window on all the time, and I have the habit to input :w everytime I changed a new line. So all I need to do is to type :make, which isn't complex and I don't need a short-cut for that. Note that you need to set your 'makeprg' right. I agree with that, but how do I keep the :cope window on all the time set cope in .vimrc or something? However, if all you need is to make use of the Win key, KDE can be set to something like the 4-modifiers KDE default, and that's the settings I'm currently using that and I use win shortcut key on most KDE-related features. sorry, I don't really understande what you mean by this...although I've just noticed that I have under KDE modifiers: ModifierX11-Mod Shift shift Ctrlcontrol Alt mod1 Win mod4 I think I need to read up on what these KDE modifiers mean, anyway thanks for the help with using make. Rob.
Re: BOF
Bill McCarthy wrote: Hello Vim List, I listened to Bram's BOF this past weekend. I still don't know what BOF means. From Wikipedia: BoF is an acronym for: Basic Oxygen Furnace Birds of a Feather beginning of file Body-on-frame Breath of Fire BOF can also mean: Baptism of Fire Board of Finance Battalions of Fear Biography of Ferns boron oxyfluoride. Best of Five British Orienteering Federation I would guess Birds of a Feather. Which is it? Surely Bit of Fun should be included in that list :-) Rob.
Re: different format of features in :version
IMHO, that depends on for what reason you are looking at it, if you are looking whether a particular feature is included or not the present alphabetical ordering offers you the fastest (?) way of finding that information Nikolai Weibull wrote: On 8/15/06, Yakov Lerner [EMAIL PROTECTED] wrote: I want to suggest different format of features listing in output of :version. There's always the possibility of adding a :version! alternative. nikolai -- Robert Cussons Office SB3 3.163, Theory Group Gesellschaft für Schwerionenforschung mbH (GSI) Planckstraße 1 64291 Darmstadt Germany. Tel: +49 (0)6159 71 2754 E-mail: [EMAIL PROTECTED]
Re: different format of features in :version
IMHO, that depends on for what reason you are looking at it, if you are looking whether a particular feature is included or not the present alphabetical ordering offers you the fastest (?) way of finding that information Nikolai Weibull wrote: On 8/15/06, Yakov Lerner [EMAIL PROTECTED] wrote: I want to suggest different format of features listing in output of :version. There's always the possibility of adding a :version! alternative. nikolai -- Robert Cussons Office SB3 3.163, Theory Group Gesellschaft für Schwerionenforschung mbH (GSI) Planckstraße 1 64291 Darmstadt Germany. Tel: +49 (0)6159 71 2754 E-mail: [EMAIL PROTECTED]
Re: [OT] Who forwarded my message to eBay?
Charles E Campbell Jr wrote: Edward L. Fox wrote: Somebody in this mailing list had forwarded one of my post to eBay customer support center. I think this mail puzzled eBay so much, although they still promised that they will still try their best to help me with my problem. Here is the response from eBay customer support: 8 Dear eBay Member, Thank you for writing to eBay. I am sorry to inform you that after reading your email, I am unclear as to the exact problem you are experiencing. I am ready to help you with this issue, but for me to help, I need you to send in more information. This will help me answer your question correctly. Please send back a detailed explanation of your problem and I will reply to you very quickly. I appreciate your patience and understanding regarding this matter and I am sorry for any inconvenience caused to you. Sincerely, Shania K. EBay's helpdesk gets subscribed somehow, and its a robot; at least, I've seen no sign whatsoever of a human involved. That includes the supposed name, in this case Shania K., attached to the robot's replies, which I suspect is simply a random lookup or construct. Gotta train your spam filter just to reject it. Regards, Chip Campbell Not sure it's a robot as I seem to remember when I received them and when Tony brought up this subject before, the answer was along the same lines, but the wording was different, either that or they've changed their generic answer...
inserting a character space whilst remaining in normal mode
Hi all, something I find myself doing quite often is the above, i.e. I have: extract(p,f,m,n) and I want extract(p, f, m, n) and rather than going to the comma and pressing 'a', 'space', 'Esc' I would prefer to use a single key and stay in normal mode, can someone give me a pointer to the place in the help for this, I tried insert, but that is all about insert mode. Many thanks, Rob.
Re: inserting a character space whilst remaining in normal mode
Yakov Lerner wrote: On 8/7/06, Robert Cussons [EMAIL PROTECTED] wrote: Hi all, something I find myself doing quite often is the above, i.e. I have: extract(p,f,m,n) and I want extract(p, f, m, n) and rather than going to the comma and pressing 'a', 'space', 'Esc' I would prefer to use a single key and stay in normal mode, can someone give me a pointer to the place in the help for this, I tried insert, but that is all about insert mode. I have this mapping in my vimrc: :nmap space i esc Just type space in normal mode to indent things (to insert space). Use it all the time :-) Yakov Thanks Tim and Yakov, I had realised I could do a mapping but before I did just wanted to check I wasn't missing a key that already did the job in vim, yours looks like a logical mapping Yakov as space acts the same as l as far as I can see in normal mode and I have never used it anyway. Thanks for the help, Rob.
Chip's block substitution script
Sorry Chip, you are absolutely right, I obviously didn't test it thoroughly enough the last time, just tried it out again and of course it does as you said and reassembles the strings again when you are finished. Very nice little script. Thanks, Rob.
Re: Put the cursor in the middle of screen when replacing
Carlos Liu wrote: On 8/2/06, Tim Chase [EMAIL PROTECTED] wrote: How to put cursor in the middle of screen when replacing words? I have to see the next few lines to know replace or not, but the word always sit in the bottom of the screen. Sounds like you're looking for the 'scrolloff' setting. :help 'scrolloff' will provide details on this. It allows you to keep a certain number of lines on the screen at the same time. If you set it to an outrageously high value, it will keep the cursor centered vertically on the screen. That's exactly what I want. Thank you! This is more out of interest to increase my knowledge of vim, but wouldn't incorporting the 'zz' command from normal mode somehow achieve the same?
Re: substituting only in visual block
Bernd Strohhäcker wrote: Dr. Johannes Zellner schrieb: Hi, having marked a visual block with ctrl-v, I'd like to so a search / replace only in that visual block. E.g. when selecting the right block in: xx xx xx xx xx xx xx xx I'd to do something like s/xx/yy/g which applies only to the selected block. How can I do this? Hi, try Charles Campell's vis-script: http://www.vim.org/scripts/script.php?script_id=1195 HTH, Bernd Thanks for the pointer to this, it is a useful script, if Charles is out there today, just a little point, it doesn't seem to like 'c' being used in substitutions, don't know if you already new about that. But perhaps I should give an example, if I have the text below, with the two columns under fh in the top line highlighted, so the 6th and 7th character in each line highlighted: sdasdfhafdlhasdf dsfhalshdflkashf adfhalasdfhasdfl asdfhaldfhlsadhf sahdflakshfdl then I use the command: :','B s/l/m/g I get the result: sdasdfhafdlhasdf dsfhamshdflkashf adfhamasdfhasdfl asdfhamdfhlsadhf sahdfmakshfdl as you would expect, all l's in these two columns have been changed to m's. Now I do the same but I want to be prompted: :','B s/l/m/gc but this time I get this result: sdasdafdlhasdf dsfhahdflkashf adfhasdfhasdfl asdfhdfhlsadhf sahdfkshfdl fh ls la al la Thanks for the script though Charles, I look forward to using it. Rob.
Re: Differences with vim 7
Yakov Lerner wrote: On 7/31/06, Robert Cussons [EMAIL PROTECTED] wrote: snip Are those two vims built with same GUI libraries ? I suspect that they are build with different GUIs. Can you send first 4 lines out :version output from each of two vims ? Yakov P.S. I remember that I had similar issue between one Qt-based program and similar Xt-based program. I set same font for them two, but they showed it rather differently. Maybe you'll want to rebuild vim7 to use same GUI as your vim6.3. If you send first 4 lines from both vims :version, we'll know which GUI they are both built with. VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 31 2006 08:50:59) Included patches: 1-42 Compiled by ... Huge version with X11-Motif GUI. Features included (+) or not (-): VIM - Vi IMproved 6.3 (2004 June 7, compiled Jul 30 2005 12:36:01) Included patches: 1-71, 81-82 Compiled by ... Big version with GTK2 GUI. Features included (+) or not (-): Seems you have hit the nail on the head Yakov, how would I rebuild Vim7 using your script but changing the GUI is it using the --configure options? a) install package 'openmotif-devel' or (motif-dev or what's called) b) ./vim7-install.sh enable-gui=motif Caution: you must make sure motif-dev is instaleld, first. Yakov Thanks very much to everyone who helped with this, I'm afraid I chickened out in the end and asked the network administrator, he backported a vim 7 compiled with GTK2 GUI onto my machine, which has solved the problem. Many thanks again for all the help, Rob.
Re: [SPAM?]Re: gvimdiff and gvim 7 in windows
[EMAIL PROTECTED] wrote: Robert Cussons [EMAIL PROTECTED] wrote on 2006.07.21 19:19:56: because this is the size I want my gvim window to be when it opens, however as gvimdiff opens at least two buffers I would like it to open full screen, is there a way of getting this to happen? gvim 7 in windows part: I also use gvim at home, but there I use gvim 7 on windows instead of gvim 6.3 on debian. So I have a few questions: How do I use gvimdiff in windows? If I already have a gvim window open how do I launch a new separate instance of gvim from inside the first window (without having to go to the desktop and click the icon!) Sorry this is more of a windows question than gvim: On my linux machine running KDE I have Ctrl-Shift-G set up to launch gvim, is there a way to set a keyboard shortcut in Windows XP to do the same? Many thanks for any help, Rob. If you want to maximize the window in Windows, here is the way: if has(gui_win32)NT Windows autocmd GUIEnter * :simalt ~x endif Note that it should be wrapped inside an autocmd group, if you don't have any autocmd inside your .vimrc, here is the way: augroup vimrcEx autocmd! put your autocmd here. augroup END About diff mode: I use the following to test for diff mode, but I forget why it works. let in_diff_mode = 0 windo let in_diff_mode = in_diff_mode + l:diff if in_diff_mode == 1 do something else do something else endif About short-cut key for launch gvim? just create a shortcut on desktop or start menu, then right click to change the properties, the short cut key could be set there. -- Sincerely, Pan, Shi Zhu. ext: 2606 A very late reply to this, thanks for the diff mode tip that works great on Linux, I will try it on windows later. The short-cut key works, I had already tried it, but I was trying to type in the box rather than press the keys themselves, DOH! The only problem is that if you already have a gvim session running all the shortcut key does is maximize it, but nevermind, in that case I will just use what Tony suggested: !gvim Thanks, Rob.
Differences with vim 7
I just installed vim 7 on my linux system at work (more specifically debian sarge running KDE 3.3) and I get a few funny things happening. It is installed in my home/bin directory as I don't have root permissions. All comments seem to come out underlined and the fonts for everything including the menus are different to before, I don't know how to check the current font setting, but when I type :set, there doesn't seem to be anything that would have changed the font listed. Anyone had the same problems? Many thanks for any help, Rob.
Re: Differences with vim 7
Peter Hodge wrote: Some GUIs will allow you to use the command set guifont=* Which brings up a font selection window. If that works, you can select a font and then use set guifont to find out exactly what to add to your .vimrc regards, Peter --- Yakov Lerner [EMAIL PROTECTED] wrote: On 7/31/06, Robert Cussons [EMAIL PROTECTED] wrote: I just installed vim 7 on my linux system at work (more specifically debian sarge running KDE 3.3) and I get a few funny things happening. It is installed in my home/bin directory as I don't have root permissions. All comments seem to come out underlined and the fonts for everything including the menus are different to before, I don't know how to check the current font setting, but when I type :set, there doesn't seem to be anything that would have changed the font listed. Anyone had the same problems? :set guifont? Yakov Send instant messages to your online friends http://au.messenger.yahoo.com Thanks Yakov and Peter, it appears that the problem may be more with Vim7 finding the fonts on my system. I had Sans regular 12 on Vim6.3 and the list of fonts there is greater than that in Vim7, do I need to tell Vim where to look for fonts, if so how do I check where Vim 6.3 looks and tell Vim 7 to look there as well. I think this is because 6.3 is a network wide install and 7 is installed in my home directory. Thanks, Rob.
Re: Differences with vim 7
Robert Cussons wrote: Peter Hodge wrote: Some GUIs will allow you to use the command set guifont=* Which brings up a font selection window. If that works, you can select a font and then use set guifont to find out exactly what to add to your .vimrc regards, Peter --- Yakov Lerner [EMAIL PROTECTED] wrote: On 7/31/06, Robert Cussons [EMAIL PROTECTED] wrote: I just installed vim 7 on my linux system at work (more specifically debian sarge running KDE 3.3) and I get a few funny things happening. It is installed in my home/bin directory as I don't have root permissions. All comments seem to come out underlined and the fonts for everything including the menus are different to before, I don't know how to check the current font setting, but when I type :set, there doesn't seem to be anything that would have changed the font listed. Anyone had the same problems? :set guifont? Yakov Send instant messages to your online friends http://au.messenger.yahoo.com Thanks Yakov and Peter, it appears that the problem may be more with Vim7 finding the fonts on my system. I had Sans regular 12 on Vim6.3 and the list of fonts there is greater than that in Vim7, do I need to tell Vim where to look for fonts, if so how do I check where Vim 6.3 looks and tell Vim 7 to look there as well. I think this is because 6.3 is a network wide install and 7 is installed in my home directory. Thanks, Rob. I just discovered that the font is not Sans regular 12 on Vim6.3 because when I use :set guifont=* although that is the font that is highlighted, if I actually apply it then the font changes (to Sans regular 12) and to change it back I have to use :set guifont= with no argument, so I guess I must be displaying the default font or something?
Re: Differences with vim 7
Yakov Lerner wrote: 1. In vim6.3 , try :set guifont? and select the font name with mouse 2. In vim7, try :set guifont=xxx where xxx if font name as you selected it from vim6.3 If you get the right font, then put this :set guifont=xxx line into .vimrc Yakov Hi Yakov, :set guifont? yields the same result in both cases: guifont= with no font specified, but the fonts are not the same, hence I think they must be looking at a different default font somewhere. If I knew what the actual font it was using in vim6.3 was, then I would be able to do something, but I can't see how to find out. Any ideas anyone? Thanks, Rob.
Re: Differences with vim 7
Yakov Lerner wrote: On 7/31/06, Robert Cussons [EMAIL PROTECTED] wrote: Yakov Lerner wrote: 1. In vim6.3 , try :set guifont? and select the font name with mouse 2. In vim7, try :set guifont=xxx where xxx if font name as you selected it from vim6.3 If you get the right font, then put this :set guifont=xxx line into .vimrc Yakov Hi Yakov, :set guifont? yields the same result in both cases: guifont= with no font specified, but the fonts are not the same, hence I think they must be looking at a different default font somewhere. If I knew what the actual font it was using in vim6.3 was, then I would be able to do something, but I can't see how to find out. Any ideas anyone? I do not know of other way other than brute-froce searching in 'set guifont=*' for the right name/size. I have: :set guifont=Monospace\ 9 in my vimrc (this is GTK2 gvim) but font names are different depending on gui flavor of gvim. Take a look at Antonie's tip http://www.vim.org/tips/tip.php?tip_id=632 Setting the font in the GUI Yakov Thanks Yakov, I will look over Antoine's tip in more detail tonight and see if I can't find a solution. Many thanks, Rob.
Re: Differences with vim 7
Robert Cussons wrote: Peter Hodge wrote: Some GUIs will allow you to use the command set guifont=* Which brings up a font selection window. If that works, you can select a font and then use set guifont to find out exactly what to add to your .vimrc regards, Peter --- Yakov Lerner [EMAIL PROTECTED] wrote: On 7/31/06, Robert Cussons [EMAIL PROTECTED] wrote: I just installed vim 7 on my linux system at work (more specifically debian sarge running KDE 3.3) and I get a few funny things happening. It is installed in my home/bin directory as I don't have root permissions. All comments seem to come out underlined and the fonts for everything including the menus are different to before, I don't know how to check the current font setting, but when I type :set, there doesn't seem to be anything that would have changed the font listed. Anyone had the same problems? :set guifont? Yakov Send instant messages to your online friends http://au.messenger.yahoo.com I found out by accident that the font is Monospace 10, so I put the following line in my .vimrc set guifont=Monospace\ 10 but I still get different fonts, I have attached a screenshot of two gvim sessions, lhs is gvim7, rhs is gvim6.3, if you look at the bottom of each window is sets the font as I have just executed :set guifont? in each of the windows. They have both accessed and read the .vimrc it would seem, so what is wrong? Any help would be greatly appreciated, this is becoming mildly frustrating :-) Rob. I just got this e-mail bounced back, turns out I can't send a .png file to the group, don't have any ideas how else to show it to anyone that cares :-( and could help :-)
Re: Differences with vim 7
snip Are those two vims built with same GUI libraries ? I suspect that they are build with different GUIs. Can you send first 4 lines out :version output from each of two vims ? Yakov P.S. I remember that I had similar issue between one Qt-based program and similar Xt-based program. I set same font for them two, but they showed it rather differently. Maybe you'll want to rebuild vim7 to use same GUI as your vim6.3. If you send first 4 lines from both vims :version, we'll know which GUI they are both built with. VIM - Vi IMproved 7.0 (2006 May 7, compiled Jul 31 2006 08:50:59) Included patches: 1-42 Compiled by ... Huge version with X11-Motif GUI. Features included (+) or not (-): VIM - Vi IMproved 6.3 (2004 June 7, compiled Jul 30 2005 12:36:01) Included patches: 1-71, 81-82 Compiled by ... Big version with GTK2 GUI. Features included (+) or not (-): Seems you have hit the nail on the head Yakov, how would I rebuild Vim7 using your script but changing the GUI is it using the --configure options? Many thanks for your help, Rob.
Re: a question about subsitution....
Thanks Yakov, that was the explanation I wanted. Rob. Yakov Lerner wrote: On 7/12/06, Robert Cussons [EMAIL PROTECTED] wrote: Thanks Max and Chip, I didn't realis that \ and \ were used to denote the beginning and end of the word and therefore they could be used separately, I always just thought of them as a way of getting an exact match, which I suppose is almost the same thing, however, I still don't understand why you can't exclusively mark the start of this string with \ Try /\*\word\ , it will work. But /\\* will never match, becuse \ requires alphabetic character after it. When you put non-alphabetic char [*] to the right of \, \ will *NEVER* match. I know this is non-intuituve, but this is how it works. \ requires alphabetic char to the right of it. This is why \[*] never matches. \ requires alphabetic char to the right of it. This is why \\* never matches. \ requires alphabetic char right after it. Thisis the reason \\* never matches. Yakov -- Robert Cussons Office SB3 3.163, Theory Group Gesellschaft für Schwerionenforschung mbH (GSI) Planckstraße 1 64291 Darmstadt Germany. Tel: +49 (0)6159 71 2754 E-mail: [EMAIL PROTECTED]
Re: a question about subsitution....
Thanks Max and Chip, I didn't realis that \ and \ were used to denote the beginning and end of the word and therefore they could be used separately, I always just thought of them as a way of getting an exact match, which I suppose is almost the same thing, however, I still don't understand why you can't exclusively mark the start of this string with \ Thanks for the help, Rob. Charles E Campbell Jr wrote: Max Dyckhoff wrote: As I understand it, the \ and \ tokens represent the beginning and end of a word. This means that the character immediately after the \ token must be a word character, namely letters, numbers, and underscore (as defined by the iskeyword option). Max ...snip: At some points in my code I had a variable that was a pointer that was denoted (in C) by: *iterNum I wanted to replace instances of exactly this string globally between my present position and line 791, with: j So try :791,.s/\*iterNum\/j/g (or :.,791s/... depending on what your current line is rltv to 791) Regards, Chip Campbell
a question about subsitution....
Hi everyone, I have a point of interest question about a substitution I was trying to make. At some points in my code I had a variable that was a pointer that was denoted (in C) by: *iterNum I wanted to replace instances of exactly this string globally between my present position and line 791, with: j therefore I tried the command below: :.,791s/\\*iterNum\/j/g and got the following error, even though the string *iterNum appeared a number of times within this range: E486: Pattern not found: \\*iterNum\ I was fairly certain that the * had to be escaped, but just in case I tried the below: :.,791s/\*iterNum\/j/g and not surprisingly got an two errors, as follows: E56: * operand could be empty E476: Invalid command So, in the end I gave up with the identical match and instead just used the following and checked it afterwards, I could of course have used c on the end as well to prompt me each time: :.,791s/\*iterNum/j/g My question (sorry this is so long-winded) is why the first substition did not work. Many thanks, Rob.
Re: Vertical selection
Hi guys, I knew about the Ctrl-V with I command, but have never used it with A. So out of interest I just tried it, but it appends at the next point in front of the cursor, not at the end of the line, as I expected A to act, I guess this is because you are in some way taking the A command from visual mode Gerald Lai wrote: 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 -- Robert Cussons Office SB3 3.163, Theory Group Gesellschaft für Schwerionenforschung mbH (GSI) Planckstraße 1 64291 Darmstadt Germany. Tel: +49 (0)6159 71 2754 E-mail: [EMAIL PROTECTED]
Re: Vertical selection
Thanks for the tip Benji, just to make the difference between 'I' and 'A' in blockwise visual mode clear to anyone else who might be reading this and doesn't know, 'I' will always insert in the position immediately before the selected block, whilst 'A' will always insert in the position immediately after the selected block and as Benji said, pressing '$' followed by 'A' whilst in blockwise visual mode will insert at the end of each line. Sorry if no-one else cares:-) Benji Fisher wrote: On Fri, May 19, 2006 at 10:34:27AM +0200, Robert Cussons wrote: Hi guys, I knew about the Ctrl-V with I command, but have never used it with A. So out of interest I just tried it, but it appends at the next point in front of the cursor, not at the end of the line, as I expected A to act, I guess this is because you are in some way taking the A command from visual mode First, a slight correction: it appends after the Visual selection. If you start at the (upper or lower) left and move the cursor right (and down or up), then this is the same as appending after the cursor. It is different if you start the Visual selection at the right and move left. Second, if you want to append at the ends of the lines, use $ (end of line) while in Blockwise-Visual mode. HTH --Benji Fisher -- Robert Cussons Office SB3 3.163, Theory Group Gesellschaft für Schwerionenforschung mbH (GSI) Planckstraße 1 64291 Darmstadt Germany. Tel: +49 (0)6159 71 2754 E-mail: [EMAIL PROTECTED]
Re: Shell support in Vim?
Suresh Govindachar wrote: Frank Terbeck wrote: Suresh Govindachar Personally, the step mentioned below, viz., moving the mouse to the xterm is a _big_ pain. As a user, what I like about the idea of a shell inside vim is the means to avoid the mouse. C-Z in console vim does avoid the mouse but it doesn't allow simultaneous view and fast access of vim and the shell; and the shell from C-Z doesn't support commands supported by a vim buffer. Just use GNU screen http://www.gnu.org/software/screen/. There's no need for a mouse just to switch between vim and a shell at all. Thanks, but I am on Windows. Also, poking around in https://savannah.gnu.org/projects/screen leads one to the mailing list http://groups.yahoo.com/group/gnu-screen which has the notice: GNU screen is NOT developed any more. The maintainers only fix serious bugs. From the dates of the files, development on screen stopped in Jan 2004. I suspect developing a terminal is a complex project. - The rxvt shell from MinGW is not recommend by them for general use (and does odd things when one uses it generally); - tcsh from Amol cannot run UnixUtils from http://unxutils.sourceforge.net. - There is someone who patches vim to support a shell but does so only for Unix; he doesn't support it for Windows and I do not know if he has gone beyond 6.3 or 6.4. --Suresh --Suresh Hi Suresh, it may be that I'm being dense, but what is the problem with Alt-Tab ing between windows to use both a console and gvim?
Re: swapping tab and escape
Hi All, Matt kindly suggested this mapping for the above inoremap m-i tab nnoremap tab esc vnoremap tab escgV inoremap tab esc`^ but how would I add a mapping to make tab work as escape in the command line, also is there any loss of functionality making this mapping, I don't use tab in the command line, but does it do anything useful that I don't know about? Thanks, Rob.