neovim

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

commit 349499a7dbd1cc77fe10f8705b7ec7449381decd
parent 711ea8dd465d7e381c7d7d0ba4c34d45d27c455e
Author: Tomas Nemec <nemi@skaut.cz>
Date:   Sat, 15 Oct 2022 07:30:58 +0200

update

Diffstat:
Mafter/plugin/difftastic.lua | 4++--
Mlua/tms/first_load.lua | 20+++++++++++++++-----
2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/after/plugin/difftastic.lua b/after/plugin/difftastic.lua @@ -128,10 +128,10 @@ local function show_diff(lang, lhs_file, rhs_file, chunks) -- vim.fn.bufload(oldbuf) vim.api.nvim_buf_call(lhs_buf, function() - vim.api.nvim_command(':0r ' .. lhs_file) + vim.cmd.read { range = { 0 }, args = { lhs_file } } end) vim.api.nvim_buf_call(rhs_buf, function() - vim.api.nvim_command(':0r ' .. rhs_file) + vim.cmd.read { range = { 0 }, args = { rhs_file } } end) vim.api.nvim_buf_set_name(lhs_buf, lhs_file) diff --git a/lua/tms/first_load.lua b/lua/tms/first_load.lua @@ -1,11 +1,21 @@ local install_path = vim.fn.stdpath('data') .. '/site/pack/packer' -local name = function(repo) return string.match(repo, '%w+/(.*)') end +local name = function(repo) + return string.match(repo, '%w+/(.*)') +end local clone = function(repo, path) - vim.api.nvim_command(string.format('!git clone --depth=1 https://github.com/%s %s', repo, path)) + vim.api.cmd['!'] { args = { '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 -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') start('lewis6991/impatient.nvim')