Update neovim config

work
mat ess 2022-02-10 00:09:07 -05:00
parent 25e82208f1
commit fc7033db75
1 changed files with 28 additions and 18 deletions

View File

@ -5,7 +5,7 @@ let
# inherit (config.lib.file) mkOutOfStoreSymlink;
nixConfigDir = "${config.home.homeDirectory}/dotfiles.nix";
nvr = "${pkgs.neovim-remote}/bin/nvr";
# nvr = "${pkgs.neovim-remote}/bin/nvr";
pluginWithDeps = plugin: deps: plugin.overrideAttrs (_: { dependencies = deps; });
@ -28,22 +28,33 @@ in
# Config and plugins ------------------------------------------------------------------------- {{{
# TODO: migrate to lua config
# Minimal init.vim config to load Lua config. Nix and Home Manager don't currently support
# `init.lua`.
# xdg.configFile."nvim/lua".source = mkOutOfStoreSymlink "${nixConfigDir}/configs/nvim/lua";
# xdg.configFile."nvim/colors".source = mkOutOfStoreSymlink "${nixConfigDir}/configs/nvim/colors";
# programs.neovim.extraConfig = "lua require('init')";
programs.neovim.extraConfig = builtins.readFile ../configs/init.vim;
programs.neovim.plugins = with pkgs.vimPlugins; [
neovim-sensible
tabular
vim-commentary
vim-surround
vim-colorschemes
lightline-vim
vim-fish
vim-nix
ctrlp
] ++ map (p: { plugin = p; optional = true; }) [
which-key-nvim
zoomwintab-vim
nvim-treesitter
] ++ map nonVSCodePlugin [
direnv-vim
vim-fugitive
dhall-vim
haskell-vim
];
# }}}
@ -53,28 +64,28 @@ in
programs.neovim.extras.termBufferAutoChangeDir = true;
programs.neovim.extras.nvrAliases.enable = true;
programs.fish.functions.set-nvim-background = mkIf config.programs.neovim.enable {
# See `./shells.nix` for more on how this is used.
body = ''
# Set `background` of all running Neovim instances base on `$term_background`.
for server in (${nvr} --serverlist)
${nvr} -s --nostart --servername $server -c "set background=$term_background" &
end
'';
onVariable = "term_background";
};
# programs.fish.functions.set-nvim-background = mkIf config.programs.neovim.enable {
# # See `./shells.nix` for more on how this is used.
# body = ''
# # Set `background` of all running Neovim instances base on `$term_background`.
# for server in (${nvr} --serverlist)
# ${nvr} -s --nostart --servername $server -c "set background=$term_background" &
# end
# '';
# onVariable = "term_background";
# };
programs.fish.interactiveShellInit = mkIf config.programs.neovim.enable ''
# Run Neovim related functions on init for their effects, and to register them so they are
# triggered when the relevant event happens or variable changes.
set-nvim-background
'';
# programs.fish.interactiveShellInit = mkIf config.programs.neovim.enable ''
# # Run Neovim related functions on init for their effects, and to register them so they are
# # triggered when the relevant event happens or variable changes.
# set-nvim-background
# '';
# }}}
# Required packages -------------------------------------------------------------------------- {{{
programs.neovim.extraPackages = with pkgs; [
neovim-remote
# neovim-remote
gcc # needed for nvim-treesitter
tree-sitter # needed for nvim-treesitter
@ -82,7 +93,6 @@ in
# See `../configs/nvim/lua/init.lua` for configuration.
# ccls
nodePackages.bash-language-server
# nodePackages.typescript-language-server
nodePackages.vim-language-server
nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server