Compare commits

..
3 Commits
Author SHA1 Message Date
anth64 9fbdb4e259 docs: add license 2026-11-15 10:20:38 +01:00
anth64 4724eb8dd5 feat: add python formatting 2026-11-15 10:18:02 +01:00
anth64 e71b388358 feat: add python lsp and indentation 2026-11-15 10:18:02 +01:00
6 changed files with 51 additions and 2 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.
+1
View File
@@ -22,3 +22,4 @@ Language servers and formatters, per language:
- JavaScript/TypeScript: typescript (7+, uses `tsc --lsp`)
- HTML/CSS/JSON: vscode-langservers-extracted
- Lua: lua-language-server
- Python: basedpyright, ruff
+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" }
+5
View File
@@ -0,0 +1,5 @@
return {
name = "basedpyright",
cmd = "basedpyright-langserver --stdio",
roots = { "pyproject.toml", "setup.py", "requirements.txt", ".git" },
}
+11 -2
View File
@@ -18,7 +18,15 @@ plug.plugins.lspc.message_level = 2
require("set")
require("remap")
local filetypes = { "csharp", "html", "java", "javascript", "json", "lua" }
local filetypes = {
"csharp",
"html",
"java",
"javascript",
"json",
"lua",
"python",
}
settings = {}
for _, syntax in ipairs(filetypes) do
settings[syntax] = require("ftplugin/" .. syntax)
@@ -31,6 +39,7 @@ local servers = {
"java",
"javascript",
"json",
"python",
"typescript",
}
local ls_map = plug.plugins.lspc.ls_map
@@ -38,7 +47,7 @@ for _, syntax in ipairs(servers) do
ls_map[syntax] = require("lsp/" .. syntax)
end
local formatters = { "ansi_c", "cpp", "csharp" }
local formatters = { "ansi_c", "cpp", "csharp", "python" }
local format = plug.plugins.format
local on_save_syntaxes = {}
for _, syntax in ipairs(formatters) do