aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2023-10-20 16:33:03 +0200
committerMax Christian Pohle2023-10-20 16:36:34 +0200
commitebe1de13f1ae081af20ba22d7b62f7477d5062cd (patch)
tree9fc7d8b52b3c939c2e9fda01a4ca878948d77c7e
parent811187fedac2596dbe0c690ed8bec48a76a19968 (diff)
downloadvim-ebe1de13f1ae081af20ba22d7b62f7477d5062cd.tar.bz2
vim-ebe1de13f1ae081af20ba22d7b62f7477d5062cd.zip
Fixed LS integration and nvim init.lua housekeeping
-rw-r--r--.gitmodules21
l---------after/syntax/cpp.vim1
-rw-r--r--init.lua271
m---------pack/all/start/fzf0
m---------pack/all/start/fzf.vim0
m---------pack/all/start/vim-editorconfig0
m---------pack/nvim/start/nvim-cmp0
m---------pack/nvim/start/nvim-cmp-lsp-signature-help0
m---------pack/nvim/start/nvim-cmp-nvim-lsp0
m---------pack/nvim/start/nvim-git-blame0
m---------pack/nvim/start/nvim-lsp0
m---------pack/nvim/start/nvim-lspconfig0
m---------pack/nvim/start/nvim-lua-language-server0
m---------pack/nvim/start/nvim-plenary0
m---------pack/nvim/start/nvim-telescope0
m---------pack/nvim/start/nvim-treesitter0
m---------pack/nvim/start/nvim-vsnip0
m---------pack/vim/opt/vim-youcompleteme0
18 files changed, 146 insertions, 147 deletions
diff --git a/.gitmodules b/.gitmodules
index 986283d..92552d3 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -22,9 +22,6 @@
22[submodule "pack/submodules/start/nvim-cmp"] 22[submodule "pack/submodules/start/nvim-cmp"]
23 path = pack/nvim/start/nvim-cmp 23 path = pack/nvim/start/nvim-cmp
24 url = https://github.com/hrsh7th/nvim-cmp 24 url = https://github.com/hrsh7th/nvim-cmp
25[submodule "pack/submodules/start/nvim-lspconfig"]
26 path = pack/nvim/start/nvim-lspconfig
27 url = https://github.com/neovim/nvim-lspconfig
28[submodule "pack/submodules/start/nvim-cmp-nvim-lsp"] 25[submodule "pack/submodules/start/nvim-cmp-nvim-lsp"]
29 path = pack/nvim/start/nvim-cmp-nvim-lsp 26 path = pack/nvim/start/nvim-cmp-nvim-lsp
30 url = https://github.com/hrsh7th/cmp-nvim-lsp 27 url = https://github.com/hrsh7th/cmp-nvim-lsp
@@ -61,3 +58,21 @@
61[submodule "pack/all/start/fzf.vim"] 58[submodule "pack/all/start/fzf.vim"]
62 path = pack/all/start/fzf.vim 59 path = pack/all/start/fzf.vim
63 url = https://github.com/junegunn/fzf.vim 60 url = https://github.com/junegunn/fzf.vim
61[submodule "pack/all/start/fzf"]
62 path = pack/all/start/fzf
63 url = https://github.com/junegunn/fzf
64[submodule "pack/nvim/start/nvim-telescope"]
65 path = pack/nvim/start/nvim-telescope
66 url = https://github.com/nvim-telescope/telescope.nvim
67[submodule "pack/nvim/start/nvim-plenary"]
68 path = pack/nvim/start/nvim-plenary
69 url = https://github.com/nvim-lua/plenary.nvim
70[submodule "pack/nvim/start/nvim-lua-language-server"]
71 path = pack/nvim/start/nvim-lua-language-server
72 url = https://github.com/LuaLS/lua-language-server
73[submodule "pack/nvim/start/nvim-lspconfig"]
74 path = pack/nvim/start/nvim-lspconfig
75 url = https://github.com/neovim/nvim-lspconfig
76[submodule "pack/nvim/start/nvim-lsp"]
77 path = pack/nvim/start/nvim-lsp
78 url = https://github.com/prabirshrestha/vim-lsp
diff --git a/after/syntax/cpp.vim b/after/syntax/cpp.vim
deleted file mode 120000
index 64e3fd4..0000000
--- a/after/syntax/cpp.vim
+++ /dev/null
@@ -1 +0,0 @@
1c.vim \ No newline at end of file
diff --git a/init.lua b/init.lua
index d58bbba..e69b081 100644
--- a/init.lua
+++ b/init.lua
@@ -2,57 +2,147 @@ vim.cmd('source ~/.vim/vimrc')
2 2
3vim.o.termguicolors = true 3vim.o.termguicolors = true
4vim.o.exrc = true 4vim.o.exrc = true
5vim.o.shell = 'cmd.exe'
6-- vim.o.shadafile = "/tmp/shada"
7vim.opt.rtp:append("C:\\Users\\max\\scoop\\shims")
8
9-- only on Linux...
10-- vim.o.shadafile = (os.getenv("XDG_CACHE_HOME") or
11-- os.getenv("HOME") .. "/.cache"
12-- ) .. "/vim.shada"
13-- vimscript: get(environ(), "XDG_CACHE_HOME", "~/.cache")."/vim.shada"
14-- require'man'
5 15
6vim.o.shadafile = (os.getenv("XDG_CACHE_HOME") or 16require'colorizer'.setup()
7 os.getenv("HOME") .. "/.cache"
8 ) .. "/vim.shada"
9 17
10-- vimscript: get(environ(), "XDG_CACHE_HOME", "~/.cache")."/vim.shada" 18-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
19require('cmp_nvim_lsp').setup{}
20local capabilities = require('cmp_nvim_lsp').default_capabilities()
11 21
12require'man'
13 22
14require'colorizer'.setup() 23local cmp = require('cmp');
24cmp.setup({
25 snippet = {
26 -- REQUIRED - you must specify a snippet engine
27 expand = function(args)
28 vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
29 -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
30 -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
31 -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
32 end,
33 },
34 window = {
35 completion = cmp.config.window.bordered(),
36 documentation = cmp.config.window.bordered(),
37 },
38 mapping = cmp.mapping.preset.insert({
39 ['<C-b>'] = cmp.mapping.scroll_docs(-4),
40 ['<C-f>'] = cmp.mapping.scroll_docs(4),
41 ["<Tab>"] = cmp.mapping.select_next_item({behavior=cmp.SelectBehavior.Insert}),
42 ["<S-Tab>"] = cmp.mapping.select_prev_item({behavior=cmp.SelectBehavior.Insert}),
43 ['<C-Space>'] = cmp.mapping.complete(),
44 ['<C-e>'] = cmp.mapping.abort(),
45 -- ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
46
47 ["<CR>"] = cmp.mapping.confirm({
48 behavior = cmp.ConfirmBehavior.Replace,
49 select = true,
50 }),
51
52 ['<C-s>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
53 }),
54 sources = cmp.config.sources({
55 { name = 'nvim_lsp' },
56 { name = 'vsnip' }, -- For vsnip users.
57 -- { name = 'luasnip' }, -- For luasnip users.
58 -- { name = 'ultisnips' }, -- For ultisnips users.
59 -- { name = 'snippy' }, -- For snippy users.
60 }, {
61 { name = 'buffer' },
62 })
63})
64
65-- Set configuration for specific filetype.
66cmp.setup.filetype('gitcommit', {
67 sources = cmp.config.sources({
68 { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
69 }, {
70 { name = 'buffer' },
71 })
72})
15 73
16-- language servers: 74-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
75cmp.setup.cmdline({ '/', '?' }, {
76 -- mapping = cmp.mapping.preset.cmdline(),
77 sources = {
78 { name = 'buffer' }
79 }
80})
81
82-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
83cmp.setup.cmdline(':', {
84 -- mapping = cmp.mapping.preset.cmdline(),
85 sources = cmp.config.sources({
86 { name = 'cmdline' }
87 })
88})
89
90
91-- # Language Servers
17-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md 92-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
18 93
94-- The following example advertise capabilities to `clangd`.
19-- C/C++ | clang 95-- C/C++ | clang
20require'lspconfig'.clangd.setup{} 96require('lspconfig')['clangd'].setup{capabilities = capabilities}
21 97
22-- lua 98-- bash | bash-language-server
23require'lspconfig'.sumneko_lua.setup{ 99require('lspconfig')['bashls'].setup{capabilities = capabilities}
24 settings = { 100
25 Lua = { 101-- ccs | vscode-css-languageserver
26 diagnostics = { 102require('lspconfig')['cssls'].setup{capabilities = capabilities}
27 globals = { 'vim' } 103
28 } 104-- rust | rust-analyzer
29 } 105require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities}
30 } 106
31} 107-- javascript | eslint
108require('lspconfig')['eslint'].setup{capabilities = capabilities}
109
110-- javascript | typescript-language-server
111require('lspconfig')['tsserver'].setup{capabilities = capabilities}
112
113-- vimscript | vim-language-server
114require('lspconfig')['vimls'].setup{capabilities = capabilities}
115
116require('lspconfig')['html'].setup{capabilities = capabilities}
117
118require('lspconfig')['jsonls'].setup{capabilities = capabilities}
119
120-- C/C++ | clang
121require('lspconfig')['clangd'].setup{capabilities = capabilities}
32 122
33-- bash | bash-language-server 123-- bash | bash-language-server
34require'lspconfig'.bashls.setup{} 124require('lspconfig')['bashls'].setup{capabilities = capabilities}
35 125
36-- ccs | vscode-css-languageserver 126-- ccs | vscode-css-languageserver
37require'lspconfig'.cssls.setup{} 127require('lspconfig')['cssls'].setup{capabilities = capabilities}
38 128
39-- rust | rust-analyzer 129-- rust | rust-analyzer
40require'lspconfig'.rust_analyzer.setup{} 130require('lspconfig')['rust_analyzer'].setup{capabilities = capabilities}
41 131
42-- javascript | eslint 132-- javascript | eslint
43require'lspconfig'.eslint.setup{} 133require('lspconfig')['eslint'].setup{capabilities = capabilities}
44 134
45-- javascript | typescript-language-server 135-- javascript | typescript-language-server
46require'lspconfig'.tsserver.setup{} 136require('lspconfig')['tsserver'].setup{capabilities = capabilities}
47 137
48-- vimscript | vim-language-server 138-- vimscript | vim-language-server
49require'lspconfig'.vimls.setup{} 139require('lspconfig')['vimls'].setup{capabilities = capabilities}
50 140
51require'lspconfig'.html.setup{} 141require('lspconfig')['html'].setup{capabilities = capabilities}
52 142
53require'lspconfig'.jsonls.setup{} 143require('lspconfig')['jsonls'].setup{capabilities = capabilities}
54 144
55require'lspconfig'.pylsp.setup{ 145require('lspconfig')['pylsp'].setup{
56 settings = { 146 settings = {
57 pylsp = { 147 pylsp = {
58 plugins = { 148 plugins = {
@@ -65,123 +155,16 @@ require'lspconfig'.pylsp.setup{
65 } 155 }
66} 156}
67 157
68 158-- lua
69require'cmp_nvim_lsp'.setup{} 159require('lspconfig')['lua_ls'].setup{
70 160 settings = {
71require'cmp'.setup { 161 Lua = {
72 sources = { 162 diagnostics = {
73 { name = 'nvim_lsp' } 163 globals = { 'vim', 'require', 'cmp' }
74 } 164 }
75} 165 }
76 166 }
77-- -- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
78local capabilities = require('cmp_nvim_lsp').default_capabilities()
79--
80-- -- The following example advertise capabilities to `clangd`.
81require'lspconfig'.clangd.setup {
82capabilities = capabilities,
83}
84
85-- Set up nvim-cmp.
86local cmp = require'cmp'
87
88cmp.setup({
89 snippet = {
90 -- REQUIRED - you must specify a snippet engine
91 expand = function(args)
92 vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
93 -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
94 -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
95 -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
96 end,
97 },
98 window = {
99 completion = cmp.config.window.bordered(),
100 documentation = cmp.config.window.bordered(),
101 },
102 mapping = cmp.mapping.preset.insert({
103 ['<C-b>'] = cmp.mapping.scroll_docs(-4),
104 ['<C-f>'] = cmp.mapping.scroll_docs(4),
105 ['<C-Space>'] = cmp.mapping.complete(),
106 ['<C-e>'] = cmp.mapping.abort(),
107 -- ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
108
109 ["<CR>"] = cmp.mapping.confirm({
110 behavior = cmp.ConfirmBehavior.Replace,
111 select = true,
112 }),
113
114 ['<C-s>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
115 }),
116 sources = cmp.config.sources({
117 { name = 'nvim_lsp' },
118 { name = 'vsnip' }, -- For vsnip users.
119 -- { name = 'luasnip' }, -- For luasnip users.
120 -- { name = 'ultisnips' }, -- For ultisnips users.
121 -- { name = 'snippy' }, -- For snippy users.
122 }, {
123 { name = 'buffer' },
124 })
125})
126
127-- Set configuration for specific filetype.
128cmp.setup.filetype('gitcommit', {
129sources = cmp.config.sources({
130{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
131}, {
132{ name = 'buffer' },
133})
134})
135
136-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
137cmp.setup.cmdline({ '/', '?' }, {
138mapping = cmp.mapping.preset.cmdline(),
139sources = {
140{ name = 'buffer' }
141} 167}
142})
143
144-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
145cmp.setup.cmdline(':', {
146mapping = cmp.mapping.preset.cmdline(),
147sources = cmp.config.sources({
148{ name = 'path' }
149}, {
150{ name = 'cmdline' }
151})
152})
153
154-- -- Set up lspconfig.
155-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
156-- -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
157-- -- require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
158-- -- }
159--
160-- -- C/C++ | clang
161-- require'lspconfig'.clangd.setup{capabilities = capabilities}
162--
163-- -- bash | bash-language-server
164-- require'lspconfig'.bashls.setup{capabilities = capabilities}
165--
166-- -- ccs | vscode-css-languageserver
167-- require'lspconfig'.cssls.setup{capabilities = capabilities}
168--
169-- -- rust | rust-analyzer
170-- require'lspconfig'.rust_analyzer.setup{capabilities = capabilities}
171--
172-- -- javascript | eslint
173-- require'lspconfig'.eslint.setup{capabilities = capabilities}
174--
175-- -- javascript | typescript-language-server
176-- require'lspconfig'.tsserver.setup{capabilities = capabilities}
177--
178-- -- vimscript | vim-language-server
179-- require'lspconfig'.vimls.setup{capabilities = capabilities}
180--
181-- require'lspconfig'.html.setup{capabilities = capabilities}
182--
183-- require'lspconfig'.jsonls.setup{capabilities = capabilities}
184--
185 168
186 169
187require'nvim-treesitter.configs'.setup { 170require'nvim-treesitter.configs'.setup {
@@ -212,3 +195,5 @@ require'nvim-treesitter.configs'.setup {
212 additional_vim_regex_highlighting = false, 195 additional_vim_regex_highlighting = false,
213 }, 196 },
214} 197}
198
199-- vim: tabstop=2 shiftwidth=2 softtabstop=2
diff --git a/pack/all/start/fzf b/pack/all/start/fzf
new file mode 160000
Subproject 70c461c60bb1e2165a378e8ba0451b511c29b5c
diff --git a/pack/all/start/fzf.vim b/pack/all/start/fzf.vim
Subproject 0f03107bc94b31a9c7adcee6da8e5de7492e4b0 Subproject d1016dbd7cec2d2a3bb5863776c84b4034e4b85
diff --git a/pack/all/start/vim-editorconfig b/pack/all/start/vim-editorconfig
Subproject 30ddc057f71287c3ac2beca876e7ae6d5abe26a Subproject e014708e917b457e8f6c57f357d55dd3826880d
diff --git a/pack/nvim/start/nvim-cmp b/pack/nvim/start/nvim-cmp
Subproject c49ad26e894e137e401b1d294948c46327877ea Subproject d3a3056204e1a9dbb7c7fe36c114dc43b681768
diff --git a/pack/nvim/start/nvim-cmp-lsp-signature-help b/pack/nvim/start/nvim-cmp-lsp-signature-help
Subproject d2768cb1b83de649d57d967085fe73c5e01f8fd Subproject 3d8912ebeb56e5ae08ef0906e3a54de1c66b92f
diff --git a/pack/nvim/start/nvim-cmp-nvim-lsp b/pack/nvim/start/nvim-cmp-nvim-lsp
Subproject 59224771f91b86d1de12570b4070fe4ad7cd1ee Subproject 44b16d11215dce86f253ce0c30949813c0a9076
diff --git a/pack/nvim/start/nvim-git-blame b/pack/nvim/start/nvim-git-blame
new file mode 160000
Subproject 8fcf0077ab0c020a68e9d26d347df7da717ddf1
diff --git a/pack/nvim/start/nvim-lsp b/pack/nvim/start/nvim-lsp
new file mode 160000
Subproject c58edb98f09a650612adaaf8c47995c9e2b7ffb
diff --git a/pack/nvim/start/nvim-lspconfig b/pack/nvim/start/nvim-lspconfig
Subproject 6b43ce561d97412cc512b569db6938e44529293 Subproject e49b1e90c1781ce372013de3fa93a91ea29fc34
diff --git a/pack/nvim/start/nvim-lua-language-server b/pack/nvim/start/nvim-lua-language-server
new file mode 160000
Subproject ce964793afc6251673238c256a25e06502e487b
diff --git a/pack/nvim/start/nvim-plenary b/pack/nvim/start/nvim-plenary
new file mode 160000
Subproject 50012918b2fc8357b87cff2a7f7f0446e47da17
diff --git a/pack/nvim/start/nvim-telescope b/pack/nvim/start/nvim-telescope
new file mode 160000
Subproject 74ce793a60759e3db0d265174f137fb62743035
diff --git a/pack/nvim/start/nvim-treesitter b/pack/nvim/start/nvim-treesitter
Subproject 68e8181dbcf29330716d380e5669f2cd838eadb Subproject eb3faef3a44641e5875581e901b0a8df8da2bde
diff --git a/pack/nvim/start/nvim-vsnip b/pack/nvim/start/nvim-vsnip
Subproject 8dde8c0ef10bb1afdbb301e2bd7eb1c153dd558 Subproject be277461265f1e5c7db470aa479f30956597ea9
diff --git a/pack/vim/opt/vim-youcompleteme b/pack/vim/opt/vim-youcompleteme
Subproject 88efc6f6035e4c656e8791f3c3a8a4328a1634d Subproject cc9a3ae3efdcc7d038aab0620ea28882533c236
..