Skip to content

Commit

Permalink
Update .chezmoi.toml
Browse files Browse the repository at this point in the history
Update .chezmoiignore
Update .config/nvim/lua/plugins/none-ls.lua
Update .config/nvim/lua/plugins/nvim-lspconfig.lua
  • Loading branch information
Hyuga-Tsukui committed Nov 9, 2024
1 parent 4183427 commit 7ddde21
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 66 deletions.
4 changes: 2 additions & 2 deletions .chezmoi.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
command = "nvim"

[git]
## autoCommit = true
## autoPush = true
autoCommit = true
autoPush = true
1 change: 1 addition & 0 deletions .chezmoiignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
README.md

tmux/plugins/
nix/
1 change: 1 addition & 0 deletions dot_config/nvim/lua/plugins/none-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ return {
null_ls.builtins.formatting.prettierd.with({}),

null_ls.builtins.formatting.sqlfmt,
null_ls.builtins.formatting.nixpkgs_fmt,
},
on_attach = function(client, bufnr)
vim.keymap.set("n", "<space>f", function()
Expand Down
132 changes: 68 additions & 64 deletions dot_config/nvim/lua/plugins/nvim-lspconfig.lua
Original file line number Diff line number Diff line change
@@ -1,75 +1,79 @@
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config = function()
local lspconfig = require("lspconfig")
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
config = function()
local lspconfig = require("lspconfig")

if lspconfig.lua_ls then
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = {
globals = {
"vim",
},
},
},
},
})
end
if lspconfig.lua_ls then
lspconfig.lua_ls.setup({
settings = {
Lua = {
diagnostics = {
globals = {
"vim",
},
},
},
},
})
end

if lspconfig.ts_ls then
lspconfig.ts_ls.setup({})
end
if lspconfig.ts_ls then
lspconfig.ts_ls.setup({})
end

if lspconfig.ocamllsp then
lspconfig.ocamllsp.setup({})
end
if lspconfig.ocamllsp then
lspconfig.ocamllsp.setup({})
end

if lspconfig.gopls then
lspconfig.gopls.setup({})
end
if lspconfig.gopls then
lspconfig.gopls.setup({})
end

if lspconfig.terraformls then
lspconfig.terraformls.setup({
on_attach = function(client, _)
client.server_capabilities.semanticTokensProvider = nil
end,
})
end
if lspconfig.terraformls then
lspconfig.terraformls.setup({
on_attach = function(client, _)
client.server_capabilities.semanticTokensProvider = nil
end,
})
end

if lspconfig.typos_lsp then
lspconfig.typos_lsp.setup({
init_options = {
config = "~/.config/typos/.typos.toml",
},
})
end
if lspconfig.typos_lsp then
lspconfig.typos_lsp.setup({
init_options = {
config = "~/.config/typos/.typos.toml",
},
})
end

-- Lsp Keymaps.
-- global.
-- vim.keymap.set("n", "<space>e", vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist)
if lspconfig.nil_ls then
lspconfig.nil_ls.setup({})
end

-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
-- Lsp Keymaps.
-- global.
-- vim.keymap.set("n", "<space>e", vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist)

local opts = { buffer = ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<space>k", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
end,
})
end,
-- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"

local opts = { buffer = ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<space>k", vim.lsp.buf.hover, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
end,
})
end,
}

0 comments on commit 7ddde21

Please sign in to comment.