Added keybind custom/configs/set.lua

This commit is contained in:
ChrisHilborne 2023-10-21 20:30:09 +02:00
parent 39aca09d72
commit eeaa9e4cb4
8 changed files with 20 additions and 4 deletions

View File

@ -40,6 +40,8 @@ P.S. You can delete this when you're done too. It's your config now :)
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
require("custom")
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
@ -193,7 +195,7 @@ require('lazy').setup({
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
{ import = 'custom.plugins' },
{ import = 'plugins' },
}, {})
-- [[ Theme ]]
@ -367,12 +369,16 @@ require('nvim-treesitter.configs').setup {
},
}
-- Diagnostic keymaps
-- Diagnostic keymap
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', 'C-y', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
@ -395,7 +401,7 @@ local on_attach = function(_, bufnr)
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
nmap('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
@ -486,7 +492,7 @@ cmp.setup {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
['<C-y>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},

View File

@ -0,0 +1,9 @@
vim.opt.nu = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true

1
lua/custom/init.lua Normal file
View File

@ -0,0 +1 @@
require("custom.configs.set")