Added fzf to nvim and a few zsh aliases

This commit is contained in:
2021-12-14 21:11:27 -05:00
parent 9c48322f85
commit 306fbd4fee
5 changed files with 5 additions and 279 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
**/.DS_Store **/.DS_Store
**/Brewfile.lock.json **/Brewfile.lock.json
**/plugins **/plugins
**/plugin
**/.zcompdump* **/.zcompdump*
**/.zcompdump **/.zcompdump
**/.zcompcache **/.zcompcache

View File

@@ -2,6 +2,7 @@ local actions = require('telescope.actions')
local telescope = require('telescope') local telescope = require('telescope')
--telescope.load_extension('projects') --telescope.load_extension('projects')
telescope.load_extension('fzf')
telescope.setup{ telescope.setup{
defaults = { defaults = {

View File

@@ -46,6 +46,8 @@ use {
requires = { {'nvim-lua/plenary.nvim'} } requires = { {'nvim-lua/plenary.nvim'} }
} }
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
use { use {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
config = get_config("treesitter"), config = get_config("treesitter"),

View File

@@ -1,279 +0,0 @@
-- Automatically generated packer.nvim plugin loader code
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
return
end
vim.api.nvim_command('packadd packer.nvim')
local no_errors, error_msg = pcall(function()
local time
local profile_info
local should_profile = false
if should_profile then
local hrtime = vim.loop.hrtime
profile_info = {}
time = function(chunk, start)
if start then
profile_info[chunk] = hrtime()
else
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
end
end
else
time = function(chunk, start) end
end
local function save_profiles(threshold)
local sorted_times = {}
for chunk_name, time_taken in pairs(profile_info) do
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
end
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
local results = {}
for i, elem in ipairs(sorted_times) do
if not threshold or threshold and elem[2] > threshold then
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
end
end
_G._packer = _G._packer or {}
_G._packer.profile_output = results
end
time([[Luarocks path setup]], true)
local package_path_str = "/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
if not string.find(package.path, package_path_str, 1, true) then
package.path = package.path .. ';' .. package_path_str
end
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
package.cpath = package.cpath .. ';' .. install_cpath_pattern
end
time([[Luarocks path setup]], false)
time([[try_loadstring definition]], true)
local function try_loadstring(s, component, name)
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
if not success then
vim.schedule(function()
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
end)
end
return result
end
time([[try_loadstring definition]], false)
time([[Defining packer_plugins]], true)
_G.packer_plugins = {
["bufdelete.nvim"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/bufdelete.nvim",
url = "https://github.com/famiu/bufdelete.nvim"
},
["cmp-buffer"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-buffer",
url = "https://github.com/hrsh7th/cmp-buffer"
},
["cmp-calc"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-calc",
url = "https://github.com/hrsh7th/cmp-calc"
},
["cmp-cmdline"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-cmdline",
url = "https://github.com/hrsh7th/cmp-cmdline"
},
["cmp-emoji"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-emoji",
url = "https://github.com/hrsh7th/cmp-emoji"
},
["cmp-nvim-lsp"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-path"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
["cmp-spell"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-spell",
url = "https://github.com/f3fora/cmp-spell"
},
["cmp-vsnip"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/cmp-vsnip",
url = "https://github.com/hrsh7th/cmp-vsnip"
},
["diffview.nvim"] = {
commands = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" },
config = { 'require("config/diffview")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/Users/michael/.local/share/nvim/site/pack/packer/opt/diffview.nvim",
url = "https://github.com/sindrets/diffview.nvim"
},
["lsp_signature.nvim"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim",
url = "https://github.com/ray-x/lsp_signature.nvim"
},
["lspkind-nvim"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/lspkind-nvim",
url = "https://github.com/onsails/lspkind-nvim"
},
["lualine.nvim"] = {
config = { 'require("config/lualine")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/lualine.nvim",
url = "https://github.com/nvim-lualine/lualine.nvim"
},
neogit = {
commands = { "Neogit" },
config = { 'require("config/neogit")' },
loaded = false,
needs_bufread = true,
only_cond = false,
path = "/Users/michael/.local/share/nvim/site/pack/packer/opt/neogit",
url = "https://github.com/TimUntersberger/neogit"
},
["nightfox.nvim"] = {
config = { 'require("config/nightfox")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
url = "https://github.com/EdenEast/nightfox.nvim"
},
["nvim-cmp"] = {
config = { 'require("config/cmp")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp"
},
["nvim-lsp-installer"] = {
config = { 'require("config/lsp-installer")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer",
url = "https://github.com/williamboman/nvim-lsp-installer"
},
["nvim-lspconfig"] = {
config = { 'require("config/lsp")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-tree.lua"] = {
config = { 'require("config/nvim-tree")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
url = "https://github.com/kyazdani42/nvim-tree.lua"
},
["nvim-treesitter"] = {
config = { 'require("config/treesitter")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
url = "https://github.com/nvim-treesitter/nvim-treesitter"
},
["nvim-treesitter-textobjects"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textobjects",
url = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"
},
["nvim-web-devicons"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
url = "https://github.com/kyazdani42/nvim-web-devicons"
},
["packer.nvim"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/packer.nvim",
url = "https://github.com/wbthomason/packer.nvim"
},
["plenary.nvim"] = {
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/plenary.nvim",
url = "https://github.com/nvim-lua/plenary.nvim"
},
["telescope.nvim"] = {
config = { 'require("config/telescope")' },
loaded = true,
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
["which-key.nvim"] = {
config = { 'require("config/which")' },
loaded = false,
needs_bufread = false,
only_cond = false,
path = "/Users/michael/.local/share/nvim/site/pack/packer/opt/which-key.nvim",
url = "https://github.com/folke/which-key.nvim"
}
}
time([[Defining packer_plugins]], false)
-- Config for: nvim-lsp-installer
time([[Config for nvim-lsp-installer]], true)
require("config/lsp-installer")
time([[Config for nvim-lsp-installer]], false)
-- Config for: nvim-cmp
time([[Config for nvim-cmp]], true)
require("config/cmp")
time([[Config for nvim-cmp]], false)
-- Config for: nightfox.nvim
time([[Config for nightfox.nvim]], true)
require("config/nightfox")
time([[Config for nightfox.nvim]], false)
-- Config for: nvim-lspconfig
time([[Config for nvim-lspconfig]], true)
require("config/lsp")
time([[Config for nvim-lspconfig]], false)
-- Config for: telescope.nvim
time([[Config for telescope.nvim]], true)
require("config/telescope")
time([[Config for telescope.nvim]], false)
-- Config for: nvim-treesitter
time([[Config for nvim-treesitter]], true)
require("config/treesitter")
time([[Config for nvim-treesitter]], false)
-- Config for: nvim-tree.lua
time([[Config for nvim-tree.lua]], true)
require("config/nvim-tree")
time([[Config for nvim-tree.lua]], false)
-- Config for: lualine.nvim
time([[Config for lualine.nvim]], true)
require("config/lualine")
time([[Config for lualine.nvim]], false)
-- Command lazy-loads
time([[Defining lazy-load commands]], true)
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neogit lua require("packer.load")({'neogit'}, { cmd = "Neogit", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewOpen lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewOpen", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewClose lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewClose", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewToggleFiles lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewToggleFiles", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DiffviewFocusFiles lua require("packer.load")({'diffview.nvim'}, { cmd = "DiffviewFocusFiles", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
time([[Defining lazy-load commands]], false)
vim.cmd [[augroup packer_load_aucmds]]
vim.cmd [[au!]]
-- Event lazy-loads
time([[Defining lazy-load event autocommands]], true)
vim.cmd [[au VimEnter * ++once lua require("packer.load")({'which-key.nvim'}, { event = "VimEnter *" }, _G.packer_plugins)]]
time([[Defining lazy-load event autocommands]], false)
vim.cmd("augroup END")
if should_profile then save_profiles() end
end)
if not no_errors then
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
end

View File

@@ -1,5 +1,6 @@
# configure aliases # configure aliases
#alias zshconfig="$ZDOTDIR" #alias zshconfig="$ZDOTDIR"
alias cdots() { cd "$HOME/.dotfiles" }
alias zdots() { nvim "$ZDOTDIR" } alias zdots() { nvim "$ZDOTDIR" }
alias dots() { nvim ~/.dotfiles } alias dots() { nvim ~/.dotfiles }
alias reload() { source "$ZDOTDIR/.zshrc" } alias reload() { source "$ZDOTDIR/.zshrc" }