This commit is contained in:
Markus Dieckmann 2022-09-02 16:10:28 +02:00
commit e46a22ddd6
4 changed files with 63 additions and 60 deletions

View File

@ -1,26 +1,25 @@
local set = vim.opt
set.modelines=0
set.hidden=true
set.number=true
set.ruler=true
set.visualbell=true
set.textwidth=120
set.cursorline=true
set.tabstop=2
set.shiftwidth=2
set.showmode=true
set.showcmd=true
set.showmatch=true
set.hlsearch=true
set.ignorecase=true
set.smartcase=true
set.incsearch=true
set.wrapscan=true
set.scrolloff=999
set.backspace="indent,eol,start"
set.mouse="nicr"
set.termguicolors=true
set.modelines = 0
set.hidden = true
set.number = true
set.ruler = true
set.visualbell = true
set.textwidth = 120
set.cursorline = true
set.tabstop = 2
set.shiftwidth = 2
set.showmode = true
set.showcmd = true
set.showmatch = true
set.hlsearch = true
set.ignorecase = true
set.smartcase = true
set.incsearch = true
set.wrapscan = true
set.scrolloff = 999
set.backspace = "indent,eol,start"
set.mouse = "nicr"
set.termguicolors = true
set.matchpairs:append("<:>")
set.completeopt="menuone,noselect,preview"
set.expandtab=true
set.completeopt = "menuone,noselect,preview"
set.expandtab = true

View File

@ -1,6 +1,6 @@
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap=true, silent=true }
local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
@ -14,7 +14,7 @@ local on_attach = function(client, bufnr)
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', '<leader>gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', '<leader>K', vim.lsp.buf.hover, bufopts)
@ -29,22 +29,25 @@ local on_attach = function(client, bufnr)
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', '<leader>gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<leader>f',function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('n', '<leader>f', vim.lsp.buf.formatting, bufopts)
end
local lsp_flags = {
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
}
require('mason-lspconfig').setup_handlers{
require('mason-lspconfig').setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup{
require('lspconfig')[server_name].setup {
on_attach = on_attach,
flags = lsp_flags,
}
end,
['rust_analyzer'] = function()
require('rust-tools').setup {}
require('rust-tools').setup {
on_attach = on_attach,
flags = lsp_flags,
}
end,
['sumneko_lua'] = function()
require('lspconfig')["sumneko_lua"].setup {
@ -60,7 +63,7 @@ require('mason-lspconfig').setup_handlers{
}
end,
}
require('lspconfig')['rust_analyzer'].setup{
require('lspconfig')['rust_analyzer'].setup {
on_attach = on_attach,
flags = lsp_flags,
-- Server-specific settings...

View File

@ -1,7 +1,8 @@
require("null-ls").setup({
sources = {
require("null-ls").builtins.formatting.stylua,
--require("null-ls").builtins.formatting.stylua,
-- require("null-ls").builtins.diagnostics.eslint,
-- require("null-ls").builtins.completion.spell,
},

View File

@ -1 +1 @@
require('nvim-lightbulb').setup({autocmd = {enabled = true}})
require('nvim-lightbulb').setup({ autocmd = { enabled = true } })