asmfmt
This commit is contained in:
parent
e3e8915890
commit
98470836af
1 changed files with 100 additions and 99 deletions
|
@ -1,103 +1,104 @@
|
|||
return {
|
||||
-- NOTE: Plugins can specify dependencies.
|
||||
--
|
||||
-- The dependencies are proper plugin specifications as well - anything
|
||||
-- you do for a plugin at the top level, you can do for a dependency.
|
||||
--
|
||||
-- Use the `dependencies` key to specify the dependencies of a particular plugin
|
||||
-- NOTE: Plugins can specify dependencies.
|
||||
--
|
||||
-- The dependencies are proper plugin specifications as well - anything
|
||||
-- you do for a plugin at the top level, you can do for a dependency.
|
||||
--
|
||||
-- Use the `dependencies` key to specify the dependencies of a particular plugin
|
||||
|
||||
{ -- Autoformat
|
||||
'stevearc/conform.nvim',
|
||||
lazy = false,
|
||||
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)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
-- 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 = false, cpp = false, json = true, bib = true, markdown = false }
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
['_'] = { 'prettier' },
|
||||
rust = { 'rust-analyzer' },
|
||||
lua = { 'stylua' },
|
||||
typst = { 'typstyle' },
|
||||
json = { 'jq' },
|
||||
-- rust = { 'rustfmt' }, -- does not need one with the lsp there
|
||||
c = { 'clang-format' },
|
||||
cpp = { 'clang-format' },
|
||||
python = { 'autopep8' },
|
||||
-- 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 = { 'prettier' },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'glacambre/firenvim',
|
||||
enabled = vim.g.started_by_firenvim,
|
||||
lazy = false,
|
||||
build = function()
|
||||
vim.fn['firenvim#install'](0)
|
||||
end,
|
||||
config = function()
|
||||
vim.g.firenvim_config = {
|
||||
localSettings = {
|
||||
['.*'] = {
|
||||
filename = '/tmp/{hostname}_{pathname%10}.{extension%5}',
|
||||
cmdline = 'firenvim',
|
||||
takeover = 'never', -- can't open it with never at all?
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
-- enables UNIX specific stuff in vim,
|
||||
-- specifically:
|
||||
-- :SudoWrite
|
||||
-- :SudoRead
|
||||
-- :Chmod
|
||||
-- and also some more, but those are easy done with shell
|
||||
'tpope/vim-eunuch',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'mikesmithgh/kitty-scrollback.nvim',
|
||||
enabled = true,
|
||||
lazy = true,
|
||||
cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth' },
|
||||
event = { 'User KittyScrollbackLaunch' },
|
||||
-- version = '*', -- latest stable version, may have breaking changes if major version changed
|
||||
-- version = '^3.0.0', -- pin major version, include fixes and features that do not have breaking changes
|
||||
config = function()
|
||||
require('kitty-scrollback').setup {
|
||||
myconfig = function()
|
||||
return { keymaps_enabled = false }
|
||||
end,
|
||||
}
|
||||
end,
|
||||
},
|
||||
{ -- Autoformat
|
||||
'stevearc/conform.nvim',
|
||||
lazy = false,
|
||||
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)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
-- 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 = false, cpp = false, json = true, bib = true, markdown = false }
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
||||
}
|
||||
end,
|
||||
formatters_by_ft = {
|
||||
['_'] = { 'prettier' },
|
||||
rust = { 'rust-analyzer' },
|
||||
lua = { 'stylua' },
|
||||
typst = { 'typstyle' },
|
||||
json = { 'jq' },
|
||||
-- rust = { 'rustfmt' }, -- does not need one with the lsp there
|
||||
c = { 'clang-format' },
|
||||
cpp = { 'clang-format' },
|
||||
python = { 'autopep8' },
|
||||
-- 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 = { 'prettier' },
|
||||
asm = { "asmfmt" }
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'glacambre/firenvim',
|
||||
enabled = vim.g.started_by_firenvim,
|
||||
lazy = false,
|
||||
build = function()
|
||||
vim.fn['firenvim#install'](0)
|
||||
end,
|
||||
config = function()
|
||||
vim.g.firenvim_config = {
|
||||
localSettings = {
|
||||
['.*'] = {
|
||||
filename = '/tmp/{hostname}_{pathname%10}.{extension%5}',
|
||||
cmdline = 'firenvim',
|
||||
takeover = 'never', -- can't open it with never at all?
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
-- enables UNIX specific stuff in vim,
|
||||
-- specifically:
|
||||
-- :SudoWrite
|
||||
-- :SudoRead
|
||||
-- :Chmod
|
||||
-- and also some more, but those are easy done with shell
|
||||
'tpope/vim-eunuch',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'mikesmithgh/kitty-scrollback.nvim',
|
||||
enabled = true,
|
||||
lazy = true,
|
||||
cmd = { 'KittyScrollbackGenerateKittens', 'KittyScrollbackCheckHealth' },
|
||||
event = { 'User KittyScrollbackLaunch' },
|
||||
-- version = '*', -- latest stable version, may have breaking changes if major version changed
|
||||
-- version = '^3.0.0', -- pin major version, include fixes and features that do not have breaking changes
|
||||
config = function()
|
||||
require('kitty-scrollback').setup {
|
||||
myconfig = function()
|
||||
return { keymaps_enabled = false }
|
||||
end,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
{ import = 'custom.plugins' },
|
||||
{ import = 'custom.plugins' },
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue