update nvim config

This commit is contained in:
LordMZTE 2022-10-22 00:38:18 +02:00
parent 4f6fa9e0be
commit f3f5b24d61
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
3 changed files with 26 additions and 26 deletions

View file

@ -1,21 +1,29 @@
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
-- Getting stuck in ~~vim~~ terminal
map("t", "<Esc>", "<C-\\><C-n>", {})
-- telescope
map("n", "ff", "<cmd>Telescope find_files<cr>", { silent = true })
map("n", "fg", "<cmd>Telescope live_grep<cr>", { silent = true })
-- Quick cursor movement
map("n", "<C-Down>", "5j", { noremap = true })
map("n", "<C-Up>", "5k", { noremap = true })
map("n", "<C-Down>", "5j", opts)
map("n", "<C-Up>", "5k", opts)
-- Quick pasting/yoinking to system register
map("n", "+y", '"+y', { noremap = true })
map("n", "+p", '"+p', { noremap = true })
map("n", "+d", '"+d', { noremap = true })
map("n", "+y", '"+y', opts)
map("n", "+p", '"+p', opts)
map("n", "+d", '"+d', opts)
map("n", "*y", '"*y', { noremap = true })
map("n", "*p", '"*p', { noremap = true })
map("n", "*d", '"*d', { noremap = true })
map("n", "*y", '"*y', opts)
map("n", "*p", '"*p', opts)
map("n", "*d", '"*d', opts)
-- See `:help vim.lsp.*` for documentation on any of the below functions
map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
map("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
map("n", "-n", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
map("n", "-a", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
map("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
map("n", "-d", "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
map("n", "-r", "<cmd>lua vim.lsp.buf.format { asnyc = true }<CR>", opts)

View file

@ -1,6 +1,5 @@
local map = vim.api.nvim_set_keymap
local lspc = require "lspconfig"
local caps = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local lua_runtime_path = vim.split(package.path, ";")
@ -49,16 +48,3 @@ lspc.taplo.setup { capabilities = caps }
lspc.yamlls.setup { capabilities = caps }
lspc.zls.setup { capabilities = caps }
-- Mappings.
local opts = { noremap = true, silent = true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
map("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
map("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
map("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
map("n", "-n", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
map("n", "-a", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
map("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
map("n", "-d", "<cmd>lua vim.diagnostic.goto_next()<CR>", opts)
map("n", "-r", "<cmd>lua vim.lsp.buf.format { asnyc = true }<CR>", opts)

View file

@ -1,3 +1,5 @@
local map = vim.api.nvim_set_keymap
require("telescope").setup {
defaults = {
vimgrep_arguments = {
@ -26,3 +28,7 @@ require("telescope").setup {
}
require("telescope").load_extension "ui-select"
map("n", "ff", "<cmd>Telescope find_files<cr>", { silent = true })
map("n", "fg", "<cmd>Telescope live_grep<cr>", { silent = true })
map("n", "gs", "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", { silent = true })