diff options
author | Yigit Sever | 2022-12-07 12:06:58 +0300 |
---|---|---|
committer | Yigit Sever | 2022-12-07 12:06:58 +0300 |
commit | dd8de0ecd58263649290cd11e74dbbb7950a4e44 (patch) | |
tree | 7a7b678db879c2e713fa225e4fbf4e1af91d5622 /.config/nvim/lua | |
parent | e5e2af6072dfdf3f79d73edecc31b6efb3e4e395 (diff) | |
download | dotfiles-dd8de0ecd58263649290cd11e74dbbb7950a4e44.tar.gz dotfiles-dd8de0ecd58263649290cd11e74dbbb7950a4e44.tar.bz2 dotfiles-dd8de0ecd58263649290cd11e74dbbb7950a4e44.zip |
feat(nvim): use rust-tools and fidget
new plugins make us go microsoft code
Diffstat (limited to '.config/nvim/lua')
-rw-r--r-- | .config/nvim/lua/plugin_settings.lua | 51 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 19 |
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 |
364 | local capabilities = require('cmp_nvim_lsp').default_capabilities() | 364 | local capabilities = require('cmp_nvim_lsp').default_capabilities() |
365 | 365 | ||
366 | local servers = { 'rust_analyzer', 'jedi_language_server', 'texlab', 'clangd', 'ltex' } | 366 | local servers = { 'jedi_language_server', 'texlab', 'clangd', 'ltex' } |
367 | for _, lsp in ipairs(servers) do | 367 | for _, 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 | ||
383 | local 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 | |||
415 | require('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 {{{ -- | ||
630 | require("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 | ||
8 | return require('packer').startup(function() | 8 | return 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 { |