Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
c20960ebaa | |||
96c6bf4621 | |||
f6ca6ee8d2 |
|
@ -1,14 +1,31 @@
|
|||
local lsp_zero_config = {
|
||||
call_servers = 'global',
|
||||
}
|
||||
|
||||
local lsp_servers = {
|
||||
'zls',
|
||||
'nixd',
|
||||
'gopls',
|
||||
'pylsp',
|
||||
'templ',
|
||||
'clangd',
|
||||
'glslls',
|
||||
'ansiblels',
|
||||
'rust_analyzer',
|
||||
}
|
||||
|
||||
vim.filetype.add({ extension = { templ = "templ" } })
|
||||
|
||||
|
||||
local lsp = require('lsp-zero').preset({})
|
||||
lsp.set_preferences(lsp_zero_config)
|
||||
|
||||
lsp.on_attach(function(_, bufnr)
|
||||
lsp.default_keymaps({buffer = bufnr})
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, bufopts)
|
||||
end)
|
||||
|
||||
lsp.setup_servers(lsp_servers)
|
||||
|
||||
local lsp_config = require('lspconfig')
|
||||
lsp_config.lua_ls.setup(lsp.nvim_lua_ls())
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, {
|
||||
pattern = "*.txt,*.md",
|
||||
callback = function ()
|
||||
vim.api.nvim_set_option_value("spell", true, { scope = "local" })
|
||||
vim.api.nvim_set_option_value("wrap", true, { scope = "local" })
|
||||
vim.api.nvim_set_option_value("linebreak", true, { scope = "local" })
|
||||
end
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWrite", {
|
||||
callback = function (opts)
|
||||
local filetype = vim.bo[opts.buf].filetype
|
||||
if filetype == "text" or filetype == "markdown" then
|
||||
return
|
||||
end
|
||||
vim.api.nvim_exec2("%s/[ \\t]\\+$//e", { output = false })
|
||||
end
|
||||
})
|
|
@ -1,5 +1,4 @@
|
|||
require("cam123.set")
|
||||
require("cam123.autocmd")
|
||||
require("cam123.remap")
|
||||
require("cam123.lazy")
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ require('lazy').setup({
|
|||
branch = 'v2.x',
|
||||
dependencies = {
|
||||
{'neovim/nvim-lspconfig'},
|
||||
{'williamboman/mason.nvim'},
|
||||
{'williamboman/mason-lspconfig.nvim'},
|
||||
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<Escape>", function () vim.opt.hlsearch = false end)
|
||||
|
|
Loading…
Reference in New Issue
Block a user