neovim

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

commit 04338434cd5ac7d356c2f0df904bcbfca6aa71fa
parent 4f8ce7ab03656085c18673c03503d7e9d50faac3
Author: Tomas Nemec <owl@gtms.dev>
Date:   Tue, 12 Sep 2023 07:16:21 +0200

update

Diffstat:
Mafter/plugin/sidebar.lua | 3++-
Mafter/plugin/telescope.lua | 5-----
Mafter/queries/dart/highlights.scm | 2--
Mftplugin/dart.lua | 2+-
Mlua/plugins.lua | 354+++++++++++++++++++++++++++++++++++++++----------------------------------------
Mlua/tms/first_load.lua | 11++++++++---
Mlua/tms/p/hexen.lua | 28+++++++++++++++++++---------
7 files changed, 206 insertions(+), 199 deletions(-)

diff --git a/after/plugin/sidebar.lua b/after/plugin/sidebar.lua @@ -1,4 +1,5 @@ -if not pcall(require, 'sidebar-nvim') then +-- if not pcall(require, 'sidebar-nvim') then +do return end diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua @@ -17,10 +17,6 @@ pcall(telescope.load_extension, 'zk') pcall(telescope.load_extension, 'git_worktree') pcall(telescope.load_extension, 'advanced_git_search') -vim.cmd.packadd('packer.nvim') -require('packer').init() -_ = pcall(telescope.load_extension, 'packer') - local l = require('tms.p.telescope').L local function builtin(name, theme) @@ -34,7 +30,6 @@ vim.keymap.set('n', '<space>k', builtin('keymaps', l.dd_large()), { desc = 'Tele vim.keymap.set('n', '<space>o', builtin('oldfiles'), { desc = 'Telescope Old Files' }) vim.keymap.set('n', '<space>s', builtin('spell_suggest', l.dd()), { desc = 'Telescope Spell Suggest' }) vim.keymap.set('n', '<space>t', builtin('treesitter'), { desc = 'Telescope Treesitter' }) -vim.keymap.set('n', '<space>p', require('telescope').extensions.packer.packer, { desc = 'Telescope Packer' }) vim.keymap.set('n', '<space>c', builtin('git_status', l.dd_large()), { desc = 'Telescope Git Status' }) vim.keymap.set('n', '<space>e', builtin('grep_string'), { desc = 'Telescope Grep String' }) vim.keymap.set('n', '<space>l', function() diff --git a/after/queries/dart/highlights.scm b/after/queries/dart/highlights.scm @@ -2,5 +2,3 @@ (annotation name: (identifier) @annotation) -(marker_annotation - name: (identifier) @annotation) diff --git a/ftplugin/dart.lua b/ftplugin/dart.lua @@ -7,7 +7,7 @@ vim.b.undo_ftplugin = 'setl com< cms< inex< isf<' vim.cmd.iabbrev('STring', 'String') -local first_line = vim.filetype.getlines(0, 1) +local first_line = vim.fn.getline(1) if string.match(first_line, '^#!.*dcli') then vim.bo.makeprg = [[dcli run %]] vim.bo.efm = [[%f:%l:%c: %m]] diff --git a/lua/plugins.lua b/lua/plugins.lua @@ -1,179 +1,177 @@ -vim.cmd.packadd('packer.nvim') -local packer = require('packer') -return packer.startup { - function() - local use = packer.use - - packer.use_rocks('luautf8') - -- packer.use_rocks('lyaml') - - use { 'wbthomason/packer.nvim', opt = true } - - -- EXP - use 'yioneko/nvim-type-fmt' - - -- meta - use 'tweekmonster/startuptime.vim' - - -- colorscheme - use 'tjdevries/colorbuddy.nvim' - - -- spell - use 'xxdavid/bez-diakritiky.vim' - - -- movements - use 'ggandor/leap.nvim' - use 'ggandor/leap-spooky.nvim' - - -- editor - use 'tpope/vim-repeat' - use 'kylechui/nvim-surround' - use 'chaoren/vim-wordmotion' -- word counts with _,.,-,... - use 'romgrk/equal.operator' -- equal text object `lefthand = righthand` - use 'godlygeek/tabular' -- align - -- use 'windwp/nvim-autopairs' - use 'numToStr/Comment.nvim' - use 'mbbill/undotree' - -- use 'camspiers/Animate.vim' - use 'nvchad/nvim-colorizer.lua' - use 'rainbowhxch/beacon.nvim' - -- use 'Yggdroot/hiPairs' - use 'karb94/neoscroll.nvim' - use { 'sidebar-nvim/sidebar.nvim', requires = { 'kyazdani42/nvim-web-devicons' } } - -- use { 'kevinhwang91/nvim-ufo', requires = { 'kevinhwang91/promise-async' } } - use 'elihunter173/dirbuf.nvim' - use 'norcalli/nvim-terminal.lua' - use { 'j-hui/fidget.nvim', tag = 'legacy' } - use 'lervag/vimtex' - - -- lua - use 'nanotee/luv-vimdocs' - use 'milisims/nvim-luaref' - - -- Notes - -- use { 'nvim-neorg/neorg', requires = { 'nvim-lua/plenary.nvim' } } - use { 'mickael-menu/zk-nvim' } - - -- quickfix list - use 'kevinhwang91/nvim-bqf' - - -- distraction - use 'junegunn/limelight.vim' - use 'Pocco81/true-zen.nvim' - use 'shortcuts/no-neck-pain.nvim' - - -- how to vim - use 'ThePrimeagen/vim-be-good' - use 'nagy135/typebreak.nvim' - use 'm4xshen/hardtime.nvim' - - -- vcs - use { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' } } - use 'sindrets/diffview.nvim' - use 'tpope/vim-fugitive' - use 'ThePrimeagen/git-worktree.nvim' - use 'rhysd/conflict-marker.vim' - - -- http - use { 'NTBBloodbath/rest.nvim', requires = { 'nvim-lua/plenary.nvim' } } - - -- filetype - use 'tikhomirov/vim-glsl' - use 'windwp/nvim-ts-autotag' - use 'baskerville/vim-sxhkdrc' - -- use 'dart-lang/dart-vim-plugin' - use 'mfussenegger/nvim-jdtls' - use 'akinsho/pubspec-assist.nvim' - -- snippets - use 'L3MON4D3/luaSnip' - - -- completion - use { - 'hrsh7th/nvim-cmp', - requires = { - 'dmitmel/cmp-cmdline-history', - 'f3fora/cmp-spell', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-calc', - 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-nvim-lsp', - -- 'zbirenbaum/copilot-cmp', - 'hrsh7th/cmp-nvim-lsp-signature-help', - 'hrsh7th/cmp-nvim-lua', - 'hrsh7th/cmp-path', - 'petertriho/cmp-git', - 'ray-x/cmp-treesitter', - 'rcarriga/cmp-dap', - 'saadparwaiz1/cmp_luasnip', - 'tamago324/cmp-zsh', - 'uga-rosa/cmp-dictionary', - }, - } - use 'aduros/ai.vim' - - -- ui - use 'stevearc/dressing.nvim' - use 'rcarriga/nvim-notify' - - -- lsp - use 'neovim/nvim-lspconfig' - use 'williamboman/mason.nvim' - use 'williamboman/mason-lspconfig.nvim' - use 'b0o/schemastore.nvim' - use 'folke/neodev.nvim' - use { 'jose-elias-alvarez/null-ls.nvim', requires = { 'nvim-lua/plenary.nvim' } } - use 'lvimuser/lsp-inlayhints.nvim' - - -- use 'zbirenbaum/copilot.lua' - use 'Exafunction/codeium.vim' - - -- dap - use 'mfussenegger/nvim-dap' - use 'leoluz/nvim-dap-go' - use 'rcarriga/nvim-dap-ui' - use 'theHamsta/nvim-dap-virtual-text' - use 'mxsdev/nvim-dap-vscode-js' - use { - 'microsoft/vscode-js-debug', - opt = true, - run = 'npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out', - } - - -- treesitter - use 'nvim-treesitter/nvim-treesitter' - use 'nvim-treesitter/nvim-treesitter-textobjects' - use 'nvim-treesitter/nvim-treesitter-refactor' - use 'nvim-treesitter/playground' - use 'JoosepAlviste/nvim-ts-context-commentstring' - use 'lewis6991/nvim-treesitter-context' - use 'cshuaimin/ssr.nvim' - use 'ThePrimeagen/refactoring.nvim' - - -- telescope - use { - 'nvim-telescope/telescope.nvim', - requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim', 'kyazdani42/nvim-web-devicons' }, - } - use 'nvim-telescope/telescope-packer.nvim' - use 'nvim-telescope/telescope-fzy-native.nvim' - use 'nvim-telescope/telescope-dap.nvim' - use { 'aaronhallaert/advanced-git-search.nvim', requires = { 'tpope/vim-fugitive' } } - - -- Godot - use 'habamax/vim-godot' - - -- qmk - use 'codethread/qmk.nvim' - - -- personal - use 'GenesisTMS/trans.nvim' - use 'git@gitlab.com:gtms/dart-tools.nvim' - -- use '/home/tms/dev/nvim/plugins/dart-tools.nvim' - use 'git@gitlab.com:gtms/difftastic.nvim' - - -- database - use 'tpope/vim-dadbod' - use 'kristijanhusak/vim-dadbod-ui' - use 'kristijanhusak/vim-dadbod-completion' - end, +vim.cmd.packadd('paq-nvim') +local plugins = require('paq') + +return plugins { + { 'savq/paq-nvim', opt = true }, + + -- deps + 'kyazdani42/nvim-web-devicons', + 'nvim-lua/plenary.nvim', + 'nvim-lua/popup.nvim', + + -- EXP + 'yioneko/nvim-type-fmt', + + -- meta + 'tweekmonster/startuptime.vim', + + -- colorscheme + 'tjdevries/colorbuddy.nvim', + + -- spell + 'xxdavid/bez-diakritiky.vim', + + -- movements + 'ggandor/leap.nvim', + 'ggandor/leap-spooky.nvim', + + -- editor + 'tpope/vim-repeat', + 'kylechui/nvim-surround', + 'chaoren/vim-wordmotion', -- word counts with _,.,-,... + 'romgrk/equal.operator', -- equal text object `lefthand = righthand` + 'godlygeek/tabular', -- align + -- use 'windwp/nvim-autopairs' + 'numToStr/Comment.nvim', + 'mbbill/undotree', + -- use 'camspiers/Animate.vim' + 'nvchad/nvim-colorizer.lua', + 'rainbowhxch/beacon.nvim', + -- use 'Yggdroot/hiPairs' + 'karb94/neoscroll.nvim', + { 'sidebar-nvim/sidebar.nvim', requires = { 'kyazdani42/nvim-web-devicons' } }, + -- use { 'kevinhwang91/nvim-ufo', requires = { 'kevinhwang91/promise-async' } } + 'elihunter173/dirbuf.nvim', + 'norcalli/nvim-terminal.lua', + { 'j-hui/fidget.nvim', branch = 'legacy' }, + 'lervag/vimtex', + + -- lua + 'nanotee/luv-vimdocs', + 'milisims/nvim-luaref', + + -- Notes + -- { 'nvim-neorg/neorg', requires = { 'nvim-lua/plenary.nvim' } } + { 'mickael-menu/zk-nvim' }, + + -- quickfix list + 'kevinhwang91/nvim-bqf', + + -- distraction + 'junegunn/limelight.vim', + 'Pocco81/true-zen.nvim', + 'shortcuts/no-neck-pain.nvim', + + -- how to vim + 'ThePrimeagen/vim-be-good', + 'nagy135/typebreak.nvim', + 'm4xshen/hardtime.nvim', + + -- vcs + { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' } }, + 'sindrets/diffview.nvim', + 'tpope/vim-fugitive', + 'ThePrimeagen/git-worktree.nvim', + 'rhysd/conflict-marker.vim', + + -- http + { 'NTBBloodbath/rest.nvim', requires = { 'nvim-lua/plenary.nvim' } }, + + -- filetype + 'tikhomirov/vim-glsl', + 'windwp/nvim-ts-autotag', + 'baskerville/vim-sxhkdrc', + -- use 'dart-lang/dart-vim-plugin' + 'mfussenegger/nvim-jdtls', + 'akinsho/pubspec-assist.nvim', + -- snippets + 'L3MON4D3/luaSnip', + + -- completion + { + 'hrsh7th/nvim-cmp', + requires = { + 'dmitmel/cmp-cmdline-history', + 'f3fora/cmp-spell', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-calc', + 'hrsh7th/cmp-cmdline', + 'hrsh7th/cmp-nvim-lsp', + -- 'zbirenbaum/copilot-cmp', + 'hrsh7th/cmp-nvim-lsp-signature-help', + 'hrsh7th/cmp-nvim-lua', + 'hrsh7th/cmp-path', + 'petertriho/cmp-git', + 'ray-x/cmp-treesitter', + 'rcarriga/cmp-dap', + 'saadparwaiz1/cmp_luasnip', + 'tamago324/cmp-zsh', + 'uga-rosa/cmp-dictionary', + }, + }, + 'aduros/ai.vim', + + -- ui + 'stevearc/dressing.nvim', + 'rcarriga/nvim-notify', + + -- lsp + 'neovim/nvim-lspconfig', + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + 'b0o/schemastore.nvim', + 'folke/neodev.nvim', + { 'jose-elias-alvarez/null-ls.nvim', requires = { 'nvim-lua/plenary.nvim' } }, + 'lvimuser/lsp-inlayhints.nvim', + + -- use 'zbirenbaum/copilot.lua' + 'Exafunction/codeium.vim', + + -- dap + 'mfussenegger/nvim-dap', + 'leoluz/nvim-dap-go', + 'rcarriga/nvim-dap-ui', + 'theHamsta/nvim-dap-virtual-text', + 'mxsdev/nvim-dap-vscode-js', + { + 'microsoft/vscode-js-debug', + opt = true, + run = 'npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out', + }, + + -- treesitter + 'nvim-treesitter/nvim-treesitter', + 'nvim-treesitter/nvim-treesitter-textobjects', + 'nvim-treesitter/nvim-treesitter-refactor', + 'nvim-treesitter/playground', + 'JoosepAlviste/nvim-ts-context-commentstring', + 'lewis6991/nvim-treesitter-context', + 'cshuaimin/ssr.nvim', + 'ThePrimeagen/refactoring.nvim', + + -- telescope + { + 'nvim-telescope/telescope.nvim', + requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim', 'kyazdani42/nvim-web-devicons' }, + }, + 'nvim-telescope/telescope-fzy-native.nvim', + 'nvim-telescope/telescope-dap.nvim', + { 'aaronhallaert/advanced-git-search.nvim', requires = { 'tpope/vim-fugitive' } }, + + -- Godot + 'habamax/vim-godot', + + -- qmk + 'codethread/qmk.nvim', + + -- personal + 'GenesisTMS/trans.nvim', + { url = 'git@gitlab.com:gtms/dart-tools.nvim' }, + -- use '/home/tms/dev/nvim/plugins/dart-tools.nvim' + { url = 'git@gitlab.com:gtms/difftastic.nvim' }, + + -- database + 'tpope/vim-dadbod', + 'kristijanhusak/vim-dadbod-ui', + 'kristijanhusak/vim-dadbod-completion', } diff --git a/lua/tms/first_load.lua b/lua/tms/first_load.lua @@ -1,21 +1,26 @@ -local install_path = vim.fn.stdpath('data') .. '/site/pack/packer' +local install_path = vim.fn.stdpath('data') .. '/site/pack/paqs' + local name = function(repo) return string.match(repo, '%w+/(.*)') end + local clone = function(repo, path) - vim.api.cmd['!'] { args = { 'git', 'clone', '--depth=1', string.format('https://github.com/%s', repo), path } } + vim.fn.system { 'git', 'clone', '--depth=1', string.format('https://github.com/%s', repo), path } end + local install = function(repo, path) if vim.fn.isdirectory(path) == 0 then clone(repo, path) end end + local opt = function(repo) install(repo, string.format('%s/opt/%s', install_path, name(repo))) end + local start = function(repo) install(repo, string.format('%s/start/%s', install_path, name(repo))) end -opt('wbthomason/packer.nvim') +opt('savq/paq-nvim') start('tjdevries/colorbuddy.nvim') diff --git a/lua/tms/p/hexen.lua b/lua/tms/p/hexen.lua @@ -6,7 +6,9 @@ local M = {} -- Encode -local function byteToHex(b) return string.format('\\u%04X', b) end +local function byteToHex(b) + return string.format('\\u%04X', b) +end local function lineToHex(line) local r = {} @@ -22,20 +24,24 @@ end -- Decode -local function byteFromHex(h) return tonumber(h, 16) end +local function byteFromHex(h) + return tonumber(h, 16) +end local function lineFromHex(line) - local sub = string.gsub(line, "\\u(%x+)", function(hex) return utf8.char(byteFromHex(hex)) end) + local sub = string.gsub(line, '\\u(%x+)', function(hex) + return utf8.char(byteFromHex(hex)) + end) return sub end -- -- local function translate(filterFn) - local _s = fn.getpos("'<") - local start_range = {_s[2], _s[3]} - local _e = fn.getpos("'>") - local end_range = {_e[2], _e[3]} + local _s = fn.getpos('\'<') + local start_range = { _s[2], _s[3] } + local _e = fn.getpos('\'>') + local end_range = { _e[2], _e[3] } local lines = api.nvim_buf_get_lines(0, start_range[1] - 1, end_range[1], true) if #lines == 0 then @@ -57,9 +63,13 @@ end -- API -function M.decode() translate(lineFromHex) end +function M.decode() + translate(lineFromHex) +end -function M.encode() translate(lineToHex) end +function M.encode() + translate(lineToHex) +end return M