Neovim, refactor to use modules, lua, and LSP
Refactors the neovim config to use nix modules, and changes the plugins to favor the builtin neovim LSP over COC. Changes all code to use lua code instead of vimscript.
This commit is contained in:
parent
ffada2703c
commit
0352e8e4d3
8 changed files with 337 additions and 134 deletions
40
hmModules/apps/neovim/plugin/telescope.nix
Normal file
40
hmModules/apps/neovim/plugin/telescope.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
cfgp = config.neovim.plugins;
|
||||
in {
|
||||
config = lib.mkIf (config.neovim.enable && cfgp.telescope.enable) {
|
||||
programs.neovim.plugins = let
|
||||
configText = ''
|
||||
require('telescope').setup({
|
||||
extensions = {
|
||||
'' + lib.strings.optionalString cfgp.telescope.fzf.enable ''
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
}
|
||||
'' + ''
|
||||
}
|
||||
})
|
||||
|
||||
'' + lib.strings.optionalString cfgp.telescope.fzf.enable ''
|
||||
require('telescope').load_extension('fzf')
|
||||
'';
|
||||
in with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = telescope-nvim;
|
||||
type = "lua";
|
||||
config = configText;
|
||||
}
|
||||
(lib.mkIf cfgp.nvimcmp.enable telescope-fzf-native-nvim)
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
(lib.mkIf cfgp.telescope.fzf.enable fzf)
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue