File: emoji_list.lua

package info (click to toggle)
neovim 0.11.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64,140 kB
  • sloc: ansic: 263,427; python: 1,472; lisp: 1,237; sh: 1,138; makefile: 383; xml: 84; ruby: 6
file content (19 lines) | stat: -rw-r--r-- 406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- Script to fill the window with emoji characters, one per line.
-- Source this script: :source %

if vim.bo.modified then
  vim.cmd.new()
else
  vim.cmd.enew()
end

local lnum = 1
for c = 0x100, 0x1ffff do
  local cs = vim.fn.nr2char(c)
  if vim.fn.charclass(cs) == 3 then
    vim.fn.setline(lnum, string.format('|%s| %d', cs, vim.fn.strwidth(cs)))
    lnum = lnum + 1
  end
end

vim.bo.modified = false