refactor fzf.zsh

WIP

wip: add whitespace that isn't tidy.nvim
This commit is contained in:
Daylin Morgan 2022-01-21 10:37:04 -06:00
parent ec05032f50
commit 5acfc464dc
4 changed files with 71 additions and 34 deletions

View file

@ -11,3 +11,4 @@ end
map('i','jk','<Esc>',{noremap=true})
map('v','jk','<Esc>',{noremap=true})

View file

@ -1,11 +1,11 @@
-- LOAD THE PLUGINS
-- install packer on the fly
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
Packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
end
-- local fn = vim.Fn
-- local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
-- if fn.empty(fn.glob(install_path)) > 0 then
-- packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
-- end
--
@ -13,6 +13,7 @@ return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'preservim/NERDTree'
use {
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
@ -20,19 +21,40 @@ return require('packer').startup(function(use)
require'alpha'.setup(require'alpha.themes.startify'.opts)
end
}
use {
'airblade/vim-gitgutter',
config = function ()
config = function()
local cmd = vim.cmd
cmd [[highlight! link SignColumn LineNr]]
end
}
use {
'neoclide/coc.nvim',
branch='release'
'norcalli/nvim-colorizer.lua',
conifg = function()
require'colorizer'.setup()
end
}
use {
"folke/which-key.nvim",
config = function()
require("which-key").setup()
end
}
use {
"ntpeters/vim-better-whitespace",
config = function()
local cmd = vim.cmd
cmd [[ let g:strip_whitespace_on_save = 1 ]]
end
}
-- style
use 'Mofiqul/dracula.nvim'
-- language specific plugins
@ -46,8 +68,7 @@ return require('packer').startup(function(use)
-- toml
use 'cespare/vim-toml'
if Packer_bootstrap then
if packer_bootstrap then
require('packer').sync()
end
end)

View file

@ -3,6 +3,8 @@ local o = vim.o
local w = vim.wo
local b = vim.bo
vim.g.mapleader = ' '
b.autoindent = true
b.expandtab = true
b.softtabstop = 4

View file

@ -1,43 +1,56 @@
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2> /dev/null
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2>/dev/null
# Key bindings
# ------------
source "$HOME/.fzf/shell/key-bindings.zsh"
FZF_COLORS="
--color=dark
--color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f
--color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7
"
FZF_LAYOUT="
--height=40%
--border=rounded
--margin=0,5,5%
--layout=reverse
"
# Configs
export FZF_DEFAULT_OPTS="--color=fg:#f8f8f2,bg:#282a36,hl:#bd93f9
--color=fg+:#f8f8f2,bg+:#44475a,hl+:#bd93f9
--color=info:#ffb86c,prompt:#50fa7b,pointer:#ff79c6
--color=marker:#ff79c6,spinner:#ffb86c,header:#6272a4
--layout=reverse --info=inline --border=horizontal
--min-height=25"
export FZF_DEFAULT_OPTS=${FZF_COLORS}${FZF_LAYOUT}
export FZF_CTRL_GENERAL="--height=100% --margin=0,0,0"
#adapted from https://github.com/zimfw/fzf/blob/master/init.zsh
if (( ${+commands[fd]} )); then
export FZF_DEFAULT_COMMAND="command fd --type file --exclude ".git/" --hidden --no-ignore"
_fzf_compgen_path() {
command fd --type file --exclude ".git/" --hidden --no-ignore "${1}"
}
elif (( ${+commands[rg]} )); then
export FZF_DEFAULT_COMMAND="command rg -uu -g '!.git' --files"
_fzf_compgen_path() {
command rg -uu -g '!.git' --files "${1}"
}
if [ -x "$(command -v fd)" ]; then
export FZF_DEFAULT_COMMAND="command fd --type file --exclude ".git/" --hidden --no-ignore"
_fzf_compgen_path() {
command fd --type file --exclude ".git/" --hidden --no-ignore "${1}"
}
elif [ -x "$(command -v rg)" ]; then
export FZF_DEFAULT_COMMAND="command rg -uu -g '!.git' --files"
_fzf_compgen_path() {
command rg -uu -g '!.git' --files "${1}"
}
fi
if (( ${+commands[bat]} )); then
export FZF_CTRL_T_OPTS="--preview 'command bat --color=always --line-range :500 {}' ${FZF_CTRL_T_OPTS}"
if [ -x "$(command -v bat)" ]; then
export FZF_CTRL_T_OPTS="
--preview 'command bat --style numbers --color=always --line-range :500 {}'
--preview-window up,70%,border-rounded
${FZF_CTRL_GENERAL}
"
fi
export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'"
export FZF_ALT_C_OPTS="
--height 60%
--preview 'lsd --tree --color always --icon always {}'
--preview-window right,60%,border-rounded
"
if (( ${+FZF_DEFAULT_COMMAND} )) export FZF_CTRL_T_COMMAND=${FZF_DEFAULT_COMMAND}
# [[ -v FZF_CTRL_T_COMMAND ]] && && export FZF_CTRL_T_COMMAND=${FZF_DEFAULT_COMMAND}
[[ -z "$FZF_CTRL_T_COMMAND" ]] && export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
# fix spacing on fzf-tab to show max options
zstyle ':fzf-tab:*' fzf-pad 4