Re: How to reference characters within visually selected text within a function?

2016-08-28 Thread Tim Chase
On 2016-08-28 15:33, jf...@worcester.edu wrote: > I have a question. I am trying to create a function that uses > visually selected text. For example: > > Let's say I have > > 12345 > > And I highlight the characters > > 234 > > How would I access the selected text '234' within a vim funct

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

2016-09-13 Thread Tim Chase
On 2016-09-13 08:23, Amit Christian wrote: > I find it still difficult to go to next lines or browsing up or > down through the text. Can any one please help me with efficient > use of working with text without a usual j,k,h,l use? Are there > resources or help on internet? What are your strategies

Re: Trying to learn to Work with Text without using J,K,H,L and arrow keys

2016-09-15 Thread Tim Chase
On 2016-09-15 07:53, Amit Christian wrote: > > I have disabled (temporarily) the use of j, k, h, l (using > > HardMode vim plugin). > > I think my decision about disabling hljk (even temporarily) may not > be good. I userstand that it is not recommended to disable an > inbuilt capability. But In

Re: norm 1G does not work on vim8.0.4

2016-09-17 Thread Tim Chase
On 2016-09-17 14:29, Ni Va wrote: > norm 1G does not work on vim8.0.4 I just pulled from source and tested both 8.0.4 and the current tip and it works in both. Have you tried it without your startup files? -tim -- -- You received this message from the "vim_use" maillist. Do not top-post! Ty

Re: norm 1G does not work on vim8.0.4

2016-09-17 Thread Tim Chase
On 2016-09-17 14:47, Ni Va wrote: > > > norm 1G does not work on vim8.0.4 > > > > I just pulled from source and tested both 8.0.4 and the current > > tip and it works in both. Have you tried it without your startup > > files? > > no how van i disable it ? $ vim -u NONE yourfile.txt should do.

Re: norm 1G does not work on vim8.0.4

2016-09-17 Thread Tim Chase
On 2016-09-17 15:04, Ni Va wrote: > On Saturday, September 17, 2016 at 11:51:10 PM UTC+2, Tim Chase > wrote: > > On 2016-09-17 14:47, Ni Va wrote: >>>>> norm 1G does not work on vim8.0.4 > >> $ vim -u NONE yourfile.txt > > OK some loaded plugins may ca

Re: norm 1G does not work on vim8.0.4

2016-09-17 Thread Tim Chase
On 2016-09-18 03:57, Nikolay Aleksandrovich Pavlov wrote: > And if you are writing `norm 1G` somewhere (e.g. in a plugin), then > just write it as `normal! 1G` (with bang). And stepping back, if you're writing *either* "norm 1G" or "norm! 1G" just write 1 or whichever line-number you want to g

Re: norm 1G does not work on vim8.0.4

2016-09-18 Thread Tim Chase
On 2016-09-18 02:55, Ni Va wrote: > > And stepping back, if you're writing *either* "norm 1G" or "norm! > > 1G" just write > > > > 1 > > > > or whichever line-number you want to go to. Likewise, just use > > "$" rather than "norm G" or "norm! g" > > > > :help range > > > > -tim > > Than

Re: mapping :h to ;

2016-09-24 Thread Tim Chase
On 2016-09-24 11:55, Tony Mechelynck wrote: > - In most cases, it is safe to use the F and Shift-F "function" keys > with the exception of (Help) and sometimes of (Menu) > - If you have non-ASCII printing characters on your keyboard, you > can use them too. For instance, my Belgian keyboard (show

Re: Cursor doesn't move to top of screen when issuing a 'zt'

2016-09-24 Thread Tim Chase
On 2016-09-24 08:40, Scott Friedemann wrote: > After installing v8.0 on two different Windows computers, when I > issue a 'zt' to move the cursor location to the top of the screen, > there are always 5 lines above the cursor position. I imagine this > is a setting, but cannot find. This happens wit

Re: Strength of builtin blowfish2 encryption?

2016-09-25 Thread Tim Chase
On 2016-09-25 13:15, Shawn H Corey wrote: >> > I wonder how string the builtin encryption of vim really is. >> >> Encryption really isn't the business of a text editor. Decrypt the >> cipher-text, feed it to the editor, encrypt when saving, and be >> sure to delete any temporary/backup files. > >

Re: How to input character 'ƒ' (U+0192)

2016-10-08 Thread Tim Chase
On 2016-10-08 12:13, L. A. Walsh wrote: > In various locations on windows I can use ALT+0131 (on the numeric > pad) to display/input the Unicode "function symbol", 'ƒ', which is > unicode char 0192 (it's also the Florin currency symbol in the > Netherlands and called a LATIN SMALL LETTER F with HOO

Re: Spellchecking in CamelCase?

2016-12-02 Thread Tim Chase
On 2016-12-02 14:14, Christian Brabandt wrote: > On Fr, 02 Dez 2016, Ben Tucker wrote: >> "TargetTime" example by considering each word in the identifier >> separately for the purposes of spell checking. So with the >> "spellcamelcase" option turned on, "Target" and "Time" are spell >> checked sepa

Re: How to prevent asterisk key from advancing to next match when pressed

2016-12-14 Thread Tim Chase
On 2016-12-14 01:03, Slartibartfast wrote: > Anyone know a way to achieve setting the search word like this > without causing the screen to be scrolled? I'm sure it must be > possible but I'm having trouble working it out myself. Could do something like :nnoremap * :let @/='\'.expand('cword>')

Re: How to prevent asterisk key from advancing to next match when pressed

2016-12-14 Thread Tim Chase
On 2016-12-14 04:34, Slartibartfast wrote: > > :nnoremap * :let @/='\'.expand('cword>').'\>' > > Wow, what on earth does that mean? > > I tried it all the same and yes it does indeed work in gVim but I > have no idea why. It remaps the "*" key to run the ex command that follows. let @/=

Re: How can I do date format convertion?

2016-12-14 Thread Tim Chase
On 2016-12-14 18:31, Carfield Yim wrote: > 20150204 > 20150304 > 20150309 > 20150323 > 20150331 > 20150416 > 20150608 > > I would like to change it to > > 2015.02.04 > 2015.03.04 > 2015.03.09 > 2015.03.23 > 2015.03.31 > 2015.04.16 > 2015.06.08 > > How can I do that? Capture them and reformat t

Re: someone is stealing my F11 key

2016-12-15 Thread Tim Chase
On 2016-12-15 15:21, tooth pik wrote: > now, in vim, in konsole, in kwin, in kde, in leap 42.2 when I press > F11 the window > maximizes and if I press it again it resets > > can someone by any chance here tell me which of the above suspects > is stealing my > F11 and how to make them stop? I'd f

Re: Why the number of the yanked line is too many(may be over 22) the command line will not show if the line was copied ?

2016-12-19 Thread Tim Chase
On 2016-12-19 19:14, Zhe Lee wrote: > I mean when I copy several line in the vim, the command line will > show the lines has been yanked. But when number of yanked line is > over 22(I test it), the command line will show nothing when the > copy is done. But it becomes a little inconvenient for me t

Re: Having certain lines readonly

2017-01-03 Thread Tim Chase
On 2017-01-02 03:42, Tihomir Mitkov wrote: > Is it possible to have certain lines uneditable while keeping the > rest of them editable? The closest I've heard of is the "narrow region" plugin https://github.com/chrisbra/NrrwRgn -tim -- -- You received this message from the "vim_use" mailli

Re: How to use * to search the word with dash under cursor?

2017-01-07 Thread Tim Chase
On 2017-01-07 17:45, Zhe Lee wrote: > if the cursor is on the first line first column (on `a` now). And > then I press `*` I want to find the `a-b` but the vim just search > `a` instead of `a-b`, so how to make * to include the dash `-`? Add the dash to your 'iskeyword' setting: :set isk+=- Th

Re: Sed substitution did not go as planned...

2017-02-05 Thread Tim Chase
On 2017-02-04 05:14, Marcus Martinez wrote: > ...and modified the first ten lines using Sed substitution... > :1,10 s/^/--/ > > After running this command the beginning of lines 1 through 10 do > have the "--" correctly placed. However, the first character of > each line in the file is now highlig

Re: Sed substitution did not go as planned...

2017-02-05 Thread Tim Chase
On 2017-02-05 16:30, Shawn H Corey wrote: > On Sun, 5 Feb 2017 21:41:34 +0100 > Christian Brabandt wrote: > > On So, 05 Feb 2017, Shawn H Corey wrote: > > > :nnoremap :nohlsearch > > > > > > In normal mode, Esc does nothing but ring the bell, so this > > > feels intuitive to me. :) > > > >

Re: Sed substitution did not go as planned...

2017-02-05 Thread Tim Chase
On 2017-02-05 18:09, Shawn H Corey wrote: > On Sun, 5 Feb 2017 16:14:41 -0600 Tim Chase wrote: >> On 2017-02-05 16:30, Shawn H Corey wrote: >>> On Sun, 5 Feb 2017 21:41:34 +0100 >>> Christian Brabandt wrote: >>>> That is known to confuse the Vim parser

Re: Filter-like command -- but to insert instead of replacing

2017-02-10 Thread Tim Chase
On 2017-02-09 16:06, Bram Moolenaar wrote: > I don't think it can be done with one command. Simplest seems to > be to copy the text and then filter it. > (visually select the text) > YP > gv > :!filter-command > > Would not be a bad idea to have an Ex command for this. No

Re: Filter-like command -- but to insert instead of replacing

2017-02-11 Thread Tim Chase
On 2017-02-11 11:26, Arun wrote: > On Sat, Feb 11, 2017 at 2:37 AM, Bram Moolenaar wrote: >> Perhaps this will work: >> :{range}copy {address} !cmd >> > > Just wondering how this would work with :g, hope it wont be > executing the filter against each line, rather as a whole. It would > be

Re: W-word Boundaries

2017-02-13 Thread Tim Chase
On 2017-02-13 13:34, Shawn H Corey wrote: > > The two patterns, \< and \> match w-word boundaries. Is there > something to match W-word boundaries? The best I came up with is: > > \(^\|\s\)\@<= > > I'm writing a syntax file for G+ comments where in-line styles start > with a W-word boundary,

Re: highlight a word following a certain key

2017-03-01 Thread Tim Chase
On 2017-03-01 00:41, sinbad wrote: > i want to hightlight a word following a certain word. For instance. > In the below example, i want to highlight the words that appear > after 'key' which are one, two and three. how can i do that? > > 1.txt: > > key one > key two > abc def > key three If you

Re: Ambiguity about what $ means?

2017-03-05 Thread Tim Chase
On 2017-03-05 09:20, Pablo Contreras wrote: > s/$/XXX/ [snip] > s/$\_.*/XXX/ > > apparently should match 'end-of-line, then using \_. any char > including enf-of-line as many times as necessary to the end of the > file. Then replace with XXX > > instead this happens: > 'E486: Pattern $\_.* not

Re: substitute variable into text

2017-03-05 Thread Tim Chase
On 2017-03-05 12:18, lothar atheling wrote: > how do i substitute variable into text i am editing? > also, same question with respect to an expression. > > "execute" may work, but it seems something heavy-handed. > is there a better way? The usual way to do this is to use :help sub-replace-spe

Re: Ambiguity about what $ means?

2017-03-06 Thread Tim Chase
On 2017-03-06 08:01, Ben Fritz wrote: > On Sunday, March 5, 2017 at 1:55:19 PM UTC-6, Tim Chase wrote: >> On 2017-03-05 09:20, Pablo Contreras wrote: >>> s/$/XXX/ >> [snip] >>> s/$\_.*/XXX/ >> From >> >> :help /$ >> >> "&

Re: Start vim with a datestamped filename?

2017-03-13 Thread Tim Chase
On 2017-03-12 13:56, George Skuse wrote: > I'd like to have the filename dynamically datestamped > (MMdd_hhmmss), ie: filename-20170312_165737.txt > > Does anyone know how this could be accomplished as part of the > invocation using vim commands? This needs to be crossplatform and > not rely

Re: Wierdness in vim

2017-03-16 Thread Tim Chase
On 2017-03-16 05:05, a joeiam wrote: > Issue:working in a file with about 6800 lines I find an error. Need > to add two lines to one 'section'. Used +y to yank and then used > +GP to place. Was absolutely unable to place the lines. Instead the > 2 lines were place at the end of the document. It lo

Re: Wierdness in vim

2017-03-16 Thread Tim Chase
On 2017-03-16 13:12, o1bigtenor wrote: > Trying to find the cheat sheet where I found the +GP command for > pasting. Of course cannot find it now! Count your blessings. If it mis-instructed you on the clipboard copy/paste, it's not a very good cheat sheet ;-) > I haven't tried using your suggest

Re: Passing current line number to shell command

2017-03-19 Thread Tim Chase
On 2017-03-19 03:51, Honggyu Kim wrote: > I would like to ask a question regarding getting the current line > number. I can get it as follows: > > :echo line(',') > > It works fine but my question is in command execution with '!' in > the front. > > :!echo line('.') > > But "line" is not in

Re: What do you do when you make the wrong movement with 'c'?

2017-04-15 Thread Tim Chase
On 2017-04-14 13:32, Mike Ciul wrote: > What do you do when you use the wrong movement with a change? Do > you soldier on in insert mode? Escape and undo? Escape and move to > the right place before changing? Do you have habits or mnemonics > that help you know where the cursor will be after you hi

Re: am getting a CRITICAL error using gvim and linux

2017-05-18 Thread Tim Chase
On 2017-05-18 11:04, Charles E Campbell wrote: > gvim/vim compiled and linked ok; when I started it up that CRITICAL > message resulted (I'd just wiped out my vim directory+contents, > gotten the code via git, re-compiled, and was doing a test-run to > insure that it actually did compile&link corre

Re: :right command on Chinese characters

2017-05-21 Thread Tim Chase
On 2017-05-21 19:54, Joey wrote: > When I run :right command in gvim, it's ok, like this: > >彼外道常说自然,我说因缘。——楞严经 > > But if I open the txt file with Word, it's like this: > > 彼外道常说自然,我说因缘。——楞严 > 经 > > The last character is returned to the next line

Re: :right command on Chinese characters

2017-05-22 Thread Tim Chase
On 2017-05-22 01:49, Joey Ling wrote: > On Sunday, May 21, 2017 at 8:15:50 PM UTC+8, Tim Chase wrote: > > I suspect what's happening is that, since Vim does the > > right-justification with spaces, Word is displaying all those > > spaces and then not having enoug

Re: Is there a simple way to |^a| and |^x| ?

2017-06-05 Thread Tim Chase
On 2017-06-05 19:37, Erik Christiansen wrote: > Both ^a and ^x have proven very useful in a variety of scenarios. > Now, while editing some postscript, I sometimes have to decrement > the magnitude of a series of literal constants by a common amount, > and if there were mod variants of ^a and ^x, I

Re: Is there a simple way to |^a| and |^x| ?

2017-06-06 Thread Tim Chase
On 2017-06-06 09:43, Erik Christiansen wrote: > On 05.06.17 08:29, Tim Chase wrote: > > While a side-stepping of your literal request, you can do > > incrementing/decrementing in search replacements. > > > > For all numbers in a range: > > > > :'<

Re: decrease number?

2017-06-19 Thread Tim Chase
On 2017-06-19 19:14, stosss wrote: > stroke="#c0c0c0" /> > > I want to change them like this: > > stroke="#c0c0c0" /> > > The "ten" place holder needs to decrease by one. > x1="20" y1="45" x2="820" y2="45" > > Can someone point me to something that would show me a fast way to > do this? >

Re: decrease number?

2017-06-19 Thread Tim Chase
On 2017-06-19 22:29, John Passaro wrote: > use the expression register: > > s/\v\w+\="\zs\d\d+\ze"/\=submatch(0)-10/g Beware that this catches any variable name (not just [xy][12] which may or may not be what you want), and also doesn't catch negative-number values. But for the general case of t

Failing to do an install in $HOME from git

2017-06-30 Thread Tim Chase
I just pulled down a clone of the git repo, modified src/Makefile to point `prefix` at $HOME/local but when I go to build, it complains that it can't find auto/config.h but as far as I can tell, I'm doing everything according to the install-from-source instructions in usr_90: $ git clone https://

Re: Failing to do an install in $HOME from git

2017-06-30 Thread Tim Chase
On 2017-06-30 21:43, Christian Brabandt wrote: > On Fr, 30 Jun 2017, Tim Chase wrote: > > > I just pulled down a clone of the git repo, modified src/Makefile > > to point `prefix` at $HOME/local but when I go to build, it > > complains that it can't find auto/config.h

Re: Failing to do an install in $HOME from git

2017-06-30 Thread Tim Chase
On 2017-06-30 22:04, Christian Brabandt wrote: > The last line, if run successfully, should show this: > ... > checking whether we need -D_FORTIFY_SOURCE=1... yes > checking linker --as-needed support... yes > configure: updating cache auto/config.cache > configure: creating auto/config.status > co

Re: Failing to do an install in $HOME from git

2017-06-30 Thread Tim Chase
On 2017-06-30 15:30, Tim Chase wrote: > On 2017-06-30 22:04, Christian Brabandt wrote: > > The last line, if run successfully, should show this: > > ... > > checking whether we need -D_FORTIFY_SOURCE=1... yes > > checking linker --as-needed support... yes > &g

Searching limited to syntax groups

2017-07-18 Thread Tim Chase
My digging hasn't been able to turn up anything, but I was hoping for something that would let me easily search just code or comments to the exclusion of the other. Something like (imaging a sequence like "\%syntax{SyntaxID}" but actual flavor/implementation is negotiable) /\%syntax{Comment}cus

Re: Searching limited to syntax groups

2017-07-18 Thread Tim Chase
On 2017-07-18 15:47, David Fishburn wrote: > http://www.vim.org/scripts/script.php?script_id=848 Excellent...I look forward to experimenting with it. Thanks! -tim -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to.

Re: [OT] "steep learning curve" ... but what is it actually?

2017-07-30 Thread Tim Chase
On 2017-07-30 09:10, tu...@posteo.de wrote: > Suppose this "steep learning curve" would be a graph > in the mathematical sense -- I would think, that > the X-axis represents t (time) and the Y-axis represents > the amount of knowledge k in turn. I think the confusion comes because it seems to be a

Re: A very naive question: any doc (book, web page, ...) to learn step by step how to custom configure vim?

2017-08-11 Thread Tim Chase
On 2017-08-11 10:16, Grant Taylor wrote: > I'd suggest not modifying how Vim behaves / does thing while > getting started with Vim. > > However that does not extend to unconfigured Vim. I say this > because things like line numbers (:set number), search highlighting > (:set hlsearch), and (syntax

Re: how to redefine paragraphs?

2017-09-11 Thread Tim Chase
On 2017-09-11 09:48, Ben Fritz wrote: > On Friday, September 8, 2017 at 6:33:56 PM UTC-5, Tony Mechelynck > wrote: > > • if the 'paragraphs' option is not empty, then a dot in column 1 > > immediately followed by one of the disjoint character pairs > > making up 'paragraphs' is a paragraph start. B

Re: How to display tabs characters as ^I

2017-09-21 Thread Tim Chase
On 2017-09-21 03:59, Igor Forca wrote: > So, how to display ^I (as single character) instead of horizontal > spacing produced by tab key? You want the 'list' setting: :set list or toggle it with :set list! which you can read about at :help 'list' -tim -- -- You received this mes

Re: how to quickly change block data order

2017-09-21 Thread Tim Chase
On 2017-09-21 08:08, Gary Johnson wrote: > Get rid of the indentation of the first line: > > gg0dw Or either of the following gg :set fo= > :set tw=39 > gggqG If you prefer to do it with standard *nix tools outside of vim, you can use sed 's/^\s*//' in.txt | fmt -w 40 > out

Re: VIM and NVD Vulnerability

2017-09-29 Thread Tim Chase
While I can see value in fixing the invalid-free instance described, a vimscript can already call out to any shell command it wants. $ echo 'Important file, do not delete'! > important_file.txt $ echo "call system('touch demo.txt')" > demo.vim $ echo "call system('rm important_file.txt')" >>

Re: insert block of text after end of line

2017-10-15 Thread Tim Chase
On 2017-10-12 11:41, 'Paolo Zandonella' via vim_use wrote: > is there the possibility to paste a block of text or insert some > characters on mouse position after the end of line? You likely want the 'virtualedit' setting: :help 've' which lets you place the cursor in the area after the actual

Re: stray control characters appear on vim startup

2017-10-16 Thread Tim Chase
On 2017-10-16 16:21, John Passaro wrote: > Sometimes when I open a new vim session, unpredictably, various > characters appear on the first line, they look like they are > terminal control characters but I don't know for sure. > > For example: > ;2R^[[>0;95;0c > > They go away as soon as I type

Directing which window is changed with :copen

2017-10-20 Thread Tim Chase
Long a nagging annoyance, I figured it's time to ask. I frequently will do a :vimgrep on a term under the cursor, but want the resulting navigation to open in a new window. $ vim somefile.c :echo 'In my main code window' :new :echo 'I want my vimgrep results HERE' :vimgrep /pattern/ *.[

Re: Directing which window is changed with :copen

2017-10-20 Thread Tim Chase
On 2017-10-20 21:04, Tim Chase wrote: > Long a nagging annoyance, I figured it's time to ask. I frequently > will do a :vimgrep on a term under the cursor, but want the > resulting navigation to open in a new window. Digging a little further, it's not quite as capricious/malic

Re: vim paste question

2017-10-23 Thread Tim Chase
On 2017-10-23 03:21, dexter i wrote: > i want to be able to emit the following lines into the file under > current cursor position. is the word i just > yanked. what's the best way to achieve this. > > { > .testtype = ; \ > .testtypestring = ""; \ > } There are some templating pl

Re: Insert space before last character

2017-10-24 Thread Tim Chase
On 2017-10-24 12:58, Adrian Johnson wrote: > I am trying to insert space after first character in a line and a > space before last character in same line using command mode. I could > introduce space before first character but could not insert space > before last character. > > > F783S > Y625D >

Re: recommendation for a function over the entire buffer

2017-10-26 Thread Tim Chase
On 2017-10-26 19:13, Jose Caballero wrote: > if I want to write a function that does something after every line > matching a given pattern (for example, for every python method > definition), what does the community prefer to handle it? > Just iteratively? The pattern you describe matches nigh-exa

Re: recommendation for a function over the entire buffer

2017-10-26 Thread Tim Chase
On 2017-10-26 21:12, Jose Caballero wrote: > Quick question: when using the :g command, can I call a plugin > function? Like > > :g//:call AFunction() Yes (that 2nd colon is optional). It would require the function to context-aware with regards to the current line, but otherwise, it Should Work™

Vim surprisingly slow?

2017-11-12 Thread Tim Chase
Taking on the challenge listed here https://dev.to/jorinvo/csv-challenge-1al it provides a .json file link to mung into date-named files (never mind that these happen to all be the same date), I came up with this vim solution: :g/.*name":"\([^"]*\)".*card":"\([^"]*\)".*/let s=substitute(getline(

Re: Vim surprisingly slow?

2017-11-14 Thread Tim Chase
On 2017-11-14 18:57, Nazri Ramliy wrote: > On Sun, Nov 12, 2017 at 10:21 PM, Tim Chase > wrote: > > If I change the "exec" to an "echo", it's as fast as I expect. > > > > Any idea what might be making the exec so slow? > > It's

Re: Vim surprisingly slow?

2017-11-14 Thread Tim Chase
On 2017-11-14 18:17, Christian Brabandt wrote: > On Di, 14 Nov 2017, Nazri Ramliy wrote: > > > On Sun, Nov 12, 2017 at 10:21 PM, Tim Chase > > wrote: > > > If I change the "exec" to an "echo", it's as fast as I expect. > > > > >

Re: Vim surprisingly slow?

2017-11-14 Thread Tim Chase
On 2017-11-14 00:08, Erik Falor wrote: > Here's what iotop shows during a typical run: > > Total DISK READ : 0.00 B/s | Total DISK WRITE :1372.27 K/s > Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 2.68 M/s > TID PRIO USER DISK READ DISK WRITE SWAPIN IO> > COM

Re: Vim surprisingly slow?

2017-11-14 Thread Tim Chase
On 2017-11-14 22:15, Christian Brabandt wrote: > Some more things to try: > Does `:set ei=all` or using `:noa :.w` make a difference perhaps? Makes no difference that I could tell. I ^C'ed it after about 30 seconds in both cases. > Also does it work better if you explicitly use e.g. writefile(''

Re: Vim surprisingly slow?

2017-11-14 Thread Tim Chase
On 2017-11-14 22:41, Christian Brabandt wrote: > > > Also does it work better if you explicitly use e.g. > > > writefile('', 'a')? > > > > Much faster! > > > > :g/.*name":"\([^"]*\)".*card":"\([^"]*\)".*/let > > s=substitute(getline('.'), > > '.*stamp":"\(\d\+\)-\(\d\+\)-\(\d\+\).*','\1\2\3',''

Re: Vim surprisingly slow?

2017-11-14 Thread Tim Chase
On 2017-11-14 19:04, Eli the Bearded wrote: > Just do one write. Yeah, I've come up with multiple multi-step solutions and the solution I came up with *works*, it's just surprisingly slow for something that can execute in around a second if slightly reworded (see elsewhere on this thread where Chr

Re: Vim surprisingly slow?

2017-11-15 Thread Tim Chase
On 2017-11-15 08:25, Christian Brabandt wrote: > On Mi, 15 Nov 2017, Dominique Pellé wrote: > > As highlighted in red, notice that we only write 179,281 bytes to > > file "20150425.txt" but we open/write/close/fsync 5004 times. > > That repeated I/O patterns kills performance, especially because >

Re: Vim surprisingly slow?

2017-11-16 Thread Tim Chase
On 2017-11-16 08:03, Christian Brabandt wrote: > On the other hand, we can not fsync() at the end of the `:g` > command, because at that time, we would not have a filehandle to > fsync(). I suppose one could gather the file-handles used during the :g command and then issue one fsync() for each of

Re: pattern for substitution including linefeed and carriage return

2017-12-10 Thread Tim Chase
On 2017-12-10 09:52, Gary Johnson wrote: > A pattern that will match that string is > > "Legend\nfor name\nis not found" > > :help /\_. The "\_" convention holds for things other than "." to add the "and include newline" connotation, so you can change your spaces to Legend\_s\+for\_s\

Re: highlighting prefixed keywords

2017-12-17 Thread Tim Chase
On 2017-12-17 18:49, Jorge Almeida wrote: > I need to apply custom highligthing in a setup that should be simple > for people who understand highligthing: > > I have a bunch of keywords with a common prefix, the single > character 'c'. The keywords are to be listed one by one, not > obtained via s

Re: highlighting prefixed keywords

2017-12-17 Thread Tim Chase
On 2017-12-17 19:16, Jorge Almeida wrote: > Just a detail: is it possible to enumerate the keywords in a > separate declaration, to improve maintainability? (The actual list > is more extense). I'm thinking of something similar to: > > syntax keyword Foo open close mount umount > > Even if it's

Re: Keystroke command

2018-01-18 Thread Tim Chase
On 2018-01-18 22:41, Gua Chung Lim wrote: > For example gUw is the keystrokes to change the > > current word to uppercase. Can I put gUw into the command like... > > > > :%s/^foobar/gUw/g > > to change any foobar at the beginning of the line to FOOBAR? > > (I know this is a wrong example, I'm tryi

Re: Print to PDF (and open in browser)

2018-01-28 Thread Tim Chase
On 2018-01-27 02:29, slackyma...@gmail.com wrote: > "PRINT TO PDF / PRINT AND OPEN TO CHROMIUM > nmap :ha > newfile.ps :! ps2pdf newfile.ps:! rm > newfile.ps > nmap :ha > newfile.ps :! ps2pdf newfile.ps:! > rm newfile.ps && chromium newfile.pdf [snip] > The only problem is that I have to rename

Re: Replace groups of dots by a tab

2018-02-02 Thread Tim Chase
On 2018-02-02 10:45, Bernard Fay wrote: > I have a file with a bunch of lines like the following one: > > AAE ..Above Aerodrome > Elevation > > I would like to replace the dots by a single tab. > > I tried the following substitutions but it does not work.

Re: Partial current word under cursor

2018-02-02 Thread Tim Chase
> nnoremap s :%s/\<\(\)\>//g > > I was thinking that I would set the cursor where I need to insert > the new word, as in "get#Something" where # represents the cursor > and then I'd need to replace it like so: > s/\<\(left-of-cursor)\zs\ze(right-of-cursor)\>/whatever/g You might try something lik

Re: Change only second match on a line...

2018-02-15 Thread Tim Chase
On 2018-02-15 17:16, 'Grant Taylor' via vim_use wrote: > Is there a way to change only the second (or any specific) instance > of a pattern on a line? > > Sort of like how 's/old/new/' changes the first instance of "old" > to "new", but for the second (or any specific) instance. The easiest way o

Re: write to command0line prompt

2018-02-18 Thread Tim Chase
On 2018-02-18 13:05, Renato Fabbri wrote: > :normal :ls > does not leave the user with the cursor at the command-line, e.g. > in: :ls > > Is there a way to write a function or is there a command I might > use to leave the user with a given string in the command-line? A mapping can leave you at th

Re: Visual + global substitution on part of a line replaces every occurance, even outside the selected region

2018-02-21 Thread Tim Chase
On 2018-02-22 04:25, David Woodfall wrote: > If I visually highlight part of a line and do a substitution > using /g it replaces every occurrence in the line, even outside the > visual range. > > Is there a way around this? You want the "\%V" atom: :help /\%V so you'd search for /\%Vpatter

Just another little note of "woah, vim already does that"

2018-02-27 Thread Tim Chase
I've got a rather large source file for an ETL process containing several functions (one for each of the files it processes). There's enough similarity between the file processing that it's easy to do a search and end up in the wrong function without noticing. Knowing vim supported matching/color

Re: Vim for Web development

2018-03-03 Thread Tim Chase
On 2018-03-03 01:55, Renato Fabbri wrote: > Vim is a text editor, ok, and in the Unix design of a programming > environment, what other tools do you use and how. I usually use tmux (and before that GNU screen) to wrap my whole session. Inside that I have - vim open to edit my code - usually a s

Re: Vim for Web development

2018-03-03 Thread Tim Chase
On 2018-03-03 08:22, Renato Fabbri wrote: > The major drawback I found is that vim session do no recover the > terminal windows/buffers It depends on how you open your terminal windows. If you just use :terminal then if you use ":mksession", vim will only remember that you have a termina

Re: Mapping for one handed touch typing

2018-03-23 Thread Tim Chase
On 2018-03-23 14:03, Robert Bower wrote: > I am a occasional Vim user. It is my default rescue editor and I > use it for a few tasks but not many. I would like to use it for > more because it is so customizable. What holds me back is I am a > one handed left handed touch typist. I only have use

Re: Comparing values of two consequent lines

2018-03-29 Thread Tim Chase
On 2018-03-29 08:51, tu...@posteo.de wrote: > I have a textfile with lot of lines. > These lines have the following format > > a- > b- [snip] > I want to check, whether all paired lines have attached > the same value. You can find them with /^command a-\(\w\+\) \+\(\d\+\) *\ncommand b-\1 \+

Re: Comparing values of two consequent lines

2018-03-29 Thread Tim Chase
On 2018-03-29 06:21, Tim Chase wrote: > > I want to check, whether all paired lines have attached > > the same value. > > You can find them with > > /^command a-\(\w\+\) \+\(\d\+\) *\ncommand b-\1 \+\2\@! I suppose I should have offered both alternatives...finding

Re: Comparing values of two consequent lines

2018-03-29 Thread Tim Chase
On 2018-03-29 20:34, tu...@posteo.de wrote: > On 03/29 06:55, Tim Chase wrote: > > On 2018-03-29 06:21, Tim Chase wrote: > > > > I want to check, whether all paired lines have attached > > > > the same value. > > > > > > /

Two spaces after punctuation and SpellCap issues

2018-04-15 Thread Tim Chase
To reproduce: $ vim -u NONE :syntax on :set spell cpo+=J to let vim know I always put two spaces after a sentence. However, if I enter text like Call Bob re. the faucet. or Take Main St. the whole way down. vim's syntax highlighting flags "the" in SpellCap as if it's expecting the

Re: Two spaces after punctuation and SpellCap issues

2018-04-17 Thread Tim Chase
On 2018-04-16 18:05, Bram Moolenaar wrote: > Tim Chase wrote: > > > To reproduce: > > > > $ vim -u NONE > > :syntax on > > :set spell cpo+=J > > > > to let vim know I always put two spaces after a sentence. > > However, if I enter t

Re: vi commands

2018-05-21 Thread Tim Chase
On 2018-05-21 13:32, sampe...@tiscali.it wrote: > I tried to select rows by ctrl-v but with ‘>’ key text is indented > to different space vs tabstop. E.g. my tabstop is set to default as > 4 value and > indent rows to 8 spaces. how can I tune it? You'll want to check your 'shiftwidth', 'softtabsto

Re: vi commands

2018-05-21 Thread Tim Chase
On 2018-05-11 10:52, sampe...@tiscali.it wrote: >> One way is to select the lines of code that you need indenting >> with shift+v and scrolling down, then press > > > Do you know if it works for every VIM environment? I don't usually > install GUI in Linux server. It works in both console & GUI ve

Re: vimdiff exit when files are identical?

2018-05-28 Thread Tim Chase
On 2018-05-28 18:11, M Kelly wrote: > Is there a variable for how many diffs are present after starting > vimdiff ? I'd like to exit immediately with status of 0 if there > are no differences between the files I pass into vimdiff. Not that I know of off the top of my head (though if there is, I'd

Re: Perform diff as exact line match

2018-06-29 Thread Tim Chase
On 2018-06-28 18:30, Joseph L. Casale wrote: > Does a means or plugin exist to perform a diff between two > tabs/files that compares entire lines? I've occasionally hacked this by inserting a unique tag (usually just an incrementing number) after each line in the file, something like :windo g/^

Re: Remember last command?

2018-07-18 Thread Tim Chase
On 2018-07-18 12:23, Bill Tugger wrote: > I often have to make small edits in several files. I need to > display each file as I make the changes so automated tools don't > work. You're asking for automating something you say can't be automated. If the actions *are* repeatable, you can record a m

Re: write as an expression?

2018-07-19 Thread Tim Chase
On 2018-07-19 08:17, Bee wrote: > I would like this function to be written as an expression. > > function! SpellReplaceAll() > if &spell > try | spellr > catch > endtry > endif > endfun > nmap :call SpellReplaceAll() > > How to make it work as an expression? > > The following do

Re: write as an expression?

2018-07-19 Thread Tim Chase
On 2018-07-19 10:08, Bee wrote: > When to use ' or " ? In some contexts (that I don't have memorized) a double-quote is treated as the start of a comment. :help :quote Also, double-quote strings can get special sequences replaced in them while single-quote strings don't: :help expr-quote

Re: Interloper vi

2018-07-31 Thread Tim Chase
On 2018-07-31 19:20, 'Suresh Govindachar' via vim_use wrote: > Why is the old vi being executed even though `which vi` shows the > newer one? And how to get vi to execute the newly installed vim? Have you checked for an alias? Possibly something like $ alias vi alias vi='/usr/bin/vi' Also,

Re: why is cut and paste broken on X11?

2018-08-06 Thread Tim Chase
On 2018-08-06 07:58, ruben.sa...@my.liu.edu wrote: > Why is it that X11 cut and paste has been broken for a couple of > years now and that it is not being fixed. It worked fine for 30 > years. To begin with, mouse works perfectly fine in vim and is configurable for how exactly it does work. You'

Re: Formatting text and using the convention of putting 2 spaces after a period

2018-08-06 Thread Tim Chase
On 2018-08-06 14:47, John Little wrote: > So, for text to be rendered properly in a variable width font one > space is best, but with a monospace font, aka a typewriter font, > such as vim uses, some of us cling to two spaces. I still use two spaces in my source material particularly because I can

  1   2   3   4   5   6   7   8   9   10   >