coolwanglu / neovim-e

Electron UI for Neovim
MIT License
271 stars 29 forks source link

Sets up the basics for hot reloading config.cson. #28

Closed norcalli closed 9 years ago

norcalli commented 9 years ago

Watches the userData directory for changes and then reloads the appropriate settings. It currently watches the directory because text editors replace the file written with a temporary copy, which breaks fs.watch in many cases. Perhaps using a third party watcher would be better, but also another dependency. fs.watch also triggered multiple times for a text editor write, so I added a 250ms debounce.

It works as far as I can tell, I wasn't 100% sure which calls were neccessary to reset the config or which function would be best to call to redraw the whole editor. I used nv_resize in the end.

Note: Oh dear god, I used hub pull-request and it set the title incorrectly.

coolwanglu commented 9 years ago

Please remove the 2 commits in the other PR.

coolwanglu commented 9 years ago

Why would you do this? I remember that .vimrc and .gvimrc are only used during the startup of the editors.

norcalli commented 9 years ago

Apologies for the messy PR, I've been testing random tools. When I was testing out fonts, I found this useful. And if the config options ever expand, then a framework is around for playing around with settings. And when I'm changing my .vimrc, I frequently re-source them so that I don't have to restart vim. It's a common pattern.

coolwanglu commented 9 years ago

@norcalli So maybe we need a way of manually re-loading the config file?

norcalli commented 9 years ago

@coolwanglu Perhaps through a menu option? I've been playing around with multiple windows as well and setting that up through menu items.

coolwanglu commented 9 years ago

I'm fine with menu options, although there's nothing right now, so maybe you need to set up everything for Atom Shell. On the other hand, since we are using vim, maybe we can achieve this through some command. There used to be guifont option for gvim, but for the abstract ui of vim seems that it's been removed.. I'll try to ask there.

norcalli commented 9 years ago

I've made a lot of changes suiting the editor to OS X and my own preferences for now, but I'll be making it more cross platform soon. My command-config branch has a lot of these changes.