summaryrefslogtreecommitdiff
path: root/dot_config/nvim/lua/bindings.lua
diff options
context:
space:
mode:
authorChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-04-13 00:39:31 -0400
committerChloe Kudryavtsev <code@toast.bunkerlabs.net>2023-04-13 00:39:31 -0400
commit6273b6d43aedc6b00b82e1081db14c39194da765 (patch)
treec6b1b1e6f9391696001375cb93ecd34449eefe0c /dot_config/nvim/lua/bindings.lua
parentnvim: add rudimentary treesitter folding support (diff)
nvim: redo the whole thing
reasons tm
Diffstat (limited to 'dot_config/nvim/lua/bindings.lua')
-rw-r--r--dot_config/nvim/lua/bindings.lua51
1 files changed, 15 insertions, 36 deletions
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
+ ['<leader>'] = {
+ 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', '<leader>sv', function() dofile(env.MYVIMRC) end, { desc = 'source vimrc'})
- km('n', '<leader>s%', '<cmd>source %<cr>', { desc = 'source current file'})
-else
- -- general bindings that aren't specific to a plugin
- require 'which-key'.register {
- -- diagnostics
- ['<leader>'] = {
- 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
- ['<leader>s'] = {
- name = '+source',
- v = { function() dofile(env.MYVIMRC) end, 'Vimrc' },
- ['%'] = { '<cmd>source %<cr>', 'Current File' },
- },
-
- -- document missing builtins
- ['g'] = {
- t = 'Next tab',
- T = 'Previous tab',
- },
- }
-end
+ -- document missing builtins
+ ['g'] = {
+ t = 'Next tab',
+ T = 'Previous tab',
+ },
+}