Compare commits
7 commits
b14d2680e3
...
4cdadaaaf9
Author | SHA1 | Date | |
---|---|---|---|
4cdadaaaf9 | |||
75f62a7ffb | |||
1d2a775658 | |||
9a00d41394 | |||
293f2a1897 | |||
0602b8516b | |||
8c145ba626 |
7 changed files with 54 additions and 11 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
local arrr = require 'arrr'
|
||||
local params = arrr {
|
||||
{ "Sets the root to search in", "--root", "-r", 'root' };
|
||||
{ "Sets the root to search in", "--root", "-r", true };
|
||||
}{...}
|
||||
|
||||
local buf = {}
|
||||
|
|
|
@ -7,6 +7,8 @@ temp=$(mktemp -p /dev/shm -d -t git-hook.XXXX)
|
|||
export SRC_DIR=$(pwd)
|
||||
export WORK_DIR=$(git rev-parse --show-toplevel)
|
||||
|
||||
export commit=commit
|
||||
|
||||
new() {
|
||||
git status --porcelain | grep -E '^AM|^M|^A' | sed 's/^[^ ]* *//'
|
||||
}
|
||||
|
@ -22,8 +24,30 @@ check() {
|
|||
end"
|
||||
}
|
||||
|
||||
get_marks() {
|
||||
git status --porcelain | cut --bytes 4- | while read file
|
||||
do
|
||||
if [ -e "$temp/index/$file" ]
|
||||
then
|
||||
grep -n -i no$commit "$temp/index/$file" | sed "s/:/ /" | while read line
|
||||
do
|
||||
echo "$file:$line"
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
git checkout-index --prefix="$temp/index/" --all
|
||||
|
||||
marks=$(get_marks)
|
||||
if [ -n "$marks" ]
|
||||
then
|
||||
/bin/echo -e "\x1b[31m'no$commit' mark(s) found:\x1b[0m"
|
||||
echo $marks
|
||||
rm -rf $temp
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $temp/index/
|
||||
|
||||
ln -s "$WORK_DIR"/.git/ .git
|
||||
|
|
|
@ -37,5 +37,13 @@ return function(_, bufnr)
|
|||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "LspWorkspaces", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Rename", function(params)
|
||||
if #params.fargs > 0 then
|
||||
vim.lsp.buf.rename(params.fargs[1])
|
||||
else
|
||||
vim.lsp.buf.rename()
|
||||
end
|
||||
end, {nargs = "?"})
|
||||
end
|
||||
|
|
6
vim/plugin/coq.lua
Normal file
6
vim/plugin/coq.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
xpcall(function()
|
||||
require("coq")
|
||||
vim.api.nvim_command("command COQ COQnow --shut-up")
|
||||
end, function()
|
||||
vim.api.nvim_command("command COQ echoerr 'COQ not loaded.'")
|
||||
end)
|
|
@ -1,5 +1,14 @@
|
|||
local config = require 'lspconfig'
|
||||
|
||||
local ensure_capabilities
|
||||
xpcall(function()
|
||||
ensure_capabilities = require("coq").lsp_ensure_capabilities
|
||||
end, function()
|
||||
function ensure_capabilities(...)
|
||||
return ...
|
||||
end
|
||||
end)
|
||||
|
||||
local default = { on_attach = require 'lsp.attach' }
|
||||
for _, language in ipairs {
|
||||
"html",
|
||||
|
@ -11,5 +20,5 @@ for _, language in ipairs {
|
|||
"standardrb",
|
||||
"zls",
|
||||
} do
|
||||
config[language].setup(default)
|
||||
config[language].setup(ensure_capabilities(default))
|
||||
end
|
||||
|
|
|
@ -55,7 +55,7 @@ vim.api.nvim_create_user_command("Matcha", function(params)
|
|||
end, {nargs="+"})
|
||||
|
||||
vim.api.nvim_create_user_command("MatchaLocal", function(params)
|
||||
vim.fn.setloclist(0, findLocations(params.farts))
|
||||
vim.fn.setloclist(0, findLocations(params.fargs))
|
||||
vim.cmd("lopen")
|
||||
vim.cmd("lrewind")
|
||||
end, {nargs="+"})
|
||||
|
|
|
@ -30,15 +30,11 @@ use {
|
|||
{
|
||||
"hedyhli/outline.nvim", config = require 'config.outline';
|
||||
};
|
||||
{ 'jinh0/eyeliner.nvim', config = function()
|
||||
require('eyeliner').setup {
|
||||
highlight_on_key = true;
|
||||
dim = true;
|
||||
}
|
||||
end
|
||||
};
|
||||
'folke/twilight.nvim';
|
||||
'leafo/moonscript-vim';
|
||||
'ms-jpq/coq_nvim';
|
||||
'ms-jpq/coq.artifacts';
|
||||
'ms-jpq/coq.thirdparty';
|
||||
'neovim/nvim-lspconfig';
|
||||
'pigpigyyy/Yuescript-vim';
|
||||
'vim-scripts/openscad.vim';
|
||||
|
|
Loading…
Reference in a new issue