----------------------------------------------------------- -- Keymaps of Neovim and installed plugins ----------------------------------------------------------- local map = vim.api.nvim_set_keymap local default_opts = { noremap = true, silent = true } -- Fast saving with and s map('n', 's', ':w', default_opts) map('n', 'a', ':w|:luafile %', default_opts) map('n', 'aa', ':w|:luafile % |:PackerSync', default_opts) map('i', 's', ':w', default_opts) -- Python Script that saves the file & moves Todos to my Todolist. map('n', 'sd', ':w|:! python3 ~/Documents/Northpass/Scripts/TodoMD/todo.py %', default_opts) -- Neovim Tab Navgation via Vem-Tabline map('n', 't', ':tabnew', default_opts) map('n', 'e', ':bnext', default_opts) map('n', 'w', ':bprev', default_opts) map('n', 'd', ':bdelete', default_opts) map('n', 'r', 'vem_move_buffer_right', default_opts) map('n', 'q', 'vem_move_buffer_left', default_opts) ----------------------------------------------------------- -- Applications and Plugins shortcuts ----------------------------------------------------------- ----------------------------------------------------------- -- Telescope Keymaps ----------------------------------------------------------- -- For Neovim >= 0.7.0 Mapper = require("nvim-mapper") local M = Mapper.map local default_opts = {noremap=true, silent=true} -- Sidebar M('n', 'n', ':SidebarNvimToggle', default_opts, "Sidebar Toggle", "sidebar-toggle", "Open or Close Sidebar" ) M('n', 'q', ':SidebarNvimUpdate', default_opts, "Sidebar Update", "sidebar-update", "Refresh the Sidebar" ) --[[ Sidebar Resize M('n', '=', ':SidebarNvimResize +1', default_opts, "Sidebar +1", "sidebar-plus1", "Sidebar Bigger by one" ) M('n', '-', ':SidebarNvimResize -1', default_opts, "Sidebar -1", "sidebar-minus1", "Sidebar Smaller by one" ) M('n', '==', ':SidebarNvimResize +10', default_opts, "Sidebar +10", "sidebar-plus10", "Sidebar Bigger by 10" ) M('n', '--', ':SidebarNvimResize -10', default_opts, "Sidebar -10", "sidebar-minus10", "Sidebar Smaller by 10" )--]] -- Markdown Preview Toggle M('n', 'P', ":MarkdownPreview", default_opts, "Markdown Preview", "md_preview", "Display Markdown preview in Qutebrowser" ) -- Telescope Options M('n', 'ff', ':Telescope find_files', default_opts, "Find Files", "find-files", "Find Files in Telescope pop-up" ) M('n', 'fg', ':Telescope live_grep', default_opts, "Live Grep", "live-grep", "Grep Files in Telescope pop-up" ) M('n', 'fb', ':Telescope buffers', default_opts, "Buffers", "buffers", "See Buffers in Telescope pop-up" ) M('n', 'fe', ":Telescope file_browser", default_opts, "Telescope Files", "telescope-file-browser", "Find files and directories in telescope" ) M('n', '', "@t", default_opts, "Add Todo", "todo_todo", "Add To-do/Task to the beginning of the line" ) M('n', '', "@s", default_opts, "Add Solutions Engineering", "todo_seng", "Add Solutions Engineering to the beginning of the line" ) M('n', '', "@f", default_opts, "Add Feature", "add_feat", "Add Feature Request tag to the beginning of the line. " ) M( 'n', '', "@c", default_opts, "Replace with Complete", "add_complete", "Replace tag with Complete tag at beginning of the line." ) M('n', '', "@w", default_opts, "Add Warning/Error", "add_error", "Add Warning/Error tag at the beginning of the line." ) M('n', 'ce', ":TodoTrouble keywords=TODO | :resize +10", default_opts, "Show Todo Tags", "show_todos", "Show Todo Tags." ) M('n', 'cf', ":TodoTrouble keywords=FEAT", default_opts, "Show Feature Tags", "show_features", "Show Feature Requests." ) M('n', 'cq', ":TodoTrouble keywords=ERROR, WARN", default_opts, "Show Warning Tags", "show_warnings", "Show Errors Tags." ) M('n', 'b', ":! black %", default_opts, "Black Formatting", "black_current_file", "Use Black Formatting on Current File." ) M('n', 'm', ":! markdownlint -f %", default_opts, "Markdownlint", "md_lint_format", "Use mdlint Formatting on Current File." ) M('n', 'r30', ":resize 30", default_opts, "Resize30", "resize_30", "Resize Window to #30" )