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('i','jk','<Esc>',{noremap=true})
map('v','jk','<Esc>',{noremap=true}) map('v','jk','<Esc>',{noremap=true})

View file

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

View file

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

View file

@ -1,43 +1,56 @@
# Auto-completion # Auto-completion
# --------------- # ---------------
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2> /dev/null [[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2>/dev/null
# Key bindings # Key bindings
# ------------ # ------------
source "$HOME/.fzf/shell/key-bindings.zsh" 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=${FZF_COLORS}${FZF_LAYOUT}
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_CTRL_GENERAL="--height=100% --margin=0,0,0"
#adapted from https://github.com/zimfw/fzf/blob/master/init.zsh #adapted from https://github.com/zimfw/fzf/blob/master/init.zsh
if (( ${+commands[fd]} )); then if [ -x "$(command -v fd)" ]; then
export FZF_DEFAULT_COMMAND="command fd --type file --exclude ".git/" --hidden --no-ignore" export FZF_DEFAULT_COMMAND="command fd --type file --exclude ".git/" --hidden --no-ignore"
_fzf_compgen_path() { _fzf_compgen_path() {
command fd --type file --exclude ".git/" --hidden --no-ignore "${1}" command fd --type file --exclude ".git/" --hidden --no-ignore "${1}"
} }
elif (( ${+commands[rg]} )); then elif [ -x "$(command -v rg)" ]; then
export FZF_DEFAULT_COMMAND="command rg -uu -g '!.git' --files" export FZF_DEFAULT_COMMAND="command rg -uu -g '!.git' --files"
_fzf_compgen_path() { _fzf_compgen_path() {
command rg -uu -g '!.git' --files "${1}" command rg -uu -g '!.git' --files "${1}"
} }
fi fi
if (( ${+commands[bat]} )); then if [ -x "$(command -v bat)" ]; then
export FZF_CTRL_T_OPTS="--preview 'command bat --color=always --line-range :500 {}' ${FZF_CTRL_T_OPTS}" 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 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 # fix spacing on fzf-tab to show max options
zstyle ':fzf-tab:*' fzf-pad 4 zstyle ':fzf-tab:*' fzf-pad 4