aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'config/nvim/lua')
-rw-r--r--config/nvim/lua/plugins.lua178
1 files changed, 98 insertions, 80 deletions
diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua
index 71498e9..e820099 100644
--- a/config/nvim/lua/plugins.lua
+++ b/config/nvim/lua/plugins.lua
@@ -8,92 +8,109 @@ return require('packer').startup(function()
use 'tpope/vim-eunuch' -- basic commands on current file (Rename/Remove)
use 'romainl/vim-cool' -- only highlight search matches when searching
- -- nvim lsp configuration
+ -- tags managment
use {
- 'neovim/nvim-lspconfig',
- ft = {'rust', 'python', 'c', 'cpp', 'lua'},
+ 'ludovicchabant/vim-gutentags',
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', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
- map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
- map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
- map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
- map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
- map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
- map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
- map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts)
- map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', 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',
- requires = {'neovim/nvim-lspconfig'},
- ft = {'rust'},
- 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', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
- map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
- map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
- map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
- map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
- map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
- map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
- map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts)
- map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
- end
- require('rust-tools').setup {
- server = {
- on_attach = on_attach,
- }
- }
- vim.diagnostic.config {
- signs = false,
- update_in_insert = false,
+ vim.g.gutentags_ctags_exclude = {
+ 'doc/*',
+ 'docs/*',
+ 'Makefile',
+ '.mypy_cache',
+ '.pytest_cache',
+ '.tox',
+ 'build/*',
+ 'dist/*'
}
end
}
+ -- 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', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
+ -- map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
+ -- map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
+ -- map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
+ -- map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
+ -- map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
+ -- map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
+ -- map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts)
+ -- map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', 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',
+ -- requires = {'neovim/nvim-lspconfig'},
+ -- ft = {'rust'},
+ -- 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', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
+ -- map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
+ -- map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
+ -- map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
+ -- map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
+ -- map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
+ -- map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
+ -- map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts)
+ -- map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
+ -- end
+ -- require('rust-tools').setup {
+ -- server = {
+ -- on_attach = on_attach,
+ -- }
+ -- }
+ -- vim.diagnostic.config {
+ -- signs = false,
+ -- update_in_insert = false,
+ -- }
+ -- end
+ -- }
+
-- comment text objects
use {
'numToStr/Comment.nvim',
@@ -181,6 +198,7 @@ return require('packer').startup(function()
map('n', '<C-p>', '<cmd>Telescope git_files<cr>', {})
map('n', '<leader>H', '<cmd>Telescope help_tags<cr>', {})
map('n', '<leader>;', '<cmd>Telescope commands<cr>', {})
+ map('n', '<leader>p', '<cmd>Telescope tags<cr>', {})
end
}