From 16672efe351e1165aee5f31504f8da7ca064df29 Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sun, 22 Jan 2017 06:50:31 +0100 Subject: [PATCH] Cool stuff Signed-off-by: Tomas Slusny --- .gitmodules | 9 +- README.md | 20 +- dotfiles/bashrc | 8 +- dotfiles/mpv.conf | 1 + dotfiles/profile | 2 +- dotfiles/tmux.conf | 2 +- dotfiles/vimperatorrc | 171 ------------------ dotfiles/vimrc | 79 +++++--- dotfiles/zimrc | 16 ++ dotfiles/zlogin | 57 ++++++ dotfiles/zshrc | 76 ++++++++ install.conf.yaml | 15 +- lib/bash/fzf | 1 - .../vimperator/colors/tomorrow-night.vimp | 72 -------- lib/{bash => shell}/base16-shell | 0 lib/{bash => shell}/fasd | 0 lib/shell/fzf | 1 + lib/shell/zim | 1 + lib/vim/vim-snippets | 2 +- 19 files changed, 238 insertions(+), 295 deletions(-) create mode 100644 dotfiles/mpv.conf delete mode 100644 dotfiles/vimperatorrc create mode 100644 dotfiles/zimrc create mode 100644 dotfiles/zlogin create mode 100644 dotfiles/zshrc delete mode 160000 lib/bash/fzf delete mode 100644 lib/firefox/vimperator/colors/tomorrow-night.vimp rename lib/{bash => shell}/base16-shell (100%) rename lib/{bash => shell}/fasd (100%) create mode 160000 lib/shell/fzf create mode 160000 lib/shell/zim diff --git a/.gitmodules b/.gitmodules index ba3eba64..be7196a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,10 +5,10 @@ path = lib/bash/bash-it url = https://github.com/Bash-it/bash-it [submodule "lib/bash/fasd"] - path = lib/bash/fasd + path = lib/shell/fasd url = https://github.com/clvv/fasd [submodule "lib/bash/fzf"] - path = lib/bash/fzf + path = lib/shell/fzf url = https://github.com/junegunn/fzf.git [submodule "lib/vim-pathogen"] path = lib/vim/vim-pathogen @@ -38,7 +38,7 @@ path = lib/vim/base16-vim url = https://github.com/chriskempson/base16-vim [submodule "lib/bash/base16-shell"] - path = lib/bash/base16-shell + path = lib/shell/base16-shell url = https://github.com/chriskempson/base16-shell [submodule "lib/tmux/tmux-yank"] path = lib/tmux/tmux-yank @@ -91,3 +91,6 @@ [submodule "lib/tmux/tmux-open"] path = lib/tmux/tmux-open url = https://github.com/tmux-plugins/tmux-open +[submodule "lib/shell/zim"] + path = lib/shell/zim + url = https://github.com/Eriner/zim diff --git a/README.md b/README.md index 08215b68..9779166b 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,17 @@ These are my configuration files for Linux and Mac. It is still work in progress, so expect a lot of changes, but I think it is stable enough to be usable. I put this README together, because I (like most of other programmers) do not -have any life. I even added CI integration to this repo, because I was bored. Yes, you hear right, CI INTEGRATION TO +have any life. I even added CI to this repo, because I was bored. Yes, you hear right, COUNTINUOS INTEGRATION TO FUCKING DOTFILES REPO. I doubt anyone will ever appreciate my effort, but [frankly, my dear, I don't give a damn](https://en.wikipedia.org/wiki/Frankly,_my_dear,_I_don't_give_a_damn). Expect a lot of changes in this repo, because most of the time I just cannot make up my mind, and I change my decisions very often. ## 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. +* [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 @@ -27,9 +29,8 @@ because most of the time I just cannot make up my mind, and I change my decision 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). Also, has - Vimperator. Install latest Firefox stable version, Vimperator do not works with Developer Edition. -* [vimperator](https://addons.mozilla.org/en-US/firefox/addon/vimperator/) - Vim for your firefox. No need to say more. + 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 @@ -44,8 +45,9 @@ because most of the time I just cannot make up my mind, and I change my decision 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. + 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 @@ -127,7 +129,7 @@ To see all helper commands, run `dottool --help`. ## Included stuff -### Bash +### Shell * [fasd](https://github.com/clvv/fasd): Command-line productivity booster, offers quick access to files and directories, inspired by autojump, z and v. * [fzf](https://github.com/junegunn/fzf): A command-line fuzzy finder written in Go * [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) diff --git a/dotfiles/bashrc b/dotfiles/bashrc index b63e1f21..2cc5cf97 100644 --- a/dotfiles/bashrc +++ b/dotfiles/bashrc @@ -177,7 +177,7 @@ # [[ $TMUX = "" ]] && export TERM="xterm-256color" # Base 16 - BASE16_SHELL=$DOTHOME/lib/bash/base16-shell/ + BASE16_SHELL=$DOTHOME/lib/shell/base16-shell/ [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)" [ -z $BASE16_THEME ] && base16_tomorrow-night @@ -186,8 +186,8 @@ # Plugins {{{ # Init fasd with cache to speed up startup - source "$DOTHOME/lib/bash/fasd/fasd" > /dev/null - fasd_cache=~/.fasd-init-cache + source "$DOTHOME/lib/shell/fasd/fasd" > /dev/null + fasd_cache=~/.fasd.cache.bash if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache" fi @@ -203,7 +203,7 @@ # Use faster grep command if possible if command -v rg >/dev/null 2>&1; then - export FZF_DEFAULT_COMMAND='rg --files --hidden --follow' + export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"' elif command -v ag >/dev/null 2>&1; then export FZF_DEFAULT_COMMAND='ag -g ""' fi diff --git a/dotfiles/mpv.conf b/dotfiles/mpv.conf new file mode 100644 index 00000000..8030632c --- /dev/null +++ b/dotfiles/mpv.conf @@ -0,0 +1 @@ +border=no diff --git a/dotfiles/profile b/dotfiles/profile index 4f46dbbb..b77bb47e 100644 --- a/dotfiles/profile +++ b/dotfiles/profile @@ -4,7 +4,7 @@ source ${HOME}/.dotconfig # Adjust path to use bin in user/bin -export PATH="$DOTHOME/usr/bin:$HOME/.local/bin:$PATH" +export PATH="$DOTHOME/usr/bin:$HOME/.local/bin:$PATH:$HOME/.cargo/bin" # Fix Java window resizing in TWM export _JAVA_AWT_WM_NONREPARENTING=1 diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index 07292d87..2d0eb25d 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -52,7 +52,7 @@ # User interface {{{ # improve colors - set -g default-terminal 'tmux-256color' + set -g default-terminal 'screen-256color' # disable annoying notifications set-option -g visual-bell off diff --git a/dotfiles/vimperatorrc b/dotfiles/vimperatorrc deleted file mode 100644 index 6a64882e..00000000 --- a/dotfiles/vimperatorrc +++ /dev/null @@ -1,171 +0,0 @@ -" vim: set filetype=vim: -" ██╗ ██╗██╗███╗ ███╗██████╗ ███████╗██████╗ █████╗ ████████╗ ██████╗ ██████╗ ██████╗ ██████╗ -" ██║ ██║██║████╗ ████║██╔══██╗██╔════╝██╔══██╗██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗██╔══██╗██╔════╝ -" ██║ ██║██║██╔████╔██║██████╔╝█████╗ ██████╔╝███████║ ██║ ██║ ██║██████╔╝██████╔╝██║ -" ╚██╗ ██╔╝██║██║╚██╔╝██║██╔═══╝ ██╔══╝ ██╔══██╗██╔══██║ ██║ ██║ ██║██╔══██╗██╔══██╗██║ -" ╚████╔╝ ██║██║ ╚═╝ ██║██║ ███████╗██║ ██║██║ ██║ ██║ ╚██████╔╝██║ ██║██║ ██║╚██████╗ -" ╚═══╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ - -colorscheme tomorrow-night - -" Map , to be leader -map , - -" Set default editor to gvim (including environment setup) -" This also works on Mac, because MacVim have alias for gvim -set editor='bash -lc "gvim -f $*" gvim ' - -" I don't like beeps -set visualbell - -" useful for command-line completion -set autocomplete -set wildmode=list:longest,full -set complete=lS - -" show tab numbers -set tabnumbers - -" h and l for tab movement -nnoremap K gT -nnoremap J gt - -" faster scrolling -noremap j 3j -noremap k 3k - -" fast open private window -noremap wp :wopen -private - -" Display - -"" show only the tab bar -set gui=tabs - -" Find -"" perform incremental searching -set incsearch -"" highlight search results -set hlsearch -"" typically (see below) ignore case -set ignorecase -"" only consider case if an upper case char is used -set smartcase - -" set default search to duckduckgo -set defsearch=duckduckgo -set suggestengines=duckduckgo - -" use also characters for hints -set hintchars=hjklasdfgyuiopqwertnmzxcvb - -" do not close firefox window when last tab is closed -set! browser.tabs.closeWindowWithLastTab=false - -" disable some browser features -" ----------------------------- - -" smooth scrolling -set! general.smoothScroll=false - -" browser tab animation -set! browser.tabs.animate=false - -" multiprocess -" ------------ - -set! browser.tabs.remote.autostart=false -set! browser.tabs.remote.force-enable=false -set! extensions.e10sBlockedByAddons=true -set! extensions.e10sBlocksEnabling=true - -" urls -" ---- - -" don't submit mistyped URLs to search engine -set! keyword.enabled=false - -" http://example should not try http://example.com -set! browser.fixup.alternate.enabled=false - -" javascript URLs are evil -set! browser.urlbar.filter.javascript=true - -" show me the full URL -set! browser.urlbar.trimURLs=false - -" new tab page -" ------------ - -" don't preload the new tab page -set! browser.newtab.preload=false - -" old new tab page -set! browser.newtabpage.enabled=false -set! browser.newtabpage.enhanced=false - -" homepage -" ---------- - -" homepage is about:blank -set! browser.startup.homepage='about:blank' - -" disable about:home tips -set! browser.aboutHomeSnippets.updateUrl='' - -" warnings and things to show -" --------------------------- - -" disable warnings -set! browser.tabs.warnOnClose=false -set! browser.tabs.warnOnCloseOtherTabs=false -set! browser.tabs.warnOnOpen=false -set! browser.warnOnQuit=false -set! general.warnOnAboutConfig=false -set! network.warnOnAboutNetworking=false - -" okay, i've already seen these things -set! browser.newtabpage.introShown=true -set! signon.importedFromSqlite=true -set! privacy.trackingprotection.introCount=20 - - -" privacy -" ======= - -" tracking protection -set! privacy.trackingprotection.enabled=false -set! privacy.trackingprotection.pbmode.enabled=true - -" clear things on shutdown -set! privacy.clearOnShutdown.cache=false -set! privacy.clearOnShutdown.cookies=true -set! privacy.clearOnShutdown.downloads=true -set! privacy.clearOnShutdown.formdata=true -set! privacy.clearOnShutdown.history=false -set! privacy.clearOnShutdown.offlineApps=true -set! privacy.clearOnShutdown.openWindows=true -set! privacy.clearOnShutdown.sessions=true -set! privacy.clearOnShutdown.siteSettings=true - -" disable "safe browsing" so that Google might not know everything i see -set! browser.safebrowsing.enabled=false -set! browser.safebrowsing.downloads.enabled=false -set! browser.safebrowsing.malware.enabled=false - -" DNT header -set! privacy.donottrackheader.enabled=true -set! privacy.donottrackheader.value=1 - -" not sure what this is exactly, but i am disabling it -set! camera.control.face_detection.enabled=false - -" no data reporting -set! datareporting.healthreport.uploadEnabled=false - -" extensions -" ========== - -" vimperator -set! extensions.vimperator.firsttime=false - diff --git a/dotfiles/vimrc b/dotfiles/vimrc index 27259ded..d2986d37 100644 --- a/dotfiles/vimrc +++ b/dotfiles/vimrc @@ -1,4 +1,4 @@ -" vim:set ft=vim:foldmethod=marker: +" vim:foldmethod=marker:set ft=vim: " ██╗ ██╗██╗███╗ ███╗██████╗ ██████╗ " ██║ ██║██║████╗ ████║██╔══██╗██╔════╝ " ██║ ██║██║██╔████╔██║██████╔╝██║ @@ -140,15 +140,15 @@ " Status line format set statusline= - set statusline +=%1*\ %n\ %* "buffer number - set statusline +=%5*%{&ff}%* "file format - set statusline +=%3*%y%* "file type - set statusline +=%4*\ %<%F%* "full path - set statusline +=%2*%m%* "modified flag - set statusline +=%1*%=%5l%* "current line - set statusline +=%2*/%L%* "total lines - set statusline +=%1*%4v\ %* "virtual column number - set statusline +=%2*0x%04B\ %* "character under cursor + set statusline +=\ %n\ "buffer number + set statusline +=%{&ff} "file format + set statusline +=%y "file type + set statusline +=\ %<%F "full path + set statusline +=%m "modified flag + set statusline +=%=%5l "current line + set statusline +=/%L "total lines + set statusline +=%4v\ "virtual column number + set statusline +=0x%04B\ "character under cursor " We are using bash let g:is_bash=1 @@ -156,6 +156,9 @@ " Always use vertical diffs set diffopt+=vertical + " Cursor line (it is slowing Vim a bit, but too useful) + set cursorline + " Show tabs and trailing spaces set list listchars=tab:→\ ,trail:· @@ -329,14 +332,14 @@ " Show numbers, folds and git diff signs on left function! Info() if &number - windo set norelativenumber nonumber foldcolumn=0 + set nonumber foldcolumn=0 if exists('+cursorcolumn') - set nocursorcolumn nocursorline + set nocursorcolumn endif else - windo set relativenumber number foldcolumn=1 + set number foldcolumn=1 if exists('+cursorcolumn') - set cursorline + set cursorcolumn endif endif endfunction @@ -381,7 +384,14 @@ hi clear LineNr hi clear SignColumn hi clear FoldColumn - hi Search cterm=NONE ctermfg=18 ctermbg=3 + hi Search cterm=NONE ctermfg=0 ctermbg=3 + hi StatusLine ctermbg=NONE ctermfg=4 + hi StatusLineNC cterm=underline ctermbg=NONE ctermfg=19 + hi VertSplit ctermbg=NONE ctermfg=19 + hi Title ctermfg=19 + hi TabLineSel ctermbg=NONE ctermfg=4 + hi TabLineFill ctermbg=NONE ctermfg=19 + hi TabLine ctermbg=NONE ctermfg=19 " gitgutter let g:gitgutter_signs = 0 @@ -392,6 +402,7 @@ " syntastic let g:syntastic_always_populate_loc_list = 1 let g:syntastic_vim_checkers = ['vint'] + set statusline+=%#warningmsg#%{SyntasticStatuslineFlag()}%* " EditorConfig let g:EditorConfig_core_mode = 'external_command' " Speed up editorconfig plugin @@ -408,13 +419,6 @@ nnoremap gr :Gremove autocmd BufReadPost fugitive://* set bufhidden=delete - " Airline - let g:airline_theme='base16' - let g:airline#extensions#tabline#enabled=1 - let g:airline#extensions#tabline#show_buffers=0 - let g:airline#extensions#tabline#buffer_min_count=1 - let g:airline#extensions#tabline#show_close_button=0 - " Eclim let g:EclimCompletionMethod='omnifunc' nnoremap jc :JavaCorrect @@ -425,6 +429,7 @@ nnoremap jD :JavaDocPreview nnoremap jt :JUnit % nnoremap jT :JUnitFindTest + nnoremap jr :JavaRename " Supertab let g:SuperTabDefaultCompletionType='context' @@ -439,10 +444,32 @@ imap (fzf-complete-file-ag) " imap (fzf-complete-line) + " rg command suffix, [options] + function! VRg_raw(command_suffix, ...) + return call('fzf#vim#grep', extend(['rg --no-heading --column --color always '.a:command_suffix, 1], a:000)) + endfunction + + " query, [[ag options], options] + function! VRg(query, ...) + let query = empty(a:query) ? '^.' : a:query + let args = copy(a:000) + let ag_opts = len(args) > 1 ? remove(args, 0) : '' + let command = ag_opts . ' ' . "'".substitute(query, "'", "'\\\\''", 'g')."'" + return call('VRg_raw', insert(args, command, 0)) + endfunction + + " Try to use ripgrep, otherwise fallback to ag + function! VFind(query, ...) + let args = insert(copy(a:000), a:query, 0) + if executable('rg') + return call('VRg', args) + endif + + return call('fzf#vim#ag', args) + endfunction + command! -bang -nargs=* Find call VFind(, 0) + " Enable per-command history. - " CTRL-N and CTRL-P will be automatically bound to next-history and - " previous-history instead of down and up. If you don't like the change, - " explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS. let g:fzf_history_dir = '~/.local/share/fzf-history' " If this is Git repo, list git files only, otherwise list all @@ -456,7 +483,7 @@ " Menus {{{ " Search everywhere (fzf.vim Ag) - nmap / :Ag + nmap / :Find " Help tags (fzf.vim Helptags) nmap ? :Helptags diff --git a/dotfiles/zimrc b/dotfiles/zimrc new file mode 100644 index 00000000..c050be84 --- /dev/null +++ b/dotfiles/zimrc @@ -0,0 +1,16 @@ +# Select what modules you would like enabled. +zmodules=(directory environment git git-info history input utility meta custom \ + syntax-highlighting history-substring-search prompt completion) + +# Set your desired prompt here +zprompt_theme='gitster' + +# 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. +# For (u)rxvt, termite and gnome-terminal users, +# removing the 'cursor' highlighter will fix the disappearing cursor problem +zhighlighters=(main brackets cursor) + diff --git a/dotfiles/zlogin b/dotfiles/zlogin new file mode 100644 index 00000000..4afcbb9f --- /dev/null +++ b/dotfiles/zlogin @@ -0,0 +1,57 @@ +# +# startup file read in interactive login shells +# +# The following code helps us by optimizing the existing framework. +# This includes zcompile, zcompdump, etc. +# + +( + # Function to determine the need of a zcompile. If the .zwc file + # does not exist, or the base file is newer, we need to compile. + # These jobs are asynchronous, and will not impact the interactive shell + zcompare() { + if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then + zcompile ${1} + fi + } + + zim_mods=${ZDOTDIR:-${HOME}}/.zim/modules + setopt EXTENDED_GLOB + + # zcompile the completion cache; siginificant speedup. + for file in ${ZDOTDIR:-${HOME}}/.zcomp^(*.zwc)(.); do + zcompare ${file} + done + + # zcompile .zshrc + zcompare ${ZDOTDIR:-${HOME}}/.zshrc + + # zcompile some light module init scripts + zcompare ${zim_mods}/git/init.zsh + zcompare ${zim_mods}/utility/init.zsh + zcompare ${zim_mods}/pacman/init.zsh + zcompare ${zim_mods}/spectrum/init.zsh + zcompare ${zim_mods}/completion/init.zsh + zcompare ${zim_mods}/fasd/init.zsh + + # zcompile all .zsh files in the custom module + for file in ${zim_mods}/custom/**/^(README.md|*.zwc)(.); do + zcompare ${file} + done + + # zcompile all autoloaded functions + for file in ${zim_mods}/**/functions/^(*.zwc)(.); do + zcompare ${file} + done + + # syntax-highlighting + for file in ${zim_mods}/syntax-highlighting/external/highlighters/**/*.zsh; do + zcompare ${file} + done + zcompare ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh + + # zsh-histery-substring-search + zcompare ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh + + +) &! diff --git a/dotfiles/zshrc b/dotfiles/zshrc new file mode 100644 index 00000000..96d4fa16 --- /dev/null +++ b/dotfiles/zshrc @@ -0,0 +1,76 @@ +# Source .profile +if [ -f ~/.profile ]; then + source ~/.profile +fi + +# Colors {{{ + + # Enable colors + export CLICOLOR=1 + + # Enable 256 color mode + # [[ $TMUX = "" ]] && export TERM="xterm-256color" + + # Base 16 + BASE16_SHELL=$DOTHOME/lib/shell/base16-shell/ + [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)" + [ -z $BASE16_THEME ] && base16_tomorrow-night + +# }}} + +# Source zim +if [[ -s ${ZDOTDIR:-${HOME}}/.zim/init.zsh ]]; then + source ${ZDOTDIR:-${HOME}}/.zim/init.zsh +fi + +# Update and cleanup brew +if command -v brew >/dev/null 2>&1; then + export PYTHONPATH=$(brew --prefix)/lib/python2.7/site-packages:$PYTHONPATH + alias brewup='brew update && brew upgrade --all && brew cleanup && brew cask cleanup' +fi + +# Copy-paste (requires xclip on *NIX systems) +if command -v xclip >/dev/null 2>&1; then + alias pbcopy='xclip -i -selection clipboard' + alias pbpaste='xclip -o -selection clipboard' +fi + +# Run with in server mode to allow eclim debugger, open eclim project and start session recording +function vjava () { + $EDITOR --servername "$1" +Session +"ProjectOpen $1" +} + +# Serve current directory as HTTP server, optionally specifying the port (default is 8000) +function serve() { + local port="${1:-8000}" + sleep 1 && open "http://localhost:${port}/" & + # Set the default Content-Type to `text/plain` instead of `application/octet-stream` + # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files) + python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port" +} + +# Init fasd with cache to speed up startup +source "$DOTHOME/lib/shell/fasd/fasd" > /dev/null +fasd_cache=~/.fasd.cache.zsh +if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then + fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install >| "$fasd_cache" +fi +source "$fasd_cache" +unset fasd_cache + +# Add viminfo fasd command +alias v='f -e vim -b viminfo' + +# Load fzf +source ~/.fzf.zsh + +# Use faster grep command if possible +if command -v rg >/dev/null 2>&1; then + export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"' +elif command -v ag >/dev/null 2>&1; then + export FZF_DEFAULT_COMMAND='ag -g ""' +fi + +# Load rest of libraries +# command -v thefuck >/dev/null 2>&1 && eval "$(thefuck --alias)" +command -v hub >/dev/null 2>&1 && eval "$(hub alias -s)" diff --git a/install.conf.yaml b/install.conf.yaml index 2ef11997..d7bcf23c 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -15,17 +15,17 @@ - git submodule foreach git pull origin master - Updating submodules - - - mkdir -p ~/.vimperator & mkdir -p ~/.kwm & mkdir -p ~/.config/bspwm & mkdir -p ~/.config/sxhkd & mkdir -p ~/.karabiner.d/configuration & mkdir -p usr/bin & mkdir -p usr/vim & mkdir -p ~/.config/dunst & mkdir -p ~/.ncmpcpp & mkdir -p ~/.vim/undodir & mkdir -p ~/.config/polybar & mkdir -p ~/.config/qutebrowser & mkdir -p ~/Library/Preferences/qutebrowser + - mkdir -p ~/.vimperator ; mkdir -p ~/.kwm ; mkdir -p ~/.config/bspwm ; mkdir -p ~/.config/sxhkd ; mkdir -p ~/.karabiner.d/configuration ; mkdir -p usr/bin ; mkdir -p usr/vim ; mkdir -p ~/.config/dunst ; mkdir -p ~/.ncmpcpp ; mkdir -p ~/.vim/undodir ; mkdir -p ~/.config/polybar ; mkdir -p ~/.config/qutebrowser ; mkdir -p ~/Library/Preferences/qutebrowser ; mkdir -p ~/.config/mpv - Creating directory structure - - 'echo "export DOTHOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"" > usr/dotconfig; touch usr/gitconfig' - Setting up home directory - - curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh - - Downloading git prompt for bash + - Downloading git prompt - - - lib/bash/fzf/install --all --no-update-rc - - Installing fuzzy finder for bash + - lib/shell/fzf/install --all --no-update-rc + - Installing fuzzy finder for shell - - cp -Rf "lib/macos/bar.widget/" "$HOME/Library/Application Support/Übersicht/widgets/bar.widget" & true - Copying panel widgets @@ -38,8 +38,6 @@ $HOME/.vimrc: dotfiles/vimrc $HOME/.tmux.conf: dotfiles/tmux.conf $HOME/.ideavimrc: dotfiles/ideavimrc - $HOME/.vimperatorrc: dotfiles/vimperatorrc - $HOME/.vimperator/colors: lib/firefox/vimperator/colors $HOME/.kwm/kwmrc: dotfiles/kwmrc $HOME/.khdrc: dotfiles/khdrc $HOME/.inputrc: dotfiles/inputrc @@ -56,3 +54,8 @@ $HOME/.ncmpcpp/config: dotfiles/ncmpcpp $HOME/.config/polybar/config: dotfiles/polybar $HOME/.config/qutebrowser/qutebrowser.conf: dotfiles/qutebrowser.conf + $HOME/.config/mpv/mpv.conf: dotfiles/mpv.conf + $HOME/.zshrc: dotfiles/zshrc + $HOME/.zlogin: dotfiles/zlogin + $HOME/.zimrc: dotfiles/zimrc + $HOME/.zim: lib/shell/zim diff --git a/lib/bash/fzf b/lib/bash/fzf deleted file mode 160000 index 8ac37d59..00000000 --- a/lib/bash/fzf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8ac37d59278209a7aec536f319c26109ef6704eb diff --git a/lib/firefox/vimperator/colors/tomorrow-night.vimp b/lib/firefox/vimperator/colors/tomorrow-night.vimp deleted file mode 100644 index b8be69fe..00000000 --- a/lib/firefox/vimperator/colors/tomorrow-night.vimp +++ /dev/null @@ -1,72 +0,0 @@ -" ==Vimperator_Color_Scheme== -" name: tomorrow-night -" ==VimPGray_Colorscheme_Settings== - -" Reset all styles first -hi clear - -hi CompDesc color: #b8b8b8; width: 50%; -hi CompDesc[selected] color: #282828; -hi CompItem[selected] background: #7cafc2; color: #282828; - -" Used in Command Line -" Entire bottom line -hi CmdLine color: #e8e8e8; background: #282828; font-family: Hack, Inconsolata; font-size: 12px; padding: 0px; vertical-align: middle; border: none; - -" Used in the URL column of `bmarks` -hi CompResult color: #aaa; width: 45%; overflow: hidden; -hi CompTitle color: #e8e8e8; background: #282828; font-weight: bold; -hi CompTitle>* color: #aaa; font-weight: bold; border-top: 1px solid gray; border-bottom: 1px solid #BBB; padding: 1px 0.5ex; - -" Hints! -hi Hint color: white; background-color: #800; border-color: ButtonShadow; font-family: Hack, Inconsolata; font-size: 12px; border-width: 0px; border-style: solid; padding 0 1px; -hi Hint::after content: attr(number); -hi HintActive color: black; background: #480; -hi HintElem color: black; background-color: #880; -hi HintImage opacity: .5; - -" Used also in wrapping error messages as the background, simple speaking -hi InfoMsg color: #e8e8e8; background: #282828; - -" Used when error on syntax error in vimperatorrc, etc. -hi LineNr color: orange; background-color: #282828; - -hi ErrorMsg color: #c22; background-color: #282828; font-weight: bold; - -" Used in CARET or COMMAND modes -hi ModeMsg color: #e8e8e8; background: #282828; - -hi MoreMsg color: #080; background: #222; font-weight: bold; -moz-border-radius: 5px; padding-left: 5px; - -hi Normal color: #e8e8e8; background: #282828; - -" Used in :`js tr` -hi Boolean color: #f00; -hi Function color: #04c; -hi Null color: #00c; -hi Number color: #00c; -hi Object color: #c40; -hi String color: #0c0; - -" Used in "Press ENTER..." of `jumps` or `bmarks`, or "Follow Hint..." or `f` -hi Question color: #080; background: #222; font-weight: bold; -moz-border-radius: 5px; padding-left: 5px; - -" hi Search color: #333; background-color: #cc0; font-size: inherit; padding: 0; padding: 0; - -hi StatusLine color: #e8e8e8; background: #282828; font-family: Hack, Inconsolata; font-size: 12px; margin-top: 1px; - -" Firefox's tabs -hi TabNumber color: #e8e8e8; font-weight: bold; margin: 0; padding-right: .3ex; text-shadow: #000 -1px 0 0, #000 0 1px 0, #000 1px 0 0, #000 0 -1px 0; - -" Used in `pageinfo` or `jumps` -hi Title color: #e8e8e8; background: #282828; font-weight: bold; - -" Used in items of Info field of `bmarks` -hi Keyword color: #CC0; -hi Tag color: #0CC; -hi URL color: #080; text-decoration: none; padding: 0 2px; -hi URL:hover color: #880; background-color: #222; -moz-border-radius: 5px; cursor: pointer; - -hi ContentSeparator border:none; - -" vim:set filetype=vim: diff --git a/lib/bash/base16-shell b/lib/shell/base16-shell similarity index 100% rename from lib/bash/base16-shell rename to lib/shell/base16-shell diff --git a/lib/bash/fasd b/lib/shell/fasd similarity index 100% rename from lib/bash/fasd rename to lib/shell/fasd diff --git a/lib/shell/fzf b/lib/shell/fzf new file mode 160000 index 00000000..fa7c8977 --- /dev/null +++ b/lib/shell/fzf @@ -0,0 +1 @@ +Subproject commit fa7c8977a85b08eee660f42f8bf52628166e422f diff --git a/lib/shell/zim b/lib/shell/zim new file mode 160000 index 00000000..cc34e3f3 --- /dev/null +++ b/lib/shell/zim @@ -0,0 +1 @@ +Subproject commit cc34e3f310aa6c0e532c70a739b081b89569571f diff --git a/lib/vim/vim-snippets b/lib/vim/vim-snippets index ff501974..40ca4aec 160000 --- a/lib/vim/vim-snippets +++ b/lib/vim/vim-snippets @@ -1 +1 @@ -Subproject commit ff5019746af5ab1f0ae96475db33b7921ef6d3ab +Subproject commit 40ca4aec34d457d29e4e731b14cc3328c9f27009