summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/mo/fzf.lua20
-rw-r--r--lua/mo/statusline.lua20
2 files changed, 15 insertions, 25 deletions
diff --git a/lua/mo/fzf.lua b/lua/mo/fzf.lua
index c5c4b3e..b4c22ba 100644
--- a/lua/mo/fzf.lua
+++ b/lua/mo/fzf.lua
@@ -22,11 +22,19 @@ fzf.setup({
defaults = { git_icons = false, file_icons = false },
tags = { previewer = "bat" },
btags = { previewer = "bat" },
- files = { fzf_opts = { ["--ansi"] = false } },
+ files = {
+ previewer = "bat",
+ fzf_opts = { ["--ansi"] = true },
+ cwd_header = true,
+ winopts = { toggle_behavior = "default", preview = { hidden = true } },
+ formatter = "path.dirname_first",
+ },
grep = {
fzf_opts = { ["--ansi"] = false },
- rg_glob = true,
rg_opts = " --color=never --column --line-number --no-heading --smart-case --max-columns=4096 -e",
+ rg_glob = true,
+ glob_flag = "--iglob",
+ glob_separator = "%s%-%-",
},
builtin = { winopts = { width = 1, height = 1 } },
blines = swiper,
@@ -35,14 +43,14 @@ fzf.setup({
git = { blame = swiper },
winopts = function()
- local height = math.ceil(vim.o.lines / 2)
+ local height = math.ceil(2 * vim.o.lines / 3)
return {
backdrop = 80,
row = 1,
col = 0,
width = 1,
height = height > 3 and height or 1,
- border = {"", " ", "", "", "", "", "", ""},
+ border = { "", " ", "", "", "", "", "", "" },
toggle_behavior = "extend",
--- @diagnostic disable-next-line: missing-fields
preview = {
@@ -50,7 +58,7 @@ fzf.setup({
treesitter = false,
layout = "vertical",
vertical = "up:60%",
- border = {"", " ", "", "", "", "", "", ""},
+ border = { "", " ", "", "", "", "", "", "" },
},
on_create = function()
vim.keymap.set(
@@ -68,7 +76,9 @@ fzf.setup({
end,
keymap = {
fzf = {
+ true,
["ctrl-q"] = "select-all+accept",
+ ["alt-p"] = "toggle-preview",
},
},
})
diff --git a/lua/mo/statusline.lua b/lua/mo/statusline.lua
deleted file mode 100644
index b24436c..0000000
--- a/lua/mo/statusline.lua
+++ /dev/null
@@ -1,20 +0,0 @@
--- local function lsp_status()
--- local clients = vim.lsp.get_active_clients({ bufnr = 0 })
--- if #clients == 0 then return "" end
--- local names = {}
--- for _, client in ipairs(clients) do
--- table.insert(names, client.name)
--- end
--- return "[" .. table.concat(names, ", ") .. "]"
--- end
-
-local M = {}
-
-function M.lsp_status()
- local clients = vim.lsp.get_clients({ bufnr = 0 })
- if #clients == 0 then return "" end
-
- return "%#StatusLineLsp#[" .. table.concat(vim.tbl_map(function(client) return client.name end, clients), ",") .. "]%* "
-end
-
-return M