Compare commits
2 commits
77504f4af0
...
2927afe3e2
| Author | SHA1 | Date | |
|---|---|---|---|
| 2927afe3e2 | |||
| 0b5e0531b6 |
16 changed files with 47 additions and 48 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -149,3 +149,6 @@
|
|||
[submodule "pack/general/start/playground"]
|
||||
path = pack/general/start/playground
|
||||
url = https://github.com/nvim-treesitter/playground
|
||||
[submodule "pack/general/start/conform.nvim"]
|
||||
path = pack/general/start/conform.nvim
|
||||
url = https://github.com/stevearc/conform.nvim
|
||||
|
|
|
|||
65
init.lua
65
init.lua
|
|
@ -221,17 +221,12 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
end,
|
||||
})
|
||||
|
||||
---- formatter.nvim ----
|
||||
require("formatter").setup({
|
||||
filetype = {
|
||||
terraform = {
|
||||
require("formatter.filetypes.terraform").terraformfmt,
|
||||
},
|
||||
},
|
||||
["*"] = {
|
||||
-- "formatter.filetypes.any" defines default configurations for any
|
||||
-- filetype
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
---- conform.nvim ----
|
||||
require("conform").setup({
|
||||
format_on_save = {
|
||||
-- These options will be passed to conform.format()
|
||||
timeout_ms = 500,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
})
|
||||
|
||||
|
|
@ -332,9 +327,9 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
|
||||
vim.keymap.set("n", "<Leader>q", vim.diagnostic.setloclist)
|
||||
vim.keymap.set("n", "<F3>", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end)
|
||||
-- vim.keymap.segcjk("n", "<F3>", function()
|
||||
-- vim.lsp.buf.format({ async = true })
|
||||
-- end)
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
|
|
@ -416,26 +411,26 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Auto format on save
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
callback = function()
|
||||
if vim.b.disable_format then
|
||||
return
|
||||
end
|
||||
local lsp_format = false
|
||||
for _, client in pairs(vim.lsp.buf_get_clients()) do
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
lsp_format = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if lsp_format then
|
||||
vim.lsp.buf.format({ async = false })
|
||||
else
|
||||
vim.cmd("Format")
|
||||
end
|
||||
end,
|
||||
})
|
||||
-- -- Auto format on save
|
||||
-- vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
-- callback = function()
|
||||
-- if vim.b.disable_format then
|
||||
-- return
|
||||
-- end
|
||||
-- local lsp_format = false
|
||||
-- for _, client in pairs(vim.lsp.get_clients()) do
|
||||
-- if client.server_capabilities.documentFormattingProvider then
|
||||
-- lsp_format = true
|
||||
-- break
|
||||
-- end
|
||||
-- end
|
||||
-- if lsp_format then
|
||||
-- vim.lsp.buf.format({ async = false })
|
||||
-- else
|
||||
-- vim.cmd("Format")
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
---- nvim-lint ----
|
||||
local lint = require("lint")
|
||||
|
|
@ -680,7 +675,7 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
|||
vim.cmd("packadd crates.nvim")
|
||||
|
||||
local crates = require("crates")
|
||||
crates.setup()
|
||||
crates.setup({})
|
||||
vim.keymap.set("n", "<leader>cv", crates.show_versions_popup)
|
||||
vim.keymap.set("n", "<leader>cf", crates.show_features_popup)
|
||||
vim.keymap.set("n", "<leader>cd", crates.show_dependencies_popup)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0c8436cb10e9ac62354baa5874a4a3413f2432c1
|
||||
Subproject commit eecd13449945ee2c064e00c618dfec9b2d856ea3
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 6f35d797882c6ce0ab7c87dc86561512dc3d7aba
|
||||
Subproject commit 26ed90509c377d10dbdebd25b7094a886323b32b
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 92166b89ab4b3d60f24e58170cac53b7141fd032
|
||||
Subproject commit 9c9eb07fecc578e25e28db8dc9002b43fff2ed79
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 0236521ea582747b58869cb72f70ccfa967d2e89
|
||||
Subproject commit e30b7f2008e52442154b66f7c519bfd2f1e32acb
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2b6860d15aaab01d3fb90859c0ba97f20ad7bc5f
|
||||
Subproject commit 50fcf17db7c75af80e6b6109acfbfb4504768780
|
||||
1
pack/general/start/conform.nvim
Submodule
1
pack/general/start/conform.nvim
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 9a06e83527407a7600a2fe4e0d10adf432b6215e
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 379a5a915aea3e9ba0d4a778e8478584ac0f9011
|
||||
Subproject commit 8df63f2ddc615feb71fd4aee45a4cee022876df1
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 5260e5e8ecadaf13e6b82cf867a909f54e15fd07
|
||||
Subproject commit a110e12d0b58eefcf5b771f533fc2cf3050680ac
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 1a3a8d047bc01f1760ae4a0f5e80f111ea222e67
|
||||
Subproject commit 941fa1220a61797a51f3af9ec6b7d74c8c7367ce
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit f1f0699a1d49f28e607ffa4361f1bbe757ac5ebc
|
||||
Subproject commit b36bf49d097a09781ad6ac0cfea28b40b74570a3
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 3a74b5831058d0daf8952a5b8c556c61b30a3f46
|
||||
Subproject commit 9d80c1497ec343f81c0c5800b65f2e73ca569025
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit b77921fdc44833c994fdb389d658ccbce5490c16
|
||||
Subproject commit c0cfc1738361b5da1cd0a962dd6f774cc444f856
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2ef7da3a363890686dbaad18ddbf59177cfe4f78
|
||||
Subproject commit 11668478677de360dea45cf2b090d34f21b8ae07
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit dfa230be84a044e7f546a6c2b0a403c739732b86
|
||||
Subproject commit f2bfde705ac752c52544d5cfa8b0aee0a766c1ed
|
||||
Loading…
Add table
Reference in a new issue