This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.config/nvim/lua/maps.lua

36 lines
1.2 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>tf",
function() require("telescope.builtin").find_files() end)
vim.keymap.set("n", "<leader>tb",
function() require("telescope.builtin").buffers() end)
vim.keymap.set("n", "<leader>tg",
function() require("telescope.builtin").grep_string() end)
vim.keymap.set("n", "<leader>tl",
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")