repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: fix missing keymaps in command_center

123ff6c5a6c0ef618ef69e7852166e0be1bc78b7

Oliver Jan Krylow <olver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (4)

neovim/ftplugin/markdown.lua

Modified
6 6 local want = require 'bugabinga.std.want'
7 7 -- local auto = require 'bugabinga.std.auto'
8 8 local map = require 'bugabinga.std.keymap'
9 --- TODO C-V open markdown preview
11 10 want { 'toggleterm.terminal' } (function(toggleterm)
12 11 local Terminal = toggleterm.Terminal
13 - -- local buffer_content = vim.api.nvim_buf_get_lines(0, 0, -1, false)
14 12 local file = vim.api.nvim_buf_get_name(0)
13 + local markdown_preview_command = 'mdcat ' .. file
14 + -- this command only shows the correct preview, if the buffer has been saved
15 + -- before. i could not figure out how to use the buffer content instead.
15 16 local mdcat = Terminal:new {
16 - cmd = 'mdcat ' .. file,
17 + cmd = markdown_preview_command,
17 18 direction = 'float',
18 - float_opts = { border = 'curved' },
19 19 start_in_insert = false,
20 - on_open = function(terminal)
21 - -- terminal:send(buffer_content)
22 - end,
20 + close_on_exit = false,
21 + hidden = true,
24 23 map {
25 - name = 'Open Markdown Preview',
26 - description = 'Opens a preview of the current markdown buffer in a terminal.',
24 + description = 'Opens a preview of the current markdown buffer.',
27 25 category = map.CATEGORY.MARKDOWN,
28 26 mode = map.MODE.NORMAL,
29 - keys = '<C-v>',
27 + keys = '<LEADER>mp',
30 28 command = function()
31 29 mdcat:toggle()
32 30 end,

neovim/init.lua

Modified
69 69 -- [ ] icon facade: icon.get("name")
70 70 -- [ ] make keymap facade immediate and support buffer local binds
71 71 -- [ ] put all keybinds into facade
72 +-- [ ] use nvim-specific lsp only in neovim config
73 +-- [ ] fix gitsigns highights
72 74 -- [ ] hydra cycle buffers
73 75 -- [ ] add fstabfmt to null-ls
74 76 -- [ ] add keybind to dismiss notify window

neovim/lua/bugabinga/plugins/init.lua

Modified
58 58 'lukas-reineke/indent-blankline.nvim',
59 59 -- move blocks of code around
60 60 'booperlv/nvim-gomove',
61 + -- toolkit for creating themes
62 + 'rktjmp/lush.nvim',
61 63 -- theme with colors i like
62 64 'rockerBOO/boo-colorscheme-nvim',
63 65 -- display the colorcolumn as a virtual character

neovim/lua/bugabinga/std/keymap.lua

Modified
1 1 local want = require 'bugabinga.std.want'
2 2 local bind = want { 'command_center' } (function(command_center)
3 3 return function(map)
4 - map.visible = map.visible or true
4 + map.visible = map.visible == nil or map.visible
5 5 map.options = map.options or {}
6 6 local options = vim.tbl_extend('keep', map.options, { silent = true })
7 7 if map.visible then
8 8 command_center.add({
9 - name = map.name,
10 - description = map.description,
11 - category = map.category,
12 - cmd = map.command,
13 - keybindings = { map.mode, map.keys, options },
14 - }, command_center.mode.ADD_ONLY)
9 + {
10 + description = map.description,
11 + category = map.category,
12 + cmd = map.command,
13 + keybindings = { map.mode, map.keys, options },
14 + },
15 + }, command_center.mode.ADD_ONLY)
16 17 -- use neovim api to add keybind instead of command_center, because it has
17 18 -- nicer defaults.
40 41 NAVIGATION = 'navigation',
41 42 NOTIFY = 'notify',
43 -},{
44 - __call = function(_, ...) return bind(...) end,
44 +}, {
45 + __call = function(_, ...)
46 + return bind(...)
47 + end,