From 676df7d0f3a8dc7d00d7de65355370255ee6fb50 Mon Sep 17 00:00:00 2001 From: afonso Date: Sun, 3 Mar 2024 16:58:37 +0000 Subject: [PATCH] [nvim] cleaned config a bit --- .config/nvim/lazy-lock.json | 36 ++-- .config/nvim/lua/plugins/autopairs.lua | 2 +- .config/nvim/lua/plugins/copilot.lua | 2 +- .config/nvim/lua/plugins/dap.lua | 29 ++++ .config/nvim/lua/plugins/jukit.lua | 2 + .config/nvim/lua/plugins/lazy.lua | 221 ++++--------------------- .config/nvim/lua/plugins/lspconfig.lua | 16 +- .config/nvim/lua/plugins/none-ls.lua | 4 - .config/nvim/lua/plugins/vimtex.lua | 4 +- 9 files changed, 103 insertions(+), 213 deletions(-) create mode 100644 .config/nvim/lua/plugins/dap.lua diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index c146ecc..206fd6a 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,6 +1,6 @@ { "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, - "catppuccin": { "branch": "main", "commit": "9703f227bfab20d04bcee62d2f08f1795723b4ae" }, + "catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" }, "cinnamon.nvim": { "branch": "master", "commit": "c406ffda3a0302f32c23b24ab756ea20467d6578" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, @@ -12,42 +12,46 @@ "copilot.lua": { "branch": "master", "commit": "03f825956ec49e550d07875d867ea6e7c4dc8c00" }, "distant.nvim": { "branch": "v0.3", "commit": "de7288b1af6fdb2d2e7a8aa00f07a236261c2491" }, "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, - "fidget.nvim": { "branch": "main", "commit": "4e854f3299e21d1c18279add340428a97520fc44" }, - "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" }, + "fidget.nvim": { "branch": "main", "commit": "60404ba67044c6ab01894dd5bf77bd64ea5e09aa" }, + "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, "gruvbox-material": { "branch": "master", "commit": "b17fe51688b76e2ccf118e5f76f3978b9a8c503e" }, "impatient.nvim": { "branch": "main", "commit": "47302af74be7b79f002773011f0d8e85679a7618" }, + "instant.nvim": { "branch": "master", "commit": "294b6d08143b3db8f9db7f606829270149e1a786" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "leap.nvim": { "branch": "main", "commit": "657752e806916a72b0da4b669506d93c49a0c82b" }, + "leap.nvim": { "branch": "main", "commit": "90ca1ded0608c891ba7a63de059ce5bc8533f060" }, "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "3614a39aae98ccd34124b072939d6283853b3dd2" }, - "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, + "mini.animate": { "branch": "main", "commit": "82519630b2760ffc516ebc387bef632f9c07b9f5" }, "nerdy.nvim": { "branch": "main", "commit": "7c9a4ea4a9ca7063e86dbcf7ce0f233cb59bdc10" }, - "none-ls.nvim": { "branch": "main", "commit": "34b1311bd07bd3741e60e06b34d0709d6e5a9f0f" }, - "nvim-autopairs": { "branch": "master", "commit": "2e8a10c5fc0dcaf8296a5f1a7077efcd37065cc8" }, + "none-ls.nvim": { "branch": "main", "commit": "4715e3e0480152dbbca1a3b5d09f070508a54691" }, + "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" }, "nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" }, "nvim-ghost.nvim": { "branch": "main", "commit": "a1ca0b2dac59881066d7ac9373cf64d59ba29d6a" }, - "nvim-lspconfig": { "branch": "master", "commit": "d1bab4cf4b69e49d6058028fd933d8ef5e74e680" }, + "nvim-lspconfig": { "branch": "master", "commit": "ec7d51a619049c7c597f469f81ea199db6794651" }, "nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" }, - "nvim-treesitter": { "branch": "master", "commit": "b3e53e94232d2bc6d70516efbd932bcce3ba8e1e" }, - "nvim-treesitter-context": { "branch": "master", "commit": "6a4b354233b12f094d824575e09db089355e59dd" }, - "nvim-web-devicons": { "branch": "master", "commit": "14ac5887110b06b89a96881d534230dac3ed134d" }, - "oil.nvim": { "branch": "master", "commit": "bf753c3e3f8736939ad5597f92329dfe7b1df4f5" }, - "orgmode": { "branch": "master", "commit": "5657e2f721d582bdd665686a0399c616bc697ccf" }, + "nvim-treesitter": { "branch": "master", "commit": "18aa5ae3fd7245137bc41b5348102fe254405509" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" }, + "nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" }, + "oil.nvim": { "branch": "master", "commit": "132b4ea0740c417b9d717411cab4cf187e1fd095" }, + "orgmode": { "branch": "master", "commit": "36424ff2491ee3d2efb2a074a5ed1862a6d060c6" }, + "pastify.nvim": { "branch": "main", "commit": "47317b9bb7bf5fb7dfd994a6eb9bec8f00628dc0" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, + "rustaceanvim": { "branch": "master", "commit": "b44e1db9056d74cc491aa4a3f625f8bdca0d6743" }, "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, "tla.nvim": { "branch": "master", "commit": "e419c75e805ab6d9967c7325bf35734c372d3d4b" }, "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, - "typst.vim": { "branch": "main", "commit": "e28d440c7ba4df2516d7d7f908c4fb664a8cf86c" }, + "typst.vim": { "branch": "main", "commit": "ff57d27cf5ee7427941a63fb537714f9a80e0246" }, "undotree": { "branch": "master", "commit": "9dbbf3b7d19dda0d22ceca461818e4739ad8154d" }, "vim-alloy": { "branch": "master", "commit": "5bd57c4890be39e221dd3e1f6735457dce454bbd" }, "vim-jukit": { "branch": "master", "commit": "73214c9a8abc4b6aa7a6266b5bc2ddbf8b3e3c00" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-tpipeline": { "branch": "master", "commit": "649f079a0bee19565978b82b672d831c6641d952" }, - "vimtex": { "branch": "master", "commit": "9df79e15bf035d1cfb32c11fffed38dd7b6a0501" }, + "vimtex": { "branch": "master", "commit": "afac40289eed684ab1301390dcd246b1609f8119" }, "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua index c24b33d..ca961a5 100644 --- a/.config/nvim/lua/plugins/autopairs.lua +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -3,7 +3,7 @@ local npairs = require('nvim-autopairs') npairs.setup({ map_cr = true, - map_bs = true, + map_bs = false, check_ts = true, enable_check_bracket_line = true, ignored_next_char = "[%w]" diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua index 78ab8cd..2c70c30 100644 --- a/.config/nvim/lua/plugins/copilot.lua +++ b/.config/nvim/lua/plugins/copilot.lua @@ -14,7 +14,7 @@ require('copilot').setup({ }, filetypes = { yaml = false, - markdown = false, + markdown = true, help = false, gitcommit = false, gitrebase = false, diff --git a/.config/nvim/lua/plugins/dap.lua b/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..b5914ad --- /dev/null +++ b/.config/nvim/lua/plugins/dap.lua @@ -0,0 +1,29 @@ +local dap = require("dap") + +dap.adapters.lldb = { + type = 'server', + port = "${port}", + executable = { + command = '/Users/afonso/.local/share/nvim/mason/bin/codelldb', + args = {"--port", "${port}"}, + } +} + +dap.configurations.c = { + { + name = "codelldb: With args", + type = "codelldb", + request = "launch", + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + args = function() + local args = vim.fn.input('Arguments: ') + return args ~= '' and { args } or nil + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + }, + +} + diff --git a/.config/nvim/lua/plugins/jukit.lua b/.config/nvim/lua/plugins/jukit.lua index 49bcd25..cc6cc42 100644 --- a/.config/nvim/lua/plugins/jukit.lua +++ b/.config/nvim/lua/plugins/jukit.lua @@ -1,4 +1,6 @@ local opts = { noremap = true, silent = true, buffer = true } +--Convert between py and ipynb +vim.keymap.set('n', 'jnp', 'call jukit#convert#notebook_convert()', opts) -- Create new code cell below. Argument: Whether to create code cell (0) or markdown cell (1) vim.keymap.set('n', 'jco', 'call jukit#cells#create_below(0)', opts) -- Create new code cell above. Argument: Whether to create code cell (0) or markdown cell (1) diff --git a/.config/nvim/lua/plugins/lazy.lua b/.config/nvim/lua/plugins/lazy.lua index 9e3c571..6410607 100644 --- a/.config/nvim/lua/plugins/lazy.lua +++ b/.config/nvim/lua/plugins/lazy.lua @@ -10,19 +10,7 @@ lazy.setup({ name = "catppuccin", lazy = false, priority = 1000, - config = function() - require("catppuccin").setup({ - integrations = { - cmp = true, - treesitter = true, - treesitter_context = true, - fidget = true, - telescope = true, - leap = true, - mason = true, - }, - }) - end + opts = {} }, 'sainnhe/gruvbox-material', @@ -30,33 +18,24 @@ lazy.setup({ -------------------------------------------------------MFP--------------------------------- { 'susliko/tla.nvim', - config = function() - require("tla").setup() - end + opts = {} }, -------------------------------------------------------QOL--------------------------------- { - 'chipsenkbeil/distant.nvim', - branch = 'v0.3', + 'jbyuki/instant.nvim', config = function() - require('distant'):setup({ - servers = { - ['10.8.0.9'] = { - launch = { - default = { - username = 'afonso', - args = '--port 8080 --shutdown lonely=1' - } - } - }, - } - }) + vim.g.instant_username = 'afonso' end }, 'vimpostor/vim-tpipeline', + { + 'TobinPalmer/pastify.nvim', + cmd = { 'Pastify' }, + opts = {} + }, --Python notebooks { @@ -66,24 +45,6 @@ lazy.setup({ end, ft = { 'python', 'json' } }, - --org mode - { - '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 orgmode - require('orgmode').setup({ - org_agenda_files = '~/org/**/*', - org_default_notes_file = '~/org/refile.org', - }) - end, - }, { "zbirenbaum/copilot.lua", @@ -93,55 +54,31 @@ lazy.setup({ require 'plugins.copilot' end, }, - --better navigation with 's-letter' - { - 'ggandor/leap.nvim', - event = "VeryLazy", - config = function() - require('leap').add_default_mappings() - end - }, --Nvim to browser 'subnut/nvim-ghost.nvim', - { - '2kabhishek/nerdy.nvim', - event = "VeryLazy", - dependencies = { - 'stevearc/dressing.nvim', - 'nvim-telescope/telescope.nvim', - }, - cmd = 'Nerdy', - }, - { 'declancm/cinnamon.nvim', - config = function() - require('cinnamon').setup { - scroll_limit = 10000, - always_scroll = true, - } - end + opts = { + scroll_limit = 10000, + always_scroll = true, + } }, { "folke/todo-comments.nvim", event = "VeryLazy", dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - require("todo-comments").setup {} - end + opts = {} }, { 'folke/zen-mode.nvim', event = "VeryLazy", - config = function() - require("zen-mode").setup { - vim.keymap.set('n', 'z', ' ZenMode ', { noremap = true, silent = true }) - } - end + opts = { + vim.keymap.set('n', 'z', ' ZenMode ', { noremap = true, silent = true }) + } }, --Change add and remove surroundings from words @@ -149,82 +86,28 @@ lazy.setup({ { 'NvChad/nvim-colorizer.lua', - config = function() - require 'colorizer'.setup() - end + opts = {} }, - -- { - -- "roobert/tailwindcss-colorizer-cmp.nvim", - -- event = "VeryLazy", - -- config = function() - -- require("tailwindcss-colorizer-cmp").setup({ - -- color_square_width = 2, - -- }) - -- end - -- }, - -- { - -- 'laytan/tailwind-sorter.nvim', - -- event = "VeryLazy", - -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' }, - -- build = 'cd formatter && bun i && bun run build', - -- config = true, - -- }, - --Database integration - -- 'tpope/vim-dadbod', - -- { - -- 'kristijanhusak/vim-dadbod-ui', - -- config = function() - -- vim.g.db_ui_auto_execute_table_helpers = 1 - -- end - -- }, - -- 'kristijanhusak/vim-dadbod-completion', - 'mbbill/undotree', --Tmux navigation { 'alexghergh/nvim-tmux-navigation', - config = function() - require 'nvim-tmux-navigation'.setup { - disable_when_zoomed = true, -- defaults to false - keybindings = { - left = "", - down = "", - up = "", - right = "", - } + opts = { + disable_when_zoomed = true, -- defaults to false + keybindings = { + left = "", + down = "", + up = "", + right = "", } - end + } }, -- Rename variable pop up 'stevearc/dressing.nvim', - -- { - -- 'krady21/compiler-explorer.nvim', - -- event = "VeryLazy", - -- config = function() - -- require("compiler-explorer").setup({ - -- url = "https://godbolt.org", - -- infer_lang = true, -- Try to infer possible language based on file extension. - -- line_match = { - -- highlight = true, -- highlight the matching line(s) in the other buffer. - -- jump = true, -- move the cursor in the other buffer to the first matching line. - -- }, - -- open_qflist = true, -- Open qflist after compilation if there are diagnostics. - -- split = "split", -- How to split the window after the second compile (split/vsplit). - -- compiler_flags = "", -- Default flags passed to the compiler. - -- job_timeout_ms = 25000, -- Timeout for libuv job in milliseconds. - -- languages = { -- Language specific default compiler/flags - -- c = { - -- compiler = "cg132" - -- } - -- }, - -- }) - -- end - -- }, - { 'windwp/nvim-autopairs', config = function() @@ -244,9 +127,7 @@ lazy.setup({ { 'stevearc/oil.nvim', - config = function() - require("oil").setup() - end + opts = {} }, -------------------------------------------------------LSP---------------------------------------------- @@ -303,6 +184,9 @@ lazy.setup({ }, { "mfussenegger/nvim-dap", + config = function() + require 'plugins.dap' + end }, { @@ -331,12 +215,17 @@ lazy.setup({ { 'lervag/vimtex', - event = "VeryLazy", config = function() require 'plugins.vimtex' end }, + { + 'mrcjkb/rustaceanvim', + version = '^4', -- Recommended + ft = { 'rust' }, + }, + ------------------------------------------------------------------------------------------- -- Syntax Highlighting { @@ -358,16 +247,6 @@ lazy.setup({ "runoshun/vim-alloy", - --Tabs - --{ - -- 'akinsho/bufferline.nvim', - -- version = 'v3.*', - -- dependencies = 'nvim-tree/nvim-web-devicons', - -- config = function() - -- require("plugins.bufferline") - -- end - --}, - --does so much { 'nvim-telescope/telescope.nvim', @@ -377,34 +256,6 @@ lazy.setup({ config = function() require('plugins.telescope') end }, - - --Main menu - -- { - -- 'startup-nvim/startup.nvim', - -- dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim' }, - -- config = function() - -- require('startup').setup { theme = 'dashboard' } - -- end, - -- }, - - -------------------------------------------OTHERS---------------------------------------------- - - -- { - -- "nvim-neorg/neorg", - -- build = ":Neorg sync-parsers", - -- config = function() - -- require("neorg").setup { - -- load = { - -- ["core.defaults"] = {}, -- Loads default behaviour - -- ["core.concealer"] = {} -- Adds pretty icons to your documents - -- }, - -- } - -- end, - -- dependencies = { "nvim-lua/plenary.nvim" }, - -- }, - - -- 'kmonad/kmonad-vim', - -- 'elkowar/yuck.vim', --Discord Rich Presence 'andweeb/presence.nvim' diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index f35b085..e1923c7 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -60,8 +60,16 @@ mason_lspconfig.setup_handlers { end, } -lspconfig["ocamllsp"].setup{ - on_attach = on_attach, - flags = lsp_flags, - capabilities = capabilities, +lspconfig["ocamllsp"].setup { + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities, +} + +vim.g.rustaceanvim = { + server = { + on_attach = on_attach, + flags = lsp_flags, + capabilities = capabilities + }, } diff --git a/.config/nvim/lua/plugins/none-ls.lua b/.config/nvim/lua/plugins/none-ls.lua index 837ccac..39296df 100644 --- a/.config/nvim/lua/plugins/none-ls.lua +++ b/.config/nvim/lua/plugins/none-ls.lua @@ -3,12 +3,8 @@ local null_ls = require("null-ls") null_ls.setup({ sources = { - null_ls.builtins.formatting.rustfmt, null_ls.builtins.formatting.black, - null_ls.builtins.diagnostics.flake8, null_ls.builtins.formatting.gofmt, - null_ls.builtins.code_actions.shellcheck, - null_ls.builtins.formatting.beautysh, null_ls.builtins.formatting.prettierd.with({ filetypes = { "html", "json", "css", "js", "yaml", "markdown" }, }), diff --git a/.config/nvim/lua/plugins/vimtex.lua b/.config/nvim/lua/plugins/vimtex.lua index 9b92de7..fdac0c5 100644 --- a/.config/nvim/lua/plugins/vimtex.lua +++ b/.config/nvim/lua/plugins/vimtex.lua @@ -1,2 +1,2 @@ -vim.g.vimtex_view_method = 'zathura' -vim.g.vimtex_compiler_methor = 'latexmk' +vim.g.vimtex_view_method = 'skim' +vim.g.vimtex_compiler_methor = 'pdflatex'