mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2025-07-02 17:49: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",
|
||||
|
Reference in New Issue
Block a user