Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread David Finton
Wonderful!  I really appreciate your help.

On Sunday, July 9, 2023 at 6:34:55 AM UTC-7 yeeche...@gmail.com wrote:

> You could just add the following to the top of your vimrc instead of 
> setting those yourself:
>
> unlet! skip_defaults_vim
> source $VIMRUNTIME/defaults.vim
>
> The reasoning is a little complicated but basically if you don't have a 
> vimrc, Vim uses a "defaults.vim" as defaults settings, but once you use 
> your own vimrc it doesn't load defaults.vim for backwards compatibility 
> reasons. You can manually load it by adding those two lines above, see ":h 
> defaults.vim".
>
> As for plugins like markdown_preview, I think those are cool but they do 
> require installing a Node.js server instead of just having an app, so I 
> feel that it's a little more involved.
>
> On Sunday, July 9, 2023 at 1:50:41 AM UTC-7 David Finton wrote:
>
>> I added the following three lines to my *empty* .vimrc -- and now I seem 
>> to have the plugins working!  Is there anything else I should do?
>>
>> *set nocompatible*
>> *filetype on*
>> *filetype plugin on*
>>
>> Thanks!
>>
>> -David
>>
>>
>> On Sunday, July 9, 2023 at 1:37:31 AM UTC-7 David Finton wrote:
>>
>>> Is there some command that needs to be present in .vimrc to cause Vim to 
>>> load scripts based on the filetype?
>>>
>>> On Sunday, July 9, 2023 at 1:33:34 AM UTC-7 David Finton wrote:
>>>
 Okay.  Yee Cheng reminds me that I should be able to restrict this 
 behavior to the markdown filetype.  And this should work by means of 
 ~/.vim/ftplugin/markdown.vim.

 Indeed!  This works for me -- but only if I hide my personal .vimrc 
 file!  In fact, if that file exists, the markdown.vim script will not be 
 loaded, *even if the .vimrc is empty!  *I confirmed this via the 
 :scriptnames command in the editor.

 What is going wrong, that simply doing "touch .vimrc" to create an 
 empty .vimrc file is sufficient to cause this mechanism to fail?

 So... rename / remove my .vimrc, and I can open a '.md' file in MacVim, 
 and the :scriptnames command shows ~/.vim/ftplugin/markdown.vim is loaded. 
  Now I close that file, and do "touch .vimrc" at the commandline, and open 
 the same file... and markdown.vim is not loaded.  The file .vimrc exists 
 -- 
 but it's empty.  


 On Sunday, July 9, 2023 at 12:31:05 AM UTC-7 David Finton wrote:

> Thank you;  that makes sense!  I tried putting the file in 
>  ~/.vim/ftplugin and it had no effect.  Could you suggest another place 
> to 
> try?
>
> --David
>
>
>
> On Jul 8, 2023, at 11:28 PM, Yee Cheng Chin  
> wrote:
>
> I think the reason why the article you linked to uses a ftplugin file 
> in .vim folder is to make sure it only gets set when you are editing a 
> Markdown file. Otherwise if you do it in your own vimrc it will be set 
> for 
> all file types unless you explicitly uses a FileType auto-command to do 
> the 
> same thing. My guess is that you put the file at the wrong place, which 
> resulted in it not being loaded in.
>
> On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:
>
>> Solved.
>>
>> I looked for info on setting the variable makeprg in Vim.  In Vim, 
>> ":set mp" showed me that the makeprg variable was still set to its 
>> default 
>> value of "make". But I also realized that I could change that setting in 
>> my 
>> ~/_vimrc file, rather than in a script under the ".vim" folder.  
>>
>> I used the same exact setting line from Rob Allen's article, but I 
>> used it to set the "makeprg" variable directly in my vimrc.  
>>
>> Works like a charm.
>>
>>
>> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>>
>>> I found a simple recipe for configuring ".make" in MacVim to 
>>> automatically bring up Marked 2 for markdown rendering as I edit.  I 
>>> can't 
>>> get it to work.  Perhaps there is a simpler way?
>>>
>>> The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
>>> 
>>>
>>> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
>>> following line:
>>>
>>> set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
>>> When I try ":make" in MacVim, it reports the following:
>>>
>>> make: *** No targets specified and no makefile found.  Stop.
>>>
>>> I can manually start Marked 2, and in Marked 2 find the file I'm 
>>> editing and open it, and that works.  But I would like to do this with 
>>> a 
>>> keystroke from MacVim.  Rob Allen's page filled me with hope that this 
>>> was 
>>> possible and easy.  Am I close?
>>>
>>> Thanks!
>>>
>>
> -- 
> -- 
> You received this message from the "vim_mac" maillist.
> Do not top-post! 

Re: :hardcopy not launching Preview

2023-07-09 Thread Richard Mitchell
Thanks for the reply!  Your response makes compete sense.

Even my question about my message getting deleted, got deleted.  Odd.

On Sunday, July 9, 2023 at 4:46:28 AM UTC-4 Yee Cheng Chin wrote:

> I don't know why your replies got deleted Richard, but regarding your 
> question about encrypted files, Bram is concerned about a very specific use 
> case where Vim can be used to edit files in an encrypted format. See ":h 
> cryptmethod" and ":h :X" for example.
>
> I personally find this to be quite an edge case. People who are paranoid 
> enough to edit encrypted files and need them encrypted at rest are probably 
> unlikely going to be printing their files out, although I could be wrong 
> regarding that depending on what type of content we are talking about here. 
> And "printexpr" has always generated temporary files (v:fname_in) to allow 
> for passing to a print command.
>
> Looking around, it does seem a little hard to directly pass a PDF to 
> Preview to open. In theory it should definitely be possible, and you can 
> copy / paste to clipboard and then load it that way but then you are 
> exposing it to all applications. In macOS there is an ability to take a 
> screenshot and directly send it to Preview.app but I think there is a very 
> specific service (basically a way for Mac applications to advertise what 
> capabilities they have) and Preview.app only exposes it for TIFF image 
> files (which I think is how the screenshot utility sends the image to it 
> without saving to a file).
>
> As for RAM file system, I think they may make it a little more secure, but 
> we still have a core system that the file was exposed to a global name 
> space (file system) that all apps can access.
>
> Otherwise we could just load the Postscript / PDF completely in app 
> instead of going through an external app if we really want to.
>
> On Sat, Jul 8, 2023 at 1:32 AM Richard Mitchell  
> wrote:
>
>> Why was my message/question deleted?
>
>
>>
>> On Thursday, July 6, 2023 at 5:37:25 PM UTC-4 Lifepillar wrote:
>>
>>> On 2023-07-06, Bram Moolenaar  wrote: 
>>> > 
>>> >> On 2023-07-04, Bram Moolenaar  wrote: 
>>> >> >> Or, even better, one could create a (sufficiently large) RAM disk 
>>> with 
>>> >> >> something like: 
>>> >> >> 
>>> >> >> hdiutil attach -nomount ram://204800 
>>> >> >> diskutil erasevolume APFS TempDisk /dev/diskN 
>>> >> >> 
>>> >> >> use it as volatile storage, then destroy it: 
>>> >> >> 
>>> >> >> diskutil eject /Volumes/TempDisk 
>>> >> >> 
>>> >> >> The RAM disk can likely be formatted with an encrypted file 
>>> system, too. 
>>> >> 
>>> >> I was able to do that with the following commands; there is probably 
>>> >> a simpler way: 
>>> >> 
>>> >> hdiutil attach -nomount ram://20480 
>>> >> 
>>> >> This will return the path to the new device, e.g., /dev/disk4. 
>>> >> 
>>> >> diskutil erasevolume APFS TempDisk /dev/disk4 
>>> >> 
>>> >> This will initialize the disk. Unfortunately, this command does not 
>>> >> return the volume's path, which, for some reason, is /dev/disk5s1 (I 
>>> >> would have expected /dev/disk4s1). 
>>> >> 
>>> >> diskutil apfs deleteVolume disk5s1 
>>> >> diskutil apfs addVolume disk5 APFS encrypted -nomount 
>>> -stdinpassphrase 
>>> >> 
>>> >> Enter a password. Finally, mount the encrypted volume: 
>>> >> 
>>> >> diskutil apfs unlockVolume disk5s1 -stdinpassphrase 
>>> >> 
>>> >> and enter the password. 
>>> > 
>>> > Does this give a prompt, does the user know when to type the password? 
>>>
>>> No prompt: that reads the password from stdin, then decrypts and mounts 
>>> the volume. If the password were to be read from a file called pwd.txt, 
>>> you would it in the obvious way: 
>>>
>>> diskutil apfs unlockVolume disk5s1 -stdinpassphrase >>
>>> >> > I can guess that "ram://" specifies using a RAM disk. What is the 
>>> >> > "204800" for? 
>>> >> 
>>> >> 204800 is the number of 512-byte sectors of the disk. So, the command 
>>> >> above will create a 100MB RAM disk. 
>>> > 
>>> > OK, so we divide the file size by 512 and use the resulting number. 
>>> > Or do we need to round it up to a multiple of 1024? 
>>>
>>> Rounding is not necessary (but it doesn't hurt), but a minimum size is. 
>>> About 20MB seems a safe lower bound. 
>>>
>>> Note, however, that the commands above will create something that looks 
>>> and behaves like a mounted volume, including with a mount point (e.g., 
>>> /Volumes/TempDisk). Even if the file system is encrypted and volatile, 
>>> it will still be accessible like a normal volume to anyone with access 
>>> to the mount point as long as the disk is mounted (usual file system 
>>> permissions will apply to the content). 
>>>
>>> Is your purpose to include some macOS-specific mechanism for secure 
>>> inter-process communication to Vim? Maybe, that should be done using 
>>> some OS-specific API. 
>>>
>>> Life. 
>>>
>>>
>>> -- 
>> -- 
>> You received this message from the "vim_mac" maillist.
>> Do not top-post! Type your reply below the text 

Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread yeeche...@gmail.com
You could just add the following to the top of your vimrc instead of 
setting those yourself:

unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim

The reasoning is a little complicated but basically if you don't have a 
vimrc, Vim uses a "defaults.vim" as defaults settings, but once you use 
your own vimrc it doesn't load defaults.vim for backwards compatibility 
reasons. You can manually load it by adding those two lines above, see ":h 
defaults.vim".

As for plugins like markdown_preview, I think those are cool but they do 
require installing a Node.js server instead of just having an app, so I 
feel that it's a little more involved.

On Sunday, July 9, 2023 at 1:50:41 AM UTC-7 David Finton wrote:

> I added the following three lines to my *empty* .vimrc -- and now I seem 
> to have the plugins working!  Is there anything else I should do?
>
> *set nocompatible*
> *filetype on*
> *filetype plugin on*
>
> Thanks!
>
> -David
>
>
> On Sunday, July 9, 2023 at 1:37:31 AM UTC-7 David Finton wrote:
>
>> Is there some command that needs to be present in .vimrc to cause Vim to 
>> load scripts based on the filetype?
>>
>> On Sunday, July 9, 2023 at 1:33:34 AM UTC-7 David Finton wrote:
>>
>>> Okay.  Yee Cheng reminds me that I should be able to restrict this 
>>> behavior to the markdown filetype.  And this should work by means of 
>>> ~/.vim/ftplugin/markdown.vim.
>>>
>>> Indeed!  This works for me -- but only if I hide my personal .vimrc 
>>> file!  In fact, if that file exists, the markdown.vim script will not be 
>>> loaded, *even if the .vimrc is empty!  *I confirmed this via the 
>>> :scriptnames command in the editor.
>>>
>>> What is going wrong, that simply doing "touch .vimrc" to create an empty 
>>> .vimrc file is sufficient to cause this mechanism to fail?
>>>
>>> So... rename / remove my .vimrc, and I can open a '.md' file in MacVim, 
>>> and the :scriptnames command shows ~/.vim/ftplugin/markdown.vim is loaded. 
>>>  Now I close that file, and do "touch .vimrc" at the commandline, and open 
>>> the same file... and markdown.vim is not loaded.  The file .vimrc exists -- 
>>> but it's empty.  
>>>
>>>
>>> On Sunday, July 9, 2023 at 12:31:05 AM UTC-7 David Finton wrote:
>>>
 Thank you;  that makes sense!  I tried putting the file in 
  ~/.vim/ftplugin and it had no effect.  Could you suggest another place to 
 try?

 --David



 On Jul 8, 2023, at 11:28 PM, Yee Cheng Chin  
 wrote:

 I think the reason why the article you linked to uses a ftplugin file 
 in .vim folder is to make sure it only gets set when you are editing a 
 Markdown file. Otherwise if you do it in your own vimrc it will be set for 
 all file types unless you explicitly uses a FileType auto-command to do 
 the 
 same thing. My guess is that you put the file at the wrong place, which 
 resulted in it not being loaded in.

 On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:

> Solved.
>
> I looked for info on setting the variable makeprg in Vim.  In Vim, 
> ":set mp" showed me that the makeprg variable was still set to its 
> default 
> value of "make". But I also realized that I could change that setting in 
> my 
> ~/_vimrc file, rather than in a script under the ".vim" folder.  
>
> I used the same exact setting line from Rob Allen's article, but I 
> used it to set the "makeprg" variable directly in my vimrc.  
>
> Works like a charm.
>
>
> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>
>> I found a simple recipe for configuring ".make" in MacVim to 
>> automatically bring up Marked 2 for markdown rendering as I edit.  I 
>> can't 
>> get it to work.  Perhaps there is a simpler way?
>>
>> The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
>> 
>>
>> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
>> following line:
>>
>> set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
>> When I try ":make" in MacVim, it reports the following:
>>
>> make: *** No targets specified and no makefile found.  Stop.
>>
>> I can manually start Marked 2, and in Marked 2 find the file I'm 
>> editing and open it, and that works.  But I would like to do this with a 
>> keystroke from MacVim.  Rob Allen's page filled me with hope that this 
>> was 
>> possible and easy.  Am I close?
>>
>> Thanks!
>>
>
 -- 
 -- 
 You received this message from the "vim_mac" 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 a topic in the 
 Google Groups "vim_mac" group.
 To unsubscribe from this topic, 

Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread David Finton
I added the following three lines to my *empty* .vimrc -- and now I seem to 
have the plugins working!  Is there anything else I should do?

*set nocompatible*
*filetype on*
*filetype plugin on*

Thanks!

-David


On Sunday, July 9, 2023 at 1:37:31 AM UTC-7 David Finton wrote:

> Is there some command that needs to be present in .vimrc to cause Vim to 
> load scripts based on the filetype?
>
> On Sunday, July 9, 2023 at 1:33:34 AM UTC-7 David Finton wrote:
>
>> Okay.  Yee Cheng reminds me that I should be able to restrict this 
>> behavior to the markdown filetype.  And this should work by means of 
>> ~/.vim/ftplugin/markdown.vim.
>>
>> Indeed!  This works for me -- but only if I hide my personal .vimrc file! 
>>  In fact, if that file exists, the markdown.vim script will not be loaded, 
>> *even 
>> if the .vimrc is empty!  *I confirmed this via the :scriptnames command 
>> in the editor.
>>
>> What is going wrong, that simply doing "touch .vimrc" to create an empty 
>> .vimrc file is sufficient to cause this mechanism to fail?
>>
>> So... rename / remove my .vimrc, and I can open a '.md' file in MacVim, 
>> and the :scriptnames command shows ~/.vim/ftplugin/markdown.vim is loaded. 
>>  Now I close that file, and do "touch .vimrc" at the commandline, and open 
>> the same file... and markdown.vim is not loaded.  The file .vimrc exists -- 
>> but it's empty.  
>>
>>
>> On Sunday, July 9, 2023 at 12:31:05 AM UTC-7 David Finton wrote:
>>
>>> Thank you;  that makes sense!  I tried putting the file in 
>>>  ~/.vim/ftplugin and it had no effect.  Could you suggest another place to 
>>> try?
>>>
>>> --David
>>>
>>>
>>>
>>> On Jul 8, 2023, at 11:28 PM, Yee Cheng Chin  wrote:
>>>
>>> I think the reason why the article you linked to uses a ftplugin file in 
>>> .vim folder is to make sure it only gets set when you are editing a 
>>> Markdown file. Otherwise if you do it in your own vimrc it will be set for 
>>> all file types unless you explicitly uses a FileType auto-command to do the 
>>> same thing. My guess is that you put the file at the wrong place, which 
>>> resulted in it not being loaded in.
>>>
>>> On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:
>>>
 Solved.

 I looked for info on setting the variable makeprg in Vim.  In Vim, 
 ":set mp" showed me that the makeprg variable was still set to its default 
 value of "make". But I also realized that I could change that setting in 
 my 
 ~/_vimrc file, rather than in a script under the ".vim" folder.  

 I used the same exact setting line from Rob Allen's article, but I used 
 it to set the "makeprg" variable directly in my vimrc.  

 Works like a charm.


 On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:

> I found a simple recipe for configuring ".make" in MacVim to 
> automatically bring up Marked 2 for markdown rendering as I edit.  I 
> can't 
> get it to work.  Perhaps there is a simpler way?
>
> The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
> 
>
> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
> following line:
>
> set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
> When I try ":make" in MacVim, it reports the following:
>
> make: *** No targets specified and no makefile found.  Stop.
>
> I can manually start Marked 2, and in Marked 2 find the file I'm 
> editing and open it, and that works.  But I would like to do this with a 
> keystroke from MacVim.  Rob Allen's page filled me with hope that this 
> was 
> possible and easy.  Am I close?
>
> Thanks!
>

>>> -- 
>>> -- 
>>> You received this message from the "vim_mac" 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 a topic in the 
>>> Google Groups "vim_mac" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/vim_mac/246RNCSsiyo/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> vim_mac+u...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/vim_mac/3b27eef1-ac93-4217-a134-19ca8c8d930fn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>>
>>>

-- 
-- 
You received this message from the "vim_mac" 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 Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, 

Re: :hardcopy not launching Preview

2023-07-09 Thread Yee Cheng Chin
I don't know why your replies got deleted Richard, but regarding your
question about encrypted files, Bram is concerned about a very specific use
case where Vim can be used to edit files in an encrypted format. See ":h
cryptmethod" and ":h :X" for example.

I personally find this to be quite an edge case. People who are paranoid
enough to edit encrypted files and need them encrypted at rest are probably
unlikely going to be printing their files out, although I could be wrong
regarding that depending on what type of content we are talking about here.
And "printexpr" has always generated temporary files (v:fname_in) to allow
for passing to a print command.

Looking around, it does seem a little hard to directly pass a PDF to
Preview to open. In theory it should definitely be possible, and you can
copy / paste to clipboard and then load it that way but then you are
exposing it to all applications. In macOS there is an ability to take a
screenshot and directly send it to Preview.app but I think there is a very
specific service (basically a way for Mac applications to advertise what
capabilities they have) and Preview.app only exposes it for TIFF image
files (which I think is how the screenshot utility sends the image to it
without saving to a file).

As for RAM file system, I think they may make it a little more secure, but
we still have a core system that the file was exposed to a global name
space (file system) that all apps can access.

Otherwise we could just load the Postscript / PDF completely in app instead
of going through an external app if we really want to.

On Sat, Jul 8, 2023 at 1:32 AM Richard Mitchell 
wrote:

> Why was my message/question deleted?
>
> On Thursday, July 6, 2023 at 5:37:25 PM UTC-4 Lifepillar wrote:
>
>> On 2023-07-06, Bram Moolenaar  wrote:
>> >
>> >> On 2023-07-04, Bram Moolenaar  wrote:
>> >> >> Or, even better, one could create a (sufficiently large) RAM disk
>> with
>> >> >> something like:
>> >> >>
>> >> >> hdiutil attach -nomount ram://204800
>> >> >> diskutil erasevolume APFS TempDisk /dev/diskN
>> >> >>
>> >> >> use it as volatile storage, then destroy it:
>> >> >>
>> >> >> diskutil eject /Volumes/TempDisk
>> >> >>
>> >> >> The RAM disk can likely be formatted with an encrypted file system,
>> too.
>> >>
>> >> I was able to do that with the following commands; there is probably
>> >> a simpler way:
>> >>
>> >> hdiutil attach -nomount ram://20480
>> >>
>> >> This will return the path to the new device, e.g., /dev/disk4.
>> >>
>> >> diskutil erasevolume APFS TempDisk /dev/disk4
>> >>
>> >> This will initialize the disk. Unfortunately, this command does not
>> >> return the volume's path, which, for some reason, is /dev/disk5s1 (I
>> >> would have expected /dev/disk4s1).
>> >>
>> >> diskutil apfs deleteVolume disk5s1
>> >> diskutil apfs addVolume disk5 APFS encrypted -nomount -stdinpassphrase
>> >>
>> >> Enter a password. Finally, mount the encrypted volume:
>> >>
>> >> diskutil apfs unlockVolume disk5s1 -stdinpassphrase
>> >>
>> >> and enter the password.
>> >
>> > Does this give a prompt, does the user know when to type the password?
>>
>> No prompt: that reads the password from stdin, then decrypts and mounts
>> the volume. If the password were to be read from a file called pwd.txt,
>> you would it in the obvious way:
>>
>> diskutil apfs unlockVolume disk5s1 -stdinpassphrase >
>> >> > I can guess that "ram://" specifies using a RAM disk. What is the
>> >> > "204800" for?
>> >>
>> >> 204800 is the number of 512-byte sectors of the disk. So, the command
>> >> above will create a 100MB RAM disk.
>> >
>> > OK, so we divide the file size by 512 and use the resulting number.
>> > Or do we need to round it up to a multiple of 1024?
>>
>> Rounding is not necessary (but it doesn't hurt), but a minimum size is.
>> About 20MB seems a safe lower bound.
>>
>> Note, however, that the commands above will create something that looks
>> and behaves like a mounted volume, including with a mount point (e.g.,
>> /Volumes/TempDisk). Even if the file system is encrypted and volatile,
>> it will still be accessible like a normal volume to anyone with access
>> to the mount point as long as the disk is mounted (usual file system
>> permissions will apply to the content).
>>
>> Is your purpose to include some macOS-specific mechanism for secure
>> inter-process communication to Vim? Maybe, that should be done using
>> some OS-specific API.
>>
>> Life.
>>
>>
>> --
> --
> You received this message from the "vim_mac" 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 Groups
> "vim_mac" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_mac+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> 

Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread David Finton
Is there some command that needs to be present in .vimrc to cause Vim to 
load scripts based on the filetype?

On Sunday, July 9, 2023 at 1:33:34 AM UTC-7 David Finton wrote:

> Okay.  Yee Cheng reminds me that I should be able to restrict this 
> behavior to the markdown filetype.  And this should work by means of 
> ~/.vim/ftplugin/markdown.vim.
>
> Indeed!  This works for me -- but only if I hide my personal .vimrc file! 
>  In fact, if that file exists, the markdown.vim script will not be loaded, 
> *even 
> if the .vimrc is empty!  *I confirmed this via the :scriptnames command 
> in the editor.
>
> What is going wrong, that simply doing "touch .vimrc" to create an empty 
> .vimrc file is sufficient to cause this mechanism to fail?
>
> So... rename / remove my .vimrc, and I can open a '.md' file in MacVim, 
> and the :scriptnames command shows ~/.vim/ftplugin/markdown.vim is loaded. 
>  Now I close that file, and do "touch .vimrc" at the commandline, and open 
> the same file... and markdown.vim is not loaded.  The file .vimrc exists -- 
> but it's empty.  
>
>
> On Sunday, July 9, 2023 at 12:31:05 AM UTC-7 David Finton wrote:
>
>> Thank you;  that makes sense!  I tried putting the file in 
>>  ~/.vim/ftplugin and it had no effect.  Could you suggest another place to 
>> try?
>>
>> --David
>>
>>
>>
>> On Jul 8, 2023, at 11:28 PM, Yee Cheng Chin  wrote:
>>
>> I think the reason why the article you linked to uses a ftplugin file in 
>> .vim folder is to make sure it only gets set when you are editing a 
>> Markdown file. Otherwise if you do it in your own vimrc it will be set for 
>> all file types unless you explicitly uses a FileType auto-command to do the 
>> same thing. My guess is that you put the file at the wrong place, which 
>> resulted in it not being loaded in.
>>
>> On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:
>>
>>> Solved.
>>>
>>> I looked for info on setting the variable makeprg in Vim.  In Vim, ":set 
>>> mp" showed me that the makeprg variable was still set to its default value 
>>> of "make". But I also realized that I could change that setting in my 
>>> ~/_vimrc file, rather than in a script under the ".vim" folder.  
>>>
>>> I used the same exact setting line from Rob Allen's article, but I used 
>>> it to set the "makeprg" variable directly in my vimrc.  
>>>
>>> Works like a charm.
>>>
>>>
>>> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>>>
 I found a simple recipe for configuring ".make" in MacVim to 
 automatically bring up Marked 2 for markdown rendering as I edit.  I can't 
 get it to work.  Perhaps there is a simpler way?

 The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
 

 So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
 following line:

 set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
 When I try ":make" in MacVim, it reports the following:

 make: *** No targets specified and no makefile found.  Stop.

 I can manually start Marked 2, and in Marked 2 find the file I'm 
 editing and open it, and that works.  But I would like to do this with a 
 keystroke from MacVim.  Rob Allen's page filled me with hope that this was 
 possible and easy.  Am I close?

 Thanks!

>>>
>> -- 
>> -- 
>> You received this message from the "vim_mac" 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 a topic in the 
>> Google Groups "vim_mac" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/vim_mac/246RNCSsiyo/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> vim_mac+u...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vim_mac/3b27eef1-ac93-4217-a134-19ca8c8d930fn%40googlegroups.com
>>  
>> 
>> .
>>
>>
>>

-- 
-- 
You received this message from the "vim_mac" 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 Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/fc3fb6bc-d75b-465a-bee6-d4aaa5ff2560n%40googlegroups.com.


Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread David Finton
Okay.  Yee Cheng reminds me that I should be able to restrict this behavior 
to the markdown filetype.  And this should work by means of 
~/.vim/ftplugin/markdown.vim.

Indeed!  This works for me -- but only if I hide my personal .vimrc file! 
 In fact, if that file exists, the markdown.vim script will not be loaded, 
*even 
if the .vimrc is empty!  *I confirmed this via the :scriptnames command in 
the editor.

What is going wrong, that simply doing "touch .vimrc" to create an empty 
.vimrc file is sufficient to cause this mechanism to fail?

So... rename / remove my .vimrc, and I can open a '.md' file in MacVim, and 
the :scriptnames command shows ~/.vim/ftplugin/markdown.vim is loaded.  Now 
I close that file, and do "touch .vimrc" at the commandline, and open the 
same file... and markdown.vim is not loaded.  The file .vimrc exists -- but 
it's empty.  


On Sunday, July 9, 2023 at 12:31:05 AM UTC-7 David Finton wrote:

> Thank you;  that makes sense!  I tried putting the file in 
>  ~/.vim/ftplugin and it had no effect.  Could you suggest another place to 
> try?
>
> --David
>
>
>
> On Jul 8, 2023, at 11:28 PM, Yee Cheng Chin  wrote:
>
> I think the reason why the article you linked to uses a ftplugin file in 
> .vim folder is to make sure it only gets set when you are editing a 
> Markdown file. Otherwise if you do it in your own vimrc it will be set for 
> all file types unless you explicitly uses a FileType auto-command to do the 
> same thing. My guess is that you put the file at the wrong place, which 
> resulted in it not being loaded in.
>
> On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:
>
>> Solved.
>>
>> I looked for info on setting the variable makeprg in Vim.  In Vim, ":set 
>> mp" showed me that the makeprg variable was still set to its default value 
>> of "make". But I also realized that I could change that setting in my 
>> ~/_vimrc file, rather than in a script under the ".vim" folder.  
>>
>> I used the same exact setting line from Rob Allen's article, but I used 
>> it to set the "makeprg" variable directly in my vimrc.  
>>
>> Works like a charm.
>>
>>
>> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>>
>>> I found a simple recipe for configuring ".make" in MacVim to 
>>> automatically bring up Marked 2 for markdown rendering as I edit.  I can't 
>>> get it to work.  Perhaps there is a simpler way?
>>>
>>> The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
>>> 
>>>
>>> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
>>> following line:
>>>
>>> set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
>>> When I try ":make" in MacVim, it reports the following:
>>>
>>> make: *** No targets specified and no makefile found.  Stop.
>>>
>>> I can manually start Marked 2, and in Marked 2 find the file I'm editing 
>>> and open it, and that works.  But I would like to do this with a keystroke 
>>> from MacVim.  Rob Allen's page filled me with hope that this was possible 
>>> and easy.  Am I close?
>>>
>>> Thanks!
>>>
>>
> -- 
> -- 
> You received this message from the "vim_mac" 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 a topic in the 
> Google Groups "vim_mac" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/vim_mac/246RNCSsiyo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> vim_mac+u...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vim_mac/3b27eef1-ac93-4217-a134-19ca8c8d930fn%40googlegroups.com
>  
> 
> .
>
>
>

-- 
-- 
You received this message from the "vim_mac" 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 Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/09415578-b5f8-4a98-9c9f-ab299af0b7c4n%40googlegroups.com.


Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread Yongwei Wu
Is there any reason you do not want to use a plugin like
https://github.com/iamcco/markdown-preview.nvim? Scrolling in Vim would
synchronize with the view in the browser.

On Sun, 9 Jul 2023 at 12:54, David Finton  wrote:

> Solved.
>
> I looked for info on setting the variable makeprg in Vim.  In Vim, ":set
> mp" showed me that the makeprg variable was still set to its default value
> of "make". But I also realized that I could change that setting in my
> ~/_vimrc file, rather than in a script under the ".vim" folder.
>
> I used the same exact setting line from Rob Allen's article, but I used it
> to set the "makeprg" variable directly in my vimrc.
>
> Works like a charm.
>
>
> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>
>> I found a simple recipe for configuring ".make" in MacVim to
>> automatically bring up Marked 2 for markdown rendering as I edit.  I can't
>> get it to work.  Perhaps there is a simpler way?
>>
>> The recipe is from Rob Allen:  Use Vim's :make to preview markdown
>> 
>>
>> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the
>> following line:
>>
>> set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
>> When I try ":make" in MacVim, it reports the following:
>>
>> make: *** No targets specified and no makefile found.  Stop.
>>
>> I can manually start Marked 2, and in Marked 2 find the file I'm editing
>> and open it, and that works.  But I would like to do this with a keystroke
>> from MacVim.  Rob Allen's page filled me with hope that this was possible
>> and easy.  Am I close?
>>
>> Thanks!
>>
> --
> --
> You received this message from the "vim_mac" 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 Groups
> "vim_mac" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_mac+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_mac/b7f0cfc0-f8a3-4cf5-9dd8-53c972fac56cn%40googlegroups.com
> 
> .
>


-- 
Yongwei Wu
URL: http://wyw.dcweb.cn/

-- 
-- 
You received this message from the "vim_mac" 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 Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/CADs46ifFTUWMhnQYRTOsFwekK5O_xsi-aD9xtvcKNMJn%2BvW9gg%40mail.gmail.com.


Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread David Finton
Thank you;  that makes sense!  I tried putting the file in  ~/.vim/ftplugin and 
it had no effect.  Could you suggest another place to try?

--David



> On Jul 8, 2023, at 11:28 PM, Yee Cheng Chin  wrote:
> 
> I think the reason why the article you linked to uses a ftplugin file in .vim 
> folder is to make sure it only gets set when you are editing a Markdown file. 
> Otherwise if you do it in your own vimrc it will be set for all file types 
> unless you explicitly uses a FileType auto-command to do the same thing. My 
> guess is that you put the file at the wrong place, which resulted in it not 
> being loaded in.
> 
> On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:
>> Solved.
>> 
>> I looked for info on setting the variable makeprg in Vim.  In Vim, ":set mp" 
>> showed me that the makeprg variable was still set to its default value of 
>> "make". But I also realized that I could change that setting in my ~/_vimrc 
>> file, rather than in a script under the ".vim" folder.  
>> 
>> I used the same exact setting line from Rob Allen's article, but I used it 
>> to set the "makeprg" variable directly in my vimrc.  
>> 
>> Works like a charm.
>> 
>> 
>> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>>> I found a simple recipe for configuring ".make" in MacVim to automatically 
>>> bring up Marked 2 for markdown rendering as I edit.  I can't get it to 
>>> work.  Perhaps there is a simpler way?
>>> 
>>> The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
>>> 
>>> 
>>> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
>>> following line:
>>> set makeprg=open\ -a\ Marked\\\ 2.app \ '%:p'
>>> 
>>> When I try ":make" in MacVim, it reports the following:
>>> 
>>> make: *** No targets specified and no makefile found.  Stop.
>>> 
>>> I can manually start Marked 2, and in Marked 2 find the file I'm editing 
>>> and open it, and that works.  But I would like to do this with a keystroke 
>>> from MacVim.  Rob Allen's page filled me with hope that this was possible 
>>> and easy.  Am I close?
>>> 
>>> Thanks!
> 
> 
> -- 
> -- 
> You received this message from the "vim_mac" 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 a topic in the Google 
> Groups "vim_mac" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/vim_mac/246RNCSsiyo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> vim_mac+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vim_mac/3b27eef1-ac93-4217-a134-19ca8c8d930fn%40googlegroups.com
>  
> .

-- 
-- 
You received this message from the "vim_mac" 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 Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/51B3A150-DD9C-4A6B-A217-A0D2AFB7D5D6%40gmail.com.


Re: Using :Make for MacVim to invoke "Marked 2" for markdown rendering?

2023-07-09 Thread Yee Cheng Chin
I think the reason why the article you linked to uses a ftplugin file in 
.vim folder is to make sure it only gets set when you are editing a 
Markdown file. Otherwise if you do it in your own vimrc it will be set for 
all file types unless you explicitly uses a FileType auto-command to do the 
same thing. My guess is that you put the file at the wrong place, which 
resulted in it not being loaded in.

On Saturday, July 8, 2023 at 9:54:54 PM UTC-7 David Finton wrote:

> Solved.
>
> I looked for info on setting the variable makeprg in Vim.  In Vim, ":set 
> mp" showed me that the makeprg variable was still set to its default value 
> of "make". But I also realized that I could change that setting in my 
> ~/_vimrc file, rather than in a script under the ".vim" folder.  
>
> I used the same exact setting line from Rob Allen's article, but I used it 
> to set the "makeprg" variable directly in my vimrc.  
>
> Works like a charm.
>
>
> On Tuesday, July 4, 2023 at 5:27:22 PM UTC-7 David Finton wrote:
>
>> I found a simple recipe for configuring ".make" in MacVim to 
>> automatically bring up Marked 2 for markdown rendering as I edit.  I can't 
>> get it to work.  Perhaps there is a simpler way?
>>
>> The recipe is from Rob Allen:  Use Vim's :make to preview markdown 
>> 
>>
>> So I have the file ~/.vim/ftplugin/markdown.vim, and it contains the 
>> following line:
>>
>> set makeprg=open\ -a\ Marked\\\ 2.app\ '%:p'
>> When I try ":make" in MacVim, it reports the following:
>>
>> make: *** No targets specified and no makefile found.  Stop.
>>
>> I can manually start Marked 2, and in Marked 2 find the file I'm editing 
>> and open it, and that works.  But I would like to do this with a keystroke 
>> from MacVim.  Rob Allen's page filled me with hope that this was possible 
>> and easy.  Am I close?
>>
>> Thanks!
>>
>

-- 
-- 
You received this message from the "vim_mac" 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 Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/3b27eef1-ac93-4217-a134-19ca8c8d930fn%40googlegroups.com.