Add rust tools to nvim

This commit is contained in:
Luke Else 2023-03-15 22:49:53 +00:00
parent c994896bdc
commit 9a49ecbff3
2 changed files with 53 additions and 1 deletions

45
nvim/after/plugin/rt.lua Normal file
View File

@ -0,0 +1,45 @@
local opts = {
tools = { -- rust-tools options
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
reload_workspace_from_cargo_toml = true,
-- These apply to the default RustSetInlayHints command
inlay_hints = {
-- automatically set inlay hints (type hints)
-- default: true
auto = true,
-- Only show inlay hints for the current line
only_current_line = false,
-- whether to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- prefix for parameter hints
-- default: "<-"
parameter_hints_prefix = "<- ",
-- prefix for all the other hints (type, chaining)
-- default: "=>"
other_hints_prefix = "=> ",
-- whether to align to the length of the longest line in the file
max_len_align = false,
-- padding from the left if max_len_align is true
max_len_align_padding = 1,
-- whether to align to the extreme right or not
right_align = false,
-- padding from the right if right_align is true
right_align_padding = 7,
-- The color of the hints
highlight = "Comment",
},
},
}
require('rust-tools').setup(opts)

View File

@ -4,13 +4,15 @@ return require('packer').startup(function(use)
-- Packer can manage itself -- Packer can manage itself
use 'wbthomason/packer.nvim' use 'wbthomason/packer.nvim'
-- Fuzzy Finding
use { use {
'nvim-telescope/telescope.nvim', tag = '0.1.0', 'nvim-telescope/telescope.nvim', tag = '0.1.0',
-- or , branch = '0.1.x', -- or , branch = '0.1.x',
requires = { {'nvim-lua/plenary.nvim'} } requires = { {'nvim-lua/plenary.nvim'} }
} }
use { -- Theme inspired by Atom -- Color Scheme
use {
'navarasu/onedark.nvim', 'navarasu/onedark.nvim',
priority = 1000, priority = 1000,
config = function() config = function()
@ -18,11 +20,13 @@ return require('packer').startup(function(use)
end end
} }
-- Ease of use Plugins
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
use('theprimeagen/harpoon') use('theprimeagen/harpoon')
use('mbbill/undotree') use('mbbill/undotree')
use('tpope/vim-fugitive') use('tpope/vim-fugitive')
-- Bracket Autocompletion
use { use {
'windwp/nvim-autopairs', 'windwp/nvim-autopairs',
config = function() require('nvim-autopairs').setup {} end config = function() require('nvim-autopairs').setup {} end
@ -51,6 +55,9 @@ return require('packer').startup(function(use)
} }
} }
-- Rust tools
use 'simrat39/rust-tools.nvim'
-- Debugger -- Debugger
use 'nvim-lua/plenary.nvim' use 'nvim-lua/plenary.nvim'
use { 'rcarriga/nvim-dap-ui', requires = {'mfussenegger/nvim-dap'} } use { 'rcarriga/nvim-dap-ui', requires = {'mfussenegger/nvim-dap'} }