Skip to content

Commit

Permalink
ddcを良い感じに
Browse files Browse the repository at this point in the history
  • Loading branch information
Akihiro Saiki committed Jul 9, 2023
1 parent 41ac2ff commit 2079748
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
6 changes: 3 additions & 3 deletions nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"bufferline.nvim": { "branch": "main", "commit": "bf2f6b7edd0abf6b0732f5e5c0a8f30e51611c75" },
"ddc-filter-converter_remove_overlap": { "branch": "main", "commit": "5597c2cfeb9d3a12a889cf043ee62ce49e12005a" },
"ddc-filter-converter_truncate_abbr": { "branch": "main", "commit": "182fe925e3d583d14a333dca1b8f5a52af1aa701" },
"ddc-filter-matcher_head": { "branch": "main", "commit": "16727bb785c7fdbd4c5ed7a5f3da8d2f7355f8fd" },
"ddc-filter-sorter_rank": { "branch": "main", "commit": "a4009777e14dc69e73478dde11fb82ca8a36d589" },
"ddc-source-around": { "branch": "main", "commit": "5093825ca9079a10d2e9856e929363f3494354f9" },
Expand All @@ -9,7 +10,7 @@
"ddc-source-file": { "branch": "main", "commit": "f10a559015f1bf1779f9eb6d7db2ad7af6eff89e" },
"ddc-source-nvim-lsp": { "branch": "main", "commit": "738b86b5c16ee8f396d9437e6aea17780e325ef1" },
"ddc-source-vsnip": { "branch": "main", "commit": "d3c429fd91f432ab5478cc343f9b61bacac74f8e" },
"ddc-ui-pum": { "branch": "main", "commit": "e8eb779ab052b66627e177ee8334910ebe5cae73" },
"ddc-ui-native": { "branch": "main", "commit": "758eca2be8654f3d2b451aa7dc756ce39855568d" },
"ddc.vim": { "branch": "main", "commit": "6c1de37d138d376326c9bbc1ed0b66d6a244189a" },
"denops-popup-preview.vim": { "branch": "main", "commit": "0f22d5ea1058a2b6dfc5185d729bdf0ad9aa7147" },
"denops-signature_help": { "branch": "main", "commit": "8a8df4cb1969c91737b341c3110368b9186c621f" },
Expand All @@ -20,7 +21,7 @@
"gin.vim": { "branch": "main", "commit": "fd28fa823bb41143d9af822b27f82bc873a85021" },
"lazy.nvim": { "branch": "main", "commit": "da8b00581a52f5f87ad2aba9f52171fda7491f18" },
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "82685fdd0f67a694b244cb058b83761f54664d68" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "fa50cc2540210845fccc3c0b9762417189a563a2" },
"mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" },
"material.nvim": { "branch": "main", "commit": "c7631d373d3ae02ef502ec6b8620a8ff36ab922e" },
"neo-tree.nvim": { "branch": "v2.x", "commit": "7f6fa04dbd8e8c79d1af33bc90e856b65d8641da" },
Expand All @@ -33,7 +34,6 @@
"nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" },
"nvim-window-picker": { "branch": "main", "commit": "5902827d0e338890a22849e2f18dc80d1cc1a8db" },
"plenary.nvim": { "branch": "master", "commit": "bda256fab0eb66a15e8190937e417e6a14ee5d72" },
"pum.vim": { "branch": "main", "commit": "bcacdfb3db540bcfc58deff7995521f5f6adbfaf" },
"vim-gitgutter": { "branch": "main", "commit": "4a7ca061af2b199a9b97041270611439e8fa2b02" },
"vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" },
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
Expand Down
57 changes: 32 additions & 25 deletions nvim/lua/plugins/ddc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ return {
lazy = false,
dependencies = {
"vim-denops/denops.vim",
"Shougo/pum.vim",
"Shougo/ddc-ui-pum",
--"Shougo/pum.vim",
--"Shougo/ddc-ui-pum",
"Shougo/ddc-ui-native",
"Shougo/ddc-source-around",
"Shougo/ddc-source-nvim-lsp",
"LumaKernel/ddc-source-file",
Expand All @@ -16,26 +17,28 @@ return {
"Shougo/ddc-source-cmdline-history",
"Shougo/ddc-filter-matcher_head",
"Shougo/ddc-filter-sorter_rank",
"Shougo/ddc-filter-converter_truncate_abbr",
"Shougo/ddc-filter-converter_remove_overlap",
"matsui54/denops-popup-preview.vim",
"matsui54/denops-signature_help",
},
config = function()
local patch_global = vim.fn['ddc#custom#patch_global']
patch_global("ui", "pum")
patch_global("ui", "native")
--patch_global("ui", "pum")
patch_global("sources", {
'around',
'nvim-lsp',
'vsnip',
'file',
'around',
'cmdline',
'cmdline-history',
})
patch_global("sourceOptions", {
_ = {
matchers = { "matcher_head" },
sorters = { "sorter_rank" },
converters = { "converter_remove_overlap" },
converters = { "converter_truncate_abbr", "converter_remove_overlap" },
ignoreCase = true,
},
around = {
Expand Down Expand Up @@ -64,29 +67,33 @@ return {
"CmdlineEnter",
"CmdlineChanged",
})

vim.cmd([[inoremap <silent><expr> <TAB> ddc#map#pum_visible() ? '<C-n>' : (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ? '<TAB>' : ddc#map#manual_complete()]])
vim.cmd([[inoremap <expr><S-TAB> ddc#map#pum_visible() ? '<C-p>' : '<C-h>']])

vim.fn['ddc#enable']()
end,
},
{
'Shougo/pum.vim',
keys = {
{ "<C-n>", ":call pum#map#select_relative(+1)<CR>", mode = "i" },
{ "<C-p>", ":call pum#map#select_relative(-1)<CR>", mode = "i" },
{ "<C-y>", ":call pum#map#confirm()<CR>", mode = "i" },
{ "<C-q>", ":call pum#map#cancel()<CR>", mode = "i" },
{ "<Tab>", ":call pum#map#insert_relative(+1)<CR>", mode = "c" },
{ "<S-Tab>", ":call pum#map#insert_relative(-1)<CR>", mode = "c" },
},
config = function()
vim.fn['pum#set_option']({
use_complete = true,
border = "rounded",
auto_select = true,
padding = true,
scrollbar_char = "",
})
end,
},
--{
-- 'Shougo/pum.vim',
-- keys = {
-- { "<C-n>", ":call pum#map#select_relative(+1)<CR>", mode = "i" },
-- { "<C-p>", ":call pum#map#select_relative(-1)<CR>", mode = "i" },
-- { "<C-y>", ":call pum#map#confirm()<CR>", mode = "i" },
-- { "<C-q>", ":call pum#map#cancel()<CR>", mode = "i" },
-- { "<Tab>", ":call pum#map#insert_relative(+1)<CR>", mode = "c" },
-- { "<S-Tab>", ":call pum#map#insert_relative(-1)<CR>", mode = "c" },
-- },
-- config = function()
-- vim.fn['pum#set_option']({
-- use_complete = true,
-- border = "rounded",
-- auto_select = true,
-- padding = true,
-- scrollbar_char = "",
-- })
-- end,
--},
{
"matsui54/denops-popup-preview.vim",
dependencies = { "vim-denops/denops.vim" },
Expand Down
3 changes: 0 additions & 3 deletions nvim/lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ return {
{
'gamoutatsumi/dps-ghosttext.vim',
dependencies = 'vim-denops/denops.vim',
cmd = {
"GhostStart"
},
},
}

2 changes: 1 addition & 1 deletion nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local setup = function()
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<C-y>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
Expand Down

0 comments on commit 2079748

Please sign in to comment.