1
0
Fork 0

nvim: format

This commit is contained in:
Vladimír Dudr 2023-02-11 14:25:06 +01:00
parent d5a279bce8
commit c6abd232bd
16 changed files with 240 additions and 242 deletions

View file

@ -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

View file

@ -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

View file

@ -3,9 +3,9 @@ local M = {}
local function toggle_win_opt(name)
local newval = not vim.api.nvim_win_get_option(0, name)
vim.api.nvim_win_set_option(
0,
name,
newval
0,
name,
newval
)
if newval then
vim.notify(name .. ' is on')
@ -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' })

View file

@ -1,82 +1,82 @@
local M = {}
function M.setup()
-- {{{ LAYA
-- {{{ LAYA
local aug = vim.api.nvim_create_augroup('laya', {})
local aug = vim.api.nvim_create_augroup('laya', {})
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
group = aug,
pattern = '**/jopixel/**/*.php',
callback = function()
vim.cmd.iabbrev({ args = { '<buffer>', 'TR', '$this->obtainer()->translator()->t();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'TI', '$this->obtainer()->translator()->t()<Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'LOG', '$this->obtainer()->logger()->log();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'DBG', "$this->obtainer()->logger()->log('debug', 'debug',);<Left><Left>" } })
vim.cmd.iabbrev({ args = { '<buffer>', 'PROD', '$this->producer()' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'FILE', '$this->producer()->file()<Left>' } })
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
})
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
group = aug,
pattern = '**/jopixel/**/*.php',
callback = function()
vim.cmd.iabbrev({ args = { '<buffer>', 'TR', '$this->obtainer()->translator()->t();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'TI', '$this->obtainer()->translator()->t()<Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'LOG', '$this->obtainer()->logger()->log();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'DBG', "$this->obtainer()->logger()->log('debug', 'debug',);<Left><Left>" } })
vim.cmd.iabbrev({ args = { '<buffer>', 'PROD', '$this->producer()' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'FILE', '$this->producer()->file()<Left>' } })
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,
})
-- }}} LAYA
-- }}} LAYA
--- terminal {{{
local termgroup = vim.api.nvim_create_augroup('terminal', { clear = true })
vim.api.nvim_create_autocmd('TermOpen', {
group = termgroup,
callback = function()
-- local buf = args.buf
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
})
--}}}
--- terminal {{{
local termgroup = vim.api.nvim_create_augroup('terminal', { clear = true })
vim.api.nvim_create_autocmd('TermOpen', {
group = termgroup,
callback = function()
-- local buf = args.buf
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,
})
--}}}
-- Buffer {{{
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { command = "checktime" })
-- Buffer {{{
vim.api.nvim_create_autocmd({ 'FocusGained', 'TermClose', 'TermLeave' }, { command = 'checktime' })
-- go to last loc when opening a buffer
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)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- go to last loc when opening a buffer
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)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})
-- }}}
-- }}}
-- qf {{{
-- local pad = function (str, n)
-- if #str > n then
-- return str
-- else
-- return str .. string.rep(' ', n - #str)
-- end
-- end
-- qf {{{
-- local pad = function (str, n)
-- if #str > n then
-- return str
-- else
-- return str .. string.rep(' ', n - #str)
-- end
-- end
-- QuickfixFunc = function(info)
-- local items
-- if info.quickfix then
-- items = vim.fn.getqflist({ id = info.id, items = 1 }).items
-- else
-- items = vim.fn.getloclist(info.id, { items = 1 }).items
-- end
-- QuickfixFunc = function(info)
-- local items
-- if info.quickfix then
-- items = vim.fn.getqflist({ id = info.id, items = 1 }).items
-- else
-- items = vim.fn.getloclist(info.id, { items = 1 }).items
-- end
-- local res = {};
-- for i = info.start_idx, info.end_idx, 1 do
-- local item = items[i]
-- table.insert(res, pad
-- end
-- end
-- local res = {};
-- for i = info.start_idx, info.end_idx, 1 do
-- local item = items[i]
-- table.insert(res, pad
-- end
-- end
-- }}}
-- }}}
end
return M

View file

@ -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

View file

@ -1,24 +1,23 @@
local M = {
'numToStr/FTerm.nvim',
keys = {
{ '<Space>gg', '<Plug>Lazygit', desc = 'Lazygit' },
{ '<Space>gg', '<Plug>Lazygit', desc = 'Lazygit' },
{ '<Space>gh', '<Plug>GitHistory', desc = 'Git history' },
},
lazy = true,
}
function M.config()
local fterm = require('FTerm')
local lazygit = fterm:new({
-- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want
cmd = 'lazygit',
dimensions = {
height = 0.9,
width = 0.9
}
})
-- ft = 'fterm_lazygit', -- You can also override the default filetype, if you want
cmd = 'lazygit',
dimensions = {
height = 0.9,
width = 0.9,
},
})
local git_history = function()
local file = vim.api.nvim_buf_get_name(0)
@ -28,8 +27,8 @@ function M.config()
cmd = cmd,
dimensions = {
height = 0.9,
width = 0.9
}
width = 0.9,
},
})
end

View file

@ -40,6 +40,6 @@ return {
-- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'Inner git hunk' })
end
}
end,
},
}

View file

@ -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,10 +39,10 @@ local function on_attach(args) -- {{{
if client.server_capabilities.codeLensProvider then
vim.api.nvim_create_autocmd(
{ 'BufEnter', 'CursorHold', 'InsertLeave', }, {
callback = vim.lsp.codelens.refresh,
buffer = bufnr,
})
{ 'BufEnter', 'CursorHold', 'InsertLeave' }, {
callback = vim.lsp.codelens.refresh,
buffer = bufnr,
})
end
vim.keymap.set('n', '<leader>cl', vim.lsp.codelens.run, mkOpts('LSP Run code lens'))
vim.keymap.set('n', '<leader>ci', vim.lsp.buf.implementation, mkOpts('LSP implementation'))
@ -57,8 +57,8 @@ 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, })
end,
vim.lsp.buf.format({ async = true, filter = formatting_filter })
end,
mkOpts('Lsp Format')
)
@ -70,71 +70,71 @@ local function on_attach(args) -- {{{
client.server_capabilities.semanticTokensProvider.legend = {
tokenModifiers = { 'static' },
tokenTypes = {
'comment', -- "comment",
'comment', -- "excluded_code",
'identifier', -- "identifier",
'keyword', -- "keyword",
'keyword', -- "keyword_control",
'number', -- "number",
'operator', -- "operator",
'operator', -- "operator_overloaded",
'preproc', -- "preprocessor_keyword",
'string', -- "string",
'whitespace', -- "whitespace",
'text', -- "text",
'static', -- "static_symbol",
'preproc', -- "preprocessor_text",
'punctuation', -- "punctuation",
'string.escape', -- "string_verbatim",
'comment', -- "comment",
'comment', -- "excluded_code",
'identifier', -- "identifier",
'keyword', -- "keyword",
'keyword', -- "keyword_control",
'number', -- "number",
'operator', -- "operator",
'operator', -- "operator_overloaded",
'preproc', -- "preprocessor_keyword",
'string', -- "string",
'whitespace', -- "whitespace",
'text', -- "text",
'static', -- "static_symbol",
'preproc', -- "preprocessor_text",
'punctuation', -- "punctuation",
'string.escape', -- "string_verbatim",
'character.special', -- "string_escape_character",
'class', -- "class_name",
'type', -- "delegate_name",
'enum', -- "enum_name",
'interface', -- "interface_name",
'namespace', -- "module_name",
'struct', -- "struct_name",
'typeParameter', -- "type_parameter_name",
'field', -- "field_name",
'enumMember', -- "enum_member_name",
'constant', -- "constant_name",
'variable', -- "local_name",
'parameter', -- "parameter_name",
'method', -- "method_name",
'method', -- "extension_method_name",
'property', -- "property_name",
'event', -- "event_name",
'namespace', -- "namespace_name",
'label', -- "label_name",
'text.literal', -- "xml_doc_comment_attribute_name",
'text.literal', -- "xml_doc_comment_attribute_quotes",
'text.literal', -- "xml_doc_comment_attribute_value",
'text.literal', -- "xml_doc_comment_cdata_section",
'text.literal', -- "xml_doc_comment_comment",
'text.literal', -- "xml_doc_comment_delimiter",
'text.literal', -- "xml_doc_comment_entity_reference",
'text.literal', -- "xml_doc_comment_name",
'text.literal', -- "xml_doc_comment_processing_instruction",
'text.literal', -- "xml_doc_comment_text",
'text.literal', -- "xml_literal_attribute_name",
'text.literal', -- "xml_literal_attribute_quotes",
'text.literal', -- "xml_literal_attribute_value",
'text.literal', -- "xml_literal_cdata_section",
'text.literal', -- "xml_literal_comment",
'text.literal', -- "xml_literal_delimiter",
'text.literal', -- "xml_literal_embedded_expression",
'text.literal', -- "xml_literal_entity_reference",
'text.literal', -- "xml_literal_name",
'text.literal', -- "xml_literal_processing_instruction",
'text.literal', -- "xml_literal_text",
'regexp', -- "regex_comment",
'regexp', -- "regex_character_class",
'regexp', -- "regex_anchor",
'regexp', -- "regex_quantifier",
'regexp', -- "regex_grouping",
'regexp', -- "regex_alternation",
'regexp', -- "regex_text",
'regexp', -- "regex_self_escaped_character",
'regexp' -- "regex_other_escape",
'class', -- "class_name",
'type', -- "delegate_name",
'enum', -- "enum_name",
'interface', -- "interface_name",
'namespace', -- "module_name",
'struct', -- "struct_name",
'typeParameter', -- "type_parameter_name",
'field', -- "field_name",
'enumMember', -- "enum_member_name",
'constant', -- "constant_name",
'variable', -- "local_name",
'parameter', -- "parameter_name",
'method', -- "method_name",
'method', -- "extension_method_name",
'property', -- "property_name",
'event', -- "event_name",
'namespace', -- "namespace_name",
'label', -- "label_name",
'text.literal', -- "xml_doc_comment_attribute_name",
'text.literal', -- "xml_doc_comment_attribute_quotes",
'text.literal', -- "xml_doc_comment_attribute_value",
'text.literal', -- "xml_doc_comment_cdata_section",
'text.literal', -- "xml_doc_comment_comment",
'text.literal', -- "xml_doc_comment_delimiter",
'text.literal', -- "xml_doc_comment_entity_reference",
'text.literal', -- "xml_doc_comment_name",
'text.literal', -- "xml_doc_comment_processing_instruction",
'text.literal', -- "xml_doc_comment_text",
'text.literal', -- "xml_literal_attribute_name",
'text.literal', -- "xml_literal_attribute_quotes",
'text.literal', -- "xml_literal_attribute_value",
'text.literal', -- "xml_literal_cdata_section",
'text.literal', -- "xml_literal_comment",
'text.literal', -- "xml_literal_delimiter",
'text.literal', -- "xml_literal_embedded_expression",
'text.literal', -- "xml_literal_entity_reference",
'text.literal', -- "xml_literal_name",
'text.literal', -- "xml_literal_processing_instruction",
'text.literal', -- "xml_literal_text",
'regexp', -- "regex_comment",
'regexp', -- "regex_character_class",
'regexp', -- "regex_anchor",
'regexp', -- "regex_quantifier",
'regexp', -- "regex_grouping",
'regexp', -- "regex_alternation",
'regexp', -- "regex_text",
'regexp', -- "regex_self_escaped_character",
'regexp' -- "regex_other_escape",
},
}
end
@ -193,20 +193,20 @@ local function config()
vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = {
severity = vim.diagnostic.severity.ERROR,
}
},
}
),
},
root_dir = function(startpath)
local u = require('lspconfig.util')
return u.search_ancestors(startpath, function(path)
return not string.find(path, '/vendor/') and (
return not string.find(path, '/vendor/') and (
u.path.exists(u.path.join(path, 'composer.json'))
or u.path.exists(u.path.join(path, 'sharedLibs'))
or u.path.exists(u.path.join(path, '.git'))
or u.path.exists(u.path.join(path, 'sharedLibs'))
or u.path.exists(u.path.join(path, '.git'))
)
end)
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',
}
},
},
},
},
@ -250,18 +250,18 @@ return {
{
'neovim/nvim-lspconfig',
dependencies = {
{ 'j-hui/fidget.nvim', config = true },
{ 'j-hui/fidget.nvim', config = true },
{ 'ray-x/lsp_signature.nvim', opts = { hint_prefix = '', floating_window = false, hint_scheme = 'Identifier' } },
},
keys = {
{ '<leader>li', '<Cmd>LspInfo<CR>', desc = 'Lsp info' },
{ '<leader>ll', '<Cmd>LspLog<CR>', desc = 'Lsp log' },
{ '<leader>ll', '<Cmd>LspLog<CR>', desc = 'Lsp log' },
},
event = 'BufRead',
config = config,
},
{ 'SmiteshP/nvim-navic', lazy = true },
{ 'SmiteshP/nvim-navic', lazy = true },
{ 'Hoffs/omnisharp-extended-lsp.nvim', lazy = true },
{ 'b0o/schemastore.nvim', lazy = true },
{ 'folke/neodev.nvim', lazy = true }
{ 'b0o/schemastore.nvim', lazy = true },
{ 'folke/neodev.nvim', lazy = true },
}

View file

@ -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

View file

@ -15,8 +15,8 @@ return {
end,
expr = true, remap = true, silent = true, mode = 'i',
},
{ '<tab>', function() require('luasnip').jump(1) end, mode = 's' },
{ '<s-tab>', function() require('luasnip').jump(-1) end, mode = { 'i', 's' } },
{ '<tab>', function() require('luasnip').jump(1) end, mode = 's' },
{ '<s-tab>', function() require('luasnip').jump( -1) end, mode = { 'i', 's' } },
-- { '<C-E>',
-- function() return require('luasnip').choice_active() and '<Plug>luasnip-next-choice' or '<C-E>' end,
-- mode = 'i', remap = true, expr = true,

View file

@ -9,8 +9,8 @@ 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 },
}, },
{ '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',

View file

@ -3,9 +3,9 @@ local M = {
branch = 'v2.x',
lazy = false,
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>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)' },
},
cmd = 'Neotree',
dependencies = {
@ -35,14 +35,14 @@ function M.config()
event_handlers = {
{
event = 'neo_tree_window_after_open',
handler = function (ev)
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

View file

@ -37,17 +37,17 @@ function M.config()
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-b>'] = cmp.mapping.scroll_docs( -4),
['<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).

View file

@ -5,19 +5,19 @@ 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 = {
{ '<Space>b', [[<Cmd>Telescope buffers<CR>]], desc = 'Buffers' },
{ '<Space>ff', [[<Cmd>Telescope find_files<CR>]], desc = 'Search file' },
{ '<Space>fg', [[<Cmd>Telescope live_grep<CR>]], desc = 'Grep through files' },
{ '<Space>T', [[<Cmd>Telescope<CR>]], desc = 'Telescope' },
{ '<Space>b', [[<Cmd>Telescope buffers<CR>]], desc = 'Buffers' },
{ '<Space>ff', [[<Cmd>Telescope find_files<CR>]], desc = 'Search file' },
{ '<Space>fg', [[<Cmd>Telescope live_grep<CR>]], desc = 'Grep through files' },
{ '<Space>T', [[<Cmd>Telescope<CR>]], desc = 'Telescope' },
{ '<Space>Tg', [[<Cmd>Telescope grep_string<CR>]], desc = 'Telescope grep string' },
{ '<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' },
}
{ '<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

View file

@ -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

View file

@ -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,
}