{ pkgs, config, lib, ... }: with lib; with builtins; let cfg = config.vim.lsp; in { options.vim.lsp = {lspsaga = {enable = mkEnableOption "LSP Saga";};}; config = mkIf (cfg.enable && cfg.lspsaga.enable) { vim.startPlugins = ["lspsaga"]; vim.vnoremap = { "ca" = ":lua require('lspsaga.codeaction').range_code_action()"; }; vim.nnoremap = { "lf" = "lua require'lspsaga.provider'.lsp_finder()"; "lh" = "lua require('lspsaga.hover').render_hover_doc()"; "" = "lua require('lspsaga.action').smart_scroll_with_saga(1)"; "" = "lua require('lspsaga.action').smart_scroll_with_saga(-1)"; "lr" = "lua require'lspsaga.rename'.rename()"; "ld" = "lua require'lspsaga.provider'.preview_definition()"; "ll" = "lua require'lspsaga.diagnostic'.show_line_diagnostics()"; "lc" = "lua require'lspsaga.diagnostic'.show_cursor_diagnostics()"; "lp" = "lua require'lspsaga.diagnostic'.lsp_jump_diagnostic_prev()"; "ln" = "lua require'lspsaga.diagnostic'.lsp_jump_diagnostic_next()"; } // ( if (!cfg.nvimCodeActionMenu.enable) then { "ca" = "lua require('lspsaga.codeaction').code_action()"; } else {} ) // ( if (!cfg.lspSignature.enable) then { "ls" = "lua require('lspsaga.signaturehelp').signature_help()"; } else {} ); vim.luaConfigRC.lspsage = nvim.dag.entryAnywhere '' -- Enable lspsaga local saga = require 'lspsaga' saga.init_lsp_saga() saga.setup({ symbol_in_winbar = { enable = true, separator = " ", hide_keyword = true, show_file = true, folder_level = 2, respect_root = false, color_mode = true, }, }) ''; }; }