|
| 1 | +--- |
| 2 | +layout: newsletter |
| 3 | +title: "Newsletter #6 - Ship it!" |
| 4 | +category: newsletter |
| 5 | +permalink: /news/2015/december/ |
| 6 | +--- |
| 7 | + |
| 8 | +Welcome to the sixth newsletter for Neovim, a project that aims to improve Vim |
| 9 | +by adding [new features][terminal-emulator] and wrap it all in a nice, modern |
| 10 | +face. |
| 11 | + |
| 12 | +### Introduction |
| 13 | + |
| 14 | +Hi, this is @tarruda and I will be addressing the Neovim community directly in |
| 15 | +this newsletter. Other than that, I will try to keep it structured as @jdavis |
| 16 | +did previously. Let's get started! |
| 17 | + |
| 18 | +## General News |
| 19 | + |
| 20 | +### 0.1 release |
| 21 | + |
| 22 | +Neovim now has its first public release! |
| 23 | + |
| 24 | +A few months ago, @justinmk created the [0.1 milestone][0.1-milestone] which |
| 25 | +greatly helped us focus on more urgent tasks that resulted in the first release. |
| 26 | +We planned many features not yet available in 0.1, but decided to postpone them |
| 27 | +for future milestones, which will be more frequent after this newsletter. |
| 28 | + |
| 29 | +This illustrates the path Neovim will take from now on: Instead of preparing |
| 30 | +big releases that take forever to happen, we'll focus on smaller, frequent and |
| 31 | +more stable releases. |
| 32 | + |
| 33 | +The 0.1 release is basically just a tag for users looking to compile Neovim in |
| 34 | +a version that has a minimum level of stability, but future releases may also |
| 35 | +contain precompiled binaries and even installers (when Windows is officially |
| 36 | +supported). |
| 37 | + |
| 38 | +Neovim 0.1.0 and 0.1.1 are already available in the [releases |
| 39 | +page][nvim-releases] and for [Homebrew/Linuxbrew][homebrew-formula] and [Arch |
| 40 | +Linux][archlinux-pkgbuild]. Check the [installation page on the Neovim |
| 41 | +Wiki][installing-neovim-package] for more possibilities to install Neovim |
| 42 | +(although, at the time of writing, most of these will install the latest |
| 43 | +development version of Neovim instead of a 0.1.x release). |
| 44 | + |
| 45 | +For those that prefer(or need) to compile manually from git, the [build |
| 46 | +instructions][build-neovim] still work as usual. |
| 47 | + |
| 48 | +### Bountysource salt campaign |
| 49 | + |
| 50 | +For those who don't know yet, Bountysource launched a new platform that allows |
| 51 | +open source projects to obtain sustainable crowdfunding. This platform is |
| 52 | +conveniently called ["salt"][history-of-salt], and Neovim was one of the first |
| 53 | +projects to use it. |
| 54 | + |
| 55 | +The [first campaign][first-campaign] was very |
| 56 | +successful and raised about $35,000, which allowed me to work full-time on |
| 57 | +Neovim for roughly 6 months. Being very enthusiastic about the project and |
| 58 | +unable to meet all goals in those months, I continued to dedicate a very |
| 59 | +significant portion of my time to Neovim, so much that it started hurting my |
| 60 | +personal and professional life. This continued until February when I saw that I |
| 61 | +simply couldn't continue with my old pace. Around that time that @rappo offered |
| 62 | +me to test the salt platform beta version and I saw it as a way to continue my |
| 63 | +work on Neovim. |
| 64 | + |
| 65 | +Like it's predecessor, [the salt campaign][salt-campaign] was very successful |
| 66 | +and allowed me to continue Neovim contributions (in a healthy way) for the past 8 |
| 67 | +months, thank you! |
| 68 | + |
| 69 | +### Building Neovim from source |
| 70 | + |
| 71 | +Did we ever mention how easy it is to build and install Neovim from source? |
| 72 | +While it has a good number of dependencies, the build system automatically |
| 73 | +downloads and builds everything without cluttering your system. Check out |
| 74 | +the [installation page on the Neovim Wiki][installing-neovim-source] for the |
| 75 | +exact steps. |
| 76 | + |
| 77 | +## Development News |
| 78 | + |
| 79 | +### XDG Support |
| 80 | + |
| 81 | +Neovim now follows the [XDG directory specification][xdg-spec]. This was |
| 82 | +[proposed][xdg-proposal] by @ZyX-I when the project started, but only a couple |
| 83 | +of months ago we received a [PR][xdg-pr1] from @Yamakaky which was superseded by |
| 84 | +@jck in a [later PR][xdg-pr2] and again by @ZyX-I in a [final PR][xdg-pr3] that |
| 85 | +was merged recently. |
| 86 | + |
| 87 | +Since following the XDG directory specification, Neovim now looks for user |
| 88 | +configuration files such as `.nvimrc` and those under `~/.nvim` in the |
| 89 | +`~/.config` directory, which can be overriden by the `$XDG_CONFIG_HOME` |
| 90 | +environment variable. The specification also states that cache files should be |
| 91 | +stored in a separate directory (`~/.local/share`), which is where files like |
| 92 | +viminfo (now ShaDa) or backup/swap can optionally go. |
| 93 | + |
| 94 | +This change makes it simpler for users to backup and manage their configuration |
| 95 | +since it will be stored with other programs that also follow the specification, |
| 96 | +not to mention it keeps the home directory cleaner. |
| 97 | + |
| 98 | +Step by step instructions on how to migrate existing configuration can be found |
| 99 | +at [:h nvim-from-vim][nvim-from-vim]. |
| 100 | + |
| 101 | +### ShaDa (Shared Data) |
| 102 | + |
| 103 | +@ZyX-I [major ShaDa PR][shada-pr] was merged. It completely replaced the viminfo |
| 104 | +file for storing user data such as register contents, command history, |
| 105 | +variables, jump list and so on. |
| 106 | + |
| 107 | +A [known problem][shada-proposal] with viminfo is that two Vim instances running |
| 108 | +concurrently will override each other's data. ShaDa is a new storage format |
| 109 | +created by @ZyX-I that not only fixes the problem but also brings a number of |
| 110 | +enhancements to Neovim: |
| 111 | + |
| 112 | +- File format that: |
| 113 | + - Supports forward (ShaDa files from newer NeoVim can be used by older |
| 114 | + versions) and backward (ShaDa files from older versions can be used by |
| 115 | + newer ones without problems) compatibility, making ShaDa files |
| 116 | + future-proof to a great extent. |
| 117 | + - Supports hierarchical data structures, giving Neovim lot of flexibility in |
| 118 | + serializing any kind of information. |
| 119 | + - Is based on msgpack and explicitly standardized in documentation which |
| 120 | + allows creation of plugins/tools that perform arbitrary manipulations. |
| 121 | + - Assumes no state stored between data pieces inside the file, which makes |
| 122 | + such tools simpler and allows such manipulations as “to concatenate two |
| 123 | + ShaDa files from different NeoVim instances simply use `cat 1.shada |
| 124 | + 2.shada > joined.shada`, NeoVim will handle this properly when reading”. |
| 125 | + - Uses expanded paths(/home instead of ~/). |
| 126 | +- Embedded timestamps that allow multiple NeoVim instances to correctly merge |
| 127 | + their data when writing or reading ShaDa files. |
| 128 | +- Forward compatibility includes NeoVim core code that preserves additional |
| 129 | + information found in ShaDa files generated by newer NeoVim versions in case |
| 130 | + they provide any. |
| 131 | + |
| 132 | +While the [PR][shada-pr] is very big, @ZyX-I has taken care of adding great test |
| 133 | +coverage. Great work @ZyX-I! |
| 134 | + |
| 135 | +### Wrapping the event loop layer |
| 136 | + |
| 137 | +It's no secret that libuv is the event loop library used by Neovim, and it is |
| 138 | +what makes it possible for us to implement features that require asynchronous |
| 139 | +communication (not initiated by the user) with the editor with ease. |
| 140 | +Unfortunately due to how Neovim code is currently organized, integrating libuv |
| 141 | +was not a trivial task. |
| 142 | + |
| 143 | +The basic idea is that Neovim receives arbitrary events when it is polling for |
| 144 | +user input, but these events can't be processed immediately because Neovim can |
| 145 | +be in a state that simply can't handle arbitrary actions. So if Neovim receives |
| 146 | +an event while checking user input, it will put the event in a queue for later |
| 147 | +processing. |
| 148 | + |
| 149 | +One example is illustrated in the following scenario: Neovim checks if the user |
| 150 | +typed ctrl+c while the regexp engine is executing, but it can't process the |
| 151 | +event as it is received because it may want to execute vimscript that calls the |
| 152 | +regexp engine again, and the engine is not reentrant since it relies heavily on |
| 153 | +global variables. So it has to postpone the event for when it's safe, and |
| 154 | +determining when it's safe to process events is itself another problem. |
| 155 | + |
| 156 | +Another complication of integrating with libuv is that sometimes Neovim must |
| 157 | +only process events from a certain source. For example, while Neovim is sending |
| 158 | +a msgpack-rpc call, it should only process events that come from: |
| 159 | + |
| 160 | +- the user (eg: ctrl+c to interrupt the call) |
| 161 | +- the file descriptor that received the msgpack-rpc call (which can be from a child |
| 162 | + process stdio from a socket) |
| 163 | + |
| 164 | +To allow this kind of selective event processing, Neovim must maintain multiple |
| 165 | +queues that integrate with each other, and the logic to do this is very |
| 166 | +repetitive. In one of my [latest PRs][event-loop-pr], some libuv "classes" were |
| 167 | +wrapped in a way that makes managing these queues much easier. |
| 168 | + |
| 169 | +### jemalloc |
| 170 | + |
| 171 | +[jemalloc][jemalloc], a high performance general purpose memory allocator, is |
| 172 | +now used by default. Since Neovim makes heavy use of dynamic queues (see above) |
| 173 | +in its inner loops, `malloc(3)` is called a lot more than Vim, so it is |
| 174 | +important to use a fast implementation that has consistent performance across |
| 175 | +platforms. |
| 176 | + |
| 177 | +In a recent [PR][jemalloc-4-pr], @fmoralesc modified the jemalloc version used |
| 178 | +by our build system to target jemalloc 4.0 which brings even more performance |
| 179 | +enhancements and adds support for more platforms. |
| 180 | + |
| 181 | +### Faster travis builds |
| 182 | + |
| 183 | +We now use [Travis container-based insfrastructure][travis-container] to run |
| 184 | +Neovim builds, which makes CI builds to start immediately. This was |
| 185 | +[implemented][container-pr] by @fwalch, which also did many other improvements |
| 186 | +to our build infrastructure, allowing developers to receive much faster |
| 187 | +feedback when submitting PRs. |
| 188 | + |
| 189 | +### Quickbuild |
| 190 | + |
| 191 | +@jszakmeister is running a [quickbuild][quickbuild] server in his own |
| 192 | +infrastructure. This gives us a backup CI that double checks Neovim PRs, also |
| 193 | +running tests in FreeBSD which is not covered by travis. Thank you for improving |
| 194 | +Neovim robustness @jszakmeister! |
| 195 | + |
| 196 | +## Third-party development |
| 197 | + |
| 198 | +### Neomake |
| 199 | + |
| 200 | +Did you know that there is an alternative to [syntastic][syntastic] that makes |
| 201 | +use of Neovim asynchronous capabilities? [Neomake][neomake] is the best plugin |
| 202 | +for syntatic checking on Neovim: It is extensible like [syntastic][syntastic] |
| 203 | +and the fact that it uses [job-control][job-control] allows it to perform |
| 204 | +checking in background without blocking the user interface. This is very useful |
| 205 | +for compiled languages that are slower to check (typescript, java, .NET). |
| 206 | + |
| 207 | +The migration from [syntastic][syntastic] is also very trivial, great work |
| 208 | +@benekastah! |
| 209 | + |
| 210 | +### FZF |
| 211 | + |
| 212 | +[fzf][fzf] is a command-line fuzzy finder that thanks to its author (@junnegun, |
| 213 | +the same developer behind [vim-plug][vim-plug]), has great Neovim support |
| 214 | +through a plugin that uses our [builtin terminal emulator][terminal-emulator]. |
| 215 | + |
| 216 | +FZF is a great alternative to plugins like [ctrlp][ctrlp]: It is really fast and |
| 217 | +has the advantage of running in another process, which can make use of |
| 218 | +multi-core systems and doesn't block Neovim user interface. To see how fast and |
| 219 | +responsive it is, just try running `:FZF` to search for files on the linux |
| 220 | +source tree! |
| 221 | + |
| 222 | +Besides [fzf][fzf], the user is also encouraged to install [fzf.vim][fzf.vim], a |
| 223 | +plugin that exposes some very useful commands that are implemented on top of |
| 224 | +fzf. |
| 225 | + |
| 226 | +### Deoplete |
| 227 | + |
| 228 | +@Shougo has created [deoplete.nvim][deoplete], an asynchronous completion engine |
| 229 | +written as a [remote-plugin][remote-plugin] that makes use of Neovim async |
| 230 | +capabilities to allow completions to be computed without blocking the user |
| 231 | +interface. He decided to write a new plugin from the scratch because Neovim |
| 232 | +doesn't support the lua interface required for neocomplete. @Shougo is the sith |
| 233 | +lord of Vim plugins, here's a list containing some of his previous work: |
| 234 | + |
| 235 | +- [neocomplete][neocomplete] |
| 236 | +- [neocomplcache][neocomplcache] |
| 237 | +- [vimshell][vimshell] |
| 238 | +- [unite][unite] |
| 239 | +- [neobundle][neobundle] |
| 240 | + |
| 241 | +The community can expect great things from [deoplete.nvim][deoplete]! |
| 242 | + |
| 243 | +(Recently @Shougo posted a [slide][deoplete-slide] to explain the ideas behind |
| 244 | +deoplete.) |
| 245 | + |
| 246 | +### Neoterm |
| 247 | + |
| 248 | +[Neoterm][neoterm] is a plugin for easily running tests in a [terminal |
| 249 | +window][terminal-emulator]. It was written by @kassio and supports the following |
| 250 | +test libraries: |
| 251 | + |
| 252 | +- rspec |
| 253 | +- cucumber |
| 254 | +- minitest |
| 255 | +- go-lang test |
| 256 | +- nose |
| 257 | + |
| 258 | +Very useful @kassio! |
| 259 | + |
| 260 | +[terminal-emulator]: https://neovim.io/doc/user/nvim_terminal_emulator.html#nvim-terminal-emulator |
| 261 | +[0.1-milestone]: https://github.com/neovim/neovim/milestones/0.1-first-public-release |
| 262 | +[history-of-salt]: https://en.wikipedia.org/wiki/History_of_salt |
| 263 | +[first-campaign]: https://www.bountysource.com/teams/neovim |
| 264 | +[salt-campaign]: https://salt.bountysource.com/teams/neovim |
| 265 | +[shada-proposal]: https://github.com/neovim/neovim/issues/999 |
| 266 | +[shada-pr]: https://github.com/neovim/neovim/pull/2506 |
| 267 | +[event-loop-pr]: https://github.com/neovim/neovim/pull/2980 |
| 268 | +[jemalloc]: http://www.canonware.com/jemalloc/ |
| 269 | +[jemalloc-4-pr]: https://github.com/neovim/neovim/pull/3289 |
| 270 | +[xdg-spec]: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html |
| 271 | +[xdg-pr1]: https://github.com/neovim/neovim/pull/3120 |
| 272 | +[xdg-pr2]: https://github.com/neovim/neovim/pull/3198 |
| 273 | +[xdg-pr3]: https://github.com/neovim/neovim/pull/3470 |
| 274 | +[xdg-proposal]: https://github.com/neovim/neovim/issues/78 |
| 275 | +[travis-container]: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ |
| 276 | +[container-pr]: https://github.com/neovim/neovim/pull/2938 |
| 277 | +[quickbuild]: http://freecode.com/projects/quickbuild |
| 278 | +[syntastic]: https://github.com/scrooloose/syntastic |
| 279 | +[neomake]: https://github.com/benekastah/neomake |
| 280 | +[job-control]: https://neovim.io/doc/user/job_control.html#job-control |
| 281 | +[deoplete]: https://github.com/Shougo/deoplete.nvim |
| 282 | +[deoplete-slide]: http://www.slideshare.net/Shougo/deoplete-the-dark-powered-auto-completion-plugin-for-neovim |
| 283 | +[neoterm]: https://github.com/kassio/neoterm |
| 284 | +[remote-plugin]: https://neovim.io/doc/user/remote_plugin.html#remote-plugin |
| 285 | +[vimshell]: https://github.com/Shougo/vimshell.vim |
| 286 | +[unite]: https://github.com/Shougo/Unite.vim |
| 287 | +[neocomplete]: https://github.com/Shougo/neocomplete.vim |
| 288 | +[neocomplcache]: https://github.com/Shougo/neocomplcache.vim |
| 289 | +[neobundle]: https://github.com/Shougo/neobundle.vim |
| 290 | +[fzf]: https://github.com/junegunn/fzf |
| 291 | +[fzf.vim]: https://github.com/junegunn/fzf.vim |
| 292 | +[vim-plug]: https://github.com/junegunn/vim-plug |
| 293 | +[ctrlp]: https://github.com/kien/ctrlp.vim |
| 294 | +[windows-instrutions]: https://github.com/neovim/neovim/wiki/Installing-Neovim#windows |
| 295 | +[neovim-qt]: https://github.com/equalsraf/neovim-qt |
| 296 | +[homebrew-formula]: https://github.com/neovim/homebrew-neovim |
| 297 | +[archlinux-pkgbuild]: https://aur.archlinux.org/packages/neovim |
| 298 | +[installing-neovim-package]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package |
| 299 | +[installing-neovim-source]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-source |
| 300 | +[build-neovim]: https://github.com/neovim/neovim/wiki/Building-Neovim |
| 301 | +[nvim-from-vim]: https://neovim.io/doc/user/nvim_from_vim.html#nvim-from-vim |
| 302 | +[nvim-releases]: https://github.com/neovim/neovim/releases |
0 commit comments