{"id":208,"date":"2017-08-02T03:57:26","date_gmt":"2017-08-02T07:57:26","guid":{"rendered":"https:\/\/lennycheng.com\/blog\/?p=208"},"modified":"2019-05-13T23:00:04","modified_gmt":"2019-05-14T03:00:04","slug":"from-ed-to-vim-to-neovim","status":"publish","type":"post","link":"http:\/\/lennycheng.com\/blog\/2017\/08\/02\/from-ed-to-vim-to-neovim\/","title":{"rendered":"From Ed to Vim to Neovim"},"content":{"rendered":"<p>In the beginning was <strong><span style=\"font-family: courier new,courier,monospace;\">ed<\/span><\/strong>, a simple bare-bones line editor developed in 1969 and shipped with Unix. Back then, personal computers didn\u2019t exist and most computer programmers accessed programs via a terminal to a central server. Because memory was sparse and networking technologies were much slower (remember dial-up? This was a decade before the predecessor of dial-up was invented and when ARPANET was still state-of-the-art technology), it was only practical to edit files one line at a time instead of the whole file. In <span style=\"font-family: courier new,courier,monospace;\">ed<\/span>, many operations were formed with single keystrokes, such as pressing <span style=\"font-family: terminal,monaco,monospace;\">&#8216;a&#8217;<\/span> appended text to a file and pressing&nbsp;<span style=\"font-family: terminal,monaco,monospace;\">&#8216;i&#8217;<\/span> inserted a line before the current line, not to speed up user operations but to minimize data sent to the terminal.<\/p>\n<p>According to Wikipedia, <span style=\"font-family: courier new,courier,monospace;\">ed<\/span> was \u201cuser-unfriendly\u201d and in 1975, an improved version was made: <strong><span style=\"font-family: courier new,courier,monospace;\">ex<\/span><\/strong>, representing EXtended. <span style=\"font-family: courier new,courier,monospace;\">ex<\/span> was also a line editor but with more intuitive commands and contained commonly used operations, including substitutions. It also had its own POSIX standard (1003.1).<\/p>\n<p>In a few short years, display technologies improved and ex developed a visual mode that enabled seeing and operating on many lines at a time. <span style=\"font-family: courier new,courier,monospace;\">ex<\/span> would no longer be confined as a line editor; it grew up into a screen editor! This screen editor became known as <strong><span style=\"font-family: courier new,courier,monospace;\">vi<\/span><\/strong>, representing \u201cVisual\u201d. <span style=\"font-family: courier new,courier,monospace;\">vi<\/span> also had more commands and modes, and could easily switch to using <span style=\"font-family: courier new,courier,monospace;\">ex<\/span> commands by pressing \u201c:\u201d.<\/p>\n<p>Almost 15 years went by before a new editor based on <span style=\"font-family: courier new,courier,monospace;\">vi<\/span> was developed: <strong><span style=\"font-family: courier new,courier,monospace;\">Vim<\/span><\/strong> , representing \u201cVi Improved\u201d. <span style=\"font-family: courier new,courier,monospace;\">Vim<\/span> was a superset of <span style=\"font-family: courier new,courier,monospace;\">vi<\/span>, having more features and improved extensibility. It was 99% compatible with <span style=\"font-family: courier new,courier,monospace;\">vi<\/span> with many keys representing the same operations. <span style=\"font-family: courier new,courier,monospace;\">Vim<\/span> comes installed on almost all modern Unix-derived systems, including macOS and Linux.<\/p>\n<p>Lately, the source code for <span style=\"font-family: courier new,courier,monospace;\">Vim<\/span> has been forked into a repository known as <strong><span style=\"font-family: courier new,courier,monospace;\">Neovim<\/span><\/strong> . It is almost exactly like <span style=\"font-family: courier new,courier,monospace;\">Vim<\/span> but with a refactored codebase. Here\u2019s what one contributor had to say about <span style=\"font-family: courier new,courier,monospace;\">Vim<\/span> \u2019s codebase:<\/p>\n<p style=\"padding-left: 60px;\"><em>\u201cIndentation is haphazard. Lines contain tabs mixed with spaces. Source files are huge. There are almost 25,000 lines in eval.c. That file contains over 500 #ifdefs and references globals defined in the 2,000 line globals.h. Some of Vim\u2019s source code isn\u2019t even valid text. It\u2019s not ASCII or UTF-8. The venerable <a href=\"http:\/\/en.wikipedia.org\/wiki\/File_%28command%29\">file<\/a> can\u2019t figure out the encoding. Many of Vim\u2019s #ifdefs are for platforms that became irrelevant decades ago: BeOS, VMS, Amiga, Mac OS Classic, IRIX.\u201d<\/em><\/p>\n<p style=\"text-align: right;\"><span style=\"color: #3366ff;\"><a style=\"color: #3366ff;\" href=\"https:\/\/geoff.greer.fm\/2015\/01\/15\/why-neovim-is-better-than-vim\/\">&#8212; https:\/\/geoff.greer.fm\/2015\/01\/15\/why-neovim-is-better-than-vim\/<\/a><\/span><\/p>\n<p>So far, <span style=\"font-family: courier new,courier,monospace;\">Neovim<\/span> tagged on version 0.2 with almost 9000 commits and 320 contributors. It\u2019s still in its infant days and we will see how much traction it gains in the upcoming years.<\/p>\n<p>(Sorry <span style=\"font-family: courier new,courier,monospace;\">Emacs<\/span> users for not including your favourite editor. I might write an article about <span style=\"font-family: courier new,courier,monospace;\">Emacs<\/span> if or when I learn it one day. In the meantime, go <span style=\"font-family: courier new,courier,monospace;\">Vim<\/span> !)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the beginning was ed, a simple bare-bones line editor developed in 1969 and shipped with Unix. Back then, personal computers didn\u2019t exist and most computer programmers accessed programs via&#8230;<\/p>\n","protected":false},"author":1,"featured_media":213,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"_links":{"self":[{"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/posts\/208"}],"collection":[{"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/comments?post=208"}],"version-history":[{"count":8,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":542,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/posts\/208\/revisions\/542"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/media\/213"}],"wp:attachment":[{"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/media?parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/categories?post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/lennycheng.com\/blog\/wp-json\/wp\/v2\/tags?post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}