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