diff --git a/init.lua b/init.lua index 79762a20..8a727b71 100644 --- a/init.lua +++ b/init.lua @@ -84,6 +84,18 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +-- Set how many spaces a tab counts for +-- See `:help 'tabstop'` +vim.opt.tabstop = 2 + +-- Set the number of spaces inserted for each indentation +-- See `:help 'shiftwidth'` +vim.opt.shiftwidth = 2 + +-- Use spaces instead of tabs +-- See `:help 'expandtab'` +-- vim.opt.expandtab = true + -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 630f65ed..a19c92c0 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -10,4 +10,15 @@ return { vim.cmd 'Copilot setup' end, }, + { + 'sbdchd/neoformat', + cmd = 'Neoformat', + config = function() + vim.g.neoformat_enabled_javascript = { 'prettier' } + vim.g.neoformat_enabled_python = { 'black' } + vim.g.neoformat_enabled_typescript = { 'prettier' } + vim.g.neoformat_enabled_yaml = { 'prettier' } + vim.g.neoformat_run_on_save = 1 + end, + }, }