2023-05-11 18:41:27 +02:00
|
|
|
return {
|
2023-05-23 19:35:54 +02:00
|
|
|
-- Normal mode
|
2023-05-11 18:41:27 +02:00
|
|
|
n = {
|
|
|
|
-- ["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
|
|
|
-- ["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
|
|
|
|
-- ["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
|
|
|
|
-- ["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
|
|
|
|
|
|
|
|
-- Easy buffer navigation
|
|
|
|
["<tab>"] = { "<cmd>bnext<cr>", desc = "Switch to next buffer" },
|
|
|
|
["<S-tab>"] = { "<cmd>bprevious<cr>", desc = "Switch to previous buffer" },
|
|
|
|
|
|
|
|
-- quick save
|
|
|
|
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
2023-05-23 19:35:54 +02:00
|
|
|
|
|
|
|
-- My telescope keybindings
|
2023-11-24 19:02:03 +01:00
|
|
|
["<F1>"] = { "<cmd>Telescope help_tags<cr>", desc = "Find help with Telescope" },
|
2023-11-16 18:59:46 +01:00
|
|
|
["<leader>gf"] = { "<cmd>Telescope git_files<cr>", desc = "Find git files with Telescope" },
|
2023-11-02 12:28:01 +01:00
|
|
|
["<leader>fq"] = { "<cmd>Telescope quickfix<cr>", desc = "Find quickfixes with Telescope" },
|
|
|
|
["<leader>fs"] = { "<cmd>Telescope spell_suggest<cr>", desc = "Find spell suggestions with Telescope" },
|
2023-11-09 20:24:20 +01:00
|
|
|
["<leader>fp"] = { "<cmd>Telescope projects<cr>", desc = "Find projetcs with Telescope" },
|
|
|
|
|
|
|
|
-- My personal keybindings
|
|
|
|
["<leader>²"] = { name = "Personal" },
|
|
|
|
["<leader>²t"] = { name = "Terminals" },
|
|
|
|
["<leader>²tt"] = { "<cmd>TermSelect<cr>", desc = "Select a terminal" },
|
|
|
|
["<leader>²tg"] = { "<cmd>terminal tig<cr>", desc = "Open tig in a new tab" },
|
|
|
|
|
|
|
|
["<leader>²n"] = { name = "Neotree" },
|
|
|
|
["<leader>²nb"] = { "<cmd>Neotree toggle buffers left<cr>", desc = "Open Neotree Buffers" },
|
|
|
|
["<leader>²ng"] = { "<cmd>Neotree toggle git_status left<cr>", desc = "Open Neotree Git status" },
|
|
|
|
|
2023-11-24 19:02:03 +01:00
|
|
|
["<F2>"] = { '<cmd>Neotree toggle<cr>', desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard
|
|
|
|
["<F3>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit terminal" }, -- F27 corresponds to <Ctrl+F3> on my keyboard
|
|
|
|
["<F4>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig terminal" }, -- F28 corresponds to <Ctrl+F4> on my keyboard
|
2023-05-11 18:41:27 +02:00
|
|
|
},
|
2023-05-23 19:35:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
-- Insert mode
|
2023-11-09 20:24:20 +01:00
|
|
|
i = {
|
2023-11-24 19:02:03 +01:00
|
|
|
["<F2>"] = { '<cmd>Neotree toggle<cr>', desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard
|
|
|
|
["<F3>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit terminal" }, -- F27 corresponds to <Ctrl+F3> on my keyboard
|
|
|
|
["<F4>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig terminal" }, -- F28 corresponds to <Ctrl+F4> on my keyboard
|
2023-11-09 20:24:20 +01:00
|
|
|
},
|
2023-05-23 19:35:54 +02:00
|
|
|
|
|
|
|
-- Terminal mode
|
2023-05-11 18:41:27 +02:00
|
|
|
t = {
|
|
|
|
-- setting a mapping to false will disable it
|
|
|
|
-- ["<esc>"] = false,
|
2023-11-09 20:24:20 +01:00
|
|
|
-- Switch to normal mode in terminal mode
|
|
|
|
["<Esc><Esc><Esc>"] = { "<C-\\><C-n>" },
|
2023-05-11 18:41:27 +02:00
|
|
|
-- Clear Ctrl+l so that we can use it to clear the terminal
|
|
|
|
["<C-l>"] = false,
|
|
|
|
["<C-h>"] = false,
|
2023-11-02 12:28:01 +01:00
|
|
|
-- Clear Ctrl-J and Ctrl-K so that we can use them to navigate the terminal (for lazygit)
|
|
|
|
["<C-j>"] = false,
|
|
|
|
["<C-k>"] = false,
|
2023-11-24 19:02:03 +01:00
|
|
|
-- My terms
|
|
|
|
["<F3>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit terminal" }, -- F27 corresponds to <Ctrl+F3> on my keyboard
|
|
|
|
["<F4>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig terminal" }, -- F28 corresponds to <Ctrl+F4> on my keyboard
|
2023-05-11 18:41:27 +02:00
|
|
|
},
|
|
|
|
}
|