mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2025-01-05 15:49:20 +00:00
60 lines
1.7 KiB
Lua
60 lines
1.7 KiB
Lua
local set = vim.keymap.set
|
|
local opts = {
|
|
silent = true,
|
|
}
|
|
local e_opts = {
|
|
silent = true,
|
|
expr = true,
|
|
}
|
|
|
|
-- cmd string
|
|
local function cmd(command)
|
|
return "<cmd>" .. command .. "<CR>"
|
|
end
|
|
|
|
--
|
|
|
|
set("", "<Space>", "<Nop>", opts)
|
|
vim.g.mapleader = " "
|
|
vim.g.maplocalleader = " "
|
|
|
|
--
|
|
|
|
set("n", "<C-k>", cmd("BufferLineCycleNext"), opts)
|
|
set("n", "<C-j>", cmd("BufferLineCyclePrev"), opts)
|
|
|
|
set("n", "<C-b>", cmd("Neotree"), opts)
|
|
|
|
-- Telescope
|
|
local custom_telescope = require("plugins.telescope")
|
|
local builtin_telescope = require("telescope.builtin")
|
|
set("n", "<C-p>", custom_telescope.custom_find_files, opts)
|
|
set("n", "<C-h>", custom_telescope.custom_find_hidden_files, opts)
|
|
set("n", "<C-f>", builtin_telescope.current_buffer_fuzzy_find, opts)
|
|
--
|
|
set("n", "<space>f", builtin_telescope.live_grep, opts)
|
|
set("n", "<space>s", builtin_telescope.lsp_document_symbols, opts)
|
|
set("n", "<space>d", builtin_telescope.lsp_definitions, opts)
|
|
set("n", "<space>r", builtin_telescope.lsp_references, opts)
|
|
|
|
-- LSP
|
|
set("n", "<space>h", vim.lsp.buf.hover, opts)
|
|
|
|
-- Focus
|
|
local focus = require("focus")
|
|
set("n", "L", focus.split_cycle, opts)
|
|
|
|
-- hlslens
|
|
local map = vim.api.nvim_set_keymap
|
|
local map_opts = {
|
|
noremap = true,
|
|
silent = true,
|
|
}
|
|
--
|
|
map("n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
|
map("n", "N", [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
|
map("n", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
|
map("n", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
|
--
|
|
map("x", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
|
map("x", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|