From 33cd62170bf0098c0e793e3f5a01c98f99aeb48d Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Fri, 16 Feb 2024 20:40:28 -0300 Subject: [PATCH] feat: up flake, configure dap for rust and change some neovim defaults --- flake.lock | 24 +++++++++--------- programs/fish/default.nix | 3 ++- programs/neovim/user/dap/adapters.lua | 10 ++++++++ programs/neovim/user/dap/configurations.lua | 12 +++++++++ programs/neovim/user/init.lua | 6 ----- programs/neovim/user/options.lua | 3 +++ programs/neovim/user/plugins/dap.lua | 28 --------------------- 7 files changed, 39 insertions(+), 47 deletions(-) create mode 100644 programs/neovim/user/dap/adapters.lua create mode 100644 programs/neovim/user/dap/configurations.lua delete mode 100644 programs/neovim/user/plugins/dap.lua diff --git a/flake.lock b/flake.lock index 5893e5d..35ded32 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1707683400, - "narHash": "sha256-Zc+J3UO1Xpx+NL8UB6woPHyttEy9cXXtm+0uWwzuYDc=", + "lastModified": 1708031129, + "narHash": "sha256-EH20hJfNnc1/ODdDVat9B7aKm0B95L3YtkIRwKLvQG8=", "owner": "nix-community", "repo": "home-manager", - "rev": "21b078306a2ab68748abf72650db313d646cf2ca", + "rev": "3d6791b3897b526c82920a2ab5f61d71985b3cf8", "type": "github" }, "original": { @@ -65,11 +65,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1707847639, - "narHash": "sha256-mBmt1lFImpIK8VwHkJIenzVS95wD67dsfH1oRk2RiEg=", + "lastModified": 1708018354, + "narHash": "sha256-MlbqBzAjiz4Va2M/AvLN96Wq+jsCbEedhfMs5wW1yFM=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "2a3429d4cfdc01794b9d6fc1b49be1da019b5606", + "rev": "fbf5ba87ce57752653f3bebf6e2be090c702836e", "type": "github" }, "original": { @@ -163,11 +163,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1707689078, - "narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=", + "lastModified": 1707956935, + "narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8", + "rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c", "type": "github" }, "original": { @@ -300,11 +300,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1707813055, - "narHash": "sha256-tI6xFUBWq89HqSj0b8TfpXtH5bgM0apOa21vQbn991s=", + "lastModified": 1708099814, + "narHash": "sha256-a9OC33NEcACvKU3CwO8ao2ubibKUiq6JxnKvwbyOX8k=", "owner": "sxyazi", "repo": "yazi", - "rev": "b027487d12213b3653f33265b291dd41c707d1ab", + "rev": "53525b511efe165b0a5227263e99e81697213033", "type": "github" }, "original": { diff --git a/programs/fish/default.nix b/programs/fish/default.nix index c45d878..946bf8f 100644 --- a/programs/fish/default.nix +++ b/programs/fish/default.nix @@ -22,7 +22,8 @@ /home/wizardlink/.cargo/bin \ /home/wizardlink/.local/bin \ /lib/flatpak/exports/bin \ - /home/wizardlink/.local/share/scripts/burrito + /home/wizardlink/.local/share/scripts/burrito \ + ${pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter}/bin zoxide init --cmd cd fish | source ''; diff --git a/programs/neovim/user/dap/adapters.lua b/programs/neovim/user/dap/adapters.lua new file mode 100644 index 0000000..58e9968 --- /dev/null +++ b/programs/neovim/user/dap/adapters.lua @@ -0,0 +1,10 @@ +return { + codelldb = { + type = "server", + port = "${port}", + executable = { + command = "codelldb", + args = { "--port", "${port}" }, + }, + }, +} diff --git a/programs/neovim/user/dap/configurations.lua b/programs/neovim/user/dap/configurations.lua new file mode 100644 index 0000000..f086a28 --- /dev/null +++ b/programs/neovim/user/dap/configurations.lua @@ -0,0 +1,12 @@ +return { + rust = { + { + name = "Launch file", + type = "codelldb", + request = "launch", + program = function() return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + }, + }, +} diff --git a/programs/neovim/user/init.lua b/programs/neovim/user/init.lua index 23bd69a..c88b123 100644 --- a/programs/neovim/user/init.lua +++ b/programs/neovim/user/init.lua @@ -84,12 +84,6 @@ return { }, }, - options = { - opt = { - relativenumber = false, - }, - }, - -- This function is run last and is a good place to configuring -- augroups/autocommands and custom filetypes also this just pure lua so -- anything that doesn't fit in the normal config locations above can go here diff --git a/programs/neovim/user/options.lua b/programs/neovim/user/options.lua index 74ed9ad..1f3eb5a 100644 --- a/programs/neovim/user/options.lua +++ b/programs/neovim/user/options.lua @@ -7,6 +7,9 @@ return { spell = false, -- sets vim.opt.spell signcolumn = "auto", -- sets vim.opt.signcolumn to auto wrap = false, -- sets vim.opt.wrap + autochdir = true, -- automatically change the current directory + autowrite = true, -- write file on modification + grepprg = "rg --vimgrep", -- use ripgrep on grep actions }, g = { mapleader = " ", -- sets vim.g.mapleader diff --git a/programs/neovim/user/plugins/dap.lua b/programs/neovim/user/plugins/dap.lua deleted file mode 100644 index 9c1c3c3..0000000 --- a/programs/neovim/user/plugins/dap.lua +++ /dev/null @@ -1,28 +0,0 @@ -return { - "mfussenegger/nvim-dap", - opts = function(_, config) - local dap = require("dap") - - dap.adapters.codelldb = { - type = "server", - port = "${port}", - executable = { - command = "codelldb", - args = { "--port", "${port}" }, - } - } - - dap.configurations.rust = { - { - name = "Launch file", - type = "codelldb", - request = "launch", - program = function() - return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - end, - cwd = '${workspaceFolder}', - stopOnEntry = false, - } - } - end, -}