mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 16:51:34 +02:00
Add lvim config and nvim
This commit is contained in:
parent
0b1ace53f2
commit
d1af9278c5
19 changed files with 303 additions and 26 deletions
5
config/lvim/ftplugin/go.lua
Normal file
5
config/lvim/ftplugin/go.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
lvim.format_on_save = true
|
||||
lvim.lang.go.formatters = {
|
||||
{ exe = "gofmt" },
|
||||
{ exe = "goimports" },
|
||||
}
|
||||
22
config/lvim/ftplugin/java.lua
Normal file
22
config/lvim/ftplugin/java.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
if vim.fn.has("mac") == 1 then
|
||||
WORKSPACE_PATH = "/Users/" .. USER .. "/workspace/"
|
||||
elseif vim.fn.has("unix") == 1 then
|
||||
WORKSPACE_PATH = "/home/" .. USER .. "/workspace/"
|
||||
else
|
||||
print("Unsupported system")
|
||||
end
|
||||
|
||||
JAVA_LS_EXECUTABLE = os.getenv("HOME") .. "/.local/share/lunarvim/lvim/utils/bin/jdtls"
|
||||
|
||||
require("jdtls").start_or_attach({
|
||||
on_attach = require("lsp").common_on_attach,
|
||||
cmd = { JAVA_LS_EXECUTABLE, WORKSPACE_PATH .. vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t") },
|
||||
})
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<leader>la", ":lua require('jdtls').code_action()<CR>", { noremap = true, silent = true })
|
||||
|
||||
vim.cmd("command! -buffer JdtCompile lua require('jdtls').compile()")
|
||||
vim.cmd("command! -buffer JdtUpdateConfig lua require('jdtls').update_project_config()")
|
||||
vim.cmd("command! -buffer JdtJol lua require('jdtls').jol()")
|
||||
vim.cmd("command! -buffer JdtBytecode lua require('jdtls').javap()")
|
||||
vim.cmd("command! -buffer JdtJshell lua require('jdtls').jshell()")
|
||||
24
config/lvim/ftplugin/javascript.lua
Normal file
24
config/lvim/ftplugin/javascript.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
lvim.lang.javascript.formatters = {
|
||||
-- { exe = "eslint_d" },
|
||||
{ exe = "prettierd" },
|
||||
}
|
||||
|
||||
lvim.lang.javascript.linters = {
|
||||
{ exe = "eslint_d" },
|
||||
}
|
||||
|
||||
lvim.lang.javascript.lsp.setup.handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(_, _, p, client_id, _, config)
|
||||
if p.diagnostics ~= nil then
|
||||
local i = 1
|
||||
while i <= #p.diagnostics do
|
||||
if p.diagnostics[i].code == 80001 then
|
||||
table.remove(p.diagnostics, i)
|
||||
else
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(_, _, p, client_id, _, config)
|
||||
end,
|
||||
}
|
||||
9
config/lvim/ftplugin/lua.lua
Normal file
9
config/lvim/ftplugin/lua.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
lvim.format_on_save = true
|
||||
lvim.lang.lua.formatters = {
|
||||
{ exe = "stylua" },
|
||||
}
|
||||
|
||||
lvim.lang.lua.linters = {
|
||||
-- { exe = "luacheck" },
|
||||
-- { exe = "selene" },
|
||||
}
|
||||
9
config/lvim/ftplugin/python.lua
Normal file
9
config/lvim/ftplugin/python.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
lvim.format_on_save = true
|
||||
lvim.lang.python.formatters = {
|
||||
{ exe = "black" },
|
||||
{ exe = "isort" },
|
||||
}
|
||||
|
||||
lvim.lang.python.linters = {
|
||||
{ exe = "flake8" },
|
||||
}
|
||||
8
config/lvim/ftplugin/typescript.lua
Normal file
8
config/lvim/ftplugin/typescript.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
lvim.lang.typescript.formatters = {
|
||||
-- { exe = "eslint_d" },
|
||||
{ exe = "prettierd" },
|
||||
}
|
||||
|
||||
lvim.lang.typescript.linters = {
|
||||
{ exe = "eslint_d" },
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue