neovim

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

commit b6268fc537f4b8c8799fabdf7dcb058f3fa2eca0
Author: tms <nemi@skaut.cz>
Date:   Mon, 26 Jul 2021 21:57:34 +0200

Init

Diffstat:
Aafter/queries/dart/injections.scm | 17+++++++++++++++++
Aafter/queries/dart/textobjects.scm | 1+
Aafter/queries/html/textobjects.scm | 1+
Acompiler/bash.vim | 21+++++++++++++++++++++
Acompiler/dart.vim | 18++++++++++++++++++
Acompiler/dart_ng_test.vim | 18++++++++++++++++++
Acompiler/dcli.vim | 18++++++++++++++++++
Acompiler/lua.vim | 18++++++++++++++++++
Acompiler/zsh.vim | 21+++++++++++++++++++++
Aftplugin/cpp.lua | 1+
Aftplugin/dart.lua | 9+++++++++
Aftplugin/dart.vim | 26++++++++++++++++++++++++++
Aftplugin/go.lua | 2++
Aftplugin/h.lua | 2++
Aftplugin/json.lua | 1+
Aftplugin/lua.lua | 1+
Aftplugin/mail.lua | 4++++
Aftplugin/scheme.lua | 1+
Aftplugin/sh.lua | 1+
Aftplugin/zsh.lua | 1+
Ainit.lua | 169+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/c/autocmd.lua | 39+++++++++++++++++++++++++++++++++++++++
Alua/tms/c/keybind.lua | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/colors.lua | 128+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/ft/dart.lua | 161+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/ft/dart/debug_func.lua | 47+++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/ft/go/doc.lua | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/lsp/efm.lua | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/lsp/init.lua | 150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/actions/init.lua | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/actions/predicates.lua | 29+++++++++++++++++++++++++++++
Alua/tms/p/async_make.lua | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/bqf.lua | 11+++++++++++
Alua/tms/p/compe.lua | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/dap.lua | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/firenvim.lua | 15+++++++++++++++
Alua/tms/p/gitlens.lua | 36++++++++++++++++++++++++++++++++++++
Alua/tms/p/gitsigns.lua | 46++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/hexen.lua | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/snippets/dart.lua | 148+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/snippets/html.lua | 9+++++++++
Alua/tms/p/snippets/init.lua | 37+++++++++++++++++++++++++++++++++++++
Alua/tms/p/snippets/utils.lua | 32++++++++++++++++++++++++++++++++
Alua/tms/p/status.lua | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/telescope.lua | 181+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/terminal.lua | 127+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/treesitter.lua | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/trun.lua | 46++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/p/vifm.lua | 28++++++++++++++++++++++++++++
Alua/tms/plugins.lua | 523+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/u/git.lua | 14++++++++++++++
Alua/tms/u/plugins.lua | 15+++++++++++++++
Alua/tms/u/reload.lua | 17+++++++++++++++++
Alua/tms/u/ws.lua | 17+++++++++++++++++
Alua/tms/ws/init.lua | 45+++++++++++++++++++++++++++++++++++++++++++++
Alua/tms/ws/medoro.lua | 19+++++++++++++++++++
Aplugin/async_make.lua | 2++
Aplugin/bufonly.vim | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aplugin/color.vim | 4++++
Aplugin/debug.lua | 4++++
Aplugin/fold.vim | 9+++++++++
Aplugin/hexen.lua | 2++
Aplugin/marks.lua | 35+++++++++++++++++++++++++++++++++++
Aplugin/packer_compiled.lua | 598+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aplugin/plugins.vim | 7+++++++
Aplugin/quickfix.lua | 5+++++
Aplugin/tabularize.vim | 12++++++++++++
Aplugin/terminal.lua | 28++++++++++++++++++++++++++++
Aplugin/trun.lua | 6++++++
Aplugin/unimpaired.lua | 47+++++++++++++++++++++++++++++++++++++++++++++++
Aspell/cs.utf-8.add | 7+++++++
Aspell/cs.utf-8.add.spl | 0
Aspell/cs.utf-8.spl | 0
Aspell/csa.ascii.add | 6++++++
Aspell/csa.ascii.add.spl | 0
Asyntax/latte.vim | 127+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asyntax/neomuttrc.vim | 861+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atest/efm_bug.lua | 24++++++++++++++++++++++++
Atest/qf.lua | 31+++++++++++++++++++++++++++++++
Atest/test.lua | 234+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
80 files changed, 5107 insertions(+), 0 deletions(-)

diff --git a/after/queries/dart/injections.scm b/after/queries/dart/injections.scm @@ -0,0 +1,17 @@ +(annotation + (arguments + (named_argument + (label (identifier) @_identifier) + (list_literal (string_literal) @css) + ) + ) +(#eq? @_identifier "styles")) + +(annotation + (arguments + (named_argument + (label (identifier) @_identifier) + (string_literal) @html + ) + ) +(#eq? @_identifier "template")) diff --git a/after/queries/dart/textobjects.scm b/after/queries/dart/textobjects.scm @@ -0,0 +1 @@ +[(identifier) (type_identifier)] @identifier diff --git a/after/queries/html/textobjects.scm b/after/queries/html/textobjects.scm @@ -0,0 +1 @@ +(attribute) @attribute diff --git a/compiler/bash.vim b/compiler/bash.vim @@ -0,0 +1,21 @@ +" Vim compiler file +" Compiler: Bash +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2020 Sep 6 + +if exists("current_compiler") + finish +endif +let current_compiler = "bash" +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=sh\ %:S +CompilerSet errorformat=%f:\ line\ %l:\ %m + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/compiler/dart.vim b/compiler/dart.vim @@ -0,0 +1,18 @@ +" Vim compiler file +" Compiler: Dart test +" Maintainer: Tomas Nemec <nemi@skaut.cz> +" Last Change: May 17 2021 + +if exists("current_compiler") + finish +endif +let current_compiler = "dart" + +let s:cpo_save = &cpo +set cpo&vim + +set makeprg=dart\ % +set errorformat=%f:%l:%c:\ %m + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/compiler/dart_ng_test.vim b/compiler/dart_ng_test.vim @@ -0,0 +1,18 @@ +" Vim compiler file +" Compiler: Dart test +" Maintainer: Tomas Nemec <nemi@skaut.cz] +" Last Change: Mon May 17 10:34:27 AM CEST 2021 + +if exists("current_compiler") + finish +endif +let current_compiler = "dart_ng_test" + +let s:cpo_save = &cpo +set cpo&vim + +set makeprg=pub\ run\ build_runner\ test\ -c\ test\ --\ --no-color\ % +set errorformat=%E%.%#\]\ %m\ \[E\]%.%#,%Z%.%#\.dart\ %l:%c\ %.%#,%C%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/compiler/dcli.vim b/compiler/dcli.vim @@ -0,0 +1,18 @@ +" Vim compiler file +" Compiler: Dart test +" Maintainer: Tomas Nemec <nemi@skaut.cz> +" Last Change: May 17 2021 + +if exists("current_compiler") + finish +endif +let current_compiler = "dcli" + +let s:cpo_save = &cpo +set cpo&vim + +set makeprg=dcli\ run\ % +set errorformat=%f:%l:%c:\ %m + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/compiler/lua.vim b/compiler/lua.vim @@ -0,0 +1,18 @@ +" Vim compiler file +" Compiler: Lua +" Maintainer: Tomas Nemec <nemi@skaut.cz> +" Last Change: Jun 10 2021 + +if exists("current_compiler") + finish +endif +let current_compiler = "lua" + +let s:cpo_save = &cpo +set cpo&vim + +set makeprg=lua\ %:S +set errorformat=lua:\ %f:%l:\ %m + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/compiler/zsh.vim b/compiler/zsh.vim @@ -0,0 +1,21 @@ +" Vim compiler file +" Compiler: Zsh +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2020 Sep 6 + +if exists("current_compiler") + finish +endif +let current_compiler = "zsh" +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal <args> +endif + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet makeprg=zsh\ -n\ --\ %:S +CompilerSet errorformat=%f:%l:\ %m,%f:\ line\ %l:\ %m,\ %-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/ftplugin/cpp.lua b/ftplugin/cpp.lua @@ -0,0 +1 @@ +vim.wo.foldmethod = 'syntax' diff --git a/ftplugin/dart.lua b/ftplugin/dart.lua @@ -0,0 +1,9 @@ +vim.g.dart_style_guide = 2 +vim.g.dart_html_in_string = true +require('tms.ft.dart').setup() + +if vim.fn.getline(1):match('^#!.*dcli') then + vim.cmd [[comp dcli]] +else + vim.cmd [[comp dart]] +end diff --git a/ftplugin/dart.vim b/ftplugin/dart.vim @@ -0,0 +1,26 @@ +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +" Enable automatic indentation (2 spaces) if variable g:dart_style_guide is set +if exists('g:dart_style_guide') + setlocal expandtab + setlocal shiftwidth=2 + setlocal softtabstop=2 + + setlocal formatoptions-=t +endif + +" Set 'comments' to format dashed lists in comments. +setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,:// + +setlocal commentstring=//%s +let s:win_sep = (has('win32') || has('win64')) ? '/' : '' +let &l:errorformat = '%f:%l:%c:\ %m' + +setlocal includeexpr=dart#resolveUri(v:fname) +setlocal isfname+=: +setlocal iskeyword+=$ + +let b:undo_ftplugin = 'setl et< fo< sw< sts< com< cms< inex< isf<' diff --git a/ftplugin/go.lua b/ftplugin/go.lua @@ -0,0 +1,2 @@ +vim.cmd [[comp go]] +vim.cmd [[command! -nargs=? Godoc lua require('tms.ft.go.doc').godoc(vim.fn.expand('<args>'), vim.fn.expand('<cword>'))]] diff --git a/ftplugin/h.lua b/ftplugin/h.lua @@ -0,0 +1 @@ +cpp.lua +\ No newline at end of file diff --git a/ftplugin/json.lua b/ftplugin/json.lua @@ -0,0 +1 @@ +vim.cmd('match Comment +\\/\\/.\\+$+') diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua @@ -0,0 +1 @@ +vim.cmd[[comp lua]] diff --git a/ftplugin/mail.lua b/ftplugin/mail.lua @@ -0,0 +1,4 @@ +vim.opt.spelllang = 'cs,csa,en' +vim.opt.spell = true + +require('tms.p.compe').setup({spell = true}) diff --git a/ftplugin/scheme.lua b/ftplugin/scheme.lua @@ -0,0 +1 @@ +vim.opt.filetype = 'query' diff --git a/ftplugin/sh.lua b/ftplugin/sh.lua @@ -0,0 +1 @@ +vim.cmd [[comp bash]] diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua @@ -0,0 +1 @@ +vim.cmd [[comp zsh]] diff --git a/init.lua b/init.lua @@ -0,0 +1,169 @@ +local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim' + +if vim.fn.empty(vim.fn.glob(install_path)) > 0 then + vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path) +end + +-- vim.api.nvim_exec([[ +-- augroup Packer +-- autocmd! +-- autocmd BufWritePost lua/tms/plugins.lua PackerCompile +-- augroup end +-- ]], false) + +vim.g.mapleader = ',' +vim.cmd('syntax enable') +vim.cmd [[colorscheme gruvbox]] +vim.opt.background = 'dark' + +-- OPTIONS +-- external vimrc +vim.opt.exrc = true +vim.opt.secure = true +-- utilsions +vim.opt.clipboard = 'unnamedplus' +vim.opt.completeopt = 'menuone,noselect' +vim.opt.equalalways = false +vim.opt.grepprg = 'rg --vimgrep --no-heading --smart-case' +vim.opt.grepformat = '%f:%l:%c:%m' +vim.opt.hidden = true +vim.opt.ignorecase = true +vim.opt.inccommand = 'split' +vim.opt.incsearch = true +vim.opt.mouse = 'a' +vim.opt.pumheight = 20 +vim.opt.shiftround = true +vim.opt.shortmess = vim.opt.shortmess + 'c' +vim.opt.showbreak = '">\\ "' +vim.opt.cursorline = true +vim.opt.showmode = false +vim.opt.smartcase = true +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.opt.termguicolors = true +vim.opt.updatetime = 100 +vim.opt.writebackup = false +vim.opt.expandtab = true +vim.opt.shiftwidth = 2 +vim.opt.smartindent = true +vim.opt.softtabstop = -1 +vim.opt.swapfile = false +vim.opt.tabstop = 2 +vim.opt.undofile = true +vim.opt.foldlevel = 999 +vim.opt.foldmethod = 'indent' +vim.opt.foldtext = 'MyFoldText()' +vim.opt.list = false +vim.opt.listchars = { + space = '·', + tab = '» ', + extends = '›', + precedes = '‹', + nbsp = '_', + trail = '_', + eol = '$', +} +vim.opt.fillchars = {eob = '•', fold = ' '} +vim.opt.number = false +vim.opt.scrolloff = 5 +vim.opt.sidescrolloff = 5 +vim.opt.signcolumn = 'yes:1' + +-- MAPPINGS +local kb = require('astronauta.keymap') +local nmap = kb.nmap +local nnoremap = kb.nnoremap +local tnoremap = kb.tnoremap +local vnoremap = kb.vnoremap +local inoremap = kb.inoremap +-- forget visual +nmap {'Q', '<nop>'} +-- kb.nnoremap('<tab>', 'za') +nmap {'<esc>', '<cmd>nohl<cr>', silent = true} +nnoremap {'gA', 'ga'} +-- saving +nnoremap {'<leader>w', '<cmd>write<cr>'} +nnoremap {'<leader>W', '<cmd>wall<cr>'} +nnoremap {'<leader>e', '<cmd>edit<cr>'} +nnoremap {'<leader>E', '<cmd>enew<cr>'} +nnoremap {'<leader>q', '<cmd>quit<cr>'} +nnoremap {'<leader>Q', '<cmd>qall<cr>'} +nnoremap {'<leader>m', '<cmd>messages<cr>'} +-- window movement +nnoremap {'<a-h>', '<c-w>h'} +nnoremap {'<a-j>', '<c-w>j'} +nnoremap {'<a-k>', '<c-w>k'} +nnoremap {'<a-l>', '<c-w>l'} +-- window movement in terminal +tnoremap {'<a-l>', '<c-\\><c-n><c-w>l'} +tnoremap {'<a-j>', '<c-\\><c-n><c-w>j'} +tnoremap {'<a-k>', '<c-\\><c-n><c-w>k'} +tnoremap {'<a-h>', '<c-\\><c-n><c-w>h'} +tnoremap {'<a-r>', '<c-\\><c-n>'} +-- window move +nnoremap {'<a-H>', '<c-w>H'} +nnoremap {'<a-J>', '<c-w>J'} +nnoremap {'<a-K>', '<c-w>K'} +nnoremap {'<a-L>', '<c-w>L'} +-- window split +nnoremap {'<c-w><c-s>', require('tms.p.vifm').split, silent = true} +nnoremap {'<c-w><c-v>', require('tms.p.vifm').vsplit, silent = true} +nnoremap {'<c-w><c-w>', require('tms.p.vifm').current, silent = true} +nnoremap {'<c-w>V', '<cmd>vnew<cr>'} +nnoremap {'<c-w>S', '<cmd>new<cr>'} +-- line movement +nnoremap {'<c-j>', ':m .+1<cr>=='} +nnoremap {'<c-k>', ':m .-2<cr>=='} +vnoremap {'<c-j>', ':m \'>+1<cr>gv=gv'} +vnoremap {'<c-k>', ':m \'<-2<cr>gv=gv'} +-- fold +nnoremap {'zH', 'zM'} +nnoremap {'zh', 'zm'} +nnoremap {'zj', 'zo'} +nnoremap {'zJ', 'zO'} +nnoremap {'zk', 'zc'} +nnoremap {'zK', 'zC'} +nnoremap {'zl', 'zr'} +nnoremap {'zL', 'zR'} +-- add space +nmap {'><space>', ']<space>'} +nmap {'<<space>', '[<space>'} +-- copy / paste +vnoremap {'<c-c>', '\"*y'} +inoremap {'<c-v>', '<esc>lmv\"*P`v'} +nnoremap {'gp', '`[v`]'} -- reselect pasted text +-- remap double usage +nnoremap {'y.', 'yy'} +nnoremap {'z.', 'mmz.`m'} +nnoremap {'d.', 'dd'} +nnoremap {'c.', 'cc'} +nnoremap {'g.', 'gg'} +nnoremap {'v.', 'V'} +nnoremap {'=.', '=='} +nnoremap {'gc.', 'gcc'} + +-- autocommands +local au = require('tms.c.autocmd') +au.addListeners({ + ['user-binary'] = { + [[BufReadPre *.bin let &bin=1]], + [[BufReadPost *.bin if &bin | %!xxd]], + [[BufReadPost *.bin set ft=xxd | endif]], + [[BufWritePre *.bin if &bin | %!xxd -r]], + [[BufWritePre *.bin endif]], + [[BufWritePost *.bin if &bin | %!xxd]], + [[BufWritePost *.bin set nomod | endif]], + }, + ['user-vifm'] = {[[BufEnter vifm:* startinsert]]}, + ['user-cursorline'] = {[[WinEnter * setlocal cursorline]], [[WinLeave * setlocal nocursorline]]}, + ['user-yank-high'] = {[[TextYankPost * silent! lua require'vim.highlight'.on_yank()]]}, + ['user-colorscheme'] = { + [[ColorScheme gruvbox lua require('tms.u.reload').colors()]], + [[ColorSchemePre gruvbox lua require('tms.u.reload').colorsPre()]], + }, + -- ['quickfix'] = {[[QuickFixCmdPost [^l]* nested cwindow]], [[QuickFixCmdPost l* nested lwindow]]}, +}) + +vim.cmd [[ packadd cfilter ]] +require('tms.lsp').setup() +require('tms.ws').setup() diff --git a/lua/tms/c/autocmd.lua b/lua/tms/c/autocmd.lua @@ -0,0 +1,39 @@ +local api = vim.api + +local M = {} + +local globalListenerName = 'TMS_AUCMD' -- change this to be unique across multiple plugin name +local autocmdhandlers = {} +_G[globalListenerName] = function(name) autocmdhandlers[name]() end + +function M.addListener(name, events, fn) + autocmdhandlers[name] = fn + vim.cmd('augroup ' .. name) + vim.cmd('autocmd!') + for _, event in ipairs(events) do + local cmd = 'lua ' .. globalListenerName .. '("' .. name .. '")' + vim.cmd('au ' .. event .. ' ' .. cmd) + end + vim.cmd('augroup end') +end + +M.addListeners = function(listeners) + for group_name, definitions in pairs(listeners) do + api.nvim_command('augroup ' .. group_name) + api.nvim_command('autocmd!') + for _, definition in ipairs(definitions) do + local command = table.concat({'autocmd', definition}, ' ') + api.nvim_command(command) + end + api.nvim_command('augroup END') + end +end + +function M.removeListener(name) + vim.cmd('augroup ' .. name) + vim.cmd('autocmd!') + vim.cmd('augroup end') + autocmdhandlers[name] = nil +end + +return M diff --git a/lua/tms/c/keybind.lua b/lua/tms/c/keybind.lua @@ -0,0 +1,129 @@ +local api = vim.api +local kb = api.nvim_set_keymap +local kbb = api.nvim_buf_set_keymap + +local globalListenerName = 'TMS_KEYBIND' -- change this to be unique across multiple plugin name +local kbhandlers = {} +local id = 0 +_G[globalListenerName] = function(id) kbhandlers[id]() end + +local function createCmd(fn) + id = id + 1 + kbhandlers[id] = fn + return '<cmd>lua ' .. globalListenerName .. '(' .. id .. ')<cr>' +end + +local function expand_rhs(rhs) + if type(rhs) == 'function' then + return createCmd(rhs) + end + return rhs +end + +local function add(mode, lhs, rhs, opt) + if type(lhs) == 'table' then + for _, v in ipairs(lhs) do + kb(mode, v, expand_rhs(rhs), opt) + end + else + kb(mode, lhs, expand_rhs(rhs), opt) + end +end + +local function badd(bufnr, mode, lhs, rhs, opt) + if type(lhs) == 'table' then + for _, v in ipairs(lhs) do + kbb(bufnr, mode, v, expand_rhs(rhs), opt) + end + else + kbb(bufnr, mode, lhs, expand_rhs(rhs), opt) + end +end + +local function nmap(lhs, rhs, options) add('n', lhs, rhs, options or {}) end +local function imap(lhs, rhs, options) add('i', lhs, rhs, options or {}) end +local function tmap(lhs, rhs, options) add('t', lhs, rhs, options or {}) end +local function vmap(lhs, rhs, options) add('v', lhs, rhs, options or {}) end +local function xmap(lhs, rhs, options) add('x', lhs, rhs, options or {}) end +local function omap(lhs, rhs, options) add('o', lhs, rhs, options or {}) end +local function smap(lhs, rhs, options) add('s', lhs, rhs, options or {}) end + +local function nnoremap(lhs, rhs, options) + options = options or {} + options['noremap'] = true + add('n', lhs, rhs, options) +end + +local function tnoremap(lhs, rhs, options) + options = options or {} + options['noremap'] = true + add('t', lhs, rhs, options) +end + +local function inoremap(lhs, rhs, options) + options = options or {} + options['noremap'] = true + add('i', lhs, rhs, options) +end + +local function vnoremap(lhs, rhs, options) + options = options or {} + options['noremap'] = true + add('v', lhs, rhs, options) +end + +local function snoremap(lhs, rhs, options) + options = options or {} + options['noremap'] = true + add('s', lhs, rhs, options) +end + +local function bnnoremap(bufn, lhs, rhs, options) + options = options or {} + options['noremap'] = true + badd(bufn or 0, 'n', lhs, rhs, options) +end + +local function btnoremap(bufn, lhs, rhs, options) + options = options or {} + options['noremap'] = true + badd(bufn or 0, 't', lhs, rhs, options) +end + +local function binoremap(bufn, lhs, rhs, options) + options = options or {} + options['noremap'] = true + badd(bufn or 0, 'i', lhs, rhs, options) +end + +local function bvnoremap(bufn, lhs, rhs, options) + options = options or {} + options['noremap'] = true + badd(bufn or 0, 'v', lhs, rhs, options) +end + +local function bsnoremap(bufn, lhs, rhs, options) + options = options or {} + options['noremap'] = true + badd(bufn or 0, 's', lhs, rhs, options) +end + +return { + nmap = nmap, + imap = imap, + tmap = tmap, + vmap = vmap, + omap = omap, + xmap = xmap, + smap = smap, + nnoremap = nnoremap, + tnoremap = tnoremap, + inoremap = inoremap, + vnoremap = vnoremap, + snoremap = snoremap, + bnnoremap = bnnoremap, + btnoremap = btnoremap, + binoremap = binoremap, + bvnoremap = bvnoremap, + bsnoremap = bsnoremap, +} diff --git a/lua/tms/colors.lua b/lua/tms/colors.lua @@ -0,0 +1,128 @@ +-- map <buffer> ,c <cmd>execute 'lua ' . getline('.')<cr> +local M = {} + +M.setup = function() + local Color, c, Group, g, s = require('colorbuddy').setup() + + if vim.opt.background:get() == 'dark' then + -- gruvbox + Color.new('gwhite', '#f2e5bc') + Color.new('gred', '#fb4934') + Color.new('gpurple', '#d3869b') + Color.new('ggreen', '#b8bb26') + Color.new('gyellow', '#fabd2f') + Color.new('gblue', '#83a598') + Color.new('gaqua', '#8ec07c') + Color.new('gorange', '#fe8019') + Color.new('ggray', '#928374') + Color.new('gbgh', '#1d2021') + Color.new('gbg0', '#282828') + Color.new('gbg1', '#3c3836') + Color.new('gbg2', '#504945') + Color.new('gbg3', '#665c54') + Color.new('gbg4', '#7c6f64') + -- general + Group.new('Normal', c.gwhite, c.gbgh) + Group.new('SignColumn', nil, c.gbgh:dark(0.01)) + Group.new('NormalFloat', nil, c.gbgh) + Group.new('Search', c.gwhite:light(), c.gbg0) + Group.new('CursorLine', nil, g.Normal.bg:light(0.02)) + Group.new('Visual', nil, c.gbg1) + Group.new('FloatBorder', nil, c.gbgh) + Group.new('Folded', c.gbgh:light(0.20), g.Normal.bg:light(0.02)) + Group.new('FoldColumn', g.SignColumn, g.SignColumn) + + -- syntax + Group.new('Operator', nil, nil) + + -- GitSigns + Group.new('GitSignsAdd', c.ggreen, g.SignColumn.bg) + Group.new('GitSignsChange', c.gorange, g.SignColumn.bg) + Group.new('GitSignsDelete', c.gred, g.SignColumn.bg) + + -- Lsp + Group.new('LspDiagnosticsSignError', c.red:saturate(-0.5), g.SignColumn) + Group.new('LspDiagnosticsSignWarning', c.orange:saturate(-0.5), g.SignColumn) + Group.new('LspDiagnosticsSignInformation', c.gbg1, g.SignColumn) + Group.new('LspDiagnosticsSignHint', c.gbg1, g.SignColumn) + + -- TreeSitter + Group.new('TSDefinitionUsage', nil, c.gbg0) + Group.new('TSDefinition', nil, c.gbg0) + + -- Telescope + Group.new('TelescopeMatching', c.gwhite:light(), nil) + Group.new('TelescopeSelection', nil, g.CursorLine) + + -- Indent blankline + Group.new('IndentBlanklineChar', c.gbgh:light(0.05), nil) + Group.new('IndentBlanklineSpaceChar', c.gbgh:light(0.05), nil) + Group.new('IndentBlanklineSpaceCharBlankline', c.gbgh:light(0.05), nil) + + -- HiPairs + Group.new('hiPairs_matchPair', c.gyellow, c.gbgh) + Group.new('hiPairs_unmatchPair', nil, c.gred) + else + -- gruvbox + Color.new('gwhite', '#282828') + Color.new('gred', '#cc241d') + Color.new('gpurple', '#8f3f71') + Color.new('ggreen', '#98971e') + Color.new('gyellow', '#d79921') + Color.new('gblue', '#458588') + Color.new('gaqua', '#689d6a') + Color.new('gorange', '#d65d0e') + Color.new('ggray', '#928374') + Color.new('gbgh', '#f9f5d7') + Color.new('gbg0', '#fbf1c7') + Color.new('gbg1', '#ebdbb2') + Color.new('gbg2', '#d5c4a1') + Color.new('gbg3', '#bdae93') + Color.new('gbg4', '#a89984') + + -- general + -- Group.new('Normal', nil, nil) + Group.new('SignColumn', nil, c.gbg1) + Group.new('NormalFloat', nil, c.gbg0) + -- Group.new('FloatBorder', nil, g.NormalFloat.bg) + -- Group.new('Search', c.gwhite:light(), c.gbg0) + Group.new('CursorLine', nil, c.gbg1) + Group.new('Cursor', nil, c.gbg4) + Group.new('Visual', nil, c.gbg1:dark(0.05)) + -- Group.new('Folded', c.gbgh:light(0.20), g.Normal.bg:light(0.02)) + -- Group.new('FoldColumn', g.SignColumn, g.SignColumn) + + -- syntax + Group.new('Operator', nil, nil) + + -- GitSigns + Group.new('GitSignsAdd', nil, c.ggreen) + Group.new('GitSignsChange', nil, c.gorange) + Group.new('GitSignsDelete', nil, c.gred) + + -- Lsp + Group.new('LspDiagnosticsSignError', c.red:saturate(-0.5), g.SignColumn) + Group.new('LspDiagnosticsSignWarning', c.orange:saturate(-0.5), g.SignColumn) + Group.new('LspDiagnosticsSignInformation', c.gbg1, g.SignColumn) + Group.new('LspDiagnosticsSignHint', c.gbg1, g.SignColumn) + + -- TreeSitter + Group.new('TSDefinitionUsage', nil, c.gbg0) + Group.new('TSDefinition', nil, c.gbg0) + + -- Telescope + Group.new('TelescopeMatching', c.gwhite:light(), nil) + -- Group.new('TelescopeSelection', nil, g.CursorLine) + + -- Indent blankline + Group.new('IndentBlanklineChar', c.gbgh:light(0.05), nil) + Group.new('IndentBlanklineSpaceChar', c.gbgh:light(0.05), nil) + Group.new('IndentBlanklineSpaceCharBlankline', c.gbgh:light(0.05), nil) + + -- HiPairs + Group.new('hiPairs_matchPair', nil, c.gbg2) + Group.new('hiPairs_unmatchPair', c.gbg1, c.gred) + end + +end +return M diff --git a/lua/tms/ft/dart.lua b/lua/tms/ft/dart.lua @@ -0,0 +1,161 @@ +local loop = vim.loop +local fn = vim.fn + +local M = {} + +function M.lspcmd() + local dart_sdk = fn.resolve(fn.exepath("dart")) + local dart_sdk_root_path = fn.fnamemodify(dart_sdk, ":h") + local snapshot = dart_sdk_root_path .. "/snapshots/analysis_server.dart.snapshot" + return {'dart', snapshot, '--lsp'} +end + +local tsuexists, tsu = pcall(require, 'nvim-treesitter.ts_utils') +if not tsuexists then + return M +end + +local function findTestNode(n) + local node = n or tsu.get_node_at_cursor() + while node do + if (node:type():find('selector')) then + local prev = tsu.get_previous_node(node) + if prev and prev:type():find('identifier') then + if tsu.get_node_text(prev)[1] == 'test' then + return prev + end + end + end + node = node:parent() + end +end + +local lastName +function M.getTestName(n) + local node = n or tsu.get_node_at_cursor() + local testNode = findTestNode(node) + if testNode then + local selector = tsu.get_next_node(testNode) + if selector:type():find('selector') then + local child = selector:named_child() + while child do + if child:type():find('string_literal') then + local test = tsu.get_node_text(child)[1] + lastName = test + return test + end + child = child:named_child() + end + end + end + + if lastName then + return lastName + end + + return '' +end + +function M.setup() + -- vimp.nnoremap({'override'}, '<leader>cP', function() + -- local node = tsu.get_node_at_cursor() + -- if not node:type():find('identifier') then + -- node = nil + -- else + -- node = tsu.get_node_text(node)[1] + -- end + + -- local methodName = getMethodName() + -- if methodName then + -- local line = vim.api.nvim_get_current_line() + -- local var = '' + + -- if node then + -- var = '${' .. node .. '}' + -- vim.cmd('norm o') + -- else + -- if line ~= '' then + -- vim.cmd('norm O') + -- end + -- end + + -- vim.api.nvim_set_current_line('print("' .. methodName .. ': ' .. var .. '");') + + -- vim.cmd('norm ==') + -- vim.cmd('norm 2f"') + -- vim.cmd('startinsert') + -- end + -- end) + + -- vimp.nnoremap({'override'}, '<leader>cd', function() + -- local methodName = getMethodName() + -- if methodName then + -- local line = vim.api.nvim_get_current_line() + + -- if line ~= '' then + -- vim.cmd('norm O') + -- end + + -- vim.api.nvim_set_current_line('print("' .. methodName .. '");') + + -- vim.cmd('norm ==') + -- vim.cmd('norm 2f"') + -- vim.cmd('startinsert') + -- end + -- end) + + -- vimp.nnoremap({'override'}, '<leader>cD', function() require'tms.ft.dart.debug_func'.debug_func() end) + + vim.cmd [[command! -count=1 -nargs=* DartTest lua require('tms.ft.dart').darttest(<count>, vim.fn.expand('%'), <q-args>)]] +end + +-- TESTING DART +local lastTestFile +function M.darttest(termid, file, testargs) + if not string.match(file, '_test.dart$') then + if lastTestFile then + print('not a testing file... running last used') + file = lastTestFile + else + print('not a testing file') + return + end + end + require('tms.p.terminal').run(string.format('pub run build_runner test -- %s %s', file, testargs), termid) + lastTestFile = file +end + +function M.analyze2qfl(make_entry) + local list = {} + + local onread = function(err, data) + assert(not err, err) + if data then + local line = string.gsub(data, "\n", "") + local parsed = make_entry(line) + if parsed then + table.insert(list, parsed) + end + end + end + + local stdout = loop.new_pipe(false) + local handle + handle = loop.spawn('dart', {args = {"analyze"}, stdio = {nil, stdout, nil}}, vim.schedule_wrap( + function() + stdout:read_stop() + stdout:close() + handle:close() + + vim.fn.setqflist(list) + if #list > 0 then + vim.cmd [[copen]] + else + print("Analyzer finished...") + end + end)) + + loop.read_start(stdout, onread) +end + +return M diff --git a/lua/tms/ft/dart/debug_func.lua b/lua/tms/ft/dart/debug_func.lua @@ -0,0 +1,47 @@ +local parsers = require 'nvim-treesitter.parsers' +local tsu = require 'nvim-treesitter.ts_utils' +local api = vim.api + +local M = {} +local function getMethodName(n) + local node = n or tsu.get_node_at_cursor() + while node do + if (node:type():find('function_body')) then + local previous = tsu.get_previous_node(node) + if previous:type() == 'method_signature' then + previous = previous:child() + for i, v in previous:iter_children() do + if v == 'name' then + return tsu.get_node_text(i)[1] or nil + end + end + end + end + node = node:parent() + end +end + +local function iter_tree(node, work, level) + level = level or 1 + for n in node:iter_children() do + work(n, level) + if n:child_count() > 0 then + iter_tree(n, work, level + 1) + end + end +end + +function M.debug_func() + local root = parsers.get_tree_root() + iter_tree(root, function(node, level) + local node_type = node:type() + if node_type == 'function_body' then + api.nvim_buf_set_lines(0, node:start() + 1, node:start() + 1, true, + { + string.format('%sprint("%s");', string.rep(' ', level - 1), getMethodName(node)), + }) + end + end) +end + +return M diff --git a/lua/tms/ft/go/doc.lua b/lua/tms/ft/go/doc.lua @@ -0,0 +1,50 @@ +local lsp = require 'vim.lsp' +local M = {} + +local open = function(path) + local docid = vim.fn.jobstart('godoc -http :8765', {on_exit = function() M.docid = nil end}) + local cmd = string.format('noswallow_open "%s --new-window http://localhost:8765/pkg/%s"', + 'brave', path) + vim.fn.jobstart(cmd, {on_exit = function() vim.fn.jobstop(docid) end}) + if docid > 0 then + return docid + end + return nil +end + +M.docid = nil + +M.lsp_path = function() end + +M.godoc = function(path) + if M.jobid then + return + end + if path and path ~= '' then + M.docid = open(path) + else + -- lsp + vim.lsp.buf_request(0, 'textDocument/hover', lsp.util.make_position_params(), + function(err, method, result, client_id, bufnr, config) + if result then + local value = result.contents.value + for line in value:gmatch('([^\n]+)') do + local _, url = line:match('%[(.*)%]%((.*)%)') + if url then + path = url:gsub('https://pkg.go.dev/', ''):gsub('?utm_source=gopls', '') + M.docid = open(path) + break + end + end + end + end) + end +end + +M.godoc_stop = function() + if M.docid then + vim.fn.jobstop(M.docid) + end +end + +return M diff --git a/lua/tms/lsp/efm.lua b/lua/tms/lsp/efm.lua @@ -0,0 +1,71 @@ +local M = {} + +M.settings = { + languages = { + lua = {{formatCommand = 'lua-format -i', formatStdin = true}}, + clang = {{formatCommand = 'clang-format --style=file', formatStdin = true}}, + css = { + { + formatCommand = 'prettier --config ~/.config/prettier/config.yaml --parser css', + formatStdin = true, + }, + }, + scss = { + { + formatCommand = 'prettier --config ~/.config/prettier/config.yaml --parser scss', + formatStdin = true, + }, + }, + html = { + {formatCommand = 'html-beautify -f - -A aligned-multiple -s 2 -w 120', formatStdin = true}, + }, + json = { + { + formatCommand = 'prettier --config ~/.config/prettier/config.yaml --parser json', + formatStdin = true, + }, + }, + yaml = { + { + formatCommand = 'prettier --config ~/.config/prettier/config.yaml --parser yaml', + formatStdin = true, + }, + }, + -- javascript = { + -- { + -- formatCommand = 'prettier --config ~/.config/prettier/config.yaml --parser typescript', + -- formatStdin = true, + -- }, + -- }, + }, +} + +-- List all filetypes efm handles +M.filetypes = function() + local fts = {} + for ft, _ in pairs(M.settings.languages) do + table.insert(fts, ft) + end + return fts +end + +-- Check if filetype is handled by efm +M.handle_filetype = function(filetype) + if type(filetype) == 'string' then + for _, ft in ipairs(M.filetypes()) do + if ft == filetype then + return true + end + end + elseif type(filetype) == 'table' then + for _, ft in ipairs(M.filetypes()) do + for _, fft in ipairs(filetype) do + if ft == fft then + return true + end + end + end + end +end + +return M diff --git a/lua/tms/lsp/init.lua b/lua/tms/lsp/init.lua @@ -0,0 +1,150 @@ +local kb = require('tms.c.keybind') +local efm = require('tms.lsp.efm') + +local M = {} + +local function keybind(bufnr) + local o = {silent = true} + local oe = {silent = true, expr = true} + kb.bnnoremap(bufnr, 'gd', '<cmd>lua require"telescope.builtin".lsp_definitions()<cr>', o) + kb.bnnoremap(bufnr, 'gD', '<cmd>vsplit | lua vim.lsp.buf.definition()<cr>', o) + kb.bnnoremap(bufnr, 'gi', '<cmd>lua require"telescope.builtin".lsp_implementations()<cr>', o) + kb.bnnoremap(bufnr, 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', o) + kb.bnnoremap(bufnr, '<c-p>', '<cmd>lua vim.lsp.buf.signature_help()<cr>', o) + kb.binoremap(bufnr, '<c-p>', '<cmd>lua vim.lsp.buf.signature_help()<cr>', o) + kb.bnnoremap(bufnr, 'gr', '<cmd>lua require"telescope.builtin".lsp_references()<cr>', o) + kb.bnnoremap(bufnr, 'ga', '<cmd>lua require"tms.p.telescope".lsp_code_actions()<cr>', o) + kb.bnnoremap(bufnr, 'gn', '<cmd>lua vim.lsp.buf.rename()<cr>', o) + kb.bnnoremap(bufnr, 'gm', '<cmd>lua require("tms.p.telescope").lsp_document_symbols()<cr>', o) + kb.binoremap(bufnr, '<down>', 'pumvisible() ? "<c-n>" : "<up>"', oe) + kb.binoremap(bufnr, '<up>', 'pumvisible() ? "<c-p>" : "<down>"', oe) + -- formatting + kb.bnnoremap(bufnr, 'Q', '<cmd>lua vim.lsp.buf.formatting()<cr>', o) + kb.bvnoremap(bufnr, 'Q', '<cmd>lua vim.lsp.buf.formatting()<cr>', o) + -- workspace + kb.bnnoremap(bufnr, 'gww', '<cmd>lua require"telescope.builtin".lsp_workspace_symbols()<cr>', o) + kb.bnnoremap(bufnr, 'gwa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<cr>', o) + kb.bnnoremap(bufnr, 'gwr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<cr>', o) + kb.bnnoremap(bufnr, 'gwl', '<cmd>lua dump(vim.lsp.buf.list_workspace_folders())<cr>', o) + -- diagnostic + kb.bnnoremap(bufnr, 'gs', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<cr>', o) + kb.bnnoremap(bufnr, 'gll', '<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>', o) + kb.bnnoremap(bufnr, 'gld', '<cmd>lua require"telescope.builtin".lsp_document_diagnostics()<cr>', o) + kb.bnnoremap(bufnr, 'glw', '<cmd>lua require"telescope.builtin".lsp_workspace_diagnostics()<cr>', + o) + kb.bnnoremap(bufnr, {'>d', '>('}, '<cmd>lua vim.lsp.diagnostic.goto_next()<cr>', o) + kb.bnnoremap(bufnr, {'<d', '<('}, '<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>', o) +end + +local function custom_attach(client, bufnr) + if client.name ~= 'efm' and efm.handle_filetype(client.config.filetypes) then + client.resolved_capabilities.document_formatting = false + end + -- require'lsp_signature'.on_attach({handler_opts = {border = 'single'}, hint_enable = false}) + + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, {border = 'single'}) + vim.lsp.handlers['textDocument/signatureHelp'] = + vim.lsp.with(vim.lsp.handlers.signature_help, {border = 'single'}) + vim.lsp.handlers['textDocument/publishDiagnostics'] = + vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, + {virtual_text = false, underline = false}) + + keybind(bufnr) +end + +function M.setup() + local lspc = require('lspconfig') + + -- local capabilities = vim.lsp.protocol.make_client_capabilities() + -- capabilities.textDocument.completion.completionItem.snippetSupport = true + -- capabilities.textDocument.completion.completionItem.resolveSupport = { + -- properties = {'documentation', 'detail', 'additionalTextEdits'}, + -- } + + -- lspc.util.default_config = vim.tbl_extend('force', lspc.util.default_config, + -- {capabilities = capabilities}) + + lspc.efm.setup { + on_attach = custom_attach, + init_options = {documentFormatting = true}, + settings = efm.settings, + root_dir = lspc.util.root_pattern('.git', vim.fn.getcwd()), + filetypes = efm.filetypes(), + } + + lspc.dartls.setup { + on_attach = custom_attach, + cmd = require'tms.ft.dart'.lspcmd(), + init_options = {closingLabels = true, outline = true}, + settings = {dart = {lineLength = 120, showTodos = true, completeFunctionCalls = true}}, + handlers = { + ['dart/textDocument/publishClosingLabels'] = require('lsp_extensions.dart.closing_labels').get_callback {}, + ['dart/textDocument/publishOutline'] = require('lsp_extensions.dart.outline').get_callback(), + }, + root_dir = lspc.util.root_pattern('pubspec.yaml', '.git', vim.fn.getcwd()), + } + + local luadev = require('lua-dev').setup({ + lspconfig = { + cmd = { + '/home/tms/.cache/nvim/lspconfig/sumneko_lua/lua-language-server/bin/Linux/lua-language-server', + '-E', + '/home/tms/.cache/nvim/lspconfig/sumneko_lua/lua-language-server/main.lua', + }, + + settings = { + Lua = { + runtime = {version = 'LuaJIT', path = vim.split(package.path, ';')}, + diagnostics = {globals = {'vim', 'vimp', 'Color', 'c', 'Group', 'g', 's', 'use', 'mutt'}}, + }, + }, + }, + }) + lspc.sumneko_lua.setup(luadev) + -- { + -- on_attach = custom_attach, + -- cmd = { + -- "/home/tms/.cache/nvim/lspconfig/sumneko_lua/lua-language-server/bin/Linux/lua-language-server", + -- "-E", + -- "/home/tms/.cache/nvim/lspconfig/sumneko_lua/lua-language-server/main.lua", + -- }, + -- settings = { + + -- Lua = { + -- runtime = {version = "LuaJIT", path = vim.split(package.path, ";")}, + -- diagnostics = {globals = {"vim", "vimp", "Color", "c", "Group", "g", "s", "use", "mutt"}}, + -- workspace = { + -- -- Make the server aware of Neovim runtime files + -- library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true}, + -- }, + -- }, + -- }, + -- } + -- php + lspc.intelephense.setup { + on_attach = custom_attach, + init_options = { + clearCache = true, + licenceKey = os.getenv('XDG_CONFIG_HOME') .. '/intelephense/licenceKey.txt', + globalStoragePath = os.getenv('XDG_CONFIG_HOME') .. '/intelephense', + }, + } + + -- other + lspc.gdscript.setup {on_attach = custom_attach} + lspc.cssls.setup {on_attach = custom_attach} + lspc.clangd.setup {on_attach = custom_attach} + lspc.vimls.setup {on_attach = custom_attach} + lspc.bashls.setup {on_attach = custom_attach} + lspc.jsonls.setup {on_attach = custom_attach} + lspc.gopls.setup { + on_attach = custom_attach, + root_dir = lspc.util.root_pattern('go.mod', '.git', vim.fn.getcwd()), + } + lspc.jdtls.setup {on_attach = custom_attach} + -- lspc.pyls.setup {on_attach = custom_attach} + lspc.tsserver.setup {on_attach = custom_attach} + lspc.html.setup {on_attach = custom_attach, filetypes = {'html', 'latte'}} +end + +return M diff --git a/lua/tms/p/actions/init.lua b/lua/tms/p/actions/init.lua @@ -0,0 +1,86 @@ +local utils = require 'actions.utils' +local my_utils = require('tms.p.actions.predicates') +local M = {} + +local actions = {} +local mappings = {['n <leader>dr'] = 'run', ['n <leader>dt'] = 'test', ['n <leader>db'] = 'build'} + +-- general actions +local function make(_) vim.cmd [[make]] end + +-- helpers +M.add = function(action) table.insert(actions, action) end + +-- make_language_predicated +M.add_lang = + function(lang, a) M.add {predicate = utils.make_language_predicate(lang), actions = a} end + +-- make_git_predicate +M.add_git = function(project, escape, a) + if type(escape) == 'table' then + a = escape + escape = false + end + M.add {predicate = my_utils.make_git_predicate(project, escape), actions = a} +end + +M.setup = function() + M.add_lang('dart', { + run = make, + build = function(_) -- analyze + 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, + } + end + end + -- 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} + -- en + -- end + require('tms.ft.dart').analyze2qfl(dart2103) + end, + }) + M.add_lang('lua', {run = make}) + M.add_lang('go', { + run = function(_) + vim.cmd [[set makeprg=go\ run\ %]] + vim.cmd [[make]] + vim.cmd [[comp go]] + end, + test = function(_) + vim.cmd [[set makeprg=go\ test]] + vim.cmd [[make]] + vim.cmd [[comp go]] + end, + build = make, + }) + M.add_lang('zsh', { + run = function(_) + vim.cmd [[set makeprg=./%]] + vim.cmd [[set efm=%f:%.%#:%l:\ %m,%f:%l:\ %m,%-G%.%#]] + vim.cmd [[make]] + vim.cmd [[comp zsh]] + end, + build = make, + }) + M.add_lang('gdscript', { + run = function(_) vim.cmd [[GodotRun]] end, + build = function(_) vim.api.nvim_input(':GodotRun ') end, + }) + M.add_lang('sh', {run = make}) + + actions.mappings = mappings + require('actions'):setup(actions) +end + +return M diff --git a/lua/tms/p/actions/predicates.lua b/lua/tms/p/actions/predicates.lua @@ -0,0 +1,29 @@ +local git = require('tms.u.git') +local M = {} + +M.make_git_predicate = function(git_path, escape) + local escape_pattern = function(text) return text:gsub('([^%w])', '%%%1') end + if escape then + git_path = escape_pattern(git_path) + end + return function(_) + if git.is_git(vim.fn.getcwd()) then + local found + local id = vim.fn.jobstart('git remote show origin | awk \'/Fetch URL/\'', { + on_stdout = function(_, d, _) + for _, line in ipairs(d) do + if line:find(git_path) then + found = true + end + end + end, + }) + vim.fn.jobwait({id}) + return found + else + return false + end + end +end + +return M diff --git a/lua/tms/p/async_make.lua b/lua/tms/p/async_make.lua @@ -0,0 +1,62 @@ +local M = {} + +M.job_id = nil + +function M.make(args) + if M.job_id then + return + end + local lines = {} + -- local winnr = vim.fn.win_getid() + -- local bufnr = vim.api.nvim_win_get_buf(winnr) + + local makeprg = vim.api.nvim_get_option('makeprg') + if not makeprg then + return + end + + local cmd = vim.fn.expandcmd(makeprg) + + local function on_event(job_id, data, event) + if event == 'stdout' or event == 'stderr' then + if data then + vim.list_extend(lines, data) + end + end + + if event == 'exit' then + vim.fn.setqflist({}, ' ', + {title = cmd, lines = lines, efm = vim.api.nvim_get_option('errorformat')}) + vim.api.nvim_command('doautocmd QuickFixCmdPost') + M.job_id = nil + end + end + + local id = vim.fn.jobstart(cmd, { + on_stderr = on_event, + on_stdout = on_event, + on_exit = on_event, + stdout_buffered = true, + stderr_buffered = true, + }) + + if id > 0 then + M.job_id = id + end +end + +function M.stop() + if M.job_id then + vim.fn.jobstop(M.job_id) + print('Async make stopped.') + end +end + +function M.running() + if M.job_id then + return true + end + return false +end + +return M diff --git a/lua/tms/p/bqf.lua b/lua/tms/p/bqf.lua @@ -0,0 +1,11 @@ +local M = {} + +M.setup = function() + require('bqf').setup { + auto_enable = true, + auto_resize_height = false, + preview = {auto_preview = false}, + } +end + +return M diff --git a/lua/tms/p/compe.lua b/lua/tms/p/compe.lua @@ -0,0 +1,58 @@ +local M = {} + +M.config = {autocomplete = false, preselect = 'always'} +M.source = { + path = true, + buffer = true, + calc = true, + nvim_lsp = true, + nvim_lua = true, + snippets_nvim = true, + emoji = true, +} + +local t = function(str) return vim.api.nvim_replace_termcodes(str, true, true, true) end + +local check_back_space = function() + local col = vim.fn.col('.') - 1 + if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then + return true + else + return false + end +end + +M.setup = function(sources) + local config = M.config + local source = M.source + if sources then + for k, v in pairs(sources) do + source[k] = v + end + end + config.source = source + require('compe').setup(config) + + -- Use (s-)tab to: + --- move to prev/next item in completion menuone + --- jump to prev/next snippet's placeholder + _G.tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t '<C-n>' + elseif check_back_space() then + return t '<Tab>' + else + return vim.fn['compe#complete']() + end + end + + _G.s_tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t '<C-p>' + else + return t '<S-Tab>' + end + end +end + +return M diff --git a/lua/tms/p/dap.lua b/lua/tms/p/dap.lua @@ -0,0 +1,77 @@ +local dap = require('dap') +local dapui = require('dapui') +local M = {} + +local function cpp() + dap.adapters.cpp = { + type = 'executable', + attach = {pidProperty = 'pid', pidSelect = 'ask'}, + command = 'lldb', -- my binary was called 'lldb-vscode-11' + env = {LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY = 'YES'}, + name = 'lldb', + } + + dap.configurations.cpp = { + {type = 'cpp', request = 'launch', name = 'Launch File', program = '${file}'}, + } +end + +local function dart() + dap.defaults.fallback.external_terminal = {command = '/usr/bin/alacritty', args = {'-e'}} + + dap.adapters.dart = { + type = 'executable', + command = 'node', + args = {os.getenv('HOME') .. '/downloads/Dart-Code/out/dist/debug.js', 'dart'}, + } + + dap.configurations.dart = { + { + type = 'dart', + request = 'launch', + name = 'Launch File', + dartSdkPath = os.getenv('HOME') .. '/.local/lib/dart/stable/', + -- flutterSdkPath = os.getenv('HOME') .. "/flutter", + program = '${file}', + cwd = '${workspaceFolder}', + }, + } +end + +local function lua() + dap.configurations.lua = { + { + type = 'nlua', + request = 'attach', + name = 'Attach to running Neovim instance', + host = function() + local value = vim.fn.input('Host [127.0.0.1]: ') + if value ~= '' then + return value + end + return '127.0.0.1' + end, + port = function() + local val = tonumber(vim.fn.input('Port: ')) + assert(val, 'Please provide a port number') + return val + end, + }, + } + + dap.adapters.nlua = function(callback, config) + callback({type = 'server', host = config.host, port = config.port}) + end +end + +function M.setup() + -- cpp() + -- dart() + lua() + + vim.g.dap_virtual_text = true +end + +function M.setup_ui() dapui.setup() end + +return M diff --git a/lua/tms/p/firenvim.lua b/lua/tms/p/firenvim.lua @@ -0,0 +1,15 @@ +local kb = require 'tms.c.keybind' +local M = {} + +function M.setup() + vim.o.laststatus = 0 + + vim.g.firenvim_config = { + globalSettings = {['alt'] = 'all'}, + localSettings = {['.*'] = {cmdline = 'neovim', takeover = 'never'}}, + } + + kb.nnoremap('<c-z>', '<cmd>call firenvim#hide_frame()<cr>') +end + +return M diff --git a/lua/tms/p/gitlens.lua b/lua/tms/p/gitlens.lua @@ -0,0 +1,36 @@ +--- GitLens layer +-- @module layer.gitlens +local api = vim.api + +local layer = {} + +function layer.blame_virt_text() + local ft = vim.fn.expand('%:h:t') + if ft == '' then return end + if ft == 'bin' then return end + api.nvim_buf_clear_namespace(0, 2, 0, -1) + local currFile = vim.fn.expand('%') + local line = api.nvim_win_get_cursor(0) + local blame = vim.fn.system(string.format('git blame -c -L %d,%d %s', line[1], line[1], currFile)) + local hash = vim.split(blame, '%s')[1] + local cmd = string.format("git show %s ", hash) .. "--format='%an | %ar | %s'" + local text + if hash == '00000000' then + text = "Not Committed Yes" + else + text = vim.fn.system(cmd) + text = vim.split(text, '\n')[1] + if text:find("fatal") then text = "Not Committed Yes" end + end + api.nvim_buf_set_virtual_text(0, 2, line[1] - 1, {{text, 'GitLens'}}, {}) +end + +function layer.clear_blame_virt_text() api.nvim_buf_clear_namespace(0, 2, 0, -1) end + +function layer.init_config() +-- autocmd.bind("CursorHold *", function() layer.blame_virt_text() end) +-- autocmd.bind("CursorMoved, CursorMovedI *", function() layer.clear_blame_virt_text() end) + vim.api.nvim_command("hi! link GitLens comment") +end + +return layer diff --git a/lua/tms/p/gitsigns.lua b/lua/tms/p/gitsigns.lua @@ -0,0 +1,46 @@ +local M = {} + +M.setup = function() + require('gitsigns').setup { + signs = { + add = { + hl = 'GitSignsAdd', + text = '│', + -- text = ' ', + numhl = 'GitSignsAddNr', + linehl = 'GitSignsAddLn', + }, + change = { + hl = 'GitSignsChange', + text = '│', + -- text = ' ', + numhl = 'GitSignsChangeNr', + linehl = 'GitSignsChangeLn', + }, + delete = { + hl = 'GitSignsDelete', + text = '│', + -- text = ' ', + numhl = 'GitSignsDeleteNr', + linehl = 'GitSignsDeleteLn', + }, + topdelete = { + hl = 'GitSignsDelete', + text = '‾', + -- text = ' ', + numhl = 'GitSignsDeleteNr', + linehl = 'GitSignsDeleteLn', + }, + changedelete = { + hl = 'GitSignsChange', + text = '│', + -- text = ' ', + numhl = 'GitSignsChangeNr', + linehl = 'GitSignsChangeLn', + }, + }, + keymaps = {}, + } +end + +return M diff --git a/lua/tms/p/hexen.lua b/lua/tms/p/hexen.lua @@ -0,0 +1,65 @@ +local utf8 = require('lua-utf8') +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) + return string.gsub(line, "\\u(%x+)", function(hex) return utf8.char(byteFromHex(hex)) end) +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) + 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 + +-- todo wierd ERROR +-- E5108: Error executing lua /home/tms/.config/nvim/lua/tms/p/hexen.lua:47: bad argument #2 to 'insert' (number expected, got string) +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/lua/tms/p/snippets/dart.lua b/lua/tms/p/snippets/dart.lua @@ -0,0 +1,148 @@ +local U = require 'snippets.utils' + +-- function test_func(name) +-- return function() U.match_indentation(string.format('%s(\'$1\', () {\n$0\n});', name)) end +-- end + +local function test_func_snippet(name, nodesc) + local S + if nodesc then + S = [[ +${-1}(() { + $0 +});]] + else + S = [[ +${-1}('$1', () { + $0 +});]] + end + S = U.match_indentation(S) + return U.iterate_variables_by_id(S, -1, function(v) v.default = name end) +end + +return { + ['lib'] = [[library ${1};]], + ['im'] = [[import 'package:${1}/${2}.dart';]], + ['rgx'] = U.match_indentation [[new RegExp(r'${1}')]], + ['var'] = U.match_indentation [[var ${1} = ${2};]], + ['st'] = U.match_indentation [[static ${0}]], + ['fi'] = U.match_indentation [[final ${0}]], + ['re'] = U.match_indentation [[return ${0}]], + ['br'] = U.match_indentation [[break;]], + ['th'] = [[throw ${0}]], + ['cl'] = [[class ${1=camel_case(vim.fn.expand("%:t:r"))} ${0}]], + ['in'] = [[interface ${1=camel_case(vim.fn.expand("%:t:r"))} ${0}]], + ['imp'] = [[implements ${0}]], + ['ext'] = [[extends ${0}]], + + ['if'] = U.match_indentation [[ + if (${1:true}) { + ${0} + }]], + + ['ife'] = U.match_indentation [[ + if (${1:true}) { + ${2} + } else { + ${0} + } + ]], + + ['el'] = U.match_indentation [[ + else + ]], + + ['sw'] = U.match_indentation [[ + switch (${1}) { + ${0} + } + ]], + + ['cs'] = U.match_indentation [[ + case ${1}: + ${0}]], + + ['de'] = U.match_indentation [[ + default: + ${0}]], + + ['wh'] = U.match_indentation [[ + while (${1:/* condition */}) { + ${0} + }]], + + ['dowh'] = U.match_indentation [[ + do { + ${0} + } while (${0:/* condition */});]], + + ['as'] = U.match_indentation [[assert(${0:/* condition */});]], + + ['try'] = [[ + try { + ${0:${VISUAL}} + } catch (${1:Exception e}) { + }]], + + ['tryf'] = [[ + try { + ${0:${VISUAL}} + } catch (${1:Exception e}) { + } finally { + }]], + + ['main'] = [[ + main() { + ${0} + }]], + + ['for'] = U.match_indentation [[ + for (var ${1:i} = 0; $1 < ${2}; $1++) { + $0 + }]], + + ['fore'] = U.match_indentation [[ + for (final $1 in $2) { + $0 + }]], + + -- test + ['ex'] = U.match_indentation [[expect($1, $0);]], + ['exr'] = U.match_indentation [[expect($2, $0, reason: '$1');]], + ['tst'] = test_func_snippet('test'), + ['grp'] = test_func_snippet('group'), + ['stp'] = test_func_snippet('setUp', true), + ['td'] = test_func_snippet('tearDown', true), + + -- Angular + ['ngc'] = U.match_indentation [[ +@Component( + selector: '${1=vim.fn.expand("%:t:r"):gsub("_", "-")}', + templateUrl: '${2=vim.fn.expand("%:t:r")}.html', + styleUrls: ['$2.css'], + directives: [coreDirectives], + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, +) +class ${3=camel_case(vim.fn.expand("%:t:r"))} { + $0 +}]], + + ['ngcp'] = U.match_indentation [[ +@Component( + selector: '${1=vim.fn.expand("%:t:r"):gsub("_", "-")}', + templateUrl: '${2=vim.fn.expand("%:t:r")}.html', + styleUrls: ['$2.css'], + directives: [coreDirectives], + providers: [], + changeDetection: ChangeDetectionStrategy.OnPush, +) +class ${3=camel_case(vim.fn.expand("%:t:r"))} { + final ChangeDetectorRef changeDetector; + + $3(this.changeDetector); + + $0 +}]], +} diff --git a/lua/tms/p/snippets/html.lua b/lua/tms/p/snippets/html.lua @@ -0,0 +1,9 @@ +return { + -- Angular + ['ngif'] = [[*ngIf="${1}"]], + ['ngf'] = [[*ngFor="let ${1} of ${2}"]], + ['ngfi'] = [[*ngFor="let ${1} of ${2}; let i=index"]], + ['ngb'] = [[[${1}]="${2}"]], + ['nge'] = [[(${1})="${2}"]], + ['ngbe'] = [[[(${1})]="${2}"]], +} diff --git a/lua/tms/p/snippets/init.lua b/lua/tms/p/snippets/init.lua @@ -0,0 +1,37 @@ +local snip = require('snippets') +local U = require('snippets.utils') + +require('tms.p.snippets.utils') + +local M = {} + +M.setup = function() + snip.use_suggested_mappings() + snip.set_ux(require 'snippets.inserters.vim_input') + + snip.snippets = { + _global = { + date = os.date('%d.%m.%Y'), + todo = U.force_comment [[TODO(${=io.popen("id -un"):read("*l")}) ${=os.date('%d.%m.%Y')}: ]], + note = U.force_comment [[NOTE(${=io.popen("id -un"):read("*l")}): ]], + bang = [[#!/usr/bin/env ${1}]], + copyright = U.force_comment [[Copyright (C) Tomáš Němec ${=os.date("%Y")}]], + }, + go = {bang = [[//usr/bin/go run \$0 \$@; exit \$?]]}, + dart = require('tms.p.snippets.dart'), + html = require('tms.p.snippets.html'), + lua = { + req = [[local ${2:${1|S.v:match"([^.()]+)[()]*$"}} = require('$1')]], + func = [[function${1|vim.trim(S.v):gsub("^%S"," %0")}(${2|vim.trim(S.v)})$0 end]], + ['loc'] = [[local ${2:${1|S.v:match"([^.()]+)[()]*$"}} = ${1}]], + ['for'] = U.match_indentation [[ +for ${1:i}, ${2:v} in ipairs(${3:t}) do + $0 +end]], + sl = [[{${2|create_list_of_strings(S.v)}}]], + key = [[['${1}'] = $0]], + }, + } +end + +return M diff --git a/lua/tms/p/snippets/utils.lua b/lua/tms/p/snippets/utils.lua @@ -0,0 +1,32 @@ +function create_list_of_strings(input) + local str = '' + local function wrap_quotes(x) return '\'' .. x .. '\'' end + for item, _ in input:gmatch('([%s%w%.%_]+),') do + local str_end = (' '):rep(vim.bo.shiftwidth) .. wrap_quotes(item) + if str == '' then + str = str .. str_end + else + str = str .. ',' .. str_end + end + end + + return str +end + +function camel_case(s) + local upper = true + local output = {} + for c in string.gmatch(s, '.') do + if c == '_' then + upper = true + else + if upper then + table.insert(output, c:upper()) + upper = false + else + table.insert(output, c) + end + end + end + return table.concat(output, '') +end diff --git a/lua/tms/p/status.lua b/lua/tms/p/status.lua @@ -0,0 +1,51 @@ +local M = {} + +M.setup = function() + local lsp = function() return #vim.lsp.buf_get_clients() > 0 and '[L]' or '' end + local ts = function() + local tse, tsp = pcall(require, 'nvim-treesitter.parsers') + return tse and tsp.has_parser() and '[T]' or '' + end + local attached = function() return lsp() .. ts() end + local qf = function() + local list = vim.fn.getqflist() + local valid = {} + for _, item in ipairs(list) do + if item.valid == 1 then + table.insert(valid, item) + end + end + return #valid > 0 and 'qf' or '' + end + -- TODO(tms) 14.06.2021 + local async_make = function() + local running = require('tms.p.async_make').running() + if running then + return '[AM]' + end + return '' + end + + local theme = 'gruvbox' + if vim.opt.background:get() == 'light' then + theme = 'gruvbox_light' + end + + require('lualine').setup { + options = {['theme'] = theme}, + sections = { + lualine_c = {attached, {'filename', file_status = true}}, + lualine_x = { + {'diagnostics', sources = {'nvim_lsp'}}, + -- {async_make, color = {fg = '#fb4872'}}, + {qf, color = {fg = '#fb4934'}}, + 'encoding', + 'fileformat', + 'filetype', + }, + }, + extensions = {'fzf', 'fugitive', 'quickfix'}, + } +end + +return M diff --git a/lua/tms/p/telescope.lua b/lua/tms/p/telescope.lua @@ -0,0 +1,181 @@ +local telescope = require('telescope') +local themes = require('telescope.themes') +local builtin = require('telescope.builtin') +local actions = require('telescope.actions') +local action_set = require('telescope.actions.set') +local action_state = require('telescope.actions.state') +local pickers = require('telescope.pickers') +local make_entry = require('telescope.make_entry') +local finders = require('telescope.finders') +local sorters = require('telescope.sorters') +local conf = require('telescope.config').values +local extensions = telescope.extensions + +local M = {} + +M.b = builtin +M.e = extensions + +local escape_chars = function(string) + return string.gsub(string, '[%(|%)|\\|%[|%]|%-|%{%}|%?|%+|%*]', { + ['\\'] = '\\\\', + ['-'] = '\\-', + ['('] = '\\(', + [')'] = '\\)', + ['['] = '\\[', + [']'] = '\\]', + ['{'] = '\\{', + ['}'] = '\\}', + ['?'] = '\\?', + ['+'] = '\\+', + ['*'] = '\\*', + }) +end + +local layouts = { + dd = themes.get_dropdown(), + dd_noprev = themes.get_dropdown {previewer = false}, + dd_large = themes.get_dropdown({layout_config = {width = 120}}), + dd_large_noprev = themes.get_dropdown {layout_config = {width = 120}, previewer = false}, +} + +function M.setup() + telescope.setup { + defaults = {mappings = {i = {['<esc>'] = actions.close}}}, + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = false, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = 'smart_case', -- or "ignore_case" or "respect_case" + }, + }, + } +end + +M.find_files = function() builtin.find_files(layouts.dd_large_noprev) end + +-- show plugins and on select open new Tab and Cd there +M.plugins = function() + M.e.packer.plugins({ + attach_mappings = function(prompt_bufnr) + actions.select_default:replace(function(_, _) + local selection = actions.get_selected_entry(prompt_bufnr) + local path = require('tms.u.plugins').path(selection.directory, selection.name) + actions.close(prompt_bufnr) + vim.cmd(string.format('tabe %s', selection.readme)) + vim.cmd(string.format('tcd %s', path)) + end) + return true + end, + }) +end + +M.buffers = function() + builtin.buffers(layouts.dd_large) + -- { + -- TODO(tms) 08.06.2021: remove buffer and refresh -- How to do refresh + -- attach_mappings = function(_, map) + -- map('i', '<c-d>', function(prompt_bufnr) + -- local selection = action_state.get_selected_entry() + -- vim.api.nvim_buf_delete(selection.bufnr, {force = true}) + -- action_state.get_current_picker(prompt_bufnr):refresh(gen_new_finder(), {reset_prompt = true}) + -- end) + -- return true + -- end, + -- } +end + +M.edit_neovim = function() + builtin.find_files(themes.get_dropdown { + prompt = 'dotfiles', + cwd = '~/.config/nvim', + previewer = false, + }) +end + +M.spell_suggest = function() builtin.spell_suggest(layouts.dd) end + +M.grep_files = function(cwd, files, select_fn, opts) + local opts = opts or {} + local vimgrep_arguments = opts.vimgrep_arguments or conf.vimgrep_arguments + opts.cwd = cwd or opts.cwd and vim.fn.expand(opts.cwd) or vim.loop.cwd() + + local search_files = {} + if type(files) == 'string' then + table.insert(search_files, vim.fn.expand(files)) + elseif type(files) == 'table' then + for i, path in ipairs(files) do + files[i] = vim.fn.expand(path) + end + search_files = files + end + + local live_grepper = finders.new_job(function(prompt) + if not prompt or prompt == '' then + return nil + end + return vim.tbl_flatten {vimgrep_arguments, escape_chars(prompt), search_files} + end, opts.entry_maker or make_entry.gen_from_vimgrep(opts), opts.max_results, opts.cwd) + + pickers.new(opts, { + prompt_title = 'Grep files', + finder = live_grepper, + previewer = conf.grep_previewer(opts), + sorter = conf.generic_sorter(opts), + attach_mappings = function(_) + action_set.select:replace(select_fn) + return true + end, + }):find() +end + +-- TODO(tms) 29.04.2021 +M.grep_file = function(filepath, opts) + local finder = finders.new_job({conf.vimgrep_arguments}, function(line) return line end, + opts.max_results, '') + + pickers.new(opts, { + prompt_title = 'rg ', + finder = finder, + previewer = conf.grep_previewer({}), + sorter = conf.generic_sorter({}), + }):find() +end + +M.mail_address = function() + local search = vim.fn.input('Address > ') + pickers.new { + results_title = 'Adresses', + finder = finders.new_oneshot_job({'goobook', 'query', search}), + sorter = sorters.get_fuzzy_file(), + attach_mappings = function(_) + action_set.select:replace(function(prompt_bufnr, _) + local entry = action_state.get_selected_entry() + local mail = entry.value:match('(%S+)') + actions.close(prompt_bufnr) + vim.fn.setreg('+', mail) + vim.fn.setreg('*', mail) + end) + return true + end, + }:find() +end + +-- TODO: not working +-- If git project run Git_files otherwise run find_files +M.project_files = function() + local opts = {} + local ok = pcall(builtin.git_files, opts) + if not ok then + builtin.find_files(opts) + end +end +M.lines = function() builtin.current_buffer_fuzzy_find(layouts.dd_large_noprev) end +M.reloader = function() builtin.reloader(layouts.dd_noprev) end +M.snippets = function() extensions.snippets.snippets(layouts.dd_large) end +M.keymaps = function() builtin.keymaps(layouts.dd_large) end +M.lsp_code_actions = function() builtin.lsp_code_actions(layouts.dd) end +M.lsp_document_symbols = function() builtin.lsp_document_symbols(layouts.dd_large) end + +return M diff --git a/lua/tms/p/terminal.lua b/lua/tms/p/terminal.lua @@ -0,0 +1,127 @@ +local winh = nil +local bufh = nil +local chan = nil +local last_command = nil + +-- Returns a bool to show if the terminal window exists +local function win_is_open() + return winh ~= nil and vim.api.nvim_win_is_valid(winh) +end + +-- returns a bool to show if the buf exists +local function buf_is_valid() + return bufh ~= nil and vim.api.nvim_buf_is_valid(bufh) +end + +-- Creates the terminal window and return the user to the window where the call was made +local function create_window() + local curr = vim.api.nvim_get_current_win() + vim.cmd("botright 12split") + winh = vim.api.nvim_get_current_win() + vim.api.nvim_set_current_win(curr) +end + +-- Creates the terminal buffer and starts the terminal +local function create_buffer() + local curr = vim.api.nvim_get_current_win() + bufh = vim.api.nvim_create_buf(false, true) + vim.api.nvim_win_set_buf(winh, bufh) + vim.api.nvim_set_current_win(winh) + vim.cmd("term") + vim.cmd("norm G") + vim.api.nvim_buf_set_name(bufh, "terminal") + chan = vim.b.terminal_job_id + vim.api.nvim_set_current_win(curr) +end + +local M = {} + +-- Toggles the terminal window. +-- +-- If the window doesn't exist it is created. If it already exists, it is closed +-- If the buffer doesn't exist is is created and set as the active buffer in the terminal window +-- If either the window of buffer were created, the window buffer is set to the terminal buffer +M.toggle = function() + local link_buf = false + if win_is_open() then + vim.api.nvim_win_close(winh, true) + winh = nil + else + create_window() + link_buf = true + end + if buf_is_valid() == false then + create_buffer() + link_buf = true + end + + if link_buf then + vim.api.nvim_win_set_buf(winh, bufh) + end +end + +-- Closes the window and deletes the buffer. This entirely resets the term state +M.exit = function() + if win_is_open() then + vim.api.nvim_win_close(winh, true) + winh = nil + end + if buf_is_valid() then + vim.api.nvim_buf_delete(bufh, {force = true}) + bufh = nil + end + chan = nil +end + +-- Takes a command as a string and runs it in the terminal buffer. If the window is closed, it will be toggled +M.run = function(cmd) + print(cmd) + if win_is_open() == false or chan == nil then + M.toggle() + end + + if last_command ~= nil then + -- Send <C-c> to make sure any on-going commands like log tails are stopped before running the new command + vim.api.nvim_chan_send(chan, "\003") + end + last_command = cmd + vim.api.nvim_chan_send(chan, " " .. cmd .. "\n") +end + +-- Runs the last command again +M.rerun = function() + if last_command == nil then + print("Last command empty") + M.run('!!') + return + end + M.run(last_command) + M.catchup() +end + +-- Jumps to the terminal window and enters insert mode. If called from the terminal window, it will jump back to the +-- previous window +M.interactive = function() + if win_is_open() == false then + M.toggle() + end + + if vim.api.nvim_get_current_win() == winh then + vim.cmd("wincmd w") + else + vim.api.nvim_set_current_win(winh) + vim.cmd("startinsert") + end +end + +-- Jump to the end of terminal buffer without moving from actual buffer +M.catchup = function() + if win_is_open() == false then + M.toggle() + end + if buf_is_valid() then + vim.api.nvim_buf_call(bufh, function() vim.cmd[[normal G]] end) + end +end + +return M diff --git a/lua/tms/p/treesitter.lua b/lua/tms/p/treesitter.lua @@ -0,0 +1,63 @@ +local M = {} + +M.setup = function() + require'nvim-treesitter.configs'.setup { + ensure_intalled = 'maintained', + highlight = {enable = true}, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '+', + node_incremental = '+', + -- scope_incremental = "grc", + node_decremental = '-', + }, + }, + + indent = {enable = true}, + + refactor = {highlight_definitions = {enable = true}}, + + textobjects = { + enable = true, + select = { + enable = true, + keymaps = { + -- ['ia'] = "@parameter.inner", + -- ['aa'] = "@parameter.outer", + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@comment.outer', + ['im'] = {dart = '@identifier'}, + ['ia'] = {html = '@attribute'}, + }, + }, + swap = { + enable = true, + swap_next = { + -- [">p"] = "@parameter.inner", + ['>m'] = '@function.outer', + }, + swap_previous = { + -- ["<p"] = "@parameter.inner", + ['<m'] = '@function.outer', + }, + }, + move = { + enable = true, + goto_next_start = {[']]'] = '@function.outer', [']c'] = '@class.outer'}, + goto_next_end = {[']['] = '@function.inner', [']C'] = '@class.outer'}, + goto_previous_start = {['[['] = '@function.outer', ['[c'] = '@class.outer'}, + goto_previous_end = {['[]'] = '@function.inner', ['[C'] = '@class.outer'}, + }, + lsp_interop = { + enable = true, + peek_definition_code = {['<leader>sf'] = '@function.outer', ['<leader>sc'] = '@class.outer'}, + }, + }, + + playground = {enable = true, disable = {}, updatetime = 25, persist_queries = false}, + } +end + +return M diff --git a/lua/tms/p/trun.lua b/lua/tms/p/trun.lua @@ -0,0 +1,46 @@ +-- Trun module +local M = {} + +-- returns list of runing truns +M.trun_complete = function() + local dir = os.getenv('TRUN_CACHE') or os.getenv('HOME') .. '/.cache/trun' + local ls = io.popen('ls ' .. dir) + local truns = {} + for trun in ls:lines() do + local name = trun:match('(.*)%..*') + table.insert(truns, name) + end + return truns +end + +-- add trun to quickfix list +-- it needs to have its tempfile for output +M.to_quickfix = function(name) + if not name then + return + end + vim.fn.setqflist({}, 'r') + local handle = io.popen('trun_status - ' .. name) + local o = {} + for line in handle:lines() do + table.insert(o, line) + end + if #o == 0 then + print('No running trun for "' .. name .. '"') + return + end + local errorfile = o[2] + if errorfile then + local errfile = io.open(errorfile, 'r') + local lines = {} + for line in errfile:lines() do + table.insert(lines, line) + end + vim.fn.setqflist({}, ' ', {lines = lines}) + else + print('Trun for "' .. name .. '" does not have tmp file') + return + end +end + +return M diff --git a/lua/tms/p/vifm.lua b/lua/tms/p/vifm.lua @@ -0,0 +1,28 @@ +local M = {} + +local function defaults() vim.cmd [[ set ft=vifm ]] end + +local function run(cmd, args) + if args then + vim.g.vifm_exec_args = table.concat(args, ' ') + end + vim.cmd(cmd) + defaults() +end + +local function select(args, file) + local filename = file or vim.api.nvim_buf_get_name(0) + table.insert(args, '--select=' .. filename) + if vim.opt.background:get() == 'light' then + table.insert(args, '+"color solarized-dark"') + end + return args +end + +M.current = function() run([[Vifm\ %:h]], select({'+only'})) end + +M.split = function() run([[split +Vifm\ %:h]], select({'+only'})) end + +M.vsplit = function() run([[vsplit +Vifm\ %:h]], select({'+only'})) end + +return M diff --git a/lua/tms/plugins.lua b/lua/tms/plugins.lua @@ -0,0 +1,523 @@ +local packer = nil +local function init() + if packer == nil then + packer = require('packer') + packer.init() + end + + local use = packer.use + packer.reset() + + use {'wbthomason/packer.nvim', opt = true} + + -- spell + use 'xxdavid/bez-diakritiky.vim' + + -- editor + use 'tpope/vim-unimpaired' -- toggles and ][ movements + use 'tpope/vim-obsession' -- session + use 'tpope/vim-eunuch' -- usefull unix utililties cmds + use 'machakann/vim-sandwich' -- surround + use { -- auto pairs + disable = true, + 'tmsvg/pear-tree', + config = function() + -- " Smart pairs are disabled by default: + vim.g.pear_tree_smart_openers = 1 + vim.g.pear_tree_smart_closers = 1 + vim.g.pear_tree_smart_backspace = 1 + vim.g.pear_tree_ft_disabled = {'TelescopePrompt'} + end, + } + use { -- auto pairs + 'cohama/lexima.vim', + config = function() + vim.g.lexima_map_escape = '' + require('tms.c.autocmd').addListener('lexima_disabled', {'FileType TelescopePrompt'}, + function() vim.cmd [[let b:lexima_disabled = 1]] end) + end, + } + + use 'michaeljsmith/vim-indent-object' + use { + disable = true, + 'lukas-reineke/indent-blankline.nvim', + config = function() + vim.g.indent_blankline_char = '│' + vim.g.indent_blankline_space_char = ' ' + vim.g.indent_blankline_use_treesitter = true + vim.g.indent_blankline_show_first_indent_level = false + vim.g.indent_blankline_indent_level = 4 + vim.g.indent_blankline_filetype_exclude = {'help', 'packer'} + vim.g.indent_blankline_buftype_exclude = {'terminal'} + vim.g.indent_blankline_bufname_exclude = {'README.md'} + vim.g.indent_blankline_viewport_buffer = 100 + vim.g.indent_blankline_show_trailing_blankline_indent = false + end, + } + use { + 'b3nj5m1n/kommentary', + config = function() + require('kommentary.config').configure_language('default', + {prefer_single_line_comments = true}) + end, + } + use { -- undo tree + 'mbbill/undotree', + config = function() + vim.g.undotree_WindowLayout = 2 + vim.g.undotree_SplitWidth = 50 + local kb = require('tms.c.keybind') + kb.nnoremap('<F5>', '<cmd>UndotreeToggle<cr>') + end, + } + use { -- animate height/width of window + 'camspiers/animate.vim', + config = function() + vim.cmd('let g:animate#duration = 100.0') + local silent = {silent = true} + local kb = require('tms.c.keybind') + kb.nmap('<c-up>', ':call animate#window_delta_height(10)<cr>', silent) + kb.nmap('<c-down>', ':call animate#window_delta_height(-10)<cr>', silent) + kb.nmap('<c-left>', ':call animate#window_delta_width(-10)<cr>', silent) + kb.nmap('<c-right>', ':call animate#window_delta_width(10)<cr>', silent) + kb.nmap('<s-up>', ':call animate#window_delta_height(1)<cr>', silent) + kb.nmap('<s-down>', ':call animate#window_delta_height(-1)<cr>', silent) + kb.nmap('<s-left>', ':call animate#window_delta_width(-1)<cr>', silent) + kb.nmap('<s-right>', ':call animate#window_delta_width(1)<cr>', silent) + end, + } + use { -- colorize rgb format + 'norcalli/nvim-colorizer.lua', + config = function() + require'colorizer'.setup({'*'}, { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = true, -- "Name" codes like Blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + }) + end, + } + use { + 'danilamihailov/beacon.nvim', + config = function() + vim.g.beacon_ignore_filetypes = {'vifm'} + local kb = require('tms.c.keybind') + kb.nmap('n', 'n:Beacon<cr>') + kb.nmap('N', 'N:Beacon<cr>') + kb.nmap('*', '*:Beacon<cr>') + kb.nmap('#', '#:Beacon<cr>') + end, + } -- beacon last cursor pos + use { + 'Yggdroot/hiPairs', + config = function() + vim.g.loaded_matchparen = 1 + vim.g.hiPairs_timeout = 5 + -- vim.g.hiPairs_hl_matchPair = { + -- ['term'] = 'underline,bold', + -- ['cterm'] = 'bold', + -- ['ctermfg'] = '0', + -- ['ctermbg'] = '180', + -- ['gui'] = 'bold', + -- } + -- vim.g.hiPairs_hl_unmatchPair = { + -- ['term'] = 'underline,bold', + -- ['cterm'] = 'bold', + -- ['ctermfg'] = '0', + -- ['ctermbg'] = '180', + -- ['gui'] = 'bold', + -- } + end, + } -- highlight parens + use 'chaoren/vim-wordmotion' -- word counts with _,.,-,... + use { + 'hoob3rt/lualine.nvim', + requires = {'kyazdani42/nvim-web-devicons', opt = true}, + config = function() require('tms.p.status').setup() end, + } + use {'joeytwiddle/sexy_scroller.vim'} -- smooth scrolling + use { + disable = true, + '~/.local/lib/neoscroll.nvim', + config = function() + require('neoscroll').setup() + local t = {} + -- Syntax: t[keys] = {function , {function arguments}} + t['<C-u>'] = {'scroll', {'-vim.wo.scroll', 'true', '80'}} + t['<C-d>'] = {'scroll', {'vim.wo.scroll', 'true', '80'}} + t['<C-b>'] = {'scroll', {'-vim.api.nvim_win_get_height(0)', 'true', '100'}} + t['<C-f>'] = {'scroll', {'vim.api.nvim_win_get_height(0)', 'true', '100'}} + t['<C-y>'] = {'scroll', {'-0.10', 'false', '100'}} + t['<C-e>'] = {'scroll', {'0.10', 'false', '100'}} + t['zt'] = {'zt', {'100'}} + t['zz'] = {'zz', {'100'}} + t['zb'] = {'zb', {'100'}} + require('neoscroll.config').set_mappings(t) + end, + } -- smooth scrolling + -- use { + -- disable = true, + -- 'karb94/neoscroll.nvim', + -- config = function() require('neoscroll').setup({}) end, + -- } + use 'romgrk/equal.operator' -- equal text object `lefthand = righthand` + use { + 'AndrewRadev/sideways.vim', + config = function() + local kb = require('tms.c.keybind') + kb.nnoremap('<c-h>', ':SidewaysLeft<cr>') + kb.nnoremap('<c-l>', ':SidewaysRight<cr>') + kb.omap({'aa', 'a.'}, '<Plug>SidewaysArgumentTextobjA') + kb.xmap({'aa', 'a.'}, '<Plug>SidewaysArgumentTextobjA') + kb.omap('ia', '<Plug>SidewaysArgumentTextobjI') + kb.xmap('ia', '<Plug>SidewaysArgumentTextobjI') + kb.nmap('<leader>ah', '<Plug>SidewaysArgumentInsertBefore') + kb.nmap('<leader>al', '<Plug>SidewaysArgumentAppendAfter') + kb.nmap('<leader>aH', '<Plug>SidewaysArgumentInsertFirt') + kb.nmap('<leader>aL', '<Plug>SidewaysArgumentAppendLast') + end, + } -- parameter switch + use { + 'godlygeek/tabular', + config = function() + + local kb = require('tms.c.keybind') + kb.nmap('<leader>a=', '<cmd>Tabularize /=<cr>') + kb.vmap('<leader>a=', '<cmd>Tabularize /=<cr>') + kb.nmap('<leader>a:', '<cmd>Tabularize /:\\zs<cr>') + kb.vmap('<leader>a:', '<cmd>Tabularize /:\\zs<cr>') + kb.nmap('<leader>a,', '<cmd>Tabularize /,<cr>') + kb.vmap('<leader>a,', '<cmd>Tabularize /,<cr>') + end, + } -- aligning + use { + 'windwp/nvim-spectre', + config = function() + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>S', '<cmd>lua require("spectre").open()<cr>') + kb.vnoremap('<leader>s', '<cmd>lua require("spectre").open_visual()<cr>') + end, + } -- replace + use {'tjdevries/astronauta.nvim'} + + -- quickfix list + use { + disable = true, + 'romainl/vim-qf', + config = function() + vim.g.qf_mapping_ack_style = 0 + vim.g.qf_auto_open_quickfix = 0 + vim.g.qf_auto_resize = 0 + end, + } + use {'kevinhwang91/nvim-bqf', config = function() require('tms.p.bqf').setup() end} + + -- distraction + use 'junegunn/limelight.vim' + use { + 'folke/zen-mode.nvim', + config = function() + require('zen-mode').setup {} + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>z', '<cmd>ZenMode<cr>') + end, + } + + -- how to vim + use 'ThePrimeagen/vim-be-good' + + -- vcs + use { + 'lewis6991/gitsigns.nvim', + requires = {'nvim-lua/plenary.nvim'}, + config = function() + require('tms.p.gitsigns').setup() + local kb = require('tms.c.keybind') + kb.nmap({'>c', '>['}, '<cmd>lua require("gitsigns").next_hunk()<cr>') + kb.nmap({'<c', '<['}, '<cmd>lua require("gitsigns").prev_hunk()<cr>') + kb.nmap('<leader>hs', '<cmd>lua require("gitsigns").stage_hunk()<cr>') + kb.nmap('<leader>hu', '<cmd>lua require("gitsigns").undo_stage_hunk()<cr>') + kb.nmap('<leader>hr', '<cmd>lua require("gitsigns").reset_hunk()<cr>') + kb.nmap('<leader>hR', '<cmd>lua require("gitsigns").reset_buffer()<cr>') + kb.nmap('<leader>hp', '<cmd>lua require("gitsigns").preview_hunk()<cr>') + kb.nmap('<leader>hb', '<cmd>lua require("gitsigns").toggle_current_line_blame()<cr>') + kb.nmap('<leader>hl', '<cmd>lua require("gitsigns").toggle_linehl()<cr>') + kb.nmap('<leader>hn', '<cmd>lua require("gitsigns").toggle_numhl()<cr>') + kb.omap('ig', ':<C-U>lua require("gitsigns").select_hunk()<cr>') + kb.xmap('ig', ':<C-U>lua require("gitsigns").select_hunk()<cr>') + end, + } + use 'sindrets/diffview.nvim' -- view diffs for multiple files + use { + 'TimUntersberger/neogit', + requires = {'nvim-lua/plenary.nvim', 'sindrets/diffview.nvim'}, + config = function() + require('neogit').setup {integrations = {diffview = true}} + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>gn', '<cmd>Neogit kind=split<cr>') + end, + } -- git integration + use { + 'tpope/vim-fugitive', + config = function() + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>gg', '<cmd>G<cr>') + kb.nnoremap('<leader>gc', '<cmd>G commit<cr>') + kb.nnoremap('<leader>gb', '<cmd>Git blame<cr>') + end, + } -- git integration + use { + 'rhysd/git-messenger.vim', + config = function() + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>gm', '<plug>(git-messenger)') + end, + } -- git info for current line + + -- colorscheme + use { + 'morhetz/gruvbox', + config = function() + vim.g.gruvbox_contrast_dark = 'hard' + vim.g.gruvbox_contrast_light = 'soft' + end, + } + use { + 'tjdevries/colorbuddy.nvim', + after = {'gruvbox'}, + -- config = function() require('tms.colors').setup() end, + } + + -- http + use {disable = true, 'nicwest/vim-http'} + use { + 'NTBBloodbath/rest.nvim', + requires = {'nvim-lua/plenary.nvim'}, + config = function() + require('rest-nvim').setup() + -- vim.cmd [[command! RestRun call <Plug>RestNvim]] + -- vim.cmd [[command! RestPreview call <Plug>RestNvimPreview]] + end, + } + + -- file manager + -- use {'junegunn/fzf'} + -- use {'junegunn/fzf.vim', config = function() vim.g.fzf_buffers_jump = 1 end} + use { + 'vifm/vifm.vim', + config = function() + vim.g.loaded_netrw = true + vim.g.loaded_netrwPlugin = true + vim.g.vifm_replace_netrw = true + end, + } + + -- tasks + use {'amirrezaask/actions.nvim', config = function() require('tms.p.actions').setup() end} + use { + 'skywind3000/asyncrun.vim', + config = function() + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>rs', '<cmd>AsyncStop<cr>') + kb.nnoremap('<leader>rr', ':AsyncRun ') + end, + } + + -- filetype + use { + 'suan/vim-instant-markdown', + config = function() + vim.g.instant_markdown_autostart = 0 + vim.g.instant_markdown_browser = os.getenv('BROWSER') .. ' --new-window' + end, + } + use 'tikhomirov/vim-glsl' + use 'mattn/emmet-vim' + use {'windwp/nvim-ts-autotag', config = function() require('nvim-ts-autotag').setup {} end} -- html tag autoclose/rename + use {'vim-php/vim-composer', config = function() vim.g.composer_cmd = 'composer' end} + use 'fpob/nette.vim' + use 'baskerville/vim-sxhkdrc' + use 'dart-lang/dart-vim-plugin' + use {'akinsho/dependency-assist.nvim', config = function() require'dependency_assist'.setup() end} + + -- snippets + use {'norcalli/snippets.nvim', config = function() require('tms.p.snippets').setup() end} + + -- completion + use { + 'hrsh7th/nvim-compe', + config = function() + require('tms.p.compe').setup() + local kb = require('tms.c.keybind') + -- kb.inoremap('<c-space>', 'compe#complete()', {silent = true, expr = true}) + kb.inoremap('<cr>', 'compe#confirm("<cr>")', {silent = true, expr = true}) + kb.inoremap('<c-e>', 'compe#close("<c-e>")', {silent = true, expr = true}) + kb.imap('<Tab>', 'v:lua.tab_complete()', {expr = true}) + kb.smap('<Tab>', 'v:lua.tab_complete()', {expr = true}) + kb.imap('<S-Tab>', 'v:lua.s_tab_complete()', {expr = true}) + kb.smap('<S-Tab>', 'v:lua.s_tab_complete()', {expr = true}) + end, + } + use {'tamago324/compe-zsh', requires = {'hrsh7th/nvim-compe', 'nvim-lua/plenary.nvim'}} + + -- lsp + use 'neovim/nvim-lspconfig' + use {disable = true, 'RRethy/vim-illuminate'} + use 'ray-x/lsp_signature.nvim' + use 'alexaandru/nvim-lspupdate' + use { + 'folke/lsp-trouble.nvim', + requires = 'kyazdani42/nvim-web-devicons', + config = function() require('trouble').setup {} end, + } + use {'folke/lua-dev.nvim', config = function() end} + use { + 'jose-elias-alvarez/null-ls.nvim', + config = function() + local null_ls = require('null-ls') + local sources = { + -- null_ls.builtins.formatting.prettier, + -- null_ls.builtins.diagnostics.write_good, + -- null_ls.builtins.code_actions.gitsigns, + } + null_ls.setup({ + sources = sources, + on_attach = function(client) client.resolved_capabilities.document_formatting = false end, + }) + end, + requires = {'nvim-lua/plenary.nvim'}, + } + + -- dap + use {'mfussenegger/nvim-dap', config = function() require('tms.p.dap').setup() end} + use { + 'rcarriga/nvim-dap-ui', + requires = 'mfussenegger/nvim-dap', + config = function() require('tms.p.dap').setup_ui() end, + } + use { + disable = true, + 'Pocco81/DAPInstall.nvim', + config = function() + local dap_install = require('dap-install') + local dbg_list = require('dap-install.debuggers_list').debuggers + for debugger, _ in pairs(dbg_list) do + dap_install.config(debugger, {}) + end + end, + requires = {'jbyuki/one-small-step-for-vimkind', 'mfussenegger/nvim-dap'}, + } + use {'theHamsta/nvim-dap-virtual-text', requires = {'mfussenegger/nvim-dap'}} + + -- treesitter + use { + 'nvim-treesitter/nvim-treesitter', + config = function() + require('tms.p.treesitter').setup() + -- hack + vim.cmd [[command! TSHRefresh execute 'write|edit|TSBufEnable highlight']] + local kb = require('tms.c.keybind') + kb.nnoremap('<leader>su', '<cmd>TSHRefresh<cr>') + end, + } + use 'nvim-treesitter/nvim-treesitter-textobjects' + use 'nvim-treesitter/nvim-treesitter-refactor' + use 'nvim-treesitter/playground' + + -- nvim-lua + use { + 'nvim-telescope/telescope.nvim', + requires = {'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim'}, + config = function() + local telescope = require('tms.p.telescope') + telescope.setup() + local kb = require('tms.c.keybind') + kb.nnoremap('<space>h', telescope.b.help_tags) + kb.nnoremap('<space>d', telescope.find_files) + kb.nnoremap('<space>D', telescope.b.find_files) + kb.nnoremap('<space>g', telescope.b.git_files) + kb.nnoremap('<space>b', telescope.buffers) + kb.nnoremap('<space>l', telescope.lines) + kb.nnoremap('<space>r', telescope.b.live_grep) + kb.nnoremap('<space>e', telescope.b.grep_string) + kb.nnoremap('<space>c', telescope.b.git_status) + kb.nnoremap('<space>q', telescope.b.quickfix) + kb.nnoremap('<space>k', telescope.keymaps) + kb.nnoremap('<space>m', telescope.b.man_pages) + kb.nnoremap('<space>p', telescope.reloader) + kb.nnoremap('<space>S', telescope.spell_suggest) + -- extensions + kb.nnoremap('<space>s', telescope.snippets) + -- custom + kb.nnoremap('<space>n', telescope.edit_neovim) + -- maybe - almost unsuedtelescope + kb.nnoremap('<space>o', telescope.b.oldfiles) + kb.nnoremap('<space>t', telescope.b.treesitter) + kb.nnoremap('<space>P', telescope.plugins) + end, + } + use {'nvim-telescope/telescope-packer.nvim', requires = {'nvim-telescole/telescope.nvim'}} + use { + 'nvim-telescope/telescope-fzf-native.nvim', + run = 'make', + after = {'telescope.nvim'}, + config = function() require('telescope').load_extension('fzf') end, + } + use { + 'nvim-telescope/telescope-dap.nvim', + requires = {'nvim-telescole/telescope.nvim'}, + after = {'telescope.nvim'}, + config = function() require('telescope').load_extension('dap') end, + } + use { + 'nvim-telescope/telescope-snippets.nvim', + requires = {'nvim-telescole/telescope.nvim'}, + after = {'telescope.nvim'}, + config = function() + require('telescope').load_extension('snippets') + local kb = require('tms.c.keybind') + kb.inoremap('<c-j>', '<cmd>lua require"snippets".expand_or_advance()<cr>') + kb.inoremap('<c-k>', '<cmd>lua require"snippets".advance_snippet(-1)<cr>') + end, + } + use 'nvim-lua/lsp_extensions.nvim' + + -- Godot + use {'habamax/vim-godot'} + + -- external usage + use { + 'glacambre/firenvim', + run = ':call firenvim#install(1)', + config = function() + if not vim.g.started_by_firenvim then + return + end + require'tms.p.firenvim'.setup() + end, + } + + -- personal + use { + 'GenesisTMS/trans.nvim', + config = function() + local kb = require('tms.c.keybind') + kb.xmap('mtt', '<cmd>lua require("trans").translate()<cr>') + kb.xmap('mtc', '<cmd>lua require("trans").translate("cs")<cr>') + end, + } +end + +local plugins = setmetatable({}, { + __index = function(_, key) + init() + return packer[key] + end, +}) + +return plugins diff --git a/lua/tms/u/git.lua b/lua/tms/u/git.lua @@ -0,0 +1,14 @@ +local M = {} + +M.is_git = function(path) + local id = vim.fn.jobstart('git -C "' .. path .. '" rev-parse', + {on_exit = function(_, code, type) end}) + local status = vim.fn.jobwait({id})[1] + if status == 0 then + return true + else + return false + end +end + +return M diff --git a/lua/tms/u/plugins.lua b/lua/tms/u/plugins.lua @@ -0,0 +1,15 @@ +local M = {} + +M.path = function(dir, name) + local plugin_utils = require 'packer.plugin_utils' + local packer_lists = {} + packer_lists['opt'], packer_lists['start'] = plugin_utils.list_installed_plugins() + for p_path, _ in pairs(packer_lists[dir]) do + local plugin_name = vim.fn.fnamemodify(p_path, ':t:r') + if plugin_name == name then + return p_path + end + end +end + +return M diff --git a/lua/tms/u/reload.lua b/lua/tms/u/reload.lua @@ -0,0 +1,17 @@ +local M = {} + +M.colorsPre = function() + vim.g.gruvbox_contrast_dark = 'hard' + vim.g.gruvbox_contrast_light = 'soft' + vim.cmd [[highlight clear]] +end + +M.colors = function() + package.loaded['colorbuddy'] = nil + package.loaded['colorbuddy.color'] = nil + require('tms.colors').setup() + package.loaded['tms.p.status'] = nil + require('tms.p.status').setup() +end + +return M diff --git a/lua/tms/u/ws.lua b/lua/tms/u/ws.lua @@ -0,0 +1,17 @@ +local au = require('tms.ws') +local M = {} + +M.setup = function(workspaces) + for ws, setup in pairs(workspaces) do + if setup.path then + au.addListener('user-project-path-' .. ws, {'VimEnter ' .. setup.path}, setup.config) + end + if setup.filetypes then + for _, filetype in ipairs(setup.filetypes) do + au.addListener('user-project-ft-' .. ws, {'FileType ' .. filetype}, setup.config) + end + end + end +end + +return M diff --git a/lua/tms/ws/init.lua b/lua/tms/ws/init.lua @@ -0,0 +1,45 @@ +local kb = require('tms.c.keybind') +local au = require('tms.c.autocmd') + +local M = {} + +local ws = {} +ws.mail = { + filetypes = {'mail'}, + config = function() + kb.nnoremap('<leader>pa', [[<cmd>lua require("tms.p.telescope").mail_address()<cr>]]) + end, +} + +ws.medoro = { + path = '*/medoro/**', + config = function() + kb.nnoremap('<leader>pt', [[<cmd>e %:s?\..*$?\.html?<cr>]]) + kb.nnoremap('<leader>pxt', [[<cmd>split %:s?\..*$?\.html?<cr>]]) + kb.nnoremap('<leader>pvt', [[<cmd>vsplit %:s?\..*$?\.html?<cr>]]) + kb.nnoremap('<leader>ps', [[<cmd>e %:s?\..*$?\.scss?<cr>]]) + kb.nnoremap('<leader>pxs', [[<cmd>split %:s?\..*$?\.scss?<cr>]]) + kb.nnoremap('<leader>pvs', [[<cmd>80vsplit %:s?\..*$?\.scss?<cr>]]) + kb.nnoremap('<leader>pd', [[<cmd>e %:s?\..*$?\.dart?<cr>]]) + kb.nnoremap('<leader>pxd', [[<cmd>split %:s?\..*$?\.dart?<cr>]]) + kb.nnoremap('<leader>pvd', [[<cmd>vsplit %:s?\..*$?\.dart?<cr>]]) + kb.nnoremap('<leader>T', [[<cmd>1DartTest<cr>]]) + -- kb.nnoremap('<leader>D', string.format('<cmd>1DartTest -n %s<cr>', require'tms.ft.dart'.getTestName())) + kb.nnoremap('<leader>pl', '<cmd>lua require("tms.ws.medoro").lang()<cr>') + end, +} + +M.setup = function() + for ws, setup in pairs(ws) do + if setup.path then + au.addListener('user-project-path-' .. ws, {'VimEnter ' .. setup.path}, setup.config) + end + if setup.filetypes then + for _, filetype in ipairs(setup.filetypes) do + au.addListener('user-project-ft-' .. ws, {'FileType ' .. filetype}, setup.config) + end + end + end +end + +return M diff --git a/lua/tms/ws/medoro.lua b/lua/tms/ws/medoro.lua @@ -0,0 +1,19 @@ +local actions_state = require('telescope.actions.state') +local actions = require('telescope.actions') + +local M = {} + +function M.lang() + local cwd = '/home/tms/dev/medoro/dpgw/dpgw/src/main/resources/org/medoro/dpgw/core/lang/' + local files = {'lang.properties', 'lang_cs.properties'} + require('tms.p.telescope').grep_files(cwd, files, function(prompt_bufnr, _) + local entry = actions_state.get_selected_entry() + local lang = entry.text:match('(%S+)=.*') + print(entry.text, lang) + actions.close(prompt_bufnr) + vim.fn.setreg('+', lang) + vim.fn.setreg('*', lang) + end) +end + +return M diff --git a/plugin/async_make.lua b/plugin/async_make.lua @@ -0,0 +1,2 @@ +vim.cmd [[command! -nargs=* -complete=shellcmd Make lua require('tms.p.async_make').make(vim.fn.expand('<args>'))]] +vim.cmd [[command! -nargs=0 MakeStop lua require('tms.p.async_make').stop()]] diff --git a/plugin/bufonly.vim b/plugin/bufonly.vim @@ -0,0 +1,75 @@ +" BufOnly.vim - Delete all the buffers except the current/named buffer. +" +" +" Copyright November 2003 by Christian J. Robinson <infynity@onewest.net> +" +" Distributed under the terms of the Vim license. See ":help license". +" +" Usage: +" +" :Bonly / :BOnly / :Bufonly / :BufOnly [buffer] +" +" Without any arguments the current buffer is kept. With an argument the +" buffer name/number supplied is kept. + +if exists('g:BufonlyLoaded') || &cp + finish +end +let g:BufonlyLoaded = 1 + +command! -nargs=? -complete=buffer -bang Bonly + \ :call BufOnly('<args>', '<bang>') +command! -nargs=? -complete=buffer -bang BOnly + \ :call BufOnly('<args>', '<bang>') +command! -nargs=? -complete=buffer -bang Bufonly + \ :call BufOnly('<args>', '<bang>') +command! -nargs=? -complete=buffer -bang BufOnly + \ :call BufOnly('<args>', '<bang>') + +function! BufOnly(buffer, bang) + if a:buffer == '' + " No buffer provided, use the current buffer. + let buffer = bufnr('%') + elseif (a:buffer + 0) > 0 + " A buffer number was provided. + let buffer = bufnr(a:buffer + 0) + else + " A buffer name was provided. + let buffer = bufnr(a:buffer) + endif + + if buffer == -1 + echohl ErrorMsg + echomsg "No matching buffer for" a:buffer + echohl None + return + endif + + let last_buffer = bufnr('$') + + let delete_count = 0 + let n = 1 + while n <= last_buffer + if n != buffer && buflisted(n) + if a:bang == '' && getbufvar(n, '&modified') + echohl ErrorMsg + echomsg 'No write since last change for buffer' + \ n '(add ! to override)' + echohl None + else + silent exe 'bdel' . a:bang . ' ' . n + if ! buflisted(n) + let delete_count = delete_count+1 + endif + endif + endif + let n = n+1 + endwhile + + if delete_count == 1 + echomsg delete_count "buffer deleted" + elseif delete_count > 1 + echomsg delete_count "buffers deleted" + endif + +endfunction diff --git a/plugin/color.vim b/plugin/color.vim @@ -0,0 +1,4 @@ +function! SynGroup() + let l:s = synID(line('.'), col('.'), 1) + echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name') +endfun diff --git a/plugin/debug.lua b/plugin/debug.lua @@ -0,0 +1,4 @@ +function _G.dump(...) + local objects = vim.tbl_map(vim.inspect, {...}) + print(unpack(objects)) +end diff --git a/plugin/fold.vim b/plugin/fold.vim @@ -0,0 +1,9 @@ +function! MyFoldText() + let line = getline(v:foldstart) + let folded_line_num = v:foldend - v:foldstart + let line_text = substitute(line, '^"{\+', '', 'g') + let fillcharcount = 80 - len(line_text) - len(folded_line_num) + return repeat(' ', 4) . line_text . repeat(' ', fillcharcount) . ' (' . folded_line_num . ' L) ' +endfunction + + diff --git a/plugin/hexen.lua b/plugin/hexen.lua @@ -0,0 +1,2 @@ +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/plugin/marks.lua b/plugin/marks.lua @@ -0,0 +1,35 @@ +local nnoremap = require('astronauta.keymap').nnoremap + +-- global markers +for _, l in ipairs({ + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', +}) do + nnoremap {'m' .. l, 'm' .. l:upper()} + nnoremap {'\'' .. l, '`' .. l:upper()} + nnoremap {'`' .. l, '\'' .. l:upper()} +end diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua @@ -0,0 +1,598 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + + local time + local profile_info + local should_profile = false + if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end + else + time = function(chunk, start) end + end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/home/tms/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/tms/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/tms/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/tms/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/tms/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s)) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["actions.nvim"] = { + config = { "\27LJ\2\n;\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\18tms.p.actions\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/actions.nvim" + }, + ["animate.vim"] = { + config = { "\27LJ\2\n\5\0\0\a\0\23\00016\0\0\0009\0\1\0'\2\2\0B\0\2\0015\0\3\0006\1\4\0'\3\5\0B\1\2\0029\2\6\1'\4\a\0'\5\b\0\18\6\0\0B\2\4\0019\2\6\1'\4\t\0'\5\n\0\18\6\0\0B\2\4\0019\2\6\1'\4\v\0'\5\f\0\18\6\0\0B\2\4\0019\2\6\1'\4\r\0'\5\14\0\18\6\0\0B\2\4\0019\2\6\1'\4\15\0'\5\16\0\18\6\0\0B\2\4\0019\2\6\1'\4\17\0'\5\18\0\18\6\0\0B\2\4\0019\2\6\1'\4\19\0'\5\20\0\18\6\0\0B\2\4\0019\2\6\1'\4\21\0'\5\22\0\18\6\0\0B\2\4\1K\0\1\0,:call animate#window_delta_width(1)<cr>\14<s-right>-:call animate#window_delta_width(-1)<cr>\r<s-left>.:call animate#window_delta_height(-1)<cr>\r<s-down>-:call animate#window_delta_height(1)<cr>\v<s-up>-:call animate#window_delta_width(10)<cr>\14<c-right>.:call animate#window_delta_width(-10)<cr>\r<c-left>/:call animate#window_delta_height(-10)<cr>\r<c-down>.:call animate#window_delta_height(10)<cr>\v<c-up>\tnmap\18tms.c.keybind\frequire\1\0\1\vsilent\2#let g:animate#duration = 100.0\bcmd\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/animate.vim" + }, + ["astronauta.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/astronauta.nvim" + }, + ["asyncrun.vim"] = { + config = { "\27LJ\2\n\1\0\0\5\0\a\0\f6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\1K\0\1\0\15:AsyncRun \15<leader>rr\23<cmd>AsyncStop<cr>\15<leader>rs\rnnoremap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/asyncrun.vim" + }, + ["beacon.nvim"] = { + config = { "\27LJ\2\n\1\0\0\5\0\15\0\0246\0\0\0009\0\1\0005\1\3\0=\1\2\0006\0\4\0'\2\5\0B\0\2\0029\1\6\0'\3\a\0'\4\b\0B\1\3\0019\1\6\0'\3\t\0'\4\n\0B\1\3\0019\1\6\0'\3\v\0'\4\f\0B\1\3\0019\1\6\0'\3\r\0'\4\14\0B\1\3\1K\0\1\0\17#:Beacon<cr>\6#\17*:Beacon<cr>\6*\17N:Beacon<cr>\6N\17n:Beacon<cr>\6n\tnmap\18tms.c.keybind\frequire\1\2\0\0\tvifm\28beacon_ignore_filetypes\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/beacon.nvim" + }, + ["bez-diakritiky.vim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/bez-diakritiky.vim" + }, + ["colorbuddy.nvim"] = { + config = { "\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\15tms.colors\frequire\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/tms/.local/share/nvim/site/pack/packer/opt/colorbuddy.nvim" + }, + ["compe-zsh"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/compe-zsh" + }, + ["dart-vim-plugin"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/dart-vim-plugin" + }, + ["dependency-assist.nvim"] = { + config = { "\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22dependency_assist\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/dependency-assist.nvim" + }, + ["diffview.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/diffview.nvim" + }, + ["emmet-vim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/emmet-vim" + }, + ["equal.operator"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/equal.operator" + }, + firenvim = { + config = { "\27LJ\2\nn\0\0\3\0\6\0\f6\0\0\0009\0\1\0009\0\2\0\14\0\0\0X\0\1K\0\1\0006\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\19tms.p.firenvim\frequire\24started_by_firenvim\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/firenvim" + }, + ["git-messenger.vim"] = { + config = { "\27LJ\2\ng\0\0\5\0\5\0\b6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\1K\0\1\0\26<plug>(git-messenger)\15<leader>gm\rnnoremap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/git-messenger.vim" + }, + ["gitsigns.nvim"] = { + config = { "\27LJ\2\n\a\0\0\5\0\29\00096\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\0029\1\4\0005\3\5\0'\4\6\0B\1\3\0019\1\4\0005\3\a\0'\4\b\0B\1\3\0019\1\4\0'\3\t\0'\4\n\0B\1\3\0019\1\4\0'\3\v\0'\4\f\0B\1\3\0019\1\4\0'\3\r\0'\4\14\0B\1\3\0019\1\4\0'\3\15\0'\4\16\0B\1\3\0019\1\4\0'\3\17\0'\4\18\0B\1\3\0019\1\4\0'\3\19\0'\4\20\0B\1\3\0019\1\4\0'\3\21\0'\4\22\0B\1\3\0019\1\4\0'\3\23\0'\4\24\0B\1\3\0019\1\25\0'\3\26\0'\4\27\0B\1\3\0019\1\28\0'\3\26\0'\4\27\0B\1\3\1K\0\1\0\txmap4:<C-U>lua require(\"gitsigns\").select_hunk()<cr>\aig\tomap4<cmd>lua require(\"gitsigns\").toggle_numhl()<cr>\15<leader>hn5<cmd>lua require(\"gitsigns\").toggle_linehl()<cr>\15<leader>hlA<cmd>lua require(\"gitsigns\").toggle_current_line_blame()<cr>\15<leader>hb4<cmd>lua require(\"gitsigns\").preview_hunk()<cr>\15<leader>hp4<cmd>lua require(\"gitsigns\").reset_buffer()<cr>\15<leader>hR2<cmd>lua require(\"gitsigns\").reset_hunk()<cr>\15<leader>hr7<cmd>lua require(\"gitsigns\").undo_stage_hunk()<cr>\15<leader>hu2<cmd>lua require(\"gitsigns\").stage_hunk()<cr>\15<leader>hs1<cmd>lua require(\"gitsigns\").prev_hunk()<cr>\1\3\0\0\a<c\a<[1<cmd>lua require(\"gitsigns\").next_hunk()<cr>\1\3\0\0\a>c\a>[\tnmap\18tms.c.keybind\nsetup\19tms.p.gitsigns\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/gitsigns.nvim" + }, + gruvbox = { + after = { "colorbuddy.nvim" }, + loaded = true, + only_config = true + }, + hiPairs = { + config = { "\27LJ\2\n\2\0\0\2\0\b\0\0176\0\0\0009\0\1\0)\1\1\0=\1\2\0006\0\0\0009\0\1\0)\1\5\0=\1\3\0006\0\0\0009\0\1\0005\1\5\0=\1\4\0006\0\0\0009\0\1\0005\1\a\0=\1\6\0K\0\1\0\1\0\a\fctermbg\b180\fctermfg\0060\tterm\19underline,bold\nguibg\f#cc241d\nguifg\f#fbf1c7\bgui\tbold\ncterm\tbold\27hiPairs_hl_unmatchPair\1\0\a\fctermbg\b180\fctermfg\0060\tterm\19underline,bold\nguibg\f#3b4252\nguifg\f#ffff00\bgui\tbold\ncterm\tbold\25hiPairs_hl_matchPair\20hiPairs_timeout\22loaded_matchparen\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/hiPairs" + }, + kommentary = { + config = { "\27LJ\2\n|\0\0\4\0\5\0\b6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0005\3\4\0B\0\3\1K\0\1\0\1\0\1 prefer_single_line_comments\2\fdefault\23configure_language\22kommentary.config\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/kommentary" + }, + ["lexima.vim"] = { + config = { "\27LJ\2\n=\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\30let b:lexima_disabled = 1\bcmd\bvim\1\1\0\5\0\n\0\r6\0\0\0009\0\1\0'\1\3\0=\1\2\0006\0\4\0'\2\5\0B\0\2\0029\0\6\0'\2\a\0005\3\b\0003\4\t\0B\0\4\1K\0\1\0\0\1\2\0\0\29FileType TelescopePrompt\20lexima_disabled\16addListener\18tms.c.autocmd\frequire\5\22lexima_map_escape\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/lexima.vim" + }, + ["limelight.vim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/limelight.vim" + }, + ["lsp-trouble.nvim"] = { + config = { "\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\ftrouble\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/lsp-trouble.nvim" + }, + ["lsp_extensions.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/lsp_extensions.nvim" + }, + ["lsp_signature.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim" + }, + ["lua-dev.nvim"] = { + config = { "\27LJ\2\n\v\0\0\1\0\0\0\1K\0\1\0\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/lua-dev.nvim" + }, + ["lualine.nvim"] = { + config = { "\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\17tms.p.status\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/lualine.nvim" + }, + neogit = { + config = { "\27LJ\2\n\1\0\0\5\0\n\0\0166\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\4\0005\3\3\0=\3\5\2B\0\2\0016\0\0\0'\2\6\0B\0\2\0029\1\a\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0\31<cmd>Neogit kind=split<cr>\15<leader>gn\rnnoremap\18tms.c.keybind\17integrations\1\0\0\1\0\1\rdiffview\2\nsetup\vneogit\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/neogit" + }, + ["nette.vim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nette.vim" + }, + ["null-ls.nvim"] = { + config = { "\27LJ\2\nA\0\1\3\0\2\0\0049\1\0\0+\2\1\0=\2\1\1K\0\1\0\24document_formatting\26resolved_capabilities_\1\0\6\0\a\0\v6\0\0\0'\2\1\0B\0\2\0024\1\0\0009\2\2\0005\4\3\0=\1\4\0043\5\5\0=\5\6\4B\2\2\1K\0\1\0\14on_attach\0\fsources\1\0\0\nsetup\fnull-ls\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/null-ls.nvim" + }, + ["nvim-bqf"] = { + config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14tms.p.bqf\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-bqf" + }, + ["nvim-colorizer.lua"] = { + config = { "\27LJ\2\n\1\0\0\4\0\5\0\b6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\4\0B\0\3\1K\0\1\0\1\0\b\vcss_fn\2\vrgb_fn\2\vhsl_fn\2\bcss\2\bRGB\2\vRRGGBB\2\nnames\2\rRRGGBBAA\2\1\2\0\0\6*\nsetup\14colorizer\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua" + }, + ["nvim-compe"] = { + config = { "\27LJ\2\n\3\0\0\6\0\21\0'6\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\0029\1\4\0'\3\5\0'\4\6\0005\5\a\0B\1\4\0019\1\4\0'\3\b\0'\4\t\0005\5\n\0B\1\4\0019\1\v\0'\3\f\0'\4\r\0005\5\14\0B\1\4\0019\1\15\0'\3\f\0'\4\r\0005\5\16\0B\1\4\0019\1\v\0'\3\17\0'\4\18\0005\5\19\0B\1\4\0019\1\15\0'\3\17\0'\4\18\0005\5\20\0B\1\4\1K\0\1\0\1\0\1\texpr\2\1\0\1\texpr\2\27v:lua.s_tab_complete()\f<S-Tab>\1\0\1\texpr\2\tsmap\1\0\1\texpr\2\25v:lua.tab_complete()\n<Tab>\timap\1\0\2\vsilent\2\texpr\2\25compe#close(\"<c-e>\")\n<c-e>\1\0\2\vsilent\2\texpr\2\26compe#confirm(\"<cr>\")\t<cr>\rinoremap\18tms.c.keybind\nsetup\16tms.p.compe\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-compe" + }, + ["nvim-dap"] = { + config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14tms.p.dap\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-dap" + }, + ["nvim-dap-ui"] = { + config = { "\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rsetup_ui\14tms.p.dap\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-dap-ui" + }, + ["nvim-dap-virtual-text"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-lspconfig" + }, + ["nvim-lspupdate"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-lspupdate" + }, + ["nvim-spectre"] = { + config = { "\27LJ\2\n\1\0\0\5\0\b\0\f6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\5\0'\3\6\0'\4\a\0B\1\3\1K\0\1\0002<cmd>lua require(\"spectre\").open_visual()<cr>\14<leader>s\rvnoremap+<cmd>lua require(\"spectre\").open()<cr>\14<leader>S\rnnoremap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-spectre" + }, + ["nvim-treesitter"] = { + config = { "\27LJ\2\n\1\0\0\5\0\n\0\0176\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\3\0009\0\4\0'\2\5\0B\0\2\0016\0\0\0'\2\6\0B\0\2\0029\1\a\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0\24<cmd>TSHRefresh<cr>\15<leader>su\rnnoremap\18tms.c.keybindCcommand! TSHRefresh execute 'write|edit|TSBufEnable highlight'\bcmd\bvim\nsetup\21tms.p.treesitter\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-treesitter" + }, + ["nvim-treesitter-refactor"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-treesitter-refactor" + }, + ["nvim-treesitter-textobjects"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-treesitter-textobjects" + }, + ["nvim-ts-autotag"] = { + config = { "\27LJ\2\nA\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\20nvim-ts-autotag\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = false, + needs_bufread = false, + path = "/home/tms/.local/share/nvim/site/pack/packer/opt/packer.nvim" + }, + playground = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/playground" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/plenary.nvim" + }, + ["popup.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/popup.nvim" + }, + ["rest.nvim"] = { + config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14rest-nvim\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/rest.nvim" + }, + ["sexy_scroller.vim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/sexy_scroller.vim" + }, + ["sideways.vim"] = { + config = { "\27LJ\2\n\4\0\0\5\0\23\0,6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\0019\1\a\0005\3\b\0'\4\t\0B\1\3\0019\1\n\0005\3\v\0'\4\t\0B\1\3\0019\1\a\0'\3\f\0'\4\r\0B\1\3\0019\1\n\0'\3\f\0'\4\r\0B\1\3\0019\1\14\0'\3\15\0'\4\16\0B\1\3\0019\1\14\0'\3\17\0'\4\18\0B\1\3\0019\1\14\0'\3\19\0'\4\20\0B\1\3\0019\1\14\0'\3\21\0'\4\22\0B\1\3\1K\0\1\0%<Plug>SidewaysArgumentAppendLast\15<leader>aL%<Plug>SidewaysArgumentInsertFirt\15<leader>aH&<Plug>SidewaysArgumentAppendAfter\15<leader>al'<Plug>SidewaysArgumentInsertBefore\15<leader>ah\tnmap#<Plug>SidewaysArgumentTextobjI\aia\1\3\0\0\aaa\aa.\txmap#<Plug>SidewaysArgumentTextobjA\1\3\0\0\aaa\aa.\tomap\23:SidewaysRight<cr>\n<c-l>\22:SidewaysLeft<cr>\n<c-h>\rnnoremap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/sideways.vim" + }, + ["snippets.nvim"] = { + config = { "\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19tms.p.snippets\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/snippets.nvim" + }, + tabular = { + config = { "\27LJ\2\n\2\0\0\5\0\n\0\0286\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\5\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\6\0'\4\a\0B\1\3\0019\1\5\0'\3\6\0'\4\a\0B\1\3\0019\1\2\0'\3\b\0'\4\t\0B\1\3\0019\1\5\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0\27<cmd>Tabularize /,<cr>\15<leader>a,\30<cmd>Tabularize /:\\zs<cr>\15<leader>a:\tvmap\27<cmd>Tabularize /=<cr>\15<leader>a=\tnmap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/tabular" + }, + ["telescope-dap.nvim"] = { + config = { "\27LJ\2\nH\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\bdap\19load_extension\14telescope\frequire\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/tms/.local/share/nvim/site/pack/packer/opt/telescope-dap.nvim" + }, + ["telescope-fzf-native.nvim"] = { + config = { "\27LJ\2\nH\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\bfzf\19load_extension\14telescope\frequire\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/tms/.local/share/nvim/site/pack/packer/opt/telescope-fzf-native.nvim" + }, + ["telescope-packer.nvim"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/telescope-packer.nvim" + }, + ["telescope-snippets.nvim"] = { + config = { "\27LJ\2\n\2\0\0\5\0\n\0\0186\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\0016\0\0\0'\2\4\0B\0\2\0029\1\5\0'\3\6\0'\4\a\0B\1\3\0019\1\5\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0007<cmd>lua require\"snippets\".advance_snippet(-1)<cr>\n<c-k>7<cmd>lua require\"snippets\".expand_or_advance()<cr>\n<c-j>\rinoremap\18tms.c.keybind\rsnippets\19load_extension\14telescope\frequire\0" }, + load_after = {}, + loaded = true, + needs_bufread = false, + path = "/home/tms/.local/share/nvim/site/pack/packer/opt/telescope-snippets.nvim" + }, + ["telescope.nvim"] = { + after = { "telescope-dap.nvim", "telescope-fzf-native.nvim", "telescope-snippets.nvim" }, + loaded = true, + only_config = true + }, + ["trans.nvim"] = { + config = { "\27LJ\2\n\1\0\0\5\0\a\0\f6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\1K\0\1\0002<cmd>lua require(\"trans\").translate(\"cs\")<cr>\bmtc.<cmd>lua require(\"trans\").translate()<cr>\bmtt\txmap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/trans.nvim" + }, + undotree = { + config = { "\27LJ\2\n\1\0\0\5\0\t\0\0166\0\0\0009\0\1\0)\1\2\0=\1\2\0006\0\0\0009\0\1\0)\0012\0=\1\3\0006\0\4\0'\2\5\0B\0\2\0029\1\6\0'\3\a\0'\4\b\0B\1\3\1K\0\1\0\28<cmd>UndotreeToggle<cr>\t<F5>\rnnoremap\18tms.c.keybind\frequire\24undotree_SplitWidth\26undotree_WindowLayout\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/undotree" + }, + ["vifm.vim"] = { + config = { "\27LJ\2\nt\0\0\2\0\5\0\r6\0\0\0009\0\1\0+\1\2\0=\1\2\0006\0\0\0009\0\1\0+\1\2\0=\1\3\0006\0\0\0009\0\1\0+\1\2\0=\1\4\0K\0\1\0\23vifm_replace_netrw\23loaded_netrwPlugin\17loaded_netrw\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vifm.vim" + }, + ["vim-be-good"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-be-good" + }, + ["vim-composer"] = { + config = { "\27LJ\2\n7\0\0\2\0\4\0\0056\0\0\0009\0\1\0'\1\3\0=\1\2\0K\0\1\0\rcomposer\17composer_cmd\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-composer" + }, + ["vim-eunuch"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-eunuch" + }, + ["vim-fugitive"] = { + config = { "\27LJ\2\n\1\0\0\5\0\t\0\0166\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\0019\1\2\0'\3\a\0'\4\b\0B\1\3\1K\0\1\0\23<cmd>Git blame<cr>\15<leader>gb\22<cmd>G commit<cr>\15<leader>gc\15<cmd>G<cr>\15<leader>gg\rnnoremap\18tms.c.keybind\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-fugitive" + }, + ["vim-glsl"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-glsl" + }, + ["vim-godot"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-godot" + }, + ["vim-indent-object"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-indent-object" + }, + ["vim-instant-markdown"] = { + config = { "\27LJ\2\n\1\0\0\4\0\b\0\0146\0\0\0009\0\1\0)\1\0\0=\1\2\0006\0\0\0009\0\1\0006\1\4\0009\1\5\1'\3\6\0B\1\2\2'\2\a\0&\1\2\1=\1\3\0K\0\1\0\18 --new-window\fBROWSER\vgetenv\aos\29instant_markdown_browser\31instant_markdown_autostart\6g\bvim\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-instant-markdown" + }, + ["vim-obsession"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-obsession" + }, + ["vim-sandwich"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-sandwich" + }, + ["vim-sxhkdrc"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-sxhkdrc" + }, + ["vim-unimpaired"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-unimpaired" + }, + ["vim-wordmotion"] = { + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/vim-wordmotion" + }, + ["zen-mode.nvim"] = { + config = { "\27LJ\2\n\1\0\0\5\0\a\0\0146\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\0016\0\0\0'\2\3\0B\0\2\0029\1\4\0'\3\5\0'\4\6\0B\1\3\1K\0\1\0\21<cmd>ZenMode<cr>\14<leader>z\rnnoremap\18tms.c.keybind\nsetup\rzen-mode\frequire\0" }, + loaded = true, + path = "/home/tms/.local/share/nvim/site/pack/packer/start/zen-mode.nvim" + } +} + +time([[Defining packer_plugins]], false) +-- Config for: dependency-assist.nvim +time([[Config for dependency-assist.nvim]], true) +try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\22dependency_assist\frequire\0", "config", "dependency-assist.nvim") +time([[Config for dependency-assist.nvim]], false) +-- Config for: sideways.vim +time([[Config for sideways.vim]], true) +try_loadstring("\27LJ\2\n\4\0\0\5\0\23\0,6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\0019\1\a\0005\3\b\0'\4\t\0B\1\3\0019\1\n\0005\3\v\0'\4\t\0B\1\3\0019\1\a\0'\3\f\0'\4\r\0B\1\3\0019\1\n\0'\3\f\0'\4\r\0B\1\3\0019\1\14\0'\3\15\0'\4\16\0B\1\3\0019\1\14\0'\3\17\0'\4\18\0B\1\3\0019\1\14\0'\3\19\0'\4\20\0B\1\3\0019\1\14\0'\3\21\0'\4\22\0B\1\3\1K\0\1\0%<Plug>SidewaysArgumentAppendLast\15<leader>aL%<Plug>SidewaysArgumentInsertFirt\15<leader>aH&<Plug>SidewaysArgumentAppendAfter\15<leader>al'<Plug>SidewaysArgumentInsertBefore\15<leader>ah\tnmap#<Plug>SidewaysArgumentTextobjI\aia\1\3\0\0\aaa\aa.\txmap#<Plug>SidewaysArgumentTextobjA\1\3\0\0\aaa\aa.\tomap\23:SidewaysRight<cr>\n<c-l>\22:SidewaysLeft<cr>\n<c-h>\rnnoremap\18tms.c.keybind\frequire\0", "config", "sideways.vim") +time([[Config for sideways.vim]], false) +-- Config for: snippets.nvim +time([[Config for snippets.nvim]], true) +try_loadstring("\27LJ\2\n<\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\19tms.p.snippets\frequire\0", "config", "snippets.nvim") +time([[Config for snippets.nvim]], false) +-- Config for: lualine.nvim +time([[Config for lualine.nvim]], true) +try_loadstring("\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\17tms.p.status\frequire\0", "config", "lualine.nvim") +time([[Config for lualine.nvim]], false) +-- Config for: firenvim +time([[Config for firenvim]], true) +try_loadstring("\27LJ\2\nn\0\0\3\0\6\0\f6\0\0\0009\0\1\0009\0\2\0\14\0\0\0X\0\1K\0\1\0006\0\3\0'\2\4\0B\0\2\0029\0\5\0B\0\1\1K\0\1\0\nsetup\19tms.p.firenvim\frequire\24started_by_firenvim\6g\bvim\0", "config", "firenvim") +time([[Config for firenvim]], false) +-- Config for: zen-mode.nvim +time([[Config for zen-mode.nvim]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\a\0\0146\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\0016\0\0\0'\2\3\0B\0\2\0029\1\4\0'\3\5\0'\4\6\0B\1\3\1K\0\1\0\21<cmd>ZenMode<cr>\14<leader>z\rnnoremap\18tms.c.keybind\nsetup\rzen-mode\frequire\0", "config", "zen-mode.nvim") +time([[Config for zen-mode.nvim]], false) +-- Config for: neogit +time([[Config for neogit]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\n\0\0166\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\4\0005\3\3\0=\3\5\2B\0\2\0016\0\0\0'\2\6\0B\0\2\0029\1\a\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0\31<cmd>Neogit kind=split<cr>\15<leader>gn\rnnoremap\18tms.c.keybind\17integrations\1\0\0\1\0\1\rdiffview\2\nsetup\vneogit\frequire\0", "config", "neogit") +time([[Config for neogit]], false) +-- Config for: git-messenger.vim +time([[Config for git-messenger.vim]], true) +try_loadstring("\27LJ\2\ng\0\0\5\0\5\0\b6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\1K\0\1\0\26<plug>(git-messenger)\15<leader>gm\rnnoremap\18tms.c.keybind\frequire\0", "config", "git-messenger.vim") +time([[Config for git-messenger.vim]], false) +-- Config for: null-ls.nvim +time([[Config for null-ls.nvim]], true) +try_loadstring("\27LJ\2\nA\0\1\3\0\2\0\0049\1\0\0+\2\1\0=\2\1\1K\0\1\0\24document_formatting\26resolved_capabilities_\1\0\6\0\a\0\v6\0\0\0'\2\1\0B\0\2\0024\1\0\0009\2\2\0005\4\3\0=\1\4\0043\5\5\0=\5\6\4B\2\2\1K\0\1\0\14on_attach\0\fsources\1\0\0\nsetup\fnull-ls\frequire\0", "config", "null-ls.nvim") +time([[Config for null-ls.nvim]], false) +-- Config for: nvim-bqf +time([[Config for nvim-bqf]], true) +try_loadstring("\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14tms.p.bqf\frequire\0", "config", "nvim-bqf") +time([[Config for nvim-bqf]], false) +-- Config for: nvim-colorizer.lua +time([[Config for nvim-colorizer.lua]], true) +try_loadstring("\27LJ\2\n\1\0\0\4\0\5\0\b6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\4\0B\0\3\1K\0\1\0\1\0\b\vcss_fn\2\vrgb_fn\2\vhsl_fn\2\bcss\2\bRGB\2\vRRGGBB\2\nnames\2\rRRGGBBAA\2\1\2\0\0\6*\nsetup\14colorizer\frequire\0", "config", "nvim-colorizer.lua") +time([[Config for nvim-colorizer.lua]], false) +-- Config for: telescope.nvim +time([[Config for telescope.nvim]], true) +try_loadstring("\27LJ\2\n\6\0\0\6\0+\0_6\0\0\0'\2\1\0B\0\2\0029\1\2\0B\1\1\0016\1\0\0'\3\3\0B\1\2\0029\2\4\1'\4\5\0009\5\6\0009\5\a\5B\2\3\0019\2\4\1'\4\b\0009\5\t\0B\2\3\0019\2\4\1'\4\n\0009\5\6\0009\5\t\5B\2\3\0019\2\4\1'\4\v\0009\5\6\0009\5\f\5B\2\3\0019\2\4\1'\4\r\0009\5\14\0B\2\3\0019\2\4\1'\4\15\0009\5\16\0B\2\3\0019\2\4\1'\4\17\0009\5\6\0009\5\18\5B\2\3\0019\2\4\1'\4\19\0009\5\6\0009\5\20\5B\2\3\0019\2\4\1'\4\21\0009\5\6\0009\5\22\5B\2\3\0019\2\4\1'\4\23\0009\5\6\0009\5\24\5B\2\3\0019\2\4\1'\4\25\0009\5\26\0B\2\3\0019\2\4\1'\4\27\0009\5\6\0009\5\28\5B\2\3\0019\2\4\1'\4\29\0009\5\30\0B\2\3\0019\2\4\1'\4\31\0009\5 \0B\2\3\0019\2\4\1'\4!\0009\5\"\0B\2\3\0019\2\4\1'\4#\0009\5$\0B\2\3\0019\2\4\1'\4%\0009\5\6\0009\5&\5B\2\3\0019\2\4\1'\4'\0009\5\6\0009\5(\5B\2\3\0019\2\4\1'\4)\0009\5*\0B\2\3\1K\0\1\0\fplugins\r<space>P\15treesitter\r<space>t\roldfiles\r<space>o\16edit_neovim\r<space>n\rsnippets\r<space>s\18spell_suggest\r<space>S\rreloader\r<space>p\14man_pages\r<space>m\fkeymaps\r<space>k\rquickfix\r<space>q\15git_status\r<space>c\16grep_string\r<space>e\14live_grep\r<space>r\nlines\r<space>l\fbuffers\r<space>b\14git_files\r<space>g\r<space>D\15find_files\r<space>d\14help_tags\6b\r<space>h\rnnoremap\18tms.c.keybind\nsetup\20tms.p.telescope\frequire\0", "config", "telescope.nvim") +time([[Config for telescope.nvim]], false) +-- Config for: trans.nvim +time([[Config for trans.nvim]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\a\0\f6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\1K\0\1\0002<cmd>lua require(\"trans\").translate(\"cs\")<cr>\bmtc.<cmd>lua require(\"trans\").translate()<cr>\bmtt\txmap\18tms.c.keybind\frequire\0", "config", "trans.nvim") +time([[Config for trans.nvim]], false) +-- Config for: nvim-compe +time([[Config for nvim-compe]], true) +try_loadstring("\27LJ\2\n\3\0\0\6\0\21\0'6\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\0029\1\4\0'\3\5\0'\4\6\0005\5\a\0B\1\4\0019\1\4\0'\3\b\0'\4\t\0005\5\n\0B\1\4\0019\1\v\0'\3\f\0'\4\r\0005\5\14\0B\1\4\0019\1\15\0'\3\f\0'\4\r\0005\5\16\0B\1\4\0019\1\v\0'\3\17\0'\4\18\0005\5\19\0B\1\4\0019\1\15\0'\3\17\0'\4\18\0005\5\20\0B\1\4\1K\0\1\0\1\0\1\texpr\2\1\0\1\texpr\2\27v:lua.s_tab_complete()\f<S-Tab>\1\0\1\texpr\2\tsmap\1\0\1\texpr\2\25v:lua.tab_complete()\n<Tab>\timap\1\0\2\vsilent\2\texpr\2\25compe#close(\"<c-e>\")\n<c-e>\1\0\2\vsilent\2\texpr\2\26compe#confirm(\"<cr>\")\t<cr>\rinoremap\18tms.c.keybind\nsetup\16tms.p.compe\frequire\0", "config", "nvim-compe") +time([[Config for nvim-compe]], false) +-- Config for: nvim-dap +time([[Config for nvim-dap]], true) +try_loadstring("\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14tms.p.dap\frequire\0", "config", "nvim-dap") +time([[Config for nvim-dap]], false) +-- Config for: nvim-dap-ui +time([[Config for nvim-dap-ui]], true) +try_loadstring("\27LJ\2\n:\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rsetup_ui\14tms.p.dap\frequire\0", "config", "nvim-dap-ui") +time([[Config for nvim-dap-ui]], false) +-- Config for: actions.nvim +time([[Config for actions.nvim]], true) +try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\18tms.p.actions\frequire\0", "config", "actions.nvim") +time([[Config for actions.nvim]], false) +-- Config for: nvim-spectre +time([[Config for nvim-spectre]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\b\0\f6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\5\0'\3\6\0'\4\a\0B\1\3\1K\0\1\0002<cmd>lua require(\"spectre\").open_visual()<cr>\14<leader>s\rvnoremap+<cmd>lua require(\"spectre\").open()<cr>\14<leader>S\rnnoremap\18tms.c.keybind\frequire\0", "config", "nvim-spectre") +time([[Config for nvim-spectre]], false) +-- Config for: vifm.vim +time([[Config for vifm.vim]], true) +try_loadstring("\27LJ\2\nt\0\0\2\0\5\0\r6\0\0\0009\0\1\0+\1\2\0=\1\2\0006\0\0\0009\0\1\0+\1\2\0=\1\3\0006\0\0\0009\0\1\0+\1\2\0=\1\4\0K\0\1\0\23vifm_replace_netrw\23loaded_netrwPlugin\17loaded_netrw\6g\bvim\0", "config", "vifm.vim") +time([[Config for vifm.vim]], false) +-- Config for: nvim-treesitter +time([[Config for nvim-treesitter]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\n\0\0176\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\3\0009\0\4\0'\2\5\0B\0\2\0016\0\0\0'\2\6\0B\0\2\0029\1\a\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0\24<cmd>TSHRefresh<cr>\15<leader>su\rnnoremap\18tms.c.keybindCcommand! TSHRefresh execute 'write|edit|TSBufEnable highlight'\bcmd\bvim\nsetup\21tms.p.treesitter\frequire\0", "config", "nvim-treesitter") +time([[Config for nvim-treesitter]], false) +-- Config for: gitsigns.nvim +time([[Config for gitsigns.nvim]], true) +try_loadstring("\27LJ\2\n\a\0\0\5\0\29\00096\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\0016\0\0\0'\2\3\0B\0\2\0029\1\4\0005\3\5\0'\4\6\0B\1\3\0019\1\4\0005\3\a\0'\4\b\0B\1\3\0019\1\4\0'\3\t\0'\4\n\0B\1\3\0019\1\4\0'\3\v\0'\4\f\0B\1\3\0019\1\4\0'\3\r\0'\4\14\0B\1\3\0019\1\4\0'\3\15\0'\4\16\0B\1\3\0019\1\4\0'\3\17\0'\4\18\0B\1\3\0019\1\4\0'\3\19\0'\4\20\0B\1\3\0019\1\4\0'\3\21\0'\4\22\0B\1\3\0019\1\4\0'\3\23\0'\4\24\0B\1\3\0019\1\25\0'\3\26\0'\4\27\0B\1\3\0019\1\28\0'\3\26\0'\4\27\0B\1\3\1K\0\1\0\txmap4:<C-U>lua require(\"gitsigns\").select_hunk()<cr>\aig\tomap4<cmd>lua require(\"gitsigns\").toggle_numhl()<cr>\15<leader>hn5<cmd>lua require(\"gitsigns\").toggle_linehl()<cr>\15<leader>hlA<cmd>lua require(\"gitsigns\").toggle_current_line_blame()<cr>\15<leader>hb4<cmd>lua require(\"gitsigns\").preview_hunk()<cr>\15<leader>hp4<cmd>lua require(\"gitsigns\").reset_buffer()<cr>\15<leader>hR2<cmd>lua require(\"gitsigns\").reset_hunk()<cr>\15<leader>hr7<cmd>lua require(\"gitsigns\").undo_stage_hunk()<cr>\15<leader>hu2<cmd>lua require(\"gitsigns\").stage_hunk()<cr>\15<leader>hs1<cmd>lua require(\"gitsigns\").prev_hunk()<cr>\1\3\0\0\a<c\a<[1<cmd>lua require(\"gitsigns\").next_hunk()<cr>\1\3\0\0\a>c\a>[\tnmap\18tms.c.keybind\nsetup\19tms.p.gitsigns\frequire\0", "config", "gitsigns.nvim") +time([[Config for gitsigns.nvim]], false) +-- Config for: asyncrun.vim +time([[Config for asyncrun.vim]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\a\0\f6\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\1K\0\1\0\15:AsyncRun \15<leader>rr\23<cmd>AsyncStop<cr>\15<leader>rs\rnnoremap\18tms.c.keybind\frequire\0", "config", "asyncrun.vim") +time([[Config for asyncrun.vim]], false) +-- Config for: gruvbox +time([[Config for gruvbox]], true) +try_loadstring("\27LJ\2\nc\0\0\2\0\5\0\t6\0\0\0009\0\1\0'\1\3\0=\1\2\0006\0\0\0009\0\1\0'\1\3\0=\1\4\0K\0\1\0\27gruvbox_contrast_light\thard\26gruvbox_contrast_dark\6g\bvim\0", "config", "gruvbox") +time([[Config for gruvbox]], false) +-- Config for: beacon.nvim +time([[Config for beacon.nvim]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\15\0\0246\0\0\0009\0\1\0005\1\3\0=\1\2\0006\0\4\0'\2\5\0B\0\2\0029\1\6\0'\3\a\0'\4\b\0B\1\3\0019\1\6\0'\3\t\0'\4\n\0B\1\3\0019\1\6\0'\3\v\0'\4\f\0B\1\3\0019\1\6\0'\3\r\0'\4\14\0B\1\3\1K\0\1\0\17#:Beacon<cr>\6#\17*:Beacon<cr>\6*\17N:Beacon<cr>\6N\17n:Beacon<cr>\6n\tnmap\18tms.c.keybind\frequire\1\2\0\0\tvifm\28beacon_ignore_filetypes\6g\bvim\0", "config", "beacon.nvim") +time([[Config for beacon.nvim]], false) +-- Config for: undotree +time([[Config for undotree]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\t\0\0166\0\0\0009\0\1\0)\1\2\0=\1\2\0006\0\0\0009\0\1\0)\0012\0=\1\3\0006\0\4\0'\2\5\0B\0\2\0029\1\6\0'\3\a\0'\4\b\0B\1\3\1K\0\1\0\28<cmd>UndotreeToggle<cr>\t<F5>\rnnoremap\18tms.c.keybind\frequire\24undotree_SplitWidth\26undotree_WindowLayout\6g\bvim\0", "config", "undotree") +time([[Config for undotree]], false) +-- Config for: vim-fugitive +time([[Config for vim-fugitive]], true) +try_loadstring("\27LJ\2\n\1\0\0\5\0\t\0\0166\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\5\0'\4\6\0B\1\3\0019\1\2\0'\3\a\0'\4\b\0B\1\3\1K\0\1\0\23<cmd>Git blame<cr>\15<leader>gb\22<cmd>G commit<cr>\15<leader>gc\15<cmd>G<cr>\15<leader>gg\rnnoremap\18tms.c.keybind\frequire\0", "config", "vim-fugitive") +time([[Config for vim-fugitive]], false) +-- Config for: tabular +time([[Config for tabular]], true) +try_loadstring("\27LJ\2\n\2\0\0\5\0\n\0\0286\0\0\0'\2\1\0B\0\2\0029\1\2\0'\3\3\0'\4\4\0B\1\3\0019\1\5\0'\3\3\0'\4\4\0B\1\3\0019\1\2\0'\3\6\0'\4\a\0B\1\3\0019\1\5\0'\3\6\0'\4\a\0B\1\3\0019\1\2\0'\3\b\0'\4\t\0B\1\3\0019\1\5\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0\27<cmd>Tabularize /,<cr>\15<leader>a,\30<cmd>Tabularize /:\\zs<cr>\15<leader>a:\tvmap\27<cmd>Tabularize /=<cr>\15<leader>a=\tnmap\18tms.c.keybind\frequire\0", "config", "tabular") +time([[Config for tabular]], false) +-- Config for: hiPairs +time([[Config for hiPairs]], true) +try_loadstring("\27LJ\2\n\2\0\0\2\0\b\0\0176\0\0\0009\0\1\0)\1\1\0=\1\2\0006\0\0\0009\0\1\0)\1\5\0=\1\3\0006\0\0\0009\0\1\0005\1\5\0=\1\4\0006\0\0\0009\0\1\0005\1\a\0=\1\6\0K\0\1\0\1\0\a\fctermbg\b180\fctermfg\0060\tterm\19underline,bold\nguibg\f#cc241d\nguifg\f#fbf1c7\bgui\tbold\ncterm\tbold\27hiPairs_hl_unmatchPair\1\0\a\fctermbg\b180\fctermfg\0060\tterm\19underline,bold\nguibg\f#3b4252\nguifg\f#ffff00\bgui\tbold\ncterm\tbold\25hiPairs_hl_matchPair\20hiPairs_timeout\22loaded_matchparen\6g\bvim\0", "config", "hiPairs") +time([[Config for hiPairs]], false) +-- Config for: kommentary +time([[Config for kommentary]], true) +try_loadstring("\27LJ\2\n|\0\0\4\0\5\0\b6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0005\3\4\0B\0\3\1K\0\1\0\1\0\1 prefer_single_line_comments\2\fdefault\23configure_language\22kommentary.config\frequire\0", "config", "kommentary") +time([[Config for kommentary]], false) +-- Config for: lua-dev.nvim +time([[Config for lua-dev.nvim]], true) +try_loadstring("\27LJ\2\n\v\0\0\1\0\0\0\1K\0\1\0\0", "config", "lua-dev.nvim") +time([[Config for lua-dev.nvim]], false) +-- Config for: vim-composer +time([[Config for vim-composer]], true) +try_loadstring("\27LJ\2\n7\0\0\2\0\4\0\0056\0\0\0009\0\1\0'\1\3\0=\1\2\0K\0\1\0\rcomposer\17composer_cmd\6g\bvim\0", "config", "vim-composer") +time([[Config for vim-composer]], false) +-- Config for: lexima.vim +time([[Config for lexima.vim]], true) +try_loadstring("\27LJ\2\n=\0\0\3\0\3\0\0056\0\0\0009\0\1\0'\2\2\0B\0\2\1K\0\1\0\30let b:lexima_disabled = 1\bcmd\bvim\1\1\0\5\0\n\0\r6\0\0\0009\0\1\0'\1\3\0=\1\2\0006\0\4\0'\2\5\0B\0\2\0029\0\6\0'\2\a\0005\3\b\0003\4\t\0B\0\4\1K\0\1\0\0\1\2\0\0\29FileType TelescopePrompt\20lexima_disabled\16addListener\18tms.c.autocmd\frequire\5\22lexima_map_escape\6g\bvim\0", "config", "lexima.vim") +time([[Config for lexima.vim]], false) +-- Config for: animate.vim +time([[Config for animate.vim]], true) +try_loadstring("\27LJ\2\n\5\0\0\a\0\23\00016\0\0\0009\0\1\0'\2\2\0B\0\2\0015\0\3\0006\1\4\0'\3\5\0B\1\2\0029\2\6\1'\4\a\0'\5\b\0\18\6\0\0B\2\4\0019\2\6\1'\4\t\0'\5\n\0\18\6\0\0B\2\4\0019\2\6\1'\4\v\0'\5\f\0\18\6\0\0B\2\4\0019\2\6\1'\4\r\0'\5\14\0\18\6\0\0B\2\4\0019\2\6\1'\4\15\0'\5\16\0\18\6\0\0B\2\4\0019\2\6\1'\4\17\0'\5\18\0\18\6\0\0B\2\4\0019\2\6\1'\4\19\0'\5\20\0\18\6\0\0B\2\4\0019\2\6\1'\4\21\0'\5\22\0\18\6\0\0B\2\4\1K\0\1\0,:call animate#window_delta_width(1)<cr>\14<s-right>-:call animate#window_delta_width(-1)<cr>\r<s-left>.:call animate#window_delta_height(-1)<cr>\r<s-down>-:call animate#window_delta_height(1)<cr>\v<s-up>-:call animate#window_delta_width(10)<cr>\14<c-right>.:call animate#window_delta_width(-10)<cr>\r<c-left>/:call animate#window_delta_height(-10)<cr>\r<c-down>.:call animate#window_delta_height(10)<cr>\v<c-up>\tnmap\18tms.c.keybind\frequire\1\0\1\vsilent\2#let g:animate#duration = 100.0\bcmd\bvim\0", "config", "animate.vim") +time([[Config for animate.vim]], false) +-- Config for: nvim-ts-autotag +time([[Config for nvim-ts-autotag]], true) +try_loadstring("\27LJ\2\nA\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\20nvim-ts-autotag\frequire\0", "config", "nvim-ts-autotag") +time([[Config for nvim-ts-autotag]], false) +-- Config for: vim-instant-markdown +time([[Config for vim-instant-markdown]], true) +try_loadstring("\27LJ\2\n\1\0\0\4\0\b\0\0146\0\0\0009\0\1\0)\1\0\0=\1\2\0006\0\0\0009\0\1\0006\1\4\0009\1\5\1'\3\6\0B\1\2\2'\2\a\0&\1\2\1=\1\3\0K\0\1\0\18 --new-window\fBROWSER\vgetenv\aos\29instant_markdown_browser\31instant_markdown_autostart\6g\bvim\0", "config", "vim-instant-markdown") +time([[Config for vim-instant-markdown]], false) +-- Config for: rest.nvim +time([[Config for rest.nvim]], true) +try_loadstring("\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14rest-nvim\frequire\0", "config", "rest.nvim") +time([[Config for rest.nvim]], false) +-- Config for: lsp-trouble.nvim +time([[Config for lsp-trouble.nvim]], true) +try_loadstring("\27LJ\2\n9\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\ftrouble\frequire\0", "config", "lsp-trouble.nvim") +time([[Config for lsp-trouble.nvim]], false) +-- Load plugins in order defined by `after` +time([[Sequenced loading]], true) +vim.cmd [[ packadd telescope-fzf-native.nvim ]] + +-- Config for: telescope-fzf-native.nvim +try_loadstring("\27LJ\2\nH\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\bfzf\19load_extension\14telescope\frequire\0", "config", "telescope-fzf-native.nvim") + +vim.cmd [[ packadd telescope-snippets.nvim ]] + +-- Config for: telescope-snippets.nvim +try_loadstring("\27LJ\2\n\2\0\0\5\0\n\0\0186\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\0016\0\0\0'\2\4\0B\0\2\0029\1\5\0'\3\6\0'\4\a\0B\1\3\0019\1\5\0'\3\b\0'\4\t\0B\1\3\1K\0\1\0007<cmd>lua require\"snippets\".advance_snippet(-1)<cr>\n<c-k>7<cmd>lua require\"snippets\".expand_or_advance()<cr>\n<c-j>\rinoremap\18tms.c.keybind\rsnippets\19load_extension\14telescope\frequire\0", "config", "telescope-snippets.nvim") + +vim.cmd [[ packadd telescope-dap.nvim ]] + +-- Config for: telescope-dap.nvim +try_loadstring("\27LJ\2\nH\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0'\2\3\0B\0\2\1K\0\1\0\bdap\19load_extension\14telescope\frequire\0", "config", "telescope-dap.nvim") + +vim.cmd [[ packadd colorbuddy.nvim ]] + +-- Config for: colorbuddy.nvim +try_loadstring("\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\15tms.colors\frequire\0", "config", "colorbuddy.nvim") + +time([[Sequenced loading]], false) +if should_profile then save_profiles() end + +end) + +if not no_errors then + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/plugin/plugins.vim b/plugin/plugins.vim @@ -0,0 +1,7 @@ +" command! -nargs=? PackerUpdate packadd packer.nvim | echo luaeval("require('tms.plugins').update(_A)", <q-args>) +command! PackerInstall packadd packer.nvim | lua require('tms.plugins').install() +command! PackerUpdate packadd packer.nvim | lua require('tms.plugins').update() +command! PackerSync packadd packer.nvim | lua require('tms.plugins').sync() +command! PackerClean packadd packer.nvim | lua require('tms.plugins').clean() +command! PackerCompile packadd packer.nvim | lua require('tms.plugins').compile('~/.config/nvim/plugin/packer_load.vim') +command! -nargs=+ -complete=customlist,v:lua.require'packer'.loader_complete PackerLoad | lua require('packer').loader(<q-args>) diff --git a/plugin/quickfix.lua b/plugin/quickfix.lua @@ -0,0 +1,5 @@ +local nnoremap = require('astronauta.keymap').nnoremap +nnoremap {'<leader>c', '<cmd>copen<cr>'} +nnoremap {'<leader>C', '<cmd>cexpr []|cclose<cr>'} +nnoremap {'<leader>l', '<cmd>lopen<cr>'} +nnoremap {'<leader>L', '<cmd>lexpr []|lclose<cr>'} diff --git a/plugin/tabularize.vim b/plugin/tabularize.vim @@ -0,0 +1,12 @@ +inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a + +function! s:align() + let p = '^\s*|\s.*\s|\s*$' + if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) + let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) + let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) + Tabularize/|/l1 + normal! 0 + call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) + endif +endfunction diff --git a/plugin/terminal.lua b/plugin/terminal.lua @@ -0,0 +1,28 @@ +local ok, terminal = pcall(require, 'tms.p.terminal') +if not ok then + return +end + +local keymap = require('astronauta.keymap') +local nnoremap = keymap.nnoremap +local tnoremap = keymap.tnoremap +nnoremap {'<leader>tl', function() terminal.interactive() end} +nnoremap {'<leader>tL', function() terminal.catchup() end} +nnoremap {'<leader>to', function() terminal.toggle() end} +nnoremap {'<leader>tj', ':TerminalRun<space>'} +nnoremap {'<leader>tk', function() terminal.rerun() end} +nnoremap {'<leader>th', function() terminal.exit() end} +tnoremap {'<leader>tn', '<C-\\><C-n>'} +tnoremap {'<leader>tl', function() terminal.interactive() end} +tnoremap {'<leader>to', function() terminal.toggle() end} +tnoremap {'<leader>th', function() terminal.exit() end} + +local au = require('tms.c.autocmd') +au.addListeners({ + ['user-terminal'] = { + [[BufEnter terminal let g:SexyScroller_ScrollTime=0|let g:SexyScroller_CursorTime=0]], + [[BufLeave terminal let g:SexyScroller_ScrollTime=10|let g:SexyScroller_CursorTime=5]], + }, +}) + +vim.cmd [[command! -nargs=1 TerminalRun lua require('tms.p.terminal').run('<args>')]] diff --git a/plugin/trun.lua b/plugin/trun.lua @@ -0,0 +1,6 @@ +vim.cmd [[ +fun! TrunComplete(A,L,P) + return luaeval('require("tms.p.trun").trun_complete()') +endfun +]] +vim.cmd [[command! -nargs=1 -complete=customlist,TrunComplete Trunqf lua require('tms.p.trun').to_quickfix("<args>")]] diff --git a/plugin/unimpaired.lua b/plugin/unimpaired.lua @@ -0,0 +1,47 @@ +local nmap = require('astronauta.keymap').nmap + +-- remap ] and [ +nmap {'>q', ']q'} +nmap {'>!', ']q'} +nmap {'<!', '[q'} +nmap {'<q', '[q'} +nmap {'>Q', ']Q'} +nmap {'<Q', '[Q'} +nmap {'>a', ']a'} +nmap {'<a', '[a'} +nmap {'>A', ']A'} +nmap {'<A', '[A'} +nmap {'>b', ']b'} +nmap {'<b', '[b'} +nmap {'>B', ']B'} +nmap {'<B', '[B'} +nmap {'>l', ']l'} +nmap {'>=', ']l'} +nmap {'<l', '[l'} +nmap {'<=', '[l'} +nmap {'>L', ']L'} +nmap {'<L', '[L'} +nmap {'>t', ']t'} +nmap {'<t', '[t'} +nmap {'>T', ']T'} +nmap {'<T', '[T'} +nmap {'>s', ']s'} +nmap {'<s', '[s'} +nmap {'>S', ']S'} +nmap {'<S', '[S'} +nmap {'>f', ']f'} +nmap {'<f', '[f'} +nmap {'>e', ']e'} +nmap {'<e', '[e'} +nmap {'>x', ']x'} +nmap {'>x', ']x'} +nmap {'<x', '[x'} +nmap {'<x', '[x'} +nmap {'>u', ']u'} +nmap {'>u', ']u'} +nmap {'<u', '[u'} +nmap {'<u', '[u'} +nmap {'>y', ']y'} +nmap {'>y', ']y'} +nmap {'<y', '[y'} +nmap {'<y', '[y'} diff --git a/spell/cs.utf-8.add b/spell/cs.utf-8.add @@ -0,0 +1,7 @@ +#pozorneni +#pozorneni/! +#pozorneni +#pozorneni/! +#pozorneni +#pozorneni/! +Ňemi diff --git a/spell/cs.utf-8.add.spl b/spell/cs.utf-8.add.spl Binary files differ. diff --git a/spell/cs.utf-8.spl b/spell/cs.utf-8.spl Binary files differ. diff --git a/spell/csa.ascii.add b/spell/csa.ascii.add @@ -0,0 +1,6 @@ +#emi +#emi +Ňemi +Ňemi +Ňemi +Ňemi diff --git a/spell/csa.ascii.add.spl b/spell/csa.ascii.add.spl Binary files differ. diff --git a/syntax/latte.vim b/syntax/latte.vim @@ -0,0 +1,127 @@ +" Vim syntax file +" Language: Latte Templates +" Maintainer: Martin Janiczek <martin@janiczek.cz> +" Latest Revision: 11 March 2012 +" URL: http://forum.nette.org/cs/10222-latte-vim-syntax-highlighter +" URL: https://github.com/janiczek/vim-latte + +" ============================================================ +" ================================ INCLUDES AND WHATNOT ====== +" ============================================================ + +" check if we loaded this file before +if exists('b:current_syntax') && b:current_syntax == 'latte' + finish +endif + +" we want to highlight PHP, HTML, CSS, JS +runtime! syntax/php.vim + +" ============================================================ +" ========================================= DEFINITIONS ====== +" ============================================================ + +" TODO: should we recognize things like => , : or not? +" TODO: more specifically, should we allow only the macros +" that really are in Latte? like: +" {link Presenter:action} <-- good +" {link} <-- bad +" TODO: is this style (#blocks same color as $phpVars) ok? +" (n:attrs different color than attrs) +" TODO: macros inside <a> links + +" ------------------------------------------------------------ +" ------------------------------------------- n:attribs ------ +" ------------------------------------------------------------ + +" Commented out because it breaks highlighting of inline CSS and JS. +" TODO? + +"" n:attrib: <tag n:foo="$bar"> +"syn match latteAttribute contained /n:[a-zA-Z]\+\>/ + +"" for attributes: +"syn region htmlTag start=+<[^/]+ end=+>+ +" \ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster,latteAttribute + +" ------------------------------------------------------------ +" ---------------------------------------------- macros ------ +" ------------------------------------------------------------ + +" macro: {a macro} +syn region latteMacro start="{\S" end="}" + \ contains=latteBlockName,latteString,latteVariable + +" block name: #blockName +syn match latteBlockName /#[$_a-zA-Z0-9]\+\>/ contained + +" string: 'abcdę' +syn region latteString start=+'+ end=+'+ contained + \ contains=latteVariable + +syn region latteString start=+"+ end=+"+ contained + \ contains=latteVariable + +" ------------------------------------------------------------ +" -------------------------------------------- comments ------ +" ------------------------------------------------------------ + +" comments: {* a basic comment *} +syn region latteComment start="{\*" end="\*}" + \ contains=latteTodo + +" todo: {* TODO something *} +syn keyword latteTodo contained TODO FIXME XXX + +" ------------------------------------------------------------ +" ----------------------------------------- annotations ------ +" ------------------------------------------------------------ + +" annotation comments: {** an @annotation comment *} +syn region latteAnnotationComment start="{\*\*" end="\*}" + \ contains=latteTodo,latteAnnotation,latteVariable,latteType + +" annotation: @param +syn match latteAnnotation /@[$_a-zA-Z][$_a-zA-Z0-9]*\>/ contained + +" variable: $myVar +syn match latteVariable /$[_a-zA-Z][_a-zA-Z0-9]*\>/ contained + +" type: string +syn keyword latteType contained boolean integer float double + \ string array object resource NULL + +" ------------------------------------------------------------ +" ---------------------------------------- HTML strings ------ +" ------------------------------------------------------------ +" (so we can highlight things inside them too ;) ) + +" for values: +syn region htmlString contained start=+"+ end=+"+ + \ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,latteMacro,latteVariable + +syn region htmlString contained start=+'+ end=+'+ + \ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,latteMacro,latteVariable + +" ============================================================ +" =========================================== WIRING ;) ====== +" ============================================================ + +" finally, use the definitions! + +"hi def link latteAttribute Type + +hi def link latteMacro PreProc +hi def link latteBlockName Identifier +hi def link latteString String + +hi def link latteComment Comment +hi def link latteTodo Todo + +hi def link latteAnnotationComment Comment +hi def link latteAnnotation PreProc +hi def link latteVariable Identifier +hi def link latteType Type + +" prevent the file from loading again (see top) +let b:current_syntax = 'latte' diff --git a/syntax/neomuttrc.vim b/syntax/neomuttrc.vim @@ -0,0 +1,861 @@ +" Vim syntax file +" Language: NeoMutt setup files +" Maintainer: Richard Russon <rich@flatcap.org> +" Previous Maintainer: Guillaume Brogi <gui-gui@netcourrier.com> +" Last Change: 2020-06-21 +" Original version based on syntax/muttrc.vim + +" This file covers NeoMutt 2020-06-19 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" Set the keyword characters +setlocal isk=@,48-57,_,- + +" handling optional variables +syntax match muttrcComment "^# .*$" contains=@Spell +syntax match muttrcComment "^#[^ ].*$" +syntax match muttrcComment "^#$" +syntax match muttrcComment "[^\\]#.*$"lc=1 + +" Escape sequences (back-tick and pipe goes here too) +syntax match muttrcEscape +\\[#tnr"'Cc ]+ +syntax match muttrcEscape +[`|]+ +syntax match muttrcEscape +\\$+ + +" The variables takes the following arguments +syntax region muttrcString contained keepend start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcCommand,muttrcAction,muttrcShellString +syntax region muttrcString contained keepend start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcCommand,muttrcAction +syntax match muttrcStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcString,muttrcStringNL + +syntax region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand + +syntax match muttrcRXChars contained /[^\\][][.*?+]\+/hs=s+1 +syntax match muttrcRXChars contained /[][|()][.*?+]*/ +syntax match muttrcRXChars contained /['"]^/ms=s+1 +syntax match muttrcRXChars contained /$['"]/me=e-1 +syntax match muttrcRXChars contained /\\/ +" Why does muttrcRXString2 work with one \ when muttrcRXString requires two? +syntax region muttrcRXString contained skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars +syntax region muttrcRXString contained skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXChars +syntax region muttrcRXString contained skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXChars +" For some reason, skip refuses to match backslashes here... +syntax region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXChars +syntax region muttrcRXString contained matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXChars +syntax region muttrcRXString2 contained skipwhite start=+'+ skip=+\'+ end=+'+ contains=muttrcRXChars +syntax region muttrcRXString2 contained skipwhite start=+"+ skip=+\"+ end=+"+ contains=muttrcRXChars + +" these must be kept synchronized with muttrcRXString, but are intended for muttrcRXHooks +syntax region muttrcRXHookString contained keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syntax region muttrcRXHookString contained keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syntax region muttrcRXHookString contained keepend skipwhite start=+[^ "'^]+ skip=+\\\s+ end=+\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syntax region muttrcRXHookString contained keepend skipwhite start=+\^+ end=+[^\\]\s+re=e-1 contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syntax region muttrcRXHookString contained keepend matchgroup=muttrcRXChars skipwhite start=+\^+ end=+$\s+ contains=muttrcRXString nextgroup=muttrcString,muttrcStringNL +syntax match muttrcRXHookStringNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcRXHookString,muttrcRXHookStringNL + +" these are exclusively for args lists (e.g. -rx pat pat pat ...) +syntax region muttrcRXPat contained keepend skipwhite start=+'+ skip=+\\'+ end=+'\s*+ contains=muttrcRXString nextgroup=muttrcRXPat +syntax region muttrcRXPat contained keepend skipwhite start=+"+ skip=+\\"+ end=+"\s*+ contains=muttrcRXString nextgroup=muttrcRXPat +syntax match muttrcRXPat contained /[^-'"#!]\S\+/ skipwhite contains=muttrcRXChars nextgroup=muttrcRXPat +syntax match muttrcRXDef contained "-rx\s\+" skipwhite nextgroup=muttrcRXPat + +syntax match muttrcSpecial +\(['"]\)!\1+ + +syntax match muttrcSetStrAssignment contained skipwhite /=\s*\%(\\\?\$\)\?[0-9A-Za-z_-]\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*"+hs=s+1 end=+"+ skip=+\\"+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString +syntax region muttrcSetStrAssignment contained skipwhite keepend start=+=\s*'+hs=s+1 end=+'+ skip=+\\'+ nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcString +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*"\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetBoolAssignment contained skipwhite /=\s*'\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*\%(ask-\)\?\%(yes\|no\)/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*"\%(ask-\)\?\%(yes\|no\)"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetQuadAssignment contained skipwhite /=\s*'\%(ask-\)\?\%(yes\|no\)'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetNumAssignment contained skipwhite /=\s*\\\?\$\w\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr contains=muttrcVariable,muttrcEscapedVariable +syntax match muttrcSetNumAssignment contained skipwhite /=\s*\d\+/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetNumAssignment contained skipwhite /=\s*"\d\+"/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax match muttrcSetNumAssignment contained skipwhite /=\s*'\d\+'/hs=s+1 nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" Now catch some email addresses and headers (purified version from mail.vim) +syntax match muttrcEmail "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+" +syntax match muttrcHeader "\<\c\%(From\|To\|C[Cc]\|B[Cc][Cc]\|Reply-To\|Subject\|Return-Path\|Received\|Date\|Replied\|Attach\)\>:\=" + +syntax match muttrcKeySpecial contained +\%(\\[Cc'"]\|\^\|\\[01]\d\{2}\)+ +syntax match muttrcKey contained "\S\+" contains=muttrcKeySpecial,muttrcKeyName +syntax region muttrcKey contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=muttrcKeySpecial,muttrcKeyName +syntax region muttrcKey contained start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=muttrcKeySpecial,muttrcKeyName +syntax match muttrcKeyName contained "\\[trne]" +syntax match muttrcKeyName contained "\c<\%(BackSpace\|BackTab\|Delete\|Down\|End\|Enter\|Esc\|Home\|Insert\|Left\|Next\|PageDown\|PageUp\|Return\|Right\|Space\|Tab\|Up\)>" +syntax match muttrcKeyName contained "\c<F\d\+>" + +syntax match muttrcFormatErrors contained /%./ + +syntax match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVvWwXxYyZz+%]/ +syntax match muttrcStrftimeEscapes contained /%E[cCxXyY]/ +syntax match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/ + +syntax region muttrcAliasFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcAliasFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcAliasFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcAliasFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcAttachFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcAttachFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcComposeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcComposeFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcComposeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcComposeFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcFolderFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcFolderFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcGroupIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcGroupIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcGroupIndexFormatEscapes,muttrcGroupIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcIndexFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcIndexFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcMixFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcMixFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPCmdFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcPGPFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcQueryFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcQueryFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcQueryFormatEscapes,muttrcQueryFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSidebarFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSidebarFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSidebarFormatEscapes,muttrcSidebarFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSmimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcSmimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStatusFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStatusFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStrftimeFormatStr contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax region muttrcStrftimeFormatStr contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStrftimeEscapes,muttrcFormatErrors nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" Format escapes and conditionals +syntax match muttrcFormatConditionals2 contained /[^?]*?/ +function! s:escapesConditionals(baseName, sequence, padding, conditional) + exec 'syntax match muttrc' . a:baseName . 'Escapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?\%(' . a:sequence . '\|%\)/' + if a:padding + exec 'syntax match muttrc' . a:baseName . 'Escapes contained /%[>|*]./' + endif + if a:conditional + exec 'syntax match muttrc' . a:baseName . 'Conditionals contained /%?\%(' . a:sequence . '\)?/ nextgroup=muttrcFormatConditionals2' + else + exec 'syntax match muttrc' . a:baseName . 'Conditionals contained /%?\%(' . a:sequence . '\)?/' + endif +endfunction + +" CHECKED 2020-06-21 +" Ref: alias_format_str() in alias/dlgalias.c +call s:escapesConditionals('AliasFormat', '[acfnrt]', 1, 0) +" Ref: attach_format_str() in recvattach.c +call s:escapesConditionals('AttachFormat', '[CcDdeFfIMmnQsTtuX]', 1, 1) +" Ref: compose_format_str() in compose.c +call s:escapesConditionals('ComposeFormat', '[ahlv]', 1, 1) +" Ref: folder_format_str() in browser.c +call s:escapesConditionals('FolderFormat', '[CDdFfgilmNnstu]', 1, 0) +" Ref: group_index_format_str() in browser.c +call s:escapesConditionals('GroupIndexFormat', '[CdfMNns]', 1, 1) +" Ref: index_format_str() in hdrline.c +call s:escapesConditionals('IndexFormat', '[AaBbCDdEefgHIiJKLlMmNnOPqRrSsTtuvWXxYyZ(<[{]\|@\i\+@\|G[a-zA-Z]\+\|Fp\=\|z[cst]\|cr\=', 1, 1) +" Ref: mix_format_str() in remailer.c +call s:escapesConditionals('MixFormat', '[acns]', 1, 0) +" Ref: pgp_command_format_str() in ncrypt/pgpinvoke.c +call s:escapesConditionals('PGPCmdFormat', '[afprs]', 0, 1) +" Ref: crypt_format_str() in ncrypt/crypt_gpgme.c +" Ref: pgp_entry_format_str() in ncrypt/pgpkey.c +" Note: crypt_format_str() supports 'p', but pgp_entry_fmt() does not +call s:escapesConditionals('PGPFormat', '[AaCcFfKkLlnptu[]', 0, 0) +" Ref: query_format_str() in alias/dlgquery.c +call s:escapesConditionals('QueryFormat', '[acent]', 1, 1) +" Ref: sidebar_format_str() in sidebar.c +call s:escapesConditionals('SidebarFormat', '[!BDdFLNnorStZ]', 1, 1) +" Ref: smime_command_format_str() in ncrypt/smime.c +call s:escapesConditionals('SmimeFormat', '[aCcdfiks]', 0, 1) +" Ref: status_format_str() in status.c +call s:escapesConditionals('StatusFormat', '[bDdFfhLlMmnoPpRrSstuVv]', 1, 1) + +syntax region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes +syntax region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes + +syntax match muttrcVarEqualsAliasFmt contained skipwhite "=" nextgroup=muttrcAliasFormatStr +syntax match muttrcVarEqualsAttachFmt contained skipwhite "=" nextgroup=muttrcAttachFormatStr +syntax match muttrcVarEqualsComposeFmt contained skipwhite "=" nextgroup=muttrcComposeFormatStr +syntax match muttrcVarEqualsFolderFmt contained skipwhite "=" nextgroup=muttrcFolderFormatStr +syntax match muttrcVarEqualsGrpIdxFmt contained skipwhite "=" nextgroup=muttrcGroupIndexFormatStr +syntax match muttrcVarEqualsIdxFmt contained skipwhite "=" nextgroup=muttrcIndexFormatStr +syntax match muttrcVarEqualsMixFmt contained skipwhite "=" nextgroup=muttrcMixFormatStr +syntax match muttrcVarEqualsPGPCmdFmt contained skipwhite "=" nextgroup=muttrcPGPCmdFormatStr +syntax match muttrcVarEqualsPGPFmt contained skipwhite "=" nextgroup=muttrcPGPFormatStr +syntax match muttrcVarEqualsQueryFmt contained skipwhite "=" nextgroup=muttrcQueryFormatStr +syntax match muttrcVarEqualsSdbFmt contained skipwhite "=" nextgroup=muttrcSidebarFormatStr +syntax match muttrcVarEqualsSmimeFmt contained skipwhite "=" nextgroup=muttrcSmimeFormatStr +syntax match muttrcVarEqualsStatusFmt contained skipwhite "=" nextgroup=muttrcStatusFormatStr +syntax match muttrcVarEqualsStrftimeFmt contained skipwhite "=" nextgroup=muttrcStrftimeFormatStr + +syntax match muttrcVPrefix contained /[?&]/ nextgroup=muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" CHECKED 2020-06-21 +" List of the different screens in mutt (see Menus in keymap.c) +syntax keyword muttrcMenu contained alias attach browser compose editor generic index key_select_pgp key_select_smime mix pager pgp postpone query smime +syntax match muttrcMenuList "\S\+" contained contains=muttrcMenu +syntax match muttrcMenuCommas /,/ contained + +syntax region muttrcSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL +syntax region muttrcSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern nextgroup=muttrcString,muttrcStringNL + +syntax region muttrcNoSpamPattern contained skipwhite keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPattern +syntax region muttrcNoSpamPattern contained skipwhite keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPattern + +syntax match muttrcAttachmentsMimeType contained "[*a-z0-9_-]\+/[*a-z0-9._-]\+\s*" skipwhite nextgroup=muttrcAttachmentsMimeType +syntax match muttrcAttachmentsFlag contained "[+-]\%([AI]\|inline\|attachment\)\s\+" skipwhite nextgroup=muttrcAttachmentsMimeType +syntax match muttrcAttachmentsLine "^\s*\%(un\)\?attachments\s\+" skipwhite nextgroup=muttrcAttachmentsFlag + +syntax match muttrcUnHighlightSpace contained "\%(\s\+\|\\$\)" + +syntax keyword muttrcAsterisk contained * + +syntax keyword muttrcListsKeyword lists skipwhite nextgroup=muttrcGroupDef,muttrcComment +syntax keyword muttrcListsKeyword unlists skipwhite nextgroup=muttrcAsterisk,muttrcComment + +syntax keyword muttrcSubscribeKeyword subscribe skipwhite nextgroup=muttrcGroupDef,muttrcComment +syntax keyword muttrcSubscribeKeyword unsubscribe skipwhite nextgroup=muttrcAsterisk,muttrcComment + +syntax keyword muttrcAlternateKeyword contained alternates unalternates +syntax region muttrcAlternatesLine keepend start=+^\s*\%(un\)\?alternates\s+ skip=+\\$+ end=+$+ contains=muttrcAlternateKeyword,muttrcGroupDef,muttrcRXPat,muttrcUnHighlightSpace,muttrcComment + +" muttrcVariable includes a prefix because partial strings are considered valid. +syntax match muttrcVariable contained "\\\@<![a-zA-Z_-]*\$[a-zA-Z_-]\+" contains=muttrcVariableInner +syntax match muttrcVariableInner contained "\$[a-zA-Z_-]\+" +syntax match muttrcEscapedVariable contained "\\\$[a-zA-Z_-]\+" + +syntax match muttrcBadAction contained "[^<>]\+" contains=muttrcEmail +syntax match muttrcAction contained "<[^>]\{-}>" contains=muttrcBadAction,muttrcFunction,muttrcKeyName + +" CHECKED 2020-06-21 +" First, functions that take regular expressions: +syntax match muttrcRXHookNot contained /!\s*/ skipwhite nextgroup=muttrcRXHookString,muttrcRXHookStringNL +syntax match muttrcRXHooks /\<\%(account\|append\|close\|crypt\|folder\|mbox\|open\|pgp\)-hook\>/ skipwhite nextgroup=muttrcRXHookNot,muttrcRXHookString,muttrcRXHookStringNL + +" Now, functions that take patterns +syntax match muttrcPatHookNot contained /!\s*/ skipwhite nextgroup=muttrcPattern +syntax match muttrcPatHooks /\<\%(charset\|iconv\|index-format\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcPattern +syntax match muttrcPatHooks /\<\%(message\|reply\|send\|send2\|save\|fcc\|fcc-save\)-hook\>/ skipwhite nextgroup=muttrcPatHookNot,muttrcOptPattern + +" Global hooks that take a command +syntax keyword muttrcHooks skipwhite shutdown-hook startup-hook timeout-hook nextgroup=muttrcCommand + +syntax match muttrcBindFunction contained /\S\+\>/ skipwhite contains=muttrcFunction +syntax match muttrcBindFunctionNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindFunction,muttrcBindFunctionNL +syntax match muttrcBindKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcBindFunction,muttrcBindFunctionNL +syntax match muttrcBindKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindKey,muttrcBindKeyNL +syntax match muttrcBindMenuList contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcBindKey,muttrcBindKeyNL +syntax match muttrcBindMenuListNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcBindMenuList,muttrcBindMenuListNL + +syntax region muttrcMacroDescr contained keepend skipwhite start=+\s*\S+ms=e skip=+\\ + end=+ \|$+me=s +syntax region muttrcMacroDescr contained keepend skipwhite start=+'+ms=e skip=+\\'+ end=+'+me=s +syntax region muttrcMacroDescr contained keepend skipwhite start=+"+ms=e skip=+\\"+ end=+"+me=s +syntax match muttrcMacroDescrNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syntax region muttrcMacroBody contained skipwhite start="\S" skip='\\ \|\\$' end=' \|$' contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syntax region muttrcMacroBody matchgroup=Type contained skipwhite start=+'+ms=e skip=+\\'+ end=+'\|\%(\%(\\\\\)\@<!$\)+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcSpam,muttrcNoSpam,muttrcCommand,muttrcAction,muttrcVariable nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syntax region muttrcMacroBody matchgroup=Type contained skipwhite start=+"+ms=e skip=+\\"+ end=+"\|\%(\%(\\\\\)\@<!$\)+me=s contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcSpam,muttrcNoSpam,muttrcCommand,muttrcAction,muttrcVariable nextgroup=muttrcMacroDescr,muttrcMacroDescrNL +syntax match muttrcMacroBodyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroBody,muttrcMacroBodyNL +syntax match muttrcMacroKey contained /\S\+/ skipwhite contains=muttrcKey nextgroup=muttrcMacroBody,muttrcMacroBodyNL +syntax match muttrcMacroKeyNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroKey,muttrcMacroKeyNL +syntax match muttrcMacroMenuList contained /\S\+/ skipwhite contains=muttrcMenu,muttrcMenuCommas nextgroup=muttrcMacroKey,muttrcMacroKeyNL +syntax match muttrcMacroMenuListNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL + +syntax match muttrcAddrContent contained "[a-zA-Z0-9._-]\+@[a-zA-Z0-9./-]\+\s*" skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent +syntax region muttrcAddrContent contained start=+'+ end=+'\s*+ skip=+\\'+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent +syntax region muttrcAddrContent contained start=+"+ end=+"\s*+ skip=+\\"+ skipwhite contains=muttrcEmail nextgroup=muttrcAddrContent +syntax match muttrcAddrDef contained "-addr\s\+" skipwhite nextgroup=muttrcAddrContent + +syntax match muttrcGroupFlag contained "-group" +syntax region muttrcGroupDef contained start="-group\s\+" skip="\\$" end="\s" skipwhite keepend contains=muttrcGroupFlag,muttrcUnHighlightSpace + +syntax keyword muttrcGroupKeyword contained group ungroup +syntax region muttrcGroupLine keepend start=+^\s*\%(un\)\?group\s+ skip=+\\$+ end=+$+ contains=muttrcGroupKeyword,muttrcGroupDef,muttrcAddrDef,muttrcRXDef,muttrcUnHighlightSpace,muttrcComment + +syntax match muttrcAliasGroupName contained /\w\+/ skipwhite nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL +syntax match muttrcAliasGroupDefNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL +syntax match muttrcAliasGroupDef contained /\s*-group/ skipwhite nextgroup=muttrcAliasGroupName,muttrcAliasGroupDefNL contains=muttrcGroupFlag +syntax match muttrcAliasComma contained /,/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL +syntax match muttrcAliasEmail contained /\S\+@\S\+/ contains=muttrcEmail nextgroup=muttrcAliasName,muttrcAliasNameNL skipwhite +syntax match muttrcAliasEncEmail contained /<[^>]\+>/ contains=muttrcEmail nextgroup=muttrcAliasComma +syntax match muttrcAliasEncEmailNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL +syntax match muttrcAliasNameNoParens contained /[^<(@]\+\s\+/ nextgroup=muttrcAliasEncEmail,muttrcAliasEncEmailNL +syntax region muttrcAliasName contained matchgroup=Type start=/(/ end=/)/ skipwhite +syntax match muttrcAliasNameNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasName,muttrcAliasNameNL +syntax match muttrcAliasENNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL +syntax match muttrcAliasKey contained /\s*[^- \t]\S\+/ skipwhite nextgroup=muttrcAliasEmail,muttrcAliasEncEmail,muttrcAliasNameNoParens,muttrcAliasENNL +syntax match muttrcAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL + +syntax match muttrcUnAliasKey contained "\s*\w\+\s*" skipwhite nextgroup=muttrcUnAliasKey,muttrcUnAliasNL +syntax match muttrcUnAliasNL contained /\s*\\$/ skipwhite skipnl nextgroup=muttrcUnAliasKey,muttrcUnAliasNL + +" CHECKED 2020-06-21 +" List of letters in Flags in pattern.c +" Parameter: none +syntax match muttrcSimplePat contained "!\?\^\?[~][ADEFGgklNOPpQRSTuUvV#$=]" +" Parameter: range +syntax match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s*\%([<>-][0-9]\+[kM]\?\|[0-9]\+[kM]\?[-]\%([0-9]\+[kM]\?\)\?\)" +" Parameter: date +syntax match muttrcSimplePat contained "!\?\^\?[~][dr]\s*\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\|\%(`[^`]\+`\)\|\%(\$[a-zA-Z0-9_-]\+\)\)" contains=muttrcShellString,muttrcVariable +" Parameter: regex +syntax match muttrcSimplePat contained "!\?\^\?[~][BbCcefHhIiLMstwxYy]\s*" nextgroup=muttrcSimplePatRXContainer +" Parameter: pattern +syntax match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString +" Parameter: pattern +syntax match muttrcSimplePat contained "!\?\^\?[=][bcCefhHiLstxy]\s*" nextgroup=muttrcSimplePatString +syntax region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat + +"syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXString +syntax region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+ +syntax region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+ +syntax region muttrcSimplePatString contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 +syntax region muttrcSimplePatRXContainer contained keepend start=+"+ end=+"+ skip=+\\"+ contains=muttrcRXString +syntax region muttrcSimplePatRXContainer contained keepend start=+'+ end=+'+ skip=+\\'+ contains=muttrcRXString +syntax region muttrcSimplePatRXContainer contained keepend start=+[^ "']+ skip=+\\ + end=+\s+re=e-1 contains=muttrcRXString +syntax match muttrcSimplePatMetas contained /[(|)]/ + +syntax match muttrcOptSimplePat contained skipwhite /[~=%!(^].*/ contains=muttrcSimplePat,muttrcSimplePatMetas +syntax match muttrcOptSimplePat contained skipwhite /[^~=%!(^].*/ contains=muttrcRXString +syntax region muttrcOptPattern contained matchgroup=Type keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL +syntax region muttrcOptPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcOptSimplePat,muttrcUnHighlightSpace nextgroup=muttrcString,muttrcStringNL +syntax region muttrcOptPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL +syntax match muttrcOptPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat nextgroup=muttrcString,muttrcStringNL +syntax match muttrcOptPattern contained skipwhite /[.]/ nextgroup=muttrcString,muttrcStringNL +" Keep muttrcPattern and muttrcOptPattern synchronized +syntax region muttrcPattern contained matchgroup=Type keepend skipwhite start=+"+ skip=+\\"+ end=+"+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas +syntax region muttrcPattern contained matchgroup=Type keepend skipwhite start=+'+ skip=+\\'+ end=+'+ contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas +syntax region muttrcPattern contained keepend skipwhite start=+[~](+ end=+)+ skip=+\\)+ contains=muttrcSimplePat +syntax match muttrcPattern contained skipwhite /[~][A-Za-z]/ contains=muttrcSimplePat +syntax match muttrcPattern contained skipwhite /[.]/ +syntax region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas +syntax region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas + +" Colour definitions takes object, foreground and background arguments (regexps excluded). +syntax match muttrcColorMatchCount contained "[0-9]\+" +syntax match muttrcColorMatchCountNL contained skipwhite skipnl "\s*\\$" nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL +syntax region muttrcColorRXPat contained start=+\s*'+ skip=+\\'+ end=+'\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL +syntax region muttrcColorRXPat contained start=+\s*"+ skip=+\\"+ end=+"\s*+ keepend skipwhite contains=muttrcRXString2 nextgroup=muttrcColorMatchCount,muttrcColorMatchCountNL +syntax keyword muttrcColor contained black blue cyan default green magenta red white yellow +syntax keyword muttrcColor contained brightblack brightblue brightcyan brightdefault brightgreen brightmagenta brightred brightwhite brightyellow +syntax match muttrcColor contained "\<\%(bright\)\=color\d\{1,3}\>" +" Now for the structure of the color line +syntax match muttrcColorRXNL contained skipnl "\s*\\$" nextgroup=muttrcColorRXPat,muttrcColorRXNL +syntax match muttrcColorBG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorRXPat,muttrcColorRXNL +syntax match muttrcColorBGNL contained skipnl "\s*\\$" nextgroup=muttrcColorBG,muttrcColorBGNL +syntax match muttrcColorFG contained /\s*[$]\?\w\+/ contains=muttrcColor,muttrcVariable,muttrcUnHighlightSpace nextgroup=muttrcColorBG,muttrcColorBGNL +syntax match muttrcColorFGNL contained skipnl "\s*\\$" nextgroup=muttrcColorFG,muttrcColorFGNL +syntax match muttrcColorContext contained /\s*[$]\?\w\+/ contains=muttrcColorField,muttrcVariable,muttrcUnHighlightSpace,muttrcColorCompose nextgroup=muttrcColorFG,muttrcColorFGNL +syntax match muttrcColorNL contained skipnl "\s*\\$" nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose +syntax match muttrcColorKeyword contained /^\s*color\s\+/ nextgroup=muttrcColorContext,muttrcColorNL,muttrcColorCompose +" And now color's brother: +syntax region muttrcUnColorPatterns contained skipwhite start=+\s*'+ end=+'+ skip=+\\'+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syntax region muttrcUnColorPatterns contained skipwhite start=+\s*"+ end=+"+ skip=+\\"+ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syntax match muttrcUnColorPatterns contained skipwhite /\s*[^'"\s]\S\*/ contains=muttrcPattern nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syntax match muttrcUnColorPatNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorPatNL +syntax match muttrcUnColorAll contained skipwhite /[*]/ +syntax match muttrcUnColorAPNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL +syntax match muttrcUnColorIndex contained skipwhite /\s*index\s\+/ nextgroup=muttrcUnColorPatterns,muttrcUnColorAll,muttrcUnColorAPNL +syntax match muttrcUnColorIndexNL contained skipwhite skipnl /\s*\\$/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL +syntax match muttrcUnColorKeyword contained skipwhite /^\s*uncolor\s\+/ nextgroup=muttrcUnColorIndex,muttrcUnColorIndexNL +syntax region muttrcUnColorLine keepend start=+^\s*uncolor\s+ skip=+\\$+ end=+$+ contains=muttrcUnColorKeyword,muttrcComment,muttrcUnHighlightSpace + +syntax keyword muttrcMonoAttrib contained bold none normal reverse standout underline +syntax keyword muttrcMono contained mono skipwhite nextgroup=muttrcColorField,muttrcColorCompose +syntax match muttrcMonoLine "^\s*mono\s\+\S\+" skipwhite nextgroup=muttrcMonoAttrib contains=muttrcMono + +" CHECKED 2020-06-21 +" List of fields in Fields in color.c +syntax keyword muttrcColorField skipwhite contained + \ attachment attach_headers body bold error hdrdefault header index index_author + \ index_collapsed index_date index_flags index_label index_number index_size index_subject + \ index_tag index_tags indicator markers message normal options progress prompt quoted + \ search sidebar_divider sidebar_flagged sidebar_highlight sidebar_indicator sidebar_new + \ sidebar_ordinary sidebar_spoolfile sidebar_unread signature status tilde tree underline + \ warning nextgroup=muttrcColor + +syntax match muttrcColorField contained "\<quoted\d\=\>" + +syntax match muttrcColorCompose skipwhite contained /\s*compose\s*/ nextgroup=muttrcColorComposeField + +" CHECKED 2020-06-21 +" List of fields in ComposeFields in color.c +syntax keyword muttrcColorComposeField skipwhite contained + \ header security_both security_encrypt security_none security_sign + \ nextgroup=muttrcColorFG,muttrcColorFGNL +syntax region muttrcColorLine keepend start=/^\s*color\s\+/ skip=+\\$+ end=+$+ contains=muttrcColorKeyword,muttrcComment,muttrcUnHighlightSpace + +function! s:boolQuadGen(type, vars, deprecated) + let l:novars = copy(a:vars) + call map(l:novars, '"no" . v:val') + let l:invvars = copy(a:vars) + call map(l:invvars, '"inv" . v:val') + + let l:orig_type = copy(a:type) + if a:deprecated + let l:type = 'Deprecated' . a:type + exec 'syntax keyword muttrcVar' . l:type . ' ' . join(a:vars) + exec 'syntax keyword muttrcVar' . l:type . ' ' . join(l:novars) + exec 'syntax keyword muttrcVar' . l:type . ' ' . join(l:invvars) + else + let l:type = a:type + exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(a:vars) . ' nextgroup=muttrcSet' . l:orig_type . 'Assignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr' + exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:novars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr' + exec 'syntax keyword muttrcVar' . l:type . ' skipwhite contained ' . join(l:invvars) . ' nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr' + endif + +endfunction + +" CHECKED 2020-06-21 +" List of DT_BOOL in MuttVars in mutt_config.c +call s:boolQuadGen('Bool', [ + \ 'abort_backspace', 'allow_8bit', 'allow_ansi', 'arrow_cursor', 'ascii_chars', 'askbcc', + \ 'askcc', 'ask_follow_up', 'ask_x_comment_to', 'attach_save_without_prompting', + \ 'attach_split', 'autocrypt', 'autocrypt_reply', 'autoedit', 'auto_subscribe', 'auto_tag', + \ 'beep', 'beep_new', 'bounce_delivered', 'braille_friendly', + \ 'browser_abbreviate_mailboxes', 'change_folder_next', 'check_mbox_size', 'check_new', + \ 'collapse_all', 'collapse_flagged', 'collapse_unread', 'confirmappend', 'confirmcreate', + \ 'crypt_autoencrypt', 'crypt_autopgp', 'crypt_autosign', 'crypt_autosmime', + \ 'crypt_confirmhook', 'crypt_opportunistic_encrypt', + \ 'crypt_opportunistic_encrypt_strong_keys', 'crypt_protected_headers_read', + \ 'crypt_protected_headers_save', 'crypt_protected_headers_write', 'crypt_replyencrypt', + \ 'crypt_replysign', 'crypt_replysignencrypted', 'crypt_timestamp', 'crypt_use_gpgme', + \ 'crypt_use_pka', 'delete_untag', 'digest_collapse', 'duplicate_threads', 'edit_headers', + \ 'encode_from', 'fast_reply', 'fcc_before_send', 'fcc_clear', 'flag_safe', 'followup_to', + \ 'force_name', 'forward_decode', 'forward_decrypt', 'forward_quote', 'forward_references', + \ 'hdrs', 'header', 'header_color_partial', 'help', 'hidden_host', 'hide_limited', + \ 'hide_missing', 'hide_thread_subject', 'hide_top_limited', 'hide_top_missing', + \ 'history_remove_dups', 'honor_disposition', 'idn_decode', 'idn_encode', + \ 'ignore_list_reply_to', 'imap_check_subscribed', 'imap_condstore', 'imap_deflate', + \ 'imap_idle', 'imap_list_subscribed', 'imap_passive', 'imap_peek', 'imap_qresync', + \ 'imap_rfc5161', 'imap_servernoise', 'implicit_autoview', 'include_encrypted', + \ 'include_onlyfirst', 'keep_flagged', 'mailcap_sanitize', 'maildir_check_cur', + \ 'maildir_header_cache_verify', 'maildir_trash', 'mail_check_recent', 'mail_check_stats', + \ 'markers', 'mark_old', 'menu_move_off', 'menu_scroll', 'message_cache_clean', 'meta_key', + \ 'metoo', 'mh_purge', 'mime_forward_decode', 'mime_subject', 'mime_type_query_first', + \ 'narrow_tree', 'nm_record', 'nntp_listgroup', 'nntp_load_description', 'pager_stop', + \ 'pgp_autoinline', 'pgp_auto_decode', 'pgp_check_exit', 'pgp_check_gpg_decrypt_status_fd', + \ 'pgp_ignore_subkeys', 'pgp_long_ids', 'pgp_replyinline', 'pgp_retainable_sigs', + \ 'pgp_self_encrypt', 'pgp_show_unusable', 'pgp_strict_enc', 'pgp_use_gpg_agent', + \ 'pipe_decode', 'pipe_split', 'pop_auth_try_all', 'pop_last', 'postpone_encrypt', + \ 'print_decode', 'print_split', 'prompt_after', 'read_only', 'reflow_space_quotes', + \ 'reflow_text', 'reply_self', 'reply_with_xorig', 'resolve', 'resume_draft_files', + \ 'resume_edited_draft_files', 'reverse_alias', 'reverse_name', 'reverse_realname', + \ 'rfc2047_parameters', 'save_address', 'save_empty', 'save_name', 'save_unsubscribed', + \ 'score', 'show_new_news', 'show_only_unread', 'sidebar_folder_indent', + \ 'sidebar_new_mail_only', 'sidebar_next_new_wrap', 'sidebar_non_empty_mailbox_only', + \ 'sidebar_on_right', 'sidebar_short_path', 'sidebar_visible', 'sig_dashes', 'sig_on_top', + \ 'size_show_bytes', 'size_show_fractions', 'size_show_mb', 'size_units_on_left', + \ 'smart_wrap', 'smime_ask_cert_label', 'smime_decrypt_use_default_key', 'smime_is_default', + \ 'smime_self_encrypt', 'sort_re', 'ssl_force_tls', 'ssl_usesystemcerts', 'ssl_use_sslv2', + \ 'ssl_use_sslv3', 'ssl_use_tlsv1', 'ssl_use_tlsv1_1', 'ssl_use_tlsv1_2', 'ssl_use_tlsv1_3', + \ 'ssl_verify_dates', 'ssl_verify_host', 'ssl_verify_partial_chains', 'status_on_top', + \ 'strict_threads', 'suspend', 'text_flowed', 'thorough_search', 'thread_received', 'tilde', + \ 'ts_enabled', 'uncollapse_jump', 'uncollapse_new', 'user_agent', 'use_8bitmime', + \ 'use_domain', 'use_envelope_from', 'use_from', 'use_ipv6', 'virtual_spoolfile', + \ 'wait_key', 'weed', 'wrap_search', 'write_bcc', 'x_comment_to' + \ ], 0) + +" CHECKED 2020-06-21 +" Deprecated Bools +" List of DT_SYNONYM or DT_DEPRECATED Bools in MuttVars in mutt_config.c +call s:boolQuadGen('Bool', [ + \ 'edit_hdrs', 'envelope_from', 'forw_decode', 'forw_decrypt', 'forw_quote', + \ 'header_cache_compress', 'ignore_linear_white_space', 'pgp_autoencrypt', 'pgp_autosign', + \ 'pgp_auto_traditional', 'pgp_create_traditional', 'pgp_replyencrypt', 'pgp_replysign', + \ 'pgp_replysignencrypted', 'xterm_set_titles' + \ ], 1) + +" CHECKED 2020-06-21 +" List of DT_QUAD in MuttVars in mutt_config.c +call s:boolQuadGen('Quad', [ + \ 'abort_noattach', 'abort_nosubject', 'abort_unmodified', 'bounce', 'catchup_newsgroup', + \ 'copy', 'crypt_verify_sig', 'delete', 'fcc_attach', 'followup_to_poster', + \ 'forward_attachments', 'forward_edit', 'honor_followup_to', 'include', 'mime_forward', + \ 'mime_forward_rest', 'move', 'pgp_mime_auto', 'pop_delete', 'pop_reconnect', 'postpone', + \ 'post_moderated', 'print', 'quit', 'recall', 'reply_to', 'ssl_starttls', + \ ], 0) + +" CHECKED 2020-06-21 +" Deprecated Quads +" List of DT_SYNONYM or DT_DEPRECATED Quads in MuttVars in mutt_config.c +call s:boolQuadGen('Quad', [ + \ 'mime_fwd', 'pgp_encrypt_self', 'pgp_verify_sig', 'smime_encrypt_self' + \ ], 1) + +" CHECKED 2020-06-21 +" List of DT_NUMBER or DT_LONG in MuttVars in mutt_config.c +syntax keyword muttrcVarNum skipwhite contained + \ connect_timeout debug_level header_cache_compress_level history + \ imap_fetch_chunk_size imap_keepalive imap_pipeline_depth imap_poll_timeout mail_check + \ mail_check_stats_interval menu_context net_inc nm_db_limit nm_open_timeout + \ nm_query_window_current_position nm_query_window_duration nntp_context nntp_poll + \ pager_context pager_index_lines pgp_timeout pop_checkinterval read_inc reflow_wrap + \ save_history score_threshold_delete score_threshold_flag score_threshold_read + \ search_context sendmail_wait sidebar_component_depth sidebar_width skip_quoted_offset + \ sleep_time smime_timeout ssl_min_dh_prime_bits timeout time_inc toggle_quoted_show_levels + \ wrap wrap_headers write_inc + \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarDeprecatedNum contained skipwhite + \ header_cache_pagesize wrapmargin + \ nextgroup=muttrcSetNumAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" CHECKED 2020-06-21 +" List of DT_STRING in MuttVars in mutt_config.c +" Special cases first, and all the rest at the end +" Formats themselves must be updated in their respective groups +" See s:escapesConditionals +syntax match muttrcVarStr contained skipwhite 'my_[a-zA-Z0-9_]\+' nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcVarStr contained skipwhite alias_format nextgroup=muttrcVarEqualsAliasFmt +syntax keyword muttrcVarStr contained skipwhite attach_format nextgroup=muttrcVarEqualsAttachFmt +syntax keyword muttrcVarStr contained skipwhite compose_format nextgroup=muttrcVarEqualsComposeFmt +syntax keyword muttrcVarStr contained skipwhite folder_format vfolder_format nextgroup=muttrcVarEqualsFolderFmt +syntax keyword muttrcVarStr contained skipwhite attribution forward_format index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt +syntax keyword muttrcVarStr contained skipwhite mix_entry_format nextgroup=muttrcVarEqualsMixFmt +syntax keyword muttrcVarStr contained skipwhite + \ pgp_clearsign_command pgp_decode_command pgp_decrypt_command + \ pgp_encrypt_only_command pgp_encrypt_sign_command pgp_export_command pgp_getkeys_command + \ pgp_import_command pgp_list_pubring_command pgp_list_secring_command + \ pgp_sign_command pgp_verify_command pgp_verify_key_command + \ nextgroup=muttrcVarEqualsPGPCmdFmt +syntax keyword muttrcVarStr contained skipwhite pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt +syntax keyword muttrcVarStr contained skipwhite query_format nextgroup=muttrcVarEqualsQueryFmt +syntax keyword muttrcVarStr contained skipwhite + \ smime_decrypt_command smime_encrypt_command smime_get_cert_command + \ smime_get_cert_email_command smime_get_signer_cert_command + \ smime_import_cert_command smime_pk7out_command smime_sign_command + \ smime_verify_command smime_verify_opaque_command + \ nextgroup=muttrcVarEqualsSmimeFmt +syntax keyword muttrcVarStr contained skipwhite status_format ts_icon_format ts_status_format nextgroup=muttrcVarEqualsStatusFmt +syntax keyword muttrcVarStr contained skipwhite date_format nextgroup=muttrcVarEqualsStrftimeFmt +syntax keyword muttrcVarStr contained skipwhite group_index_format nextgroup=muttrcVarEqualsGrpIdxFmt +syntax keyword muttrcVarStr contained skipwhite sidebar_format nextgroup=muttrcVarEqualsSdbFmt +syntax keyword muttrcVarStr contained skipwhite + \ abort_key arrow_string assumed_charset attach_charset attach_sep attribution_locale + \ autocrypt_acct_format charset config_charset content_type crypt_protected_headers_subject + \ default_hook dsn_notify dsn_return empty_subject escape forward_attribution_intro + \ forward_attribution_trailer header_cache_backend header_cache_compress_method hidden_tags + \ hostname imap_authenticators imap_delim_chars imap_headers imap_login imap_pass imap_user + \ indent_string mailcap_path mark_macro_prefix mh_seq_flagged mh_seq_replied mh_seq_unseen + \ newsgroups_charset news_server nm_default_url nm_exclude_tags nm_flagged_tag nm_query_type + \ nm_query_window_current_search nm_query_window_timebase nm_record_tags nm_replied_tag + \ nm_unread_tag nntp_authenticators nntp_pass nntp_user pgp_default_key pgp_sign_as pipe_sep + \ pop_authenticators pop_host pop_pass pop_user postpone_encrypt_as post_indent_string + \ preconnect preferred_languages realname send_charset show_multipart_alternative + \ sidebar_delim_chars sidebar_divider_char sidebar_indent_string simple_search + \ smime_default_key smime_encrypt_with smime_sign_as smime_sign_digest_alg + \ smtp_authenticators smtp_pass smtp_url smtp_user spam_separator ssl_ciphers + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" Deprecated strings +syntax keyword muttrcVarDeprecatedStr + \ abort_noattach_regexp attach_keyword forw_format hdr_format indent_str msg_format + \ nm_default_uri pgp_self_encrypt_as post_indent_str print_cmd quote_regexp reply_regexp + \ smime_self_encrypt_as xterm_icon xterm_title + +" CHECKED 2020-06-21 +" List of DT_ADDRESS +syntax keyword muttrcVarStr contained skipwhite envelope_from_address from nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" List of DT_ENUM +syntax keyword muttrcVarStr contained skipwhite mbox_type nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" List of DT_MBTABLE +syntax keyword muttrcVarStr contained skipwhite crypt_chars flag_chars from_chars status_chars to_chars nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" CHECKED 2020-06-21 +" List of DT_PATH +syntax keyword muttrcVarStr contained skipwhite + \ alias_file attach_save_dir autocrypt_dir certificate_file debug_file + \ entropy_file folder header_cache history_file mbox message_cachedir newsrc + \ news_cache_dir postponed record signature smime_ca_location + \ smime_certificates smime_keys spoolfile ssl_ca_certificates_file + \ ssl_client_cert tmpdir trash + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" List of DT_COMMAND (excluding pgp_*_command and smime_*_command) +syntax keyword muttrcVarStr contained skipwhite + \ display_filter editor inews ispell mixmaster new_mail_command pager + \ print_command query_command sendmail shell visual external_search_command + \ imap_oauth_refresh_command pop_oauth_refresh_command + \ mime_type_query_command smtp_oauth_refresh_command tunnel + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" CHECKED 2020-06-21 +" List of DT_REGEX +syntax keyword muttrcVarStr contained skipwhite + \ abort_noattach_regex gecos_mask mask pgp_decryption_okay pgp_good_sign + \ quote_regex reply_regex smileys + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +" List of DT_SORT +syntax keyword muttrcVarStr contained skipwhite + \ pgp_sort_keys sidebar_sort_method sort sort_alias sort_aux sort_browser + \ nextgroup=muttrcSetStrAssignment,muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr + +" CHECKED 2020-06-21 +" List of commands in Commands in mutt_config.c +" Remember to remove hooks, they have already been dealt with +syntax keyword muttrcCommand skipwhite alias nextgroup=muttrcAliasGroupDef,muttrcAliasKey,muttrcAliasNL +syntax keyword muttrcCommand skipwhite bind nextgroup=muttrcBindMenuList,muttrcBindMenuListNL +syntax keyword muttrcCommand skipwhite exec nextgroup=muttrcFunction +syntax keyword muttrcCommand skipwhite macro nextgroup=muttrcMacroMenuList,muttrcMacroMenuListNL +syntax keyword muttrcCommand skipwhite nospam nextgroup=muttrcNoSpamPattern +syntax keyword muttrcCommand skipwhite set unset reset toggle nextgroup=muttrcVPrefix,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcVarStr +syntax keyword muttrcCommand skipwhite spam nextgroup=muttrcSpamPattern +syntax keyword muttrcCommand skipwhite unalias nextgroup=muttrcUnAliasKey,muttrcUnAliasNL +syntax keyword muttrcCommand skipwhite unhook nextgroup=muttrcHooks +syntax keyword muttrcCommand skipwhite + \ alternative_order attachments auto_view finish hdr_order ifdef ifndef + \ ignore lua lua-source mailboxes mailto_allow mime_lookup my_hdr push score + \ setenv sidebar_whitelist source subjectrx subscribe-to tag-formats + \ tag-transforms unalternative_order unattachments unauto_view uncolor + \ unhdr_order unignore unmailboxes unmailto_allow unmime_lookup unmono + \ unmy_hdr unscore unsetenv unsidebar_whitelist unsubjectrx unsubscribe-from + \ unvirtual-mailboxes virtual-mailboxes named-mailboxes + \ echo unbind unmacro + +function! s:genFunctions(functions) + for f in a:functions + exec 'syntax match muttrcFunction contained "\<' . l:f . '\>"' + endfor +endfunction + +" CHECKED 2020-06-21 +" List of functions in functions.c +" Note: 'noop' is included but is elsewhere in the source +call s:genFunctions(['noop', + \ 'accept', 'append', 'attach-file', 'attach-key', 'attach-message', 'attach-news-message', + \ 'autocrypt-acct-menu', 'autocrypt-menu', 'backspace', 'backward-char', 'backward-word', + \ 'bol', 'bottom-page', 'bottom', 'bounce-message', 'break-thread', 'buffy-cycle', + \ 'buffy-list', 'capitalize-word', 'catchup', 'chain-next', 'chain-prev', 'change-dir', + \ 'change-folder-readonly', 'change-folder', 'change-newsgroup-readonly', + \ 'change-newsgroup', 'change-vfolder', 'check-new', 'check-stats', + \ 'check-traditional-pgp', 'clear-flag', 'collapse-all', 'collapse-parts', + \ 'collapse-thread', 'complete-query', 'complete', 'compose-to-sender', 'copy-file', + \ 'copy-message', 'create-account', 'create-alias', 'create-mailbox', 'current-bottom', + \ 'current-middle', 'current-top', 'decode-copy', 'decode-save', 'decrypt-copy', + \ 'decrypt-save', 'delete-account', 'delete-char', 'delete-entry', 'delete-mailbox', + \ 'delete-message', 'delete-pattern', 'delete-subthread', 'delete-thread', 'delete', + \ 'descend-directory', 'detach-file', 'display-address', 'display-filename', + \ 'display-message', 'display-toggle-weed', 'downcase-word', 'edit-bcc', 'edit-cc', + \ 'edit-description', 'edit-encoding', 'edit-fcc', 'edit-file', 'edit-followup-to', + \ 'edit-from', 'edit-headers', 'edit-label', 'edit-language', 'edit-message', 'edit-mime', + \ 'edit-newsgroups', 'edit-or-view-raw-message', 'edit-raw-message', 'edit-reply-to', + \ 'edit-subject', 'edit-to', 'edit-type', 'edit-x-comment-to', 'edit', 'end-cond', + \ 'enter-command', 'enter-mask', 'entire-thread', 'eol', 'exit', 'extract-keys', + \ 'fetch-mail', 'filter-entry', 'first-entry', 'flag-message', 'followup-message', + \ 'forget-passphrase', 'forward-char', 'forward-message', 'forward-to-group', + \ 'forward-word', 'get-attachment', 'get-children', 'get-message', 'get-parent', + \ 'goto-folder', 'goto-parent', 'group-alternatives', 'group-chat-reply', + \ 'group-multilingual', 'group-reply', 'half-down', 'half-up', 'help', 'history-down', + \ 'history-search', 'history-up', 'imap-fetch-mail', 'imap-logout-all', 'insert', 'ispell', + \ 'jump', 'kill-eol', 'kill-eow', 'kill-line', 'kill-word', 'last-entry', + \ 'limit-current-thread', 'limit', 'link-threads', 'list-reply', 'mail-key', + \ 'mailbox-cycle', 'mailbox-list', 'mail', 'mark-as-new', 'mark-message', 'middle-page', + \ 'mix', 'modify-labels-then-hide', 'modify-labels', 'modify-tags-then-hide', + \ 'modify-tags', 'move-down', 'move-up', 'new-mime', 'next-entry', 'next-line', + \ 'next-new-then-unread', 'next-new', 'next-page', 'next-subthread', 'next-thread', + \ 'next-undeleted', 'next-unread-mailbox', 'next-unread', 'parent-message', 'pgp-menu', + \ 'pipe-entry', 'pipe-message', 'post-message', 'postpone-message', 'previous-entry', + \ 'previous-line', 'previous-new-then-unread', 'previous-new', 'previous-page', + \ 'previous-subthread', 'previous-thread', 'previous-undeleted', 'previous-unread', + \ 'print-entry', 'print-message', 'purge-message', 'purge-thread', 'quasi-delete', + \ 'query-append', 'query', 'quit', 'quote-char', 'read-subthread', 'read-thread', + \ 'recall-message', 'reconstruct-thread', 'redraw-screen', 'refresh', 'reload-active', + \ 'rename-attachment', 'rename-file', 'rename-mailbox', 'reply', 'resend-message', + \ 'root-message', 'save-entry', 'save-message', 'search-next', 'search-opposite', + \ 'search-reverse', 'search-toggle', 'search', 'select-entry', 'select-new', + \ 'send-message', 'set-flag', 'shell-escape', 'show-limit', 'show-log-messages', + \ 'show-version', 'sidebar-next-new', 'sidebar-first', 'sidebar-last', 'sidebar-next', + \ 'sidebar-open', 'sidebar-page-down', 'sidebar-page-up', 'sidebar-prev-new', + \ 'sidebar-prev', 'sidebar-toggle-virtual', 'sidebar-toggle-visible', 'skip-quoted', + \ 'smime-menu', 'sort-mailbox', 'sort-reverse', 'sort', 'subscribe-pattern', + \ 'sync-mailbox', 'tag-entry', 'tag-message', 'tag-pattern', 'tag-prefix-cond', + \ 'tag-prefix', 'tag-subthread', 'tag-thread', 'toggle-active', 'toggle-disposition', + \ 'toggle-mailboxes', 'toggle-new', 'toggle-prefer-encrypt', 'toggle-quoted', + \ 'toggle-read', 'toggle-recode', 'toggle-subscribed', 'toggle-unlink', 'toggle-write', + \ 'top-page', 'top', 'transpose-chars', 'uncatchup', 'undelete-entry', 'undelete-message', + \ 'undelete-pattern', 'undelete-subthread', 'undelete-thread', 'unsubscribe-pattern', + \ 'untag-pattern', 'upcase-word', 'update-encoding', 'verify-key', + \ 'vfolder-from-query-readonly', 'vfolder-from-query', 'vfolder-window-backward', + \ 'vfolder-window-forward', 'view-attachments', 'view-attach', 'view-file', 'view-mailcap', + \ 'view-name', 'view-raw-message', 'view-text', 'what-key', 'write-fcc' + \ ]) + +" Define the default highlighting. +" Only when an item doesn't have highlighting yet + +highlight def link muttrcSetBoolAssignment Boolean +highlight def link muttrcSetQuadAssignment Boolean + +highlight def link muttrcComment Comment + +highlight def link muttrcAlternatesLine Error +highlight def link muttrcBadAction Error +highlight def link muttrcBindFunction Error +highlight def link muttrcBindMenuList Error +highlight def link muttrcColorBG Error +highlight def link muttrcColorBGH Error +highlight def link muttrcColorBGI Error +highlight def link muttrcColorContext Error +highlight def link muttrcColorFG Error +highlight def link muttrcColorFGH Error +highlight def link muttrcColorFGI Error +highlight def link muttrcColorLine Error +highlight def link muttrcFormatErrors Error +highlight def link muttrcGroupLine Error +highlight def link muttrcListsLine Error +highlight def link muttrcPattern Error +highlight def link muttrcSubscribeLine Error +highlight def link muttrcUnColorLine Error +highlight def link muttrcVarDeprecatedBool Error +highlight def link muttrcVarDeprecatedQuad Error +highlight def link muttrcVarDeprecatedStr Error + +highlight def link muttrcAliasEncEmail Identifier +highlight def link muttrcAliasKey Identifier +highlight def link muttrcColorCompose Identifier +highlight def link muttrcColorComposeField Identifier +highlight def link muttrcColorContextH Identifier +highlight def link muttrcColorContextI Identifier +highlight def link muttrcColorField Identifier +highlight def link muttrcMenu Identifier +highlight def link muttrcSimplePat Identifier +highlight def link muttrcUnAliasKey Identifier +highlight def link muttrcUnColorIndex Identifier +highlight def link muttrcVarBool Identifier +highlight def link muttrcVarNum Identifier +highlight def link muttrcVarQuad Identifier +highlight def link muttrcVarStr Identifier + +highlight def link muttrcCommand Keyword + +highlight def link muttrcAction Macro +highlight def link muttrcAliasGroupName Macro +highlight def link muttrcFunction Macro +highlight def link muttrcGroupDef Macro +highlight def link muttrcSimplePatString Macro + +highlight def link muttrcMonoAttrib muttrcColor + +highlight def link muttrcAlternateKeyword muttrcCommand +highlight def link muttrcAttachmentsLine muttrcCommand +highlight def link muttrcColorKeyword muttrcCommand +highlight def link muttrcGroupKeyword muttrcCommand +highlight def link muttrcListsKeyword muttrcCommand +highlight def link muttrcMono muttrcCommand +highlight def link muttrcPatHooks muttrcCommand +highlight def link muttrcRXHooks muttrcCommand +highlight def link muttrcSubscribeKeyword muttrcCommand +highlight def link muttrcUnColorKeyword muttrcCommand + +highlight def link muttrcAliasFormatEscapes muttrcEscape +highlight def link muttrcAttachFormatEscapes muttrcEscape +highlight def link muttrcComposeFormatEscapes muttrcEscape +highlight def link muttrcFolderFormatEscapes muttrcEscape +highlight def link muttrcGroupIndexFormatEscapes muttrcEscape +highlight def link muttrcIndexFormatEscapes muttrcEscape +highlight def link muttrcMixFormatEscapes muttrcEscape +highlight def link muttrcPGPCmdFormatEscapes muttrcEscape +highlight def link muttrcPGPFormatEscapes muttrcEscape +highlight def link muttrcPGPTimeEscapes muttrcEscape +highlight def link muttrcQueryFormatEscapes muttrcEscape +highlight def link muttrcShellString muttrcEscape +highlight def link muttrcSidebarFormatEscapes muttrcEscape +highlight def link muttrcSmimeFormatEscapes muttrcEscape +highlight def link muttrcStatusFormatEscapes muttrcEscape +highlight def link muttrcTimeEscapes muttrcEscape + +highlight def link muttrcAliasFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcAttachFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcComposeFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcFolderFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcIndexFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcMixFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcPGPCmdFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcPGPFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcSmimeFormatConditionals muttrcFormatConditionals2 +highlight def link muttrcStatusFormatConditionals muttrcFormatConditionals2 + +highlight def link muttrcAddrDef muttrcGroupFlag +highlight def link muttrcRXDef muttrcGroupFlag + +highlight def link muttrcAliasFormatStr muttrcString +highlight def link muttrcAttachFormatStr muttrcString +highlight def link muttrcComposeFormatStr muttrcString +highlight def link muttrcFolderFormatStr muttrcString +highlight def link muttrcGroupIndexFormatStr muttrcString +highlight def link muttrcIndexFormatStr muttrcString +highlight def link muttrcMixFormatStr muttrcString +highlight def link muttrcPGPCmdFormatStr muttrcString +highlight def link muttrcPGPFormatStr muttrcString +highlight def link muttrcQueryFormatStr muttrcString +highlight def link muttrcSidebarFormatStr muttrcString +highlight def link muttrcSmimeFormatStr muttrcString +highlight def link muttrcStatusFormatStr muttrcString +highlight def link muttrcStrftimeFormatStr muttrcString + +highlight def link muttrcSetNumAssignment Number + +highlight def link muttrcEmail Special +highlight def link muttrcSimplePatMetas Special +highlight def link muttrcSpecial Special +highlight def link muttrcVariableInner Special + +highlight def link muttrcAliasEncEmailNL SpecialChar +highlight def link muttrcAliasENNL SpecialChar +highlight def link muttrcAliasGroupDefNL SpecialChar +highlight def link muttrcAliasNameNL SpecialChar +highlight def link muttrcAliasNL SpecialChar +highlight def link muttrcBindFunctionNL SpecialChar +highlight def link muttrcBindKeyNL SpecialChar +highlight def link muttrcBindMenuListNL SpecialChar +highlight def link muttrcColorBGNL SpecialChar +highlight def link muttrcColorFGNL SpecialChar +highlight def link muttrcColorMatchCountNL SpecialChar +highlight def link muttrcColorNL SpecialChar +highlight def link muttrcColorRXNL SpecialChar +highlight def link muttrcEscape SpecialChar +highlight def link muttrcKeyName SpecialChar +highlight def link muttrcKeySpecial SpecialChar +highlight def link muttrcMacroBodyNL SpecialChar +highlight def link muttrcMacroDescrNL SpecialChar +highlight def link muttrcMacroKeyNL SpecialChar +highlight def link muttrcMacroMenuListNL SpecialChar +highlight def link muttrcPatternNL SpecialChar +highlight def link muttrcRXChars SpecialChar +highlight def link muttrcStringNL SpecialChar +highlight def link muttrcUnAliasNL SpecialChar +highlight def link muttrcUnColorAPNL SpecialChar +highlight def link muttrcUnColorIndexNL SpecialChar +highlight def link muttrcUnColorPatNL SpecialChar + +highlight def link muttrcAttachmentsMimeType String +highlight def link muttrcEscapedVariable String +highlight def link muttrcMacroDescr String +highlight def link muttrcRXPat String +highlight def link muttrcRXString String +highlight def link muttrcRXString2 String +highlight def link muttrcSetStrAssignment String +highlight def link muttrcString String + +highlight def link muttrcAliasParens Type +highlight def link muttrcAttachmentsFlag Type +highlight def link muttrcColor Type +highlight def link muttrcFormatConditionals2 Type +highlight def link muttrcGroupFlag Type +highlight def link muttrcHeader Type +highlight def link muttrcHooks Type +highlight def link muttrcKey Type +highlight def link muttrcPatHookNot Type +highlight def link muttrcRXHookNot Type +highlight def link muttrcStrftimeEscapes Type + +let b:current_syntax = "neomuttrc" + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 noet tw=100 sw=8 sts=0 ft=vim isk+=- diff --git a/test/efm_bug.lua b/test/efm_bug.lua @@ -0,0 +1,24 @@ +local data = [[ +[a1.tt] +(1,17) error: ';' missing +(21,2) warning: variable 'z' not defined +(67,3) error: end of file found before string ended + +[a2.tt] + +[a3.tt] +NEW compiler v1.1 +(2,2) warning: variable 'x' not defined +(67,3) warning: 's' already defined +]] +local efm = '%+P[%f],(%l\\,%c)%*[ ]%t%*[^:]: %m,%-Q' + +-- list of lines +local lines = {} +for line in string.gmatch(data, '([^\n]+)') do + table.insert(lines, line) +end + +-- fill qf +vim.fn.setqflist({}, 'r', {lines = lines, efm = efm}) + diff --git a/test/qf.lua b/test/qf.lua @@ -0,0 +1,31 @@ +local data = {} + +data[5] = { + --- {{{ + data = [[ +file:lib/vc.dart +test/qf.lua:5:1: Expected a method, getter, setter or operator declaration. +test/test.lua:3:5: The name of a constructor must match the name of the enclosing class. +test/efm_bug.lua:6:5: A function body must be provided. +]], + -- }}} + efm = '%f:%l:%c: %m', +} + +local ACTIVE = 5 +local err = data[ACTIVE].data +local efm = data[ACTIVE].efm + +vim.fn.setqflist({}, 'r') +local lines = {} +for line in string.gmatch(err, '([^\n]+)') do + table.insert(lines, line) +end +vim.fn.setqflist({}, 'r', {lines = lines, efm = efm}) + +-- Only valid items +-- for _, item in ipairs(list.items) do +-- if item.valid == 1 then +-- vim.fn.setqflist({item}, 'a') +-- end +-- end diff --git a/test/test.lua b/test/test.lua @@ -0,0 +1,234 @@ +local data = {} + +data[1] = { + -- {{{ 1 + data = [[ +[INFO] Generating build script... +[INFO] Generating build script completed, took 244ms + +[INFO] Setting up file watchers... +[INFO] Setting up file watchers completed, took 7ms + +[INFO] Waiting for all file watchers to be ready... +[INFO] Waiting for all file watchers to be ready completed, took 120ms + +[INFO] Initializing inputs +[INFO] Reading cached asset graph... +[INFO] Reading cached asset graph completed, took 289ms + +[INFO] Checking for updates since last build... +[INFO] Checking for updates since last build completed, took 464ms + +[INFO] Running build... +[INFO] 2.0s elapsed, 1/2 actions completed. +[SEVERE] angular:angular on lib/vc.dart: + +This builder requires Dart inputs without syntax errors. +However, package:vc/vc.dart (or an existing part) contains the following errors. +vc.dart:20:10: Expected to find ';'. + +Try fixing the errors and re-running the build. + +[SEVERE] build_web_compilers:ddc on lib/vc.ddc.module: +Error compiling dartdevc module:vc|lib/vc.unsound.ddc.js + +packages/vc/vc.dart:20:10: Error: Expected ';' after this. + Player player + ^^^^^^ + +[SEVERE] build_web_compilers:ddc on lib/vc.ddc.module: +Error creating vc|lib/vc.unsound.ddc.dill +Error creating kernel summary for module:vc|lib/vc.unsound.ddc.dill + +Response:--dart-sdk-summary=file:///home/tms/.dswitch/channels/stable/versions/2.10.3/dart-sdk/lib/_internal/ddc_sdk.dill --output=/tmp/scratch_spaceTQAQPD/packages/vc/vc.unsound.ddc.dill --packages-file=org-dartlang-app:///.dart_tool/package_config.json --multi-root-scheme=org-dartlang-app --exclude-non-sources --summary-only --target=ddc --libraries-file=file:///home/tms/.dswitch/channels/stable/versions/2.10.3/dart-sdk/lib/libraries.json --reuse-compiler-result --use-incremental-compiler --used-inputs=/tmp/kernel_builder_KAOIXX/used_inputs.txt --input-summary=org-dartlang-app:///packages/video_player/video_player.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/angular.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/video_player/plugins.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/core.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/video_player/messages.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/events.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/video_player/src/control.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/core.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/bootstrap/modules.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/core/change_detection/pipe_transform.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/video_player/src/ng_plugins/progress_bar.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/collator.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/cache/local_cache.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/cache/local_storage_cache.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/progress_controller.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/events/key_event_handler.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/events/tap_event_handler.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/src/events/mouse_track_container.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/logging/logging.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/core/application_tokens.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/meta/meta.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/di.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/meta/dart2js.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/di_tokens.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/di.template.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/intl/intl.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/core/change_detection/pipe_transform.template.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/core.template.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/js/js_util.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular/src/core/application_tokens.template.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/js/js.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/collection.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/stack_trace/src/chain.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_forms/angular_forms.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/vector_math/vector_math.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/ng_core/js/window.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/typed.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/change_detection_link.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/di_providers.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/view_type.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/di_arguments.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/change_detection_constants.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/lifecycle_hooks.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/view.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/visibility.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/directives.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_compiler/v1/src/metadata/runtime_shim.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/intl/src/plural_rules.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/intl/number_symbols_data.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/intl/date_symbols.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/intl/number_symbols.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/src/algorithms.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/src/utils.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/src/iterable_zip.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/src/comparators.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/src/priority_queue.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/collection/src/canonicalized_map.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/path/path.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/angular_forms/src/directives.unsound.ddc.dill --input-summary=org-dartlang-app:///packages/vector_math/hash.unsound.ddc.dill --no-sound-null-safety --source=package:vc/vc.dart +org-dartlang-app:///packages/vc/vc.dart:20:10: Error: Expected ';' after this. + Player player + ^^^^^^ + + +[SEVERE] build_web_compilers:ddc on web/main.ddc.module: +Unable to find modules for some sources, this is usually the result of either a +bad import, a missing dependency in a package (or possibly a dev_dependency +needs to move to a real dependency), or a build failure (if importing a +generated file). + +Please check the following imports: + +`import 'package:vc/vc.template.dart' as ng;` from vc|web/main.dart at 2:1 + +[SEVERE] build_web_compilers:entrypoint on web/main.dart: +Unable to find modules for some sources, this is usually the result of either a +bad import, a missing dependency in a package (or possibly a dev_dependency +needs to move to a real dependency), or a build failure (if importing a +generated file). + +Please check the following imports: + +`import 'package:vc/vc.template.dart' as ng;` from vc|web/main.dart at 2:1 + +[INFO] Running build completed, took 3.1s + +[INFO] Caching finalized dependency graph... +[INFO] Caching finalized dependency graph completed, took 446ms + +[SEVERE] Failed after 3.5s +Serving `web` on http://localhost:8080 +[INFO] Terminating. No further builds will be scheduled + +[INFO] Builds finished. Safe to exit + +]], + -- }}} + efm = '%E[SEVERE] angular:angular on %f:,%Z%.%#:%l:%c: %m,%C%.%#,%E[SEVERE] build_web_compilers:ddc on %.%#:,%Zpackages/%f:%.%# Error: %m', +} +data[2] = { + -- {{{ 2 + data = [[ +error on test.lua: +asdfsda +vc.dart:20:10: Expected to find ';'. +]], + -- }}} + efm = '%Eerror on %f:,%Z%.%#:%l:%c: %m,%C%.%#,', +} +data[3] = { + -- {{{ 3 + data = [[ +[INFO] Caching finalized dependency graph completed, took 213ms +[SEVERE] build_web_compilers:ddc on lib/vc.template.ddc.module (cached): +Error compiling dartdevc module:vc|lib/vc.template.unsound.ddc.js + +packages/vc/vc.template.dart:127:64: Error: The getter 'tet' isn't defined for the class 'VC'. + - 'VC' is from 'package:vc/vc.dart' ('packages/vc/vc.dart'). +Try correcting the name to the name of an existing getter, or defining a getter or field named 'tet'. + this._textBinding_17.updateText(import14.interpolate0(_ctx.tet)); + ^^^ + + +[SEVERE] build_web_compilers:entrypoint on web/main.dart (cached): + +AssetNotFoundException: vc|lib/vc.template.unsound.ddc.js.metadata +[SEVERE] Failed after 438ms +[SEVERE] build_web_compilers:ddc on web/main.ddc.module: +Unable to find modules for some sources, this is usually the result of either a +bad import, a missing dependency in a package (or possibly a dev_dependency +needs to move to a real dependency), or a build failure (if importing a +generated file). + +Please check the following imports: + +`import 'package:vc/vc.template.dart' as ng;` from vc|web/main.dart at 2:1 + +[SEVERE] build_web_compilers:entrypoint on web/main.dart: +Unable to find modules for some sources, this is usually the result of either a +bad import, a missing dependency in a package (or possibly a dev_dependency +needs to move to a real dependency), or a build failure (if importing a +generated file). + +Please check the following imports: + +`import 'package:vc/vc.template.dart' as ng;` from vc|web/main.dart at 2:1 + +[INFO] Running build completed, took 3.0s +[INFO] Caching finalized dependency graph completed, took 229ms +]], + -- }}} + efm = '%E[SEVERE] build_web_compilers:ddc on %.%#:,%Zpackages/%f:%.%# Error: %m,%C%.%#', +} +data[4] = { + -- {{{ 4 + data = [[ +[SEVERE] angular:angular on lib/vc.dart: + +This builder requires Dart inputs without syntax errors. +However, package:vc/vc.dart (or an existing part) contains the following errors. +vc.dart:20:10: Expected to find ';'. + +Try fixing the errors and re-running the build. + +[SEVERE] build_web_compilers:ddc on lib/vc.ddc.module: +Error compiling dartdevc module:vc|lib/vc.unsound.ddc.js + +packages/vc/vc.dart:20:10: Error: Expected ';' after this. + Player player + ^^^^^^ + +[SEVERE] build_web_compilers:ddc on lib/vc.template.ddc.module (cached): +Error compiling dartdevc module:vc|lib/vc.template.unsound.ddc.js + +packages/vc/vc.template.dart:127:64: Error: The getter 'tet' isn't defined for the class 'VC'. + - 'VC' is from 'package:vc/vc.dart' ('packages/vc/vc.dart'). +Try correcting the name to the name of an existing getter, or defining a getter or field named 'tet'. + this._textBinding_17.updateText(import14.interpolate0(_ctx.tet)); + ^^^ + +[SEVERE] angular:angular on lib/p/progress_bar.dart: + +This builder requires Dart inputs without syntax errors. +However, package:vc/p/progress_bar.dart (or an existing part) contains the following errors. +progress_bar.dart:12:1: A function body must be provided. + +Try fixing the errors and re-running the build. + +[SEVERE] angular:angular on lib/vc.dart: + +This builder requires Dart inputs without syntax errors. +However, package:vc/vc.dart (or an existing part) contains the following errors. +vc.dart:55:1: Expected a method, getter, setter or operator declaration. +vc.dart:53:5: The name of a constructor must match the name of the enclosing class. +vc.dart:53:5: A function body must be provided. +And 2 more... + +Try fixing the errors and re-running the build. + +]], + -- }}} + efm = '%+P[SEVERE] angular:angular on %f:,%.%#:%l:%c: %m,%-Q', +} +data[5] = { + --- {{{ + data = [[ +file:lib/vc.dart +vc.dart:55:1: Expected a method, getter, setter or operator declaration. +vc.dart:53:5: The name of a constructor must match the name of the enclosing class. +vc.dart:53:5: A function body must be provided. +]], + -- }}} + efm = '%+Pfile:%f,vc.dart:%l:%c: %m', +} +data[6] = { + -- {{{ + data = [[ +[a1.tt] +(1,17) error: ';' missing +(21,2) warning: variable 'z' not defined +(67,3) error: end of file found before string ended + +[a2.tt] + +[a3.tt] +NEW compiler v1.1 +(2,2) warning: variable 'x' not defined +(67,3) warning: 's' already defined +]], + -- }}} + efm = '%+P[%f],(%l\\,%c)%*[ ]%t%*[^:]: %m,%-Q', +} + +local ACTIVE = 6 +local err = data[ACTIVE].data +local efm = data[ACTIVE].efm + +vim.fn.setqflist({}, 'r') +local lines = {} +for line in string.gmatch(err, '([^\n]+)') do + table.insert(lines, line) +end +vim.fn.setqflist({}, 'r', {lines = lines, efm = efm}) + +-- Only valid items +-- for _, item in ipairs(list.items) do +-- if item.valid == 1 then +-- vim.fn.setqflist({item}, 'a') +-- end +-- end