dotfiles/.config/nvim/lua/keys.lua

39 lines
811 B
Lua
Raw Normal View History

2021-08-24 18:17:11 +02:00
local map = vim.api.nvim_set_keymap
local function n(...) map("n", ...) end
local function x(...) map("x", ...) end
local function i(...) map("i", ...) end
-- Telescope
n("<C-f>", "<cmd>Telescope find_files<cr>", { noremap = true })
n("<C-b>", "<cmd>Telescope buffers<cr>", { noremap = true })
-- Tree
n("<S-T>", ":NvimTreeToggle<cr>", {})
-- Movement
n("<C-J>", "<C-W><C-J>", { noremap = true })
n("<C-K>", "<C-W><C-K>", { noremap = true })
n("<C-L>", "<C-W><C-L>", { noremap = true })
n("<C-H>", "<C-W><C-H>", { noremap = true })
-- Tabs
n("<C-T>", ":tabnew<cr>", {})
-- Split
n("<C-S>", ":vsplit<cr>", {})
n("<S-S>", ":split<cr>", {})
-- Quit
n("Q", "<nop>", { noremap = true })
vim.api.nvim_exec(
[[
:command WQ wq
:command Wq wq
:command W w
:command Q q
:command WQa wqa
:command Wqa wqa
]],
true)