diff --git a/.config/nvim/ftplugin/go.lua b/.config/nvim/ftplugin/go.lua new file mode 100644 index 0000000..5a9e476 --- /dev/null +++ b/.config/nvim/ftplugin/go.lua @@ -0,0 +1,3 @@ +vim.opt_local.expandtab = false +vim.opt_local.tabstop = 4 +vim.opt_local.shiftwidth = 4 diff --git a/.config/nvim/ftplugin/lua.lua b/.config/nvim/ftplugin/lua.lua new file mode 100644 index 0000000..cbbe688 --- /dev/null +++ b/.config/nvim/ftplugin/lua.lua @@ -0,0 +1,3 @@ +vim.opt_local.expandtab = true +vim.opt_local.softtabstop = 2 +vim.opt_local.shiftwidth = 2 diff --git a/.config/nvim/ftplugin/sh.lua b/.config/nvim/ftplugin/sh.lua new file mode 100644 index 0000000..8b53069 --- /dev/null +++ b/.config/nvim/ftplugin/sh.lua @@ -0,0 +1,3 @@ +vim.opt_local.expandtab = true +vim.opt_local.softtabstop = 4 +vim.opt_local.shiftwidth = 4 diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..4abc3a1 --- /dev/null +++ b/.config/nvim/init.lua @@ -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 diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..156d50f --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -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 + } +} diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..96ef4a8 --- /dev/null +++ b/.config/nvim/lua/plugins/ui.lua @@ -0,0 +1,14 @@ +return { + { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + event = 'VeryLazy' + }, + + { + 'f-person/git-blame.nvim', + opts = { + highlight_group = 'NonText' + } + } +}