add neovim stuffs

This commit is contained in:
frosty 2024-05-18 03:47:28 -04:00
parent 8440966ad8
commit b278df15c2
6 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,3 @@
vim.opt_local.expandtab = false
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 4

View file

@ -0,0 +1,3 @@
vim.opt_local.expandtab = true
vim.opt_local.softtabstop = 2
vim.opt_local.shiftwidth = 2

View file

@ -0,0 +1,3 @@
vim.opt_local.expandtab = true
vim.opt_local.softtabstop = 4
vim.opt_local.shiftwidth = 4

24
.config/nvim/init.lua Normal file
View file

@ -0,0 +1,24 @@
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable',
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup('plugins')
vim.api.nvim_create_autocmd('BufWritePre', {
callback = function()
vim.lsp.buf.format { async = false }
end
})
vim.opt.expandtab = true
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4

View file

@ -0,0 +1,59 @@
local servers = {
-- Lua
lua_ls = {
settings = {
Lua = {
format = {
defaultConfig = {
quote_style = 'single'
}
}
}
}
},
-- JSON
jsonls = {},
-- Shell
bashls = {
filetypes = { 'sh', 'zsh', }
},
-- Go
gopls = {}
}
return {
{
'williamboman/mason-lspconfig.nvim',
dependencies = {
{
'williamboman/mason.nvim',
build = ':MasonUpdate',
config = function()
require('mason').setup()
end
}
}
},
{
'neovim/nvim-lspconfig',
config = function()
local servers_keys = {}
for k, _ in pairs(servers) do
table.insert(servers_keys, k)
end
require('mason-lspconfig').setup {
ensure_installed = servers_keys
}
local lsp = require('lspconfig')
for server, params in pairs(servers) do
lsp[server].setup(params)
end
end
}
}

View file

@ -0,0 +1,14 @@
return {
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
event = 'VeryLazy'
},
{
'f-person/git-blame.nvim',
opts = {
highlight_group = 'NonText'
}
}
}