diff options
Diffstat (limited to '')
| -rw-r--r-- | lua/pml68/configs/cmp.lua | 21 | ||||
| -rw-r--r-- | lua/pml68/configs/lspconfig.lua | 1 | ||||
| -rw-r--r-- | lua/pml68/configs/settings/lua_ls.lua | 24 | ||||
| -rw-r--r-- | lua/pml68/configs/toggleterm.lua | 15 |
4 files changed, 48 insertions, 13 deletions
diff --git a/lua/pml68/configs/cmp.lua b/lua/pml68/configs/cmp.lua new file mode 100644 index 0000000..ff69651 --- /dev/null +++ b/lua/pml68/configs/cmp.lua @@ -0,0 +1,21 @@ +local cmp = require("cmp") + +cmp.setup({ + sources = { + {name = 'nvim_lsp'}, + }, + preselect = 'item', + completion = { + completeopt = 'menu,menuone,noinsert' + }, + mapping = cmp.mapping.preset.insert({ + ['<CR>'] = cmp.mapping.confirm({select = false}), + ['<S-Tab>'] = cmp.mapping.select_prev_item({behavior = 'select'}), + ['<Tab>'] = cmp.mapping.select_next_item({behavior = 'select'}), + }), + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, +}) diff --git a/lua/pml68/configs/lspconfig.lua b/lua/pml68/configs/lspconfig.lua index 12aacf8..40badc3 100644 --- a/lua/pml68/configs/lspconfig.lua +++ b/lua/pml68/configs/lspconfig.lua @@ -1,5 +1,4 @@ local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require("lspconfig") local servers = { diff --git a/lua/pml68/configs/settings/lua_ls.lua b/lua/pml68/configs/settings/lua_ls.lua index 7db368c..de4124c 100644 --- a/lua/pml68/configs/settings/lua_ls.lua +++ b/lua/pml68/configs/settings/lua_ls.lua @@ -2,18 +2,18 @@ return { settings = { Lua = { diagnostics = { - globals = { "vim " }, - }, - workspace = { - library = { - [vim.fn.expand "$VIMRUNTIME/lua"] = true, - [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, - [vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true, - [vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true, - }, - maxPreload = 100000, - preloadFileSize = 10000, - } + globals = { "vim " }, + }, + workspace = { + library = { + [vim.fn.expand "$VIMRUNTIME/lua"] = true, + [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true, + [vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true, + [vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true, + }, + maxPreload = 100000, + preloadFileSize = 10000, + } } } } diff --git a/lua/pml68/configs/toggleterm.lua b/lua/pml68/configs/toggleterm.lua new file mode 100644 index 0000000..6bf4f14 --- /dev/null +++ b/lua/pml68/configs/toggleterm.lua @@ -0,0 +1,15 @@ +local Terminal = require('toggleterm.terminal').Terminal +local lazygit = Terminal:new({ + cmd = "lazygit", + hidden = true, + direction = "float", + float_opts = { + border = "double", + }, +}) + +function _lazygit_toggle() + lazygit:toggle() +end + +vim.keymap.set("n", "<leader>g", "<cmd> lua _lazygit_toggle() <CR>", {noremap = true, silent = true}) |
