nvim: configure cmp activation + formatting
This commit is contained in:
@@ -23,7 +23,7 @@ local navic = require('nvim-navic') -- breadcrumbs
|
||||
-- Normal LSPs
|
||||
-- Install with `:LSPInstall`
|
||||
local servers = { "pylsp", "sumneko_lua", "hls" }
|
||||
for _,i in ipairs(servers) do
|
||||
for _, i in ipairs(servers) do
|
||||
lsp[i].setup({
|
||||
on_attach = function(client, bufnr)
|
||||
navic.attach(client, bufnr) -- breadcrumbs
|
||||
@@ -37,7 +37,7 @@ lsp.texlab.setup({
|
||||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '-shell-escape','%f' },
|
||||
args = { '-pdf', '-interaction=nonstopmode', '-synctex=1', '-shell-escape', '%f' },
|
||||
onSave = true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ return require('packer').startup(function(use)
|
||||
"json",
|
||||
"latex",
|
||||
"lua",
|
||||
"make",
|
||||
"python",
|
||||
"rust",
|
||||
},
|
||||
@@ -152,30 +153,28 @@ return require('packer').startup(function(use)
|
||||
use("simrat39/rust-tools.nvim") -- Cooler LSP stuff for Rust
|
||||
|
||||
-- Snippets
|
||||
-- TODO: max candidates
|
||||
-- TODO: time trigger activation
|
||||
use({
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"rafamadriz/friendly-snippets",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"L3MON4D3/LuaSnip", -- Snippet engine
|
||||
"hrsh7th/cmp-buffer", -- Source: buffer
|
||||
"hrsh7th/cmp-nvim-lsp", -- Source: LSP symbols
|
||||
"hrsh7th/cmp-path", -- Source: path
|
||||
"rafamadriz/friendly-snippets", -- Source: JSON style snippets for LuaSnip
|
||||
"saadparwaiz1/cmp_luasnip", -- Make LuaSnip work with cmp
|
||||
},
|
||||
config = function()
|
||||
local cmp = require 'cmp'
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
expand = function(args) -- set a snippet engine
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
{ name = 'luasnip', keyword_length = 3, max_item_count = 3 },
|
||||
{ name = 'nvim_lsp', keyword_length = 3, max_item_count = 10 },
|
||||
{ name = 'buffer', keyword_length = 5, max_item_count = 3 },
|
||||
{ name = 'path' },
|
||||
},
|
||||
formatting = {
|
||||
@@ -187,7 +186,7 @@ return require('packer').startup(function(use)
|
||||
end,
|
||||
},
|
||||
})
|
||||
-- Load in friendly-snippets
|
||||
-- Load friendly-snippets
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
-- TODO: Add own snippets
|
||||
--[[ require("luasnip.loaders.from_vscode").lazy_load({
|
||||
|
||||
@@ -97,12 +97,16 @@ input type:keyboard {
|
||||
set $bemenu bemenu \
|
||||
-l 7 \
|
||||
--nb "#282828" \
|
||||
--nf "#ffffff" \
|
||||
--ab "#282828" \
|
||||
--af "#ffffff" \
|
||||
--fb "#282828" \
|
||||
--tf "#93b259" \
|
||||
--tb "#282828" \
|
||||
--hf "#ffffff" \
|
||||
--hb "#393939" \
|
||||
--fn "SFMono Nerd Font 13" -i -H 25 -W 0.35
|
||||
|
||||
set $files fd -I "pdf$" $HOME | cut -f 4- -d "/"
|
||||
set $lock_screen \
|
||||
printf \
|
||||
|
||||
Reference in New Issue
Block a user