From b2fd5f73e23c166df06e462c4356ade6f00790e4 Mon Sep 17 00:00:00 2001 From: alice-vu-163 Date: Tue, 6 May 2025 17:14:31 +0700 Subject: [PATCH] improve terminal keymap and lsp config --- init.lua | 1 - lua/custom/keymaps/init.lua | 3 +++ lua/custom/plugins/init.lua | 17 +++++++++++++++++ lua/custom/setups/init.lua | 3 --- lua/custom/setups/lsp.lua | 12 ------------ lua/custom/setups/term.lua | 10 ---------- 6 files changed, 20 insertions(+), 26 deletions(-) delete mode 100644 lua/custom/setups/init.lua delete mode 100644 lua/custom/setups/lsp.lua delete mode 100644 lua/custom/setups/term.lua diff --git a/init.lua b/init.lua index 43c2b3e6..a6c33d46 100644 --- a/init.lua +++ b/init.lua @@ -1027,7 +1027,6 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. { import = 'custom.plugins' }, { import = 'custom.keymaps' }, - { import = 'custom.setups' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/keymaps/init.lua b/lua/custom/keymaps/init.lua index fdf3e770..a21e568a 100644 --- a/lua/custom/keymaps/init.lua +++ b/lua/custom/keymaps/init.lua @@ -40,4 +40,7 @@ vim.keymap.set('n', 'bd', function() vim.cmd 'bdelete!' end, { desc = 'Close buffer and toggleterm' }) +vim.keymap.set('n', '/', require('telescope.builtin').current_buffer_fuzzy_find, { desc = '[/] Fuzzy search in current buffer' }) +vim.keymap.set('t', '', [[]], { desc = 'Exit terminal mode' }) + return {} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 07c6febe..0dd93034 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -3,6 +3,23 @@ -- -- See the kickstart.nvim README for more information return { + { + 'akinsho/toggleterm.nvim', + version = '*', + config = function() + require('toggleterm').setup { + direction = 'float', + float_opts = { + border = 'curved', + width = 100, + height = 30, + winblend = 0, + }, + open_mapping = [[]], + start_in_insert = true, + } + end, + }, { 'folke/tokyonight.nvim', lazy = false, diff --git a/lua/custom/setups/init.lua b/lua/custom/setups/init.lua deleted file mode 100644 index b2739e64..00000000 --- a/lua/custom/setups/init.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Then load your custom setup scripts -require 'custom.setups.lsp' -require 'custom.setups.term' diff --git a/lua/custom/setups/lsp.lua b/lua/custom/setups/lsp.lua deleted file mode 100644 index c08a2e9a..00000000 --- a/lua/custom/setups/lsp.lua +++ /dev/null @@ -1,12 +0,0 @@ -require('lspconfig').pyright.setup { - settings = { - python = { - analysis = { - typeCheckingMode = 'off', -- disables type checking - diagnosticMode = 'openFilesOnly', -- optional: only analyze open files - autoSearchPaths = true, - useLibraryCodeForTypes = true, - }, - }, - }, -} diff --git a/lua/custom/setups/term.lua b/lua/custom/setups/term.lua deleted file mode 100644 index e4580f53..00000000 --- a/lua/custom/setups/term.lua +++ /dev/null @@ -1,10 +0,0 @@ -require('toggleterm').setup { - direction = 'float', - float_opts = { - border = 'curved', - width = 100, - height = 30, - winblend = 0, -- optional: transparency - -- Omit row/col so it's automatically centered - }, -}