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 highlig

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 wrote: On Tue, Feb 13, 2018 at 9:49 PM, Lifepillar wrote: [...] In my system (macOS and Vim 8.0.1500), if I run `vim --clean` repeatedly, both maxmem and maxmemtot are set to the same huge value

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

2018-02-13 Thread Lifepillar
On 12/02/2018 20:58, Bram Moolenaar wrote: Zhigang Song wrote: Will vim copy all file content to memory when I open a file? Vim will read the file, mainly to count the number of lines, so you can do "1234G". Not all of the file is kept in memory, especially if it's a big file. Check out the

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

2018-02-13 Thread Lifepillar
On 13/02/2018 03:15, Tony Mechelynck wrote: On Tue, Feb 13, 2018 at 2:41 AM, Matt Ackeret wrote: On Sun, 11 Feb 2018, Zhigang Song wrote: Will vim copy all file content to memory when I open a file? No, that's why vim is fast opening gigantic files. However, unlike sed, Vim is not a stream

Re: Glob filename containing { (left brace) in Windows

2018-02-11 Thread Lifepillar
On 11/02/2018 20:18, Nikolay Aleksandrovich Pavlov wrote: 2018-02-11 21:44 GMT+03:00 Lifepillar : Is there any way for glob() to expand a filename containing { (left brace) in Windows *without* removing { from isfname? For example, if the current dir has a file called '{foo', then

Glob filename containing { (left brace) in Windows

2018-02-11 Thread Lifepillar
Is there any way for glob() to expand a filename containing { (left brace) in Windows *without* removing { from isfname? For example, if the current dir has a file called '{foo', then :echo glob('\{*') correctly expands to '{foo' provided that isfname does not contain {; otherwise, the above

Re: Writing tests for completion

2018-02-09 Thread Lifepillar
On 09/02/2018 14:32, Bram Moolenaar wrote: Lifepillar wrote: On 05/02/2018 22:49, Nikolay Aleksandrovich Pavlov wrote: 2018-02-05 23:31 GMT+03:00 Lifepillar : I would like to automate the testing of my completion plugin, so I have started to write functions like this (I am using a test

Re: Writing tests for completion

2018-02-05 Thread Lifepillar
On 05/02/2018 22:49, Nikolay Aleksandrovich Pavlov wrote: 2018-02-05 23:31 GMT+03:00 Lifepillar : I would like to automate the testing of my completion plugin, so I have started to write functions like this (I am using a test framework like the one in Vim): fun! Test_buffer_keyword_completion

Writing tests for completion

2018-02-05 Thread Lifepillar
I would like to automate the testing of my completion plugin, so I have started to write functions like this (I am using a test framework like the one in Vim): fun! Test_buffer_keyword_completion() new set completeopt=menuone,noselect call feedkeys("ajump ju", "x") call assert_equal("

Re: Neither Emacs nor Vim nor Nano handle ligature literal insertion well

2018-02-03 Thread Lifepillar
On 02/02/2018 23:31, Andrew Pennebaker wrote: Hello, I would really like convenient access to ligatures in my word processing software. Unfortunately, none of the major text editing applications appears to handle ligatures intelligently: Each of Emacs, Vim, Nano, MS Word, Google Drive, Libre

Re: Is there anything like Termdebug for lldb?

2018-01-11 Thread Lifepillar
On 09/01/2018 14:09, Bram Moolenaar wrote: Lifepillar wrote: The Termdebug plugin in Vim is a lovely feature. Is there anything comparable for lldb? If lldb supports a way to communicate with it, it should be possible to make it work. I believe that there should be, as lldb can be used

Is there anything like Termdebug for lldb?

2018-01-06 Thread Lifepillar
The Termdebug plugin in Vim is a lovely feature. Is there anything comparable for lldb? 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 ---

Re: Help needed on terminal mappings

2017-12-23 Thread Lifepillar
On 09/11/2017 12:36, Lifepillar wrote: On 08/11/2017 22:15, Bram Moolenaar wrote: Hmm, perhaps you could try something like this: :tmap b SendToTerm("\b") func SendToTerm(what)   call term_sendkeys('', a:what)   return '' endfunc No idea i

Re: Apples distributed Vim version

2017-11-24 Thread Lifepillar
On 24/11/2017 15:03, Christian Brabandt wrote: On Fr, 24 Nov 2017, Lifepillar wrote: On 24/11/2017 12:46, Lifepillar wrote: On 24/11/2017 11:36, Christian Brabandt wrote: Hi, has anybody stumbled over the fact, that Apple seems to distribute a Vim version 7.4.8056, which is a version that

Re: Apples distributed Vim version

2017-11-24 Thread Lifepillar
On 24/11/2017 12:46, Lifepillar wrote: On 24/11/2017 11:36, Christian Brabandt wrote: Hi, has anybody stumbled over the fact, that Apple seems to distribute a Vim version 7.4.8056, which is a version that never actually existed? See here https://github.com/Valloric/YouCompleteMe/issues/2721

Re: Apples distributed Vim version

2017-11-24 Thread Lifepillar
On 24/11/2017 11:36, Christian Brabandt wrote: Hi, has anybody stumbled over the fact, that Apple seems to distribute a Vim version 7.4.8056, which is a version that never actually existed? See here https://github.com/Valloric/YouCompleteMe/issues/2721#issuecomment-317234769 or here: https://med

Re: Help needed on terminal mappings

2017-11-09 Thread Lifepillar
On 08/11/2017 22:15, Bram Moolenaar wrote: Lifepillar wrote: I have my terminal (Terminal.app on macOS) configured with the following mappings: Shift+Left_arrow \033[1;2D Shift+Right_arrow \033[1;2C Alt+Left_arrow\033b Alt+Right_arrow \033f The latter two, in particular, allow me to

Help needed on terminal mappings

2017-11-08 Thread Lifepillar
I have my terminal (Terminal.app on macOS) configured with the following mappings: Shift+Left_arrow \033[1;2D Shift+Right_arrow \033[1;2C Alt+Left_arrow\033b Alt+Right_arrow \033f The latter two, in particular, allow me to jump between words in a shell using Alt+arrows. Besides, in my vi

Re: Puzzling regexp match

2017-10-29 Thread Lifepillar
On 29/10/2017 19:45, Dominique Pellé wrote: Lifepillar wrote: I might be missing something trivial, but I need others's eyes to look at it. Why are these patterns :echo match('x', "[)-~]") :echo match('x', "[(-~]") :echo match('x', &quo

Puzzling regexp match

2017-10-29 Thread Lifepillar
I might be missing something trivial, but I need others's eyes to look at it. Why are these patterns :echo match('x', "[)-~]") :echo match('x', "[(-~]") :echo match('x', "[(->]") :echo match('x', "[)->]") matching? It seems they match any character. Thanks, Life. -- -- You received this messag

Re: Advice needed: best practices for vim plugin testing

2017-10-23 Thread Lifepillar
im functions: https://gist.github.com/lifepillar/b5018945561e024eeb9fc57650fc5d61 Just write the tests at the top of the script using the above-mentioned assert functions, then source it. Depending of what you are looking for, that might be all you need. For something more sophisticated than t

Re: Edit file without swap or backup files, in one command

2017-10-18 Thread Lifepillar
On 18/10/2017 11:25, Lifepillar wrote: Is it possible to :edit a file forcing Vim not to create any swap files or backups? Something like: enew setl noswapfile nobackup read ++edit # but in one command? I have tried :edit ~/my/file +set\ noswapfile but it creates a new buffer called '

Edit file without swap or backup files, in one command

2017-10-18 Thread Lifepillar
Is it possible to :edit a file forcing Vim not to create any swap files or backups? Something like: enew setl noswapfile nobackup read ++edit # but in one command? I have tried :edit ~/my/file +set\ noswapfile but it creates a new buffer called '~/my/file +set noswapfile'. Thanks, Life. -- -

Do you use in your plugin mappings?

2017-09-26 Thread Lifepillar
I have a question for you plugin developers (but I am interested also in a user's perspective). What do you think is the best approach to deal with a conflicting mapping (i.e., a mapping already defined elsewhere) in a plugin? I currently define my plugin's mappings with , but from time to time

Re: Terminal and pipes

2017-09-15 Thread Lifepillar
On 15/09/2017 20:43, Bram Moolenaar wrote: Lifepillar wrote: How does one launch piped commands in Vim terminal? The naïve: call term_start('ls | fzf') does not work. I guess that I should connect two jobs using out_io and in_io, but is that possible? You need to do t

Terminal and pipes

2017-09-15 Thread Lifepillar
How does one launch piped commands in Vim terminal? The naïve: call term_start('ls | fzf') does not work. I guess that I should connect two jobs using out_io and in_io, but is that possible? Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type yo

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

2017-09-09 Thread Lifepillar
to use Acrobat, you need to replace `Preview' with `Acrobat Reader' (o whatever the name of the app is) in the snippet. Life. On Friday, September 8, 2017 at 4:38:16 AM UTC-4, Lifepillar wrote: if has('mac') fun! PrintFile(fname) call system('pstopdf

Re: Pdf's produced by MacVim's Print are not printable with Mac Preview

2017-09-08 Thread Lifepillar
On 07/09/2017 23:47, Peter Shenkin wrote: For example, is there a way to get MacVim to use Acrobat Reader as its .pdf print app rather than Preview? I have this snippet in my vimrc, which you may adapt: if has('mac') fun! PrintFile(fname) call system('pstopdf ' . a:fname) ca

Re: need help with regex and matchlist()

2017-09-02 Thread Lifepillar
On 02/09/2017 19:46, Jose Caballero wrote: Hi, As this is my first time I try to write a vimscript function that uses regular expressions, I am a little bit of lost. Not sure which built-in function is the most proper, and/or how to use it. Let's say I have this line (very familiar for python d

Re: how to set background color for vim terminal

2017-08-28 Thread Lifepillar
On 28/08/2017 00:13, Bram Moolenaar wrote: Marcin Szamotulski wrote: I was looking how to set up background color for the `:termainal` (on linux). I cannot find proper documentation on how to adjust libvterm. The program you run in the terminal can change the background. Otherwise the same

Re: Sorry to use the `e' word but does vim have similar to cperl

2017-08-26 Thread Lifepillar
On 26/08/2017 03:30, Harry Putnam wrote: Any one here familiar with emacs cperl mode, that can tell me how to get something similar when using vim? If not familiar, `cperl-mode' trys to offer a host of short cuts that insert quite a bit of standard code for you... a simple example is; if you typ

autocmd! followed by

2017-08-18 Thread Lifepillar
It seems impossible to have autocmd! followed by another command, i.e.: autocmd! some_group | According to `:help autocmd`, autocmd may be followed by another command when the '|' appears before {cmd}. This does not seem to be the case for autocmd!. Is that intentional? Thanks, Life. -- -- Yo

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

2017-08-11 Thread Lifepillar
On 11/08/2017 22:30, Jose Caballero wrote: From the description (*), I would say yes, that seems to be exactly what I am looking for. You may find this guide interesting: https://github.com/mhinz/vim-galore Life. -- -- You received this message from the "vim_use" maillist. Do not top-post!

Re: Recognize Vim terminal buffers

2017-08-11 Thread Lifepillar
On 11/08/2017 18:21, Christian Brabandt wrote: On Fr, 11 Aug 2017, Lifepillar wrote: Is there any way yet to recognize that a window's buffer is a terminal buffer (say, to define a custom status line)? To be clear, I am talking about the terminal feature currently under development i

Recognize Vim terminal buffers

2017-08-11 Thread Lifepillar
Is there any way yet to recognize that a window's buffer is a terminal buffer (say, to define a custom status line)? To be clear, I am talking about the terminal feature currently under development in Vim. Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not top-pos

Re: wrapping a series of comma separated words

2017-08-10 Thread Lifepillar
On 10/08/2017 18:57, Chris Lott wrote: I'm constantly needing to wrap a series of comma separated titles with html tags, so this: John has published work in foo, fubar, boo review, and many more. Becomes this John has published work in foo, fubar, boo review, and many more. Rig

Re: Advice on opening large/huge files

2017-08-08 Thread Lifepillar
On 02/08/2017 14:49, Erik Christiansen wrote: On 02.08.17 11:49, Lifepillar wrote: From time to time, I need to edit large files (~10^2-10^3 MB). In my tests, Vim loads large files relatively quickly (~100MB/s). It's (some) filetype plugins that hog Vim. For instance, take any large fil

Advice on opening large/huge files

2017-08-02 Thread Lifepillar
From time to time, I need to edit large files (~10^2-10^3 MB). In my tests, Vim loads large files relatively quickly (~100MB/s). It's (some) filetype plugins that hog Vim. For instance, take any large file and change its suffix to have it recognized as Markdown. After Vim has read it (you'll see

Re: standard way include plugin as a dependency of another plugin

2017-07-30 Thread Lifepillar
On 30/07/2017 04:40, sash...@gmail.com wrote: Hi I'm writing a plugin and want it to depend on another plugin installed. At the moment I just have a line source in my plugin that pulls in that plugin. Is there a standard way of doing this or do plugin authors just invent their own way? Coul

Re: execute "set =..."

2017-07-14 Thread Lifepillar
On 13/07/2017 20:55, Lifepillar wrote: Second, how is cmap b different from cmap ^[b (where ^[ is a literal esc)? Never mind, I have found this article, which explains it very well: http://vim.wikia.com/wiki/Mapping_fast_keycodes_in_terminal_Vim Life. -- -- You received

Re: execute "set =..."

2017-07-13 Thread Lifepillar
On 13/07/2017 18:50, Tony Mechelynck wrote: On Thu, Jul 13, 2017 at 6:06 PM, Lifepillar wrote: Using Vim on macOS, I had this in my .vimrc: cmap b cmap f which allowed me to use -arrows in command mode to jump between words. It worked, but it caused a 'timeout' delay

execute "set =..."

2017-07-13 Thread Lifepillar
Using Vim on macOS, I had this in my .vimrc: cmap b cmap f which allowed me to use -arrows in command mode to jump between words. It worked, but it caused a 'timeout' delay when I was pressing to exit command mode. I have recently discovered that I can do this instead: execute "

Detect when the pop-up menu is dismissed with CTRL-E

2017-04-14 Thread Lifepillar
Hi, I need to distinguish in my plugin the situation in which the user dismisses the pop-up menu with CTRL-E (:help complete_CTRL-E) from the situation in which the menu is closed because the user presses some other key. Is there a way that does not require mapping in Insert mode? Thanks in adv

Re: Help with print encoding

2017-02-19 Thread Lifepillar
On 19/02/2017 10:11, Mike Williams wrote: On 14/02/2017 20:32, Lifepillar wrote: On 14/02/2017 16:43, Mike Williams wrote: On 14/02/2017 07:25, Lifepillar wrote: On 13/02/2017 18:08, Mike Williams wrote: The reason you see the upside-down question marks is because VIM converts the buffer

Re: Help with print encoding

2017-02-14 Thread Lifepillar
On 14/02/2017 16:43, Mike Williams wrote: On 14/02/2017 07:25, Lifepillar wrote: On 13/02/2017 18:08, Mike Williams wrote: Hi, Have you tried setting printencoding to macroman? Yes, and the result is the same. Well it was worth a shot. The reason you see the upside-down question marks

Re: Help with print encoding

2017-02-13 Thread Lifepillar
On 13/02/2017 18:08, Mike Williams wrote: Hi, Have you tried setting printencoding to macroman? Yes, and the result is the same. The reason you see the upside-down question marks is because VIM converts the buffer content from utf-8 to latin1, but the latin1 character set does not include th

Help with print encoding

2017-02-13 Thread Lifepillar
Hello everyone, I am writing to this list because I cannot find a solution to the following problem. I am trying to print some documents, and a few characters turn out as upside-down question marks. Even after reading the manual, I cannot figure out how to fix that. I am using Vim 8.0.172 under

Re: Remapping CTRL-L, CTRL-K etc… as used in line/dictionary completion

2016-12-09 Thread Lifepillar
On 09/12/2016 10:07, h_east wrote: Hi Lifepillar, 2016-12-9(Fri) 4:35:01 UTC+9 Lifepillar: Hello, is it possible to remap //... so that my mapping is invoked when //... is pressed during line/dictionary completion? To see what I mean, define imap pumvisible()?'PUM':'BA

Remapping CTRL-L, CTRL-K etc… as used in line/dictionary completion

2016-12-08 Thread Lifepillar
Hello, is it possible to remap //... so that my mapping is invoked when //... is pressed during line/dictionary completion? To see what I mean, define imap pumvisible()?'PUM':'BAM' Then, using this text: now and here nowhere no and with the cursor after the last character in the last

Re: A problem (bug?) with = and remapping

2016-10-23 Thread Lifepillar
On 22/10/2016 13:57, Lifepillar wrote: On 22/10/2016 11:14, Lifepillar wrote: Hello, I have a problem with a plugin I am writing. To reproduce [snip] Ok, I think that my example may be reduced to the following: fun! G() return "\k" endf fun! F() return "\=G()\"

Re: A problem (bug?) with = and remapping

2016-10-22 Thread Lifepillar
On 22/10/2016 11:14, Lifepillar wrote: Hello, I have a problem with a plugin I am writing. To reproduce [snip] Ok, I think that my example may be reduced to the following: fun! G() return "\k" endf fun! F() return "\=G()\" endf imap F() Is there a way to have this

A problem (bug?) with = and remapping

2016-10-22 Thread Lifepillar
Hello, I have a problem with a plugin I am writing. To reproduce, define `keysequence.vim` with this content: let s:keys = ["\s", "\k"] fun! KeySequence(i) return s:keys[a:i]."\=pumvisible()?'':KeySequence(".(a:i+1).")\" endf imap KeySequence(0) Then: vim -N -u

Re: Keyword completion as a fallback for omnicompletion

2016-10-04 Thread Lifepillar
On 2016-10-04 14:15:42 +, Lifepillar said: Hello Vim experts, for certain filetypes I'd find it convenient to fallback to keyword completion automatically when omnifunc fails, either because omnifunc is not defined or, more interestingly, because no omnifunc pattern matches. So far, I

Keyword completion as a fallback for omnicompletion

2016-10-04 Thread Lifepillar
Hello Vim experts, for certain filetypes I'd find it convenient to fallback to keyword completion automatically when omnifunc fails, either because omnifunc is not defined or, more interestingly, because no omnifunc pattern matches. So far, I have come up with the following code: fun! MyComplet

<    1   2   3