Merge branch 'master' of github.com:DarkWiiPlayer/darkrc
This commit is contained in:
commit
81f3c385dc
2 changed files with 41 additions and 21 deletions
43
lua/vim.moon
43
lua/vim.moon
|
@ -1,29 +1,17 @@
|
||||||
-- vim: set noexpandtab :miv --
|
-- vim: set noexpandtab :miv --
|
||||||
tree = (tab, level=0, skip="") ->
|
tree = (tab, pref='') ->
|
||||||
if level==0
|
print tab.title and tab.title or '┐'
|
||||||
print "┐"
|
|
||||||
|
|
||||||
pre = (lvl, skip) ->
|
|
||||||
for i=1,lvl
|
|
||||||
if skip\sub(i,i) == "y"
|
|
||||||
io.write " "
|
|
||||||
else
|
|
||||||
io.write "│ "
|
|
||||||
|
|
||||||
for idx, element in ipairs tab
|
for idx, element in ipairs tab
|
||||||
last = idx == #tab
|
last = idx == #tab
|
||||||
|
first = idx == 1
|
||||||
|
io.write pref
|
||||||
|
io.write last and "└─" or "├─"
|
||||||
switch type element
|
switch type element
|
||||||
when "table"
|
when "table"
|
||||||
pre level, skip
|
tree element, last and ' ' or '│ '
|
||||||
io.write last and "└─" or "├─"
|
|
||||||
print element.title and "┬─ "..element.title or "┐"
|
|
||||||
tree element, level+1, skip .. (last and "y" or "n")
|
|
||||||
else
|
else
|
||||||
pre level, skip
|
print tostring element
|
||||||
if idx<#tab
|
|
||||||
print "├─ "..element
|
|
||||||
else
|
|
||||||
print "└─ "..element
|
|
||||||
|
|
||||||
import max from math
|
import max from math
|
||||||
column = (col) ->
|
column = (col) ->
|
||||||
|
@ -52,17 +40,30 @@ column = (col) ->
|
||||||
box = (box) ->
|
box = (box) ->
|
||||||
column { box }
|
column { box }
|
||||||
|
|
||||||
|
CLASS = [[
|
||||||
|
print vim.col {
|
||||||
|
{ 'Class' } -- Title
|
||||||
|
{
|
||||||
|
-- Members
|
||||||
|
}
|
||||||
|
{
|
||||||
|
-- Methods
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]]
|
||||||
|
|
||||||
draw = ->
|
draw = ->
|
||||||
for line in * {
|
for line in * {
|
||||||
{ "─", "│", "┼" }
|
{ "─", "│", "┼" }
|
||||||
{ "┌", "┐", "└", "┘" }
|
{ "┌", "┐", "└", "┘" }
|
||||||
{"├", "┤", "┬", "┴"}
|
{ "├", "┤", "┬", "┴" }
|
||||||
|
{ "╼", "╽", "╾", "╾" }
|
||||||
}
|
}
|
||||||
print table.concat(line, " ")
|
print table.concat(line, " ")
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
:tree, :column, :box, :draw
|
:tree, :column, :box, :draw, :CLASS
|
||||||
-- Aliases
|
-- Aliases
|
||||||
col: column
|
col: column
|
||||||
}
|
}
|
||||||
|
|
19
vimrc
19
vimrc
|
@ -492,6 +492,25 @@ function! s:git_diff(...)
|
||||||
end
|
end
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
|
function! s:git_blame()
|
||||||
|
let l:name = expand('%')
|
||||||
|
let l:line = getpos('.')[1]
|
||||||
|
let l:char = getpos('.')[2]+59
|
||||||
|
let l:type = &filetype
|
||||||
|
enew
|
||||||
|
set modifiable
|
||||||
|
let &filetype = l:type
|
||||||
|
set buftype=nofile
|
||||||
|
set bufhidden=delete
|
||||||
|
set nowrap
|
||||||
|
silent exec "file Blame: ".l:name
|
||||||
|
keepjumps exec 'r !git blame '.l:name
|
||||||
|
keepjumps 0,0del "
|
||||||
|
set nomodifiable
|
||||||
|
keepjumps call setpos('.', [0, l:line, l:char, 0])
|
||||||
|
endfun
|
||||||
|
|
||||||
|
command! Blame call <sid>git_blame()
|
||||||
command! GitNext call <sid>git_next() | call s:git_info()
|
command! GitNext call <sid>git_next() | call s:git_info()
|
||||||
command! GitPrev call <sid>git_prev() | call s:git_info()
|
command! GitPrev call <sid>git_prev() | call s:git_info()
|
||||||
command! GitFirst call <sid>git_first() | call s:git_info()
|
command! GitFirst call <sid>git_first() | call s:git_info()
|
||||||
|
|
Loading…
Reference in a new issue