<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vim &#8211; 天地一沙鸥</title>
	<atom:link href="https://haoluobo.com/tag/vim/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com</link>
	<description>to be continue....</description>
	<lastBuildDate>Wed, 18 Oct 2023 01:06:19 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>Vim下Python（Poetry）环境的设置</title>
		<link>https://haoluobo.com/2023/10/vim-python-poetry/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Tue, 17 Oct 2023 13:05:00 +0000</pubDate>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[direnv]]></category>
		<category><![CDATA[poetry]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12482</guid>

					<description><![CDATA[近期迁移到了 Neovim 。在 Pyright 的加持下，vim的代码补全和错误校验功能已经很接近 IDE  [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>近期迁移到了 Neovim 。在 Pyright 的加持下，vim的代码补全和错误校验功能已经很接近 IDE 了。在未正确配置 Python 环境的情况下打开 Python 项目，项目里一堆的告警让人很不舒服。</p>



<p>在 vim 中编辑 Python，重要的是 PYTHONPATH 的设置。正确设置 PYTHONPATH 后，Pyright 可以正确的查找到相关的依赖库。我目前的解决方案是使用 <a rel="noreferrer noopener" href="https://direnv.net/" data-type="link" data-id="https://direnv.net/" target="_blank">direnv</a> 。</p>



<h2 class="wp-block-heading">编辑 direnv 通用配置，添加 poetry 初始化函数。</h2>



<pre class="wp-block-code"><code>vim $HOME/.direnvrc</code></pre>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: bash; title: ; notranslate">
layout_poetry() {
  if &#x5B;&#x5B; ! -f pyproject.toml ]]; then
    log_error &#039;No pyproject.toml found.  Use `poetry new` or `poetry init` to create one first.&#039;
    exit 2
  fi

  local VENV=$(dirname $(poetry run which python))
  export VIRTUAL_ENV=$(echo &quot;$VENV&quot; | rev | cut -d&#039;/&#039; -f2- | rev)
  export POETRY_ACTIVE=1
  PATH_add &quot;$VENV&quot;
}
</pre></div>


<h2 class="wp-block-heading">在 python 项目中添加 direnv 设置</h2>



<pre class="wp-block-code"><code>vim .envrc</code></pre>



<pre class="wp-block-code"><code># 进入 Poetry 环境
layout_poetry
# 设置 PYTHONPATH
export PYTHONPATH="`pwd`/vendor/Model1:`pwd`/vendor/Model2"</code></pre>



<p>在设置好 direnv 后，在 CLI 下进入目录时将设置好环境变量。CLI 下进入对应的项目目录，然后启动 vim/neovim ，Pyright即可正确的找到相关依赖。</p>



<h2 class="wp-block-heading">参考：</h2>



<ul class="wp-block-list">
<li><a href="https://rgoswami.me/posts/poetry-direnv/" data-type="link" data-id="https://rgoswami.me/posts/poetry-direnv/" target="_blank" rel="noreferrer noopener">Poetry and Direnv</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>从Vim切换到Neovim</title>
		<link>https://haoluobo.com/2023/10/vim-to-neovim/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 16 Oct 2023 12:16:00 +0000</pubDate>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[软件推荐]]></category>
		<category><![CDATA[neovide]]></category>
		<category><![CDATA[neovim]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12477</guid>

					<description><![CDATA[vim作者的离世，让vim的后续发展存在很大的不确定性。加上现在用的vim配置一直有些小问题，其中一些插件的活 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>vim作者的离世，让vim的后续发展存在很大的不确定性。加上现在用的vim配置一直有些小问题，其中一些插件的活跃度不够，bug一直无法修复。</p>



<p>近期花了些时间把neovim配置好，从vim切换到neovim。</p>



<p>配置文件： <a href="https://github.com/vicalloy/dotfiles/blob/master/.config/nvim/init.lua">https://github.com/vicalloy/dotfiles/blob/master/.config/nvim/init.lua</a></p>



<ol class="wp-block-list">
<li>没有使用别人配置好的环境，完全自行配置。
<ul class="wp-block-list">
<li>之前也热衷于使用流行的集成配置。实际下来发现不管多受欢迎的配置都会有些不符合自己喜欢的地方。而且一旦遇到问题，很难定位问题。而且现在的插件管理机制已经很完善了，自行配置的门槛低了很多。</li>



<li>不少优秀的vim插件都转由lua实现，只能在Neovim中使用。</li>
</ul>
</li>



<li>GUI界面用的 <a href="https://github.com/neovide/neovide">Neovide</a> 。用 Rust 实现的 Neovim 前端。</li>
</ol>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>换回自己的VIM配置文件</title>
		<link>https://haoluobo.com/2019/06/vicalloys-vim-config/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Sat, 22 Jun 2019 06:02:40 +0000</pubDate>
				<category><![CDATA[vicalloy的庄家]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">/?p=11757</guid>

					<description><![CDATA[用过一段时间网上的通用VIM配置文件。使用通用配置文件本来是为了省心，实际用下来却并不省心。通用配置加载的东西 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>用过一段时间网上的通用VIM配置文件。使用通用配置文件本来是为了省心，实际用下来却并不省心。通用配置加载的东西是在太多，出了问题很难排查。默认配置里有部分不符合自己习惯的东西也很难改，修改之后更是衍生出一堆奇怪的问题。</p>


<p>最近新装了一台主机，趁着设置电脑的时候将VIM的配置重新整理了一遍，改用自己的VIM配置文件。</p>


<p>当前VIM下的插件管理工具已经很完善，插件的添加和更新都很方便。将自己常用的插件整理了一下，并使用<a href="https://github.com/junegunn/vim-plug">vim-plug</a>对插件进行管理。在加上少量自定义设置后，VIM的配置文件就好了。在换回自己的VIM配置后，VIM终于又重新开始变的好用了。</p>


<p>我的VIM设置可以在 <a href="https://github.com/vicalloy/dotfiles/blob/master/.vimrc.local" target="_blank" rel="noreferrer noopener" aria-label="这里 (opens in a new tab)">这里</a> 找到。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>将VIM的配置文件切换到janus</title>
		<link>https://haoluobo.com/2013/01/vim-janus/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Sat, 05 Jan 2013 05:35:15 +0000</pubDate>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">/?p=10854</guid>

					<description><![CDATA[janus是一个非常流行的VIM配置脚本，其中集合了很多优秀的VIM插件。 此前我一直都是用自己收集的VIM配 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://github.com/carlhuda/janus">janus</a>是一个非常流行的VIM配置脚本，其中集合了很多优秀的VIM插件。<br />
此前我一直都是用自己收集的VIM配置以及插件，到现在之前的某些插件已经出现了更优秀的替代品。索性将janus fork了一份(<a href="https://github.com/vicalloy/janus">vicalloy&#8217;s janus</a>)，针对自己的使用习惯做了少许的定制。<br />
<a href="https://github.com/carlhuda/janus">janus</a>具体加载了哪些插件，做了哪些默认配置，大家还是直接去看官方的README吧。<br />
我主要做了下面一些改动：</p>
<ul>
<li>取消了Tab、空格等不可见字符的提示功能。</li>
<li>取消行号显示。在vim中直接 :num 即可跳转到对应的行，所以我一直感觉行号显示并不是太有用。</li>
<li>关闭supertab插件。这个插件似乎和某些插件有冲突。</li>
<li>增加部分插件
<ul>
<li><a href="http://www.vim.org/scripts/script.php?script_id=1708">FencView</a> 国人写的自动识别文件编码的插件。</li>
<li><a href="http://www.vim.org/scripts/script.php?script_id=2981">ZenCoding</a> Zen Coding简单的说就是用css来写html，至于具体怎么用还是去找些Zen Coding的文章来看吧。</li>
<li><a href="https://github.com/ervandew/eclim">eclim</a> 将Eclipse的功能集成到vim的插件。其中有很多很好用的vim scripts，比如htmldjango的语法高亮以及缩进处理等。将其中的部分脚本打包到了我的vim配置中。</li>
<li><a href="https://github.com/davidhalter/jedi">jedi</a> vim的代码补全能力非常的弱。jedi相比来说要强大很多，不过对动态语言来说补全想做到非常智能并不容易。</li>
<li><a href="https://github.com/Lokaltog/vim-powerline">vim-powerline</a> 状态栏定制插件</li>
</ul>
</li>
</ul>
<p>注：</p>
<ul>
<li>janus并不支持windows系统，如果你需要在windows下使用janus需要自己做些小改动。</li>
<li>加了一堆的插件后VIM的启动速度明显变慢，此前都是秒开，现在要个2～3秒的启动时间。</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>GVIM同VIM的区别</title>
		<link>https://haoluobo.com/2011/11/gvim_vs_vim/</link>
					<comments>https://haoluobo.com/2011/11/gvim_vs_vim/#comments</comments>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 14 Nov 2011 02:57:16 +0000</pubDate>
				<category><![CDATA[软件推荐]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">/?p=10238</guid>

					<description><![CDATA[从我用vim以来就一直用的是gvim。gvim和vim的功能完全一样，但少量细节上的差别还是让我决定使用gvi [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>从我用vim以来就一直用的是gvim。gvim和vim的功能完全一样，但少量细节上的差别还是让我决定使用gvim。</p>
<ul>
<li><strong>光标</strong> vim下常规模式和插入模式下的光标都一个样，让我非常的不习惯。特别是在括号匹配的时候常让我不知道哪个才是光标。相比而言gvim编辑模式下的竖线光标则要直观的多。</li>
<li><strong>颜色</strong> vim只能显示256色，gvim可显示的颜色则要丰富的多，因此gvim的代码高亮会比vim更好看些。</li>
<li><strong>菜单</strong> 可能是受windows的影响深远，部分时候我还是需要用到gvim的菜单。</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://haoluobo.com/2011/11/gvim_vs_vim/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
