Compare commits

..
16 Commits
22 changed files with 143 additions and 15 deletions

No files matched your search

+28
View File
@@ -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.
+13 -2
View File
@@ -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
-5
View File
@@ -1,5 +0,0 @@
settings = {
csharp = { "set expandtab on", "set tabwidth 4" },
java = { "set expandtab on", "set tabwidth 4" },
lua = { "set expandtab on", "set tabwidth 2" },
}
+5
View File
@@ -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)
+1
View File
@@ -0,0 +1 @@
return require("format/ansi_c")
+5
View File
@@ -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)
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 4" }
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 2" }
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 4" }
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 2" }
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 4" }
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 2" }
+1
View File
@@ -0,0 +1 @@
return { "set expandtab on", "set tabwidth 4" }
+5
View File
@@ -0,0 +1,5 @@
return {
name = "css-language-server",
cmd = "vscode-css-language-server --stdio",
settings = { css = { validate = true } },
}
+7
View File
@@ -0,0 +1,7 @@
return {
name = "html-language-server",
cmd = "vscode-html-language-server --stdio",
settings = {
html = { validate = { scripts = true, styles = true } },
},
}
+1
View File
@@ -0,0 +1 @@
return require("lsp/typescript")
+5
View File
@@ -0,0 +1,5 @@
return {
name = "json-language-server",
cmd = "vscode-json-language-server --stdio",
settings = { json = { validate = { enable = true } } },
}
+5
View File
@@ -0,0 +1,5 @@
return {
name = "basedpyright",
cmd = "basedpyright-langserver --stdio",
roots = { "pyproject.toml", "setup.py", "requirements.txt", ".git" },
}
+5
View File
@@ -0,0 +1,5 @@
return {
name = "typescript",
cmd = "tsc --lsp --stdio",
roots = { "package.json", "tsconfig.json", "jsconfig.json" },
}
+18 -4
View File
@@ -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 ")
+1
View File
@@ -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)
+37 -4
View File
@@ -9,24 +9,57 @@ plug.init({
{ "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.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 servers = { "csharp", "java" } 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 local ls_map = plug.plugins.lspc.ls_map
for _, syntax in ipairs(servers) do for _, syntax in ipairs(servers) do
ls_map[syntax] = require("lsp/" .. syntax) ls_map[syntax] = require("lsp/" .. syntax)
end end
local formatters = { "csharp" } local formatters = { "ansi_c", "cpp", "csharp", "python" }
local format = plug.plugins.format local format = plug.plugins.format
format.options.on_save = true 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 for _, syntax in ipairs(formatters) do
format.formatters[syntax] = require("format/" .. syntax) format.formatters[syntax] = require("format/" .. syntax)
end end