diff --git a/conf.d/lvim/config.lua b/conf.d/lvim/config.lua index ca7350c..a6b07ef 100644 --- a/conf.d/lvim/config.lua +++ b/conf.d/lvim/config.lua @@ -40,7 +40,7 @@ lvim.builtin.nvimtree.active = false lvim.builtin.nvimtree.setup.view.side = "left" lvim.builtin.nvimtree.setup.renderer.icons.show.git = false lvim.builtin.terminal.active = true - +-- lvim.builtin.terminal.execs[#lvim.builtin.terminal.execs+1] = { "xplr", ";e", "File manager", "float", nil } -- theme settings @@ -61,13 +61,13 @@ local home = vim.fn.expand("$HOME") -- Trying to make a modular configuration -- plugins -- --- require("user.plugins") +require("user.plugins").setup() --- -- functions --- -- --- require("user.functions") +-- functions +-- +require("user.functions") @@ -93,6 +93,7 @@ require("user.whichkey").setup() lvim.builtin.treesitter.ensure_installed = { "bash", "c", + "go", "java", "javascript", "json", @@ -112,28 +113,15 @@ lvim.builtin.treesitter.ensure_installed = { lvim.builtin.treesitter.ignore_install = { "comment" } lvim.builtin.treesitter.highlight.enable = true -lvim.builtin.treesitter.highlight.disable( "latex" ) +lvim.builtin.treesitter.highlight.disable( "latex", "zsh" ) lvim.builtin.treesitter.rainbow.enable = true --- Generic LSP settings +-- LSP settings -- -vim.diagnostic.config({ virtual_text = true }) - --- setup LSP -local capabilities = require("lvim.lsp").common_capabilities() -require("lvim.lsp.manager").setup( - "texlab", { - on_attach = require("lvim.lsp").common_on_attach, - on_init = require("lvim.lsp").common_on_init, - capabilities = capabilities, -}) - -require("lvim.lsp.manager").setup( - "marksman", { -}) +require("user.lsp").setup() @@ -145,303 +133,17 @@ require("lvim.lsp.manager").setup( --- Python management setup +-- Debug adapters -- --- setup debug adapter -lvim.builtin.dap.active = true -local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/") -pcall(function() - require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python") -end) - --- setup testing -require("neotest").setup({ - adapters = { - require("neotest-python")({ - -- Extra arguments for nvim-dap configuration - -- See https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for values - dap = { - justMyCode = false, - console = "integratedTerminal", - }, - args = { "--log-level", "DEBUG", "--quiet" }, - runner = "pytest", - }) - } -}) +require("user.dap").setup() --- Additional Plugins +-- Tests framework -- -lvim.plugins = { - -- addheader - { - 'alpertuna/vim-header', - config = function() - vim.cmd([[ - let g:header_field_author = 'Jeff Lance' - let g:header_field_author_email = 'email@jefflance.me' - let g:header_auto_update_header = 1 - let g:header_field_filename_path = 1 - let g:header_field_timestamp_format = '%d.%m.%Y %H:%M:%S' - ]]) - end, - }, - -- new file plugin - { - 'Mohammed-Taher/AdvancedNewFile.nvim', - }, - -- asyncrun - { - "skywind3000/asyncrun.vim", - }, - -- chatgpt - { - "jackMort/ChatGPT.nvim", - event = "VeryLazy", - config = function() - require("chatgpt").setup({ - api_key_cmd = "pass _api_keys/openai_perso-1" - }) - end, - dependencies = { - "MunifTanjim/nui.nvim", - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim" - } - }, - -- cmp addons - { - "tzachar/cmp-tabnine", - build = "./install.sh", - dependencies = "hrsh7th/nvim-cmp", - event = "InsertEnter", - }, - { - "micangl/cmp-vimtex", - dependencies = "hrsh7th/nvim-cmp", - }, - -- colorschemes - { - 'Abstract-IDE/Abstract-cs', - }, - { - 'ishan9299/modus-theme-vim', - }, - { - 'NLKNguyen/papercolor-theme', - }, - { - 'olimorris/onedarkpro.nvim', - priority = 1000, - config = function() - require("onedarkpro").setup({ - colors = { - onedark = { - bg = "#000000" -- black - }, - onelight = { - bg = "#FFFFFF" -- white - }, - -- cursorline = "#FF0000", - }, - styles = { - types = "NONE", - methods = "NONE", - numbers = "NONE", - strings = "NONE", - comments = "italic", - keywords = "bold,italic", - constants = "NONE", - functions = "italic", - operators = "NONE", - variables = "NONE", - parameters = "NONE", - conditionals = "italic", - virtual_text = "NONE", - }, - options = { - cursorline = true, - transparency = true, - } - }) - end - }, - -- gitignore - { - 'jefflance/vim-gitignore', - }, - -- languagetool - { - 'dpelle/vim-grammalecte', - config = function () - vim.cmd([[ - let g:grammalecte_cli_py = '/usr/bin/grammalecte-cli' - ]]) - end - }, - -- markdown previewer - { - 'iamcco/markdown-preview.nvim', - build = "cd app && npm install", - ft = "markdown", - config = function() - vim.cmd([[ - let g:mkdp_auto_start = 1 - ]]) - end, - }, - -- minimap - { - 'echasnovski/mini.map', - branch = "stable", - config = function() - require('mini.map').setup() - local map = require('mini.map') - map.setup({ - integrations = { - map.gen_integration.builtin_search(), - map.gen_integration.diagnostic({ - error = 'DiagnosticFloatingError', - warn = 'DiagnosticFloatingWarn', - info = 'DiagnosticFloatingInfo', - hint = 'DiagnosticFloatingHint', - }), - }, - symbols = { - encode = map.gen_encode_symbols.dot('2x1'), - }, - window = { - side = 'right', - width = 20, -- set to 1 for a pure scrollbar :) - winblend = 15, - show_integration_count = false, - }, - }) - end - }, - -- neoscroll: smooth scrolling - { - "karb94/neoscroll.nvim", - event = "WinScrolled", - config = function() - require('neoscroll').setup({ - -- All these keys will be mapped to their corresponding default scrolling animation - mappings = { '', '', '', '', - '', '', 'zt', 'zz', 'zb' }, - hide_cursor = true, -- Hide cursor while scrolling - stop_eof = true, -- Stop at when scrolling downwards - use_local_scrolloff = false, -- Use the local scope of scrolloff instead of the global scope - respect_scrolloff = false, -- Stop scrolling when the cursor reaches the scrolloff margin of the file - cursor_scrolls_alone = true, -- The cursor will keep on scrolling even if the window cannot scroll further - easing_function = nil, -- Default easing function - pre_hook = nil, -- Function to run before the scrolling animation starts - post_hook = nil, -- Function to run after the scrolling animation ends - }) - end - }, - -- zk: a plain text note-taking assistant - { - 'mickael-menu/zk-nvim', - config = function() - require("zk").setup({ - }) - end, - }, - -- nvim-ts-rainbow: rainbowed parenthesis - { - "mrjones2014/nvim-ts-rainbow", - }, - -- colorizer: color highlighter - { - 'norcalli/nvim-colorizer.lua', - config = function() - require("colorizer").setup({ '*' }, { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - RRGGBBAA = true, -- #RRGGBBAA hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - mode = 'background', - }) - end, - }, - { - "kevinhwang91/rnvimr", - cmd = "RnvimrToggle", - config = function() - vim.cmd([[ - let g:rnvimr_draw_border = 1 - let g:rnvimr_pick_enable = 1 - let g:rnvimr_bw_enable = 1 - ]]) - end, - }, - -- suda - { - 'lambdalisue/suda.vim', - config = function() - vim.cmd([[ - let g:prompt = 'Mot de passe: ' - let g:suda_smart_edit = 1 - ]]) - end, - }, - -- trouble - { - 'folke/trouble.nvim', - cmd = "TroubleToggle", - }, - -- vim-repeat: enable repeating supported plugin maps with "." - { - "tpope/vim-repeat" - }, - -- vim-surround - { - 'tpope/vim-surround', - config = function() - vim.cmd([[ - let timeoutlen = 500 - ]]) - end, - }, - -- LaTeX management needed plugins - { - "lervag/vimtex", - config = function() - vim.cmd([[ - let g:vimtex_view_method = "zathura" - let g:vimtex_quickfix_enabled = 0 - let g:vimtex_compiler_method = 'latexmk' - let g:vimtex_view_use_temp_files = 0 - ]]) - end, - }, - { - "KeitaNakamura/tex-conceal.vim" - }, - -- Python management needed plugins - { - "ChristianChiarulli/swenv.nvim" - }, - { - "stevearc/dressing.nvim" - }, - { - "mfussenegger/nvim-dap-python" - }, - { - "nvim-neotest/neotest" - }, - { - "nvim-neotest/neotest-python" - }, -} +require("user.tests").setup() diff --git a/conf.d/lvim/ftdetect/arduino.vim b/conf.d/lvim/ftdetect/arduino.vim index 59bf48c..ed45cf5 100644 --- a/conf.d/lvim/ftdetect/arduino.vim +++ b/conf.d/lvim/ftdetect/arduino.vim @@ -1 +1,3 @@ +" Vim filetype detection file +" Language: arduino au BufRead,BufNewFile *.ino,*.pde set filetype=arduino diff --git a/conf.d/lvim/ftdetect/asy.vim b/conf.d/lvim/ftdetect/asy.vim index ea8af9a..9236d9d 100644 --- a/conf.d/lvim/ftdetect/asy.vim +++ b/conf.d/lvim/ftdetect/asy.vim @@ -1,3 +1,3 @@ " Vim filetype detection file -" Language: Asymptote -au BufNewFile,BufRead *.asy setfiletype asy +" Language: asymptote +au BufNewFile,BufRead *.asy set filetype=asy diff --git a/conf.d/lvim/ftdetect/term.vim b/conf.d/lvim/ftdetect/term.vim new file mode 100644 index 0000000..de6a9f3 --- /dev/null +++ b/conf.d/lvim/ftdetect/term.vim @@ -0,0 +1,3 @@ +" Vim filetype detection file +" Type: terminal +au TermOpen term://* set filetype=term diff --git a/conf.d/lvim/ftplugin/tex.lua b/conf.d/lvim/ftplugin/tex.lua index 277ab32..ed93ab6 100644 --- a/conf.d/lvim/ftplugin/tex.lua +++ b/conf.d/lvim/ftplugin/tex.lua @@ -33,25 +33,25 @@ whk.register { whk.register { [""] = { -- to set a completly new using only the localleader key - name = " LaTeX", + name = "LaTeX", c = { "VimtexCompileSS", "Single-shot compile project" }, C = { - name = " Compile", + name = "Compile", s = { "VimtexStop", "Stop compile" }, c = { "VimtexCompileSelected", "Compile Selected" }, }, d = { "VimtexDocPackage", "Open Doc for package" }, e = { "VimtexErrors", "Look at the errors" }, - m = { "VimtexToggleMain", "Toggle Main" }, + m = { 'VimtexToggleMain let @+ = expand("%:t")', "Toggle Main" }, o = { "VimtexView", "View pdf" }, s = { "VimtexStatus", "Look at the status" }, T = { - name = " TOC", + name = "TOC", o = { "VimtexTocOpen", "Open TOC" }, t = { "VimtexTocToggle", "Toggle TOC" }, }, V = { - name = " VimTeX", + name = "VimTeX", c = { "edit /home/jeff/.config/lvim/ftplugin/tex.lua", "Edit configuration" }, s = { "edit /home/jeff/.config/lvim/luasnippets/tex.lua", "Edit snippets" }, i = { "VimtexInfo", "Vimtex Info" }, @@ -70,7 +70,11 @@ linters.setup({ -- local formatters = require("lvim.lsp.null-ls.formatters") formatters.setup({ - { command = "latexindent", filetypes = { "tex" } }, + { + command = "latexindent", + args = { "-l=~/.config/latex/latexsettings" }, + filetypes = { "tex" } + }, }) diff --git a/conf.d/lvim/lua/user/autocommands.lua b/conf.d/lvim/lua/user/autocommands.lua new file mode 100644 index 0000000..f8e03e8 --- /dev/null +++ b/conf.d/lvim/lua/user/autocommands.lua @@ -0,0 +1,45 @@ +--[[-- +File : conf.d/lvim/lua/user/autocommands.lua +Author : Jeff Lance +Date : 23.02.2024 16:47:36 +Last Modified Date: 23.02.2024 16:47:36 +Last Modified By : Jeff Lance +--]]-- + + + +-- Set autocommands +-- + +local M = {} + +M.setup = function() + lvim.autocommands = { + -- for any files + { + -- { "VimEnter" }, + -- { + -- pattern = { "*" }, + -- command = "FloatermNew --width=0.8 --name=terminal --cwd=", + -- } + }, + -- arduino files + { + { "BufNewFile", "BufRead" }, + { + pattern = { "*.ino", ".pde" }, + command = "set filetype=arduino", + } + }, + -- asymptote filetype + { + { "BufNewFile", "BufRead" }, + { + pattern = { "*.asy" }, + command = "set filetype=asy", + } + }, + } +end + +return M diff --git a/conf.d/lvim/lua/user/dap.lua b/conf.d/lvim/lua/user/dap.lua new file mode 100644 index 0000000..57d4d2c --- /dev/null +++ b/conf.d/lvim/lua/user/dap.lua @@ -0,0 +1,24 @@ +--[[-- +File : conf.d/lvim/lua/user/dap.lua +Author : Jeff Lance +Date : 28.12.2023 21:34:48 +Last Modified Date: 01.02.2024 12:47:04 +Last Modified By : Jeff Lance +--]]-- + + + +-- Setup debug adapter +-- + +local M = {} + +M.setup = function() + lvim.builtin.dap.active = true + local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/") + pcall(function() + require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python") + end) +end + +return M diff --git a/conf.d/lvim/lua/user/functions.lua b/conf.d/lvim/lua/user/functions.lua index 1ad9621..f988bc1 100644 --- a/conf.d/lvim/lua/user/functions.lua +++ b/conf.d/lvim/lua/user/functions.lua @@ -8,26 +8,59 @@ Last Modified By : Jeff Lance --- function Surround(w_or_W) --- local open_char = vim.fn.input("Surround with: ") --- local closed_char = nil --- if open_char == "(" then closed_char = ")" end --- if open_char == "[" then closed_char = "]" end --- if open_char == "{" then closed_char = "}" end --- if open_char == "<" then closed_char = ">" end --- if open_char == "'" then closed_char = "'" end --- if open_char == '"' then closed_char = '"' end --- if open_char == "`" then closed_char = "`" end --- if open_char == "/" then closed_char = "/" end --- if open_char == "|" then closed_char = "|" end +local M = {} --- if w_or_W == "w" then --- vim.cmd("normal! ciw" .. open_char) --- elseif w_or_W == "W" then --- vim.cmd([[normal! ciW]] .. open_char) --- end --- vim.cmd("normal! p") --- vim.cmd("normal! a" .. closed_char) --- vim.cmd("normal! a") --- end +--- Get current buffer size +---@return {width: number, height: number} +local function get_buf_size() + local cbuf = vim.api.nvim_get_current_buf() + local bufinfo = vim.tbl_filter(function(buf) + return buf.bufnr == cbuf + end, vim.fn.getwininfo(vim.api.nvim_get_current_win()))[1] + if bufinfo == nil then + return { width = -1, height = -1 } + end + return { width = bufinfo.width, height = bufinfo.height } +end + +--- Get the dynamic terminal size in cells +---@param direction string +---@param size number +---@return integer +local function get_dynamic_terminal_size(direction, size) + size = size or lvim.builtin.terminal.size + if direction ~= "float" and tostring(size):find(".", 1, true) then + size = math.min(size, 1.0) + local buf_sizes = get_buf_size() + local buf_size = direction == "horizontal" and buf_sizes.height or buf_sizes.width + return buf_size * size + else + return size + end +end + +M.xplr_toggle = function() + local Terminal = require("toggleterm.terminal").Terminal + local direction = "float" + + local xplr = Terminal:new { + cmd = "xplr", + hidden = true, + direction = direction, + -- size = 20 | function() + -- return get_dynamic_terminal_size("float", 0.8) + -- end, + float_opts = { + border = "curved", + }, + on_open = function(_) + vim.cmd "startinsert!" + end, + on_close = function(_) end, + count = 200, + } + xplr:toggle() +end + +return M diff --git a/conf.d/lvim/lua/user/keybindings.lua b/conf.d/lvim/lua/user/keybindings.lua index b622cd8..ba844e2 100644 --- a/conf.d/lvim/lua/user/keybindings.lua +++ b/conf.d/lvim/lua/user/keybindings.lua @@ -28,6 +28,7 @@ M.setup = function() lvim.keys.normal_mode[""] = "redo" lvim.keys.normal_mode[""] = ":<" lvim.keys.normal_mode[""] = ":>" + -- lvim.keys.normal_mode[""] = ":FloatermToggle terminal" end diff --git a/conf.d/lvim/lua/user/lsp.lua b/conf.d/lvim/lua/user/lsp.lua new file mode 100644 index 0000000..243f700 --- /dev/null +++ b/conf.d/lvim/lua/user/lsp.lua @@ -0,0 +1,39 @@ +--[[-- +File : conf.d/lvim/lua/user/lsp.lua +Author : Jeff Lance +Date : 28.12.2023 21:34:48 +Last Modified Date: 06.01.2024 18:59:29 +Last Modified By : Jeff Lance +--]]-- + + + +-- Setup debug adapter +-- + +local M = {} + +M.setup = function() + -- Generic LSP settings + vim.diagnostic.config({ virtual_text = true }) + + -- setup LSP + local capabilities = require("lvim.lsp").common_capabilities() + require("lvim.lsp.manager").setup( + "texlab", { + on_attach = require("lvim.lsp").common_on_attach, + on_init = require("lvim.lsp").common_on_init, + capabilities = capabilities, + }) + + require("lvim.lsp.manager").setup( + "marksman", { + }) + + require("lvim.lsp.manager").setup( + "golangci_lint_ls", { + }) + +end + +return M diff --git a/conf.d/lvim/lua/user/plugin-configs.lua b/conf.d/lvim/lua/user/plugin-configs.lua index 8c7e305..7fd0503 100644 --- a/conf.d/lvim/lua/user/plugin-configs.lua +++ b/conf.d/lvim/lua/user/plugin-configs.lua @@ -2,39 +2,16 @@ File : conf.d/lvim/lua/user/plugin-configs.lua Author : Jeff Lance Date : 28.12.2023 21:34:48 -Last Modified Date: 28.12.2023 21:34:48 +Last Modified Date: 06.01.2024 18:33:43 Last Modified By : Jeff Lance --]]-- +-- Plugins configurations +-- + local M = {} --- setup debug adapter -M.dap = function () - lvim.builtin.dap.active = true - local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/") - pcall(function() - require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python") - end) -end - --- setup testing -M.neotest = function () - require("neotest").setup({ - adapters = { - require("neotest-python")({ - -- Extra arguments for nvim-dap configuration - -- See https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for values - dap = { - justMyCode = false, - console = "integratedTerminal", - }, - args = { "--log-level", "DEBUG", "--quiet" }, - runner = "pytest", - }) - } - }) -end return M diff --git a/conf.d/lvim/lua/user/plugins.lua b/conf.d/lvim/lua/user/plugins.lua index 0e570c3..df7176a 100644 --- a/conf.d/lvim/lua/user/plugins.lua +++ b/conf.d/lvim/lua/user/plugins.lua @@ -10,10 +10,14 @@ Last Modified By : Jeff Lance local M = {} -M.setup = function () - -- local config = require("user.plugin-configs") +M.setup = function() + local configs = require("user.plugin-configs") lvim.plugins = { + -- abolish + { + 'tpope/vim-abolish', + }, -- addheader { 'alpertuna/vim-header', @@ -35,6 +39,21 @@ M.setup = function () { "skywind3000/asyncrun.vim", }, + -- chatgpt + { + "jackMort/ChatGPT.nvim", + event = "VeryLazy", + config = function() + require("chatgpt").setup({ + api_key_cmd = "pass _api_keys/openai_perso-1" + }) + end, + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim" + } + }, -- cmp addons { "tzachar/cmp-tabnine", @@ -92,6 +111,10 @@ M.setup = function () }) end }, + -- floaterm + { + 'voldikss/vim-floaterm', + }, -- gitignore { 'jefflance/vim-gitignore', @@ -116,6 +139,64 @@ M.setup = function () ]]) end, }, + -- mason + { + 'WhoIsSethDaniel/mason-tool-installer.nvim', + config = function() + local mason = require('mason-tool-installer') + mason.setup({ + ensure_installed = { + 'xo', + 'textlint', + 'yamllint', + 'yq', + 'ansible-lint', + 'xmlformatter', + 'typescript-language-server', + 'tailwindcss-language-server', + 'texlab', + 'pyright', + 'golines', + 'prettier', + 'lua-language-server', + 'markdownlint', + 'black', + 'bash-language-server', + 'golangci-lint', + 'go-debug-adapter', + 'editorconfig-checker', + 'autopep8', + 'beautysh', + 'clangd', + 'djlint', + 'docker-compose-language-service', + 'dockerfile-language-server', + 'dot-language-server', + 'golangci-lint-langserver', + 'gopls', + 'html-lsp', + 'intelephense', + 'jq', + 'json-lsp', + 'jsonlint', + 'latexindent', + 'lemminx', + 'markdown-toc', + 'marksman', + 'perlnavigator', + 'php-debug-adapter', + 'twigcs', + 'vim-language-server', + 'yaml-language-server', + 'yamlfix', + }, + auto_update = true, + run_on_start = true, + start_delay = 3000, + debounce_hours = 24, + }) + end + }, -- minimap { 'echasnovski/mini.map', @@ -134,7 +215,7 @@ M.setup = function () }), }, symbols = { - encode = map.gen_encode_symbols.dot('2x1'), + encode = map.gen_encode_symbols.dot('2x1'), }, window = { side = 'right', @@ -193,17 +274,24 @@ M.setup = function () }) end, }, - { - "kevinhwang91/rnvimr", - cmd = "RnvimrToggle", - config = function() - vim.cmd([[ - let g:rnvimr_draw_border = 1 - let g:rnvimr_pick_enable = 1 - let g:rnvimr_bw_enable = 1 - ]]) - end, - }, + -- -- rnvimr + -- { + -- "kevinhwang91/rnvimr", + -- cmd = "RnvimrToggle", + -- config = function() + -- vim.cmd([[ + -- let g:rnvimr_enable_ex = 1 + -- let g:rnvimr_enable_picker = 1 + -- let g:rnvimr_edit_cmd = 'drop' + -- let g:rnvimr_draw_border = 1 + -- let g:rnvimr_hide_gitignore = 1 + -- " let g:rnvimr_border_attr = {'fg': 14, 'bg': 0} + -- let g:rnvimr_enable_bw = 1 + -- " let g:rnvimr_shadow_winblend = 70 + -- let g:rnvimr_ranger_cmd = ['ranger', '--cmd=set draw_borders both'] + -- ]]) + -- end, + -- }, -- suda { 'lambdalisue/suda.vim', diff --git a/conf.d/lvim/lua/user/tests.lua b/conf.d/lvim/lua/user/tests.lua new file mode 100644 index 0000000..07c73c7 --- /dev/null +++ b/conf.d/lvim/lua/user/tests.lua @@ -0,0 +1,33 @@ +--[[-- +File : conf.d/lvim/lua/user/tests.lua +Author : Jeff Lance +Date : 28.12.2023 21:34:48 +Last Modified Date: 06.01.2024 18:55:14 +Last Modified By : Jeff Lance +--]]-- + + + +-- Setup test framework +-- + +local M = {} + +M.setup = function() + require("neotest").setup({ + adapters = { + require("neotest-python")({ + -- Extra arguments for nvim-dap configuration + -- See https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for values + dap = { + justMyCode = false, + console = "integratedTerminal", + }, + args = { "--log-level", "DEBUG", "--quiet" }, + runner = "pytest", + }) + } + }) +end + +return M diff --git a/conf.d/lvim/lua/user/whichkey.lua b/conf.d/lvim/lua/user/whichkey.lua index 967f39e..5f5c756 100644 --- a/conf.d/lvim/lua/user/whichkey.lua +++ b/conf.d/lvim/lua/user/whichkey.lua @@ -15,8 +15,26 @@ M.setup = function() -- whichkey mappings -- + -- chatgpt bindings + lvim.builtin.which_key.mappings["C"] = { + name = "ChatGPT", + c = { "ChatGPT", "ChatGPT" }, + e = { "ChatGPTEditWithInstruction", "Edit with instruction", mode = { "n", "v" } }, + g = { "ChatGPTRun grammar_correction", "Grammar Correction", mode = { "n", "v" } }, + t = { "ChatGPTRun translate", "Translate", mode = { "n", "v" } }, + k = { "ChatGPTRun keywords", "Keywords", mode = { "n", "v" } }, + d = { "ChatGPTRun docstring", "Docstring", mode = { "n", "v" } }, + a = { "ChatGPTRun add_tests", "Add Tests", mode = { "n", "v" } }, + o = { "ChatGPTRun optimize_code", "Optimize Code", mode = { "n", "v" } }, + s = { "ChatGPTRun summarize", "Summarize", mode = { "n", "v" } }, + f = { "ChatGPTRun fix_bugs", "Fix Bugs", mode = { "n", "v" } }, + x = { "ChatGPTRun explain_code", "Explain Code", mode = { "n", "v" } }, + r = { "ChatGPTRun roxygen_edit", "Roxygen Edit", mode = { "n", "v" } }, + l = { "ChatGPTRun code_readability_analysis", "Code Readability Analysis", mode = { "n", "v" } }, + } + -- remap neo-tree shortcut to rnvimr - lvim.builtin.which_key.mappings["e"] = { "RnvimrToggle", "File explorer" } + -- lvim.builtin.which_key.mappings["e"] = { "RnvimrToggle", "File explorer" } -- remap dashboard lvim.builtin.which_key.mappings["d"] = lvim.builtin.which_key.mappings[";"] @@ -81,6 +99,7 @@ M.setup = function() lvim.builtin.which_key.mappings["x"] = { "w! q!", "Save and quit" } lvim.builtin.which_key.mappings[";"] = {} + lvim.builtin.which_key.mappings["e"] = { ":lua require('user.functions').xplr_toggle()", "File manager" } lvim.builtin.terminal.open_mapping = "" end