From c47b87a1a322fc61e89a010ae3b9bc55115528b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Sat, 6 Jun 2020 20:48:01 +0200 Subject: [PATCH] First version of dotfiles --- .tmux.conf | 49 +++++ bashrc | 143 ++++++++++++++ create_symlinks.sh | 34 ++++ tmux.conf | 49 +++++ vim/.gitignore | 2 + vim/bundle/.gitignore | 2 + vim/colors/archman.vim.vifm | 148 +++++++++++++++ vim/colors/grb256.vim.vifm | 34 ++++ vim/colors/ir_black.vim.vifm | 213 +++++++++++++++++++++ vim/syntax/python.vim | 195 +++++++++++++++++++ vimrc | 353 +++++++++++++++++++++++++++++++++++ zsh/alias.sh | 29 +++ zsh/generic.sh | 30 +++ zsh/history.sh | 13 ++ zsh/keys.sh | 0 zshrc | 11 ++ zshrc_old | 69 +++++++ 17 files changed, 1374 insertions(+) create mode 100644 .tmux.conf create mode 100644 bashrc create mode 100755 create_symlinks.sh create mode 100644 tmux.conf create mode 100644 vim/.gitignore create mode 100644 vim/bundle/.gitignore create mode 100644 vim/colors/archman.vim.vifm create mode 100644 vim/colors/grb256.vim.vifm create mode 100644 vim/colors/ir_black.vim.vifm create mode 100644 vim/syntax/python.vim create mode 100644 vimrc create mode 100644 zsh/alias.sh create mode 100644 zsh/generic.sh create mode 100644 zsh/history.sh create mode 100644 zsh/keys.sh create mode 100644 zshrc create mode 100644 zshrc_old diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..18cc330 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,49 @@ +# remap C-b to C-a +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# split panes +bind | split-window -h +bind - split-window -v +bind s split-window -h -p 20 +bind v split-window -v -p 20 + +# switch panes +bind -n M-w select-pane -U +bind -n M-a select-pane -L +bind -n M-s select-pane -D +bind -n M-d select-pane -R + +# reload conf +bind r source-file ~/.tmux.conf + +setw -g mode-keys vi + +# change color +#set -g pane-border-style 'fg=#660033' +#set -g pane-active-border-style 'fg=#990033 bg=default' +set -g pane-border-style 'fg=#990000' +set -g pane-active-border-style 'fg=#ff0000' + + +# status bar +set -g status-position bottom +set -g status-justify left +#set -g status-style 'fg=#660033 bg=#202020' +set -g status-style 'fg=#990000 bg=#330000' + +# native xterm scrolling +set -g mouse on + +set -g history-file ~/.tmux_history + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-yank' + +run -b '~/.tmux/plugins/tpm/tpm' +run-shell ~/tmux-resurrect/resurrect.tmux + +set -s escape-time 0 diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..465d65d --- /dev/null +++ b/bashrc @@ -0,0 +1,143 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/home/legrems/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/home/legrems/miniconda3/etc/profile.d/conda.sh" ]; then + . "/home/legrems/miniconda3/etc/profile.d/conda.sh" + else + export PATH="/home/legrems/miniconda3/bin:$PATH" + fi +fi +unset __conda_setup +# <<< conda initialize <<< + +# avoid duplicates +export HISTCONTROL=ignoredumps:erasedups + +# append history entries +shopt -s histappend + +export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" + + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash diff --git a/create_symlinks.sh b/create_symlinks.sh new file mode 100755 index 0000000..39ca0fd --- /dev/null +++ b/create_symlinks.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +############################ +# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles +# Src: https://github.com/michaeljsmalley/dotfiles/blob/master/makesymlinks.sh +############################ + +########## Variables + +dir=~/Documents/dotfiles # dotfiles directory +olddir=~/dotfiles_old # old dotfiles backup directory + +files="vim vimrc zsh zshrc tmux.conf" # list of files/folders to symlink in homedir + +########## +# create dotfiles_old in homedir +echo -n "Creating $olddir for backup of any existing dotfiles in ~ ..." + mkdir -p $olddir +echo "done" + +# change to the dotfiles directory +echo -n "Changing to the $dir directory ..." + cd $dir +echo "done" + +# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks from the homedir to any files in the ~/dotfiles directory specified in $files +for file in $files; do + + echo "Moving any existing dotfiles from ~ to $olddir" + mv ~/.$file ~/dotfiles_old/ + echo "Creating symlink to $file in home directory." + + ln -s $dir/$file ~/.$file +done diff --git a/tmux.conf b/tmux.conf new file mode 100644 index 0000000..18cc330 --- /dev/null +++ b/tmux.conf @@ -0,0 +1,49 @@ +# remap C-b to C-a +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# split panes +bind | split-window -h +bind - split-window -v +bind s split-window -h -p 20 +bind v split-window -v -p 20 + +# switch panes +bind -n M-w select-pane -U +bind -n M-a select-pane -L +bind -n M-s select-pane -D +bind -n M-d select-pane -R + +# reload conf +bind r source-file ~/.tmux.conf + +setw -g mode-keys vi + +# change color +#set -g pane-border-style 'fg=#660033' +#set -g pane-active-border-style 'fg=#990033 bg=default' +set -g pane-border-style 'fg=#990000' +set -g pane-active-border-style 'fg=#ff0000' + + +# status bar +set -g status-position bottom +set -g status-justify left +#set -g status-style 'fg=#660033 bg=#202020' +set -g status-style 'fg=#990000 bg=#330000' + +# native xterm scrolling +set -g mouse on + +set -g history-file ~/.tmux_history + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-yank' + +run -b '~/.tmux/plugins/tpm/tpm' +run-shell ~/tmux-resurrect/resurrect.tmux + +set -s escape-time 0 diff --git a/vim/.gitignore b/vim/.gitignore new file mode 100644 index 0000000..904f2e4 --- /dev/null +++ b/vim/.gitignore @@ -0,0 +1,2 @@ +autoload +plugged diff --git a/vim/bundle/.gitignore b/vim/bundle/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/vim/bundle/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/vim/colors/archman.vim.vifm b/vim/colors/archman.vim.vifm new file mode 100644 index 0000000..a53c66d --- /dev/null +++ b/vim/colors/archman.vim.vifm @@ -0,0 +1,148 @@ +" ArchMan v 0.0.1a +" +" https://github.com/atahabaki/archman-vim +" +" Copyright 2020, All rights reserved +" +" Code licensed under the MIT license +" +" @author A. Taha Baki <@atahabaki> + +set background=dark +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "archman" + +hi Cursor ctermfg=24 ctermbg=231 cterm=NONE guifg=#7F4EFE guibg=#ffffff gui=NONE +hi Visual ctermfg=NONE ctermbg=241 cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi CursorLine ctermbg=234 cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi CursorColumn ctermbg=234 cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi ColorColumn ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=#3d3f49 gui=NONE +hi LineNr ctermfg=234 ctermbg=NONE cterm=NONE guifg=#76A9DB guibg=NONE gui=NONE +hi VertSplit ctermfg=234 ctermbg=0 cterm=bold guifg=#3c464f guibg=NONE gui=bold +hi MatchParen ctermfg=96 ctermbg=NONE cterm=underline guifg=#FF4143 guibg=NONE gui=underline +hi StatusLine ctermfg=231 ctermbg=236 cterm=bold guifg=#FFFFFF guibg=#64666d gui=bold +hi StatusLineNC ctermfg=231 ctermbg=236 cterm=NONE guifg=#FFFFFF guibg=#64666d gui=NONE +hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi PmenuSel ctermfg=NONE ctermbg=236 cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi IncSearch ctermfg=24 ctermbg=178 cterm=NONE guifg=NONE guibg=#FFCC4B gui=NONE +hi Search ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline +hi Directory ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi Folded ctermfg=24 ctermbg=235 cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi SignColumn ctermfg=246 ctermbg=235 cterm=NONE guifg=#909194 guibg=NONE gui=NONE +hi FoldColmun ctermfg=246 ctermbg=235 cterm=NONE guifg=#909194 guibg=NONE gui=NONE +hi Normal guifg=#FFFFFF guibg=NONE gui=NONE +hi Boolean ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi Character ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi Comment ctermfg=238 ctermbg=NONE cterm=NONE guifg=#76A9DB guibg=NONE gui=NONE +hi Conditional ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi Define ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi DiffAdd ctermfg=231 ctermbg=64 cterm=bold guifg=#FFFFFF guibg=#467010 gui=bold +hi DiffDelete ctermfg=160 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi DiffChange ctermfg=231 ctermbg=23 cterm=NONE guifg=#FFFFFF guibg=#17556F gui=NONE +hi DiffText ctermfg=231 ctermbg=24 cterm=bold guifg=#FFFFFF guibg=#17556F gui=bold +hi ErrorMsg ctermfg=231 ctermbg=96 cterm=NONE guifg=#f8f8f0 guibg=#FF4143 gui=NONE +hi WarningMsg ctermfg=231 ctermbg=96 cterm=NONE guifg=#f8f8f0 guibg=#FF4143 gui=NONE +hi Float ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi Function ctermfg=70 ctermbg=NONE cterm=NONE guifg=#1094C3 guibg=NONE gui=NONE +hi Identifier ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic +hi Keyword ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi Label ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +hi NonText ctermfg=231 ctermbg=NONE cterm=NONE guifg=#525563 guibg=NONE gui=NONE +hi Number ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi Operator ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi PreProc ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi Special ctermfg=231 ctermbg=NONE cterm=NONE guifg=#FFFFFF guibg=NONE gui=NONE +hi SpecialKey ctermfg=231 ctermbg=235 cterm=NONE guifg=#525563 guibg=NONE gui=NONE +hi Statement ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi StorageClass ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic +hi String ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +hi Tag ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi Title ctermfg=231 ctermbg=NONE cterm=bold guifg=#FFFFFF guibg=NONE gui=bold +hi Todo ctermfg=24 ctermbg=NONE cterm=inverse,bold guifg=#7F4EFE guibg=NONE gui=inverse,bold +hi Type ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline +hi rubyClass ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi rubyFunction ctermfg=70 ctermbg=NONE cterm=NONE guifg=#1094C3 guibg=NONE gui=NONE +hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubySymbol ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi rubyConstant ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic +hi rubyStringDelimiter ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +hi rubyBlockParameter ctermfg=215 ctermbg=NONE cterm=NONE guifg=#FFA244 guibg=NONE gui=italic +hi rubyInstanceVariable ctermfg=203 ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyInclude ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi rubyGlobalVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyRegexp ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +hi rubyRegexpDelimiter ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +hi rubyEscape ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi rubyControl ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi rubyClassVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyOperator ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi rubyException ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi rubyPseudoVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi rubyRailsUserClass ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic +hi rubyRailsARAssociationMethod ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi rubyRailsARMethod ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi rubyRailsRenderMethod ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi rubyRailsMethod ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi erubyDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi erubyComment ctermfg=24 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi erubyRailsMethod ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi htmlTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlEndTag ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlTagName ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlArg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi htmlSpecialChar ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi javaScriptFunction ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic +hi javaScriptRailsFunction ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi yamlKey ctermfg=96 ctermbg=NONE cterm=NONE guifg=#FF4143 guibg=NONE gui=NONE +hi yamlAnchor ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi yamlAlias ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi yamlDocumentHeader ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +hi cssURL ctermfg=215 ctermbg=NONE cterm=NONE guifg=#FFA244 guibg=NONE gui=italic +hi cssFunctionName ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=NONE +hi cssColor ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi cssPseudoClassId ctermfg=70 ctermbg=NONE cterm=NONE guifg=#1094C3 guibg=NONE gui=NONE +hi cssClassName ctermfg=70 ctermbg=NONE cterm=NONE guifg=#1094C3 guibg=NONE gui=NONE +hi cssValueLength ctermfg=56 ctermbg=NONE cterm=NONE guifg=#7F4EFE guibg=NONE gui=NONE +hi cssCommonAttr ctermfg=37 ctermbg=NONE cterm=NONE guifg=#1094C3 guibg=NONE gui=NONE +hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE +hi TabLineFill guifg=#333333 guibg=NONE gui=none +hi TabLine guifg=#666666 guibg=NONE gui=none +hi TabLineSel guifg=WHITE guibg=NONE gui=none + +" Elixir {{{ +hi elixirAtom ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic" +hi elixirModuleDeclaration ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic" +hi elixirAlias ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE gui=italic" +hi elixirInterpolationDelimiter ctermfg=70 ctermbg=NONE cterm=NONE guifg=#1094C3 guibg=NONE gui=NONE +hi elixirStringDelimiter ctermfg=178 ctermbg=NONE cterm=NONE guifg=#FFCC4B guibg=NONE gui=NONE +"}}} +" +" Vim Script {{{ +hi vimGroupName ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE +hi vimGroup ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE +hi vimOption ctermfg=37 ctermbg=NONE cterm=NONE guifg=#3DE163 guibg=NONE +hi vimHiCtermFgBg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE +hi vimHiGuiFgBg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE +" }}} + + +" +"cygwin has an annoying behavior where it resets background to light +"regardless of what is set above, so we force it yet again +" +"add these to get cygwin shell working when used to ssh into a centos6 vm +"this requires your TERM=xterm-256color in the guest vm +"- one way to do this is to append to /home/vagrant/.bash_profile ala: +" TERM=xterm-256color +" export $TERM + +execute "set background=dark" +"------------------- diff --git a/vim/colors/grb256.vim.vifm b/vim/colors/grb256.vim.vifm new file mode 100644 index 0000000..68209d9 --- /dev/null +++ b/vim/colors/grb256.vim.vifm @@ -0,0 +1,34 @@ +" Based on +runtime colors/ir_black.vim + +:let g:colors_name = "grb256" + +hi pythonSpaceError ctermbg=red guibg=red + +hi Comment ctermfg=darkgray + +hi StatusLine ctermbg=darkgrey ctermfg=white +hi StatusLineNC ctermbg=black ctermfg=lightgrey +hi VertSplit ctermbg=black ctermfg=lightgrey +hi LineNr ctermfg=darkgray +hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=234 +hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE +hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE + +hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=16 ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color +hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE +hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE +hi SpellBad guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=160 cterm=NONE + +" ir_black doesn't highlight operators for some reason +hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE + +highlight DiffAdd term=reverse cterm=bold ctermbg=lightgreen ctermfg=16 +highlight DiffChange term=reverse cterm=bold ctermbg=lightblue ctermfg=16 +highlight DiffText term=reverse cterm=bold ctermbg=lightgray ctermfg=16 +highlight DiffDelete term=reverse cterm=bold ctermbg=lightred ctermfg=16 + +highlight PmenuSel ctermfg=16 ctermbg=156 + +set guifont=DejaVu_Sans_Mono:h9:cANSI + diff --git a/vim/colors/ir_black.vim.vifm b/vim/colors/ir_black.vim.vifm new file mode 100644 index 0000000..da06f7e --- /dev/null +++ b/vim/colors/ir_black.vim.vifm @@ -0,0 +1,213 @@ +" ir_black color scheme +" More at: http://blog.infinitered.com/entries/show/8 + + +" ******************************************************************************** +" Standard colors used in all ir_black themes: +" Note, x:x:x are RGB values +" +" normal: #f6f3e8 +" +" string: #A8FF60 168:255:96 +" string inner (punc, code, etc): #00A0A0 0:160:160 +" number: #FF73FD 255:115:253 +" comments: #7C7C7C 124:124:124 +" keywords: #96CBFE 150:203:254 +" operators: white +" class: #FFFFB6 255:255:182 +" method declaration name: #FFD2A7 255:210:167 +" regular expression: #E9C062 233:192:98 +" regexp alternate: #FF8000 255:128:0 +" regexp alternate 2: #B18A3D 177:138:61 +" variable: #C6C5FE 198:197:254 +" +" Misc colors: +" red color (used for whatever): #FF6C60 255:108:96 +" light red: #FFB6B0 255:182:176 +" +" brown: #E18964 good for special +" +" lightpurpleish: #FFCCFF +" +" Interface colors: +" background color: black +" cursor (where underscore is used): #FFA560 255:165:96 +" cursor (where block is used): white +" visual selection: #1D1E2C +" current line: #151515 21:21:21 +" search selection: #07281C 7:40:28 +" line number: #3D3D3D 61:61:61 + + +" ******************************************************************************** +" The following are the preferred 16 colors for your terminal +" Colors Bright Colors +" Black #4E4E4E #7C7C7C +" Red #FF6C60 #FFB6B0 +" Green #A8FF60 #CEFFAB +" Yellow #FFFFB6 #FFFFCB +" Blue #96CBFE #FFFFCB +" Magenta #FF73FD #FF9CFE +" Cyan #C6C5FE #DFDFFE +" White #EEEEEE #FFFFFF + + +" ******************************************************************************** +set background=dark +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name = "ir_black" + + +"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + +" General colors +hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi NonText guifg=#070707 guibg=black gui=NONE ctermfg=black ctermbg=NONE cterm=NONE + +hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse +hi LineNr guifg=#3D3D3D guibg=black gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE + +hi VertSplit guifg=#202020 guibg=#202020 gui=NONE ctermfg=darkgray ctermbg=darkgray cterm=NONE +hi StatusLine guifg=#CCCCCC guibg=#202020 gui=italic ctermfg=white ctermbg=darkgray cterm=NONE +hi StatusLineNC guifg=black guibg=#202020 gui=NONE ctermfg=blue ctermbg=darkgray cterm=NONE + +hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE +hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=darkgray cterm=NONE + +hi SpecialKey guifg=#808080 guibg=#343434 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + +hi WildMenu guifg=green guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE +hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE +"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + +hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color +hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE +hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE + +" Message displayed in lower left, such as --INSERT-- +hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD + +if version >= 700 " Vim 7.x specific colors + hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD + hi CursorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD + hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=darkgray cterm=NONE + hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + hi Search guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +endif + +" Syntax highlighting +hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE +hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE +hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE + +hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE +hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE +hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE " if else end + +hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE +hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE + +hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE +hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE +hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE +hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE + +hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE +hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE +hi Operator guifg=white guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE + +hi link Character Constant +hi link Boolean Constant +hi link Float Number +hi link Repeat Statement +hi link Label Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link SpecialComment Special +hi link Debug Special + + +" Special for Ruby +hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE +hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE +hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE +hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE +hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc +"hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield +hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE +"rubyInclude +"rubySharpBang +"rubyAccess +"rubyPredefinedVariable +"rubyBoolean +"rubyClassVariable +"rubyBeginEnd +"rubyRepeatModifier +"hi link rubyArrayDelimiter Special " [ , , ] +"rubyCurlyBlock { , , } + +hi link rubyClass Keyword +hi link rubyModule Keyword +hi link rubyKeyword Keyword +hi link rubyOperator Operator +hi link rubyIdentifier Identifier +hi link rubyInstanceVariable Identifier +hi link rubyGlobalVariable Identifier +hi link rubyClassVariable Identifier +hi link rubyConstant Type + + +" Special for Java +" hi link javaClassDecl Type +hi link javaScopeDecl Identifier +hi link javaCommentTitle javaDocSeeTag +hi link javaDocTags javaDocSeeTag +hi link javaDocParam javaDocSeeTag +hi link javaDocSeeTagParam javaDocSeeTag + +hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE +hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE +"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE + + +" Special for XML +hi link xmlTag Keyword +hi link xmlTagName Conditional +hi link xmlEndTag Identifier + + +" Special for HTML +hi link htmlTag Keyword +hi link htmlTagName Conditional +hi link htmlEndTag Identifier + + +" Special for Javascript +hi link javaScriptNumber Number + + +" Special for Python +"hi link pythonEscape Keyword + + +" Special for CSharp +hi link csXmlTag Keyword + + +" Special for PHP + diff --git a/vim/syntax/python.vim b/vim/syntax/python.vim new file mode 100644 index 0000000..d841fa0 --- /dev/null +++ b/vim/syntax/python.vim @@ -0,0 +1,195 @@ +" Vim syntax file +" Language: Python +" Maintainer: Samuel Hoffstaetter +" Updated: 2006-10-15 +" Added Python 2.4 features 2006 May 4 (Dmitry Vasiliev) +" +" Derived from python.vim by Neil Schemenauer +" +" Options to control Python syntax highlighting: +" +" For highlighted numbers: +" +" let python_highlight_numbers = 1 +" +" For highlighted builtin functions: +" +" let python_highlight_builtins = 1 +" +" For highlighted standard exceptions: +" +" let python_highlight_exceptions = 1 +" +" Highlight erroneous whitespace: +" +" let python_highlight_space_errors = 1 +" +" If you want all possible Python highlighting (the same as setting the +" preceding options): +" +" let python_highlight_all = 1 +" + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +setlocal foldmethod=syntax + +syn keyword pythonStatement break continue del +syn keyword pythonStatement except exec finally +syn keyword pythonStatement pass print raise +syn keyword pythonStatement return try with +syn keyword pythonStatement global assert +syn keyword pythonStatement lambda yield + +syn match pythonDefStatement /^\s*\%(def\|class\)/ + \ nextgroup=pythonFunction skipwhite +syn region pythonFunctionFold start="^\z(\s*\)\%(def\|class\)\>" + \ end="\ze\%(\s*\n\)\+\%(\z1\s\)\@!." fold transparent +syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained + +syn match pythonComment /#\%(.\%({{{\|}}}\)\@!\)*$/ + \ contains=pythonTodo,@Spell +syn region pythonFold matchgroup=pythonComment + \ start='#.*{{{.*$' end='#.*}}}.*$' fold transparent + +syn keyword pythonRepeat for while +syn keyword pythonConditional if elif else +syn keyword pythonOperator and in is not or +" AS will be a keyword in Python 3 +syn keyword pythonPreCondit import from as +syn keyword pythonTodo TODO FIXME XXX contained + +" Decorators (new in Python 2.4) +syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite + +" strings +syn region pythonString start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape,@Spell +syn region pythonString start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape,@Spell +syn region pythonString start=+[uU]\="""+ end=+"""+ contains=pythonEscape,@Spell +syn region pythonString start=+[uU]\='''+ end=+'''+ contains=pythonEscape,@Spell +syn region pythonRawString start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+ contains=@Spell +syn region pythonRawString start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+ contains=@Spell +syn region pythonRawString start=+[uU]\=[rR]"""+ end=+"""+ contains=@Spell +syn region pythonRawString start=+[uU]\=[rR]'''+ end=+'''+ contains=@Spell +syn match pythonEscape +\\[abfnrtv'"\\]+ contained +syn match pythonEscape "\\\o\{1,3}" contained +syn match pythonEscape "\\x\x\{2}" contained +syn match pythonEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained +syn match pythonEscape "\\$" + +if exists("python_highlight_all") + let python_highlight_numbers = 1 + let python_highlight_builtins = 1 + let python_highlight_exceptions = 1 + let python_highlight_space_errors = 1 +endif + +if exists("python_highlight_numbers") + " numbers (including longs and complex) + syn match pythonNumber "\<0x\x\+[Ll]\=\>" + syn match pythonNumber "\<\d\+[LljJ]\=\>" + syn match pythonNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" + syn match pythonNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>" + syn match pythonNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" +endif + +if exists("python_highlight_builtins") + " builtin functions, types and objects, not really part of the syntax + syn keyword pythonBuiltin True False bool enumerate set frozenset help + syn keyword pythonBuiltin reversed sorted sum + syn keyword pythonBuiltin Ellipsis None NotImplemented __import__ abs + syn keyword pythonBuiltin apply buffer callable chr classmethod cmp + syn keyword pythonBuiltin coerce compile complex delattr dict dir divmod + syn keyword pythonBuiltin eval execfile file filter float getattr globals + syn keyword pythonBuiltin hasattr hash hex id input int intern isinstance + syn keyword pythonBuiltin issubclass iter len list locals long map max + syn keyword pythonBuiltin min object oct open ord pow property range + syn keyword pythonBuiltin raw_input reduce reload repr round setattr + syn keyword pythonBuiltin slice staticmethod str super tuple type unichr + syn keyword pythonBuiltin unicode vars xrange zip +endif + +if exists("python_highlight_exceptions") + " builtin exceptions and warnings + syn keyword pythonException ArithmeticError AssertionError AttributeError + syn keyword pythonException DeprecationWarning EOFError EnvironmentError + syn keyword pythonException Exception FloatingPointError IOError + syn keyword pythonException ImportError IndentationError IndexError + syn keyword pythonException KeyError KeyboardInterrupt LookupError + syn keyword pythonException MemoryError NameError NotImplementedError + syn keyword pythonException OSError OverflowError OverflowWarning + syn keyword pythonException ReferenceError RuntimeError RuntimeWarning + syn keyword pythonException StandardError StopIteration SyntaxError + syn keyword pythonException SyntaxWarning SystemError SystemExit TabError + syn keyword pythonException TypeError UnboundLocalError UnicodeError + syn keyword pythonException UnicodeEncodeError UnicodeDecodeError + syn keyword pythonException UnicodeTranslateError + syn keyword pythonException UserWarning ValueError Warning WindowsError + syn keyword pythonException ZeroDivisionError +endif + +if exists("python_highlight_space_errors") + " trailing whitespace + syn match pythonSpaceError display excludenl "\S\s\+$"ms=s+1 + " mixed tabs and spaces + syn match pythonSpaceError display " \+\t" + syn match pythonSpaceError display "\t\+ " +endif + +" This is fast but code inside triple quoted strings screws it up. It +" is impossible to fix because the only way to know if you are inside a +" triple quoted string is to start from the beginning of the file. If +" you have a fast machine you can try uncommenting the "sync minlines" +" and commenting out the rest. +"syn sync match pythonSync grouphere NONE "):$" +"syn sync maxlines=200 +syn sync minlines=2000 +syn sync linebreaks=1 + +if version >= 508 || !exists("did_python_syn_inits") + if version <= 508 + let did_python_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + " The default methods for highlighting. Can be overridden later + HiLink pythonStatement Statement + HiLink pythonDefStatement Statement + HiLink pythonFunction Function + HiLink pythonConditional Conditional + HiLink pythonRepeat Repeat + HiLink pythonString String + HiLink pythonRawString String + HiLink pythonEscape Special + HiLink pythonOperator Operator + HiLink pythonPreCondit PreCondit + HiLink pythonComment Comment + HiLink pythonTodo Todo + HiLink pythonDecorator Define + if exists("python_highlight_numbers") + HiLink pythonNumber Number + endif + if exists("python_highlight_builtins") + HiLink pythonBuiltin Function + endif + if exists("python_highlight_exceptions") + HiLink pythonException Exception + endif + if exists("python_highlight_space_errors") + HiLink pythonSpaceError Error + endif + + delcommand HiLink +endif + +let b:current_syntax = "python" + +" vim: ts=8 diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..cb8b606 --- /dev/null +++ b/vimrc @@ -0,0 +1,353 @@ +" This is Gary Bernhardt's edited by Maximilien Cuony .vimrc file +" vim:set ts=2 sts=2 sw=2 expandtab: + +" Boostrap autoload +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall +endif + +call plug#begin('~/.vim/bundle') +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" BASIC EDITING CONFIGURATION +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set nocompatible +" allow unsaved background buffers and remember marks/undo for them +set hidden +" remember more commands and search history +set history=10000 +set expandtab +set tabstop=4 +set shiftwidth=4 +set softtabstop=4 +set autoindent +set laststatus=2 +set showmatch +set incsearch +set hlsearch +" make searches case-sensitive only if they contain upper-case characters +set ignorecase smartcase +" highlight current line +set cursorline +set cmdheight=2 +set switchbuf=useopen +set numberwidth=5 +set showtabline=2 +set winwidth=79 +set shell=bash +" Prevent Vim from clobbering the scrollback buffer. See +" http://www.shallowsky.com/linux/noaltscreen.html +set t_ti= t_te= +" keep more context when scrolling off the end of a buffer +set scrolloff=3 +" Store temporary files in a central spot +set backup +set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp +set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp +" allow backspacing over everything in insert mode +set backspace=indent,eol,start +" display incomplete commands +set showcmd +" Enable highlighting for syntax +syntax on +" Enable file type detection. +" Use the default filetype settings, so that mail gets 'tw' set to 72, +" 'cindent' is on in C files, etc. +" Also load indent files, to automatically do language-dependent indenting. +filetype plugin indent on +" use emacs-style tab completion when selecting files, etc +set wildmode=longest,list +" make tab completion for files/buffers act like bash +set wildmenu +let mapleader=" " +set nu +set foldcolumn=2 +set autoindent +set foldmethod=marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" CUSTOM AUTOCMDS +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +augroup vimrcEx + " Clear all autocmds in the group + autocmd! + autocmd FileType text setlocal textwidth=78 + " Jump to last cursor position unless it's invalid or in an event handler + autocmd BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | + \ endif + + "for ruby, autoindent with two spaces, always expand tabs + autocmd FileType ruby,haml,eruby,yaml,html,javascript,sass,cucumber set ai sw=2 sts=2 et + autocmd FileType python set sw=4 sts=4 et + + autocmd! BufRead,BufNewFile *.sass setfiletype sass + + autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> + autocmd BufRead *.markdown set ai formatoptions=tcroqn2 comments=n:> + + " Indent p tags + autocmd FileType html,eruby if g:html_indent_tags !~ '\\|p\>' | let g:html_indent_tags .= '\|p\|li\|dt\|dd' | endif + + " Don't syntax highlight markdown because it's often wrong + autocmd! FileType mkd setlocal syn=off +augroup END + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" COLOR +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set t_Co=256 " 256 colors +set background=dark +":color ir_black +color archman + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" MISC KEY MAPS +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +map y "*y +" Move around splits with +nnoremap j +nnoremap k +nnoremap h +nnoremap l +" Insert a hash rocket with +imap => +" Can't be bothered to understand ESC vs in insert mode +imap +" Clear the search buffer when hitting return +:nnoremap :nohlsearch +nnoremap + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" MULTIPURPOSE TAB KEY +" Indent if we're at the beginning of a line. Else, do completion. +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +function! InsertTabWrapper() + let col = col('.') - 1 + if !col || getline('.')[col - 1] !~ '\k' + return "\" + else + return "\" + endif +endfunction + +inoremap =InsertTabWrapper() +inoremap + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" OPEN FILES IN DIRECTORY OF CURRENT FILE +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +cnoremap %% =expand('%:h').'/' +map e :edit %% +map v :view %% + + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" RENAME CURRENT FILE +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +function! RenameFile() + let old_name = expand('%') + let new_name = input('New file name: ', expand('%'), 'file') + if new_name != '' && new_name != old_name + exec ':saveas ' . new_name + exec ':silent !rm ' . old_name + redraw! + endif +endfunction +map n :call RenameFile() + +function! RandomHexString(...) + let random_string = system('cat /dev/urandom | tr -dc "0-9a-f" | head -c '.shellescape(a)) + return random_string +endfunction + +function! RandomString(...) + let random_string = system('cat /dev/urandom | tr -dc "0-9A-z" | head -c '.shellescape(a)) + return random_string +endfunction + +command! -range Md5 :echo system('echo '.shellescape(join(getline(, ), '\n')) . '| md5sum') + +command! -nargs=1 RandomHexString :normal a=RandomHexString() +command! -nargs=1 RandomString :normal a=RandomString() + +command! InsertTime :normal a=strftime('%F %H:%M:%S.0 %z') +""colorscheme desert + +" Bootstrap autoreload +if empty(glob('~/.vim/autoload/plug.vim')) + silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall +endif + +call plug#begin('~/.vim/plugged') + +Plug 'https://github.com/preservim/nerdtree' +Plug 'https://github.com/Xuyuanp/nerdtree-git-plugin.git' +Plug 'https://github.com/tiagofumo/vim-nerdtree-syntax-highlight' +Plug 'https://github.com/ryanoasis/vim-devicons' +Plug 'https://github.com/millermedeiros/vim-statline.git' +Plug 'https://github.com/tpope/vim-fugitive' +let g:statline_fugitive = 1 +let g:fugitive_gitlab_domains = ['https://git.arcanite.ch', 'https://git.polylan.ch'] +Plug 'https://github.com/junegunn/gv.vim' +Plug 'https://github.com/vim-syntastic/syntastic.git' +let g:syntastic_auto_loc_list=0 +let g:syntastic_enable_loc_list=0 +let g:syntastic_enable_highlighting=1 +let g:syntastic_error_symbol='✗→' +let g:syntastic_style_error_symbol='✗→' +let g:syntastic_warning_symbol='⚠→' +let g:syntastic_style_warning_symbol='⚠→' +let g:syntastic_aggregate_errors=1 +let g:Powerline_symbols = 'unicode' + +let g:syntastic_python_checkers=['flake8', 'pyflakes', 'pep8', 'py3kwarn'] +let g:syntastic_python_checker_args='--ignore=E501' +let g:syntastic_python_flake8_post_args='--ignore=E501,E128' +let g:syntastic_python_pep8_post_args='--ignore=E501,E128' +let g:syntastic_check_on_open=1 + +Plug 'https://github.com/gioele/vim-autoswap' +Plug 'https://github.com/airblade/vim-gitgutter' +let g:gitgutter_eager = 0 " only update on read/write +let g:gitgutter_sign_column_always = 0 +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } +Plug 'https://github.com/junegunn/fzf.vim' +Plug 'https://github.com/shumphrey/fugitive-gitlab.vim' +Plug 'https://tpope.io/vim/surround.git' +Plug 'https://github.com/saltstack/salt-vim' +Plug 'https://github.com/jiangmiao/auto-pairs' +Plug 'https://github.com/mattn/emmet-vim' +Plug 'https://github.com/itchyny/lightline.vim' +let g:lightline = { + \ 'active': { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'filename', 'readonly', 'modified' ], + \ [ 'gitdiff' ] ], + \ 'right': [ [ 'lineinfo' ], + \ [ 'percent' ] ] + \ }, + \ 'inactive': { + \ 'left': [ [ 'filename', 'gitversion' ] ], + \ }, + \ 'component_function': { + \ 'gitbranch': 'fugitive#head', + \ }, + \ 'component_expand': { + \ 'gitdiff': 'lightline#gitdiff#get', + \ }, + \ 'component_type': { + \ 'gitdiff': 'middle', + \ }, + \ } +Plug 'https://github.com/preservim/nerdcommenter' +" Add spaces after comment delimiters by default +let g:NERDSpaceDelims = 0 + +" Use compact syntax for prettified multi-line comments +let g:NERDCompactSexyComs = 1 + +" Align line-wise comment delimiters flush left instead of following code indentation +let g:NERDDefaultAlign = 'left' + +" Allow commenting and inverting empty lines (useful when commenting a region) +let g:NERDCommentEmptyLines = 1 + +" Enable trimming of trailing whitespace when uncommenting +let g:NERDTrimTrailingWhitespace = 1 + +" Enable NERDCommenterToggle to check all selected lines is commented or not +let g:NERDToggleCheckAllLines = 1 + +Plug 'https://github.com/mcchrish/nnn.vim' +nnoremap nn :NnnPicker '%:p:h' + +let g:nnn#action = { + \ '': 'tab-split', + \ '': 'split', + \ '': 'vsplit' } + + +Plug 'https://github.com/terryma/vim-multiple-cursors' +Plug 'https://github.com/tpope/vim-obsession' +Plug 'https://github.com/Konfekt/FastFold' +nmap zuz (FastFoldUpate) +let g:fastfold_savehook = 1 +let g:fastfold_fold_command_suffixes = ['x', 'X', 'a', 'A', 'o', 'O', 'c', 'C'] +let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk'] + + +Plug 'https://github.com/majutsushi/tagbar' +let g:tagbar_autofocus=1 +map :TagbarToggle + +Plug 'https://github.com/ap/vim-css-color' + +Plug 'https://github.com/vifm/vifm.vim' + +call plug#end() + +set clipboard=unnamedplus +set mouse=a +set encoding=UTF-8 +set autoread +set modifiable + + +" CursorLine +" hi Cursor gui=reverse guibg=NONE guifg=NONE +" hi CursorLine gui=reverse cterm=reverse +nnoremap ct :set cursorline! + +" Folding +" set foldnestmax=2 +" set foldmethod=indent + +set nofoldenable +set splitbelow +set splitright +set relativenumber + +" Custom shortcuts +" Search in files +nnoremap :Ag +" Git status +nnoremap :15Gstatus +" Search file name +nnoremap :Files +" Search buffers +nnoremap :Buffers +" Open Flake8 error +nnoremap :Errors +" Force write as unix type (/n instead of /r/n) +nnoremap :w! ++ff=unix +" Force quit +nnoremap :q! +" Split diff +nnoremap :Gdiffsplit +" Buffer + +"" F1-12 Shortcuts +nnoremap :tabprevious +nnoremap :tabnext +nnoremap :GV +nnoremap :Git add % +nnoremap :Gcommit +nnoremap :SyntasticCheck +nnoremap :SyntasticReset + +" Fold / unfold with space +" nnoremap za +" vnoremap zf + +nnoremap dl d$ +nnoremap :bprevious +nnoremap :bnext + +nnoremap o +nnoremap O + +nnoremap %!xxd diff --git a/zsh/alias.sh b/zsh/alias.sh new file mode 100644 index 0000000..4b725a9 --- /dev/null +++ b/zsh/alias.sh @@ -0,0 +1,29 @@ +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' +alias lla='ls -al' +alias mux='tmuxinator' + +alias pm='python manage.py' +alias sp='python manage.py shell_plus' +alias mkmg='python manage.py makemigrations' +alias mg='python manage.py migrate' +alias gp='git push' +alias rs='python manage.py runserver' +alias rs2='python manage.py runserver 127.0.0.2' +alias ga!='git commit --amend --no-edit --date now' + +cheat() { curl cheat.sh/"$1" } +cda() { conda activate "$@" } +cdd() { conda deactivate "$@" } +cdc() { conda create --name "$@" python=3.5 pip } +cdi() { conda info --envs "$@" } +ca() { pygmentize -g "$@" } +grepf() { grep -rnw ./ -e "$@"} +amendnow() { GIT_COMMITTER_DATE="$(date +%d/%m/%Y' '%H:%M:%S)" git commit --amend --no-edit --date "$(date +%d/%m/%Y' '%H:%M:%S)" } +continous-running() { while true; do inotifywait $1 -r -e close_write && ${@:2}; done } + +make_venv() { + echo $(basename $(pwd) | awk '{print "conda activate "$1}') > $(pwd | awk '{print $1"/.autoenv.zsh"}') + echo $(basename $(pwd) | awk '{print "conda deactivate "$1}') > $(pwd | awk '{print $1"/.autoenv_leave.zsh"}') +} diff --git a/zsh/generic.sh b/zsh/generic.sh new file mode 100644 index 0000000..dacf0f3 --- /dev/null +++ b/zsh/generic.sh @@ -0,0 +1,30 @@ +# Source Prezto. +if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then + source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" +fi + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/home/legrems/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/home/legrems/miniconda3/etc/profile.d/conda.sh" ]; then + . "/home/legrems/miniconda3/etc/profile.d/conda.sh" + else + export PATH="/home/legrems/miniconda3/bin:$PATH" + fi +fi +unset __conda_setup +#<<< conda initialize <<< + +export PATH=$HOME/Documents/Arcanite/git_ci_runner:$PATH +export NB_MINIONS=4 +export VISUAL=nvim +export EDITOR=nvim + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +eval $(thefuck --alias) + +source ~/.dotfiles/lib/zsh-autoenv/autoenv.zsh diff --git a/zsh/history.sh b/zsh/history.sh new file mode 100644 index 0000000..00e6042 --- /dev/null +++ b/zsh/history.sh @@ -0,0 +1,13 @@ +HISTFILE=~/.histfile + +HISTSIZE=10000 +SAVEHIST=10000 + +setopt append_history +setopt extended_history +setopt extendedglob +setopt hist_expire_dups_first +setopt hist_ignore_dups # ignore duplication command history list +setopt hist_ignore_space +setopt hist_verify +setopt inc_append_history diff --git a/zsh/keys.sh b/zsh/keys.sh new file mode 100644 index 0000000..e69de29 diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..7217e00 --- /dev/null +++ b/zshrc @@ -0,0 +1,11 @@ +# Generic defaults +source ~/.zsh/generic.sh + +# History +source ~/.zsh/history.sh + +# Bind keys +source ~/.zsh/keys.sh + +# Alias +source ~/.zsh/alias.sh diff --git a/zshrc_old b/zshrc_old new file mode 100644 index 0000000..02eada1 --- /dev/null +++ b/zshrc_old @@ -0,0 +1,69 @@ +# +# Executes commands at the start of an interactive session. +# +# Authors: +# Sorin Ionescu +# + +# Source Prezto. +if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then + source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" +fi + +export PATH=$HOME/Documents/Arcanite/git_ci_runner:$PATH + +cheat(){ curl cheat.sh/"$1" } +alias lla='ls -al' +plugins=(git) +alias mux='tmuxinator' +export PATH=~/miniconda3/bin:$PATH +alias 'mux'=tmuxinator +cda() { conda activate "$@" } +cdd() { conda deactivate "$@" } +cdc() { conda create --name "$@" python=3.5 pip } +cdi() { conda info --envs "$@" } +ca() { pygmentize -g "$@" } +grepf() { grep -rnw ./ -e "$@"} +amendnow() { GIT_COMMITTER_DATE="$(date +%d/%m/%Y' '%H:%M:%S)" git commit --amend --no-edit --date "$(date +%d/%m/%Y' '%H:%M:%S)" } +continous-running() { while true; do inotifywait $1 -r -e close_write && ${@:2}; done } + +make_venv() { + echo $(basename $(pwd) | awk '{print "conda activate "$1}') > $(pwd | awk '{print $1"/.autoenv.zsh"}') + echo $(basename $(pwd) | awk '{print "conda deactivate "$1}') > $(pwd | awk '{print $1"/.autoenv_leave.zsh"}') +} + +alias pm='python manage.py' +alias sp='python manage.py shell_plus' +alias mkmg='python manage.py makemigrations' +alias mg='python manage.py migrate' +alias gp='git push' +alias rs='python manage.py runserver' +alias rs2='python manage.py runserver 127.0.0.2' +alias ga!='git commit --amend --no-edit --date now' + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/home/legrems/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/home/legrems/miniconda3/etc/profile.d/conda.sh" ]; then + . "/home/legrems/miniconda3/etc/profile.d/conda.sh" + else + export PATH="/home/legrems/miniconda3/bin:$PATH" + fi +fi +unset __conda_setup +#<<< conda initialize <<< + +cd ~/Documents/Arcanite +export NB_MINIONS=4 +export VISUAL=nvim +export EDITOR=nvim + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +eval $(thefuck --alias) + +# Customize to your needs... +source ~/.dotfiles/lib/zsh-autoenv/autoenv.zsh