Search for pattern in the first few lines of a buffer

2021-06-20 Thread Lifepillar
I need to programmatically search for a pattern in the first ten lines of a given buffer, and save the match in a variable when found. Say, the pattern is: % KEY = value I need to extract the value if the above appears in the first lines of the buffer. Of course, the state of the buffer's

Translating complete functions to Vim9

2021-06-19 Thread Lifepillar
Is there a way to turn a completion function (:h complete-functions) into Vim9 script? The issue is that such functions are called twice, and they are expected to return values of different types in each call. Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not

Re: Vim9: how to invoke callback with additional arguments?

2021-05-31 Thread Lifepillar
>> What is Vim9's equivalent of the following? >> >> fun Callback(value, _j, _e) >> echom 'callback with value: ' .. a:value >> endf >> >> fun Func() >> call job_start(['/bin/bash', '-c', ':'], >> \ {'exit_cb': function('Callback', [42])}) >> endf >> >>

Vim9: how to invoke callback with additional arguments?

2021-05-30 Thread Lifepillar
I am trying to understand how to invoke a callback in Vim9 script. I have started from this example (from the excellent lacygoill's wiki): vim9script def Callback(_j: job, _e: number) echom 'callback' enddef def Func() job_start(['/bin/bash', '-c', ':'],

Plans (if any) for Vim9 runtime scripts?

2021-05-29 Thread Lifepillar
What is the vision for future runtime scripts? Is there a plan to move everything to Vim9—including, say, syntax scripts? What is your recommendation to contributors? Is it too early to translate runtime scripts to Vim9? Is it better to stick with the current Vim Script for the time being? I'd

Re: Vim9: E1096 Returning a value in a function without return type

2021-05-08 Thread Lifepillar
On 2021-05-08, Bram Moolenaar wrote: > > Christian wrote: > >> I am getting the error in the subject in a script I am writing. I have >> found that the culprit is the use of statements in a lambda. >> >> This is a minimal example showing the problem: >> >> vim9script >> >> def Bind(x:

Vim9: E1096 Returning a value in a function without return type

2021-05-08 Thread Lifepillar
I am getting the error in the subject in a script I am writing. I have found that the culprit is the use of statements in a lambda. This is a minimal example showing the problem: vim9script def Bind(x: number): func(string): any return (s) => x enddef def Bind2(x:

Help with indenting code

2021-03-10 Thread Lifepillar
I would like to indent code structured as follows: if X then ( if Y then ( ... ) ) else ... To make Python look like a language that is easy to indent, this language has `if... then... [else]` blocks without `endif`. I get can

Re: Vim9: call function from variadic function?

2021-03-01 Thread Lifepillar
On 2021-03-01, Bram Moolenaar wrote: > > >> This might be a bit of a stretch, but... is it possible to >> "expand/split" variable arguments to call another function with fixed >> arguments? I would like to define a function that takes as input another >> function F and some values v1, vn... , and

Re: Vim9: call function from variadic function?

2021-03-01 Thread Lifepillar
On 2021-03-01, Bram Moolenaar wrote: > > Stan Brown wrote: > >> :h curly-braces-names Thanks, I didn't know about that feature. > Note that in Vim9 script curly-braces are not supported. They have > always been a bit problematic, and compiling an expression with > curly-braces is not possible,

Vim9: call function from variadic function?

2021-02-28 Thread Lifepillar
This might be a bit of a stretch, but... is it possible to "expand/split" variable arguments to call another function with fixed arguments? I would like to define a function that takes as input another function F and some values v1, vn... , and applies F to v1, ..., vn. For example, I can define:

Re: mapping :W to :w...

2021-02-24 Thread Lifepillar
>>On 02/23 11:11, Salman Halim wrote: >> I actually prefer to never hit shift, so map ; to : instead. >> >On 2021-02-24, tu...@posteo.de wrote: > Hi Salman, > > oh! :) > > The first is genious Keep in mind that ; is a useful mapping in Vim. Sure, you can remap it to :, but, in my experience, in

Re: syntax highlighting legend

2021-02-20 Thread Lifepillar
On 2021-02-15, Matthew Pritchard wrote: > Hello I am wondering what is the color code for the different colors vim > displays. I am also assuming that these colors can be customized. How do I > do this? I'd recommend to start with: :help coloring In particular, some conventional names are

Re: How to grep #tag?

2020-10-11 Thread Lifepillar
On 2020-10-11, @lbutlr wrote: > On 11 Oct 2020, at 06:22, Bram Moolenaar wrote: >> You can use any special character to surround the pattern, it's a lot >> easier than escaping. I often use ":grep /pattern/ *", unless the >> pattern contains a slash. > As soon as I learned you could use any

Re: How to grep #tag?

2020-10-11 Thread Lifepillar
On 2020-10-11, Shlomi Fish wrote: > On Sat, 10 Oct 2020 21:09:26 - (UTC) > Lifepillar wrote: > >> How can I grep text with a special symbol, such as #? > > Either: > > :grep \\#p > > Or: > > :grep '\#p' > > Seem to work her

How to grep #tag?

2020-10-10 Thread Lifepillar
How can I grep text with a special symbol, such as #? I would like to search a bunch of files containing various #tags, but if I try from the command line: :grep #sometag that does not work. Escaping the hash causes grep to exit with an error: :grep \#sometag Any idea? Thanks, Life.

Re: Lambdas and "typedefs" in Vim9

2020-09-27 Thread Lifepillar
On 2020-09-27, Bram Moolenaar wrote: > >> Filter(x, { v -> v =~ '^b' }) >> # E1013 > > Well, in a sense that is correct. The Filter() functions accepts a > function reference with a specific type, and what is passed in is a > function reference without any known type. Ok, that might be

Re: Lambdas and "typedefs" in Vim9

2020-09-27 Thread Lifepillar
On 2020-09-27, Bram Moolenaar wrote: >> I have two questions/curiosities: >> >> 1. I was not able to pass lambdas to defs, only funcrefs. Can/will this >>be supported? > > Can you give an example of what does not work? This is what I have tried: vim9script def Filter(l: list,

Lambdas and "typedefs" in Vim9

2020-09-27 Thread Lifepillar
I have not followed the development of Vim9 script closely, but yesterday I have started to play with it. I was pleasantly surprised to see how far it's got already: I could convert some scripts of mine without much effort and make them run just fine! I have two questions/curiosities: 1. I was

Re: [vim colours + iTerm2 colours]

2020-09-24 Thread Lifepillar
On 2020-09-24, Maxim Abalenkov wrote: > > Thank you very much for your thorough explanations! Now we are very > close to the solution. My end goal is the opposite. I would like to > _disable_ iTerm2 colours, when I use Vim. I would like to use _pure_ > Vim colour scheme, without the interference

Re: [vim colours + iTerm2 colours]

2020-09-24 Thread Lifepillar
On 2020-09-23, 'Grant Taylor' via vim_use wrote: > On 9/22/20 7:33 AM, Maxim Abalenkov wrote: >> I tend to use both vim colours and iTerm2 colour scheme. If I understand >> correctly, the resulting colours that I see are a mixture of both Vim >> and iTerm2 colour profiles superimposed. Therefore,

Re: [vim colours + iTerm2 colours]

2020-09-24 Thread Lifepillar
On 2020-09-23, Maxim Abalenkov wrote: > Thank you for your reply. I will check. I'm not certain about the "gui" > part of the command. I'm not using Gvim. The termguicolors option is specifically for terminals supporting millions of colors, such as iTerm2. It tells Vim to use the "gui" color

Re: [vim colours + iTerm2 colours]

2020-09-23 Thread Lifepillar
On 2020-09-22, Maxim Abalenkov wrote: > Dear all, > > How are you? Potentially, I have another very simple question for you, > vim experts. My usual working environment is Vim running in an iTerm2 > session. I tend to use both vim colours and iTerm2 colour scheme. If > I understand correctly, the

How to get SpellBad highlighting under the cursor?

2020-09-07 Thread Lifepillar
Is there a way in Vim Script to get the highlighting under the cursor when it is SpellBad or similar group? For instance, after: :new :set ft=c :set spell i// Whaat? I would like to determine that "Whaat" is highlighted with SpellBad. I have tried with synIDattr(), but it

Handling v:count in popup filters

2020-09-03 Thread Lifepillar
How do you handle counts with a popup menu filter? Something like this almost works: let s:n = 0 fun MyFilter(winid, key) if a:key == '+' let s:n += v:count1 call popup_settext(a:winid, printf('Value: %d', s:n)) return 1 endif return 0 endf

Re: How can I find where one word is close to another word?

2020-07-26 Thread Lifepillar
On 2020-07-25, Adrian Keister wrote: > > > As most people on this forum are likely aware, searching for a word is > straight-forward enough. If I want to find occurrences of the word 'arc', I > can type / arc , with spaces around the three letters, to find basic > occurrences of the word

errorformat for LaTeX

2020-07-16 Thread Lifepillar
The log of a typeset LaTeX document of mine has the following warning: LaTeX Warning: Reference `sec:encryption' on page 1 undefined on input line 113 6 (In case the formatting changes when sending, the above message is all on a single line, except for the last digit of the line number, which is

Retrieve synID of highlight group by name

2020-07-11 Thread Lifepillar
Is there an efficient way to get the syntax ID given the name of a highlight group? I.e., the inverse of synIDattr(id, 'name') Thanks, Life. -- -- 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

Re: Status of sound support in Vim

2020-07-07 Thread Lifepillar
On 2020-07-06, rwmit...@gmail.com wrote: > > > On Monday, July 6, 2020 at 4:05:41 AM UTC-4 Lifepillar wrote: > >> On 2020-07-05, Lifepillar wrote: >> >> >>> Lifepillar wrote: >> >>> >> >>> > What is the status of +soun

Re: Status of sound support in Vim

2020-07-06 Thread Lifepillar
On 2020-07-05, Lifepillar wrote: > On 2020-07-05, Bram Moolenaar wrote: >> >> Dominique wrote: >> >>> Lifepillar wrote: >>> >>> > What is the status of +sound in Vim? In particular, is anyone working on >>> > adding support for mac

Re: Status of sound support in Vim

2020-07-05 Thread Lifepillar
On 2020-07-05, Bram Moolenaar wrote: > > Dominique wrote: > >> Lifepillar wrote: >> >> > What is the status of +sound in Vim? In particular, is anyone working on >> > adding support for macOS? >> > >> > The manual has examples mentionin

Status of sound support in Vim

2020-07-05 Thread Lifepillar
What is the status of +sound in Vim? In particular, is anyone working on adding support for macOS? The manual has examples mentioning Ubuntu, so I infer that Ubuntu should be supported, but I cannot get any sound. I have tried with .wav, .oga and .ogg files, so I don't think it's a format issue.

Re: error list

2020-05-22 Thread Lifepillar
On 2020-05-22, Joseph wrote: > Is there an easy way to dump the error list to the current vim > buffer/window? > > Actually, is there a general way to do this for other commands too? I use this code, which you may adapt to your needs: " Send the output of a Vim command to a new scratch

Re: Why is get(dict,value,default) evaluated eagerly?

2020-05-21 Thread Lifepillar
On 2020-05-21, Tony Mechelynck wrote: > On Thu, May 21, 2020 at 6:05 PM Lifepillar wrote: >> >> I have always believed that, in get(X,y,z), z would be evaluated only >> when dictionary X does not contain key y. Today, to my surprise, I have >> discovered that it is

Why is get(dict,value,default) evaluated eagerly?

2020-05-21 Thread Lifepillar
I have always believed that, in get(X,y,z), z would be evaluated only when dictionary X does not contain key y. Today, to my surprise, I have discovered that it is not the case: fun! Loop() call Loop() endf let H = { 'a': 1 } if has_key(H, 'a') || Loop() " Fine, this is

Re: Theme dev (Selenized) help: SpellRare and undercurl not working in Vim, works in NeoVim

2020-04-03 Thread Lifepillar
On 2020-04-03, Lifepillar wrote: > in Vim's terminal Sorry, I mean in terminal Vim. And btw, I am using Vim 8.2.0350. Should Vim fallback to `underline` when the terminal does not support `undercurl`? Life. -- -- You received this message from the "vim_use" maillist. Do not t

Re: Theme dev (Selenized) help: SpellRare and undercurl not working in Vim, works in NeoVim

2020-04-03 Thread Lifepillar
On 2020-04-02, Christian Brabandt wrote: > > On Mi, 01 Apr 2020, Daniel Gray wrote: > >> Hi, >> >> I'm currently working on a theme called Selenized >> https://github.com/jan-warchol/selenized/ >> >> We're using https://github.com/lifepill

Re: How to display 'current working directory' in status bar only if it differs from current file path?

2019-12-15 Thread Lifepillar
On 2019-12-15, Igor wrote: > In Vim 8.2 I have two information in my status line: > - full path to my current opened file > - full path to current working directory > > I have set the following commands: > set laststatus=2 " always display status line > set

Re: g:actual_curwin undefined

2019-06-19 Thread 'Lifepillar' via vim_use
On 19 Jun 2019, at 20:13, 'Lifepillar' via vim_use wrote: > > I want to use g:statusline_winid and g:actual_curwin to detect > whether the currently drawn status line is the active one. > > With Vim 8.1.1517, I have tried the following code: > >fun! BuildStatu

g:actual_curwin undefined

2019-06-19 Thread 'Lifepillar' via vim_use
I want to use g:statusline_winid and g:actual_curwin to detect whether the currently drawn status line is the active one. With Vim 8.1.1517, I have tried the following code: fun! BuildStatusLine() return g:statusline_winid ==# g:actual_curwin \ ? 'Active' : 'Inactive' endf

Highlight definitions displaying both settings and link

2019-06-02 Thread 'Lifepillar' via vim_use
Some highlight groups may have both settings and links. What does it depend from? For instance, in the color scheme I am using (but I have noticed this in many others): :hi StatusLineTerm StatusLineTerm xxx term=bold,reverse cterm=bold ctermfg=0 ctermbg=121 gui=bold guifg=bg guibg=LightGreen

Re: Looking for help getting iVim set up

2019-05-30 Thread 'Lifepillar' via vim_use
> On 29 May 2019, at 19:46, Eric Weir wrote: > > >> On May 29, 2019, at 4:27 AM, 'Lifepillar' via vim_use >> wrote: >> >> I feel your pain, that’s much harder than it should be. > > Thanks much for your response. Glad to hear I’m not the only

Re: Looking for help getting iVim set up

2019-05-29 Thread 'Lifepillar' via vim_use
On 29 May 2019, at 10:27, 'Lifepillar' via vim_use wrote: > > On 29 May 2019, at 00:53, Eric Weir <mailto:eew...@bellsouth.net>> wrote: >> >> I'm struggling trying to get iVim setup on my iPad. I wish there was a way >> to put problems and questions to

Re: Looking for help getting iVim set up

2019-05-29 Thread 'Lifepillar' via vim_use
On 29 May 2019, at 00:53, Eric Weir wrote: > > I'm struggling trying to get iVim setup on my iPad. I wish there was a way to > put problems and questions to a community of experienced users. > > Most immediately are the walls I’m running into in trying to import my .vim > folder and my

Re: Has window-toolbar feature?

2019-05-26 Thread 'Lifepillar' via vim_use
On 26 May 2019, at 13:14, Bram Moolenaar wrote: > > >> How do you check whether Vim has the window-toolbar (WinBar) feature? > > if has('menu') I have compiled v8.0.0197 (with +menu), has('menu') returns 1, yet it doesn't seem to have support for window toolbars. Ah ok, helpgrep-ing

Has window-toolbar feature?

2019-05-26 Thread 'Lifepillar' via vim_use
How do you check whether Vim has the window-toolbar (WinBar) feature? Thanks, Life. -- -- 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

Questions about colors/tools/check_colors.vim

2019-05-24 Thread 'Lifepillar' via vim_use
Currently, colors/tools/check_colors.vim prints warnings when 1. one of the checked highlight groups is defined with `hi link` instead of `hi`; 2. a hi command defines guifg but not ctermfg or vice versa. For instance, I get warnings for hi! link ColorColumn SomethingElse Is this

Re: Vim "by far the best editor on the iPad"

2019-05-21 Thread 'Lifepillar' via vim_use
On 18 May 2019, at 20:17, Eric Weir wrote: > > > Lotsa questions about running Vim on an iPad within the constraints of > iOS/iVim. For starters, just two: Is it possible to create folders in the > iVim sandbox, e.g., in the .vim folder? Yes. You can do it with netrw: :edit . d Type

Re: download statistics from the daily win builds

2019-05-17 Thread 'Lifepillar' via vim_use
On 17 May 2019, at 21:42, Christian Brabandt wrote: > > Hi, > I thought, that I share some download statistics from the daily Vim > builds from the vim-win32-installer repository that I created today. > > So here are some statistics for the releases 8.1.1201 (Apr 25th, 2019) - > 8.1.1336 (May

Re: A question about highlight-cterm

2019-05-11 Thread 'Lifepillar' via vim_use
On 11 May 2019, at 13:10, Bram Moolenaar wrote: > >> >> I am a bit puzzled by the note in `:help highlight-cterm`: >> >>Note: Many terminals (e.g., DOS console) can't mix these attributes with >>coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“. >> >> Virtually all

A question about highlight-cterm

2019-05-11 Thread 'Lifepillar' via vim_use
I am a bit puzzled by the note in `:help highlight-cterm`: Note: Many terminals (e.g., DOS console) can't mix these attributes with coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“. Virtually all colorschemes I have seen use ctermfg AND ctermbg AND cterm. The note above is

Re: Create buffer without opening a window

2019-05-07 Thread 'Lifepillar' via vim_use
On 7 May 2019, at 00:39, Tony Mechelynck wrote: > > On Mon, May 6, 2019 at 9:40 PM 'Lifepillar' via vim_use > mailto:vim_use@googlegroups.com>> wrote: >> >> On 6 May 2019, at 20:57, 'Andy Wokula' via vim_use >> wrote: >>> >>> Am 06.05.201

Re: Create buffer without opening a window

2019-05-06 Thread 'Lifepillar' via vim_use
On 6 May 2019, at 20:57, 'Andy Wokula' via vim_use wrote: > > Am 06.05.2019 um 17:02 schrieb 'Lifepillar' via vim_use: >> I would like to create a new buffer "in the background", without opening >> any new window, put some text into the buffer then write it to d

Create buffer without opening a window

2019-05-06 Thread 'Lifepillar' via vim_use
I would like to create a new buffer "in the background", without opening any new window, put some text into the buffer then write it to disk, without ever showing the buffer (the reason why I am not populating a List and use writefile() directly is that I need to perform some text manipulation

Re: Grouping digraphs

2019-04-30 Thread 'Lifepillar' via vim_use
On 30 Apr 2019, at 13:13, Tony Mechelynck wrote: > But (@Lifepillar) Christian is too modest — another great tool for > (among others) searching for and identifying Unicode characters is his > own unicode.vim plugin (which includes online help according to the > great Vim tradition)

Tweaking t_Co to configure colorscheme

2019-04-30 Thread 'Lifepillar' via vim_use
I have made some colorschemes that use colors 0-15 or 16-256 according to the value of t_Co or based on a user option: if _Co < 256 || g:mytheme_force16colors = 1 # Define hi groups with colors 0-15 else # Define hi groups with colors 16-256 endif Setting t_Co at runtime

Re: Grouping digraphs

2019-04-30 Thread 'Lifepillar' via vim_use
On 30 Apr 2019, at 07:44, Christian Brabandt wrote: > > > On Mo, 29 Apr 2019, 'Lifepillar' via vim_use wrote: > >> I recall reading about a proposal (by C. Brabandt, I think) for grouping >> the presentation of digraphs. I don’t seem to be able to find that >> di

Grouping digraphs

2019-04-29 Thread 'Lifepillar' via vim_use
I recall reading about a proposal (by C. Brabandt, I think) for grouping the presentation of digraphs. I don’t seem to be able to find that discussion, however. Does anyone know the status of the proposal and whether there is a patch available to try? Digraphs are a wonderful feature, except that

Re: Jump to previous window when closing a window

2019-01-13 Thread Lifepillar
On 2019-01-13, Lifepillar wrote: > If you run `vim --clean` and type vvLc, the cursor > will jump to window 2 instead of window 1, where the cursor was before > window 3 was closed. Is there a way to have the cursor go to the > previous window (as in p) when another wind

Jump to previous window when closing a window

2019-01-13 Thread Lifepillar
If you run `vim --clean` and type vvLc, the cursor will jump to window 2 instead of window 1, where the cursor was before window 3 was closed. Is there a way to have the cursor go to the previous window (as in p) when another window is closed? Thanks, Life. -- -- You received this message from

Re: How to auto delete removed file's undo/backup ?

2018-12-02 Thread Lifepillar
On 2018-12-01, Ruben Safir wrote: > how did it help you. You asked about history tmp files and the response > was completely irrelevant. Clue the rest of us in? FWIW, I have this command in my vimrc: " Clean up old undo files command! -nargs=0 CleanUpUndoFiles \ !find ~/.vim/tmp/undo

Re: Using Vim as a Browser Bookmark Manager - Auto Recursive Folding

2018-11-15 Thread Lifepillar
URL 23 > URL 24 > > - the auto folding would have to allow for nesting so a fold would start > on the word "FOLDER" and continue to the last line before the next word > "FOLDER" with the same level of indentation or until a change of > indentation occ

Re: Vim modes state diagram

2018-11-14 Thread Lifepillar
On 2018-11-14, Efraim Yawitz wrote: > On Tue, Nov 13, 2018 at 5:26 PM Yegappan Lakshmanan > wrote: > >> Hi, >> >> I came across this state diagram for the different Vim modes in a recent >> reddit thread: >> >> https://rawgit.com/darcyparker/1886716/raw/vimModeStateDiagram.svg >> >> This looked

Re: Paste into a :term window?

2018-10-25 Thread Lifepillar
On 25/10/2018 17:32, Kelvin Lawrence wrote: I'm enjoying the new :term feature in 8.1 I have my code on the left and a job running on the right. The job is a console environment for Groovy. Is there an easy way to copy from the code on the left and paste into the console I have running on the

Re: Cursor stays in command line after echo invoked with pumvisible() == 1

2018-10-21 Thread Lifepillar
On 21/10/2018 12:59, Lifepillar wrote: On 07/09/2018 20:58, Lifepillar wrote: If you run `vim --clean` (I have tried with Vim 8.1.300) and source this: fun! Act()    echo "The cursor gets stuck here ->"    return '' endf " 1. Trigger keyword completion (=='') " 3. Invok

Re: Cursor stays in command line after echo invoked with pumvisible() == 1

2018-10-21 Thread Lifepillar
On 07/09/2018 20:58, Lifepillar wrote: If you run `vim --clean` (I have tried with Vim 8.1.300) and source this: fun! Act()   echo "The cursor gets stuck here ->"   return '' endf " 1. Trigger keyword completion (=='') " 3. Invoke Act() with pumvisible() == 1 ((Act) fu

Cursor stays in command line after echo invoked with pumvisible() == 1

2018-09-07 Thread Lifepillar
If you run `vim --clean` (I have tried with Vim 8.1.300) and source this: fun! Act() echo "The cursor gets stuck here ->" return '' endf " 1. Trigger keyword completion (=='') " 3. Invoke Act() with pumvisible() == 1 ((Act) fun! Complete() return "\\\=''\\(Act)" endf imap (Act) Act()

Re: Accessing mapping from rhs

2018-08-30 Thread Lifepillar
On 30/08/2018 20:37, Christian Brabandt wrote: On Do, 30 Aug 2018, John Passaro wrote: Could you implement the function and accompanying mapping as follows? imap MyFunction("cr") imap n MyFunction("Leader-n") This is the typical workaround. The idea was to be able to know in the

Accessing mapping from rhs

2018-08-30 Thread Lifepillar
Is it possible to access the lhs of a mapping from its rhs? For example, given: imap MyFunction() is there a way for MyFunction() to know that it was called by ? Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you

About using vartabstop

2018-08-29 Thread Lifepillar
There's a meme (if it may be called so) circulating on Twitter about using Fibonacci sequences for indentation. Just for fun, I wanted to see if it could be implemented using the vartabs feature. I thought that this would do it (for C files): set shiftwidth=0 set noexpandtab set

Re: Start terminal in a given directory

2018-08-23 Thread Lifepillar
On 23/08/2018 15:28, Jason Franklin wrote: The documentation under term_start() was recently updated to include this option. So, I have likely searched the help in a version without your patch, which, has led me to believe that "cwd" was not supported. Thanks for letting me know! Life. -- --

Re: Start terminal in a given directory

2018-08-22 Thread Lifepillar
On 22/08/2018 21:06, Bram Moolenaar wrote: Currently, terminal jobs are always started in :pwd, AFAICT. Is there a reason why the "cwd" option from job_start() is not inherited by term_start()? I though this was in the todo list, but I can't find it now. Ah, it's implemented already and

Start terminal in a given directory

2018-08-22 Thread Lifepillar
Currently, terminal jobs are always started in :pwd, AFAICT. Is there a reason why the "cwd" option from job_start() is not inherited by term_start()? What is the recommended way to start a terminal job in a given working directory? Thanks, Life. -- -- You received this message from the

Re: how can I replace two lines into one line

2018-08-16 Thread Lifepillar
On 16/08/2018 09:21, Sand Glass wrote: I have many files, each file have the code block: # `define DLY \ 1 ## I want to change it to: # `define DLY 1 ## by the way, the line ending is '\r\n', windows style. Perhaps something like: :bufdo g/^`define/norm JXX

Re: Set background and hi Normal: in which order?

2018-08-12 Thread Lifepillar
On 12/08/2018 18:39, Tony Mechelynck wrote: On Sun, Aug 12, 2018 at 4:58 PM, Lifepillar wrote: Dear masters of Vim colorschemes, which of the following should a dark-only colorscheme use? (1) set background=dark hi Normal ... " Other highlight groups here (2) hi N

Set background and hi Normal: in which order?

2018-08-12 Thread Lifepillar
Dear masters of Vim colorschemes, which of the following should a dark-only colorscheme use? (1) set background=dark hi Normal ... " Other highlight groups here (2) hi Normal ... set background=dark " Other highlight groups here (3) hi Normal ... " Don't set

Re: restricted search & replace

2018-07-24 Thread Lifepillar
On 25/07/2018 05:20, tu...@posteo.de wrote: Hi, in a table made pure from ascii :) I want to replace certain character for all lines but in a certain column only. Therefore I have to restrict search and replace to a certain range of colums (vim context not table context). How can I do that?

Re: Remember last command?

2018-07-18 Thread Lifepillar
On 18/07/2018 21: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. What I do is edit a file, save it, open the next file, edit, save, etc. Search string I last used is remembered. EG if

Re: Syntax matching question(s)

2018-07-13 Thread Lifepillar
On Friday, July 13, 2018 at 3:05:03 AM UTC-4, Lifepillar wrote: According to `:h syn-pattern`, syntax patterns are always interpreted as if 'magic' is on, so \v can be removed. If I take off the \v it breaks. So there is something wrong with how I am doing it. "\v" means &

Re: Use bar cursor in Insert mode, but with no blinking

2018-06-21 Thread Lifepillar
On 20/06/2018 23:47, David Woodfall wrote: On Wednesday 20 June 2018 18:24, Lifepillar put forth the proposition: Is there a way to suppress the blinking The number after the escape \e can be from 1-6. Odd numbers blink, even don't. You can test in your terminal by eg: printf "\

Use bar cursor in Insert mode, but with no blinking

2018-06-20 Thread Lifepillar
Currently, I have these lines in my vimrc: " Show block cursor in Normal mode and line cursor in Insert mode: let _ti.="\e[1 q" let _SI.="\e[5 q" let _EI.="\e[1 q" let _te.="\e[0 q" They have the side effect that the cursor blinks (in Normal and Insert mode) even if blinking cursor is

Re: statusline, display hand-defined IPA or other arbitrary text for character under cursor

2018-05-31 Thread Lifepillar
On 31/05/2018 18:46, Kenneth Reid Beesley wrote: On Wednesday, May 30, 2018 at 2:03:21 PM UTC-6, Kenneth Reid Beesley wrote: My problem now is that I can input the hiragana characters, but the glyphs must be coming from some default font in the operating system (I'm using MacVim). The

Re: Help on Interpreting profiles (while loop vs recursive function)

2018-05-17 Thread Lifepillar
On 16/05/2018 21:09, Lifepillar wrote: I wanted to profile the performance of a while loop vs a recursive function, so I wrote two functions, Iter() and Rec(), computing the same value (full code at the end of the message). The execution took ~4s, but Rec()'s measured times were (full profile

Help on Interpreting profiles (while loop vs recursive function)

2018-05-16 Thread Lifepillar
I wanted to profile the performance of a while loop vs a recursive function, so I wrote two functions, Iter() and Rec(), computing the same value (full code at the end of the message). The execution took ~4s, but Rec()'s measured times were (full profile at the end of the message): FUNCTION

Re: Supporting xterm-bracketed-paste

2018-05-06 Thread Lifepillar
On 06/05/2018 17:45, Matteo Landi wrote: Hello everyone, Only recently I got to learn about 'xterm-bracketed-paste' when all of a sudden CMD-V-ing had stopped working on my Mac, and while I found a solution that worked with my setup [0], I am still not 100% sure the solution I found is the

Problem with writing tests for completion

2018-05-01 Thread Lifepillar
While writing tests for my completion plugin (MUcomplete), I have encountered some difficulty related to testing the auto-completion functionality, which I try to reproduce below without my plugin, using only core Vim commands. I am not sure I have found the culprit yet, but I would appreciate

Re: 'normal' doesn't trigger TextChangedI

2018-04-22 Thread Lifepillar
On 23/03/2018 22:39, Bram Moolenaar wrote: Life wrote: On 23/03/2018 15:41, Jason Felice wrote: I couldn't get feedkeys() to trigger TextChangedI either, so I've rewritten my tests to use a terminal with small delays between keystrokes, and this works. I have the same problem (writing

Re: Copy/paste to terminal

2018-04-09 Thread Lifepillar
On 08/04/2018 22:30, Ni Va wrote: Le dimanche 8 avril 2018 22:23:11 UTC+2, Ni Va a écrit : >> how can I paste that command into terminal. CTRL-W " {reg} where reg is @ Thanks for answering your own question: I have been looking for a way to paste into the terminal as well. How did you

Re: feedkeys \ Enter key

2018-04-01 Thread Lifepillar
On 01/04/2018 11:18, Ni Va wrote: Le dimanche 1 avril 2018 11:01:45 UTC+2, Lifepillar a écrit : On 01/04/2018 10:09, Ni Va wrote: Hi, In order to easily test command I have mapped this following. feedkeys enters well WEATHER chars but not key. nnoremap :!start gvim -c "

Saving lowecase variables in session files

2018-04-01 Thread Lifepillar
Sometimes, I change some plugin settings during a session. Such changes are not reflected by :mksession because the variables I have changed start with a lower-case letter. How would you add such variables to a session file? Thanks, Life. -- -- You received this message from the "vim_use"

Re: feedkeys \ Enter key

2018-04-01 Thread Lifepillar
On 01/04/2018 10:09, Ni Va wrote: Hi, In order to easily test command I have mapped this following. feedkeys enters well WEATHER chars but not key. nnoremap :!start gvim -c "call feedkeys(':WEATHER\')" Surround feedkeys()'s argument in double, not single, quotes. Life. --

Re: 'normal' doesn't trigger TextChangedI

2018-03-23 Thread Lifepillar
On 23/03/2018 17:36, Jason Felice wrote: https://github.com/eraserhd/parinfer-rust/blob/master/tests/run.vim#L40-L65 is the interesting bit. Thanks, cool hack! But read Bram's reply about test_override(), which makes this workaround unnecessary. Life. -- -- You received this message from

Re: 'normal' doesn't trigger TextChangedI

2018-03-23 Thread Lifepillar
On 23/03/2018 22:39, Bram Moolenaar wrote: Life wrote: On 23/03/2018 15:41, Jason Felice wrote: I couldn't get feedkeys() to trigger TextChangedI either, so I've rewritten my tests to use a terminal with small delays between keystrokes, and this works. I have the same problem (writing

Re: 'normal' doesn't trigger TextChangedI

2018-03-23 Thread Lifepillar
On 23/03/2018 15:41, Jason Felice wrote: I couldn't get feedkeys() to trigger TextChangedI either, so I've rewritten my tests to use a terminal with small delays between keystrokes, and this works. I have the same problem (writing tests for a plugin that uses TextChangedI, but TextChangedI

Re: Questions about mapping information

2018-03-21 Thread Lifepillar
On 21/03/2018 09:57, Nikolay Aleksandrovich Pavlov wrote: 2018-03-21 10:34 GMT+03:00 Lifepillar <lifepil...@lifepillar.me>: >> :verbose imap shows this: i &@(MUcompleteCR)24_AutoPairsReturn Last set from ~/.vim/pack/bundle/start/auto-pairs/plugin/auto-pairs.vim i

Questions about mapping information

2018-03-21 Thread Lifepillar
I am trying to debug an issue with my plugin (µcomplete) and auto-pairs, and I have a couple of questions about the way Vim displays information about mappings. I have these definitions in my vimrc: imap MyCR (MUcompleteCR) imap MyCR Auto-pairs maps , too, and it tries hard not to

Re: A syntax highlighting trivia: matching operators

2018-02-20 Thread Lifepillar
On 20/02/2018 16:10, Charles E Campbell wrote: Lifepillar wrote: Suppose that @, @@, and @@@ are three operators and that @ is not in iskeyword. Besides, the operators may not necessarily be surrounded by spaces or alphanumeric characters: for example, one may encounter @( at the begin

Re: Writing tests for completion

2018-02-18 Thread Lifepillar
On 09/02/2018 22:41, Lifepillar wrote: Unfortunately, I still have some problems when I test my plugin's mappings. I have traced back the issue to the following:   fun! s:dup_complete()     " Get the text in front of the cursor     return getline('.')[0:col('.') - 2]   endf

A syntax highlighting trivia: matching operators

2018-02-17 Thread Lifepillar
Suppose that @, @@, and @@@ are three operators and that @ is not in iskeyword. Besides, the operators may not necessarily be surrounded by spaces or alphanumeric characters: for example, one may encounter @( at the begin of the line (as in this line). How would you define syntax rules to

Re: Will vim copy all file content to memory when i open a file?

2018-02-15 Thread Lifepillar
On 15/02/2018 00:31, Tony Mechelynck wrote: On Thu, Feb 15, 2018 at 12:28 AM, Tony Mechelynck <antoine.mechely...@gmail.com> wrote: On Tue, Feb 13, 2018 at 9:49 PM, Lifepillar <lifepil...@lifepillar.me> wrote: [...] In my system (macOS and Vim 8.0.1500), if I run `vim --clean` repe

<    1   2   3   >