From 20d335b3d80e7ca04cf2ec24c43f2970b58d6f94 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Wed, 15 Mar 2023 18:55:46 +0700 Subject: [PATCH] home/nvim: remove unused files & small style change --- home/common/nvim/default.nix | 8 +- home/common/nvim/vim-events.txt | 128 -------------------------------- home/common/nvim/vim-update.py | 23 ------ 3 files changed, 4 insertions(+), 155 deletions(-) delete mode 100644 home/common/nvim/vim-events.txt delete mode 100644 home/common/nvim/vim-update.py diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix index 6057533..1d9ea92 100644 --- a/home/common/nvim/default.nix +++ b/home/common/nvim/default.nix @@ -404,7 +404,7 @@ in compile "nvim_cmp" (bind (require "cmp") (cmp: (setup cmp { snippet = { - expand = args: (call (prop (require "luasnip") "lsp_expand") (prop args "body")); + expand = { body, ... }: call (prop (require "luasnip") "lsp_expand") body; }; view = { }; window = { @@ -417,10 +417,10 @@ }; }; formatting = { - format = _: vim_item: [ + format = _: vim_item: let kind = prop vim_item "kind"; in [ (set - (prop vim_item "kind") - (string.format (let kind = prop vim_item "kind"; in [ + kind + (string.format ([ "%s %s" (tableAttr (require "lspkind") kind) kind diff --git a/home/common/nvim/vim-events.txt b/home/common/nvim/vim-events.txt deleted file mode 100644 index b0b3e55..0000000 --- a/home/common/nvim/vim-events.txt +++ /dev/null @@ -1,128 +0,0 @@ -BufAdd -BufCreate -BufDelete -BufEnter -BufFilePost -BufFilePre -BufHidden -BufLeave -BufModifiedSet -BufNew -BufNewFile -BufRead -BufReadCmd -BufReadPost -BufReadPre -BufUnload -BufWinEnter -BufWinLeave -BufWipeout -BufWrite -BufWriteCmd -BufWritePost -BufWritePre -ChanInfo -ChanOpen -CmdUndefined -CmdWinEnter -CmdWinLeave -CmdlineChanged -CmdlineEnter -CmdlineLeave -ColorScheme -ColorSchemePre -CompleteChanged -CompleteDone -CompleteDonePre -CursorHold -CursorHoldI -CursorMoved -CursorMovedI -DiagnosticChanged -DiffUpdated -DirChanged -DirChangedPre -EncodingChanged -ExitPre -FileAppendCmd -FileAppendPost -FileAppendPre -FileChangedRO -FileChangedShell -FileChangedShellPost -FileEncoding -FileReadCmd -FileReadPost -FileReadPre -FileType -FileWriteCmd -FileWritePost -FileWritePre -FilterReadPost -FilterReadPre -FilterWritePost -FilterWritePre -FocusGained -FocusLost -FuncUndefined -GUIEnter -GUIFailed -InsertChange -InsertCharPre -InsertEnter -InsertLeave -InsertLeavePre -LspAttach -LspDetach -MenuPopup -ModeChanged -OptionSet -QuickFixCmdPost -QuickFixCmdPre -QuitPre -RecordingEnter -RecordingLeave -RemoteReply -SearchWrapped -SessionLoadPost -ShellCmdPost -ShellFilterPost -Signal -SourceCmd -SourcePost -SourcePre -SpellFileMissing -StdinReadPost -StdinReadPre -SwapExists -Syntax -TabClosed -TabEnter -TabLeave -TabNew -TabNewEntered -TermChanged -TermClose -TermEnter -TermLeave -TermOpen -TermResponse -TextChanged -TextChangedI -TextChangedP -TextYankPost -UIEnter -UILeave -User -VimEnter -VimLeave -VimLeavePre -VimResized -VimResume -VimSuspend -WinClosed -WinEnter -WinLeave -WinNew -WinScrolled - diff --git a/home/common/nvim/vim-update.py b/home/common/nvim/vim-update.py deleted file mode 100644 index 6a3bd87..0000000 --- a/home/common/nvim/vim-update.py +++ /dev/null @@ -1,23 +0,0 @@ -import os, json -d = os.path.dirname(os.path.realpath(__file__)) -j = lambda x: os.path.join(d, x) -x = open(j("vim-lua.txt"),'rt').read().split('\n') -y = open(j("vim-opts.txt"),'rt').read().split('\n') - -a = {} -def add(w, k, v): - if w.get(k[0]) is None: - w[k[0]] = {} - if len(k) == 1: - w[k[0]] = v - else: - add(w[k[0]], k[1:], v) - -for w in x: - if w: - if w.startswith('function/'): - t, ar, n = w.split('/') - add(a, {'type'}) - else: - t, n = w.split('/') -