updated
This commit is contained in:
@@ -6,6 +6,9 @@ vim.o.smartcase = true
|
||||
vim.o.ignorecase = true
|
||||
vim.o.hlsearch = false
|
||||
vim.o.signcolumn = 'yes'
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
vim.o.undofile = true
|
||||
vim.o.undodir = '/home/narl/.cache/nvim-undodir'
|
||||
|
||||
vim.g.mapleader = ','
|
||||
|
||||
@@ -26,10 +29,6 @@ add({
|
||||
source = 'williamboman/mason-lspconfig.nvim'
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'mhartington/formatter.nvim'
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'mfussenegger/nvim-lint'
|
||||
})
|
||||
@@ -62,10 +61,6 @@ add({
|
||||
hooks = { post_checkout = function() vim.cmd('TSUpdate') end },
|
||||
})
|
||||
|
||||
add({
|
||||
source = 'simrat39/rust-tools.nvim'
|
||||
})
|
||||
|
||||
add({
|
||||
-- Completion framework:
|
||||
source = 'hrsh7th/nvim-cmp',
|
||||
@@ -103,8 +98,8 @@ imap_expr('<S-Tab>', [[pumvisible() ? "\<C-p>" : "\<S-Tab>"]])
|
||||
_G.cr_action = function()
|
||||
-- If there is selected item in popup, accept it with <C-y>
|
||||
if vim.fn.complete_info()['selected'] ~= -1 then return '\25' end
|
||||
-- Fall back to plain `<CR>`. You might want to customize according
|
||||
-- to other plugins. For example if 'mini.pairs' is set up, replace
|
||||
-- Fall back to plain `<CR>`. You might want to customize this
|
||||
-- according to other plugins. For example if 'mini.pairs' is set up, replace
|
||||
-- next line with `return MiniPairs.cr()`
|
||||
return '\r'
|
||||
end
|
||||
@@ -161,28 +156,6 @@ vim.lsp.config('rust_analyzer', {
|
||||
['rust-analyzer'] = {},
|
||||
},
|
||||
})
|
||||
-- local mason_registry = require("mason-registry")
|
||||
-- local cmd = {}
|
||||
-- local roslyn_package = mason_registry.get_package("roslyn")
|
||||
-- local rzls_package = mason_registry.get_package("rzls")
|
||||
-- vim.list_extend(cmd, {
|
||||
-- "dotnet",
|
||||
-- vim.fs.joinpath(roslyn_package:get_install_path(), "libexec", "Microsoft.CodeAnalysis.LanguageServer.dll"),
|
||||
-- "--stdio",
|
||||
-- "--logLevel=Information",
|
||||
-- "--extensionLogDirectory=" .. vim.fs.dirname(vim.lsp.get_log_path()),
|
||||
-- })
|
||||
--
|
||||
-- local rzls_path = vim.fs.joinpath(rzls_package:get_install_path(), "libexec")
|
||||
-- table.insert(
|
||||
-- cmd,
|
||||
-- "--razorSourceGenerator=" .. vim.fs.joinpath(rzls_path, "Microsoft.CodeAnalysis.Razor.Compiler.dll")
|
||||
-- )
|
||||
-- table.insert(
|
||||
-- cmd,
|
||||
-- "--razorDesignTimePath="
|
||||
-- .. vim.fs.joinpath(rzls_path, "Targets", "Microsoft.NET.Sdk.Razor.DesignTime.targets")
|
||||
-- )
|
||||
|
||||
require('roslyn').setup({
|
||||
config = {
|
||||
@@ -190,9 +163,6 @@ require('roslyn').setup({
|
||||
handlers = require("rzls.roslyn_handlers"),
|
||||
},
|
||||
})
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = { enable = true },
|
||||
})
|
||||
|
||||
require("catppuccin").setup({
|
||||
flavour = "auto", -- latte, frappe, macchiato, mocha
|
||||
@@ -289,19 +259,16 @@ vim.diagnostic.config({
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
-- setup must be called before loading
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
|
||||
vim.keymap.set('n', '<leader>w', '<cmd>write<cr>', {desc = 'Save file'})
|
||||
vim.keymap.set('n', '<leader>q', '<cmd>quitall<cr>', {desc = 'Exit vim'})
|
||||
|
||||
vim.keymap.set({'n', 'x', 'o'}, 'gy', '"+y', {desc = 'Copy to clipboard'})
|
||||
vim.keymap.set({'n', 'x', 'o'}, 'gp', '"+p', {desc = 'Paste clipboard text'})
|
||||
-- Simplified clipboard mappings
|
||||
-- vim.keymap.set({'n', 'x', 'o'}, '<leader>y', '"+y', {desc = 'Copy to clipboard'})
|
||||
-- vim.keymap.set({'n', 'x'}, '<leader>p', '"+p', {desc = 'Paste from clipboard'})
|
||||
|
||||
vim.keymap.set('n', '<leader>e', '<cmd>lua MiniFiles.open()<cr>', {desc = 'File explorer'})
|
||||
vim.keymap.set('n', '<leader><space>', '<cmd>Pick buffers<cr>', {desc = 'Search open files'})
|
||||
vim.keymap.set('n', '<leader>ff', '<cmd>Pick files<cr>', {desc = 'Search all files'})
|
||||
@@ -313,20 +280,6 @@ vim.keymap.set('n', '<leader>j', '<cmd>wincmd j<cr>')
|
||||
vim.keymap.set('n', '<leader>k', '<cmd>wincmd k<cr>')
|
||||
|
||||
-- Rust
|
||||
--
|
||||
|
||||
local rt = require("rust-tools")
|
||||
|
||||
rt.setup({
|
||||
server = {
|
||||
on_attach = function(_, bufnr)
|
||||
-- Hover actions
|
||||
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||
-- Code action groups
|
||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local cmp = require'cmp'
|
||||
cmp.setup({
|
||||
|
Reference in New Issue
Block a user