From bf045753653da12cc2fe978d4df83da9c3211994 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Fri, 14 May 2021 00:22:40 -0500 Subject: [PATCH] chore: update vim config --- .config/nvim/init.vim | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 43294e3..3393240 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -3,10 +3,7 @@ let g:maplocalleader = ',' set termguicolors syntax on - - -set hidden - +" set hidden " Always show the signcolumn if has("patch-8.1.1564") @@ -33,6 +30,7 @@ Plug 'glepnir/dashboard-nvim' Plug 'hoob3rt/lualine.nvim' +Plug 'simrat39/rust-tools.nvim' " One Dark Pro Plug 'joshdick/onedark.vim' @@ -136,6 +134,13 @@ nnoremap r :NvimTreeRefresh nnoremap n :NvimTreeFindFile " NvimTreeOpen and NvimTreeClose are also available if you need them +" Inverse tab in insert mode +inoremap + +" Remove search highlight on double escape +nnoremap :nohlsearch + + " a list of groups can be found at `:help nvim_tree_highlight` highlight NvimTreeFolderIcon guibg=blue @@ -148,7 +153,35 @@ lua << EOF local nvim_lsp = require'lspconfig' nvim_lsp.pyright.setup{} -nvim_lsp.rust_analyzer.setup{} + +local opts = { noremap=true, silent=true } +vim.api.nvim_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) +vim.api.nvim_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) +vim.api.nvim_set_keymap('n', 'd', 'lua vim.lsp.buf.type_definition()', opts) +vim.api.nvim_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) +vim.api.nvim_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) +vim.api.nvim_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + + + + +-- Rust Tools +require'rust-tools'.setup{ + hover_actions = { + -- the border that is used for the hover window + -- see vim.api.nvim_open_win() + border = { + {"╭", "FloatBorder"}, + {"─", "FloatBorder"}, + {"╮", "FloatBorder"}, + {"│", "FloatBorder"}, + {"╯", "FloatBorder"}, + {"─", "FloatBorder"}, + {"╰", "FloatBorder"}, + {"│", "FloatBorder"} + }, + }, +} -- Tree Sitter Config