Giter Site home page Giter Site logo

g6ai / dotfiles Goto Github PK

View Code? Open in Web Editor NEW
212.0 2.0 5.0 600 KB

My dotfiles for Bash/Zsh, Vim/Neovim, Doom Emacs, tmux, Git, terminal emulators, JupyterLab, aria2, mpv, Nix and Homebrew

License: GNU General Public License v3.0

Shell 26.16% Vim Snippet 4.49% Emacs Lisp 24.81% Python 7.27% Nix 1.62% Ruby 1.66% Lua 4.49% Vim Script 29.50%
bash vim tmux aria2 mpv git dotfiles neovim zsh alacritty kitty doom-emacs jupyterlab chezmoi nix brewfile homebrew wezterm

dotfiles's Introduction

Dotfiles

Latest commit

My dotfiles. Some of my considerations are explained in Wiki.

DeploymentShellVim/NeovimDoom EmacstmuxGitTerminal emulatorsOther config

More screenshots here.

Features

Deploy with ease and efficiency

chezmoi is used to bootstrap dotfiles.

  • Deploy with shell one-liner:

    sh -c "$(curl -fsLS git.io/chezmoi)" -- init --apply g6ai
  • Uses text/template syntax from Go extended with text template functions from sprig.

    For instance, here is a typical snippet in one of my dotfiles, init.vim.tmpl, residing in private_dot_config/nvim:

    {{ $x := splitList "_" .chezmoi.sourceFile /* private dot config/nvim/init.vim.tmpl */ -}}
    {{ $y := last $x | dir /* config/nvim */ -}}
    {{ $rtp := list "~/." $y | join "" /* ~/.config/nvim */ -}}
    {{ $vim_flag := .vim_flag -}}
    {{ template "vim/vimrc" dict "rtp" $rtp "os" .chezmoi.os "vim_flag" $vim_flag -}}

    It passes variables rtp, os and vim_flag to a common vimrc template in .chezmoitemplates/vim. This vimrc template contains both the actual config details and the logic operations which check the variables it receives on deployment, so it can generate different config per Vim variants (Vim or Neovim), OS (Linux or macOS) and other user-defined variables.

    Such snippets are extensively used in these dotfiles to manage config files of different environments in one place (.chezmoitemplates), keeping the resource-demanding logical operations at the deployment step rather than the runtime.

Shell

Vim/Neovim

  • The configs are located in the .chezmoitemplates/vim directory. They are then deployed to Vim and Neovim's runtime path.
    • Vim's vimrc.tmpl template and Neovim's init.vim.tmpl template use the versatile configs in vimrc template, which works for Linux, macOS and Windows! You can set if your system is good enough to enable plugins on chezmoi deployment.
    • Most of the vimrc's functionalities are divided and located in core directory.
  • Neovim-specific config:
    • Adopts the mighty coc.nvim. Its config is coc-settings.json.
    • Some experimetal features in Neovim 0.5+ are also embraced:

Doom Emacs

tmux

  • tmux.conf defines tmux's style and key bindings, etc. Access to system clipboard is supported:
    • For macOS, pbcopy is used. pbcopy is installed on macOS by default.
    • For Linux, xclip is used. xclip needs to be installed. Within an SSH session, primary and/or clipboard content on the remote server can be sent to local machine by X11 forwarding.
  • Helper scripts executable_update_display_vim.sh and executable_update_vim.sh update environment variable $DISPLAY and/or Vim/Neovim theme.

Git

Global dot_gitignore_global.tmpl per OS template. GitHub’s collection of .gitignore file templates are used.

Terminal emulators

From my experience, there's no perfect terminal emulator. I have tried Terminal.app, iTerm2, Alacritty, kitty and WezTerm. Currently I'm using WezTerm.

  • wezterm folder includes the WezTerm configuration file wezterm.lua.
  • kitty folder includes the kitty configuration file kitty.conf for different OS.
  • alacritty folder includes the Alacritty configuration file alacritty.yml for different OS.

Other config

dotfiles's People

Contributors

g6ai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dotfiles's Issues

`git diff --cached` shows no output

This is due to a 'bad pager', as explained in this SO answer. Specifically, some of the less options, -E and -F, cause less to automatically exit, as per less manual:

-E or --QUIT-AT-EOF
Causes less to automatically exit the first time it reaches end-of-file.

-F or --quit-if-one-screen
Causes less to automatically exit if the entire file can be displayed on the
first screen.

fd8115a sets $LESS to FR, causing the problem.

Wiki still contains dotbot deployment for windows

I'm guessing you've migrated from dotbot to chezmoi, which I'm also doing. I just noticed your windows deployment wiki section still has dotbot as your dotfile deployment manager.

I appreciate how much work you put into documenting all of these config files so other people can use it for reference, it's been very helpful!

CmdLine black box on startup

Vim cmdline problem

During Vim startup, the file name and some other file info showed in the cmdline and then disappears, then left a black box in the cmdline (as red arrow points in the snapshot).

xclip does not close STDOUT, might be a problem

As of right now I use xclip to redirect tmux buffer. However, according to https://wiki.archlinux.org/index.php/Tmux#X_clipboard_integration :

Nevertheless, it is neater to use xsel because xclip does not close STDOUT after it has read from the tmux buffer. As such, tmux does not know that the copy task has completed, and continues to wait for xclip to terminate, thereby rendering tmux unresponsive. A workaround is to redirect STDOUT to /dev/null:

# Vim style
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"
bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"

CoC interface broken in NeoVim

When I run :CocList extensions:
Screenshot 2021-03-12 at 11 15 21

And when I run :CocInfo, the output opens in another buffer instead of vertical split. Then if I try to move to that buffer by ;bn:
Screenshot 2021-03-12 at 11 15 51

Directory colours not displayed when SSHing in Alacritty

When I SSH into other machine (tried Manjaro and Raspberry Pi OS) with terminfo set to alacritty in local machine (macOS), the directory colours are not displayed and is in black and white, even if I've installed alacritty terminfo on the remote machine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.