<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Daniel Duan's Articles About NeoVim</title>
        <link>https://duan.ca/tag/neovim/</link>
        <atom:link href="https://duan.ca/tag/neovim/feed.xml" rel="self" type="application/rss+xml" />
            <item>
                <title>NeoVim, Swift and Make</title>
                <description>&#60;p&#62;When it comes to Swift source code editing, nothing beats Xcode 6.3! That
includes Xcode 6.2, which drove me to good&#39;O Vim for a while.&#60;/p&#62;
&#60;p&#62;Except it&#39;s not the old Vim, I&#39;m trying out &#60;a href=&#34;http://neovim.org&#34;&#62;NeoVim&#60;/a&#62;. The
most noticable difference in NeoVim compared to Vim is its recent
addition of a built-in terminal.&#60;/p&#62;
&#60;p&#62;With the help of syntax highlighting and a Makefile, working with Swift this
way turns out to be a fine alternative.&#60;/p&#62;
&#60;p&#62;(As a side benefit, I&#39;m forced to use only local-context autocompletion. Now
I can actually spell out full UIKit APIs 😉.)&#60;/p&#62;
&#60;p&#62;Here&#39;s a gif:&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;/assets/2015/04/demo.gif&#34; alt=&#34;Make Swift NeoVim Demo&#34; /&#62;&#60;/p&#62;
&#60;p&#62;Some details are easy to miss. I pressed &#60;code&#62;,m&#60;/code&#62;, &#60;code&#62;,&#60;/code&#62; being my binding for
&#60;code&#62;&#38;lt;leader&#38;gt;&#60;/code&#62;. A terminal session launched with the &#60;code&#62;make&#60;/code&#62; command running. When
that&#39;s done, I could press any key and the terminal pane was dismissed. Since
&#60;code&#62;test&#60;/code&#62; is the default target in my &#60;code&#62;Makefile&#60;/code&#62;, the test suit for my Swift
codes actually ran.&#60;/p&#62;
&#60;p&#62;Here&#39;s how the shortcut is set in &#60;code&#62;.nvimrc&#60;/code&#62;:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;if has(&#39;nvim&#39;)
    nnoremap &#38;lt;leader&#38;gt;m :rightbelow vertical split &#38;lt;bar&#38;gt; :term make&#38;lt;cr&#38;gt;
endif
&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The makefile is pretty straightforword if you&#39;ve worked with &#60;code&#62;xcodebuild&#60;/code&#62;.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;test :
    @xcodebuild test -project ProjectName.xcodeproj -scheme SchemeName -destination &#39;platform=iOS Simulator,name=iPhone 6&#39; | xcpretty

clean :
    @xcodebuild clean
&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;&#60;a href=&#34;https://github.com/supermarin/xcpretty&#34;&#62;xcpretty&#60;/a&#62; is a nifty script that
makes &#60;code&#62;xcodebuild&#60;/code&#62;s output much more readable.&#60;/p&#62;
&#60;p&#62;Happy vimming, Swifties :)&#60;/p&#62;
</description>
                <pubDate>Wed, 22 Apr 2015 11:46:17 -0700</pubDate>
                <link>https://duan.ca/2015/04/22/neovim-swift-and-make/</link>
                <guid isPermaLink="true">https://duan.ca/2015/04/22/neovim-swift-and-make/</guid>
            </item>
    </channel>
</rss>