summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/lua/plugin_settings.lua51
-rw-r--r--.config/nvim/lua/plugins.lua19
2 files changed, 64 insertions, 6 deletions
diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua
index fbd54ad..7ca473f 100644
--- a/.config/nvim/lua/plugin_settings.lua
+++ b/.config/nvim/lua/plugin_settings.lua
@@ -363,7 +363,7 @@ end
363-- bring in cmp_nvim_lsp 363-- bring in cmp_nvim_lsp
364local capabilities = require('cmp_nvim_lsp').default_capabilities() 364local capabilities = require('cmp_nvim_lsp').default_capabilities()
365 365
366local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab', 'clangd', 'ltex' } 366local servers = { 'jedi_language_server', 'texlab', 'clangd', 'ltex' }
367for _, lsp in ipairs(servers) do 367for _, lsp in ipairs(servers) do
368 nvim_lsp[lsp].setup { 368 nvim_lsp[lsp].setup {
369 on_attach = on_attach, 369 on_attach = on_attach,
@@ -377,6 +377,44 @@ nvim_lsp['efm'].setup{
377 capabilities = capabilities 377 capabilities = capabilities
378} 378}
379 379
380-- Configure LSP through rust-tools.nvim plugin.
381-- rust-tools will configure and enable certain LSP features for us.
382-- See https://github.com/simrat39/rust-tools.nvim#configuration
383local rust_opts = {
384 tools = {
385 runnables = {
386 use_telescope = true,
387 },
388 inlay_hints = {
389 auto = true,
390 show_parameter_hints = false,
391 parameter_hints_prefix = "",
392 other_hints_prefix = "",
393 },
394 },
395
396 -- all the opts to send to nvim-lspconfig
397 -- these override the defaults set by rust-tools.nvim
398 -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
399 server = {
400 -- on_attach is a callback called when the language server attachs to the buffer
401 on_attach = on_attach,
402 settings = {
403 -- to enable rust-analyzer settings visit:
404 -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
405 ["rust-analyzer"] = {
406 -- enable clippy on save
407 checkOnSave = {
408 command = "clippy",
409 },
410 },
411 },
412 },
413}
414
415require('rust-tools').setup(rust_opts)
416
417
380-- }}} nvim-lsp -- 418-- }}} nvim-lsp --
381 419
382-- vista {{{ -- 420-- vista {{{ --
@@ -587,3 +625,14 @@ require('leap').setup {
587} 625}
588 626
589-- }}} leap.nvim -- 627-- }}} leap.nvim --
628
629-- fidget.nvim {{{ --
630require("fidget").setup{
631-- https://github.com/j-hui/fidget.nvim/blob/main/doc/fidget.md
632 text = {
633 spinner = "triangle"
634 }
635
636}
637-- }}} fidget.nvim --
638
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index f0aaa3a..1a36ce9 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -5,7 +5,7 @@
5-- │▌ ▘▝▀▘▗▄▘▀▘▘ ▘▀▀ │ 5-- │▌ ▘▝▀▘▗▄▘▀▘▘ ▘▀▀ │
6-- └───────────────────┘ 6-- └───────────────────┘
7 7
8return require('packer').startup(function() 8return require('packer').startup(function(use)
9 -- packer can manage itself 9 -- packer can manage itself
10 use 'wbthomason/packer.nvim' 10 use 'wbthomason/packer.nvim'
11 11
@@ -24,6 +24,11 @@ return require('packer').startup(function()
24 } 24 }
25 -- quickstart lsp config 25 -- quickstart lsp config
26 use 'neovim/nvim-lspconfig' 26 use 'neovim/nvim-lspconfig'
27 -- visualize lsp progress
28 use 'j-hui/fidget.nvim'
29 -- extra rust-analyzer functionality
30 use 'simrat39/rust-tools.nvim'
31
27 32
28 -- annotation generator 33 -- annotation generator
29 use { 34 use {
@@ -42,10 +47,14 @@ return require('packer').startup(function()
42 47
43 -- completion suite 48 -- completion suite
44 use 'hrsh7th/nvim-cmp' 49 use 'hrsh7th/nvim-cmp'
45 use 'hrsh7th/cmp-nvim-lsp' 50 use ({
46 use 'hrsh7th/cmp-buffer' 51 'hrsh7th/cmp-nvim-lsp',
47 use 'hrsh7th/cmp-path' 52 'hrsh7th/cmp-buffer',
48 use 'quangnguyen30192/cmp-nvim-ultisnips' 53 'hrsh7th/cmp-path',
54 'quangnguyen30192/cmp-nvim-ultisnips',
55 after = { 'hrsh7th/nvim-cmp' },
56 requires = { 'hrsh7th/nvim-cmp' },
57 })
49 58
50 -- find, filter, preview, pick 59 -- find, filter, preview, pick
51 use { 60 use {