Giter Club home page Giter Club logo

neovim-flake's Introduction

neovim-flake

A highly configurable nix flake for neovim.

Come join the Matrix room if you have any questions or need help: #neovim-flake:matrix.org

Documentation

See the neovim-flake Manual for documentation, available options, and release notes.

If you want to dive right into trying neovim-flake you can get a fully featured configuration with nix language support by running:

nix run github:jordanisaacs/neovim-flake

Screenshot

screenshot

Philosophy

The philosophy behind this flake configuration is to allow for easily configurable and reproducible neovim environments. Enter a directory and have a ready to go neovim configuration that is the same on every machine. Whether you are a developer, writer, or live coder (see tidal cycles below!), quickly craft a config that suits every project's need. Think of it like a distribution of Neovim that takes advantage of pinning vim plugins and third party dependencies (such as tree-sitter grammars, language servers, and more).

As a result, one should never get a broken config when setting options. If setting multiple options results in a broken neovim, file an issue! Each plugin knows when another plugin which allows for smart configuration of keybindings and automatic setup of things like completion sources and languages.

Credit

Originally based on Wil Taylor's amazing neovim-flake

neovim-flake's People

Contributors

abhillman avatar antotocar34 avatar driesolbrechts avatar jordanisaacs avatar ksonj avatar lukas-zenner avatar monamayrhofer avatar moritzboehme avatar mraethel avatar schuelermine avatar sedlund avatar volfyd avatar wanderer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neovim-flake's Issues

CI Testing

I would like to get testing done beyond just nix flake check. Also confirm that formatting was done, need to look at nix fmt. For reference there is nixvim. Not necessary for a 0.1 release. Blocked by getting my CI/CD system working on my VPS.

Enabling visuals.lspkind.enable without enabling visuals.enable leads to broken config with completion.

When one enables lspkind and completion but forgets to enable visuals, this yields a broken config.

{
  visuals.lspkind.enable=true;
  autocomplete.enable=true;
}

The completion module

optionalString (config.vim.visuals.lspkind.enable)
"require('lspkind').presets.default[vim_item.kind] .. ' ' .."
calls require'lspkind' whenever visuals.lspkind.enable=true, but the lspkind plugin is only loaded if both visuals.enable and visuals.lspkind.enable are true:
config =
mkIf cfg.enable
{
vim.startPlugins = [
(
if cfg.nvimWebDevicons.enable
then "nvim-web-devicons"
else null
)
(
if cfg.lspkind.enable
then "lspkind"
else null
)

One could argue that visuals.enable should be either automatically enabled if visuals.lspkind is enabled, or not exist at all.

sqls is deprecated, use sqlls instead

Running the maximal configuration:

nix run github:jordanisaacs/neovim-flake#maximal

Results in:

sqls is deprecated, use sqlls instead.
This feature will be removed in lspconfig version 0.2.0

Handle treesitter installation better

Currently downloads all treesitter languages when plugin is called. Instead download only the treesitter languages that have their language enabled.

error loading inn config through flakes

I am trying to use your build through my flake setup, however I cannot get it working.
my dotfiles

I am aware I am doing something wrong here, would appreciate if you could help me setup through flakes.

Applying flake to system configuration...

Hello,
Really nice flake :) I used it a little bit and decided to implement it to my system configuration... and here problem appear. Till now I used @wiltaylor flake and it was implemented like this:
`
inputs.neovim-flake = {
#url = "github:jordanisaacs/neovim-flake";
url = "github:wiltaylor/neovim-flake";
};
outputs =
inputs@{ self
...,
, neovim-flake
, ...
}:
nixosConfigurations = {
let
system = "x86_64-linux";

  lib = nixpkgs-unstable.lib;

  pkgs = import nixpkgs-unstable {
    inherit system; # overlays;
    config.allowUnfree = true;
    overlays = [
      (final: prev: {
        # neovim = neovim-flake.defaultPackage.${system};
      })
    ];
  };
in {
    # desktop
    fuji = lib.nixosSystem {
      inherit system pkgs;
      modules = [
        ({ config, pkgs, ... }:
          {
            environment.systemPackages = with pkgs; [
              neovim-flake.defaultPackage.${system}
            ];
            imports = [ ./comp/fuji.nix ];
          }
        )
      ];
    };`

...
I thought it will be enough to repleace url in inputs but rebuild generate an error: error: attribute 'defaultPackage' missing
Generally I don't know nix (I am a few steps after beginning :) and I build my config by copy/paste method and I am happy when it's working :)
Any hint would be appreciated :) Thanks in advance!

Allow users to provide custom inputs in `neovimConfiguration`

Hey love the work you've done with this. I really like the idea of a home-manager but for neovim :D

It would be great if in a user's custom flake.nix there could an extraInputs argument:

{
  inputs = {
      neovim-flake.url = "path:/home/carneca/Documents/projects/neovim-flake";
      leap = {
        url = "github:ggandor/leap.nvim";
        flake = false;
      };
  };

  outputs = {nixpkgs, neovim-flake, ...}@inputs: let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
    configModule = {
      config.vim.leap.enable = true;
    };

    customNeovim = neovim-flake.lib.neovimConfiguration {
      extraInputs = {
        inherit (inputs) leap;
      };
      modules = [
        configModule
        ./modules/leap.nix
      ];
      inherit pkgs;
    };
  in {
    packages.${system}.neovim = customNeovim.neovim;
  };
}

where leap.nix is

{
  pkgs,
  lib,
  config,
  ...
}:
with lib;
with builtins; let
  cfg = config.vim.leap;
  writeIf = cond: message: if cond then message else "";
in {
  options.vim.leap = {
    enable = mkEnableOption "enable leap";
  };

  config = mkIf cfg.enable {
      vim.startPlugins = [ "leap" ];

      vim.luaConfigRC.leap = nvim.dag.entryAnywhere ''
        require('leap').add_default_mappings()
      '';
  };
}

and for that to just work.

I tried adding this extraInputs argument in neovim-flake's flake.nix but then
the module system complains that startPlugins can't accept "leap" and wants a derivation instead.

It would be nice if the user didn't have to package all the inputs they add themselves in that situation.

Error cannot find flake attribute

Thanks for this project. I cannot make it work by following the README.

(main)> nix run .#
error: cannot find flake attribute 'git+file:///home/user/Projects/flakes/neovim-flake#defaultApp.x86_64-linux'

Is there something I can do to bypass this issue?

Version 0.1

Steps to tagging a 0.1 release.

  • Fix evaluation steps and builder function.
  • Use DAG for ordering config.
  • Fix treesitter installation.
  • Make buildable on other platforms
  • Auto generate docs using nmd
  • Rewrite the README
  • Write a changelog from untagged master
  • Write docs for custom configuration
  • Use nvim-treesitter grammars
  • Write a flake template
  • Module option to install docs
  • Extendable configuration #28 #23
  • Move build into the module #30
  • A good solution to extra inputs #18 #30
  • Refactor languages/lsp/treesitter into their own section (#29 )
  • Update nmd
  • Add CONTRIBUTING.md

Doesn't work for python currently?

I'm probably installing it incorrectly, but can't find more information about the installation in the readme. Maybe it could be updated?

I've tried to use the project with my main language (python) and I got treesitter errors in every line:

image

I'm not sure how to fix this. Code completion seems to work correctly.

Later I've tried rust (test.rs), and got an error about "can't find cargo" immediately. Am I supposed to install it separately? After doing this I got "LSP[rust_analyzer] rust-analyzer failed to discover workspace"

Finally I've tried to open a C++ file. It seems to work.

The parts that do work look great though. I would love to fix my configuration

Remote Clients and Fonts

I use nix/nixos on a remote box, so when I ssh in from my mac, fonts are not resolved. This is a ticket to potentially add a short section to support users of this flake on remote boxes.

image

Keymap Override

As far as I could discern there is currently no way to override the default keymap (Only extending them).

Is there a way that I have missed?

If implemented - my first idea would be to simply add some sort of "customKeymap" attrset option to each module, that if given replaces the default keymap. Is this or something similar be something that would be welcomed as a PR?

x86_64-linux only?

Hi,

I use your flake and neovim config and I like it a lot. Thanks!

Can you eleborate why you force the use ov x86_64-linux system now in d5fc2d3 ?
I used your flake successfully on my raspberry and due to the recent change, I can't use it anymore..

#tidal can't connect to Pipewire on Arch Linux

Hi,

I came for the nix config but got really intrigued by tidal. Sadly, it didn't work out of the box for me. I had to add two wrappers, nixGL and a wrapper to fix the JACK connection

I feel like the tidal thing is supposed to be a simple example, and adding more text to it compromises that a little, but as far as I can tell, these hints are required for running it on Arch with Pipewire (and possible other systems), so adding the links to the README seems like a good idea.

Updating plugins tracking issue

Need to go through the plugins one by one and update them. Many probably have API changes as some have not been updated in a year or two. Will use this issue to track updates.

If there are any problems with updating a plugin, a new issue should be created. This is just to serve as a feed of plugin updates/initializations.

If you are interested in contributing and not sure where to start, this is a great place to get introduced to the codebase. Commits that update plugins are referenced here. Any plugin not referenced here will not have been updated for a while.

Certain Treesitter grammars give errors

I use my own Neovim flake based on this one, but the problem applies here as well: certain grammars are no longer working. Specifically, Typescript is a buggy mess. Opening a .ts file lights up the screen with red. Is this an issue with the flake, or is it an incompatibility between the grammars and a newer version of Treesitter, or is it something else entirely?

Materialize `init` file from neovimBuilder

Hello, thanks for the flake, its perfect! So perfect that some peers want me to share the plugins, init file and so on. (they are not still ready for nix)
I'm still learning how to build and work on flakes and i had no success creating a flake package based on the neovim package in the same flake. Actually I cannot find the init file in my own system.
I'm pretty sure i'm missing something, can u shed some light in this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.