neoformat
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"trailingComma": "es5",
|
||||
"tabWidth": 4,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"overrides": [
|
||||
{
|
||||
"files": ".prettierrc",
|
||||
"options": {
|
||||
"parser": "json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
column_width = 120
|
||||
column_width = 80
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
indent_type = "Tabs"
|
||||
indent_width = 4
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "None"
|
||||
|
||||
@@ -1,44 +1,41 @@
|
||||
if vim.env.PROF then
|
||||
local snacks = vim.fn.stdpath("data") .. "/lazy/snacks.nvim"
|
||||
local snacks = vim.fn.stdpath "data" .. "/lazy/snacks.nvim"
|
||||
|
||||
vim.opt.rtp:append( snacks )
|
||||
require("snacks.profiler").startup({
|
||||
vim.opt.rtp:append(snacks)
|
||||
require("snacks.profiler").startup {
|
||||
startup = {
|
||||
event = "UIEnter",
|
||||
},
|
||||
})
|
||||
}
|
||||
end
|
||||
|
||||
vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46_cache/"
|
||||
|
||||
local home = os.getenv("HOME")
|
||||
local home = os.getenv "HOME"
|
||||
package.path = package.path
|
||||
.. ";" .. home .. "/.luarocks/share/lua/5.4/?.lua"
|
||||
.. ";" .. home .. "/.luarocks/share/lua/5.4/?/init.lua"
|
||||
.. ";"
|
||||
.. home
|
||||
.. "/.luarocks/share/lua/5.4/?.lua"
|
||||
.. ";"
|
||||
.. home
|
||||
.. "/.luarocks/share/lua/5.4/?/init.lua"
|
||||
|
||||
package.cpath = package.cpath
|
||||
.. ";" .. home .. "/.luarocks/lib/lua/5.4/?.so"
|
||||
package.cpath = package.cpath .. ";" .. home .. "/.luarocks/lib/lua/5.4/?.so"
|
||||
|
||||
vim.cmd('source ' .. vim.fn.stdpath("config") .. "/cursor.vim")
|
||||
require("config.lazy")
|
||||
require("options")
|
||||
require("globals")
|
||||
require("mappings")
|
||||
require("autocmd")
|
||||
vim.cmd("source " .. vim.fn.stdpath "config" .. "/cursor.vim")
|
||||
require "config.lazy"
|
||||
require "options"
|
||||
require "globals"
|
||||
require "mappings"
|
||||
require "autocmd"
|
||||
require("minimodules").load_modules()
|
||||
-- require("coc-settings")
|
||||
|
||||
if vim.g.neovide then
|
||||
require("config.neovide")
|
||||
require "config.neovide"
|
||||
end
|
||||
|
||||
vim.filetype.add({
|
||||
vim.filetype.add {
|
||||
pattern = {
|
||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
||||
[".*/uwsm/env.*"] = "zsh",
|
||||
}
|
||||
})
|
||||
|
||||
-- for _, v in ipairs( vim.fn.readdir( vim.g.base46_cache )) do
|
||||
-- dofile( vim.g.base46_cache .. v )
|
||||
-- end
|
||||
},
|
||||
}
|
||||
|
||||
+11
-9
@@ -2,26 +2,28 @@ local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id( args.data.client_id )
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client then
|
||||
vim.lsp.document_color.enable(false, args.buf, { "background" })
|
||||
-- require("workspace-diagnostics").populate_workspace_diagnostics(client, 0)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("VimLeave", {
|
||||
command = "set guicursor=a:ver25-Cursor"
|
||||
command = "set guicursor=a:ver25-Cursor",
|
||||
})
|
||||
|
||||
-- autocmd({ "CursorHold" }, {
|
||||
-- callback = function()
|
||||
-- vim.diagnostic.open_float(nil, { focus = false })
|
||||
-- end
|
||||
-- })
|
||||
autocmd("BufWritePre", {
|
||||
callback = function()
|
||||
local ok = pcall(function()
|
||||
vim.cmd "undojoin"
|
||||
end)
|
||||
vim.cmd "Neoformat"
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd({ "InsertLeave" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
+70
-54
@@ -12,46 +12,15 @@ local function flatten_to_array(t)
|
||||
_flatten(t)
|
||||
return res
|
||||
end
|
||||
-- local cmp = require("cmp")
|
||||
-- local cmp_lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = vim.tbl_deep_extend(
|
||||
"force",
|
||||
{},
|
||||
vim.lsp.protocol.make_client_capabilities()
|
||||
-- cmp_lsp.default_capabilities()
|
||||
)
|
||||
|
||||
local cmp_kinds = {
|
||||
Text = ' ',
|
||||
Method = ' ',
|
||||
Function = ' ',
|
||||
Constructor = ' ',
|
||||
Field = ' ',
|
||||
Variable = ' ',
|
||||
Class = ' ',
|
||||
Interface = ' ',
|
||||
Module = ' ',
|
||||
Property = ' ',
|
||||
Unit = ' ',
|
||||
Value = ' ',
|
||||
Enum = ' ',
|
||||
Keyword = ' ',
|
||||
Snippet = ' ',
|
||||
Color = ' ',
|
||||
File = ' ',
|
||||
Reference = ' ',
|
||||
Folder = ' ',
|
||||
EnumMember = ' ',
|
||||
Constant = ' ',
|
||||
Struct = ' ',
|
||||
Event = ' ',
|
||||
Operator = ' ',
|
||||
TypeParameter = ' ',
|
||||
}
|
||||
|
||||
require("fidget").setup({})
|
||||
require("fidget").setup {}
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
require("mason-lspconfig").setup {
|
||||
automatic_enable = true,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
@@ -66,24 +35,28 @@ require("mason-lspconfig").setup({
|
||||
end,
|
||||
|
||||
["tailwindcss"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.tailwindcss.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end,
|
||||
|
||||
["css-lsp"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.cssls.setup {
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end,
|
||||
|
||||
zls = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.zls.setup({
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.zls.setup {
|
||||
capabilities = capabilities,
|
||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
||||
root_dir = lspconfig.util.root_pattern(
|
||||
".git",
|
||||
"build.zig",
|
||||
"zls.json"
|
||||
),
|
||||
settings = {
|
||||
zls = {
|
||||
enable_inlay_hints = true,
|
||||
@@ -91,27 +64,33 @@ require("mason-lspconfig").setup({
|
||||
warn_style = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
vim.g.zig_fmt_parse_errors = 0
|
||||
vim.g.zig_fmt_autosave = 0
|
||||
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local lspconfig = require "lspconfig"
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
}
|
||||
}
|
||||
}
|
||||
globals = {
|
||||
"bit",
|
||||
"vim",
|
||||
"it",
|
||||
"describe",
|
||||
"before_each",
|
||||
"after_each",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
-- cmp.setup {
|
||||
-- preselect = 'None',
|
||||
@@ -172,7 +151,7 @@ require("mason-lspconfig").setup({
|
||||
-- }),
|
||||
-- }
|
||||
|
||||
vim.diagnostic.config({
|
||||
vim.diagnostic.config {
|
||||
-- update_in_insert = true,
|
||||
virtual_text = false,
|
||||
virtual_lines = false,
|
||||
@@ -186,20 +165,32 @@ vim.diagnostic.config({
|
||||
header = "",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
local lspconfig = vim.lsp.config
|
||||
|
||||
lspconfig("texlab", {
|
||||
cmd = { "texlab" },
|
||||
filetypes = { "tex", "bib", "plaintex" },
|
||||
root_markers = { ".git", ".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
|
||||
root_markers = {
|
||||
".git",
|
||||
".latexmkrc",
|
||||
"latexmkrc",
|
||||
".texlabroot",
|
||||
"texlabroot",
|
||||
"Tectonic.toml",
|
||||
},
|
||||
settings = {
|
||||
texlab = {
|
||||
rootDirectory = nil,
|
||||
build = {
|
||||
executable = "latexmk",
|
||||
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
||||
args = {
|
||||
"-pdf",
|
||||
"-interaction=nonstopmode",
|
||||
"-synctex=1",
|
||||
"%f",
|
||||
},
|
||||
onSave = true,
|
||||
forwardSearchAfter = true,
|
||||
},
|
||||
@@ -207,7 +198,8 @@ lspconfig("texlab", {
|
||||
executable = "zathura",
|
||||
args = {
|
||||
"--synctex-editor-command",
|
||||
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername,
|
||||
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]]
|
||||
.. vim.v.servername,
|
||||
"--synctex-forward",
|
||||
"%l:1:%f",
|
||||
"%p",
|
||||
@@ -220,7 +212,7 @@ lspconfig("texlab", {
|
||||
diagnosticsDelay = 300,
|
||||
latexFormatter = "latexindent",
|
||||
latexindent = {
|
||||
['local'] = nil,
|
||||
["local"] = nil,
|
||||
modifyLineBreaks = false,
|
||||
},
|
||||
bibtexFormatter = "texlab",
|
||||
@@ -233,6 +225,27 @@ lspconfig("qmlls", {
|
||||
cmd = { "qmlls6" },
|
||||
})
|
||||
|
||||
lspconfig("jsonls", {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig("yamlls", {
|
||||
settings = {
|
||||
yaml = {
|
||||
schemaStore = {
|
||||
enable = false,
|
||||
url = "",
|
||||
},
|
||||
schemas = require("schemastore").yaml.schemas(),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local lspenable = vim.lsp.enable
|
||||
local servers = {
|
||||
"html",
|
||||
@@ -251,7 +264,10 @@ local flat_servers = flatten_to_array(servers)
|
||||
for _, server in ipairs(flat_servers) do
|
||||
lspconfig(server, {
|
||||
on_attach = function(client, bufnr)
|
||||
require("workspace-diagnostics").populate_workspace_diagnostics( client, bufnr )
|
||||
require("workspace-diagnostics").populate_workspace_diagnostics(
|
||||
client,
|
||||
bufnr
|
||||
)
|
||||
end,
|
||||
})
|
||||
lspenable(server)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
-- local null_ls = require("null-ls")
|
||||
--
|
||||
-- local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false })
|
||||
-- local event = "BufWritePre" -- or "BufWritePost"
|
||||
-- local async = event == "BufWritePost"
|
||||
--
|
||||
-- null_ls.setup({
|
||||
-- on_attach = function(client, bufnr)
|
||||
-- if client.supports_method("textDocument/formatting") then
|
||||
-- vim.keymap.set("n", "<Leader>f", function()
|
||||
-- vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() })
|
||||
-- end, { buffer = bufnr, desc = "[lsp] format" })
|
||||
--
|
||||
-- -- format on save
|
||||
-- vim.api.nvim_clear_autocmds({ buffer = bufnr, group = group })
|
||||
-- vim.api.nvim_create_autocmd(event, {
|
||||
-- buffer = bufnr,
|
||||
-- group = group,
|
||||
-- callback = function()
|
||||
-- vim.lsp.buf.format({ bufnr = bufnr, async = async })
|
||||
-- end,
|
||||
-- desc = "[lsp] format on save",
|
||||
-- })
|
||||
-- end
|
||||
--
|
||||
-- if client.supports_method("textDocument/rangeFormatting") then
|
||||
-- vim.keymap.set("x", "<Leader>f", function()
|
||||
-- vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() })
|
||||
-- end, { buffer = bufnr, desc = "[lsp] format" })
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
@@ -0,0 +1,19 @@
|
||||
local prettier = require("prettier")
|
||||
|
||||
prettier.setup({
|
||||
bin = 'prettier',
|
||||
filetypes = {
|
||||
"css",
|
||||
"graphql",
|
||||
"html",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"json",
|
||||
"less",
|
||||
"markdown",
|
||||
"scss",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"yaml",
|
||||
},
|
||||
})
|
||||
+51
-40
@@ -1,25 +1,25 @@
|
||||
return {
|
||||
{
|
||||
require("plugins.colorschemes")
|
||||
require "plugins.colorschemes",
|
||||
},
|
||||
{
|
||||
"nvim-mini/mini.nvim",
|
||||
version = false,
|
||||
|
||||
modules = function()
|
||||
require("config.mini-modules")
|
||||
require "config.mini-modules"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
config = function()
|
||||
require("config.treesitter")
|
||||
require "config.treesitter"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
require("config.autosession")
|
||||
require "config.autosession"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -28,7 +28,7 @@ return {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("config.telescope")
|
||||
require "config.telescope"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -44,26 +44,26 @@ return {
|
||||
"akinsho/bufferline.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("config.barbar")
|
||||
require "config.barbar"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function ()
|
||||
require("config.lualine")
|
||||
config = function()
|
||||
require "config.lualine"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mawkler/modicator.nvim",
|
||||
config = function()
|
||||
require("config.modicator")
|
||||
end
|
||||
require "config.modicator"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"jiaoshijie/undotree",
|
||||
config = function()
|
||||
require("config.undotree")
|
||||
require "config.undotree"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -74,7 +74,7 @@ return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("config.autopairs")
|
||||
require "config.autopairs"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -109,17 +109,17 @@ return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
require("config.dapconf")
|
||||
require "config.dapconf"
|
||||
end,
|
||||
},
|
||||
{
|
||||
require("config.snacks")
|
||||
require "config.snacks",
|
||||
},
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = function()
|
||||
require("config.lazydev")
|
||||
require "config.lazydev"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -131,20 +131,21 @@ return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- "saadparwaiz1/cmp_luasnip",
|
||||
"j-hui/fidget.nvim",
|
||||
"b0o/schemastore.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("config.lspconfig")
|
||||
require "config.lspconfig"
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "smolck/command-completion.nvim",
|
||||
-- opts = {
|
||||
-- border = nil,
|
||||
-- highlight_selection = true,
|
||||
-- use_matchfuzzy = true,
|
||||
-- tab_completion = true,
|
||||
-- },
|
||||
-- },
|
||||
{
|
||||
"smolck/command-completion.nvim",
|
||||
opts = {
|
||||
border = nil,
|
||||
highlight_selection = true,
|
||||
use_matchfuzzy = true,
|
||||
tab_completion = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
"andweeb/presence.nvim",
|
||||
},
|
||||
@@ -158,7 +159,7 @@ return {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("config.harpoon")
|
||||
require "config.harpoon"
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
@@ -180,7 +181,7 @@ return {
|
||||
{
|
||||
"f3fora/nvim-texlabconfig",
|
||||
config = function()
|
||||
require("config.texlab")
|
||||
require "config.texlab"
|
||||
end,
|
||||
build = "go build",
|
||||
},
|
||||
@@ -199,7 +200,7 @@ return {
|
||||
{
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
config = function()
|
||||
require("config.refactoring")
|
||||
require "config.refactoring"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -226,27 +227,27 @@ return {
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
picker_opts = require("telescope.themes").get_dropdown({
|
||||
picker_opts = require("telescope.themes").get_dropdown {
|
||||
enable_preview = true,
|
||||
}),
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"aznhe21/actions-preview.nvim",
|
||||
config = function()
|
||||
require("config.actions-preview")
|
||||
require "config.actions-preview"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
require("config.lint")
|
||||
require "config.lint"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rachartier/tiny-inline-diagnostic.nvim",
|
||||
config = function()
|
||||
require("config.TID")
|
||||
require "config.TID"
|
||||
end,
|
||||
},
|
||||
{
|
||||
@@ -256,27 +257,37 @@ return {
|
||||
"artemave/workspace-diagnostics.nvim",
|
||||
},
|
||||
{
|
||||
require("config.dev-tools")
|
||||
require "config.dev-tools",
|
||||
},
|
||||
{
|
||||
"Fildo7525/pretty_hover",
|
||||
event = "LspAttach",
|
||||
opts = {}
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"knubie/vim-kitty-navigator",
|
||||
build = "cp ./*.py ~/.config/kitty/"
|
||||
build = "cp ./*.py ~/.config/kitty/",
|
||||
},
|
||||
{
|
||||
require("config.dropbar")
|
||||
require "config.dropbar",
|
||||
},
|
||||
{
|
||||
require("config.blink")
|
||||
require "config.blink",
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("config.gitsigns")
|
||||
require "config.gitsigns"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"sbdchd/neoformat",
|
||||
init = function()
|
||||
vim.cmd(
|
||||
"source "
|
||||
.. vim.fn.stdpath "config"
|
||||
.. "/lua/plugins/neoformat.vim"
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
let g:neoformat_enabled_python = ['autopep8']
|
||||
let g:neoformat_enabled_javascript = ['prettier']
|
||||
let g:neoformat_enabled_html = ['prettier']
|
||||
let g:neoformat_enabled_css = ['prettier']
|
||||
let g:neoformat_enabled_json = ['prettier']
|
||||
let g:neoformat_enabled_yaml = ['prettier']
|
||||
let g:neoformat_enabled_lua = ['stylua']
|
||||
let g:neoformat_enabled_rust = ['rustfmt']
|
||||
let g:neoformat_enabled_cpp = ['uncrustify']
|
||||
let g:neoformat_enabled_markdown = ['prettier']
|
||||
|
||||
let g:neoformat_basic_format_align = 1
|
||||
let g:neoformat_basic_format_retab = 1
|
||||
let g:neoformat_basic_format_trim = 1
|
||||
Reference in New Issue
Block a user