diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua index f66cff1..1e9c594 100644 --- a/neovim/.config/nvim/init.lua +++ b/neovim/.config/nvim/init.lua @@ -1,9 +1,9 @@ require('plugins') require('visuals') require('handling') -require('completion') require('development') require('keybindings') +require('completion') vim.opt.tabstop = 2 vim.opt.shiftwidth = 2 diff --git a/neovim/.config/nvim/lua/completion.lua b/neovim/.config/nvim/lua/completion.lua index e05a05c..cbfea3e 100644 --- a/neovim/.config/nvim/lua/completion.lua +++ b/neovim/.config/nvim/lua/completion.lua @@ -1,26 +1,29 @@ local cmp = require("cmp") cmp.setup({ snippet = { - -- REQUIRED - you must specify a snippet engine expand = function(args) require('luasnip').lsp_expand(args.body) -- For `luasnip` users. end, }, window = { - -- completion = cmp.config.window.bordered(), - -- documentation = cmp.config.window.bordered(), + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace }), }), sources = cmp.config.sources({ { name = 'copilot', group_index = 2 }, { name = 'nvim_lsp', group_index = 2 }, - }, { + { name = 'luasnip', group_index = 2 }, + },{ { name = 'buffer' }, }) }) + +require('copilot').setup() +require('copilot_cmp').setup() diff --git a/neovim/.config/nvim/lua/development.lua b/neovim/.config/nvim/lua/development.lua index 8db13d8..975d8f3 100644 --- a/neovim/.config/nvim/lua/development.lua +++ b/neovim/.config/nvim/lua/development.lua @@ -1,9 +1,10 @@ local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) +capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) -require'lspconfig'.pyright.setup{ +require('lspconfig').pyright.setup{ capabilities = capabilities, } +require('lspconfig').tsserver.setup {} require('dap-python').setup('~/.local/share/virtualenvs/debugpy/bin/python') require('dap-python').test_runner = 'pytest' @@ -58,3 +59,37 @@ require("coverage").setup({ -- customize language specific settings }, }) +require("rest-nvim").setup({ + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Keep the http file buffer above|left when split horizontal|vertical + result_split_in_place = true, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Encode URL before making request + encode_url = true, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + show_http_info = true, + show_headers = true, + -- executables or functions for formatting response body [optional] + -- set them to false if you want to disable them + formatters = { + json = "jq", + html = function(body) + return vim.fn.system({"tidy", "-i", "-q", "-"}, body) + end + }, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = '.env', + custom_dynamic_variables = {}, + yank_dry_run = true, +}) diff --git a/neovim/.config/nvim/lua/handling.lua b/neovim/.config/nvim/lua/handling.lua index 7d01bb0..f05ebfd 100644 --- a/neovim/.config/nvim/lua/handling.lua +++ b/neovim/.config/nvim/lua/handling.lua @@ -2,8 +2,8 @@ require('leap').set_default_keymaps() require('litee.lib').setup() require('litee.gh').setup() -require("toggleterm").setup{ +require("toggleterm").setup { size = 60, - direction = 'vertical', + direction = 'horizontal', } diff --git a/neovim/.config/nvim/lua/keybindings.lua b/neovim/.config/nvim/lua/keybindings.lua index 51367df..eb9ae23 100644 --- a/neovim/.config/nvim/lua/keybindings.lua +++ b/neovim/.config/nvim/lua/keybindings.lua @@ -13,7 +13,7 @@ vim.api.nvim_set_keymap('n', '', --TESTING vim.api.nvim_set_keymap('n', '', - "lua require('neotest').output.open()", + "lua require('neotest').output.open({enter=true, auto_close=true})", { noremap = true, silent = true } ) vim.api.nvim_set_keymap('n', '', @@ -44,6 +44,11 @@ vim.api.nvim_set_keymap('n', '', "lua require('coverage').toggle()", { noremap = true, silent = true } ) +vim.api.nvim_set_keymap('n', '', + "RestNvim", + { noremap = true, silent = true } +) + --DEBUGGING @@ -55,7 +60,7 @@ vim.api.nvim_set_keymap('n', '', "lua require('dapui').toggle()", { noremap = true, silent = true } ) -vim.api.nvim_set_keymap('n', '', +vim.api.nvim_set_keymap('n', '', "lua require('dap').continue()", { noremap = true, silent = true } ) @@ -87,7 +92,7 @@ vim.keymap.set("n", "", "TroubleToggle document_diagnostics", --TERMINAL BINDINGS -vim.api.nvim_set_keymap('n', '', "ToggleTerm", { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', "ToggleTerm size=60", { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', "ToggleTermToggleAll", { noremap = true, silent = true }) vim.api.nvim_set_keymap('t', '', "ToggleTermToggleAll", { noremap = true, silent = true }) vim.keymap.set('t', '', "", @@ -101,6 +106,10 @@ vim.api.nvim_set_keymap('t', '', "wincmd l", { noremap = true, sil -- WHICH KEY local wk = require("which-key") wk.register({ + b = { + name = "+Buffer", + c = { "w | %bd | e#", "Close All But this Buffer" } + }, g = { name = "+Git", h = { diff --git a/neovim/.config/nvim/lua/plugins.lua b/neovim/.config/nvim/lua/plugins.lua index 40550ae..77014a9 100644 --- a/neovim/.config/nvim/lua/plugins.lua +++ b/neovim/.config/nvim/lua/plugins.lua @@ -23,7 +23,7 @@ return require('packer').startup(function(use) -- Handling use { - 'nvim-telescope/telescope.nvim', tag = '0.1.0', + 'nvim-telescope/telescope.nvim', tag = '0.1.1', requires = { {'nvim-lua/plenary.nvim'} } } use 'ggandor/leap.nvim' @@ -41,33 +41,15 @@ return require('packer').startup(function(use) } end } - use { - "akinsho/toggleterm.nvim", - config = function() - require("toggleterm").setup{ - size = 20, - direction = 'vertical', - } - end - } + use 'akinsho/toggleterm.nvim' -- Completion use 'github/copilot.vim' use 'hrsh7th/nvim-cmp' use 'L3MON4D3/LuaSnip' - use { - "zbirenbaum/copilot.lua", - event = {"VimEnter"}, - config = function() - vim.defer_fn(function() - require("copilot").setup() - end, 100) - end, - } - use { - "zbirenbaum/copilot-cmp", - module = "copilot_cmp", - } + use 'saadparwaiz1/cmp_luasnip' + use 'zbirenbaum/copilot.lua' + use 'zbirenbaum/copilot-cmp' use 'hrsh7th/cmp-nvim-lsp' -- Development @@ -76,6 +58,10 @@ return require('packer').startup(function(use) use 'mfussenegger/nvim-dap-python' use 'rcarriga/nvim-dap-ui' use 'theHamsta/nvim-dap-virtual-text' + use { + 'rest-nvim/rest.nvim', + requires = {'nvim-lua/plenary.nvim'} + } use { "nvim-neotest/neotest", requires = { @@ -89,8 +75,5 @@ return require('packer').startup(function(use) use({ "andythigpen/nvim-coverage", requires = "nvim-lua/plenary.nvim", --- config = function() --- require("user.coverage") --- end, }) end) diff --git a/neovim/.config/nvim/lua/visuals.lua b/neovim/.config/nvim/lua/visuals.lua index 4b2f0d3..fd3727e 100644 --- a/neovim/.config/nvim/lua/visuals.lua +++ b/neovim/.config/nvim/lua/visuals.lua @@ -1,10 +1,10 @@ vim.opt.termguicolors = true -vim.cmd[[colorscheme iceberg]] +--vim.cmd[[colorscheme iceberg]] require('lualine').setup { options = { icons_enabled = true, - theme = 'iceberg_dark', +-- theme = 'iceberg_dark', component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, disabled_filetypes = {