Re: Subject: Re: vim on cygwin using win32 clipboard
On 3/1/07, Gary Johnson [EMAIL PROTECTED] wrote: On 2007-03-01, Frodak Baksik [EMAIL PROTECTED] wrote: On 2/28/07, Matthew Woehlke [EMAIL PROTECTED] wrote: Gary Johnson wrote: It appears that I may need to install the ncurses package and reconfigure vim in order to get color. That would be likely; ncurses is (AFAIK) *much* better than termcap. Try getting ncurses and gettext libraries. Both are available packages in cygwin. There are several ncurses packages to choose from, but I finally figured out that I needed libncurses-devel, so I installed that, reconfigured and rebuilt vim and voila: color! It's not as clear to me what I need to resolve these differences: 36c36 +gettext --- -gettext 111c111 Linking: gcc -L/usr/local/lib -o vim.exe -lncurses -liconv -lintl --- Linking: gcc -L/usr/local/lib -o vim.exe -lncurses -liconv My Cygwin installation already has /usr/include/libintl.h /usr/lib/libintl.a /usr/lib/libintl.dll.a /usr/lib/libintl.la which appear to be what /usr/src/vim-7.0.122-1/src/auto/configure is looking for, so I don't understand what is missing and therefore which of the following likely-looking Cygwin packages I should install: gettext gettext-devel if either. On the other hand, I don't think I ever use any of vim's internationalization features, so it probably doesn't matter, especially for the purpose of evaluating this patch. In fact, I just checked the vims I use on HP-UX, SunOS and Linux and none of them have +gettext or -lintl. Thanks again for your help. I'll let you know if I find any issues with the clipboard. Regards, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Mobile Broadband Division | Spokane, Washington, USA You'll want to install the gettext-devel package for the +gettext feature. Thanks, Frodak
Re: Bug report: mapping fails with a few characters (i.e.: « :imap ’ foo » fails)
2007/3/2, A.J.Mechelynck [EMAIL PROTECTED]: Mapping seems to be buggy with some characters. For instance: :imap ' foo does not work (the apostrophe is U+2019). What is 'encoding' set to? Using multibyte characters (e.g. in a mapping) will only work if 'encoding' (which defines how characters are represented internally in Vim memory) is set to an appropriate multibyte setting beforehand The encoding is set to utf-8. My point is, mapping works with some multibyte characters, but not all of them. For example: :imap ∀ foo ... that is, mapping the forall symbol (U+2200), works. Since I can map some multibyte characters, there is in my opinion no issue with the encoding. The question is: why is it possible to map U+2200 but not U+2019? Regards, thomas
Re: Bug report: mapping fails with a few characters (i.e.: « :imap ’ foo » fails)
thomas wrote: 2007/3/2, A.J.Mechelynck [EMAIL PROTECTED]: Mapping seems to be buggy with some characters. For instance: :imap ' foo does not work (the apostrophe is U+2019). What is 'encoding' set to? Using multibyte characters (e.g. in a mapping) will only work if 'encoding' (which defines how characters are represented internally in Vim memory) is set to an appropriate multibyte setting beforehand The encoding is set to utf-8. My point is, mapping works with some multibyte characters, but not all of them. For example: :imap ∀ foo ... that is, mapping the forall symbol (U+2200), works. Since I can map some multibyte characters, there is in my opinion no issue with the encoding. The question is: why is it possible to map U+2200 but not U+2019? Regards, thomas Hm. It just might be a bug, but Bram would be better able than me to check this. I can map Char-0x2019 but I cannot really test that it works (I can just see that it is represented correctly in the list of mappings), because that character is not on my keyboard. U+2019 is encoded as E2 80 99 while U+2200 is E2 88 80. I wonder if the presence of a 0x80 in the middle might cause a bug in gvim. Did you try the code snippet in my previous post? If it works, then we can start digging why your previous method didn't work. If it doesn't, we should have a clear-cut testcase for others to try and reproduce. Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 80. At parties, you introduce your spouse as your service provider.
patch 7.0.206
Patch 7.0.206 (after 7.0.058) Problem:Some characters of the gb18030 encoding are not handled properly. Solution: Do not use cp936 as an alias for gb18030 encoding. Instead initialize 'encoding' to cp936. Files: src/mbyte.c, src/option.c *** ../vim-7.0.205/src/mbyte.c Tue Dec 5 22:09:02 2006 --- src/mbyte.c Tue Feb 27 16:27:44 2007 *** *** 364,370 {949, IDX_CP949}, {936, IDX_CP936}, {gbk, IDX_CP936}, - {gb18030, IDX_CP936}, /* only 99% the same */ {950, IDX_CP950}, {eucjp, IDX_EUC_JP}, {unix-jis, IDX_EUC_JP}, --- 364,369 *** ../vim-7.0.205/src/option.c Tue Oct 17 18:36:03 2006 --- src/option.cThu Mar 1 21:02:06 2007 *** *** 3290,3295 --- 3290,3303 * If not, go back to the default latin1. */ save_enc = p_enc; p_enc = p; + if (STRCMP(p_enc, gb18030) == 0) + { + /* We don't support gb18030, but cp936 is a good substitute +* for practical purposes, thus use that. It's not an alias to +* still support conversion between gb18030 and utf-8. */ + p_enc = vim_strsave((char_u *)cp936); + vim_free(p); + } if (mb_init() == NULL) { opt_idx = findoption((char_u *)encoding); *** ../vim-7.0.205/src/version.cTue Feb 27 23:06:44 2007 --- src/version.c Fri Mar 2 19:58:04 2007 *** *** 668,669 --- 668,671 { /* Add new patch number below this line */ + /**/ + 206, /**/ -- You can tune a file system, but you can't tuna fish -- man tunefs /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: Bug report: mapping fails wit h a few characters (i.e.: « :im ap ’ foo » fails)
Bram Moolenaar wrote: [...] How can you tell if the mapping works or not? You can see what a key actually produces with CTRL-V key . So when you type :imap CTRL-V key foo Where CTRL-V is one key and key is the mapped key. Does the mapping still not work? When I type :map! “ - where the {lhs}, U+201C (double high 6 quote) is produced on my keyboard by AltGr-v then, :map! list the mapping with “ (the character in question) in the {lhs}, but hitting AltGr-v in Insert mode inserts “ (the {lhs}) not - (the {rhs}). Using Ctrl-V before the key when defining the mapping makes no change: hitting the key still doesn't invoke the mapping, but :map! “ (again, with or without Ctrl-V) lists it. Best regards, Tony. -- The grand leap of the whale up the Fall of Niagara is esteemed, by all who have seen it, as one of the finest spectacles in nature. -- Benjamin Franklin.
Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored
Hi alex, On Thu, 2007-03-01 at 16:33 +0100, Alexander Farber wrote: Hello Hugh, On 3/1/07, Hugh Sasse [EMAIL PROTECTED] wrote: :scriptnames 1: C:\Documents and Settings\afarber\.vimrc 2: C:\Program Files\Vim\vim70\syntax\syntax.vim 3: C:\Program Files\Vim\vim70\syntax\synload.vim 4: C:\Program Files\Vim\vim70\syntax\syncolor.vim 5: C:\Program Files\Vim\vim70\filetype.vim 6: C:\Program Files\Vim\vim70\menu.vim 7: C:\Program Files\Vim\vim70\autoload\paste.vim 8: C:\Program Files\Vim\vim70\plugin\getscript.vim 9: C:\Program Files\Vim\vim70\plugin\gzip.vim 10: C:\Program Files\Vim\vim70\plugin\matchparen.vim 11: C:\Program Files\Vim\vim70\plugin\netrwPlugin.vim 12: C:\Program Files\Vim\vim70\plugin\rrhelper.vim 13: C:\Program Files\Vim\vim70\plugin\spellfile.vim 14: C:\Program Files\Vim\vim70\plugin\tarPlugin.vim 15: C:\Program Files\Vim\vim70\plugin\tohtml.vim 16: C:\Program Files\Vim\vim70\plugin\vimballPlugin.vim 17: C:\Program Files\Vim\vim70\plugin\zipPlugin.vim 18: C:\Program Files\Vim\vim70\syntax\actionscript.vim Is this Vim or gVim? If the later, where's the .gvimrc file? If the former, putting guifg=... in the .vimrc is meaningless. If you're using gVim create a .gvimrc file in the same directory as the .vimrc. Place the guifg=... stuff in there. What is the output of scriptnames now? Is the syntax as you'd like it now? cheers, -- Mark
Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored
Mark Woodward wrote: Hi alex, On Thu, 2007-03-01 at 16:33 +0100, Alexander Farber wrote: Hello Hugh, On 3/1/07, Hugh Sasse [EMAIL PROTECTED] wrote: :scriptnames 1: C:\Documents and Settings\afarber\.vimrc 2: C:\Program Files\Vim\vim70\syntax\syntax.vim 3: C:\Program Files\Vim\vim70\syntax\synload.vim 4: C:\Program Files\Vim\vim70\syntax\syncolor.vim 5: C:\Program Files\Vim\vim70\filetype.vim 6: C:\Program Files\Vim\vim70\menu.vim 7: C:\Program Files\Vim\vim70\autoload\paste.vim 8: C:\Program Files\Vim\vim70\plugin\getscript.vim 9: C:\Program Files\Vim\vim70\plugin\gzip.vim 10: C:\Program Files\Vim\vim70\plugin\matchparen.vim 11: C:\Program Files\Vim\vim70\plugin\netrwPlugin.vim 12: C:\Program Files\Vim\vim70\plugin\rrhelper.vim 13: C:\Program Files\Vim\vim70\plugin\spellfile.vim 14: C:\Program Files\Vim\vim70\plugin\tarPlugin.vim 15: C:\Program Files\Vim\vim70\plugin\tohtml.vim 16: C:\Program Files\Vim\vim70\plugin\vimballPlugin.vim 17: C:\Program Files\Vim\vim70\plugin\zipPlugin.vim 18: C:\Program Files\Vim\vim70\syntax\actionscript.vim Is this Vim or gVim? If the later, where's the .gvimrc file? If the former, putting guifg=... in the .vimrc is meaningless. If you're using gVim create a .gvimrc file in the same directory as the .vimrc. Place the guifg=... stuff in there. What is the output of scriptnames now? Is the syntax as you'd like it now? cheers, It's perfectly possible to run gvim with no gvimrc (it does source the vimrc). :highlight commands would sit better in a colorscheme, but regardless of whether they're in a colorscheme or in the vimrc, it's possible to set both cterm[bf]g= and gui[bf]g= (and term= if deemed necessary) in the same :hi command. IIUC, :syntax on resets all colors, re-invoking the current colorscheme if any: thus it's usually less problematic to define colors in a colorscheme. (When default colors are OK, the corresponding highlight groups can be omitted.) See (attached) an example colorscheme, which is the one I use for my day-to-day editing. It may help you design your own. To use this one, drop it in ~/.vim/colors and add colorscheme almost-default to your vimrc. Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 79. All of your most erotic dreams have a scrollbar at the right side. Vim color file Maintainer: Tony Mechelynck [EMAIL PROTECTED] Last Change: 2006 Sep 06 This is almost the default color scheme. It doesn't define the Normal highlighting, it uses whatever the colors used to be. Only the few highlight groups named below are defined; the rest (most of them) are left at their compiled-in default settings. Set 'background' back to the default. The value can't always be estimated and is then guessed. hi clear Normal set bg Remove all existing highlighting and set the defaults. hi clear Load the syntax highlighting defaults, if it's enabled. if exists(syntax_on) syntax reset endif Set our own highlighting settings hi SpecialKey guibg=NONE hi PyjamaEven ctermbg=greygui=NONEguibg=#FFD8FF white on red is not always distinct in the GUI: use black on red then hi Errorguibg=red guifg=black hi clear ErrorMsg hi link ErrorMsg Error show cursor line/column (if enabled) in very light grey in the GUI, underlined in the console if has(gui_running) hi clear CursorLine hi CursorLine guibg=#F4F4F4 endif hi clear CursorColumn hi link CursorColumn CursorLine do not make help bars and stars invisible hi clear helpBar hi link helpBarhelpHyperTextJump hi clear helpStar hi link helpStar helpHyperTextEntry the following were forgotten in the syntax/vim.vim (and ended up cleared) hi clear vimVar hi link vimVar Identifier hi clear vimGroupName hi link vimGroupName vimGroup hi clear vimHiClear hi link vimHiClear vimHighlight display the status line of the active window in a distinctive color: bold black on bright red in the GUI, white on green in the console (where the bg is never bright, and dark red is sometimes an ugly sort of reddish brown). hi StatusLine gui=NONE,bold guibg=red guifg=black \ cterm=NONE,bold ctermbg=green ctermfg=white make the status line bold-reverse (but BW) for inactive windows hi StatusLineNC gui=reverse,bold \ cterm=reverse,bold define colors for the tab line: file name of unselected tab hi TabLine gui=NONEguibg=#EE guifg=black \ cterm=NONE,bold ctermbg=lightgrey ctermfg=white file name of selected tab (GUI default is bold black on white) hi TabLineSel cterm=NONE,bold
Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored
Hello all, I have received many nice replies, thank you! Unfortunately none of them worked for me yet, lest editing C:\Program Files\Vim\vim70\syntax\syncolor.vim which is not what I need (please read below why). May I rephrase my question please? Does anybody please have a line, which I could put into my ~/.vimrc and which would invert the color of Comment's in vim and gvim on any OS? And here is the background: I work on different machines (servers, PCs, laptops) and OSs (Windows, Cygwin, Solaris, HP, Linux and at home OpenBSD). And I edit c/java/perl/shell/actionscript source code. Until now I was very happy with my vim, because I could come anywhere, drop my ~/.vimrc into home dir (with: hi Commentterm=inverse ctermfg=white ctermbg=black guifg=white guibg=black ) and start working in 2 minutes (laughing at the emacs and other editor users, who would run around and whine, that something doesn't work for them). Unfortunately as of Vim 7.0 this does not work for me. And while I can edit ...\Vim\vim70\syntax\syncolor.vim on a PC, I don't have permissions on Unix to do that. So does anybody has a line for ~/.vimrc for me, so that I put that file on my USB-keychain and on my web server and can reuse it anywhere? Thank you very much Regards Alex -- http://preferans.de
Re: Telnet commands from Vim ?
On Thu, 1 Mar 2007, Eric Roberts wrote: A.J.Mechelynck wrote: Eric Roberts wrote: Hi, I'm interested in being able to send/recieve telnet messages. It's for a debugger that is used over telnet. I know this is a fairly esoteric problem, and as far as I can tell there's no direct way of doing this but I thought I'd might ask to be sure. If there isn't any direct support for this - what's the best method of extending Vim to do this? I've looked at the the vimsh plugin - which does nearly what I need it too, except interactive programs like the telnet client program on windows doesn't work. The gdbvim and the clewn project seem to demonstrate that is definately possible to communicate between different processes and Vim. I don't mind a learning curve, I'm just interested in where would I start? ;) Thanks for your time in advance, - Eric Why do you want to use Vim to send and receive telnet messages? Vim is a text editor, not a front-end for an interactive program like a shell (see :help shell-window) or the telnet program. Start gvim in one (MS-Windows) window and telnet from a Dos Box in another window, and you'll have Vim and telnet on the same screen. Or if you're dead set on launching interactive sessions in an editor window, use emacs (withing a Cygwin shell if necessary). Best regards, Tony. As stated above, it's for a telnet debugger. Vim is a programmer friendly text I'd agree that this still seems like the wrong question :-) Is the debugger running on the same machine as vim? Why does it use telnet? Else, can you make it not do that, and [telnet to the remote machine and ] just use the debugger with vim, without vim knowing abut telnet, on the remote host? Most vim use of things like :compiler and :make are non-interactive. I think if you need to do this then you should use Expect, and/or Perl/Ruby/???'s expect-like library to turn the telnet interaction into something scripted and non-interactive. Getting the interaction right is about the trickiest part of using Expect-like programs. Maybe the debugger has an API so you can drive it programmatically? That could save you some of the pain of handling interaction for humans by machine. Maybe someone knows about this debugger already, and if you tell people what it is they can help better? editor and there seems to be a fair amount of effort to extend it to work with debuggers and I was curious about extending it to a specific one in my case. I would think that the existing extensions to use Vim with gdb would be somewhat analogous to my situation. - Eric Hugh
A loud thought
Hi Vimmers, I'm thinking something aloud. When I work, I largely use tag-jumps (CTRL-] and CTRL-T). Also, I rely on the on the ordinary jumps (CTRL-O and CTRL-I). When I jump to a tag, the target tag is displayed in the same window. At the same time it also happens that the current buffer (%) is changed to the buffer in which the tag is diaplayed and alternate buffer (#) is the previous buffer from which i did a CTRL-]. Now I have two ways to go back: CTRL-^ and CTRL-T. Once I'm back, I can revisit the tag in two ways: by issuing :tag command and pressing CTRL-O. As a result, my ordinary jump list is mixed with the tag stack. Wouldn't it be more convinient, if it were like both (jump list and tag stack) are kept separate, so that CTRL-O/CTRL-I would result in a tag visit? Let the tag stack show only tag visits, and the ordinary jump list show just the jumps. Is such a feature already there, if not, isn't it possible if that worth it? Does any body know a solution for this? Thanks Jeenu
Re: Workspace concept ala TextPad
Hi Yegappan [...] Remove the ! before the let. let file_names = input(Enter file name(s): , '', 'file') - Yegappan Thanks, it works Rgds, Eric _ Win a Zunemake MSN® your homepage for your chance to win! http://homepage.msn.com/zune?icid=hmetagline
Re: Mapping to the numerical - and + and *
Thanks all. I got it working what I wanted by copying the mswin.vim file and stripping it to what I wanted. When you don't understand vim-scripting as I do then good copying is beter then bad designing . Rgds, Eric ---START kMinus and CTRL-X and SHIFT-Del are Cut vnoremap kMinus+x vnoremap S-Del +x vnoremap C-X +x kMultiply and CTRL-C and CTRL-Insert are Copy vnoremap kMultiply +y vnoremap C-Insert +y vnoremap C-C +y kPlus and CTRL-V and SHIFT-Insert are Paste map kPlus +gP map S-Insert +gP map C-V+gP cmap kPlus C-R+ cmap S-Insert C-R+ cmap C-V C-R+ Pasting blockwise and linewise selections is not possible in Insert and Visual mode without the +virtualedit feature. They are pasted as if they were characterwise instead. Uses the paste.vim autoload script. exe 'inoremap script kPlus' paste#paste_cmd['i'] exe 'vnoremap script kPlus' paste#paste_cmd['v'] exe 'inoremap script C-V' paste#paste_cmd['i'] exe 'vnoremap script C-V' paste#paste_cmd['v'] imap S-Insert kPlus vmap S-Insert kPlus imap S-Insert C-V vmap S-Insert C-V Use CTRL-Q to do what CTRL-V used to do noremap C-QC-V ---END _ Win a Zunemake MSN® your homepage for your chance to win! http://homepage.msn.com/zune?icid=hmetagline
mark an anchor
If I am in line 100, now I want to search a key which will lead me to wherever. I want to back to the place before the seach, can vim support anchor for me to back? Thanks. ABAI
Help files to read
What are some good help files to read if I want to learn: - To use Vim itself - To create vimscripts/vim modules Robert
RE: Help files to read
For learning vim, there's actually a Vim book from the Vim page. -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Robert Hicks Sent: Friday, March 02, 2007 9:46 AM To: vim@vim.org Subject: Help files to read What are some good help files to read if I want to learn: - To use Vim itself - To create vimscripts/vim modules Robert
Re: mark an anchor
* Bin Chen [2007.03.02 09:45]: If I am in line 100, now I want to search a key which will lead me to wherever. I want to back to the place before the seach, can vim support anchor for me to back? If I understand your question, CTRL-O will do what you want. :h CTRL-O -- JR
Re: mark an anchor
If I am in line 100, now I want to search a key which will lead me to wherever. I want to back to the place before the seach, can vim support anchor for me to back? There are several possibilities, depending on your forethought and quantity of travel. If you jump elsewhere (searching, making large movements such as page-up/down, etc), you can use control+O and control+I (that's oh and eye, not zero and one) to navigate the jump-list (:help jumplist). Control+o goes back to previous jumps and then control+i moves forward in your list of jumps. If you plan ahead, you can use the 26 named marks (:help mark). You can do something like ma to drop the a mark at your current location. You can then freely navigate all over your document, and then use `a or 'a to jump back to where you were. The apostrophe just jumps to the line, while the back-tick jumps to the line and character-position. Since you can mark any letter you want, you can use ma, mb, mc...mz to mark up to 26 locations (if you can remember them) and them use `a, `b, `c,...`z to jump back to each of them. If you're forgetful, you can use the :marks command and vim will tell you where you can jump to with the apostrophe/backtick. Note that some are read-only so you can't set them, but they offer conveniences such as the backtick-backtick: you can also use backtick-backtick to toggle between the last two locations, jumping back and forth. Hope this gives you several new ways to work. I use a combo of both marks (when I remember that there's someplace important I want to jump back to) and the jumplist to see where I've been. -tim
Making my own Vim memento with a shortcut
Hi, I suppose it is possible to do this in Vim (what's not ?) : 1. Write a file listing all my shortcuts in VimDoc format ; 2. Assign this file to a mapping, say i.e Shift+F5 ; If so, 1. Where to find references on the VimDoc format ? Should I have to place it inside 'doc' ? 2. How ? Thanks.
Re: mark an anchor
Thank you! But what is back-tick? Tim Chase 写道: If I am in line 100, now I want to search a key which will lead me to wherever. I want to back to the place before the seach, can vim support anchor for me to back? There are several possibilities, depending on your forethought and quantity of travel. If you jump elsewhere (searching, making large movements such as page-up/down, etc), you can use control+O and control+I (that's oh and eye, not zero and one) to navigate the jump-list (:help jumplist). Control+o goes back to previous jumps and then control+i moves forward in your list of jumps. If you plan ahead, you can use the 26 named marks (:help mark). You can do something like ma to drop the a mark at your current location. You can then freely navigate all over your document, and then use `a or 'a to jump back to where you were. The apostrophe just jumps to the line, while the back-tick jumps to the line and character-position. Since you can mark any letter you want, you can use ma, mb, mc...mz to mark up to 26 locations (if you can remember them) and them use `a, `b, `c,...`z to jump back to each of them. If you're forgetful, you can use the :marks command and vim will tell you where you can jump to with the apostrophe/backtick. Note that some are read-only so you can't set them, but they offer conveniences such as the backtick-backtick: you can also use backtick-backtick to toggle between the last two locations, jumping back and forth. Hope this gives you several new ways to work. I use a combo of both marks (when I remember that there's someplace important I want to jump back to) and the jumplist to see where I've been.
Re: mark an anchor
Thank you! glad to help But what is back-tick? It, on US keyboards, usually shares the same key as the tilde (~). A reverse-apostrophe if you will: ` instead of ' (no those aren't specs of dust on your screen...the top one is a backtick/back-apostrophe that you're interested in, and the bottom one is a regular apostrophe) The backtick is ascii character 0x60 while the apostrophe is 0x27 HTH, -tim
Re: Making my own Vim memento with a shortcut
I suppose it is possible to do this in Vim (what's not ?) : of course :) 1. Write a file listing all my shortcuts in VimDoc format ; 2. Assign this file to a mapping, say i.e Shift+F5 ; If so, 1. Where to find references on the VimDoc format ? Should I have to place it inside 'doc' ? :help write-local-help :help add-local-help 2. How ? Once you have the helpfile written (say custom_help.txt), including the target tags that :help should jump to, you can do something like :nnoremap s-f5 :help custom_help.txtcr You can muddle around with the example given at the above help which should get you in the right direction. -tim
Re: Making my own Vim memento with a shortcut
Tim Chase a écrit : I suppose it is possible to do this in Vim (what's not ?) : of course :) 1. Write a file listing all my shortcuts in VimDoc format ; 2. Assign this file to a mapping, say i.e Shift+F5 ; If so, 1. Where to find references on the VimDoc format ? Should I have to place it inside 'doc' ? :help write-local-help :help add-local-help 2. How ? Once you have the helpfile written (say custom_help.txt), including the target tags that :help should jump to, you can do something like :nnoremap s-f5 :help custom_help.txtcr You can muddle around with the example given at the above help which should get you in the right direction. -tim Thanks Tim, cheers : Kib.
RE: mark an anchor
If I am in line 100, now I want to search a key which will lead me to wherever. I want to back to the place before the seach, can vim support anchor for me to back? If you just went to one other line, eg, line 150, '' will get you back to line 100. If you searched and got to line 150, then hit 'n' and got to line 163, then another 'n' brought you to line 213, '' would then take you back to line 163. If you want to literally mark line 100 as your anchor, which is what I think you actually want, then mm will mark that as mark 'm'. I just use 'm' because it's the same key, and 'n' as a secondary mark, but others might use marks 'a' and 'b' (ma and mb commands). In that case 'm will bring you back to the beginning of line 100 no matter where you are. Haven't used this in a while (farther to reach the key :D ), but `m should bring you back to the exact character on line 100 should you desire.
Unicode U+2028 line separator
I have a utf-8 file that uses the unicode line separator. Not something I've come across very often. In utf-8 the sequence is: 0xE2 0x80 0xA8 (e280a8) In a uxterm vim correctly reads (and sets) the file encoding as utf8 (there's no BOM on the file), but the U-2028 character is displayed as an un-displayable character and not displayed as a new line. That is, all the text is displayed as a single line. Can anyone educate me a bit on the use of the Line Separator character and if or how it can be supported in Vim? I'm having other problems -- such as the Perl script that is reading this file doesn't see the character as a new line (although it does see it as a matching a \s regular expression. -- Bill Moseley [EMAIL PROTECTED]
Re: hi Comment guifg=white guibg=black in ~/.vimrc ignored
You should set 'background' option. set background=lightor dark hi ... hi ... If 'background' option is not set, Vim may change it while initializing GUI (after vimrc is sourced). Then syntax/syncolor.vim is sourced and highlight settings are reset. -- Yukihiro Nakadaira - [EMAIL PROTECTED]
Searching within a delimited area
Hi foks. How would I search for a regex within a particular area? The text document is very long, and I don't want to match all instances, just those I care about. I would probably select the text visually. Thanks in advance. Afton.
Re: Help with errorformat
Does anyone know how to use the %*{conv} construct in the errorformat string? On Thu, 2007-03-01 at 11:46 -0500, Clive Anderson wrote: Can some kind soul help me to match the following compiler output line? runner: *E,NOPBIND (string_arrays.sv,3|20): Package string_package could not be bound. My attemp (which does not work properly) is: CompilerSet errorformat=%m:\ *%t\,%m\ (%f\,%l\|%c):\ %m Clive..
Re: Searching within a delimited area
How would I search for a regex within a particular area? The text document is very long, and I don't want to match all instances, just those I care about. I would probably select the text visually. If you happen to know the line numbers of your interesting section, you can use /\200l\100lregexp which will search for regexp as long as it falls between line 100 and line 200 (exclusive). Alternatively, you can use something like :vnoremap g/ c-c/bslash%c-r=line('lt)-1crlbslash%ltc-r=line(')+1crl (all in one line) will prime the search line with the search line-limiting. This makes it a bit easier so that within a visually selected range, type g/ and then type your search regexp after the prepopulated line. This works for line-wise visual mode. Character-wise and block-wise get a whole lot hairier. Hope this gives you some ideas, -tim
Re: Searching within a delimited area
Wow! Ok. the first seems clear enough, but a little tedious for the number of lines I have (it's delimited text, so I could always note the line number, %, note the line number, then use that search). The latter seems like dark magic. I'll meditate upon it while consulting the book of :help Thanks for the super speedy reply! Afton. On 3/2/07, Tim Chase [EMAIL PROTECTED] wrote: How would I search for a regex within a particular area? The text document is very long, and I don't want to match all instances, just those I care about. I would probably select the text visually. If you happen to know the line numbers of your interesting section, you can use /\200l\100lregexp which will search for regexp as long as it falls between line 100 and line 200 (exclusive). Alternatively, you can use something like :vnoremap g/ c-c/bslash%c-r=line('lt)-1crlbslash%ltc-r=line(')+1crl (all in one line) will prime the search line with the search line-limiting. This makes it a bit easier so that within a visually selected range, type g/ and then type your search regexp after the prepopulated line. This works for line-wise visual mode. Character-wise and block-wise get a whole lot hairier. Hope this gives you some ideas, -tim
Re: Searching within a delimited area
Wow! Ok. the first seems clear enough, but a little tedious for the number of lines I have (it's delimited text, so I could always note the line number, %, note the line number, then use that search). The latter seems like dark magic. I'll meditate upon it while consulting the book of :help Thanks for the super speedy reply! c-c/bslash%c-r=line('lt)-1crlbslash%ltc-r=line(')+1crl It's only magic until you understand it :) It basically uses the control+R followed by the equals-sign to insert the evaluation of expressions to determine the lines just outside your selection: :help c_CTRL-R_= The expressions are line(')-1 (the number of the line before the start of the selection) and line(')+1 (the number of the line after the end of the selection) So it just is inserting those line numbers into the {} blocks in: \%{start-1}l\%{end+1}l with some escaping of things like back-slashes and less-than signs. Hope this helps pull back the mystery of the line-noise above. -tim
Re: Searching within a delimited area
On 3/2/07, Tim Chase [EMAIL PROTECTED] wrote: Wow! Ok. the first seems clear enough, but a little tedious for the number of lines I have (it's delimited text, so I could always note the line number, %, note the line number, then use that search). The latter seems like dark magic. I'll meditate upon it while consulting the book of :help Thanks for the super speedy reply! c-c/bslash%c-r=line('lt)-1crlbslash%ltc-r=line(')+1crl It's only magic until you understand it :) Of course you are right. I was unfamiliar with both c-r and line commands/functions/thingies, but with those, it seems unlike something I would write, but straightforward enough to understand. The C-R seems outrageously useful for one-off macros! Thanks again. Afton.
RE: Searching within a delimited area
Hi foks. How would I search for a regex within a particular area? The text document is very long, and I don't want to match all instances, just those I care about. I would probably select the text visually. Thanks in advance. Afton. A different question is easier to answer. How do I do something with a search expression within a visually selected area? That may get you the result you are looking for. 1. search for your regex in entire file: /textSearchingFor 2. visually select the area you care about 3. do something with visually selected lines and searched for stuff. Example: replace textSearchingFor with newText: :','s//newText The ',' that vim puts in when you type ':' while you have something visually selected makes the rest of the command only work within the visually selected area. Hope this helps, Brian
Re: Searching within a delimited area
Afton Lewis wrote: How would I search for a regex within a particular area? The text document is very long, and I don't want to match all instances, just those I care about. I would probably select the text visually. With vis.vim, a plugin available from: http://mysite.verizon.net/astronaut/vim/index.html#VIS or a more stable version from: http://vim.sourceforge.net/scripts/script.php?script_id=1195 you may use visual mode (either line, character, or block; ie. either with V, v, or ctrl-v) to select a region, then use :S regexp and the search will only pick up items in that region. Regards, Chip Campbell
Re: Unicode U+2028 line separator
Bill Moseley wrote: I have a utf-8 file that uses the unicode line separator. Not something I've come across very often. In utf-8 the sequence is: 0xE2 0x80 0xA8 (e280a8) In a uxterm vim correctly reads (and sets) the file encoding as utf8 (there's no BOM on the file), but the U-2028 character is displayed as an un-displayable character and not displayed as a new line. That is, all the text is displayed as a single line. Can anyone educate me a bit on the use of the Line Separator character and if or how it can be supported in Vim? I'm having other problems -- such as the Perl script that is reading this file doesn't see the character as a new line (although it does see it as a matching a \s regular expression. I may be wrong, but IIUC this codepoint plays the same role as the HTML br tag: it does not define an end of line in the text file which contains it, but it means that, when rendered typographically, as in a browser or a WYSIWYG editor (neither of which Vim is, or tries to mimic), the rendered output must have a linebreak at this point. IOW: I think it's a feature, not a bug. You can add a linebreak after every occurrence of that codepoint by using :exe %s/\Char-0x2028/ . '\0\r/g' Note that I intentionally use double quotes in the first part and single quotes in the second part. Best regards, Tony. -- It is said that the lonely eagle flies to the mountain peaks while the lowly ant crawls the ground, but cannot the soul of the ant soar as high as the eagle?
configure Vim for Thunderbird on Mac
Q: How to configure Vim as external editor for Thunderbird on OS X? Thanks, Alan Isaac
Inserting text on the right side of the cursor and the repeat command
I was recently playing around with Tim Pope's surround.vim and noticed that it suffers the same problem that my unreleased AutoClose.vim. Namely, the plugin provides an i_ctrl-gs mapping which inserts an opening string and a closing string, placing the cursor between the two. For example, typing c-gs'foo results in 'foo|' appearing in the doucment (with the | being the cursor). My plugin behaves similarly, typing 'foo gets you 'foo|' and typing ' gets you 'foo'|. This is fine, this is good, but when you try to repeat the insertion (.) after a surround.vim c-gs you don't get 'foo' like you expect, but rather some odd behavior related to how he implemented his insert function. My problem manifests itself differently -- I'd get ''foo on a repeat -- but the cause is the same. I'm not aware of any plugins that insert text on the right side of the cursor without breaking repeat. I've avoided releasing AutoClose because of this*. Is such a thing possible? * Well, this and the issue of how to insert single openers/closers without having to toggle the plugin or use ^v.