From c6abd232bd841fb1bbe8789b871bfa07addb0515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Sat, 11 Feb 2023 14:25:06 +0100 Subject: [PATCH] nvim: format --- dot_config/nvim/dot_editorconfig | 8 +- dot_config/nvim/init.lua | 2 +- dot_config/nvim/lua/configs/keys.lua | 8 +- dot_config/nvim/lua/configs/misc.lua | 130 +++++++------- .../nvim/lua/configs/packages/colors.lua | 12 +- .../nvim/lua/configs/packages/fterm.lua | 21 ++- .../nvim/lua/configs/packages/gitsigns.lua | 4 +- dot_config/nvim/lua/configs/packages/lsp.lua | 166 +++++++++--------- .../nvim/lua/configs/packages/lualine.lua | 10 +- .../nvim/lua/configs/packages/luasnip.lua | 4 +- dot_config/nvim/lua/configs/packages/misc.lua | 24 +-- .../nvim/lua/configs/packages/neotree.lua | 33 ++-- .../nvim/lua/configs/packages/nvim-cmp.lua | 8 +- .../nvim/lua/configs/packages/telescope.lua | 31 ++-- .../nvim/lua/configs/packages/treesitter.lua | 9 +- .../nvim/lua/configs/packages/which-key.lua | 12 +- 16 files changed, 240 insertions(+), 242 deletions(-) diff --git a/dot_config/nvim/dot_editorconfig b/dot_config/nvim/dot_editorconfig index 4627590..4e27c49 100644 --- a/dot_config/nvim/dot_editorconfig +++ b/dot_config/nvim/dot_editorconfig @@ -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 diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 0892bd9..1d42865 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -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 diff --git a/dot_config/nvim/lua/configs/keys.lua b/dot_config/nvim/lua/configs/keys.lua index 69ee6f1..025cd0b 100644 --- a/dot_config/nvim/lua/configs/keys.lua +++ b/dot_config/nvim/lua/configs/keys.lua @@ -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', '', '') vim.keymap.set('n', '', '') - --}}} 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' }) diff --git a/dot_config/nvim/lua/configs/misc.lua b/dot_config/nvim/lua/configs/misc.lua index d01e00e..8d7385a 100644 --- a/dot_config/nvim/lua/configs/misc.lua +++ b/dot_config/nvim/lua/configs/misc.lua @@ -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 = { '', 'TR', '$this->obtainer()->translator()->t();' } }) - vim.cmd.iabbrev({ args = { '', 'TI', '$this->obtainer()->translator()->t()' } }) - vim.cmd.iabbrev({ args = { '', 'LOG', '$this->obtainer()->logger()->log();' } }) - vim.cmd.iabbrev({ args = { '', 'DBG', "$this->obtainer()->logger()->log('debug', 'debug',);" } }) - vim.cmd.iabbrev({ args = { '', 'PROD', '$this->producer()' } }) - vim.cmd.iabbrev({ args = { '', 'FILE', '$this->producer()->file()' } }) - vim.cmd.iabbrev({ args = { '', 'LINK', "$this->producer()->link($this, '')" } }) - vim.cmd.iabbrev({ args = { '', 'NW', '$this->obtainer()->notifications()->warning();' } }) - vim.cmd.iabbrev({ args = { '', 'NS', '$this->obtainer()->notifications()->success();' } }) - end -}) + vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { + group = aug, + pattern = '**/jopixel/**/*.php', + callback = function() + vim.cmd.iabbrev({ args = { '', 'TR', '$this->obtainer()->translator()->t();' } }) + vim.cmd.iabbrev({ args = { '', 'TI', '$this->obtainer()->translator()->t()' } }) + vim.cmd.iabbrev({ args = { '', 'LOG', '$this->obtainer()->logger()->log();' } }) + vim.cmd.iabbrev({ args = { '', 'DBG', "$this->obtainer()->logger()->log('debug', 'debug',);" } }) + vim.cmd.iabbrev({ args = { '', 'PROD', '$this->producer()' } }) + vim.cmd.iabbrev({ args = { '', 'FILE', '$this->producer()->file()' } }) + vim.cmd.iabbrev({ args = { '', 'LINK', "$this->producer()->link($this, '')" } }) + vim.cmd.iabbrev({ args = { '', 'NW', '$this->obtainer()->notifications()->warning();' } }) + vim.cmd.iabbrev({ args = { '', 'NS', '$this->obtainer()->notifications()->success();' } }) + 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 diff --git a/dot_config/nvim/lua/configs/packages/colors.lua b/dot_config/nvim/lua/configs/packages/colors.lua index 3fa531c..67cfc9b 100644 --- a/dot_config/nvim/lua/configs/packages/colors.lua +++ b/dot_config/nvim/lua/configs/packages/colors.lua @@ -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 diff --git a/dot_config/nvim/lua/configs/packages/fterm.lua b/dot_config/nvim/lua/configs/packages/fterm.lua index db756b7..46c8b87 100644 --- a/dot_config/nvim/lua/configs/packages/fterm.lua +++ b/dot_config/nvim/lua/configs/packages/fterm.lua @@ -1,24 +1,23 @@ local M = { 'numToStr/FTerm.nvim', keys = { - { 'gg', 'Lazygit', desc = 'Lazygit' }, + { 'gg', 'Lazygit', desc = 'Lazygit' }, { 'gh', '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 diff --git a/dot_config/nvim/lua/configs/packages/gitsigns.lua b/dot_config/nvim/lua/configs/packages/gitsigns.lua index 5d5b946..a780e35 100644 --- a/dot_config/nvim/lua/configs/packages/gitsigns.lua +++ b/dot_config/nvim/lua/configs/packages/gitsigns.lua @@ -40,6 +40,6 @@ return { -- Text object map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'Inner git hunk' }) - end - } + end, + }, } diff --git a/dot_config/nvim/lua/configs/packages/lsp.lua b/dot_config/nvim/lua/configs/packages/lsp.lua index 1c09d6d..bd01579 100644 --- a/dot_config/nvim/lua/configs/packages/lsp.lua +++ b/dot_config/nvim/lua/configs/packages/lsp.lua @@ -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', 'cl', vim.lsp.codelens.run, mkOpts('LSP Run code lens')) vim.keymap.set('n', 'ci', vim.lsp.buf.implementation, mkOpts('LSP implementation')) @@ -57,8 +57,8 @@ local function on_attach(args) -- {{{ vim.keymap.set('n', 'cr', 'Trouble lsp_references', mkOpts('LSP references')) vim.keymap.set( { 'v', 'n' }, '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 = { { 'li', 'LspInfo', desc = 'Lsp info' }, - { 'll', 'LspLog', desc = 'Lsp log' }, + { 'll', 'LspLog', 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 }, } diff --git a/dot_config/nvim/lua/configs/packages/lualine.lua b/dot_config/nvim/lua/configs/packages/lualine.lua index 1e29344..faaf75a 100644 --- a/dot_config/nvim/lua/configs/packages/lualine.lua +++ b/dot_config/nvim/lua/configs/packages/lualine.lua @@ -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 diff --git a/dot_config/nvim/lua/configs/packages/luasnip.lua b/dot_config/nvim/lua/configs/packages/luasnip.lua index baba0f8..d6f616e 100644 --- a/dot_config/nvim/lua/configs/packages/luasnip.lua +++ b/dot_config/nvim/lua/configs/packages/luasnip.lua @@ -15,8 +15,8 @@ return { end, expr = true, remap = true, silent = true, mode = 'i', }, - { '', function() require('luasnip').jump(1) end, mode = 's' }, - { '', function() require('luasnip').jump(-1) end, mode = { 'i', 's' } }, + { '', function() require('luasnip').jump(1) end, mode = 's' }, + { '', function() require('luasnip').jump( -1) end, mode = { 'i', 's' } }, -- { '', -- function() return require('luasnip').choice_active() and 'luasnip-next-choice' or '' end, -- mode = 'i', remap = true, expr = true, diff --git a/dot_config/nvim/lua/configs/packages/misc.lua b/dot_config/nvim/lua/configs/packages/misc.lua index 2cc8d54..f28326a 100644 --- a/dot_config/nvim/lua/configs/packages/misc.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -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 = { - { 'tt', 'TroubleToggle', desc = 'Trouble toggle', }, - { 'td', 'Trouble document_diagnostics', desc = 'Trouble toggle', }, + { 'tt', 'TroubleToggle', desc = 'Trouble toggle' }, + { 'td', 'Trouble document_diagnostics', desc = 'Trouble toggle' }, }, config = { mode = 'document_diagnostics', diff --git a/dot_config/nvim/lua/configs/packages/neotree.lua b/dot_config/nvim/lua/configs/packages/neotree.lua index ded4dbb..3650004 100644 --- a/dot_config/nvim/lua/configs/packages/neotree.lua +++ b/dot_config/nvim/lua/configs/packages/neotree.lua @@ -3,9 +3,9 @@ local M = { branch = 'v2.x', lazy = false, keys = { - { 'ft', [[Neotree toggle]], desc = 'Toggle Neotree' }, - { 'fr', [[Neotree reveal]], desc = 'Reveal current file in Neotree' }, - { 'gt', [[Neotree git_status]], desc = 'Neotree git status (Git Tree)' } + { 'ft', [[Neotree toggle]], desc = 'Toggle Neotree' }, + { 'fr', [[Neotree reveal]], desc = 'Reveal current file in Neotree' }, + { 'gt', [[Neotree git_status]], 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() [''] = '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', [''] = '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 diff --git a/dot_config/nvim/lua/configs/packages/nvim-cmp.lua b/dot_config/nvim/lua/configs/packages/nvim-cmp.lua index e241ba9..8a48d1f 100644 --- a/dot_config/nvim/lua/configs/packages/nvim-cmp.lua +++ b/dot_config/nvim/lua/configs/packages/nvim-cmp.lua @@ -37,17 +37,17 @@ function M.config() -- documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs( -4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete({}), [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = false }) + [''] = 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). diff --git a/dot_config/nvim/lua/configs/packages/telescope.lua b/dot_config/nvim/lua/configs/packages/telescope.lua index 7d60092..78707e4 100644 --- a/dot_config/nvim/lua/configs/packages/telescope.lua +++ b/dot_config/nvim/lua/configs/packages/telescope.lua @@ -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 = { - { 'b', [[Telescope buffers]], desc = 'Buffers' }, - { 'ff', [[Telescope find_files]], desc = 'Search file' }, - { 'fg', [[Telescope live_grep]], desc = 'Grep through files' }, - { 'T', [[Telescope]], desc = 'Telescope' }, + { 'b', [[Telescope buffers]], desc = 'Buffers' }, + { 'ff', [[Telescope find_files]], desc = 'Search file' }, + { 'fg', [[Telescope live_grep]], desc = 'Grep through files' }, + { 'T', [[Telescope]], desc = 'Telescope' }, { 'Tg', [[Telescope grep_string]], desc = 'Telescope grep string' }, { 'Td', [[Telescope diagnostics]], desc = 'Telescope workspace diagnostics' }, - { 'Tj', [[Telescope jumplist]], desc = 'Telescope jumplist' }, - { 'Tr', [[Telescope resume]], desc = 'Telescope resume' }, - } + { 'Tj', [[Telescope jumplist]], desc = 'Telescope jumplist' }, + { 'Tr', [[Telescope resume]], 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 = { [''] = layout_actions.toggle_preview, - } - } + }, + }, }, pickers = { buffers = { @@ -51,9 +51,9 @@ function M.config() }, n = { [''] = actions.delete_buffer, - } - } - } + }, + }, + }, }, } @@ -72,9 +72,8 @@ function M.config() imap Telescope builtin initial_mode=insert nmap Telescope builtin initial_mode=insert ]], false) - end + end, }) - end return M diff --git a/dot_config/nvim/lua/configs/packages/treesitter.lua b/dot_config/nvim/lua/configs/packages/treesitter.lua index b90386c..6678d46 100644 --- a/dot_config/nvim/lua/configs/packages/treesitter.lua +++ b/dot_config/nvim/lua/configs/packages/treesitter.lua @@ -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 diff --git a/dot_config/nvim/lua/configs/packages/which-key.lua b/dot_config/nvim/lua/configs/packages/which-key.lua index a38ea96..8ea2003 100644 --- a/dot_config/nvim/lua/configs/packages/which-key.lua +++ b/dot_config/nvim/lua/configs/packages/which-key.lua @@ -3,12 +3,12 @@ return { config = function() local wk = require('which-key') wk.register({ - ['f'] = { name = "+file"}, - ['g'] = { name = "+git"}, - ['l'] = { name = "+LSP"}, - ['t'] = { name = "+Trouble"}, - ['c'] = { name = "+Code"}, - ['cc'] = { name = "+calls"}, + ['f'] = { name = '+file' }, + ['g'] = { name = '+git' }, + ['l'] = { name = '+LSP' }, + ['t'] = { name = '+Trouble' }, + ['c'] = { name = '+Code' }, + ['cc'] = { name = '+calls' }, }) end, }