insanum / sncli

Simplenote CLI
MIT License
396 stars 34 forks source link

Add config option to choose tmp file extension type? #103

Closed Lynxiayel closed 3 years ago

Lynxiayel commented 3 years ago

Hi, The current tmp file for a markdown note is named as *.mkd. As I edit it in a vim environment, I regularly need to reformat it with some vim plugins. Unfortunately the .mkd extension name is not recognized. I am wondering if we can have an option for choosing what extension name we use for the tmp files? Thanks.

samuelallan72 commented 3 years ago

@Lynxiayel I'm not sure the history behind using mkd as the file extension, but I agree that md would be more standard. I don't think we'd want to update the default though, since this may break the workflow of others.

I am wondering if we can have an option for choosing what extension name we use for the tmp files?

This may be a good idea. You mean so you can set something like cfg_markdown_file_ext = "md"?

Another option that may work for you without patching sncli, would be to add an autocmd to your vim config wherever custom filetype detection is handled (filetype.vim?):

autocmd BufNewFile,BufRead *.mkd setf markdown
Lynxiayel commented 3 years ago

@swalladge Thanks for the reply, also the vim workaround is helpful. From a flexibility perspective, I think adding a config option would still be a nice enhancement (if it's not too much change to the codebase), because I think there are other ext names like "markdown", and people may be using other editors than vim.