summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-07-03 17:03:56 +0100
committerYour Name <you@example.com>2024-07-03 17:03:56 +0100
commitc959b2112fb4c82b5bfd410df21706455225bd40 (patch)
tree6774868448d127c2f560827de8e5edbd868a2832 /lua/config
minor additionsHEADmaster
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/cmp.lua222
-rw-r--r--lua/config/default.lua27
-rw-r--r--lua/config/formatters.lua8
-rw-r--r--lua/config/jupyter-which_key.lua6
-rw-r--r--lua/config/keymaps.lua91
-rw-r--r--lua/config/latex-which_key.lua13
-rw-r--r--lua/config/linters.lua6
-rw-r--r--lua/config/magma.lua24
-rw-r--r--lua/config/mason_lspconfig_setup.lua19
-rw-r--r--lua/config/neorg-which_key.lua10
-rw-r--r--lua/config/nvim_treesitter_config_setup.lua56
-rw-r--r--lua/config/oil-which_key.lua7
-rw-r--r--lua/config/oil.lua179
-rw-r--r--lua/config/options.lua44
-rw-r--r--lua/config/org.lua9
-rw-r--r--lua/config/plugins-latex.lua6
-rw-r--r--lua/config/plugins.lua225
-rw-r--r--lua/config/python-debug.lua6
-rw-r--r--lua/config/python-testing.lua15
-rw-r--r--lua/config/python-which_key.lua25
-rw-r--r--lua/config/terminal-which_key.lua9
-rw-r--r--lua/config/terminal.lua168
-rw-r--r--lua/config/test.lua4
-rw-r--r--lua/config/texcmp.lua7
-rw-r--r--lua/config/texlab.lua20
-rw-r--r--lua/config/toggleterm.lua77
-rw-r--r--lua/config/ultisnip.lua9
-rw-r--r--lua/config/vimtex.lua2
-rw-r--r--lua/config/vimwiki-which_key.lua6
-rw-r--r--lua/config/vimwiki.lua14
-rw-r--r--lua/config/which_key_config.lua272
31 files changed, 1586 insertions, 0 deletions
diff --git a/lua/config/cmp.lua b/lua/config/cmp.lua
new file mode 100644
index 0000000..68b7883
--- /dev/null
+++ b/lua/config/cmp.lua
@@ -0,0 +1,222 @@
+local has_words_before = function()
+ local line, col = unpack(vim.api.nvim_win_get_cursor(0))
+ return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
+end
+
+local function jumpable(dir)
+ local luasnip_ok, luasnip = pcall(require, "luasnip")
+ if not luasnip_ok then
+ return false
+ end
+
+ local win_get_cursor = vim.api.nvim_win_get_cursor
+ local get_current_buf = vim.api.nvim_get_current_buf
+
+ ---sets the current buffer's luasnip to the one nearest the cursor
+ ---@return boolean true if a node is found, false otherwise
+ local function seek_luasnip_cursor_node()
+ -- TODO(kylo252): upstream this
+ -- for outdated versions of luasnip
+ if not luasnip.session.current_nodes then
+ return false
+ end
+
+ local node = luasnip.session.current_nodes[get_current_buf()]
+ if not node then
+ return false
+ end
+
+ local snippet = node.parent.snippet
+ local exit_node = snippet.insert_nodes[0]
+
+ local pos = win_get_cursor(0)
+ pos[1] = pos[1] - 1
+
+ -- exit early if we're past the exit node
+ if exit_node then
+ local exit_pos_end = exit_node.mark:pos_end()
+ if (pos[1] > exit_pos_end[1]) or (pos[1] == exit_pos_end[1] and pos[2] > exit_pos_end[2]) then
+ snippet:remove_from_jumplist()
+ luasnip.session.current_nodes[get_current_buf()] = nil
+
+ return false
+ end
+ end
+
+ node = snippet.inner_first:jump_into(1, true)
+ while node ~= nil and node.next ~= nil and node ~= snippet do
+ local n_next = node.next
+ local next_pos = n_next and n_next.mark:pos_begin()
+ local candidate = n_next ~= snippet and next_pos and (pos[1] < next_pos[1])
+ or (pos[1] == next_pos[1] and pos[2] < next_pos[2])
+
+ -- Past unmarked exit node, exit early
+ if n_next == nil or n_next == snippet.next then
+ snippet:remove_from_jumplist()
+ luasnip.session.current_nodes[get_current_buf()] = nil
+
+ return false
+ end
+
+ if candidate then
+ luasnip.session.current_nodes[get_current_buf()] = node
+ return true
+ end
+
+ local ok
+ ok, node = pcall(node.jump_from, node, 1, true) -- no_move until last stop
+ if not ok then
+ snippet:remove_from_jumplist()
+ luasnip.session.current_nodes[get_current_buf()] = nil
+
+ return false
+ end
+ end
+
+ -- No candidate, but have an exit node
+ if exit_node then
+ -- to jump to the exit node, seek to snippet
+ luasnip.session.current_nodes[get_current_buf()] = snippet
+ return true
+ end
+
+ -- No exit node, exit from snippet
+ snippet:remove_from_jumplist()
+ luasnip.session.current_nodes[get_current_buf()] = nil
+ return false
+ end
+
+ if dir == -1 then
+ return luasnip.in_snippet() and luasnip.jumpable(-1)
+ else
+ return luasnip.in_snippet() and seek_luasnip_cursor_node() and luasnip.jumpable(1)
+ end
+end
+
+local t = function(str)
+ return vim.api.nvim_replace_termcodes(str, true, true, true)
+end
+
+
+local status_cmp_ok, cmp = pcall(require, "cmp")
+if not status_cmp_ok then
+ return
+end
+local status_luasnip_ok, luasnip = pcall(require, "luasnip")
+if not status_luasnip_ok then
+ return
+end
+
+local setup = {
+ confirm_opts = lvim.builtin.cmp.confirm_opts,
+ completion = {
+ keyword_length = 1,
+ },
+ experimental = {
+ ghost_text = false,
+ native_menu = false,
+ },
+ formatting = {
+ fields = { "kind", "abbr", "menu" },
+ max_width = 0,
+ kind_icons = lvim.icons.kind,
+ source_names = {
+ nvim_lsp = "(LSP)",
+ luasnip = "(Snippet)",
+ latex_symbols = "(LaTeX)",
+ emoji = "(Emoji)",
+ path = "(Path)",
+ calc = "(Calc)",
+ cmp_tabnine = "(Tabnine)",
+ vsnip = "(Snippet)",
+ ultisnips = "(Snippet)",
+ buffer = "(Buffer)",
+ tmux = "(TMUX)",
+ },
+ duplicates = lvim.builtin.cmp.duplicates,
+ duplicates_default = 0,
+ format = lvim.builtin.cmp.format,
+ },
+ snippet = {
+ expand = function(args)
+ vim.fn["UltiSnips#Anon"](args.body)
+ end,
+ },
+ window = lvim.builtin.cmp.window,
+ sources = {
+ { name = "nvim_lsp" },
+ { name = "path" },
+ { name = "luasnip" },
+ { name = "cmp_tabnine" },
+ { name = "nvim_lua" },
+ { name = "buffer" },
+ { name = "calc" },
+ { name = "emoji" },
+ { name = "treesitter" },
+ { name = "ultisnips" },
+ { name = "latex_symbols" },
+ { name = "crates" },
+ { name = "tmux" },
+ },
+ mapping = cmp.mapping.preset.insert {
+ ["<C-k>"] = cmp.mapping.select_prev_item(),
+ ["<C-j>"] = cmp.mapping.select_next_item(),
+ ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select }, { "i" }),
+ ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select }, { "i" }),
+ ["<C-d>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-y>"] = cmp.mapping {
+ i = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false },
+ c = function(fallback)
+ if cmp.visible() then
+ cmp.confirm { behavior = cmp.ConfirmBehavior.Replace, select = false }
+ else
+ fallback()
+ end
+ end,
+ },
+ ["<Tab>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_next_item()
+ elseif vim.fn["UltiSnips#CanJumpForwards"]() == 1 then
+ vim.api.nvim_feedkeys(t("<Plug>(ultisnips_jump_forward)"), "m", true)
+ elseif has_words_before() then
+ fallback()
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ ["<S-Tab>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_prev_item()
+ elseif vim.fn["UltiSnips#CanJumpBackwards"]() == 1 then
+ vim.api.nvim_feedkeys(t("<Plug>(ultisnips_jump_backward)"), "m", true)
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ ["<C-Space>"] = cmp.mapping.complete(),
+ ["<C-e>"] = cmp.mapping.abort(),
+ ["<CR>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ local confirm_opts = vim.deepcopy(lvim.builtin.cmp.confirm_opts) -- avoid mutating the original opts below
+ local is_insert_mode = function()
+ return vim.api.nvim_get_mode().mode:sub(1, 1) == "i"
+ end
+ if is_insert_mode() then -- prevent overwriting brackets
+ confirm_opts.behavior = cmp.ConfirmBehavior.Insert
+ end
+ if cmp.confirm(confirm_opts) then
+ return -- success, exit early
+ end
+ end
+
+ if jumpable(1) and luasnip.jump(1) then
+ return -- success, exit early
+ end
+ fallback() -- if not exited early, always fallback
+ end),
+ },
+}
+
+require("cmp").setup(setup)
diff --git a/lua/config/default.lua b/lua/config/default.lua
new file mode 100644
index 0000000..0ce21b3
--- /dev/null
+++ b/lua/config/default.lua
@@ -0,0 +1,27 @@
+-- Setup Lazy.nvim
+
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not vim.loop.fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazypath,
+ })
+end
+vim.opt.rtp:prepend(lazypath)
+
+
+---- Options to add `gf` functionality inside `.lua` files.
+vim.opt_local.include = [[\v<((do|load)file|require)[^''"]*[''"]\zs[^''"]+]]
+vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
+
+for _, path in pairs(vim.api.nvim_list_runtime_paths()) do
+ vim.opt_local.path:append(path .. '/lua')
+end
+
+vim.opt_local.suffixesadd:prepend('.lua')
+--
+
diff --git a/lua/config/formatters.lua b/lua/config/formatters.lua
new file mode 100644
index 0000000..fe7d976
--- /dev/null
+++ b/lua/config/formatters.lua
@@ -0,0 +1,8 @@
+local formatters = require "lvim.lsp.null-ls.formatters"
+formatters.setup {
+ { command = "black", filetypes = {"python"} },
+ { command = "latexindent", filetypes = {"tex"} },
+}
+lvim.format_on_save.enabled = true
+lvim.format_on_save.pattern = { "*.py", "*.tex", }
+
diff --git a/lua/config/jupyter-which_key.lua b/lua/config/jupyter-which_key.lua
new file mode 100644
index 0000000..69917c0
--- /dev/null
+++ b/lua/config/jupyter-which_key.lua
@@ -0,0 +1,6 @@
+lvim.builtin.which_key.mappings["J"] = {
+ name = "Jupyter-Ascending",
+ x = { "<cmd>JupyterExecute<CR>", "Execute Cell" },
+ X = { "<cmd>JupyterExecuteAll<CR>", "Execute All Cells" },
+ r = { "<cmd>JupyterRestart<CR>", "Restart Kernel" },
+ }
diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua
new file mode 100644
index 0000000..01f5d9b
--- /dev/null
+++ b/lua/config/keymaps.lua
@@ -0,0 +1,91 @@
+Leader = ","
+LocalLeader = "<Leader>"
+-- Shorten function name
+local km = vim.keymap.set
+-- Silent keymap option
+local opts = { silent = true }
+
+-- Modes
+-- normal_mode = "n",
+-- insert_mode = "i",
+-- visual_mode = "v",
+-- visual_block_mode = "x",
+-- term_mode = "t",
+-- command_mode = "c",
+
+-- Normal --
+
+-- Better window navigation
+km("n", "<C-h>", "<C-w>h", opts)
+km("n", "<C-j>", "<C-w>j", opts)
+km("n", "<C-k>", "<C-w>k", opts)
+km("n", "<C-l>", "<C-w>l", opts)
+
+-- Resize with arrows
+km("n", "<C-Up>", ":resize -2<CR>", opts)
+km("n", "<C-Down>", ":resize +2<CR>", opts)
+km("n", "<C-Left>", ":vertical resize -2<CR>", opts)
+km("n", "<C-Right>", ":vertical resize +2<CR>", opts)
+
+-- Navigate buffers
+km("n", "<S-l>", ":bnext<CR>", opts)
+km("n", "<S-h>", ":bprevious<CR>", opts)
+
+-- Clear highlights
+km("n", "<leader>h", "<cmd>nohlsearch<CR>", opts)
+
+-- Close buffers
+km("n", "<S-q>", "<cmd>Bdelete!<CR>", opts)
+
+-- Better paste
+km("v", "p", '"_dP', opts)
+
+-- Insert --
+-- Press jk fast to enter
+km("i", "jk", "<ESC>", opts)
+
+-- Visual --
+-- Stay in indent mode
+km("v", "<", "<gv", opts)
+km("v", ">", ">gv", opts)
+
+-- Plugins --
+
+-- NvimTree
+km("n", "<leader>e", ":NvimTreeToggle<CR>", opts)
+
+-- Oil
+km("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory"}, opts)
+
+-- Telescope
+km("n", "<leader>ff", ":Telescope find_files<CR>", opts)
+km("n", "<leader>ft", ":Telescope live_grep<CR>", opts)
+km("n", "<leader>fp", ":Telescope projects<CR>", opts)
+km("n", "<leader>fb", ":Telescope buffers<CR>", opts)
+
+-- Git
+km("n", "<leader>gg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
+
+-- Comment
+km("n", "<leader>/", "<cmd>lua require('Comment.api').toggle_current_linewise()<CR>", opts)
+km("x", "<leader>/", '<ESC><CMD>lua require("Comment.api").toggle_linewise_op(vim.fn.visualmode())<CR>')
+
+-- DAP
+km("n", "<leader>db", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", opts)
+km("n", "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", opts)
+km("n", "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", opts)
+km("n", "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", opts)
+km("n", "<leader>dO", "<cmd>lua require'dap'.step_out()<cr>", opts)
+km("n", "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", opts)
+km("n", "<leader>dl", "<cmd>lua require'dap'.run_last()<cr>", opts)
+km("n", "<leader>du", "<cmd>lua require'dapui'.toggle()<cr>", opts)
+km("n", "<leader>dt", "<cmd>lua require'dap'.terminate()<cr>", opts)
+
+-- Terminal
+-- Better terminal navigation
+km("t", "<C-h>", "<C-\\><C-N><C-w>h", opts)
+km("t", "<C-j>", "<C-\\><C-N><C-w>j", opts)
+km("t", "<C-k>", "<C-\\><C-N><C-w>k", opts)
+km("t", "<C-l>", "<C-\\><C-N><C-w>l", opts)
+km("v", "<leader>tp", ":ToggleTermSendVisualSelection <CR>", opts)
+
diff --git a/lua/config/latex-which_key.lua b/lua/config/latex-which_key.lua
new file mode 100644
index 0000000..3553455
--- /dev/null
+++ b/lua/config/latex-which_key.lua
@@ -0,0 +1,13 @@
+-- Mappings
+
+lvim.builtin.which_key.mappings["L"] = {
+ name = "LaTeX",
+ C = {
+ name = "Compile",
+ c = { "<cmd>TexlabBuild<CR>", "Compile Project and Show Output" },
+ e = { "<cmd>Texplore<CR>", "Explore current directory" },
+ C = { "<cmd>VimtexClean<CR>", "Clean Project with vimtex" },
+ v = { "<cmd>VimtexCompile<CR>", "Compile Project with vimtex" },
+ V = { "<cmd>VimtexView<CR>", "Show the output" },
+ },
+}
diff --git a/lua/config/linters.lua b/lua/config/linters.lua
new file mode 100644
index 0000000..8395999
--- /dev/null
+++ b/lua/config/linters.lua
@@ -0,0 +1,6 @@
+local linters = require "lvim.lsp.null-ls.linters"
+linters.setup {
+ { command = "flake8", filetypes = { "python" } },
+ { command = "chktex", filetypes = { "tex" } },
+}
+
diff --git a/lua/config/magma.lua b/lua/config/magma.lua
new file mode 100644
index 0000000..c9b9b17
--- /dev/null
+++ b/lua/config/magma.lua
@@ -0,0 +1,24 @@
+Magma_kbd = {
+ { op = "EvaluateOperator", keys = "r", expr = true, },
+ { op = "EvaluateLine", keys = "rr", },
+ { op = "EvaluateVisual", keys = "r", v = true },
+ { op = "ReevaluateCell", keys = "rc", },
+ { op = "Delete", keys = "rd", },
+ { op = "ShowOutput", keys = "ro" },
+}
+
+for _, row in ipairs(Magma_kbd) do
+ Mod = (row.expr ~= nil) and { silent = true, expr = row.expr,} or { silent = true, }
+ Map = (row.v ~= nil) and { "n", "v", } or "n"
+ Command = (row.v ~= nil) and ":<C-u>" or "<cmd>"
+ vim.keymap.set(
+ Map, "<LocalLeader>" .. row.keys,
+ Command .. "Magma" .. row.op .. "<CR>", Mod)
+end
+
+vim.g.magma_automatically_open_output = false
+-- vim.g.magma_image_provider = "kitty"
+-- vim.g.magma_automatically_open_output = true
+-- vim.g.magma_image_provider = "kitty"
+vim.g.magma_image_provider = "ueberzug"
+
diff --git a/lua/config/mason_lspconfig_setup.lua b/lua/config/mason_lspconfig_setup.lua
new file mode 100644
index 0000000..9fcb6ab
--- /dev/null
+++ b/lua/config/mason_lspconfig_setup.lua
@@ -0,0 +1,19 @@
+require("mason-lspconfig").setup()
+require("mason-lspconfig").setup_handlers({
+ function (server_name)
+ require("lspconfig")[server_name].setup({})
+ end,
+ ["lua_ls"] = function ()
+ local lspconfig = require("lspconfig")
+ lspconfig.lua_ls.setup({
+ settings = {
+ Lua = {
+ diagnostics = {
+ globals = { "vim" }
+ }
+ }
+ }
+ })
+ end,
+})
+
diff --git a/lua/config/neorg-which_key.lua b/lua/config/neorg-which_key.lua
new file mode 100644
index 0000000..2ab7f0e
--- /dev/null
+++ b/lua/config/neorg-which_key.lua
@@ -0,0 +1,10 @@
+-- binding for switching
+lvim.builtin.which_key.mappings["N"] = {
+ name = "Neorg",
+ i = { "<cmd>Neorg index<CR>", "Neorg Index" },
+ j = { "<cmd>Neorg journal<CR>", "Neorg Journal" },
+ r = { "<cmd>Neorg return<CR>", "Neorg Return" },
+ w = { "<cmd>Neorg workspace<CR>", "Neorg Workspace" },
+ W = { ":Neorg workspace<TAB>", "Neorg Workspace" },
+}
+
diff --git a/lua/config/nvim_treesitter_config_setup.lua b/lua/config/nvim_treesitter_config_setup.lua
new file mode 100644
index 0000000..cf8f79a
--- /dev/null
+++ b/lua/config/nvim_treesitter_config_setup.lua
@@ -0,0 +1,56 @@
+ require("nvim-treesitter.configs").setup({
+ ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "python", "cpp", "make",
+ "norg", "org", "latex", "tmux", "zathurarc", "yaml", "xml", "sxhkdrc", "ssh_config",
+ "sql", "regex", "r", "perl", "muttrc", "html", "fortran", "bibtex", "bash" },
+ auto_install = true,
+ highlight = {
+ enable = true,
+ },
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "<Leader>ss",
+ node_incremental = "<Leader>si",
+ scope_incremental = "<Leader>sc",
+ node_decremental = "<Leader>sd",
+ },
+ },
+ textobjects = {
+ select = {
+ enable = true,
+
+ -- Automatically jump forward to textobj, similar to targets.vim
+ lookahead = true,
+
+ keymaps = {
+ -- You can use the capture groups defined in textobjects.scm
+ ["af"] = "@function.outer",
+ ["if"] = "@function.inner",
+ ["ac"] = "@class.outer",
+ -- You can optionally set descriptions to the mappings (used in the desc parameter of
+ -- nvim_buf_set_keymap) which plugins like which-key display
+ ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
+ -- You can also use captures from other query groups like `locals.scm`
+ ["as"] = { query = "@scope", query_group = "locals", desc = "Select language scope" },
+ },
+ -- You can choose the select mode (default is charwise 'v')
+ --
+ -- Can also be a function which gets passed a table with the keys
+ -- * query_string: eg '@function.inner'
+ -- * method: eg 'v' or 'o'
+ -- and should return the mode ('v', 'V', or '<c-v>') or a table
+ -- mapping query_strings to modes.
+ selection_modes = {
+ ['@parameter.outer'] = 'v', -- charwise
+ ['@function.outer'] = 'V', -- linewise
+ ['@class.outer'] = '<c-v>', -- blockwise
+ },
+ -- If you set this to `true` (default is `false`) then any textobject is
+ -- extended to include preceding or succeeding whitespace. Succeeding
+ -- whitespace has priority in order to act similarly to eg the built-in
+ -- `ap`.
+ include_surrounding_whitespace = true,
+ },
+ },
+ })
+
diff --git a/lua/config/oil-which_key.lua b/lua/config/oil-which_key.lua
new file mode 100644
index 0000000..818fa54
--- /dev/null
+++ b/lua/config/oil-which_key.lua
@@ -0,0 +1,7 @@
+-- binding for switching
+lvim.builtin.which_key.mappings["O"] = {
+ name = "Oil",
+ o = { "<cmd>Oil<CR>", "Open parent directory" },
+}
+
+
diff --git a/lua/config/oil.lua b/lua/config/oil.lua
new file mode 100644
index 0000000..4f8671c
--- /dev/null
+++ b/lua/config/oil.lua
@@ -0,0 +1,179 @@
+ local config = function ()
+ require("oil").setup({
+ -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
+ -- Set to false if you still want to use netrw.
+ default_file_explorer = true,
+ -- Id is automatically added at the beginning, and name at the end
+ -- See :help oil-columns
+ columns = {
+ "icon",
+ -- "permissions",
+ -- "size",
+ -- "mtime",
+ },
+ -- Buffer-local options to use for oil buffers
+ buf_options = {
+ buflisted = false,
+ bufhidden = "hide",
+ },
+ -- Window-local options to use for oil buffers
+ win_options = {
+ wrap = false,
+ signcolumn = "no",
+ cursorcolumn = false,
+ foldcolumn = "0",
+ spell = false,
+ list = false,
+ conceallevel = 3,
+ concealcursor = "nvic",
+ },
+ -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
+ delete_to_trash = false,
+ -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
+ skip_confirm_for_simple_edits = false,
+ -- Selecting a new/moved/renamed file or directory will prompt you to save changes first
+ -- (:help prompt_save_on_select_new_entry)
+ prompt_save_on_select_new_entry = true,
+ -- Oil will automatically delete hidden buffers after this delay
+ -- You can set the delay to false to disable cleanup entirely
+ -- Note that the cleanup process only starts when none of the oil buffers are currently displayed
+ cleanup_delay_ms = 2000,
+ lsp_file_methods = {
+ -- Time to wait for LSP file operations to complete before skipping
+ timeout_ms = 1000,
+ -- Set to true to autosave buffers that are updated with LSP willRenameFiles
+ -- Set to "unmodified" to only save unmodified buffers
+ autosave_changes = false,
+ },
+ -- Constrain the cursor to the editable parts of the oil buffer
+ -- Set to `false` to disable, or "name" to keep it on the file names
+ constrain_cursor = "editable",
+ -- Set to true to watch the filesystem for changes and reload oil
+ experimental_watch_for_changes = false,
+ -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
+ -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
+ -- Additionally, if it is a string that matches "actions.<name>",
+ -- it will use the mapping at require("oil.actions").<name>
+ -- Set to `false` to remove a keymap
+ -- See :help oil-actions for a list of all available actions
+ keymaps = {
+ ["g?"] = "actions.show_help",
+ ["<CR>"] = "actions.select",
+ ["<C-s>"] = "actions.select_vsplit",
+ ["<C-h>"] = "actions.select_split",
+ ["<C-t>"] = "actions.select_tab",
+ ["<C-p>"] = "actions.preview",
+ ["<C-c>"] = "actions.close",
+ ["<C-l>"] = "actions.refresh",
+ ["-"] = "actions.parent",
+ ["_"] = "actions.open_cwd",
+ ["`"] = "actions.cd",
+ ["~"] = "actions.tcd",
+ ["gs"] = "actions.change_sort",
+ ["gx"] = "actions.open_external",
+ ["g."] = "actions.toggle_hidden",
+ ["g\\"] = "actions.toggle_trash",
+ },
+ -- Set to false to disable all of the above keymaps
+ use_default_keymaps = true,
+ view_options = {
+ -- Show files and directories that start with "."
+ show_hidden = false,
+ -- This function defines what is considered a "hidden" file
+ is_hidden_file = function(name, bufnr)
+ return vim.startswith(name, ".")
+ end,
+ -- This function defines what will never be shown, even when `show_hidden` is set
+ is_always_hidden = function(name, bufnr)
+ return false
+ end,
+ -- Sort file names in a more intuitive order for humans. Is less performant,
+ -- so you may want to set to false if you work with large directories.
+ natural_order = true,
+ sort = {
+ -- sort order can be "asc" or "desc"
+ -- see :help oil-columns to see which columns are sortable
+ { "type", "asc" },
+ { "name", "asc" },
+ },
+ },
+ -- Extra arguments to pass to SCP when moving/copying files over SSH
+ extra_scp_args = {},
+ -- EXPERIMENTAL support for performing file operations with git
+ git = {
+ -- Return true to automatically git add/mv/rm files
+ add = function(path)
+ return false
+ end,
+ mv = function(src_path, dest_path)
+ return false
+ end,
+ rm = function(path)
+ return false
+ end,
+ },
+ -- Configuration for the floating window in oil.open_float
+ float = {
+ -- Padding around the floating window
+ padding = 2,
+ max_width = 0,
+ max_height = 0,
+ border = "rounded",
+ win_options = {
+ winblend = 0,
+ },
+ -- This is the config that will be passed to nvim_open_win.
+ -- Change values here to customize the layout
+ override = function(conf)
+ return conf
+ end,
+ },
+ -- Configuration for the actions floating preview window
+ preview = {
+ -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
+ -- min_width and max_width can be a single value or a list of mixed integer/float types.
+ -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
+ max_width = 0.9,
+ -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
+ min_width = { 40, 0.4 },
+ -- optionally define an integer/float for the exact width of the preview window
+ width = nil,
+ -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
+ -- min_height and max_height can be a single value or a list of mixed integer/float types.
+ -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
+ max_height = 0.9,
+ -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
+ min_height = { 5, 0.1 },
+ -- optionally define an integer/float for the exact height of the preview window
+ height = nil,
+ border = "rounded",
+ win_options = {
+ winblend = 0,
+ },
+ -- Whether the preview window is automatically updated when the cursor is moved
+ update_on_cursor_moved = true,
+ },
+ -- Configuration for the floating progress window
+ progress = {
+ max_width = 0.9,
+ min_width = { 40, 0.4 },
+ width = nil,
+ max_height = { 10, 0.9 },
+ min_height = { 5, 0.1 },
+ height = nil,
+ border = "rounded",
+ minimized_border = "none",
+ win_options = {
+ winblend = 0,
+ },
+ },
+ -- Configuration for the floating SSH window
+ ssh = {
+ border = "rounded",
+ },
+ -- Configuration for the floating keymaps help window
+ keymaps_help = {
+ border = "rounded",
+ },
+ })
+ end
diff --git a/lua/config/options.lua b/lua/config/options.lua
new file mode 100644
index 0000000..fbc53bc
--- /dev/null
+++ b/lua/config/options.lua
@@ -0,0 +1,44 @@
+vim.g.mapleader = ","
+vim.opt.backup = false -- creates a backup file
+vim.opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
+vim.opt.cmdheight = 1 -- more space in the neovim command line for displaying messages
+vim.opt.completeopt = { "menuone", "noselect" } -- mostly just for cmp
+vim.opt.conceallevel = 0 -- so that `` is visible in markdown files
+vim.opt.fileencoding = "utf-8" -- the encoding written to a file
+vim.opt.hlsearch = true -- highlight all matches on previous search pattern
+vim.opt.ignorecase = true -- ignore case in search patterns
+vim.opt.pumheight = 10 -- pop up menu height
+vim.opt.showmode = true -- we don't need to see things like -- INSERT -- anymore
+vim.opt.showtabline = 0 -- always show tabs
+vim.opt.smartcase = true -- smart case
+vim.opt.smartindent = true -- make indenting smarter again
+vim.opt.splitbelow = true -- force all horizontal splits to go below current window
+vim.opt.splitright = true -- force all vertical splits to go to the right of current window
+vim.opt.swapfile = false -- creates a swapfile
+vim.opt.termguicolors = true -- set term gui colors (most terminals support this)
+vim.opt.timeoutlen = 1000 -- time to wait for a mapped sequence to complete (in milliseconds)
+vim.opt.undofile = true -- enable persistent undo
+vim.opt.updatetime = 300 -- faster completion (4000ms default)
+vim.opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
+vim.opt.expandtab = true -- convert tabs to spaces
+vim.opt.shiftwidth = 2 -- the number of spaces inserted for each indentation
+vim.opt.tabstop = 2 -- insert 2 spaces for a tab
+vim.opt.cursorline = true -- highlight the current line
+vim.opt.number = true -- set numbered lines
+vim.opt.laststatus = 3
+vim.opt.showcmd = false
+vim.opt.ruler = false
+vim.opt.numberwidth = 4 -- set number column width to 2 {default 4}
+vim.opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time
+vim.opt.wrap = false -- display lines as one long line
+vim.opt.scrolloff = 8 -- is one of my fav
+vim.opt.sidescrolloff = 8
+vim.opt.guifont = "monospace:h17" -- the font used in graphical neovim applications
+vim.opt.fillchars.eob=" "
+vim.opt.shortmess:append "c"
+vim.opt.whichwrap:append("<,>,[,],h,l")
+vim.opt.iskeyword:append("-")
+vim.cmd([[ let g:python_host_prog = /usr/bin/python
+ let g:python3_host_prog = /usr/bin/python3
+]])
+
diff --git a/lua/config/org.lua b/lua/config/org.lua
new file mode 100644
index 0000000..fa2dcf2
--- /dev/null
+++ b/lua/config/org.lua
@@ -0,0 +1,9 @@
+ require("orgmode").setup_ts_grammer()
+ require("nvim-treesitter.configs").setup{
+ ensure_installed = {'org'},
+ }
+ require("orgmode").setup({
+ org_agenda_files = {'/home/vgg/org/*'},
+ org_default_notes_file = {'/home/vgg/org/refile.org'}
+ })
+
diff --git a/lua/config/plugins-latex.lua b/lua/config/plugins-latex.lua
new file mode 100644
index 0000000..02d64f7
--- /dev/null
+++ b/lua/config/plugins-latex.lua
@@ -0,0 +1,6 @@
+table.insert(lvim.plugins, {
+ "lervag/vimtex",
+ "kdheepak/cmp-latex-symbols",
+ "KeitaNakamura/tex-conceal.vim",
+ "SirVer/ultisnips",
+})
diff --git a/lua/config/plugins.lua b/lua/config/plugins.lua
new file mode 100644
index 0000000..5399333
--- /dev/null
+++ b/lua/config/plugins.lua
@@ -0,0 +1,225 @@
+table.insert(lvim.plugins, {
+ "ChristianChiarulli/swenv.nvim",
+ "stevearc/dressing.nvim",
+
+ {"akinsho/toggleterm.nvim", config = true},
+
+ "mfussenegger/nvim-dap-python",
+ "nvim-neotest/neotest",
+ "nvim-neotest/neotest-python",
+ "tpope/vim-fugitive",
+ "tpope/vim-rhubarb",
+ {
+ 'stevearc/oil.nvim',
+ opts = {},
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+
+ config = function ()
+ require("oil").setup({
+ default_file_explorer = true,
+ })
+ end
+ },
+ {
+ "chrishrb/gx.nvim",
+ keys = { { "gx", "<cmd>Browse<cr>", mode = { "n", "x" } } },
+ cmd = { "Browse" },
+ init = function ()
+ vim.g.netrw_nogx = 1 -- disable netrw gx
+ end,
+ dependencies = { "nvim-lua/plenary.nvim" },
+ submodules = false, -- not needed, submodules are required only for tests
+
+ -- you can specify also another config if you want
+ config = function() require("gx").setup {
+ open_browser_app = "xdg-open", -- specify your browser app; default for macOS is "open", Linux "xdg-open" and Windows "powershell.exe"
+ -- open_browser_args = { "--background" }, -- specify any arguments, such as --background for macOS' "open".
+ handlers = {
+ plugin = true, -- open plugin links in lua (e.g. packer, lazy, ..)
+ github = true, -- open github issues
+ package_json = true, -- open dependencies from package.json
+ search = true, -- search the web/selection on the web if nothing else is found
+ go = true, -- open pkg.go.dev from an import statement (uses treesitter)
+ },
+ handler_options = {
+ search_engine = "https://search.brave.com/search?q=", -- or you can pass in a custom search engine
+ select_for_search = false, -- if your cursor is e.g. on a link, the pattern for the link AND for the word will always match. This disables this behaviour for default so that the link is opened without the select option for the word AND link
+ },
+ } end,
+ },
+ {"vimwiki/vimwiki",
+ init = function()
+ vim.g.vimwiki_list = {
+ {
+ path = '~/vimwiki.md/',
+ syntax = 'markdown',
+ ext = '.md',
+ },
+ }
+ end
+ },
+ {"dccsillag/magma-nvim",
+ -- run = ":UpdateRemotePlugins",
+ config = function()
+ vim.cmd([[nnoremap <silent> <leader>mk :MagmaInit Python3<CR>
+ nnoremap <silent> <leader>m :MagmaEvaluateOperator<CR>
+ nnoremap <silent> <leader>mm :MagmaEvaluateLine<CR>
+ xnoremap <silent> <leader>m :<C-u>MagmaEvaluateVisual<CR>
+ nnoremap <silent> <leader>mc :MagmaReevaluateCell<CR>
+ nnoremap <silent> <leader>md :MagmaDelete<CR>
+ nnoremap <silent> <leader>mo :MagmaShowOutput<CR>
+ nnoremap <silent> <leader>ms :MagmaSave<CR>
+
+ let g:magma_automatically_open_output = v:false
+ let g:magma_image_provider = "ueberzug"
+ let g:magma_save_path = "~/tmp/magma"
+ ]])
+ end,
+ },
+
+ "goerz/jupytext.vim",
+ "untitled-ai/jupyter_ascending.vim",
+
+ {
+ 'nvim-orgmode/orgmode',
+ -- dependencies = {
+ -- { 'nvim-treesitter/nvim-treesitter', lazy = true },
+ -- },
+ event = 'VeryLazy',
+ config = function()
+ -- -- Load treesitter grammar for org
+ -- require('orgmode').setup_ts_grammar()
+
+ -- -- Setup treesitter
+ -- require('nvim-treesitter.configs').setup({
+ -- highlight = {
+ -- enable = true,
+ -- },
+ -- ensure_installed = { 'org' },
+ -- })
+
+ -- Setup Orgmode
+ require('orgmode').setup({
+ org_agenda_files = '~/Orgmode/**/*',
+ org_default_notes_file = '~/Orgmode/refile.org',
+ mappings = {
+ org_return_uses_meta_return = true,
+
+ },
+ })
+ end
+ },
+ "kdheepak/cmp-latex-symbols",
+ "KeitaNakamura/tex-conceal.vim",
+ {"f3fora/nvim-texlabconfig",
+ config = function()
+ require("texlabconfig").setup()
+ end,
+ ft = { 'tex', 'bib' }, -- Lazy-load on filetype
+ build = 'go build'
+ },
+ {"lervag/vimtex",
+ init = function()
+
+ vim.cmd([[
+ let g:tex_flavor = 'latex'
+ let g:vimtex_view_method = 'zathura'
+ let g:vimtex_quickfix_mode = 0
+ let g:vimtex_cache_persistent = 0
+ set conceallevel=1
+ let g:tex_conceal = 'abdmg'
+
+ ]])
+ vim.keymap.set('i', '<C-f>', [[<Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"'<CR><CR>:w<CR> ]])
+ vim.keymap.set('n', '<C-f>', [[: silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &'<CR><CR>:redraw!<CR>]])
+ -- vim.api.nvim_create_autocmd("BufEnter",{
+ -- callback = function()
+ -- vim.fn.system({
+ -- "inkscape-figures",
+ -- "watch"
+ -- })
+ -- end,
+ -- })
+ end
+ },
+ -- {
+ -- "xiyaowong/link-visitor.nvim",
+ -- config = function ()
+ -- require("link-visitor").setup({
+ -- open_cmd = nil,
+ -- silent = true, -- disable all prints, `false` by defaults skip_confirmation
+ -- skip_confirmation = false, -- Skip the confirmation step, default: false
+ -- border = "rounded" -- none, single, double, rounded, solid, shadow see `:h nvim_open_win()`
+ -- })
+ -- end
+ -- },
+ {
+ "vhyrro/luarocks.nvim",
+ priority = 1000,
+ opts = {
+ rocks = { "fzy", "pathlib.nvim", },
+ },
+ config = true,
+
+ },
+ "nvim-neorg/neorg-telescope",
+ { "nvim-neorg/neorg",
+ ft = "norg",
+
+ lazy = false, -- specify lazy = false because some lazy.nvim distributions set lazy = true by default
+ -- dependencies = { "luarocks.nvim" },
+ -- tag = "*",
+ dependencies = {
+ { "luarocks.nvim" },
+ -- { 'nvim-lua/plenary.nvim' },
+ { 'nvim-treesitter/nvim-treesitter' },
+ { 'nvim-neorg/tree-sitter-norg' },
+ { 'nvim-treesitter/nvim-treesitter-textobjects' },
+ { 'hrsh7th/nvim-cmp' },
+ { 'nvim-neorg/neorg-telescope' },
+ { 'tamton-aquib/neorg-jupyter' },
+ { "pysan3/neorg-templates", dependencies = { "L3MON4D3/LuaSnip" } },
+ { 'pritchett/neorg-capture' },
+ { 'nvim-neorg/neorg-gtd' },
+ },
+ -- build = ":Neorg sync-parsers",
+ cmd = "Neorg",
+ config = function()
+ -- -- Setup treesitter
+ require('nvim-treesitter.configs').setup({
+ highlight = {
+ enable = true,
+ }
+ })
+ require("neorg").setup {
+ load = {
+ ["core.defaults"] = {},
+ ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" }, },
+ ["core.integrations.nvim-cmp"] = {},
+ ["core.integrations.telescope"] = {},
+ ["core.concealer"] = { config = { icon_preset = "diamond" } },
+ ["core.keybinds"] = {
+ config = {
+ default_keybinds = true,
+ neorg_leader = "<Leader>",
+ LocalLeader = "<Leader>",
+ },
+ },
+ ["core.dirman"] = { -- Manages Neorg workspaces
+ config = {
+ workspaces = {
+ notes = "~/Notes",
+ tutorial = "~/Notes/Norg-Tutorial",
+ uh = "~/Notes/UH",
+ },
+ default_workspace = "notes",
+ use_popup = true,
+ },
+ },
+ ["core.ui.calendar"] = {},
+ ["external.jupyter"] = {}
+ },
+ }
+ end
+ },
+})
diff --git a/lua/config/python-debug.lua b/lua/config/python-debug.lua
new file mode 100644
index 0000000..d264ac1
--- /dev/null
+++ b/lua/config/python-debug.lua
@@ -0,0 +1,6 @@
+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)
+
diff --git a/lua/config/python-testing.lua b/lua/config/python-testing.lua
new file mode 100644
index 0000000..729bcdf
--- /dev/null
+++ b/lua/config/python-testing.lua
@@ -0,0 +1,15 @@
+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",
+ })
+ }
+})
+
diff --git a/lua/config/python-which_key.lua b/lua/config/python-which_key.lua
new file mode 100644
index 0000000..d51240b
--- /dev/null
+++ b/lua/config/python-which_key.lua
@@ -0,0 +1,25 @@
+lvim.builtin.which_key.mappings["dm"] = { "<cmd>lua require('neotest').run.run()<cr>",
+ "Test Method" }
+lvim.builtin.which_key.mappings["dM"] = { "<cmd>lua require('neotest').run.run({strategy = 'dap'})<cr>",
+ "Test Method DAP" }
+lvim.builtin.which_key.mappings["df"] = {
+ "<cmd>lua require('neotest').run.run({vim.fn.expand('%')})<cr>", "Test Class" }
+lvim.builtin.which_key.mappings["dF"] = {
+ "<cmd>lua require('neotest').run.run({vim.fn.expand('%'), strategy = 'dap'})<cr>", "Test Class DAP" }
+lvim.builtin.which_key.mappings["dS"] = { "<cmd>lua require('neotest').summary.toggle()<cr>", "Test Summary" }
+
+-- binding for switching
+lvim.builtin.which_key.mappings["P"] = {
+ name = "Python",
+ e = { "<cmd>lua require('swenv.api').pick_venv()<cr>", "Choose Env" },
+ dm = { "<cmd>lua require('neotest').run.run()<cr>",
+ "Test Method" },
+ dM = { "<cmd>lua require('neotest').run.run({strategy = 'dap'})<cr>",
+ "Test Method DAP" },
+ df = {
+ "<cmd>lua require('neotest').run.run({vim.fn.expand('%')})<cr>", "Test Class" },
+ dF = {
+ "<cmd>lua require('neotest').run.run({vim.fn.expand('%'), strategy = 'dap'})<cr>", "Test Class DAP" },
+ dS = { "<cmd>lua require('neotest').summary.toggle()<cr>", "Test Summary" }
+}
+
diff --git a/lua/config/terminal-which_key.lua b/lua/config/terminal-which_key.lua
new file mode 100644
index 0000000..0063786
--- /dev/null
+++ b/lua/config/terminal-which_key.lua
@@ -0,0 +1,9 @@
+-- binding for switching
+lvim.builtin.which_key.mappings["t"] = {
+ name = "Terminal",
+ i = { "<cmd>lua require 'lvim.core.terminal'.ipython_toggle()<cr>", "Ipython" },
+ s = { "<cmd>lua require 'lvim.core.terminal'.scim_toggle()<cr>", "sc-im" },
+ t = { "<cmd>terminal<cr>", "Terminal" },
+ w = { "<cmd>lua require 'lvim.core.terminal'.w3m_toggle()<cr>", "w3m" },
+}
+
diff --git a/lua/config/terminal.lua b/lua/config/terminal.lua
new file mode 100644
index 0000000..43216be
--- /dev/null
+++ b/lua/config/terminal.lua
@@ -0,0 +1,168 @@
+config = function()
+active = true,
+on_config_done = nil,
+ -- size can be a number or function which is passed the current terminal
+size = 20,
+open_mapping = [[<c-\>]],
+ hide_numbers = true, -- hide the number column in toggleterm buffers
+ shade_filetypes = {},
+ shade_terminals = true,
+ shading_factor = 2, -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light
+ start_in_insert = true,
+ insert_mappings = true, -- whether or not the open mapping applies in insert mode
+ persist_size = false,
+ -- direction = 'vertical' | 'horizontal' | 'window' | 'float',
+ direction = "float",
+ close_on_exit = true, -- close the terminal window when the process exits
+ auto_scroll = true, -- automatically scroll to the bottom on terminal output
+ shell = nil, -- change the default shell
+ -- This field is only relevant if direction is set to 'float'
+ float_opts = {
+ -- The border key is *almost* the same as 'nvim_win_open'
+ -- see :h nvim_win_open for details on borders however
+ -- the 'curved' border is a custom border type
+ -- not natively supported but implemented in this plugin.
+ -- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
+ border = "curved",
+ -- width = <value>,
+ -- height = <value>,
+ winblend = 0,
+ highlights = {
+ border = "Normal",
+ background = "Normal",
+ },
+ },
+ winbar = {
+ enabled = false,
+ },
+ -- Add executables on the config.lua
+ -- { cmd, keymap, description, direction, size }
+ -- lvim.builtin.terminal.execs = {...} to overwrite
+ -- lvim.builtin.terminal.execs[#lvim.builtin.terminal.execs+1] = {"gdb", "tg", "GNU Debugger"}
+ -- TODO: pls add mappings in which key and refactor this
+ execs = {
+ { nil, "<M-1>", "Horizontal Terminal", "horizontal", 0.3 },
+ { nil, "<M-2>", "Vertical Terminal", "vertical", 0.4 },
+ { nil, "<M-3>", "Float Terminal", "float", nil },
+ },
+ }
+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 number
+---@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
+
+init = function()
+ for i, exec in pairs(lvim.builtin.terminal.execs) do
+ local direction = exec[4] or lvim.builtin.terminal.direction
+
+ local opts = {
+ cmd = exec[1] or lvim.builtin.terminal.shell or vim.o.shell,
+ keymap = exec[2],
+ label = exec[3],
+ -- NOTE: unable to consistently bind id/count <= 9, see #2146
+ count = i + 100,
+ direction = direction,
+ size = function()
+ return get_dynamic_terminal_size(direction, exec[5])
+ end,
+ }
+
+ M.add_exec(opts)
+ end
+end
+
+setup = function()
+ local terminal = require "toggleterm"
+ terminal.setup(lvim.builtin.terminal)
+ if lvim.builtin.terminal.on_config_done then
+ lvim.builtin.terminal.on_config_done(terminal)
+ end
+end
+
+add_exec = function(opts)
+ local binary = opts.cmd:match "(%S+)"
+ if vim.fn.executable(binary) ~= 1 then
+ Log:debug("Skipping configuring executable " .. binary .. ". Please make sure it is installed properly.")
+ return
+ end
+
+ vim.keymap.set({ "n", "t" }, opts.keymap, function()
+ M._exec_toggle { cmd = opts.cmd, count = opts.count, direction = opts.direction, size = opts.size() }
+ end, { desc = opts.label, noremap = true, silent = true })
+end
+
+_exec_toggle = function(opts)
+ local Terminal = require("toggleterm.terminal").Terminal
+ local term = Terminal:new { cmd = opts.cmd, count = opts.count, direction = opts.direction }
+ term:toggle(opts.size, opts.direction)
+end
+
+---Toggles a log viewer according to log.viewer.layout_config
+---@param logfile string the fullpath to the logfile
+toggle_log_view = function(logfile)
+ local log_viewer = lvim.log.viewer.cmd
+ if vim.fn.executable(log_viewer) ~= 1 then
+ log_viewer = "less +F"
+ end
+ Log:debug("attempting to open: " .. logfile)
+ log_viewer = log_viewer .. " " .. logfile
+ local term_opts = vim.tbl_deep_extend("force", lvim.builtin.terminal, {
+ cmd = log_viewer,
+ open_mapping = lvim.log.viewer.layout_config.open_mapping,
+ direction = lvim.log.viewer.layout_config.direction,
+ -- TODO: this might not be working as expected
+ size = lvim.log.viewer.layout_config.size,
+ float_opts = lvim.log.viewer.layout_config.float_opts,
+ })
+
+ local Terminal = require("toggleterm.terminal").Terminal
+ local log_view = Terminal:new(term_opts)
+ log_view:toggle()
+end
+
+lazygit_toggle = function()
+ local Terminal = require("toggleterm.terminal").Terminal
+ local lazygit = Terminal:new {
+ cmd = "lazygit",
+ hidden = true,
+ direction = "float",
+ float_opts = {
+ border = "none",
+ width = 100000,
+ height = 100000,
+ zindex = 200,
+ },
+ on_open = function(_)
+ vim.cmd "startinsert!"
+ end,
+ on_close = function(_) end,
+ count = 99,
+ }
+ lazygit:toggle()
+end
diff --git a/lua/config/test.lua b/lua/config/test.lua
new file mode 100644
index 0000000..7cbcffb
--- /dev/null
+++ b/lua/config/test.lua
@@ -0,0 +1,4 @@
+local home_dir = "/home/vgg/"
+local buf_dir = vim.fs.dirname(vim.fn.bufname())
+local fig_dir = "/figures/"
+vim.fn.system("echo ", fig_dir)
diff --git a/lua/config/texcmp.lua b/lua/config/texcmp.lua
new file mode 100644
index 0000000..0599bd5
--- /dev/null
+++ b/lua/config/texcmp.lua
@@ -0,0 +1,7 @@
+vim.api.nvim_create_autocmd("FileType", {
+ group = vim.api.nvim_create_augroup("LaTeXGroup", { clear = true }),
+ pattern = "tex",
+ callback = function()
+ require("user.cmp")
+ end,
+})
diff --git a/lua/config/texlab.lua b/lua/config/texlab.lua
new file mode 100644
index 0000000..c38a5bb
--- /dev/null
+++ b/lua/config/texlab.lua
@@ -0,0 +1,20 @@
+local lspconfig = require("lspconfig")
+local forwardSearch_args = {'--synctex-forward', '%l:1:%f', '%p'}
+
+lspconfig.texlab.setup({
+ settings = {
+ texlab = {
+ auxDirectory = ".",
+ bibtexFormatter = "texlab",
+ build = {
+ args = { "-pv", "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
+ executable = "latexmk",
+ onSave = true
+ },
+ forwardSearch = {
+ executable = "zathura",
+ args = forwardSearch_args
+ },
+ },
+ },
+})
diff --git a/lua/config/toggleterm.lua b/lua/config/toggleterm.lua
new file mode 100644
index 0000000..8da0bc9
--- /dev/null
+++ b/lua/config/toggleterm.lua
@@ -0,0 +1,77 @@
+local status_ok, toggleterm = pcall(require, "toggleterm")
+if not status_ok then
+ return
+end
+
+toggleterm.setup({
+ size = function(term)
+ if term.direction == "horizontal" then
+ return 20
+ elseif term.direction == "vertical" then
+ return vim.o.columns * 0.45
+ end
+ end,
+ open_mapping = [[<c-\>]],
+ hide_numbers = true,
+ shade_filetypes = {},
+ shade_terminals = true,
+ shading_factor = 2,
+ start_in_insert = true,
+ insert_mappings = true,
+ persist_size = true,
+ direction = "vertical",
+ close_on_exit = true,
+ shell = vim.o.shell,
+ float_opts = {
+ border = "curved",
+ winblend = 0,
+ highlights = {
+ border = "Normal",
+ background = "Normal",
+ },
+ },
+})
+
+function _G.set_terminal_keymaps()
+ local opts = {noremap = true}
+ vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
+ vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
+ vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
+ vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
+ vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
+ vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
+end
+
+vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
+
+local Terminal = require("toggleterm.terminal").Terminal
+local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
+
+function _LAZYGIT_TOGGLE()
+ lazygit:toggle()
+end
+
+local node = Terminal:new({ cmd = "node", hidden = true })
+
+function _NODE_TOGGLE()
+ node:toggle()
+end
+
+local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
+
+function _NCDU_TOGGLE()
+ ncdu:toggle()
+end
+
+local htop = Terminal:new({ cmd = "htop", hidden = true })
+
+function _HTOP_TOGGLE()
+ htop:toggle()
+end
+
+local python = Terminal:new({ cmd = "python", hidden = true })
+
+function _PYTHON_TOGGLE()
+ python:toggle()
+end
+
diff --git a/lua/config/ultisnip.lua b/lua/config/ultisnip.lua
new file mode 100644
index 0000000..3b5dee9
--- /dev/null
+++ b/lua/config/ultisnip.lua
@@ -0,0 +1,9 @@
+vim.cmd([[
+ let g:UltiSnipsExpandTrigger="<CR>"
+ let g:UltiSnipsJumpForwardTrigger="<Plug>(ultisnips_jump_forward)"
+ let g:UltiSnipsJumpBackwardTrigger="<Plug>(ultisnips_jump_backward)"
+ let g:UltiSnipsListSnippets="<c-x><c-s>"
+ let g:UltiSnipsRemoveSelectModeMappings=0
+ let g:UltiSnipsEditSplit="tabdo"
+ let g:UltiSnipsSnippetDirectories=[$HOME."/.config/lvim/UltiSnips"]
+]])
diff --git a/lua/config/vimtex.lua b/lua/config/vimtex.lua
new file mode 100644
index 0000000..4818bc2
--- /dev/null
+++ b/lua/config/vimtex.lua
@@ -0,0 +1,2 @@
+vim.g.vimtex_view_method = "zathura"
+vim.g.vimtex_quickfix_enabled = 0
diff --git a/lua/config/vimwiki-which_key.lua b/lua/config/vimwiki-which_key.lua
new file mode 100644
index 0000000..cbe1aa4
--- /dev/null
+++ b/lua/config/vimwiki-which_key.lua
@@ -0,0 +1,6 @@
+lvim.builtin.which_key.mappings["W"] = {
+ name = "Vimwiki",
+ i = { "<cmd>VimwikiIndex<CR>", "Vimwiki Index" },
+ d = { "<cmd>VimwikiDiaryIndex<CR>", "Vimwiki Diary Index" },
+ s = { "<cmd>VimwikiUISelect<CR>", "Vimwiki Select" },
+ }
diff --git a/lua/config/vimwiki.lua b/lua/config/vimwiki.lua
new file mode 100644
index 0000000..60db7f8
--- /dev/null
+++ b/lua/config/vimwiki.lua
@@ -0,0 +1,14 @@
+vim.g.vimwiki_list = {'/home/vgg/vimwiki.md'}
+vim.g.vimwiki_ext2syntax = {
+ ['.md'] = 'markdown',
+ ['.markdown'] = 'markdown',
+ ['.mdown'] = 'markdown',
+ ['.wiki'] = 'markdown',
+}
+vim.g.vimwiki_global_ext = 0 -- don't treat all md files as vimwiki (0)
+vim.g.vimwiki_folding = "list"
+vim.g.vimwiki_hl_headers = 1 -- use alternating colours for different heading levels
+vim.g.vimwiki_markdown_link_ext = 1 -- add markdown file extension when generating links
+vim.g.taskwiki_markdown_syntax = "markdown"
+vim.g.indentLine_conceallevel = 2 -- indentline controlls concel
+--vim.set.o.conceallevel = 1 -- so that I can see `` and full urls in markdown files
diff --git a/lua/config/which_key_config.lua b/lua/config/which_key_config.lua
new file mode 100644
index 0000000..4083ebc
--- /dev/null
+++ b/lua/config/which_key_config.lua
@@ -0,0 +1,272 @@
+local status_ok, which_key = pcall(require, "which-key")
+if not status_ok then
+ return
+end
+
+local setup = {
+ plugins = {
+ marks = true, -- shows a list of your marks on ' and `
+ registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
+ spelling = {
+ enabled = true,
+ suggestions = 20,
+ }, -- use which-key for spelling hints
+ -- the presets plugin, adds help for a bunch of default keybindings in Neovim
+ -- No actual key bindings are created
+ presets = {
+ operators = false, -- adds help for operators like d, y, ...
+ motions = true, -- adds help for motions
+ text_objects = true, -- help for text objects triggered after entering an operator
+ windows = true, -- default bindings on <c-w>
+ nav = true, -- misc bindings to work with windows
+ z = true, -- bindings for folds, spelling and others prefixed with z
+ g = true, -- bindings for prefixed with g
+ },
+ },
+ -- add operators that will trigger motion and text object completion
+ -- to enable all native operators, set the preset / operators plugin above
+ -- operators = { gc = "Comments" },
+ key_labels = {
+ -- override the label used to display some keys. It doesn't effect WK in any other way.
+ -- For example:
+ -- ["<space>"] = "SPC",
+ -- ["<cr>"] = "RET",
+ -- ["<tab>"] = "TAB",
+ },
+ icons = {
+ breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
+ separator = "", -- symbol used between a key and it's label
+ group = "", -- symbol prepended to a group
+ },
+ popup_mappings = {
+ scroll_down = "<c-d>", -- binding to scroll down inside the popup
+ scroll_up = "<c-u>", -- binding to scroll up inside the popup
+ },
+ window = {
+ border = "single", -- none, single, double, shadow
+ position = "bottom", -- bottom, top
+ margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
+ padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
+ winblend = 0,
+ },
+ layout = {
+ height = { min = 4, max = 25 }, -- min and max height of the columns
+ width = { min = 20, max = 50 }, -- min and max width of the columns
+ spacing = 3, -- spacing between columns
+ align = "left", -- align columns left, center or right
+ },
+ ignore_missing = true, -- enable this to hide mappings for which you didn't specify a label
+ hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate
+ show_help = true, -- show help message on the command line when the popup is visible
+ show_keys = true, -- show the currently pressed key and its label as a message in the command line
+ triggers = "auto", -- automatically setup triggers
+ -- triggers = {"<leader>"} -- or specify a list manually
+ triggers_blacklist = {
+ -- list of mode / prefixes that should never be hooked by WhichKey
+ -- this is mostly relevant for key maps that start with a native binding
+ -- most people should not need to change this
+ i = { "j", "k" },
+ v = { "j", "k" },
+ },
+ -- disable the WhichKey popup for certain buf types and file types.
+ -- Disabled by default for Telescope
+ disable = {
+ buftypes = {},
+ filetypes = { "TelescopePrompt" },
+ },
+ }
+
+local opts = {
+ mode = "n", -- NORMAL mode
+ prefix = "<leader>",
+ buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+ silent = true, -- use `silent` when creating keymaps
+ noremap = true, -- use `noremap` when creating keymaps
+ nowait = true, -- use `nowait` when creating keymaps
+ }
+
+-- local vopts = {
+-- mode = "v", -- VISUAL mode
+-- prefix = "<leader>",
+-- buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+-- silent = true, -- use `silent` when creating keymaps
+-- noremap = true, -- use `noremap` when creating keymaps
+-- nowait = true, -- use `nowait` when creating keymaps
+-- }
+
+ -- NOTE: Prefer using : over <cmd> as the latter avoids going back in normal-mode.
+ -- see https://neovim.io/doc/user/map.html#:map-cmd
+-- local vmappings = {
+-- ["/"] = { "<Plug>(comment_toggle_linewise_visual)", "Comment toggle linewise (visual)" },
+-- l = {
+-- name = "LSP",
+-- a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
+-- },
+-- g = {
+-- name = "Git",
+-- r = { "<cmd>Gitsigns reset_hunk<cr>", "Reset Hunk" },
+-- s = { "<cmd>Gitsigns stage_hunk<cr>", "Stage Hunk" },
+-- },
+-- }
+--
+local mappings = {
+ [";"] = { "<cmd>Alpha<CR>", "Dashboard" },
+ ["w"] = { "<cmd>w!<CR>", "Save" },
+ ["q"] = { "<cmd>confirm q<CR>", "Quit" },
+ ["/"] = { "<Plug>(comment_toggle_linewise_current)", "Comment toggle current line" },
+ ["c"] = { "<cmd>BufferKill<CR>", "Close Buffer" },
+ ["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" },
+ ["e"] = { "<cmd>NvimTreeToggle<CR>", "Explorer" },
+ ["v"] = { "<cmd>edit /home/vgg/.config/nvim/init.lua<CR>", "Edit config" },
+ b = {
+ name = "Buffers",
+ j = { "<cmd>BufferLinePick<cr>", "Jump" },
+ f = { "<cmd>Telescope buffers previewer=false<cr>", "Find" },
+ b = { "<cmd>BufferLineCyclePrev<cr>", "Previous" },
+ n = { "<cmd>BufferLineCycleNext<cr>", "Next" },
+ W = { "<cmd>noautocmd w<cr>", "Save without formatting (noautocmd)" },
+ -- w = { "<cmd>BufferWipeout<cr>", "Wipeout" }, -- TODO: implement this for bufferline
+ e = {
+ "<cmd>BufferLinePickClose<cr>",
+ "Pick which buffer to close",
+ },
+ h = { "<cmd>BufferLineCloseLeft<cr>", "Close all to the left" },
+ l = {
+ "<cmd>BufferLineCloseRight<cr>",
+ "Close all to the right",
+ },
+ D = {
+ "<cmd>BufferLineSortByDirectory<cr>",
+ "Sort by directory",
+ },
+ L = {
+ "<cmd>BufferLineSortByExtension<cr>",
+ "Sort by language",
+ },
+ },
+ d = {
+ name = "Debug",
+ t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" },
+ b = { "<cmd>lua require'dap'.step_back()<cr>", "Step Back" },
+ c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" },
+ C = { "<cmd>lua require'dap'.run_to_cursor()<cr>", "Run To Cursor" },
+ d = { "<cmd>lua require'dap'.disconnect()<cr>", "Disconnect" },
+ g = { "<cmd>lua require'dap'.session()<cr>", "Get Session" },
+ i = { "<cmd>lua require'dap'.step_into()<cr>", "Step Into" },
+ o = { "<cmd>lua require'dap'.step_over()<cr>", "Step Over" },
+ u = { "<cmd>lua require'dap'.step_out()<cr>", "Step Out" },
+ p = { "<cmd>lua require'dap'.pause()<cr>", "Pause" },
+ r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Toggle Repl" },
+ s = { "<cmd>lua require'dap'.continue()<cr>", "Start" },
+ q = { "<cmd>lua require'dap'.close()<cr>", "Quit" },
+ U = { "<cmd>lua require'dapui'.toggle({reset = true})<cr>", "Toggle UI" },
+ },
+ p = {
+ name = "Plugins",
+ i = { "<cmd>Lazy install<cr>", "Install" },
+ s = { "<cmd>Lazy sync<cr>", "Sync" },
+ S = { "<cmd>Lazy clear<cr>", "Status" },
+ c = { "<cmd>Lazy clean<cr>", "Clean" },
+ u = { "<cmd>Lazy update<cr>", "Update" },
+ p = { "<cmd>Lazy profile<cr>", "Profile" },
+ l = { "<cmd>Lazy log<cr>", "Log" },
+ d = { "<cmd>Lazy debug<cr>", "Debug" },
+ },
+--
+-- -- -- " Available Debug Adapters:
+-- -- -- " https://microsoft.github.io/debug-adapter-protocol/implementors/adapters/
+-- -- -- " Adapter configuration and installation instructions:
+-- -- -- " https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation
+-- -- -- " Debug Adapter protocol:
+-- -- -- " https://microsoft.github.io/debug-adapter-protocol/
+-- -- -- " Debugging
+-- ---- g = {
+-- ---- name = "Git",
+-- ---- j = { "<cmd>lua require 'gitsigns'.nav_hunk('next', {navigation_message = false})<cr>", "Next Hunk" },
+-- ---- k = { "<cmd>lua require 'gitsigns'.nav_hunk('prev', {navigation_message = false})<cr>", "Prev Hunk" },
+-- ---- l = { "<cmd>lua require 'gitsigns'.blame_line()<cr>", "Blame" },
+-- ---- L = { "<cmd>lua require 'gitsigns'.blame_line({full=true})<cr>", "Blame Line (full)" },
+-- ---- p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
+-- ---- r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
+-- ---- R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
+-- ---- s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
+-- ---- u = {
+-- ---- "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>",
+-- ---- "Undo Stage Hunk",
+-- ---- },
+-- ---- o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
+-- ---- b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
+-- ---- c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
+-- ---- C = {
+-- ---- "<cmd>Telescope git_bcommits<cr>",
+-- ---- "Checkout commit(for current file)",
+-- ---- },
+-- ---- d = {
+-- ---- "<cmd>Gitsigns diffthis HEAD<cr>",
+-- ---- "Git Diff",
+-- ---- },
+-- ---- },
+ l = {
+ name = "LSP",
+ a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
+ d = { "<cmd>Telescope diagnostics bufnr=0 theme=get_ivy<cr>", "Buffer Diagnostics" },
+ w = { "<cmd>Telescope diagnostics<cr>", "Diagnostics" },
+ i = { "<cmd>LspInfo<cr>", "Info" },
+ I = { "<cmd>Mason<cr>", "Mason Info" },
+ j = {
+ "<cmd>lua vim.diagnostic.goto_next()<cr>",
+ "Next Diagnostic",
+ },
+ k = {
+ "<cmd>lua vim.diagnostic.goto_prev()<cr>",
+ "Prev Diagnostic",
+ },
+ l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
+ q = { "<cmd>lua vim.diagnostic.setloclist()<cr>", "Quickfix" },
+ r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
+ s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
+ S = {
+ "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>",
+ "Workspace Symbols",
+ },
+ e = { "<cmd>Telescope quickfix<cr>", "Telescope Quickfix" },
+ },
+ s = {
+ name = "Search",
+ b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
+ c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
+ f = { "<cmd>Telescope find_files<cr>", "Find File" },
+ h = { "<cmd>Telescope help_tags<cr>", "Find Help" },
+ H = { "<cmd>Telescope highlights<cr>", "Find highlight groups" },
+ M = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
+ r = { "<cmd>Telescope oldfiles<cr>", "Open Recent File" },
+ R = { "<cmd>Telescope registers<cr>", "Registers" },
+ t = { "<cmd>Telescope live_grep<cr>", "Text" },
+ k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
+ C = { "<cmd>Telescope commands<cr>", "Commands" },
+ l = { "<cmd>Telescope resume<cr>", "Resume last search" },
+ p = {
+ "<cmd>lua require('telescope.builtin').colorscheme({enable_preview = true})<cr>",
+ "Colorscheme with Preview",
+ },
+ },
+ T = {
+ name = "Treesitter",
+ i = { ":TSConfigInfo<cr>", "Info" },
+ },
+ t = {
+ name = "Terminal",
+ t = { "<cmd>terminal<cr>", "Terminal" },
+ g = { "<cmd>lua require 'user.terminal'.lazygit_toggle()<cr>", "LazyGit" },
+ i = { "<cmd>lua require 'user.terminal'.ipython_toggle()<cr>", "IPython" },
+ s = { "<cmd>lua require 'user.terminal'.scim_toggle()<cr>", "sc-im" },
+ w = { "<cmd>lua require 'user.terminal'.w3m_toggle()<cr>", "w3m" },
+ }
+
+
+
+ },
+
+ which_key.setup(setup)
+ which_key.register(mappings, opts)
+-- which_key.register(vmappings, vopts)