neovim

Personal neovim configuration files
git clone git://gtms.dev/neovim
Log | Files | Refs

commit bcef0f29d1c088d05cdb8abab29657951fc28022
parent 949662eae25c35fe74b2f38085fb98582af67e67
Author: Tomas Nemec <owl@gtms.dev>
Date:   Tue, 12 Mar 2024 22:13:38 +0100

update

Diffstat:
Dafter/plugin/aerial.lua | 2--
Dafter/plugin/animate.lua | 10----------
Dafter/plugin/autopairs.lua | 7-------
Dafter/plugin/beacon.lua | 1-
Mafter/plugin/bqf.lua | 6+++++-
Dafter/plugin/color-picker.lua | 8--------
Dafter/plugin/copilot.lua | 31-------------------------------
Mafter/plugin/dressing.lua | 21+++++++++++++++++++--
Mafter/plugin/fidget.lua | 10+++++++++-
Dafter/plugin/foldhue.lua | 5-----
Rafter/plugin/conform.lua -> after/plugin/format.lua | 0
Dafter/plugin/git-worktree.lua | 3---
Mafter/plugin/git.lua | 57+++++++++++++++++++++++++++++++++++++++++++--------------
Dafter/plugin/gitsigns.lua | 39---------------------------------------
Mafter/plugin/hardtime.lua | 12+++++++++++-
Dafter/plugin/hexen.lua | 7-------
Dafter/plugin/hi-pairs.lua | 22----------------------
Mafter/plugin/leap.lua | 8++++----
Mafter/plugin/lsp.lua | 8++++----
Dafter/plugin/luasnip.lua | 138-------------------------------------------------------------------------------
Mafter/plugin/medoro.lua | 2+-
Mafter/plugin/neodev.lua | 2+-
Mafter/plugin/neorg.lua | 2+-
Mafter/plugin/neoscroll.lua | 7+++++--
Mafter/plugin/no-neck-pain.lua | 9++++++++-
Mafter/plugin/notify.lua | 12+++++++++---
Dafter/plugin/nulls.lua | 77-----------------------------------------------------------------------------
Mafter/plugin/nvim-surround.lua | 2+-
Mafter/plugin/pubspec.lua | 4++--
Mafter/plugin/qmk.lua | 458++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mafter/plugin/rest-nvim.lua | 2+-
Mafter/plugin/ssr.lua | 2++
Mafter/plugin/telescope.lua | 24++++++++++++------------
Mafter/plugin/trans.lua | 4++--
Mafter/plugin/treesitter-context.lua | 4++--
Mafter/plugin/treesitter.lua | 4++--
Mafter/plugin/typebreak.lua | 2+-
Dafter/plugin/ufo.lua | 26--------------------------
Mafter/plugin/undotree.lua | 8++++----
Dafter/plugin/zen.lua | 11-----------
Mcompiler/dart_ng_test.lua | 2+-
Dftplugin/c.lua | 0
Mftplugin/dart.lua | 10+++++-----
Mftplugin/gdscript.lua | 2+-
Mftplugin/gitcommit.lua | 2+-
Mftplugin/go.lua | 12+++++++++---
Dftplugin/help.lua | 0
Mftplugin/html.lua | 2+-
Dftplugin/latte.lua | 0
Mftplugin/lua.lua | 4++--
Mftplugin/mail.lua | 2+-
Mftplugin/neorg.lua | 3+--
Dftplugin/vim.lua | 0
Mftplugin/zsh.lua | 3+--
Mlua/plugins.lua | 6+++---
Mlua/tms/ft/dart/analyze.lua | 12++++++------
Dlua/tms/p/hexen.lua | 78------------------------------------------------------------------------------
Mplugin/bufremove.lua | 2+-
Mplugin/diagflow.lua | 2+-
Mplugin/file_pairs.lua | 8++++----
Mplugin/json_qf.lua | 4++--
Dplugin/match.lua | 3---
Dplugin/qftf.lua | 44--------------------------------------------
Mplugin/snippet.lua | 1+
Dplugin/trans.lua | 4----
Dplugin/vimtex.lua | 0
66 files changed, 419 insertions(+), 844 deletions(-)

diff --git a/after/plugin/aerial.lua b/after/plugin/aerial.lua @@ -1,2 +0,0 @@ -if not pcall(require, 'aerial') then return end -require('aerial').setup({ highlight_on_jump = 0 }) diff --git a/after/plugin/animate.lua b/after/plugin/animate.lua @@ -1,10 +0,0 @@ -if vim.g['animate#loaded'] then - vim.keymap.set('n', '<c-up>', ':call animate#window_delta_height(10)<cr>', { silent = true }) - vim.keymap.set('n', '<c-down>', ':call animate#window_delta_height(-10)<cr>', { silent = true }) - vim.keymap.set('n', '<c-left>', ':call animate#window_delta_width(-10)<cr>', { silent = true }) - vim.keymap.set('n', '<c-right>', ':call animate#window_delta_width(10)<cr>', { silent = true }) - vim.keymap.set('n', '<s-up>', ':call animate#window_delta_height(1)<cr>', { silent = true }) - vim.keymap.set('n', '<s-down>', ':call animate#window_delta_height(-1)<cr>', { silent = true }) - vim.keymap.set('n', '<s-left>', ':call animate#window_delta_width(-1)<cr>', { silent = true }) - vim.keymap.set('n', '<s-right>', ':call animate#window_delta_width(1)<cr>', { silent = true }) -end diff --git a/after/plugin/autopairs.lua b/after/plugin/autopairs.lua @@ -1,7 +0,0 @@ -if not pcall(require, 'nvim-autopairs') then - return -end -require('nvim-autopairs').setup({ disable_filetype = { 'TelescopePrompt', 'vim' } }) --- local cmp_autopairs = require('nvim-autopairs.completion.cmp') --- local cmp = require('cmp') --- cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({map_char = {tex = ''}})) diff --git a/after/plugin/beacon.lua b/after/plugin/beacon.lua @@ -1 +0,0 @@ -if not pcall(require, 'beacon') then return end diff --git a/after/plugin/bqf.lua b/after/plugin/bqf.lua @@ -1,3 +1,7 @@ if not pcall(require, 'bqf') then return end -require('bqf').setup { auto_enable = true, auto_resize_height = false, preview = { auto_preview = true } } +require('bqf').setup { + auto_enable = true, + auto_resize_height = false, + preview = { auto_preview = true }, +} diff --git a/after/plugin/color-picker.lua b/after/plugin/color-picker.lua @@ -1,8 +0,0 @@ -if not pcall(require, 'color-picker') then - return -end - -local opts = { noremap = true, silent = true } - -vim.keymap.set('n', '<leader>c', '<cmd>PickColor<cr>', opts) -vim.keymap.set('i', '<leader>c', '<cmd>PickColorInsert<cr>', opts) diff --git a/after/plugin/copilot.lua b/after/plugin/copilot.lua @@ -1,31 +0,0 @@ -if not pcall(require, 'copilot') then - return -end - -local copilot = require('copilot') -copilot.setup({ -- - - suggestion = { - enabled = true, - auto_trigger = true, - keymap = { next = '<c-n>', prev = '<c-p>', accept = '<c-y>', dismiss = '<c-e>' }, - }, -}) - -local toggle = require('tms.toggle') -toggle.fn('p', require('copilot.suggestion').toggle_auto_trigger, 'copilot') - -if pcall(require, 'cmp') then - local cmp = require('cmp') - cmp.event:on('menu_opened', function() - vim.b.copilot_suggestion_hidden = true - if require('copilot.suggestion').is_visible() then - require('copilot.suggestion').dismiss() - end - end) - cmp.event:on('menu_closed', function() - vim.b.copilot_suggestion_hidden = false - if not require('copilot.suggestion').is_visible() then - require('copilot.suggestion').next() - end - end) -end diff --git a/after/plugin/dressing.lua b/after/plugin/dressing.lua @@ -3,6 +3,23 @@ if not pcall(require, 'dressing') then end require('dressing').setup({ - input = { insert_only = false }, - select = { backend = { 'telescope', 'builtin' }, telescope = require('telescope.themes').get_dropdown() }, + input = { + insert_only = false, + mappings = { + n = { + ["<C-e>"] = "Close", + ["<C-y>"] = "Confirm", + }, + i = { + ["<C-e>"] = "Close", + ["<C-y>"] = "Confirm", + ["<C-p>"] = "HistoryPrev", + ["<C-n>"] = "HistoryNext", + }, + }, + }, + select = { + backend = { 'telescope', 'builtin' }, + telescope = require('telescope.themes').get_dropdown() + }, }) diff --git a/after/plugin/fidget.lua b/after/plugin/fidget.lua @@ -2,4 +2,12 @@ if not pcall(require, 'fidget') then return end -require('fidget').setup { progress = { display = { done_ttl = 0.5, progress_icon = { pattern = 'moon' } } } } +require('fidget').setup { + progress = { + display = { + done_ttl = 0.5, + progress_icon = { + pattern = 'moon' }, + }, + }, +} diff --git a/after/plugin/foldhue.lua b/after/plugin/foldhue.lua @@ -1,5 +0,0 @@ -if not pcall(require, 'foldhue') then - return -end - -require('foldhue').enable() diff --git a/after/plugin/conform.lua b/after/plugin/format.lua diff --git a/after/plugin/git-worktree.lua b/after/plugin/git-worktree.lua @@ -1,3 +0,0 @@ -if not pcall(require, 'git-worktree') then return end - -require('git-worktree').setup() diff --git a/after/plugin/git.lua b/after/plugin/git.lua @@ -3,9 +3,49 @@ if vim.g.loaded_fugitive then vim.keymap.set('n', '<leader>gc', '<cmd>G commit<cr>', { desc = 'Git Commit' }) vim.keymap.set('n', '<leader>gb', '<cmd>Git blame<cr>', { desc = 'Git Blame' }) end +if pcall(require, 'git-worktree') then + require('git-worktree').setup() +end + +if pcall(require, 'gitsigns') then + local gsigns = require('gitsigns') + + local get_theme = function() + local dark_theme = { add = '│', change = '│', delete = '│', topdelete = '‾', changedelete = '│' } + local light_theme = { add = ' ', change = ' ', delete = ' ', topdelete = ' ', changedelete = ' ' } + + if vim.opt.background:get() == 'light' then + return light_theme + end + + return dark_theme + end -local has_cmp_git, cmp_git = pcall(require, 'cmp_git') -if has_cmp_git then + local theme = get_theme() + gsigns.setup { + signs = { + add = { text = theme.add }, + change = { text = theme.change }, + delete = { text = theme.delete }, + topdelete = { text = theme.topdelete }, + changedelete = { text = theme.changedelete }, + }, + } + + vim.keymap.set('n', '<leader>hl', gsigns.next_hunk, { desc = 'Git Next Hunk' }) + vim.keymap.set('n', '<leader>hh', gsigns.prev_hunk, { desc = 'Git Previous Hunk' }) + vim.keymap.set('n', '<leader>hs', gsigns.stage_hunk, { desc = 'Git Stage Hunk' }) + vim.keymap.set('n', '<leader>hu', gsigns.undo_stage_hunk, { desc = 'Git Undo Stage Hunk' }) + vim.keymap.set('n', '<leader>hr', gsigns.reset_hunk, { desc = 'Git Reset Hunk' }) + vim.keymap.set('n', '<leader>hR', gsigns.reset_buffer, { desc = 'Git Reset Buffer' }) + vim.keymap.set('n', '<leader>hp', gsigns.preview_hunk, { desc = 'Git Preview Hunk' }) + vim.keymap.set('n', '<leader>hb', gsigns.toggle_current_line_blame, { desc = 'Git Toggle Blame Line' }) + vim.keymap.set('n', '<leader>hn', gsigns.toggle_numhl, { desc = 'Git Highlight Num' }) + vim.keymap.set('o', 'ig', ':<C-U>lua require("gitsigns").select_hunk()<cr>') + vim.keymap.set('x', 'ig', ':<C-U>lua require("gitsigns").select_hunk()<cr>') +end + +if pcall(require, 'cmp_git') then local function filter_repo(git_info) -- dpgw issues are in one repo dpgw/dpgw if git_info.host == 'devel.bigroot.cz' then @@ -14,7 +54,7 @@ if has_cmp_git then return git_info end - cmp_git.setup { + require 'cmp_git'.setup { trigger_actions = { { debug_name = 'gitlab_issues', @@ -33,16 +73,5 @@ if has_cmp_git then end, }, }, - } end - -local has_igit, igit = pcall(require, 'igit') -if has_igit then - igit.setup({ - command = 'IG', - -- branch = { open_cmd = 'botright' }, - -- log = { open_cmd = 'botright' }, - -- status = { open_cmd = 'botright' }, - }) -end diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua @@ -1,39 +0,0 @@ -if not pcall(require, 'gitsigns') then - return -end - -local gsigns = require('gitsigns') - -local get_theme = function() - local dark_theme = { add = '│', change = '│', delete = '│', topdelete = '‾', changedelete = '│' } - local light_theme = { add = ' ', change = ' ', delete = ' ', topdelete = ' ', changedelete = ' ' } - - if vim.opt.background:get() == 'light' then - return light_theme - end - - return dark_theme -end - -local theme = get_theme() -gsigns.setup { - signs = { - add = { text = theme.add }, - change = { text = theme.change }, - delete = { text = theme.delete }, - topdelete = { text = theme.topdelete }, - changedelete = { text = theme.changedelete }, - }, -} - -vim.keymap.set('n', '<leader>hl', gsigns.next_hunk, { desc = 'Git Next Hunk' }) -vim.keymap.set('n', '<leader>hh', gsigns.prev_hunk, { desc = 'Git Previous Hunk' }) -vim.keymap.set('n', '<leader>hs', gsigns.stage_hunk, { desc = 'Git Stage Hunk' }) -vim.keymap.set('n', '<leader>hu', gsigns.undo_stage_hunk, { desc = 'Git Undo Stage Hunk' }) -vim.keymap.set('n', '<leader>hr', gsigns.reset_hunk, { desc = 'Git Reset Hunk' }) -vim.keymap.set('n', '<leader>hR', gsigns.reset_buffer, { desc = 'Git Reset Buffer' }) -vim.keymap.set('n', '<leader>hp', gsigns.preview_hunk, { desc = 'Git Preview Hunk' }) -vim.keymap.set('n', '<leader>hb', gsigns.toggle_current_line_blame, { desc = 'Git Toggle Blame Line' }) -vim.keymap.set('n', '<leader>hn', gsigns.toggle_numhl, { desc = 'Git Highlight Num' }) -vim.keymap.set('o', 'ig', ':<C-U>lua require("gitsigns").select_hunk()<cr>') -vim.keymap.set('x', 'ig', ':<C-U>lua require("gitsigns").select_hunk()<cr>') diff --git a/after/plugin/hardtime.lua b/after/plugin/hardtime.lua @@ -2,4 +2,14 @@ if not pcall(require, 'hardtime') then return end -require('hardtime').setup { disabled_filetypes = { 'qf', 'fugitiveblame', 'fugitive', 'netrw', 'dirbuf', 'mason', 'query' } } +require('hardtime').setup { + disabled_filetypes = { + 'qf', + 'fugitiveblame', + 'fugitive', + 'netrw', + 'dirbuf', + 'mason', + 'query', + }, +} diff --git a/after/plugin/hexen.lua b/after/plugin/hexen.lua @@ -1,7 +0,0 @@ -if not pcall(require, 'tms.p.hexen') then return end - --- TODO Arguments and range passed -vim.api.nvim_create_user_command('HexEncode', require('tms.p.hexen').encode, { range = true }) -vim.api.nvim_create_user_command('HexDecode', require('tms.p.hexen').decode, { range = true }) --- vim.cmd [[command! -range HexEncode lua require('tms.p.hexen').encode()]] --- vim.cmd [[command! -range HexDecode lua require('tms.p.hexen').decode()]] diff --git a/after/plugin/hi-pairs.lua b/after/plugin/hi-pairs.lua @@ -1,22 +0,0 @@ -if not vim.g.loaded_hiPairs then return end - -vim.g.loaded_matchparen = 1 -vim.g.hiPairs_timeout = 5 -vim.g.hiPairs_hl_matchPair = { - ['term'] = 'underline,bold', - ['cterm'] = 'bold', - ['ctermfg'] = 'none', - ['ctermbg'] = 'none', - ['guifg'] = 'none', - ['guibg'] = 'none', - ['gui'] = 'bold', -} -vim.g.hiPairs_hl_unmatchPair = { - ['term'] = 'underline,bold', - ['cterm'] = 'bold', - ['ctermfg'] = 'none', - ['ctermbg'] = 'none', - ['guifg'] = 'none', - ['guibg'] = 'none', - ['gui'] = 'bold', -} diff --git a/after/plugin/leap.lua b/after/plugin/leap.lua @@ -2,16 +2,16 @@ if not pcall(require, 'leap') then return end -local leap = require('leap') +local leap = require 'leap' leap.opts.highlight_unlabeled_phase_one_targets = true -local ast_ns = require('tms.p.leap').ast_ns +local ast_ns = require 'tms.p.leap'.ast_ns -local default_highlights = function() +local function default_highlights() vim.api.nvim_set_hl_ns(0) end -local ast_highlights = function() +local function ast_highlights() vim.api.nvim_set_hl_ns(ast_ns) end diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua @@ -37,7 +37,7 @@ local function keymap(client, buf) if client.supports_method('textDocument/documentHighlight') then vim.keymap.set('n', '<leader>k', lb.document_highlight, opt('LSP Highlight')) vim.api.nvim_create_autocmd('CursorMoved', - { group = lsp_group, buffer = buf, callback = vim.lsp.buf.clear_references }) + { group = lsp_group, buffer = buf, callback = vim.lsp.buf.clear_references }) end if client.supports_method('textDocument/inlayHint') then vim.keymap.set('n', 'gH', function() @@ -99,13 +99,13 @@ end -- mason if pcall(require, 'mason') then - require'mason'.setup() + require 'mason'.setup() local mlsp = require 'mason-lspconfig' mlsp.setup() mlsp.setup_handlers { function(name) - local opts = require'tms.lsp'.make_opts(name) - require'lspconfig'[name].setup(opts) + local opts = require 'tms.lsp'.make_opts(name) + require 'lspconfig'[name].setup(opts) end, ['jsonls'] = function() end, diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua @@ -1,138 +0,0 @@ -if not pcall(require, 'luasnip') then - return -end - -local ls = require('luasnip') -local types = require('luasnip.util.types') - -ls.config.set_config({ - history = true, - updateevents = 'TextChanged,TextChangedI', - ext_opts = { [types.choiceNode] = { active = { virt_text = { { '<- choice', 'Comment' } } } } }, -}) - -local opts = { silent = true } -vim.keymap.set({ 'i', 's' }, '<c-l>', function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end -end, opts) -vim.keymap.set({ 'i', 's' }, '<c-h>', function() - if ls.jumpable(-1) then - ls.jump(-1) - end -end, opts) -vim.keymap.set({ 'i' }, '<c-e>', function() - if ls.choice_active() then - ls.change_choice(1) - end -end, opts) -vim.keymap.set({ 'i' }, '<c-u>', require('luasnip.extras.select_choice'), opts) - -local s = ls.snippet -local sn = ls.snippet_node -local isn = ls.indent_snippet_node -local t = ls.text_node -local i = ls.insert_node -local f = ls.function_node -local c = ls.choice_node -local d = ls.dynamic_node -local r = ls.restore_node -local events = require('luasnip.util.events') -local ai = require('luasnip.nodes.absolute_indexer') -local p = require('luasnip.extras').partial -local rep = require('luasnip.extras').rep -local fmt = require('luasnip.extras.fmt').fmt - -local shell = function(command) - return function() - local file = io.popen(command, 'r') - local res = {} - for line in file:lines() do - table.insert(res, line) - end - return res[1] - end -end -local cmt = function() - return require('luasnip.util.util').buffer_comment_chars()[1] -end - -ls.cleanup() - -ls.add_snippets('all', { - s('bang', t('#!/usr/bin/env ')), - s('date', p(os.date, '%d.%m.%Y')), - s('time', p(os.date, '%H:%M:%S')), - s('todo', { f(cmt), t(' TODO('), f(shell('id -un')), t(') '), p(os.date, '%d.%m.%y'), t(': ') }), -}) - -ls.add_snippets('lua', { - s('f', fmt('function({}) {} end', { i(1), i(2) })), - s('F', fmt('function() {} end', { i(1) })), - s('r', fmt('require(\'{}\')', { i(1) })), - s('l', fmt('local {} = {}', { i(1), i(2) })), - s('lr', fmt('local {} = require(\'{}\')', { i(1), rep(1) })), -}) - -ls.add_snippets('dart', { - s('for', fmt([[ - for (final {} in {}) {{ - {} - }} - ]], { i(1), i(2), i(3) })), - s('fori', fmt([[ - for (var i = {}; i < {}; i++) {{ - {} - }} - ]], { i(1), i(2), i(3) })), - -- Angular - s('i', fmt([[ - @Input() - {}; - ]], { i(1) })), - s('o', fmt([[ - @Output() - Stream<{}> get {}; - ]], { i(1), i(2) })), - s('c', fmt([[ - import 'package:ngdart/angular.dart'; - - @Component( - selector: '{}', - template: '{}' - changeDetection: ChangeDetectionStrategy.OnPush, - ) - class {} {{ - {} - }} - ]], { i(1), i(2), i(3), i(4) })), - s('d', fmt([[ - import 'package:ngdart/angular.dart'; - - @Directive(selector: '{}') - class {} {{ - {} - }} - ]], { i(1), i(2), i(3) })), - s('vc', fmt([[ - @ViewChild({}) - {}? {} - ]], { i(1), i(2), i(3) })), - s('vch', fmt([[ - @ViewChildren({}) - List<{}>? {} - ]], { i(1), i(2), i(3) })), -}) - --- Angular -ls.add_snippets('html', { - s('if', fmt('*ngIf="{}"', { i(1) })), - s('nf', fmt('*ngFor="let {} of {}"', { i(1), i(2) })), - s('nfi', fmt('*ngFor="let {} of {}; let i=index"', { i(1), i(2) })), - s('ni', fmt('[{}]="{}"', { i(1), i(2) })), - s('no', fmt('({})="{}"', { i(1), i(2) })), - s('nb', fmt('[({})]="{}"', { i(1), i(2) })), -}) - -ls.add_snippets('scss', { s('v', fmt('var(--{})', { i(1) })) }) diff --git a/after/plugin/medoro.lua b/after/plugin/medoro.lua @@ -3,6 +3,6 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { group = group, pattern = '*/medoro/**', callback = function() - vim.keymap.set('n', '<leader>al', require('tms.medoro').lang, { buffer = true }) + vim.keymap.set('n', '<leader>al', require 'tms.medoro'.lang, { buffer = true }) end, }) diff --git a/after/plugin/neodev.lua b/after/plugin/neodev.lua @@ -2,4 +2,4 @@ if not pcall(require, 'neodev') then return end -require'neodev'.setup {} +require 'neodev'.setup {} diff --git a/after/plugin/neorg.lua b/after/plugin/neorg.lua @@ -1,6 +1,6 @@ if not pcall(require, 'neorg') then return end -require('neorg').setup({ +require 'neorg'.setup({ -- Tell Neorg what modules to load load = { ['core.integrations.treesitter'] = {}, diff --git a/after/plugin/neoscroll.lua b/after/plugin/neoscroll.lua @@ -2,8 +2,11 @@ if not pcall(require, 'neoscroll') then return end -require('neoscroll').setup { mappings = { '<C-u>', '<C-d>', '<C-b>', '<C-f>', 'zt', 'zz', 'zb' } } -require('neoscroll.config').set_mappings { +require 'neoscroll'.setup { + mappings = { '<C-u>', '<C-d>', '<C-b>', '<C-f>', 'zt', 'zz', 'zb' }, +} + +require 'neoscroll.config'.set_mappings { ['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '80' } }, ['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '80' } }, ['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '100' } }, diff --git a/after/plugin/no-neck-pain.lua b/after/plugin/no-neck-pain.lua @@ -2,4 +2,11 @@ if not pcall(require, 'no-neck-pain') then return end -require('no-neck-pain').setup { width = 130, buffers = { wo = { winfixwidth = true } } } +require('no-neck-pain').setup { + width = 130, + buffers = { + wo = { + winfixwidth = true, + }, + }, +} diff --git a/after/plugin/notify.lua b/after/plugin/notify.lua @@ -1,6 +1,12 @@ if not pcall(require, 'notify') then return end -local notify = require('notify') -notify.setup({ on_open = function(win) vim.api.nvim_win_set_config(win, { focusable = false }) end, stages = 'slide' }) +local notify = require 'notify' +notify.setup { + on_open = function(win) + vim.api.nvim_win_set_config(win, { focusable = false }) + end, + stages = 'slide', +} + vim.notify = notify -vim.keymap.set('n', '<leader>N', require('notify').dismiss, { desc = 'Dismiss notification' }) +vim.keymap.set('n', '<leader>N', require('notify').dismiss, { desc = 'Dismiss notification' }) diff --git a/after/plugin/nulls.lua b/after/plugin/nulls.lua @@ -1,77 +0,0 @@ -if not pcall(require, 'null-ls') then - return -end - -local null_ls = require('null-ls') -local h = require('null-ls.helpers') -local builtins = null_ls.builtins - -local zsh_diag = { - name = 'zsh check', - method = null_ls.methods.DIAGNOSTICS, - filetypes = { 'zsh' }, - update_on_insert = true, - generator = null_ls.generator({ - command = 'zsh', - args = { '-n', '$FILENAME' }, - format = 'line', - check_exit_code = function(code) - return code <= 1 - end, - from_stderr = true, - to_stdin = true, - on_output = h.diagnostics.from_patterns({ { pattern = [[%w+:(%d+): (.*)]], groups = { 'row', 'message' } } }), - }), -} - -null_ls.setup({ - sources = { - -- formatting - builtins.formatting.prettier.with { - filetypes = { 'typescript' }, - args = h.range_formatting_args_factory({ - '--parser', - vim.api.nvim_get_option_value('filetype', { scope = 'local' }), - '--trailing-comma', - 'all', - '--tab-width', - '2', - '--stdin-filepath', - '$FILENAME', - }, '--range-start', '--range-end'), - }, - builtins.formatting.prettier.with { - filetypes = { 'html' }, - args = h.range_formatting_args_factory({ - '--parser', - vim.api.nvim_get_option_value('filetype', { scope = 'local' }), - '--stdin-filepath', - '$FILENAME', - '--prose-wrap', - 'always', - '--plugin', - '/home/tms/.local/share/npm/lib/node_modules/prettier-plugin-organize-attributes/lib/index.js', - }, '--range-start', '--range-end'), - }, - builtins.formatting.prettier.with { - filetypes = { 'yaml', 'css', 'scss', 'markdown', 'graphql' }, - args = h.range_formatting_args_factory({ - '--parser', - vim.api.nvim_get_option_value('filetype', { scope = 'local' }), - '--stdin-filepath', - '$FILENAME', - '--prose-wrap', - 'always', - }, '--range-start', '--range-end'), - }, - builtins.formatting.lua_format, - -- builtins.formatting.clang_format, - builtins.formatting.shfmt.with { - filetypes = { 'sh', 'zsh' }, - args = { '-i', vim.opt.shiftwidth:get(), '-filename', '$FILENAME' }, - }, - -- diagnostic - builtins.diagnostics.shellcheck, - zsh_diag, - }, -}) diff --git a/after/plugin/nvim-surround.lua b/after/plugin/nvim-surround.lua @@ -1,6 +1,6 @@ if not pcall(require, 'nvim-surround') then return end -require('nvim-surround').setup() +require 'nvim-surround'.setup() vim.keymap.set('o', 'ir', 'i[') vim.keymap.set('o', 'ar', 'a[') diff --git a/after/plugin/pubspec.lua b/after/plugin/pubspec.lua @@ -5,10 +5,10 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { if #vim.fs.find('pubspec.yaml', { upward = true, type = 'file' }) == 0 then return end - vim.keymap.set('n', '<leader>an', require('tms.ft.dart.analyze').qf2131, { buffer = true, desc = 'Dart Analyze' }) + vim.keymap.set('n', '<leader>an', require 'tms.ft.dart.analyze'.qf2131, { buffer = true, desc = 'Dart Analyze' }) end, }) if pcall(require, 'pubspec-assist') then - require('pubspec-assist').setup() + require 'pubspec-assist'.setup() end diff --git a/after/plugin/qmk.lua b/after/plugin/qmk.lua @@ -5,236 +5,236 @@ end local source = {} function source:complete(_, callback) callback({ - { label = 'KC_NO', detail = [[Ignore this key (NOOP)]] }, - { label = 'KC_TRNS', detail = [[Use the next lowest non-transparent key ]] }, - { label = 'KC_A', detail = [[`a` and `A` ]] }, - { label = 'KC_B', detail = [[`b` and `B` ]] }, - { label = 'KC_C', detail = [[`c` and `C` ]] }, - { label = 'KC_D', detail = [[`d` and `D` ]] }, - { label = 'KC_E', detail = [[`e` and `E` ]] }, - { label = 'KC_F', detail = [[`f` and `F` ]] }, - { label = 'KC_G', detail = [[`g` and `G` ]] }, - { label = 'KC_H', detail = [[`h` and `H` ]] }, - { label = 'KC_I', detail = [[`i` and `I` ]] }, - { label = 'KC_J', detail = [[`j` and `J` ]] }, - { label = 'KC_K', detail = [[`k` and `K` ]] }, - { label = 'KC_L', detail = [[`l` and `L` ]] }, - { label = 'KC_M', detail = [[`m` and `M` ]] }, - { label = 'KC_N', detail = [[`n` and `N` ]] }, - { label = 'KC_O', detail = [[`o` and `O` ]] }, - { label = 'KC_P', detail = [[`p` and `P` ]] }, - { label = 'KC_Q', detail = [[`q` and `Q` ]] }, - { label = 'KC_R', detail = [[`r` and `R` ]] }, - { label = 'KC_S', detail = [[`s` and `S` ]] }, - { label = 'KC_T', detail = [[`t` and `T` ]] }, - { label = 'KC_U', detail = [[`u` and `U` ]] }, - { label = 'KC_V', detail = [[`v` and `V` ]] }, - { label = 'KC_W', detail = [[`w` and `W` ]] }, - { label = 'KC_X', detail = [[`x` and `X` ]] }, - { label = 'KC_Y', detail = [[`y` and `Y` ]] }, - { label = 'KC_Z', detail = [[`z` and `Z` ]] }, - { label = 'KC_1', detail = [[`1` and `!` ]] }, - { label = 'KC_2', detail = [[`2` and `@` ]] }, - { label = 'KC_3', detail = [[`3` and `#` ]] }, - { label = 'KC_4', detail = [[`4` and `$` ]] }, - { label = 'KC_5', detail = [[`5` and `%` ]] }, - { label = 'KC_6', detail = [[`6` and `^` ]] }, - { label = 'KC_7', detail = [[`7` and `&` ]] }, - { label = 'KC_8', detail = [[`8` and `*` ]] }, - { label = 'KC_9', detail = [[`9` and `(` ]] }, - { label = 'KC_0', detail = [[`0` and `)` ]] }, - { label = 'KC_ENT', detail = [[Return (Enter)]] }, - { label = 'KC_ESC', detail = [[Escape]] }, - { label = 'KC_BSPC', detail = [[Delete (Backspace)]] }, - { label = 'KC_TAB', detail = [[Tab ]] }, - { label = 'KC_SPC', detail = [[Spacebar]] }, - { label = 'KC_MINS', detail = [[`-` and `_` ]] }, - { label = 'KC_EQL', detail = [[`=` and `+` ]] }, - { label = 'KC_LBRC', detail = [[`[` and `{` ]] }, - { label = 'KC_RBRC', detail = [[`]` and `}` ]] }, - { label = 'KC_BSLS', detail = [[`\` and `\]] }, - { label = 'KC_NUHS', detail = [[Non-US `#` and `~`]] }, - { label = 'KC_SCLN', detail = [[`;` and `:` ]] }, - { label = 'KC_QUOT', detail = [[`'` and `"` ]] }, - { label = 'KC_GRV', detail = [[<code>&#96;</code> and `~`]] }, - { label = 'KC_COMM', detail = [[`,` and `<` ]] }, - { label = 'KC_DOT', detail = [[`.` and `>` ]] }, - { label = 'KC_SLSH', detail = [[`/` and `?` ]] }, - { label = 'KC_CAPS', detail = [[Caps Lock ]] }, - { label = 'KC_F1', detail = [[F1]] }, - { label = 'KC_F2', detail = [[F2]] }, - { label = 'KC_F3', detail = [[F3]] }, - { label = 'KC_F4', detail = [[F4]] }, - { label = 'KC_F5', detail = [[F5]] }, - { label = 'KC_F6', detail = [[F6]] }, - { label = 'KC_F7', detail = [[F7]] }, - { label = 'KC_F8', detail = [[F8]] }, - { label = 'KC_F9', detail = [[F9]] }, - { label = 'KC_F10', detail = [[F10 ]] }, - { label = 'KC_F11', detail = [[F11 ]] }, - { label = 'KC_F12', detail = [[F12 ]] }, - { label = 'KC_PSCR', detail = [[Print Screen]] }, - { label = 'KC_SCRL', detail = [[Scroll Lock, Brightness Down (macOS)]] }, - { label = 'KC_PAUS', detail = [[Pause, Brightness Up (macOS)]] }, - { label = 'KC_INS', detail = [[Insert]] }, - { label = 'KC_HOME', detail = [[Home]] }, - { label = 'KC_PGUP', detail = [[Page Up ]] }, - { label = 'KC_DEL', detail = [[Forward Delete]] }, - { label = 'KC_END', detail = [[End ]] }, - { label = 'KC_PGDN', detail = [[Page Down ]] }, - { label = 'KC_RGHT', detail = [[Right Arrow ]] }, - { label = 'KC_LEFT', detail = [[Left Arrow]] }, - { label = 'KC_DOWN', detail = [[Down Arrow]] }, - { label = 'KC_UP', detail = [[Up Arrow]] }, - { label = 'KC_NUM', detail = [[Keypad Num Lock and Clear ]] }, - { label = 'KC_PSLS', detail = [[Keypad `/`]] }, - { label = 'KC_PAST', detail = [[Keypad `*`]] }, - { label = 'KC_PMNS', detail = [[Keypad `-`]] }, - { label = 'KC_PPLS', detail = [[Keypad `+`]] }, - { label = 'KC_PENT', detail = [[Keypad Enter]] }, - { label = 'KC_P1', detail = [[Keypad `1` and End]] }, - { label = 'KC_P2', detail = [[Keypad `2` and Down Arrow ]] }, - { label = 'KC_P3', detail = [[Keypad `3` and Page Down]] }, - { label = 'KC_P4', detail = [[Keypad `4` and Left Arrow ]] }, - { label = 'KC_P5', detail = [[Keypad `5`]] }, - { label = 'KC_P6', detail = [[Keypad `6` and Right Arrow]] }, - { label = 'KC_P7', detail = [[Keypad `7` and Home ]] }, - { label = 'KC_P8', detail = [[Keypad `8` and Up Arrow ]] }, - { label = 'KC_P9', detail = [[Keypad `9` and Page Up]] }, - { label = 'KC_P0', detail = [[Keypad `0` and Insert ]] }, - { label = 'KC_PDOT', detail = [[Keypad `.` and Delete ]] }, - { label = 'KC_NUBS', detail = [[Non-US `\` and `\ ]] }, - { label = 'KC_APP', detail = [[Application (Windows Context Menu Key)]] }, - { label = 'KC_KB_POWER', detail = [[System Power]] }, - { label = 'KC_PEQL', detail = [[Keypad `=`]] }, - { label = 'KC_F13', detail = [[F13 ]] }, - { label = 'KC_F14', detail = [[F14 ]] }, - { label = 'KC_F15', detail = [[F15 ]] }, - { label = 'KC_F16', detail = [[F16 ]] }, - { label = 'KC_F17', detail = [[F17 ]] }, - { label = 'KC_F18', detail = [[F18 ]] }, - { label = 'KC_F19', detail = [[F19 ]] }, - { label = 'KC_F20', detail = [[F20 ]] }, - { label = 'KC_F21', detail = [[F21 ]] }, - { label = 'KC_F22', detail = [[F22 ]] }, - { label = 'KC_F23', detail = [[F23 ]] }, - { label = 'KC_F24', detail = [[F24 ]] }, - { label = 'KC_EXEC', detail = [[Execute ]] }, - { label = 'KC_HELP', detail = [[Help]] }, - { label = 'KC_MENU', detail = [[Menu]] }, - { label = 'KC_SLCT', detail = [[Select]] }, - { label = 'KC_STOP', detail = [[Stop]] }, - { label = 'KC_AGIN', detail = [[Again ]] }, - { label = 'KC_UNDO', detail = [[Undo]] }, - { label = 'KC_CUT', detail = [[Cut ]] }, - { label = 'KC_COPY', detail = [[Copy]] }, - { label = 'KC_PSTE', detail = [[Paste ]] }, - { label = 'KC_FIND', detail = [[Find]] }, - { label = 'KC_KB_MUTE', detail = [[Mute]] }, - { label = 'KC_KB_VOLUME_UP', detail = [[Volume Up ]] }, + { label = 'KC_NO', detail = [[Ignore this key (NOOP)]] }, + { label = 'KC_TRNS', detail = [[Use the next lowest non-transparent key ]] }, + { label = 'KC_A', detail = [[`a` and `A` ]] }, + { label = 'KC_B', detail = [[`b` and `B` ]] }, + { label = 'KC_C', detail = [[`c` and `C` ]] }, + { label = 'KC_D', detail = [[`d` and `D` ]] }, + { label = 'KC_E', detail = [[`e` and `E` ]] }, + { label = 'KC_F', detail = [[`f` and `F` ]] }, + { label = 'KC_G', detail = [[`g` and `G` ]] }, + { label = 'KC_H', detail = [[`h` and `H` ]] }, + { label = 'KC_I', detail = [[`i` and `I` ]] }, + { label = 'KC_J', detail = [[`j` and `J` ]] }, + { label = 'KC_K', detail = [[`k` and `K` ]] }, + { label = 'KC_L', detail = [[`l` and `L` ]] }, + { label = 'KC_M', detail = [[`m` and `M` ]] }, + { label = 'KC_N', detail = [[`n` and `N` ]] }, + { label = 'KC_O', detail = [[`o` and `O` ]] }, + { label = 'KC_P', detail = [[`p` and `P` ]] }, + { label = 'KC_Q', detail = [[`q` and `Q` ]] }, + { label = 'KC_R', detail = [[`r` and `R` ]] }, + { label = 'KC_S', detail = [[`s` and `S` ]] }, + { label = 'KC_T', detail = [[`t` and `T` ]] }, + { label = 'KC_U', detail = [[`u` and `U` ]] }, + { label = 'KC_V', detail = [[`v` and `V` ]] }, + { label = 'KC_W', detail = [[`w` and `W` ]] }, + { label = 'KC_X', detail = [[`x` and `X` ]] }, + { label = 'KC_Y', detail = [[`y` and `Y` ]] }, + { label = 'KC_Z', detail = [[`z` and `Z` ]] }, + { label = 'KC_1', detail = [[`1` and `!` ]] }, + { label = 'KC_2', detail = [[`2` and `@` ]] }, + { label = 'KC_3', detail = [[`3` and `#` ]] }, + { label = 'KC_4', detail = [[`4` and `$` ]] }, + { label = 'KC_5', detail = [[`5` and `%` ]] }, + { label = 'KC_6', detail = [[`6` and `^` ]] }, + { label = 'KC_7', detail = [[`7` and `&` ]] }, + { label = 'KC_8', detail = [[`8` and `*` ]] }, + { label = 'KC_9', detail = [[`9` and `(` ]] }, + { label = 'KC_0', detail = [[`0` and `)` ]] }, + { label = 'KC_ENT', detail = [[Return (Enter)]] }, + { label = 'KC_ESC', detail = [[Escape]] }, + { label = 'KC_BSPC', detail = [[Delete (Backspace)]] }, + { label = 'KC_TAB', detail = [[Tab ]] }, + { label = 'KC_SPC', detail = [[Spacebar]] }, + { label = 'KC_MINS', detail = [[`-` and `_` ]] }, + { label = 'KC_EQL', detail = [[`=` and `+` ]] }, + { label = 'KC_LBRC', detail = [[`[` and `{` ]] }, + { label = 'KC_RBRC', detail = [[`]` and `}` ]] }, + { label = 'KC_BSLS', detail = [[`\` and `\]] }, + { label = 'KC_NUHS', detail = [[Non-US `#` and `~`]] }, + { label = 'KC_SCLN', detail = [[`;` and `:` ]] }, + { label = 'KC_QUOT', detail = [[`'` and `"` ]] }, + { label = 'KC_GRV', detail = [[<code>&#96;</code> and `~`]] }, + { label = 'KC_COMM', detail = [[`,` and `<` ]] }, + { label = 'KC_DOT', detail = [[`.` and `>` ]] }, + { label = 'KC_SLSH', detail = [[`/` and `?` ]] }, + { label = 'KC_CAPS', detail = [[Caps Lock ]] }, + { label = 'KC_F1', detail = [[F1]] }, + { label = 'KC_F2', detail = [[F2]] }, + { label = 'KC_F3', detail = [[F3]] }, + { label = 'KC_F4', detail = [[F4]] }, + { label = 'KC_F5', detail = [[F5]] }, + { label = 'KC_F6', detail = [[F6]] }, + { label = 'KC_F7', detail = [[F7]] }, + { label = 'KC_F8', detail = [[F8]] }, + { label = 'KC_F9', detail = [[F9]] }, + { label = 'KC_F10', detail = [[F10 ]] }, + { label = 'KC_F11', detail = [[F11 ]] }, + { label = 'KC_F12', detail = [[F12 ]] }, + { label = 'KC_PSCR', detail = [[Print Screen]] }, + { label = 'KC_SCRL', detail = [[Scroll Lock, Brightness Down (macOS)]] }, + { label = 'KC_PAUS', detail = [[Pause, Brightness Up (macOS)]] }, + { label = 'KC_INS', detail = [[Insert]] }, + { label = 'KC_HOME', detail = [[Home]] }, + { label = 'KC_PGUP', detail = [[Page Up ]] }, + { label = 'KC_DEL', detail = [[Forward Delete]] }, + { label = 'KC_END', detail = [[End ]] }, + { label = 'KC_PGDN', detail = [[Page Down ]] }, + { label = 'KC_RGHT', detail = [[Right Arrow ]] }, + { label = 'KC_LEFT', detail = [[Left Arrow]] }, + { label = 'KC_DOWN', detail = [[Down Arrow]] }, + { label = 'KC_UP', detail = [[Up Arrow]] }, + { label = 'KC_NUM', detail = [[Keypad Num Lock and Clear ]] }, + { label = 'KC_PSLS', detail = [[Keypad `/`]] }, + { label = 'KC_PAST', detail = [[Keypad `*`]] }, + { label = 'KC_PMNS', detail = [[Keypad `-`]] }, + { label = 'KC_PPLS', detail = [[Keypad `+`]] }, + { label = 'KC_PENT', detail = [[Keypad Enter]] }, + { label = 'KC_P1', detail = [[Keypad `1` and End]] }, + { label = 'KC_P2', detail = [[Keypad `2` and Down Arrow ]] }, + { label = 'KC_P3', detail = [[Keypad `3` and Page Down]] }, + { label = 'KC_P4', detail = [[Keypad `4` and Left Arrow ]] }, + { label = 'KC_P5', detail = [[Keypad `5`]] }, + { label = 'KC_P6', detail = [[Keypad `6` and Right Arrow]] }, + { label = 'KC_P7', detail = [[Keypad `7` and Home ]] }, + { label = 'KC_P8', detail = [[Keypad `8` and Up Arrow ]] }, + { label = 'KC_P9', detail = [[Keypad `9` and Page Up]] }, + { label = 'KC_P0', detail = [[Keypad `0` and Insert ]] }, + { label = 'KC_PDOT', detail = [[Keypad `.` and Delete ]] }, + { label = 'KC_NUBS', detail = [[Non-US `\` and `\ ]] }, + { label = 'KC_APP', detail = [[Application (Windows Context Menu Key)]] }, + { label = 'KC_KB_POWER', detail = [[System Power]] }, + { label = 'KC_PEQL', detail = [[Keypad `=`]] }, + { label = 'KC_F13', detail = [[F13 ]] }, + { label = 'KC_F14', detail = [[F14 ]] }, + { label = 'KC_F15', detail = [[F15 ]] }, + { label = 'KC_F16', detail = [[F16 ]] }, + { label = 'KC_F17', detail = [[F17 ]] }, + { label = 'KC_F18', detail = [[F18 ]] }, + { label = 'KC_F19', detail = [[F19 ]] }, + { label = 'KC_F20', detail = [[F20 ]] }, + { label = 'KC_F21', detail = [[F21 ]] }, + { label = 'KC_F22', detail = [[F22 ]] }, + { label = 'KC_F23', detail = [[F23 ]] }, + { label = 'KC_F24', detail = [[F24 ]] }, + { label = 'KC_EXEC', detail = [[Execute ]] }, + { label = 'KC_HELP', detail = [[Help]] }, + { label = 'KC_MENU', detail = [[Menu]] }, + { label = 'KC_SLCT', detail = [[Select]] }, + { label = 'KC_STOP', detail = [[Stop]] }, + { label = 'KC_AGIN', detail = [[Again ]] }, + { label = 'KC_UNDO', detail = [[Undo]] }, + { label = 'KC_CUT', detail = [[Cut ]] }, + { label = 'KC_COPY', detail = [[Copy]] }, + { label = 'KC_PSTE', detail = [[Paste ]] }, + { label = 'KC_FIND', detail = [[Find]] }, + { label = 'KC_KB_MUTE', detail = [[Mute]] }, + { label = 'KC_KB_VOLUME_UP', detail = [[Volume Up ]] }, { label = 'KC_KB_VOLUME_DOWN', detail = [[Volume Down ]] }, - { label = 'KC_LCAP', detail = [[Locking Caps Lock ]] }, - { label = 'KC_LNUM', detail = [[Locking Num Lock]] }, - { label = 'KC_LSCR', detail = [[Locking Scroll Lock ]] }, - { label = 'KC_PCMM', detail = [[Keypad `,`]] }, + { label = 'KC_LCAP', detail = [[Locking Caps Lock ]] }, + { label = 'KC_LNUM', detail = [[Locking Num Lock]] }, + { label = 'KC_LSCR', detail = [[Locking Scroll Lock ]] }, + { label = 'KC_PCMM', detail = [[Keypad `,`]] }, { label = 'KC_KP_EQUAL_AS400', detail = [[Keypad `=` on AS/400 keyboards]] }, - { label = 'KC_INT1', detail = [[International 1 ]] }, - { label = 'KC_INT2', detail = [[International 2 ]] }, - { label = 'KC_INT3', detail = [[International 3 ]] }, - { label = 'KC_INT4', detail = [[International 4 ]] }, - { label = 'KC_INT5', detail = [[International 5 ]] }, - { label = 'KC_INT6', detail = [[International 6 ]] }, - { label = 'KC_INT7', detail = [[International 7 ]] }, - { label = 'KC_INT8', detail = [[International 8 ]] }, - { label = 'KC_INT9', detail = [[International 9 ]] }, - { label = 'KC_LNG1', detail = [[Language 1]] }, - { label = 'KC_LNG2', detail = [[Language 2]] }, - { label = 'KC_LNG3', detail = [[Language 3]] }, - { label = 'KC_LNG4', detail = [[Language 4]] }, - { label = 'KC_LNG5', detail = [[Language 5]] }, - { label = 'KC_LNG6', detail = [[Language 6]] }, - { label = 'KC_LNG7', detail = [[Language 7]] }, - { label = 'KC_LNG8', detail = [[Language 8]] }, - { label = 'KC_LNG9', detail = [[Language 9]] }, - { label = 'KC_ERAS', detail = [[Alternate Erase ]] }, - { label = 'KC_SYRQ', detail = [[SysReq/Attention]] }, - { label = 'KC_CNCL', detail = [[Cancel]] }, - { label = 'KC_CLR', detail = [[Clear ]] }, - { label = 'KC_PRIR', detail = [[Prior ]] }, - { label = 'KC_RETN', detail = [[Return]] }, - { label = 'KC_SEPR', detail = [[Separator ]] }, - { label = 'KC_OUT', detail = [[Out ]] }, - { label = 'KC_OPER', detail = [[Oper]] }, - { label = 'KC_CLAG', detail = [[Clear/Again ]] }, - { label = 'KC_CRSL', detail = [[CrSel/Props ]] }, - { label = 'KC_EXSL', detail = [[ExSel ]] }, - { label = 'KC_LCTL', detail = [[Left Control]] }, - { label = 'KC_LSFT', detail = [[Left Shift]] }, - { label = 'KC_LALT', detail = [[Left Alt (Option) ]] }, - { label = 'KC_LGUI', detail = [[Left GUI (Windows/Command/Meta key) ]] }, - { label = 'KC_RCTL', detail = [[Right Control ]] }, - { label = 'KC_RSFT', detail = [[Right Shift ]] }, - { label = 'KC_RALT', detail = [[Right Alt (Option/AltGr)]] }, - { label = 'KC_RGUI', detail = [[Right GUI (Windows/Command/Meta key)]] }, - { label = 'KC_PWR', detail = [[System Power Down ]] }, - { label = 'KC_SLEP', detail = [[System Sleep]] }, - { label = 'KC_WAKE', detail = [[System Wake ]] }, - { label = 'KC_MUTE', detail = [[Mute]] }, - { label = 'KC_VOLU', detail = [[Volume Up ]] }, - { label = 'KC_VOLD', detail = [[Volume Down ]] }, - { label = 'KC_MNXT', detail = [[Next Track]] }, - { label = 'KC_MPRV', detail = [[Previous Track]] }, - { label = 'KC_MSTP', detail = [[Stop Track]] }, - { label = 'KC_MPLY', detail = [[Play/Pause Track]] }, - { label = 'KC_MSEL', detail = [[Launch Media Player ]] }, - { label = 'KC_EJCT', detail = [[Eject ]] }, - { label = 'KC_MAIL', detail = [[Launch Mail ]] }, - { label = 'KC_CALC', detail = [[Launch Calculator ]] }, - { label = 'KC_MYCM', detail = [[Launch My Computer]] }, - { label = 'KC_WSCH', detail = [[Browser Search]] }, - { label = 'KC_WHOM', detail = [[Browser Home]] }, - { label = 'KC_WBAK', detail = [[Browser Back]] }, - { label = 'KC_WFWD', detail = [[Browser Forward ]] }, - { label = 'KC_WSTP', detail = [[Browser Stop]] }, - { label = 'KC_WREF', detail = [[Browser Refresh ]] }, - { label = 'KC_WFAV', detail = [[Browser Favorites ]] }, - { label = 'KC_MFFD', detail = [[Next Track]] }, - { label = 'KC_MRWD', detail = [[Previous Track]] }, - { label = 'KC_BRIU', detail = [[Brightness Up ]] }, - { label = 'KC_BRID', detail = [[Brightness Down ]] }, - { label = 'KC_CPNL', detail = [[Open Control Panel]] }, - { label = 'KC_ASST', detail = [[Launch Context-Aware Assistant]] }, - { label = 'MOD_LCTL', detail = 'Left Control' }, - { label = 'MOD_LSFT', detail = 'Left Shift' }, - { label = 'MOD_LALT', detail = 'Left Alt' }, - { label = 'MOD_LGUI', detail = 'Left GUI (Windows/Command/Meta key)' }, - { label = 'MOD_RCTL', detail = 'Right Control' }, - { label = 'MOD_RSFT', detail = 'Right Shift' }, - { label = 'MOD_RALT', detail = 'Right Alt (AltGr)' }, - { label = 'MOD_RGUI', detail = 'Right GUI (Windows/Command/Meta key)' }, - { label = 'MOD_HYPR', detail = 'Hyper (Left Control, Shift, Alt and GUI)' }, - { label = 'MOD_MEH', detail = 'Meh (Left Control, Shift, and Alt)' }, - { label = 'KC_TILD', detail = '~' }, - { label = 'KC_EXLM', detail = '!' }, - { label = 'KC_AT', detail = '@' }, - { label = 'KC_HASH', detail = '#' }, - { label = 'KC_DLR', detail = '$' }, - { label = 'KC_PERC', detail = '%' }, - { label = 'KC_CIRC', detail = '^' }, - { label = 'KC_AMPR', detail = '&' }, - { label = 'KC_ASTR', detail = '*' }, - { label = 'KC_LPRN', detail = '(' }, - { label = 'KC_RPRN', detail = ')' }, - { label = 'KC_UNDS', detail = '_' }, - { label = 'KC_PLUS', detail = '+' }, - { label = 'KC_LCBR', detail = '{' }, - { label = 'KC_RCBR', detail = '}' }, - { label = 'KC_PIPE', detail = [[\|]] }, - { label = 'KC_COLN', detail = ':' }, - { label = 'KC_DQT', detail = '"' }, - { label = 'KC_LT', detail = '<' }, - { label = 'KC_GT', detail = '>' }, - { label = 'KC_QUES', detail = '?' }, + { label = 'KC_INT1', detail = [[International 1 ]] }, + { label = 'KC_INT2', detail = [[International 2 ]] }, + { label = 'KC_INT3', detail = [[International 3 ]] }, + { label = 'KC_INT4', detail = [[International 4 ]] }, + { label = 'KC_INT5', detail = [[International 5 ]] }, + { label = 'KC_INT6', detail = [[International 6 ]] }, + { label = 'KC_INT7', detail = [[International 7 ]] }, + { label = 'KC_INT8', detail = [[International 8 ]] }, + { label = 'KC_INT9', detail = [[International 9 ]] }, + { label = 'KC_LNG1', detail = [[Language 1]] }, + { label = 'KC_LNG2', detail = [[Language 2]] }, + { label = 'KC_LNG3', detail = [[Language 3]] }, + { label = 'KC_LNG4', detail = [[Language 4]] }, + { label = 'KC_LNG5', detail = [[Language 5]] }, + { label = 'KC_LNG6', detail = [[Language 6]] }, + { label = 'KC_LNG7', detail = [[Language 7]] }, + { label = 'KC_LNG8', detail = [[Language 8]] }, + { label = 'KC_LNG9', detail = [[Language 9]] }, + { label = 'KC_ERAS', detail = [[Alternate Erase ]] }, + { label = 'KC_SYRQ', detail = [[SysReq/Attention]] }, + { label = 'KC_CNCL', detail = [[Cancel]] }, + { label = 'KC_CLR', detail = [[Clear ]] }, + { label = 'KC_PRIR', detail = [[Prior ]] }, + { label = 'KC_RETN', detail = [[Return]] }, + { label = 'KC_SEPR', detail = [[Separator ]] }, + { label = 'KC_OUT', detail = [[Out ]] }, + { label = 'KC_OPER', detail = [[Oper]] }, + { label = 'KC_CLAG', detail = [[Clear/Again ]] }, + { label = 'KC_CRSL', detail = [[CrSel/Props ]] }, + { label = 'KC_EXSL', detail = [[ExSel ]] }, + { label = 'KC_LCTL', detail = [[Left Control]] }, + { label = 'KC_LSFT', detail = [[Left Shift]] }, + { label = 'KC_LALT', detail = [[Left Alt (Option) ]] }, + { label = 'KC_LGUI', detail = [[Left GUI (Windows/Command/Meta key) ]] }, + { label = 'KC_RCTL', detail = [[Right Control ]] }, + { label = 'KC_RSFT', detail = [[Right Shift ]] }, + { label = 'KC_RALT', detail = [[Right Alt (Option/AltGr)]] }, + { label = 'KC_RGUI', detail = [[Right GUI (Windows/Command/Meta key)]] }, + { label = 'KC_PWR', detail = [[System Power Down ]] }, + { label = 'KC_SLEP', detail = [[System Sleep]] }, + { label = 'KC_WAKE', detail = [[System Wake ]] }, + { label = 'KC_MUTE', detail = [[Mute]] }, + { label = 'KC_VOLU', detail = [[Volume Up ]] }, + { label = 'KC_VOLD', detail = [[Volume Down ]] }, + { label = 'KC_MNXT', detail = [[Next Track]] }, + { label = 'KC_MPRV', detail = [[Previous Track]] }, + { label = 'KC_MSTP', detail = [[Stop Track]] }, + { label = 'KC_MPLY', detail = [[Play/Pause Track]] }, + { label = 'KC_MSEL', detail = [[Launch Media Player ]] }, + { label = 'KC_EJCT', detail = [[Eject ]] }, + { label = 'KC_MAIL', detail = [[Launch Mail ]] }, + { label = 'KC_CALC', detail = [[Launch Calculator ]] }, + { label = 'KC_MYCM', detail = [[Launch My Computer]] }, + { label = 'KC_WSCH', detail = [[Browser Search]] }, + { label = 'KC_WHOM', detail = [[Browser Home]] }, + { label = 'KC_WBAK', detail = [[Browser Back]] }, + { label = 'KC_WFWD', detail = [[Browser Forward ]] }, + { label = 'KC_WSTP', detail = [[Browser Stop]] }, + { label = 'KC_WREF', detail = [[Browser Refresh ]] }, + { label = 'KC_WFAV', detail = [[Browser Favorites ]] }, + { label = 'KC_MFFD', detail = [[Next Track]] }, + { label = 'KC_MRWD', detail = [[Previous Track]] }, + { label = 'KC_BRIU', detail = [[Brightness Up ]] }, + { label = 'KC_BRID', detail = [[Brightness Down ]] }, + { label = 'KC_CPNL', detail = [[Open Control Panel]] }, + { label = 'KC_ASST', detail = [[Launch Context-Aware Assistant]] }, + { label = 'MOD_LCTL', detail = 'Left Control' }, + { label = 'MOD_LSFT', detail = 'Left Shift' }, + { label = 'MOD_LALT', detail = 'Left Alt' }, + { label = 'MOD_LGUI', detail = 'Left GUI (Windows/Command/Meta key)' }, + { label = 'MOD_RCTL', detail = 'Right Control' }, + { label = 'MOD_RSFT', detail = 'Right Shift' }, + { label = 'MOD_RALT', detail = 'Right Alt (AltGr)' }, + { label = 'MOD_RGUI', detail = 'Right GUI (Windows/Command/Meta key)' }, + { label = 'MOD_HYPR', detail = 'Hyper (Left Control, Shift, Alt and GUI)' }, + { label = 'MOD_MEH', detail = 'Meh (Left Control, Shift, and Alt)' }, + { label = 'KC_TILD', detail = '~' }, + { label = 'KC_EXLM', detail = '!' }, + { label = 'KC_AT', detail = '@' }, + { label = 'KC_HASH', detail = '#' }, + { label = 'KC_DLR', detail = '$' }, + { label = 'KC_PERC', detail = '%' }, + { label = 'KC_CIRC', detail = '^' }, + { label = 'KC_AMPR', detail = '&' }, + { label = 'KC_ASTR', detail = '*' }, + { label = 'KC_LPRN', detail = '(' }, + { label = 'KC_RPRN', detail = ')' }, + { label = 'KC_UNDS', detail = '_' }, + { label = 'KC_PLUS', detail = '+' }, + { label = 'KC_LCBR', detail = '{' }, + { label = 'KC_RCBR', detail = '}' }, + { label = 'KC_PIPE', detail = [[\|]] }, + { label = 'KC_COLN', detail = ':' }, + { label = 'KC_DQT', detail = '"' }, + { label = 'KC_LT', detail = '<' }, + { label = 'KC_GT', detail = '>' }, + { label = 'KC_QUES', detail = '?' }, }) end @@ -250,7 +250,7 @@ vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { { name = 'qmk_keys' }, { name = 'nvim_lsp' }, { name = 'snippets' }, - { name = 'buffer', keyword_length = 5 }, + { name = 'buffer', keyword_length = 5 }, }, } end, diff --git a/after/plugin/rest-nvim.lua b/after/plugin/rest-nvim.lua @@ -2,7 +2,7 @@ if not pcall(require, 'rest-nvim') then return end -local rest = require('rest-nvim') +local rest = require 'rest-nvim' rest.setup() vim.api.nvim_create_user_command('Rest', function() diff --git a/after/plugin/ssr.lua b/after/plugin/ssr.lua @@ -1,3 +1,5 @@ if not pcall(require, 'ssr') then return end + +vim.keymap.set({ "n", "x" }, "<leader>sr", function() require "ssr".open() end) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua @@ -2,8 +2,8 @@ if not pcall(require, 'telescope') then return end -local telescope = require('telescope') -local actions = require('telescope.actions') +local telescope = require 'telescope' +local actions = require 'telescope.actions' telescope.setup { defaults = { mappings = { i = { ['<esc>'] = actions.close, ['<c-y>'] = actions.select_default } } }, @@ -17,11 +17,11 @@ pcall(telescope.load_extension, 'zk') pcall(telescope.load_extension, 'git_worktree') pcall(telescope.load_extension, 'advanced_git_search') -local l = require('tms.p.telescope').L +local l = require 'tms.p.telescope'.L local function builtin(name, theme) return function() - require('telescope.builtin')[name](theme) + require 'telescope.builtin'[name](theme) end end @@ -33,30 +33,30 @@ vim.keymap.set('n', '<space>t', builtin('treesitter'), { desc = 'Telescope Trees vim.keymap.set('n', '<space>c', builtin('git_status', l.dd_large()), { desc = 'Telescope Git Status' }) vim.keymap.set('n', '<space>e', builtin('grep_string'), { desc = 'Telescope Grep String' }) vim.keymap.set('n', '<space>l', function() - require('telescope.builtin')['current_buffer_fuzzy_find'](l.dd_large_noprev()) + require 'telescope.builtin'['current_buffer_fuzzy_find'](l.dd_large_noprev()) end, { desc = 'Telescope Buffer Lines' }) vim.keymap.set('n', '<space>b', builtin('buffers', l.dd_large()), { desc = 'Telescope Buffers' }) vim.keymap.set('n', '<space>h', builtin('help_tags'), { desc = 'Telescope Help Tags' }) vim.keymap.set('n', '<space>d', builtin('diagnostics', l.dd_large()), { desc = 'Telescope Diagnostics' }) vim.keymap.set('n', '<space>f', builtin('find_files', l.dd_large_noprev()), { desc = 'Telescope Find Files' }) vim.keymap.set('n', '<space>F', function() - require('telescope.builtin').find_files(l.dd_large_noprev({ no_ignore = true, hidden = true })) + require 'telescope.builtin'.find_files(l.dd_large_noprev({ no_ignore = true, hidden = true })) end, { desc = 'Telescope Find All Files' }) vim.keymap.set('n', '<space>P', function() - require('telescope.builtin').reloader(l.dd_noprev()) + require 'telescope.builtin'.reloader(l.dd_noprev()) end, { desc = 'Telescope Reloader' }) vim.keymap.set('n', '<space>wo', function() - require('telescope').extensions.git_worktree.git_worktrees() + require 'telescope'.extensions.git_worktree.git_worktrees() end, { desc = 'Telescope Git Worktree List' }) vim.keymap.set('n', '<space>wi', function() - require('telescope').extensions.git_worktree.create_git_worktree() + require 'telescope'.extensions.git_worktree.create_git_worktree() end, { desc = 'Telescope Git Worktree Create' }) vim.keymap.set('n', '<space>n', function() - require('telescope.builtin').find_files(require('telescope.themes').get_dropdown { + require 'telescope.builtin'.find_files(require 'telescope.themes'.get_dropdown { prompt_title = 'dotfiles', cwd = '~/.config/nvim', previewer = false, @@ -68,11 +68,11 @@ vim.api.nvim_create_autocmd('LspAttach', { group = group, callback = function() vim.keymap.set('n', '<space>m', function() - require('telescope.builtin').lsp_document_symbols(l.dd_large()) + require 'telescope.builtin'.lsp_document_symbols(l.dd_large()) end, { desc = 'Telescope Lsp Document Symbols' }) vim.keymap.set('n', '<space>M', function() - require('telescope.builtin').lsp_dynamic_workspace_symbols() + require 'telescope.builtin'.lsp_dynamic_workspace_symbols() end, { desc = 'Telescope LSP Dynamic Workspace Symbols' }) end, }) diff --git a/after/plugin/trans.lua b/after/plugin/trans.lua @@ -1,3 +1,3 @@ if not pcall(require, 'trans') then return end -vim.keymap.set('x', 'mtt', function() require('trans').translate() end) -vim.keymap.set('x', 'mtc', function() require('trans').translate('cs') end) +vim.keymap.set('x', 'mtt', function() require 'trans'.translate() end) +vim.keymap.set('x', 'mtc', function() require 'trans'.translate('cs') end) diff --git a/after/plugin/treesitter-context.lua b/after/plugin/treesitter-context.lua @@ -2,13 +2,13 @@ if not pcall(require, 'treesitter-context') then return end -require'treesitter-context'.setup { +require 'treesitter-context'.setup { -- enable = false, -- Enable this plugin (Can be enabled/disabled later via commands) -- max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. -- min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. line_numbers = true, multiline_threshold = 5, -- Maximum number of lines to show for a single context - trim_scope = 'inner', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + trim_scope = 'inner', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' -- mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' -- -- Separator between context and content. Should be a single character string, like '-'. -- -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua @@ -2,7 +2,7 @@ if not pcall(require, 'nvim-treesitter') then return end -local parser_configs = require('nvim-treesitter.parsers').get_parser_configs() +local parser_configs = require 'nvim-treesitter.parsers'.get_parser_configs() parser_configs.norg = { install_info = { @@ -28,7 +28,7 @@ parser_configs.norg_table = { }, } -require'nvim-treesitter.configs'.setup { +require 'nvim-treesitter.configs'.setup { -- ensure_intalled = 'all', -- ignore_install = { 'lua', 'vim', 'c' }, highlight = { enable = true }, diff --git a/after/plugin/typebreak.lua b/after/plugin/typebreak.lua @@ -1,3 +1,3 @@ if pcall(require, 'typebreak') then - vim.api.nvim_create_user_command('Typebreak', require('typebreak').start, {}); + vim.api.nvim_create_user_command('Typebreak', require 'typebreak'.start, {}); end diff --git a/after/plugin/ufo.lua b/after/plugin/ufo.lua @@ -1,26 +0,0 @@ -if not pcall(require, 'ufo') then - return -end - -local ufo = require('ufo') - --- vim.o.foldcolumn = 1 -vim.o.foldlevel = 99 -vim.o.foldlevelstart = 99 -vim.o.foldenable = true -vim.o.foldmethod = 'manual' - -vim.keymap.set('n', 'zL', ufo.openAllFolds, {}) -vim.keymap.set('n', 'zH', ufo.closeAllFolds, {}) - -ufo.setup({ - open_fold_hl_timeout = 150, - ---@diagnostic disable-next-line: unused-local - -- provider_selector = function(bufnr, filetype, buftype) - -- return { 'treesitter', 'indent' } - -- end, -}) - --- require('tms.colors').update(function(t) --- t.Group.new('UfoFoldedEllipsis', nil, t.dimm(t.groups.Normal.bg, 0.05)) --- end) diff --git a/after/plugin/undotree.lua b/after/plugin/undotree.lua @@ -1,4 +1,4 @@ - if not vim.g.loaded_undotree then return end - vim.g.undotree_WindowLayout = 2 - vim.g.undotree_SplitWidth = 50 - vim.keymap.set('n', '<F5>', '<cmd>UndotreeToggle<cr>') +if not vim.g.loaded_undotree then return end +vim.g.undotree_WindowLayout = 2 +vim.g.undotree_SplitWidth = 50 +vim.keymap.set('n', '<F5>', '<cmd>UndotreeToggle<cr>') diff --git a/after/plugin/zen.lua b/after/plugin/zen.lua @@ -1,11 +0,0 @@ -if not pcall(require, 'true-zen') then - return -end - -local zen = require('true-zen') -zen.setup { modes = { ataraxis = { backdrop = 0.05 }, narrow = { folds_style = 'invisible' } } } -vim.keymap.set('n', '<leader>nr', ':TZNarrow<CR>', { desc = 'Zen Line Narrow' }) -vim.keymap.set('v', '<leader>nr', ':\'<,\'>TZNarrow<CR>', { desc = 'Zen Range Narrow' }) -vim.keymap.set('n', '<leader>nf', zen.focus, { desc = 'Zen Focus' }) -vim.keymap.set('n', '<leader>nd', zen.minimalist, { desc = 'Zen Distract Free' }) -vim.keymap.set('n', '<leader>na', zen.ataraxis, { desc = 'Zen Atraxis' }) diff --git a/compiler/dart_ng_test.lua b/compiler/dart_ng_test.lua @@ -1,5 +1,5 @@ vim.v.current_compiler = 'dart_ng_test' -local set = require('tms.compiler').set +local set = require 'tms.compiler'.set set('makeprg', [[pub run build_runner test -- --no-color %]]) set('efm', [[%E%.%#\] %m \[E\]%.%#,%Z%.%#\.dart %l:%c %.%#,%C%.%#]]) diff --git a/ftplugin/c.lua b/ftplugin/c.lua diff --git a/ftplugin/dart.lua b/ftplugin/dart.lua @@ -1,8 +1,8 @@ vim.opt_local.comments = [[sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://]] vim.opt_local.commentstring = '//%s' vim.opt_local.includeexpr = [[v:lua.require('tms.ft.dart.package').package_path(v:fname)]] -vim.opt_local.isfname:append{ ':' } -vim.opt_local.iskeyword:append{ '$' } +vim.opt_local.isfname:append { ':' } +vim.opt_local.iskeyword:append { '$' } vim.opt_local.textwidth = 80 vim.opt_local.formatoptions:remove('t') vim.opt_local.makeprg = [[dart %]] @@ -10,8 +10,8 @@ vim.opt_local.efm = [[%f:%l:%c: %m]] vim.b.undo_ftplugin = 'setl com< cms< inex< isf<' vim.cmd.iabbrev('STring', 'String') -if pcall(require, 'no-neck-pain') and not require'no-neck-pain.state'.enabled and not vim.g.no_neck_init then - require'no-neck-pain'.enable() +if pcall(require, 'no-neck-pain') and not require 'no-neck-pain.state'.enabled and not vim.g.no_neck_init then + require 'no-neck-pain'.enable() -- at start cursor is in left most window vim.schedule(function() vim.cmd [[exe "normal \<c-w>l"]] @@ -24,7 +24,7 @@ if string.find(full_path, '%.pub%-cache') then vim.bo.modifiable = false end -require'tms.lsp.dart'.start() +require 'tms.lsp.dart'.start() vim.keymap.set('n', '<leader>ar', ':make<cr>', { desc = 'Dart Run' }) vim.keymap.set('n', '<leader>at', ':DartTest<cr>', { desc = 'Dart Test' }) diff --git a/ftplugin/gdscript.lua b/ftplugin/gdscript.lua @@ -2,6 +2,6 @@ vim.lsp.start { name = 'gdscript', cmd = vim.lsp.rpc.connect('127.0.0.1', 6005), filetypes = { 'gd', 'gdscript', 'gdscript3' }, - capabilities = require'tms.lsp'.capabilities(), + capabilities = require 'tms.lsp'.capabilities(), root_dir = vim.fs.dirname(vim.fs.find({ 'project.godot', '.git' }, { upward = true })[1]), } diff --git a/ftplugin/gitcommit.lua b/ftplugin/gitcommit.lua @@ -5,7 +5,7 @@ if pcall(require, 'cmp') then { name = 'git' }, { name = 'glab_dpgw' }, { name = 'path' }, - { name = 'buffer', keyword_length = 5 }, + { name = 'buffer', keyword_length = 5 }, }, } end diff --git a/ftplugin/go.lua b/ftplugin/go.lua @@ -1,11 +1,17 @@ vim.bo.makeprg = [[go run %]] -vim.lsp.start(require'tms.lsp'.make_opts('gopls')) +vim.lsp.start(require 'tms.lsp'.make_opts('gopls')) -- vim.cmd [[command! -buffer -nargs=? Godoc lua require('tms.ft.go.doc').godoc(vim.fn.expand('<args>'), vim.fn.expand('<cword>'))]] vim.api.nvim_create_autocmd('BufWritePre', - { callback = require('tms.ft.go').org_imports, buffer = 0, desc = 'Go Organize Imports' }) -vim.keymap.set('n', '<leader>ao', require('tms.ft.go').org_imports, { buffer = true, desc = 'Go Organize Imports' }) + { + callback = require 'tms.ft.go'.org_imports, + buffer = 0, + desc = 'Go Organize Imports', + } +) + +vim.keymap.set('n', '<leader>ao', require 'tms.ft.go'.org_imports, { buffer = true, desc = 'Go Organize Imports' }) vim.keymap.set('n', '<leader>ar', ':make<cr>', { buffer = true }) vim.keymap.set('n', '<leader>at', ':GoTest<cr>', { buffer = true }) diff --git a/ftplugin/help.lua b/ftplugin/help.lua diff --git a/ftplugin/html.lua b/ftplugin/html.lua @@ -1 +1 @@ -require'tms.lsp.dart'.start() +require 'tms.lsp.dart'.start() diff --git a/ftplugin/latte.lua b/ftplugin/latte.lua diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua @@ -6,8 +6,8 @@ vim.keymap.set('n', '<leader>ar', vim.cmd.make) vim.lsp.start { name = 'lua-language-server', cmd = { 'lua-language-server' }, - before_init = require'neodev.lsp'.before_init, - capabilities = require'tms.lsp'.capabilities(), + before_init = require 'neodev.lsp'.before_init, + capabilities = require 'tms.lsp'.capabilities(), root_dir = vim.fn.getcwd(), settings = { Lua = { diff --git a/ftplugin/mail.lua b/ftplugin/mail.lua @@ -1,3 +1,3 @@ vim.opt.spell = true vim.opt.spelllang = { 'cs', 'csa', 'en' } -vim.keymap.set('n', '<leader>aa', require('tms.p.telescope').mail_address, { buffer = true }) +vim.keymap.set('n', '<leader>aa', require 'tms.p.telescope'.mail_address, { buffer = true }) diff --git a/ftplugin/neorg.lua b/ftplugin/neorg.lua @@ -1,6 +1,5 @@ if pcall(require, 'cmp') then - require('cmp').setup.buffer { - -- + require 'cmp'.setup.buffer { -- completion = {autocomplete = false}, sources = { -- diff --git a/ftplugin/vim.lua b/ftplugin/vim.lua diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua @@ -2,8 +2,7 @@ vim.bo.makeprg = [[zsh -n -- %:S]] vim.bo.efm = [[%f:%l: %m,%f: line %l: %m, %-G%.%#]] if pcall(require, 'cmp') then - require('cmp').setup.buffer { - -- + require 'cmp'.setup.buffer { -- completion = { autocomplete = false }, sources = { -- diff --git a/lua/plugins.lua b/lua/plugins.lua @@ -1,6 +1,6 @@ vim.cmd.packadd('paq-nvim') return require('paq') { - { 'savq/paq-nvim', opt = true }, + { 'savq/paq-nvim', opt = true }, 'kyazdani42/nvim-web-devicons', 'nvim-lua/plenary.nvim', 'nvim-lua/popup.nvim', @@ -21,7 +21,7 @@ return require('paq') { 'karb94/neoscroll.nvim', 'elihunter173/dirbuf.nvim', 'j-hui/fidget.nvim', - { 'lervag/vimtex', opt = true }, + { 'lervag/vimtex', opt = true }, 'milisims/nvim-luaref', -- { 'nvim-neorg/neorg', requires = { 'nvim-lua/plenary.nvim' } } 'mickael-menu/zk-nvim', @@ -34,7 +34,7 @@ return require('paq') { 'tpope/vim-fugitive', 'ThePrimeagen/git-worktree.nvim', 'rhysd/conflict-marker.vim', - { 'rest-nvim/rest.nvim', requires = { 'nvim-lua/plenary.nvim' }, opt = true }, + { 'rest-nvim/rest.nvim', requires = { 'nvim-lua/plenary.nvim' }, opt = true }, 'tikhomirov/vim-glsl', 'windwp/nvim-ts-autotag', 'baskerville/vim-sxhkdrc', diff --git a/lua/tms/ft/dart/analyze.lua b/lua/tms/ft/dart/analyze.lua @@ -3,7 +3,7 @@ local loop = vim.loop local M = {} -- Dart analyze to quickfix list -M.qf = function(make_entry) +function M.qf(make_entry) local list = {} local onread = function(err, data) @@ -18,7 +18,7 @@ M.qf = function(make_entry) local stdout = loop.new_pipe(false) local handle print('Analyzing...') - handle = loop.spawn('dart', {args = {'analyze'}, stdio = {nil, stdout, nil}}, vim.schedule_wrap(function() + handle = loop.spawn('dart', { args = { 'analyze' }, stdio = { nil, stdout, nil } }, vim.schedule_wrap(function() stdout:read_stop() stdout:close() handle:close() @@ -34,21 +34,21 @@ M.qf = function(make_entry) loop.read_start(stdout, onread) end -M.qf2103 = function() +function M.qf2103() local dart2103 = function(line) local level, msg, filename, lnum, lcol = string.match(line, '(%a+) %- (.*) at (%S+):(%d+):(%d+) .*') if level and filename and lnum and lcol and msg then - return {type = string.sub(level, 1, 1):upper(), filename = filename, lnum = lnum, lcol = lcol, text = msg} + return { type = string.sub(level, 1, 1):upper(), filename = filename, lnum = lnum, lcol = lcol, text = msg } end end M.qf(dart2103) end -M.qf2131 = function() +function M.qf2131() local dart2131 = function(line) local level, filename, lnum, lcol, msg = string.match(line, '(%a+) %- (%S+):(%d+):(%d+) %- (.*)') if level and filename and lnum and lcol and msg then - return {type = string.sub(level, 1, 1):upper(), filename = filename, lnum = lnum, lcol = lcol, text = msg} + return { type = string.sub(level, 1, 1):upper(), filename = filename, lnum = lnum, lcol = lcol, text = msg } end end M.qf(dart2131) diff --git a/lua/tms/p/hexen.lua b/lua/tms/p/hexen.lua @@ -1,78 +0,0 @@ -local utf8 = require('luautf8') -local api = vim.api -local fn = vim.fn - -local M = {} - --- Encode - -local function byteToHex(b) - return string.format('\\u%04X', b) -end - -local function lineToHex(line) - local r = {} - for _, j in utf8.codes(line) do - if j > 128 then - table.insert(r, byteToHex(j)) - else - table.insert(r, utf8.char(j)) - end - end - return table.concat(r, '') -end - --- Decode - -local function byteFromHex(h) - return tonumber(h, 16) -end - -local function lineFromHex(line) - local sub = string.gsub(line, '\\u(%x+)', function(hex) - return utf8.char(byteFromHex(hex)) - end) - return sub -end - --- -- - -local function translate(filterFn) - local _s = fn.getpos('\'<') - local start_range = { _s[2], _s[3] } - local _e = fn.getpos('\'>') - local end_range = { _e[2], _e[3] } - - local lines = api.nvim_buf_get_lines(0, start_range[1] - 1, end_range[1], true) - if #lines == 0 then - print('No lines selected') - return - end - local end_col = #lines[#lines] - end_range[2] = math.min(end_col, end_range[2] + 1) - lines[#lines] = string.sub(lines[#lines], 1, end_range[2]) - lines[1] = string.sub(lines[1], start_range[2]) - - local r = {} - for _, v in pairs(lines) do - table.insert(r, filterFn(v)) - end - - api.nvim_buf_set_text(0, start_range[1] - 1, start_range[2] - 1, end_range[1] - 1, end_range[2], r) -end - --- API - -function M.decode() - translate(lineFromHex) -end - -function M.encode() - translate(lineToHex) -end - -return M - --- +ěščř --- žýáíé --- +\u011B\u0161\u010D\u0159\u017E\u00FD\u00E1\u00ED\u00E9 diff --git a/plugin/bufremove.lua b/plugin/bufremove.lua @@ -149,7 +149,7 @@ function H.can_remove(buf_id, force, fun_name) if vim.api.nvim_buf_get_option(buf_id, 'modified') then H.notify(string.format('Buffer %d has unsaved changes. Use `Bufremove.%s(%d, true)` to force.', buf_id, fun_name, - buf_id)) + buf_id)) return false end return true diff --git a/plugin/diagflow.lua b/plugin/diagflow.lua @@ -57,7 +57,7 @@ local function create_boxed_text(text_lines) local top_border = border_chars.top_left .. string.rep(border_chars.horizontal, max_length) .. border_chars.top_right local bottom_border = border_chars.bottom_left .. string.rep(border_chars.horizontal, max_length) .. - border_chars.bottom_right + border_chars.bottom_right local boxed_lines = { top_border } for _, line in ipairs(text_lines) do diff --git a/plugin/file_pairs.lua b/plugin/file_pairs.lua @@ -5,9 +5,9 @@ local letter_set = {} local set_mark = function(letter, path, buffer) path = path or vim.fn.expand('%') if buffer == nil then buffer = true end - vim.keymap.set('n', '<leader>m' .. letter, '<cmd>edit ' .. path .. '<cr>', { buffer = buffer}) - vim.keymap.set('n', '<leader>mv' .. letter, '<cmd>vsplit ' .. path .. '<cr>', { buffer = buffer}) - vim.keymap.set('n', '<leader>mx' .. letter, '<cmd>split ' .. path .. '<cr>', { buffer = buffer}) + vim.keymap.set('n', '<leader>m' .. letter, '<cmd>edit ' .. path .. '<cr>', { buffer = buffer }) + vim.keymap.set('n', '<leader>mv' .. letter, '<cmd>vsplit ' .. path .. '<cr>', { buffer = buffer }) + vim.keymap.set('n', '<leader>mx' .. letter, '<cmd>split ' .. path .. '<cr>', { buffer = buffer }) end local unset_marks = function() @@ -22,7 +22,7 @@ local unset_marks = function() end local configure = function() - -- TODO(tms) 19.11.21: + -- TODO(tms) 19.11.21: unset_marks() local filename = vim.fn.expand('%:t:r') local dir = vim.fn.expand('%:h') diff --git a/plugin/json_qf.lua b/plugin/json_qf.lua @@ -21,7 +21,7 @@ local function populate_qf(type, sort, use_quickfix) local json_types = { 'string', 'number', 'boolean', 'array', 'object', 'null' } if has_value(json_types, type) then for s in vim.fn.system('jq -c \'to_entries[] | if (.value|type == "' .. type .. '") then .key else empty end\' ' .. - cur_file):gmatch('[^\r\n]+') do + cur_file):gmatch('[^\r\n]+') do local key = s:gsub('%"', ''):gsub('^%s*(.-)%s*$', '%1'):gsub(',', '') table.insert(cmd_lines, key) end @@ -36,7 +36,7 @@ local function populate_qf(type, sort, use_quickfix) local qf_list = {} for _, v in pairs(cmd_lines) do table.insert(qf_list, - { filename = cur_file, lnum = get_key_location(v).row, col = get_key_location(v).col, text = v }) + { filename = cur_file, lnum = get_key_location(v).row, col = get_key_location(v).col, text = v }) end if use_quickfix then diff --git a/plugin/match.lua b/plugin/match.lua @@ -1,3 +0,0 @@ --- vim.api.nvim_create_user_command('Match', function(args) --- vim.cmd.match() --- end, {}) diff --git a/plugin/qftf.lua b/plugin/qftf.lua @@ -1,44 +0,0 @@ -function _G.qftf(info) - local items - local ret = {} - if info.quickfix == 1 then - items = vim.fn.getqflist({ id = info.id, items = 0 }).items - else - items = vim.fn.getloclist(info.winid, { id = info.id, items = 0 }).items - end - local limit = 31 - local fname_fmt1, fname_fmt2 = '%-' .. limit .. 's', '…%.' .. (limit - 1) .. 's' - local valid_fmt = '%s │%4d:%-3d│%s %s' - for i = info.start_idx, info.end_idx do - local e = items[i] - local fname = '' - local str - if e.valid == 1 then - if e.bufnr > 0 then - fname = vim.fn.bufname(e.bufnr) - if fname == '' then - fname = '[No Name]' - else - fname = fname:gsub('^' .. vim.env.HOME, '~') - end - -- char in fname may occur more than 1 width, ignore this issue in order to keep performance - if #fname <= limit then - fname = fname_fmt1:format(fname) - else - fname = fname_fmt2:format(fname:sub(1 - limit)) - end - end - local lnum = e.lnum > 99999 and -1 or e.lnum - local col = e.col > 999 and -1 or e.col - local qtype = e.type == '' and '' or ' ' .. e.type:sub(1, 1):upper() - local text = e.text:gsub('^%s*(.-)%s*$', '%1') - str = valid_fmt:format(fname, lnum, col, qtype, text) - else - str = e.text - end - table.insert(ret, str) - end - return ret -end - --- vim.opt.qftf = '{info -> v:lua._G.qftf(info)}' diff --git a/plugin/snippet.lua b/plugin/snippet.lua @@ -3,6 +3,7 @@ vim.keymap.set({ 'i', 's' }, '<c-l>', function() vim.snippet.jump(1) end end, { desc = 'Snippet Jump Forward' }) + vim.keymap.set({ 'i', 's' }, '<c-h>', function() if vim.snippet.jumpable(-1) then vim.snippet.jump(-1) diff --git a/plugin/trans.lua b/plugin/trans.lua @@ -1,4 +0,0 @@ -if not pcall(require, 'trans') then return end - -vim.keymap.set('x', 'mtt', function() require('trans').translate() end) -vim.keymap.set('x', 'mtc', function() require('trans').translate('cs') end) diff --git a/plugin/vimtex.lua b/plugin/vimtex.lua