From 31c7bc5258d7323658e60cb5400d5f3457fff74f Mon Sep 17 00:00:00 2001 From: Matthew Wozniak Date: Thu, 18 Jan 2024 19:30:36 -0500 Subject: vimtex --- after/plugin/cfg.vim | 8 +++----- after/plugin/lsp.lua | 3 ++- after/plugin/lualine.lua | 3 ++- after/plugin/luasnip.lua | 24 ++++++++++++++++++++++++ after/plugin/vimtex.vim | 3 +++ 5 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 after/plugin/luasnip.lua create mode 100644 after/plugin/vimtex.vim (limited to 'after/plugin') diff --git a/after/plugin/cfg.vim b/after/plugin/cfg.vim index 94659fc..b11cdce 100644 --- a/after/plugin/cfg.vim +++ b/after/plugin/cfg.vim @@ -15,8 +15,6 @@ set guioptions-=L set gfn=Fira\ Code:h12 set noshowmode -if !has('gui_running') - colorscheme dim -else - colorscheme monochrome -endif +set formatoptions+=a + +colorscheme vacme diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 7722c1e..f3ecc2f 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -2,7 +2,7 @@ local lspconfig = require('lspconfig') local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities() -local servers = {"clangd", "zls", "rust_analyzer", "lua_ls"} +local servers = {"clangd", "zls", "rust_analyzer", "lua_ls", "texlab"} for _, lsp in pairs(servers) do lspconfig[lsp].setup { capabilities = lsp_capabilities, @@ -40,6 +40,7 @@ local luasnip = require('luasnip') local select_opts = {behavior = cmp.SelectBehavior.Select} cmp.setup({ + experimental = { ghost_text = true }, formatting = { fields = {'menu', 'abbr', 'kind'}, format = function(entry, item) diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua index 1d60a17..0e3427d 100644 --- a/after/plugin/lualine.lua +++ b/after/plugin/lualine.lua @@ -1,4 +1,4 @@ -if vim.fn.has('gui_running') then +if vim.fn.has('gui_running') == 1 then require('lualine').setup { options = { component_separators = { left = '', right = ''}, @@ -11,6 +11,7 @@ else options = { component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, + theme = require('lualine.themes.auto'), } } end diff --git a/after/plugin/luasnip.lua b/after/plugin/luasnip.lua new file mode 100644 index 0000000..5ee5143 --- /dev/null +++ b/after/plugin/luasnip.lua @@ -0,0 +1,24 @@ +require("luasnip").config.set_config({ -- Setting LuaSnip config + + -- Enable autotriggered snippets + enable_autosnippets = true, + + -- Use Tab (or some other key if you prefer) to trigger visual selection + store_selection_keys = "", +}) + +vim.cmd[[ +" Expand or jump in insert mode +imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' + +" Jump forward through tabstops in visual mode +smap luasnip#jumpable(1) ? 'luasnip-jump-next' : '' + +" Jump backward through snippet tabstops with Shift-Tab (for example) +imap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '' +smap luasnip#jumpable(-1) ? 'luasnip-jump-prev' : '' +]] + +require("luasnip.loaders.from_lua").load({ + paths = "~/etc/nvim/luasnip", +}) diff --git a/after/plugin/vimtex.vim b/after/plugin/vimtex.vim new file mode 100644 index 0000000..3d3e289 --- /dev/null +++ b/after/plugin/vimtex.vim @@ -0,0 +1,3 @@ +noremap wc VimtexCountWords +let g:vimtex_view_method = 'zathura' + -- cgit v1.2.3-54-g00ecf