From 2a8737894385882b8e8ac00422f35c0eb1ab936b Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Tue, 28 Mar 2017 16:30:13 +0200 Subject: [PATCH] Add new plugins, fix travis, fix README Signed-off-by: Tomas Slusny --- .gitmodules | 18 ++- .travis.yml | 2 +- README.md | 107 +++++------------- bspwm/.config/sxhkd/sxhkdrc | 2 +- zsh/.zsh/bundle/alias-tips | 1 + zsh/.zsh/bundle/cdk/cdk.plugin.zsh | 8 ++ zsh/.zsh/bundle/k | 1 + .../bundle/{vi => vi-mode}/vi-mode.plugin.zsh | 30 ++--- zsh/.zshrc | 70 ++++++------ 9 files changed, 107 insertions(+), 132 deletions(-) create mode 160000 zsh/.zsh/bundle/alias-tips create mode 100644 zsh/.zsh/bundle/cdk/cdk.plugin.zsh create mode 160000 zsh/.zsh/bundle/k rename zsh/.zsh/bundle/{vi => vi-mode}/vi-mode.plugin.zsh (64%) diff --git a/.gitmodules b/.gitmodules index 329b7caf..8bf3c845 100644 --- a/.gitmodules +++ b/.gitmodules @@ -104,6 +104,12 @@ [submodule "vim/.vim/bundle/editorconfig-vim"] path = vim/.vim/bundle/editorconfig-vim url = https://github.com/editorconfig/editorconfig-vim +[submodule "zsh/.fzf"] + path = zsh/.fzf + url = https://github.com/junegunn/fzf.git +[submodule "zsh/.zim"] + path = zsh/.zim + url = https://github.com/Eriner/zim [submodule "zsh/.zsh/bundle/base16-shell"] path = zsh/.zsh/bundle/base16-shell url = https://github.com/chriskempson/base16-shell @@ -113,9 +119,9 @@ [submodule "zsh/.zsh/bundle/async"] path = zsh/.zsh/bundle/async url = https://github.com/mafredri/zsh-async -[submodule "zsh/.fzf"] - path = zsh/.fzf - url = https://github.com/junegunn/fzf.git -[submodule "zsh/.zim"] - path = zsh/.zim - url = https://github.com/Eriner/zim +[submodule "zsh/.zsh/bundle/k"] + path = zsh/.zsh/bundle/k + url = https://github.com/supercrabtree/k +[submodule "zsh/.zsh/bundle/alias-tips"] + path = zsh/.zsh/bundle/alias-tips + url = https://github.com/djui/alias-tips diff --git a/.travis.yml b/.travis.yml index 3d70254a..3748f771 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: bash script: - - bash install + - make diff --git a/README.md b/README.md index d81fd819..dcdcde7e 100644 --- a/README.md +++ b/README.md @@ -10,100 +10,66 @@ because most of the time I just cannot make up my mind, and I change my decision ## Requirements -* [python](https://www.python.org/downloads/) - Required for [dotbot](https://github.com/anishathalye/dotbot) to work - properly. Python is installed by default on most Linux distributions and also on Mac. * [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Most of the installation process is managed via Git, so you need this one. - -## Optional requirements - -* [zsh](http://www.zsh.org/) - Zsh is awesome. I was using bash, but then switched to zsh, and it is pretty much compatible with all bash stuff - and it is also faster and nicer. -* [tmux](https://tmux.github.io/) - Terminal multiplexer. Awesome stuff, but I find myself to use it less and less, - because I started using tiling window manager's features more. But still, tmux is really awesome, and have some great - features what screen do not have. I have some really nice Tmux stuff in my repository, so feel free to try it, maybe - you will like it. -* [neovim](https://neovim.io/) - Required for Vim stuff (of course). Needs to be installed with python - support for all plugins to work correctly. If you are just starting with Vim, then I recommend you to run `vimtutor` - from your CLI. Thank me later. -* [Firefox](https://www.mozilla.org/en-US/firefox/new/) - The only browser I found that can be properly styled to my - likings (for example, doing what I did with my Firefox is with browsers like Chrome just not possible) -* [vimfx](https://addons.mozilla.org/en-US/firefox/addon/vimfx/) - Vim for your firefox. No need to say more. -* [Stylish](https://addons.mozilla.org/en-US/firefox/addon/stylish/) - Just cool extension that can style your browser. - I do not found nice solution how to store my custom Firefox style in some dotfile, so this is last thing I do not like - in this setup, you need to install my style manually from Addon menu (yes, I know, it is horrible, but it is only way - that is currently working and styles entire top menu properly on my Mac OS). -* [editorconfig](https://github.com/editorconfig/editorconfig-core-c/blob/master/INSTALL.md) - For editorconfig plugin. - This is not necessary at all, but EditorConfig is super awesome portable thing to configure indentation and whitespace - settings for your project, and it works in most of editors, not only in Vim. - -### macOS specific - -* [kwm](https://github.com/koekeishiya/kwm) - Awesome tiling window manager for macOS. Noticed that I am using macOS - instead of OSX? It is because Apple rebranded OSX to macOS in latest Sierra update. You can read more about it - [here](https://techcrunch.com/2016/06/13/os-x-is-now-macos-and-gets-support-for-siri-auto-unlock-and-more/). Great - stuff, right? Anyway, back to the point. Kwm is a lot better than Amethyst, if you are still using it. Are you asking - why? Because it can be configured from dotfile, that is why. Also, it have nice focus borders, and is more similar to - window managers on - Linux, what I really miss on OSX, but I am not going to use XQuartz just to have i3 for my terminals here, lol. -* [khd](https://github.com/koekeishiya/khd) - Hotkey daemon for macOS, required to have keybindings in kwm. Originally - these two was one project, but they got split, what is imo great thing. -* [karabiner-elements](https://github.com/tekezo/Karabiner-Elements) - Can remap our Caps-Lock key to Hyper key, what I - am using in khd config as mod key for everything. You will need specifically [this - build](https://cl.ly/hwJn/download/Karabiner-Elements-0.90.61.dmg) what have support for hyper key remapping. Rest of - configuration that will remap caps lock to hyper is in dotfiles. -* [Alfred 3](https://www.alfredapp.com/) - Used as launcher application in my kwm/khd config. Not needed, you can just - adjust keybindings in khdrc to use Spotlight, but Alfred is just too awesome to pass. +* [stow](https://www.gnu.org/software/stow/) - Stow is used for dotfile installation (creating symlinks) ## How to install? -It is simple, just use integrated dotbot installer - +It is simple, just use `make` ```shell -git clone https://github.com/deathbeam/dotfiles.git ~/.dotfiles && \ - ~/.dotfiles/install +git clone git://github.com/deathbeam/dotfiles ~/.dotfiles +cd ~/.dotfiles +make ``` -These dotfiles are configured with [Terminus](http://terminus-font.sourceforge.net/) font in mind, so better install it. -To install Firefox theme, use [Stylish](https://addons.mozilla.org/en-US/firefox/addon/stylish/) and enter this URL to -`Install from URLs`: - -``` -https://raw.githubusercontent.com/deathbeam/dotfiles/master/lib/firefox/firefox.css -``` +Most of my dotfiles are using [Terminus](http://terminus-font.sourceforge.net/) font, so to make everything look +correct, install it in both TrueType and bitmap format. ## How to update? You can just use Git: ```shell -git -C $DOTHOME pull --rebase +cd ~/.dotfiles +git pull --rebase +make ``` ## How to inlude your own stuff? -After you have installed dotfiles, you can start including your own stuff by creating appropriate dotfiles in usr -directory: +After you have installed dotfiles, you can start including your own stuff by creating appropriate `.local` dotfiles in +home directory: ```shell -vim $DOTHOME/usr/zshrc -vim $DOTHOME/usr/vimrc -vim $DOTHOME/usr/tmux.conf -vim $DOTHOME/usr/gitconfig +$EDITOR ~/.gitconfig.local +$EDITOR ~/.vimrc.local +$EDITOR ~/.zshrc.local +$EDITOR ~/.tmux.conf.local ``` -To add your own Vim plugin you can use clone it to proper directory. For example to add -[SuperTab](https://github.com/ervandew/supertab), all you need to do is run this command: +To add your own Vim, Tmux or Zsh plugin you can just clone it to proper `bundle` directory: ```shell -git clone https://github.com/ervandew/supertab.git $DOTHOME/usr/vim/supertab +# Add SuperTab vim plugin +git clone git://github.com/ervandew/supertab ~/.vim/bundle/supertab + +# Add Tmux sessionist plugin +git clone git://github.com/tmux-plugins/tmux-sessionist ~/.tmux/bundle/tmux-sessionist + +# Add zsh-autoenv zsh plugin +git clone git://github.com/Tarrasch/zsh-autoenv ~/.zsh/bundle/zsh-autoenv ``` ## Included stuff ### Shell + * [alias-tips](https://github.com/djui/alias-tips): A plugin to help remembering those aliases you defined once * [base-16-shell](https://github.com/chriskempson/base16-shell): A shell script to change your shell's default ANSI colors but most importantly, colors 17 to 21 of your shell's 256 colorspace (if supported by your terminal) + * [cdk](https://github.com/deathbeam/dotfiles/tree/experimental/zsh/.zsh/bundle/cdk): Runs `k` on directory change * [fzf](https://github.com/junegunn/fzf): A command-line fuzzy finder written in Go + * [k](https://github.com/supercrabtree/k): k is the new l, yo + * [vi-mode](https://github.com/deathbeam/dotfiles/tree/experimental/zsh/.zsh/bundle/vi-mode): Runs `k` on directory change * [zim](https://github.com/Eriner/zim): ZIM - Zsh IMproved ### Vim @@ -145,18 +111,3 @@ git clone https://github.com/ervandew/supertab.git $DOTHOME/usr/vim/supertab * [tmux-sensible](https://github.com/tmux-plugins/tmux-sensible): basic tmux settings everyone can agree on * [tmux-yank](https://github.com/tmux-plugins/tmux-yank): Plugin for copying to system clipboard * [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator): Seamless navigation between tmux panes and vim splits - -## Thanks to.. - - * [skwp/dotfiles](https://github.com/skwp/dotfiles) for some sane .gitignore config for ignoring Vim and ctags stuff - * [mathiasbynens/dotfiles](https://github.com/mathiasbynens/dotfiles) for sane .gitconfig and some things in - .gitignore, and also for enabling Bash 4 features for tab completion if possible - * [amix/vimrc](https://github.com/amix/vimrc) for a lot of stuff in my vimrc. Without configurations, what are really - nicely explained in that repo, I would be lost like forever - * [twily](http://twily.info/) for his awesome Firefox stylish theme, what I configured to suit my needs - * [nerdbar.widget](https://github.com/herrbischoff/nerdbar.widget) for awesome widget for Ubersicht on what I based on - mine - * [thoughtbot/dotfiles](https://github.com/thoughtbot/dotfiles) for some parts of tmux configuration. I also want to - mention that I absolutely love their youtube channel - * I also found some things in other dotfile repositories (for example most of the great config in vimperatorrc), but I - totally lost track, so sorry if I forgot to mention anyone here diff --git a/bspwm/.config/sxhkd/sxhkdrc b/bspwm/.config/sxhkd/sxhkdrc index 10ff3555..971d4a8a 100644 --- a/bspwm/.config/sxhkd/sxhkdrc +++ b/bspwm/.config/sxhkd/sxhkdrc @@ -4,7 +4,7 @@ # terminal emulator super + Return - st -e $SHELL -c "source ~/.zshrc; tmux new-session -A -s main" + st -e $SHELL -c "export PS1='temp'; source ~/.zshrc; tmux new-session -A -s main" # program menu super + space diff --git a/zsh/.zsh/bundle/alias-tips b/zsh/.zsh/bundle/alias-tips new file mode 160000 index 00000000..c2e1ecf9 --- /dev/null +++ b/zsh/.zsh/bundle/alias-tips @@ -0,0 +1 @@ +Subproject commit c2e1ecf9fcea069828bde44c3624c9aeb4a134a7 diff --git a/zsh/.zsh/bundle/cdk/cdk.plugin.zsh b/zsh/.zsh/bundle/cdk/cdk.plugin.zsh new file mode 100644 index 00000000..44f05ccd --- /dev/null +++ b/zsh/.zsh/bundle/cdk/cdk.plugin.zsh @@ -0,0 +1,8 @@ +_cdk_chpwd_handler () { + emulate -L zsh + command -v k >/dev/null 2>&1 && k +} + +autoload -U add-zsh-hook +add-zsh-hook chpwd _cdk_chpwd_handler +_cdk_chpwd_handler diff --git a/zsh/.zsh/bundle/k b/zsh/.zsh/bundle/k new file mode 160000 index 00000000..1fa7c039 --- /dev/null +++ b/zsh/.zsh/bundle/k @@ -0,0 +1 @@ +Subproject commit 1fa7c039d40684d39cb225599bda4a86a62e765d diff --git a/zsh/.zsh/bundle/vi/vi-mode.plugin.zsh b/zsh/.zsh/bundle/vi-mode/vi-mode.plugin.zsh similarity index 64% rename from zsh/.zsh/bundle/vi/vi-mode.plugin.zsh rename to zsh/.zsh/bundle/vi-mode/vi-mode.plugin.zsh index a28f7d43..1ec2f132 100644 --- a/zsh/.zsh/bundle/vi/vi-mode.plugin.zsh +++ b/zsh/.zsh/bundle/vi-mode/vi-mode.plugin.zsh @@ -1,12 +1,7 @@ # Updates editor information when the keymap changes. function zle-keymap-select() { + vi_precmd zle reset-prompt - zle -R -} - -# Ensure that the prompt is redrawn when the terminal size changes. -TRAPWINCH() { - zle && zle -R } zle -N zle-keymap-select @@ -18,9 +13,13 @@ bindkey -v autoload -Uz edit-command-line bindkey -M vicmd 'v' edit-command-line -# allow ctrl-p, ctrl-n for navigate history (standard behaviour) -bindkey '^P' up-history -bindkey '^N' down-history +# allow ctrl-p, ctrl-n, j and k for navigate history (standard behaviour) +# bindkey '^P' up-history +# bindkey '^N' down-history +bindkey '^P' history-substring-search-up +bindkey '^N' history-substring-search-down +bindkey -M vicmd 'k' history-substring-search-up +bindkey -M vicmd 'j' history-substring-search-down # allow ctrl-h, ctrl-w, ctrl-? for char and word deletion (standard behaviour) bindkey '^?' backward-delete-char @@ -39,11 +38,14 @@ if [[ "$MODE_INDICATOR" == "" ]]; then MODE_INDICATOR="%{$fg_bold[red]%}<%{$fg[red]%}<<%{$reset_color%}" fi -function vi_mode_prompt_info() { +vi_mode_prompt_info() { echo "${${KEYMAP/vicmd/$MODE_INDICATOR}/(main|viins)/}" } -# define right prompt, if it wasn't defined by a theme -if [[ "$RPS1" == "" && "$RPROMPT" == "" ]]; then - RPS1='$(vi_mode_prompt_info)' -fi +vi_precmd() { + # define right prompt, if it wasn't defined by a theme + RPROMPT="`vi_mode_prompt_info`" +} + +autoload -Uz add-zsh-hook +add-zsh-hook precmd vi_precmd diff --git a/zsh/.zshrc b/zsh/.zshrc index f33b597e..4333c15c 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -34,32 +34,42 @@ # Plugins {{{ - # Select what modules you would like enabled. - zmodules=( \ - archive \ - directory \ - environment \ - fasd \ - git \ - git-info \ - history \ - input \ - utility \ - syntax-highlighting \ - history-substring-search \ - completion) - - # Set the string below to the desired terminal title format string. - # Below uses the following format: 'username@host:/current/directory' - ztermtitle='%n@%m:%~' - - # This determines what highlighters will be used with the syntax-highlighting module. - zhighlighters=(main brackets cursor) - - # Source zim - source ~/.zim/init.zsh - - # Load fzf + # Load zim + if [ -f ~/.zim/init.zsh ]; then + # Select what modules you would like enabled. + zmodules=( \ + archive \ + directory \ + environment \ + fasd \ + git \ + git-info \ + history \ + input \ + utility \ + syntax-highlighting \ + history-substring-search \ + completion) + + # Set the string below to the desired terminal title format string. + # Below uses the following format: 'username@host:/current/directory' + ztermtitle='%n@%m:%~' + + # This determines what highlighters will be used with the syntax-highlighting module. + zhighlighters=(main brackets cursor) + + # Source zim + source ~/.zim/init.zsh + fi + + # Load hub alias + command -v hub >/dev/null 2>&1 && eval "$(hub alias -s)" + + # Pathogen-like loader for plugins + find -L ~/.zsh/bundle -type f -name "*.plugin.zsh" | sort | + while read filename; do source "$filename"; done + + # Load fzf after plugins to be able to override them [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # Use faster FZF grep command if possible @@ -69,12 +79,8 @@ export FZF_DEFAULT_COMMAND='ag -g ""' fi - # Load hub alias - command -v hub >/dev/null 2>&1 && eval "$(hub alias -s)" - - # Pathogen-like loader for plugins - find -L ~/.zsh/bundle -type f -name "*.plugin.zsh" | sort | - while read filename; do source "$filename"; done + # Load base16 theme + [ -z $BASE16_THEME ] && base16_solarized-dark # }}}