From c959b2112fb4c82b5bfd410df21706455225bd40 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 3 Jul 2024 17:03:56 +0100 Subject: minor additions --- lua/plugins.lua | 522 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 522 insertions(+) create mode 100644 lua/plugins.lua (limited to 'lua/plugins.lua') diff --git a/lua/plugins.lua b/lua/plugins.lua new file mode 100644 index 0000000..6274b1a --- /dev/null +++ b/lua/plugins.lua @@ -0,0 +1,522 @@ +require("lazy").setup({ + -- + -- ColourScheme Setup + -- + { + "rebelot/kanagawa.nvim", + config = function() + vim.cmd.colorscheme("kanagawa-wave") + end, + }, + { + 'goolord/alpha-nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function () + require'alpha'.setup(require'alpha.themes.startify'.config) + end + }, + { + "sam4llis/nvim-lua-gf" + }, + + -- + -- Nvim-tree Setup + -- + { + "nvim-tree/nvim-tree.lua", + dependencies = { + "nvim-tree/nvim-web-devicons" + }, + config = function() + require("nvim-tree").setup({}) + end, + }, + + { + "nvim-tree/nvim-web-devicons", + }, + + -- + -- Telescope Setup + -- + { + "nvim-lua/plenary.nvim", + cmd = { "PlenaryBustedFile", "PlenaryBustedDirectory" }, + lazy = true + }, + { + 'nvim-telescope/telescope.nvim', + dependencies = { + "nvim-lua/plenary.nvim", + "telescope-fzf-native.nvim" + }, + lazy = true, + }, + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + lazy = true + }, + { + "folke/neodev.nvim", + lazy = true, + }, + + -- Autopairs + { + "windwp/nvim-autopairs", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "hrsh7th/nvim-cmp" + }, + }, + -- + -- Treesitter Setup + -- + { + "nvim-treesitter/nvim-treesitter", + config = function() + require("config.nvim_treesitter_config_setup") + end, + }, + { + "nvim-treesitter/nvim-treesitter-textobjects" + }, + -- + -- Language Server Setup + -- + { + "neovim/nvim-lspconfig", + lazy = true, + dependencies = { "mason-lspconfig.nvim", "nlsp-settings.nvim" }, + }, + { + "williamboman/mason.nvim", + config = function () + require("mason").setup() + end, + }, + { + "williamboman/mason-lspconfig.nvim", + dependencies = { "mason.nvim"}, + config = function () + require("config.mason_lspconfig_setup") + end, + }, + { + "tamago324/nlsp-settings.nvim", + lazy = true, + }, + { + "nvimtools/none-ls.nvim", + lazy = true, + }, + -- + -- Completion Engine Setup + -- + { + "hrsh7th/cmp-nvim-lsp", + lazy = true, + }, + { + "saadparwaiz1/cmp_luasnip", + lazy = true, + }, + { + "hrsh7th/cmp-buffer", + lazy = true, + }, + { + "hrsh7th/cmp-path", + lazy = true, + }, + { + "hrsh7th/cmp-cmdline", + lazy = true, + }, + { + "L3MON4D3/LuaSnip", + config = function() +-- require("luasnip.loaders.from_lua").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load() +-- require("luasnip.loaders.from_snipmate").lazy_load() + end, + event = "InsertEnter", + dependencies = { + "friendly-snippets", + }, + }, + { + "rafamadriz/friendly-snippets", + lazy = true + }, + { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "cmp-nvim-lsp", + "cmp-buffer", -- source for text in buffer + "cmp-path", -- source for file systems paths in commands + "L3MON4D3/LuaSnip", -- snippet engine + "saadparwaiz1/cmp_luasnip", -- for lua autocompletion + "rafamadriz/friendly-snippets", -- useful snippets engine + "onsails/lspkind.nvim", -- vs-code like pictograms + "cmp-cmdline", + }, + config = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + local lspkind = require("lspkind") + + -- loads vscode style snippets from installed plugins +-- require("luasnip.loaders.from_lua").lazy_load() + require("luasnip.loaders.from_vscode").lazy_load() +-- require("luasnip.loaders.from_snipmate").lazy_load() + + cmp.setup({ + completion = { + completeopt = "menu,menuone,preview,noselect", + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = false}), + }), + --sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths + }), + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...:", + }), + }, + }) + end + }, + -- + -- Whichkey + -- + { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + --require("config.which_key_config").setup({}) + }, + { + 'nvim-orgmode/orgmode', + dependencies = { + { 'nvim-treesitter/nvim-treesitter', lazy = true }, + }, + event = 'VeryLazy', + config = function() + -- 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 + }, + { + "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, + skip_confirm_for_simple_edits = true, + view_options = { + show_hidden = true, + natural_order = true, + is_always_hidden = function (name, _) + return name == '..' or name == '.git' + end, + }, + win_options = { + wrap = true, + } + }) + end + }, + { + "chrishrb/gx.nvim", + keys = { { "gx", "Browse", 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 + }, + { + "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', '', [[: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"':w ]]) + vim.keymap.set('n', '', [[: silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &':redraw!]]) + vim.api.nvim_create_autocmd("BufEnter",{ + callback = function() + vim.fn.system({ + "inkscape-figures", + "watch" + }) + end, + }) + 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" }, + { '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 = "", + LocalLeader = "", + }, + }, + ["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 + }, + { + "goerz/jupytext.vim", + }, + { + "untitled-ai/jupyter_ascending.vim", + }, + {"dccsillag/magma-nvim", + -- run = ":UpdateRemotePlugins", + config = function() + vim.cmd([[nnoremap mk :MagmaInit Python3 + nnoremap m :MagmaEvaluateOperator + nnoremap mm :MagmaEvaluateLine + xnoremap m :MagmaEvaluateVisual + nnoremap mc :MagmaReevaluateCell + nnoremap md :MagmaDelete + nnoremap mo :MagmaShowOutput + nnoremap ms :MagmaSave + + let g:magma_automatically_open_output = v:false + let g:magma_image_provider = "ueberzug" + let g:magma_save_path = "~/tmp/magma" + ]]) + end, + }, + -- Terminal + { + "akinsho/toggleterm.nvim", + config = function() + require("toggleterm").setup({ + open_mapping = [[]], + 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 = , + -- height = , + winblend = 0, + highlights = { + border = "Normal", + background = "Normal", + }, + }, + winbar = { + enabled = true, + }, + -- 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, "", "Horizontal Terminal", "horizontal", 0.3 }, + { nil, "", "Vertical Terminal", "vertical", 0.4 }, + { nil, "", "Float Terminal", "float", nil }, + }, + cmd = { + "ToggleTerm", + "TermExec", + "ToggleTermToggleAll", + "ToggleTermSendCurrentLine", + "ToggleTermSendVisualLines", + "ToggleTermSendVisualSelection", + }, + }) + end, + }, +}) -- cgit v1.2.3