2022-03-03 13:52:43 -05:00
|
|
|
-----------------------------------------------------------
|
2023-01-16 16:47:30 -05:00
|
|
|
|
|
|
|
|
-- Keymaps of Neovim and installed plugins
|
2022-03-03 13:52:43 -05:00
|
|
|
-----------------------------------------------------------
|
2023-01-16 16:47:30 -05:00
|
|
|
|
2022-03-03 13:52:43 -05:00
|
|
|
local map = vim.api.nvim_set_keymap
|
|
|
|
|
local default_opts = { noremap = true, silent = true }
|
|
|
|
|
|
|
|
|
|
-- Fast saving with <leader> and s
|
|
|
|
|
map('n', '<leader>s', ':w<CR>', default_opts)
|
2022-06-30 14:16:47 -04:00
|
|
|
map('n', '<leader>a', ':w|:luafile %<CR>', default_opts)
|
2022-10-05 09:26:39 -04:00
|
|
|
map('n', '<leader>aa', ':w|:luafile %<CR> |:PackerSync<CR>', default_opts)
|
2022-03-03 13:52:43 -05:00
|
|
|
map('i', '<leader>s', '<C-c>:w<CR>', default_opts)
|
2023-01-16 16:47:30 -05:00
|
|
|
-- Python Script that saves the file & moves Todos to my Todolist.
|
2022-11-09 16:48:39 -05:00
|
|
|
map('n', '<leader>sd', ':w|:! python3 ~/Documents/Northpass/Scripts/TodoMD/todo.py %<CR>', default_opts)
|
2022-03-03 13:52:43 -05:00
|
|
|
|
2022-07-14 18:51:47 -04:00
|
|
|
-- Neovim Tab Navgation via Vem-Tabline
|
2022-03-08 16:14:59 -05:00
|
|
|
map('n', '<leader>t', ':tabnew<CR>', default_opts)
|
2022-07-14 18:51:47 -04:00
|
|
|
map('n', '<leader>e', ':bnext<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>w', ':bprev<CR>', default_opts)
|
2022-08-23 08:10:48 -04:00
|
|
|
map('n', '<leader>d', ':bdelete<CR>', default_opts)
|
2022-07-14 18:51:47 -04:00
|
|
|
map('n', '<leader>r', '<Plug>vem_move_buffer_right', default_opts)
|
|
|
|
|
map('n', '<leader>q', '<Plug>vem_move_buffer_left', default_opts)
|
2022-03-03 13:52:43 -05:00
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
2023-01-16 16:47:30 -05:00
|
|
|
|
2022-03-03 13:52:43 -05:00
|
|
|
-- Applications and Plugins shortcuts
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
-- nvim-tree
|
2022-09-09 17:45:28 -04:00
|
|
|
map('n', '<leader>n', ':NvimTreeToggle<CR>', default_opts) -- open/close
|
2022-06-29 17:16:38 -04:00
|
|
|
map('n', '<leader>q', ':NvimTreeRefresh<CR>', default_opts) -- refresh
|
2022-03-03 13:52:43 -05:00
|
|
|
|
2022-06-29 17:16:38 -04:00
|
|
|
-- Place Check box for To-Do style Lists
|
2022-08-11 13:20:10 -04:00
|
|
|
map('i','<C-z>', '* [ ] ', default_opts)
|
|
|
|
|
|
|
|
|
|
-- Nvim Tree Resize
|
|
|
|
|
map('n', '<leader>=', ':NvimTreeResize +1<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>-', ':NvimTreeResize -1<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>==', ':NvimTreeResize +10<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>--', ':NvimTreeResize -10<CR>', default_opts)
|
2023-01-16 16:47:30 -05:00
|
|
|
|
2022-11-09 16:48:39 -05:00
|
|
|
-----------------------------------------------------------
|
2023-01-16 16:47:30 -05:00
|
|
|
|
2022-11-09 16:48:39 -05:00
|
|
|
-- Telescope Keymaps
|
|
|
|
|
-----------------------------------------------------------
|
2023-01-16 16:47:30 -05:00
|
|
|
|
2022-11-09 16:48:39 -05:00
|
|
|
map('n', '<leader>ff', ':Telescope find_files<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>fg', ':Telescope live_grep<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>fb', ':Telescope buffers<CR>', default_opts)
|
|
|
|
|
map('n', '<leader>fe', ':Telescope file_browser<CR>', default_opts)
|
2022-11-15 17:17:06 -05:00
|
|
|
|
|
|
|
|
Mapper = require("nvim-mapper")
|
|
|
|
|
local M = Mapper.map
|
|
|
|
|
-- For Neovim >= 0.7.0
|
2022-11-30 17:21:29 -05:00
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<leader>P', ":MarkdownPreview<CR>",
|
|
|
|
|
{silent = true, noremap = true},
|
|
|
|
|
"Markdown",
|
|
|
|
|
"md_preview",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Display Markdown preview in Qutebrowser"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<leader>fe', ":Telescope file_browser<CR>",
|
|
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Telescope",
|
|
|
|
|
"telescope-file-browser",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Find files and directories in telescope"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
|
|
|
|
'n', '<C-t>', "@t<CR>",
|
2023-01-16 16:47:30 -05:00
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Todo Comments",
|
|
|
|
|
"todo_todo",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Add To-do/Task to the beginning of the line"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<C-s>', "@s<CR>",
|
2022-11-30 17:21:29 -05:00
|
|
|
{silent=true, noremap=true},
|
2023-01-16 16:47:30 -05:00
|
|
|
"Todo Comments",
|
|
|
|
|
"todo_seng",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Add Solutions Engineering to the beginning of the line"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
|
|
|
|
'n', '<C-f>', "@f<CR>",
|
|
|
|
|
{silent=true, noremap=true},
|
2023-01-16 16:47:30 -05:00
|
|
|
"Todo Comments",
|
2023-01-24 15:20:37 -05:00
|
|
|
"add_feat",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Add Feature Request tag to the beginning of the line. "
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<C-x>', "@c<CR>",
|
|
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Todo Comments",
|
2023-01-24 15:20:37 -05:00
|
|
|
"add_complete",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Replace tag with Complete tag at beginning of the line."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<C-w>', "@w<CR>",
|
2022-11-30 17:21:29 -05:00
|
|
|
{silent=true, noremap=true},
|
2023-01-16 16:47:30 -05:00
|
|
|
"Todo Comments",
|
2023-01-24 15:20:37 -05:00
|
|
|
"add_error",
|
2022-11-30 17:21:29 -05:00
|
|
|
"Add Warning/Error tag at the beginning of the line."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-24 15:20:37 -05:00
|
|
|
'n', '<leader>ce', ":TodoTrouble keywords=TODO<CR> | :resize +10<CR>",
|
2023-01-16 16:47:30 -05:00
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Show Todos",
|
2023-01-24 15:20:37 -05:00
|
|
|
"show_todos",
|
|
|
|
|
"Show Todo Tags."
|
2022-11-30 17:21:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<leader>cf', ":TodoTrouble keywords=FEAT<CR>",
|
|
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Show Todos",
|
2023-01-24 15:20:37 -05:00
|
|
|
"show_features",
|
|
|
|
|
"Show Feature Requests."
|
2022-11-30 17:21:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
M(
|
2023-01-16 16:47:30 -05:00
|
|
|
'n', '<leader>cq', ":TodoTrouble keywords=ERROR, WARN<CR>",
|
|
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Show Todos",
|
2023-01-24 15:20:37 -05:00
|
|
|
"show_warnings",
|
|
|
|
|
"Show Errors Tags."
|
2022-11-30 17:21:29 -05:00
|
|
|
)
|
2022-12-07 14:09:19 -05:00
|
|
|
|
|
|
|
|
M(
|
|
|
|
|
'n', '<leader>b', ":! black %<CR>",
|
|
|
|
|
{silent=true, noremap=true},
|
|
|
|
|
"Black Cwf",
|
|
|
|
|
"black_current_file",
|
|
|
|
|
"Use Black Formatting on Current File."
|
|
|
|
|
)
|