40 lines
1.2 KiB
VimL
Executable file
40 lines
1.2 KiB
VimL
Executable file
call plug#begin()
|
|
|
|
" List your plugins here
|
|
Plug 'projekt0n/github-nvim-theme'
|
|
Plug 'neovim/nvim-lspconfig'
|
|
|
|
call plug#end()
|
|
|
|
colorscheme github_dark
|
|
highlight Normal guibg=none ctermbg=none
|
|
highlight NonText guibg=none ctermbg=none
|
|
highlight NormalNC guibg=none ctermbg=none
|
|
|
|
lua << EOF
|
|
require('lspconfig').rust_analyzer.setup({
|
|
cmd = { "/usr/bin/rust-analyzer" },
|
|
on_attach = function(client, bufnr)
|
|
-- Enable completion triggered by <C-x><C-o>
|
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
|
|
-- Key mappings
|
|
local opts = { noremap = true, silent = true }
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<Cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
|
|
end,
|
|
|
|
settings = {
|
|
["rust-analyzer"] = {
|
|
cargo = {
|
|
allFeatures = true,
|
|
},
|
|
procMacro = {
|
|
enable = true,
|
|
},
|
|
},
|
|
},
|
|
})
|
|
EOF
|