mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-19 10:03:25 +00:00
chore: faster builds, fzf lua (#74)
This commit is contained in:
parent
80efbae1e9
commit
0db4171b0b
8 changed files with 52 additions and 25 deletions
|
|
@ -96,6 +96,9 @@ function M.setup_integrations()
|
|||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
|
||||
vim.keymap.set("n", "<C-f>", "<cmd>FzfLua files<cr>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "<C-s>", "<cmd>FzfLua live_grep<cr>", { buffer = bufnr })
|
||||
|
||||
vim.keymap.set("n", "gC", function()
|
||||
show_all = not show_all
|
||||
require("canola").set_columns(show_all and detail_columns or base_columns)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ return {
|
|||
local opts = {
|
||||
"default-title",
|
||||
winopts = {
|
||||
fullscreen = true,
|
||||
border = "single",
|
||||
preview = {
|
||||
layout = "vertical",
|
||||
|
|
@ -47,6 +48,18 @@ return {
|
|||
fzf_opts = {
|
||||
["--layout"] = "reverse",
|
||||
},
|
||||
files = {
|
||||
winopts = { preview = { hidden = true } },
|
||||
},
|
||||
git_files = {
|
||||
winopts = { preview = { hidden = true } },
|
||||
},
|
||||
grep = {
|
||||
_headers = {},
|
||||
},
|
||||
live_grep = {
|
||||
_headers = {},
|
||||
},
|
||||
}
|
||||
|
||||
fzf.setup(opts)
|
||||
|
|
@ -58,18 +71,8 @@ return {
|
|||
end
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<C-f>",
|
||||
function()
|
||||
local fzf = require "fzf-lua"
|
||||
local git_dir = vim.fn.system("git rev-parse --git-dir 2>/dev/null"):gsub("\n", "")
|
||||
if vim.v.shell_error == 0 and git_dir ~= "" then
|
||||
fzf.git_files()
|
||||
else
|
||||
fzf.files()
|
||||
end
|
||||
end,
|
||||
},
|
||||
{ "<C-f>", "<cmd>FzfLua files<cr>" },
|
||||
{ "<C-s>", "<cmd>FzfLua live_grep<cr>" },
|
||||
{ "<leader>ff", "<cmd>FzfLua files<cr>" },
|
||||
{ "<leader>fg", "<cmd>FzfLua live_grep<cr>" },
|
||||
{ "<leader>fb", "<cmd>FzfLua buffers<cr>" },
|
||||
|
|
|
|||
|
|
@ -9,7 +9,13 @@ return {
|
|||
local neocodeium = require "neocodeium"
|
||||
neocodeium.setup()
|
||||
|
||||
vim.keymap.set("i", "<Right>", neocodeium.accept)
|
||||
vim.keymap.set("i", "<Right>", function()
|
||||
if neocodeium.visible() then
|
||||
neocodeium.accept()
|
||||
else
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Right>", true, false, true), "n", false)
|
||||
end
|
||||
end)
|
||||
vim.keymap.set("i", "<A-w>", neocodeium.accept_word)
|
||||
vim.keymap.set("i", "<A-a>", neocodeium.accept_line)
|
||||
vim.keymap.set("i", "<A-e>", neocodeium.cycle_or_complete)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue