Default border color set to 'Normal', minor 'git_diff' fix

main
bhagwan 3 years ago
parent fdae33b047
commit 7243918bdd

@ -221,7 +221,7 @@ require'fzf-lua'.setup {
-- win_border = false, -- window border? or borderchars?
win_border = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' },
hl_normal = 'Normal', -- window normal color
hl_border = 'FloatBorder', -- window border color
hl_border = 'Normal', -- change to 'FloatBorder' if exists
},
-- fzf_bin = 'sk', -- use skim instead of fzf?
fzf_opts = {

@ -256,7 +256,7 @@ Consult the list below for available settings:
-- win_border = false, -- window border? or borderchars?
win_border = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' },
hl_normal = 'Normal', -- window normal color
hl_border = 'FloatBorder', -- window border color
hl_border = 'Normal', -- change to 'FloatBorder' if exists
},
-- fzf_bin = 'sk', -- use skim instead of fzf?
fzf_opts = {

@ -28,7 +28,7 @@ M.globals = {
win_border = true,
borderchars = { '', '', '', '', '', '', '', '' },
hl_normal = 'Normal',
hl_border = 'FloatBorder',
hl_border = 'Normal',
--[[ window_on_create = function()
-- Set popup background same as normal windows
vim.cmd("set winhl=Normal:Normal,FloatBorder:FloatBorder")
@ -199,6 +199,7 @@ M.globals.git = {
["D"] = { icon = "D", color = "red" },
["A"] = { icon = "A", color = "green" },
["R"] = { icon = "R", color = "yellow" },
["C"] = { icon = "C", color = "yellow" },
["?"] = { icon = "?", color = "magenta" },
},
}

@ -209,7 +209,7 @@ local get_diff_files = function(opts)
local status, err = utils.io_systemlist(path.git_cwd(cmd, opts.cwd))
if err == 0 then
for i = 1, #status do
local icon = status[i]:match("[MUDAR?]+")
local icon = status[i]:match("[MUDARC?]+")
local file = status[i]:match("[^ ]*$")
if icon and file then
diff_files[file] = icon

@ -173,7 +173,7 @@ function Previewer.git_diff:cmdline(o)
o = o or {}
local act = helpers.choices_to_shell_cmd_previewer(function(items)
local is_deleted = items[1]:match("D"..utils.nbsp) ~= nil
local is_untracked = items[1]:match("[?RA]"..utils.nbsp) ~= nil
local is_untracked = items[1]:match("[?RAC]"..utils.nbsp) ~= nil
local file = path.entry_to_file(items[1], not self.relative and self.opts.cwd)
local cmd = self.cmd
local args = self.args

@ -0,0 +1,50 @@
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
vim.api.nvim_command('echohl WarningMsg | echom "Fzf-lua requires neovim > v0.5 | echohl None"')
return
end
local res, packer = pcall(require, "packer")
local install_suffix = "/site/pack/packer/%s/packer.nvim"
local install_path = vim.fn.stdpath("data") .. string.format(install_suffix, "opt")
local is_installed = vim.loop.fs_stat(install_path) ~= nil
if not res and is_installed then
vim.cmd("packadd packer.nvim")
res, packer = pcall(require, "packer")
end
if not res then
print("Downloading packer.nvim...\n")
vim.fn.system({
"git", "clone", '--depth', '1',
"https://github.com/wbthomason/packer.nvim",
install_path,
})
vim.cmd("packadd packer.nvim")
res, packer = pcall(require, "packer")
if res then
vim.fn.delete(packer.config.compile_path, "rf")
print("Successfully installed packer.nvim.")
else
print(("Error installing packer.nvim\nPath: %s"):format(install_path))
return
end
end
packer.startup({function(use)
use { 'wbthomason/packer.nvim', opt = true }
use { 'ibhagwan/fzf-lua',
requires = { 'vijaymarupudi/nvim-fzf' },
config = function()
vim.api.nvim_set_keymap('n', '<C-p>',
'<Esc>:lua require"fzf-lua".files()<CR>', {})
require'fzf-lua'.setup({})
end,
}
end})
if not vim.loop.fs_stat(packer.config.compile_path) then
packer.sync()
else
packer.compile()
end
Loading…
Cancel
Save