Skip to content

Commit

Permalink
wip (cmp, lsp)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucpr committed May 8, 2024
1 parent 6f723be commit fc0f6a0
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 584 deletions.
4 changes: 2 additions & 2 deletions nvim/dpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class Config extends BaseConfig {
"toml",
"load",
{
path: await fn.expand(args.denops, dotfilesDir + "tomls/cmp.toml"),
path: await fn.expand(args.denops, dotfilesDir + "lua/plugins/completion/dein_lazy.toml"),
options: {
lazy: true,
},
Expand All @@ -171,7 +171,7 @@ export class Config extends BaseConfig {
"toml",
"load",
{
path: await fn.expand(args.denops, dotfilesDir + "lua/plugins/completion/dein_lazy.toml"),
path: await fn.expand(args.denops, dotfilesDir + "lua/plugins/lsp/dein_lazy.toml"),
options: {
lazy: true,
},
Expand Down
40 changes: 40 additions & 0 deletions nvim/lua/plugins/completion/copilot.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--- lua_source {{{
vim.g.copilot_filetypes = {
gitcommit = true,
markdown = true,
yaml = true,
text = true,
}
vim.g.copilot_no_tab_map = true

vim.keymap.set(
"i",
"<C-c>",
'copilot#Accept()',
{ silent = true, expr = true, script = true, replace_keycodes = false }
)
vim.keymap.set(
"i",
"<C-x>",
'<Plug>(copilot-dismiss)'
)
--- }}}

--- lua_post_source {{{
local function append_diff()
-- Get the Git repository root directory
local git_dir = vim.fn.FugitiveGitDir()
local git_root = vim.fn.fnamemodify(git_dir, ':h')
-- Get the diff of the staged changes relative to the Git repository root
local diff = vim.fn.system('git -C ' .. git_root .. ' diff --cached')
-- Add a comment character to each line of the diff
local comment_diff = table.concat(vim.tbl_map(function(line)
return '# ' .. line
end, vim.split(diff, '\n')), "\n")
-- Append the diff to the commit message
vim.api.nvim_buf_set_lines(0, -1, -1, false, vim.split(comment_diff, '\n'))
end
vim.cmd [[
autocmd BufReadPost COMMIT_EDITMSG call lua append_diff()
]]
--- }}}
47 changes: 47 additions & 0 deletions nvim/lua/plugins/completion/dein_lazy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
[[plugins]]
repo = 'cohama/lexima.vim'
on_event = 'InsertEnter'

[[plugins]]
repo = 'hrsh7th/nvim-cmp'
on_event = 'VimEnter'
hooks_file = '$XDG_CONFIG_HOME/nvim/lua/plugins/completion/nvim-cmp.lua'

[[plugins]]
repo = 'hrsh7th/cmp-nvim-lsp'
on_event = 'VimEnter'

[[plugins]]
repo = 'hrsh7th/cmp-buffer'
on_event = 'VimEnter'

[[plugins]]
repo = 'hrsh7th/cmp-path'
on_event = 'VimEnter'

[[plugins]]
repo = 'hrsh7th/cmp-cmdline'
on_event = 'VimEnter'

[[plugins]]
repo = 'hrsh7th/cmp-nvim-lsp-signature-help'
on_event = 'VimEnter'

[[plugins]]
repo = 'hrsh7th/cmp-nvim-lsp-document-symbol'
on_event = 'VimEnter'

[[plugins]]
repo = 'onsails/lspkind.nvim'
on_event = 'VimEnter'

[[plugins]]
repo = 'hrsh7th/vim-vsnip'
on_event = 'VimEnter'
hooks_file = '$XDG_CONFIG_HOME/nvim/lua/plugins/completion/vim-vsnip.lua'

[[plugins]]
repo = 'hrsh7th/cmp-vsnip'
on_event = 'VimEnter'

[[plugins]]
repo = 'github/copilot.vim'
on_event = 'VimEnter'
hooks_file = '$XDG_CONFIG_HOME/nvim/lua/plugins/completion/copilot.lua'
Loading

0 comments on commit fc0f6a0

Please sign in to comment.