From 54e89d3acd98805c128a64d0b63ffbcdf1e633cd Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 29 Nov 2022 20:48:46 -0700 Subject: [PATCH] add neovim as nix app --- README.md | 20 +++++++++------ apps/default.nix | 15 +++++++++++ neovim-plugins.md | 64 ----------------------------------------------- 3 files changed, 28 insertions(+), 71 deletions(-) delete mode 100644 neovim-plugins.md diff --git a/README.md b/README.md index cc3c7a5..9cb99e9 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,24 @@ configuration may be difficult to translate to a non-Nix system. However, some of the configurations are easier to lift directly: -- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/lua) +- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/config) - [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions) - [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/fish/default.nix) - [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix) - [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon) +Try out my Neovim config: + +```bash +nix run github:nmasur/dotfiles#neovim +``` + +Or build it as a package: + +```bash +nix build github:nmasur/dotfiles#neovim +``` + --- # Installation @@ -87,12 +99,6 @@ openssl s_client -showcerts -verify 5 -connect cache.nixos.org:443 < /dev/null sudo nvim $NIX_SSL_CERT_FILE ``` -### Dealing with Neovim issues: - -Update Neovim Packer plugins: `:PackerSync` - -Update TreeSitter languages: `:TSUpdateSync` - --- # Flake Templates diff --git a/apps/default.nix b/apps/default.nix index f0076ff..a630d66 100644 --- a/apps/default.nix +++ b/apps/default.nix @@ -20,4 +20,19 @@ # Connect machine metrics to Netdata Cloud netdata = import ./netdata-cloud.nix { inherit pkgs; }; + # Run neovim as an app + neovim = { + type = "app"; + program = "${ + (import ../modules/neovim/package { + inherit pkgs; + colors = import ../modules/colorscheme/gruvbox/neovim-gruvbox.nix { + inherit pkgs; + }; + }) + }/bin/nvim"; + }; + + nvim = neovim; + } diff --git a/neovim-plugins.md b/neovim-plugins.md deleted file mode 100644 index c35f1a9..0000000 --- a/neovim-plugins.md +++ /dev/null @@ -1,64 +0,0 @@ -# Neovim Plugins - -## Must-haves - -- neovim/nvim-lspconfig: enable LSP -- hrsh7th/cmp-nvim-lsp: connect LSP to nvim-cmp -- hrsh7th/cmp-buffer: completion from current buffer -- nvim-lua/plenary.nvim: utility functions for other plugins -- jose-elias-alvarez/null-ls.nvim: auto-trigger linting, formatting -- tpope/vim-surround: surround shortcuts -- tpope/vim-repeat: better repeat with . -- numToStr/Comment.nvim: smart comment shortcut -- lewis6991/impatient.nvim: faster start time -- nvim-treesitter/nvim-treesitter: language parsers -- nvim-telescope/telescope.nvim: fuzzy finder -- nvim-telescope/telescope-project.nvim: jump projects -- akinsho/toggleterm.nvim: embedded floating terminal -- lewis6991/gitsigns.nvim: git in sidebar -- hoob3rt/lualine.nvim: status bar -- kyazdani42/nvim-web-devicons: icons in status bar -- akinsho/bufferline.nvim: tab view for buffers -- moll/vim-bbye: fixes for buffer closing -- kyazdani42/nvim-tree.lua: better sidebar explorer - -## Optional - -- hrsh7th/cmp-path: completion of file path -- hrsh7th/cmp-cmdline: completion of shell commands -- hrsh7th/cmp-nvim-lua: completion of neovim commands -- L3MON4D3/LuaSnip: snippet engine -- saadparwaiz1/cmp_luasnip: completion of luasnip snippets -- lukas-reineke/cmp-rg: completion of ripgrep search -- rafamadriz/friendly-snippets: pre-generated snippets -- folke/lsp-colors.nvim: LSP error highlights -- tpope/vim-eunuch: file manipulation -- tpope/vim-vinegar: better netrw file explorer -- tpope/vim-fugitive: git commands -- godlygeek/tabular: alignment commands -- jakewvincent/mkdnflow.nvim: markdown notes -- nvim-treesitter/nvim-treesitter-textobjects: syntax-aware textobjects -- chr4/nginx.vim: nginx syntax -- towolf/vim-helm: helm syntax -- rodjek/vim-puppet: puppet syntax -- nvim-telescope/telescope-fzy-native.nvim: faster sorting -- jvgrootveld/telescope-zoxide: jump directories -- nvim-telescope/telescope-file-browser.nvim: view files -- ellisonleao/glow.nvim: view markdown with glow -- norcalli/nvim-colorizer.lua: preview hex colors - -# Other Tools - -- git -- stylua -- black -- flake8 -- fish_indent -- nixfmt -- rustfmt -- shellcheck -- shfmt -- terraform -- luacheck -- markdownlint -- pylint