From 7f30d31c9142bbeb10a21b4de9f58bc6d3a0a3f1 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 26 Oct 2022 00:00:35 +0200 Subject: Removed unnecessary files --- lua/user/keys.lua | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'lua/user/keys.lua') diff --git a/lua/user/keys.lua b/lua/user/keys.lua index bc1f874..8beb6d3 100644 --- a/lua/user/keys.lua +++ b/lua/user/keys.lua @@ -26,7 +26,14 @@ vim.g.mapleader = ";" --vim.g.maplocalleader = ";" -- "jj" to exit insert-mode -map("i", "kk", "") +map("i", "jk", "") + +map("n", "m", ":messages") + +-- Print last error message or use these commands | v:errmsgv | :statusmsg | :h execute() | +--nnoremap x :put =trim(execute(input(':', '', 'command'))) +-- Press x, then enter your command, such as 5mess and press . The last five message lines will be added to the current buffer. +-- useful to copy error message when vim start -- save quickly --map("n", ";w", ":w", d("Save buffer")) @@ -38,8 +45,33 @@ map("i", "kk", "") --nnoremap so :source $my_vimrc --]]) +-- Toggle between folds +--utils.map("n", "", "&foldlevel ? 'zM' : 'zR'", { expr = true }) + +-- Move to the next and previous item in the quickfixlist +--utils.map("n", "]c", "cnext") +--utils.map("n", "[c", "cprevious") + +-- Use space to toggle fold +--utils.map("n", "", "za") + +-- Hitting ESC when inside a terminal to get into normal mode +--utils.map("t", "", [[]]) + +-- select last change +--nnoremap gV `[v`] + + +--map("n", "", ":runtime! /lua/plugins/*.lua | :runtime! /lua/user/*.lua | :luafile ~/.config/nvim/init.lua", print ("Nvim reloaded")) +--map("n", "", ":lua require('init').unload_lua_namespace()", print ("Nvim reloaded")) +--map("n", "", "luafile ~/.config/nvim/init.lua", vim.notify("Nvim configuration reloaded!", vim.log.levels.INFO)) +--map("n", "", "luafile ~/.config/nvim/init.lua | :lua require("notify")("completion off")") +--map("n", "", "luafile ~/.config/nvim/init.lua", vim.api.nvim_echo({{'first chunk and ', 'None'}, {'second chunk to echo', 'None'}}, false, {})) +--map("n", "", "luafile ~/.config/nvim/init.lua", print ("Nvim config loading...")) +--map("n", "", "luafile ~/.config/nvim/init.lua | :echo ('hello') | ") +map("n", "", "luafile ~/.config/nvim/init.lua | :echom ('Nvim config loading...') | :sl! | echo ('')") +--map("n", "", "luafile ~/.config/nvim/init.lua") --vim.api.nvim_set_keymap("n", "", "lua ReloadConfig()", { noremap = true, silent = false }) -map("n", "", "luafile ~/.config/nvim/init.lua", print ("Nvim configuration reloaded")) map("n", "tc", ":lua require('user.utils').toggle_completion()") -- vim.notify("Nvim configuration reloaded!", vim.log.levels.INFO) @@ -169,6 +201,39 @@ map("v", "p", '"_dP') -- visual mode to select text to swap with map("v", "", "`.``gvP``P") +-- Keep Visual mode selection when indenting text +--utils.map("x", ">", ">gv") +--utils.map("x", "<", "/", ":/\\<\\>", { silent = false }) + +-- EasyAlign keybindings +-- 'vipga' starts interactive EasyAlign in visual mode +-- 'gaip' starts interactive EasyAlign for text/motion object +--utils.map({ "n", "x" }, "ga", "(EasyAlign)") +--utils.map({ "n", "x" }, "ga", "(LiveEasyAlign)") + +-- Set a mark when moving more than 5 lines upwards/downards +-- this will populate the jumplist enabling us to jump back with Ctrl-O +--utils.map("n", "k", [[(v:count > 5 ? "m'" . v:count : "") . 'k']], { expr = true }) +--utils.map("n", "j", [[(v:count > 5 ? "m'" . v:count : "") . 'j']], { expr = true }) + +-- Zoom toggle a buffer in a new tab +--utils.map("n", "z", function() +-- require("tt.helper").zoomToggleNewTab() +--end, { desc = "Zoom toggle a buffer in a new tab" }) + +-- Hitting ESC when inside a terminal to get into normal mode +--utils.map("t", "", [[]]) + + + + -- Search and replace map("v", "sr", 'y:%s/"//gc') --vnoremap ; :call Get_visual_selection() -- cgit v1.2.3