-
vim 配置 Golang 开发
2021-05-23
我很喜欢 Vim 编辑器,也想学习下 Golang,于是在一台旧的 Macbook Pro 上配置了 Golang 的 Vim 开发环境。 neovim 和 vim-plug 我使用的是 neovim,插件管理用的是 vim-plug。首先通过 homebrew 安装 neovim: brew install neovim 安装完成后,通过命令 nvim 启动 neovim,我在 zsh 的配置文件 .zshrc 里添加了 alias vim="nvim" 这…
-
Buffers, Windows, Tabs in Vim
2021-02-14
Most editors, like VSCode, use tabs and windows system. A tab usually means an opened file, and when we close it, the file goes away. Vim use buffers, windows and tabs, and they are different from most editors. Buffer First, let’s look at buffers in vim. A buffer is the in-memory text of a file. When we open a file in vim, it creates a buffer in memory. And what in this buffer is the file’s content. When we edit the file, we edit the buffer. Let’s try to edit a file named file1: vim file1 Vim creates a new buffer for file1 in memory. When we type :q to quit vim, the buffer will be cleared and there will be no file file1 stored on disk because we didn’t write anything to the buffer.…