if exists('b:current_syntax')
    finish
endif

syntax match vlime_sldbSection /\m^Thread: \d\+; Level: \d\+$/ contains=vlime_sldbNumber
syntax match vlime_sldbSection /\m^Restarts:$/
syntax match vlime_sldbSection /\m^Frames:$/
syntax match vlime_sldbRestart /\m\(^\s*\d\+\.\s\+\)\@<=[^[:space:]]\+\(\s\+-\)\@=/
syntax match vlime_sldbNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([dDeEfFlL][-+]\=\d\+\)\="
syntax match vlime_sldbNumber "-\=\(\d\+/\d\+\)"
syntax region vlime_sldbString start=/\m"/ skip=/\m\\\\\|\\"/ end=/\m"/
syntax region vlime_sldbObject start=/\m#</ end=/\m>/ contains=vlime_sldbObject,vlime_sldbString

hi def link vlime_sldbSection Comment
hi def link vlime_sldbRestart Operator
hi def link vlime_sldbNumber Number
hi def link vlime_sldbString String
hi def link vlime_sldbObject Constant

let b:current_syntax = 'vlime_sldb'

Make strings and objects in SLDB buffers stop at EOL.

if exists('b:current_syntax')
    finish
endif

syntax match vlime_sldbSection /\m^Thread: \d\+; Level: \d\+$/ contains=vlime_sldbNumber
syntax match vlime_sldbSection /\m^Restarts:$/
syntax match vlime_sldbSection /\m^Frames:$/
syntax match vlime_sldbRestart /\m\(^\s*\d\+\.\s\+\)\@<=[^[:space:]]\+\(\s\+-\)\@=/
syntax match vlime_sldbNumber "-\=\(\.\d\+\|\d\+\(\.\d*\)\=\)\([dDeEfFlL][-+]\=\d\+\)\="
syntax match vlime_sldbNumber "-\=\(\d\+/\d\+\)"
syntax region vlime_sldbString start=/\m"/ skip=/\m\\\\\|\\"/ end=/\m"\|$)/
syntax region vlime_sldbObject start=/\m#</ end=/\m>/ end=/$/me=e-1 contains=vlime_sldbObject,vlime_sldbString

hi def link vlime_sldbSection Comment
hi def link vlime_sldbRestart Operator
hi def link vlime_sldbNumber Number
hi def link vlime_sldbString String
hi def link vlime_sldbObject Constant

let b:current_syntax = 'vlime_sldb'


" ftplugin/javascript.vim

" intelligent autocompleter
set omnifunc=javascriptcomplete#CompleteJS

" F1 comment line
map <F1> 0i//<esc>j
imap <F1> <esc>0i//<esc>j

" F2 uncomment line
map <F2> :s/^\/\///e<return>:noh<return>j

" F3 structured comment
map <F3> o<esc>i/<esc>79.yyp0O//<space>
imap <F3> <esc>o<esc>i/<esc>79.yyp0O//<space>

" F4 file header
map <F4> <esc>1GO// Creation Date: <esc>:r! date "+\%Y.\%m.\%d"<return><esc>kJo<esc>0xxo<return><esc>kO"use strict";<esc>G

" use TAB character when TAB is pressed
set noexpandtab

" number of spaces to show for a TAB
set tabstop=4

" number of spaces for indent (>>, endfunction
set shiftwidth=4

" number of spaces for a tab in editing operations
set softtabstop=4

set textwidth=0

set smartindent

" TODO it would be nice to have this when on a comment, but it's not cool for code
set nowrap
set smartcase

colorscheme conanperlgray

" highlight unwanted spaces
call SpaceHighlightor()

Update Javascript rules to comply with CSW rules

" ftplugin/javascript.vim

" intelligent autocompleter
set omnifunc=javascriptcomplete#CompleteJS

" F1 comment line
map <F1> 0i//<esc>j
imap <F1> <esc>0i//<esc>j

" F2 uncomment line
map <F2> :s/^\/\///e<return>:noh<return>j

" F3 structured comment
map <F3> o<esc>i/<esc>79.yyp0O//<space>
imap <F3> <esc>o<esc>i/<esc>79.yyp0O//<space>

" F4 file header
map <F4> <esc>1GO'use strict';<esc>o<esc>

" use TAB character when TAB is pressed
set expandtab

" number of spaces to show for a TAB
set tabstop=2

" number of spaces for indent (>>, endfunction
set shiftwidth=2

" number of spaces for a tab in editing operations
set softtabstop=2

set textwidth=0

set smartindent

" TODO it would be nice to have this when on a comment, but it's not cool for code
set nowrap
set smartcase

set number
colorscheme conanperlgray

" highlight unwanted spaces
call SpaceHighlightor()


" Open a module (in sys.path) in a new window (like CTRL-M in IDLE)
" Place this somewhere in your .vimrc

func OpenModule(name)
python << EOF
import vim
name = vim.eval("a:name")
try:
    module = __import__(name)
    filename = getattr(module, "__file__", None)
    if filename:
        import re
        filename = re.sub(".py[co]", ".py", filename)
        vim.command("e %s" % filename)
    else:
        print "error: can't find module `%s` source" % name
except ImportError:
    print "error: can't find `%s` module" % name
EOF
endfunc
comm! -nargs=1 OM call OpenModule(<f-args>)

Add current directory to sys.path

" Open a module (in sys.path) in a new window (like CTRL-M in IDLE)
" Place this somewhere in your .vimrc

func OpenModule(name)
python << EOF
import os, sys
sys.path.append(os.getcwd())
import vim
name = vim.eval("a:name")
try:
    module = __import__(name)
    filename = getattr(module, "__file__", None)
    if filename:
        import re
        filename = re.sub(".py[co]", ".py", filename)
        vim.command("e %s" % filename)
    else:
        print "error: can't find module `%s` source" % name
except ImportError:
    print "error: can't find `%s` module" % name
EOF
endfunc
comm! -nargs=1 OM call OpenModule(<f-args>)


if g:colors_name == 'sonokai'
    hi! link Boolean    Blue
    hi! link Character  Green
    hi! link Float      Blue
    hi! link Function   Purple
    hi! link Macro      Orange
    hi! link Number     Blue
    hi! link String     Green

    hi! link juliaConstNum      Blue
    hi! link juliaComplexUnit   Blue
    hi! link juliaEuler         Blue
    hi! link juliaFunctionCall  Blue
endif

Adjust colors for Julia syntax in vim

if g:colors_name == 'sonokai'

    hi! link Boolean     Green
    hi! link Character   Green
    hi! link Constant    Green
    hi! link Float       Green
    hi! link Function    Purple
    hi! link Identifier  Green
    hi! link Macro       Orange
    hi! link Number      Green
    hi! link String      Green

    hi! link juliaFunctionCall  Blue

elseif (g:colors_name == 'gruvbox-material' || g:colors_name == 'everforest')

    hi! link Boolean     Aqua
    hi! link Character   Aqua
    hi! link Float       Aqua
    hi! link Function    Purple
    hi! link Identifier  Aqua
    hi! link Macro       Orange
    hi! link Number      Aqua
    hi! link String      Aqua
    hi! link Type        Blue

    hi! link juliaConstNum      Aqua
    hi! link juliaComplexUnit   Aqua
    hi! link juliaEuler         Aqua
    hi! link juliaFunctionCall  Blue

endif


" Author: Nelson Yeung <nelsyeung@icloud.com>
" Description: Check Dart files with dart analysis server LSP

call ale#Set('dart_analysis_server_executable', 'dart')

function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
    " Note: pub only looks for pubspec.yaml, there's no point in adding
    " support for pubspec.yml
    let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')

    return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : ''
endfunction

function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
    let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
    let l:dart = resolve(exepath(l:executable))

    return '%e '
    \   . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
    \   . ' --lsp'
endfunction

call ale#linter#Define('dart', {
\   'name': 'analysis_server',
\   'lsp': 'stdio',
\   'executable': {b -> ale#Var(b, 'dart_analysis_server_executable')},
\   'command': function('ale_linters#dart#analysis_server#GetCommand'),
\   'project_root': function('ale_linters#dart#analysis_server#GetProjectRoot'),
\})

Add support for standalone files

" Author: Nelson Yeung <nelsyeung@icloud.com>
" Description: Check Dart files with dart analysis server LSP

call ale#Set('dart_analysis_server_executable', 'dart')

function! ale_linters#dart#analysis_server#GetProjectRoot(buffer) abort
    " Note: pub only looks for pubspec.yaml, there's no point in adding
    " support for pubspec.yml
    let l:pubspec = ale#path#FindNearestFile(a:buffer, 'pubspec.yaml')

    return !empty(l:pubspec) ? fnamemodify(l:pubspec, ':h:h') : '.'
endfunction

function! ale_linters#dart#analysis_server#GetCommand(buffer) abort
    let l:executable = ale#Var(a:buffer, 'dart_analysis_server_executable')
    let l:dart = resolve(exepath(l:executable))

    return '%e '
    \   . fnamemodify(l:dart, ':h') . '/snapshots/analysis_server.dart.snapshot'
    \   . ' --lsp'
endfunction

call ale#linter#Define('dart', {
\   'name': 'analysis_server',
\   'lsp': 'stdio',
\   'executable': {b -> ale#Var(b, 'dart_analysis_server_executable')},
\   'command': function('ale_linters#dart#analysis_server#GetCommand'),
\   'project_root': function('ale_linters#dart#analysis_server#GetProjectRoot'),
\})


" we need the conceal feature (vim ≥ 7.3)
if exists('g:no_lisp_conceal') || !has('conceal') || &enc != 'utf-8'
    finish
endif

syntax keyword clojureNiceOperator or conceal cchar=∧
syntax keyword clojureNiceOperator and conceal cchar=∨
syntax keyword clojureNiceOperator not conceal cchar=¬
syntax keyword clojureNiceOperator <= conceal cchar=≤
syntax keyword clojureNiceOperator >= conceal cchar=≥
syntax keyword clojureNiceOperator not= conceal cchar=≠
syntax keyword clojureNiceOperator + conceal cchar=Σ
syntax keyword clojureNiceOperator * conceal cchar=Π
syntax keyword clojureNiceOperator Math/sqrt conceal cchar=√
syntax keyword clojureNiceOperator Math/pi conceal cchar=π
syntax keyword clojureNiceOperator fn conceal cchar=λ

hi link lispNiceOperator Operator
hi! link Conceal Operator

setlocal conceallevel=1

Fix incorrect Clojure conceal symbols for and/or

" we need the conceal feature (vim ≥ 7.3)
if exists('g:no_lisp_conceal') || !has('conceal') || &enc != 'utf-8'
    finish
endif

syntax keyword clojureNiceOperator or conceal cchar=∨
syntax keyword clojureNiceOperator and conceal cchar=∧
syntax keyword clojureNiceOperator not conceal cchar=¬
syntax keyword clojureNiceOperator <= conceal cchar=≤
syntax keyword clojureNiceOperator >= conceal cchar=≥
syntax keyword clojureNiceOperator not= conceal cchar=≠
syntax keyword clojureNiceOperator + conceal cchar=Σ
syntax keyword clojureNiceOperator * conceal cchar=Π
syntax keyword clojureNiceOperator Math/sqrt conceal cchar=√
syntax keyword clojureNiceOperator Math/pi conceal cchar=π
syntax keyword clojureNiceOperator fn conceal cchar=λ

hi link lispNiceOperator Operator
hi! link Conceal Operator

setlocal conceallevel=1


" To get syntax highlighting and tab settings for gyp(i) files, add the
" following to your .vimrc file:
"     so /path/to/src/vim/filetypes.vim

augroup filetype
        au! BufRead,BufNewFile *.gyp    set filetype=python expandtab tabstop=2 shiftwidth=2
        au! BufRead,BufNewFile *.gypi   set filetype=python expandtab tabstop=2 shiftwidth=2
augroup END

Add vim filetype settings for DEPS.

" To get syntax highlighting and tab settings for gyp(i) and DEPS files,
" add the following to your .vimrc file:
"     so /path/to/src/tools/vim/filetypes.vim

augroup filetype
        au! BufRead,BufNewFile *.gyp    set filetype=python expandtab tabstop=2 shiftwidth=2
        au! BufRead,BufNewFile *.gypi   set filetype=python expandtab tabstop=2 shiftwidth=2
        au! BufRead,BufNewFile DEPS     set filetype=python expandtab tabstop=2 shiftwidth=2
augroup END


"
" Solarized8
" https://github.com/lifepillar/vim-solarized8
" NOTE: colorscheme must be set in after file
"

" Use terminal's base16 colors
" let g:solarized_use16 = 1

" Set terminal background to transparent
let g:solarized_termtrans = 1

" Enable italics
let g:solarized_term_italics = 1

" Possible fix for colors
" https://github.com/lifepillar/vim-solarized8#troubleshooting
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

Enable truecolor support for solarized8

"
" Solarized8
" https://github.com/lifepillar/vim-solarized8
" NOTE: colorscheme must be set in after file
"

" Use terminal's base16 colors
" let g:solarized_use16 = 1

" Set terminal background to transparent
let g:solarized_termtrans = 1

" Enable italics
let g:solarized_term_italics = 1

" Possible fix for colors
" https://github.com/lifepillar/vim-solarized8#troubleshooting
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

" Enable true color support
" https://gist.github.com/XVilka/8346728
set termguicolors


set background=dark

if has("gui_running")
  colorscheme wombat
else
  colorscheme wombat256mod
endif

" Use the same background color for signs as we do for line numbers. This
" makes signs and line numbers look like one nice big column.
hi! link SignColumn LineNr

" Use a more subtle color to highlight whitespace when using 'listchars'.
hi! SpecialKey gui=NONE guifg=#113245 guibg=#002b36

hi! ColorColumn ctermbg=black

" Use the same background colour everywhere, including non-text regions.
hi! Normal ctermbg=NONE
hi! NonText ctermbg=NONE

Remove background colours in GUI Vim

set background=dark

if has("gui_running")
  colorscheme wombat
else
  colorscheme wombat256mod
endif

" Use the same background color for signs as we do for line numbers. This
" makes signs and line numbers look like one nice big column.
hi! link SignColumn LineNr

" Use a more subtle color to highlight whitespace when using 'listchars'.
hi! SpecialKey gui=NONE guifg=#113245 guibg=#002b36

hi! ColorColumn guibg=black ctermbg=black

" Use the same background colour everywhere, including non-text regions.
hi! Normal guibg=NONE ctermbg=NONE
hi! NonText guibg=NONE ctermbg=NONE


" Enable spell checking.
setlocal spell

" Support YAML and TOML front matter syntax highlighting, via vim-markdown.
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_toml_frontmatter = 1

" If an H1 is used as a file heading, don't fold it, via vim-markdown.
let g:vim_markdown_folding_style_pythonic = 1

" Turn on vim-markdown plugin.
packadd vim-markdown

" Use a dictionary to lookup words.
if executable('dict')
  setlocal keywordprg=dict
  nnoremap <buffer> <silent> <s-k> :execute "split " . shellescape(&keywordprg) . "<bar> 0read !" . shellescape(&keywordprg) . " " . expand("<cword>")<bar> :Man!<CR>
endif

" vim:fdm=marker ft=vim et sts=2 sw=2

Disable custom dict help mapping

" Enable spell checking.
setlocal spell

" Support YAML and TOML front matter syntax highlighting, via vim-markdown.
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_toml_frontmatter = 1

" If an H1 is used as a file heading, don't fold it, via vim-markdown.
let g:vim_markdown_folding_style_pythonic = 1

" Turn on vim-markdown plugin.
packadd vim-markdown

" Use a dictionary to lookup words.
if executable('dict')
  setlocal keywordprg=dict
  " nnoremap <buffer> <silent> <S-k> :execute "split " . shellescape(&keywordprg) . "<bar> 0read !" . shellescape(&keywordprg) . " " . expand("<cword>")<bar> :Man!<CR>
endif

" vim:fdm=marker ft=vim et sts=2 sw=2


filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" Plugins {{{
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'kien/ctrlp.vim'
Plugin 'mattn/emmet-vim'
Plugin 'tpope/vim-surround'
Plugin 'xolox/vim-misc' "Needed for vim-notes
Plugin 'xolox/vim-notes'

" Make gvim-only colorschemes work transparently in terminal vim
Plugin 'godlygeek/csapprox'
" }}}
" Syntax {{{
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'jelera/vim-javascript-syntax'
" }}}
" Colorschemes {{{
Plugin 'tomasr/molokai'
Plugin 'altercation/vim-colors-solarized'
Plugin 'zefei/cake16'
Plugin 'vim-scripts/Wombat'
Plugin 'wombat256.vim'
" }}}

call vundle#end()

Remove color schemes from vundle config

filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" Plugins {{{
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'kien/ctrlp.vim'
Plugin 'mattn/emmet-vim'
Plugin 'tpope/vim-surround'
Plugin 'xolox/vim-misc' "Needed for vim-notes
Plugin 'xolox/vim-notes'

" Make gvim-only colorschemes work transparently in terminal vim
Plugin 'godlygeek/csapprox'
" }}}
" Syntax {{{
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'jelera/vim-javascript-syntax'
" }}}
" Colorschemes {{{
Plugin 'tomasr/molokai'
Plugin 'vim-scripts/Wombat'
Plugin 'wombat256.vim'
" }}}

call vundle#end()


let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': ['javascript'],'passive_filetypes': [] }
nnoremap <C-w>E :SyntasticCheck<CR> :SyntasticToggleMode<CR>

Add JSCS to javascript checkers.

let g:syntastic_javascript_checkers = ['eslint', 'jscs']
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': ['javascript'],'passive_filetypes': [] }
nnoremap <C-w>E :SyntasticCheck<CR> :SyntasticToggleMode<CR>


au BufNewFile,BufRead *requirements.{txt,in} set ft=requirements
au BufNewFile,BufRead *requirements/*.{txt,in} set ft=requirements

" vim: et sw=4 ts=4 sts=4:

Use regular expression at filetype detection

function! s:isRequirementsFile()
    let l:filename = expand("%:p")

    if l:filename =~# '\v.*requirements\.(txt|in)'
        return 1
    endif

    if l:filename =~# '\v.requirements/.*\.(txt|in)'
        return 1
    endif

    return 0
endfunction

au BufNewFile,BufRead *.{txt,in} if s:isRequirementsFile() | set ft=requirements

" vim: et sw=4 ts=4 sts=4:


let g:syntastic_always_populate_loc_list=0
let g:syntastic_auto_loc_list = 0
" let g:syntastic_loc_list_height=10
let g:syntastic_check_on_open = 0
" let g:syntastic_check_on_wq = 1
" let g:syntastic_quiet_messages = {'level': 'warnings'}
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
let g:syntastic_python_checkers=['prospector', 'flake8', 'pylint']
" let g:syntastic_quiet_messages = {'level': 'warnings'}
" let g:syntastic_python_<checker>_quiet_messages = {'level': 'warnings'}
let g:syntastic_python_flake8_args="--max-line-length=99"
" let g:syntastic_python_checkers_args=['flake8']
"
" let g:syntastic_javascript_checkers=['jshint', 'standard', 'jslint' ]
let g:syntastic_javascript_checkers = ['standard']

"
let g:syntastic_mode_map = { 'mode': 'active',
                               \ 'active_filetypes': ['c', 'python', 'ruby', 'php', 'javascript', 'java', 'jsx'],
                               \ 'passive_filetypes': [''] }

Add eslint to syntasitic config

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
" let g:syntastic_loc_list_height=10
let g:syntastic_check_on_open = 0
" let g:syntastic_check_on_wq = 1
" let g:syntastic_quiet_messages = {'level': 'warnings'}
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
let g:syntastic_python_checkers=['prospector', 'flake8', 'pylint']
" let g:syntastic_quiet_messages = {'level': 'warnings'}
" let g:syntastic_python_<checker>_quiet_messages = {'level': 'warnings'}
let g:syntastic_python_flake8_args="--max-line-length=99"
" let g:syntastic_python_checkers_args=['flake8']
"
" let g:syntastic_javascript_checkers=['jshint', 'standard', 'jslint' ]
let g:syntastic_javascript_checkers = ['eslint', 'standard']

"
let g:syntastic_mode_map = { 'mode': 'active',
                               \ 'active_filetypes': ['c', 'python', 'ruby', 'php', 'javascript', 'java', 'jsx'],
                               \ 'passive_filetypes': [''] }


set mouse=a
set number
set nowrap

" More natural splits
set splitright
set splitbelow

" Default indentation
set expandtab    " Use spaces
set shiftwidth=4 " Use 4 spaces
set tabstop=8    " Display tabs as 8 spaces
set shiftround   " Snap to multiples of shiftwidth when indenting

" Spell checking
set spelllang=en,sv
set spellfile=~/.config/nvim/spell/en.utf-8.add,~/.config/nvim/spell/sv.utf-8.add

" Searching
set ignorecase         " Case insensitive search
set smartcase          " When an upper case character is typed, make it strict
set inccommand=nosplit " Interactively show search-results when substituting

" Persist undo history between sessions
set undodir=~/.config/nvim/undo
set undofile

" Be totally case insensitive in command mode though.
"
" Lets you type :pl<Tab>i<Tab> to get :PlugInstall.
" This would otherwise insist on you capitalizing the I yourself since the P
" would be capitalized and turn the case insensitivity off.
augroup dynamic_smartcase
    autocmd!
    autocmd CmdLineEnter : set nosmartcase
    autocmd CmdLineLeave : set smartcase
augroup END

" :terminal settings
augroup terminal
    autocmd!

    autocmd TermOpen * setlocal nonumber
augroup END

Allow switching buffers without saving

set mouse=a
set number
set nowrap

" More natural splits
set splitright
set splitbelow

" Allow switching buffers without saving
set hidden

" Default indentation
set expandtab    " Use spaces
set shiftwidth=4 " Use 4 spaces
set tabstop=8    " Display tabs as 8 spaces
set shiftround   " Snap to multiples of shiftwidth when indenting

" Spell checking
set spelllang=en,sv
set spellfile=~/.config/nvim/spell/en.utf-8.add,~/.config/nvim/spell/sv.utf-8.add

" Searching
set ignorecase         " Case insensitive search
set smartcase          " When an upper case character is typed, make it strict
set inccommand=nosplit " Interactively show search-results when substituting

" Persist undo history between sessions
set undodir=~/.config/nvim/undo
set undofile

" Be totally case insensitive in command mode though.
"
" Lets you type :pl<Tab>i<Tab> to get :PlugInstall.
" This would otherwise insist on you capitalizing the I yourself since the P
" would be capitalized and turn the case insensitivity off.
augroup dynamic_smartcase
    autocmd!
    autocmd CmdLineEnter : set nosmartcase
    autocmd CmdLineLeave : set smartcase
augroup END

" :terminal settings
augroup terminal
    autocmd!

    autocmd TermOpen * setlocal nonumber
augroup END


set mouse=a
syntax on
filetype plugin indent on

" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo

" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0

" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline

" More natural split opening
set splitbelow splitright

map Q gq

Add folder location for swap files

set mouse=a
syntax on
filetype plugin indent on

" Set cache folder
set directory=$XDG_CACHE_HOME/nvim/swap

" Set persistent history in cache folder
set undofile
set undodir=$XDG_CACHE_HOME/nvim/undo

" Some nice colors for right margin and current line
set colorcolumn=81 cursorline
highlight ColorColumn ctermbg=0
highlight CursorLine cterm=NONE ctermbg=0

" Better identation and search options
set autoindent smartindent
set incsearch hlsearch ignorecase smartcase
set ruler showcmd title showmode modeline

" More natural split opening
set splitbelow splitright

map Q gq


" Vim syntax file

if exists("b:current_syntax")
  finish
endif

syn match Ignore /\s\[[0-9]\{3,}\]$/
syn match Comment /^\s*Comment.*$/
syn region Constant start="\[http" end="\]"
syn region Statement start="^\s+ " end="^\s "

let b:current_syntax = "hackernews"

Improve syntax highlighting of main page

" Vim syntax file

if exists("b:current_syntax")
  finish
endif

" Hide hacker news item id at end of main page lines
syn match Ignore /\s\[[0-9]\{3,}\]$/

" Remove emphesis from all components of main page item except title
syn match Comment /^\s*[0-9]\{1,2}\.\s/
syn match Comment /\s(.*\..*)/
syn match Comment /^.*ago\s|.*comments/

" Comment titles
syn match Comment /^\s*Comment.*$/

" Highlight links
syn region Constant start="\[http" end="\]"

" Highlight code blocks
syn region Statement start="^\s+ " end="^\s "

let b:current_syntax = "hackernews"


" JAVASCRIPT

let javascript_enable_domhtmlcss = 1
let g:javascript_conceal = 1

Add support for es6 in vim-node

" JAVASCRIPT

let javascript_enable_domhtmlcss = 1
let g:javascript_conceal = 1

" use Node navigation for ES6
autocmd User Node setlocal suffixesadd+=.es,.es6,.jsx


" ==========================================
" Syntastic settings

let g:syntastic_javascript_syntax_checker = "jshint"
let g:syntastic_coffee_coffeelint_args = "--csv --file $HOME/.coffeelint.json"
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
let g:syntastic_ruby_rubocop_exec = "$RBENV_ROOT/shims/ruby $RBENV_ROOT/shims/rubocop"
let g:syntastic_check_on_open = 0
let g:syntastic_scss_checkers = ['scss_lint']

Remove rbenv configuration for rubocop

" ==========================================
" Syntastic settings

let g:syntastic_javascript_syntax_checker = "jshint"
let g:syntastic_coffee_coffeelint_args = "--csv --file $HOME/.coffeelint.json"
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
let g:syntastic_check_on_open = 0
let g:syntastic_scss_checkers = ['scss_lint']


" FUGITIVE:
" --------
" Autodelete fugitive buffers
autocmd BufReadPost fugitive://* set bufhidden=delete

" MAPPINGS:
nnoremap <Leader>gs :Git<CR>
nnoremap <Leader>gd :Gdiffsplit<CR>

" Gitlab
let g:fugitive_gitlab_domains = ['https://gitlab.ravenpack.com']

Add keybindings for git push/log

" FUGITIVE:
" --------
" Autodelete fugitive buffers
autocmd BufReadPost fugitive://* set bufhidden=delete

" MAPPINGS:
nnoremap <Leader>gs :Git<CR>
nnoremap <Leader>gd :Gdiffsplit<CR>
nnoremap <Leader>gp :Gpush<CR>
nnoremap <Leader>gl :Glog<CR>

" Gitlab
let g:fugitive_gitlab_domains = ['https://gitlab.ravenpack.com']


" --------------------------------
"  Function(s)
" --------------------------------
function! VimBootstrapUpdate()
   let langs = join(split(g:vim_bootstrap_langs, ","), "\\&langs=")
   let editor = g:vim_bootstrap_editor
   let path = $MYVIMRC
   let data = 'langs='.langs.'\&editor='.editor
   exec 'silent !\curl -fLso '.path.' http://vim-bootstrap.com/generate.vim --data '.data | redr!
   echo path." sucesfully updated! "
endfunction

" --------------------------------
"  Expose our commands to the user
" --------------------------------
command! VimBootstrapUpdate call VimBootstrapUpdate()

Fix exec curl (potentially related to fish)

" --------------------------------
"  Function(s)
" --------------------------------
function! VimBootstrapUpdate()
   let langs = join(split(g:vim_bootstrap_langs, ","), "\\&langs=")
   let editor = g:vim_bootstrap_editor
   let path = $MYVIMRC
   let data = 'langs='.langs.'\&editor='.editor
   silent exec '!curl -fLso '.path.' http://vim-bootstrap.com/generate.vim --data '.data | redr!
   echo path." sucesfully updated! "
endfunction

" --------------------------------
"  Expose our commands to the user
" --------------------------------
command! VimBootstrapUpdate call VimBootstrapUpdate()


" Hide ignored files from CtrlP.
let g:ctrlp_user_command = {
  \ 'types': {
    \ 1: ['.git', 'cd %s && git ls-files --cached --exclude-standard --others'],
    \ 2: ['.hg', 'hg --cwd %s locate -I .'],
    \ },
  \ 'fallback': 'find %s -type f'
  \ }

" Use `fd` as a fallback if available (faster and supports 'ignore' files).
if executable('fd')
  let g:ctrlp_user_command['fallback'] = 'fd --type f --color never . %s'
endif

" Disable caching in CtrlP.
let g:ctrlp_use_caching = 0

Tweak CtrlP config, include hidden files with "fd"

" Hide ignored files from CtrlP.
let g:ctrlp_user_command = {
  \ 'types': {
    \ 1: ['.git', 'cd %s && git ls-files --cached --exclude-standard --others'],
    \ 2: ['.hg', 'hg --cwd %s locate -I .'],
    \ },
  \ 'fallback': 'find %s -type f'
  \ }

" Use `fd` as a fallback if available (faster and supports 'ignore' files).
if executable('fd')
  let g:ctrlp_user_command['fallback'] = 'fd --type f --hidden --color never . %s'
endif

" Disable caching in CtrlP.
let g:ctrlp_use_caching = 0


" Set indentation
set ts=2 sw=2

" Write and close quickly
nmap <Leader>wq :wq<Cr>

" Clean up search highlights
nmap <C-l> :noh<Cr>

" Set default theme
colorscheme pablo

" Send all yanking/deleting ops to clipboard
set clipboard=unnamedplus

Update vim to use syntastic and flow locals

" Set indentation
set ts=2 sw=2

" Write and close quickly
nmap <Leader>wq :wq<Cr>

" Clean up search highlights
nmap <C-n> :noh<Cr>

" Set default theme
colorscheme pablo

" Send all yanking/deleting ops to clipboard
set clipboard=unnamedplus

" Move a line of a text using Ctrl+[jk]
nmap <C-j> mz:m+<cr>`z
nmap <C-k> mz:m-2<cr>`z

" Syntastic
let g:syntastic_javascript_checkers = ['eslint', 'jshint']
" Prefer local executable
let g:flow#flowpath = exec('$(npm bin)/eslint')

" Show line numbers
set number

" Enable JSX for all js
let g:jsx_ext_required = 0

" Set up flow
let g:flow#flowpath = exec('$(npm bin)/flow')
if executable(g:flow#flowpath)
  let g:flow#enable = 1
else
  let g:flow#enable = 0
endif


call plug#begin('~/.vim/plugged')

"My color scheme
Plug 'agude/eldar.vim'
"VimCompletesMe
Plug 'ajh17/VimCompletesMe'
"Surround
Plug 'tpope/vim-surround'
"Repeat (lets you use . with surround)
Plug 'tpope/vim-repeat'
"Vimwiki
Plug 'vimwiki/vimwiki'
"Tagbar
Plug 'majutsushi/tagbar'
"ctrlp
Plug 'ctrlpvim/ctrlp.vim'
"Python Syntax Highlighting
Plug 'hdima/python-syntax'
"Git support
Plug 'tpope/vim-fugitive'
" Better Diffing using git 1.8
Plug 'chrisbra/vim-diff-enhanced'
" PEP8 compliant indenting
Plug 'hynek/vim-python-pep8-indent'

call plug#end()

Add Deoplete and Jedi for Neovim

call plug#begin('~/.vim/plugged')

"My color scheme
Plug 'agude/eldar.vim'
"VimCompletesMe
Plug 'ajh17/VimCompletesMe'
"Surround
Plug 'tpope/vim-surround'
"Repeat (lets you use . with surround)
Plug 'tpope/vim-repeat'
"Vimwiki
Plug 'vimwiki/vimwiki'
"Tagbar
Plug 'majutsushi/tagbar'
"ctrlp
Plug 'ctrlpvim/ctrlp.vim'
"Python Syntax Highlighting
Plug 'hdima/python-syntax'
"Git support
Plug 'tpope/vim-fugitive'
" Better Diffing using git 1.8
Plug 'chrisbra/vim-diff-enhanced'
" PEP8 compliant indenting
Plug 'hynek/vim-python-pep8-indent'

" Neovim only

if has("nvim")
    " Autocomplete
    function! DoRemote(arg)
        UpdateRemotePlugins
    endfunction
    Plug 'Shougo/deoplete.nvim', { 'do': function('DoRemote') }
    " Jedi autocomplete
    Plug 'zchee/deoplete-jedi'
endif

call plug#end()


lang en_US.UTF-8

set noshowmode
set nohlsearch
set hidden
set noerrorbells
set nu
set tabstop=2 softtabstop=2
set shiftwidth=2
set expandtab
set smartindent
set nowrap
set noswapfile
set nobackup
set nowritebackup
set undodir=~/.vim/undodir
set undofile
set incsearch
set scrolloff=6
set colorcolumn=80,120
set signcolumn=yes
set cmdheight=2
set updatetime=300
set shortmess+=c
set mouse=a
set termguicolors

au BufRead,BufNewFile *.transit setfiletype ruby
au BufRead,BufNewFile *.yml set filetype yaml

Remove not needed YAML format assignment


setlocal spell

highlight htmlItalic cterm=italic
highlight htmlBold cterm=bold

" Highlight words to avoid in tech writing
" http://css-tricks.com/words-avoid-educational-writing/
" https://github.com/pengwynn/dotfiles
highlight TechWordsToAvoid ctermbg=red ctermfg=white
function! MatchTechWordsToAvoid()
  match TechWordsToAvoid /\c\(obviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however\|so,\|easy\)/
endfunction
call MatchTechWordsToAvoid()
autocmd BufWinEnter *.md call MatchTechWordsToAvoid()
autocmd InsertEnter *.md call MatchTechWordsToAvoid()
autocmd InsertLeave *.md call MatchTechWordsToAvoid()
autocmd BufWinLeave *.md call clearmatches()
command! -nargs=* Wrap set wrap linebreak nolist

" en and em dashes
inoremap <buffer> --<space> –
inoremap <buffer> ---<space> —

Add word completion, en_us as default.

setlocal spell spelllang=en_us
set complete+=kspell

highlight htmlItalic cterm=italic
highlight htmlBold cterm=bold

" Highlight words to avoid in tech writing
" http://css-tricks.com/words-avoid-educational-writing/
" https://github.com/pengwynn/dotfiles
highlight TechWordsToAvoid ctermbg=red ctermfg=white
function! MatchTechWordsToAvoid()
  match TechWordsToAvoid /\c\(obviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however\|so,\|easy\)/
endfunction
call MatchTechWordsToAvoid()
autocmd BufWinEnter *.md call MatchTechWordsToAvoid()
autocmd InsertEnter *.md call MatchTechWordsToAvoid()
autocmd InsertLeave *.md call MatchTechWordsToAvoid()
autocmd BufWinLeave *.md call clearmatches()
command! -nargs=* Wrap set wrap linebreak nolist

" en and em dashes
inoremap <buffer> --<space> –
inoremap <buffer> ---<space> —


" Automatically wrap at 72 characters and spell check commit messages
setlocal textwidth=72
setlocal spell

command! -nargs=1 -buffer Jira :normal i[<args>](https://transfix.atlassian.net/browse/<args>)<ESC>

Update `:Jira` command with default ticket

" Automatically wrap at 72 characters and spell check commit messages
setlocal textwidth=72
setlocal spell

function! s:JiraMarkdownLink(...)
  if a:0 == 0  " No args provided, use git branch name
    let l:ticket_num = fugitive#Head()
  else  " Ticket number is passed as only argument
    let l:ticket_num = a:1
  endif

  return "[" . l:ticket_num . "](https://transfix.atlassian.net/browse/" . l:ticket_num . ")"
endfunction

command! -nargs=? -buffer Jira :normal "=s:JiraMarkdownLink(<f-args>)<C-M>p


" Copyright (c) 2011 Rob Hoelz
"
" Permission is hereby granted, free of charge, to any person obtaining a copy of
" this software and associated documentation files (the "Software"), to deal in the
" Software without restriction, including without limitation the rights to use, copy,
" modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
" and to permit persons to whom the Software is furnished to do so, subject to the
" following conditions:
"
" The above copyright notice and this permission notice shall be included in all
" copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
" FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

if ! has('lua')
    echomsg 'This plugin requires Lua support'
    finish
endif

let s:script_path = expand('<sfile>:r') . '.lua'
execute 'luafile ' . s:script_path

Load helper Lua script with require

" Copyright (c) 2011 Rob Hoelz
"
" Permission is hereby granted, free of charge, to any person obtaining a copy of
" this software and associated documentation files (the "Software"), to deal in the
" Software without restriction, including without limitation the rights to use, copy,
" modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
" and to permit persons to whom the Software is furnished to do so, subject to the
" following conditions:
"
" The above copyright notice and this permission notice shall be included in all
" copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
" FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
" COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

if ! has('lua')
    echomsg 'This plugin requires Lua support'
    finish
endif

lua << LUA
oldpath      = package.path
package.path = vim.eval('expand("<sfile>:h")') .. '/?.lua'
require 'lua-bridge'
package.path = oldpath
LUA


" vim-markdown
let g:markdown_fenced_languages = [
      \ 'objc',
      \ 'ruby',
      \ 'sh',
      \ 'swift',
      \ 'vim',
      \ 'yaml'
    \ ]

" vim-sort-motion
let g:sort_motion_flags = 'ui'

" vim-gnupg
let g:GPGDefaultRecipients = ['0x4C7167F8']
let g:GPGPreferArmor = 1

let g:Illuminate_delay = 200
highlight illuminatedWord ctermbg=white ctermfg=black

" Netrw
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_list_hide =
      \ netrw_gitignore#Hide()
      \ . ',^\./'
      \ . ',^\.git/'

let g:highlightedyank_highlight_duration = 150

nnoremap <silent> <C-W>z :call zoom#toggle()<CR>

let g:gutentags_file_list_command = 'rg --files'
let g:gutentags_exclude_filetypes = ['gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git']

let g:tmux_navigator_disable_when_zoomed = 1

Revert "Remove outdated autoformat config"

" vim-markdown
let g:markdown_fenced_languages = [
      \ 'objc',
      \ 'ruby',
      \ 'sh',
      \ 'swift',
      \ 'vim',
      \ 'yaml'
    \ ]

" vim-sort-motion
let g:sort_motion_flags = 'ui'

" vim-gnupg
let g:GPGDefaultRecipients = ['0x4C7167F8']
let g:GPGPreferArmor = 1

let g:Illuminate_delay = 200
highlight illuminatedWord ctermbg=white ctermfg=black

" Netrw
let g:netrw_banner = 0
let g:netrw_liststyle = 3
let g:netrw_list_hide =
      \ netrw_gitignore#Hide()
      \ . ',^\./'
      \ . ',^\.git/'

let g:highlightedyank_highlight_duration = 150

nnoremap <silent> <C-W>z :call zoom#toggle()<CR>

let g:gutentags_file_list_command = 'rg --files'
let g:gutentags_exclude_filetypes = ['gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git']

let g:tmux_navigator_disable_when_zoomed = 1

let g:formatdef_buildifierbzl = "'buildifier -type bzl'"
let g:formatdef_buildifierbuild = "'buildifier -type build'"
let g:formatdef_buildifierworkspace = "'buildifier -type workspace'"


" jj in Insert mode issues an <ESC>
inoremap jj <ESC>

"Likewise, in normal mode, drop into insert mode
" nnoremap <C-@> a

"Ctrt-w closes current buffer, without saving
"nnoremap <C-w> :bd!<CR>
"imap <C-w> <ESC><C-w><CR>

"Rather than use Ctrl-W-CtrW to move around, use Ctrl-`
"noremap <C-`> <C-w>

CHange mapleader & add comment short cuts

" leader-> ' '
let mapleader = ' '

" jj in Insert mode issues an <ESC>
inoremap jj <ESC>

"Likewise, in normal mode, drop into insert mode
" nnoremap <C-@> a

"Ctrt-w closes current buffer, without saving
"nnoremap <C-w> :bd!<CR>
"imap <C-w> <ESC><C-w><CR>

"Rather than use Ctrl-W-CtrW to move around, use Ctrl-`
"noremap <C-`> <C-w>
"
"
"

"in go FileType, <leader>-b and r run build and go-build and go-run
autocmd FileType go nmap <leader>b  <Plug>(go-build)
autocmd FileType go nmap <leader>r  <Plug>(go-run)
"Ctl-n and Ctl-m do next and prev error
map <C-n> :cnext<CR>
map <C-m> :cprevious<CR>
nnoremap <leader>a :cclose<CR>


colorscheme solarized

set ruler
set showcmd
set incsearch
set laststatus=2
syntax on

set virtualedit=""

let AutoCloseOn = 0

set foldmethod=manual

set visualbell

let g:ale_ruby_rubocop_executable="./bin/rubocop"

Stop using binstub version of rubocop


" ============================================================================
" FILE: kotemplate.vim
" AUTHOR: koturn <jeak.koutan.apple@gmail.com>
" DESCRIPTION: {{{
" koturn's template loader.
" alti.vim: https://github.com/LeafCage/alti.vim
" }}}
" ============================================================================
let s:save_cpo = &cpo
set cpo&vim

let s:define = {
      \ 'enter': 'alti#kotemplate#enter',
      \ 'cmpl': 'alti#kotemplate#cmpl',
      \ 'prompt': 'alti#kotemplate#prompt',
      \ 'submitted': 'alti#kotemplate#submitted'
      \}

function! alti#kotemplate#define() abort
  return s:define
endfunction

function! alti#kotemplate#enter() abort dict
  let self.candidates = kotemplate#complete_load('', '', 0)
endfunction

function! alti#kotemplate#cmpl(context) abort dict
  let arglead = tolower(a:context.arglead)
  return filter(copy(self.candidates), '!stridx(tolower(v:val), arglead)')
endfunction

function! alti#kotemplate#prompt(context) abort
  return 'KoTemplate> '
endfunction

function! alti#kotemplate#submitted(context, line) abort
  call kotemplate#load(a:context.inputs[0])
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

Use fuzzy filtering and fix action on submitted

" ============================================================================
" FILE: kotemplate.vim
" AUTHOR: koturn <jeak.koutan.apple@gmail.com>
" DESCRIPTION: {{{
" koturn's template loader.
" alti.vim: https://github.com/LeafCage/alti.vim
" }}}
" ============================================================================
let s:save_cpo = &cpo
set cpo&vim

let s:define = {
      \ 'name': 'kotemplate'
      \ 'enter': 'alti#kotemplate#enter',
      \ 'cmpl': 'alti#kotemplate#cmpl',
      \ 'prompt': 'alti#kotemplate#prompt',
      \ 'submitted': 'alti#kotemplate#submitted'
      \}

function! alti#kotemplate#define() abort
  return s:define
endfunction

function! alti#kotemplate#enter() abort dict
  let self.candidates = kotemplate#complete_load('', '', 0)
endfunction

function! alti#kotemplate#cmpl(context) abort dict
  return a:context.fuzzy_filtered(self.candidates)
endfunction

function! alti#kotemplate#prompt(context) abort
  return 'KoTemplate> '
endfunction

function! alti#kotemplate#submitted(context, line) abort
  call kotemplate#load(a:context.selection)
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo


" Syntax Highlighting
try
  if match($TERM, '256') >=  0
    set t_Co=256
    let g:rehash256=1
    colorscheme molokai
  else
    colorscheme ir_black
  endif
catch
  silent !echo 'colorscheme not found'
endtry

" Switch syntax highlighting on, when the terminal has colors
if &t_Co > 2 || has('gui_running')
  syntax on
endif

set laststatus=2
" let g:lightline = { 'colorscheme': 'seoul256', }

Add gui_running option to setup colorscheme

" Syntax Highlighting
try
  if match($TERM, '256') >= 0 || has('gui_running')
    set t_Co=256
    let g:rehash256=1
    colorscheme molokai
  else
    colorscheme ir_black
  endif
catch
  silent !echo 'colorscheme not found'
endtry

" Switch syntax highlighting on, when the terminal has colors
if &t_Co > 2 || has('gui_running')
  syntax on
endif

set laststatus=2
" let g:lightline = { 'colorscheme': 'seoul256', }


" Quit NERDTree when a file is opened
let NERDTreeQuitOnOpen = 1
let NERDTreeShowHidden = 1

" Binds
map <leader>t :NERDTreeToggle<CR>

Set nerdtree win pos to right

" Quit NERDTree when a file is opened
let NERDTreeQuitOnOpen = 1
let NERDTreeShowHidden = 1
let NERDTreeWinPos = "right"

" Binds
map <leader>t :NERDTreeToggle<CR>


" remap RepeatUndo so it doesn't clobber <C-r> by default
nmap <C-u>    <Plug>(RepeatRedo)

Fix redo mapping that unexpecedtly broke

" remap RepeatUndo so it doesn't clobber <C-r> by default
"
" FIXME: <Plug>(RepeatRedo) does not register by default? The fix is to directly
"        call the mapping from vim-repeat.vim
"
nnoremap <c-u>    :<C-u>call repeat#wrap("\<lt>C-R>",v:count)<cr>


" ========================================
" Vim plugin configuration
" ========================================
"
" Filetype off is required by plug
filetype off

call plug#begin('~/.yadr/vim/plugged')

if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  Plug 'zchee/deoplete-go', { 'do': 'make' }
  Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' }
  Plug 'dracula/vim', { 'as': 'dracula' }
  Plug 'wannesm/wmgraphviz.vim'
  Plug 'ap/vim-css-color'
  Plug 'artur-shaik/vim-javacomplete2'
  Plug 'airblade/vim-rooter'
  Plug 'chr4/nginx.vim'
  Plug 'adamclerk/vim-razor'
endif

call plug#end()

"Filetype plugin indent on is required by plug
filetype plugin indent on

let vimsettings = '~/.vim/plug_settings'
for fpath in split(globpath(vimsettings, '*.vim'), '\n')
  " exe 'source' fpath
endfor

Use less (CSS) plugin for vim

" ========================================
" Vim plugin configuration
" ========================================
"
" Filetype off is required by plug
filetype off

call plug#begin('~/.yadr/vim/plugged')

if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  Plug 'zchee/deoplete-go', { 'do': 'make' }
  Plug 'nsf/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' }
  Plug 'dracula/vim', { 'as': 'dracula' }
  Plug 'wannesm/wmgraphviz.vim'
  Plug 'ap/vim-css-color'
  Plug 'artur-shaik/vim-javacomplete2'
  Plug 'airblade/vim-rooter'
  Plug 'chr4/nginx.vim'
  Plug 'adamclerk/vim-razor'
  Plug 'groenewege/vim-less'
endif

call plug#end()

"Filetype plugin indent on is required by plug
filetype plugin indent on

let vimsettings = '~/.vim/plug_settings'
for fpath in split(globpath(vimsettings, '*.vim'), '\n')
  " exe 'source' fpath
endfor


"" Wrapping
set textwidth=79                " Set wrap width to 79 characters

"" Whitespace
set tabstop=4                   " Set literal tab width and display
set softtabstop=4               " Set tab width for insertion and <BS>
set shiftwidth=4                " Set CTRL-T, > (add indent) & CTRL-D, < (remove indent) widths
set expandtab                   " Ensure tabs are expanded to spaces

Increase Python line lengths to 99

"" Wrapping
set textwidth=99                " Set wrap width to 99 characters

"" Whitespace
set tabstop=4                   " Set literal tab width and display
set softtabstop=4               " Set tab width for insertion and <BS>
set shiftwidth=4                " Set CTRL-T, > (add indent) & CTRL-D, < (remove indent) widths
set expandtab                   " Ensure tabs are expanded to spaces


" unmaps
map Q <Nop>
map K <Nop>

" command mode with space
nmap <space> :
map <space> :

" leader commands

" navigation
nmap <leader>p <C-p>
nmap <leader><leader> <C-^>
nmap <leader>w :w<cr>
nmap <leader>q @q
nmap <leader>x :wq<cr>
nmap <leader>c :!

" split navkgation
nmap <leader>s <C-w>w
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l

nmap <leader>t :w<cr>:! rake test<cr>

" ==================== Plugins ====================

nmap <leader>fw :FixWhitespace<cr>
vmap <enter> <plug>(EasyAlign)
nmap <leader>m :NERDTree<cr>
nmap <leader>M :NERDTreeFind<cr>

" Git
nmap <leader>ga :Gwrite<cr>
nmap <leader>gc :Gcommit<cr>
nmap <leader>gac :Gwrite<cr>:Gcommit -m ""<left>
nmap <leader>gp :Git push<cr>
nmap <leader>gb :Gbrowse<cr>

Remove ,x, use ZZ instead

" unmaps
map Q <Nop>
map K <Nop>

" command mode with space
nmap <space> :
map <space> :

" leader commands

" navigation
nmap <leader>p <C-p>
nmap <leader><leader> <C-^>
nmap <leader>w :w<cr>
nmap <leader>q @q
nmap <leader>c :!

" split navkgation
nmap <leader>s <C-w>w
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l

nmap <leader>t :w<cr>:! rake test<cr>

" ==================== Plugins ====================

nmap <leader>fw :FixWhitespace<cr>
vmap <enter> <plug>(EasyAlign)
nmap <leader>m :NERDTree<cr>
nmap <leader>M :NERDTreeFind<cr>

" Git
nmap <leader>ga :Gwrite<cr>
nmap <leader>gc :Gcommit<cr>
nmap <leader>gac :Gwrite<cr>:Gcommit -m ""<left>
nmap <leader>gp :Git push<cr>
nmap <leader>gb :Gbrowse<cr>


" Enable true color mode.
set termguicolors

" Disable visual bell.
set visualbell t_vb=

" Set focus to follow mouse.
set mousefocus

" Set right mouse button action.
set mousemodel=extend

" Set font.
if exists('GuiFont')
  GuiFont Inconsolata-g for Powerline:h12
endif

" Set color scheme and vim-airline theme dynamically.
let g:zenburn_high_Contrast = 1
let g:airline_theme = 'one'
set background=dark
colorscheme one

" Set nvim-gtk settings.
if exists('g:GtkGuiLoaded')
  call rpcnotify(1, 'Gui', 'Font', 'Fira Code 13')
  call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)
  call rpcnotify(1, 'Gui', 'Option', 'Popupmenu', 0)
endif

Update Gui options for nvim-qt

" Enable true color mode.
set termguicolors

" Disable visual bell.
set visualbell t_vb=

" Set focus to follow mouse.
set mousefocus

" Set right mouse button action.
set mousemodel=extend

if exists(':GuiFont')
  GuiFont! Fira Code:h13
endif

if exists(':GuiRenderLigatures')
  GuiRenderLigatures 1
endif

if exists(':GuiTabline')
  GuiTabline 0
endif

if exists(':GuiPopupmenu')
  GuiPopupmenu 0
endif

if exists(':GuiScrollBar')
  GuiScrollBar 1
endif

" Set color scheme and vim-airline theme dynamically.
let g:zenburn_high_Contrast = 1
let g:airline_theme = 'one'
set background=dark
colorscheme one

" Set nvim-gtk settings.
if exists('g:GtkGuiLoaded')
  call rpcnotify(1, 'Gui', 'Font', 'Fira Code 13')
  call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)
  call rpcnotify(1, 'Gui', 'Option', 'Popupmenu', 0)
endif


au BufRead,BufNewFile *.myr set ft=myr

Update error format to recognize new mbld output.

au BufRead,BufNewFile *.myr
            \ set ft=myr |
            \ set errorformat=%f:%l:\ %m,%D%f/%[a-z]%#...,%Dproject\ base\ %f:


set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
syntax on

set nomore

setfiletype tex

call vimtex#test#keys('02f+d2ac',
      \ ['a + \bar{\mathit{c + d}} ='],
      \ ['a +  ='])

call vimtex#test#keys('fdd2ad',
      \ ['a + \left(b + \left[c + d \right] + e\right) + f'],
      \ ['a +  + f'])

call vimtex#test#keys('f\dac',
      \ ['a + \test[opt1][opt2]{arg} + f'],
      \ ['a +  + f'])

quit!

Add failing test for ac/ic objects

set nocompatible
let &rtp = '../..,' . &rtp
filetype plugin on
syntax on

set nomore

setfiletype tex

call vimtex#test#keys('02f+d2ac',
      \ ['a + \bar{\mathit{c + d}} ='],
      \ ['a +  ='])

call vimtex#test#keys('fdd2ad',
      \ ['a + \left(b + \left[c + d \right] + e\right) + f'],
      \ ['a +  + f'])

call vimtex#test#keys('f\dac',
      \ ['a + \test[opt1][opt2]{arg} + f'],
      \ ['a +  + f'])

call vimtex#test#keys('f\dac',
      \ ['a + \; f'],
      \ ['a +  f'])

quit!


" let g:ctrlp_map = '<c-p>'
" unmap <c-b>

set relativenumber
set number

set background=dark
colorscheme solarized

set ts=3 sw=3 et
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1

Change color to light background and fix color settings for certain terminal emulators.

set t_Co=16

" let g:ctrlp_map = '<c-p>'
" unmap <c-b>

set relativenumber
set number

set background=light
colorscheme solarized

set ts=3 sw=3 et
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1


" gVim needs a powerline font
if has("gui_macvim")
   set guifont=Ubuntu\ Mono\ Nerd\ Font\ Complete\ Mono:h15
else
   set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 12
endif

set cursorline       " highlight current line
set number           " show line numbers on left hand side
set numberwidth=5    " set the size of the number column
set showmode         " display mode

" output
set lazyredraw    " do not update screen during macros

" disable cursor blink in command mode, set insert blink rate
set guicursor+=n-v-c:blinkon0
set guicursor+=i-ci:ver25-Cursor/lCursor-blinkwait750-blinkoff250-blinkon750

" folding
set foldenable          " enable folding
set foldlevelstart=10   " open most folds
set foldnestmax=10      " 10 nested fold max

" window splits
set splitbelow    " new split on bottom
set splitright    " new vsplit on right

" command line
set showcmd       " display incomplete commands
set wildmenu      " visual autocomplete for command menu

Disable cursorline highlighting for performance

" gVim needs a powerline font
if has("gui_macvim")
   set guifont=Ubuntu\ Mono\ Nerd\ Font\ Complete\ Mono:h15
else
   set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 12
endif

set nocursorline     " do not highlight current line (navigation is very slow when enabled)
set number           " show line numbers on left hand side
set numberwidth=5    " set the size of the number column
set showmode         " display mode

" output
set lazyredraw    " do not update screen during macros

" disable cursor blink in command mode, set insert blink rate
set guicursor+=n-v-c:blinkon0
set guicursor+=i-ci:ver25-Cursor/lCursor-blinkwait750-blinkoff250-blinkon750

" folding
set foldenable          " enable folding
set foldlevelstart=10   " open most folds
set foldnestmax=10      " 10 nested fold max

" window splits
set splitbelow    " new split on bottom
set splitright    " new vsplit on right

" command line
set showcmd       " display incomplete commands
set wildmenu      " visual autocomplete for command menu


augroup filetypedetect
    au BufRead,BufNewFile *.tmux set filetype=tmux
    au BufRead,BufNewFile *.ssh set filetype=sshconfig
augroup END

Use the desired nvim colours more

augroup filetypedetect
    au BufRead,BufNewFile *.tmux set filetype=tmux
    au BufRead,BufNewFile *.ssh set filetype=sshconfig
    au BufRead,BufNewFile *.git set filetype=gitconfig
augroup END


com! -nargs=1 -complete=dir DeployEclimd call s:deploy_eclimd(<f-args>)

function! s:deploy_eclimd(eclipsePath)
  let l:eclim_d = '/tmp/eclim'
  let l:eclipse_d = resolve(getcwd() . '/' . a:eclipsePath)
  let l:vim_d = '/tmp/vim-eclim'

  if ! executable('git')
    echom 'Please install git first.'
    return
  endif

  if ! filereadable(l:eclipse_d . '/eclipse.ini') &&
        \ ! filereadable(expand(a:eclipsePath) . '/eclipse.ini')
    echom 'Eclipse path invalid.'
    echom 'Please specify the directory that contains eclipse.ini.'
    return
  endif

  " download code, build and then remove
  execute 'silent !git clone https://github.com/ervandew/eclim.git ' . l:eclim_d
  execute 'cd ' . l:eclim_d

  " always checkout last release to build from
  let l:last_tag = split(system('git tag'), '\n')[-1]
  execute 'silent !git checkout ' . l:last_tag
  execute 'silent !ant -Dvim.files=' . l:vim_d ' -Declipse.home=' . l:eclipse_d
  execute 'cd -'
  execute 'silent !rm -rf ' . l:eclim_d . ' ' . l:vim_d
endfunction

" vim: sw=2 ts=2 sts=2

Add warning about ant command

com! -nargs=1 -complete=dir DeployEclimd call s:deploy_eclimd(<f-args>)

function! s:deploy_eclimd(eclipsePath)
  let l:eclim_d = '/tmp/eclim'
  let l:eclipse_d = resolve(getcwd() . '/' . a:eclipsePath)
  let l:vim_d = '/tmp/vim-eclim'

  if ! executable('git') || ! executable('ant')
    echom 'Please make sure you have git and ant installed.'
    return
  endif

  if ! filereadable(l:eclipse_d . '/eclipse.ini') &&
        \ ! filereadable(expand(a:eclipsePath) . '/eclipse.ini')
    echom 'Eclipse path invalid.'
    echom 'Please specify the directory that contains eclipse.ini.'
    return
  endif

  " download code, build and then remove
  execute 'silent !git clone https://github.com/ervandew/eclim.git ' . l:eclim_d
  execute 'cd ' . l:eclim_d

  " always checkout last release to build from
  let l:last_tag = split(system('git tag'), '\n')[-1]
  execute 'silent !git checkout ' . l:last_tag
  execute 'silent !ant -Dvim.files=' . l:vim_d ' -Declipse.home=' . l:eclipse_d
  execute 'cd -'
  execute 'silent !rm -rf ' . l:eclim_d . ' ' . l:vim_d
endfunction

" vim: sw=2 ts=2 sts=2


filetype off

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'

" My plugins
Bundle 'tpope/vim-endwise'
Bundle 'scrooloose/nerdcommenter'
Bundle 'vim-ruby/vim-ruby'
Bundle 'godlygeek/tabular'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-fugitive'
Bundle 'jgdavey/vim-turbux'
Bundle 'jgdavey/tslime.vim'
Bundle 'rking/ag.vim'
Bundle 'ctrlpvim/ctrlp.vim'
" Bundle 'bling/vim-bufferline'
" Bundle 'fatih/vim-go'
" Bundle 'rust-lang/rust.vim'
" Bundle 'scrooloose/nerdtree'

" Color Schemes
Bundle 'wesgibbs/vim-irblack'
" Bundle 'altercation/vim-colors-solarized'
" Bundle 'zeis/vim-kolor'
" Bundle 'morhetz/gruvbox'

" Vim Powerline
" Bundle 'vim-airline/vim-airline'

" JavaScript, HTML
Bundle 'pangloss/vim-javascript'
Bundle 'othree/html5-syntax.vim'
Bundle 'othree/html5.vim'
Bundle 'kchmck/vim-coffee-script'

Install vim plugins for typescript and elixir syntax

filetype off

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'

" My plugins
Bundle 'tpope/vim-endwise'
Bundle 'scrooloose/nerdcommenter'
Bundle 'vim-ruby/vim-ruby'
Bundle 'godlygeek/tabular'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-rails'
Bundle 'tpope/vim-fugitive'
Bundle 'jgdavey/vim-turbux'
Bundle 'jgdavey/tslime.vim'
Bundle 'rking/ag.vim'
Bundle 'ctrlpvim/ctrlp.vim'
" Bundle 'bling/vim-bufferline'
" Bundle 'fatih/vim-go'
" Bundle 'rust-lang/rust.vim'
" Bundle 'scrooloose/nerdtree'

" Color Schemes
Bundle 'wesgibbs/vim-irblack'
" Bundle 'altercation/vim-colors-solarized'
" Bundle 'zeis/vim-kolor'
" Bundle 'morhetz/gruvbox'

" Vim Powerline
" Bundle 'vim-airline/vim-airline'

" JavaScript, HTML
Bundle 'pangloss/vim-javascript'
Bundle 'othree/html5-syntax.vim'
Bundle 'othree/html5.vim'
Bundle 'kchmck/vim-coffee-script'
Bundle 'leafgarland/typescript-vim'

" Elixir
Bundle 'elixir-lang/vim-elixir'


" don't give |ins-completion-menu| messages.  For example,
" '-- XXX completion (YYY)', 'match 1 of 2', 'The only match',
set shortmess+=c

" Set up CSS/Sass completion.
au User CmSetup call cm#register_source({'name' : 'cm-css',
		\ 'priority': 9,
		\ 'scoping': 1,
		\ 'scopes': ['css','scss'],
		\ 'abbreviation': 'css',
		\ 'cm_refresh_patterns':[':\s+\w*$'],
		\ 'cm_refresh': {'omnifunc': 'csscomplete#CompleteCSS'},
		\ })

Add delay to auto completion.

" don't give |ins-completion-menu| messages.  For example,
" '-- XXX completion (YYY)', 'match 1 of 2', 'The only match',
set shortmess+=c

let g:cm_complete_delay = 400

" Set up CSS/Sass completion.
au User CmSetup call cm#register_source({'name' : 'cm-css',
		\ 'priority': 9,
		\ 'scoping': 1,
		\ 'scopes': ['css','scss'],
		\ 'abbreviation': 'css',
		\ 'cm_refresh_patterns':[':\s+\w*$'],
		\ 'cm_refresh': {'omnifunc': 'csscomplete#CompleteCSS'},
		\ })


"""""""""""""""""""""""""""
" nvim-tree Settings
"""""""""""""""""""""""""""

let g:nvim_tree_width = 40 "30 by default
let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default
let g:nvim_tree_auto_close = 1 "0 by default, closes the tree when it's the last window
let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer

noremap <silent> <leader>n :NvimTreeToggle<CR>
nnoremap <leader>r :NvimTreeRefresh<CR>

Add .DS_STORE to nvim tree ignore

"""""""""""""""""""""""""""
" nvim-tree Settings
"""""""""""""""""""""""""""

let g:nvim_tree_width = 40 "30 by default
let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache', '.DS_STORE' ] "empty by default
let g:nvim_tree_auto_close = 1 "0 by default, closes the tree when it's the last window
let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer

noremap <silent> <leader>n :NvimTreeToggle<CR>
nnoremap <leader>r :NvimTreeRefresh<CR>


" This file is automatically sourced by neovim-qt
" GuiFont can only be called in this file, since it is sourced *after* the shim plugin has been loaded.

" Set font, accounting for DPI. Desktop has 95 (on 1920x1200), yuki has 96
if has("nvim")
    if system("xdpyinfo | perl -ne '/resolution.*x([0-9]+)/ && print $1;'") < 96
        GuiFont Droid Sans Mono:h11
    else
        GuiFont Droid Sans Mono:h14
    endif
else
    if system("xdpyinfo | perl -ne '/resolution.*x([0-9]+)/ && print $1;'") < 96
        set guifont=Droid\ Sans\ Mono\ 11
    else
        set guifont=Droid\ Sans\ Mono\ 14
    endif
fi

Use the same font size as Konsole

" This file is automatically sourced by neovim-qt
" GuiFont can only be called in this file, since it is sourced *after* the shim plugin has been loaded.

" Set font to whatever Konsole uses
" We can't do this heuristically because Shuriken and Yuki have the same DPI
if has("nvim")
    let s:cmd = "GuiFont Droid Sans Mono for Powerline:h"
else
    let s:cmd = "set guifont=Droid\ Sans\ Mono\ for\ Powerline\ "
endif

let s:fontsize = system("awk -F, '/^Font=/{print $2}' ~/.local/share/konsole/*.profile | head -n1")
execute s:cmd . s:fontsize


if exists('g:gina_loaded')
  finish
endif
let g:gina_loaded = 1

command! -nargs=* -range -bang -bar
      \ -complete=customlist,gina#router#complete
      \ Gina
      \ call gina#router#command(
      \   <q-bang>,
      \   [<line1>, <line2>],
      \   <q-args>,
      \   has('nvim') ? '' : <q-mods>
      \ )

augroup gina_internal
  autocmd! *
  autocmd BufReadCmd gina://* nested call gina#router#autocmd('BufReadCmd')
augroup END

Allow <q-mods> in neovim as well

if exists('g:gina_loaded')
  finish
endif
let g:gina_loaded = 1

command! -nargs=* -range -bang -bar
      \ -complete=customlist,gina#router#complete
      \ Gina
      \ call gina#router#command(<q-bang>, [<line1>, <line2>], <q-args>, <q-mods>)

augroup gina_internal
  autocmd! *
  autocmd BufReadCmd gina://* nested call gina#router#autocmd('BufReadCmd')
augroup END


SnippetG '--', '-------------------------------------------------'

function Snippet_isod(time)
  return strftime("%F")
endfunction

function Snippet_ts(time)
  return strftime("%s")
endfunction

SnippetG 'isod', function("Snippet_isod")
SnippetG 'ts', function("Snippet_ts")

Add global snippet for ⏎

SnippetG '--', '-------------------------------------------------'

function Snippet_isod(time)
  return strftime("%F")
endfunction

function Snippet_ts(time)
  return strftime("%s")
endfunction

SnippetG 'isod', function("Snippet_isod")
SnippetG 'ts', function("Snippet_ts")

SnippetG 'cr', "⏎"


if get(g:, 'spacevim_enable_clap', 0)
  MP 'liuchengxu/vim-clap'
elseif g:spacevim.gui && !has('terminal')
  MP 'Yggdroot/LeaderF'
else
  if g:spacevim.speed_up_via_timer
    MP 'junegunn/fzf',  { 'dir': '~/.fzf', 'do': './install --all', 'on': [] }
    MP 'junegunn/fzf.vim', { 'on': [] }
    call timer_start(700, 'spacevim#defer#fzf')
  else
    MP 'junegunn/fzf',  { 'dir': '~/.fzf', 'do': './install --all' }
    MP 'junegunn/fzf.vim'
  endif
endif

Add post-install hook for vim-clap

if get(g:, 'spacevim_enable_clap', 0)
  MP 'liuchengxu/vim-clap', { 'do': ':Clap install-binary!' }
elseif g:spacevim.gui && !has('terminal')
  MP 'Yggdroot/LeaderF'
else
  if g:spacevim.speed_up_via_timer
    MP 'junegunn/fzf',  { 'dir': '~/.fzf', 'do': './install --all', 'on': [] }
    MP 'junegunn/fzf.vim', { 'on': [] }
    call timer_start(700, 'spacevim#defer#fzf')
  else
    MP 'junegunn/fzf',  { 'dir': '~/.fzf', 'do': './install --all' }
    MP 'junegunn/fzf.vim'
  endif
endif


"Map proper tabbing commands
nmap <C-right> :tabnext<CR>
nmap <C-left> :tabprevious<CR>
map <C-right> :tabnext<CR>
map <C-left> :tabprevious<CR>
imap <C-right> <ESC>:tabprevious<CR>
imap <C-left> <ESC>:tabnext<CR>

" Enable split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Enable folding with the spacebar
nnoremap <space> za

" Enabel mouse-wheel scrolling
set mouse=a

Clear search highlighting by hitting ESC

"Map proper tabbing commands
nmap <C-right> :tabnext<CR>
nmap <C-left> :tabprevious<CR>
map <C-right> :tabnext<CR>
map <C-left> :tabprevious<CR>
imap <C-right> <ESC>:tabprevious<CR>
imap <C-left> <ESC>:tabnext<CR>

" Enable split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

" Enable folding with the spacebar
nnoremap <space> za

" Enabel mouse-wheel scrolling
set mouse=a

" Clear search highlighting by hitting ESC
nnoremap <silent><esc> :noh<CR>
nnoremap <esc>^[ <esc>^[


function! RefactorDoRemote(arg)
  UpdateRemotePlugins
endfunction

" Lispy plugins
Plug 'guns/vim-sexp' " Attempt to strip down?
Plug 'luochen1990/rainbow'
" Clojure plugins
Plug 'tpope/vim-fireplace'
Plug 'guns/vim-clojure-static'
Plug 'guns/vim-clojure-highlight'

Plug 'neovim/node-host'
Plug 'snoe/clj-refactor.nvim', {'do': function('RefactorDoRemote')}

" TODO: Move to completion layer?
Plug 'SevereOverfl0w/async-clj-omni'

Add sexp mappings for a regular person

function! RefactorDoRemote(arg)
  UpdateRemotePlugins
endfunction

" Lispy plugins
Plug 'guns/vim-sexp' " Attempt to strip down?
Plug 'tpope/vim-sexp-mappings-for-regular-people'
Plug 'luochen1990/rainbow'
" Clojure plugins
Plug 'tpope/vim-fireplace'
Plug 'guns/vim-clojure-static'
Plug 'guns/vim-clojure-highlight'

Plug 'neovim/node-host'
Plug 'snoe/clj-refactor.nvim', {'do': function('RefactorDoRemote')}

" TODO: Move to completion layer?
Plug 'SevereOverfl0w/async-clj-omni'


if exists('g:sniphpets_symfony_load')
    finish
endif

let g:sniphpets_symfony_load = 1

let g:sniphpets_symfony_app_bundle = 'AppBundle'
let g:sniphpets_symfony_route_name_prefix = ''
let g:sniphpets_symfony_form_name_prefix = 'app_'
let g:sniphpets_symfony_view_suffix = 'html.twig'

Add default value for route parts delimiter

if exists('g:sniphpets_symfony_load')
    finish
endif

let g:sniphpets_symfony_load = 1

let g:sniphpets_symfony_app_bundle = 'AppBundle'
let g:sniphpets_symfony_route_name_prefix = ''
let g:sniphpets_symfony_route_parts_delimiter = '_'
let g:sniphpets_symfony_form_name_prefix = 'app_'
let g:sniphpets_symfony_view_suffix = 'html.twig'


if executable('pip-compile')
    let s:filename = expand("%:p")
    if fnamemodify(s:filename, ":t") ==# 'requirements.in'
        " this is the default filename for pip-compile
        setlocal makeprg=pip-compile
    elseif fnamemodify(s:filename, ":e") ==# 'in'
        \ && Requirements_matched_filename(s:filename)
        setlocal makeprg=pip-compile\ %
    endif
endif
" vim: et sw=4 ts=4 sts=4:

Set the same versioning comments as for other files

" the Requirements File Format syntax support for Vim
" Version: 1.5.3
" Author:  raimon <raimon49@hotmail.com>
" License: MIT LICENSE
" The MIT License (MIT)
"
" Copyright (c) 2015 raimon
"
" Permission is hereby granted, free of charge, to any person obtaining a copy
" of this software and associated documentation files (the "Software"), to deal
" in the Software without restriction, including without limitation the rights
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
" copies of the Software, and to permit persons to whom the Software is
" furnished to do so, subject to the following conditions:
"
" The above copyright notice and this permission notice shall be included in all
" copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
" SOFTWARE.
if executable('pip-compile')
    let s:filename = expand("%:p")
    if fnamemodify(s:filename, ":t") ==# 'requirements.in'
        " this is the default filename for pip-compile
        setlocal makeprg=pip-compile
    elseif fnamemodify(s:filename, ":e") ==# 'in'
        \ && Requirements_matched_filename(s:filename)
        setlocal makeprg=pip-compile\ %
    endif
endif
" vim: et sw=4 ts=4 sts=4:


let g:ale_sign_column_always = 1
let g:ale_fix_on_save = 0
let g:airline#extensions#ale#enabled = 1

nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)

let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_enter = 0
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
let g:ale_pattern_options_enabled = 1

let g:ale_open_list = 1
let g:ale_list_window_size = 5
let g:ale_fixers = {
\   '*': ['remove_trailing_lines', 'trim_whitespace'],
\   'vim': ['vint'],
\   'javascript': ['eslint'],
\   'sh': ['shfmt'],
\}
let g:ale_linters = {
\  'go': ['gofmt'],
\}

" Enable eslint for ale
let g:ale_pattern_options = {
\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
\}

Enable ALE linting on save

let g:ale_sign_column_always = 1
let g:ale_fix_on_save = 1
let g:airline#extensions#ale#enabled = 1

nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)

" Disable ALE on save:
" let g:ale_lint_on_text_changed = 'never'
" let g:ale_lint_on_insert_leave = 0
" let g:ale_lint_on_enter = 0
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 1
let g:ale_pattern_options_enabled = 1

let g:ale_open_list = 1
let g:ale_list_window_size = 5
let g:ale_fixers = {
\   '*': ['remove_trailing_lines', 'trim_whitespace'],
\   'vim': ['vint'],
\   'javascript': ['eslint'],
\   'sh': ['shfmt'],
\}
let g:ale_linters = {
\  'go': ['gofmt'],
\}

" Enable eslint for ale
let g:ale_pattern_options = {
\ '\.min\.js$': {'ale_linters': [], 'ale_fixers': []},
\ '\.min\.css$': {'ale_linters': [], 'ale_fixers': []},
\}


let s:spc = g:airline_symbols.space

function! airline#extensions#neomake#apply(...)
    let w:airline_section_warning = get(w:, 'airline_section_warning', g:airline_section_warning)
    let w:airline_section_warning .= s:spc.'%{neomake#statusline#LoclistStatus()}'
endfunction

function! airline#extensions#neomake#init(ext)
    call airline#parts#define_raw('neomake', '%{neomake#statusline#LoclistStatus()}')
    call a:ext.add_statusline_func('airline#extensions#neomake#apply')
endfunction

Add option to disable Airline integration.

" vim: ts=4 sw=4 et

if exists('g:neomake_airline') && g:neomake_airline == 0
    finish
endif

let s:spc = g:airline_symbols.space

function! airline#extensions#neomake#apply(...)
    let w:airline_section_warning = get(w:, 'airline_section_warning', g:airline_section_warning)
    let w:airline_section_warning .= s:spc.'%{neomake#statusline#LoclistStatus()}'
endfunction

function! airline#extensions#neomake#init(ext)
    call airline#parts#define_raw('neomake', '%{neomake#statusline#LoclistStatus()}')
    call a:ext.add_statusline_func('airline#extensions#neomake#apply')
endfunction


" Stones vim syntax file
" Language: stones
" Maintainer: Zack Hixon <zackh@firemail.cc>

syn case match

syn keyword STodo TODO NOTE FIXME HACK OHMYGOODNESS
syn keyword SInt red
syn keyword SConditional purple
syn keyword SOperator yellow
syn keyword SFunction green blue orange
syn keyword SDirection up down left right
syn match SComment /^red\|^orange\|^yellow\|^green\|^blue\|^purple\|[^123]\|^up\|^down\|^left\|^right/
syn match SNumber /[123]/

hi def link STodo Todo
hi def link SInt Number
hi def link SConditional Type
hi def link SOperator Operator
hi def link SFunction Function
hi def link SNth Function
hi def link SDirection Identifier
hi def link SNumber Number
hi def link SComment Comment

" these syntax definitions are awful, deal with it

Make whitespace not comments

" Stones vim syntax file
" Language: stones
" Maintainer: Zack Hixon <zackh@firemail.cc>

syn case match

syn keyword STodo TODO NOTE FIXME HACK OHMYGOODNESS
syn keyword SInt red
syn keyword SConditional purple
syn keyword SOperator yellow
syn keyword SFunction green blue orange
syn keyword SDirection up down left right
syn match SComment /^red\|^orange\|^yellow\|^green\|^blue\|^purple\|[^123]\|^up\|^down\|^left\|^right\|^\s/
syn match SNumber /[123]/

hi def link STodo Todo
hi def link SInt Number
hi def link SConditional Type
hi def link SOperator Operator
hi def link SFunction Function
hi def link SNth Function
hi def link SDirection Identifier
hi def link SNumber Number
hi def link SComment Comment

" these syntax definitions are awful, deal with it


if exists("g:go_loaded_snippets")
  finish
endif
let g:go_loaded_snippets = 1

function! g:UltiSnips_Complete()
  call UltiSnips#ExpandSnippetOrJump()
  if g:ulti_expand_or_jump_res == 0
    if pumvisible()
      return "\<C-N>"
    else
      return "\<TAB>"
    endif
  endif

  return ""
  endif
endfunction

function! g:UltiSnips_Reverse()
  call UltiSnips#JumpBackwards()
  if g:ulti_jump_backwards_res == 0
    return "\<C-P>"
  endif

  return ""
endfunction

au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
au BufEnter * exec "inoremap <silent> " . g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"

let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsSnippetDirectories=["gosnippets"]

Load only if ultisnips exists

if exists("g:go_loaded_snippets")
  finish
endif
let g:go_loaded_snippets = 1

" If this exists, it means UltiSnips is installed Return if it's not installed
if globpath(&rtp, 'plugin/UltiSnips.vim') == ""
    finish
endif

function! g:UltiSnips_Complete()
  call UltiSnips#ExpandSnippetOrJump()
  if g:ulti_expand_or_jump_res == 0
    if pumvisible()
      return "\<C-N>"
    else
      return "\<TAB>"
    endif
  endif

  return ""
  endif
endfunction

function! g:UltiSnips_Reverse()
  call UltiSnips#JumpBackwards()
  if g:ulti_jump_backwards_res == 0
    return "\<C-P>"
  endif

  return ""
endfunction

au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
au BufEnter * exec "inoremap <silent> " . g:UltiSnipsJumpBackwardTrigger . " <C-R>=g:UltiSnips_Reverse()<cr>"

let g:UltiSnipsSnippetDirectories=["gosnippets"]

if !exists("g:UltiSnipsJumpForwardTrigger")
   let g:UltiSnipsJumpForwardTrigger = "<tab>"
endif

if !exists("g:UltiSnipsJumpBackwardTrigger")
   let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
endif


let g:gutentags_cache_dir = '~/.vim/gutentags'

"prevent automatically generating the tagfile and syntax highlighting tags (default: 0)
if !exists("g:disableautotags")
    let g:gutentags_enabled = 0
endif

Fix disabling tag generation, and only index files tracked by git

let g:gutentags_cache_dir = '~/.vim/gutentags'

let g:gutentags_file_list_command = {
    \ 'markers': {
    \ '.git': 'git ls-files',
    \ },
\ }

"prevent automatically generating the tagfile and syntax highlighting tags (default: 0)
if exists("g:disableautotags") && g:disableautotags == 1
    let g:gutentags_enabled = 0
endif


if exists('g:SetColorScheme')
  call g:SetColorScheme()
end

if exists('g:GtkGuiLoaded')
  " nvim-gtk
  call rpcnotify(1, 'Gui', 'Font', 'Source Code Pro 12')
elseif exists('g:GuiLoaded')
  " nvim-qt
  GuiFont! Fira Code:h11
else
  set guifont=Fira\ Code\ 14
  set guioptions-=m  "remove menu bar
  set guioptions-=T  "remove toolbar
  set guioptions-=r  "remove right-hand scroll bar
  set guioptions-=L  "remove left-hand scroll bar
end

Improve nvim-qt font size on desktop

if exists('g:SetColorScheme')
  call g:SetColorScheme()
end

if exists('g:GtkGuiLoaded')
  " nvim-gtk
  call rpcnotify(1, 'Gui', 'Font', 'Source Code Pro 12')
elseif exists('g:GuiLoaded')
  " nvim-qt
  GuiFont! Fira Code:h9
else
  set guifont=Fira\ Code\ 14
  set guioptions-=m  "remove menu bar
  set guioptions-=T  "remove toolbar
  set guioptions-=r  "remove right-hand scroll bar
  set guioptions-=L  "remove left-hand scroll bar
end


" JAVA filetype configuration

" set compiler, build java classes, jump to first error
compiler gradlew

map <silent> <leader>m     :wall<bar>make classes compileTestJava -Dorg.gradle.parallel=false<cr><cr>
" TIP: Use vim-unimpaired to navigate the quickfixes
"        ]q    Next error
"        [q    Previous error
"        [Q    First error
"        ]Q    Last error

" increase max line length and match
setlocal textwidth=100
setlocal colorcolumn=100
match OverLength /\%101v.*/

Set default textwidth to 90

" JAVA filetype configuration

" set compiler, build java classes, jump to first error
compiler gradlew

map <silent> <leader>m     :wall<bar>make classes compileTestJava -Dorg.gradle.parallel=false<cr><cr>
" TIP: Use vim-unimpaired to navigate the quickfixes
"        ]q    Next error
"        [q    Previous error
"        [Q    First error
"        ]Q    Last error

" increase max line length and match
setlocal textwidth=90
setlocal colorcolumn=101
match OverLength /\%101v.*/


highlight ColorColumn ctermbg=DarkGray
highlight CursorLine ctermbg=None cterm=None
set cursorline

function! EnterInsertModeHighlight()
    let &colorcolumn="78,80,".join(range(100, 120), ",")
    highlight CursorLineNr ctermfg=White ctermbg=Magenta
endfunction

function! EnterNormalModeHighlight()
    set colorcolumn=
    highlight CursorLineNr ctermfg=Yellow ctermbg=DarkGray
endfunction

autocmd InsertEnter * call EnterInsertModeHighlight()
autocmd InsertLeave * call EnterNormalModeHighlight()

call EnterNormalModeHighlight()

let g:loaded_matchparen = 0

Enable italic font in vim for 3 term types

highlight ColorColumn ctermbg=DarkGray
highlight CursorLine ctermbg=None cterm=None
set cursorline

function! EnterInsertModeHighlight()
    let &colorcolumn="78,80,".join(range(100, 120), ",")
    highlight CursorLineNr ctermfg=White ctermbg=Magenta
endfunction

function! EnterNormalModeHighlight()
    set colorcolumn=
    highlight CursorLineNr ctermfg=Yellow ctermbg=DarkGray
endfunction

autocmd InsertEnter * call EnterInsertModeHighlight()
autocmd InsertLeave * call EnterNormalModeHighlight()

call EnterNormalModeHighlight()

if &term =~ "xterm" || &term =~ "screen" || &term =~ "putty"
    set t_ZH=
    set t_ZR=
    highlight Comment cterm=Italic
endif

let g:loaded_matchparen = 0


" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer:   Honza Pokorny <https://honza.ca>
" Version:      0.5

if exists("b:current_syntax")
    finish
endif

let b:current_syntax = "dockerfile"

syntax case ignore

syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|LABEL|VOLUME|WORKDIR|COPY|STOPSIGNAL)\s/
highlight link dockerfileKeyword Keyword

syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
highlight link dockerfileString String

syntax match dockerfileComment "\v^\s*#.*$"
highlight link dockerfileComment Comment

set commentstring=#\ %s

" match "RUN", "CMD", and "ENTRYPOINT" lines, and parse them as shell
let s:current_syntax = b:current_syntax
unlet b:current_syntax
syntax include @SH syntax/sh.vim
let b:current_syntax = s:current_syntax
syntax region shLine matchgroup=dockerfileKeyword start=/\v^\s*(RUN|CMD|ENTRYPOINT)\s/ end=/\v$/ contains=@SH
" since @SH will handle "\" as part of the same line automatically, this "just works" for line continuation too, but with the caveat that it will highlight "RUN echo '" followed by a newline as if it were a block because the "'" is shell line continuation...  not sure how to fix that just yet (TODO)

Add `ARG` instruction syntax for vim

" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer:   Honza Pokorny <https://honza.ca>
" Version:      0.5

if exists("b:current_syntax")
    finish
endif

let b:current_syntax = "dockerfile"

syntax case ignore

syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|LABEL|VOLUME|WORKDIR|COPY|STOPSIGNAL|ARG)\s/
highlight link dockerfileKeyword Keyword

syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
highlight link dockerfileString String

syntax match dockerfileComment "\v^\s*#.*$"
highlight link dockerfileComment Comment

set commentstring=#\ %s

" match "RUN", "CMD", and "ENTRYPOINT" lines, and parse them as shell
let s:current_syntax = b:current_syntax
unlet b:current_syntax
syntax include @SH syntax/sh.vim
let b:current_syntax = s:current_syntax
syntax region shLine matchgroup=dockerfileKeyword start=/\v^\s*(RUN|CMD|ENTRYPOINT)\s/ end=/\v$/ contains=@SH
" since @SH will handle "\" as part of the same line automatically, this "just works" for line continuation too, but with the caveat that it will highlight "RUN echo '" followed by a newline as if it were a block because the "'" is shell line continuation...  not sure how to fix that just yet (TODO)


let g:deoplete#enable_at_startup = 1

let g:deoplete#sources = {}
let g:deoplete#sources._=['buffer', 'ultisnips', 'file', 'dictionary']
let g:deoplete#sources.clojure=['async_clj', 'file', 'ultisnips', 'dictionary']

command! AsyncCljDebug call deoplete#custom#set('async_clj', 'debug_enabled', 1) | call deoplete#enable_logging("DEBUG", "/tmp/deopletelog")

Remove manual specification of sources

let g:deoplete#enable_at_startup = 1

let g:deoplete#sources = {}
let g:deoplete#sources._=['buffer', 'ultisnips', 'file', 'dictionary']

command! AsyncCljDebug call deoplete#custom#set('async_clj', 'debug_enabled', 1) | call deoplete#enable_logging("DEBUG", "/tmp/deopletelog")


" specify 2-space indent for Ruby files
setlocal expandtab
setlocal tabstop=2 shiftwidth=2 softtabstop=2

" highlight ruby whitespace errors
let ruby_space_errors = 1
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1

" set the 'foldmethod' option to 'syntax' and allow folding of
" classes, modules, methods, code blocks, heredocs and comments.
let ruby_fold = 1

" Use v or # to get a variable interpolation (inside of a string)}
" ysiw#   Wrap the token under the cursor in #{}
" v...s#  Wrap the selection in #{}
let b:surround_113 = "#{\r}"      " v
let b:surround_35  = "#{\r}"      " #

" Select text in an ERb file with visual mode and then press s- or s=
" Or yss- to do entire line.
let b:surround_45 = "<% \r -%>"   " -
let b:surround_61 = "<%= \r %>"   " =

" Activate Ruby.vim's tooltips for Ruby keywords
setlocal ballooneval

" The compiler plugins contain instructions which allow Vim to run the
" specified source file with an appropriate executable, parse any errors, and
" jump to the corresponding error location if required.
compiler ruby

Fix Surround maps for string interpolation

" specify 2-space indent for Ruby files
setlocal expandtab
setlocal tabstop=2 shiftwidth=2 softtabstop=2

" highlight ruby whitespace errors
let ruby_space_errors = 1
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1

" set the 'foldmethod' option to 'syntax' and allow folding of
" classes, modules, methods, code blocks, heredocs and comments.
let ruby_fold = 1

" Use v or # to get a variable interpolation (inside of a string)}
" ysiw#   Wrap the token under the cursor in #{}
" v...s#  Wrap the selection in #{}
let b:surround_118 = "#{ \r }"    " v
let b:surround_35  = "#{ \r }"    " #

" Select text in an ERb file with visual mode and then press s- or s=
" Or yss- to do entire line.
let b:surround_45 = "<% \r -%>"   " -
let b:surround_61 = "<%= \r %>"   " =

" Activate Ruby.vim's tooltips for Ruby keywords
setlocal ballooneval

" The compiler plugins contain instructions which allow Vim to run the
" specified source file with an appropriate executable, parse any errors, and
" jump to the corresponding error location if required.
compiler ruby


setlocal spell spelllang=en_us
set complete+=kspell

set conceallevel=2

" http://vim.wikia.com/wiki/Word_wrap_without_line_breaks
setlocal wrap linebreak nolist textwidth=0 wrapmargin=0

highlight htmlItalic cterm=italic gui=italic
highlight htmlBold cterm=bold gui=bold

" en and em dashes (https://www.w3schools.com/charsets/ref_utf_punctuation.asp)
" inoremap <buffer> --<space> –
" inoremap <buffer> ---<space> —

" arrows (https://www.w3schools.com/charsets/ref_utf_arrows.asp)
" inoremap <buffer> --><space> →
" inoremap <buffer> <--<space> ←

Add note about conceallevel setting.

setlocal spell spelllang=en_us
set complete+=kspell

" WARNING: The conceallevel setting may be overridden by the indentLine plugin.
" To disable in a Markdown file, run :IndentLinesToggle
" https://github.com/Yggdroot/indentLine#customization
set conceallevel=0

" http://vim.wikia.com/wiki/Word_wrap_without_line_breaks
setlocal wrap linebreak nolist textwidth=0 wrapmargin=0

highlight htmlItalic cterm=italic gui=italic
highlight htmlBold cterm=bold gui=bold

" en and em dashes (https://www.w3schools.com/charsets/ref_utf_punctuation.asp)
" inoremap <buffer> --<space> –
" inoremap <buffer> ---<space> —

" arrows (https://www.w3schools.com/charsets/ref_utf_arrows.asp)
" inoremap <buffer> --><space> →
" inoremap <buffer> <--<space> ←


" Always display and search dotfiles/dotdirectories
let g:CommandTAlwaysShowDotFiles = 1
let g:CommandTScanDotDirectores = 1

" Show the match window at the top of the screen rather than the bottom
let g:CommandTMatchWindowAtTop = 1

" Don't show any more than 25 matches at once
let g:CommandTMaxHeight=25

noremap <leader>T <Esc>:CommandTFlush<CR>
noremap <leader>t <Esc>:CommandT<CR>

Implement a Textmate-y tab usage style

" Always display and search dotfiles/dotdirectories
let g:CommandTAlwaysShowDotFiles = 1
let g:CommandTScanDotDirectores = 1

" Show the match window at the top of the screen rather than the bottom
let g:CommandTMatchWindowAtTop = 1

" Don't show any more than 25 matches at once
let g:CommandTMaxHeight=25

" Use <CR> to open new tab and <C-t> for same
let g:CommandTAcceptSelectionMap='<C-t>'
let g:CommandTAcceptSelectionTabMap='<CR>'

noremap <leader>T <Esc>:CommandTFlush<CR>
noremap <leader>t <Esc>:CommandT<CR>


" File:        vorax_exec.vim
" Author:      Alexandru Tică
" Description: An Oracle IDE for Geeks
" License:     see LICENSE.txt

" Add ! key to execute a node in vorax.
call NERDTreeAddKeyMap({
			\ 'key': '@',
			\ 'quickhelpText': 'Execute file under VoraX.',
			\ 'callback': 'NERDTreeVoraxExec'})

" Callback function to actually execute the vorax file.
function! NERDTreeVoraxExec()
  let treenode = g:NERDTreeFileNode.GetSelected()
  if !treenode.path.isDirectory
    let cmd = treenode.path.str({'escape': 0})
    " to address blanks in path on windows
    let cmd = fnamemodify(cmd, ':8')
      if vorax#utils#IsVoraxManagedFile(cmd)
        call vorax#sqlplus#SandboxExec('@' . cmd)
      else
        call vorax#utils#SpitWarn('Not a Vorax managed file.')
      endif
  endif
endfunction

Fix running scripts from a path with blanks.

" File:        vorax_exec.vim
" Author:      Alexandru Tică
" Description: An Oracle IDE for Geeks
" License:     see LICENSE.txt

" Add ! key to execute a node in vorax.
call NERDTreeAddKeyMap({
			\ 'key': '@',
			\ 'quickhelpText': 'Execute file under VoraX.',
			\ 'callback': 'NERDTreeVoraxExec'})

" Callback function to actually execute the vorax file.
function! NERDTreeVoraxExec()
  let treenode = g:NERDTreeFileNode.GetSelected()
  if !treenode.path.isDirectory
    let cmd = treenode.path.str({'escape': 0})
    " to address blanks in path on windows
    let cmd = fnamemodify(cmd, ':8')
      if vorax#utils#IsVoraxManagedFile(cmd)
        call vorax#sqlplus#SandboxExec('@"' . cmd . '"')
      else
        call vorax#utils#SpitWarn('Not a Vorax managed file.')
      endif
  endif
endfunction


source ../plugin/queqiao.vim
lua dofile('012-eval-functions.lua')
quit

Write out test file output for functions test

source ../plugin/queqiao.vim
lua dofile('012-eval-functions.lua')
silent! write 012-eval-functions.out
silent! quit


" vim-images.vim - Image pasting for vim
" Maintainer:   Blake Taylor <http://blakefrost.com/>
" Version:      0.1

if exists("g:loaded_vimages") || &cp
  finish
endif
let g:loaded_vimages = 1
let g:images_root = '/Users/blake/images/' "TODO: Inject this

function! s:warn(msg)
  echohl WarningMsg
  echomsg a:msg
  echohl NONE
endfunction

function! vimages#PasteImage()
  " Paste image from clipboard accroding to date/time
  let date_path = strftime("%Y/%m/%d/")

  let images_path = 'captures/' . date_path
  let images_dir  = g:images_root . images_path
  let file = strftime("%T") . '.png'

  " Make sure the directory exists
  execute 'silent !mkdir -p ' . images_dir
  execute "silent !pngpaste " . images_dir . file

  " Test that the file exists
  if filereadable(images_dir . file)
    execute "normal a \<BS>".'![](/'.images_path.file.')'
    normal! 02l
    startinsert!
  else
    echo "Couldn't paste image. perhaps no image data in clipboard?:"
  endif
  redraw!
endfunction

Allow images path to be modified as global variable

" vim-images.vim - Image pasting for vim
" Maintainer:   Blake Taylor <http://blakefrost.com/>
" Version:      0.1

if exists("g:loaded_vimages") || &cp
  finish
endif
let g:loaded_vimages = 1

if !exists("g:images_root")
  let g:images_root = expand('~/images/')
endif

function! s:warn(msg)
  echohl WarningMsg
  echomsg a:msg
  echohl NONE
endfunction

function! vimages#PasteImage()
  " Paste image from clipboard accroding to date/time
  let date_path = strftime("%Y/%m/%d/")

  let images_path = 'captures/' . date_path
  let images_dir  = g:images_root . images_path
  let file = strftime("%T") . '.png'

  " Make sure the directory exists
  execute 'silent !mkdir -p ' . images_dir
  execute "silent !pngpaste " . images_dir . file

  " Test that the file exists
  if filereadable(images_dir . file)
    execute "normal a \<BS>".'![](/'.images_path.file.')'
    normal! 02l
    startinsert!
  else
    echo "Couldn't paste image. perhaps no image data in clipboard?:"
  endif
  redraw!
endfunction


" Default indentation settings
setlocal tabstop=2
setlocal shiftwidth=2

" ? and ! are part of method names
setlocal iskeyword+=?,!

" RSpec
let g:rspec_command = "!frbe rspec {spec}"
nmap <buffer> <Leader>t :call RunCurrentSpecFile()<CR>
nmap <buffer> <Leader>s :call RunNearestSpec()<CR>
nmap <buffer> <Leader>l :call RunLastSpec()<CR>
nmap <buffer> <Leader>a :call RunAllSpecs()<CR>

" XmpFilter
nmap <buffer> <M-m> <Plug>(xmpfilter-mark)
xmap <buffer> <M-m> <Plug>(xmpfilter-mark)
imap <buffer> <M-m> <Plug>(xmpfilter-mark)

nmap <buffer> <M-r> <Plug>(xmpfilter-run)
xmap <buffer> <M-r> <Plug>(xmpfilter-run)
imap <buffer> <M-r> <Plug>(xmpfilter-run)

" AutoPairs
let b:AutoPairs = {'(':')', '[':']', '{':'}', "'":"'", '"':'"', '`':'`', '|':'|'}

Remove frbe from standard rspec command

" Default indentation settings
setlocal tabstop=2
setlocal shiftwidth=2

" ? and ! are part of method names
setlocal iskeyword+=?,!

" RSpec
let g:rspec_command = "!rspec {spec}"
nmap <buffer> <Leader>t :call RunCurrentSpecFile()<CR>
nmap <buffer> <Leader>s :call RunNearestSpec()<CR>
nmap <buffer> <Leader>l :call RunLastSpec()<CR>
nmap <buffer> <Leader>a :call RunAllSpecs()<CR>

" XmpFilter
nmap <buffer> <M-m> <Plug>(xmpfilter-mark)
xmap <buffer> <M-m> <Plug>(xmpfilter-mark)
imap <buffer> <M-m> <Plug>(xmpfilter-mark)

nmap <buffer> <M-r> <Plug>(xmpfilter-run)
xmap <buffer> <M-r> <Plug>(xmpfilter-run)
imap <buffer> <M-r> <Plug>(xmpfilter-run)

" AutoPairs
let b:AutoPairs = {'(':')', '[':']', '{':'}', "'":"'", '"':'"', '`':'`', '|':'|'}


call tern#Enable()

" Menu
menu <silent> Tern.Jump\ To\ Defintion :TernDef<CR>
menu <silent> Tern.See\ Documentation :TernDoc<CR>
menu <silent> Tern.DataType :TernType <CR>
menu <silent> Tern.Show\ all\ References :TernRefs<CR>
menu <silent> Tern.Rename :TernRename <CR>

Fix unkown func when open js file

if !has('python') && !has('python3')
  echo 'tern requires python support'
  finish
endif

call tern#Enable()

" Menu
menu <silent> Tern.Jump\ To\ Defintion :TernDef<CR>
menu <silent> Tern.See\ Documentation :TernDoc<CR>
menu <silent> Tern.DataType :TernType <CR>
menu <silent> Tern.Show\ all\ References :TernRefs<CR>
menu <silent> Tern.Rename :TernRename <CR>


let g:indent_guides_auto_colors = 1
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1

Set vim indent guide vars to defaults

let g:indent_guides_auto_colors = 1
let g:indent_guides_start_level = 1
let g:indent_guides_guide_size = 0


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" basic.vim <https://github.com/amix/vimrc>
source $VILA/config/.config/nvim/_basic.vim

" Allow hidden buffer
set hidden

" Height of the command bar
set cmdheight=1

" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2

" Linebreak on 80 characters
set lbr
set tw=80

" Display line number
set number

" Highlight current line
set cursorline

" Configure default register with system clipboard
set clipboard=unnamed,unnamedplus

" Buffer settings
set switchbuf=useopen

" Exclude quickfix buffers from buffer list
augroup qf
  autocmd!
  autocmd FileType qf set nobuflisted
augroup END

Use hybrid mode for line number display

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" basic.vim <https://github.com/amix/vimrc>
source $VILA/config/.config/nvim/_basic.vim

" Allow hidden buffer
set hidden

" Height of the command bar
set cmdheight=1

" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2

" Linebreak on 80 characters
set lbr
set tw=80

" Display line number in hybrid mode
set number
set relativenumber

" Highlight current line
set cursorline

" Configure default register with system clipboard
set clipboard=unnamed,unnamedplus

" Buffer settings
set switchbuf=useopen

" Exclude quickfix buffers from buffer list
augroup qf
  autocmd!
  autocmd FileType qf set nobuflisted
augroup END


set number " Show the line number of the line under the cursor

let g:relative_linenumbers = get(g:, 'relative_linenumbers', "1")

function! TurnOn()
  if (g:relative_linenumbers == "1")
    setlocal relativenumber
  endif
endfunction

function! TurnOff()
  if (g:relative_linenumbers == "1")
    setlocal norelativenumber
  endif
endfunction

" Auto toggle `relativenumber` when switching buffers
augroup vimrc_set_relativenumber_only_active_window
  autocmd!
  autocmd VimEnter,BufWinEnter,WinEnter * call TurnOn()
  autocmd WinLeave * call TurnOff()
augroup END

Add proper `yort` toggle for the buffer autocmds

set number " Show the line number of the line under the cursor

let g:relative_linenumbers = get(g:, 'relative_linenumbers', "1")

nmap yort :call ToggleRelativeLineNumbers()<CR>

function! ToggleRelativeLineNumbers()
  if (g:relative_linenumbers == "1")
    let g:relative_linenumbers = 0
    setlocal norelativenumber
  else
    let g:relative_linenumbers = 1
    setlocal relativenumber
  endif
endfunction

function! s:Enter()
  if (g:relative_linenumbers == "1")
    setlocal relativenumber
  endif
endfunction

function! s:Leave()
  if (g:relative_linenumbers == "1")
    setlocal norelativenumber
  endif
endfunction

" Auto toggle `relativenumber` when switching buffers
augroup vimrc_set_relativenumber_only_active_window
  autocmd!
  autocmd VimEnter,BufWinEnter,WinEnter * call s:Enter()
  autocmd WinLeave * call s:Leave()
augroup END


" Enable spellchecking
setlocal spell

" Automatically wrap at 80 characters
setlocal textwidth=80

" Limelight settings
let g:limelight_paragraph_span = 1
let g:limelight_priority = -1

" Set fullscreen and linespace when entering goyo
function! s:goyo_enter()
  if has('gui_running')
    set fullscreen
    set linespace=7
  endif
  Limelight
endfunction

" Reset fullscreen and linespace when leaving goyo
function! s:goyo_leave()
  if has('gui_running')
    set nofullscreen
    set linespace=0
  endif
  Limelight!
endfunction

autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()

" Toggle goyo
nnoremap <leader>G :Goyo<CR>

Update statusline when going into Goyo

" Enable spellchecking
setlocal spell

" Automatically wrap at 80 characters
setlocal textwidth=80

" Limelight settings
let g:limelight_paragraph_span = 1
let g:limelight_priority = -1

" Set fullscreen and linespace when entering goyo
function! s:goyo_enter()
  if has('gui_running')
    set fullscreen
    set linespace=7
  endif
  let &l:statusline = '%M'
  hi StatusLine ctermfg=red guifg=red cterm=NONE gui=NONE
  Limelight
endfunction

" Reset fullscreen and linespace when leaving goyo
function! s:goyo_leave()
  if has('gui_running')
    set nofullscreen
    set linespace=0
  endif
  Limelight!
endfunction

autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()

" Toggle goyo
nnoremap <leader>G :Goyo<CR>


let g:pylint_onwrite = 0
let g:pylint_show_rate = 0
let g:pylint_cwindow = 1
compiler pylint

map <F7> Ofrom ipdb import set_trace; set_trace(); # TODO<esc>
map <F8> Oimport traceback, sys; traceback.print_exception(*sys.exc_info()); # TODO<esc>

Remove references to pylint compiler.


" ----------------------------------------
" Platform Specific Configuration
" ----------------------------------------

if has('win32') || has('win64')
  " Windows
  source $VIMRUNTIME/mswin.vim
  set guifont=Consolas:h10
  set guioptions-=T " Toolbar
  set guioptions-=m " Menubar

  " Set height and width on Windows
  set lines=60
  set columns=120

  " Disable quickfixsigns on Windows due to incredible slowdown.
  let g:loaded_quickfixsigns=1

  " Windows has a nasty habit of launching gVim in the wrong working directory
  cd ~
elseif has('gui_macvim')
  " MacVim

  " Custom Source Code font for Powerline
  " From: https://github.com/Lokaltog/powerline-fonts
  set guifont=Source\ Code\ Pro\ for\ Powerline:h12

  " Hide Toolbar in MacVim
  if has("gui_running")
    set guioptions=egmrt
  endif

  " Use option (alt) as meta key.
  set macmeta
endif

if has('macunix') || has('mac')
  " Fix meta key for Mac
  let c='a'
  while c <= 'z'
    exec "set <A-".c.">=\e".c
    exec "imap \e".c." <A-".c.">"
    let c = nr2char(1+char2nr(c))
  endw
endif

Make font bigger because I’m blind

" ----------------------------------------
" Platform Specific Configuration
" ----------------------------------------

if has('win32') || has('win64')
  " Windows
  source $VIMRUNTIME/mswin.vim
  set guifont=Consolas:h16
  set guioptions-=T " Toolbar
  set guioptions-=m " Menubar

  " Set height and width on Windows
  set lines=60
  set columns=120

  " Disable quickfixsigns on Windows due to incredible slowdown.
  let g:loaded_quickfixsigns=1

  " Windows has a nasty habit of launching gVim in the wrong working directory
  cd ~
elseif has('gui_macvim')
  " MacVim

  " Custom Source Code font for Powerline
  " From: https://github.com/Lokaltog/powerline-fonts
  set guifont=Source\ Code\ Pro\ for\ Powerline:h16
  " set guifont=Monaco:h16

  " Hide Toolbar in MacVim
  if has("gui_running")
    set guioptions=egmrt
  endif

  " Use option (alt) as meta key.
  set macmeta
endif

if has('macunix') || has('mac')
  " Fix meta key for Mac
  let c='a'
  while c <= 'z'
    exec "set <A-".c.">=\e".c
    exec "imap \e".c." <A-".c.">"
    let c = nr2char(1+char2nr(c))
  endw
endif


function! asyncomplete#sources#OmniSharp#completor(opt, ctx) abort
  let column = a:ctx['col']
  let typed = a:ctx['typed']

  let kw = matchstr(typed, '\w\+$')
  let kwlen = len(kw)
  if kwlen < 1
    return
  endif
  let startcol = column - kwlen

  call OmniSharp#GetCompletions(kw, {results->
  \ asyncomplete#complete(a:opt['name'], a:ctx, startcol, results)})
endfunction

" vim:et:sw=2:sts=2

Improve asyncomplete response after '.'

function! asyncomplete#sources#OmniSharp#completor(opt, ctx) abort
  let column = a:ctx['col']
  let typed = a:ctx['typed']

  let kw = matchstr(typed, '\(\w*\W\)*\zs\w\+$')
  let kwlen = len(kw)

  let startcol = column - kwlen

  call OmniSharp#GetCompletions(kw, {results->
  \ asyncomplete#complete(a:opt['name'], a:ctx, startcol, results)})
endfunction

" vim:et:sw=2:sts=2


" Small default height for CommandT
let g:CommandTMaxHeight=20
let g:CommandTMaxFiles=20000

Fix ESC in CommandT while in terminal Vim not working

" Small default height for CommandT
let g:CommandTMaxHeight=20
let g:CommandTMaxFiles=20000

" Make ESC work in CommandT while in terminal Vim
if &term =~ "xterm" || &term =~ "screen"
  let g:CommandTCancelMap=['<ESC>']
end


au FileType javascript set tabstop=2

Fix tabstop / shiftwidth for JavaScript

au FileType javascript set shiftwidth=2
au FileType javascript set softtabstop=2
au FileType javascript set tabstop=2
au FileType javascript set expandtab