Compare commits
No commits in common. "ae8c94f00b0de4b6fe88ac63698071bc452fbaf7" and "5f24d87f0a8cbd6301451f4208e4916aacce9c0a" have entirely different histories.
ae8c94f00b
...
5f24d87f0a
21 changed files with 54 additions and 55 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -67,6 +67,3 @@
|
|||
[submodule "pack/general/start/Comment.nvim"]
|
||||
path = pack/general/start/Comment.nvim
|
||||
url = https://github.com/numToStr/Comment.nvim
|
||||
[submodule "pack/general/start/vim-caddyfile"]
|
||||
path = pack/general/start/vim-caddyfile
|
||||
url = https://github.com/isobit/vim-caddyfile
|
||||
|
|
|
|||
69
init.lua
69
init.lua
|
|
@ -53,7 +53,7 @@ g['airline#extensions#tabline#left_alt_sep'] = '|'
|
|||
local function map(mode, lhs, rhs, opts)
|
||||
local options = {noremap = true, silent = true}
|
||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||
vim.keymap.set(mode, lhs, rhs, options)
|
||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||
end
|
||||
map('!','<C-BS>','<C-w>')
|
||||
map('v','>','>gv')
|
||||
|
|
@ -66,29 +66,22 @@ ts.setup {
|
|||
ensure_installed = {
|
||||
'bash',
|
||||
'c',
|
||||
'cmake',
|
||||
'cpp',
|
||||
'css',
|
||||
'comment',
|
||||
'dockerfile',
|
||||
'dot',
|
||||
'gitattributes',
|
||||
'gitignore',
|
||||
'go',
|
||||
'html',
|
||||
'http',
|
||||
'javascript',
|
||||
'json',
|
||||
'kotlin',
|
||||
'latex',
|
||||
'lua',
|
||||
'markdown',
|
||||
'perl',
|
||||
'php',
|
||||
'python',
|
||||
'rust',
|
||||
'scss',
|
||||
'sql',
|
||||
'toml',
|
||||
'typescript',
|
||||
'vim',
|
||||
|
|
@ -101,30 +94,44 @@ local lsp = require 'lspconfig'
|
|||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_lsp_attach = function(client, bufnr)
|
||||
vim.pretty_print(bufnr)
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
||||
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
local opts = { noremap=true, silent=true }
|
||||
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
vim.keymap.set('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||
vim.keymap.set('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
vim.keymap.set('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||
vim.keymap.set('n', '<F3>', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
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', '<Leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||
buf_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
buf_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
buf_set_keymap('n', '<Leader>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||
buf_set_keymap('n', '<F3>', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = { 'gopls', 'kotlin_language_server', 'rust_analyzer', 'tsserver', 'pylsp' }
|
||||
-- Setup loop moved to the cmp section, since calling setup multiple times
|
||||
-- overrides the previous calls.
|
||||
local servers = { 'gopls', 'rust_analyzer', 'tsserver', 'pylsp' }
|
||||
for _, server in ipairs(servers) do
|
||||
lsp[server].setup {
|
||||
on_attach = on_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
-- Auto format on save
|
||||
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()]]
|
||||
|
|
@ -187,12 +194,8 @@ cmp.setup({
|
|||
-- Setup lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
for _, server in ipairs(servers) do
|
||||
lsp[server].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_lsp_attach,
|
||||
flags = {
|
||||
debounce_text_changes = 150,
|
||||
}
|
||||
require('lspconfig')[server].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
end
|
||||
---- Ultisnips
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 97a188a98b5a3a6f9b1b850799ac078faa17ab67
|
||||
Subproject commit 78ab4e9785b6da9b7a539df3bd6f70300dc9482b
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 8f8d493e7836f2697df878ef9c128337cbf2bb84
|
||||
Subproject commit 281a89e374eb04663e18e786db5f215092a56595
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit a33960eb51b638f232dff71cfeac5ede87b38312
|
||||
Subproject commit e10fcf22dcc0441da3c984e26ae2e467b0ae554f
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 3022dbc9166796b644a841a02de8dd1cc1d311fa
|
||||
Subproject commit 62fc67a2b0205136bc3e312664624ba2ab4a9323
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 91ff86cd9c29299a64f968ebb45846c485725f23
|
||||
Subproject commit 447c87cdd6e6d6a1d2488b1d43108bfa217f56e1
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2be79d8a9b03d4175ba6b3d14b082680de1b31b1
|
||||
Subproject commit 5632135df892a742e5c3bbf97f0f634e273254d4
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit f98c85e7c3d65a51f45863a34feb4849c82f240f
|
||||
Subproject commit 8b817e76b6399634f3f49e682d6e409844241858
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 24f9e795bfac5fabbaba703116e747dcf2ad8d2f
|
||||
Subproject commit 29c50f1327d9d84436e484aac362d2fa6bca590b
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit fabf012e243bc58c4785ab4c44f05e94b34c431a
|
||||
Subproject commit 3df0790319b0985d04e2f09fe879b6c2b15692f2
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit b0dff0ec4f2748626aae13f011d1a47071fe9abc
|
||||
Subproject commit 706371f1300e7c0acb98b346f80dad2dd9b5f679
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit fc2f44dc6024bddb75b82e471c642ad1f4483094
|
||||
Subproject commit ba25b747a3cff70c1532c2f28fcc912cf7b938ea
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 7ccb9a056fa43da243e3a439109c354c551c51b6
|
||||
Subproject commit 42891dccf82438ed021cd4ad338ff2412fb31dfd
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 4b7e52044bbb84242158d977a50c4cbcd85070c7
|
||||
Subproject commit 986ad71ae930c7d96e812734540511b4ca838aa2
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 76ea9a898d3307244dce3573392dcf2cc38f340f
|
||||
Subproject commit b5833a682c511885887373aad76272ad70f7b3c2
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 46dd87223757619a0a7fb0b075e2cf7d23ea899d
|
||||
Subproject commit ebb89a0846ff8b8bc64579155d661b825f97d3f2
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit cc5d3490c8f4c87d29d97df414941a9df8ceb390
|
||||
Subproject commit 55bad92d246a31e3425dfaf16b7eec657eab1fad
|
||||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 24fe0720551883e407cb70ae1d7c03f162d1d5a0
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit c3f83ebb43b560af066d2a5d66bc77c6c05293b1
|
||||
Subproject commit 3a9643961233c2812816078af8bd1eaabc530dce
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit d36caa6b1cf508a4df1c691f915572fc02143258
|
||||
Subproject commit 89bcca8a3aeab360f6dfe5ce70999fc928669411
|
||||
Loading…
Add table
Reference in a new issue