34 lines
1.1 KiB
Lua
34 lines
1.1 KiB
Lua
-- Author : swytch
|
|
-- Created : Friday Mar 12, 2021 20:17:19 CET
|
|
-- License : GPLv3
|
|
-- Description : neovim mappings file
|
|
|
|
vim.keymap.set({ "n", "v" }, "<space>", "<Nop>", { silent = true })
|
|
vim.g.mapleader = " "
|
|
|
|
-- Dealing with word wrap
|
|
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'",
|
|
{ expr = true, silent = true })
|
|
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'",
|
|
{ expr = true, silent = true })
|
|
|
|
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)
|
|
|
|
-- telescope
|
|
vim.keymap.set("n", "<leader>ff",
|
|
function() require("telescope.builtin").find_files() end)
|
|
vim.keymap.set("n", "<leader>fb",
|
|
function() require("telescope.builtin").buffers() end)
|
|
vim.keymap.set("n", "<leader>fl",
|
|
function() require("telescope.builtin").live_grep() end)
|
|
|
|
-- colorscheme
|
|
vim.keymap.set("n", "<C-s>",
|
|
function() require("astronomy").toggle_variant() end)
|
|
|
|
-- snippets
|
|
vim.keymap.set({ "i", "s" }, "<C-E>", "<Plug>luasnip-next-choice")
|