1
0
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:
2023-09-28 18:17:05 +02:00
parent f7c1110ca3
commit 8fcb4267cc
9 changed files with 41 additions and 40 deletions

View File

@ -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" },

View File

@ -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, {})

View File

@ -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)

View File

@ -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",

View File

@ -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")

View File

@ -1,8 +0,0 @@
require("projections").setup({
store_hooks = {
pre = function()
-- Close neo-tree before storing sessions
vim.cmd([[Neotree action=close]])
end,
},
})

View File

@ -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"),

View File

@ -39,5 +39,4 @@ telescope.setup({
telescope.load_extension("fzf")
telescope.load_extension("ui-select")
telescope.load_extension("projections")
telescope.load_extension("yaml_schema")