Re: Function to find all matches in a string?

2024-01-03 Thread Arun
] It looks like substitute() is the closest to what you want to achieve. Perhaps you can add submatch() to get the result appended to the list. Something like this in mind: :let a=[]|g/#\w\+/call substitute(getline('.'), @/, '\=extend(a, [submatch(0)])', 'g') Regards, -Arun -- -- You received

Re: Function to find all matches in a string?

2024-01-02 Thread Arun
like this in mind: :let a=[] | g/#\w\+/call substitute(getline('.'), @/, '\=extend(a, [submatch(0)])', 'g') Regards, -Arun -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information,

vimgrep on files in 'path'

2023-12-18 Thread Arun
..but getcompletion() sometimes does not give me the full path leading to errors. Regards, -Arun -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php

Re: Replace spaces with underscore after some pattern in line

2023-09-28 Thread Arun
bb XXX_a_bbb > ee XXX_aaa___ddd > ddd ee XXX aaa_bbb__eee > > Zero width patterns are helpful here. Try, :%s/\(XXX.*\)\@<=\s/_/g Here, the expression says, any whitespace (\s) that is preceded by "XXX.*" be replaced with

Re: How to quickly move to a specific buffer?

2022-12-14 Thread Arun
On Tue, Dec 13, 2022 at 7:22 PM Steve Litt wrote: > Arun said on Tue, 13 Dec 2022 18:22:41 -0800 > > >Usually, I :split open (maximized) my active files > > For me, :split only makes 2 windows, not a window for every buffer. > # vim -o .. If you are already insid

Re: How to quickly move to a specific buffer?

2022-12-13 Thread Arun
pings help in achieving that: "--8<-- set nocp set winminheight=0 set laststatus=2 au WinEnter * wincmd _ "Map Alt-j to edit split window one below. "Alt" works well in GUI, use something else inside terminals nnoremap j "Map Alt-k to edit split window one above nnoremap k &

Re: Play sound on search wrap

2022-10-06 Thread Arun
:warningmsg="" endf "call CheckWrap using standard statusline set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P%{CheckWrap()} --- The above should ring the bell (provided you did not disable it) on search wraps. Regards, -Arun On Thu, Oct 6, 2022 at 12:33 PM Lifepillar wrote:

Re: Print the first field of a table in one line separated by commas

2022-09-06 Thread Arun
This seems to work well too (tested with 8.1): %s/\(\S\+\)\>.*\n/xx\1yyy,/ Regards, -Arun On Tue, Sep 6, 2022 at 3:43 PM Tim Chase wrote: > On 2022-09-06 14:45, andalou wrote: > > I have the table: > > 1001 John Sena 4 > > 1002 Jafar Iqbal 6 > > 100

Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-05 Thread Arun
ledit=onemore Alternatively, have you considered recording/macros? :h complex-repeat You could just record a set of key strokes using the "q" command and recall the sequence whenever you want. Regards, -Arun > I suppose I could use "Tdx". > > I figured that ther

Re: Perform diff as exact line match

2018-06-29 Thread Arun
a script sometime ago that searches for the exact changed text within a changed line using the above logic. You can modify that to suit to your needs. Regards, -Arun -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replyi

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

2018-02-27 Thread Arun
keeps it ever interesting. As for the above issue, "folds" are good too. - goto just before start of function and: zfgg - after end of function: zfG To prevent search from opening folds: :set foldopen-=search For running commands that skips closed folds :foldd {cmd} Regards, -Arun

Re: vimdiff - how to jump to next difference in long line - shortcut ]c does not work

2018-02-23 Thread Arun
On Fri, Feb 23, 2018 at 9:43 AM, Igor Forca <igo...@gmail.com> wrote: > @Arun, I have tested your code in deep. It is working perfectly. What I > have found is little trouble in the case when first line include the change. > > File1: > aaa ccc > aaa ccc > &

Re: vimdiff - how to jump to next difference in long line - shortcut ]c does not work

2018-02-22 Thread Arun
On Thu, Feb 22, 2018 at 9:26 AM, Arun <aema...@gmail.com> wrote: > On Wed, Feb 21, 2018 at 10:53 PM, Igor Forca <igo...@gmail.com> wrote: > >> @Arun, thanks a lot for this code. I have performed two tests: >> >> TEST 1: LINES WITH NO DIFFERENCE BETWEEN TW

Re: vimdiff - how to jump to next difference in long line - shortcut ]c does not work

2018-02-22 Thread Arun
On Wed, Feb 21, 2018 at 10:53 PM, Igor Forca <igo...@gmail.com> wrote: > @Arun, thanks a lot for this code. I have performed two tests: > > TEST 1: LINES WITH NO DIFFERENCE BETWEEN TWO LINES WITH DIFFERENCES > > File1: > aaa aaa > aaa bbb > aaa aaa > aaa bbb >

Re: vimdiff - how to jump to next difference in long line - shortcut ]c does not work

2018-02-21 Thread Arun
]x :call DiffSearch('curline') -- 8< -- Use ]c for the behavior you want, and use "]x" if you want to search in the current line. Feel free to modify this to suit to your needs. Once search pattern \%h or \%s (help todo.txt) gets implemented in vim, you should be able to jus

Re: pattern of func

2018-02-19 Thread Arun
; set, you could immediately see what your pattern matches. Regards, -Arun On Mon, Feb 19, 2018 at 12:40 PM, Ni Va <nivaem...@gmail.com> wrote: > Hi, > > 1/Got a list mirror of file read that contains these kind of lines: > 19 févr. 2018 15:49:09.301 Foo.BarFoo() - FIN

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

2017-02-12 Thread Arun
On Sat, Feb 11, 2017 at 11:52 AM, Tim Chase <v...@tim.thechases.com> wrote: > 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 > >> > >

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

2017-02-11 Thread Arun
ork with :g, hope it wont be executing the filter against each line, rather as a whole. It would be useful to have a set of lines selected using :g applied against a filter. If the output of the filtered command be captured to a register (or to a destination line, like copy), that woul

Re: VimScript tips needed

2016-08-08 Thread Arun
On Mon, Aug 8, 2016 at 11:51 AM, Nikolay Aleksandrovich Pavlov < zyx@gmail.com> wrote: > 2016-08-08 20:44 GMT+03:00 Arun <aema...@gmail.com>: > > On Mon, Aug 8, 2016 at 12:11 AM, Marc Weber <marco-owe...@gmx.de> wrote: > >> > >> :h search() ->

Re: how to map the n to nzz just in the jump in search result ?

2016-07-17 Thread Arun
it to > > :nnoremap n nzz > > and you're good to go. > > As it appears that the intent here is to re-center the searched line, another approach is to set a high 'scrolloff' lines, like :set scrolloff=999 That way, even backward search (or any other jump for that matter) would als

Re: Is there a way to display line numbers and relative line numbers as with two rulers?

2015-12-17 Thread Arun
I do is visually select the lines and do one of the above delete (ctrl-d) or yank (ctrl-y) operations depending on the context. The mapping started off as an experiment initially, but now it is an indispensable to me. Regards, -Arun On Thu, Dec 17, 2015 at 5:04 AM, Christian Brabandt <c

Re: Is there a way to display line numbers and relative line numbers as with two rulers?

2015-12-17 Thread Arun
On Thu, Dec 17, 2015 at 1:05 PM, Christian Brabandt <cbli...@256bit.org> wrote: > On Do, 17 Dez 2015, Arun wrote: > > > visual indication is a very acceptable trade off for me. I have two > > visual mode mappings in that regard: > > > > > > :vnor

Re: How to replace each character in string with chracter x?

2015-12-16 Thread Arun
You can try the zero-width variant too: %s/\(<[^>]*\)\@<=[^>]\(.*>\)\@=/x/g ..seem to work. On Wed, Dec 16, 2015 at 1:19 AM, Igor Forca wrote: > It works. Thanks a lot. > > -- > -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply

Re: Incrementing and decrementing numbers

2015-06-04 Thread Arun
Looks like it is signed operation always, you can try these mappings instead: Keeping cursor on a number, hit these nn c-a ciwc-r=@+1cresc nn c-x ciwc-r=@-1cresc You can, maybe, write a function to move to the nearest number to mimic native ctrl-a behavior. Regards, -Arun On Thu, Jun 4, 2015

Re: Understanding Vim exclusive motions.

2015-03-30 Thread Arun Jusrut
I think i understand what you are saying. I was misinterpreting the reference manual terms 'start of motion' and 'end of motion'; i was determining start and end of motion based on direction that the cursor moves, which like you said, is not the correct way. Thanks :), Arun On Mon, Mar 30, 2015

Re: vim: least key stroke to replace a word

2015-02-17 Thread Arun
of the macro, you can drop it. Regards, -Arun -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google

Re: use cases for o_v/V/c-v (:help o_v)

2015-01-30 Thread Arun
c-v is something I use quite frequently for block insertions/delete. :h blockwise-operators As a simple example, to comment a bunch of adjacent shell script lines, I use: ^ c-vjjj I#esc v/V, very rarely, I mapped it to :n/:N Regards, -Arun On Thu, Jan 29, 2015 at 7:56 AM, Enno

Re: finding consecutive lines with specific different words/chars

2014-02-17 Thread Arun E
like this should do: :g/^\(this is line \)\(\d\+\)\(.*\)\n\1\(\2\)\@!\d\+\\3$/+p -Arun a search command is preffered over a vimscript. -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more information

Re: how to delete lines containing a pattern and not containing another pattern?

2014-01-28 Thread Arun E
Ben's method would do it. One more way to do this is: :g/.*arch\.*\(sparc.*\)\@!$/d --Arun -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You

Re: Cannot traverse taglist after installing SourceExlorer

2012-07-29 Thread Arun
On Thursday, July 26, 2012 2:37:54 PM UTC+5:30, Christian Brabandt wrote: On Thu, July 26, 2012 11:01, Arun wrote: On Wednesday, July 25, 2012 7:50:27 PM UTC+5:30, Arun wrote: Hi, Recently I have added the following vim plugins - Source Explorer, NERDTree and Trnity. I

Re: Cannot traverse taglist after installing SourceExlorer

2012-07-29 Thread Arun
On Thursday, July 26, 2012 10:04:59 PM UTC+5:30, Ben Fritz wrote: On Wednesday, July 25, 2012 9:20:27 AM UTC-5, Arun wrote: Hi, Recently I have added the following vim plugins - Source Explorer, NERDTree and Trnity. I found that with Source Explorer I am not able to traverse

Re: Cannot traverse taglist after installing SourceExlorer

2012-07-26 Thread Arun
On Wednesday, July 25, 2012 7:50:27 PM UTC+5:30, Arun wrote: Hi, Recently I have added the following vim plugins - Source Explorer, NERDTree and Trnity. I found that with Source Explorer I am not able to traverse the Taglist. I could go to the taglist window using Ctrl-w h. However

Cannot traverse taglist after installing SourceExlorer

2012-07-25 Thread Arun
Hi, Recently I have added the following vim plugins - Source Explorer, NERDTree and Trnity. I found that with Source Explorer I am not able to traverse the Taglist. I could go to the taglist window using Ctrl-w h. However, in that window I cannot go to a tag. The cursor is always in the

Re: how to info vim the ruby/lua intepreter path under windows

2010-12-29 Thread Arun
\Ruby191\bin to path. Regards, Arun -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php

Re: Vim tabs with tag-jumping (ctags)

2009-09-28 Thread Arun
with that file open and the correct function under the cursor. Try set switchbuf=usetab. Also take a look at :h switchbuf. -arun --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---

Vim and ctags, C# code navigation

2009-07-14 Thread Arun
to the particular class. c. A related question. Can anyone comment on cscope for c#/java? Does it allow to search for tokens w/ namespace/class context? Appreciate any help here. Thanks, Arun --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more

Re: How to adjust java indentation?

2009-05-23 Thread Arun
. Is there a whole different set of options for java syntax? Could someone please help me out, or tell me where to look? Sorry, I don't know the exact solution. But you may want to modify $VIMRUNTIME/indent/java.vim. That file should be picked up when filetype indent on is set in vimrc. -Arun

ANNOUNCE: Mastermind board game for vim 7.0

2009-02-16 Thread Arun Easi
: (press \mm to start the game, after sourcing the file) http://www.vim.org/scripts/script.php?script_id=2541 Please send in your comments/suggestions. -Arun --~--~-~--~~~---~--~~ You received this message from the vim_use maillist. For more information, visit http