Compare commits

..

3 commits

Author SHA1 Message Date
raf
81a05c4afc
Merge 2c9202a48b into 9eb6159ca3 2024-09-12 22:10:43 +03:00
ppenguin
9eb6159ca3
Telescope: fix projects binding, add Telescope resume in default (#370)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* Telescope: fix projects binding, add Telescope resume in default

The projects command had a typo preventing it from working; the
keybinding description was the same as for Telescope files.
Added `<leader>fr` for Telescope resume per default.

* Add info to release notes
2024-09-08 15:44:42 +00:00
diniamo
67abc51902
treewide: remove the theme section from the DAG order dependance (#369)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* treewide: remove the theme section from the DAG order dependance

* docs/dag-entries: correct theme entry note
2024-09-05 18:06:24 +00:00
6 changed files with 78 additions and 69 deletions

View file

@ -11,7 +11,7 @@ entries in nvf:
inserted before the rest of the DAG inserted before the rest of the DAG
2. `globalsScript` - used to set globals defined in `vim.globals` 2. `globalsScript` - used to set globals defined in `vim.globals`
3. `basic` - used to set basic configuration options 3. `basic` - used to set basic configuration options
4. `theme` - used to set up the theme, which has to be done before other plugins 4. `theme` (this is simply placed before `pluginConfigs`, meaning that surrounding entries don't depend on it) - used to set up the theme, which has to be done before other plugins
5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option, 5. `pluginConfigs` - the result of the nested `vim.pluginRC` (internal option,
see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own see the [Custom Plugins](/index.xhtml#ch-custom-plugins) page for adding your own
plugins) DAG, used to set up internal plugins plugins) DAG, used to set up internal plugins

View file

@ -150,3 +150,9 @@ configuration formats.
- `nvf-print-config-path` will display the path to _a clone_ of your - `nvf-print-config-path` will display the path to _a clone_ of your
`init.lua`. This is not the path used by the Neovim wrapper, but an `init.lua`. This is not the path used by the Neovim wrapper, but an
identical clone. identical clone.
[ppenguin](https://github.com/ppenguin):
- Telescope:
- Fixed `project-nvim` command and keybinding
- Added default ikeybind/command for `Telescope resume` (`<leader>fr`)

View file

@ -7,7 +7,7 @@
inherit (lib.attrsets) attrNames; inherit (lib.attrsets) attrNames;
inherit (lib.types) bool lines enum; inherit (lib.types) bool lines enum;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAfter; inherit (lib.nvim.dag) entryBefore;
cfg = config.vim.theme; cfg = config.vim.theme;
supportedThemes = import ./supported-themes.nix { supportedThemes = import ./supported-themes.nix {
@ -45,7 +45,7 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
startPlugins = [cfg.name]; startPlugins = [cfg.name];
luaConfigRC.theme = entryAfter ["basic"] '' luaConfigRC.theme = entryBefore ["pluginConfigs"] ''
${cfg.extraConfig} ${cfg.extraConfig}
${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}} ${supportedThemes.${cfg.name}.setup {inherit (cfg) style transparent;}}
''; '';

View file

@ -17,75 +17,78 @@
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = [ vim = {
"telescope" startPlugins = [
"plenary-nvim" "telescope"
]; "plenary-nvim"
];
vim.maps.normal = mkMerge [ maps.normal = mkMerge [
(mkSetBinding mappings.findFiles "<cmd> Telescope find_files<CR>") (mkSetBinding mappings.findFiles "<cmd> Telescope find_files<CR>")
(mkSetBinding mappings.liveGrep "<cmd> Telescope live_grep<CR>") (mkSetBinding mappings.liveGrep "<cmd> Telescope live_grep<CR>")
(mkSetBinding mappings.buffers "<cmd> Telescope buffers<CR>") (mkSetBinding mappings.buffers "<cmd> Telescope buffers<CR>")
(mkSetBinding mappings.helpTags "<cmd> Telescope help_tags<CR>") (mkSetBinding mappings.helpTags "<cmd> Telescope help_tags<CR>")
(mkSetBinding mappings.open "<cmd> Telescope<CR>") (mkSetBinding mappings.open "<cmd> Telescope<CR>")
(mkSetBinding mappings.resume "<cmd> Telescope resume<CR>")
(mkSetBinding mappings.gitCommits "<cmd> Telescope git_commits<CR>") (mkSetBinding mappings.gitCommits "<cmd> Telescope git_commits<CR>")
(mkSetBinding mappings.gitBufferCommits "<cmd> Telescope git_bcommits<CR>") (mkSetBinding mappings.gitBufferCommits "<cmd> Telescope git_bcommits<CR>")
(mkSetBinding mappings.gitBranches "<cmd> Telescope git_branches<CR>") (mkSetBinding mappings.gitBranches "<cmd> Telescope git_branches<CR>")
(mkSetBinding mappings.gitStatus "<cmd> Telescope git_status<CR>") (mkSetBinding mappings.gitStatus "<cmd> Telescope git_status<CR>")
(mkSetBinding mappings.gitStash "<cmd> Telescope git_stash<CR>") (mkSetBinding mappings.gitStash "<cmd> Telescope git_stash<CR>")
(mkIf config.vim.lsp.enable (mkMerge [ (mkIf config.vim.lsp.enable (mkMerge [
(mkSetBinding mappings.lspDocumentSymbols "<cmd> Telescope lsp_document_symbols<CR>") (mkSetBinding mappings.lspDocumentSymbols "<cmd> Telescope lsp_document_symbols<CR>")
(mkSetBinding mappings.lspWorkspaceSymbols "<cmd> Telescope lsp_workspace_symbols<CR>") (mkSetBinding mappings.lspWorkspaceSymbols "<cmd> Telescope lsp_workspace_symbols<CR>")
(mkSetBinding mappings.lspReferences "<cmd> Telescope lsp_references<CR>") (mkSetBinding mappings.lspReferences "<cmd> Telescope lsp_references<CR>")
(mkSetBinding mappings.lspImplementations "<cmd> Telescope lsp_implementations<CR>") (mkSetBinding mappings.lspImplementations "<cmd> Telescope lsp_implementations<CR>")
(mkSetBinding mappings.lspDefinitions "<cmd> Telescope lsp_definitions<CR>") (mkSetBinding mappings.lspDefinitions "<cmd> Telescope lsp_definitions<CR>")
(mkSetBinding mappings.lspTypeDefinitions "<cmd> Telescope lsp_type_definitions<CR>") (mkSetBinding mappings.lspTypeDefinitions "<cmd> Telescope lsp_type_definitions<CR>")
(mkSetBinding mappings.diagnostics "<cmd> Telescope diagnostics<CR>") (mkSetBinding mappings.diagnostics "<cmd> Telescope diagnostics<CR>")
])) ]))
( (
mkIf config.vim.treesitter.enable mkIf config.vim.treesitter.enable
(mkSetBinding mappings.treesitter "<cmd> Telescope treesitter<CR>") (mkSetBinding mappings.treesitter "<cmd> Telescope treesitter<CR>")
) )
( (
mkIf config.vim.projects.project-nvim.enable mkIf config.vim.projects.project-nvim.enable
(mkSetBinding mappings.findProjects "<cmd Telescope projects<CR>") (mkSetBinding mappings.findProjects "<cmd> Telescope projects<CR>")
) )
]; ];
vim.binds.whichKey.register = pushDownDefault { binds.whichKey.register = pushDownDefault {
"<leader>f" = "+Telescope"; "<leader>f" = "+Telescope";
"<leader>fl" = "Telescope LSP"; "<leader>fl" = "Telescope LSP";
"<leader>fm" = "Cellular Automaton"; "<leader>fm" = "Cellular Automaton";
"<leader>fv" = "Telescope Git"; "<leader>fv" = "Telescope Git";
"<leader>fvc" = "Commits"; "<leader>fvc" = "Commits";
};
pluginRC.telescope = entryAnywhere ''
local telescope = require('telescope')
telescope.setup(${toLuaObject cfg.setupOpts})
${
if config.vim.ui.noice.enable
then "telescope.load_extension('noice')"
else ""
}
${
if config.vim.notify.nvim-notify.enable
then "telescope.load_extension('notify')"
else ""
}
${
if config.vim.projects.project-nvim.enable
then "telescope.load_extension('projects')"
else ""
}
'';
}; };
vim.pluginRC.telescope = entryAnywhere ''
local telescope = require('telescope')
telescope.setup(${toLuaObject cfg.setupOpts})
${
if config.vim.ui.noice.enable
then "telescope.load_extension('noice')"
else ""
}
${
if config.vim.notify.nvim-notify.enable
then "telescope.load_extension('notify')"
else ""
}
${
if config.vim.projects.project-nvim.enable
then "telescope.load_extension('projects')"
else ""
}
'';
}; };
} }

View file

@ -150,13 +150,13 @@
in { in {
options.vim.telescope = { options.vim.telescope = {
mappings = { mappings = {
findProjects = mkMappingOption "Find files [Telescope]" "<leader>fp"; findProjects = mkMappingOption "Find projects [Telescope]" "<leader>fp";
findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff"; findFiles = mkMappingOption "Find files [Telescope]" "<leader>ff";
liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg"; liveGrep = mkMappingOption "Live grep [Telescope]" "<leader>fg";
buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb"; buffers = mkMappingOption "Buffers [Telescope]" "<leader>fb";
helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh"; helpTags = mkMappingOption "Help tags [Telescope]" "<leader>fh";
open = mkMappingOption "Open [Telescope]" "<leader>ft"; open = mkMappingOption "Open [Telescope]" "<leader>ft";
resume = mkMappingOption "Resume (previous search) [Telescope]" "<leader>fr";
gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw"; gitCommits = mkMappingOption "Git commits [Telescope]" "<leader>fvcw";
gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb"; gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "<leader>fvcb";

View file

@ -133,8 +133,8 @@ in {
vim = { vim = {
luaConfigRC = { luaConfigRC = {
globalsScript = entryAnywhere (concatLines globalsScript); globalsScript = entryAnywhere (concatLines globalsScript);
# basic, theme # basic
pluginConfigs = entryAfter ["theme"] pluginConfigs; pluginConfigs = entryAfter ["basic"] pluginConfigs;
extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs; extraPluginConfigs = entryAfter ["pluginConfigs"] extraPluginConfigs;
mappings = entryAfter ["extraPluginConfigs"] mappings; mappings = entryAfter ["extraPluginConfigs"] mappings;
}; };