Thursday, November 22, 2018

Noswap and Nobackup when editing python on a specific device (mounted) on Linux

Hi,

from time to time I have to edit a python file, which
is stored on the 2M flash memory on a microcontroller
board.

To avoid unneccassary write cycles to the flash (flash wear out)
I want to disable backup and swapfile in such a case.

And to ensure both are switched off even if I have forgotten
to do so, vim should do that automatically.

I am working under Linux.

The mountpoint for the flash (the microcontroller represents
itsself as "USBstick" with 2M memory space...) is
/home/user/flash and I am always editing python code.

I tried
autocmd FileType python setlocal nobackup
autocmd FileType python setlocal noswapfile
as a first test...but it fails (supposedly a layer eight failure...)

How can I acchieve this trick?

Thanks a lot for any help in advance!
Cheers!
Meino


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: