From 5a8050ed2cc7787e6bcc8dcafd1e0eefa2854b19 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Sun, 21 Nov 2021 11:36:57 +0100 Subject: [PATCH] added neovim formatter pkgs --- roles/home/common.nix | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/roles/home/common.nix b/roles/home/common.nix index b76bac7..a970bb3 100644 --- a/roles/home/common.nix +++ b/roles/home/common.nix @@ -4,22 +4,18 @@ imports = [ ./zsh.nix ./git.nix ]; home = { - stateVersion = "21.05"; + stateVersion = "21.05"; sessionVariables = { EDITOR = "nvim"; VISUAL = "nvim"; }; - packages = with pkgs; [ - rizin - sshfs - nixfmt - ]; + packages = with pkgs; [ rizin sshfs nixfmt ]; }; programs.neovim = { - enable = true; - + enable = true; + extraPackages = with pkgs; [ nodePackages.prettier cmake-format clang-tools rustfmt ]; extraConfig = '' " syntax syntax enable @@ -76,28 +72,32 @@ set cindent cinkeys-=0# set expandtab shiftwidth=2 tabstop=2 softtabstop=2 - set statusline+=%#warningmsg# - set statusline+=%{SyntasticStatuslineFlag()} - set statusline+=%* + " Enable alignment + let g:neoformat_basic_format_align = 1 + + " Enable tab to spaces conversion + let g:neoformat_basic_format_retab = 1 + + " Enable trimmming of trailing whitespace + let g:neoformat_basic_format_trim = 1 ''; - viAlias = true; + viAlias = true; vimAlias = true; - plugins = with pkgs.vimPlugins; [ + plugins = with pkgs.vimPlugins; [ vim-nix molokai YouCompleteMe vim-airline vim-airline-themes - vim-lsp + vim-lsp vim-indent-guides - vim-signify + vim-signify nerdtree vim-easy-align vim-fugitive - vim-yaml - vim-autoformat vimtex + neoformat ]; }; }