Re: Partial current word under cursor

2018-02-04 Thread porphyry5
On Friday, February 2, 2018 at 2:42:21 PM UTC-8, S wrote: > Hello! > > > > It's a standard practice of mine having to replace whole words with > something else, very useful when coding.  I have the following > mapping in my vimrc: > >     > nnoremap s > :%s/\<\(\

Re: using vim to add links to an epub index file

2017-11-26 Thread porphyry5
On Saturday, November 25, 2017 at 10:25:32 AM UTC-8, Chris Jones wrote: > On Fri, Nov 24, 2017 at 12:43:46PM EST, porphyry5 wrote: > > On Thursday, November 23, 2017 at 3:53:58 PM UTC-8, Chris Jones wrote: > > [..] > > > > Substitute (:h :s) will do all you nee

Re: using vim to add links to an epub index file

2017-11-24 Thread porphyry5
On Thursday, November 23, 2017 at 3:53:58 PM UTC-8, Chris Jones wrote: > I am currently in the final stages of putting together an epub version of > Auguste Escoffier's _Le Guide Culinaire_. > > Since this is a "cookbook" of sorts, the last step before proofreading > pretty much requires building

Re: Evoking the option for :help in a mapping

2017-08-29 Thread porphyry5
On Monday, August 28, 2017 at 1:32:32 PM UTC-7, Tony Mechelynck wrote: > On Mon, Aug 28, 2017 at 7:02 PM, Graham Lawrence wrote: > > I have the customary mappings for :help, > > > > nmap :exec "help " . expand("") > > nmap :exec "help " . expand("") > > > > and have been trying to develo

Re: Regex arithmetic

2017-08-07 Thread porphyry5
On Saturday, August 5, 2017 at 2:09:41 PM UTC-7, ZyX wrote: > 2017-08-05 23:27 GMT+03:00 porphyry5 : > > On Friday, August 4, 2017 at 10:03:16 AM UTC-7, porphyry5 wrote: > >> :h submatch( includes > >> Example: > >> :s/\d\+/\=submatch(0) +

Re: Regex arithmetic

2017-08-05 Thread porphyry5
On Friday, August 4, 2017 at 10:03:16 AM UTC-7, porphyry5 wrote: > :h submatch( includes >         Example: >             :s/\d\+/\=submatch(0) + 1/ >         This finds the first number in the line and adds one to it. > > Needing to increment several fields consisting of under

Re: Vim Improvement suggester

2017-04-19 Thread porphyry5
On Tuesday, April 18, 2017 at 10:00:53 PM UTC-7, Patrik Iselind wrote: > Hi, > > I am interested in a way to be suggested what i can improve with my personal > usage of Vim commands. So i thought it would be useful if Vim could record > the commands i use somehow. Then once a month or something

Re: A mapping with a manual insert mode in the middle

2017-01-18 Thread porphyry5
On Monday, January 16, 2017 at 10:26:40 PM UTC-8, Zeke Blackwell wrote: > Greetings! > > I'd like to create a mapping in my .vimrc that does some manipulation, drops > me into insert mode, then picks back up for more manipulation after I hit > escape. > > Is this possible? I guess I just don

Re: Inconsistent behavior at end of .vim script

2016-10-14 Thread porphyry5
On Thursday, October 13, 2016 at 10:38:34 AM UTC-7, Frank Shute wrote: > Hi Graham, > > What you might want to do is use echom rather than plain echo. > > The former sticks it's output into the message buffer and you can then > read it with: > > :mes > > HTH. > snip > > Frank Thank you Frank

Re: question on VIM syntax: highlight an entire paragraph

2016-04-18 Thread porphyry5
On Sunday, April 17, 2016 at 9:34:04 AM UTC-7, ZyX wrote: > 2016-04-17 17:52 GMT+03:00 porphyry5 >: > > On Saturday, April 16, 2016 at 3:48:52 PM UTC-7, Jose Caballero wrote: > >> Is it possible to highlight an entire paragraph based on a single line > >> content?

Re: question on VIM syntax: highlight an entire paragraph

2016-04-17 Thread porphyry5
On Saturday, April 16, 2016 at 3:48:52 PM UTC-7, Jose Caballero wrote: > Is it possible to highlight an entire paragraph based on a single line > content? > I would be interested in changing the color of an entire block of > configuration lines if one of those lines in the block is "enabled = > Fa

Re: au! FileChangedShell

2015-09-06 Thread porphyry5
On Friday, September 4, 2015 at 11:50:56 AM UTC-7, porphyry5 wrote: > I put this command in ~/.vimrc. > au! FileChangedShell img.dat r img.dat > which also contains > set autochdir " pwd is always directory of current buffer > > I hoped to ensure that, if the

Re: Is there any way to override scripts that load after .vimrc?

2015-06-13 Thread porphyry5
On Friday, June 12, 2015 at 8:16:48 AM UTC-7, Joe Shockey wrote: > My .vimrc file sets my textwidth=0, but it is being overridden by a plugin > (/root/share/vim/vim72/ftplugin/vim.vim) that loads after my .vimrc and sets > textwidht=72. I only have a user account on the server, so I don't have much

Re: What sets textwidth=78

2015-03-25 Thread porphyry5
On Monday, March 23, 2015 at 1:39:38 PM UTC-7, gevisz wrote: > On Mon, 23 Mar 2015 11:44:36 -0700 (PDT) porphyry5 wrote: > > > On Sunday, March 22, 2015 at 12:05:37 PM UTC-7, gevisz wrote: > > > On Sun, 22 Mar 2015 09:46:01 -0500 toothpik wrote: > > > > > &g

Re: What sets textwidth=78

2015-03-23 Thread porphyry5
t; > > On Saturday, March 21, 2015 at 5:12:17 PM UTC+1, porphyry5 wrote: > > > > > (...) > > > > > > > > > > Thank you, by a happy coincidence it has occurred again, and > > > > > :verbose set tw? > > > > > rev

Re: What sets textwidth=78

2015-03-21 Thread porphyry5
On Wednesday, March 18, 2015 at 12:18:52 PM UTC-7, Gary Johnson wrote: > On 2015-03-18, porphyry5 wrote: > > On Monday, March 16, 2015 at 12:40:50 PM UTC-7, riesebie wrote: > > > * Graham Lawrence [2015-03-16 11:06 -0700]: > > > > > > > Using Huge

Re: What sets textwidth=78

2015-03-21 Thread porphyry5
On Wednesday, March 18, 2015 at 12:18:46 PM UTC-7, Ben Fritz wrote: > On Wednesday, March 18, 2015 at 1:28:49 PM UTC-5, porphyry5 wrote: > > On Monday, March 16, 2015 at 11:12:10 AM UTC-7, nekneknek...@gmail.com > > wrote: > > > :verbose set textwidth > > > >

Re: What sets textwidth=78

2015-03-18 Thread porphyry5
On Monday, March 16, 2015 at 12:40:50 PM UTC-7, riesebie wrote: > * Graham Lawrence [2015-03-16 11:06 -0700]: > > > Using Huge vim 7.4 with patch 1-473 on arch linux > > > > One of the last entries in my .vimrc is > > set textwidth=0 > > which is occasionally overridden by some feature in vim

Re: What sets textwidth=78

2015-03-18 Thread porphyry5
On Monday, March 16, 2015 at 11:12:10 AM UTC-7, nekneknek...@gmail.com wrote: > :verbose set textwidth > > itchyny I thank you for your help, but all this shows me is the current setting of textwidth. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your repl

Re: E303 Unable to load swap file

2015-02-13 Thread porphyry5
On Thursday, February 12, 2015 at 12:19:52 PM UTC-8, Reid Thompson wrote: > > *E303* > > Unable to open swap file for "{filename}", recovery impossible > > > > Vim was not able to create a swap file. You can still edit the file, but if > > Vi

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-29 Thread porphyry5
On Monday, November 24, 2014 4:05:08 AM UTC-8, Erik Christiansen wrote: > I am reminded of two quotes: > > There are two ways of constructing a software design. One way is to make > it so simple that there are obviously no deficiencies. And the other way > is to make it so complicated that there

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-23 Thread porphyry5
On Friday, November 21, 2014 1:31:20 AM UTC-8, Erik Christiansen wrote: > On 20.11.14 11:54, porphyry5 wrote: > > Annoyingly, I cannot see any clear way to use an associative array in > > this case, because of that pesky word suffix list. I believe 'if > > (word in wd

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-20 Thread porphyry5
On Wednesday, November 19, 2014 8:04:59 PM UTC-8, Erik Christiansen wrote: > On 19.11.14 12:21, porphyry5 wrote: > > So if I read this hash table stuff correctly any data item that one > > wants to look up in an associative array generates its own address in > > memory, by usi

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-19 Thread porphyry5
On Tuesday, November 18, 2014 11:38:19 PM UTC-8, John Little wrote: > Not much to the point, but I couldn't let this pass: > porphyry5 said: > >... I used a plain numeric index as I figured it must use an address array > >to reference the words array, and with a numeric ind

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-19 Thread porphyry5
On Wednesday, November 19, 2014 12:10:08 AM UTC-8, Erik Christiansen wrote: > On 18.11.14 15:26, porphyry5 wrote: > > I'm not sure how awk organizes arrays internally, but I used a plain > > numeric index as I figured it must use an address array to reference > > t

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-18 Thread porphyry5
On Tuesday, November 18, 2014 2:37:22 AM UTC-8, Erik Christiansen wrote: > On 17.11.14 10:57, Graham Lawrence wrote: > > For my test file the awk program tagged some 3500 words, with 1960 of them > > unique, so this vim script must run within a loop to avoid the tedium and > > 4000 odd keystrokes r

Re: :%s//\=@o/gce ignores c flag in key mapping

2014-11-15 Thread porphyry5
On Friday, November 14, 2014 4:02:55 PM UTC-8, porphyry5 wrote: > In a key mapping I use the command ':%s//\=@o/gce'. > > The command executes as expected except that it behaves as if the c flag were > not set.  Is this flag unavailable in a key mapping, or is there som

Re: Get filename part only from "% with substitute()

2012-10-16 Thread porphyry5
On Monday, October 15, 2012 7:27:40 AM UTC-7, Christian Brabandt wrote: > On Mon, October 15, 2012 16:14, porphyry5 wrote: > > > On Sunday, October 14, 2012 4:59:28 PM UTC-7, coot_. wrote: > > >> On 15:25 Sun 14 Oct , Graham Lawrence wrote: > >

Re: Get filename part only from "% with substitute()

2012-10-15 Thread porphyry5
On Sunday, October 14, 2012 4:59:28 PM UTC-7, coot_. wrote: > On 15:25 Sun 14 Oct , Graham Lawrence wrote: > > > :echo substitute(@%, "\..*", "", "") > > > > > > :echo substitute(@%, "\([^.]\+\)\..*", "\1", "") > > > Parameters2.html > > > > > > >From :reg > > > ": echo substitute(@%

Re: Key mapping behaves differently than same sequence of keys struck by hand

2012-07-17 Thread porphyry5
On Monday, July 16, 2012 5:12:18 PM UTC-7, Gary Johnson wrote: > On 2012-07-16, Graham Lawrence wrote: > > As a keystroke sequence > > hEa"Bi"j > > seems to enquote the current word anywhere in the line. > > In particular, it does so if the cursor is in column 1 at the start of > > the fi

Re: Can't write to ntfs file system

2012-01-05 Thread porphyry5
On Jan 4, 1:28 pm, Christian Brabandt wrote: > Hi Graham! > > On Mi, 04 Jan 2012, Graham Lawrence wrote: > > > My apologies to all.  It is something in my vimrc.  Without that, vim > > creates and edits on ntfs without complaint.  My thanks to Joan Miquel > > Torres Rigo for the suggestion. > > Wh

Re: In script always search from start of buffer

2011-11-23 Thread porphyry5
On Nov 22, 6:17 am, Tim Chase wrote: > > You can do the following in a script which, while 2 steps, I find > equally clear as Tony's use of search() > >    let @/=@" >    / > Yes, the terser, the better > > As a side-note, depending on your line's contents, you may have > to wrap the value of @

Re: In script always search from start of buffer

2011-11-22 Thread porphyry5
On Nov 21, 8:28 pm, Tony Mechelynck wrote: > > I find it less confusing, when typing at the command-line (not in a > script) to type complex commands (:while, :if, etc.) all on one line > until their :endwhile, :endif, etc., separating intervening commands > with bars, and taking care that some

Re: In script always search from start of buffer

2011-11-22 Thread porphyry5
On Nov 21, 7:41 pm, Tony Mechelynck wrote: > > The reason why normal-mode commands must be prefixed by "normal" in > scripts is that the :normal command executes its argument as a > normal-mode command (or set of commands). If you want to execute :normal > as part of a string of bar-separated co

Re: In script always search from start of buffer

2011-11-21 Thread porphyry5
On Sun, Nov 20, 2011 at 5:10 PM, Tony Mechelynck [via VIM] wrote: > Yes, and why not use bar-separated commands? You _are_ running in > 'nocompatible' mode aren't you? The following (untested) assumes that > this mapping definition is part of a script (of your vimrc, maybe): Essentially I wrote

Re: In script always search from start of buffer

2011-11-21 Thread porphyry5
On Sun, Nov 20, 2011 at 1:25 PM, Gary Johnson-4 [via VIM] wrote: > On 2011-11-20, porphyry5 wrote: >> In a script, how can I get repeated searches always to begin at the start >> of >> the buffer? >> If I precede the search with gg  or :cursor(1, 1) I get E49

In script always search from start of buffer

2011-11-20 Thread porphyry5
In a script, how can I get repeated searches always to begin at the start of the buffer? If I precede the search with gg or :cursor(1, 1) I get E492, with 1G I get E464. :map p$ ggdd:while @" != "":b#:cursor (1, 1):silent! /^R"0i$:b#dd:endwhile -- View this message in context: http://vim.104564

Re: replace e flag works in command but fails if that command in key mapping

2011-10-03 Thread porphyry5
and test this autocommand out. On Oct 2, 10:35 am, Tony Mechelynck wrote: > On 02/10/11 16:04, porphyry5 wrote: > > > Well, I think I finally have this figured out.  If I'm using sessions, > > any session includes its own .vimrc, being that .vimrc in effect when >

Re: replace e flag works in command but fails if that command in key mapping

2011-10-02 Thread porphyry5
if I want to change a mapping in .vimrc, and have the benefit of that change in my session, I must make the new mapping explicitly in the current session, as well as in .vimrc. On Oct 1, 8:13 am, porphyry5 wrote: > Using vim 7.2 on slackware 13.1 > OK, I've traced the problem with the erro

Re: replace e flag works in command but fails if that command in key mapping

2011-10-01 Thread porphyry5
Using vim 7.2 on slackware 13.1 OK, I've traced the problem with the error flag not being suppressed. It is caused because vim is still using an old version of .vimrc, not the current version, i.e. it is using a version preceding my addition of the e flag to those replace commands. It does so bec

replace e flag works in command but fails if that command in key mapping

2011-09-30 Thread porphyry5
The e option in :s/\<[a-z]/\u&/ge duly suppresses the error message if used as a command, but fails when used in the following key mapping in .vimrc " Type ;c to ConcatenateTitles and accumulate them in register z :map ;c :s/\<[a-z]/\u&/ge:s/[ ,.;:'"]//ge"Zyy producing "E486: Pattern not found:

sort content of a register

2011-09-24 Thread porphyry5
One by one I have appended a number of lines to a register ("z). I need to sort them and then paste them at the start of the document. Without complaint, vim accepts the command :"zsort but the content of "z is unchanged. Is it possible to do this in the register, or must I paste it into the docu