From 068b80280745909422a6298c2e9bd3bd3a4794f5 Mon Sep 17 00:00:00 2001 From: hellerve Date: Sun, 25 Feb 2018 18:28:31 +0100 Subject: [PATCH] erc: added carp checker; vimrc: added carp checker and vim-es6 --- erc | 26 +++++++++++++++++++++++++- vimrc | 3 +++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/erc b/erc index 377c6a6..cad03bc 100644 --- a/erc +++ b/erc @@ -12,7 +12,11 @@ meta_commands["blame"] = function() author = string.match(lines, "author (%a+)") - message(author) + if author == nil then + message("Not checked in!") + else + message(author) + end end keys["%"] = function() @@ -35,6 +39,26 @@ keys["!"] = function() message(result) end +meta_commands["carp"] = function() + file = get_filename() + handle = io.popen("carp --check "..file) + result = handle:read("*a") + handle:close() + + if result.len == 0 then return end + if starts(result, "Invalid path") then + message("File not yet saved to disk!") + return + end + + split = result:gmatch(":") + + if split[0] == file then + move(tonumber(split[1]), tonumber(split[2])) + message(table.concat(table.unpack(split, 3), ":")) + end +end + function get_meta_commands() res = "" diff --git a/vimrc b/vimrc index 28e911f..31613c7 100644 --- a/vimrc +++ b/vimrc @@ -93,6 +93,7 @@ Bundle 'hellerve/luna-vim' Bundle 'tikhomirov/vim-glsl' Plugin 'rust-lang/rust.vim' Plugin 'kchmck/vim-coffee-script' +Plugin 'isRuslan/vim-es6' " Custom bundles if filereadable(expand("~/.vim.local/bundles.vim")) @@ -636,3 +637,5 @@ if filereadable(expand("~/.vimrc.local")) endif " }}} + +let g:syntastic_carp_checkers = ['carp']