Update; Add nice ripgrep search
This commit is contained in:
18
flake.lock
generated
18
flake.lock
generated
@@ -159,11 +159,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1775710090,
|
||||
"narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=",
|
||||
"lastModified": 1776169885,
|
||||
"narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4c1018dae018162ec878d42fec712642d214fdfa",
|
||||
"rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -190,11 +190,11 @@
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1776067740,
|
||||
"narHash": "sha256-B35lpsqnSZwn1Lmz06BpwF7atPgFmUgw1l8KAV3zpVQ=",
|
||||
"lastModified": 1776434932,
|
||||
"narHash": "sha256-gyqXNMgk3sh+ogY5svd2eNLJ6oEwzbAeaoBrrxD0lKk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7e495b747b51f95ae15e74377c5ce1fe69c1765f",
|
||||
"rev": "c7f47036d3df2add644c46d712d14262b7d86c0c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -206,11 +206,11 @@
|
||||
},
|
||||
"nixpkgs-wsl-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1776067740,
|
||||
"narHash": "sha256-B35lpsqnSZwn1Lmz06BpwF7atPgFmUgw1l8KAV3zpVQ=",
|
||||
"lastModified": 1776434932,
|
||||
"narHash": "sha256-gyqXNMgk3sh+ogY5svd2eNLJ6oEwzbAeaoBrrxD0lKk=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7e495b747b51f95ae15e74377c5ce1fe69c1765f",
|
||||
"rev": "c7f47036d3df2add644c46d712d14262b7d86c0c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -59,13 +59,28 @@ in
|
||||
HISTCONTROL='erasedups:ignoreboth'
|
||||
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
|
||||
unsetopt beep
|
||||
'';
|
||||
|
||||
profileExtra = lib.mkIf cfg.sourceProfile ''
|
||||
source $HOME/.profile
|
||||
prg() {
|
||||
# ''${1} is the search term, ''${2} is the path (defaulting to . if empty)
|
||||
local query="''${1:-}"
|
||||
local search_path="''${2:-.}"
|
||||
|
||||
local selected=$(
|
||||
fzf --ansi --disabled --query "$query" \
|
||||
--bind "start:reload(rg --column --line-number --no-heading --color=always --smart-case {q} \"$search_path\")" \
|
||||
--bind "change:reload:sleep 0.1; rg --column --line-number --no-heading --color=always --smart-case {q} \"$search_path\" || true" \
|
||||
--delimiter : \
|
||||
--preview 'bat --color=always --style=numbers --highlight-line {2} {1}' \
|
||||
--preview-window 'right:45%'
|
||||
)
|
||||
|
||||
# Extract file and line, then open in Neovim
|
||||
[ -n "$selected" ] && nvim "$(echo "$selected" | cut -d: -f1)" +"$(echo "$selected" | cut -d: -f2)"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
@@ -66,7 +66,19 @@ vim.opt.directory = swapdir .. "," .. temp
|
||||
-------- CLIPBOARD ---------
|
||||
----------------------------
|
||||
if vim.fn.has("wsl") == 1 then
|
||||
vim.opt.clipboard = vim.opt.clipboard + 'unnamedplus'
|
||||
vim.g.clipboard = {
|
||||
name = 'WslClipboard',
|
||||
copy = {
|
||||
["+"] = 'win32yank.exe -i --crlf',
|
||||
["*"] = 'win32yank.exe -i --crlf',
|
||||
},
|
||||
paste = {
|
||||
["+"] = 'win32yank.exe -o --lf',
|
||||
["*"] = 'win32yank.exe -o --lf',
|
||||
},
|
||||
cache_enabled = 0,
|
||||
}
|
||||
vim.opt.clipboard = 'unnamedplus'
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user