Re: findfile() results are inconsistent
Dnia wtorek, 25 lipca 2006 02:14, Eric Van Dewoestine napisał: 1. We are in /home/mikolaj:: echo findifile(b, 1;) 1/b You are giving findfile() a relative path to search, so it is returning a relative result. Result is the same regardless to path in second argument. m.
Re: findfile() results are inconsistent
Dnia wtorek, 25 lipca 2006 07:11, A.J.Mechelynck napisał: I don't see any inconsistency. According to the help, findfile() is Just like |finddir()|, but find a file instead of a directory. and finddir() has: When the found directory is below the current directory a relative path is returned. Otherwise a full path is returned. Isn't that what you got? OK. But even when described it is inconsistency. Is the semicolon really obligatory? :lcd $VIMRUNTIME/doc :echo findfile(help.txt,.) (without a colon), returns help.txt, which is the expected result. Try it from directory below $VIMRUNTIME/doc. Without ; it doesn't look up. m.
Re: findfile() results are inconsistent
On 7/25/06, Mikolaj Machowski [EMAIL PROTECTED] wrote: Dnia wtorek, 25 lipca 2006 02:14, Eric Van Dewoestine napisał: 1. We are in /home/mikolaj:: echo findifile(b, 1;) 1/b You are giving findfile() a relative path to search, so it is returning a relative result. Result is the same regardless to path in second argument. Yes, my mistake. From the vim docs: When the found directory is below the current directory a relative path is returned. Otherwise a full path is returned. 1) 1/b is below your current directory so a relative path is returned as described in the documentation. 2) 3) In these examples the result is not at or below the current directory. So, the results are still consistent with the documented behavior. Regarding ';', the docs imply that it forces a search upwards, but should probably state that explicitly. -- eric
Re: Crazy wish: vimcat
Benji Fisher wrote: On Fri, Jul 21, 2006 at 03:31:15PM -0500, mwoehlke wrote: Is this possible? It just occurred to me that it would be great if there was a VIM-related program that would 'cat' in color using VIM's highlighting rules. Is this something that VIM could be made to do via scripting, or would it need to be a totally new program? If the latter, any guesses how hard it would be to make such a critter? I notice that echo ':q' | vim file sort-of works... it gives the first page, plus trailing '~'s (if less then a page), although this wouldn't work with TERM's where curses displays are a separate buffer (like 'xterm', but not 'linux'). Maybe this is what you want: http://www.vim.org/tips/tip.php?tip_id=121 I keep meaning to play with this, but it occurs to me I am pretty sure this is not what I want. First off, I want 'cat', not 'more' (i.e. not a pager). Second, for it to work right, it has to *not* use the termlib, for the above-mentioned reason. -- Matthew DOS Attack: See America Online -- my college room mate
Bug in filetype.vim w.r.t. mutt temp file names
I noticed recently that vim does not always set 'filetype' to mail when I edit mutt temporary files, e.g., postponed messages. I traced the problem to mutt's use of mktemp() with the pattern muttXX. I don't know about other OSs, but mktemp() on SunOS 5.8 replaces those Xs with characters from the POSIX portable filename character set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 . _ - The pattern used in filetype.vim to match file names of this form is mutt\w\{6\} The \w character class does not include the characters '.' or '-'. I replaced that pattern with this one: mutt[[:alnum:]._-]\{6\} I was surprised that [:alnum:] worked in the context of an autocommand filename pattern. I didn't want to use \f because it included too much. A patch is attached. I have posted it here rather than sending it to Bram directly to allow others to comment in case I missed something. Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA *** filetype.vim.orig Mon May 8 16:43:45 2006 --- filetype.vimTue Jul 25 13:27:55 2006 *** *** 877,883 au BufNewFile,BufRead *.mgp setf mgp Mail (for Elm, trn, mutt, rn, slrn) ! au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt\w\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail Mail aliases au BufNewFile,BufRead /etc/mail/aliases,/etc/aliases setf mailaliases --- 877,883 au BufNewFile,BufRead *.mgp setf mgp Mail (for Elm, trn, mutt, rn, slrn) ! au BufNewFile,BufRead snd.\d\+,.letter,.letter.\d\+,.followup,.article,.article.\d\+,pico.\d\+,mutt{ng,}-*-\w\+,mutt[[:alnum:]._-]\{6\},ae\d\+.txt,/tmp/SLRN[0-9A-Z.]\+,*.eml setf mail Mail aliases au BufNewFile,BufRead /etc/mail/aliases,/etc/aliases setf mailaliases
Re: Bug in filetype.vim w.r.t. mutt temp file names
On 7/26/06, mwoehlke [EMAIL PROTECTED] wrote: Gary Johnson wrote: I noticed recently that vim does not always set 'filetype' to mail when I edit mutt temporary files, e.g., postponed messages. I traced the problem to mutt's use of mktemp() with the pattern muttXX. I don't know about other OSs, but mktemp() on SunOS 5.8 replaces those Xs with characters from the POSIX portable filename character set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 . _ - The pattern used in filetype.vim to match file names of this form is mutt\w\{6\} The \w character class does not include the characters '.' or '-'. I replaced that pattern with this one: mutt[[:alnum:]._-]\{6\} I was surprised that [:alnum:] worked in the context of an autocommand filename pattern. I didn't want to use \f because it included too much. A patch is attached. I have posted it here rather than sending it to Bram directly to allow others to comment in case I missed something. Ok, you asked for comments :-). What's wrong with: mutt[\w.-]\{6\} I think \w is not recognized inside []. Yakov
Re: Bug in filetype.vim w.r.t. mutt temp file names
Yakov Lerner wrote: On 7/26/06, mwoehlke [EMAIL PROTECTED] wrote: Gary Johnson wrote: I noticed recently that vim does not always set 'filetype' to mail when I edit mutt temporary files, e.g., postponed messages. I traced the problem to mutt's use of mktemp() with the pattern muttXX. I don't know about other OSs, but mktemp() on SunOS 5.8 replaces those Xs with characters from the POSIX portable filename character set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 . _ - The pattern used in filetype.vim to match file names of this form is mutt\w\{6\} The \w character class does not include the characters '.' or '-'. I replaced that pattern with this one: mutt[[:alnum:]._-]\{6\} I was surprised that [:alnum:] worked in the context of an autocommand filename pattern. I didn't want to use \f because it included too much. A patch is attached. I have posted it here rather than sending it to Bram directly to allow others to comment in case I missed something. Ok, you asked for comments :-). What's wrong with: mutt[\w.-]\{6\} I think \w is not recognized inside []. Hmm... ok, maybe not. I must be thinking of KATE and '\s'. Or maybe KATE also supports '\w' in []'s. -- Matthew DOS Attack: See America Online -- my college room mate
Re: Why does Press ENTER or type command to continue appear when 12 columns left?
On 7/25/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 7/23/06, Nikolai Weibull [EMAIL PROTECTED] wrote: On 7/23/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 7/23/06, Nikolai Weibull [EMAIL PROTECTED] wrote: When output from for example :echon comes within 12 columns of the right hand margin the Press ENTER or type command to continue prompt appears. Why is this so? It's used for ':set showcmd'. If you want full screen width for messages, unset ':set showcmd' to ':set noshowcmd'. Ah. Forgot about 'showcmd'. I found a solution/trick that prints long 1-line messages always without Press Enter: http://www.vim.org/tips/tip.php?tip_id=1289 how to print wide (full screen width) messages without Press Enter prompt Hehe, of course! So simple! I'm going to use that. Thanks! nikolai P.S. Nice to see your face, Nikolai! Hehe, yeah; I always look like that :-).
Re: findfile() results are inconsistent
Dnia wtorek, 25 lipca 2006 16:50, Eric Van Dewoestine napisał: So, the results are still consistent with the documented behavior. But not internally consistent. But OK - it is documented behaviour. Regarding ';', the docs imply that it forces a search upwards, but should probably state that explicitly. Maybe link to file-searching? Thanks Yakov. m.
Bug in :runtime ?
Hello Vim Developers, I was timing the startup process by stepping though what I think Gvim does (on Win XP Pro with 7.0.42). gvim -u NONE -N That starts up without _vimrc or _gvimrc or plugins and sets nocp. :so $vim\_vimrc worked fine. :so $vim\_gvimrc also worked fine. :ru! plugin\**\*.vim didn't seem to do anything. Repeating the above as :verb ru! plugin\**\*.vim reports: not found in 'runtimepath': plugin\**\*.vim Hmm, when I tried again with the unixy :ru! plugin/**/*.vim the plugins were finally sourced. Bug? -- Best regards, Bill
Re: Bug in :runtime ?
Bill McCarthy wrote: Hello Vim Developers, I was timing the startup process by stepping though what I think Gvim does (on Win XP Pro with 7.0.42). gvim -u NONE -N That starts up without _vimrc or _gvimrc or plugins and sets nocp. :so $vim\_vimrc worked fine. :so $vim\_gvimrc also worked fine. :ru! plugin\**\*.vim didn't seem to do anything. Repeating the above as :verb ru! plugin\**\*.vim reports: not found in 'runtimepath': plugin\**\*.vim Hmm, when I tried again with the unixy :ru! plugin/**/*.vim the plugins were finally sourced. Bug? IIUC, it's a feature: \* means a literal asterisk. Not a very good feature since IIUC, asterisks are not allowed in filenames on Windows. Or can they happen in long file names? ... Don't you have a HOME directory? On XP, I would expect that to default to %HOMEDRIVE%%HOME£PATH% if you don't define it (something like C:\Documents and Settings\username ) -- and, since XP is a multiuser OS, it allows each user to have a different set of preferences. $VIM, OTOH, would normally be something like C:\Program Files\Vim , which is the same for everyone. Best regards, Tony.
Running win32 vim and gvim under Cygwin and pure Windows XP
Most of my development work is done on a Unix system (usually SunOS but sometimes Linux or HP-UX), but some requires that I use Windows XP. Source code is maintained under ClearCase on all these systems except Linux. I'm trying to get my Windows environment tuned up so that development is as easy for me using Windows as it already is using Unix. One thing I've done is installed Cygwin. This has been really nice, but I can't always use the Cygwin environment because of all the tools and applications that understand only Windows. So the environment I think I want is this: when I open gvim from a Windows tool or application, I get a Windows gvim that executes system(), :sh, :!, :r!, etc. in a Windows environment; but when I start vim or gvim from the Cygwin shell, I get the same Windows vim or gvim executable, but one which executes system(), etc., in the Cygwin environment, i.e., pretty much as it would in a real Unix environment. To that end, I have done a standard install of Cygwin, installed the standard vim for Windows from vim.sf.net, put C:\Program Files\Vim\vim70 in my Windows PATH, added export SHELL to my $HOME/.bash_profile, and added the following lines to the top of my _vimrc (C:\Program Files\Vim\_vimrc): if has(win32) $SHELL == /bin/bash executable(C:/cygwin/bin/bash) Running in Cygwin. set shell=C:/cygwin/bin/bash if executable('grep') set grepprg=grep\ -n\ $*\ /dev/null endif if exists(+shellslash) set shellslash endif else set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if diffopt =~ 'icase' | let opt = opt . '-i ' | endif if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif let eq = '' if $VIMRUNTIME =~ ' ' if sh =~ '\cmd' let cmd = '' . $VIMRUNTIME . '\diff' let eq = '' else let cmd = substitute($VIMRUNTIME, ' ', ' ', '') . '\diff' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' ' . arg3 . eq endfunction endif where the outer else clause encloses vim's default MyDiff() for Windows installations. In addition, I have found it necessary to make some changes to some plugins (ctags.vim and ccase.vim) following this example in $VIMRUNTIME/ftplugin/perl.vim: if shellxquote != '' let perlpath = system('perl -e print join(q/,/,@INC)') else let perlpath = system(perl -e 'print join(q/,/,@INC)') endif Vim automatically sets 'shellxquote' to when 'shell' is set to the Cygwin shell. Without this, system() commands don't handle temporary files properly. With this, however, you have to use single-quotes (') instead of double-quotes () in system() commands as shown above. So my questions to anyone else using Vim and Cygwin on Windows XP are: Does what I'm doing make sense? Is there some way to fix the 'shellxquote' problem other than modifying every plugin I use as I've done above? Is there a better way of doing any of this? I suppose I could build a Cygwin-aware vim binary, but I have successfully avoided having to compile anything under Windows so far and would really like to avoid that headache. Regards, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: Other European languages on a US keyboard [OT]
Yakov Lerner wrote: On 7/24/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: The French have used accented letters since (IIUC) before Gutenberg invented printing. While Antonie helps us with bits of history, I thought I'd ask this. I was on irc chat, and somehow the issue of French using a lot of silent letters came up. For example, Peugeot is 7 letters but 4 sounds. I don't speak French, but the tendency is there. Somebody explained that in middle ages, literacy was rare, and scribes were paid by letters written; and scribes would artificially inflate number of letter. Does this explanation hold water ? I know that generally in other languages, the silent letters are artifact of past real sounds that are preserved due to conservatism of orthography. Was if different in French ? Yakov In the Middle Ages, scribes weren't paid commercially (I think): they were monks and had their share in their convent's table and bed. Payment was to the convent, maybe by the thickness of the book, maybe according to the beauty of illustrations (and decorated letters), maybe according to how long it took to read the story aloud, I don't rightly know. Or else maybe some copists were attached to some nobleman's court, and wrote, copied or decorated books in return for being lodged, fed, clad, and generally cared for. I guess many small letters wouldn't have fetched very much more than slightly fewer, but slightly bigger, letters. French orthography has been largely fixed at some point of the Middle Ages (12th century?), but French pronunciation, like English pronunciation, has continued to evolve since then. Just like English spelling does not reflect the Great Vowel Shift, French spelling still uses letters that belong in the etymology, ceased to be pronounced at some point in the past, but reappear in the feminine or in liaison: un grand monsieur -- no liaison, the d in grand is silent un grand homme -- liaison, the d is sounded [t] une grande femme -- feminine, before unvoiced consonant, -de is sounded [t] une grande maison -- feminine, before voiced consonant, -de is sounded [d] elle est grande -- feminine, before pause, [d] une grand-mère -- compound, frozen before the adjective (from Lat. grandis in both genders) acquired -e in the feminine: no liaison, -d is silent. la grandeur -- derived word, with [d] pronounced. There are many such cases, also e.g. with verbs, or with plurals where the -s (from the Latin accusative plural) has remained sounded only in liaison. IIUC, at least some linguists say that those silent letters are not artifacts, but reflect phonemes (is that the word?) that are still present in the mental representation of the language, but are not always pronounced depending on context. I don't know where the proper name Peugeot came from, but -eu- is the standard French graphy for a sound unknown in English (except as the first part of a diphtong in some recent forms of upper-class British English long O) but represented in German as ö; the e after the g is a diacritic, meaning g is pronounced soft before a,o,u; and -ot is a common diminutive ending where the -t (from, I guess, Latin -otus, -otum, as in factotum maybe?) used to be pronounced but isn't anymre. (About -ge- : The spelling of British gaol is much more surprising than its French counterpart geôle when considering how they are pronounced respectively.) Best regards, Tony.
Re: Running win32 vim and gvim under Cygwin and pure Windows XP
Gary Johnson wrote: Most of my development work is done on a Unix system (usually SunOS but sometimes Linux or HP-UX), but some requires that I use Windows XP. Source code is maintained under ClearCase on all these systems except Linux. I'm trying to get my Windows environment tuned up so that development is as easy for me using Windows as it already is using Unix. One thing I've done is installed Cygwin. This has been really nice, but I can't always use the Cygwin environment because of all the tools and applications that understand only Windows. So the environment I think I want is this: when I open gvim from a Windows tool or application, I get a Windows gvim that executes system(), :sh, :!, :r!, etc. in a Windows environment; but when I start vim or gvim from the Cygwin shell, I get the same Windows vim or gvim executable, but one which executes system(), etc., in the Cygwin environment, i.e., pretty much as it would in a real Unix environment. To that end, I have done a standard install of Cygwin, installed the standard vim for Windows from vim.sf.net, put C:\Program Files\Vim\vim70 in my Windows PATH, added export SHELL to my $HOME/.bash_profile, and added the following lines to the top of my _vimrc (C:\Program Files\Vim\_vimrc): if has(win32) $SHELL == /bin/bash executable(C:/cygwin/bin/bash) Running in Cygwin. set shell=C:/cygwin/bin/bash if executable('grep') set grepprg=grep\ -n\ $*\ /dev/null endif if exists(+shellslash) set shellslash endif else set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if diffopt =~ 'icase' | let opt = opt . '-i ' | endif if diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '' . arg1 . '' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '' . arg2 . '' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '' . arg3 . '' | endif let eq = '' if $VIMRUNTIME =~ ' ' if sh =~ '\cmd' let cmd = '' . $VIMRUNTIME . '\diff' let eq = '' else let cmd = substitute($VIMRUNTIME, ' ', ' ', '') . '\diff' endif else let cmd = $VIMRUNTIME . '\diff' endif silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' ' . arg3 . eq endfunction endif where the outer else clause encloses vim's default MyDiff() for Windows installations. In addition, I have found it necessary to make some changes to some plugins (ctags.vim and ccase.vim) following this example in $VIMRUNTIME/ftplugin/perl.vim: if shellxquote != '' let perlpath = system('perl -e print join(q/,/,@INC)') else let perlpath = system(perl -e 'print join(q/,/,@INC)') endif Vim automatically sets 'shellxquote' to when 'shell' is set to the Cygwin shell. Without this, system() commands don't handle temporary files properly. With this, however, you have to use single-quotes (') instead of double-quotes () in system() commands as shown above. So my questions to anyone else using Vim and Cygwin on Windows XP are: Does what I'm doing make sense? Is there some way to fix the 'shellxquote' problem other than modifying every plugin I use as I've done above? Is there a better way of doing any of this? I suppose I could build a Cygwin-aware vim binary, but I have successfully avoided having to compile anything under Windows so far and would really like to avoid that headache. Regards, Gary Interfacing native-Windows programs with the Cygwin environment, or vice-versa, is a ticklish matter. Maybe not insoluble but it requires constant attention to all the differences. See for instance, how src/Make_cyg.mak (used to compile native-Windows Vim using Cygwin tools) uses the cygpath utility (see man cygpath) when generating if_perl.c from if_perl.xs, in order to pass to the native-Windows Perl interpreter a pathname that it can understand. And that is just the most obvious thing: disk paths. In Vim, you probably will need two separate vimrc files, and therefore either two separate $HOME directories (which is not Cygwin's normal usage), or else a bash wrapper script to invoke Windows Vim with a -u command-line option. Since you are already familiar with Unix-like tools, it just might be less of a headache to keep a Cygwin-aware Vim in the Cygwin /usr/bin aka /usr/local/bin directory (which is not part of the Windows %PATH% but comes early in the Cygwin $PATH), and also a native-Windows Vim in (for instance) C:\Program Files\vim\vim70. You can compile them both under Cygwin: the native-windows Vim using src/Make_cyg.mak and the Cygwin-aware Vim (or even gvim for Cygwin X11) using the top-level Makefile. I haven't (yet) built Vim for Cygwin but I have built both native-Windows Vim
search and result
In a function, I am executing a search. I have to implement different things based on whether search got a result or failed with an error. exec '/^\w\+\t\w\+' In the next line, I have to check whether the test passed or failed. How do I do this ? Regards, Shankar Shankar Ramakrishnan Design Engineer MicroController Division Freescale Semiconductor NOIDA - 201 301, INDIA Mobile : 09899125114 Work : +91-120-4394021 Home : +91-120-4333249 This e-mail, and any associated attachments have been classified as: [ ] Public [ ] Freescale Semiconductor Internal Use Only [ ] Freescale Semiconductor Confidential Proprietary
Re: search and result
Hi, SHANKAR R-R66203 wrote: In a function, I am executing a search. I have to implement different things based on whether search got a result or failed with an error. exec '/^\w\+\t\w\+' In the next line, I have to check whether the test passed or failed. How do I do this ? use the search() function: if search('/^\w\+\t\w\+') != 0 do something endif Regards, Jürgen -- Jürgen Krämer Softwareentwicklung HABEL GmbH Co. KGmailto:[EMAIL PROTECTED] Hinteres Öschle 2 Tel: +49 / 74 61 / 93 53 - 15 78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99
RE: search and result
I am actually having a little bit complicated situation. Inside a search() fucntion, can I use, variables. The part of the code is given below. let rs_sig = expand(cword) exec '1' exec '/^\s*module\s\+\w\+' let rs_line=getline(.) let rs_ModuleName=matchstr(rs_line,w\\+\\,0,2) exec 'tabedit D:\Profiles\r66203\_tags\LF\debussy.harlech' if search('/^' . rs_sig . '\t' . rs_ModuleName . '\t') != 0 echo Got the signal inside a module else echo Not got it endif Thanks, Shankar -Original Message- From: Jürgen Krämer [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 25, 2006 3:28 PM To: vim mailing list Subject: Re: search and result Hi, SHANKAR R-R66203 wrote: In a function, I am executing a search. I have to implement different things based on whether search got a result or failed with an error. exec '/^\w\+\t\w\+' In the next line, I have to check whether the test passed or failed. How do I do this ? use the search() function: if search('/^\w\+\t\w\+') != 0 do something endif Regards, Jürgen -- Jürgen Krämer Softwareentwicklung HABEL GmbH Co. KGmailto:[EMAIL PROTECTED] Hinteres Öschle 2 Tel: +49 / 74 61 / 93 53 - 15 78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99
Re: search and result
Hi, SHANKAR R-R66203 wrote: I am actually having a little bit complicated situation. Inside a search() fucntion, can I use, variables. The part of the code is given below. let rs_sig = expand(cword) exec '1' exec '/^\s*module\s\+\w\+' let rs_line=getline(.) let rs_ModuleName=matchstr(rs_line,w\\+\\,0,2) exec 'tabedit D:\Profiles\r66203\_tags\LF\debussy.harlech' if search('/^' . rs_sig . '\t' . rs_ModuleName . '\t') != 0 ^^ the slash is not needed. echo Got the signal inside a module else echo Not got it endif Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)
Re: Problem starting up vim: No mapping found
A.J.Mechelynck [EMAIL PROTECTED] wrote: If you want step-by-step help about how to compile Vim on Unix-like systems, see my page http://users.skynet.be/antoine.mechelynck/vim/compunix.vim I most probably won't compile on the productive servers, but consider to do it on my virtual server. However, I tried the link, and sadly it didn't work :-( -- Thanks for the help, Tobias
Re: Problem starting up vim: No mapping found
On 7/25/06, Tobias Herp [EMAIL PROTECTED] wrote: A.J.Mechelynck [EMAIL PROTECTED] wrote: If you want step-by-step help about how to compile Vim on Unix-like systems, see my page http://users.skynet.be/antoine.mechelynck/vim/compunix.vim I most probably won't compile on the productive servers, but consider to do it on my virtual server. However, I tried the link, and sadly it didn't work :-( You can try to compile vim using this script: http://www.vim.org/scripts/script.php?script_id=1473 vim7_install.sh : Shell script that downloads, builds and installs latest vim7 in 1 command. The latest version of this script picks vim sources from svn, which gives you the latest sources. This script is really easy to use :-) Yakov
Re: Problem starting up vim: No mapping found
Yakov Lerner [EMAIL PROTECTED] wrote: On 7/24/06, Tobias Herp [EMAIL PROTECTED] wrote: Hi, fellow vimmers, just returning to work after two weeks, I found that vim on several Linux machines doesn't start up properly anymore; it says Keine Zuordnung gefunden Keine Zuordnung gefunden (twice the same message; after removing the LANG environment variable, the english version No mapping found was used) You can find from where this message comes using % vim -V20 or % vim -V20 21 | tee logfile and examiging logfile later. Thanks, Yakov, this did the trick; I identified two lines in /etc/vimrc. Important is to examine the logfile /later/, since editing it in the same -V20 session is somewhat tiresome... ;-) BTW, the message No mapping found comes from command :map with lhs but empty rhs, like :map xyz. Yes, right. I wonder why the errors didn't show up earlier... -- Cheers, Tobias
ANN: vim7_install.sh : {download + build + install} latest vim7 from svn sources in 1 command.
If you were always wanted to build vim from sources (on unix/cygwin) but did not know where to start, don't hesitate to pick the vim7_install.sh from http://www.vim.org/scripts/script.php?script_id=1473 , also attached. It allows you to {download, build and install} vim7 in once command, and to customize the build, too. The latest version of vim7_install.sh checks out vim sources from svn. This gives you the latest sources, up to the fresh yesrday's patch. To customize the build, just add the './configure' options as arguments of to 'sh vim7_install.sh' (all arguments beginning with -- are passed to ./configure), or setenv/export environment variables that configuire understands. -- DETAILED DESCRIPTION This shell script is for linux, unix or cygwin (not for windows). Download this script, vim7-install.sh, into any directory and invoke: sh ./vim7-install.sh Script will figure that url of the latest patchlevel of vim7, download the sources, then build and install vim7. No arguments are needed. If you are invoking the script as root, vim will be installed into /usr/local (that is , for everybody). If you are non-root, then you will be prompted for one of two choices: (1) to install vim under your $HOME (for which you do not need root password), or (2) to install vim under /usr/local, for which you need to know root password. All arguments beginning with '--' will be passed to 'configure'. Vim will be built with '--with-features=huge' (unless you pass some other '--with-features=' on the vim7a_install.sh commandline ). -- INSTALL DETAILS No installation is necessary for this script. Just download it and invoke using shell: sh ./vim7a_install.sh If you choose to install vim under into your $HOME/bin, then add $HOME/bin to your PATH. You do this by editing your shell startup script, which depends on your shell (~/.bashrc, ~/.profile, ~/.cshrc, ~/.tcshrc ). Yakov vim7-install.sh Description: Bourne shell script
Re: ANN: vim7_install.sh : {download + build + install} latest vim7 from svn sources in 1 command.
On 7/25/06, Yakov Lerner [EMAIL PROTECTED] wrote: If you were always wanted to build vim from sources (on unix/cygwin) Grammar correction. I wanted to write: If you always wanted ...
Re: Other European languages on a US keyboard [OT]
[more way off topic comments] ...some linguists say that those silent letters are not artifacts, but reflect __phonemes__ (is that the word?) that are still present in the mental representation of the language... --__morphemes__, actually, from a written point of view (you did say letters). They are what's left of the word eroded from Latin and, like night in English, demonstrate (just as you have pointed out) the word's philology (etymology is somewhat correct, but focuses more on semantics than the morphemic transformation). Note: I studied Latin, Greek and Linguistics at Université de Paris X in the late 70s. Many French nouns, for example, evolve from the accusative (direct object) singular form in Latin with further erosion, rosam rose, templum temple, calculus calcule. This also accounts partially for what others see as French's tendency to accentuate the final syllable of a word; actually, there isn't really a tonic accent in French (I won't go into this), but the final of the word was often the penultimate in Latin, often the part receiving the tonic accent in that language (just as now in Italian, Spanish, etc.) and therefore could not be lost without compromising the word itself. Phonemes are (very) roughly equivalent to syllables and exist at the oral or phonetic level. French has the peculiarity, more than most other Western languages in my observation, of its end of word phonemes being greatly ambiguous due to the erosion from Latin already mentioned. Hence, it's easier to find rhymes both rich and otherwise in French even across gender boundaries (whereas Italian and Spanish have kept the o/a alternance when French erodes both feminine am and masculine um to silent e). The resulting explosion in jeux de mots (puns), so looked down upon or at least smirked at in English, is inexplicably prized in French (where it is so much more common in the first place): Le _saint_ père, _sain_ de corps et d'esprit, _ceint_ de vertu, couvait le mal dans son _sein_. (The _holy_ father, while _healthy_ in body and spirit, and _girded_ with virtue, nourished evil in his _breast_. All these underlined words are pronounced identically. There's yet another word or two in French pronounced the same way, but it's been too many years and I can't seem to conjure them up at the moment. If Linguistics paid a decent wage, I probably wouldn't be writing C code for a living. Is this off-topic or what? Russ A.J.Mechelynck wrote: Yakov Lerner wrote: On 7/24/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: The French have used accented letters since (IIUC) before Gutenberg invented printing. While Antonie helps us with bits of history, I thought I'd ask this. I was on irc chat, and somehow the issue of French using a lot of silent letters came up. For example, Peugeot is 7 letters but 4 sounds. I don't speak French, but the tendency is there. Somebody explained that in middle ages, literacy was rare, and scribes were paid by letters written; and scribes would artificially inflate number of letter. Does this explanation hold water ? I know that generally in other languages, the silent letters are artifact of past real sounds that are preserved due to conservatism of orthography. Was if different in French ? Yakov In the Middle Ages, scribes weren't paid commercially (I think): they were monks and had their share in their convent's table and bed. Payment was to the convent, maybe by the thickness of the book, maybe according to the beauty of illustrations (and decorated letters), maybe according to how long it took to read the story aloud, I don't rightly know. Or else maybe some copists were attached to some nobleman's court, and wrote, copied or decorated books in return for being lodged, fed, clad, and generally cared for. I guess many small letters wouldn't have fetched very much more than slightly fewer, but slightly bigger, letters. French orthography has been largely fixed at some point of the Middle Ages (12th century?), but French pronunciation, like English pronunciation, has continued to evolve since then. Just like English spelling does not reflect the Great Vowel Shift, French spelling still uses letters that belong in the etymology, ceased to be pronounced at some point in the past, but reappear in the feminine or in liaison: un grand monsieur -- no liaison, the d in grand is silent un grand homme -- liaison, the d is sounded [t] une grande femme -- feminine, before unvoiced consonant, -de is sounded [t] une grande maison -- feminine, before voiced consonant, -de is sounded [d] elle est grande -- feminine, before pause, [d] une grand-mère -- compound, frozen before the adjective (from Lat. grandis in both genders) acquired -e in the feminine: no liaison, -d is silent. la grandeur -- derived word, with [d] pronounced. There are many such cases, also e.g. with verbs, or with plurals where the -s (from the Latin accusative
a question related to substitution using regular expression
Dear All, My file is like the following: data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947 data_2.dat pre= -444.333 post= -333.545 diff= -777.333 . . I hope to find out a regular expression subtitution commad to delete everything after dat to get a file like: data_1.dat data_2.dat . . I know visual mode will do the work too. But I still hope to find out the substitution command using regular expression so I can use sed to make it automatic. Thank you very much.
Re: a question related to substitution using regular expression
Xiaoshen Li wrote: Dear All, My file is like the following: data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947 data_2.dat pre= -444.333 post= -333.545 diff= -777.333 . . I hope to find out a regular expression subtitution commad to delete everything after dat to get a file like: data_1.dat data_2.dat . . I know visual mode will do the work too. But I still hope to find out the substitution command using regular expression so I can use sed to make it automatic. Any of these will work with vim: :%s/\.dat\zs.*$// :%s/\.dat/.*$/.dat/ :%s/\s\+pre.*$// :%s/^\(data.\{-}\.dat\).*$/\1/ sed doesn't support the same regexp set that vim does. Regards, Chip Campbell
Re: a question related to substitution using regular expression
My file is like the following: data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947 data_2.dat pre= -444.333 post= -333.545 diff= -777.333 . . I hope to find out a regular expression subtitution commad to delete everything after dat to get a file like: data_1.dat data_2.dat . . I know visual mode will do the work too. But I still hope to find out the substitution command using regular expression so I can use sed to make it automatic. Well, you're in luck...the Vim regexp can be the same regexp as for sed: s/\.dat[[:blank:]].*/.dat/ or possibly the slightly shorter s/[[:blank:]]*pre=.*// Some sed's may allow for vim's \s or \ notation, in which case you can trim it even further: s/\.dat\.*/.dat/ or even s/\s*pre=.*// However, in your case, you might even be able to use the cut program: cut -d -f1 text which just asks for the first field, when delimited by spaces (if your original file uses tabs, you can ignore the -d , as cut defaults to using tabs) Just a few ideas... -tim
Re: Other European languages on a US keyboard [OT]
On Tue, Jul 25, 2006 at 10:27:58AM EDT, Russell Bateman wrote: [more way off topic comments] [...] Phonemes are (very) roughly equivalent to syllables and exist at the oral or phonetic level. French has the peculiarity, more than most other Western languages in my observation, of its end of word phonemes being greatly ambiguous due to the erosion from Latin already mentioned. Hence, it's easier to find rhymes both rich and otherwise in French even across gender boundaries (whereas Italian and Spanish have kept the o/a alternance when French erodes both feminine am and masculine um to silent e). The resulting explosion in jeux de mots (puns), so looked down upon or at least smirked at in English, is inexplicably prized in French (where it is so much more common in the first place): Le _saint_ père, _sain_ de corps et d'esprit, _ceint_ de vertu, couvait le mal dans son _sein_. (The _holy_ father, while _healthy_ in body and spirit, and _girded_ with virtue, nourished evil in his _breast_. All these underlined words are pronounced identically. There's yet another word or two in French pronounced the same way, but it's been too many years and I can't seem to conjure them up at the moment. seing .. as in blanc-seing If Linguistics paid a decent wage, I probably wouldn't be writing C code for a living. Is this off-topic or what? Russ
Re: Other European languages on a US keyboard
On Tue, Jul 25, 2006 at 03:09:29AM EDT, A.J.Mechelynck wrote: [..] and it can change fonts on-the-fly (change the font from Courier to Lucida to whatever, only through Vim keyboard commands). I would never want do that.. but just out of curiosity.. why would that not be possible in an xterm? because console Vim has no control over the xterm's fonts. ok. a bit more flexible than toggling the xterm's font. It can do real boldface and italics, as well as straight or curly underlining. That would be for highlighting stuff, right? So the same functionality can be achieved with colors. And in a more pleasing manner IMHO.. the color schemes that I have seen that use italics have not convinced me. I do html a lot, and it helps me to see iitalics, bbold italics, ubold underlined italics,/u/b uunderlined italics,/u/iuunderlined/u text all displayed like they should. .. meaning you can toggle between the source version and the rendered version of the document in Vim? Of course colours can do it, but console vim has only 16 bg and 16 fg colours: the list is soon over. .. my mistake.. I never counted them and I thought that console Vim on a 256-color xterm was capable of displaying 256 colors simultaneoulsy. [..] Note: :setl fenc=latin9 follows by :setl fenc? returns iso-8859-15. This is normal, they are two names for the same thing. So this should help clarify the issue. For more details, see :help mbyte.txt http://vim.sourceforge.net/tips/tip.php?tip_id=246 section 37 (last) of the Vim FAQ http://vimdoc.sourceforge.net/htmldoc/vimfaq.html http://www.unicode.org/ http://www.cl.cam.ac.uk/~mgk25/unicode.html Thanks cga
Re: a question related to substitution using regular expression
Why not just s/ .*// ? (For either vim or sed.) Marshall On Jul 25, 2006, at 1:09 PM, Tim Chase wrote: My file is like the following: data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947 data_2.dat pre= -444.333 post= -333.545 diff= -777.333 . . I hope to find out a regular expression subtitution commad to delete everything after dat to get a file like: data_1.dat data_2.dat . . I know visual mode will do the work too. But I still hope to find out the substitution command using regular expression so I can use sed to make it automatic. Well, you're in luck...the Vim regexp can be the same regexp as for sed: s/\.dat[[:blank:]].*/.dat/ or possibly the slightly shorter s/[[:blank:]]*pre=.*// Some sed's may allow for vim's \s or \ notation, in which case you can trim it even further: s/\.dat\.*/.dat/ or even s/\s*pre=.*// However, in your case, you might even be able to use the cut program: cut -d -f1 text which just asks for the first field, when delimited by spaces (if your original file uses tabs, you can ignore the -d , as cut defaults to using tabs) Just a few ideas... -tim
Matching non-capitalized words?
How would I match (and then delete) all of the words in a buffer that are not capitalized? Thanks. -- yours, William
RE: Matching non-capitalized words?
Make sure 'ignorecase' is off: :set noignorecase :%s/\[a-z]\+\//g Salman. -Original Message- From: William O'Higgins Witteman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 25, 2006 4:24 PM To: vim Subject: Matching non-capitalized words? How would I match (and then delete) all of the words in a buffer that are not capitalized? Thanks. -- yours, William
Re: Matching non-capitalized words?
Make sure 'ignorecase' is off: :set noignorecase :%s/\[a-z]\+\//g If you don't want to bung with your vim-wide (or bufferwide) settings, you can always just change your :s to include the I flag. :%s/\[a-z]\+\//gI Additionally, this will not find camel-case words, such as strFooBarBaz (which can be common if your source text is code) To accomodate that, you can use :%s/\\l\w*\//gI (that is backslash ell not backslash one, which is a slightly shorter notation for [a-z], and may have some unicode plusses to it) You can learn more at :help :s_flags (and scroll down to the I) :help /\l :help /\w to tailor the regexp for exactly what you're hunting. -tim
Re: Other European languages on a US keyboard [OT]
Russell Bateman wrote: [more way off topic comments] ...some linguists say that those silent letters are not artifacts, but reflect __phonemes__ (is that the word?) that are still present in the mental representation of the language... --__morphemes__, actually, from a written point of view (you did say letters). They are what's left of the word eroded from Latin and, like night in English, demonstrate (just as you have pointed out) the word's philology (etymology is somewhat correct, but focuses more on semantics than the morphemic transformation). Note: I studied Latin, Greek and Linguistics at Université de Paris X in the late 70s. I haven't studied linguistics, other than as an amateur, so I have to defer to you. By etymology I meant here (as you understood) what might be called the word's linguistic history: night is the English form of the Germanic word which gave Dutch and German nacht where the -ch- is still pronounced as a guttural consonant. Similarly light (NL/DE licht), though (DE doch), through (DE durch), etc. Many French nouns, for example, evolve from the accusative (direct object) singular form in Latin with further erosion, rosam rose, templum temple, calculus calcule. This also accounts partially for what others see as French's tendency to accentuate the final syllable of a word; actually, there isn't really a tonic accent in French (I won't go into this), but the final of the word was often the penultimate in Latin, often the part receiving the tonic accent in that language (just as now in Italian, Spanish, etc.) and therefore could not be lost without compromising the word itself. Phonemes are (very) roughly equivalent to syllables and exist at the oral or phonetic level. French has the peculiarity, more than most other Western languages in my observation, of its end of word phonemes being greatly ambiguous due to the erosion from Latin already mentioned. Hence, it's easier to find rhymes both rich and otherwise in French even across gender boundaries (whereas Italian and Spanish have kept the o/a alternance when French erodes both feminine am and masculine um to silent e). The resulting explosion in jeux de mots (puns), so looked down upon or at least smirked at in English, is inexplicably prized in French (where it is so much more common in the first place): Le _saint_ père, _sain_ de corps et d'esprit, _ceint_ de vertu, couvait le mal dans son _sein_. (The _holy_ father, while _healthy_ in body and spirit, and _girded_ with virtue, nourished evil in his _breast_. All these underlined words are pronounced identically. There's yet another word or two in French pronounced the same way, but it's been too many years and I can't seem to conjure them up at the moment. Gentlemen, that reminds me: Un _sot_ à la potrine étriquée chevauchait un âne. Il tenait dans sa main droite le _sceau_ destiné à marquer le _seau_ qu'il tenait de sa main gauche. Subitement, l'âne fait un écart et [letrwasotõb]. Comment écrivez-vous [letrwaso]? Réponse: l'étroit sot. -- Again, not really translatable. A narrow-chested _fool_ [so] was riding an ass. He was holding in his right hand the _seal_ [so] with which to mark the _bucket_ [so] he was holding in his left. Suddenly, the ass shies and (the three [so] fall). How do you write (the three [so])? Answer: the narrow fool (because the three and the narrow are also homonymous, and so are the 3rd persons sg. pl. of to fall in the indicative present). If Linguistics paid a decent wage, I probably wouldn't be writing C code for a living. :D Is this off-topic or what? Russ Yes, it is, but it's fun, isn't it? Best regards, Tony.
Re: Other European languages on a US keyboard
cga2000 wrote: On Tue, Jul 25, 2006 at 03:09:29AM EDT, A.J.Mechelynck wrote: [..] and it can change fonts on-the-fly (change the font from Courier to Lucida to whatever, only through Vim keyboard commands). I would never want do that.. but just out of curiosity.. why would that not be possible in an xterm? because console Vim has no control over the xterm's fonts. ok. a bit more flexible than toggling the xterm's font. It can do real boldface and italics, as well as straight or curly underlining. That would be for highlighting stuff, right? So the same functionality can be achieved with colors. And in a more pleasing manner IMHO.. the color schemes that I have seen that use italics have not convinced me. I do html a lot, and it helps me to see iitalics, bbold italics, ubold underlined italics,/u/b uunderlined italics,/u/iuunderlined/u text all displayed like they should. .. meaning you can toggle between the source version and the rendered version of the document in Vim? [...] No, I still see the tags, and font color=redblah blah blah/font doesn't make blah blah blah show up red in gvim, but the HTML syntax has groups htmlItalic, htmlBold, htmlUnderlined, htmlBoldItalic, etc., which appear as italic, bold, underlined, bold-italic, etc., in the GUI (unless, of course, a colorscheme changes them, but why would it want to?). Similarly, the built-in spell checker uses (by default) curly underlining, so the background and foreground colours of the underlying text are not altered. Best regards, Tony.
Re: search and result
SHANKAR R-R66203 wrote: In a function, I am executing a search. I have to implement different things based on whether search got a result or failed with an error. exec '/^\w\+\t\w\+' In the next line, I have to check whether the test passed or failed. How do I do this ? Regards, Shankar Shankar Ramakrishnan Design Engineer MicroController Division Freescale Semiconductor NOIDA - 201 301, INDIA Mobile : 09899125114 Work : +91-120-4394021 Home : +91-120-4333249 This e-mail, and any associated attachments have been classified as: [ ] Public [ ] Freescale Semiconductor Internal Use Only [ ] Freescale Semiconductor Confidential Proprietary let v:errmsg = exec '/^\w\+\t\w\+' if v:errmsg =~ ^E486: search failed else search succeeded endif see :help v:errmsg :help E486 HTH, Tony.
Re: Problem starting up vim: No mapping found
Tobias Herp wrote: Charles E Campbell Jr wrote: Tobias Herp wrote: My vim version (SuSE Linux 9.1): VIM - Vi IMproved 6.2 (2003 Jun 1, compiled Apr 6 2004 03:03:03) ... Yakov gave you good advice; here's some more: build vim 7.0 . Well, I probably would, but those are business servers or servers which are meant to be identical to the business server, and thus I won't compile anything myself if I could avoid it... [...] Well, then, tell your sysadmin that Vim 6.2 is now out-of-date, that even 6.4 is obsolescent, and that he should change over to 7.0. It shouldn't be a great hassle to him. You can even point him to my HowTo page, telling him that the reason it is so detailed is that it was meant for people much less expert than him (or her, as the case may be). (A little grease makes the wheels go round.) Best regards, Tony.
Re: Problem starting up vim: No mapping found
Tobias Herp wrote: A.J.Mechelynck [EMAIL PROTECTED] wrote: If you want step-by-step help about how to compile Vim on Unix-like systems, see my page http://users.skynet.be/antoine.mechelynck/vim/compunix.vim I most probably won't compile on the productive servers, but consider to do it on my virtual server. However, I tried the link, and sadly it didn't work :-( Typo: the extension at the end should be .htm -- or you can go back one level (to .../vim/ ) and select the last link in the top-left corner. Best regards, Tony.
Inserting hex characters
I'm editing binary files with Vim using set display=uhex and I was wondering if there's a way to insert characters given their scancode. Something like what I used to do in DOS by holding Alt then typing the number of the character to enter?
Re: Inserting hex characters
I'm editing binary files with Vim using set display=uhex and I was wondering if there's a way to insert characters given their scancode. Something like what I used to do in DOS by holding Alt then typing the number of the character to enter? Sounds like you're looking for what's described at :help i_CTRL-V_digit where you can, in insert-mode, type control+V followed by -a decimal number -an x followed by a hex number -a u followed by a 4-hexchar unicode sequence -a U followed by an 8-hexchar unicode sequence HTH, -tim
Re: Inserting hex characters
Tim Chase wrote: I'm editing binary files with Vim using set display=uhex and I was wondering if there's a way to insert characters given their scancode. Something like what I used to do in DOS by holding Alt then typing the number of the character to enter? Sounds like you're looking for what's described at :help i_CTRL-V_digit where you can, in insert-mode, type control+V followed by -a decimal number -an x followed by a hex number -a u followed by a 4-hexchar unicode sequence -a U followed by an 8-hexchar unicode sequence HTH, -tim Careful, Tim: UTF-8 is unsuited to binary editing, because you can't enter a byte 127 by itself in UTF-8. Best regards, Tony.
Re: Matching non-capitalized words?
Hi, Tim Chase wrote: Make sure 'ignorecase' is off: :set noignorecase :%s/\[a-z]\+\//g If you don't want to bung with your vim-wide (or bufferwide) settings, you can always just change your :s to include the I flag. :%s/\[a-z]\+\//gI another option is to include \C in the regular expression itself: :%s/\C\[a-z]\+\//g Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)