Lsp fixes, buffer closing, file lookups
This commit is contained in:
parent
009809b976
commit
fc7980dc5f
117
lua/functions.lua
Normal file
117
lua/functions.lua
Normal file
@ -0,0 +1,117 @@
|
||||
local F = {}
|
||||
|
||||
F.close_buffer = function(force)
|
||||
-- This is a modification of a NeoVim plugin from
|
||||
-- Author: ojroques - Olivier Roques
|
||||
-- Src: https://github.com/ojroques/nvim-bufdel
|
||||
-- (Author has okayed copy-paste)
|
||||
|
||||
-- Options
|
||||
local opts = {
|
||||
next = "cycle", -- how to retrieve the next buffer
|
||||
quit = false, -- exit when last buffer is deleted
|
||||
--TODO make this a chadrc flag/option
|
||||
}
|
||||
|
||||
-- ----------------
|
||||
-- Helper functions
|
||||
-- ----------------
|
||||
|
||||
-- Switch to buffer 'buf' on each window from list 'windows'
|
||||
local function switch_buffer(windows, buf)
|
||||
local cur_win = vim.fn.winnr()
|
||||
for _, winid in ipairs(windows) do
|
||||
vim.cmd(string.format("%d wincmd w", vim.fn.win_id2win(winid)))
|
||||
vim.cmd(string.format("buffer %d", buf))
|
||||
end
|
||||
vim.cmd(string.format("%d wincmd w", cur_win)) -- return to original window
|
||||
end
|
||||
|
||||
-- Select the first buffer with a number greater than given buffer
|
||||
local function get_next_buf(buf)
|
||||
local next = vim.fn.bufnr "#"
|
||||
if opts.next == "alternate" and vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
for i = 0, vim.fn.bufnr "$" - 1 do
|
||||
next = (buf + i) % vim.fn.bufnr "$" + 1 -- will loop back to 1
|
||||
if vim.fn.buflisted(next) == 1 then
|
||||
return next
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- ----------------
|
||||
-- End helper functions
|
||||
-- ----------------
|
||||
|
||||
local buf = vim.fn.bufnr()
|
||||
if vim.fn.buflisted(buf) == 0 then -- exit if buffer number is invalid
|
||||
vim.cmd "close"
|
||||
return
|
||||
end
|
||||
|
||||
if #vim.fn.getbufinfo { buflisted = 1 } < 2 then
|
||||
if opts.quit then
|
||||
-- exit when there is only one buffer left
|
||||
if force then
|
||||
vim.cmd "qall!"
|
||||
else
|
||||
vim.cmd "confirm qall"
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local chad_term, _ = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
if chad_term then
|
||||
-- Must be a window type
|
||||
vim.cmd(string.format("setlocal nobl", buf))
|
||||
vim.cmd "enew"
|
||||
return
|
||||
end
|
||||
-- don't exit and create a new empty buffer
|
||||
vim.cmd "enew"
|
||||
vim.cmd "bp"
|
||||
end
|
||||
|
||||
local next_buf = get_next_buf(buf)
|
||||
local windows = vim.fn.getbufinfo(buf)[1].windows
|
||||
|
||||
-- force deletion of terminal buffers to avoid the prompt
|
||||
if force or vim.fn.getbufvar(buf, "&buftype") == "terminal" then
|
||||
local chad_term, type = pcall(function()
|
||||
return vim.api.nvim_buf_get_var(buf, "term_type")
|
||||
end)
|
||||
|
||||
-- TODO this scope is error prone, make resilient
|
||||
if chad_term then
|
||||
if type == "wind" then
|
||||
-- hide from bufferline
|
||||
vim.cmd(string.format("%d bufdo setlocal nobl", buf))
|
||||
-- swtich to another buff
|
||||
-- TODO switch to next bufffer, this works too
|
||||
vim.cmd "BufferLineCycleNext"
|
||||
else
|
||||
local cur_win = vim.fn.winnr()
|
||||
-- we can close this window
|
||||
vim.cmd(string.format("%d wincmd c", cur_win))
|
||||
return
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("bd! %d", buf))
|
||||
end
|
||||
else
|
||||
switch_buffer(windows, next_buf)
|
||||
vim.cmd(string.format("silent! confirm bd %d", buf))
|
||||
end
|
||||
-- revert buffer switches if user has canceled deletion
|
||||
if vim.fn.buflisted(buf) == 1 then
|
||||
switch_buffer(windows, buf)
|
||||
end
|
||||
end
|
||||
|
||||
return F
|
23
lua/lsp.lua
23
lua/lsp.lua
@ -1,8 +1,4 @@
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
|
||||
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
@ -15,7 +11,24 @@ lsp_installer.on_server_ready(function(server)
|
||||
}
|
||||
server:attach_buffers()
|
||||
else
|
||||
if server.name == "ansiblels" then
|
||||
opts.settings = {
|
||||
ansible = {
|
||||
ansible = {
|
||||
path = "ansible"
|
||||
},
|
||||
ansibleLint = {
|
||||
enabled = true,
|
||||
path = "ansible-lint"
|
||||
},
|
||||
python = {
|
||||
interpreterPath = "python3"
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
server:setup(opts)
|
||||
vim.cmd [[ do User LspAttachBuffers ]]
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -33,7 +33,7 @@ map("n", "<S-Tab>", ":BufferLineCyclePrev<CR>")
|
||||
map("n", "<Tab>", ":BufferLineCycleNext<CR>")
|
||||
|
||||
-- Buffer closing.
|
||||
map("n", "<leader>bc", ":BufferLinePickClose<CR>")
|
||||
map("n", "<leader>bc", ":lua require('functions').close_buffer()<CR>")
|
||||
|
||||
-- Buffer moving.
|
||||
map("n", "<leader>bl", ":BufferLineMoveNext<CR>")
|
||||
@ -81,7 +81,6 @@ map("n", "<leader>lT", ":lua vim.lsp.buf.type_definition()<CR>", lsp_opts)
|
||||
map("n", "<leader>ln", ":lua vim.lsp.buf.rename()<CR>", lsp_opts)
|
||||
map("n", "<leader>lc", ":lua vim.lsp.buf.code_action()<CR>", lsp_opts)
|
||||
map("n", "<leader>lr", ":lua vim.lsp.buf.references()<CR>", lsp_opts)
|
||||
map("n", "<leader>le", ":Telescope diagnostics bufnr=0", lsp_opts)
|
||||
map("n", "[", ":lua vim.lsp.diagnostic.goto_prev()<CR>", lsp_opts)
|
||||
map("n", "]", ":lua vim.lsp.diagnostic.goto_next()<CR>", lsp_opts)
|
||||
map("n", "<leader>lq", ":Telescope diagnostics bufnr=0<CR>", lsp_opts)
|
||||
|
@ -434,6 +434,9 @@ return require("packer").startup({function()
|
||||
setup = function() vim.g.mkdp_filetypes = { "markdown" } end,
|
||||
ft = { "markdown" },
|
||||
}
|
||||
use {
|
||||
"pearofducks/ansible-vim",
|
||||
}
|
||||
|
||||
for key, plugin in pairs(additional_plugins) do
|
||||
if type(plugin) == "string" then
|
||||
|
@ -12,7 +12,7 @@ nvim_treesitter.setup {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true
|
||||
disable = { 'yaml' }
|
||||
},
|
||||
autotag = {
|
||||
enable = true
|
||||
|
@ -86,6 +86,11 @@ _G.packer_plugins = {
|
||||
path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/opt/TrueZen.nvim",
|
||||
url = "https://github.com/Pocco81/TrueZen.nvim"
|
||||
},
|
||||
["ansible-vim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/pricehiller/.local/share/nvim/site/pack/packer/start/ansible-vim",
|
||||
url = "https://github.com/pearofducks/ansible-vim"
|
||||
},
|
||||
["cheatsheet.nvim"] = {
|
||||
config = { "\27LJ\2\n<\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\15cheatsheet\frequire\0" },
|
||||
loaded = true,
|
||||
@ -396,7 +401,7 @@ _G.packer_plugins = {
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
commands = { "Telescope" },
|
||||
config = { "\27LJ\2\n½\2\0\0\a\0\14\0\0246\0\0\0'\2\1\0B\0\2\0029\1\2\0005\3\n\0005\4\6\0005\5\4\0005\6\3\0=\6\5\5=\5\a\0045\5\b\0=\5\t\4=\4\v\3B\1\2\0019\1\f\0'\3\a\0B\1\2\0019\1\f\0'\3\r\0B\1\2\0019\1\f\0'\3\t\0B\1\2\1K\0\1\0\21find_directories\19load_extension\15extensions\1\0\0\bfzf\1\0\4\nfuzzy\2\14case_mode\15smart_case\25override_file_sorter\2\28override_generic_sorter\2\16media_files\1\0\0\14filetypes\1\0\1\rfind_cmd\arg\1\5\0\0\bpng\twebp\bjpg\tjpeg\nsetup\14telescope\frequire\0" },
|
||||
config = { "\27LJ\2\n½\2\0\0\a\0\14\0\0246\0\0\0'\2\1\0B\0\2\0029\1\2\0005\3\n\0005\4\6\0005\5\4\0005\6\3\0=\6\5\5=\5\a\0045\5\b\0=\5\t\4=\4\v\3B\1\2\0019\1\f\0'\3\a\0B\1\2\0019\1\f\0'\3\r\0B\1\2\0019\1\f\0'\3\t\0B\1\2\1K\0\1\0\21find_directories\19load_extension\15extensions\1\0\0\bfzf\1\0\4\28override_generic_sorter\2\nfuzzy\2\14case_mode\15smart_case\25override_file_sorter\2\16media_files\1\0\0\14filetypes\1\0\1\rfind_cmd\arg\1\5\0\0\bpng\twebp\bjpg\tjpeg\nsetup\14telescope\frequire\0" },
|
||||
loaded = false,
|
||||
needs_bufread = true,
|
||||
only_cond = false,
|
||||
@ -487,22 +492,18 @@ _G.packer_plugins = {
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Setup for: dashboard-nvim
|
||||
time([[Setup for dashboard-nvim]], true)
|
||||
try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/dashboard\frequire\0", "setup", "dashboard-nvim")
|
||||
time([[Setup for dashboard-nvim]], false)
|
||||
-- Setup for: markdown-preview.nvim
|
||||
time([[Setup for markdown-preview.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\2\0\4\0\0056\0\0\0009\0\1\0005\1\3\0=\1\2\0K\0\1\0\1\2\0\0\rmarkdown\19mkdp_filetypes\6g\bvim\0", "setup", "markdown-preview.nvim")
|
||||
time([[Setup for markdown-preview.nvim]], false)
|
||||
-- Setup for: TrueZen.nvim
|
||||
time([[Setup for TrueZen.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21plugins/true-zen\frequire\0", "setup", "TrueZen.nvim")
|
||||
time([[Setup for TrueZen.nvim]], false)
|
||||
-- Config for: cheatsheet.nvim
|
||||
time([[Config for cheatsheet.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\15cheatsheet\frequire\0", "config", "cheatsheet.nvim")
|
||||
time([[Config for cheatsheet.nvim]], false)
|
||||
-- Setup for: markdown-preview.nvim
|
||||
time([[Setup for markdown-preview.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n=\0\0\2\0\4\0\0056\0\0\0009\0\1\0005\1\3\0=\1\2\0K\0\1\0\1\2\0\0\rmarkdown\19mkdp_filetypes\6g\bvim\0", "setup", "markdown-preview.nvim")
|
||||
time([[Setup for markdown-preview.nvim]], false)
|
||||
-- Setup for: dashboard-nvim
|
||||
time([[Setup for dashboard-nvim]], true)
|
||||
try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/dashboard\frequire\0", "setup", "dashboard-nvim")
|
||||
time([[Setup for dashboard-nvim]], false)
|
||||
-- Config for: which-key.nvim
|
||||
time([[Config for which-key.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14which-key\frequire\0", "config", "which-key.nvim")
|
||||
@ -511,6 +512,10 @@ time([[Config for which-key.nvim]], false)
|
||||
time([[Config for nvim-neoclip.lua]], true)
|
||||
try_loadstring("\27LJ\2\nW\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\30enable_persistant_history\2\nsetup\fneoclip\frequire\0", "config", "nvim-neoclip.lua")
|
||||
time([[Config for nvim-neoclip.lua]], false)
|
||||
-- Config for: cheatsheet.nvim
|
||||
time([[Config for cheatsheet.nvim]], true)
|
||||
try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\15cheatsheet\frequire\0", "config", "cheatsheet.nvim")
|
||||
time([[Config for cheatsheet.nvim]], false)
|
||||
-- Load plugins in order defined by `after`
|
||||
time([[Sequenced loading]], true)
|
||||
vim.cmd [[ packadd coq_nvim ]]
|
||||
@ -523,45 +528,16 @@ time([[Sequenced loading]], false)
|
||||
|
||||
-- Command lazy-loads
|
||||
time([[Defining lazy-load commands]], true)
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.open() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.toggle() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.close() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.set_log_level() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.session() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIInstall lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIInstall", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIUninstall lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIUninstall", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIList lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIList", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Vista lua require("packer.load")({'vista.vim'}, { cmd = "Vista", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZMinimalist lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZMinimalist", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file ToggleTerm lua require("packer.load")({'nvim-toggleterm.lua'}, { cmd = "ToggleTerm", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZFocus lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZFocus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZAtaraxis lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZAtaraxis", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Git lua require("packer.load")({'vim-fugitive'}, { cmd = "Git", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindWord lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindWord", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeOpen lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeOpen", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeFocus lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeFocus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SessionSave lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionSave", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file SessionLoad lua require("packer.load")({'dashboard-nvim'}, { cmd = "SessionLoad", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardJumpMarks lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardJumpMarks", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardNewFile lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardNewFile", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file new lua require("packer.load")({'mkdir.nvim'}, { cmd = "new", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindWord lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindWord", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindHistory lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindHistory", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardFindFile lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardFindFile", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardChangeColorscheme lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardChangeColorscheme", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Dashboard lua require("packer.load")({'dashboard-nvim'}, { cmd = "Dashboard", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSUpdateSync lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSUpdateSync", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeOpen lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeOpen", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeFocus lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeFocus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file NvimTreeToggle lua require("packer.load")({'nvim-tree.lua'}, { cmd = "NvimTreeToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSUpdate lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSUpdate", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSToggleAll lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSToggleAll", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstallFromGrammer lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstallFromGrammer", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSEnableAll lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSEnableAll", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufToggle lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufEnable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufEnable", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstallSync lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstallSync", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstall lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstall", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.continue() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.run() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.run_last() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
@ -583,26 +559,55 @@ pcall(vim.cmd, [[au CmdUndefined lua require'dap'.reverse_continue() ++once lua
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.up() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.down() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.run_to_cursor() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.open() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.toggle() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.repl.close() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.set_log_level() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[au CmdUndefined lua require'dap'.session() ++once lua require"packer.load"({'DAPInstall.nvim'}, {}, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIInstall lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIInstall", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIUninstall lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIUninstall", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DIList lua require("packer.load")({'DAPInstall.nvim'}, { cmd = "DIList", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file new lua require("packer.load")({'mkdir.nvim'}, { cmd = "new", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file DashboardChangeColorscheme lua require("packer.load")({'dashboard-nvim'}, { cmd = "DashboardChangeColorscheme", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Dashboard lua require("packer.load")({'dashboard-nvim'}, { cmd = "Dashboard", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Neoformat lua require("packer.load")({'neoformat'}, { cmd = "Neoformat", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZMinimalist lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZMinimalist", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Vista lua require("packer.load")({'vista.vim'}, { cmd = "Vista", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSUpdate lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSUpdate", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file CommentToggle lua require("packer.load")({'nvim-comment'}, { cmd = "CommentToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file ToggleTerm lua require("packer.load")({'nvim-toggleterm.lua'}, { cmd = "ToggleTerm", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZFocus lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZFocus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TZAtaraxis lua require("packer.load")({'TrueZen.nvim'}, { cmd = "TZAtaraxis", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Git lua require("packer.load")({'vim-fugitive'}, { cmd = "Git", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSUpdateSync lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSUpdateSync", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSToggleAll lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSToggleAll", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstallFromGrammer lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstallFromGrammer", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSEnableAll lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSEnableAll", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufToggle lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufToggle", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSBufEnable lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSBufEnable", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstallSync lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstallSync", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args>, mods = "<mods>" }, _G.packer_plugins)]])
|
||||
pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file TSInstall lua require("packer.load")({'nvim-treesitter'}, { cmd = "TSInstall", 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!]]
|
||||
-- Filetype lazy-loads
|
||||
time([[Defining lazy-load filetype autocommands]], true)
|
||||
vim.cmd [[au FileType vue ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "vue" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType php ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "php" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType markdown ++once lua require("packer.load")({'markdown-preview.nvim'}, { ft = "markdown" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType html ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "html" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType javascript ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "javascript" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType javascriptreact ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "javascriptreact" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType typescriptreact ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "typescriptreact" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType svelte ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "svelte" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType markdown ++once lua require("packer.load")({'markdown-preview.nvim'}, { ft = "markdown" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType php ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "php" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType vue ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "vue" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType html ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "html" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au FileType javascript ++once lua require("packer.load")({'nvim-ts-autotag'}, { ft = "javascript" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load filetype autocommands]], false)
|
||||
-- Event lazy-loads
|
||||
time([[Defining lazy-load event autocommands]], true)
|
||||
vim.cmd [[au BufEnter * ++once lua require("packer.load")({'indent-blankline.nvim', 'vim-resize', 'nvim-web-devicons', 'nvim-lspconfig', 'nvim-treesitter', 'todo-comments.nvim', 'nvim-colorizer.lua'}, { event = "BufEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'gitsigns.nvim', 'vim-better-whitespace', 'neoscroll.nvim', 'nvim-scrollview'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufEnter * ++once lua require("packer.load")({'nvim-lspconfig', 'indent-blankline.nvim', 'nvim-web-devicons', 'nvim-treesitter', 'nvim-colorizer.lua', 'todo-comments.nvim', 'vim-resize'}, { event = "BufEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'friendly-snippets'}, { event = "InsertEnter *" }, _G.packer_plugins)]]
|
||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'gitsigns.nvim', 'neoscroll.nvim', 'nvim-scrollview', 'vim-better-whitespace'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||
time([[Defining lazy-load event autocommands]], false)
|
||||
vim.cmd("augroup END")
|
||||
if should_profile then save_profiles() end
|
||||
|
Loading…
Reference in New Issue
Block a user