mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2025-07-01 23:19:25 +00:00
[neovim] Replace the projections plugin with neovim-projects
This commit is contained in:
@ -34,14 +34,6 @@ vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
|
||||
end,
|
||||
})
|
||||
|
||||
-- -- Autostore session on VimExit
|
||||
-- local Session = require("projections.session")
|
||||
-- vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
|
||||
-- callback = function()
|
||||
-- Session.store(vim.loop.cwd())
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- Ensure terraform files use hcl LSP
|
||||
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
||||
pattern = { "*.tf" },
|
||||
|
@ -13,8 +13,3 @@ end, {})
|
||||
vim.api.nvim_create_user_command("RemoveTrailingSpaces", function()
|
||||
vim.cmd("% s/\\s\\+$//e")
|
||||
end, {})
|
||||
|
||||
local workspace = require("projections.workspace")
|
||||
vim.api.nvim_create_user_command("AddWorkspace", function()
|
||||
workspace.add(vim.loop.cwd())
|
||||
end, {})
|
||||
|
@ -93,8 +93,8 @@ keymap("x", "<leader>/", "<esc><cmd>lua require'Comment.api'.toggle.linewise(vim
|
||||
keymap("n", "<leader>df", ":DiffviewFileHistory %<cr>", opts)
|
||||
keymap("n", "<leader>dc", ":DiffviewClose<cr>", opts)
|
||||
|
||||
-- Projections
|
||||
keymap("n", "<leader>fp", ":Telescope projections<cr>", opts)
|
||||
-- Projects
|
||||
keymap("n", "<leader>fp", ":Telescope neovim-project discover<cr>", opts)
|
||||
|
||||
-- Base64
|
||||
keymap("v", "<leader>64e", ":<c-u>lua require'b64'.encode()<cr>", opts)
|
||||
|
@ -19,6 +19,16 @@ local lazy_opts = {
|
||||
},
|
||||
}
|
||||
|
||||
local projects = function ()
|
||||
local file = io.open(os.getenv("HOME") .. "/.config/nvim/neovim-projects.json", "rb")
|
||||
if not file then return {} end
|
||||
|
||||
local jsonString = file:read "*a"
|
||||
file:close()
|
||||
|
||||
return vim.json.decode(jsonString)
|
||||
end
|
||||
|
||||
require("lazy").setup({
|
||||
-- Colorschemes
|
||||
{
|
||||
@ -87,7 +97,20 @@ require("lazy").setup({
|
||||
},
|
||||
{ "romgrk/fzy-lua-native" },
|
||||
{ "mg979/vim-visual-multi", version = "v0.*" },
|
||||
{ "gnikdroy/projections.nvim", branch = "pre_release" },
|
||||
{
|
||||
"coffebar/neovim-project",
|
||||
opts = {
|
||||
projects = projects(),
|
||||
last_session_on_startup = false,
|
||||
},
|
||||
init = function()
|
||||
vim.opt.sessionoptions:append("globals")
|
||||
end,
|
||||
dependencies = {
|
||||
{ "Shatur/neovim-session-manager" },
|
||||
},
|
||||
priority = 100,
|
||||
},
|
||||
{ "nvim-treesitter/nvim-treesitter", event = "BufReadPost" },
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
|
@ -16,7 +16,6 @@ require("plugins.noice")
|
||||
require("plugins.trouble")
|
||||
require("plugins.autosave")
|
||||
require("plugins.markdowntoc")
|
||||
require("plugins.projections")
|
||||
require("plugins.diffview")
|
||||
require("plugins.align")
|
||||
require("plugins.ufo")
|
||||
|
@ -1,8 +0,0 @@
|
||||
require("projections").setup({
|
||||
store_hooks = {
|
||||
pre = function()
|
||||
-- Close neo-tree before storing sessions
|
||||
vim.cmd([[Neotree action=close]])
|
||||
end,
|
||||
},
|
||||
})
|
@ -22,7 +22,7 @@ starter.setup({
|
||||
header = logo,
|
||||
footer = "",
|
||||
items = {
|
||||
new_section("Projects", "Telescope projections", "Telescope"),
|
||||
new_section("Projects", "Telescope neovim-project discover", "Telescope"),
|
||||
new_section("Recent files", "Telescope oldfiles", "Telescope"),
|
||||
new_section("New file", "ene | startinsert", "Built-in"),
|
||||
new_section("Quit", "qa", "Built-in"),
|
||||
|
@ -39,5 +39,4 @@ telescope.setup({
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("ui-select")
|
||||
telescope.load_extension("projections")
|
||||
telescope.load_extension("yaml_schema")
|
||||
|
Reference in New Issue
Block a user