Compare commits
18
Commits
d3de51fe24
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59f1a2e7e7 | ||
|
|
3c4056b785 | ||
|
|
6d48561d99 | ||
|
|
59f9f64020 | ||
|
|
9fbdb4e259 | ||
|
|
4724eb8dd5 | ||
|
|
e71b388358 | ||
|
|
b9326f4d2c | ||
|
|
491421e6f4 | ||
|
|
596df85e51 | ||
|
|
4652d0673e | ||
|
|
377202ddb3 | ||
|
|
9558301e8f | ||
|
|
e4243adae0 | ||
|
|
8ab6fb23d2 | ||
|
|
018af24722 | ||
|
|
2cce717f2b | ||
|
|
0d00c20263 |
No files matched your search
@@ -0,0 +1,28 @@
|
|||||||
|
BSD 3-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2026, anth64
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
@@ -10,5 +10,16 @@ My configuration for [vis](https://github.com/martanne/vis).
|
|||||||
git clone https://github.com/erf/vis-plug ~/.config/vis/plugins/vis-plug
|
git clone https://github.com/erf/vis-plug ~/.config/vis/plugins/vis-plug
|
||||||
```
|
```
|
||||||
|
|
||||||
[ripgrep](https://github.com/BurntSushi/ripgrep), [fzf](https://github.com/junegunn/fzf) and
|
[ripgrep](https://github.com/BurntSushi/ripgrep) and
|
||||||
[lua-language-server](https://github.com/LuaLS/lua-language-server) are required.
|
[fzf](https://github.com/junegunn/fzf) are required.
|
||||||
|
|
||||||
|
Language servers and formatters, per language:
|
||||||
|
|
||||||
|
- C/C++: clangd, clang-format
|
||||||
|
- C#: csharp-ls, csharpier
|
||||||
|
- Go: gopls
|
||||||
|
- Java: jdtls (in `~/.local/share/java/jdtls`)
|
||||||
|
- JavaScript/TypeScript: typescript (7+, uses `tsc --lsp`)
|
||||||
|
- HTML/CSS/JSON: vscode-langservers-extracted
|
||||||
|
- Lua: lua-language-server
|
||||||
|
- Python: basedpyright, ruff
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
settings = {
|
|
||||||
lua = { "set expandtab on", "set tabwidth 2" },
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
local format = require("plugins/vis-plug").plugins.format
|
||||||
|
|
||||||
|
return format.stdio_formatter(function(win)
|
||||||
|
return "clang-format" .. format.with_filename(win, " --assume-filename=")
|
||||||
|
end)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return require("format/ansi_c")
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
local format = require("plugins/vis-plug").plugins.format
|
||||||
|
|
||||||
|
return format.stdio_formatter(function(win)
|
||||||
|
return "csharpier format" .. format.with_filename(win, " --stdin-path ")
|
||||||
|
end)
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
local format = require("plugins/vis-plug").plugins.format
|
||||||
|
|
||||||
|
return format.stdio_formatter(function(win)
|
||||||
|
return "ruff format" .. format.with_filename(win, " --stdin-filename ") .. " -"
|
||||||
|
end)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 4" }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 2" }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 4" }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 2" }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 4" }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 2" }
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return { "set expandtab on", "set tabwidth 4" }
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
name = "csharp-ls",
|
||||||
|
cmd = "csharp-ls",
|
||||||
|
roots = { "*.sln", "*.slnx", "*.csproj" },
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
name = "css-language-server",
|
||||||
|
cmd = "vscode-css-language-server --stdio",
|
||||||
|
settings = { css = { validate = true } },
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
name = "html-language-server",
|
||||||
|
cmd = "vscode-html-language-server --stdio",
|
||||||
|
settings = {
|
||||||
|
html = { validate = { scripts = true, styles = true } },
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
name = "jdtls",
|
||||||
|
cmd = os.getenv("HOME") .. "/.local/share/java/jdtls/bin/jdtls",
|
||||||
|
roots = { "gradlew", "mvnw", ".git" },
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
return require("lsp/typescript")
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
name = "json-language-server",
|
||||||
|
cmd = "vscode-json-language-server --stdio",
|
||||||
|
settings = { json = { validate = { enable = true } } },
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
name = "basedpyright",
|
||||||
|
cmd = "basedpyright-langserver --stdio",
|
||||||
|
roots = { "pyproject.toml", "setup.py", "requirements.txt", ".git" },
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
name = "typescript",
|
||||||
|
cmd = "tsc --lsp --stdio",
|
||||||
|
roots = { "package.json", "tsconfig.json", "jsconfig.json" },
|
||||||
|
}
|
||||||
@@ -1,9 +1,23 @@
|
|||||||
local plug = require("plugins/vis-plug")
|
local plug = require("plugins/vis-plug")
|
||||||
local n = vis.modes.NORMAL
|
local n = vis.modes.NORMAL
|
||||||
|
local leader = " "
|
||||||
|
|
||||||
vis:map(n, "=", plug.plugins.format.apply)
|
local format = plug.plugins.format
|
||||||
|
|
||||||
|
-- configured formatter if the syntax has one, else the language server
|
||||||
|
local function format_file(keys)
|
||||||
|
if format.pick(vis.win) then
|
||||||
|
return format.apply(keys)
|
||||||
|
end
|
||||||
|
vis:command("lspc-format")
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
vis:map(n, "=", format_file)
|
||||||
|
|
||||||
vis:map(n, "<C-p>", ":fzf<Enter>")
|
vis:map(n, "<C-p>", ":fzf<Enter>")
|
||||||
vis:map(n, " pf", ":fzf<Enter>")
|
vis:map(n, leader .. "pf", ":fzf<Enter>")
|
||||||
vis:map(n, " ps", ":grep ")
|
vis:map(n, leader .. "ps", ":grep ")
|
||||||
vis:map(n, " pv", ":e .<Enter>")
|
vis:map(n, leader .. "pv", ":e .<Enter>")
|
||||||
|
vis:map(n, leader .. "f", format_file)
|
||||||
|
vis:map(n, leader .. "rn", ":lspc-rename ")
|
||||||
@@ -2,4 +2,5 @@ vis.events.subscribe(vis.events.WIN_OPEN, function()
|
|||||||
vis:command("set number on")
|
vis:command("set number on")
|
||||||
vis:command("set relativenumbers on")
|
vis:command("set relativenumbers on")
|
||||||
vis:command("set colorcolumn 80")
|
vis:command("set colorcolumn 80")
|
||||||
|
vis:command("set autoindent on")
|
||||||
end)
|
end)
|
||||||
@@ -3,18 +3,63 @@ require("vis")
|
|||||||
local plug = require("plugins/vis-plug")
|
local plug = require("plugins/vis-plug")
|
||||||
|
|
||||||
plug.init({
|
plug.init({
|
||||||
{ "https://codeberg.org/muhq/vis-lspc" },
|
{ "https://codeberg.org/muhq/vis-lspc", alias = "lspc" },
|
||||||
{ "https://codefloe.com/mcepl/vis-fzf-open" },
|
{ "https://codefloe.com/mcepl/vis-fzf-open" },
|
||||||
{ "milhnl/vis-format", alias = "format" },
|
{ "milhnl/vis-format", alias = "format" },
|
||||||
{ "jocap/vis-filetype-settings", file = "vis-filetype-settings" },
|
{ "jocap/vis-filetype-settings", file = "vis-filetype-settings" },
|
||||||
{ "https://codeberg.org/wf/vis-paw" },
|
{ "https://codeberg.org/wf/vis-paw" },
|
||||||
{ "https://repo.or.cz/vis-quickfix.git", alias = "qf" },
|
{ "https://repo.or.cz/vis-quickfix.git", alias = "qf" },
|
||||||
|
{ "milhnl/vis-editorconfig-options", file = "init" },
|
||||||
|
{ "Nomarian/vis-commentary", alias = "commentary" },
|
||||||
|
{ "https://codeberg.org/luxanna/vis-autoclose" },
|
||||||
{ "przmv/base16-vis", theme = true, file = "themes/base16-brewer" },
|
{ "przmv/base16-vis", theme = true, file = "themes/base16-brewer" },
|
||||||
}, true)
|
}, true)
|
||||||
|
|
||||||
plug.plugins.format.options.on_save = true
|
plug.plugins.commentary()
|
||||||
plug.plugins.qf.grepprg = "rg --vimgrep --sort path </dev/null"
|
plug.plugins.qf.grepprg = "rg --vimgrep --sort path </dev/null"
|
||||||
|
plug.plugins.lspc.message_level = 2
|
||||||
|
|
||||||
require("set")
|
require("set")
|
||||||
require("remap")
|
require("remap")
|
||||||
require("filetypes")
|
|
||||||
|
local filetypes = {
|
||||||
|
"csharp",
|
||||||
|
"html",
|
||||||
|
"java",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"python",
|
||||||
|
}
|
||||||
|
settings = {}
|
||||||
|
for _, syntax in ipairs(filetypes) do
|
||||||
|
settings[syntax] = require("ftplugin/" .. syntax)
|
||||||
|
end
|
||||||
|
|
||||||
|
local servers = {
|
||||||
|
"csharp",
|
||||||
|
"css",
|
||||||
|
"html",
|
||||||
|
"java",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"python",
|
||||||
|
"typescript",
|
||||||
|
}
|
||||||
|
local ls_map = plug.plugins.lspc.ls_map
|
||||||
|
for _, syntax in ipairs(servers) do
|
||||||
|
ls_map[syntax] = require("lsp/" .. syntax)
|
||||||
|
end
|
||||||
|
|
||||||
|
local formatters = { "ansi_c", "cpp", "csharp", "python" }
|
||||||
|
local format = plug.plugins.format
|
||||||
|
local on_save_syntaxes = {}
|
||||||
|
for _, syntax in ipairs(formatters) do
|
||||||
|
on_save_syntaxes[syntax] = true
|
||||||
|
end
|
||||||
|
format.options.on_save = function(win)
|
||||||
|
return on_save_syntaxes[win.syntax] == true
|
||||||
|
end
|
||||||
|
for _, syntax in ipairs(formatters) do
|
||||||
|
format.formatters[syntax] = require("format/" .. syntax)
|
||||||
|
end
|
||||||
Reference in new issue
Block a user