fixup linters, enable :Format conform cmd, enable friendly-snippets

This commit is contained in:
Kerry Staley 2024-03-21 17:14:01 -07:00
parent df1ccefc7a
commit 148baaf958
1 changed files with 23 additions and 11 deletions

View File

@ -663,12 +663,24 @@ require('lazy').setup({
--
-- You can use a sub-list to tell conform to run *until* a formatter
-- is found.
javascript = { { 'prettierd', 'prettier' } },
typescript = { { 'prettierd', 'prettier' } },
ruby = { { 'rubocop' } },
go = { { 'gofmt' } },
-- javascript = { { 'prettierd', 'prettier' } }
javascript = { 'prettierd' },
typescript = { 'prettierd' },
ruby = { 'rubocop' },
go = { 'gofmt' },
},
formatters = {},
vim.api.nvim_create_user_command('Format', function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
['end'] = { args.line2, end_line:len() },
}
end
require('conform').format { async = true, lsp_fallback = true, range = range }
end, { range = true }),
},
},
@ -692,12 +704,12 @@ require('lazy').setup({
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
-- {
-- 'rafamadriz/friendly-snippets',
-- config = function()
-- require('luasnip.loaders.from_vscode').lazy_load()
-- end,
-- },
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
'saadparwaiz1/cmp_luasnip',
@ -791,7 +803,7 @@ require('lazy').setup({
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'catppuccin-macchiato'
vim.cmd.colorscheme 'catppuccin'
-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'