74 lines
2.0 KiB
Lua
74 lines
2.0 KiB
Lua
|
|
-- NOTE: a place for me to put configuration of files
|
|
-- I don't have a use for anymore
|
|
local archive = {
|
|
-- NOTE: removed nvim-tree becuase learning telescope is
|
|
-- a better use of my time
|
|
{
|
|
'nvim-tree/nvim-tree.lua',
|
|
config = function()
|
|
require('nvim-tree').setup {
|
|
sort = {
|
|
sorter = 'case_sensitive',
|
|
},
|
|
view = {
|
|
width = 30,
|
|
},
|
|
renderer = {
|
|
group_empty = true,
|
|
},
|
|
filters = {
|
|
dotfiles = true,
|
|
},
|
|
}
|
|
vim.keymap.set('n', '<leader>0', ':NvimTreeToggle<CR>', { silent = true })
|
|
end,
|
|
opts = {
|
|
disable_netwr = true,
|
|
update_focused_file = {
|
|
enabled = true,
|
|
},
|
|
},
|
|
},
|
|
{ -- Autoformat
|
|
'stevearc/conform.nvim',
|
|
event = { 'BufWritePre' },
|
|
cmd = { 'ConformInfo' },
|
|
-- NOTE: I'm not certain if I need this...
|
|
-- keys = {
|
|
-- {
|
|
-- '<leader>f',
|
|
-- function()
|
|
-- require('conform').format { async = true, lsp_fallback = true }
|
|
-- end,
|
|
-- mode = '',
|
|
-- desc = '[F]ormat buffer',
|
|
-- },
|
|
-- },
|
|
opts = {
|
|
notify_on_error = false,
|
|
format_on_save = function(bufnr)
|
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
|
-- have a well standardized coding style. You can add additional
|
|
-- languages here or re-enable it for the disabled ones.
|
|
local disable_filetypes = { c = true, cpp = true }
|
|
return {
|
|
timeout_ms = 500,
|
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
|
}
|
|
end,
|
|
stop_after_first = true,
|
|
formatters_by_ft = {
|
|
lua = { 'stylua' },
|
|
-- Conform can also run multiple formatters sequentially
|
|
-- python = { "isort", "black" },
|
|
--
|
|
-- You can use a sub-list to tell conform to run *until* a formatter
|
|
-- is found.
|
|
javascript = { 'prettierd' },
|
|
typescript = { 'prettierd' },
|
|
},
|
|
},
|
|
},
|
|
|