From 2e6df3a8bd9ff0f6ec72fd7874b8a3d2ed335317 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 8 Jan 2024 17:46:07 +0000 Subject: [PATCH] Revert "Move key mappings" This reverts commit b7f26524b0ddcd5db1b2783c20bdb423d4cb1bfb. --- after/ftplugin/markdown.lua | 1 - lua/opdavies/init.lua | 8 ++++++++ lua/opdavies/options.lua | 35 ----------------------------------- 3 files changed, 8 insertions(+), 36 deletions(-) delete mode 100644 after/ftplugin/markdown.lua diff --git a/after/ftplugin/markdown.lua b/after/ftplugin/markdown.lua deleted file mode 100644 index 4148068..0000000 --- a/after/ftplugin/markdown.lua +++ /dev/null @@ -1 +0,0 @@ -vim.o.wrap = true diff --git a/lua/opdavies/init.lua b/lua/opdavies/init.lua index 1fcdda4..386cced 100644 --- a/lua/opdavies/init.lua +++ b/lua/opdavies/init.lua @@ -12,3 +12,11 @@ require "opdavies.telescope.mappings" vim.api.nvim_create_user_command("GoToFile", function() require("opdavies.telescope").git_files() end, {}) + +local imap = require("opdavies.keymap").imap +local nmap = require("opdavies.keymap").nmap +local xmap = require("opdavies.keymap").xmap + +-- Quicker macro playback. +nmap { "Q", "@qj" } +xmap { "Q", ":norm @q" } diff --git a/lua/opdavies/options.lua b/lua/opdavies/options.lua index 5599f22..90ceaad 100644 --- a/lua/opdavies/options.lua +++ b/lua/opdavies/options.lua @@ -31,25 +31,6 @@ local function set_autocmd() vim.cmd.set "filetype=term" end, }) - - vim.api.nvim_create_autocmd("FileType", { - pattern = "html.twig", - group = vim.api.nvim_create_augroup("twig_keymaps", { clear = true }), - callback = function() - local imap = require("opdavies.keymap").imap - local opts = { silent = true, buffer = true } - - imap { "{#", "{# #}", opts } - imap { "{%", "{% %}", opts } - imap { "{{", "{{ }}", opts } - end, - }) -end - -local function set_user_commands() - vim.api.nvim_create_user_command("GoToFile", function() - require("opdavies.telescope").git_files() - end, {}) end local function set_filetypes() @@ -123,21 +104,6 @@ local function set_key_mappings() -- Move half a screen up or down and re-center. nmap { "", "zz" } nmap { "", "zz" } - - -- Quicker macro playback. - nmap { "Q", "@qj" } - xmap { "Q", ":norm @q" } - - -- Automatically close brackets, parentheses and quotes. - imap { "'", "''" } - imap { "(", "()" } - imap { "/*", "/**/" } - imap { "<", "<>" } - imap { "[", "[]" } - imap { "[;", "[];" } - imap { "{", "{}" } - imap { "{;", "{};" } - imap { '"', '""' } end local function set_highlights() @@ -202,7 +168,6 @@ M.setup = function() set_vim_o() set_key_mappings() set_autocmd() - set_user_commands() set_filetypes() set_highlights()