From 3198f2870c35f95a477cf5d07e33d4ea9fc64fb4 Mon Sep 17 00:00:00 2001 From: aliaksandrkotau Date: Mon, 1 Jan 2024 15:07:06 +0100 Subject: [PATCH] open terminal, but inside neovim now --- dummy_src/p.py | 1 + init.lua | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dummy_src/p.py b/dummy_src/p.py index 21ac9ada..54980e22 100644 --- a/dummy_src/p.py +++ b/dummy_src/p.py @@ -10,6 +10,7 @@ def f(x: int) -> str: d = f'Values {x=} {a=} {b=} {c=}' logging.error(d) logging.exception('FATAL!!!!!!!###!@#') + breakpoint() return d diff --git a/init.lua b/init.lua index 2d35c368..9ac9b78d 100644 --- a/init.lua +++ b/init.lua @@ -304,8 +304,8 @@ vim.o.smartcase = true vim.wo.signcolumn = 'yes' -- Decrease update time -vim.o.updatetime = 150 -vim.o.timeoutlen = 100 +vim.o.updatetime = 350 +vim.o.timeoutlen = 350 -- Set completeopt to have a better completion experience vim.o.completeopt = 'menuone,noselect' @@ -612,13 +612,24 @@ mason_lspconfig.setup_handlers { } -- [[ Configure nvim-cmp ]] --- See `:help cmp` +-- See `:help cmp` local cmp = require 'cmp' local luasnip = require 'luasnip' require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup {} cmp.setup { + enabled = function() + -- disable completion in comments + local context = require 'cmp.config.context' + -- keep command mode completion enabled when cursor is in a comment + if vim.api.nvim_get_mode().mode == 'c' then + return true + else + return not context.in_treesitter_capture("comment") + and not context.in_syntax_group("Comment") + end + end, snippet = { expand = function(args) luasnip.lsp_expand(args.body) @@ -707,6 +718,9 @@ vim.cmd [[ \ ['Open &Neotree', ':Neotree'], \ ['&Vertical split', ':vsp'], \ ['Ho&rizontal split', ':sp'], + \ ['--', ''], + \ ['Open &Terminal Right', ':botright vnew | terminal'], + \ ['Open Terminal &Down', ':belowright new | terminal'], \ ]) ]] vim.cmd [[ @@ -763,7 +777,7 @@ vim.keymap.set('n', 'ds', function() end) -- Start Neovim in insert mode by default -vim.cmd[[autocmd VimEnter * startinsert]] +-- vim.cmd[[autocmd VimEnter * startinsert]] -- Map to toggle between normal and insert mode vim.api.nvim_set_keymap('n', '', ':startinsert', { noremap = true, silent = true }) vim.api.nvim_set_keymap('i', '', ':stopinsert', { noremap = true, silent = true })