Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 3.03 KB

zsh_wentzell.md

File metadata and controls

76 lines (50 loc) · 3.03 KB

Some Useful Information and Resources on Zsh + Git, Vim

Sciware: Tools and Workflow Show and Tell

Date: July 18, 2019

Presenter: Nils Wentzell

My config files can be found here

Zsh

Why should you use it?

  • Powerful globbing expressions
  • Intelligent autocompletion and autocorrection
  • Plugin-based through oh-my-zsh
  • Powerful and customizeable command line prompts
  • Git command line integration

Installation

  • Install through system package manager (recommended) or compile from source
  • Initial configuration setup through oh-my-zsh
  • Use chsh -s $(which zsh) to change your default shell or ask SCC to change it for you on the ldap based linux workstations

Some remarks

  • Enable extended globbing by adding setopt extendedglob to your ~/.zshrc
  • Enable completion by adding autoload -Uz compinit to you ~/.zshrc

Some globbing examples

  • ls **/a.out -- Find a.out recursing into all subdirectories
  • ls *.(c|h) -- Files ending in .h or .c (Groupings)
  • ls <10-13>.txt -- List files with matching the integer range
  • ls *.^c -- Negation, files not ending in c
  • ls **/<10-13>*.(c|h) -- Combine them

Pattern Globbing examples

  • ls *(.) -- regular files
  • ls *(x) -- executable files
  • ls *(.x) -- regular executable files
  • ls *(@) -- links
  • ls *(W) -- world-writeable files
  • ls *(R) -- world-readable files

Don't forget your command history reverse search (Ctrl + R)

git

Useful alias for command line branch history viewing

  • Set the alias for git l using git config --global alias.l "log --graph --abbrev-commit --decorate --format=format:'%C(blue)%h%C(reset) - %C(cyan)%aD%C(reset) %C(green)(%ar)%C(reset)%C(yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all"

Vim

Plugin Managers

A small selection of plugins I use

Language Server Protocol

  • Separate programming language support from the editor / IDE
  • Provides functionality such as auto completion, jump to definition, variable replacements, compiler errors and warnings, ...
  • Initially developed for VSCode, now an open standard
  • Integrates with many editors