Skip to content

Commit

Permalink
Feat(Neovim Project) add project manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Gako358 committed Oct 30, 2024
1 parent 95d48b6 commit 0794b26
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 0 deletions.
34 changes: 34 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
flake = false;
};

# Projects
plugins-project = {
url = "github:coffebar/neovim-project";
flake = false;
};
plugins-session = {
url = "github:Shatur/neovim-session-manager";
flake = false;
};

# Autocompletes
plugins-nvim-cmp = {
url = "github:hrsh7th/nvim-cmp";
Expand Down Expand Up @@ -259,6 +269,7 @@
gitsigns.codeActions = true;
lazygit.enable = true;
};
vim.gui.enable = true;
vim.keys = {
enable = true;
whichKey.enable = true;
Expand Down Expand Up @@ -325,6 +336,7 @@
todo.enable = true;
};
vim.telescope.enable = true;
vim.project.enable = true;
};
};
in
Expand Down
25 changes: 25 additions & 0 deletions modules/gui/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.gui;
in {
options.vim.gui = {
enable = mkEnableOption "Neovide gui";
};

config = mkIf (cfg.enable) {
vim.luaConfigRC.gui = nvim.dag.entryAnywhere ''
vim.g.neovide_transparency = 0
vim.g.transparency = 0.91
vim.g.neovide_background_color = ("#0f1117" .. string.format("%x", math.floor(((255 * vim.g.transparency) or 0.8))))
vim.o.guifont = "Iosevka Nerd Font:h12"
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", {desc = "Exit terminal mode"})
vim.keymap.set("n", "<leader>tv", ":vsplit | terminal<CR>", {desc = "Open vertical split terminal"})
vim.keymap.set("n", "<leader>th", ":split | terminal<CR>", {desc = "Open horizontal split terminal"})
'';
};
}
2 changes: 2 additions & 0 deletions modules/modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
./core
./debug
./git
./gui
./keys
./languages
./lsp
./note
./project
./snippets
./telescope
./treesitter
Expand Down
43 changes: 43 additions & 0 deletions modules/project/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.project;
in {
options.vim.project = {
enable = mkEnableOption "enable project management in neovim";
};

config = mkIf (cfg.enable) {
vim.startPlugins = [
"project"
"session"
];

vim.luaConfigRC.sql =
nvim.dag.entryAnywhere
/*
lua
*/
''
vim.api.nvim_set_keymap('n', '<leader>pp', '<cmd>NeovimProjectDiscover<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>pr', '<cmd>NeovimProjectLoadRecent<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>ph', '<cmd>NeovimProjectHistory<CR>', { noremap = true, silent = true })
require("neovim-project").setup {
projects = {
"~/Projects/*",
"~/Projects/workspace/*",
"~/Sources/*",
"~/Documents/*",
},
picker = {
type = "telescope", -- or "fzf-lua"
}
}
'';
};
}

0 comments on commit 0794b26

Please sign in to comment.