Merge branch 'master' into dev

This commit is contained in:
Alex Yatskov 2024-04-20 09:05:14 -07:00
commit 4cfae23fc0
21 changed files with 188 additions and 164 deletions

12
.gitmodules vendored
View File

@ -67,12 +67,6 @@
[submodule "pack/plugins/start/vim-rooter"]
path = pack/plugins/start/vim-rooter
url = https://github.com/airblade/vim-rooter.git
[submodule "pack/plugins/start/fzf.vim"]
path = pack/plugins/start/fzf.vim
url = https://github.com/junegunn/fzf.vim.git
[submodule "pack/plugins/start/fzf"]
path = pack/plugins/start/fzf
url = https://github.com/junegunn/fzf.git
[submodule "pack/plugins/start/neodev.nvim"]
path = pack/plugins/start/neodev.nvim
url = https://github.com/folke/neodev.nvim.git
@ -97,6 +91,12 @@
[submodule "pack/plugins/start/vim-quickhl"]
path = pack/plugins/start/vim-quickhl
url = https://github.com/t9md/vim-quickhl.git
[submodule "pack/plugins/start/vim-jdaddy"]
path = pack/plugins/start/vim-jdaddy
url = https://github.com/tpope/vim-jdaddy.git
[submodule "pack/plugins/start/fzf-lua"]
path = pack/plugins/start/fzf-lua
url = https://github.com/ibhagwan/fzf-lua.git
[submodule "pack/plugins/start/argonaut.nvim"]
path = pack/plugins/start/argonaut.nvim
url = https://git.foosoft.net/alex/argonaut.nvim.git

View File

@ -36,7 +36,7 @@ vim.opt.writebackup = false
-- common keymaps
vim.keymap.set('i', '<c-c>', '<esc>')
vim.keymap.set('n', '<bs>', '<cmd>bd<cr>')
vim.keymap.set('n', '<bs>', '<cmd>bp|bd #<cr>')
vim.keymap.set('n', '<c-c><c-c>', '<cmd>nohlsearch<cr>')
vim.keymap.set('n', '<leader><leader>', '<cmd>b#<cr>')
vim.keymap.set('n', '<leader>w', '<cmd>w<cr>')

View File

@ -1,13 +1,9 @@
vim.cmd.GuiTabline(0)
vim.cmd.GuiPopupmenu(0)
local font
if vim.fn.has('unix') == 1 then
font = 'Terminus:h12'
elseif vim.fn.has('win32') == 1 then
font = 'Lucida Console:h8'
end
if font then
vim.cmd.Guifont({args = {font}, bang = true})
if vim.fn.has('win32') == 1 then
vim.cmd.Guifont({
args = {'Cascadia Mono:h10'},
bang = true
})
end

View File

@ -7,20 +7,25 @@ end)
-- comment.nvim
require('Comment').setup()
-- fzf.vim
-- fzf-lua
if vim.fn.executable('fzf') == 1 then
vim.cmd([[
command! -bang -nargs=* Fs
\ call fzf#vim#grep(
\ 'git grep --line-number -- '.shellescape(<q-args>), 0,
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
]])
local fzf_lua = require('fzf-lua')
fzf_lua.setup({
winopts = {
preview = {
winopts = {
cursorline = false,
},
},
},
})
vim.keymap.set('n', '<leader>fg', vim.cmd.GFiles)
vim.keymap.set('n', '<leader>fs', vim.cmd.Fs)
vim.keymap.set('n', '<leader>fh', vim.cmd.History)
vim.keymap.set('n', '<leader>fb', vim.cmd.Buffers)
vim.keymap.set('n', '<leader>fl', vim.cmd.Lines)
vim.keymap.set('n', '<leader>fb', fzf_lua.buffers)
vim.keymap.set('n', '<leader>fg', fzf_lua.git_files)
vim.keymap.set('n', '<leader>fh', fzf_lua.oldfiles)
vim.keymap.set('n', '<leader>fl', fzf_lua.lines)
vim.keymap.set('n', '<leader>fp', fzf_lua.grep)
vim.keymap.set('n', '<leader>fs', fzf_lua.live_grep_native)
end
-- guid.nvim

View File

@ -1,10 +1,34 @@
-- UnAlign
vim.api.nvim_create_user_command(
'UnAlign',
function(ctx)
vim.cmd(ctx.line1 .. ',' .. ctx.line2 .. 's/\\(\\S\\+\\)\\s\\{2,\\}/\\1 /g')
end,
{range = '%'}
)
local function invoke(args)
output = vim.fn.system(table.concat(args, ' '))
local output = vim.fn.system(table.concat(args, ' '))
return string.gsub(output, '%s+$', '')
end
local function get_branch_parent()
local function git_parent_branch(parent_branch)
for _, branch in ipairs({'master', 'main'}) do
local output = invoke({'git', 'rev-parse', '--verify', branch})
if not string.find(output, 'fatal') then
parent_branch = branch
end
end
if parent_branch ~= '' then
return parent_branch
end
local author = invoke({'git', 'config', 'user.name'})
if #author == 0 then
print('User name is not set')
return
end
local hash = invoke{
'git',
@ -22,43 +46,42 @@ local function get_branch_parent()
end
end
-- UnAlign
vim.api.nvim_create_user_command(
'UnAlign',
function(ctx)
vim.cmd(ctx.line1 .. ',' .. ctx.line2 .. 's/\\(\\S\\+\\)\\s\\{2,\\}/\\1 /g')
end,
{range = '%'}
)
-- TopicEdit
vim.api.nvim_create_user_command(
'TopicEdit',
function(ctx)
local hash = get_branch_parent()
if hash then
local names = invoke({'git', 'diff', '--name-only', hash})
if #names == 0 then
print('No files changed since previous author')
else
local function git_edit_paths(names)
local root_dir = invoke({'git', 'rev-parse', '--show-toplevel'})
for name in string.gmatch(names, '[^\r\n]+') do
vim.cmd(string.format('e %s/%s', root_dir, name))
end
end
end
-- GitConflicts
vim.api.nvim_create_user_command(
'GitConflicts',
function()
git_edit_paths(invoke({'git', 'diff', '--name-only', '--diff-filter=U'}))
end,
{}
)
-- TopicDiff
-- GitTopicEdit
vim.api.nvim_create_user_command(
'TopicDiff',
'GitTopicEdit',
function(ctx)
local hash = get_branch_parent()
local hash = git_parent_branch(ctx.args)
if hash then
git_edit_paths(invoke({'git', 'diff', '--name-only', hash}))
end
end,
{nargs = '?'}
)
-- GitTopicDiff
vim.api.nvim_create_user_command(
'GitTopicDiff',
function(ctx)
local hash = git_parent_branch(ctx.args)
if hash then
invoke({'git', 'difftool', '-d', hash})
end
end,
{}
{nargs = '?'}
)

@ -1 +0,0 @@
Subproject commit 90b818788249bb080f9eddcc4b36ad4080b55c5c

@ -0,0 +1 @@
Subproject commit 62cb8f37b3a017e6b2401726c96e02498f332b70

@ -1 +0,0 @@
Subproject commit f6cb5b17897ff0c38f60fecd4b529678bcfec259

@ -1 +1 @@
Subproject commit 7d131a8d3ba5016229e8a1d08bf8782acea98852
Subproject commit 0a5a66803c7407767b799067986b4dc3036e1983

@ -1 +1 @@
Subproject commit b49b976cf2c28cd8283e9d74cb10885f6dd9e3d0
Subproject commit ce9a2e8eaba5649b553529c5498acb43a6c317cd

@ -1 +1 @@
Subproject commit a408e6bb101066952b81de9c11be367114bd561f
Subproject commit ce0cdf8538c8c0b9c8fb2884d3d1090c8faf515d

@ -1 +1 @@
Subproject commit 04e0ca376d6abdbfc8b52180f8ea236cbfddf782
Subproject commit ce16de5665c766f39c271705b17fff06f7bcb84f

@ -1 +1 @@
Subproject commit 41f40dc4b86f3e166cf08115f621001972565a20
Subproject commit 9266dc26862d8f3556c2ca77602e811472b4c5b8

@ -1 +1 @@
Subproject commit 4f71c0c4a196ceb656c824a70792f3df3ce6bb6d
Subproject commit 8aad4396840be7fc42896e3011751b7609ca4119

@ -1 +1 @@
Subproject commit 8b0fc3711760195aba104e2d190cff9af8267052
Subproject commit d0ccc1a5172f6a26182238767e60e08b931d11fa

@ -1 +1 @@
Subproject commit 0966b866580ec5cc8fbc26ee396a516d72600db5
Subproject commit 3851bedb7f191b9a4a5531000b6fc0a8795cc9bb

@ -1 +1 @@
Subproject commit 12dd6316974f71ce333e360c0260b4e1f81169c3
Subproject commit 9815a55dbcd817784458df7a18acacc6f82b1241

@ -1 +1 @@
Subproject commit fab00f7c0f3a08e860e39c7adeb8fbe849921a98
Subproject commit dac8e5c2d85926df92672bf2afb4fc48656d96c7

@ -1 +1 @@
Subproject commit 76cab3355fee04e750f69ccd34787b2570c6de7a
Subproject commit feef9b31507f8e942bcd21f9e1f22d587c83c72d

@ -0,0 +1 @@
Subproject commit 23b67752cb869dd9c8f3109173b69aa96a1f3acf

@ -1 +1 @@
Subproject commit 7d538b77a5a8806e344b057f8846f6d0c035efa9
Subproject commit 8670143f9e12ed1cd3c9b2c54f345cdd9a4baac3