From eeaa9e4cb4c888b669f99ca46c0c74519dc415a7 Mon Sep 17 00:00:00 2001 From: ChrisHilborne Date: Sat, 21 Oct 2023 20:30:09 +0200 Subject: [PATCH] Added keybind custom/configs/set.lua --- init.lua | 14 ++++++++++---- lua/custom/configs/set.lua | 9 +++++++++ lua/custom/init.lua | 1 + lua/{custom => }/plugins/autoformat.lua | 0 lua/{custom => }/plugins/debug.lua | 0 lua/{custom => }/plugins/nvim-tree.lua | 0 lua/{custom => }/plugins/themes.lua | 0 lua/{custom => }/plugins/util.lua | 0 8 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 lua/custom/configs/set.lua create mode 100644 lua/custom/init.lua rename lua/{custom => }/plugins/autoformat.lua (100%) rename lua/{custom => }/plugins/debug.lua (100%) rename lua/{custom => }/plugins/nvim-tree.lua (100%) rename lua/{custom => }/plugins/themes.lua (100%) rename lua/{custom => }/plugins/util.lua (100%) diff --git a/init.lua b/init.lua index b68f27a7..60f03c6e 100644 --- a/init.lua +++ b/init.lua @@ -40,6 +40,8 @@ P.S. You can delete this when you're done too. It's your config now :) -- Set 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', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', '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('D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') @@ -486,7 +492,7 @@ cmp.setup { [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { + [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = true, }, diff --git a/lua/custom/configs/set.lua b/lua/custom/configs/set.lua new file mode 100644 index 00000000..d1ffe60c --- /dev/null +++ b/lua/custom/configs/set.lua @@ -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 diff --git a/lua/custom/init.lua b/lua/custom/init.lua new file mode 100644 index 00000000..b29be39a --- /dev/null +++ b/lua/custom/init.lua @@ -0,0 +1 @@ +require("custom.configs.set") diff --git a/lua/custom/plugins/autoformat.lua b/lua/plugins/autoformat.lua similarity index 100% rename from lua/custom/plugins/autoformat.lua rename to lua/plugins/autoformat.lua diff --git a/lua/custom/plugins/debug.lua b/lua/plugins/debug.lua similarity index 100% rename from lua/custom/plugins/debug.lua rename to lua/plugins/debug.lua diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua similarity index 100% rename from lua/custom/plugins/nvim-tree.lua rename to lua/plugins/nvim-tree.lua diff --git a/lua/custom/plugins/themes.lua b/lua/plugins/themes.lua similarity index 100% rename from lua/custom/plugins/themes.lua rename to lua/plugins/themes.lua diff --git a/lua/custom/plugins/util.lua b/lua/plugins/util.lua similarity index 100% rename from lua/custom/plugins/util.lua rename to lua/plugins/util.lua