How to write a text line as binary/Hex with a filename by means of Vim command line(s)?

2012-07-03 Thread William Fugh
Hi guys, -Vim 7.3 + Vista(SP2) If there are 8 chars in one line like this: 52494646 Question: using Vim command line(s), how to write a binary file, and make it 'RIFF' (4 char, not '52494646') in a viewer of TXT? BRs, -- William -- You received this message from the "vim_use" ma

Re: How to write a text line as binary/Hex with a filename by means of Vim command line(s)?

2012-07-04 Thread William Fugh
[...] > function! WriteChars(outfile, text) > let chars = '' > for i in range(0, len(a:text)-1, 2) > let chars .= nr2char('0x'.a:text[i : i+1]) > endfor > call writefile([chars], a:outfile, 'b') > endfunction > command! WriteChars call WriteChars('data.bin', getline('.')) > Good one. t

[Help] How to ONLY sort part of a file and keep the format?

2012-09-13 Thread William Fugh
Hi folks, As the title. How to sort only the non-TAB-beginning line(s) of a TAB-Based file like the below and keep the format? thanks! # -- Origin: #

Re: How to ONLY sort part of a file and keep the format?

2012-09-13 Thread William Fugh
Amazing! thanks you guys very much! Got it.[?] - William On Fri, Sep 14, 2012 at 5:31 AM, Bee wrote: > > > On Sep 13, 12:21 pm, Christian Brabandt wrote: > > Hi William! > > > > On Fr, 14 Sep 2012, William Fugh wrote: > > > > > Hi folks, &g

Re: How to ONLY sort part of a file and keep the format?

2012-09-13 Thread William Fugh
On Fri, Sep 14, 2012 at 9:15 AM, Bee wrote: > > I think, this will do: > > :v/^^I/.,/^^I/-sort > > where ^I is a literal tab. > > > > It also works using \t rather than the literal tab (^I): > > :v/^\t/.,/^\t/-sort > > Either way I get: > E16: Invalid range > remove all empty lines. :-) > Bu

Re: [Help] How to ONLY sort part of a file and keep the format?

2012-09-13 Thread William Fugh
On Fri, Sep 14, 2012 at 10:56 AM, ping wrote: > On 9/13/2012 3:21 PM, Christian Brabandt wrote: > >> Hi William! >> >> On Fr, 14 Sep 2012, William Fugh wrote: >> >> Hi folks, >>> >>> As the title. How to sort only the non-TAB-beginning line(

Weird:: substitute by using register with combinations

2013-04-04 Thread William Fugh
It's OK if execute the following in command-line directly :%s#combinations#œ̄ṣ́#g However, if like this: :let @w = "%s#combinations#œ̄ṣ́#g" :@w the combinations will be lost. :-( BTW, it is also strictly correct if put the command into a function and call the function. ===

Re: Weird:: substitute by using register with combinations

2013-04-06 Thread William Fugh
ons were failed if the command(s) contain(s) combination(s). On Sat, Apr 6, 2013 at 3:44 AM, Ben Fritz wrote: > On Thursday, April 4, 2013 11:53:16 PM UTC-5, William Fugh wrote: > > It's OK if execute the following in command-line directly > > :%s#combinations#œ̄ṣ́#g > &g

Re: Weird:: substitute by using register with combinations

2013-04-07 Thread William Fugh
BTW: Here is a patch. > > Well done, thank you guys so much. :-) On Sun, Apr 7, 2013 at 7:13 AM, Christian Brabandt wrote: > Hi William! > > On Fr, 05 Apr 2013, William Fugh wrote: > > > It's OK if execute the following in command-line directly > > :%s#comb

regexp: different match, re=1 vs re=0

2013-08-21 Thread William Fugh
Version: 7.4, gVim, MS-DOS/MS-Windows = :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\|[({]\zs\s\+\|\s\+\ze[)}]\|\s\zs\s\+\|\s\+\ze[,;.]\([^.,;]\)##g ---

Re: regexp: different match, re=1 vs re=0

2013-08-23 Thread William Fugh
On Thu, Aug 22, 2013 at 10:14 PM, Bram Moolenaar wrote: > > William Fugh wrote: > > > Version: 7.4, gVim, MS-DOS/MS-Windows > > = > > > :%s#\[\(com\|ref\|ex\|p\|i\|u\|s\|b\)\]\zs\s\+\|\s\+\ze\[/\(com\|ref\|ex