All notes tagged with vim.

August 23, 2023

vim wsl

Copy/Paste for Neovim in WSL

If you want a seamless copy/paste experience on Neovim in WSL there is a newly recommended method for doing so, without having to install extra software.

Paste the following Lua snippet in your configuration and "+y to yank the selected text into your global register. Similarly, use "+p to paste.

if vim.fn.has "wsl" == 1 then
  vim.g.clipboard = {
    name = "WslClipboard",
    copy = {
      ["+"] = "clip.exe",
      ["*"] = "clip.exe",
    },
    paste = {
      ["+"] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
      ["*"] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
    },
    cache_enabled = 0,
  }
end

August 22, 2023

vim linux

Latest Neovim on Ubuntu

I’m using Ubuntu for my development environment, and Ubuntu does not have the latest Neovim in their repository.

That’s why I choose to install the last version by source. The steps I take are:

wget https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz
tar xfz nvim-linux64.tar.gz
sudo mv nvim-linux64 /opt/nvim

Now you have to make sure that /opt/nvim/bin is part of your path. If you are smart, and using the Fish shell, add this to your Fish config.

fish_add_path -aP /opt/nvim/bin

If you are on Bash:

export PATH=/opt/nvim/bin:$PATH

Enjoy your latest version of Neovim!

July 5, 2023

vim

Patching Berkeley Mono with Nerd Fonts

I’m using Berkeley Mono as my font, which is beautiful, but doesn’t have all the glyphs I need for my terminal and editor.

The glyphs I need are part of Nerd Fonts. This is the command I run to patch Berkeley Mono with the use of Docker:

docker run --rm \
	-v /tmp/berkeley-mono/origin:/in \
	-v /tmp/berkeley-mono/patched:/out \
	nerdfonts/patcher \
	--progressbars \
	--mono \
	--adjust-line-height \
	--fontawesome \
	--fontawesomeextension \
	--fontlogos \
	--octicons \
	--codicons \
	--powersymbols \
	--pomicons \
	--powerline \
	--powerlineextra \
	--material \
	--weather

I found the above command in this blog post from Serhat Teker: Patching Fonts with Docker.