2021-05-19 00:53:42 +02:00
|
|
|
-- Author : swytch
|
|
|
|
-- Created : Friday Mar 12, 2021 20:17:19 CET
|
|
|
|
-- License : GPLv3
|
|
|
|
-- Description : neovim mappings file
|
|
|
|
|
2022-04-27 21:30:56 +02:00
|
|
|
vim.keymap.set({ "n", "v" }, "<space>", "<Nop>", { silent = true })
|
|
|
|
vim.g.mapleader = " "
|
2021-05-21 23:57:34 +02:00
|
|
|
|
2022-04-27 21:30:56 +02:00
|
|
|
-- Dealing with word wrap
|
|
|
|
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'",
|
2022-04-27 21:58:12 +02:00
|
|
|
{ expr = true, silent = true })
|
2022-04-27 21:30:56 +02:00
|
|
|
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
|
2022-04-27 21:58:12 +02:00
|
|
|
{ expr = true, silent = true })
|
2022-04-27 21:30:56 +02:00
|
|
|
|
|
|
|
vim.keymap.set("n", "<leader>y", "\"+y")
|
|
|
|
vim.keymap.set("n", "<leader>p", "\"+P")
|
|
|
|
vim.keymap.set("n", "<leader><enter>", "<cmd>w! | !compiler %<CR>")
|
|
|
|
vim.keymap.set("n", "<leader>u", function() require("packer").sync() end)
|
2021-05-23 01:37:44 +02:00
|
|
|
|
|
|
|
-- telescope
|
2022-04-27 21:30:56 +02:00
|
|
|
vim.keymap.set("n", "<leader>ff",
|
2022-04-27 21:58:12 +02:00
|
|
|
function() require("telescope.builtin").find_files() end)
|
2022-04-27 21:30:56 +02:00
|
|
|
vim.keymap.set("n", "<leader>fb",
|
2022-04-27 21:58:12 +02:00
|
|
|
function() require("telescope.builtin").buffers() end)
|
2022-04-27 21:30:56 +02:00
|
|
|
vim.keymap.set("n", "<leader>fl",
|
2022-04-27 21:58:12 +02:00
|
|
|
function() require("telescope.builtin").live_grep() end)
|
2021-10-22 22:40:18 +02:00
|
|
|
|
|
|
|
-- colorscheme
|
2022-04-27 21:58:12 +02:00
|
|
|
vim.keymap.set("n", "<C-s>",
|
|
|
|
function() require("astronomy").toggle_variant() end)
|
2021-11-20 16:02:59 +01:00
|
|
|
|
|
|
|
-- snippets
|
2022-04-27 21:30:56 +02:00
|
|
|
vim.keymap.set({ "i", "s" }, "<C-E>", "<Plug>luasnip-next-choice")
|