aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Hiar <codyfh@gmail.com>2017-02-19 17:12:42 -0700
committerCody Hiar <codyfh@gmail.com>2017-02-19 17:12:42 -0700
commite8e0f6bcf2e3caed116d6e823df421619ea24f58 (patch)
tree7ab1a78a10767fd075b6379b488171869170a3e2
parent800366d09dd715990c530b8998d758d66ccf5b13 (diff)
Big revamp after the thoughtbot video
-rw-r--r--UltiSnips/htmljinja.snippets93
-rw-r--r--UltiSnips/python.snippets8
-rw-r--r--indent/yaml.vim32
-rw-r--r--syntax/htmljinja.vim27
-rw-r--r--syntax/jinja.vim113
-rw-r--r--vimrc52
6 files changed, 32 insertions, 293 deletions
diff --git a/UltiSnips/htmljinja.snippets b/UltiSnips/htmljinja.snippets
deleted file mode 100644
index 806afe7..0000000
--- a/UltiSnips/htmljinja.snippets
+++ /dev/null
@@ -1,93 +0,0 @@
-# http://jinja.pocoo.org/
-
-# jinja2 is a full featured template engine for Python. It has full
-# unicode support, an optional integrated sandboxed execution
-# environment, widely used and BSD licensed.
-
-# possible extends:
-#extends html
-
-
-snippet block "block" b
-{% block ${1:name} %}
- $2
-{% endblock %}
-endsnippet
-
-
-snippet {{ "variable" b
-{{ $1 }}
-endsnippet
-
-
-snippet {# "comment" b
-{# $1 #}
-endsnippet
-
-
-snippet # "comment" b
-{# $1 #}
-endsnippet
-
-
-snippet extends "extends" b
-{% extends "${1:template}" %}
-endsnippet
-
-
-snippet include "include" b
-{% include "${1:template}" %}
-endsnippet
-
-
-snippet import "import" b
-{% import "${1:template}" %}
-endsnippet
-
-
-snippet from "from/import/as" b
-{% from "${1:template}" import ${2:name}${3: as ${4:$2}} %}
-endsnippet
-
-
-snippet for "for" b
-{% for ${1:item} in ${2:sequence} %}
- $3
-{% endfor %}
-endsnippet
-
-
-snippet fore "for/else" b
-{% for ${1:item} in ${2:sequence} %}
- $3
-{% else %}
- $4
-{% endfor %}
-endsnippet
-
-
-snippet if "if" b
-{% if ${1:expr} %}
- $2
-{% endif %}
-endsnippet
-
-
-snippet ife "if/else" b
-{% if ${1:expr} %}
- $2
-{% else %}
- $3
-{% endif %}
-endsnippet
-
-
-snippet ifee "if/elif/else" b
-{% if ${1:expr} %}
- $2
-{% elif %}
- $3
-{% else %}
- $4
-{% endif %}
-endsnippet
diff --git a/UltiSnips/python.snippets b/UltiSnips/python.snippets
deleted file mode 100644
index 65be5b1..0000000
--- a/UltiSnips/python.snippets
+++ /dev/null
@@ -1,8 +0,0 @@
-snippet "" "Comments but same line" b
-""" $1 """
-endsnippet
-
-snippet de "Make a very basic function" b
-def ${1:function}($2):
- ${3:pass}
-endsnippet
diff --git a/indent/yaml.vim b/indent/yaml.vim
deleted file mode 100644
index 1b1ded3..0000000
--- a/indent/yaml.vim
+++ /dev/null
@@ -1,32 +0,0 @@
-" Vim indent file
-" Language: Yaml
-" Author: Ian Young
-" Get it bundled for pathogen: https://github.com/avakhov/vim-yaml
-
-if exists("b:did_indent")
- finish
-endif
-"runtime! indent/ruby.vim
-"unlet! b:did_indent
-let b:did_indent = 1
-
-setlocal autoindent sw=2 et
-setlocal indentexpr=GetYamlIndent()
-setlocal indentkeys=o,O,*<Return>,!^F
-
-function! GetYamlIndent()
- let lnum = v:lnum - 1
- if lnum == 0
- return 0
- endif
- let line = substitute(getline(lnum),'\s\+$','','')
- let indent = indent(lnum)
- let increase = indent + &sw
- if line =~ ':$'
- return increase
- else
- return indent
- endif
-endfunction
-
-" vim:set sw=2:
diff --git a/syntax/htmljinja.vim b/syntax/htmljinja.vim
deleted file mode 100644
index 3f9cba4..0000000
--- a/syntax/htmljinja.vim
+++ /dev/null
@@ -1,27 +0,0 @@
-" Vim syntax file
-" Language: Jinja HTML template
-" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
-" Last Change: 2007 Apr 8
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-if !exists("main_syntax")
- let main_syntax = 'html'
-endif
-
-if version < 600
- so <sfile>:p:h/jinja.vim
- so <sfile>:p:h/html.vim
-else
- runtime! syntax/jinja.vim
- runtime! syntax/html.vim
- unlet b:current_syntax
-endif
-
-let b:current_syntax = "htmljinja"
diff --git a/syntax/jinja.vim b/syntax/jinja.vim
deleted file mode 100644
index 7704e3a..0000000
--- a/syntax/jinja.vim
+++ /dev/null
@@ -1,113 +0,0 @@
-" Vim syntax file
-" Language: Jinja template
-" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
-" Last Change: 2008 May 9
-" Version: 1.1
-"
-" Known Bugs:
-" because of odd limitations dicts and the modulo operator
-" appear wrong in the template.
-"
-" Changes:
-"
-" 2008 May 9: Added support for Jinja2 changes (new keyword rules)
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
- syntax clear
-elseif exists("b:current_syntax")
- finish
-endif
-
-syntax case match
-
-" Jinja template built-in tags and parameters (without filter, macro, is and raw, they
-" have special threatment)
-syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import
-
-syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter
-syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction
-syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName
-
-" Variable Names
-syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
-syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none loop super caller varargs kwargs
-
-" Filters
-syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained nextgroup=jinjaFilter
-syn match jinjaFilter contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
-syn match jinjaFunction contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
-syn match jinjaBlockName contained skipwhite /[a-zA-Z_][a-zA-Z0-9_]*/
-
-" Jinja template constants
-syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\\"/ end=/"/
-syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\\'/ end=/'/
-syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/
-
-" Operators
-syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/
-syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/
-syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute
-syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/
-
-" Jinja template tag and variable blocks
-syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
-syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
-syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained
-syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ skipwhite containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
-
-syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment
-
-" Jinja template 'raw' tag
-syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment
-
-" Jinja comments
-syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString
-
-" Block start keywords. A bit tricker. We only highlight at the start of a
-" tag block and only if the name is not followed by a comma or equals sign
-" which usually means that we have to deal with an assignment.
-syn match jinjaStatement containedin=jinjaTagBlock contained skipwhite /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/
-
-" and context modifiers
-syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/ skipwhite
-
-
-" Define the default highlighting.
-" For version 5.7 and earlier: only when not done already
-" For version 5.8 and later: only when an item doesn't have highlighting yet
-if version >= 508 || !exists("did_jinja_syn_inits")
- if version < 508
- let did_jinja_syn_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- HiLink jinjaPunctuation jinjaOperator
- HiLink jinjaAttribute jinjaVariable
- HiLink jinjaFunction jinjaFilter
-
- HiLink jinjaTagDelim jinjaTagBlock
- HiLink jinjaVarDelim jinjaVarBlock
- HiLink jinjaCommentDelim jinjaComment
- HiLink jinjaRawDelim jinja
-
- HiLink jinjaSpecial Special
- HiLink jinjaOperator Normal
- HiLink jinjaRaw Normal
- HiLink jinjaTagBlock PreProc
- HiLink jinjaVarBlock PreProc
- HiLink jinjaStatement Statement
- HiLink jinjaFilter Function
- HiLink jinjaBlockName Function
- HiLink jinjaVariable Identifier
- HiLink jinjaString Constant
- HiLink jinjaNumber Constant
- HiLink jinjaComment Comment
-
- delcommand HiLink
-endif
-
-let b:current_syntax = "jinja"
diff --git a/vimrc b/vimrc
index c4c45b6..f67d514 100644
--- a/vimrc
+++ b/vimrc
@@ -1,27 +1,39 @@
"-----------------------------------------------------------------------------------------------------------------------
-" Plug
-"-----------------------------------------------------------------------------------------------------------------------
-call plug#begin('~/.vim/plugged')
+" Plugins
+"----------------------------------------------------------------------------------------------------------------------
+call plug#begin('~/.config/nvim/plugged')
+
+" Extending vim functionality
+Plug 'mileszs/ack.vim' " Use ack to grep project directory
+Plug 'scrooloose/syntastic' " Syntax checking
+Plug 'terryma/vim-multiple-cursors' " Multipe cursors, like the sublime feature
+Plug 'godlygeek/tabular' " Lines up code
+Plug 'jamessan/vim-gnupg' " Loads encrypted files by asking for password
+Plug 'gcmt/taboo.vim' " Rename Tabs
+Plug 'mattn/emmet-vim' " HTML expansion plugin, very useful
+Plug 'bkad/CamelCaseMotion' " Camel Case based motions
+Plug 'tmhedberg/SimpylFold' " Folding for python
+Plug 'tpope/vim-commentary' " Better commenting commands
+Plug 'tpope/vim-fugitive' " Git integration with vim
+Plug 'tpope/vim-surround' " Helps with surrounding text
+Plug 'vimwiki/vimwiki' " A cool program for wiki notes
+Plug 'tmhedberg/matchit' " Match tags in html
-"General vim Plugins
-Plug 'morhetz/gruvbox'
-Plug 'nathanaelkane/vim-indent-guides'
-Plug 'thornycrackers/nerdtree', { 'tag': '4.1.0' }
-Plug 'tpope/vim-commentary'
-Plug 'jistr/vim-nerdtree-tabs'
-Plug 'tpope/vim-fugitive'
-Plug 'terryma/vim-multiple-cursors'
-Plug 'scrooloose/syntastic'
-Plug 'ctrlpvim/ctrlp.vim'
-Plug 'tpope/vim-surround'
-Plug 'tmhedberg/matchit'
+" Syntax highlighting / Themes
+Plug 'morhetz/gruvbox' " Pretty colorscheme
+Plug 'nathanaelkane/vim-indent-guides' " Creates indent lines, makes code a bit easier to read
Plug 'plasticboy/vim-markdown'
-Plug 'thornycrackers/vim-options' " Vim options
-Plug 'vimwiki/vimwiki'
Plug 'ledger/vim-ledger'
-Plug 'ervandew/supertab'
-Plug 'gcmt/taboo.vim'
+Plug 'stephpy/vim-yaml'
+Plug 'hdima/python-syntax'
+Plug 'elzr/vim-json'
+Plug 'digitaltoad/vim-pug'
+Plug 'elixir-lang/vim-elixir'
+Plug 'othree/yajs.vim' " Javascript syntax
+Plug 'gavocanov/vim-js-indent'
+
+" My custom options
+Plug 'thornycrackers/vim-options'
-" Add plugins to &runtimepath
call plug#end()
"-----------------------------------------------------------------------------------------------------------------------