summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorNanderty <psopka@sopka.ch>2024-01-31 15:47:52 +0100
committerNanderty <psopka@sopka.ch>2024-01-31 15:47:52 +0100
commit0d00ee23f35046f8465cb8302b6795d15227dfda (patch)
tree3f3042de3a141e491bc98acd91490a263939a74d /lua
parent42383b96d9a1b929080824946340d7459d49ac20 (diff)
downloadneovim-config-0d00ee23f35046f8465cb8302b6795d15227dfda.tar.gz
neovim-config-0d00ee23f35046f8465cb8302b6795d15227dfda.tar.bz2
neovim-config-0d00ee23f35046f8465cb8302b6795d15227dfda.zip
Snippets and general improvements
Diffstat (limited to 'lua')
-rw-r--r--lua/Snippets/tex/enumerate.lua2
-rw-r--r--lua/Snippets/tex/general.lua4
-rw-r--r--lua/Snippets/tex/math.lua32
-rw-r--r--lua/Snippets/tex/symbols.lua21
-rw-r--r--lua/lualine/theme.lua2
-rw-r--r--lua/plugins/cmp.lua20
-rw-r--r--lua/plugins/general.lua7
-rw-r--r--lua/plugins/interface.lua4
-rw-r--r--lua/plugins/lsp.lua1
-rw-r--r--lua/plugins/tex.lua1
-rw-r--r--lua/plugins/treesitter.lua55
11 files changed, 89 insertions, 60 deletions
diff --git a/lua/Snippets/tex/enumerate.lua b/lua/Snippets/tex/enumerate.lua
index 7677c9c..65c78a4 100644
--- a/lua/Snippets/tex/enumerate.lua
+++ b/lua/Snippets/tex/enumerate.lua
@@ -17,7 +17,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ite', snippetType = 'autosnippet' },
+ s({ trig = 'itm', snippetType = 'autosnippet' },
{ t('\\item') },
{ condition = tex.in_enumerate * helper.line_begin }
),
diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua
index 0c6521d..10b3c80 100644
--- a/lua/Snippets/tex/general.lua
+++ b/lua/Snippets/tex/general.lua
@@ -67,7 +67,7 @@ return {
)
),
- s({ trig = 'spt', snippetType = 'autosnippet' },
+ s({ trig = 'tsp', snippetType = 'autosnippet' },
fmta(
'\\textsuperscript{<>}',
{
@@ -77,7 +77,7 @@ return {
),
- s({ trig = 'sbt', snippetType = 'autosnippet' },
+ s({ trig = 'tsb', snippetType = 'autosnippet' },
fmta(
'\\textsubscript{<>}',
{
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
index 31f92d6..95c4e64 100644
--- a/lua/Snippets/tex/math.lua
+++ b/lua/Snippets/tex/math.lua
@@ -12,7 +12,7 @@ return {
)
),
- s({ trig = "tex", snippetType = "autosnippet" },
+ s({ trig = "txt", snippetType = "autosnippet" },
fmta(
'\\text{<>}',
{
@@ -102,7 +102,7 @@ return {
),
{ condition = tex.in_mathzone }
),
- s({ trig = "ove", snippetType = "autosnippet" },
+ s({ trig = "vrl", snippetType = "autosnippet" },
fmta(
'\\overline{<>}',
{
@@ -122,7 +122,7 @@ return {
{ condition = tex.in_mathzone }
),
- s({ trig = 'gg', snippetType = 'autosnippet' },
+ s({ trig = 'sqr', snippetType = 'autosnippet' },
fmta(
'\\sqrt[<>]{<>}',
{
@@ -143,7 +143,21 @@ return {
{ condition = tex.in_mathzone }
),
- s({ trig = "bb", snippetType = "autosnippet" },
+ s({ trig = "ngl", snippetType = "autosnippet" },
+ {
+ t('\\langle '),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = "ngr", snippetType = "autosnippet" },
+ {
+ t('\\rangle '),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = "lr", snippetType = "autosnippet" },
fmta(
'\\left(<>\\right)',
{
@@ -154,13 +168,13 @@ return {
),
s({ trig = 'df', snippetType = 'autosnippet' },
- { t('\\,d') },
+ { t('\\,d ') },
{ condition = tex.in_mathzone }
),
s({ trig = "sin", snippetType = "autosnippet" },
fmta(
- '\\sin{(<>)}',
+ '\\sin{\\left(<>\\right)}',
{
i(1),
}
@@ -170,7 +184,7 @@ return {
s({ trig = "cos", snippetType = "autosnippet" },
fmta(
- '\\cos{(<>)}',
+ '\\cos{\\left(<>\\right)}',
{
i(1),
}
@@ -180,7 +194,7 @@ return {
s({ trig = "tan", snippetType = "autosnippet" },
fmta(
- '\\tan{(<>)}',
+ '\\tan{\\left(<>\\right)}',
{
i(1),
}
@@ -208,7 +222,7 @@ return {
{ condition = tex.in_mathzone }
),
- s({ trig = "xpn", snippetType = "autosnippet" },
+ s({ trig = "exp", snippetType = "autosnippet" },
fmta(
'e^{<>}',
{
diff --git a/lua/Snippets/tex/symbols.lua b/lua/Snippets/tex/symbols.lua
index ef57ca4..76935db 100644
--- a/lua/Snippets/tex/symbols.lua
+++ b/lua/Snippets/tex/symbols.lua
@@ -17,6 +17,13 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = 'hbr', snippetType = 'autosnippet' },
+ {
+ t('\\hbar '),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = 'cdo', snippetType = 'autosnippet' },
{
t('\\cdot '),
@@ -31,6 +38,20 @@ return {
{ condition = tex.in_mathzone }
),
+ s({ trig = 'div', snippetType = 'autosnippet' },
+ {
+ t('\\div'),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
+ s({ trig = 'nn', snippetType = 'autosnippet' },
+ {
+ t('\\in'),
+ },
+ { condition = tex.in_mathzone }
+ ),
+
s({ trig = 'app', snippetType = 'autosnippet' },
{
t('\\approx '),
diff --git a/lua/lualine/theme.lua b/lua/lualine/theme.lua
index d07acef..91c58a4 100644
--- a/lua/lualine/theme.lua
+++ b/lua/lualine/theme.lua
@@ -1,4 +1,4 @@
-local colors = require('monokai-pro.colorscheme').colors
+local colors = require('monokai-pro.colorscheme')
local monokai_pro = {}
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({
- ['<Space>'] = cmp.mapping.confirm({ select = false }),
+ ['<S-Space>'] = cmp.mapping.confirm({ select = false }),
['<Tab>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
['<S-Tab>'] = 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,
- }
}