You've already forked dotfiles
fix: Several small updates.
- Removing the load_lauunchjs call for dap as it's no longer needed. - Cleanup of lspconfig of several lines that appear to not do anything in testing, and updating keymap order. - Removing the luasnip setup section as it appears to not be required in testing. - Update to nvim-cmp for luasnip relative loading and removing the buffer from command mode completion - Twilight update to narrow the focus but also expand out if statements. - ZSH re-enabling keychain despite it being slow as replacement with gpg-agent will take a focused session to do across environments
This commit is contained in:
@@ -141,7 +141,7 @@ return {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require('dap.ext.vscode').load_launchjs('.launch.json', {})
|
-- require('dap.ext.vscode').load_launchjs('.launch.json', {})
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = {
|
virtual_text = {
|
||||||
source = 'always',
|
source = 'always',
|
||||||
@@ -14,19 +11,12 @@ return {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config('*', {
|
|
||||||
capabilities = capabilities, -- TODO: Does this do anything?
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Auto set keymaps and other settings on LSP attach
|
-- Auto set keymaps and other settings on LSP attach
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local bufnr = args.buf
|
local bufnr = args.buf
|
||||||
|
|
||||||
-- TODO: Does this do anything?
|
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
||||||
|
|
||||||
-- Keyboard Mappings
|
-- Keyboard Mappings
|
||||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
vim.keymap.set('n', '<C-[>', vim.diagnostic.goto_prev, bufopts)
|
vim.keymap.set('n', '<C-[>', vim.diagnostic.goto_prev, bufopts)
|
||||||
@@ -38,8 +28,8 @@ return {
|
|||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
|
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -1,21 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
'L3MON4D3/LuaSnip',
|
'L3MON4D3/LuaSnip',
|
||||||
config = function()
|
config = function()
|
||||||
local ls = require('luasnip')
|
|
||||||
local extras = require('luasnip.extras')
|
|
||||||
local l = extras.lambda
|
|
||||||
ls.setup({
|
|
||||||
snip_env = {
|
|
||||||
s = function(...)
|
|
||||||
local snip = ls.s(...)
|
|
||||||
table.insert(getfenv(2).ls_file_snippets, snip)
|
|
||||||
end,
|
|
||||||
parse = function(...)
|
|
||||||
local snip = ls.parser.parse_snippet(...)
|
|
||||||
table.insert(getfenv(2).ls_file_snippets, snip)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" })
|
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" })
|
||||||
end,
|
end,
|
||||||
@@ -23,4 +8,5 @@ return {
|
|||||||
'saadparwaiz1/cmp_luasnip', -- Wrapper to load snippets in nvim-cmp
|
'saadparwaiz1/cmp_luasnip', -- Wrapper to load snippets in nvim-cmp
|
||||||
'rafamadriz/friendly-snippets',
|
'rafamadriz/friendly-snippets',
|
||||||
},
|
},
|
||||||
|
build = "make install_jsregexp"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ return {
|
|||||||
cmp.setup {
|
cmp.setup {
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
require('luasnip').lsp_expand(args.body)
|
require('plugins.luasnip').lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
@@ -51,9 +51,9 @@ return {
|
|||||||
mapping = cmp.mapping.preset.cmdline(),
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'path' },
|
{ name = 'path' },
|
||||||
{ name = 'buffer' },
|
-- { name = 'buffer' },
|
||||||
}, {
|
}, {
|
||||||
{ name = 'cmdline', keyword_length = 1 },
|
{ name = 'cmdline' },
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ return {
|
|||||||
dimming = {
|
dimming = {
|
||||||
alpha = 0.3,
|
alpha = 0.3,
|
||||||
},
|
},
|
||||||
|
context = 6,
|
||||||
|
treesitter = true,
|
||||||
expand = {
|
expand = {
|
||||||
"function",
|
"function",
|
||||||
"method",
|
"method",
|
||||||
"table",
|
"table",
|
||||||
|
"if_statement",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
|
|||||||
zstyle ':completion:*:warnings' format '%BNo matches for: %d%b'
|
zstyle ':completion:*:warnings' format '%BNo matches for: %d%b'
|
||||||
|
|
||||||
# Autoload keychain for ssh-agent handling if it is installed
|
# Autoload keychain for ssh-agent handling if it is installed
|
||||||
# if command -v keychain &> /dev/null
|
if command -v keychain &> /dev/null
|
||||||
# then
|
then
|
||||||
# eval $(keychain --eval --quiet --nogui --noask)
|
eval $(keychain --eval --quiet --nogui --noask)
|
||||||
# fi
|
fi
|
||||||
|
|
||||||
# TODO: Replace above with GPG agent
|
# TODO: Replace above with GPG agent
|
||||||
# GPG Agent handling of ssh key authorization and unlocks
|
# GPG Agent handling of ssh key authorization and unlocks
|
||||||
|
|||||||
Reference in New Issue
Block a user