From 70abc1f30f772757088b13d97256423385156080 Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 15 Feb 2023 23:11:33 -0500 Subject: Major changes including better ui and more keybinds :) --- lua/core/maps.lua | 73 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 24 deletions(-) (limited to 'lua/core/maps.lua') diff --git a/lua/core/maps.lua b/lua/core/maps.lua index bd4367e..d616e8f 100644 --- a/lua/core/maps.lua +++ b/lua/core/maps.lua @@ -9,17 +9,11 @@ a.nvim_set_keymap("n", "to", "vw:term", opts) -- esc to go to normal mode in term bufers a.nvim_set_keymap("t", "", "", opts) --- open Trouble buffer -a.nvim_set_keymap("n", "tt", - "TroubleToggle document_diagnostics", opts) -a.nvim_set_keymap("n", "td", "TodoTrouble", opts) - --- dismiss notifications -a.nvim_set_keymap("n", "nd", "", { callback = require('notify').dismiss }) - -- open file viewer a.nvim_set_keymap("n", "fo", ":Ex", opts) a.nvim_set_keymap("n", "fs", ":Sex", opts) +a.nvim_set_keymap("n", "fh", ":Hex", opts) +a.nvim_set_keymap("n", "fv", ":Vex", opts) -- clear search a.nvim_set_keymap("n", "", ":nohlsearch:echo", opts) @@ -38,6 +32,33 @@ a.nvim_set_keymap("n", "", "zz", opts) -- execute order 111 a.nvim_set_keymap("n", "x", "!chmod +x %", opts) +-- add some keybinds to the file view +a.nvim_create_autocmd('FileType', { + pattern = 'netrw', + callback = function() + local bind = function(lhs, rhs) + vim.keymap.set('n', lhs, rhs, { remap = true, buffer = true }) + end + bind('h', '-^') -- Go up a directory + bind('l', '') -- Go down a directory / open a file + bind('.', 'gh') -- Toggle dotfiles + bind('P', 'z') -- Close preview window + bind('', 'q') -- Close netrw + end +}) + +-- plugin related binds +-- better indenting +a.nvim_set_keymap('i', '', 'lua require("intellitab").indent()', opts) + +-- open Trouble buffer +a.nvim_set_keymap("n", "tt", +"TroubleToggle document_diagnostics", opts) +a.nvim_set_keymap("n", "td", "TodoTrouble", opts) + +-- dismiss notifications +a.nvim_set_keymap("n", "nd", "", { callback = require('notify').dismiss }) + -- resizing splits a.nvim_set_keymap("n", '', "SmartResizeLeft", opts) a.nvim_set_keymap("n", '', "SmartResizeDown", opts) @@ -58,24 +79,28 @@ a.nvim_set_keymap('n', 'su', 'Telescope undo', opts) a.nvim_set_keymap('n', 'sd', 'Telescope diagnostics', opts) a.nvim_set_keymap('n', 'sn', 'Telescope notify', opts) --- resource snippets +-- treesitter +a.nvim_set_keymap('n', 'j', 'TSJToggle', opts) + +-- re-source snippets a.nvim_set_keymap('n', 's', 'source ~/.config/nvim/lua/core/snippets/init.lua', opts) --- auto comand keybinds --- add some keybinds to the file view -a.nvim_create_autocmd('FileType', { - pattern = 'netrw', - callback = function() - local bind = function(lhs, rhs) - vim.keymap.set('n', lhs, rhs, {remap = true, buffer = true}) - end - bind('h', '-^') -- Go up a directory - bind('l', '') -- Go down a directory / open a file - bind('.', 'gh') -- Toggle dotfiles - bind('P', 'z') -- Close preview window - bind('', 'q') -- Close netrw - end -}) +-- hover +vim.keymap.set('n', '', require("hover").hover_select, opts) + +-- lsp diagnostics float +a.nvim_set_keymap('n', '', 'lua vim.diagnostic.open_float()', opts) + +-- essentials +a.nvim_set_keymap('n', 'eu', 'lua require("essentials").go_to_url()', opts) +a.nvim_set_keymap('n', 'ec', 'lua require("essentials").cheat_sh()', opts) + +-- return to home screen +a.nvim_set_keymap('n', 'gh', 'Alpha', opts) + +-- highlighting +a.nvim_set_keymap("v", "ha", ":HSHighlight 1", opts) +a.nvim_set_keymap("v", "hc", ":HSRmHighlight", opts) -- vbox note taking function _G.Toggle_venn() -- cgit v1.2.1