summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/Snippets/luasniphelperslatex.lua4
-rw-r--r--lua/Snippets/tex/chemistry.lua10
-rw-r--r--lua/Snippets/tex/environments.lua4
-rw-r--r--lua/Snippets/tex/figures.lua152
-rw-r--r--lua/Snippets/tex/general.lua11
-rw-r--r--lua/Snippets/tex/math.lua2
-rw-r--r--lua/Snippets/tex/sections.lua12
-rw-r--r--lua/config/keymaps.lua9
-rw-r--r--lua/plugins/cmp.lua2
-rw-r--r--lua/plugins/colorscheme.lua11
-rw-r--r--lua/plugins/interface.lua30
-rw-r--r--lua/plugins/lsp.lua32
-rw-r--r--lua/plugins/mini.lua33
-rw-r--r--lua/plugins/telescope.lua1
14 files changed, 229 insertions, 84 deletions
diff --git a/lua/Snippets/luasniphelperslatex.lua b/lua/Snippets/luasniphelperslatex.lua
index e0571cf..29599b3 100644
--- a/lua/Snippets/luasniphelperslatex.lua
+++ b/lua/Snippets/luasniphelperslatex.lua
@@ -17,4 +17,8 @@ tex.in_enumerate = function()
return tex.in_env('enumerate')
end
+tex.in_figure = function()
+ return tex.in_env('figure')
+end
+
return tex
diff --git a/lua/Snippets/tex/chemistry.lua b/lua/Snippets/tex/chemistry.lua
index a75536f..3ae0e9d 100644
--- a/lua/Snippets/tex/chemistry.lua
+++ b/lua/Snippets/tex/chemistry.lua
@@ -22,14 +22,4 @@ return {
}
)
),
-
- s({ trig = 'chrg', snippetType = 'autosnippet' },
- fmta(
- '\\charge{<>}{<>}',
- {
- i(1),
- i(2),
- }
- )
- ),
}
diff --git a/lua/Snippets/tex/environments.lua b/lua/Snippets/tex/environments.lua
index 3e8b543..46e5ee5 100644
--- a/lua/Snippets/tex/environments.lua
+++ b/lua/Snippets/tex/environments.lua
@@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers')
return {
- s({ trig = 'beg', snippetType = 'autosnippet' },
+ s({ trig = 'bgn', snippetType = 'autosnippet' },
fmta(
[[
\begin{<>}
@@ -19,7 +19,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ali', snippetType = 'autosnippet' },
+ s({ trig = 'lgn', snippetType = 'autosnippet' },
fmta(
[[
\begin{align*}
diff --git a/lua/Snippets/tex/figures.lua b/lua/Snippets/tex/figures.lua
index 4adc1b4..3cbed87 100644
--- a/lua/Snippets/tex/figures.lua
+++ b/lua/Snippets/tex/figures.lua
@@ -6,12 +6,39 @@ return {
s({ trig = 'chfig', snippetType = 'autosnippet' },
fmta(
[[
-\begin{figure}[h]
+\begin{figure}[!h]
\centering
\chemfig {
<>
}
- \caption{<>}
+ \caption{
+ <>
+ }
+ \label{fig:<>}
+\end{figure}
+]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ }
+ ),
+ { condition = helper.line_begin }
+ ),
+
+ s({ trig = 'chsch', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\begin{figure}[!h]
+ \centering
+ \schemestart
+ \chemfig {
+ <>
+ }
+ \schemestop
+ \caption{
+ <>
+ }
\label{fig:<>}
\end{figure}
]],
@@ -27,12 +54,14 @@ return {
s({ trig = 'imfig', snippetType = 'autosnippet' },
fmta(
[[
-\begin{figure}[h]
+\begin{figure}[!h]
\centering
\includegraphics
[<>]
{<>}
- \caption{<>}
+ \caption{
+ <>
+ }
\label{fig:<>}
\end{figure}
]],
@@ -49,13 +78,15 @@ return {
s({ trig = 'pdfig', snippetType = 'autosnippet' },
fmta(
[[
-\begin{figure}[h]
+\begin{figure}[!h]
\centering
\resizebox
{<>}
{!}
{\input{<>}}
- \caption{<>}
+ \caption{
+ <>
+ }
\label{fig:<>}
\end{figure}
]],
@@ -68,4 +99,113 @@ return {
),
{ condition = helper.line_begin }
),
+
+ s({ trig = 'sch', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\schemestart
+<>
+\schemestop
+]],
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'sus', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\subscheme {
+ <>
+}
+]],
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'chf', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\chemfig {
+ <>
+}
+ ]],
+ {
+ i(1),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'arr', snippetType = 'autosnippet' },
+ fmta(
+ '\\arrow(<>){<>}[<>]',
+ {
+ i(1),
+ i(2),
+ i(3),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'move', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\chemmove[shorten <<=<>,shorten >>=<>]{
+ \draw(<>).. controls +(<>) and +(<>).. (<>);
+}
+ ]],
+ {
+ i(1),
+ i(2),
+ i(3),
+ i(4),
+ i(5),
+ i(6),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'chr', snippetType = 'autosnippet' },
+ fmta(
+ '\\charge{<>}{<>}',
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'nme', snippetType = 'autosnippet' },
+ fmta(
+ [[
+\chemname{
+ <>
+}{<>}
+]],
+ {
+ i(1),
+ i(2),
+ }
+ ),
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'omi', snippetType = 'autosnippet' },
+ { t('\\ominus') },
+ { condition = tex.in_figure }
+ ),
+
+ s({ trig = 'opl', snippetType = 'autosnippet' },
+ { t('\\oplus') },
+ { condition = tex.in_figure }
+ ),
}
diff --git a/lua/Snippets/tex/general.lua b/lua/Snippets/tex/general.lua
index b53f80c..23d2e60 100644
--- a/lua/Snippets/tex/general.lua
+++ b/lua/Snippets/tex/general.lua
@@ -38,7 +38,7 @@ return {
)
),
- s({ trig = 'bf', snippetType = 'autosnippet' },
+ s({ trig = 'bft', snippetType = 'autosnippet' },
fmta(
'\\textbf{<>}',
{
@@ -47,6 +47,15 @@ return {
)
),
+ s({ trig = 'tlc', snippetType = 'autosnippet' },
+ fmta(
+ '\\textit{<>}',
+ {
+ i(1),
+ }
+ )
+ ),
+
s({ trig = 'cte', snippetType = 'autosnippet' },
fmta(
'\\supercite{<>}',
diff --git a/lua/Snippets/tex/math.lua b/lua/Snippets/tex/math.lua
index 47c21a8..53a2807 100644
--- a/lua/Snippets/tex/math.lua
+++ b/lua/Snippets/tex/math.lua
@@ -65,7 +65,7 @@ return {
{ condition = tex.in_mathzone }
),
- s({ trig = 'nn', snippetType = 'autosnippet' },
+ s({ trig = 'hhn', snippetType = 'autosnippet' },
fmta(
'\\num{<>}',
{
diff --git a/lua/Snippets/tex/sections.lua b/lua/Snippets/tex/sections.lua
index 432a424..582201e 100644
--- a/lua/Snippets/tex/sections.lua
+++ b/lua/Snippets/tex/sections.lua
@@ -3,7 +3,7 @@ local helper = require('Snippets.luasniphelpers')
return {
- s({ trig = 'sec', snippetType = 'autosnippet' },
+ s({ trig = 'sct', snippetType = 'autosnippet' },
fmta(
'\\section{<>}',
{
@@ -13,7 +13,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'nsec', snippetType = 'autosnippet' },
+ s({ trig = 'nsc', snippetType = 'autosnippet' },
fmta(
'\\newpage\\section{<>}',
{
@@ -23,7 +23,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ssec', snippetType = 'autosnippet' },
+ s({ trig = 'ssc', snippetType = 'autosnippet' },
fmta(
'\\subsection{<>}',
{
@@ -33,7 +33,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'nssec', snippetType = 'autosnippet' },
+ s({ trig = 'nssc', snippetType = 'autosnippet' },
fmta(
'\\newpage\\subsection{<>}',
{
@@ -43,7 +43,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'ssec', snippetType = 'autosnippet' },
+ s({ trig = 'sss', snippetType = 'autosnippet' },
fmta(
'\\newpage\\subsubsection{<>}',
{
@@ -53,7 +53,7 @@ return {
{ condition = helper.line_begin }
),
- s({ trig = 'nsssec', snippetType = 'autosnippet' },
+ s({ trig = 'nsss', snippetType = 'autosnippet' },
fmta(
'\\newpage\\subsubsection{<>}',
{
diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua
index a345140..e14dc63 100644
--- a/lua/config/keymaps.lua
+++ b/lua/config/keymaps.lua
@@ -11,9 +11,14 @@ return {
end)
vim.keymap.set('n', '<leader>w', '<cmd>w<cr>')
vim.keymap.set('n', '<leader>q', '<cmd>qa<cr>')
- vim.keymap.set('n', '<leader>e', [[<C-w>]])
vim.keymap.set('n', '<leader>p', [["+p]])
- vim.keymap.set({ 'n', 'v' }, '<leader>y', [['+y]])
+ vim.keymap.set('v', '<leader>y', [["+y]])
+ vim.keymap.set('n', '<leader>y', [[<S-v>"+y]])
+
+ vim.keymap.set('n', '<leader>h', [[<C-w>h]])
+ vim.keymap.set('n', '<leader>j', [[<C-w>j]])
+ vim.keymap.set('n', '<leader>k', [[<C-w>k]])
+ vim.keymap.set('n', '<leader>l', [[<C-w>l]])
end,
},
}
diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua
index 3f7b6ea..4f9d8f4 100644
--- a/lua/plugins/cmp.lua
+++ b/lua/plugins/cmp.lua
@@ -24,7 +24,6 @@ return {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'FelipeLema/cmp-async-path',
- 'hrsh7th/cmp-calc',
'saadparwaiz1/cmp_luasnip',
'L3MON4D3/LuaSnip',
},
@@ -56,7 +55,6 @@ return {
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'async_path' },
- { name = 'calc' },
}),
formatting = {
format = function(_, item)
diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua
index a857143..42c977c 100644
--- a/lua/plugins/colorscheme.lua
+++ b/lua/plugins/colorscheme.lua
@@ -6,16 +6,13 @@ return {
config = function()
vim.opt.background = 'dark'
require('monokai-pro').setup({
- plugins = {
- indent_blankline = {
- context_highlight = 'pro',
- },
- },
+ filter = 'octagon',
override = function(c)
return {
- TelescopePromptNormal = { bg = c.base.dimmed3 },
+ TelescopeSelection = { bg = c.base.dimmed3 },
+ TelescopePromptNormal = { bg = c.base.dimmed3, fg = c.base.white },
TelescopePromptBorder = { bg = c.base.dimmed3, fg = c.base.dimmed3 },
- TelescopeResultsNormal = { bg = c.base.dimmed5 },
+ TelescopeResultsNormal = { bg = c.base.dimmed5, fg = c.base.white },
TelescopeResultsBorder = { bg = c.base.dimmed5, fg = c.base.dimmed5 },
TelescopePreviewNormal = { bg = c.base.dimmed5 },
TelescopePreviewBorder = { bg = c.base.dimmed5, fg = c.base.dimmed5 },
diff --git a/lua/plugins/interface.lua b/lua/plugins/interface.lua
index f5009f6..c1164d1 100644
--- a/lua/plugins/interface.lua
+++ b/lua/plugins/interface.lua
@@ -1,5 +1,8 @@
return {
{
+ 'nvim-tree/nvim-web-devicons',
+ },
+ {
'nvim-lualine/lualine.nvim',
event = 'VeryLazy',
opts = {
@@ -51,31 +54,4 @@ return {
{ bg = require('monokai-pro.colorscheme').colors.editor.backgroundnil })
end,
},
- {
- 'lukas-reineke/indent-blankline.nvim',
- event = {
- 'BufReadPost',
- 'BufNewFile'
- },
- opts = {
- show_current_context = true,
- },
- },
- {
- 'lewis6991/gitsigns.nvim',
- event = {
- 'BufReadPost',
- 'BufNewFile'
- },
- opts = {
- signs = {
- add = { text = ' │' },
- change = { text = ' │' },
- delete = { text = ' │' },
- topdelete = { text = ' │' },
- changedelete = { text = ' │' },
- untracked = { text = ' │' },
- },
- },
- },
}
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua
index 668a80a..740e0cc 100644
--- a/lua/plugins/lsp.lua
+++ b/lua/plugins/lsp.lua
@@ -2,7 +2,7 @@ return {
{
'neovim/nvim-lspconfig',
event = {
- 'BufReadPost',
+ 'BufReadPre',
'BufNewFile'
},
dependencies = {
@@ -11,27 +11,14 @@ return {
'hrsh7th/cmp-nvim-lsp',
},
config = function()
- require('mason').setup()
-
- require('mason-lspconfig').setup()
-
local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities()
- local lsp_attach = function(client, bufnr)
- end
-
+ local lsp_attach = function(client, bufnr) end
local lspconfig = require('lspconfig')
- require('mason-lspconfig').setup_handlers({
- function(server_name)
- lspconfig[server_name].setup({
- on_attach = lsp_attach,
- capabilities = lsp_capabilities,
- })
- end,
- })
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
+
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
- vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
+ vim.fn.sign_define(hl, { texthl = hl, numhl = hl })
end
vim.diagnostic.config({
update_in_insert = true,
@@ -53,6 +40,17 @@ return {
vim.diagnostic.open_float(nil, opts)
end
})
+
+ require('mason').setup()
+ require('mason-lspconfig').setup()
+ require('mason-lspconfig').setup_handlers({
+ function(server_name)
+ lspconfig[server_name].setup({
+ on_attach = lsp_attach,
+ capabilities = lsp_capabilities,
+ })
+ end,
+ })
end,
},
}
diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua
index 114e5bb..4284334 100644
--- a/lua/plugins/mini.lua
+++ b/lua/plugins/mini.lua
@@ -1,6 +1,6 @@
return {
{
- 'echasnovski/mini.nvim',
+ 'echasnovski/mini.sessions',
event = 'VimEnter',
keys = {
{
@@ -20,8 +20,18 @@ return {
},
config = function()
require('mini.sessions').setup({
- force = { read = false, write = true, delete = true }
+ force = {
+ read = false,
+ write = true,
+ delete = true,
+ },
})
+ end,
+ },
+ {
+ 'echasnovski/mini.starter',
+ event = 'VimEnter',
+ config = function()
require('mini.starter').setup({
evaluate_single = true,
silent = true,
@@ -31,4 +41,23 @@ return {
})
end,
},
+ {
+ 'echasnovski/mini.indentscope',
+ event = {
+ 'BufReadPre',
+ 'BufNewFile'
+ },
+ config = function()
+ require('mini.indentscope').setup({
+ draw = {
+ delay = 0,
+ animation = require('mini.indentscope').gen_animation.none(),
+ },
+ options = {
+ try_as_border = true,
+ },
+ symbol = '│',
+ })
+ end,
+ },
}
diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua
index 2ff3777..c95b7bc 100644
--- a/lua/plugins/telescope.lua
+++ b/lua/plugins/telescope.lua
@@ -9,7 +9,6 @@ return {
},
dependencies = {
'nvim-lua/plenary.nvim',
- 'nvim-tree/nvim-web-devicons',
'nvim-telescope/telescope-fzf-native.nvim',
},
opts = {