Compare commits

..

No commits in common. "4cfae23fc0c8a3968e72bafc89050f47ba49cca2" and "77ac354da5d475d03eb51c076008f95d214b7ee6" have entirely different histories.

21 changed files with 165 additions and 189 deletions

12
.gitmodules vendored
View File

@ -67,6 +67,12 @@
[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"]
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"] [submodule "pack/plugins/start/neodev.nvim"]
path = pack/plugins/start/neodev.nvim path = pack/plugins/start/neodev.nvim
url = https://github.com/folke/neodev.nvim.git url = https://github.com/folke/neodev.nvim.git
@ -91,12 +97,6 @@
[submodule "pack/plugins/start/vim-quickhl"] [submodule "pack/plugins/start/vim-quickhl"]
path = pack/plugins/start/vim-quickhl path = pack/plugins/start/vim-quickhl
url = https://github.com/t9md/vim-quickhl.git 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"] [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>bp|bd #<cr>') vim.keymap.set('n', '<bs>', '<cmd>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,9 +1,13 @@
vim.cmd.GuiTabline(0) vim.cmd.GuiTabline(0)
vim.cmd.GuiPopupmenu(0) vim.cmd.GuiPopupmenu(0)
if vim.fn.has('win32') == 1 then local font
vim.cmd.Guifont({ if vim.fn.has('unix') == 1 then
args = {'Cascadia Mono:h10'}, font = 'Terminus:h12'
bang = true elseif vim.fn.has('win32') == 1 then
}) font = 'Lucida Console:h8'
end
if font then
vim.cmd.Guifont({args = {font}, bang = true})
end end

View File

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

View File

@ -1,34 +1,10 @@
-- 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)
local output = vim.fn.system(table.concat(args, ' ')) output = vim.fn.system(table.concat(args, ' '))
return string.gsub(output, '%s+$', '') return string.gsub(output, '%s+$', '')
end end
local function git_parent_branch(parent_branch) local function get_branch_parent()
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',
@ -46,42 +22,43 @@ local function git_parent_branch(parent_branch)
end end
end end
local function git_edit_paths(names) -- 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 root_dir = invoke({'git', 'rev-parse', '--show-toplevel'}) local root_dir = invoke({'git', 'rev-parse', '--show-toplevel'})
for name in string.gmatch(names, '[^\r\n]+') do for name in string.gmatch(names, '[^\r\n]+') do
vim.cmd(string.format('e %s/%s', root_dir, name)) vim.cmd(string.format('e %s/%s', root_dir, name))
end end
end end
end
-- GitConflicts
vim.api.nvim_create_user_command(
'GitConflicts',
function()
git_edit_paths(invoke({'git', 'diff', '--name-only', '--diff-filter=U'}))
end, end,
{} {}
) )
-- GitTopicEdit -- TopicDiff
vim.api.nvim_create_user_command( vim.api.nvim_create_user_command(
'GitTopicEdit', 'TopicDiff',
function(ctx) function(ctx)
local hash = git_parent_branch(ctx.args) local hash = get_branch_parent()
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 = '?'} {}
) )

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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