From 6273b6d43aedc6b00b82e1081db14c39194da765 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Thu, 13 Apr 2023 00:39:31 -0400 Subject: nvim: redo the whole thing reasons tm --- dot_config/nvim/lua/bindings.lua | 51 ++++++++++++---------------------------- 1 file changed, 15 insertions(+), 36 deletions(-) (limited to 'dot_config/nvim/lua/bindings.lua') diff --git a/dot_config/nvim/lua/bindings.lua b/dot_config/nvim/lua/bindings.lua index 42c5896..8c6e82e 100644 --- a/dot_config/nvim/lua/bindings.lua +++ b/dot_config/nvim/lua/bindings.lua @@ -1,37 +1,16 @@ ----@diagnostic disable:undefined-global +-- general bindings that aren't specific to a plugin +require 'which-key'.register { + -- diagnostics + [''] = { + e = { vim.diagnostic.open_float, 'diag float' }, + q = { vim.diagnostic.setloclist, 'diag locations' }, + }, + ['[d'] = { vim.diagnostic.goto_prev, 'prev diag' }, + [']d'] = { vim.diagnostic.goto_next, 'next diag' }, -local util = require 'util' - -local env = vim.env - --- TODO: write a wrapper for both -if not util.hp 'which-key.nvim' then - -- minimal bindings for a no-plugin environment - local km = vim.keymap.set - km('n', 'sv', function() dofile(env.MYVIMRC) end, { desc = 'source vimrc'}) - km('n', 's%', 'source %', { desc = 'source current file'}) -else - -- general bindings that aren't specific to a plugin - require 'which-key'.register { - -- diagnostics - [''] = { - e = { vim.diagnostic.open_float, 'diag float' }, - q = { vim.diagnostic.setloclist, 'diag locations' }, - }, - ['[d'] = { vim.diagnostic.goto_prev, 'prev diag' }, - [']d'] = { vim.diagnostic.goto_next, 'next diag' }, - - -- source - ['s'] = { - name = '+source', - v = { function() dofile(env.MYVIMRC) end, 'Vimrc' }, - ['%'] = { 'source %', 'Current File' }, - }, - - -- document missing builtins - ['g'] = { - t = 'Next tab', - T = 'Previous tab', - }, - } -end + -- document missing builtins + ['g'] = { + t = 'Next tab', + T = 'Previous tab', + }, +} -- cgit v1.2.3