From 7e68aa434eb56ac5ce9140f501fdc8a2bba10fd6 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 4 Apr 2022 13:56:14 +0200 Subject: Added neovim jinja syntax --- config/nvim/lua/plugins.lua | 118 +++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 55 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 2156a52..2e51e37 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -9,6 +9,11 @@ return require('packer').startup(function() use 'romainl/vim-cool' -- only highlight search matches when searching use 'lukas-reineke/indent-blankline.nvim' + use { + 'cacharle/vim-jinja-languages', + requires = {'mitsuhiko/vim-jinja'} + } + -- python formatter use { 'psf/black', @@ -37,60 +42,60 @@ return require('packer').startup(function() } -- nvim lsp configuration - -- use { - -- 'neovim/nvim-lspconfig', - -- ft = {'rust', 'python', 'c', 'cpp', 'lua'}, - -- config = function() - -- local on_attach = function(_, bufnr) - -- local opts = { noremap = true, silent = true } - -- local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - -- map('n', '[', 'lua vim.lsp.buf.declaration()', opts) - -- map('n', ']', 'lua vim.lsp.buf.definition()', opts) - -- map('n', 'K', 'lua vim.lsp.buf.hover()', opts) - -- map('n', 'gk', 'lua vim.lsp.buf.signature_help()', opts) - -- map('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - -- map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) - -- map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) - -- map('n', 'q', 'Telescope diagnostics', opts) - -- map('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - -- end - -- local lspconfig = require('lspconfig') - -- lspconfig.clangd.setup { on_attach = on_attach } - -- lspconfig.rust_analyzer.setup { on_attach = on_attach } - -- -- need python-lsp-server and pyls-flake8 - -- lspconfig.pylsp.setup { on_attach = on_attach } - -- -- package lua-language-server on ArchLinux - -- lspconfig.sumneko_lua.setup { - -- on_attach = on_attach , - -- settings = { - -- Lua = { - -- runtime = { - -- -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - -- version = 'LuaJIT', - -- -- Setup your lua path - -- path = vim.split(package.path, ';'), - -- }, - -- diagnostics = { - -- -- Get the language server to recognize the `vim` global - -- globals = {'vim'}, - -- }, - -- workspace = { - -- -- Make the server aware of Neovim runtime files - -- library = { - -- [vim.fn.expand('$VIMRUNTIME/lua')] = true, - -- [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, - -- }, - -- }, - -- } - -- }, - -- } - -- vim.diagnostic.config { - -- signs = false, - -- update_in_insert = false, - -- } - -- end, - -- } - -- + use { + 'neovim/nvim-lspconfig', + ft = {'rust', 'python', 'c', 'cpp', 'lua'}, + config = function() + local on_attach = function(_, bufnr) + local opts = { noremap = true, silent = true } + local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + map('n', '[', 'lua vim.lsp.buf.declaration()', opts) + map('n', ']', 'lua vim.lsp.buf.definition()', opts) + map('n', 'K', 'lua vim.lsp.buf.hover()', opts) + map('n', 'gk', 'lua vim.lsp.buf.signature_help()', opts) + map('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) + map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) + map('n', 'q', 'Telescope diagnostics', opts) + map('n', 'rn', 'lua vim.lsp.buf.rename()', opts) + end + local lspconfig = require('lspconfig') + -- lspconfig.clangd.setup { on_attach = on_attach } + -- lspconfig.rust_analyzer.setup { on_attach = on_attach } + -- need python-lsp-server and pyls-flake8 + lspconfig.pylsp.setup { on_attach = on_attach } + -- package lua-language-server on ArchLinux + -- lspconfig.sumneko_lua.setup { + -- on_attach = on_attach , + -- settings = { + -- Lua = { + -- runtime = { + -- -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + -- version = 'LuaJIT', + -- -- Setup your lua path + -- path = vim.split(package.path, ';'), + -- }, + -- diagnostics = { + -- -- Get the language server to recognize the `vim` global + -- globals = {'vim'}, + -- }, + -- workspace = { + -- -- Make the server aware of Neovim runtime files + -- library = { + -- [vim.fn.expand('$VIMRUNTIME/lua')] = true, + -- [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + -- }, + -- }, + -- } + -- }, + -- } + vim.diagnostic.config { + signs = false, + update_in_insert = false, + } + end, + } + -- -- rust lsp (needs rust-analyser) -- use { -- 'simrat39/rust-tools.nvim', @@ -168,7 +173,8 @@ return require('packer').startup(function() theme = 'nord', icons_enabled = true, section_separators = '', - component_separators = '' + component_separators = '', + -- globalstatus = true, -- need 0.7 } } end @@ -223,6 +229,8 @@ return require('packer').startup(function() map('n', 'H', 'Telescope help_tags', {}) map('n', ';', 'Telescope commands', {}) map('n', 'p', 'Telescope tags', {}) + map('n', 'g', 'Telescope live_grep', {}) + map('n', 'G', 'Telescope grep_string', {}) end } -- cgit