-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding html autocomplete, colors, and addition vimrc config
- Loading branch information
Showing
7 changed files
with
2,601 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.netrwhist | ||
bundle* | ||
|
||
# Ignore .swp files | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
Plugins Used: | ||
# Plugin Information for Vim setup | ||
Plugins Manager: | ||
- Apt-Vim | ||
|
||
Plugins: | ||
- auto-pairs.vim | ||
- Automatically pairs braces, parentheses, etc. | ||
- NERDTree | ||
- GUI file manager | ||
- indentLine https://github.com/Yggdroot/indentLine.git | ||
- Indent lines | ||
- Supertab | ||
- Autocompletion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
" # Configuration | ||
if !exists('g:instant_markdown_slow') | ||
let g:instant_markdown_slow = 0 | ||
endif | ||
|
||
if !exists('g:instant_markdown_autostart') | ||
let g:instant_markdown_autostart = 1 | ||
endif | ||
|
||
if !exists('g:instant_markdown_open_to_the_world') | ||
let g:instant_markdown_open_to_the_world = 0 | ||
endif | ||
|
||
if !exists('g:instant_markdown_allow_unsafe_content') | ||
let g:instant_markdown_allow_unsafe_content = 0 | ||
endif | ||
|
||
if !exists('g:instant_markdown_allow_external_content') | ||
let g:instant_markdown_allow_external_content = 1 | ||
endif | ||
|
||
" # Utility Functions | ||
" Simple system wrapper that ignores empty second args | ||
function! s:system(cmd, stdin) | ||
if strlen(a:stdin) == 0 | ||
call system(a:cmd) | ||
else | ||
call system(a:cmd, a:stdin) | ||
endif | ||
endfu | ||
|
||
" Wrapper function to automatically execute the command asynchronously and | ||
" redirect output in a cross-platform way. Note that stdin must be passed as a | ||
" List of lines. | ||
function! s:systemasync(cmd, stdinLines) | ||
if has('win32') || has('win64') | ||
call s:winasync(a:cmd, a:stdinLines) | ||
else | ||
let cmd = a:cmd . '&>/dev/null &' | ||
call s:system(cmd, join(a:stdinLines, "\n")) | ||
endif | ||
endfu | ||
|
||
" Executes a system command asynchronously on Windows. The List stdinLines will | ||
" be concatenated and passed as stdin to the command. If the List is empty, | ||
" stdin will also be empty. | ||
function! s:winasync(cmd, stdinLines) | ||
" To execute a command asynchronously on windows, the script must use the | ||
" "!start" command. However, stdin can't be passed to this command like | ||
" system(). Instead, the lines are saved to a file and then piped into the | ||
" command. | ||
if len(a:stdinLines) | ||
let tmpfile = tempname() | ||
call writefile(a:stdinLines, tmpfile) | ||
let command = 'type ' . tmpfile . ' | ' . a:cmd | ||
else | ||
let command = a:cmd | ||
endif | ||
exec 'silent !start /b cmd /c ' . command . ' > NUL' | ||
endfu | ||
|
||
function! s:refreshView() | ||
let bufnr = expand('<bufnr>') | ||
call s:systemasync("curl -X PUT -T - http://localhost:8090", | ||
\ s:bufGetLines(bufnr)) | ||
endfu | ||
|
||
function! s:startDaemon(initialMDLines) | ||
let env = '' | ||
if g:instant_markdown_open_to_the_world | ||
let env .= 'INSTANT_MARKDOWN_OPEN_TO_THE_WORLD=1 ' | ||
endif | ||
if g:instant_markdown_allow_unsafe_content | ||
let env .= 'INSTANT_MARKDOWN_ALLOW_UNSAFE_CONTENT=1 ' | ||
endif | ||
if !g:instant_markdown_allow_external_content | ||
let env .= 'INSTANT_MARKDOWN_BLOCK_EXTERNAL=1 ' | ||
endif | ||
|
||
call s:systemasync('instant-markdown-d', a:initialMDLines) | ||
endfu | ||
|
||
function! s:initDict() | ||
if !exists('s:buffers') | ||
let s:buffers = {} | ||
endif | ||
endfu | ||
|
||
function! s:pushBuffer(bufnr) | ||
call s:initDict() | ||
let s:buffers[a:bufnr] = 1 | ||
endfu | ||
|
||
function! s:popBuffer(bufnr) | ||
call s:initDict() | ||
call remove(s:buffers, a:bufnr) | ||
endfu | ||
|
||
function! s:killDaemon() | ||
call s:systemasync("curl -s -X DELETE http://localhost:8090", []) | ||
endfu | ||
|
||
function! s:bufGetLines(bufnr) | ||
return getbufline(a:bufnr, 1, "$") | ||
endfu | ||
|
||
" I really, really hope there's a better way to do this. | ||
fu! s:myBufNr() | ||
return str2nr(expand('<abuf>')) | ||
endfu | ||
|
||
" # Functions called by autocmds | ||
" | ||
" ## push a new Markdown buffer into the system. | ||
" | ||
" 1. Track it so we know when to garbage collect the daemon | ||
" 2. Start daemon if we're on the first MD buffer. | ||
" 3. Initialize changedtickLast, possibly needlessly(?) | ||
fu! s:pushMarkdown() | ||
let bufnr = s:myBufNr() | ||
call s:initDict() | ||
if len(s:buffers) == 0 | ||
call s:startDaemon(s:bufGetLines(bufnr)) | ||
endif | ||
call s:pushBuffer(bufnr) | ||
let b:changedtickLast = b:changedtick | ||
endfu | ||
|
||
" ## pop a Markdown buffer | ||
" | ||
" 1. Pop the buffer reference | ||
" 2. Garbage collection | ||
" * daemon | ||
" * autocmds | ||
fu! s:popMarkdown() | ||
let bufnr = s:myBufNr() | ||
silent au! instant-markdown * <buffer=abuf> | ||
call s:popBuffer(bufnr) | ||
if len(s:buffers) == 0 | ||
call s:killDaemon() | ||
endif | ||
endfu | ||
|
||
" ## Refresh if there's something new worth showing | ||
" | ||
" 'All things in moderation' | ||
fu! s:temperedRefresh() | ||
if !exists('b:changedtickLast') | ||
let b:changedtickLast = b:changedtick | ||
elseif b:changedtickLast != b:changedtick | ||
let b:changedtickLast = b:changedtick | ||
call s:refreshView() | ||
endif | ||
endfu | ||
|
||
fu! s:previewMarkdown() | ||
call s:startDaemon(getline(1, '$')) | ||
aug instant-markdown | ||
if g:instant_markdown_slow | ||
au CursorHold,BufWrite,InsertLeave <buffer> call s:temperedRefresh() | ||
else | ||
au CursorHold,CursorHoldI,CursorMoved,CursorMovedI <buffer> call s:temperedRefresh() | ||
endif | ||
au BufWinLeave <buffer> call s:cleanUp() | ||
aug END | ||
endfu | ||
|
||
fu! s:cleanUp() | ||
call s:killDaemon() | ||
au! instant-markdown * <buffer> | ||
endfu | ||
|
||
if g:instant_markdown_autostart | ||
" # Define the autocmds " | ||
aug instant-markdown | ||
au! * <buffer> | ||
au BufEnter <buffer> call s:refreshView() | ||
if g:instant_markdown_slow | ||
au CursorHold,BufWrite,InsertLeave <buffer> call s:temperedRefresh() | ||
else | ||
au CursorHold,CursorHoldI,CursorMoved,CursorMovedI <buffer> call s:temperedRefresh() | ||
endif | ||
au BufWinLeave <buffer> call s:popMarkdown() | ||
au BufwinEnter <buffer> call s:pushMarkdown() | ||
aug END | ||
else | ||
command! -buffer InstantMarkdownPreview call s:previewMarkdown() | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
" Vim color file | ||
" Converted from Textmate theme Monokai using Coloration v0.3.2 (http://github.com/sickill/coloration) | ||
|
||
set background=dark | ||
highlight clear | ||
|
||
if exists("syntax_on") | ||
syntax reset | ||
endif | ||
|
||
set t_Co=256 | ||
let g:colors_name = "monokai" | ||
|
||
hi Cursor ctermfg=235 ctermbg=231 cterm=NONE guifg=#272822 guibg=#f8f8f0 gui=NONE | ||
hi Visual ctermfg=NONE ctermbg=59 cterm=NONE guifg=NONE guibg=#49483e gui=NONE | ||
hi CursorLine ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE | ||
hi CursorColumn ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE | ||
hi ColorColumn ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE | ||
hi LineNr ctermfg=102 ctermbg=237 cterm=NONE guifg=#90908a guibg=#3c3d37 gui=NONE | ||
hi VertSplit ctermfg=241 ctermbg=241 cterm=NONE guifg=#64645e guibg=#64645e gui=NONE | ||
hi MatchParen ctermfg=197 ctermbg=NONE cterm=underline guifg=#f92672 guibg=NONE gui=underline | ||
hi StatusLine ctermfg=231 ctermbg=241 cterm=bold guifg=#f8f8f2 guibg=#64645e gui=bold | ||
hi StatusLineNC ctermfg=231 ctermbg=241 cterm=NONE guifg=#f8f8f2 guibg=#64645e gui=NONE | ||
hi Pmenu ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi PmenuSel ctermfg=NONE ctermbg=59 cterm=NONE guifg=NONE guibg=#49483e gui=NONE | ||
hi IncSearch term=reverse cterm=reverse ctermfg=193 ctermbg=16 gui=reverse guifg=#C4BE89 guibg=#000000 | ||
hi Search term=reverse cterm=NONE ctermfg=231 ctermbg=24 gui=NONE guifg=#f8f8f2 guibg=#204a87 | ||
hi Directory ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi Folded ctermfg=242 ctermbg=235 cterm=NONE guifg=#75715e guibg=#272822 gui=NONE | ||
hi SignColumn ctermfg=NONE ctermbg=237 cterm=NONE guifg=NONE guibg=#3c3d37 gui=NONE | ||
hi Normal ctermfg=231 ctermbg=235 cterm=NONE guifg=#f8f8f2 guibg=#272822 gui=NONE | ||
hi Boolean ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi Character ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi Comment ctermfg=242 ctermbg=NONE cterm=NONE guifg=#75715e guibg=NONE gui=NONE | ||
hi Conditional ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi Constant ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi Define ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi DiffAdd ctermfg=231 ctermbg=64 cterm=bold guifg=#f8f8f2 guibg=#46830c gui=bold | ||
hi DiffDelete ctermfg=88 ctermbg=NONE cterm=NONE guifg=#8b0807 guibg=NONE gui=NONE | ||
hi DiffChange ctermfg=NONE ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=#243955 gui=NONE | ||
hi DiffText ctermfg=231 ctermbg=24 cterm=bold guifg=#f8f8f2 guibg=#204a87 gui=bold | ||
hi ErrorMsg ctermfg=231 ctermbg=197 cterm=NONE guifg=#f8f8f0 guibg=#f92672 gui=NONE | ||
hi WarningMsg ctermfg=231 ctermbg=197 cterm=NONE guifg=#f8f8f0 guibg=#f92672 gui=NONE | ||
hi Float ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi Function ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE | ||
hi Identifier ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic | ||
hi Keyword ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi Label ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE | ||
hi NonText ctermfg=59 ctermbg=236 cterm=NONE guifg=#49483e guibg=#31322c gui=NONE | ||
hi Number ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi Operator ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi PreProc ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi Special ctermfg=231 ctermbg=NONE cterm=NONE guifg=#f8f8f2 guibg=NONE gui=NONE | ||
hi SpecialComment ctermfg=242 ctermbg=NONE cterm=NONE guifg=#75715e guibg=NONE gui=NONE | ||
hi SpecialKey ctermfg=59 ctermbg=237 cterm=NONE guifg=#49483e guibg=#3c3d37 gui=NONE | ||
hi Statement ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi StorageClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic | ||
hi String ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE | ||
hi Tag ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi Title ctermfg=231 ctermbg=NONE cterm=bold guifg=#f8f8f2 guibg=NONE gui=bold | ||
hi Todo ctermfg=95 ctermbg=NONE cterm=inverse,bold guifg=#75715e guibg=NONE gui=inverse,bold | ||
hi Type ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi Underlined ctermfg=NONE ctermbg=NONE cterm=underline guifg=NONE guibg=NONE gui=underline | ||
hi rubyClass ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi rubyFunction ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE | ||
hi rubyInterpolationDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi rubySymbol ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi rubyConstant ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic | ||
hi rubyStringDelimiter ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE | ||
hi rubyBlockParameter ctermfg=208 ctermbg=NONE cterm=NONE guifg=#fd971f guibg=NONE gui=italic | ||
hi rubyInstanceVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi rubyInclude ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi rubyGlobalVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi rubyRegexp ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE | ||
hi rubyRegexpDelimiter ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE | ||
hi rubyEscape ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi rubyControl ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi rubyClassVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi rubyOperator ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi rubyException ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi rubyPseudoVariable ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi rubyRailsUserClass ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic | ||
hi rubyRailsARAssociationMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi rubyRailsARMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi rubyRailsRenderMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi rubyRailsMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi erubyDelimiter ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi erubyComment ctermfg=95 ctermbg=NONE cterm=NONE guifg=#75715e guibg=NONE gui=NONE | ||
hi erubyRailsMethod ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi htmlTag ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE | ||
hi htmlEndTag ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE | ||
hi htmlTagName ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi htmlArg ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi htmlSpecialChar ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi javaScriptFunction ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=italic | ||
hi javaScriptRailsFunction ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi javaScriptBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi yamlKey ctermfg=197 ctermbg=NONE cterm=NONE guifg=#f92672 guibg=NONE gui=NONE | ||
hi yamlAnchor ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi yamlAlias ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE | ||
hi yamlDocumentHeader ctermfg=186 ctermbg=NONE cterm=NONE guifg=#e6db74 guibg=NONE gui=NONE | ||
hi cssURL ctermfg=208 ctermbg=NONE cterm=NONE guifg=#fd971f guibg=NONE gui=italic | ||
hi cssFunctionName ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi cssColor ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi cssPseudoClassId ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE | ||
hi cssClassName ctermfg=148 ctermbg=NONE cterm=NONE guifg=#a6e22e guibg=NONE gui=NONE | ||
hi cssValueLength ctermfg=141 ctermbg=NONE cterm=NONE guifg=#ae81ff guibg=NONE gui=NONE | ||
hi cssCommonAttr ctermfg=81 ctermbg=NONE cterm=NONE guifg=#66d9ef guibg=NONE gui=NONE | ||
hi cssBraces ctermfg=NONE ctermbg=NONE cterm=NONE guifg=NONE guibg=NONE gui=NONE |
Oops, something went wrong.