From d58acd7bc2321e61b1db5d6b955942846568530a Mon Sep 17 00:00:00 2001 From: Hung Date: Sun, 4 Jun 2023 21:40:47 -0700 Subject: [PATCH] feat(nvim): add 'fug' for unrestricted live grep (no .gitignore) --- flake.lock | 6 +++--- native_configs/neovim/init.lua | 8 +++++++- nix-conf/home-manager/flake.lock | 18 +++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index ecaa208..787668d 100644 --- a/flake.lock +++ b/flake.lock @@ -504,11 +504,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1685655444, - "narHash": "sha256-6EujQNAeaUkWvpEZZcVF8qSfQrNVWFNNGbUJxv/A5a8=", + "lastModified": 1685836261, + "narHash": "sha256-rpxEPGeW4JZJcH58SQApJUtJ7w78VPtkF6Cut/Pq6Kg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e635192892f5abbc2289eaac3a73cdb249abaefd", + "rev": "dd4982554e18b936790da07c4ea2db7c7600f283", "type": "github" }, "original": { diff --git a/native_configs/neovim/init.lua b/native_configs/neovim/init.lua index 45132dc..532e978 100644 --- a/native_configs/neovim/init.lua +++ b/native_configs/neovim/init.lua @@ -328,6 +328,12 @@ remap('n', 'fg', function() require('telescope.builtin').live_grep() end, { desc = '[F]ind by [G]rep' }) +remap('n', 'fug', function() + -- This relies on many factors: We use `rg` and that `-g '**/*'` effectively + -- drops ignore rules like the default `.gitignore` rule. + require('telescope.builtin').live_grep({ glob_pattern = '**/*' }) +end, { desc = '[F]ind by [u]nrestricted [G]rep' }) + remap('n', 'fb', function() require('telescope.builtin').buffers() end, { desc = '[F]ind existing [B]uffers' }) @@ -347,7 +353,7 @@ remap('n', 'zf', function() end, { desc = '[Z]ettelkasten [F]iles' }) remap('n', 'zg', function() - vim.cmd([[:ZkGrep]]) + vim.cmd(":ZkGrep") end, { desc = '[Z]ettelkasten [G]rep' }) -- treesitter diff --git a/nix-conf/home-manager/flake.lock b/nix-conf/home-manager/flake.lock index 9cf8b49..bcc7d08 100644 --- a/nix-conf/home-manager/flake.lock +++ b/nix-conf/home-manager/flake.lock @@ -803,11 +803,11 @@ ] }, "locked": { - "lastModified": 1685833925, - "narHash": "sha256-KCo8QT/DtM4pSTQDWFOhVP7MDzwi0wb2ZlxhgjEwXtM=", + "lastModified": 1685885003, + "narHash": "sha256-+OB0EvZBfGvnlTGg6mtyUCqkMnUp9DkmRUU4d7BZBVE=", "owner": "nix-community", "repo": "home-manager", - "rev": "bffc49ffb255f213d2f902043da37b3016450f4a", + "rev": "607d8fad96436b134424b9935166a7cd0884003e", "type": "github" }, "original": { @@ -1182,11 +1182,11 @@ }, "nixpkgs_12": { "locked": { - "lastModified": 1685655444, - "narHash": "sha256-6EujQNAeaUkWvpEZZcVF8qSfQrNVWFNNGbUJxv/A5a8=", + "lastModified": 1685836261, + "narHash": "sha256-rpxEPGeW4JZJcH58SQApJUtJ7w78VPtkF6Cut/Pq6Kg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e635192892f5abbc2289eaac3a73cdb249abaefd", + "rev": "dd4982554e18b936790da07c4ea2db7c7600f283", "type": "github" }, "original": { @@ -1753,11 +1753,11 @@ "nixpkgs": "nixpkgs_13" }, "locked": { - "lastModified": 1685846256, - "narHash": "sha256-G4aYK4VqlMHImvZ0lUnLHw1A+Cx28T0sBMvAKZBcGpk=", + "lastModified": 1685932304, + "narHash": "sha256-HUrE7Al6Rp9GeOjUycXz25TYhXXf1vtZLf/FFPVFRNw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "1ef3c6de6127a1cba94cc5492cdde52e33d06ea4", + "rev": "08b06ab2046bce2c3b5f53ec599a6550ab9a9485", "type": "github" }, "original": {