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