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

198
.gitmodules vendored
View File

@ -1,102 +1,102 @@
[submodule ".vim/bundle/vim-argwrap"] [submodule ".vim/bundle/vim-argwrap"]
path = pack/plugins/start/vim-argwrap path = pack/plugins/start/vim-argwrap
url = https://git.foosoft.net/alex/vim-argwrap.git url = https://git.foosoft.net/alex/vim-argwrap.git
[submodule ".vim/bundle/vim-sort-motion"] [submodule ".vim/bundle/vim-sort-motion"]
path = pack/plugins/start/vim-sort-motion path = pack/plugins/start/vim-sort-motion
url = https://github.com/christoomey/vim-sort-motion.git url = https://github.com/christoomey/vim-sort-motion.git
[submodule ".vim/bundle/vim-go"] [submodule ".vim/bundle/vim-go"]
path = pack/plugins/start/vim-go path = pack/plugins/start/vim-go
url = https://github.com/fatih/vim-go.git url = https://github.com/fatih/vim-go.git
[submodule ".vim/bundle/vim-easy-align"] [submodule ".vim/bundle/vim-easy-align"]
path = pack/plugins/start/vim-easy-align path = pack/plugins/start/vim-easy-align
url = https://github.com/junegunn/vim-easy-align.git url = https://github.com/junegunn/vim-easy-align.git
[submodule ".vim/bundle/vim-indent-object"] [submodule ".vim/bundle/vim-indent-object"]
path = pack/plugins/start/vim-indent-object path = pack/plugins/start/vim-indent-object
url = https://github.com/michaeljsmith/vim-indent-object.git url = https://github.com/michaeljsmith/vim-indent-object.git
[submodule ".vim/bundle/vim-better-whitespace"] [submodule ".vim/bundle/vim-better-whitespace"]
path = pack/plugins/start/vim-better-whitespace path = pack/plugins/start/vim-better-whitespace
url = https://github.com/ntpeters/vim-better-whitespace.git url = https://github.com/ntpeters/vim-better-whitespace.git
[submodule ".vim/bundle/vim-abolish"] [submodule ".vim/bundle/vim-abolish"]
path = pack/plugins/start/vim-abolish path = pack/plugins/start/vim-abolish
url = https://github.com/tpope/vim-abolish.git url = https://github.com/tpope/vim-abolish.git
[submodule ".vim/bundle/vim-repeat"] [submodule ".vim/bundle/vim-repeat"]
path = pack/plugins/start/vim-repeat path = pack/plugins/start/vim-repeat
url = https://github.com/tpope/vim-repeat url = https://github.com/tpope/vim-repeat
[submodule ".vim/bundle/vim-surround"] [submodule ".vim/bundle/vim-surround"]
path = pack/plugins/start/vim-surround path = pack/plugins/start/vim-surround
url = https://github.com/tpope/vim-surround url = https://github.com/tpope/vim-surround
[submodule ".vim/bundle/vim-unimpaired"] [submodule ".vim/bundle/vim-unimpaired"]
path = pack/plugins/start/vim-unimpaired path = pack/plugins/start/vim-unimpaired
url = https://github.com/tpope/vim-unimpaired.git url = https://github.com/tpope/vim-unimpaired.git
[submodule ".vim/bundle/vim-dirvish"] [submodule ".vim/bundle/vim-dirvish"]
path = pack/plugins/start/vim-dirvish path = pack/plugins/start/vim-dirvish
url = https://github.com/justinmk/vim-dirvish.git url = https://github.com/justinmk/vim-dirvish.git
[submodule ".vim/bundle/vim-signify"] [submodule ".vim/bundle/vim-signify"]
path = pack/plugins/start/vim-signify path = pack/plugins/start/vim-signify
url = https://github.com/mhinz/vim-signify.git url = https://github.com/mhinz/vim-signify.git
[submodule ".vim/bundle/vim-angry"] [submodule ".vim/bundle/vim-angry"]
path = pack/plugins/start/vim-angry path = pack/plugins/start/vim-angry
url = https://github.com/b4winckler/vim-angry.git url = https://github.com/b4winckler/vim-angry.git
[submodule ".vim/pack/plugins/start/vim-fugitive"] [submodule ".vim/pack/plugins/start/vim-fugitive"]
path = pack/plugins/start/vim-fugitive path = pack/plugins/start/vim-fugitive
url = https://github.com/tpope/vim-fugitive.git url = https://github.com/tpope/vim-fugitive.git
[submodule "pack/plugins/start/vim-polyglot"] [submodule "pack/plugins/start/vim-polyglot"]
path = pack/plugins/start/vim-polyglot path = pack/plugins/start/vim-polyglot
url = https://github.com/sheerun/vim-polyglot url = https://github.com/sheerun/vim-polyglot
[submodule "pack/plugins/opt/cmp-nvim-lsp"] [submodule "pack/plugins/opt/cmp-nvim-lsp"]
path = pack/plugins/start/cmp-nvim-lsp path = pack/plugins/start/cmp-nvim-lsp
url = https://github.com/hrsh7th/cmp-nvim-lsp.git url = https://github.com/hrsh7th/cmp-nvim-lsp.git
[submodule "pack/plugins/opt/nvim-lspconfig"] [submodule "pack/plugins/opt/nvim-lspconfig"]
path = pack/plugins/start/nvim-lspconfig path = pack/plugins/start/nvim-lspconfig
url = https://github.com/neovim/nvim-lspconfig.git url = https://github.com/neovim/nvim-lspconfig.git
[submodule "pack/plugins/opt/nvim-cmp"] [submodule "pack/plugins/opt/nvim-cmp"]
path = pack/plugins/start/nvim-cmp path = pack/plugins/start/nvim-cmp
url = https://github.com/hrsh7th/nvim-cmp.git url = https://github.com/hrsh7th/nvim-cmp.git
[submodule "pack/plugins/opt/cmp-vsnip"] [submodule "pack/plugins/opt/cmp-vsnip"]
path = pack/plugins/start/cmp-vsnip path = pack/plugins/start/cmp-vsnip
url = https://github.com/hrsh7th/cmp-vsnip url = https://github.com/hrsh7th/cmp-vsnip
[submodule "pack/plugins/opt/vim-vsnip"] [submodule "pack/plugins/opt/vim-vsnip"]
path = pack/plugins/start/vim-vsnip path = pack/plugins/start/vim-vsnip
url = https://github.com/hrsh7th/vim-vsnip url = https://github.com/hrsh7th/vim-vsnip
[submodule "pack/plugins/start/suda.vim"] [submodule "pack/plugins/start/suda.vim"]
path = pack/plugins/start/suda.vim path = pack/plugins/start/suda.vim
url = https://github.com/lambdalisue/suda.vim.git url = https://github.com/lambdalisue/suda.vim.git
[submodule "pack/plugins/start/plenary.nvim"] [submodule "pack/plugins/start/plenary.nvim"]
path = pack/plugins/start/plenary.nvim path = pack/plugins/start/plenary.nvim
url = https://github.com/nvim-lua/plenary.nvim.git url = https://github.com/nvim-lua/plenary.nvim.git
[submodule "pack/plugins/start/vim-rooter"] [submodule "pack/plugins/start/vim-rooter"]
path = pack/plugins/start/vim-rooter path = pack/plugins/start/vim-rooter
url = https://github.com/airblade/vim-rooter.git url = https://github.com/airblade/vim-rooter.git
[submodule "pack/plugins/start/fzf.vim"] [submodule "pack/plugins/start/neodev.nvim"]
path = pack/plugins/start/fzf.vim path = pack/plugins/start/neodev.nvim
url = https://github.com/junegunn/fzf.vim.git url = https://github.com/folke/neodev.nvim.git
[submodule "pack/plugins/start/fzf"] [submodule "pack/plugins/start/cmp-nvim-lsp-signature-help"]
path = pack/plugins/start/fzf path = pack/plugins/start/cmp-nvim-lsp-signature-help
url = https://github.com/junegunn/fzf.git url = https://github.com/hrsh7th/cmp-nvim-lsp-signature-help.git
[submodule "pack/plugins/start/neodev.nvim"] [submodule "pack/plugins/start/nightfox.nvim"]
path = pack/plugins/start/neodev.nvim path = pack/plugins/start/nightfox.nvim
url = https://github.com/folke/neodev.nvim.git url = https://github.com/EdenEast/nightfox.nvim.git
[submodule "pack/plugins/start/cmp-nvim-lsp-signature-help"] [submodule "pack/plugins/start/lualine.nvim"]
path = pack/plugins/start/cmp-nvim-lsp-signature-help path = pack/plugins/start/lualine.nvim
url = https://github.com/hrsh7th/cmp-nvim-lsp-signature-help.git url = https://github.com/nvim-lualine/lualine.nvim.git
[submodule "pack/plugins/start/nightfox.nvim"] [submodule "pack/plugins/start/Comment.nvim"]
path = pack/plugins/start/nightfox.nvim path = pack/plugins/start/Comment.nvim
url = https://github.com/EdenEast/nightfox.nvim.git url = https://github.com/numToStr/Comment.nvim.git
[submodule "pack/plugins/start/lualine.nvim"] [submodule "pack/plugins/start/guid.nvim"]
path = pack/plugins/start/lualine.nvim path = pack/plugins/start/guid.nvim
url = https://github.com/nvim-lualine/lualine.nvim.git url = https://git.foosoft.net/alex/guid.nvim.git
[submodule "pack/plugins/start/Comment.nvim"] [submodule "pack/plugins/start/revolver.nvim"]
path = pack/plugins/start/Comment.nvim path = pack/plugins/start/revolver.nvim
url = https://github.com/numToStr/Comment.nvim.git url = https://git.foosoft.net/alex/revolver.nvim.git
[submodule "pack/plugins/start/guid.nvim"] [submodule "pack/plugins/start/vim-quickhl"]
path = pack/plugins/start/guid.nvim path = pack/plugins/start/vim-quickhl
url = https://git.foosoft.net/alex/guid.nvim.git url = https://github.com/t9md/vim-quickhl.git
[submodule "pack/plugins/start/revolver.nvim"] [submodule "pack/plugins/start/vim-jdaddy"]
path = pack/plugins/start/revolver.nvim path = pack/plugins/start/vim-jdaddy
url = https://git.foosoft.net/alex/revolver.nvim.git url = https://github.com/tpope/vim-jdaddy.git
[submodule "pack/plugins/start/vim-quickhl"] [submodule "pack/plugins/start/fzf-lua"]
path = pack/plugins/start/vim-quickhl path = pack/plugins/start/fzf-lua
url = https://github.com/t9md/vim-quickhl.git url = https://github.com/ibhagwan/fzf-lua.git
[submodule "pack/plugins/start/argonaut.nvim"] [submodule "pack/plugins/start/argonaut.nvim"]
path = pack/plugins/start/argonaut.nvim path = pack/plugins/start/argonaut.nvim
url = https://git.foosoft.net/alex/argonaut.nvim.git url = https://git.foosoft.net/alex/argonaut.nvim.git

View File

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

View File

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

View File

@ -7,20 +7,25 @@ end)
-- comment.nvim -- comment.nvim
require('Comment').setup() require('Comment').setup()
-- fzf.vim -- fzf-lua
if vim.fn.executable('fzf') == 1 then if vim.fn.executable('fzf') == 1 then
vim.cmd([[ local fzf_lua = require('fzf-lua')
command! -bang -nargs=* Fs fzf_lua.setup({
\ call fzf#vim#grep( winopts = {
\ 'git grep --line-number -- '.shellescape(<q-args>), 0, preview = {
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0) winopts = {
]]) cursorline = false,
},
},
},
})
vim.keymap.set('n', '<leader>fg', vim.cmd.GFiles) vim.keymap.set('n', '<leader>fb', fzf_lua.buffers)
vim.keymap.set('n', '<leader>fs', vim.cmd.Fs) vim.keymap.set('n', '<leader>fg', fzf_lua.git_files)
vim.keymap.set('n', '<leader>fh', vim.cmd.History) vim.keymap.set('n', '<leader>fh', fzf_lua.oldfiles)
vim.keymap.set('n', '<leader>fb', vim.cmd.Buffers) vim.keymap.set('n', '<leader>fl', fzf_lua.lines)
vim.keymap.set('n', '<leader>fl', vim.cmd.Lines) vim.keymap.set('n', '<leader>fp', fzf_lua.grep)
vim.keymap.set('n', '<leader>fs', fzf_lua.live_grep_native)
end end
-- guid.nvim -- 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) local function invoke(args)
output = vim.fn.system(table.concat(args, ' ')) local output = vim.fn.system(table.concat(args, ' '))
return string.gsub(output, '%s+$', '') return string.gsub(output, '%s+$', '')
end 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'}) local author = invoke({'git', 'config', 'user.name'})
if #author == 0 then
print('User name is not set')
return
end
local hash = invoke{ local hash = invoke{
'git', 'git',
@ -22,43 +46,42 @@ local function get_branch_parent()
end end
end end
-- UnAlign local function git_edit_paths(names)
vim.api.nvim_create_user_command( local root_dir = invoke({'git', 'rev-parse', '--show-toplevel'})
'UnAlign', for name in string.gmatch(names, '[^\r\n]+') do
function(ctx) vim.cmd(string.format('e %s/%s', root_dir, name))
vim.cmd(ctx.line1 .. ',' .. ctx.line2 .. 's/\\(\\S\\+\\)\\s\\{2,\\}/\\1 /g') end
end, end
{range = '%'}
)
-- TopicEdit -- GitConflicts
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'TopicEdit', 'GitConflicts',
function(ctx) function()
local hash = get_branch_parent() git_edit_paths(invoke({'git', 'diff', '--name-only', '--diff-filter=U'}))
if hash then
local names = invoke({'git', 'diff', '--name-only', hash})
if #names == 0 then
print('No files changed since previous author')
else
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
end, end,
{} {}
) )
-- TopicDiff -- GitTopicEdit
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'TopicDiff', 'GitTopicEdit',
function(ctx) 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 if hash then
invoke({'git', 'difftool', '-d', hash}) invoke({'git', 'difftool', '-d', hash})
end end
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