Compare commits
16
Commits
2cce717f2b
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59f1a2e7e7 | ||
|
|
3c4056b785 | ||
|
|
6d48561d99 | ||
|
|
59f9f64020 | ||
|
|
9fbdb4e259 | ||
|
|
4724eb8dd5 | ||
|
|
e71b388358 | ||
|
|
b9326f4d2c | ||
|
|
491421e6f4 | ||
|
|
596df85e51 | ||
|
|
4652d0673e | ||
|
|
377202ddb3 | ||
|
|
9558301e8f | ||
|
|
e4243adae0 | ||
|
|
8ab6fb23d2 | ||
|
|
018af24722 |
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
|
||||
```
|
||||
|
||||
[ripgrep](https://github.com/BurntSushi/ripgrep), [fzf](https://github.com/junegunn/fzf) and
|
||||
[lua-language-server](https://github.com/LuaLS/lua-language-server) are required.
|
||||
[ripgrep](https://github.com/BurntSushi/ripgrep) and
|
||||
[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,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" },
|
||||
}
|
||||
@@ -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 "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 = "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 @@
|
||||
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 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, " pf", ":fzf<Enter>")
|
||||
vis:map(n, " ps", ":grep ")
|
||||
vis:map(n, " pv", ":e .<Enter>")
|
||||
vis:map(n, leader .. "pf", ":fzf<Enter>")
|
||||
vis:map(n, leader .. "ps", ":grep ")
|
||||
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 relativenumbers on")
|
||||
vis:command("set colorcolumn 80")
|
||||
vis:command("set autoindent on")
|
||||
end)
|
||||
@@ -9,24 +9,57 @@ plug.init({
|
||||
{ "jocap/vis-filetype-settings", file = "vis-filetype-settings" },
|
||||
{ "https://codeberg.org/wf/vis-paw" },
|
||||
{ "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" },
|
||||
}, true)
|
||||
|
||||
plug.plugins.commentary()
|
||||
plug.plugins.qf.grepprg = "rg --vimgrep --sort path </dev/null"
|
||||
plug.plugins.lspc.message_level = 2
|
||||
|
||||
require("set")
|
||||
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
|
||||
for _, syntax in ipairs(servers) do
|
||||
ls_map[syntax] = require("lsp/" .. syntax)
|
||||
end
|
||||
|
||||
local formatters = { "csharp" }
|
||||
local formatters = { "ansi_c", "cpp", "csharp", "python" }
|
||||
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
|
||||
format.formatters[syntax] = require("format/" .. syntax)
|
||||
end
|
||||
Reference in new issue
Block a user