From 8269fa1d12c187ab8a7c6b46e99f15007b84b6b0 Mon Sep 17 00:00:00 2001 From: Leslie Kerman Date: Fri, 3 May 2024 00:51:19 +0100 Subject: [PATCH] Add latex editing stuff (among other stuff) --- lazy-lock.json | 46 ++++++++++ lua/configs/autocomplete.lua | 144 ++++++++++++++---------------- lua/configs/latex.lua | 12 +++ lua/core/init.lua | 12 +++ lua/core/keymaps.lua | 165 ++++++++++++++++++----------------- lua/core/plugins.lua | 5 +- lua/core/theme.lua | 65 ++++++-------- snippets/tex.snippets | 21 +++++ 8 files changed, 270 insertions(+), 200 deletions(-) create mode 100644 lazy-lock.json create mode 100644 lua/configs/latex.lua create mode 100644 snippets/tex.snippets diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..91ef50e --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,46 @@ +{ + "LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "aylin.vim": { "branch": "master", "commit": "d9532f02f5ea8f396fc62c50bb34c348b4a9aa02" }, + "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, + "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "edge": { "branch": "master", "commit": "4e2eee9fbbad1c8fdcad8acda979d3828aee538d" }, + "everforest-nvim": { "branch": "main", "commit": "5e0e32a569fb464911342f0d421721cc1c94cf25" }, + "github-nvim-theme": { "branch": "main", "commit": "7b97aa55ef9dabce479f74f86b8c61c1464c9d2e" }, + "gitsigns.nvim": { "branch": "main", "commit": "9cafac31a091267838e1e90fd6e083d37611f516" }, + "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, + "haskell-tools.nvim": { "branch": "master", "commit": "217cb7958ebbebf360f7c43efd5129e66d748042" }, + "kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" }, + "lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, + "lspsaga.nvim": { "branch": "main", "commit": "052234296f13e2705d5d290c7bd5a36d3dd81fde" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "material.vim": { "branch": "main", "commit": "07e70d5d675fadb1e81191b2d990b2a72edccf0d" }, + "nlsp-settings.nvim": { "branch": "main", "commit": "2421dc3811af0c870ca93dcaf714943339e7ea88" }, + "nordic.nvim": { "branch": "main", "commit": "03fcff3c8d68049b8118047784746048b4a08049" }, + "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, + "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, + "nvim-lspconfig": { "branch": "master", "commit": "aa5f4f4ee10b2688fb37fa46215672441d5cd5d9" }, + "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, + "nvim-tree.lua": { "branch": "master", "commit": "347e1eb35264677f66a79466bb5e3d111968e12c" }, + "nvim-treesitter": { "branch": "master", "commit": "99d3e799b46f5c2a1fc0d7a42d7ab452de48c067" }, + "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, + "one-nvim": { "branch": "main", "commit": "faf6fb3f98fccbe009c3466f657a8fff84a5f956" }, + "onedark.vim": { "branch": "main", "commit": "57b77747694ea5676c3ca0eeaf9567dc499730c0" }, + "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, + "papercolor-theme": { "branch": "master", "commit": "0cfe64ffb24c21a6101b5f994ca342a74c977aef" }, + "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, + "ripgrep": { "branch": "master", "commit": "bb8601b2bafb5e68181cbbb84e6ffa4f7a72bf16" }, + "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, + "sonokai": { "branch": "master", "commit": "da162343354fbd9bf9cd49293a856f0e3761e8ac" }, + "space-vim-dark": { "branch": "master", "commit": "0ab698bd2a3959e3bed7691ac55ba4d8abefd143" }, + "telescope.nvim": { "branch": "master", "commit": "2d0d057791854decb2c9b6a0b52d43f3900dff40" }, + "toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" }, + "tokyodark.nvim": { "branch": "master", "commit": "ba538ab69e8a4e3ebac127734b7deff9e7462463" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" }, + "vimtex": { "branch": "master", "commit": "a80934749c69cc6875b3c9b13ef59573a4824fb2" } +} \ No newline at end of file diff --git a/lua/configs/autocomplete.lua b/lua/configs/autocomplete.lua index 1b3e349..12635ec 100644 --- a/lua/configs/autocomplete.lua +++ b/lua/configs/autocomplete.lua @@ -2,69 +2,67 @@ local M = {} function M.config() -- Setup nvim-cmp. - local cmp = require 'cmp' + local cmp = require("cmp") + local luasnip = require("luasnip") + local has_words_before = function() + 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 cmp.setup({ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - -- luasnip - require('luasnip').lsp_expand(args.body) - -- vsnip - -- vim.fn["vsnip#anonymous"](args.body) - -- snippy - -- require('snippy').expand_snippet(args.body) - -- ultisnip - -- vim.fn["UltiSnips#Anon"](args.body) - end, - }, - mapping = { - [''] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }), - [''] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }), - [''] = cmp.config.disable, - [''] = cmp.mapping({ - i = cmp.mapping.abort(), - c = cmp.mapping.close(), - }), - -- Accept currently selected item... - -- Set `select` to `false` to only confirm explicitly selected items: - [''] = cmp.mapping.confirm({ select = true }), - }, - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }, { { name = 'buffer' } }) + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif cmp.visible() then + cmp.select_next_item() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if luasnip.jumpable(-1) then + luasnip.jump(-1) + elseif cmp.visible() then + cmp.select_prev_item() + end + end, { "i", "s" }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' } + }, { + { name = 'buffer' }, + }) }) - -- You can also set special config for specific filetypes: - -- cmp.setup.filetype('gitcommit', { - -- sources = cmp.config.sources({ - -- { name = 'cmp_git' }, - -- }, { - -- { name = 'buffer' }, - -- }) - -- }) - -- nvim-cmp for commands - cmp.setup.cmdline('/', { + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } }) cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } - }) + }), + matching = { disallow_symbol_nonprefix_matching = false } }) - local has_words_before = function() - 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 nlspsettings = require("nlspsettings") @@ -76,30 +74,8 @@ function M.config() loader = 'json' }) - cmp.setup({ - mapping = { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - }) + require("luasnip.loaders.from_snipmate").lazy_load({paths = "~/.config/nvim/snippets/"}) + local devicons = require('nvim-web-devicons') cmp.register_source('devicons', { complete = function(_, _, callback) @@ -115,22 +91,30 @@ function M.config() end, }) - -- nvim-lspconfig config + -- Set up nvim-lspconfig. -- List of all pre-configured LSP servers: -- github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md - local servers = { 'pylsp', 'clangd', 'html', 'cssls' } + + -- Servers without extra config + local servers = { 'pylsp', 'html', 'zls' } local lspconfig = require('lspconfig') for _, lsp in pairs(servers) do lspconfig[lsp].setup {} end - lspconfig.rust_analyzer.setup { + + -- Servers with extra config + lspconfig['rust_analyzer'].setup { settings = { ["rust-analyzer"] = { procMacro = { enable = true }, } } } + lspconfig['clangd'].setup { + cmd = {'clangd', '-header-insertion=never' } + } + --- Set up LspSaga. require("lspsaga").setup({ ui = { -- This option only works in Neovim 0.9 @@ -254,11 +238,11 @@ function M.config() auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result signs = { -- icons / text used for a diagnostic - error = "", - warning = "", - hint = "", + error = "", + warning = "", + hint = "", information = "", - other = "﫠" + other = "󰮍" }, use_diagnostic_signs = false -- enabling this will use the signs defined in your lsp client } diff --git a/lua/configs/latex.lua b/lua/configs/latex.lua new file mode 100644 index 0000000..24844b7 --- /dev/null +++ b/lua/configs/latex.lua @@ -0,0 +1,12 @@ +local M = {} +function M.config() + -- vim.g.vimtex_view_general_viewer = "open" + -- vim.g.vimtex_view_general_options = "" + vim.g.vimtex_view_method = "zathura" + vim.g.tex_flavor="latex" + vim.g.vimtex_view_method="zathura" + vim.g.vimtex_quickfix_mode=0 + vim.cmd "highlight! Conceal guifg=white" +end +return M + diff --git a/lua/core/init.lua b/lua/core/init.lua index 59b0825..024736a 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -73,7 +73,19 @@ require("configs.terminal").config() require("configs.nvimtree").config() require("configs.scrollbar").config() require("configs.telescope").config() +require("configs.latex").config() require("configs.lang.rust").config() require("core.keymaps") require("core.theme") + +local list_snips = function() + local ft_list = require("luasnip").available()[vim.o.filetype] + local ft_snips = {} + for _, item in pairs(ft_list) do + ft_snips[item.trigger] = item.name + end + print(vim.inspect(ft_snips)) +end + +vim.api.nvim_create_user_command("SnipList", list_snips, {}) diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua index 6ca4309..d529019 100644 --- a/lua/core/keymaps.lua +++ b/lua/core/keymaps.lua @@ -1,111 +1,114 @@ -vim.g.mapleader = ';' +vim.g.mapleader = ";" local function set_bg_light() - vim.cmd('set background=light') - local colors_name = vim.g.colors_name - vim.cmd('colorscheme shine') - vim.cmd('colorscheme ' .. colors_name) + vim.cmd("set background=light") end local function set_bg_dark() - vim.cmd('set background=dark') - local colors_name = vim.g.colors_name - vim.cmd('colorscheme ron') - vim.cmd('colorscheme ' .. colors_name) + vim.cmd("set background=dark") end -- keymaps -vim.keymap.set('i', '', '') -vim.keymap.set('i', '', '') -vim.keymap.set('i', '', '') -vim.keymap.set('i', '', '') -vim.keymap.set('i', '', '') -vim.keymap.set('n', '', '') -vim.keymap.set('n', '', '') -vim.keymap.set('n', '', '') -vim.keymap.set('n', '', '') -vim.keymap.set('i', '', '::') -- for C++ and Rust -vim.keymap.set('n', 'vl', set_bg_light) -vim.keymap.set('n', 'vd', set_bg_dark) -vim.keymap.set('n', '', ':') +vim.keymap.set("i", "", "") +vim.keymap.set("i", "", "") +vim.keymap.set("i", "", "") +vim.keymap.set("i", "", "") +vim.keymap.set("i", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("n", "", "") +vim.keymap.set("i", "", "::") -- for C++ and Rust and Haskell, etc. +vim.keymap.set("n", "vl", set_bg_light) +vim.keymap.set("n", "vd", set_bg_dark) +vim.keymap.set("n", "", ":") + +local ls = require("luasnip") +vim.keymap.set({"i"}, "", function() ls.expand() end, {silent = true}) +vim.keymap.set({"i", "s"}, "", function() ls.jump( 1) end, {silent = true}) +vim.keymap.set({"i", "s"}, "", function() + if ls.choice_active() then + ls.change_choice(1) + end +end, {silent = true}) -- f: file tree -vim.keymap.set('n', '', ':NvimTreeToggle') -vim.keymap.set('n', 'ft', ':NvimTreeToggle') +vim.keymap.set("n", "", ":NvimTreeToggle") +vim.keymap.set("n", "ft", ":NvimTreeToggle") -- y: telescope -local telescope = require 'telescope.builtin' -vim.keymap.set('n', '', function() telescope.find_files {} end) -vim.keymap.set('n', '', function() telescope.git_files {} end) -vim.keymap.set('n', '', function() telescope.buffers {} end) -vim.keymap.set({ 'n', 'i' }, '', function() telescope.registers {} end) +local telescope = require "telescope.builtin" +vim.keymap.set("n", "", function() telescope.find_files {} end) +vim.keymap.set("n", "", function() telescope.git_files {} end) +vim.keymap.set("n", "", function() telescope.buffers {} end) +vim.keymap.set({ "n", "i" }, "", function() telescope.registers {} end) -- w: window -vim.keymap.set('n', 'w1', 'o') -vim.keymap.set('n', 'wx', ':x') -vim.keymap.set('n', 'w2', ':sp') -vim.keymap.set('n', 'w3', ':vs') +vim.keymap.set("n", "w1", "o") +vim.keymap.set("n", "wx", ":x") +vim.keymap.set("n", "w2", ":sp") +vim.keymap.set("n", "w3", ":vs") -- window resize -vim.keymap.set('n', '', '<') -vim.keymap.set('n', '', '>') -vim.keymap.set('n', '', '-') -vim.keymap.set('n', '', '+') +vim.keymap.set("n", "", "<") +vim.keymap.set("n", "", ">") +vim.keymap.set("n", "", "-") +vim.keymap.set("n", "", "+") -- b: buffer -vim.keymap.set('n', 'bn', ':bn') -vim.keymap.set('n', 'bp', ':bp') -vim.keymap.set('n', 'bd', ':Bdelete') +vim.keymap.set("n", "bn", ":bn") +vim.keymap.set("n", "bp", ":bp") +vim.keymap.set("n", "bd", ":Bdelete") -- p: plugins -vim.keymap.set('n', 'pi', ':PackerInstall') -vim.keymap.set('n', 'pc', ':PackerClean') +vim.keymap.set("n", "pi", ":PackerInstall") +vim.keymap.set("n", "pc", ":PackerClean") -- s: search -vim.keymap.set('n', 'ss', '/') -vim.keymap.set('n', 'sw', '/\\\\>') +vim.keymap.set("n", "ss", "/") +vim.keymap.set("n", "sw", "/\\\\>") -- l/g/w: language -- l: general -- g: goto -- w: workspace -- e: diagnostics -vim.keymap.set('n', 'ee', ':Lspsaga show_line_diagnostics') -vim.keymap.set('n', 'ef', ':Lspsaga show_cursor_diagnostics') -vim.keymap.set('n', 'el', ':TroubleToggle') -- Show list of diagnostics across the workspace -vim.keymap.set('n', 'et', ':Trouble') -- Focus onto the trouble window -vim.keymap.set('n', 'lq', vim.diagnostic.setloclist) -vim.keymap.set('n', 'lk', ':Lspsaga hover_doc') -vim.keymap.set('n', 'ld', ':Lspsaga preview_definition') -vim.keymap.set('n', 'lr', ':Lspsaga rename') -vim.keymap.set('n', 'lh', vim.lsp.buf.signature_help) -vim.keymap.set('n', 'lf', function() vim.lsp.buf.format { async = true } end) -vim.keymap.set('n', 'la', ':Lspsaga code_action') -vim.keymap.set('n', '', ':Lspsaga code_action') +vim.keymap.set("n", "ee", ":Lspsaga show_line_diagnostics") +vim.keymap.set("n", "ef", ":Lspsaga show_cursor_diagnostics") +vim.keymap.set("n", "el", ":TroubleToggle") -- Show list of diagnostics across the workspace +vim.keymap.set("n", "et", ":Trouble") -- Focus onto the trouble window +vim.keymap.set("n", "lq", vim.diagnostic.setloclist) +vim.keymap.set("n", "lk", ":Lspsaga hover_doc") +vim.keymap.set("n", "ld", ":Lspsaga preview_definition") +vim.keymap.set("n", "lr", ":Lspsaga rename") +vim.keymap.set("n", "lh", vim.lsp.buf.signature_help) +vim.keymap.set("n", "lf", function() vim.lsp.buf.format { async = true } end) +vim.keymap.set("n", "la", ":Lspsaga code_action") +vim.keymap.set("n", "", ":Lspsaga code_action") -vim.keymap.set('n', 'gd', ':Glance definitions') -vim.keymap.set('n', '', ':Glance references') -vim.keymap.set('n', 'gt', ':Glance type_definitions') -vim.keymap.set('n', 'gi', ':Glance implementations') -vim.keymap.set('n', 'gN', ':Lspsaga diagnostic_jump_prev') -vim.keymap.set('n', 'gn', ':Lspsaga diagnostic_jump_next') +vim.keymap.set("n", "gd", ":Glance definitions") +vim.keymap.set("n", "", ":Glance references") +vim.keymap.set("n", "gt", ":Glance type_definitions") +vim.keymap.set("n", "gi", ":Glance implementations") +vim.keymap.set("n", "gN", ":Lspsaga diagnostic_jump_prev") +vim.keymap.set("n", "gn", ":Lspsaga diagnostic_jump_next") -vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder) -vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder) -vim.keymap.set('n', 'wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end) +vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder) +vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder) +vim.keymap.set("n", "wl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end) -- t: terminal -- use to toggle terminal, this can be set in lua/configs/terminal.lua -- the default position is also set in lua/configs/terminal.lua -local terminal = require('toggleterm.terminal') -vim.keymap.set('t', '', '') -vim.keymap.set('n', 'tt', ':ToggleTerm direction=tab') -vim.keymap.set('n', 'tn', function() terminal.Terminal:new():toggle() end) -vim.keymap.set('n', 'tf', ':ToggleTerm direction=float') -vim.keymap.set('n', 'th', ':ToggleTerm direction=horizontal') -vim.keymap.set('n', 'tv', ':ToggleTerm direction=vertical') +local terminal = require("toggleterm.terminal") +vim.keymap.set("t", "", "") +vim.keymap.set("n", "tt", ":ToggleTerm direction=tab") +vim.keymap.set("n", "tn", function() terminal.Terminal:new():toggle() end) +vim.keymap.set("n", "tf", ":ToggleTerm direction=float") +vim.keymap.set("n", "th", ":ToggleTerm direction=horizontal") +vim.keymap.set("n", "tv", ":ToggleTerm direction=vertical") -- h: git -vim.keymap.set('n', 'hu', ':Gitsigns undo_stage_hunk') -vim.keymap.set('n', 'hn', ':Gitsigns next_hunk') -vim.keymap.set('n', 'hN', ':Gitsigns next_hunk') -vim.keymap.set('n', 'hc', ':Gitsigns preview_hunk') -vim.keymap.set('n', 'hr', ':Gitsigns reset_hunk') -vim.keymap.set('n', 'hR', ':Gitsigns reset_buffer') -vim.keymap.set('n', 'hb', ':Gitsigns blame_line') -vim.keymap.set('n', 'hd', ':Gitsigns diffthis') -vim.keymap.set('n', 'hs', ':Gitsigns select_hunk') +vim.keymap.set("n", "hu", ":Gitsigns undo_stage_hunk") +vim.keymap.set("n", "hn", ":Gitsigns next_hunk") +vim.keymap.set("n", "hN", ":Gitsigns next_hunk") +vim.keymap.set("n", "hc", ":Gitsigns preview_hunk") +vim.keymap.set("n", "hr", ":Gitsigns reset_hunk") +vim.keymap.set("n", "hR", ":Gitsigns reset_buffer") +vim.keymap.set("n", "hb", ":Gitsigns blame_line") +vim.keymap.set("n", "hd", ":Gitsigns diffthis") +vim.keymap.set("n", "hs", ":Gitsigns select_hunk") diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua index f990e65..7bc7c8b 100644 --- a/lua/core/plugins.lua +++ b/lua/core/plugins.lua @@ -15,6 +15,8 @@ require("lazy").setup({ "Th3Whit3Wolf/one-nvim", "AlexvZyl/nordic.nvim", "lewis6991/gitsigns.nvim", + "kaicataldo/material.vim", + "neanias/everforest-nvim", -- basics "kyazdani42/nvim-web-devicons", @@ -24,7 +26,7 @@ require("lazy").setup({ "akinsho/bufferline.nvim", "moll/vim-bbye", - -- language + { "lervag/vimtex", lazy = false }, "neovim/nvim-lspconfig", "glepnir/lspsaga.nvim", "hrsh7th/cmp-nvim-lsp", @@ -36,6 +38,7 @@ require("lazy").setup({ "nvim-treesitter/nvim-treesitter", "simrat39/rust-tools.nvim", "dnlhc/glance.nvim", + { 'mrcjkb/haskell-tools.nvim', version = '^3', ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject', } ,}, "tamago324/nlsp-settings.nvim", "folke/trouble.nvim", "nvim-lualine/lualine.nvim", diff --git a/lua/core/theme.lua b/lua/core/theme.lua index 4601dc0..7be019d 100644 --- a/lua/core/theme.lua +++ b/lua/core/theme.lua @@ -3,60 +3,49 @@ -- themes with special settings -- sonokai ---sonokai styles: default, atlantis, andromeda, shusia, maia, espresso ---vim.g.sonokai_style = 'default' ---vim.g.sonokai_enable_italic = 0 ---vim.g.sonokai_disable_italic_comment = 0 ---vim.cmd('colorscheme sonokai') +-- sonokai styles: default, atlantis, andromeda, shusia, maia, espresso +-- vim.g.sonokai_style = 'default' +-- vim.g.sonokai_enable_italic = 0 +-- vim.g.sonokai_disable_italic_comment = 0 -- tokyo night -- vim.g.tokyodark_transparent_background = false ---vim.g.tokyodark_enable_italic_comment = true ---vim.g.tokyodark_enable_italic = true ---vim.g.tokyodark_color_gamma = "1.0" ---vim.cmd("colorscheme tokyodark") +-- vim.g.tokyodark_enable_italic_comment = true +-- vim.g.tokyodark_enable_italic = true +-- vim.g.tokyodark_color_gamma = "1.0" -- Change the "hint" color to the "orange" color, and make the "error" color bright red ---vim.g.tokyonight_colors = { hint = "orange", error = "#cb5550" } ---vim.cmd('colorscheme sonokai') +-- vim.g.tokyonight_colors = { hint = "orange", error = "#cb5550" } -- space vim dark -- vim.g.space_vim_dark_background = 234 -- 234 (darkest) ~ 238 (lightest) --- vim.cmd("colorscheme space-vim-dark"); -- kanagwa -- Default options: ---require('kanagawa').setup({ --- undercurl = true, -- enable undercurls --- commentStyle = { italic = true }, --- functionStyle = {}, --- keywordStyle = { italic = true}, --- statementStyle = { bold = true }, --- typeStyle = {}, --- variablebuiltinStyle = { italic = true}, --- specialReturn = true, -- special highlight for the return keyword --- specialException = true, -- special highlight for exception handling keywords --- transparent = false, -- do not set background color --- dimInactive = false, -- dim inactive window `:h hl-NormalNC` --- globalStatus = false, -- adjust window separators highlight for laststatus=3 --- colors = {}, --- overrides = {}, ---}) - ---vim.cmd("colorscheme kanagawa") +-- require('kanagawa').setup({ +-- undercurl = true, -- enable undercurls +-- commentStyle = { italic = true }, +-- functionStyle = {}, +-- keywordStyle = { italic = true}, +-- statementStyle = { bold = true }, +-- typeStyle = {}, +-- variablebuiltinStyle = { italic = true}, +-- specialReturn = true, -- special highlight for the return keyword +-- specialException = true, -- special highlight for exception handling keywords +-- transparent = false, -- do not set background color +-- dimInactive = false, -- dim inactive window `:h hl-NormalNC` +-- globalStatus = false, -- adjust window separators highlight for laststatus=3 +-- colors = {}, +-- overrides = {}, +-- }) -- edge -- vim.g.edge_style = 'aura' -- neon, aura -- vim.g.edge_better_performance = 1 --- vim.cmd("colorscheme edge") --- github --- vim.cmd("colorscheme github_dark_high_contrast") +-- material +-- vim.g.material_theme_style = 'darker' --- oxocarbon --- vim.cmd("colorscheme oxocarbon") - --- nordic -vim.cmd("colorscheme sonokai") +vim.cmd("colorscheme edge") vim.cmd("set background=dark") diff --git a/snippets/tex.snippets b/snippets/tex.snippets new file mode 100644 index 0000000..934aade --- /dev/null +++ b/snippets/tex.snippets @@ -0,0 +1,21 @@ +snippet be "begin{} / end{}" bA + \begin{$1} + $0 + \end{$1} + +snippet al "begin{align} / end{align}" bA + \begin{align} + $0 + \end{align} + +snippet bf "{\bf ...}" bA + {\bf $1}$0 + +snippet it "{\it ...}" bA + {\it $1}$0 + +snippet un "{\it ...}" bA + {\un $1}$0 + +snippet fr "\frac {} {}" bA + \frac {$1} {$2}$0