feat(kauffinger/lazyvim): new config with my own from kauffinger/lazyvim
This commit is contained in:
51
lua/config/keymaps.lua
Normal file
51
lua/config/keymaps.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
local keys = require("lazy.core.handler").handlers.keys
|
||||
---@cast keys LazyKeysHandler
|
||||
-- do not create the keymap if a lazy keys handler exists
|
||||
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
|
||||
opts = opts or {}
|
||||
opts.silent = opts.silent ~= false
|
||||
vim.keymap.set(mode, lhs, rhs, opts)
|
||||
end
|
||||
end
|
||||
|
||||
map("n", "<leader>gd", function()
|
||||
Util.float_term(
|
||||
{ "lazydocker", "-f", Util.get_root() .. "docker-compose.yml" },
|
||||
{ cwd = Util.get_root(), esc_esc = false }
|
||||
)
|
||||
end, { desc = "LazyDocker (root dir)" })
|
||||
|
||||
local bind = vim.keymap.set
|
||||
local opts = { silent = true, noremap = true }
|
||||
|
||||
-- for russian layout
|
||||
bind("i", "<c-х>", "<C-[>", opts)
|
||||
bind("n", "л", "gk", opts)
|
||||
bind("n", "о", "gj", opts)
|
||||
bind("i", "<C-г>", "<C-G>u<C-U>", opts)
|
||||
bind("i", "<C-ц>", "<C-G>u<C-W>", opts)
|
||||
|
||||
bind("n", "[c", function()
|
||||
require("treesitter-context").go_to_context()
|
||||
end)
|
||||
|
||||
--personal
|
||||
--normal mode
|
||||
bind("i", "jk", "<Esc>")
|
||||
--save
|
||||
bind("n", "zz", "<Cmd>:update<CR>")
|
||||
|
||||
bind("n", ",<space>", "<Cmd>:nohlsearch<CR>")
|
||||
|
||||
-- namespace php
|
||||
vim.keymap.set("n", "<leader>u", "<cmd>GetClass<cr>")
|
||||
vim.keymap.set("n", "<leader>un", "<cmd>Namespace<cr>")
|
||||
|
||||
vim.keymap.set("n", "<leader>[", "<Cmd>call append(line('.') - 1, repeat([''], v:count1))<CR>")
|
||||
vim.keymap.set("n", "<leader>]", "<Cmd>call append(line('.'), repeat([''], v:count1))<CR>")
|
||||
Reference in New Issue
Block a user