Comments (7)
replace on toml
diff --git a/config/nvim/rc/dein_lazy.toml b/config/nvim/rc/dein_lazy.toml
index 8f70021..40ca44a 100644
--- a/config/nvim/rc/dein_lazy.toml
+++ b/config/nvim/rc/dein_lazy.toml
@@ -276,6 +276,7 @@ let g:lsp_settings_filetype_objc = ['clangd']
let g:lsp_settings_filetype_typescript = [<SID>is_node_project() ? 'typescript-language-server' : 'deno']
"""
on_event = ["BufRead", "BufNewFile"]
+if = "!has('nvim')"
[[plugins]]
repo = "mattn/vim-lsp-settings"
@@ -284,6 +285,68 @@ let g:lsp_settings_enable_suggestions = v:false
"""
on_source = "vim-lsp"
+[[plugins]]
+repo = "neovim/nvim-lspconfig"
+on_event = ["BufRead", "BufNewFile"]
+if = "has('nvim')"
+
+[[plugins]]
+repo = "williamboman/mason.nvim"
+lua_source = """
+require("mason").setup()
+"""
+depends = ["nvim-lspconfig", "mason-lspconfig.nvim"]
+on_cmd = "Mason"
+if = "has('nvim')"
+
+[[plugins]]
+repo = "williamboman/mason-lspconfig.nvim"
+on_source = "mason.vim"
+lua_source = '''
+-- https://zenn.dev/kawarimidoll/articles/2b57745045b225
+-- ref: Shougo/shougo-s-github
+require('mason-lspconfig').setup_handlers({
+ function(server_name)
+ local nvim_lsp = require('lspconfig')
+ local node_root_dir = nvim_lsp.util.root_pattern('package.json')
+ local is_node_repo = node_root_dir(vim.api.nvim_buf_get_name(0)) ~= nil
+
+ local opts = {}
+
+ if server_name == 'vtsls' then
+ -- Must be node directory
+ if not is_node_repo then
+ return
+ end
+
+ opts.root_dir = node_root_dir
+ elseif server_name == 'denols' then
+ -- Must not be node directory
+ if is_node_repo then
+ return
+ end
+
+ opts.init_options = {
+ lint = true,
+ unstable = true,
+ suggest = {
+ imports = {
+ hosts = {
+ ['https://deno.land'] = true,
+ ['https://cdn.nest.land'] = true,
+ ['https://crux.land'] = true
+ }
+ }
+ }
+ }
+ end
+
+ nvim_lsp[server_name].setup(opts)
+ end
+})
+'''
+if = "has('nvim')"
+
diff --git a/config/nvim/rc/ddc.toml b/config/nvim/rc/ddc.toml
index 8a028d0..4af55e1 100644
--- a/config/nvim/rc/ddc.toml
+++ b/config/nvim/rc/ddc.toml
@@ -12,9 +12,9 @@ vimx.g.ddc_source_options = {
}
}
-vimx.g.ddc_sources = {
+local sources = {
snippet = { "vsnip" },
- lsp = { "vim-lsp" },
+ lsp = vimx.fn.has("nvim") and { "nvim-lsp" } or { "vim-lsp" },
["in-vim"] = { "around", "buffer" },
["out-vim"] = { "rg" },
}
@@ -37,7 +37,7 @@ vimx.keymap.set(
{
expr = true,
callback = function()
- vimx.fn.ddc.map.manual_complete({ "vim-lsp" })
+ vimx.fn.ddc.map.manual_complete(sources.lsp)
end
}
)
@@ -49,7 +49,7 @@ lua_source = """
local vimx = require("artemis")
vimx.fn.ddc.custom.patch_global(
"sources",
- { "vsnip", "vim-lsp", "around", "buffer", "rg", }
+ { "vsnip", "nvim-lsp", "around", "buffer", "rg", }
)
-- TODO: なんかよくわからんけどluaだといけない
@@ -62,7 +62,7 @@ vimx.cmd "call ddc#custom#patch_global('sourceOptions', g:ddc_source_options)"
vimx.fn.ddc.custom.patch_filetype(
{ "toml", "vim" },
"sources",
- { "vsnip", "necovim", "vim-lsp", "around", "buffer", "rg" }
+ { "vsnip", "necovim", "nvim-lsp", "around", "buffer", "rg" }
)
vimx.fn.ddc.custom.patch_filetype(
@@ -115,6 +115,19 @@ vimx.g.ddc_source_options["vim-lsp"] = {
"""
depends = ["vim-lsp"]
on_source = "ddc.vim"
+if = "!has('nvim')"
+
+[[plugins]]
+repo = "Shougo/ddc-source-nvim-lsp"
+on_souce = "ddc.vim"
+lua_source = """
+local vimx = require("artemis")
+vimx.g.ddc_source_options["nvim-lsp"] = {
+ mark = "[LSP]",
+ forceCompletionPattern = [[\..?|:|->|\w+/]],
+}
+"""
+if = "has('nvim')"
[[plugins]]
repo = "Shougo/ddc-around"
from dotfiles.
not work above.
from dotfiles.
denols needs "single_file_support" ...?
from dotfiles.
work vim.lsp.buf.format etc.
but not integrate with ddc yet.
from dotfiles.
TODO: diagnostics
from dotfiles.
diagnostics: DONE
but, using ddu-lsp is better...?
from dotfiles.
using ddu-lsp 👌🏻
from dotfiles.
Related Issues (20)
- markdownのsectionでfoldしたい
- fix yabai workspace badge by sketchybar HOT 1
- gh extensionを管理したい
- aquaのprをautomergeしたい
- miseのツールを管理したい HOT 3
- chore(deps): update dependency python/cpython to v3.12.2
- fishを早くする
- mergeされたprのnotificationを一括でdoneする HOT 2
- dppに移行する
- azikしたい
- dduのpreviewをなおす HOT 1
- auto releaserがほしい
- runnerのrenovateが多すぎる HOT 2
- ddu-source-redmineでチケット発行したい
- denopsでcopilot chatがしたい
- macのdefaultsをnixで設定できるか調べる HOT 3
- chore(deps): update dependency https://deno.land/x/dax to v0.39.2 HOT 1
- check json schemas on ci
- support xdg_config_home for vim
- replace deno.land to jsr HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.