Skip to content

A home-manager module to configure Vim/ZSH/tmux.

Notifications You must be signed in to change notification settings

lightcode/lc-shell-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lc-shell for Nix

This repository contains a Nix module to configure Vim, ZSH and tmux. This module is meant to be used with home-manager.

Installation

Prerequisites

You need to have Nix and home-manager installed.

Include the module

Using niv (you need to install and initialize it before):

niv add lightcode/lc-shell-nix -v v1.0.0

You can import it by adding these lines to your home.nix:

{
  imports = let
    sources = import ./nix/sources.nix {};
  in [
    sources.lc-shell-nix.outPath
  ];
}

Or by fetching manually the tarball:

If you don't want to use niv, you can add these lines to your home.nix:

{
  imports = [
    (fetchTarball "https://github.com/lightcode/lc-shell-nix/archive/v1.0.0.tar.gz")
  ];
}

Enable the module

Once the module is added to your configuration, you need to enable the features you need:

{
  lc-shell = {
    vim.enable = true;
    tmux.enable = true;
    zsh.enable = true;
  };
}

What lc-shell-nix can do?

Vim

  • CTRL + k and CTRL + p: enable/disable paste mode and hide/show line number
  • , + w: write
  • , + q: quit buffer
  • CTRL + p: open ctrlp, an extension that allows to open files
  • , + Left/Right: change buffer
  • , + s: strip trailing whitespace (remove white space at the end of lines)

Note: in this context, buffers are used like tabs.

Tmux

  • ALT + Up/Down/Left/Right: move between panels
  • ALT + PageUp/PageDown: change window
  • ALT + Space: zoom a panel
  • CTRL + b, PageUp: scroll the panel up. Next you can move with PageUP, PageDown and the arrows. This mode is the copy mode.

ZSH

Functions:

  • reloadzsh: reload .zshrc, .zshenv and run rehash (that permit to recreate hash table that contains all functions in PATH. This is useful for completion)

Useful aliases:

  • gc: git commit
  • gl: git log
  • gws: git status --short

ZSH customizations

To customize ZSH, you can add ZSH files in the ~/.zshrc.d directory. You can still use the features provided by home-manager and Nix to override some parameters or add plugins.