aboutsummaryrefslogtreecommitdiff
path: root/store/config
diff options
context:
space:
mode:
Diffstat (limited to 'store/config')
-rw-r--r--store/config/nvim/lazy-lock.json7
-rw-r--r--store/config/nvim/lua/plugins.lua25
-rw-r--r--store/config/nvim/lua/setup/lsp.lua33
-rw-r--r--store/config/nvim/lua/setup/plugins/conform.lua18
-rw-r--r--store/config/nvim/lua/setup/plugins/init.lua1
5 files changed, 55 insertions, 29 deletions
diff --git a/store/config/nvim/lazy-lock.json b/store/config/nvim/lazy-lock.json
index 69c535c..f323937 100644
--- a/store/config/nvim/lazy-lock.json
+++ b/store/config/nvim/lazy-lock.json
@@ -1,8 +1,9 @@
{
- "catppuccin": { "branch": "main", "commit": "a0c769bc7cd04bbbf258b3d5f01e2bdce744108d" },
+ "catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
+ "conform.nvim": { "branch": "master", "commit": "0e93e0d12d2f7ebdea9e3e444dfaff0050cefbe6" },
"gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
@@ -10,8 +11,8 @@
"nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" },
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
- "nvim-lint": { "branch": "master", "commit": "b47cbb249351873e3a571751c3fb66ed6369852f" },
- "nvim-lspconfig": { "branch": "master", "commit": "036885e8e5456d3907626b634693234f628afef6" },
+ "nvim-lint": { "branch": "master", "commit": "cc26ae6a620298bb3f33b0e0681f99a10ae57781" },
+ "nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
diff --git a/store/config/nvim/lua/plugins.lua b/store/config/nvim/lua/plugins.lua
index 4f61660..8458575 100644
--- a/store/config/nvim/lua/plugins.lua
+++ b/store/config/nvim/lua/plugins.lua
@@ -1,11 +1,13 @@
-- spellchecker: disable
return {
- { "catppuccin/nvim", name = "catppuccin", priority = 1000 },
- "neovim/nvim-lspconfig",
- "hrsh7th/nvim-cmp",
- "hrsh7th/cmp-nvim-lsp",
- "hrsh7th/cmp-buffer",
- "hrsh7th/cmp-path",
+ {
+ "catppuccin/nvim",
+ name = "catppuccin",
+ priority = 1000
+ },
+ {
+ "neovim/nvim-lspconfig"
+ },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate"
@@ -28,7 +30,12 @@ return {
"nvim-telescope/telescope.nvim",
dependencies = { 'nvim-lua/plenary.nvim' }
},
- "windwp/nvim-autopairs",
- "mfussenegger/nvim-lint",
- "lewis6991/gitsigns.nvim",
+ { "lewis6991/gitsigns.nvim" },
+ { "hrsh7th/nvim-cmp" },
+ { "hrsh7th/cmp-nvim-lsp" },
+ { "hrsh7th/cmp-buffer" },
+ { "hrsh7th/cmp-path" },
+ { "windwp/nvim-autopairs" },
+ { "mfussenegger/nvim-lint" },
+ { 'stevearc/conform.nvim' }
}
diff --git a/store/config/nvim/lua/setup/lsp.lua b/store/config/nvim/lua/setup/lsp.lua
index 472cdaf..a11ad34 100644
--- a/store/config/nvim/lua/setup/lsp.lua
+++ b/store/config/nvim/lua/setup/lsp.lua
@@ -7,6 +7,13 @@ vim.lsp.config("*", {
)
})
+---@param ev vim.api.keyset.create_autocmd.callback_args
+---@param name string
+local function client_name_is(ev, name)
+ local client = vim.lsp.get_client_by_id(ev.data.client_id)
+ return client and client.name == name
+end
+
local function setup_clangd()
local clangd = "clangd"
local brew_clangd_path = "/usr/local/opt/llvm/bin/clangd"
@@ -19,8 +26,7 @@ local function setup_clangd()
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
- local client = vim.lsp.get_client_by_id(ev.data.client_id)
- if client and client.name == "clangd" then
+ if client_name_is(ev, "clangd") then
vim.keymap.set('n', 'grs', "<cmd>ClangdSwitchSourceHeader<cr>", {
buffer = ev.buf
})
@@ -62,28 +68,21 @@ local function setup_denols()
end
end,
})
-end
-
-
-local function setup()
- setup_clangd()
- setup_lua_ls()
- setup_denols()
-
- function _G.crupest_no_range_format()
- vim.notify("Range format is no supported by the lsp.", vim.log.levels.ERROR, {})
- end
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
- local client = vim.lsp.get_client_by_id(ev.data.client_id)
- vim.keymap.set('n', 'gqa', vim.lsp.buf.format, { buffer = ev.buf })
- if client and not client:supports_method('textDocument/rangeFormatting') then
- vim.bo[ev.buf].formatexpr = "v:lua.crupest_no_range_format()"
+ if client_name_is(ev, "denols") then
+ vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
end
end
})
+end
+
+local function setup()
+ setup_clangd()
+ setup_lua_ls()
+ setup_denols()
vim.lsp.enable({ "clangd", "lua_ls", "denols" })
end
diff --git a/store/config/nvim/lua/setup/plugins/conform.lua b/store/config/nvim/lua/setup/plugins/conform.lua
new file mode 100644
index 0000000..e14c3f9
--- /dev/null
+++ b/store/config/nvim/lua/setup/plugins/conform.lua
@@ -0,0 +1,18 @@
+local function setup()
+ require("conform").setup({
+ formatters_by_ft = {
+ javascript = { "prettierd", "prettier", stop_after_first = true },
+ typescript = { "prettierd", "prettier", stop_after_first = true },
+ javascriptreact = { "prettierd", "prettier", stop_after_first = true },
+ typescriptreact = { "prettierd", "prettier", stop_after_first = true },
+ markdown = { "prettierd", "prettier", stop_after_first = true },
+ },
+ default_format_opts = {
+ lsp_format = "fallback",
+ },
+ })
+end
+
+return {
+ setup = setup
+}
diff --git a/store/config/nvim/lua/setup/plugins/init.lua b/store/config/nvim/lua/setup/plugins/init.lua
index 8f1346b..88eca4f 100644
--- a/store/config/nvim/lua/setup/plugins/init.lua
+++ b/store/config/nvim/lua/setup/plugins/init.lua
@@ -15,6 +15,7 @@ local function setup()
require("setup.plugins.tree-sitter").setup()
require("setup.plugins.lint").setup()
+ require("setup.plugins.conform").setup()
require("setup.plugins.cmp").setup()
require("nvim-autopairs").setup {}
end