From 71f08e66aad5173db698b7d021b842efb241410c Mon Sep 17 00:00:00 2001 From: Nigel Barink Date: Thu, 26 Sep 2024 14:46:07 +0200 Subject: [PATCH] Merge Windows config --- lazy-lock.json | 52 +++++++++++++++---------------- lua/barink/plugins/dap.lua | 35 ++++++++++++++++++--- lua/barink/plugins/edgy.lua | 38 ++++++++++++++++------ lua/barink/plugins/lsp.lua | 38 ++++++++++++++++++++-- lua/barink/plugins/tokyonight.lua | 46 +++++++++++++++++---------- lua/barink/vim.lua | 12 +++++++ 6 files changed, 162 insertions(+), 59 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 7002000..cec8a7b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,38 +1,38 @@ { "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "catppuccin": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "edgy.nvim": { "branch": "main", "commit": "0e8bbab4eba9dab6c237e4a2e146dc0466897be6" }, - "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, + "gitsigns.nvim": { "branch": "main", "commit": "356df59308d8b87486644d2324d7558ac0f3db36" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, - "lazy.nvim": { "branch": "main", "commit": "33be7ac3173c7c20b94ce7e1b9734c1a1e85f292" }, - "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, - "mason-lspconfig": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, - "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, - "neoconf.nvim": { "branch": "main", "commit": "04060950124f5901dd383566208b591a5bdb2929" }, - "nui.nvim": { "branch": "main", "commit": "a2bc1e9d0359caa5d11ad967cd1e30e8d4676226" }, - "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, - "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, - "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" }, - "nvim-jdtls": { "branch": "master", "commit": "40e8494e04c1bcd5dd6c0d0bc187d2d10965017d" }, - "nvim-lspconfig": { "branch": "master", "commit": "9c9eb07fecc578e25e28db8dc9002b43fff2ed79" }, - "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, - "nvim-treesitter": { "branch": "master", "commit": "09700b88b41ed96391de3d2010d74dc54fd5c210" }, - "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, + "lazy.nvim": { "branch": "main", "commit": "a09c876f6ef642c8feaea45932df73b058d9a083" }, + "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, + "mason-lspconfig": { "branch": "main", "commit": "58bc9119ca273c0ce5a66fad1927ef0f617bd81b" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "neoconf.nvim": { "branch": "main", "commit": "944f30e58171cf909b6567ce206e9097745560d1" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, + "nvim-dap": { "branch": "master", "commit": "bc03b83c94d0375145ff5ac6a6dcf28c1241e06f" }, + "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, + "nvim-jdtls": { "branch": "master", "commit": "6bfd1591583b02e742fc3a2f43393c4ea3b6d3c7" }, + "nvim-lspconfig": { "branch": "master", "commit": "1ea7c6126a1aa0121098e4f16c04d5dde1a4ba22" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-treesitter": { "branch": "master", "commit": "733fa85db27079ec2757183c5c840ba15a303e1f" }, + "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope.nvim": { "branch": "master", "commit": "61a4a615366c470a4e9ca8f8b45718b6b92af73f" }, - "todo-comments.nvim": { "branch": "main", "commit": "96fee098a90e7c09c9811aa7df71d773ba8b9b53" }, - "tokyonight.nvim": { "branch": "main", "commit": "30d7be361a7fbf187a881f17e574e9213d5108ea" }, - "trouble.nvim": { "branch": "main", "commit": "88c3be40c061ce053ab326ce4fdcb973a1f785ff" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "master", "commit": "79552ef8488cb492e0f9d2bf3b4e808f57515e35" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "trouble.nvim": { "branch": "main", "commit": "40c5317a6e90fe3393f07b0fee580d9e93a216b4" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, - "vim-fugitive": { "branch": "master", "commit": "64d6cafb9dcbacce18c26d7daf617ebb96b273f3" }, - "which-key.nvim": { "branch": "main", "commit": "7915964e73c30ba5657e9a762c6570925dad421b" } -} \ No newline at end of file + "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, + "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" } +} diff --git a/lua/barink/plugins/dap.lua b/lua/barink/plugins/dap.lua index ccd4d5b..0552b34 100644 --- a/lua/barink/plugins/dap.lua +++ b/lua/barink/plugins/dap.lua @@ -34,13 +34,40 @@ return { stopOnEntry = false, } } + dap.adapters.lldb = { + type = 'executable', + command = "C:\\Program Files\\LLVM\\bin\\lldb-dap.exe", + name = 'lldb' + } + + -- Zig configuration + dap.configurations.zig = { + name = 'launch', + type= 'lldb', + request = 'launch', + program = '${workspaceFolder}/zig-out/bin/tests.exe', + cwd = '${workspaceFolder}', + } + -- Java configuration + -- See also ftplugin dap.configurations.java = { { - type = 'java'; - request = 'launch'; - name = "Launch file"; - program = "java ${file}"; + type = 'java', + request = 'launch', + name = "Launch file", + program = "java ${file}", }} + dap.configurations.cpp = {{ + name="launch", + type="lldb", + request="launch", + program = function () + return vim.fn.input('Path to executable: ', vim.fn.getcwd() ..'/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + }} dap.configurations.go = { { type = "delve", diff --git a/lua/barink/plugins/edgy.lua b/lua/barink/plugins/edgy.lua index dc0e6c7..f387301 100644 --- a/lua/barink/plugins/edgy.lua +++ b/lua/barink/plugins/edgy.lua @@ -1,9 +1,29 @@ -return { - "folke/edgy.nvim", - event = "VeryLazy", - opts = {}, - init = function () - vim.opt.laststatus = 3 - vim.opt.splitkeep = "screen" - end -} +return { + "folke/edgy.nvim", + event = "VeryLazy", + opts= { + bottom ={ + { + ft = "toggleterm", + size = { height = 0.4 }, + filter = function (_, win) + return vim.api.nvim_win_get_config(win).relative == "" + end, + }, + { + ft = "lazyterm", + title = "Lazyterm", + size = { height = 0.4 }, + filter = function(buf, _) + return not vim.b[buf].lazyterm_cmd + end + } + }, + init = function () + vim.opt.laststatus = 3 + vim.opt.splitkeep = "screen" + end, + } +} + + diff --git a/lua/barink/plugins/lsp.lua b/lua/barink/plugins/lsp.lua index 93e738f..9212a5a 100644 --- a/lua/barink/plugins/lsp.lua +++ b/lua/barink/plugins/lsp.lua @@ -98,9 +98,41 @@ return require("luasnip.loaders.from_lua").load({paths= "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\snippets"}) + -- Set up lspconfig. - local capabilities = require('cmp_nvim_lsp').default_capabilities() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lsp = require("lspconfig") - end - } + local language_server = { + asm_lsp= true, + zls = true, + rust_analyzer = true, + jdtls = true, + pylsp = true, + clangd = { + capabilities = capabilities, + root_dir = require('lspconfig').util.root_pattern("compile_commands.json", "compile_flags.txt", ".git"), + cmd = {"clangd"}, + filetypes = { "c", "cpp", "objc", "objcpp"}, + settings = { + clangd = { + compilationDatabasePath = "compile-commands.json", + }, + } + }, + tsserver = true, + gopls = true + } + for name, config in pairs(language_server) do + if config == true then + config = {} + end + config = vim.tbl_deep_extend("force", {}, { + capabilities = capabilities, + }, config) + lsp[name].setup({}) + end + + end, +} diff --git a/lua/barink/plugins/tokyonight.lua b/lua/barink/plugins/tokyonight.lua index a5fef0d..deed102 100644 --- a/lua/barink/plugins/tokyonight.lua +++ b/lua/barink/plugins/tokyonight.lua @@ -1,18 +1,30 @@ -return { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = {}, - config = function() - require("tokyonight").setup({ - style = "night", - light_style = "day", - transparent = true, - terminal_colors = true, - dim_inactive = false, - lualine_bold = false, - }) +-- return { +-- "folke/tokyonight.nvim", +-- lazy = false, +-- priority = 1000, +-- opts = {}, +-- config = function() +-- require("tokyonight").setup({ +-- style = "night", +-- light_style = "day", +-- transparent = true, +-- terminal_colors = true, +-- dim_inactive = false, +-- lualine_bold = false, +-- }) +-- +-- vim.cmd [[colorscheme tokyonight]] +-- end +-- } - vim.cmd [[colorscheme tokyonight]] - end - } +return { + { + "catppuccin/nvim", + name="catppuccin", + priority=1000, + config = function () + require("catppuccin").setup() + vim.cmd.colorscheme = "catppuccin" + end +} +} diff --git a/lua/barink/vim.lua b/lua/barink/vim.lua index 8b73673..4f5a67a 100644 --- a/lua/barink/vim.lua +++ b/lua/barink/vim.lua @@ -35,3 +35,15 @@ vim.api.nvim_create_autocmd('LspAttach', { end, }) +--[[ +-- Run zig test on save +-- TODO: fix vim.cmd call +-- TODO: only do this when a zig test file is open +vim.api.nvim_create_autocmd('BufWritePost' , { + callback = function () + vim.cmd{cmd = '!zig' , args= {'test', vim.fn.expand('%')} } + end +})]]-- + + +