Compare commits

..

No commits in common. "54e89d3acd98805c128a64d0b63ffbcdf1e633cd" and "dfacb580ae1ffe721051c549c86b006d497ef3ac" have entirely different histories.

5 changed files with 95 additions and 60 deletions

View File

@ -6,24 +6,12 @@ configuration may be difficult to translate to a non-Nix system.
However, some of the configurations are easier to lift directly: However, some of the configurations are easier to lift directly:
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/config) - [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/lua)
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions) - [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) - [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) - [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix)
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon) - [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 # Installation
@ -99,6 +87,12 @@ openssl s_client -showcerts -verify 5 -connect cache.nixos.org:443 < /dev/null
sudo nvim $NIX_SSL_CERT_FILE sudo nvim $NIX_SSL_CERT_FILE
``` ```
### Dealing with Neovim issues:
Update Neovim Packer plugins: `:PackerSync`
Update TreeSitter languages: `:TSUpdateSync`
--- ---
# Flake Templates # Flake Templates

View File

@ -20,19 +20,4 @@
# Connect machine metrics to Netdata Cloud # Connect machine metrics to Netdata Cloud
netdata = import ./netdata-cloud.nix { inherit pkgs; }; 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;
} }

View File

@ -1,4 +1,4 @@
{ inputs, globals, overlays, ... }: { inputs, globals, ... }:
with inputs; with inputs;
@ -22,7 +22,7 @@ darwin.lib.darwinSystem {
}; };
mailUser = globals.user; mailUser = globals.user;
networking.hostName = "noah-masur-mac"; networking.hostName = "noah-masur-mac";
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays; nixpkgs.overlays = [ firefox-darwin.overlay ];
# Set registry to flake packages, used for nix X commands # Set registry to flake packages, used for nix X commands
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
} }

View File

@ -1,37 +1,29 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }: {
let home-manager.users.${config.user} = {
neovim = import ./package { home.packages = [
inherit pkgs; (import ./package {
colors = import config.theme.colors.neovimConfig { inherit pkgs; }; inherit pkgs;
}; colors = import config.theme.colors.neovimConfig { inherit pkgs; };
})
in { ];
home-manager.users.${config.user} =
{
home.packages = [ neovim ];
programs.git.extraConfig.core.editor = "nvim";
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
};
programs.fish = {
shellAliases = { vim = "nvim"; };
shellAbbrs = {
v = lib.mkForce "nvim";
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
vll = "nvim -c 'Telescope oldfiles'";
};
};
programs.kitty.settings.scrollback_pager = lib.mkForce ''
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
programs.git.extraConfig.core.editor = "nvim";
home.sessionVariables = {
EDITOR = "nvim";
MANPAGER = "nvim +Man!";
}; };
programs.fish = {
shellAliases = { vim = "nvim"; };
shellAbbrs = {
v = lib.mkForce "nvim";
vl = lib.mkForce "vim -c 'normal! `0' -c 'bdelete 1'";
vll = "nvim -c 'Telescope oldfiles'";
};
};
};
# # Used for icons in Vim # # Used for icons in Vim
# fonts.fonts = with pkgs; [ nerdfonts ]; # fonts.fonts = with pkgs; [ nerdfonts ];

64
neovim-plugins.md Normal file
View File

@ -0,0 +1,64 @@
# 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