From 0d00ee23f35046f8465cb8302b6795d15227dfda Mon Sep 17 00:00:00 2001 From: Nanderty Date: Wed, 31 Jan 2024 15:47:52 +0100 Subject: Snippets and general improvements --- lua/plugins/cmp.lua | 20 ++++++++--------- lua/plugins/general.lua | 7 ------ lua/plugins/interface.lua | 4 ++-- lua/plugins/lsp.lua | 1 - lua/plugins/tex.lua | 1 + lua/plugins/treesitter.lua | 55 ++++++++++++++++++++++++---------------------- 6 files changed, 41 insertions(+), 47 deletions(-) (limited to 'lua/plugins') diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 4f9d8f4..e3305ce 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -19,22 +19,19 @@ return { }, { 'hrsh7th/nvim-cmp', - event = 'InsertEnter', + event = { + 'InsertEnter', + 'CmdlineEnter', + }, dependencies = { 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-buffer', 'FelipeLema/cmp-async-path', 'saadparwaiz1/cmp_luasnip', 'L3MON4D3/LuaSnip', + 'micangl/cmp-vimtex', }, opts = function() - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and - vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil - end - local luasnip = require('luasnip') local cmp = require('cmp') @@ -45,16 +42,17 @@ return { end, }, mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.confirm({ select = false }), + [''] = cmp.mapping.confirm({ select = false }), [''] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), [''] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), ['jk'] = cmp.mapping.abort(), }), sources = cmp.config.sources({ - { name = 'nvim_lsp' }, { name = 'luasnip' }, - { name = 'buffer' }, + { name = 'vimtex', }, { name = 'async_path' }, + { name = 'nvim_lsp' }, + { name = 'buffer' }, }), formatting = { format = function(_, item) diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua index 6f7afc5..d269c13 100644 --- a/lua/plugins/general.lua +++ b/lua/plugins/general.lua @@ -25,11 +25,4 @@ return { }, config = true }, - { - 'ludovicchabant/vim-gutentags', - event = { - 'BufReadPost', - 'BufNewFile' - }, - }, } diff --git a/lua/plugins/interface.lua b/lua/plugins/interface.lua index c1164d1..42d0108 100644 --- a/lua/plugins/interface.lua +++ b/lua/plugins/interface.lua @@ -49,9 +49,9 @@ return { }, config = function(_, opts) require('lualine').setup(opts) - vim.api.nvim_set_hl(0, 'StatusLine', { bg = require('monokai-pro.colorscheme').colors.editor.background }) + vim.api.nvim_set_hl(0, 'StatusLine', { bg = require('monokai-pro.colorscheme').editor.background }) vim.api.nvim_set_hl(0, 'StatusLineNC', - { bg = require('monokai-pro.colorscheme').colors.editor.backgroundnil }) + { bg = require('monokai-pro.colorscheme').editor.backgroundnil }) end, }, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 740e0cc..d353394 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -8,7 +8,6 @@ return { dependencies = { 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim', - 'hrsh7th/cmp-nvim-lsp', }, config = function() local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities() diff --git a/lua/plugins/tex.lua b/lua/plugins/tex.lua index 54d2270..f3cacfd 100644 --- a/lua/plugins/tex.lua +++ b/lua/plugins/tex.lua @@ -8,6 +8,7 @@ return { vim.g.vimtex_view_method = 'zathura_simple' vim.g.vimtex_fold_enabled = 1 vim.g.vimtex_fold_manual = 1 + vim.g.vimtex_complete_bib_simple = 1 end, }, } diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index ee16f1b..cbfa516 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,29 +1,32 @@ return { - { - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - event = { - 'BufReadPost', - 'BufNewFile' + { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', + event = { + 'BufReadPost', + 'BufNewFile' + }, + opts = { + auto_install = true, + ignore_install = { 'latex' }, + indent = { enable = true, disable = { 'python' } }, + ensure_installed = { + 'javascript', + 'python', + 'cpp', + 'c', + 'lua', + 'php', + 'html', + 'css', + }, + }, + }, + { + 'luckasRanarison/tree-sitter-hyprlang', + event = { + 'BufReadPre', + 'BufNewFile' + }, }, - opts = { - auto_install = true, - ignore_install = { 'latex' }, - highlight = { enable = true }, - indent = { enable = true, disable = { 'python' } }, - ensure_installed = { - 'javascript', - 'python', - 'cpp', - 'c', - 'lua', - 'php', - 'html', - 'css', - }, - }, - config = function(_, opts) - require('nvim-treesitter.configs').setup(opts) - end, - } } -- cgit v1.2.3