nvim: format
This commit is contained in:
parent
d5a279bce8
commit
c6abd232bd
16 changed files with 240 additions and 242 deletions
|
@ -2,8 +2,12 @@ root = true
|
|||
[*.lua]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
tab_width = 4
|
||||
quote_style = single
|
||||
tab_width = 2
|
||||
max_line_length = 120
|
||||
insert_final_newline = true
|
||||
|
||||
continuation_indent = 2
|
||||
quote_style = single
|
||||
call_arg_parentheses = keep
|
||||
table_separator_style = comma
|
||||
trailing_table_separator = smart
|
||||
|
|
|
@ -15,7 +15,7 @@ require('configs.options').setup()
|
|||
require('lazy').setup(
|
||||
'configs.packages',
|
||||
{
|
||||
install = { colorscheme = { 'gruvbox' }, },
|
||||
install = { colorscheme = { 'gruvbox' } },
|
||||
-- rtp = { disabled_plugins = { 'netrwPlugin' } },
|
||||
change_detection = {
|
||||
-- automatically check for config file changes and reload the ui
|
||||
|
|
|
@ -15,10 +15,8 @@ local function toggle_win_opt(name)
|
|||
end
|
||||
|
||||
function M.setup()
|
||||
-- scroll up and down with shift+arrow {{
|
||||
vim.keymap.set('n', '<S-Down>', '<C-E>')
|
||||
vim.keymap.set('n', '<S-Up>', '<C-Y>')
|
||||
--}}}
|
||||
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to next diagnostic' })
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to prev diagnostic' })
|
||||
|
|
|
@ -18,7 +18,7 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
|||
vim.cmd.iabbrev({ args = { '<buffer>', 'LINK', "$this->producer()->link($this, '')<Left><Left>" } })
|
||||
vim.cmd.iabbrev({ args = { '<buffer>', 'NW', '$this->obtainer()->notifications()->warning();<Left><Left>' } })
|
||||
vim.cmd.iabbrev({ args = { '<buffer>', 'NS', '$this->obtainer()->notifications()->success();<Left><Left>' } })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- }}} LAYA
|
||||
|
@ -32,15 +32,15 @@ vim.api.nvim_create_autocmd('TermOpen', {
|
|||
vim.api.nvim_win_set_option(0, 'number', false)
|
||||
vim.api.nvim_win_set_option(0, 'signcolumn', 'no')
|
||||
vim.schedule(vim.cmd.startinsert) -- without schedule it lock screen refresh
|
||||
end
|
||||
end,
|
||||
})
|
||||
--}}}
|
||||
|
||||
-- Buffer {{{
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { command = "checktime" })
|
||||
vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, { command = 'checktime' })
|
||||
|
||||
-- go to last loc when opening a buffer
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
vim.api.nvim_create_autocmd('BufReadPost', {
|
||||
callback = function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(0)
|
||||
|
|
|
@ -101,14 +101,14 @@ function M.config()
|
|||
pattern = '*Trouble',
|
||||
callback = function()
|
||||
vim.wo.cursorline = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd('WinLeave', {
|
||||
group = troublegr,
|
||||
pattern = '*Trouble',
|
||||
callback = function()
|
||||
vim.wo.cursorline = false
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local augr = vim.api.nvim_create_augroup('config_colorscheme', {});
|
||||
|
@ -121,7 +121,7 @@ function M.config()
|
|||
normalizeTerminal()
|
||||
normalizeCmpKindHighlight()
|
||||
normalizeTroubleHighlight()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('Colorscheme', {
|
||||
|
@ -151,9 +151,9 @@ function M.config()
|
|||
end
|
||||
|
||||
gr:hl('LineNr', 'gray', 'dark0_hard', linenr_style)
|
||||
gr:hl('LspCodeLens', 'gray', nil, { 'italic', })
|
||||
gr:hl('LspCodeLens', 'gray', nil, { 'italic' })
|
||||
|
||||
gr:hl('IndentBlanklineContextChar', 'orange', nil, { 'nocombine', })
|
||||
gr:hl('IndentBlanklineContextChar', 'orange', nil, { 'nocombine' })
|
||||
|
||||
gr:hl('DiagnosticVirtualTextError', 'error', nil, { 'italic', })
|
||||
gr:hl('DiagnosticVirtualTextWarn', 'warn', nil, { 'italic', })
|
||||
|
@ -175,7 +175,7 @@ function M.config()
|
|||
vim.fn.sign_define('DiagnosticSignWarn', { text = ' ', texthl = 'DiagnosticSignWarn' })
|
||||
vim.fn.sign_define('DiagnosticSignInfo', { text = ' ', texthl = 'DiagnosticSignInfo' })
|
||||
vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' })
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local term = vim.env.TERM
|
||||
|
|
|
@ -8,7 +8,6 @@ local M = {
|
|||
}
|
||||
|
||||
function M.config()
|
||||
|
||||
local fterm = require('FTerm')
|
||||
|
||||
local lazygit = fterm:new({
|
||||
|
@ -16,8 +15,8 @@ function M.config()
|
|||
cmd = 'lazygit',
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
width = 0.9,
|
||||
},
|
||||
})
|
||||
|
||||
local git_history = function()
|
||||
|
@ -28,8 +27,8 @@ function M.config()
|
|||
cmd = cmd,
|
||||
dimensions = {
|
||||
height = 0.9,
|
||||
width = 0.9
|
||||
}
|
||||
width = 0.9,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
|
|
|
@ -40,6 +40,6 @@ return {
|
|||
|
||||
-- Text object
|
||||
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'Inner git hunk' })
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
local function formatting_filter(c)
|
||||
local bl = {
|
||||
'phpactor'
|
||||
'phpactor',
|
||||
}
|
||||
for _, name in ipairs(bl) do
|
||||
if c.name == name then
|
||||
|
@ -39,7 +39,7 @@ local function on_attach(args) -- {{{
|
|||
|
||||
if client.server_capabilities.codeLensProvider then
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'BufEnter', 'CursorHold', 'InsertLeave', }, {
|
||||
{ 'BufEnter', 'CursorHold', 'InsertLeave' }, {
|
||||
callback = vim.lsp.codelens.refresh,
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
@ -57,7 +57,7 @@ local function on_attach(args) -- {{{
|
|||
vim.keymap.set('n', '<leader>cr', '<Cmd>Trouble lsp_references<CR>', mkOpts('LSP references'))
|
||||
vim.keymap.set(
|
||||
{ 'v', 'n' }, '<leader>F', function()
|
||||
vim.lsp.buf.format({ async = true, filter = formatting_filter, })
|
||||
vim.lsp.buf.format({ async = true, filter = formatting_filter })
|
||||
end,
|
||||
mkOpts('Lsp Format')
|
||||
)
|
||||
|
@ -193,7 +193,7 @@ local function config()
|
|||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = {
|
||||
severity = vim.diagnostic.severity.ERROR,
|
||||
}
|
||||
},
|
||||
}
|
||||
),
|
||||
},
|
||||
|
@ -206,7 +206,7 @@ local function config()
|
|||
or u.path.exists(u.path.join(path, '.git'))
|
||||
)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
}, -- }}}
|
||||
yamlls = { -- {{{
|
||||
settings = {
|
||||
|
@ -230,7 +230,7 @@ local function config()
|
|||
versions = {
|
||||
['3.1'] = 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json',
|
||||
['3.0'] = 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.0/schema.json',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -263,5 +263,5 @@ return {
|
|||
{ 'SmiteshP/nvim-navic', lazy = true },
|
||||
{ 'Hoffs/omnisharp-extended-lsp.nvim', lazy = true },
|
||||
{ 'b0o/schemastore.nvim', lazy = true },
|
||||
{ 'folke/neodev.nvim', lazy = true }
|
||||
{ 'folke/neodev.nvim', lazy = true },
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ function M.config()
|
|||
theme = vim.env.TERM ~= 'linux' and 'gruvbox' or nil,
|
||||
component_separators = { '', '' },
|
||||
section_separators = { '', '' },
|
||||
disabled_filetypes = {}
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
|
@ -23,7 +23,7 @@ function M.config()
|
|||
lualine_c = { { 'filename', path = 1 } },
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
|
@ -31,16 +31,16 @@ function M.config()
|
|||
lualine_c = { { 'filename', path = 1 } },
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {
|
||||
lualine_b = { { 'filename', path = 1 }, },
|
||||
lualine_b = { { 'filename', path = 1 } },
|
||||
lualine_c = { { navic.get_location, cond = navic.is_available } },
|
||||
lualine_y = { { 'require("lsp_signature").status_line(100).label' }, 'filetype' },
|
||||
},
|
||||
inactive_winbar = {},
|
||||
extensions = { 'neo-tree' }
|
||||
extensions = { 'neo-tree' },
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ return {
|
|||
{ 'lukas-reineke/indent-blankline.nvim', config = true, opts = {
|
||||
show_current_context = true,
|
||||
show_current_context_start = false,
|
||||
} },
|
||||
}, },
|
||||
{ 'echasnovski/mini.trailspace', version = '*', config = function() require('mini.trailspace').setup({}) end },
|
||||
|
||||
-- stolen from LazyVim
|
||||
|
@ -19,12 +19,12 @@ return {
|
|||
init = function()
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.select = function(...)
|
||||
require('lazy').load({ plugins = { 'dressing.nvim', }, })
|
||||
require('lazy').load({ plugins = { 'dressing.nvim' } })
|
||||
return vim.ui.select(...)
|
||||
end
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.input = function(...)
|
||||
require('lazy').load({ plugins = { 'dressing.nvim', }, })
|
||||
require('lazy').load({ plugins = { 'dressing.nvim' } })
|
||||
return vim.ui.input(...)
|
||||
end
|
||||
end,
|
||||
|
@ -78,7 +78,7 @@ return {
|
|||
event = 'BufRead',
|
||||
config = function()
|
||||
vim.g.matchup_matchparen_offscreen = {}
|
||||
end },
|
||||
end, },
|
||||
|
||||
{
|
||||
'echasnovski/mini.surround',
|
||||
|
@ -86,7 +86,7 @@ return {
|
|||
event = 'BufEnter',
|
||||
config = function()
|
||||
require('mini.surround').setup({})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{ 'echasnovski/mini.statusline',
|
||||
|
@ -98,8 +98,8 @@ return {
|
|||
end,
|
||||
},
|
||||
|
||||
{ 'fpob/nette.vim', ft = 'nette', },
|
||||
{ 'ziglang/zig.vim', ft = 'zig', },
|
||||
{ 'fpob/nette.vim', ft = 'nette' },
|
||||
{ 'ziglang/zig.vim', ft = 'zig' },
|
||||
|
||||
{
|
||||
'mfussenegger/nvim-jdtls',
|
||||
|
@ -108,12 +108,12 @@ return {
|
|||
|
||||
{
|
||||
'folke/trouble.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons', },
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
lazy = true,
|
||||
cmd = { 'Trouble', 'TroubleToggle', },
|
||||
cmd = { 'Trouble', 'TroubleToggle' },
|
||||
keys = {
|
||||
{ '<Leader>tt', '<Cmd>TroubleToggle<CR>', desc = 'Trouble toggle', },
|
||||
{ '<Leader>td', '<Cmd>Trouble document_diagnostics<CR>', desc = 'Trouble toggle', },
|
||||
{ '<Leader>tt', '<Cmd>TroubleToggle<CR>', desc = 'Trouble toggle' },
|
||||
{ '<Leader>td', '<Cmd>Trouble document_diagnostics<CR>', desc = 'Trouble toggle' },
|
||||
},
|
||||
config = {
|
||||
mode = 'document_diagnostics',
|
||||
|
|
|
@ -5,7 +5,7 @@ local M = {
|
|||
keys = {
|
||||
{ '<Space>ft', [[<Cmd>Neotree toggle<CR>]], desc = 'Toggle Neotree' },
|
||||
{ '<Space>fr', [[<Cmd>Neotree reveal<CR>]], desc = 'Reveal current file in Neotree' },
|
||||
{ '<Space>gt', [[<Cmd>Neotree git_status<CR>]], desc = 'Neotree git status (Git Tree)' }
|
||||
{ '<Space>gt', [[<Cmd>Neotree git_status<CR>]], desc = 'Neotree git status (Git Tree)' },
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
dependencies = {
|
||||
|
@ -37,12 +37,12 @@ function M.config()
|
|||
event = 'neo_tree_window_after_open',
|
||||
handler = function(ev)
|
||||
vim.api.nvim_win_set_option(ev.winid, 'statusline', ' %{fnamemodify(getcwd(),":~")}')
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true
|
||||
enable_character_fade = true,
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
|
@ -89,7 +89,7 @@ function M.config()
|
|||
unstaged = '',
|
||||
staged = '',
|
||||
conflict = '',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
window = {
|
||||
|
@ -125,7 +125,7 @@ function M.config()
|
|||
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
show_path = 'none' -- "none", "relative", "absolute"
|
||||
}
|
||||
},
|
||||
},
|
||||
['A'] = 'add_directory', -- also accepts the optional config.show_path option like "add".
|
||||
['d'] = 'delete',
|
||||
|
@ -146,7 +146,7 @@ function M.config()
|
|||
['?'] = 'show_help',
|
||||
['<'] = 'prev_source',
|
||||
['>'] = 'next_source',
|
||||
}
|
||||
},
|
||||
},
|
||||
nesting_rules = {},
|
||||
filesystem = {
|
||||
|
@ -195,8 +195,8 @@ function M.config()
|
|||
['<c-x>'] = 'clear_filter',
|
||||
['[g'] = 'prev_git_modified',
|
||||
[']g'] = 'next_git_modified',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
buffers = {
|
||||
follow_current_file = true, -- This will find and focus the file in the active buffer every
|
||||
|
@ -208,7 +208,7 @@ function M.config()
|
|||
['bd'] = 'buffer_delete',
|
||||
['<bs>'] = 'navigate_up',
|
||||
['.'] = 'set_root',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
|
@ -222,11 +222,10 @@ function M.config()
|
|||
['gc'] = 'git_commit',
|
||||
['gp'] = 'git_push',
|
||||
['gg'] = 'git_commit_and_push',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -41,13 +41,13 @@ function M.config()
|
|||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete({}),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false })
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
}
|
||||
end,
|
||||
},
|
||||
})
|
||||
--
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
|
|
|
@ -5,7 +5,7 @@ local M = {
|
|||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
||||
}
|
||||
},
|
||||
},
|
||||
cmd = { 'Telescope' },
|
||||
keys = {
|
||||
|
@ -17,7 +17,7 @@ local M = {
|
|||
{ '<Space>Td', [[<Cmd>Telescope diagnostics<CR>]], desc = 'Telescope workspace diagnostics' },
|
||||
{ '<Space>Tj', [[<Cmd>Telescope jumplist<CR>]], desc = 'Telescope jumplist' },
|
||||
{ '<Space>Tr', [[<Cmd>Telescope resume<CR>]], desc = 'Telescope resume' },
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
function M.config()
|
||||
|
@ -28,7 +28,7 @@ function M.config()
|
|||
telescope.setup {
|
||||
defaults = {
|
||||
preview = {
|
||||
hide_on_startup = true
|
||||
hide_on_startup = true,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
|
@ -36,8 +36,8 @@ function M.config()
|
|||
},
|
||||
n = {
|
||||
['<M-i>'] = layout_actions.toggle_preview,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
|
@ -51,9 +51,9 @@ function M.config()
|
|||
},
|
||||
n = {
|
||||
['<C-d>'] = actions.delete_buffer,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -72,9 +72,8 @@ function M.config()
|
|||
imap <buffer> <C-a> <Cmd>Telescope builtin initial_mode=insert<CR>
|
||||
nmap <buffer> <C-a> <Cmd>Telescope builtin initial_mode=insert<CR>
|
||||
]], false)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -3,7 +3,7 @@ local M = {
|
|||
dependencies = {
|
||||
'nvim-treesitter/playground',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
{ 'yioneko/nvim-yati', tag = 'legacy' }
|
||||
{ 'yioneko/nvim-yati', tag = 'legacy' },
|
||||
-- { dir = '/home/sogun/devel/nvim-yati/', }
|
||||
},
|
||||
event = 'BufRead',
|
||||
|
@ -17,8 +17,8 @@ function M.config()
|
|||
enable = true,
|
||||
disable = { 'help' },
|
||||
},
|
||||
playground = { enable = true, },
|
||||
yati = { enable = true, },
|
||||
playground = { enable = true },
|
||||
yati = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
|
@ -80,7 +80,7 @@ function M.config()
|
|||
-- and should return true of false
|
||||
include_surrounding_whitespace = true,
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
local ts_parsers = require 'nvim-treesitter.parsers'.get_parser_configs()
|
||||
|
@ -95,7 +95,6 @@ function M.config()
|
|||
},
|
||||
filetype = 'xml', -- if filetype does not match the parser name
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -3,12 +3,12 @@ return {
|
|||
config = function()
|
||||
local wk = require('which-key')
|
||||
wk.register({
|
||||
['<Space>f'] = { name = "+file"},
|
||||
['<Space>g'] = { name = "+git"},
|
||||
['<Space>l'] = { name = "+LSP"},
|
||||
['<Space>t'] = { name = "+Trouble"},
|
||||
['<Space>c'] = { name = "+Code"},
|
||||
['<Space>cc'] = { name = "+calls"},
|
||||
['<Space>f'] = { name = '+file' },
|
||||
['<Space>g'] = { name = '+git' },
|
||||
['<Space>l'] = { name = '+LSP' },
|
||||
['<Space>t'] = { name = '+Trouble' },
|
||||
['<Space>c'] = { name = '+Code' },
|
||||
['<Space>cc'] = { name = '+calls' },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue