Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add "all current" runtime test which install everything via package manager
FROM debian:latest # Update registry RUN apt-get update -qq # Install tesseract and dependencies RUN apt-get install -y \ libtesseract-dev \ libleptonica-dev \ tesseract-ocr-eng # Install Go RUN apt-get install -y git golang ENV GOPATH=/go # Get go packages RUN go get github.com/otiai10/mint ADD . ${GOPATH}/s...
Add compton to autostart (turned off by default).
[Desktop Entry] Type=Application Name=Compton (X Compositor) GenericName=X compositor Comment=A X compositor TryExec=compton Exec=compton --dbus # turned off by default Hidden=true OnlyShowIn=LXQt; X-LXQt-Module=true
Add Docker image for Wily
# moveit/moveit:kinetic-ci-wily # Sets up a base image to use for running Continuous Integration on Travis for Ubuntu Wily FROM osrf/ubuntu_32bit:wily MAINTAINER Dave Coleman dave@dav.ee # ---------------------------------------------------------------------------------- # From https://github.com/osrf/docker_images/ ...
Add Minecraft Feed The Beast Unleashed dockerfile.
FROM elliotcm/java7:1.7.0u45 MAINTAINER Elliot Crosby-McCullough "elliot@smart-casual.com" RUN apt-get install unzip ADD http://www.creeperrepo.net/direct/FTB2/18606e7928709218bd2a4386fb84ada9/modpacks%5EUnleashed%5E1_1_3%5EUnleashed-server.zip minecraft-ftb-unleashed.zip RUN unzip minecraft-ftb-unleashed.zip -d /var/...
Add magnific popup script to head.
<% content_for :head dp %> <script type='text/javascript'> $(document).ready(function () { $('#main-image').magnificPopup({ delegate: 'a', type: 'image' }); }); </script> <% end %>
Fix container status is_active static method call
namespace Dockery.DockerSdk.Model { public enum ContainerStatus { CREATED, RESTARTING, RUNNING, PAUSED, EXITED; public static ContainerStatus[] all() { return {RUNNING, PAUSED, EXITED, CREATED, RESTARTING}; } public static ContainerStatus...
namespace Dockery.DockerSdk.Model { public enum ContainerStatus { CREATED, RESTARTING, RUNNING, PAUSED, EXITED; public static ContainerStatus[] all() { return {RUNNING, PAUSED, EXITED, CREATED, RESTARTING}; } public static ContainerStatus...
Allow overriding content property in Comment class
/* valacomment.vala * * Copyright (C) 2008-2009 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
/* valacomment.vala * * Copyright (C) 2008-2009 Florian Brosch * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
Make UUID generation an internal helper
public string generate_uuid() { char[] uuid = new char[16]; var output = new StringBuilder(); weak char[] hexstring = (char[]) "0123456789ABCDEF"; char left; char right; uuid_generate(uuid); for (int i = 0;i <16; i++) { left = (uuid[i] >> 4) & 0x0f ; right = uuid[i] & 0x0f; output.append_c(hexstring[left])...
internal string generate_uuid() { char[] uuid = new char[16]; var output = new StringBuilder(); weak char[] hexstring = (char[]) "0123456789ABCDEF"; char left; char right; uuid_generate(uuid); for (int i = 0;i <16; i++) { left = (uuid[i] >> 4) & 0x0f ; right = uuid[i] & 0x0f; output.append_c(hexstring[left...
Add a test for enum methods and constants
using GLib; enum Maman.Foo { VAL2 = 2, VAL3, VAL5 = 5 } class Maman.Bar : Object { public void run () { stdout.printf (" %d", Foo.VAL2); stdout.printf (" %d", Foo.VAL3); stdout.printf (" 4"); stdout.printf (" %d", Foo.VAL5); } static void test_enums_0_conversion () { Foo foo = 0; } public sta...
using GLib; enum Maman.Foo { VAL2 = 2, VAL3, VAL5 = 5 } enum Maman.Fooish { VAL1, VAL2; public int something () { return (int) this; } public const int FOO = 2; } class Maman.Bar : Object { public void run () { stdout.printf (" %d", Foo.VAL2); stdout.printf (" %d", Foo.VAL3); stdout.printf (" 4"...
Add forgotten custom item class
/* * Copyright (C) 2008 Zeeshan Ali <zeenix@gmail.com>. * Copyright (C) 2008 Nokia Corporation, all rights reserved. * * Author: Zeeshan Ali <zeenix@gmail.com> * * This file is part of Rygel. * * Rygel is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public...
Make sure we also allow /pub/static
# Check Basic auth against a table. /admin URLs are no basic auth protected to avoid the possibility of people # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && req.url !~ "^/(index\.php/)?admin(_.*)?/" ) { ...
# Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people # locking themselves out if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFOUND") == "NOTFOUND" && !req.url ~ "^/(index\.php/)?admin(_.*)?/" && ...
Disable http auth for GraphQL endpoint
# Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people # locking themselves out. /oauth and /rest have their own auth so we can skip Basic Auth on them as well if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFO...
# Check Basic auth against a table. /admin URLs are not basic auth protected to avoid the possibility of people # locking themselves out. /oauth and /rest have their own auth so we can skip Basic Auth on them as well if ( table.lookup(magentomodule_basic_auth, regsub(req.http.Authorization, "^Basic ", ""), "NOTFO...
Use CtrlP instead of CtrlPMixed
" plugin/plugin.ctrlp.vim " Customize the path of the cache files let g:ctrlp_cache_dir = g:vim_home . '/tmp/ctrlp' " Allow to prefix <C-p> with a count to start in a specific mode let g:ctrlp_cmd = 'exe get(["CtrlPMixed", "CtrlPBuffer", "CtrlPModified", "CtrlPMRU"], v:count)' " Avoid adding a prefix to each entry i...
" plugin/plugin.ctrlp.vim " Customize the path of the cache files let g:ctrlp_cache_dir = g:vim_home . '/tmp/ctrlp' " Allow to prefix <C-p> with a count to start in a specific mode let g:ctrlp_cmd = 'exe get(["CtrlP", "CtrlPBuffer", "CtrlPMRU"], v:count)' " Avoid adding a prefix to each entry in the list let g:ctrlp...
Use vim-airline/vim-airline instead of bling
call plug#begin('~/.vim/plugged') Plug 'bling/vim-airline' " Display more information in statusline. [vim-airline] Plug 'tpope/vim-fugitive' " This is a Git helper plugin. [vim-fugitive] Plug 'airblade/vim-gitgutter' " Show the diff of changes in the gutter. [vim-gitgutter] Plug 'godlygeek/tabular' " I mostly ...
call plug#begin('~/.vim/plugged') Plug 'vim-airline/vim-airline' " Display more information in statusline. [vim-airline] Plug 'vim-airline/vim-airline-themes' " Themes for vim-airline. Plug 'tpope/vim-fugitive' " This is a Git helper plugin. [vim-fugitive] Plug 'airblade/vim-gitgutter' " Show the diff of chang...
Make fswitch recognise .cc files
" deoplete call deoplete#custom#var('omni', 'input_patterns', { 'cpp': ['[^. *\t]\.\w*','[^. *\t]\::\w*','[^. *\t]\->\w*','#include\s*[<"][^>"]*'] }) " Linters let g:ale_linters.c = ['gcc'] let g:ale_linters.cpp = ['gcc'] " Autoformat let g:ale_fixers.c = ['clang-format'] let g:ale_fixers.cpp = ['clang-format']
" deoplete call deoplete#custom#var('omni', 'input_patterns', { 'cpp': ['[^. *\t]\.\w*','[^. *\t]\::\w*','[^. *\t]\->\w*','#include\s*[<"][^>"]*'] }) " Linters let g:ale_linters.c = ['gcc'] let g:ale_linters.cpp = ['gcc'] " Autoformat let g:ale_fixers.c = ['clang-format'] let g:ale_fixers.cpp = ['clang-format'] " fs...
Add some abbreviations & stop markdown auto-opening
abbrev tableflip (╯°□°)╯︵ ┻━┻)
abbrev tableflip (╯°□°)╯︵ ┻━┻) abbrev nre nREPL abbrev taht that abbrev superceded superseded abbrev Superceded Superseded let g:markdown_composer_open_browser = 0
Revert "VIm: use 4-spaces indentation"
set autoindent " automatically indent new lines set formatoptions+=o " continue comment marker in new lines set textwidth=78 " hard-wrap long lines as you type them set tabstop=4 " render TABs using this many spaces set expandtab " insert spaces when TAB is pressed set softtabstop=4 " ... thi...
set autoindent " automatically indent new lines set formatoptions+=o " continue comment marker in new lines set textwidth=78 " hard-wrap long lines as you type them set tabstop=2 " render TABs using this many spaces set expandtab " insert spaces when TAB is pressed set softtabstop=2 " ... thi...
Make Ctrl-P show hidden files
let g:ctrlp_working_path_mode ='a' " let g:ctrlp_map = '<c-f>' map <c-b> :CtrlPBuffer<cr> let g:ctrlp_max_height = 20 let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee' let g:ctrlp_follow_symlinks = 1
let g:ctrlp_working_path_mode ='a' " let g:ctrlp_map = '<c-f>' map <c-b> :CtrlPBuffer<cr> let g:ctrlp_max_height = 20 let g:ctrlp_custom_ignore = 'node_modules\|^\.DS_Store\|^\.git\|^\.coffee' let g:ctrlp_follow_symlinks = 1 let g:ctrlp_show_hidden = 1
Add :DiffOrig function to show diff btw last save and current edits
" from http://vimcasts.org/episodes/tidying-whitespace/ function! Preserve(command) " Preparation: save last search, and cursor position. let save_cursor = getpos('.') let last_search = getreg('/') " Do the business: execute a:command " Clean up: restore previous search history, and cursor position call s...
" from http://vimcasts.org/episodes/tidying-whitespace/ function! Preserve(command) " Preparation: save last search, and cursor position. let save_cursor = getpos('.') let last_search = getreg('/') " Do the business: execute a:command " Clean up: restore previous search history, and cursor position call s...
Add tab setting for HTML.
" tab set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab " appearance set showmatch set list set listchars=tab:>.,trail:_,eol:↲,extends:>,precedes:<,nbsp:% " control set backspace=start,eol,indent set whichwrap=b,s,[,],,~
" tab set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab augroup fileTypeIndent autocmd! autocmd BufNewFile,BufRead *.html setlocal tabstop=2 shiftwidth=2 softtabstop=2 augroup END " appearance set showmatch set list set listchars=tab:>.,trail:_,eol:↲,extends:>,precedes:<,nbsp:% " co...
Add tmux syntax to vim
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' " Make gvim-only colorschemes work transparently in terminal vim Plugin 'godlygeek/csapprox' " }}} " Synt...
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' " Make gvim-only colorschemes work transparently in terminal vim Plugin 'godlygeek/csapprox' " }}} " Synt...
Add filetype detection for sbt and template files
au BufRead,BufNewFile *.scala set filetype=scala
au BufRead,BufNewFile *.scala set filetype=scala au BufNewFile,BufRead *.sbt set filetype=scala " Use haml syntax for scaml au BufRead,BufNewFile *.scaml set filetype=haml
Use 1-based indexing for buffer ranges
" vim: et sw=2 sts=2 scriptencoding utf-8 " Function: #list_active_buffers {{{1 function! sy#debug#list_active_buffers() abort for b in range(0, bufnr('$')) if !buflisted(b) || empty(getbufvar(b, 'sy')) continue endif let sy = copy(getbufvar(b, 'sy')) let path = remove(sy, 'path') echo...
" vim: et sw=2 sts=2 scriptencoding utf-8 " Function: #list_active_buffers {{{1 function! sy#debug#list_active_buffers() abort for b in range(1, bufnr('$')) if !buflisted(b) || empty(getbufvar(b, 'sy')) continue endif let sy = copy(getbufvar(b, 'sy')) let path = remove(sy, 'path') echo...
Add vim-sexp (and tpopes bindings)
Plug 'Shougo/deoplete.nvim' Plug 'airblade/vim-gitgutter' Plug 'ctrlpvim/ctrlp.vim' Plug 'easymotion/vim-easymotion' Plug 'jiangmiao/auto-pairs' Plug 'liuchengxu/vim-better-default' Plug 'rafi/awesome-vim-colorschemes' Plug 'tpope/vim-commentary' Plug 'tpope/vim-dadbod' Plug 'tpope/vim-dispatch' Plug 'tpope/vim-eunuch'...
Plug 'Shougo/deoplete.nvim' Plug 'airblade/vim-gitgutter' Plug 'ctrlpvim/ctrlp.vim' Plug 'easymotion/vim-easymotion' Plug 'guns/vim-sexp' Plug 'jiangmiao/auto-pairs' Plug 'liuchengxu/vim-better-default' Plug 'rafi/awesome-vim-colorschemes' Plug 'tpope/vim-commentary' Plug 'tpope/vim-dadbod' Plug 'tpope/vim-dispatch' Pl...
Fix Vim highlighting of action blocks
" Vim Syntax configuration for ruby-ll grammar files. " " Language: ruby-ll " Maintainer: Yorick Peterse <yorickpeterse@gmail.com> " syntax clear syn include @rubyTop syntax/ruby.vim syn match rllKeyword "%[a-zA-Z]\+" syn match rllComment "#.*$" syn match rllOperator "?|+|\*" syn region rllRuby start="{" end="}" c...
" Vim Syntax configuration for ruby-ll grammar files. " " Language: ruby-ll " Maintainer: Yorick Peterse <yorickpeterse@gmail.com> " syntax clear syn include @rubyTop syntax/ruby.vim syn match rllKeyword "%[a-zA-Z]\+" syn match rllComment "#.*$" syn match rllOperator "?|+|\*" syn match rllDelimiter '[=|]' syn regi...
Add note for skipped test of o_v, o_V, and o_Ctrl-v
let s:suite = themis#suite('operator_pending_behavior') let s:assert = themis#helper('assert') " NOTE: Also see repetition.vim spec " :h o_v " :h o_V " :h o_CTRL-V " Helper: function! s:add_line(str) put! =a:str endfunction function! s:add_lines(lines) for line in reverse(a:lines) put! =line endfo...
let s:suite = themis#suite('operator_pending_behavior') let s:assert = themis#helper('assert') " NOTE: Also see repetition.vim spec " :h o_v " :h o_V " :h o_CTRL-V " Helper: function! s:add_line(str) put! =a:str endfunction function! s:add_lines(lines) for line in reverse(a:lines) put! =line endfo...
Allow full screen on Windows only because the key
" off99555's '.vimrc' configurations " Extended to the Ultimate .vimrc "let g:airline_theme='base16_solarized' "let g:airline#extensions#tabline#enabled = 1 "colorscheme solarized """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " file settings set number " Maximize the Vim window und...
" off99555's '.vimrc' configurations " Extended to the Ultimate .vimrc """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " file settings set number " Maximize the Vim window under Windows OS if has('gui_running') && (has("win16") || has("win32")) au GUIEnter * simalt ~x endif " St...
Add arrow mappings for Markdown.
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! ...
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! ...
Remove unnecessary solarized setting for vim
" set term=screen-256color-bce let s:uname = system("uname -s") let g:solorized_termcolors=256 set t_Co=256 set background=dark colorscheme solarized " Added to support visual gitgutter display highlight clear SignColumn " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the...
" set term=screen-256color-bce let s:uname = system("uname -s") set t_Co=256 set background=dark colorscheme solarized " Added to support visual gitgutter display highlight clear SignColumn " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if (...
Add leader to c/d to copy to null register
" set a map leader for more key combos let mapleader = ',' let g:mapleader = ',' " scroll the viewport faster nnoremap <C-e> 3<C-e> nnoremap <C-y> 3<C-y> " scroll by visual lines nnoremap <silent> j gj nnoremap <silent> k gk " disable search highlights nnoremap <silent> <CR> :nohlsearch<CR><CR> " fold with spacebar...
" set a map leader for more key combos let mapleader = ',' let g:mapleader = ',' " scroll the viewport faster nnoremap <C-e> 3<C-e> nnoremap <C-y> 3<C-y> " scroll by visual lines nnoremap <silent> j gj nnoremap <silent> k gk " disable search highlights nnoremap <silent> <CR> :nohlsearch<CR><CR> " fold with spacebar...
Use 2 spaces as a tab in python file
" tab set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab au BufRead,BufNewFile,BufReadPre *.coffee set filetype=coffee augroup fileTypeIndent autocmd! autocmd BufNewFile,BufRead *.html setlocal tabstop=2 shiftwidth=2 softtabstop=2 autocmd BufNewFile,BufRead *.coffee setlocal tabst...
" tab set expandtab set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab au BufRead,BufNewFile,BufReadPre *.coffee set filetype=coffee augroup fileTypeIndent autocmd! autocmd BufNewFile,BufRead *.html setlocal tabstop=2 shiftwidth=2 softtabstop=2 autocmd BufNewFile,BufRead *.coffee setlocal tabst...
Set Powerline font variant in gui
" Set maximum terminal color space. set t_Co=256 " Set promptline.vim theme. let g:promptline_theme = 'airline' " Set colorscheme. if has('gui_running') let g:airline#extensions#tmuxline#enabled = 0 let g:airline_theme = 'zenburn' let g:zenburn_high_Contrast = 1 colorscheme zenburn set background=dark else ...
" Set maximum terminal color space. set t_Co=256 " Set promptline.vim theme. let g:promptline_theme = 'airline' " Set colorscheme. if has('gui_running') let g:airline#extensions#tmuxline#enabled = 0 let g:airline_theme = 'zenburn' let g:zenburn_high_Contrast = 1 colorscheme zenburn set background=dark else ...
Add abbreviations to a bunch of useful stuff
iab DATE <C-R>=strftime("%d. %b %y")<CR> iab TIME <C-R>=strftime("%H:%M")<CR>
" Inserting Dates and Times iab Ydate <C-R>=strftime("%d-%b-%Y")<CR> " Example: 16-Apr-2016 iab Ytime <C-R>=strftime("%H:%M")<CR> " Example: 22:21 iab YDATE <C-R>=strftime("%a %b %d %T %Z %Y")<CR> " Example: Sat Apr 16 22:20:24 WEST 2016 " The lower letter alphabet. iab Yalpha abcdefghijklmnopqrstuvwxyz " The upper...
Add ticket mapping to git commit filetype
" Turn on spell checking. setlocal spell " Mapping to insert current git ticket into file. inoremap <C-g><C-t> <C-r>=execute('!git ticket')<cr> " Mapping to retrieve commit message after failed commit. function! GetPrevCommit() let l:git_toplevel = glob("`git rev-parse --show-toplevel`/.git/COMMIT_EDITMSG") :0rea...
" Turn on spell checking. setlocal spell " Mapping to insert current git ticket into file. nnoremap <buffer> <silent> <LocalLeader>t :r !git ticket<cr> " Mapping to retrieve commit message after failed commit. function! GetPrevCommit() let l:git_toplevel = glob("`git rev-parse --show-toplevel`/.git/COMMIT_EDITMSG")...
Add iabbrev's for thign -> thing
inoremap <buffer> --- — inoremap <buffer> -- – setlocal textwidth=80 setlocal colorcolumn=80 setlocal formatoptions+=n " Recognize numbered lists setlocal nojoinspaces setlocal spell " Some keyboards are inclined to this iabbrev ANd And iabbrev CHrist Christ iabbrev FOr For iabbrev GOd God iabbrev HIm Him iabbrev HOl...
inoremap <buffer> --- — inoremap <buffer> -- – setlocal textwidth=80 setlocal colorcolumn=80 setlocal formatoptions+=n " Recognize numbered lists setlocal nojoinspaces setlocal spell " Some keyboards are inclined to this iabbrev ANd And iabbrev CHrist Christ iabbrev FOr For iabbrev GOd God iabbrev HIm Him iabbrev HOl...
Set json filetype for .tfstate.backup files
au BufRead,BufNewFile *.tf setlocal filetype=terraform au BufRead,BufNewFile *.tfvars setlocal filetype=terraform au BufRead,BufNewFile *.tfstate setlocal filetype=json
au BufRead,BufNewFile *.tf setlocal filetype=terraform au BufRead,BufNewFile *.tfvars setlocal filetype=terraform au BufRead,BufNewFile *.tfstate setlocal filetype=json au BufRead,BufNewFile *.tfstate.backup setlocal filetype=json
Handle case where match was cleared elsewhere
"if exists("g:loaded_lsc") " finish "endif "let g:loaded_lsc = 1 " Diagnostics {{{1 " Highlight groups {{{2 if !hlexists('lscDiagnosticError') highlight link lscDiagnosticError Error endif if !hlexists('lscDiagnosticWarning') highlight link lscDiagnosticWarning SpellBad endif if !hlexists('lscDiagnosticInfo') ...
"if exists("g:loaded_lsc") " finish "endif "let g:loaded_lsc = 1 " Diagnostics {{{1 " Highlight groups {{{2 if !hlexists('lscDiagnosticError') highlight link lscDiagnosticError Error endif if !hlexists('lscDiagnosticWarning') highlight link lscDiagnosticWarning SpellBad endif if !hlexists('lscDiagnosticInfo') ...
Enable hybrid reduced colors for iterm2 beta
let g:yadr_disable_solarized_enhancements = 1 let g:hybrid_custom_term_colors = 0 let g:hybrid_reduced_contrast = 1 set background=dark colorscheme hybrid
let g:yadr_disable_solarized_enhancements = 1 let g:hybrid_custom_term_colors = 1 let g:hybrid_reduced_contrast = 1 set background=dark colorscheme hybrid
Set Go tabstop to 4
" increase max line length setlocal textwidth=100
" increase max line length setlocal textwidth=100 setlocal shiftwidth=4 " set 'shift' size setlocal softtabstop=4 " set 'tab' size during indent mode setlocal tabstop=4 " set tab character size
Fix issue with theme update functions
let g:Pl#Mod#theme = [] function! Pl#Mod#UpdateTheme(theme) " {{{ let theme = a:theme for mod in g:Pl#Mod#theme " We have to loop through instead of using index() because some " segments are lists! let target_seg_idx = -1 for i in range(0, len(theme) - 1) unlet! segment let segment = theme[i] if t...
let g:Pl#Mod#theme = [] function! Pl#Mod#UpdateTheme(theme) " {{{ let theme = deepcopy(a:theme) for mod in g:Pl#Mod#theme " We have to loop through instead of using index() because some " segments are lists! let target_seg_idx = -1 for i in range(0, len(theme) - 1) unlet! segment let segment = theme[...
Add key binding to save vim file as sudo
" Bindings imap jj <Esc> " Toggle spell check nmap <silent> <leader>z :set spell!<CR> " Start a search and replace for current word map <Leader>rw :%s/\<<C-r><C-w>\>/ " Insert new line without going into insert mode map <F9> O<Esc> map <F8> o<Esc> " map NERDtree shortcut map <C-n> :NERDTreeToggle<CR> " Run all spe...
" Bindings imap jj <Esc> " Toggle spell check nmap <silent> <leader>z :set spell!<CR> " Start a search and replace for current word map <Leader>rw :%s/\<<C-r><C-w>\>/ " Insert new line without going into insert mode map <F9> O<Esc> map <F8> o<Esc> " map NERDtree shortcut map <C-n> :NERDTreeToggle<CR> " Run all spe...
Use PGP for GPG files
call plug#begin('~/.vim/plugged') Plug 'chriskempson/base16-vim' " base16 themes Plug 'tpope/vim-fugitive', {'for': []} " git <3 Plug 'scrooloose/syntastic' " syntax checking Plug 'editorconfig/editorc...
call plug#begin('~/.vim/plugged') Plug 'chriskempson/base16-vim' " base16 themes Plug 'tpope/vim-fugitive', {'for': []} " git <3 Plug 'scrooloose/syntastic' " syntax checking Plug 'editorconfig/editorc...
Update Copy maps to work in more modes.
" Bind Ctrl-S to update. nnoremap <silent> <C-S> :<C-U>update<CR> " Close the buffer but not the window. nnoremap <silent> <C-W> :<C-U>BD<CR> " Clear highlighting until next search. nnoremap <silent> <C-I> :<C-U>nohlsearch<CR> " Toggle highlighting. nnoremap <silent> <leader>h :<C-U>set hlsearch!<CR> " Copy to syst...
" Bind Ctrl-S to update. nnoremap <silent> <C-S> :<C-U>update<CR> " Close the buffer but not the window. nnoremap <silent> <C-W> :<C-U>BD<CR> " Clear highlighting until next search. nnoremap <silent> <C-I> :<C-U>nohlsearch<CR> " Toggle highlighting. nnoremap <silent> <leader>h :<C-U>set hlsearch!<CR> " Copy to syst...
Format Ruby files with prettier
let b:ale_fixers = ['remove_trailing_lines', 'rubocop', 'trim_whitespace']
let b:ale_fixers = ['remove_trailing_lines', 'rubocop', 'trim_whitespace'] augroup Prettier autocmd! if get(g:, 'prettier#autoformat') autocmd BufWritePre *.ruby call prettier#Autoformat() endif augroup end
Use four spaces for indentation in TSX files
" JavaScript autocmd FileType javascript.jsx set shiftwidth=4 " TypeScript autocmd FileType typescript set shiftwidth=4 " JSON autocmd FileType json set shiftwidth=4
" JavaScript autocmd FileType javascript.jsx set shiftwidth=4 " TypeScript autocmd FileType typescript set shiftwidth=4 autocmd FileType typescript.tsx set shiftwidth=4 " JSON autocmd FileType json set shiftwidth=4
Set position to 0,0 for git commits
" My filetypes if exists("did_load_filetypes") finish endif augroup filetypedetect autocmd BufNewFile,BufRead *.shlib set filetype=sh autocmd BufNewFile,BufRead *.json set filetype=json autocmd BufNewFile,BufRead Jamfile,Jamroot,*.jam set filetype=jam autocmd BufNewFile,BufRead *.bb,*.inc,*.conf set fil...
" My filetypes if exists("did_load_filetypes") finish endif augroup filetypedetect autocmd BufNewFile,BufRead *.shlib set filetype=sh autocmd BufNewFile,BufRead *.json set filetype=json autocmd BufNewFile,BufRead Jamfile,Jamroot,*.jam set filetype=jam autocmd BufNewFile,BufRead *.bb,*.inc,*.conf set fil...
Upgrade to new vim-fugitive syntax
" This callback will be executed when the entire command is completed function! OnPushed(channel) unlet g:asyncPushOutput " clear status line echo "" endfunction function! AsyncPush() " Make sure we're running VIM version 8 or higher. if v:version < 800 echoerr 'asyncPush requires VIM version 8 or higher...
" This callback will be executed when the entire command is completed function! OnPushed(channel) unlet g:asyncPushOutput " clear status line echo "" endfunction function! AsyncPush() " Make sure we're running VIM version 8 or higher. if v:version < 800 echoerr 'asyncPush requires VIM version 8 or higher...
Add a missing scriptencoding line
" Author: Peter Renström <renstrom.peter@gmail.com> " Description: Fixing C/C++ files with clang-format. call ale#Set('c_clangformat_executable', 'clang-format') call ale#Set('c_clangformat_use_global', 0) call ale#Set('c_clangformat_options', '') function! ale#fixers#clangformat#GetExecutable(buffer) abort retur...
scriptencoding utf-8 " Author: Peter Renström <renstrom.peter@gmail.com> " Description: Fixing C/C++ files with clang-format. call ale#Set('c_clangformat_executable', 'clang-format') call ale#Set('c_clangformat_use_global', 0) call ale#Set('c_clangformat_options', '') function! ale#fixers#clangformat#GetExecutable(bu...
Build to HTML from Vim with :make
" Set up Vim to edit Katasemeion biblical text files " Author: Kazark if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo&vim setlocal textwidth=80 setlocal spell " Disable automatic comment continuations to the next line... doesn't apply " here and could make Vim insert u...
" Set up Vim to edit Katasemeion biblical text files " Author: Kazark if exists("b:did_ftplugin") finish endif let b:did_ftplugin = 1 let s:save_cpo = &cpo set cpo&vim setlocal textwidth=80 setlocal spell " Disable automatic comment continuations to the next line... doesn't apply " here and could make Vim insert u...
Use Intero for go to definition
" Autocompletion via neco-ghc let g:haskellmode_completion_ghc = 0 setlocal omnifunc=necoghc#omnifunc nnoremap <buffer> <silent> <F8> :wa<CR>:NeomakeProject stackbuild<CR> " ghc-mod mappings nnoremap <silent> <leader>ht :GhcModType!<CR> nnoremap <silent> <leader>hI :GhcModTypeInsert!<CR> nnoremap <silent> <leader>hl ...
" Autocompletion via neco-ghc let g:haskellmode_completion_ghc = 0 setlocal omnifunc=necoghc#omnifunc nnoremap <buffer> <silent> <F8> :wa<CR>:NeomakeProject stackbuild<CR> " ghc-mod mappings nnoremap <silent> <leader>ht :GhcModType!<CR> nnoremap <silent> <leader>hI :GhcModTypeInsert!<CR> nnoremap <silent> <leader>hl ...
Add abbreviation for JOb -> Job
inoremap <buffer> --- — inoremap <buffer> -- – setlocal textwidth=80 setlocal colorcolumn=80 setlocal formatoptions+=n " Recognize numbered lists setlocal nojoinspaces setlocal spell " Some keyboards are inclined to this iabbrev SOn Son iabbrev GOd God iabbrev ANd And iabbrev FOr For iabbrev HIm Him
inoremap <buffer> --- — inoremap <buffer> -- – setlocal textwidth=80 setlocal colorcolumn=80 setlocal formatoptions+=n " Recognize numbered lists setlocal nojoinspaces setlocal spell " Some keyboards are inclined to this iabbrev SOn Son iabbrev GOd God iabbrev ANd And iabbrev FOr For iabbrev HIm Him iabbrev JOb Job i...
Add FZF command to search git files
" FUNCTIONS {{{ " fuzzy serach buffers command! FZFBuffers call fzf#run({ \ 'source': BuffersList(), \ 'sink': 'e ', \ 'tmux_height': '30%' \}) " fuzzy search most recently opened files command! FZFMru call fzf#run({ \'source': v:oldfiles, \'sink' : 'e ', \ 'tmux_height': '30%' ...
" FUNCTIONS {{{ " fuzzy serach buffers command! FZFBuffers call fzf#run({ \ 'source': BuffersList(), \ 'sink': 'e ', \ 'tmux_height': '30%' \}) " fuzzy search most recently opened files command! FZFMru call fzf#run({ \'source': v:oldfiles, \'sink' : 'e ', \ 'tmux_height': '30%' ...
Add completion regex for Clojure
let g:rainbow_active = 1 let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn,defcomponent' setlocal lispwords+=go-loop
let g:rainbow_active = 1 let g:clojure_special_indent_words = 'deftype,defrecord,reify,proxy,extend-type,extend-protocol,letfn,defcomponent' setlocal lispwords+=go-loop let g:deoplete#keyword_patterns = {} let g:deoplete#keyword_patterns.clojure = '[\w!$%&*+/:<=>?@\^_~\-\.#]*'
Add Redir command for saving command output in scratch window
function! ChompedSystem( ... ) return substitute(call('system', a:000), '\n\+$', '', '') endfunction
function! ChompedSystem( ... ) return substitute(call('system', a:000), '\n\+$', '', '') endfunction " Redirect the output of a Vim or external command into a scratch buffer function! Redir(cmd) abort let output = execute(a:cmd) vnew let w:scratch = 1 setlocal buftype=nofile bufhidden=wipe nobuflisted no...
Revert "vim: Maintain VISUAL selection while indenting/dedenting"
" Visual mode mappings. " Move between windows. xnoremap <C-h> <C-w>h xnoremap <C-j> <C-w>j xnoremap <C-k> <C-w>k xnoremap <C-l> <C-w>l " Move VISUAL LINE selection within buffer. xnoremap <silent> K :call wincent#mappings#visual#move_up()<CR> xnoremap <silent> J :call wincent#mappings#visual#move_down()<CR> xnorema...
" Visual mode mappings. " Move between windows. xnoremap <C-h> <C-w>h xnoremap <C-j> <C-w>j xnoremap <C-k> <C-w>k xnoremap <C-l> <C-w>l " Move VISUAL LINE selection within buffer. xnoremap <silent> K :call wincent#mappings#visual#move_up()<CR> xnoremap <silent> J :call wincent#mappings#visual#move_down()<CR>
Replace grepprg with ag if it exists
" Ignore case if search pattern is all lowercase, case-sensitive otherwise set smartcase " Ignore case when searching set ignorecase " Highlight search terms set hlsearch " Show search matches as you type set incsearch " Use Ack instead of grep set grepprg=ack " ========================================== " Search ...
" Ignore case if search pattern is all lowercase, case-sensitive otherwise set smartcase " Ignore case when searching set ignorecase " Highlight search terms set hlsearch " Show search matches as you type set incsearch " ========================================== " Search in project/directory " Search current word...
Set foldin method to syntax
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Folding Settings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set foldenable " Enable folding set foldlevelstart=10 " Open most folds by default set foldnestmax=10 " TOO MANY FOLDS D=<
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Folding Settings """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" set foldenable " Enable folding set foldlevelstart=10 " Open most folds by default set foldnestmax=10 " TOO MANY FOLDS D=< set fol...
Add bb shortcut in vim
" How to: Type the letters then hit space " General iabbrev fsl # frozen_string_literal: true " debugging iabbrev bpry binding.pry iabbrev bpid binding.pry if Rails.env.development? iabbrev bpit binding.pry if Rails.env.test? iabbrev brp binding.remote_pry iabbrev brpid binding.remote_pry if Rails.env.development? ia...
" How to: Type the letters then hit space " General iabbrev fsl # frozen_string_literal: true " pry iabbrev bpry binding.pry iabbrev bpid binding.pry if Rails.env.development? iabbrev bpit binding.pry if Rails.env.test? iabbrev brp binding.remote_pry iabbrev brpid binding.remote_pry if Rails.env.development? iabbrev ...
Add heading operator mappings for Markdown
" Vim filetype plugin " Language Markdown " Maintainer Ben Knoble <ben.knoble@gmail.com> " Wrap at 80 characters setlocal textwidth=80 " Spell check on setlocal spell spelllang=en_us function! UnderlineHeading(level) if a:level == 1 normal! yypVr= elseif a:level == 2 normal! yypVr-...
" Vim filetype plugin " Language Markdown " Maintainer Ben Knoble <ben.knoble@gmail.com> " Wrap at 80 characters setlocal textwidth=80 " Spell check on setlocal spell spelllang=en_us function! UnderlineHeading(level) if a:level == 1 normal! yypVr= elseif a:level == 2 normal! yypVr-...
Add rehash command for vim
function! KillTrailingWhitespace(lines) " Kill trailing whitespace/lines. let l:search = @/ let l:view = winsaveview() %s/\s\+$//e if a:lines %s/\($\n\s*\)\+\%$//e endif let @/ = l:search call winrestview(l:view) endfunction " kill trailing whitespace (bang for lines) command! -bang -nargs=* KillTrai...
function! KillTrailingWhitespace(lines) " Kill trailing whitespace/lines. let l:search = @/ let l:view = winsaveview() execute '%s/\s\+$//e' if a:lines execute '%s/\($\n\s*\)\+\%$//e' endif let @/ = l:search call winrestview(l:view) endfunction " kill trailing whitespace (bang for lines) command! -ba...
Indent on newline in interpolation function argument
if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal nolisp setlocal autoindent setlocal indentexpr=TerraformIndent(v:lnum) setlocal indentkeys+=<:>,0=},0=) if exists("*TerraformIndent") finish endif function! TerraformIndent(lnum) " previous non-blank line let prevlnum = prevnonblank(a:lnum...
if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal nolisp setlocal autoindent setlocal indentexpr=TerraformIndent(v:lnum) setlocal indentkeys+=<:>,0=},0=) if exists("*TerraformIndent") finish endif function! TerraformIndent(lnum) " previous non-blank line let prevlnum = prevnonblank(a:lnum...
Add config for .twig files
set number set list set colorcolumn=81 au BufRead,BufNewFile *.tsx setfiletype typescript au BufRead,BufNewFile *.ts setfiletype typescript autocmd Filetype typescript setlocal expandtab autocmd Filetype typescript setlocal tabstop=2 autocmd Filetype typescript setlocal shiftwidth=2 au BufRead,BufNewFile *.yml setfil...
set number set list set colorcolumn=81 au BufRead,BufNewFile *.tsx setfiletype typescript au BufRead,BufNewFile *.ts setfiletype typescript autocmd Filetype typescript setlocal expandtab autocmd Filetype typescript setlocal tabstop=2 autocmd Filetype typescript setlocal shiftwidth=2 au BufRead,BufNewFile *.yml setfil...
Update the wildignore variables to be more generic
" Ignore retarded directories set wildignore+=build/* set wildignore+=public/build/* set wildignore+=exam/* set wildignore+=*.pyc let g:CommandTCancelMap=['<ESC>','<C-c>'] let g:CommandTMaxFiles=999999 let g:CommandTMaxDepth=999999 let g:CommandTMaxCachedDirectories=10 let g:CommandTTraverseSCM="pwd"
" Ignore retarded directories set wildignore+=**/bower_components/** set wildignore+=**/node_modules/** set wildignore+=**/build/** set wildignore+=*.pyc let g:CommandTCancelMap=['<ESC>','<C-c>'] let g:CommandTMaxFiles=999999 let g:CommandTMaxDepth=999999 let g:CommandTMaxCachedDirectories=10 let g:CommandTTraverseSC...
Remove base16-vim. A color scheme that's not used. Remove vim-markdown. Performance issues with large files. Added vim-fugitive. Git integration.
" Vundle set nocompatible filetype off set rtp+=~/.config/nvim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'chriskempson/base16-vim' Plugin 'ervandew/supertab' Plugin 'kien/ctrlp.vim' Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-commentary' Plugin 'tpope/vim-markdown' P...
" Vundle set nocompatible filetype off set rtp+=~/.config/nvim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'ervandew/supertab' Plugin 'kien/ctrlp.vim' Plugin 'scrooloose/syntastic' Plugin 'tpope/vim-commentary' Plugin 'lilydjwg/colorizer' Plugin 'vim-ruby/vim-ruby' Plugin ...
Add line numbers to Vim.
" Personal vim configuration. " Maintainer: Lorenzo Cabrini <lorenzo.cabrini@gmail.com> " General options set nocompatible set backspace=indent,eol,start set showcmd set showmatch set incsearch set autowrite set hidden set history=50 set ruler " Tabs and spaces set tabstop=8 set expandtab set shiftwidth=4 set softtab...
" Personal vim configuration. " Maintainer: Lorenzo Cabrini <lorenzo.cabrini@gmail.com> " General options set nocompatible set backspace=indent,eol,start set showcmd set showmatch set incsearch set autowrite set hidden set history=50 set ruler set number " Tabs and spaces set tabstop=8 set expandtab set shiftwidth=4 ...
Add supertab to vim config
" =============================== " Setup: " Include following line in ~/.vimrc: " source $PATH_TO_HERE/vim_config.vim " Then run: " git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim " vim +PluginInstall +qall " ================================ " Vundle config " set nocompatible file...
" =============================== " Setup: " Include following line in ~/.vimrc: " source $PATH_TO_HERE/vim_config.vim " Then run: " git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim " vim +PluginInstall +qall " ================================ " Vundle config " set nocompatible file...
Switch to regular Tomorrow Night theme
set background=dark silent! colorscheme base16-tomorrow " Feel free to override the colorscheme by adding a line to ~/.vimrc.local " such as the following: " " colorscheme solarized
set background=dark silent! colorscheme Tomorrow-Night " Feel free to override the colorscheme by adding a line to ~/.vimrc.local " such as the following: " " colorscheme solarized
Change comma to just <leader>
" Turn off default key mappings let g:multi_cursor_use_default_mapping=0 " Switch to multicursor mode with ,mc let g:multi_cursor_start_key=',mc' " Ctrl-n, Ctrl-p, Ctrl-x, and <Esc> are mapped in the special multicursor " mode once you've added at least one virtual cursor to the buffer let g:multi_cursor_next_key='<C...
" Turn off default key mappings let g:multi_cursor_use_default_mapping=0 " Switch to multicursor mode with ,mc let g:multi_cursor_start_key='<leader>mc' " Ctrl-n, Ctrl-p, Ctrl-x, and <Esc> are mapped in the special multicursor " mode once you've added at least one virtual cursor to the buffer let g:multi_cursor_next_...
Remove some c family configurations
autocmd BufNewFile,BufRead *.cu set cindent autocmd BufNewFile,BufRead *.cc,*.cpp,*.cu,*.h,*.hpp,*.c set ft=cpp.doxygen set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:0,=s,l0,b0,g0,hs,N-s,ps,ts,is,+s,c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0 nmap <Leader>k :tabe %<CR>g]
set cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:0,=s,l0,b0,g0,hs,N-s,ps,ts,is,+s,c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0
Make Command-T wildignore a multiline string for easier addition of patterns in the future
" ------------------------------------------------------------------------------ " Command-T and related configuration " ------------------------------------------------------------------------------ if &term =~ "xterm" || &term =~ "screen" " Ensure Escape key can close the match listing in Command-T let g:Command...
" ------------------------------------------------------------------------------ " Command-T and related configuration " ------------------------------------------------------------------------------ if &term =~ "xterm" || &term =~ "screen" " Ensure Escape key can close the match listing in Command-T let g:Command...
Change terminal vim color scheme
set background=dark colorscheme Tomorrow-Night-Blue if !has("gui_running") colorscheme desert end
set background=dark colorscheme Tomorrow-Night-Blue if !has("gui_running") colorscheme Tomorrow-Night end
Add '()' to call function.
let s:Vital = vital#of('autocomplete_swift') let s:Http = s:Vital.import('Web.HTTP') let s:Json = s:Vital.import('Web.JSON') let s:command_name = 'sourcekittendaemon' let s:host = 'localhost' let s:port = -1 function! sourcekitten_daemon#complete(path, offset) if sourcekitten_daemon#is_enabled() != 1 ret...
let s:Vital = vital#of('autocomplete_swift') let s:Http = s:Vital.import('Web.HTTP') let s:Json = s:Vital.import('Web.JSON') let s:command_name = 'sourcekittendaemon' let s:host = 'localhost' let s:port = -1 function! sourcekitten_daemon#complete(path, offset) if sourcekitten_daemon#is_enabled() != 1 ret...
Check if gui version of vim is running
" Rspec mappings map <Leader>t :call RunCurrentSpecFile()<CR> map <Leader>s :call RunNearestSpec()<CR> map <Leader>l :call RunLastSpec()<CR> let s:plugin_path = expand("<sfile>:p:h:h") if has("gui_macvim") let g:rspec_command = "silent !" . s:plugin_path . "/bin/run_in_os_x_terminal 'rspec {spec}'" else let g:rsp...
" Rspec mappings map <Leader>t :call RunCurrentSpecFile()<CR> map <Leader>s :call RunNearestSpec()<CR> map <Leader>l :call RunLastSpec()<CR> let s:plugin_path = expand("<sfile>:p:h:h") if has("gui_running") && has("gui_macvim") let g:rspec_command = "silent !" . s:plugin_path . "/bin/run_in_os_x_terminal 'rspec {sp...
Update nvim config to use vim-sensible plugin
call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' call plug#end() " Use UTF-8 encoding set encoding=utf-8 " View line numbers set number " Configure vim-airline let g:airline_theme='simple' set ...
call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' " Config Plug 'tpope/vim-sensible' call plug#end() " View line numbers set number " Configure vim-airline let g:airline_theme='simple' " Config...
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 " Set up CSS/Sass completion. au User CmSetup call cm#register_source({'name' : 'cm-css', \ 'priority': 9, \ 'scoping': 1, \ 'scopes': ['css','scss'], \ 'abbreviation': 'c...
" 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','...
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 let g:images_root = '/Users/blake/images/' "TODO: Inject this function! s:warn(msg) echohl WarningMsg echomsg a:msg echo...
" 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 echom...
Set vim indent guide vars to defaults
let g:indent_guides_auto_colors = 1 let g:indent_guides_start_level = 2 let g:indent_guides_guide_size = 1
let g:indent_guides_auto_colors = 1 let g:indent_guides_start_level = 1 let g:indent_guides_guide_size = 0
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") function! TurnOn() if (g:relative_linenumbers == "1") setlocal relativenumber endif endfunction function! TurnOff() if (g:relative_linenumbers == "1") setlocal norelativenumb...
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 ...
Change default python version to 3
if exists('g:loaded_pycheck') finish endif let g:loaded_pycheck = 1 sign define pycheck_E text=E! texthl=Error sign define pycheck_W text=W! texthl=Search func s:CheckBuffer() " create custom detection by writing to b:pycheck_version in ftplugin let python_ver = exists('b:pycheck_version') ? b:pycheck_version : (e...
if exists('g:loaded_pycheck') finish endif let g:loaded_pycheck = 1 sign define pycheck_E text=E! texthl=Error sign define pycheck_W text=W! texthl=WarningMsg func s:CheckBuffer() " create custom detection by writing to b:pycheck_version in ftplugin let python_ver = exists('b:pycheck_version') ? b:pycheck_version ...
Add <leader>i shortcut for :ImportJSImportAll
if exists("g:import_js_loaded") || &cp finish endif let g:import_js_loaded = 1 command ImportJSImport call importjs#ImportJSImport() command ImportJSImportAll call importjs#ImportJSImportAll() if !hasmapto(':ImportJSImport<CR>') && maparg('<Leader>j', 'n') == '' silent! nnoremap <unique> <silent> <Leader>j :Impor...
if exists("g:import_js_loaded") || &cp finish endif let g:import_js_loaded = 1 command ImportJSImport call importjs#ImportJSImport() command ImportJSImportAll call importjs#ImportJSImportAll() if !hasmapto(':ImportJSImport<CR>') && maparg('<Leader>j', 'n') == '' silent! nnoremap <unique> <silent> <Leader>j :Impor...
Add commented out theme to use in sunlight
" Indentation with four spaces set tabstop=4 set shiftwidth=4 set softtabstop=4 set expandtab " Display errors nicely (and silently) set noerrorbells set novisualbell hi clear SpellBad hi SpellBad cterm=underline ctermfg=red " Display search results nicely hi Search ctermbg=red ctermfg=white " Add line numbers set r...
" Indentation with four spaces set tabstop=4 set shiftwidth=4 set softtabstop=4 set expandtab " Display errors nicely (and silently) set noerrorbells set novisualbell hi clear SpellBad hi SpellBad cterm=underline ctermfg=red " Display search results nicely hi Search ctermbg=red ctermfg=white " Add line numbers set r...
Remove grep current partial, doesn't work well
function! GetVisual() let reg_save = getreg('"') let regtype_save = getregtype('"') let cb_save = &clipboard set clipboard& normal! ""gvy let selection = getreg('"') call setreg('"', reg_save, regtype_save) let &clipboard = cb_save return selection endfunction "grep the current word using K (mnemonic...
function! GetVisual() let reg_save = getreg('"') let regtype_save = getregtype('"') let cb_save = &clipboard set clipboard& normal! ""gvy let selection = getreg('"') call setreg('"', reg_save, regtype_save) let &clipboard = cb_save return selection endfunction "grep the current word using K (mnemonic...
Set comment string for yaml
" ========================================= " Commentary Settings autocmd FileType tmux set commentstring=#\ %s autocmd FileType moon set commentstring=--\ %s autocmd FileType puppet set commentstring=#\ %s autocmd FileType dockerfile set commentstring=#\ %s autocmd FileType nginx set commentstring=#\ %s autocmd FileT...
" ========================================= " Commentary Settings autocmd FileType tmux set commentstring=#\ %s autocmd FileType eruby.yaml set commentstring=#\ %s autocmd FileType moon set commentstring=--\ %s autocmd FileType puppet set commentstring=#\ %s autocmd FileType dockerfile set commentstring=#\ %s autocmd ...
Set .tmpl files' syntax to gohtmltmpl.
" We take care to preserve the user's fileencodings and fileformats, " because those settings are global (not buffer local), yet we want " to override them for loading Go files, which are defined to be UTF-8. let s:current_fileformats = '' let s:current_fileencodings = '' " define fileencodings to open as utf-8 encodi...
" We take care to preserve the user's fileencodings and fileformats, " because those settings are global (not buffer local), yet we want " to override them for loading Go files, which are defined to be UTF-8. let s:current_fileformats = '' let s:current_fileencodings = '' " define fileencodings to open as utf-8 encodi...
Add syntax highlighting for framework versions
if exists("b:current_syntax") finish endif syntax case match syntax match paketDepsKeyword /^\s*redirects/ syntax match paketDepsKeyword /^\s*source/ syntax match paketDepsKeyword /^\s*nuget/ syntax match paketDepsKeyword /^\s*http/ syntax match paketDepsKeyword /^\s*github/ syntax match paketDepsKeyword /^\s*gro...
if exists("b:current_syntax") finish endif syntax case match syntax match paketDepsKeyword /^\s*framework/ syntax match paketDepsKeyword /^\s*redirects/ syntax match paketDepsKeyword /^\s*source/ syntax match paketDepsKeyword /^\s*nuget/ syntax match paketDepsKeyword /^\s*http/ syntax match paketDepsKeyword /^\s*...
Add ultisnips and dictionary to deopletion
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'] command! AsyncCljDebug call deoplete#custom#set('async_clj', 'debug_enabled', 1) | call deoplete#enable_logging("DEBUG", "/tmp/de...
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#enabl...
Copy text selected with mouse
let mapleader=" " inoremap jj <Esc> " window management nnoremap <C-j> <C-w>j nnoremap <C-k> <C-w>k nnoremap <C-l> <C-w>l nnoremap <C-h> <C-w>h " buffers nnoremap <silent> <TAB> :bnext<CR> nnoremap <silent> <S-TAB> :bprevious<CR> " tabbing vnoremap < <gv vnoremap > >gv " move selection vnoremap J :m '>+1<cr>gv=gv ...
let mapleader=" " inoremap jj <Esc> " window management nnoremap <C-j> <C-w>j nnoremap <C-k> <C-w>k nnoremap <C-l> <C-w>l nnoremap <C-h> <C-w>h " buffers nnoremap <silent> <TAB> :bnext<CR> nnoremap <silent> <S-TAB> :bprevious<CR> " tabbing vnoremap < <gv vnoremap > >gv " move selection vnoremap J :m '>+1<cr>gv=gv ...
Add omnicomplete support in Go files
setlocal tabstop=4 setlocal shiftwidth=4 setlocal softtabstop=4 setlocal noexpandtab let g:go_fmt_command = "goimports" let g:go_highlight_types = 1 let g:go_highlight_fields = 1 let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_operators = 1 let g:go_highlight_extra_types = 1 let g:g...
setlocal tabstop=4 setlocal shiftwidth=4 setlocal softtabstop=4 setlocal noexpandtab let g:go_fmt_command = "goimports" let g:go_highlight_types = 1 let g:go_highlight_fields = 1 let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_operators = 1 let g:go_highlight_extra_types = 1 let g:g...
Remove default language as python
function! GSO(question) let firstarg=a:question python << EOF import vim import os import pickle as pkl from io import BytesIO from lxml import etree from gso import load_up_answers, load_up_questions question = vim.eval("firstarg") vim.current.buffer.append(question) results = [] i = 0 for result in load_up_ques...
function! GSO(question) let firstarg=a:question python << EOF import vim import os import pickle as pkl from io import BytesIO from lxml import etree from gso import load_up_answers, load_up_questions question = vim.eval("firstarg") vim.current.buffer.append(question) results = [] i = 0 for result in load_up_ques...
Enable HTML5 syntax highlighting in htmldjango
" HTML5 ominicomplete & syntax NeoBundleLazy 'othree/html5.vim', { \ 'autoload': {'filetypes': ['html']} \ } " CSS3 syntax NeoBundleLazy 'hail2u/vim-css3-syntax', { \ 'autoload': {'filetypes': ['css']} \ } " Coq syntax NeoBundleLazy 'jvoorhis/coq.vim', { ...
" HTML5 ominicomplete & syntax NeoBundleLazy 'othree/html5.vim', { \ 'autoload': {'filetypes': ['html', 'htmldjango']} \ } " CSS3 syntax NeoBundleLazy 'hail2u/vim-css3-syntax', { \ 'autoload': {'filetypes': ['css']} \ } " Coq syntax NeoBundleLazy 'jvoorhis/coq.v...
Add rbenv shims 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
" ========================================== " 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/...
Store vim notes in Dropbox or /Users/mange
set nocompatible let g:CommandTMaxHeight = 20 " let g:easytags_suppress_ctags_warning = 1 let g:easytags_resolve_links = 1 let g:easytags_cmd = '/usr/local/bin/ctags' let g:easytags_dynamic_files = 1 let g:UltiSnipsEditSplit = "horizontal" let g:UltiSnipsExpandTrigger = "<c-tab>" let g:UltiSnipsListSnippets = "<c-s-t...
set nocompatible let g:CommandTMaxHeight = 20 " let g:easytags_suppress_ctags_warning = 1 let g:easytags_resolve_links = 1 let g:easytags_cmd = '/usr/local/bin/ctags' let g:easytags_dynamic_files = 1 let g:UltiSnipsEditSplit = "horizontal" let g:UltiSnipsExpandTrigger = "<c-tab>" let g:UltiSnipsListSnippets = "<c-s-t...
Remove author from Javascript headers
" 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>7...
" 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>7...
Add Vim syntax support for Name and HexSequence tokens.
" Vim syntax file " Language: Cretonne " Maintainer: Jakob Stoklund Olesen <stoklund@2pi.dk " Last Change: Sep 22, 2016 if version < 600 syntax clear elseif exists("b:current_syntax") finish endif syn keyword ctonHeader test isa set syn keyword ctonDecl function stack_slot jump_table syn keyword ctonFilech...
" Vim syntax file " Language: Cretonne " Maintainer: Jakob Stoklund Olesen <stoklund@2pi.dk " Last Change: Sep 22, 2016 if version < 600 syntax clear elseif exists("b:current_syntax") finish endif " Disable spell checking even in comments. " They tend to refer to weird stuff like assembler mnemonics anyway...
Add path to show git status
" Main plugins Plug 'w0rp/ale' Plug 'jiangmiao/auto-pairs' Plug 'jlanzarotta/bufexplorer' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --bin'} Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'} Plug 'preservim/nerdt...
" Main plugins Plug 'w0rp/ale' Plug 'jiangmiao/auto-pairs' Plug 'jlanzarotta/bufexplorer' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'junegunn/fzf', {'dir': '~/.fzf', 'do': './install --bin'} Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'} Plug 'preservim/nerdt...
Remove fish filetype vim config
" c autocmd BufNewFile,BufRead *.c,*.h call SetCOptions() function SetCOptions() setlocal filetype=c setlocal colorcolumn=81 setlocal commentstring=//\ %s " prefer // over /*...*/ for single-line comments endfunction " fish autocmd BufNewFile,BufRead *.fish call SetFishOptions() function SetFishOptions() setlocal ...
" c autocmd BufNewFile,BufRead *.c,*.h call SetCOptions() function SetCOptions() setlocal filetype=c setlocal colorcolumn=81 setlocal commentstring=//\ %s " prefer // over /*...*/ for single-line comments endfunction " latex - fix "plaintex" filetype detection shit autocmd BufNewFile,BufRead *.tex call SetLatexOpti...
Add nvr command as VISUAL inside nvim
nnoremap <silent> <leader>gs :Gstatus<CR> nnoremap <silent> <leader>gd :Gdiff<CR> nnoremap <silent> <leader>gc :Gcommit<CR> nnoremap <silent> <leader>gb :Gblame<CR> nnoremap <silent> <leader>gl :Glog<CR> nnoremap <silent> <leader>gp :Git push<CR> nnoremap <silent> <leader>gu :Git pull<CR> nnoremap <silent> <leader>gr :...
nnoremap <silent> <leader>gs :Gstatus<CR> nnoremap <silent> <leader>gd :Gdiff<CR> nnoremap <silent> <leader>gc :Gcommit<CR> nnoremap <silent> <leader>gb :Gblame<CR> nnoremap <silent> <leader>gl :Glog<CR> nnoremap <silent> <leader>gp :Git push<CR> nnoremap <silent> <leader>gu :Git pull<CR> nnoremap <silent> <leader>gr :...
Add vim-rhubarb to git layer
Plug 'tpope/vim-fugitive' Plug 'tommcdo/vim-fugitive-blame-ext' Plug 'airblade/vim-gitgutter' Plug 'junegunn/gv.vim'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-rhubarb' Plug 'tommcdo/vim-fugitive-blame-ext' Plug 'airblade/vim-gitgutter' Plug 'junegunn/gv.vim'
Add git add and commit leader commands
nnoremap <Leader>gb :Gblame<CR> nnoremap <Leader>gd :Gdiff<CR>
nnoremap <Leader>gb :Gblame<CR> nnoremap <Leader>gd :Gdiff<CR> nnoremap <Leader>ga :Gwrite<CR> nnoremap <Leader>gc :Gcommit -v<CR>
Fix another executable callback typo
" Author: Tomota Nakamura <https://github.com/tomotanakamura> " Description: clang linter for cpp files call ale#Set('cpp_clang_executable', 'clang++') call ale#Set('cpp_clang_options', '-std=c++14 -Wall') function! ale_linters#cpp#clang#GetExecutable(buffer) abort return ale#Var(a:buffer, 'cpp_clang_executable')...
" Author: Tomota Nakamura <https://github.com/tomotanakamura> " Description: clang linter for cpp files call ale#Set('cpp_clang_executable', 'clang++') call ale#Set('cpp_clang_options', '-std=c++14 -Wall') function! ale_linters#cpp#clang#GetExecutable(buffer) abort return ale#Var(a:buffer, 'cpp_clang_executable')...