Skip to content

Instantly share code, notes, and snippets.

@Wes974
Last active October 24, 2019 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wes974/72823467f402684c098baa6275c96dd2 to your computer and use it in GitHub Desktop.
Save Wes974/72823467f402684c098baa6275c96dd2 to your computer and use it in GitHub Desktop.
my configurations files
################################################################################
# #
# ~/.zshrc #
# #
# Auhtor: Ouwéis Moolna #
# #
################################################################################
#==============================================================================#
# oh-my-zsh config #
#==============================================================================#
# Path to the oh-my-zsh installation.
export ZSH=/Users/Ouweis/.oh-my-zsh
# Set theme
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='nerdfont-complete' # Set font, not displayed properly if not set here
# Enable command auto-correction.
ENABLE_CORRECTION="true"
# Which plugins to load
# plugins can be found in ~/.oh-my-zsh/plugins/
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
plugins=(
# git xcode
osx
colored-man-pages
colorize
)
#==============================================================================#
# User configuration #
#==============================================================================#
# Set $PATH
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/sbin"
# PATH for MacPorts
export PATH="$PATH:/opt/local/bin:/opt/local/sbin"
# PATH for X11
export PATH="$PATH:/opt/X11/bin"
# PATH for MacGPG2
# export PATH="$PATH:/usr/local/MacGPG2/bin"
# PATH for TeX
export PATH="$PATH:/Library/TeX/texbin"
# PATH for Anaconda
# export PATH=/usr/local/anaconda3/bin:"$PATH"
# PATH for Wine
export PATH="$PATH:/Applications/Wine Stable.app/Contents/Resources/wine/bin"
# PATH for mono
# export PATH="$PATH:/Library/Frameworks/Mono.framework/Versions/Current/bin/"
# PATH for Go
# export PATH="$PATH:/usr/local/opt/go/libexec/bin"
# export PATH="$PATH:$HOME/Developement/go/bin"
# export GOPATH="$HOME/Developement/go"
# PATH for my scripts
export PATH="$PATH:$HOME/bin"
source $ZSH/oh-my-zsh.sh
# compdef gpg2=gpg
compdef mosh=ssh # Allow SSH tab completion for mosh hostnames
eval $(thefuck --alias)
#==============================================================================#
# Aliases #
#==============================================================================#
alias vim='/usr/local/bin/nvim'
alias cat='/usr/local/bin/ccat'
#==============================================================================#
# General Options #
#==============================================================================#
# Set your language environment
# export LANGUAGE="fr_FR.UTF-8"
# export LANG="fr_FR.UTF-8"
# export LC_ALL=$LANG
# export LC_CTYPE=fr_FR.UTF-8
export LANG=fr_FR.UTF-8
export LANGUAGE=fr_FR.UTF-8
export LC_CTYPE="fr_FR.UTF-8"
export LC_NUMERIC="fr_FR.UTF-8"
export LC_TIME="fr_FR.UTF-8"
export LC_COLLATE="fr_FR.UTF-8"
export LC_MONETARY="fr_FR.UTF-8"
export LC_MESSAGES="fr_FR.UTF-8"
export LC_PAPER="fr_FR.UTF-8"
export LC_NAME="fr_FR.UTF-8"
export LC_ADDRESS="fr_FR.UTF-8"
export LC_TELEPHONE="fr_FR.UTF-8"
export LC_MEASUREMENT="fr_FR.UTF-8"
export LC_IDENTIFICATION="fr_FR.UTF-8"
export LC_ALL=fr_FR.UTF-8
# Set term
export TERM="xterm-256color"
# Preferred editor
export EDITOR='nvim'
# Hombrew
export HOMEBREW_GITHUB_API_TOKEN=
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_INSECURE_REDIRECT=1
# iTerm 2 integration
source ~/.iterm2/.iterm2_shell_integration.zsh
# zsh completions support
fpath=(/usr/local/share/zsh-completions $fpath)
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.*' insert-sections true
zstyle ':completion:*:man:*' menu yes select
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
. /usr/local/etc/profile.d/z.sh
# Fix GPG
# if [ -f "${HOME}/.gpg-agent-info" ]; then
# . "${HOME}/.gpg-agent-info"
# export GPG_AGENT_INFO
# export SSH_AUTH_SOCK
# fi
# GPG_TTY=$(tty)
# export GPG_TTY
export DEFAULT_USER="$USER"
#==============================================================================#
# Powerlevel 9k #
# =============================================================================#
# General options
POWERLEVEL9K_PROMPT_ON_NEWLINE=true # Double Lined Prompt
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="" # Change first line start
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="> " # "╰-> " # How to go to new line
POWERLEVEL9K_DIR_SHOW_WRITABLE=true # Show if directory is not writable
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3 # Shorten current path
# POWERLEVEL9K_SHORTEN_DELIMITER="" # Delimiter for shortening
# POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right" # How to shorten path
POWERLEVEL9K_TIME_FORMAT="\UF43A %D{%H:%M}" # HH:MM
POWERLEVEL9K_STATUS_OK=false # Hide status if no error
POWERLEVEL9K_BATTERY_VERBOSE=false # Hide time remaining next to battery level
POWERLEVEL9K_ALWAYS_SHOW_USER=true # Always show user
POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="001" # Display user in red
# Prompts configuration
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context ssh root_indicator dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(time battery background_jobs status_joined)
#==============================================================================#
# Fonctions #
#==============================================================================#
function videoToGif() {
name=$(basename "$1")
name="${name%.*}.gif"
start_time=$2
duration=$3
palette="/tmp/palette.png"
if [ $# -eq 4 ]; then
filters="fps=$4,scale=500:-1:flags=lanczos"
elif [ $# -eq 5 ]; then
filters="fps=$4,scale=$5:-1:flags=lanczos"
else
filters="fps=15,scale=500:-1:flags=lanczos"
fi
# ffmpeg -v warning -ss $start_time -t $duration -i "$1" -vf "$filters,palettegen" -y $palette
# ffmpeg -v warning -ss $start_time -t $duration -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse=dither=sierra2" -y $name
ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y $palette
ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse=dither=sierra2" -y $name
}
# zsh highlighting (need to be at the end !!!)
source ~/.oh-my-zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
" Vim color file
" ~/.config/nvim/colors/civic.vim
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "Civic"
hi Cursor ctermfg=233 ctermbg=231 cterm=NONE guifg=#252630 guibg=#fcffff gui=NONE
hi Visual ctermfg=NONE ctermbg=235 cterm=NONE guifg=NONE guibg=#3c4856 gui=NONE
hi CursorLine ctermfg=NONE ctermbg=235 cterm=NONE guifg=NONE guibg=#383942 gui=NONE
hi CursorColumn ctermfg=NONE ctermbg=235 cterm=NONE guifg=NONE guibg=#383942 gui=NONE
hi ColorColumn ctermfg=NONE ctermbg=235 cterm=NONE guifg=NONE guibg=#383942 gui=NONE
hi LineNr ctermfg=102 ctermbg=235 cterm=NONE guifg=#83848c guibg=#383942 gui=NONE
hi VertSplit ctermfg=235 ctermbg=235 cterm=NONE guifg=#5c5d65 guibg=#5c5d65 gui=NONE
hi MatchParen ctermfg=168 ctermbg=NONE cterm=underline guifg=#cf3f93 guibg=NONE gui=underline
hi StatusLine ctermfg=254 ctermbg=235 cterm=bold guifg=#e1e2e7 guibg=#5c5d65 gui=bold
hi StatusLineNC ctermfg=254 ctermbg=235 cterm=NONE guifg=#e1e2e7 guibg=#5c5d65 gui=NONE
hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE
hi PmenuSel ctermfg=NONE ctermbg=235 cterm=NONE guifg=NONE guibg=#3c4856 gui=NONE
hi IncSearch ctermfg=233 ctermbg=167 cterm=NONE guifg=#252630 guibg=#ca4540 gui=NONE
hi Search ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline
hi Directory ctermfg=167 ctermbg=NONE cterm=NONE guifg=#ca4540 guibg=NONE gui=NONE
hi Folded ctermfg=77 ctermbg=233 cterm=NONE guifg=#32cf72 guibg=#252630 gui=NONE
if has("gui_vimr")
hi Normal ctermfg=254 ctermbg=233 cterm=NONE guifg=#e1e2e7 guibg=#252630 gui=NONE
else
" No background
hi Normal guibg=NONE ctermbg=NONE
endif
" hi Normal ctermfg=254 ctermbg=233 cterm=NONE guifg=#e1e2e7 guibg=#252630 gui=NONE
hi Boolean ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi Character ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi Comment ctermfg=77 ctermbg=NONE cterm=NONE guifg=#32cf72 guibg=NONE gui=NONE
hi Conditional ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi Constant ctermfg=66 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi Define ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi DiffAdd ctermfg=254 ctermbg=64 cterm=bold guifg=#e1e2e7 guibg=#46830e gui=bold
hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8b080a guibg=NONE gui=NONE
hi DiffChange ctermfg=254 ctermbg=23 cterm=NONE guifg=#e1e2e7 guibg=#23385c gui=NONE
hi DiffText ctermfg=254 ctermbg=24 cterm=bold guifg=#e1e2e7 guibg=#204a87 gui=bold
hi ErrorMsg ctermfg=254 ctermbg=131 cterm=NONE guifg=#e1e2e7 guibg=#af5d38 gui=NONE
hi WarningMsg ctermfg=254 ctermbg=131 cterm=NONE guifg=#e1e2e7 guibg=#af5d38 gui=NONE
hi Float ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi Function ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi Identifier ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi Keyword ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi Label ctermfg=167 ctermbg=NONE cterm=NONE guifg=#ca4540 guibg=NONE gui=NONE
" No color for NonText
hi NonText ctermbg=none
" hi NonText ctermfg=244 ctermbg=233 cterm=NONE guifg=#7f7f7f guibg=#2e2f39 gui=NONE
hi Number ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi Operator ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi PreProc ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi Special ctermfg=254 ctermbg=NONE cterm=NONE guifg=#e1e2e7 guibg=NONE gui=NONE
hi SpecialKey ctermfg=244 ctermbg=235 cterm=NONE guifg=#7f7f7f guibg=#383942 gui=NONE
hi Statement ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi StorageClass ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi String ctermfg=161 ctermbg=NONE cterm=NONE guifg=#ca4540 guibg=NONE gui=NONE
hi Tag ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi Title ctermfg=254 ctermbg=NONE cterm=bold guifg=#e1e2e7 guibg=NONE gui=bold
hi Todo ctermfg=77 ctermbg=NONE cterm=inverse,bold guifg=#32cf72 guibg=NONE gui=inverse,bold
hi Type ctermfg=162 ctermbg=NONE cterm=NONE guifg=#d7008f guibg=NONE gui=NONE
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline
hi rubyClass ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi rubyFunction ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE
hi rubySymbol ctermfg=167 ctermbg=NONE cterm=NONE guifg=#ca4540 guibg=NONE gui=NONE
hi rubyConstant ctermfg=37 ctermbg=NONE cterm=NONE guifg=#1da9a2 guibg=NONE gui=NONE
hi rubyStringDelimiter ctermfg=167 ctermbg=NONE cterm=NONE guifg=#ca4540 guibg=NONE gui=NONE
hi rubyBlockParameter ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi rubyInstanceVariable ctermfg=131 ctermbg=NONE cterm=NONE guifg=#af5d38 guibg=NONE gui=NONE
hi rubyInclude ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi rubyGlobalVariable ctermfg=254 ctermbg=NONE cterm=NONE guifg=#e1e2e7 guibg=NONE gui=NONE
hi rubyRegexp ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi rubyRegexpDelimiter ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi rubyEscape ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi rubyControl ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi rubyClassVariable ctermfg=254 ctermbg=NONE cterm=NONE guifg=#e1e2e7 guibg=NONE gui=NONE
hi rubyOperator ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi rubyException ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi rubyPseudoVariable ctermfg=131 ctermbg=NONE cterm=NONE guifg=#af5d38 guibg=NONE gui=NONE
hi rubyRailsUserClass ctermfg=37 ctermbg=NONE cterm=NONE guifg=#1da9a2 guibg=NONE gui=NONE
hi rubyRailsARAssociationMethod ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi rubyRailsARMethod ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi rubyRailsRenderMethod ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi rubyRailsMethod ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi erubyDelimiter ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi erubyComment ctermfg=77 ctermbg=NONE cterm=NONE guifg=#32cf72 guibg=NONE gui=NONE
hi erubyRailsMethod ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi htmlTag ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi htmlEndTag ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi htmlTagName ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi htmlArg ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi htmlSpecialChar ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi javaScriptFunction ctermfg=168 ctermbg=NONE cterm=NONE guifg=#cf3f93 guibg=NONE gui=NONE
hi javaScriptRailsFunction ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi javaScriptBraces ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi jsFuncCall ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi yamlKey ctermfg=97 ctermbg=NONE cterm=NONE guifg=#746db0 guibg=NONE gui=NONE
hi yamlAnchor ctermfg=254 ctermbg=NONE cterm=NONE guifg=#e1e2e7 guibg=NONE gui=NONE
hi yamlAlias ctermfg=254 ctermbg=NONE cterm=NONE guifg=#e1e2e7 guibg=NONE gui=NONE
hi yamlDocumentHeader ctermfg=167 ctermbg=NONE cterm=NONE guifg=#ca4540 guibg=NONE gui=NONE
hi cssURL ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi cssFunctionName ctermfg=73 ctermbg=NONE cterm=NONE guifg=#56afb0 guibg=NONE gui=NONE
hi cssColor ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
hi cssPseudoClassId ctermfg=37 ctermbg=NONE cterm=NONE guifg=#1da9a2 guibg=NONE gui=NONE
hi cssClassName ctermfg=37 ctermbg=NONE cterm=NONE guifg=#1da9a2 guibg=NONE gui=NONE
hi cssValueLength ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi cssCommonAttr ctermfg=173 ctermbg=NONE cterm=NONE guifg=#c77a4b guibg=NONE gui=NONE
hi cssBraces ctermfg=66 ctermbg=NONE cterm=NONE guifg=#55747c guibg=NONE gui=NONE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" My neovim config file. "
" "
" Author : Ouwéis Moolna "
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim-plug ----------------------------------------------------------------
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.local/share/nvim/plugged')
" vim-airline
Plug 'vim-airline/vim-airline'
" Autocompletion
function! BuildYCM(info)
" info is a dictionary with 3 fields
" - name: name of the plugin
" - status: 'installed', 'updated', or 'unchanged'
" - force: set on PlugInstall! or PlugUpdate!
if a:info.status == 'installed' || a:info.force
!~/.local/share/nvim/plugged/YouCompleteMe/install.py --clang-completer --java-completer
endif
endfunction
Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') }
" Remplacer YCM par un d'eux :
" Plug 'roxma/nvim-completion-manager' " Dead projet ?
" Plug 'SirVer/ultisnips'
" Plug 'honza/vim-snippets'
" Installs and builds OmniSharp
" Plug 'OmniSharp/omnisharp-vim', { 'do': 'cd server && xbuild' , 'for': 'csharp' }
" Linting
" Plug 'vim-syntastic/syntastic'
" Plug 'neomake/neomake'
Plug 'w0rp/ale'
" Syntax
Plug 'sheerun/vim-polyglot'
" NERDTree
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Plist support
Plug 'darfink/vim-plist', { 'for': 'plist' }
" Better tabs control
Plug 'ervandew/supertab'
" Distraction free
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' , 'for': 'markdown' }
" Distraction
Plug 'johngrib/vim-game-code-break', { 'on': 'VimGameCodeBreak' }
" Markdown preview
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install', 'for': 'markdown' }
" fff
Plug 'dylanaraps/fff.vim', { 'on': 'F' }
" Initialize plugin system
call plug#end()
" General options ------------------------------------------------------------
set ffs=unix
" Always utf8
set termencoding=utf-8
set encoding=utf-8
set fileencoding=utf-8 " UTF-8 on write
filetype plugin indent on
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
set undodir=~/.config/nvim/undodir
set undofile
set undolevels=100
set undoreload=1000
set backupdir=~/.config/nvim/backup
""set directory=~/.config/nvim/backup // A VERIFIER
set mouse=a
set wildmenu " Show all autocomplete of vim commands
set number " Show line numbers
set relativenumber " Show relative numbers
set noshowmode
set lazyredraw
set clipboard=unnamedplus " Access macOS clipboard
set wrap " Enable word wrap
set linebreak " Wrap lines at convenient points
set hidden " Hide buffers in background
set autoread " Reload a file when changed from the outside
set title
" set the title
set titlestring=%{substitute(getcwd(),\ $HOME,\ '~',\ '')}/
set titlestring+=%f
" set splitright splitbelow " Better splitting of window
" Window splits automatically equalized
" set equalalways
" buffer settings
set hid " buffer becomes hidden when abandoned
set shortmess+=c
set completeopt-=preview " Hide the preview windows when autocompleting
set rtp+=/usr/local/opt/fzf
let g:python_host_prog = '/usr/local/bin/python2'
let g:python3_host_prog = '/usr/local/bin/python3'
" Color Scheme Options ----------------------------------------------------
set termguicolors
colorscheme civic
" Others cool schemes :
"
" colorscheme hybrid " Made from iTerm2 color scheme
"
" colorscheme quantum " With it's options
" let g:quantum_black=1
" let g:quantum_italics=1
" let g:airline_theme='quantum'
"
" colorscheme neodark " With it's options
" let g:neodark#background = '#202020'
" let g:neodark#terminal_transparent = 1 " default: 0
" VimR Options ------------------------------------------------------------
if has("gui_vimr")
" Here goes some VimR specific settings like
endif
" Auto commands ------------------------------------------------------------
" detect .md as markdown instead of modula-2
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
" stop highlighting of underscores in markdown files
autocmd BufNewFile,BufRead,BufEnter *.md,*.markdown :syntax match markdownIgnore "_"
" Searching ----------------------------------------------------------------
set ignorecase " ignore case when searching…
set smartcase " except when using uper-case letters.
set incsearch " search as typing.
set hlsearch " highlight search
" Remove search highlighting with delete/backspace key
nnoremap <silent> <BS> :nohlsearch<CR>
" Tabs, Spaces and Scrolling ------------------------------------------------
set tabstop=4 " Numbers of visual spaces / tabs.
set softtabstop=4 " Numbers of spaces / tabs.
set expandtab " Tab -> Space.
set shiftwidth=4
set shiftround
set scrolloff=15
set sidescrolloff=20
set sidescroll=1
if (exists('+colorcolumn'))
set colorcolumn=80
highlight ColorColumn ctermbg=9
endif
" higlight everything after 80 column
" highlight OverLength ctermbg=red ctermfg=white guibg=#592929
" match OverLength /\%81v.\+/
" Plugins --------------------------------------------------------------------
" airline
let g:airline#extensions#tabline#enabled = 1 " Enable tabline extension
let g:airline#extensions#tabline#show_tabs = 0 " Always show
let g:airline#extensions#whitespace#enabled = 0 " Disable whitespace extension
let g:airline_theme = 'base16_google' " Use base16 google theme
let g:airline#extensions#ale#enabled = 1
" YouCompleteMe
let g:ycm_global_ycm_extra_conf = "~/.config/nvim/.ycm_extra_conf.py" " Global config file for C family completion
" Supertab
let g:SuperTabDefaultCompletionType = "<c-n>"
" neomake
"autocmd! BufWritePost,BufReadPost * Neomake
" When writing a buffer.
" call neomake#configure#automake('w')
" When writing a buffer, and on normal mode changes (after 750ms).
" call neomake#configure#automake('nw', 500)
" When reading a buffer (after 1s), and when writing.
" call neomake#configure#automake('rw', 500)
" ALE
let g:ale_lint_on_insert_leave = 1
" NERDTree
" Launch NERDTree when opening a directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
" Close NERDTree if it's the only remaining
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Markdown Preview
"
" set to 1, the nvim will open the preview window once enter the markdown buffer
" default: 0
let g:mkdp_auto_start = 0
" set to 1, the nvim will auto close current preview window when change
" from markdown buffer to another buffer
" default: 1
let g:mkdp_auto_close = 1
" set to 1, the vim will just refresh markdown when save the buffer or
" leave from insert mode, default 0 is auto refresh markdown as you edit or
" move the cursor
" default: 0
let g:mkdp_refresh_slow = 0
" set to 1, the MarkdownPreview command can be use for all files,
" by default it just can be use in markdown file
" default: 0
let g:mkdp_command_for_global = 0
" set to 1, preview server available to others in your network
" by default, the server only listens on localhost (127.0.0.1)
" default: 0
let g:mkdp_open_to_the_world = 0
" specify browser to open preview page
" default: ''
let g:mkdp_browser = 'Safari'
" set to 1, echo preview page url in command line when open preview page
" default is 0
let g:mkdp_echo_preview_url = 0
" a custom vim function name to open preview page
" this function will receive url as param
" default is empty
let g:mkdp_browserfunc = ''
" options for markdown render
" mkit: markdown-it options for render
" katex: katex options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {}
\ }
" use a custom markdown style must be absolute path
let g:mkdp_markdown_css = ''
" use a custom highlight style must absolute path
let g:mkdp_highlight_css = ''
" use a custom port to start server or random for empty
let g:mkdp_port = ''
" fff
"
" Vertical split (NERDtree style).
" let g:fff#split = "30vnew"
"
" Open split on the left side (NERDtree style).
" let g:fff#split_direction = "nosplitbelow nosplitright"
" Keys --------------------------------------------------------------------
" Open fff on press of 'f'
" nnoremap f :F<CR>
" Move by visual line
nnoremap <expr> k (v:count > 1 ? "m'" . v:count : '') . 'gk'
nnoremap <expr> j (v:count > 1 ? "m'" . v:count : '') . 'gj'
" Better autocompletion when pressing <Enter>
inoremap <expr> <CR> pumvisible() ? "\<C-Y>\<ESC>a" : "\<CR>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment